diff options
author | Bill Wendling <isanbard@gmail.com> | 2013-12-07 21:24:29 +0000 |
---|---|---|
committer | Bill Wendling <isanbard@gmail.com> | 2013-12-07 21:24:29 +0000 |
commit | fccbdd27bcd604e232dfa8c77105dcb625da305e (patch) | |
tree | d6f151df44549fe3f6d56b8c1ab5192b3a28d860 /lib | |
parent | d9979c53c324464fd8acf36e686886d2f2810add (diff) | |
download | external_llvm-fccbdd27bcd604e232dfa8c77105dcb625da305e.zip external_llvm-fccbdd27bcd604e232dfa8c77105dcb625da305e.tar.gz external_llvm-fccbdd27bcd604e232dfa8c77105dcb625da305e.tar.bz2 |
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@196668 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-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 0a0727e..4c861b3 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; |