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

Unified Diff: src/IceTargetLoweringX8632.cpp

Issue 969703002: Subzero: Fix a register allocation issue for "advanced phi lowering". (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: Created 5 years, 10 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 | « no previous file | tests_lit/llvm2ice_tests/phi.ll » ('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 0576add554dd4fa18a98b822d0352596e5210586..c3189a0d2a9cbd4f5a3434c10c5519e1700cc5d8 100644
--- a/src/IceTargetLoweringX8632.cpp
+++ b/src/IceTargetLoweringX8632.cpp
@@ -1693,7 +1693,8 @@ void TargetX8632::lowerAssign(const InstAssign *Inst) {
// If Dest is in memory, then RI is either a physical register or
// an immediate, otherwise RI can be anything.
jvoung (off chromium) 2015/03/02 19:27:56 The "can be anything" comment seems to go with Leg
Jim Stichnoth 2015/03/02 23:33:53 Done.
Operand *RI =
- legalize(Src0, Dest->hasReg() ? Legal_All : Legal_Reg | Legal_Imm);
+ legalize(Src0, Dest->hasReg() ? Legal_Reg : Legal_Reg | Legal_Imm,
+ Dest->getRegNum());
if (isVectorType(Dest->getType()))
_movp(Dest, RI);
else
@@ -4156,6 +4157,12 @@ namespace {
bool isMemoryOperand(const Operand *Opnd) {
if (const auto Var = llvm::dyn_cast<Variable>(Opnd))
return !Var->hasReg();
+ // We treat vector undef values the same as a memory operand,
+ // because they do in fact need a register to materialize the vector
+ // of zeroes into.
+ if (llvm::isa<ConstantUndef>(Opnd))
+ return isScalarFloatingType(Opnd->getType()) ||
+ isVectorType(Opnd->getType());
if (llvm::isa<Constant>(Opnd))
return isScalarFloatingType(Opnd->getType());
return true;
« no previous file with comments | « no previous file | tests_lit/llvm2ice_tests/phi.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698