[PATCH] D43423: [SimplifyCFG] Create flag to disable simplifyCFG.

Davide Italiano via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Feb 16 18:49:37 PST 2018


davide added subscribers: chandlerc, davide.
davide added a comment.

Some high level comments:

1. This is something that GCC does relatively frequently (adding frontend options to control optimization passes), but LLVM tends to not expose these details.

FWIW, I'd very much prefer the details of the optimizer wouldn't be exposed as frontend flags.

2. I really don't think metadata is the correct way of conveying this information to the optimizer. Among all the other problems, metadata can be stripped willy-nilly. Maybe a function attribute will work better?

Some alternatives which I don't like, but I can't currently propose anything better are:

1. Having a separate optimization pipeline that you use in these cases
2. Having an instrumentation pass that annotates your CFG to prevent passes from destroying coverage signal. That said, I'm not really familiar to comment on whether this is feasible or not.

Please note that completely disabling SimplifyCFG will result in non-trivial performance hits (at least, in my experience), so you might want to evaluate this carefully.
@chandlerc might have thoughts on how to address this.


https://reviews.llvm.org/D43423





More information about the cfe-commits mailing list