Subzero: Fix a bug in postLower().
In -O2 mode, postLower() is supposed to iterate over just the
instructions that were most recently added. Instead, it was iterating
all the way to the end of the block, also post-lowering high-level ICE
instructions that hadn't yet been lowered. This was basically
harmless, given that the spec2k asm code is identical after this
patch, but it improves performance.
BUG= none
R=jvoung@chromium.org
Review URL: https://codereview.chromium.org/721333004
diff --git a/src/IceTargetLoweringX8632.cpp b/src/IceTargetLoweringX8632.cpp
index b96023e..937a15b 100644
--- a/src/IceTargetLoweringX8632.cpp
+++ b/src/IceTargetLoweringX8632.cpp
@@ -4299,7 +4299,7 @@
}
// Add the terminator branch instruction to the end.
- Context.setInsertPoint(Context.end());
+ Context.setInsertPoint(Context.getEnd());
_br(Succ);
}
@@ -4509,7 +4509,7 @@
return;
// Find two-address non-SSA instructions where Dest==Src0, and set
// the DestNonKillable flag to keep liveness analysis consistent.
- for (auto Inst = Context.begin(), E = Context.end(); Inst != E; ++Inst) {
+ for (auto Inst = Context.getCur(), E = Context.getNext(); Inst != E; ++Inst) {
if (Inst->isDeleted())
continue;
if (Variable *Dest = Inst->getDest()) {