-
Notifications
You must be signed in to change notification settings - Fork 10.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[OpenMP] Avoid type-punning on the parallel_51 call edge #60327
Labels
Comments
@llvm/issue-subscribers-openmp |
jdoerfert
changed the title
[OpenM] Avoid type-punning on the parallel_51 call edge
[OpenMP] Avoid type-punning on the parallel_51 call edge
Jan 27, 2023
The real problem are the "previous.lb" and "previous.ub" bounds passed as i64 to the outlined function. These need to be casted to pointers first. With the new loop API this should resolve itself. |
razmser
pushed a commit
to SuduIDE/llvm-project
that referenced
this issue
Oct 2, 2023
AAIndirectCallInfo will collect information and specialize indirect call sites. It is similar to our IndirectCallPromotion but runs as part of the Attributor (so with assumed callee information). It also expands more calls and let's the rest of the pipeline figure out what is UB, for now. We use existing call promotion logic to improve the result, otherwise we rely on the (implicit) function pointer cast. This effectively "fixes" llvm#60327 as it will undo the type punning early enough for the inliner to work with the (now specialized, thus direct) call. Fixes: llvm#60327
razmser
pushed a commit
to SuduIDE/llvm-project
that referenced
this issue
Oct 2, 2023
AAIndirectCallInfo will collect information and specialize indirect call sites. It is similar to our IndirectCallPromotion but runs as part of the Attributor (so with assumed callee information). It also expands more calls and let's the rest of the pipeline figure out what is UB, for now. We use existing call promotion logic to improve the result, otherwise we rely on the (implicit) function pointer cast. This effectively "fixes" llvm#60327 as it will undo the type punning early enough for the inliner to work with the (now specialized, thus direct) call. Fixes: llvm#60327
razmser
pushed a commit
to SuduIDE/llvm-project
that referenced
this issue
Oct 2, 2023
AAIndirectCallInfo will collect information and specialize indirect call sites. It is similar to our IndirectCallPromotion but runs as part of the Attributor (so with assumed callee information). It also expands more calls and let's the rest of the pipeline figure out what is UB, for now. We use existing call promotion logic to improve the result, otherwise we rely on the (implicit) function pointer cast. This effectively "fixes" llvm#60327 as it will undo the type punning early enough for the inliner to work with the (now specialized, thus direct) call. Fixes: llvm#60327
razmser
pushed a commit
to SuduIDE/llvm-project
that referenced
this issue
Oct 3, 2023
AAIndirectCallInfo will collect information and specialize indirect call sites. It is similar to our IndirectCallPromotion but runs as part of the Attributor (so with assumed callee information). It also expands more calls and let's the rest of the pipeline figure out what is UB, for now. We use existing call promotion logic to improve the result, otherwise we rely on the (implicit) function pointer cast. This effectively "fixes" llvm#60327 as it will undo the type punning early enough for the inliner to work with the (now specialized, thus direct) call. Fixes: llvm#60327
razmser
pushed a commit
to SuduIDE/llvm-project
that referenced
this issue
Oct 3, 2023
AAIndirectCallInfo will collect information and specialize indirect call sites. It is similar to our IndirectCallPromotion but runs as part of the Attributor (so with assumed callee information). It also expands more calls and let's the rest of the pipeline figure out what is UB, for now. We use existing call promotion logic to improve the result, otherwise we rely on the (implicit) function pointer cast. This effectively "fixes" llvm#60327 as it will undo the type punning early enough for the inliner to work with the (now specialized, thus direct) call. Fixes: llvm#60327
razmser
pushed a commit
to SuduIDE/llvm-project
that referenced
this issue
Oct 6, 2023
AAIndirectCallInfo will collect information and specialize indirect call sites. It is similar to our IndirectCallPromotion but runs as part of the Attributor (so with assumed callee information). It also expands more calls and let's the rest of the pipeline figure out what is UB, for now. We use existing call promotion logic to improve the result, otherwise we rely on the (implicit) function pointer cast. This effectively "fixes" llvm#60327 as it will undo the type punning early enough for the inliner to work with the (now specialized, thus direct) call. Fixes: llvm#60327
razmser
pushed a commit
to SuduIDE/llvm-project
that referenced
this issue
Oct 11, 2023
AAIndirectCallInfo will collect information and specialize indirect call sites. It is similar to our IndirectCallPromotion but runs as part of the Attributor (so with assumed callee information). It also expands more calls and let's the rest of the pipeline figure out what is UB, for now. We use existing call promotion logic to improve the result, otherwise we rely on the (implicit) function pointer cast. This effectively "fixes" llvm#60327 as it will undo the type punning early enough for the inliner to work with the (now specialized, thus direct) call. Fixes: llvm#60327
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We type pun firstprivate integers (among other things) on the call edge between the sequential and parallel region. This is really bad for device code as it prevents us in pretty much all pipelines to inline the parallel runtime function. If we would not type-pun it works fine. If we run another optimization pipeline, it does work too. Unsure what part of the inliner is affected here but my guess is that it's the "CallBase::getCalledFunction" checking that the callee type matches the call site.
This is a pretty bad regression we should try to fix and backport into 16.
Example: https://godbolt.org/z/9o7qMPcvM
The text was updated successfully, but these errors were encountered: