does llvm 16 work with ghc 9.6.1 ?

George Colpitts george.colpitts at gmail.com
Tue Apr 25 19:56:52 UTC 2023


@duog has documented workarounds in
https://gitlab.haskell.org/ghc/ghc/-/issues/21936:


These /ghc/ flags reproduce -O0:

-optlo-passes='module(default<O0>,function(mem2reg),globalopt,function(lower-expect))'
-fno-llvm-tbaa -O0


These /ghc/ flags reproduce -O1:

-optlo-passes='module(default<O1>,globalopt)' -O1 -fno-llvm-tbaa


These /ghc/ flags reproduce -O2:

-optlo-passes='module(default<O2>)' -O2 -fno-llvm-tbaa


On Tue, Apr 25, 2023 at 11:35 AM George Colpitts <george.colpitts at gmail.com>
wrote:

> the bug for this is https://gitlab.haskell.org/ghc/ghc/-/issues/22954
>
> On Tue, Apr 25, 2023 at 10:54 AM George Colpitts <
> george.colpitts at gmail.com> wrote:
>
>> Thanks Moritz. I went ahead and tried it. On a very simple smoke test I
>> observed that "-fllvm works" but "-O2 -fllvm" does not. It fails with
>> "Cannot use -O# with legacy PM.". There is already a bug for changing ghc
>> to work with the new pass manager. It wasn't clear to me that this would be
>> needed for llvm 16. It seems that it is.
>>
>> Cheers
>> George
>>
>>
>>
>>
>> On Mon, Apr 24, 2023 at 10:02 PM Moritz Angermann <
>> moritz.angermann at gmail.com> wrote:
>>
>>> Hi George,
>>>
>>> while I personally haven’t tried. I’d encourage you to just try. Unless
>>> they changed their textual IR (they don’t do that often anymore), it could
>>> just work.
>>>
>>> Whether or not you run into bugs for the specific target you are looking
>>> at, is hard to say without knowing the target.
>>>
>>> My suggestion would be to just try building your configuration with the
>>> llvm backend against llvm16, and run validate if you can.
>>>
>>> Cheers,
>>>   Moritz
>>>
>>> On Tue, 25 Apr 2023 at 4:50 AM, George Colpitts <
>>> george.colpitts at gmail.com> wrote:
>>>
>>>> Hi
>>>>
>>>> Does anybody know if  llvm 16 works with ghc 9.6.1 ?
>>>>
>>>> Thanks
>>>> George
>>>>
>>>> _______________________________________________
>>>> ghc-devs mailing list
>>>> ghc-devs at haskell.org
>>>> http://mail.haskell.org/cgi-bin/mailman/listinfo/ghc-devs
>>>>
>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-devs/attachments/20230425/7b378e14/attachment.html>


More information about the ghc-devs mailing list