[polly] [Polly] Data flow reduction detection to cover more cases (PR #84901)

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 22 08:22:18 PDT 2024


================
@@ -3593,8 +3705,14 @@ void ScopBuilder::buildScop(Region &R, AssumptionCache &AC) {
     buildDomain(Stmt);
     buildAccessRelations(Stmt);
 
-    if (DetectReductions)
-      checkForReductions(Stmt);
+    if (DetectReductions) {
+      BasicBlock *BB = Stmt.getBasicBlock();
----------------
Meinersbur wrote:

Multiple statements can inhibit the same BasicBlock. See `ScopBuilder::buildEqivClassBlockStmts`.

Alternatively, instead of enumerating per-ScopStmt as line 3702 does, you could enumerate over BasicBlocks in this ScopStmts and lookup the ScopStmt that corresponds to a specific instruction (`Scop::getStmtFor`).

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


More information about the llvm-commits mailing list