summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/CodeGenPrepare.cpp
diff options
context:
space:
mode:
authorSimon Dardis <simon.dardis@mips.com>2017-11-13 16:41:17 +0000
committerSimon Dardis <simon.dardis@mips.com>2017-11-13 16:41:17 +0000
commit8222160eb35d93285f9f1b3bddfa1be2452aca07 (patch)
tree0894aa13791c0697a5d320c73eb1600fdd1c2440 /llvm/lib/CodeGen/CodeGenPrepare.cpp
parent5f19b9078349b12459a30e6e287d36de54a1329e (diff)
downloadbcm5719-llvm-8222160eb35d93285f9f1b3bddfa1be2452aca07.tar.gz
bcm5719-llvm-8222160eb35d93285f9f1b3bddfa1be2452aca07.zip
Revert "[CodeGenPrepare] Check that erased sunken address are not reused"
This reverts commit r318032. The test broke some sanitizer bots. llvm-svn: 318049
Diffstat (limited to 'llvm/lib/CodeGen/CodeGenPrepare.cpp')
-rw-r--r--llvm/lib/CodeGen/CodeGenPrepare.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/llvm/lib/CodeGen/CodeGenPrepare.cpp b/llvm/lib/CodeGen/CodeGenPrepare.cpp
index 96b7704a765..d6633a508f5 100644
--- a/llvm/lib/CodeGen/CodeGenPrepare.cpp
+++ b/llvm/lib/CodeGen/CodeGenPrepare.cpp
@@ -4358,12 +4358,7 @@ bool CodeGenPrepare::optimizeMemoryInst(Instruction *MemoryInst, Value *Addr,
// Now that we determined the addressing expression we want to use and know
// that we have to sink it into this block. Check to see if we have already
// done this for some other load/store instr in this block. If so, reuse the
- // computation. Before attempting reuse, check if the address is valid as it
- // may have been erased.
- auto I = SunkAddrs.find(Addr);
- if (I != SunkAddrs.end() && I->second && I->second->user_empty())
- SunkAddrs.erase(I);
-
+ // computation.
Value *&SunkAddr = SunkAddrs[Addr];
if (SunkAddr) {
DEBUG(dbgs() << "CGP: Reusing nonlocal addrmode: " << AddrMode << " for "
OpenPOWER on IntegriCloud