summaryrefslogtreecommitdiffstats
path: root/llvm/lib/IR/Instructions.cpp
diff options
context:
space:
mode:
authorDavid Majnemer <david.majnemer@gmail.com>2014-04-30 16:12:21 +0000
committerDavid Majnemer <david.majnemer@gmail.com>2014-04-30 16:12:21 +0000
commit6b3244c46033ab2060daf569634ad22d4c4fd62b (patch)
tree54cfe861c849519b2e65fd7ccc7cdcf243d8afe9 /llvm/lib/IR/Instructions.cpp
parent56df6ff2c5c291eb67305dc36280b27e3b7f65de (diff)
downloadbcm5719-llvm-6b3244c46033ab2060daf569634ad22d4c4fd62b.tar.gz
bcm5719-llvm-6b3244c46033ab2060daf569634ad22d4c4fd62b.zip
IR: Alloca clones should remember inalloca state
Pretty straightforward, we weren't propagating whether or not an AllocaInst had 'inalloca' marked on it when it came time to clone it. The inliner exposed this bug. A reduced testcase is forthcoming. llvm-svn: 207665
Diffstat (limited to 'llvm/lib/IR/Instructions.cpp')
-rw-r--r--llvm/lib/IR/Instructions.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/llvm/lib/IR/Instructions.cpp b/llvm/lib/IR/Instructions.cpp
index 5b93c5323ab..e8bcddbd992 100644
--- a/llvm/lib/IR/Instructions.cpp
+++ b/llvm/lib/IR/Instructions.cpp
@@ -3587,9 +3587,10 @@ InsertValueInst *InsertValueInst::clone_impl() const {
}
AllocaInst *AllocaInst::clone_impl() const {
- return new AllocaInst(getAllocatedType(),
- (Value*)getOperand(0),
- getAlignment());
+ AllocaInst *Result = new AllocaInst(getAllocatedType(),
+ (Value *)getOperand(0), getAlignment());
+ Result->setUsedWithInAlloca(isUsedWithInAlloca());
+ return Result;
}
LoadInst *LoadInst::clone_impl() const {
OpenPOWER on IntegriCloud