[llvm] [SEH] Ignore EH pad check for internal intrinsics (PR #79694)

Reid Kleckner via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 8 15:53:54 PST 2024


https://github.com/rnk commented:

Is there some reason we can't apply the funclet bundle to these invokes in clang?

I really worry that this could allow tail merging transforms that the funclet bundles are designed to prevent, something like this:

```
if (cond()) {
  __try {
    maythrow(1);
  } __except(1) {
    __try {
      __builtin_trap();
    } __finally { dtor1(); }
  }
} else {
  __try {
    maythrow(2);
  } __except(1) {
    __try {
      __builtin_trap();
    } __finally { dtor2(); }
  }
}
```

I guess cases like this are less common for SEH than C++ EH, especially since `__except` bodies are not modelled as separate funclets, and we fully outline `__finally` blocks in the frontend.

So, having reasoned through that, I think this is pretty low risk, but I want to push back just a little bit and ask if this can be implemented in the frontend.

Sorry for the delay, as usual, life and work are extremely busy.

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


More information about the llvm-commits mailing list