llvm-project
5021bde6 - [flang][fir] Add invariant attribute to fir.load (#206204)

Commit
46 days ago
[flang][fir] Add invariant attribute to fir.load (#206204) Add an optional `invariant` unit attribute to `fir.load`, modeled on the existing `nontemporal` attribute. When set, it indicates the referenced memory location holds the same value at all points in the program where it is dereferenceable, so the load may be treated as invariant. The FIR-to-LLVM LoadOpConversion forwards the attribute to the invariant flag of `llvm.load` (which lowers to `!invariant.load`). `!invariant.load` metadata might be useful for OpenACC/OpenMP offload, e.g. by using MLIR AA we can mark `fir.load`s inside the GPU kernels letting the target codegen to generate read-only data cache load instructions.
Author
Parents
Loading