aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Transforms/Scalar/LICM.cpp
diff options
context:
space:
mode:
authorDuncan Sands <baldrick@free.fr>2010-09-02 08:14:03 +0000
committerDuncan Sands <baldrick@free.fr>2010-09-02 08:14:03 +0000
commitfc6e29d4ab52b7d3efd83846ed495a9ca7e51e49 (patch)
tree2c7b45b801ac9fe4f25bc94ce67befd03d605726 /lib/Transforms/Scalar/LICM.cpp
parent4315093eb76b8806fed72273f0909d68645f12d3 (diff)
downloadexternal_llvm-fc6e29d4ab52b7d3efd83846ed495a9ca7e51e49.zip
external_llvm-fc6e29d4ab52b7d3efd83846ed495a9ca7e51e49.tar.gz
external_llvm-fc6e29d4ab52b7d3efd83846ed495a9ca7e51e49.tar.bz2
Reapply commit 112699, speculatively reverted by echristo, since
I'm sure it is harmless. Original commit message: If PrototypeValue is erased in the middle of using the SSAUpdator then the SSAUpdator may access freed memory. Instead, simply pass in the type and name explicitly, which is all that was used anyway. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112810 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms/Scalar/LICM.cpp')
-rw-r--r--lib/Transforms/Scalar/LICM.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/Transforms/Scalar/LICM.cpp b/lib/Transforms/Scalar/LICM.cpp
index fa71ab5..85ed358 100644
--- a/lib/Transforms/Scalar/LICM.cpp
+++ b/lib/Transforms/Scalar/LICM.cpp
@@ -526,7 +526,7 @@ void LICM::sink(Instruction &I) {
SSAUpdater SSA(&NewPHIs);
if (!I.use_empty())
- SSA.Initialize(&I);
+ SSA.Initialize(I.getType(), I.getName());
// Insert a copy of the instruction in each exit block of the loop that is
// dominated by the instruction. Each exit block is known to only be in the
@@ -728,7 +728,7 @@ void LICM::PromoteAliasSet(AliasSet &AS) {
SomeValue = LoopUses[0];
else
SomeValue = cast<StoreInst>(LoopUses[0])->getOperand(0);
- SSA.Initialize(SomeValue);
+ SSA.Initialize(SomeValue->getType(), SomeValue->getName());
// First step: bucket up uses of the pointers by the block they occur in.
// This is important because we have to handle multiple defs/uses in a block