Skip to content

Commit f7931de

Browse files
committed
[AVR] When lowering shifts into loops, put newly generated MBBs in the same
spot as the original MBB (avr-rust/rust-legacy-fork#62)
1 parent 2ac14ec commit f7931de

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/Target/AVR/AVRISelLowering.cpp

+4-1
Original file line numberDiff line numberDiff line change
@@ -1471,7 +1471,10 @@ MachineBasicBlock *AVRTargetLowering::insertShift(MachineInstr &MI,
14711471
}
14721472

14731473
const BasicBlock *LLVM_BB = BB->getBasicBlock();
1474-
MachineFunction::iterator I = BB->getParent()->begin();
1474+
1475+
MachineFunction::iterator I;
1476+
for (I = F->begin(); I != F->end() && &(*I) != BB; ++I);
1477+
if (I != F->end()) ++I;
14751478
++I;
14761479

14771480
// Create loop block.

0 commit comments

Comments
 (0)