Merge pull request #75292 from nate-chandler/rdar131882748

[Mem2Reg] Bail on address-only types.
This commit is contained in:
nate-chandler
2024-07-18 10:52:03 -07:00
committed by GitHub
2 changed files with 37 additions and 0 deletions

View File

@@ -2203,6 +2203,12 @@ bool MemoryToRegisters::promoteAllocation(AllocStackInst *alloc,
return true;
}
// The value stored into an alloc_stack whose type address-only can never be
// represented in a register. Bail out.
if (alloc->getType().isAddressOnly(f)) {
return false;
}
// For AllocStacks that are only used within a single basic blocks, use
// the linear sweep to remove the AllocStack.
if (inSingleBlock) {