[llvm-branch-commits] [llvm-branch] r314383 - Merging r314180:
Dylan McKay via llvm-branch-commits
llvm-branch-commits at lists.llvm.org
Thu Sep 28 00:18:32 PDT 2017
Author: dylanmckay
Date: Thu Sep 28 00:18:32 2017
New Revision: 314383
URL: http://llvm.org/viewvc/llvm-project?rev=314383&view=rev
Log:
Merging r314180:
------------------------------------------------------------------------
r314180 | dylanmckay | 2017-09-26 13:51:03 +1300 (Tue, 26 Sep 2017) | 7 lines
[AVR] When lowering shifts into loops, put newly generated MBBs in the same
spot as the original MBB
Discovered in avr-rust/rust#62
https://github.com/avr-rust/rust/issues/62
Patch by Gergo Erdi.
------------------------------------------------------------------------
Modified:
llvm/branches/release_50/lib/Target/AVR/AVRISelLowering.cpp
Modified: llvm/branches/release_50/lib/Target/AVR/AVRISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/branches/release_50/lib/Target/AVR/AVRISelLowering.cpp?rev=314383&r1=314382&r2=314383&view=diff
==============================================================================
--- llvm/branches/release_50/lib/Target/AVR/AVRISelLowering.cpp (original)
+++ llvm/branches/release_50/lib/Target/AVR/AVRISelLowering.cpp Thu Sep 28 00:18:32 2017
@@ -1469,8 +1469,10 @@ MachineBasicBlock *AVRTargetLowering::in
}
const BasicBlock *LLVM_BB = BB->getBasicBlock();
- MachineFunction::iterator I = BB->getParent()->begin();
- ++I;
+
+ MachineFunction::iterator I;
+ for (I = F->begin(); I != F->end() && &(*I) != BB; ++I);
+ if (I != F->end()) ++I;
// Create loop block.
MachineBasicBlock *LoopBB = F->CreateMachineBasicBlock(LLVM_BB);
More information about the llvm-branch-commits
mailing list