summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--llvm/lib/Transforms/Scalar/LowerInvoke.cpp2
-rw-r--r--llvm/lib/Transforms/Scalar/TailDuplication.cpp4
2 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/LowerInvoke.cpp b/llvm/lib/Transforms/Scalar/LowerInvoke.cpp
index d42d0533f1c..24033f4876a 100644
--- a/llvm/lib/Transforms/Scalar/LowerInvoke.cpp
+++ b/llvm/lib/Transforms/Scalar/LowerInvoke.cpp
@@ -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 {
diff --git a/llvm/lib/Transforms/Scalar/TailDuplication.cpp b/llvm/lib/Transforms/Scalar/TailDuplication.cpp
index 315b90697cf..a3980b342c2 100644
--- a/llvm/lib/Transforms/Scalar/TailDuplication.cpp
+++ b/llvm/lib/Transforms/Scalar/TailDuplication.cpp
@@ -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;
}
OpenPOWER on IntegriCloud