[PATCH] D89264: [LICM] Make promotion faster

Alina Sbirlea via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 18 15:24:36 PST 2021


asbirlea added a comment.

Runtime impact looks reasonable now. What's the compile-time impact for the patch now?

Minor comments inline.



================
Comment at: llvm/lib/Transforms/Scalar/LICM.cpp:461
+        foreachMemoryAccess(MSSA, L, [&](Instruction *I) {
+          MaybePromotable.push_back(I);
+        });
----------------
Nit: It seems the conditions in `IsPotentiallyPromotable` would be useful as an early filter to prevent filling up the `MaybePromotable` only to clean it up shortly after.


================
Comment at: llvm/lib/Transforms/Scalar/LICM.cpp:2246
-  auto CurAST = std::make_unique<AliasSetTracker>(*AA, MSSA, L);
-  CurAST->addAllInstructionsInLoopUsingMSSA();
-  return CurAST;
----------------
Remove the `addAllInstructionsInLoopUsingMSSA` API as well.


================
Comment at: llvm/lib/Transforms/Scalar/LICM.cpp:2274
+  });
+
+  // We're only interested in must-alias sets that contain a mod.
----------------
A quick exit check for promotion is whether the AST is saturated.
Probably need to add the API for that inside the AliasSetTracker.
```
bool isSaturated(){
    return AliasAnyAS != nullptr;
}
```

```
if (AST.isSaturated())
    return {}; // Nothing to promote...


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D89264/new/

https://reviews.llvm.org/D89264



More information about the llvm-commits mailing list