diff options
Diffstat (limited to 'llvm/lib/CodeGen/SafeStack.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SafeStack.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/SafeStack.cpp b/llvm/lib/CodeGen/SafeStack.cpp index f0667f7..477ff7a 100644 --- a/llvm/lib/CodeGen/SafeStack.cpp +++ b/llvm/lib/CodeGen/SafeStack.cpp @@ -192,7 +192,7 @@ public: SafeStack(Function &F, const TargetLoweringBase &TL, const DataLayout &DL, DomTreeUpdater *DTU, ScalarEvolution &SE) : F(F), TL(TL), DL(DL), DTU(DTU), SE(SE), - StackPtrTy(PointerType::getUnqual(F.getContext())), + StackPtrTy(DL.getAllocaPtrType(F.getContext())), IntPtrTy(DL.getIntPtrType(F.getContext())), Int32Ty(Type::getInt32Ty(F.getContext())) {} @@ -616,7 +616,8 @@ Value *SafeStack::moveStaticAllocasToUnsafeStack( IRBuilder<> IRBUser(InsertBefore); Value *Off = IRBUser.CreatePtrAdd(BasePointer, ConstantInt::get(Int32Ty, -Offset)); - Value *Replacement = IRBUser.CreateBitCast(Off, AI->getType(), Name); + Value *Replacement = + IRBUser.CreateAddrSpaceCast(Off, AI->getType(), Name); if (auto *PHI = dyn_cast<PHINode>(User)) // PHI nodes may have multiple incoming edges from the same BB (why??), |