[llvm] [OpenMPOpt][Attributor] Avoid eager deglobalization AA registration (PR #198710)

ZT Qin via llvm-commits llvm-commits at lists.llvm.org
Tue May 26 19:09:58 PDT 2026


nolongerwait wrote:

> I don't think this is a proper fix. A better fix would be to skip OpenMPOpt pass if there is no actual OpenMP code in the module. That said, we probably want to change how we mark a module instead.
> 
> CC @kevinsala

Thanks, I agree that skipping OpenMPOpt for modules without actual OpenMP code would be a better solution in principle.

We did consider that first when investigating the compile-time issue. The difficulty is that the current module-level marker seems too coarse for that decision.

The change I tried here was an attempt to make that gating more precise by looking for concrete OpenMP signals in the IR, such as runtime uses, device kernels, offload entries, or device-runtime artifacts. I agree, though, that this is still heuristic and probably not the ideal abstraction boundary.

One additional constraint on our side is that our team does not currently have deep OpenMP expertise, so it is difficult for us to propose a fully convincing design-level fix without guidance from OpenMP maintainers. We can investigate and iterate, but we would appreciate advice on what the intended signal should be.

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


More information about the llvm-commits mailing list