Skip to content

Commit 694a641

Browse files
committed
[ARM64] [Windows] Mark block address as taken when expanding catchrets
This fixes issue #109250 The issue happens during the `MachineBlockPlacement` pass. The block, whose address was previously not taken, is deemed redundant by the pass and subsequently replaced using `MachineBasicBlock::ReplaceUsesOfBlockWith` in `BranchFolding`. ReplaceUsesOfBlockWith only replaces uses in the terminator. However, `expandPostRAPseudo` introduces new block uses when expanding catchrets. These uses do not get replaced, which results in undefined label errors later on. Marking the block addresss as taken prevents the replacement of the block, without also replacing non-terminator uses.
1 parent 4c50112 commit 694a641

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

llvm/lib/Target/AArch64/AArch64InstrInfo.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1994,6 +1994,7 @@ bool AArch64InstrInfo::expandPostRAPseudo(MachineInstr &MI) const {
19941994
.addReg(AArch64::X0)
19951995
.addMBB(TargetMBB)
19961996
.addImm(0);
1997+
TargetMBB->setMachineBlockAddressTaken();
19971998
return true;
19981999
}
19992000

0 commit comments

Comments
 (0)