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

Unified Diff: src/IceRegAlloc.cpp

Issue 417933004: Subzero: Fix a regalloc eviction bug. (Closed) Base URL: https://gerrit.chromium.org/gerrit/p/native_client/pnacl-subzero.git@master
Patch Set: Add Jan's test 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 | « no previous file | tests_lit/llvm2ice_tests/regalloc_evict_non_overlap.ll » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/IceRegAlloc.cpp
diff --git a/src/IceRegAlloc.cpp b/src/IceRegAlloc.cpp
index fcfe13e40cd1a946342f577a8c4d6c4d8ae23f87..10a02a3ee381dfd44c8574a75e16b735f3c56cf3 100644
--- a/src/IceRegAlloc.cpp
+++ b/src/IceRegAlloc.cpp
@@ -345,7 +345,17 @@ void LinearScan::scan(const llvm::SmallBitVector &RegMaskFull) {
Next = I;
++Next;
LiveRangeWrapper Item = *I;
- if (Item.Var->getRegNumTmp() == MinWeightIndex) {
+ // Note: The Item.overlaps(Cur) clause is not part of the
+ // description of AssignMemLoc() in the original paper. But
+ // there doesn't seem to be any need to evict an inactive
+ // live range that doesn't overlap with the live range
+ // currently being considered. It's especially bad if we
+ // would end up evicting an infinite-weight but
+ // currently-inactive live range. The most common situation
+ // for this would be a scratch register kill set for call
+ // instructions.
+ if (Item.Var->getRegNumTmp() == MinWeightIndex &&
+ Item.overlaps(Cur)) {
if (Func->getContext()->isVerbose(IceV_LinearScan)) {
Str << "Evicting ";
Item.dump(Func);
« no previous file with comments | « no previous file | tests_lit/llvm2ice_tests/regalloc_evict_non_overlap.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698