diff options
author | Dan Gohman <gohman@apple.com> | 2008-09-02 20:17:56 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2008-09-02 20:17:56 +0000 |
commit | 115267fdc663b21d6240bee94e7ffe423d4f52d1 (patch) | |
tree | c91f63dc9cd9f2b6e367d8d6f0691b47e6bb7dd3 /llvm/lib/CodeGen | |
parent | 123f025b295f59f8382cf9ecce299c52df3640e4 (diff) | |
download | bcm5719-llvm-115267fdc663b21d6240bee94e7ffe423d4f52d1.tar.gz bcm5719-llvm-115267fdc663b21d6240bee94e7ffe423d4f52d1.zip |
Ensure that HandlePHINodesInSuccessorBlocks is run for all blocks,
even in FastISel mode in the case where FastISel successfully
selects all the instructions.
llvm-svn: 55641
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 9b982f4fb4a..f0afdae866b 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -5536,7 +5536,7 @@ void SelectionDAGISel::SelectBasicBlock(BasicBlock *LLVMBB, } // 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 @@ void SelectionDAGISel::SelectAllBasicBlocks(Function &Fn, MachineFunction &MF) { } } - 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(); } |