summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/BranchFolding.cpp
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@codeaurora.org>2015-03-10 20:29:59 +0000
committerChad Rosier <mcrosier@codeaurora.org>2015-03-10 20:29:59 +0000
commit99fb8d17ec08dbd3b465e0ef431a5ad9a2bbc84a (patch)
tree6b80ef937216bdd564c6e2c83a4141c15772af3d /llvm/lib/CodeGen/BranchFolding.cpp
parentd388e930ce6d8aa1b47e0ce40017f6542887349e (diff)
downloadbcm5719-llvm-99fb8d17ec08dbd3b465e0ef431a5ad9a2bbc84a.tar.gz
bcm5719-llvm-99fb8d17ec08dbd3b465e0ef431a5ad9a2bbc84a.zip
Don't evaluate rend() on every iteration of the loop.
llvm-svn: 231837
Diffstat (limited to 'llvm/lib/CodeGen/BranchFolding.cpp')
-rw-r--r--llvm/lib/CodeGen/BranchFolding.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/BranchFolding.cpp b/llvm/lib/CodeGen/BranchFolding.cpp
index 05bf31b3ba0..a2e981680c6 100644
--- a/llvm/lib/CodeGen/BranchFolding.cpp
+++ b/llvm/lib/CodeGen/BranchFolding.cpp
@@ -755,11 +755,13 @@ removeMMOsFromMemoryOperations(MachineBasicBlock::iterator MBBIStartPos,
++CommonTailLen;
MachineBasicBlock::reverse_iterator MBBI = MBB->rbegin();
+ MachineBasicBlock::reverse_iterator MBBIE = MBB->rend();
MachineBasicBlock::reverse_iterator MBBICommon = MBBCommon.rbegin();
MachineBasicBlock::reverse_iterator MBBIECommon = MBBCommon.rend();
while (CommonTailLen--) {
- assert(MBBI != MBB->rend() && "Reached BB end within common tail length!");
+ assert(MBBI != MBBIE && "Reached BB end within common tail length!");
+ (void)MBBIE;
if (MBBI->isDebugValue()) {
++MBBI;
OpenPOWER on IntegriCloud