InstCombine: don't drop 'inalloca' in PromoteCastOfAllocation (PR19569)
[oota-llvm.git] / lib / Transforms / InstCombine / InstCombineCasts.cpp
index de8b94d6c2e9c133872ce3df056a16138982a3a3..70b0a8343f6c3cbbd0969cd1ec3be7a546d9b1df 100644 (file)
@@ -143,6 +143,7 @@ Instruction *InstCombiner::PromoteCastOfAllocation(BitCastInst &CI,
   AllocaInst *New = AllocaBuilder.CreateAlloca(CastElTy, Amt);
   New->setAlignment(AI.getAlignment());
   New->takeName(&AI);
+  New->setUsedWithInAlloca(AI.isUsedWithInAlloca());
 
   // If the allocation has multiple real uses, insert a cast and change all
   // things that used it to use the new cast.  This will also hack on CI, but it