[llvm] [OpenMPOpt] Block SPMDization when omp_alloc/omp_free are present (PR #190875)
Johannes Doerfert via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 29 12:57:48 PDT 2026
jdoerfert wrote:
> Note
> that situation can be replicated in the trunk.
So, why are we not adding a test then?
---
I doubt this is the right fix:
Right now, we do not treat omp_alloc as an openmp runtime call, right?
So we never get into the switch but analyze the call as if it was any arbitrary user code.
So it doesn't matter if the callee is omp_alloc, __ockl_dm_alloc, or foobar.
Since we see the definition of that callee, we will do SPMD compatibility for the code inside.
Basically, we will run into this case
```
// If the callee is known and can be used in IPO, we will update the
// state based on the callee state in updateImpl.
```
Correct?
Now, either we should be flagging the code as not SPMD compatible (or requires guarding), or it should be fine to use SPMD mode. Neither option depends on omp_alloc per se. So whatever is happening would happen for `my_omp_alloc` as well, no?
That said, we need to determine why it is deemed SPMD compatible w/o guarding, assuming that is not correct.
https://github.com/llvm/llvm-project/pull/190875
More information about the llvm-commits
mailing list