diff options
author | Matt Arsenault <Matthew.Arsenault@amd.com> | 2013-12-07 02:58:45 +0000 |
---|---|---|
committer | Matt Arsenault <Matthew.Arsenault@amd.com> | 2013-12-07 02:58:45 +0000 |
commit | bbf18c69580e19e260ffeb7c6e7872905c606e9c (patch) | |
tree | f87deb0f01f292b8b135cba5fd89f5358914d681 /llvm/lib | |
parent | 21f38f45392af5902f043a8ccb0247f6f2ea182c (diff) | |
download | bcm5719-llvm-bbf18c69580e19e260ffeb7c6e7872905c606e9c.tar.gz bcm5719-llvm-bbf18c69580e19e260ffeb7c6e7872905c606e9c.zip |
Fix assert with copy from global through addrspacecast
llvm-svn: 196638
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp index 0a0727e0fa3..4c861b3fd09 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp @@ -263,9 +263,9 @@ Instruction *InstCombiner::visitAllocaInst(AllocaInst &AI) { for (unsigned i = 0, e = ToDelete.size(); i != e; ++i) EraseInstFromFunction(*ToDelete[i]); Constant *TheSrc = cast<Constant>(Copy->getSource()); - Instruction *NewI - = ReplaceInstUsesWith(AI, ConstantExpr::getBitCast(TheSrc, - AI.getType())); + Constant *Cast + = ConstantExpr::getPointerBitCastOrAddrSpaceCast(TheSrc, AI.getType()); + Instruction *NewI = ReplaceInstUsesWith(AI, Cast); EraseInstFromFunction(*Copy); ++NumGlobalCopies; return NewI; |