Don't evaluate rend() on every iteration of the loop.

llvm-svn: 231837
diff --git a/llvm/lib/CodeGen/BranchFolding.cpp b/llvm/lib/CodeGen/BranchFolding.cpp
index 05bf31b..a2e9816 100644
--- a/llvm/lib/CodeGen/BranchFolding.cpp
+++ b/llvm/lib/CodeGen/BranchFolding.cpp
@@ -755,11 +755,13 @@
     ++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;