diff options
author | Bill Wendling <isanbard@gmail.com> | 2013-12-08 00:25:40 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2013-12-08 00:25:40 +0000 |
commit | 209178dacacb5c254926a9d8c72933f23feced9f (patch) | |
tree | 934ab7a7d197ab27a61cded1966576c33c8b0e01 /lib/Transforms | |
parent | 9ab21a198d14f6cd117563746e5d4eefd383a393 (diff) | |
download | llvm-209178dacacb5c254926a9d8c72933f23feced9f.tar.gz llvm-209178dacacb5c254926a9d8c72933f23feced9f.tar.bz2 llvm-209178dacacb5c254926a9d8c72933f23feced9f.tar.xz |
Merging r196638:
------------------------------------------------------------------------
r196638 | arsenm | 2013-12-06 18:58:45 -0800 (Fri, 06 Dec 2013) | 1 line
Fix assert with copy from global through addrspacecast
------------------------------------------------------------------------
git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_34@196709 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Transforms')
-rw-r--r-- | lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp b/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp index 0a0727e0fa..4c861b3fd0 100644 --- a/lib/Transforms/InstCombine/InstCombineLoadStoreAlloca.cpp +++ b/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; |