[llvm-dev] OptBisect implementation for new pass manager

David Greene via llvm-dev llvm-dev at lists.llvm.org
Mon Oct 1 13:13:29 PDT 2018


Philip Pfaffe <philip.pfaffe at gmail.com> writes:

> Sorry, but I strongly oppose to the road you're suggesting here. As I
> said before the Pass*Manager* is entirely the wrong place to handle
> OptNone, the absolutely the wrong design. It makes sense for function
> *only*, and immediately breaks down everywhere else. Frankly, OptNone
> should take no role in this particular discussion, and I feel like so
> far it has because "We've always done it this way".

I think we're miscommunicating.  I'm not talking about the optnone
function attribute and I don't think Andy is either.  I'm saying that
one option for "skipping" passes that must run is to run them in a
degraded mode where they do just enough to generate functional code.
One way (though maybe not the best way) is to tell the pass to run that
way via the OptLevel::None value.

Even Module passes could run in degraded mode.

> Second, I don't completely subscribe to the arguments towards
> not-skippable passes. Fundamentally: Who decides whether a pass is
> skippable or not? _When_ is a pass skippable, when isn't it? Neither
> the Pass nor the PassManager may actually decide that. The only things
> that do are the pipeline builder and the bisecter. Pipeline builder
> here means the driver tool that constructs and executes the pipeline
> (like clang or opt), not PassBuilder. We can achieve that if we put
> this feature into the instrumentation instead. Here we have the right
> amount of control, at least cost and minimal complexity. Then, all we
> need to is get the default treatment right. If we can agree on whether
> we truly want to not skip some passes 90% of the time, than we can
> just encode that as an overrideable default, such as by tracking a
> list of non-skippable passes right there in the implementation.

I think that's compeletely fine.  You're right that neither the pass
manager nor the pass can make those decisions.  The piece I don't yet
grasp is how we express that a pass is not skippable (or may be run in
degraded mode) in various contexts.  How do we provide the information
so that pass instrumentation may make the correct decision?

I do think running a "must run" pass in degraded mode during bisecting
is very useful.

                             -David


More information about the llvm-dev mailing list