diff options
author | Cameron Zwarich <zwarich@apple.com> | 2011-02-24 10:00:16 +0000 |
---|---|---|
committer | Cameron Zwarich <zwarich@apple.com> | 2011-02-24 10:00:16 +0000 |
commit | 324a24f6aa5d6752c57c39e1e19f00b8c8a4ceec (patch) | |
tree | 2213d3b2a4b860a0bb6fd2322c37a7f5a4bae52f /lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | |
parent | a46cd97818ac6fa336b093adecf2006fb041ca1c (diff) | |
download | external_llvm-324a24f6aa5d6752c57c39e1e19f00b8c8a4ceec.zip external_llvm-324a24f6aa5d6752c57c39e1e19f00b8c8a4ceec.tar.gz external_llvm-324a24f6aa5d6752c57c39e1e19f00b8c8a4ceec.tar.bz2 |
Add a mechanism for invalidating the LiveOutInfo of a PHI, and use it whenever
a block is visited before all of its predecessors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126378 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp index 9d3f5bc..d540063 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp @@ -832,8 +832,25 @@ void SelectionDAGISel::SelectAllBasicBlocks(const Function &Fn) { CheckLineNumbers(LLVMBB); #endif - if (OptLevel != CodeGenOpt::None) + if (OptLevel != CodeGenOpt::None) { + bool AllPredsVisited = true; + for (const_pred_iterator PI = pred_begin(LLVMBB), PE = pred_end(LLVMBB); + PI != PE; ++PI) { + if (!FuncInfo->VisitedBBs.count(*PI)) { + AllPredsVisited = false; + break; + } + } + + if (!AllPredsVisited) { + for (BasicBlock::const_iterator I = LLVMBB->begin(), E = LLVMBB->end(); + I != E && isa<PHINode>(I); ++I) { + FuncInfo->InvalidatePHILiveOutRegInfo(cast<PHINode>(I)); + } + } + FuncInfo->VisitedBBs.insert(LLVMBB); + } FuncInfo->MBB = FuncInfo->MBBMap[LLVMBB]; FuncInfo->InsertPt = FuncInfo->MBB->getFirstNonPHI(); |