[llvm] [SEH] Fix register liveness verification for EHa (PR #76933)

Phoebe Wang via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 4 04:15:55 PST 2024


================
@@ -3347,10 +3348,13 @@ void MachineVerifier::verifyLiveRangeSegment(const LiveRange &LR,
     OwnerLI.computeSubRangeUndefs(Undefs, LaneMask, *MRI, *Indexes);
   }
 
+  bool IsEHa = MF->getMMI().getModule()->getModuleFlag("eh-asynch");
   while (true) {
     assert(LiveInts->isLiveInToMBB(LR, &*MFI));
-    // We don't know how to track physregs into a landing pad.
-    if (!Reg.isVirtual() && MFI->isEHPad()) {
+    // TODO: we don't know how to track physregs into a landing pad. For async
+    // EH, the virtual reg lives before scope begin, but we don't know seh scope
+    // range of landing pad in Machine IR. Therefore don't check its liveness.
+    if (MFI->isEHPad() && (!Reg.isVirtual() || IsEHa)) {
----------------
phoebewang wrote:

Since `eh-asynch` is a module flag, I'm worried we won't check for all EHPad even they don't use `__try`.

https://github.com/llvm/llvm-project/pull/76933


More information about the llvm-commits mailing list