summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2014-02-23 13:34:21 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2014-02-23 13:34:21 +0000
commitc24d19c3952184d463ce10e5252013eb3dc207d5 (patch)
tree5bc1147b3300ff1de2abda57dfb67620f0429679
parentd464ec7d52d450275662a0611b720b1cdc673fc5 (diff)
downloadbcm5719-llvm-c24d19c3952184d463ce10e5252013eb3dc207d5.tar.gz
bcm5719-llvm-c24d19c3952184d463ce10e5252013eb3dc207d5.zip
LocalStackSlotAllocation: Turn one-iteration loop into if.
No functionality change. llvm-svn: 201974
-rw-r--r--llvm/lib/CodeGen/LocalStackSlotAllocation.cpp17
1 files changed, 5 insertions, 12 deletions
diff --git a/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp b/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp
index 08f0cc2f011..6cf164b9e4f 100644
--- a/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp
+++ b/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp
@@ -377,18 +377,11 @@ bool LocalStackSlotPass::insertFrameReferenceRegisters(MachineFunction &Fn) {
// processed all FrameRefs before this one, just check whether or not
// the next FrameRef will be able to reuse this new register. If not,
// then don't bother creating it.
- bool CanReuse = false;
- for (int refn = ref + 1; refn < e; ++refn) {
- FrameRef &FRN = FrameReferenceInsns[refn];
- MachineBasicBlock::iterator J = FRN.getMachineInstr();
- MachineInstr *MIN = J;
-
- CanReuse = lookupCandidateBaseReg(BaseOffset, FrameSizeAdjust,
- FRN.getLocalOffset(), MIN, TRI);
- break;
- }
-
- if (!CanReuse) {
+ if (ref + 1 >= e ||
+ !lookupCandidateBaseReg(
+ BaseOffset, FrameSizeAdjust,
+ FrameReferenceInsns[ref + 1].getLocalOffset(),
+ FrameReferenceInsns[ref + 1].getMachineInstr(), TRI)) {
BaseOffset = PrevBaseOffset;
continue;
}
OpenPOWER on IntegriCloud