diff options
| author | Dan Gohman <gohman@apple.com> | 2010-07-06 20:24:04 +0000 |
|---|---|---|
| committer | Dan Gohman <gohman@apple.com> | 2010-07-06 20:24:04 +0000 |
| commit | 34396292396879083b196c2f929d6903104379f8 (patch) | |
| tree | 37658fcecc83c8be1bb329b5795e93fac4b9cf0a /llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp | |
| parent | c96c37f6fdf64faa8244e5692f30a059b62998be (diff) | |
| download | bcm5719-llvm-34396292396879083b196c2f929d6903104379f8.tar.gz bcm5719-llvm-34396292396879083b196c2f929d6903104379f8.zip | |
Reapply r107655 with fixes; insert the pseudo instruction into
the block before calling the expansion hook. And don't
put EFLAGS in a mbb's live-in list twice.
llvm-svn: 107691
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp')
| -rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp b/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp index a6f63c746b7..935679a1133 100644 --- a/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/InstrEmitter.cpp @@ -723,6 +723,11 @@ EmitMachineNode(SDNode *Node, bool IsClone, bool IsCloned, MI->setMemRefs(cast<MachineSDNode>(Node)->memoperands_begin(), cast<MachineSDNode>(Node)->memoperands_end()); + // Insert the instruction into position in the block. This needs to + // happen before any custom inserter hook is called so that the + // hook knows where in the block to insert the replacement code. + MBB->insert(InsertPos, MI); + if (II.usesCustomInsertionHook()) { // Insert this instruction into the basic block using a target // specific inserter which may returns a new basic block. @@ -731,8 +736,6 @@ EmitMachineNode(SDNode *Node, bool IsClone, bool IsCloned, return; } - MBB->insert(InsertPos, MI); - // Additional results must be an physical register def. if (HasPhysRegOuts) { for (unsigned i = II.getNumDefs(); i < NumResults; ++i) { |

