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

Unified Diff: src/IceTargetLoweringX8632.cpp

Issue 385133006: Various improvements related to legalization code. (Closed) Base URL: https://gerrit.chromium.org/gerrit/p/native_client/pnacl-subzero.git@master
Patch Set: Created 6 years, 5 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
« src/IceTargetLoweringX8632.h ('K') | « src/IceTargetLoweringX8632.h ('k') | no next file » | 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 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) {
« src/IceTargetLoweringX8632.h ('K') | « src/IceTargetLoweringX8632.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698