[clang] [llvm] [mlir] [openmp] [Clang][OpenMP] Canonicalize Intra-tiles in Loop Tiling (PR #191114)

Michael Kruse via cfe-commits cfe-commits at lists.llvm.org
Thu Aug 6 06:45:46 PDT 2026


================
@@ -15257,6 +15367,13 @@ StmtResult SemaOpenMP::ActOnOpenMPTileDirective(ArrayRef<OMPClause *> Clauses,
         ForStmt(Context, InitStmt.get(), CondExpr.get(), nullptr,
                 IncrStmt.get(), Inner, LoopHelper.Init->getBeginLoc(),
                 LoopHelper.Init->getBeginLoc(), LoopHelper.Inc->getEndLoc());
+
+    // Attach the droppable reinterpretation attribute to the intra-tile loop.
+    auto *Hint = OMPInvariantPredicateBoundAttr::CreateImplicit(
----------------
Meinersbur wrote:

In a previous version of this patch you only added the predicated if it could not shown that the itertion is a multiple of a tile size. Could we still do that here?

I had AI point out to me that the optimizer will not always be able to optimize-away this predicate, due to the constant loop bound being outside the outlined body that contains the predicate.

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


More information about the cfe-commits mailing list