[flang-commits] [flang] [flang] Inline hlfir.copy_in for trivial types (PR #138718)
Tom Eccles via flang-commits
flang-commits at lists.llvm.org
Fri Jun 6 02:54:49 PDT 2025
================
@@ -967,6 +969,15 @@ hlfir::LoopNest hlfir::genLoopNest(mlir::Location loc,
auto ub = builder.createConvert(loc, indexType, extent);
auto doLoop =
builder.create<fir::DoLoopOp>(loc, one, ub, one, isUnordered);
+ if (!couldVectorize) {
+ mlir::LLVM::LoopVectorizeAttr va{mlir::LLVM::LoopVectorizeAttr::get(
+ builder.getContext(),
+ /*disable=*/builder.getBoolAttr(true), {}, {}, {}, {}, {}, {})};
+ mlir::LLVM::LoopAnnotationAttr la = mlir::LLVM::LoopAnnotationAttr::get(
+ builder.getContext(), {}, /*vectorize=*/va, {}, /*unroll*/ {},
+ /*unroll_and_jam*/ {}, {}, {}, {}, {}, {}, {}, {}, {}, {}, {});
+ doLoop.setLoopAnnotationAttr(la);
+ }
----------------
tblah wrote:
Please could you add a test verifying that this attribute makes it through lowering to the right place in LLVMIR (or if there is already a test showing a fir.do_loop with this attribute getting lowered to LLVMIR then that's okay).
https://github.com/llvm/llvm-project/pull/138718
More information about the flang-commits
mailing list