[polly] [polly] Add profitability check for expanded region. (PR #96548)

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Thu Jul 25 01:44:01 PDT 2024


================
@@ -1621,6 +1626,12 @@ void ScopDetection::findScops(Region &R) {
     if (!ExpandedR)
       continue;
 
+    if (!isRegionExpansionProfitable(*ExpandedR, LI)) {
+      removeCachedResults(*ExpandedR);
+      delete ExpandedR;
----------------
Meinersbur wrote:

I think this should be moved inside `expandRegion` such that it returns nullptr when this test fails. Also avoids the manual memory management.

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


More information about the llvm-commits mailing list