[llvm] [StackColoring] Handle SEH catch object stack slots conservatively (PR #66988)

Nikita Popov via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 22 02:56:02 PDT 2023


================
@@ -739,14 +695,23 @@ unsigned StackColoring::collectMarkers(unsigned NumSlot) {
     return 0;
   }
 
-  // 1) PR27903: slots with multiple start or end lifetime ops are not
+  // PR27903: slots with multiple start or end lifetime ops are not
   // safe to enable for "lifetime-start-on-first-use".
-  // 2) And also not safe for variable X in catch(X) in windows.
   for (unsigned slot = 0; slot < NumSlot; ++slot) {
-    if (NumStartLifetimes[slot] > 1 || NumEndLifetimes[slot] > 1 ||
-        (NumLoadInCatchPad[slot] > 1 && !StoreSlots.test(slot)))
+    if (NumStartLifetimes[slot] > 1 || NumEndLifetimes[slot] > 1)
       ConservativeSlots.set(slot);
   }
+
+  // The write to the catch object by the personality function is not propely
+  // modeled in IR: It happens before any cleanuppads are executed, even if the
----------------
nikic wrote:

I've filed https://github.com/llvm/llvm-project/issues/67110 to keep track of this idea.

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


More information about the llvm-commits mailing list