expand to multiple basic blocks, in which case fast-isel
needs to informed of which block to use as it resumes
inserting instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57040
91177308-0d34-0410-b5e6-
96231b3b80d8
const TargetLowering &TLI;
public:
+ /// startNewBlock - Set the current block, to which generated
+ /// machine instructions will be appended, and clear the local
+ /// CSE map.
+ ///
+ void startNewBlock(MachineBasicBlock *mbb) {
+ setCurrentBlock(mbb);
+ LocalValueMap.clear();
+ }
+
/// setCurrentBlock - Set the current block, to which generated
/// machine instructions will be appended.
///
void setCurrentBlock(MachineBasicBlock *mbb) {
MBB = mbb;
- LocalValueMap.clear();
}
/// SelectInstruction - Do "fast" instruction selection for the given
CodeGenAndEmitDAG();
SDL->clear();
}
- FastIS->setCurrentBlock(BB);
+ FastIS->startNewBlock(BB);
// Do FastISel on as many instructions as possible.
for (; BI != End; ++BI) {
// Just before the terminator instruction, insert instructions to
}
SelectBasicBlock(LLVMBB, BI, next(BI));
+ // If the instruction was codegen'd with multiple blocks,
+ // inform the FastISel object where to resume inserting.
+ FastIS->setCurrentBlock(BB);
continue;
}