From f1ced259b5617e9c15fcafd47e090c22e2702062 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Tue, 4 May 2010 00:58:39 +0000 Subject: [PATCH] Instruction selection optimizations may have moved the def of a function argument out of the entry block. rdar://7937489 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102993 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index f48fdfc05ca..422cb7aaafc 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -227,7 +227,8 @@ bool SelectionDAGISel::runOnMachineFunction(MachineFunction &mf) { else { MachineInstr *Def = RegInfo->getVRegDef(Reg); MachineBasicBlock::iterator InsertPos = Def; - EntryMBB->insert(llvm::next(InsertPos), MI); + // FIXME: VR def may not be in entry block. + Def->getParent()->insert(llvm::next(InsertPos), MI); } } -- 2.34.1