Disable tail duplication in a case that breaks on Olden/tsp
authorChris Lattner <sabre@nondot.org>
Mon, 1 Mar 2004 01:12:13 +0000 (01:12 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 1 Mar 2004 01:12:13 +0000 (01:12 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12021 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Transforms/Scalar/TailDuplication.cpp
lib/Transforms/Utils/LowerInvoke.cpp

index 315b90697cf5202eecb3c443d65768cbc4a57050..a3980b342c2ec16aaa0e2a577d5bb748782cb857 100644 (file)
@@ -135,6 +135,10 @@ bool TailDup::canEliminateUnconditionalBranch(TerminatorInst *TI) {
       Instruction *User = cast<Instruction>(*UI);
       if (User->getParent() != Tail && User->getParent() != BB)
         return false;
+
+      // The 'swap' problem foils the tail duplication rewriting code.
+      if (isa<PHINode>(User) && User->getParent() == Tail)
+        return false;
     }
   return true;
 }
index d42d0533f1c4521bf42f4a8aaa796ba495ebc78e..24033f4876aee67eafb19a5e98f0ab825b2b197a 100644 (file)
@@ -42,7 +42,7 @@ using namespace llvm;
 
 namespace {
   Statistic<> NumLowered("lowerinvoke", "Number of invoke & unwinds replaced");
-  cl::opt<bool> ExpensiveEHSupport("enable-correct-eh-support", 
+  cl::opt<bool> ExpensiveEHSupport("enable-correct-eh-support",
  cl::desc("Make the -lowerinvoke pass insert expensive, but correct, EH code"));
 
   class LowerInvoke : public FunctionPass {