mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-25 21:18:19 +00:00
Fix assert with copy from global through addrspacecast
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@196638 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user