summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorEugene Leviant <eleviant@accesssoftek.com>2019-03-12 10:10:29 +0000
committerEugene Leviant <eleviant@accesssoftek.com>2019-03-12 10:10:29 +0000
commit1e249caaec399769f21efdc49f002e0e5cade5aa (patch)
treedc33ab4c268a6895215ca878156d230a06c2f984 /llvm/lib/CodeGen
parent9f92b3d081228be2a4133bbf8b850f9aa88470cf (diff)
downloadbcm5719-llvm-1e249caaec399769f21efdc49f002e0e5cade5aa.tar.gz
bcm5719-llvm-1e249caaec399769f21efdc49f002e0e5cade5aa.zip
[CGP] Fix UB when GEP is bound to trivial PHINode
Differential revision: https://reviews.llvm.org/D59140 llvm-svn: 355904
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/CodeGenPrepare.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp
index af1b65253f8..1d61d326372 100644
--- a/llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -6849,6 +6849,7 @@ bool CodeGenPrepare::optimizeInst(Instruction *I, DominatorTree &DT,
// to introduce PHI nodes too late to be cleaned up. If we detect such a
// trivial PHI, go ahead and zap it here.
if (Value *V = SimplifyInstruction(P, {*DL, TLInfo})) {
+ LargeOffsetGEPMap.erase(P);
P->replaceAllUsesWith(V);
P->eraseFromParent();
++NumPHIsElim;
OpenPOWER on IntegriCloud