[llvm-commits] [llvm] r107813 - /llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp

Dan Gohman gohman at apple.com
Wed Jul 7 14:18:22 PDT 2010


Author: djg
Date: Wed Jul  7 16:18:22 2010
New Revision: 107813

URL: http://llvm.org/viewvc/llvm-project?rev=107813&view=rev
Log:
Not all custom inserters create new basic blocks. If the inserter
didn't create a new block, don't reset the insert position.

Modified:
    llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp?rev=107813&r1=107812&r2=107813&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/InstrEmitter.cpp Wed Jul  7 16:18:22 2010
@@ -732,8 +732,11 @@
   if (II.usesCustomInsertionHook()) {
     // Insert this instruction into the basic block using a target
     // specific inserter which may returns a new basic block.
-    MBB = TLI->EmitInstrWithCustomInserter(MI, MBB);
-    InsertPos = MBB->end();
+    MachineBasicBlock *NewMBB = TLI->EmitInstrWithCustomInserter(MI, MBB);
+    if (NewMBB != MBB) {
+      MBB = NewMBB;
+      InsertPos = NewMBB->end();
+    }
     return;
   }
   





More information about the llvm-commits mailing list