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

Amit Tiwari via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 17 02:57:01 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(
----------------
loopacino wrote:

No, it does because without the attribute the outer-loop variable (`.floor.iv`) is not registered in the DSA stack–making it loop invariant. This results in no recomputation of the `.floor.iv` value, and the stale value keeps re-assigning to inner `.tile.iv`.  Here, `ReinterpretTileLB/FoundFloor` trigger this recompuatation for all the cases including the `NoPartialTile` case. By the way, other convenience is that we can directly use `f+T` from the `OMPInvariantPredicateBoundAttr`, instead of extracting it from default `min(f+T,N)`.
	  
NB: The same floor stale value issue arises with `stripe` with an outer `collapse`

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


More information about the llvm-commits mailing list