mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-23 01:24:30 +00:00
fix PR6760, a missing check in heap SRoA.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100936 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -966,7 +966,8 @@ static bool ValueIsOnlyUsedLocallyOrStoredToOneGlobal(const Instruction *V,
|
||||
continue; // Otherwise, storing through it, or storing into GV... fine.
|
||||
}
|
||||
|
||||
if (isa<GetElementPtrInst>(Inst)) {
|
||||
// Must index into the array and into the struct.
|
||||
if (isa<GetElementPtrInst>(Inst) && Inst->getNumOperands() >= 3) {
|
||||
if (!ValueIsOnlyUsedLocallyOrStoredToOneGlobal(Inst, GV, PHIs))
|
||||
return false;
|
||||
continue;
|
||||
|
Reference in New Issue
Block a user