[llvm-dev] Codegen pass configs dependent on function attributes?

Quentin Colombet via llvm-dev llvm-dev at lists.llvm.org
Tue May 5 18:56:55 PDT 2020


Hi Amara,

I’ve done that internally for testing purposes and basically the existing GISel pipeline with fallbacks just did what I wanted.
In other words, I always used the GISel pipeline but I added an attribute that triggered a fallback to SDISel for the functions I wanted to compile with SDISel. I had to disable the global-isel-abort thing though. That said, that should be easily fixable.

For the record, I was doing the attribute check in lowerFormalArgument IIRC. I.e., something that is called for every single function at the beginning of the GISel pipeline.

Cheers,
-Quentin

> On May 5, 2020, at 2:48 PM, Amara Emerson <aemerson at apple.com> wrote:
> 
> Hi all.
> 
> I’m trying to get GlobalISel to work better with LTO. At the moment if you enable it via -fglobal-isel, it only adds the -mllvm -global-isel and related options to the cc1 invocation. With LTO, that doesn’t work as we need to encode codegen options into the bitcode, usually via function attributes.
> 
> Does anyone have any ideas on how to achieve this? The only way I can see it working is if we have a unified codegen pipeline for both GISel and SelectionDAG. Then use a function attribute to tell the GISel passes to skip and leave it to FastISel/SelectionDAG which runs afterwards. Likewise, FastISel/SelectionDAG would need to skip the function if it was marked for GISel compilation and we didn’t trigger a fallback.
> 
> Amara



More information about the llvm-dev mailing list