Revert r82214. It broke 403.gcc on x86_64 / Darwin.
authorEvan Cheng <evan.cheng@apple.com>
Fri, 18 Sep 2009 08:26:06 +0000 (08:26 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Fri, 18 Sep 2009 08:26:06 +0000 (08:26 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82215 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAGISel.cpp

index e2fab1b1b80046624c91da0e013426310a939f0f..19ea647311519d464d4a99407209a16d2fa35475 100644 (file)
@@ -982,7 +982,6 @@ SelectionDAGISel::FinishBasicBlock() {
   
   // If we generated any switch lowering information, build and codegen any
   // additional DAGs necessary.
-  SmallSet<unsigned, 4> Processed;
   for (unsigned i = 0, e = SDL->SwitchCases.size(); i != e; ++i) {
     // Set the current basic block to the mbb we wish to insert the code into
     BB = SDL->SwitchCases[i].ThisBB;
@@ -1005,18 +1004,12 @@ SelectionDAGISel::FinishBasicBlock() {
         for (unsigned pn = 0; ; ++pn) {
           assert(pn != SDL->PHINodesToUpdate.size() &&
                  "Didn't find PHI entry!");
-          if (SDL->PHINodesToUpdate[pn].first != Phi)
-            continue;
-          if (!Processed.insert(pn))
-            // Already processed, done. We can't have the value from more than
-            // one edges.
+          if (SDL->PHINodesToUpdate[pn].first == Phi) {
+            Phi->addOperand(MachineOperand::CreateReg(SDL->PHINodesToUpdate[pn].
+                                                      second, false));
+            Phi->addOperand(MachineOperand::CreateMBB(SDL->SwitchCases[i].ThisBB));
             break;
-          Phi->addOperand(MachineOperand::CreateReg(SDL->PHINodesToUpdate[pn].
-                                                    second, false));
-          assert(BB->isPred(SDL->SwitchCases[i].ThisBB) &&
-                 "phi value cannot come from a bb that is not a predecessor!");
-          Phi->addOperand(MachineOperand::CreateMBB(SDL->SwitchCases[i].ThisBB));
-          break;
+          }
         }
       }