summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-09-10 06:36:57 +0000
committerChris Lattner <sabre@nondot.org>2006-09-10 06:36:57 +0000
commit2e0dfb0b1639951ab03d79360b69f86cb057ec47 (patch)
tree6b1f36ab8007596c728fe6094c5d808fc1fdcefb /llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
parent9a22d7b60f023a858519ff9e3dd2aa85faa60f1c (diff)
downloadbcm5719-llvm-2e0dfb0b1639951ab03d79360b69f86cb057ec47.tar.gz
bcm5719-llvm-2e0dfb0b1639951ab03d79360b69f86cb057ec47.zip
This code was trying too hard. By eliminating redundant edges in the CFG
due to switch cases going to the same place, it make #pred != #phi entries, breaking live interval analysis. This fixes 458.sjeng on x86 with llc. llvm-svn: 30236
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
index 578f8d2f3da..4c4b0f951d5 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp
@@ -970,24 +970,21 @@ void SelectionDAGLowering::visitSwitch(SwitchInst &I) {
// of the jump table. If the value of the jump table slot corresponds to
// a case statement, push the case's BB onto the vector, otherwise, push
// the default BB.
- std::set<MachineBasicBlock*> UniqueBBs;
std::vector<MachineBasicBlock*> DestBBs;
uint64_t TEI = First;
for (CaseItr ii = Cases.begin(), ee = Cases.end(); ii != ee; ++TEI) {
if (cast<ConstantIntegral>(ii->first)->getRawValue() == TEI) {
DestBBs.push_back(ii->second);
- UniqueBBs.insert(ii->second);
++ii;
} else {
DestBBs.push_back(Default);
- UniqueBBs.insert(Default);
}
}
// Update successor info
- for (std::set<MachineBasicBlock*>::iterator ii = UniqueBBs.begin(),
- ee = UniqueBBs.end(); ii != ee; ++ii)
- JumpTableBB->addSuccessor(*ii);
+ for (std::vector<MachineBasicBlock*>::iterator I = DestBBs.begin(),
+ E = DestBBs.end(); I != E; ++I)
+ JumpTableBB->addSuccessor(*I);
// Create a jump table index for this jump table, or return an existing
// one.
OpenPOWER on IntegriCloud