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 380363002: Subzero: Fix a regalloc bug involving too-aggressive AllowRegisterOverlap. (Closed) Base URL: https://gerrit.chromium.org/gerrit/p/native_client/pnacl-subzero.git@master
Patch Set: Add PrecoloredUnhandled to the output 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
« no previous file with comments | « src/IceRegAlloc.cpp ('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 c2782f6a66d736200958d5526e94bc27ab9369aa..2652e8bfd0e761666e9872378ce626ea72874cfb 100644
--- a/src/IceTargetLoweringX8632.cpp
+++ b/src/IceTargetLoweringX8632.cpp
@@ -2615,9 +2615,12 @@ Operand *TargetX8632::legalize(Operand *From, LegalMask Allowed,
}
if (Variable *Var = llvm::dyn_cast<Variable>(From)) {
// We need a new physical register for the operand if:
- // Mem is not allowed and Var->getRegNum() is unknown, or
+ // Mem is not allowed and Var isn't guaranteed a physical
+ // register, or
// RegNum is required and Var->getRegNum() doesn't match.
- if ((!(Allowed & Legal_Mem) && !Var->hasReg()) ||
+ bool WillHaveRegister =
+ (Var->hasReg() || Var->getWeight() == RegWeight::Inf);
+ if ((!(Allowed & Legal_Mem) && !WillHaveRegister) ||
(RegNum != Variable::NoRegister && RegNum != Var->getRegNum())) {
Variable *Reg = copyToReg(From, RegNum);
if (RegNum == Variable::NoRegister) {
« no previous file with comments | « src/IceRegAlloc.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698