Index: src/IceTargetLoweringX8632.cpp |
diff --git a/src/IceTargetLoweringX8632.cpp b/src/IceTargetLoweringX8632.cpp |
index 46a587fe1f139727438baf153e72f350b3945311..e0c020c305c5e50f9c0fcf14024bc9aa1cee9a00 100644 |
--- a/src/IceTargetLoweringX8632.cpp |
+++ b/src/IceTargetLoweringX8632.cpp |
@@ -2152,7 +2152,13 @@ Operand *TargetX8632::legalize(Operand *From, LegalMask Allowed, |
return From; |
} |
if (llvm::isa<Constant>(From)) { |
- if (!(Allowed & Legal_Imm)) { |
+ if (llvm::isa<ConstantUndef>(From)) { |
+ // Undef values are lowered to a register. |
Jim Stichnoth
2014/06/17 06:28:07
Maybe change "lowered to a register" to "lowered t
wala
2014/06/17 20:38:02
I agree that the comment needs to be clarified tha
|
+ Variable *Reg = makeReg(From->getType(), RegNum); |
+ // Insert a FakeDef so that the live range of Reg is not overestimated. |
+ Context.insert(InstFakeDef::create(Func, Reg)); |
+ From = Reg; |
+ } else if (!(Allowed & Legal_Imm)) { |
Variable *Reg = makeReg(From->getType(), RegNum); |
_mov(Reg, From); |
From = Reg; |