Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Unified Diff: src/IceInst.cpp

Issue 1127963004: Subzero ARM: lowerArguments (GPR), basic legalize(), and lowerRet(i32, i64). (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: fix warnings, etc Created 5 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/IceInst.h ('k') | src/IceInstARM32.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceInst.cpp
diff --git a/src/IceInst.cpp b/src/IceInst.cpp
index b06f6dfa12449039c441670c016b7641ed0672ba..0e6be75ffd8b6a3dd34aa2427c5eada0ff106461 100644
--- a/src/IceInst.cpp
+++ b/src/IceInst.cpp
@@ -873,4 +873,20 @@ void InstTarget::dump(const Cfg *Func) const {
Inst::dump(Func);
}
+bool checkForRedundantAssign(const Variable *Dest, const Operand *Source) {
+ const auto SrcVar = llvm::dyn_cast<const Variable>(Source);
+ if (!SrcVar)
+ return false;
+ if (Dest->hasReg() && Dest->getRegNum() == SrcVar->getRegNum()) {
+ // TODO: On x86-64, instructions like "mov eax, eax" are used to
+ // clear the upper 32 bits of rax. We need to recognize and
+ // preserve these.
+ return true;
+ }
+ if (!Dest->hasReg() && !SrcVar->hasReg() &&
+ Dest->getStackOffset() == SrcVar->getStackOffset())
+ return true;
+ return false;
+}
+
} // end of namespace Ice
« no previous file with comments | « src/IceInst.h ('k') | src/IceInstARM32.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698