summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorDavide Italiano <davide@freebsd.org>2017-05-18 21:43:23 +0000
committerDavide Italiano <davide@freebsd.org>2017-05-18 21:43:23 +0000
commita76e5fa111eb751a5e06518bb47718ffca9f475c (patch)
treec0dbc498030cae386c351fafc07158575823ea55 /llvm/lib/Transforms
parenta46f688e8f4d90444e3537f046cac2e7c67120b3 (diff)
downloadbcm5719-llvm-a76e5fa111eb751a5e06518bb47718ffca9f475c.tar.gz
bcm5719-llvm-a76e5fa111eb751a5e06518bb47718ffca9f475c.zip
[NewGVN] Replace predicate info leftovers.
This time with an additional fix, i.e. we remove the dead @llvm.ssa.copy instruction. llvm-svn: 303385
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/NewGVN.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Transforms/Scalar/NewGVN.cpp b/llvm/lib/Transforms/Scalar/NewGVN.cpp
index 0e7572f8d2e..34b93a88718 100644
--- a/llvm/lib/Transforms/Scalar/NewGVN.cpp
+++ b/llvm/lib/Transforms/Scalar/NewGVN.cpp
@@ -3301,6 +3301,10 @@ bool NewGVN::eliminateInstructions(Function &F) {
Value *DominatingLeader = EliminationStack.back();
+ auto *II = dyn_cast<IntrinsicInst>(DominatingLeader);
+ if (II && II->getIntrinsicID() == Intrinsic::ssa_copy)
+ DominatingLeader = II->getOperand(0);
+
// Don't replace our existing users with ourselves.
if (U->get() == DominatingLeader)
continue;
@@ -3321,6 +3325,8 @@ bool NewGVN::eliminateInstructions(Function &F) {
// It's about to be alive again.
if (LeaderUseCount == 0 && isa<Instruction>(DominatingLeader))
ProbablyDead.erase(cast<Instruction>(DominatingLeader));
+ if (LeaderUseCount == 0 && II)
+ ProbablyDead.insert(II);
++LeaderUseCount;
AnythingReplaced = true;
}
OpenPOWER on IntegriCloud