[llvm-dev] [RFC] Expressing preserved-relations between passes from different modules (was: Re: Linker issue)
Nicolai Hähnle-Montoro via llvm-dev
llvm-dev at lists.llvm.org
Mon Jun 3 01:35:21 PDT 2019
re-upping and renaming this thread to get some attention, as we'd like
some feedback on a change that affects the future design direction.
The concrete problem: We would like to mark the LCSSA pass as
preserving the StackProtector pass in order to be able to properly
express all dependencies we have. Unfortunately, those passes are
defined in different modules that do not (and should not) depend on
each other, which causes linking to fail.
Our proposal is to introduce a collection of cross-module pass IDs in
the core module (lib/IR) to work around such issues. This is done by
the RFC patch at https://reviews.llvm.org/D62802.
The only potential alternative I can see would be to generate the IDs
using some kind of template magic and then rely on (runtime) linker
magic to common the generated symbols. That feels like a bit too much
magic for a fundamentally simple problem to me, hence the more
low-tech proposal in the linked Phabricator review.
Please let us know your thoughts!
On Tue, May 14, 2019 at 3:55 PM Ryan Taylor via llvm-dev
<llvm-dev at lists.llvm.org> wrote:
> Some background: We have an issue with in loop values being correctly marked uniform but the out of loop uses can be non-uniform. Currently the out of loop users are not marked as divergent because the in loop value is uniform inside the loop. We have gotten around this problem for the moment by applying LCSSA which inserts a PHI in the loop exit for the in loop uniform value that allows the divergent info to be passed onto isel.
> The LCSSA is being inserted into XXXDAGToDAGISel class but this causes a pass scheduling conflict with StackProtector. So what we've done is try to preserve StackProtector in LCSSA, the issue is that the linker fails in Debug build (but not Release build).
> StackProtector lies in CodeGen while LCSSA lies in Tranforms/Utils.
> Matt had mentioned to me that you can't refer to a preserved pass if it's not on the same library and that it might make sense to move the transform IDs into a separate library. We need a way to mark transforms/analyses as preserved without depending on linking the transform itself.
> LLVM Developers mailing list
> llvm-dev at lists.llvm.org
Lerne, wie die Welt wirklich ist,
aber vergiss niemals, wie sie sein sollte.
More information about the llvm-dev