[Mlir-commits] [llvm] [mlir] [MLIR][OpenMP] Lowering nontemporal clause to LLVM IR for SIMD directive (PR #118751)

Tom Eccles llvmlistbot at llvm.org
Mon Mar 17 04:20:05 PDT 2025


tblah wrote:

> Thanks for the suggestion. Could you please share a reference for adding a pass in LLVM as well as for adding an attribute to OpenMP? That would be helpful for me to analyze and implement it.

I believe Kiran meant a pass in flang rather than in llvm. Here is an example of a flang pass for OpenMP: https://github.com/llvm/llvm-project/blob/main/flang/lib/Optimizer/OpenMP/MarkDeclareTarget.cpp, there are some more changes needed outside the new file so it would be a good idea to look at the commit which added the pass: https://github.com/llvm/llvm-project/commit/062fce6f4dd142cf9275abb3358f88b61a2db4e8

Here is a flang pass which adds attributes to some functions: https://github.com/llvm/llvm-project/blob/main/flang/lib/Optimizer/Transforms/FunctionAttr.cpp. Your pass would be similar except you would be adding the nontemporal attribute to some loads and stores.

For more information about MLIR passes, see the MLIR documentation: https://mlir.llvm.org/docs/PassManagement/

Please feel free to message me on the Flang slack if you need any support.

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


More information about the Mlir-commits mailing list