Chromium Code Reviews| Index: src/IceTargetLoweringX8632.cpp |
| diff --git a/src/IceTargetLoweringX8632.cpp b/src/IceTargetLoweringX8632.cpp |
| index f1b8c25097a151564c54f72d6190b7846d311cde..48058dd5b48a44124c1c8357c7227e666dde83e5 100644 |
| --- a/src/IceTargetLoweringX8632.cpp |
| +++ b/src/IceTargetLoweringX8632.cpp |
| @@ -2576,7 +2576,7 @@ void TargetX8632::lowerUnreachable(const InstUnreachable * /*Inst*/) { |
| Variable *TargetX8632::copyToReg(Operand *Src, int32_t RegNum) { |
| Type Ty = Src->getType(); |
| Variable *Reg = makeReg(Ty, RegNum); |
| - if (isVectorType(Src->getType())) { |
| + if (isVectorType(Ty)) { |
| _movp(Reg, Src); |
| } else { |
| _mov(Reg, Src); |
| @@ -2647,6 +2647,8 @@ Operand *TargetX8632::legalize(Operand *From, LegalMask Allowed, |
| From = Ctx->getConstantZero(From->getType()); |
| } |
| } |
| + // There should be no constants of vector type (other than undef). |
| + assert(!isVectorType(From->getType())); |
| bool NeedsReg = false; |
| if (!(Allowed & Legal_Imm)) |
| // Immediate specifically not allowed |
| @@ -2670,9 +2672,9 @@ Operand *TargetX8632::legalize(Operand *From, LegalMask Allowed, |
| // Mem is not allowed and Var isn't guaranteed a physical |
| // register, or |
| // RegNum is required and Var->getRegNum() doesn't match. |
| - bool WillHaveRegister = |
| + bool AlreadyInRegister = |
|
Jim Stichnoth
2014/07/14 19:44:17
To me, WillHaveRegister captures the situation whe
wala
2014/07/14 20:40:03
How about MustHaveRegister?
For me, WillHaveRegis
|
| (Var->hasReg() || Var->getWeight() == RegWeight::Inf); |
| - if ((!(Allowed & Legal_Mem) && !WillHaveRegister) || |
| + if ((!(Allowed & Legal_Mem) && !AlreadyInRegister) || |
| (RegNum != Variable::NoRegister && RegNum != Var->getRegNum())) { |
| Variable *Reg = copyToReg(From, RegNum); |
| if (RegNum == Variable::NoRegister) { |