[MLIR][OpenMP] Lowering nontemporal clause to LLVM IR for SIMD directive (#118751)

This patch,
- Added a new attribute `nontemporal` to fir.load and fir.store operation in the FIR dialect.
- Added a pass `lower-nontemporal` which is called before FIRToLLVM conversion pass and adds the nontemporal attribute to loads and stores on the list items specified in the nontemporal clause of the SIMD directive.
- Set the `UnitAttr:$nontemporal` to llvm.load and llvm.store operations during FIR to LLVM dialect conversion, if the corresponding fir.load or fir.store operations have the nontemporal attribute.
- Attached the `nontemporal metadata` to load and store instructions that have the nontemporal attribute, during LLVM dialect to LLVM IR translation.
This commit is contained in:
Kaviya Rajendiran
2025-04-30 11:13:20 +05:30
committed by GitHub
parent e4332e4706
commit 857ac4c229
12 changed files with 418 additions and 23 deletions

View File

@@ -3569,8 +3569,13 @@ struct StoreOpConversion : public fir::FIROpConversion<fir::StoreOp> {
} else {
mlir::LLVM::StoreOp storeOp =
rewriter.create<mlir::LLVM::StoreOp>(loc, llvmValue, llvmMemref);
if (isVolatile)
storeOp.setVolatile_(true);
if (store.getNontemporal())
storeOp.setNontemporal(true);
newOp = storeOp;
}
if (std::optional<mlir::ArrayAttr> optionalTag = store.getTbaa())