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 | d2ff647964ed242e67ac12f7d21a58c864309d95 (patch) | |
tree | f3d624b7415f0a61dad613c3a39b14d81d4c09c3 /lib | |
parent | 21dbb99964f0568d2d3d3fc7e2bd5967e7577bd1 (diff) | |
download | llvm-d2ff647964ed242e67ac12f7d21a58c864309d95.tar.gz llvm-d2ff647964ed242e67ac12f7d21a58c864309d95.tar.bz2 llvm-d2ff647964ed242e67ac12f7d21a58c864309d95.tar.xz |
Ensure that HandlePHINodesInSuccessorBlocks is run for all blocks,
even in FastISel mode in the case where FastISel successfully
selects all the instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55641 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 9b982f4fb4..f0afdae866 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/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(); } |