#
d55bc4c7 |
| 05-May-2016 |
Dehao Chen <dehao@google.com> |
clang-format some files in preparation of coming patch reviews.
llvm-svn: 268583
|
#
aa641a51 |
| 22-Apr-2016 |
Andrew Kaylor <andrew.kaylor@intel.com> |
Re-commit optimization bisect support (r267022) without new pass manager support.
The original commit was reverted because of a buildbot problem with LazyCallGraph::SCC handling (not related to the
Re-commit optimization bisect support (r267022) without new pass manager support.
The original commit was reverted because of a buildbot problem with LazyCallGraph::SCC handling (not related to the OptBisect handling).
Differential Revision: http://reviews.llvm.org/D19172
llvm-svn: 267231
show more ...
|
#
6013f45f |
| 22-Apr-2016 |
Vedant Kumar <vsk@apple.com> |
Revert "Initial implementation of optimization bisect support."
This reverts commit r267022, due to an ASan failure:
http://lab.llvm.org:8080/green/job/clang-stage2-cmake-RgSan_check/1549
llvm-s
Revert "Initial implementation of optimization bisect support."
This reverts commit r267022, due to an ASan failure:
http://lab.llvm.org:8080/green/job/clang-stage2-cmake-RgSan_check/1549
llvm-svn: 267115
show more ...
|
#
f0f27929 |
| 21-Apr-2016 |
Andrew Kaylor <andrew.kaylor@intel.com> |
Initial implementation of optimization bisect support.
This patch implements a optimization bisect feature, which will allow optimizations to be selectively disabled at compile time in order to trac
Initial implementation of optimization bisect support.
This patch implements a optimization bisect feature, which will allow optimizations to be selectively disabled at compile time in order to track down test failures that are caused by incorrect optimizations.
The bisection is enabled using a new command line option (-opt-bisect-limit). Individual passes that may be skipped call the OptBisect object (via an LLVMContext) to see if they should be skipped based on the bisect limit. A finer level of control (disabling individual transformations) can be managed through an addition OptBisect method, but this is not yet used.
The skip checking in this implementation is based on (and replaces) the skipOptnoneFunction check. Where that check was being called, a new call has been inserted in its place which checks the bisect limit and the optnone attribute. A new function call has been added for module and SCC passes that behaves in a similar way.
Differential Revision: http://reviews.llvm.org/D19172
llvm-svn: 267022
show more ...
|
#
045afc4f |
| 06-Apr-2016 |
Fiona Glaser <escha@apple.com> |
Loop Unroll: add options and tweak to make Partial unrolling more useful
1. Add FullUnrollMaxCount option that works like MaxCount, but also limits the unroll count for fully unrolled loops. So i
Loop Unroll: add options and tweak to make Partial unrolling more useful
1. Add FullUnrollMaxCount option that works like MaxCount, but also limits the unroll count for fully unrolled loops. So if a loop has an iteration count over this, it won't fully unroll. 2. Add CLI options for MaxCount and the new option, so they can be tested (plus a test). 3. Make partial unrolling obey MaxCount.
An example use-case (the out of tree one this is originally designed for) is a target’s TTI can analyze a loop and decide on a max unroll count separate from the size threshold, e.g. based on register pressure, then constrain LoopUnroll to not exceed that, regardless of the size of the unrolled loop.
llvm-svn: 265562
show more ...
|
#
16332ba8 |
| 06-Apr-2016 |
Fiona Glaser <escha@apple.com> |
LoopUnroll: only allow non-modulo Partial unrolling when Runtime=true
Patch by Evgeny Stupachenko <evstupac@gmail.com>.
llvm-svn: 265558
|
#
a82a58a4 |
| 04-Apr-2016 |
Zia Ansari <zia.ansari@intel.com> |
Enable unroll for constant bound loops when TripCount is not modulo of unroll factor, reducing it to maximum power-of-2 that satisfies threshold limit.
Commit for Evgeny Stupachenko (evstupac@gmail.
Enable unroll for constant bound loops when TripCount is not modulo of unroll factor, reducing it to maximum power-of-2 that satisfies threshold limit.
Commit for Evgeny Stupachenko (evstupac@gmail.com)
Differential Revision: http://reviews.llvm.org/D18290
llvm-svn: 265337
show more ...
|
#
8d441eb9 |
| 25-Mar-2016 |
David L Kreitzer <david.l.kreitzer@intel.com> |
Enable non-power-of-2 #pragma unroll counts.
Patch by Evgeny Stupachenko.
Differential Revision: http://reviews.llvm.org/D18202
llvm-svn: 264407
|
#
6827de19 |
| 14-Mar-2016 |
Justin Lebar <jlebar@google.com> |
[LoopUnroll] Respect the convergent attribute.
Summary: Specifically, when we perform runtime loop unrolling of a loop that contains a convergent op, we can only unroll k times, where k divides the
[LoopUnroll] Respect the convergent attribute.
Summary: Specifically, when we perform runtime loop unrolling of a loop that contains a convergent op, we can only unroll k times, where k divides the loop trip multiple.
Without this change, we'll happily unroll e.g. the following loop
for (int i = 0; i < N; ++i) { if (i == 0) convergent_op(); foo(); }
into
int i = 0; if (N % 2 == 1) { convergent_op(); foo(); ++i; } for (; i < N - 1; i += 2) { if (i == 0) convergent_op(); foo(); foo(); }.
This is unsafe, because we've just added a control-flow dependency to the convergent op in the prelude.
In general, runtime unrolling loops that contain convergent ops is safe only if we don't have emit a prelude, which occurs when the unroll count divides the trip multiple.
Reviewers: resistor
Subscribers: llvm-commits, mzolotukhin
Differential Revision: http://reviews.llvm.org/D17526
llvm-svn: 263509
show more ...
|
#
f831fdb5 |
| 08-Mar-2016 |
Sanjay Patel <spatel@rotateright.com> |
fix variable name; NFC
llvm-svn: 262953
|
#
5c967236 |
| 08-Mar-2016 |
Sanjay Patel <spatel@rotateright.com> |
use range-based loop; NFCI
llvm-svn: 262952
|
Revision tags: llvmorg-3.8.0 |
|
#
9f520ebc |
| 26-Feb-2016 |
Michael Zolotukhin <mzolotukhin@apple.com> |
[LoopUnrollAnalyzer] Check that we're using SCEV for the same loop we're simulating.
Summary: Check that we're using SCEV for the same loop we're simulating. Otherwise, we might try to use the itera
[LoopUnrollAnalyzer] Check that we're using SCEV for the same loop we're simulating.
Summary: Check that we're using SCEV for the same loop we're simulating. Otherwise, we might try to use the iteration number of the current loop in SCEV expressions for inner/outer loops IVs, which is clearly incorrect.
Reviewers: chandlerc, hfinkel
Subscribers: sanjoy, llvm-commits, mzolotukhin
Differential Revision: http://reviews.llvm.org/D17632
llvm-svn: 261958
show more ...
|
Revision tags: llvmorg-3.8.0-rc3 |
|
#
31088a9d |
| 19-Feb-2016 |
Chandler Carruth <chandlerc@gmail.com> |
[LPM] Factor all of the loop analysis usage updates into a common helper routine.
We were getting this wrong in small ways and generally being very inconsistent about it across loop passes. Instead,
[LPM] Factor all of the loop analysis usage updates into a common helper routine.
We were getting this wrong in small ways and generally being very inconsistent about it across loop passes. Instead, let's have a common place where we do this. One minor downside is that this will require some analyses like SCEV in more places than they are strictly needed. However, this seems benign as these analyses are complete no-ops, and without this consistency we can in many cases end up with the legacy pass manager scheduling deciding to split up a loop pass pipeline in order to run the function analysis half-way through. It is very, very annoying to fix these without just being very pedantic across the board.
The only loop passes I've not updated here are ones that use AU.setPreservesAll() such as IVUsers (an analysis) and the pass printer. They seemed less relevant.
With this patch, almost all of the problems in PR24804 around loop pass pipelines are fixed. The one remaining issue is that we run simplify-cfg and instcombine in the middle of the loop pass pipeline. We've recently added some loop variants of these passes that would seem substantially cleaner to use, but this at least gets us much closer to the previous state. Notably, the seven loop pass managers is down to three.
I've not updated the loop passes using LoopAccessAnalysis because that analysis hasn't been fully wired into LoopSimplify/LCSSA, and it isn't clear that those transforms want to support those forms anyways. They all run late anyways, so this is harmless. Similarly, LSR is left alone because it already carefully manages its forms and doesn't need to get fused into a single loop pass manager with a bunch of other loop passes.
LoopReroll didn't use loop simplified form previously, and I've updated the test case to match the trivially different output.
Finally, I've also factored all the pass initialization for the passes that use this technique as well, so that should be done regularly and reliably.
Thanks to James for the help reviewing and thinking about this stuff, and Ben for help thinking about it as well!
Differential Revision: http://reviews.llvm.org/D17435
llvm-svn: 261316
show more ...
|
#
1da4afdf |
| 08-Feb-2016 |
Michael Zolotukhin <mzolotukhin@apple.com> |
Factor out UnrollAnalyzer to Analysis, and add unit tests for it.
Summary: Unrolling Analyzer is already pretty complicated, and it becomes harder and harder to exercise it with usual IR tests, as w
Factor out UnrollAnalyzer to Analysis, and add unit tests for it.
Summary: Unrolling Analyzer is already pretty complicated, and it becomes harder and harder to exercise it with usual IR tests, as with them we can only check the final decision: whether the loop is unrolled or not. This change factors this framework out from LoopUnrollPass to analyses, which allows to use unit tests. The change itself is supposed to be NFC, except adding a couple of tests.
I plan to add more tests as I add new functionality and find/fix bugs.
Reviewers: chandlerc, hfinkel, sanjoy
Subscribers: zzheng, sanjoy, llvm-commits
Differential Revision: http://reviews.llvm.org/D16623
llvm-svn: 260169
show more ...
|
Revision tags: llvmorg-3.8.0-rc2, llvmorg-3.8.0-rc1 |
|
#
b8d82abb |
| 12-Jan-2016 |
Justin Bogner <mail@justinbogner.com> |
LoopUnroll: Move the actual unrolling logic to a standalone function. NFC
This is pure code motion - break the actual work out of runOnLoop into a reusable standalone function.
llvm-svn: 257445
|
#
921b04e9 |
| 12-Jan-2016 |
Justin Bogner <mail@justinbogner.com> |
LoopUnroll: Make canUnrollCompletely static - it doesn't use any state. NFC
llvm-svn: 257427
|
#
a1dd4931 |
| 12-Jan-2016 |
Justin Bogner <mail@justinbogner.com> |
LoopUnroll: Clean up the maze of initialization for unroll parameters. NFC
The layering of where the various loop unroll parameters are initialized and overridden here was very confusing, making it
LoopUnroll: Clean up the maze of initialization for unroll parameters. NFC
The layering of where the various loop unroll parameters are initialized and overridden here was very confusing, making it pretty difficult to tell just how the various sources interacted. Instead, we put all of the initialization logic together in a single function so that it's obvious what overrides what.
llvm-svn: 257426
show more ...
|
#
0fb7ed57 |
| 11-Jan-2016 |
Justin Bogner <mail@justinbogner.com> |
LoopUnroll: Use the optsize threshold for minsize as well
Currently we're unrolling loops more in minsize than in optsize, which means -Oz will have a larger code size than -Os. That doesn't make an
LoopUnroll: Use the optsize threshold for minsize as well
Currently we're unrolling loops more in minsize than in optsize, which means -Oz will have a larger code size than -Os. That doesn't make any sense.
This resolves the FIXME about this in LoopUnrollPass and extends the optsize test to make sure we use the smaller threshold for minsize as well.
llvm-svn: 257402
show more ...
|
#
883a3ea6 |
| 16-Dec-2015 |
Justin Bogner <mail@justinbogner.com> |
LPM: Make callers of LPM.deleteLoopFromQueue update LoopInfo directly. NFC
As of r255720, the loop pass manager will DTRT when passes update the loop info for removed loops, so they no longer need t
LPM: Make callers of LPM.deleteLoopFromQueue update LoopInfo directly. NFC
As of r255720, the loop pass manager will DTRT when passes update the loop info for removed loops, so they no longer need to reach into LPPassManager APIs to do this kind of transformation. This change very nearly removes the need for the LPPassManager to even be passed into loop passes - the only remaining pass that uses the LPM argument is LoopUnswitch.
llvm-svn: 255797
show more ...
|
#
843fb204 |
| 15-Dec-2015 |
Justin Bogner <mail@justinbogner.com> |
LPM: Stop threading `Pass *` through all of the loop utility APIs. NFC
A large number of loop utility functions take a `Pass *` and reach into it to find out which analyses to preserve. There are a
LPM: Stop threading `Pass *` through all of the loop utility APIs. NFC
A large number of loop utility functions take a `Pass *` and reach into it to find out which analyses to preserve. There are a number of problems with this:
- The APIs have access to pretty well any Pass state they want, so it's hard to tell what they may or may not do.
- Other APIs have copied these and pass around a `Pass *` even though they don't even use it. Some of these just hand a nullptr to the API since the callers don't even have a pass available.
- Passes in the new pass manager don't work like the current ones, so the APIs can't be used as is there.
Instead, we should explicitly thread the analysis results that we actually care about through these APIs. This is both simpler and more reusable.
llvm-svn: 255669
show more ...
|
Revision tags: llvmorg-3.7.1, llvmorg-3.7.1-rc2, llvmorg-3.7.1-rc1 |
|
#
6db3338c |
| 15-Oct-2015 |
Benjamin Kramer <benny.kra@googlemail.com> |
[ScalarOpts] Remove dead code.
Does not touch debug dumpers. NFC.
llvm-svn: 250417
|
#
deade196 |
| 22-Sep-2015 |
Michael Zolotukhin <mzolotukhin@apple.com> |
[Unroll] Do not crash trying to propagate a value to vector load.
llvm-svn: 248333
|
#
8bb31dd0 |
| 22-Sep-2015 |
Michael Zolotukhin <mzolotukhin@apple.com> |
[Unroll] Follow-up for r247769: fix a bug in UnrolledInstAnalyzer::visitLoad.
Apart from checking that GlobalVariable is a constant, we should check that it's not a weak constant, in which case we c
[Unroll] Follow-up for r247769: fix a bug in UnrolledInstAnalyzer::visitLoad.
Apart from checking that GlobalVariable is a constant, we should check that it's not a weak constant, in which case we can't propagate its value.
llvm-svn: 248327
show more ...
|
#
fc314be0 |
| 16-Sep-2015 |
Michael Zolotukhin <mzolotukhin@apple.com> |
[Unroll] Fix a bug in UnrolledInstAnalyzer::visitLoad.
We only checked that a global is initialized with constants, which is incorrect. We should be checking that GlobalVariable *is* a constant, not
[Unroll] Fix a bug in UnrolledInstAnalyzer::visitLoad.
We only checked that a global is initialized with constants, which is incorrect. We should be checking that GlobalVariable *is* a constant, not just initialized with it.
llvm-svn: 247769
show more ...
|
#
efbba72c |
| 10-Sep-2015 |
James Molloy <james.molloy@arm.com> |
Add GlobalsAA as preserved to a bunch of transforms
GlobalsAA must by definition be preserved in function passes, but the passmanager doesn't know that. Make each pass explicitly preserve GlobalsAA.
Add GlobalsAA as preserved to a bunch of transforms
GlobalsAA must by definition be preserved in function passes, but the passmanager doesn't know that. Make each pass explicitly preserve GlobalsAA.
llvm-svn: 247263
show more ...
|