[llvm-commits] [llvm] r55641 - /llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

Dan Gohman gohman at apple.com
Tue Sep 2 13:17:56 PDT 2008


Author: djg
Date: Tue Sep  2 15:17:56 2008
New Revision: 55641

URL: http://llvm.org/viewvc/llvm-project?rev=55641&view=rev
Log:
Ensure that HandlePHINodesInSuccessorBlocks is run for all blocks,
even in FastISel mode in the case where FastISel successfully 
selects all the instructions. 

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

Modified: llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp?rev=55641&r1=55640&r2=55641&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp (original)
+++ llvm/trunk/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp Tue Sep  2 15:17:56 2008
@@ -5536,7 +5536,7 @@
     }
 
   // Handle PHI nodes in successor blocks.
-  if (Begin != End && End == LLVMBB->end())
+  if (End == LLVMBB->end())
     HandlePHINodesInSuccessorBlocks(LLVMBB);
     
   // Make sure the root of the DAG is up-to-date.
@@ -5798,8 +5798,14 @@
       }
     }
 
-    if (Begin != End)
-      SelectBasicBlock(LLVMBB, Begin, End);
+    // Run SelectionDAG instruction selection on the remainder of the block
+    // not handled by FastISel. If FastISel is not run, this is the entire
+    // block. If FastISel is run and happens to handle all of the
+    // LLVM Instructions in the block, [Begin,End) will be an empty range,
+    // but we still need to run this so that
+    // HandlePHINodesInSuccessorBlocks is called and any resulting code
+    // is emitted.
+    SelectBasicBlock(LLVMBB, Begin, End);
 
     FinishBasicBlock();
   }





More information about the llvm-commits mailing list