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

Unified Diff: src/IceTargetLoweringX8632.cpp

Issue 339783002: Add support for undef values in ICE IR. (Closed) Base URL: https://gerrit.chromium.org/gerrit/p/native_client/pnacl-subzero.git@master
Patch Set: Clarify that we expect backends to lower undef to 0 Created 6 years, 6 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/IceOperand.h ('k') | src/llvm2ice.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceTargetLoweringX8632.cpp
diff --git a/src/IceTargetLoweringX8632.cpp b/src/IceTargetLoweringX8632.cpp
index 46a587fe1f139727438baf153e72f350b3945311..e0a33633423d988bccba9a5e5e7318b80261a15f 100644
--- a/src/IceTargetLoweringX8632.cpp
+++ b/src/IceTargetLoweringX8632.cpp
@@ -2152,6 +2152,12 @@ Operand *TargetX8632::legalize(Operand *From, LegalMask Allowed,
return From;
}
if (llvm::isa<Constant>(From)) {
+ if (llvm::isa<ConstantUndef>(From)) {
+ // Lower undefs to zero. Another option is to lower undefs to an
Jim Stichnoth 2014/06/18 13:43:33 Please help future developers. :) Leave the FakeD
+ // uninitialized register; however, using an uninitialized register
+ // results in less predictable code.
+ From = Ctx->getConstantZero(From->getType());
+ }
if (!(Allowed & Legal_Imm)) {
Variable *Reg = makeReg(From->getType(), RegNum);
_mov(Reg, From);
« no previous file with comments | « src/IceOperand.h ('k') | src/llvm2ice.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698