mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-21 08:17:40 +00:00
More instcombine cleanup, towards improving debug line info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131604 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -57,12 +57,14 @@ Instruction *InstCombiner::visitAllocaInst(AllocaInst &AI) {
|
||||
Value *Idx[2];
|
||||
Idx[0] = NullIdx;
|
||||
Idx[1] = NullIdx;
|
||||
Value *V = GetElementPtrInst::CreateInBounds(New, Idx, Idx + 2,
|
||||
New->getName()+".sub", It);
|
||||
Instruction *GEP =
|
||||
GetElementPtrInst::CreateInBounds(New, Idx, Idx + 2,
|
||||
New->getName()+".sub");
|
||||
InsertNewInstBefore(GEP, *It);
|
||||
|
||||
// Now make everything use the getelementptr instead of the original
|
||||
// allocation.
|
||||
return ReplaceInstUsesWith(AI, V);
|
||||
return ReplaceInstUsesWith(AI, GEP);
|
||||
} else if (isa<UndefValue>(AI.getArraySize())) {
|
||||
return ReplaceInstUsesWith(AI, Constant::getNullValue(AI.getType()));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user