Generate temporary storage inline inside WHERE and FORALL when possible.
A following patch will use the runtime to cover the generic cases.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Event Timeline
Load logical/numerical scalars value before selecting the temporary storage kind
to avoid picking up the runtime startegy when the inlined startegy works.
Add related regerssion test.
I did not properly plug the fetching of saved value on WHERE/ELSEWHERE, my bad. Update coming soon.
Handle saving of where and elsewhere mask correctly:
- Elsewhere mask that are saved should be evaluated using the "pending control mask" (inside the else region of the fir.if for the previous where/elsewhere mask).
- When entering Where/Elsewhere, the saved value for the mask must be used if the mask was saved. The previous code bypassed that.
Add related regression tests.
Thanks for the review!
I fixed typos in the merge commit, but I merged before seeing @tblah review comment, sorry about that. I made a new patch to address your comments.
flang/test/HLFIR/order_assignments/impure-where.fir | ||
---|---|---|
37 | I trimmed the expected IR a bit too much, well spotted, the generated fir.allocmem indeed has a size parameter. I updated the expected output to include it in https://reviews.llvm.org/D151428. |