diff options
| author | Tobias Grosser <tobias@grosser.es> | 2017-05-04 10:16:20 +0000 |
|---|---|---|
| committer | Tobias Grosser <tobias@grosser.es> | 2017-05-04 10:16:20 +0000 |
| commit | 3f25a7e8ee9ea0db767ec796d0c3f72c38906bc2 (patch) | |
| tree | 9f082eb60781386aeb19d6e34a67be98fd08d002 /polly/lib/Analysis/ScopDetection.cpp | |
| parent | 4f1f64174b28f58c15d12067e50929b2c9c826d2 (diff) | |
| download | bcm5719-llvm-3f25a7e8ee9ea0db767ec796d0c3f72c38906bc2.tar.gz bcm5719-llvm-3f25a7e8ee9ea0db767ec796d0c3f72c38906bc2.zip | |
[ScopDetection] Check for already known required-invariant loads [NFC]
For certain test cases we spent over 50% of the scop detection time in
checking if a load is likely invariant. We can avoid most of these checks by
testing early on if a load is expected to be invariant. Doing this reduces
scop-detection time on a large benchmark from 52 seconds to just 25 seconds.
No functional change is expected.
llvm-svn: 302134
Diffstat (limited to 'polly/lib/Analysis/ScopDetection.cpp')
| -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; |

