mirror of
https://github.com/RPCS3/llvm.git
synced 2025-02-22 11:42:42 +00:00
Move FastISel's HandlePHINodesInSuccessorBlocks call down into FastISel
itself too. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102176 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
27ef9976c2
commit
e8c92dd439
@ -107,14 +107,6 @@ public:
|
|||||||
/// index value.
|
/// index value.
|
||||||
unsigned getRegForGEPIndex(const Value *V);
|
unsigned getRegForGEPIndex(const Value *V);
|
||||||
|
|
||||||
/// HandlePHINodesInSuccessorBlocks - Handle PHI nodes in successor blocks.
|
|
||||||
/// Emit code to ensure constants are copied into registers when needed.
|
|
||||||
/// Remember the virtual registers that need to be added to the Machine PHI
|
|
||||||
/// nodes as input. We cannot just directly add them, because expansion
|
|
||||||
/// might result in multiple MBB's for one BB. As such, the start of the
|
|
||||||
/// BB might correspond to a different MBB than the end.
|
|
||||||
bool HandlePHINodesInSuccessorBlocks(const BasicBlock *LLVMBB);
|
|
||||||
|
|
||||||
virtual ~FastISel();
|
virtual ~FastISel();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
@ -311,6 +303,14 @@ private:
|
|||||||
bool SelectBitCast(const User *I);
|
bool SelectBitCast(const User *I);
|
||||||
|
|
||||||
bool SelectCast(const User *I, unsigned Opcode);
|
bool SelectCast(const User *I, unsigned Opcode);
|
||||||
|
|
||||||
|
/// HandlePHINodesInSuccessorBlocks - Handle PHI nodes in successor blocks.
|
||||||
|
/// Emit code to ensure constants are copied into registers when needed.
|
||||||
|
/// Remember the virtual registers that need to be added to the Machine PHI
|
||||||
|
/// nodes as input. We cannot just directly add them, because expansion
|
||||||
|
/// might result in multiple MBB's for one BB. As such, the start of the
|
||||||
|
/// BB might correspond to a different MBB than the end.
|
||||||
|
bool HandlePHINodesInSuccessorBlocks(const BasicBlock *LLVMBB);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -553,6 +553,12 @@ bool FastISel::SelectBitCast(const User *I) {
|
|||||||
|
|
||||||
bool
|
bool
|
||||||
FastISel::SelectInstruction(const Instruction *I) {
|
FastISel::SelectInstruction(const Instruction *I) {
|
||||||
|
// Just before the terminator instruction, insert instructions to
|
||||||
|
// feed PHI nodes in successor blocks.
|
||||||
|
if (isa<TerminatorInst>(I))
|
||||||
|
if (!HandlePHINodesInSuccessorBlocks(I->getParent()))
|
||||||
|
return false;
|
||||||
|
|
||||||
DL = I->getDebugLoc();
|
DL = I->getDebugLoc();
|
||||||
|
|
||||||
// First, try doing target-independent selection.
|
// First, try doing target-independent selection.
|
||||||
|
@ -751,20 +751,6 @@ void SelectionDAGISel::SelectAllBasicBlocks(const Function &Fn) {
|
|||||||
FastIS->startNewBlock(BB);
|
FastIS->startNewBlock(BB);
|
||||||
// Do FastISel on as many instructions as possible.
|
// Do FastISel on as many instructions as possible.
|
||||||
for (; BI != End; ++BI) {
|
for (; BI != End; ++BI) {
|
||||||
// Just before the terminator instruction, insert instructions to
|
|
||||||
// feed PHI nodes in successor blocks.
|
|
||||||
if (isa<TerminatorInst>(BI))
|
|
||||||
if (!FastIS->HandlePHINodesInSuccessorBlocks(LLVMBB)) {
|
|
||||||
++NumFastIselFailures;
|
|
||||||
if (EnableFastISelVerbose || EnableFastISelAbort) {
|
|
||||||
dbgs() << "FastISel miss: ";
|
|
||||||
BI->dump();
|
|
||||||
}
|
|
||||||
assert(!EnableFastISelAbort &&
|
|
||||||
"FastISel didn't handle a PHI in a successor");
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Try to select the instruction with FastISel.
|
// Try to select the instruction with FastISel.
|
||||||
if (FastIS->SelectInstruction(BI))
|
if (FastIS->SelectInstruction(BI))
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user