diff options
| author | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2017-09-14 06:51:21 +0200 |
|---|---|---|
| committer | Luc Van Oostenryck <luc.vanoostenryck@gmail.com> | 2017-11-13 12:48:45 +0100 |
| commit | b1f6b9740bd8a542ece0d0ec5c41d26b2e0ca56a (patch) | |
| tree | 04b6baf8e0503c4423258b4f721a9545f535e025 /linearize.c | |
| parent | 092e22f01df4dfd54a55bec0c40e8cda9b6a7161 (diff) | |
| download | sparse-dev-b1f6b9740bd8a542ece0d0ec5c41d26b2e0ca56a.tar.gz | |
dump-ir: allow to skip the optimization pass(es)
For experimenting with some optimization and the linearization
process, it's useful to see the raw result, without any kind
of optimization.
This patch test PASS_OPTIM (-foptim-{enable,disable}) to see
if the whole optimization process can be skipped.
Note: ideally, this should be coupled with -O0 but this
could create problems with the 'sparse' tools when used
on file wit an optimization level of 0 (since the sparse
tools depends on the optimization for the context checking
to be accurate and in general diagnostics also need
at least basic optimization).
Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Diffstat (limited to 'linearize.c')
| -rw-r--r-- | linearize.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/linearize.c b/linearize.c index 31cc9480..55448a8c 100644 --- a/linearize.c +++ b/linearize.c @@ -2238,6 +2238,8 @@ static struct entrypoint *linearize_fn(struct symbol *sym, struct symbol *base_t if (fpasses & PASS_MEM2REG) simplify_symbol_usage(ep); + if (!(fpasses & PASS_OPTIM)) + return ep; repeat: /* * Remove trivial instructions, and try to CSE |
