[GHC] #14982: LLVM default -mcpu setting inhibits customization

#14982: LLVM default -mcpu setting inhibits customization -------------------------------------+------------------------------------- Reporter: tommd | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.6.1 Component: Compiler | Version: 8.4.1 (LLVM) | Keywords: | Operating System: Unknown/Multiple Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- With GHC 8.4.1 we are now passing a default `-mcpu` selection to llvm. This default is passed regardless of any explicit command line option such as `-optlc=-mcpu=native`. If/when the user explicitly specifies the architecture we now get a failed build. The error message from LLVM is: {{{ llc: for the -mcpu option: may only occur zero or one times! `llc' failed in phase `LLVM Compiler'. (Exit code: 1) }}} This is when compiling with GHC 8.4.1 as such: {{{ ghc-8.4.1 -fforce-recomp -fllvm -optlc=-mcpu=native -O2 tt.hs }} I suggest we either check for a user option of `mcpu` before adding the default or revert this behavior and allow llvm to take it's (optimistic and less portable) default. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14982 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14982: LLVM default -mcpu setting inhibits customization -------------------------------------+------------------------------------- Reporter: tommd | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.4.2 Component: Compiler (LLVM) | Version: 8.4.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * cc: angerman (added) * milestone: 8.6.1 => 8.4.2 Comment: Any thoughts on what we should do here, Moritz? I'm leaning towards just reverting the `-mcpu` change. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14982#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14982: LLVM default -mcpu setting inhibits customization -------------------------------------+------------------------------------- Reporter: tommd | Owner: (none) Type: bug | Status: new Priority: normal | Milestone: 8.4.2 Component: Compiler (LLVM) | Version: 8.4.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Wiki Page: | -------------------------------------+------------------------------------- Comment (by angerman): The code in question pulls the `mcpu` (and `mattr`) from the new `llvm- targets` file. As such a hack around it right now would be to just modify the `llvm-targets` file. This however is a rather ugly hack as it would apply the logic globally. I guess we could just, as suggested, trop the `mcpu` from `llc` if a custom one is given. I'm not sure how to handle `mattr` though. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14982#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14982: LLVM default -mcpu setting inhibits customization -------------------------------------+------------------------------------- Reporter: tommd | Owner: (none) Type: bug | Status: patch Priority: normal | Milestone: 8.4.2 Component: Compiler (LLVM) | Version: 8.4.1 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: None/Unknown | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): D4548 Wiki Page: | -------------------------------------+------------------------------------- Changes (by angerman): * status: new => patch * differential: => D4548 -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/14982#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#14982: LLVM default -mcpu setting inhibits customization
-------------------------------------+-------------------------------------
Reporter: tommd | Owner: (none)
Type: bug | Status: patch
Priority: normal | Milestone: 8.4.2
Component: Compiler (LLVM) | Version: 8.4.1
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: None/Unknown | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Rev(s): D4548
Wiki Page: |
-------------------------------------+-------------------------------------
Comment (by Ben Gamari
participants (1)
-
GHC