summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms
diff options
context:
space:
mode:
authorDevang Patel <dpatel@apple.com>2007-06-01 22:15:31 +0000
committerDevang Patel <dpatel@apple.com>2007-06-01 22:15:31 +0000
commitac54a62fd2e2c9bc430eb9865f2c5676955a4495 (patch)
tree00ab6ed04e9bb8e516c77b18f0fc0bf8f27c9154 /llvm/lib/Transforms
parent48e93f2ce9fac9c7d30cf06a7705127d94d5e639 (diff)
downloadbcm5719-llvm-ac54a62fd2e2c9bc430eb9865f2c5676955a4495.tar.gz
bcm5719-llvm-ac54a62fd2e2c9bc430eb9865f2c5676955a4495.zip
Insert new instructions in AliasSet.
llvm-svn: 37390
Diffstat (limited to 'llvm/lib/Transforms')
-rw-r--r--llvm/lib/Transforms/Scalar/LICM.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/llvm/lib/Transforms/Scalar/LICM.cpp b/llvm/lib/Transforms/Scalar/LICM.cpp
index 087325c6906..3b16814fe86 100644
--- a/llvm/lib/Transforms/Scalar/LICM.cpp
+++ b/llvm/lib/Transforms/Scalar/LICM.cpp
@@ -476,9 +476,11 @@ void LICM::sink(Instruction &I) {
// Firstly, we create a stack object to hold the value...
AllocaInst *AI = 0;
- if (I.getType() != Type::VoidTy)
+ if (I.getType() != Type::VoidTy) {
AI = new AllocaInst(I.getType(), 0, I.getName(),
I.getParent()->getParent()->getEntryBlock().begin());
+ CurAST->add(AI);
+ }
// Secondly, insert load instructions for each use of the instruction
// outside of the loop.
@@ -499,6 +501,7 @@ void LICM::sink(Instruction &I) {
// Insert a new load instruction right before the terminator in
// the predecessor block.
PredVal = new LoadInst(AI, "", Pred->getTerminator());
+ CurAST->add(cast<LoadInst>(PredVal));
}
UPN->setIncomingValue(i, PredVal);
@@ -507,6 +510,7 @@ void LICM::sink(Instruction &I) {
} else {
LoadInst *L = new LoadInst(AI, "", U);
U->replaceUsesOfWith(&I, L);
+ CurAST->add(L);
}
}
OpenPOWER on IntegriCloud