[llvm] r207665 - IR: Alloca clones should remember inalloca state

David Majnemer david.majnemer at gmail.com
Wed Apr 30 09:12:22 PDT 2014


Author: majnemer
Date: Wed Apr 30 11:12:21 2014
New Revision: 207665

URL: http://llvm.org/viewvc/llvm-project?rev=207665&view=rev
Log:
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.

Modified:
    llvm/trunk/lib/IR/Instructions.cpp

Modified: llvm/trunk/lib/IR/Instructions.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/Instructions.cpp?rev=207665&r1=207664&r2=207665&view=diff
==============================================================================
--- llvm/trunk/lib/IR/Instructions.cpp (original)
+++ llvm/trunk/lib/IR/Instructions.cpp Wed Apr 30 11:12:21 2014
@@ -3587,9 +3587,10 @@ InsertValueInst *InsertValueInst::clone_
 }
 
 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 {





More information about the llvm-commits mailing list