diff options
-rw-r--r-- | polly/lib/Analysis/ScopDetection.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/polly/lib/Analysis/ScopDetection.cpp b/polly/lib/Analysis/ScopDetection.cpp index 31ee882d0ce..0e8e0efbeaf 100644 --- a/polly/lib/Analysis/ScopDetection.cpp +++ b/polly/lib/Analysis/ScopDetection.cpp @@ -350,6 +350,14 @@ bool ScopDetection::onlyValidRequiredInvariantLoads( return false; for (LoadInst *Load : RequiredILS) { + // If we already know a load has been accepted as required invariant, we + // already run the validation below once and consequently don't need to + // run it again. Hence, we return early. For certain test cases (e.g., + // COSMO this avoids us spending 50% of scop-detection time in this + // very function (and its children). + if (Context.RequiredILS.count(Load)) + continue; + if (!isHoistableLoad(Load, CurRegion, *LI, *SE, *DT)) return false; |