[polly] r317495 - [ForwardOpTree] Limit isl operations of known content reload.

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 6 09:48:14 PST 2017


Author: meinersbur
Date: Mon Nov  6 09:48:14 2017
New Revision: 317495

URL: http://llvm.org/viewvc/llvm-project?rev=317495&view=rev
Log:
[ForwardOpTree] Limit isl operations of known content reload.

Put the analysis part of reloadKnownContent under an isl
max-operations quota scope, as has already been done for
forwardKnownLoad.

This should fix the aosp timeout of "GrTestUtils.cpp".

Modified:
    polly/trunk/lib/Transform/ForwardOpTree.cpp

Modified: polly/trunk/lib/Transform/ForwardOpTree.cpp
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/Transform/ForwardOpTree.cpp?rev=317495&r1=317494&r2=317495&view=diff
==============================================================================
--- polly/trunk/lib/Transform/ForwardOpTree.cpp (original)
+++ polly/trunk/lib/Transform/ForwardOpTree.cpp Mon Nov  6 09:48:14 2017
@@ -576,7 +576,8 @@ public:
                                         Loop *DefLoop, isl::map DefToTarget,
                                         bool DoIt) {
     // Cannot do anything without successful known analysis.
-    if (Known.is_null())
+    if (Known.is_null() || Translator.is_null() || UseToTarget.is_null() ||
+        DefToTarget.is_null() || MaxOpGuard.hasQuotaExceeded())
       return FD_NotApplicable;
 
     MemoryAccess *Access = TargetStmt->lookupInputAccessOf(Inst);
@@ -586,6 +587,12 @@ public:
       return FD_CanForwardLeaf;
     }
 
+    // Don't spend too much time analyzing whether it can be reloaded. When
+    // carrying-out the forwarding, we cannot bail-out in the middle of the
+    // transformation. It also shouldn't take as long because some results are
+    // cached.
+    IslQuotaScope QuotaScope = MaxOpGuard.enter(!DoIt);
+
     // { DomainDef[] -> ValInst[] }
     isl::union_map ExpectedVal = makeNormalizedValInst(Inst, UseStmt, UseLoop);
 




More information about the llvm-commits mailing list