[GHC] #10394: LLVM mangler doesn't mangle AVX instructions

#10394: LLVM mangler doesn't mangle AVX instructions -------------------------------------+------------------------------------- Reporter: dobenour | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler | Version: 7.11 (LLVM) | Operating System: Unknown/Multiple Keywords: | Type of failure: Runtime crash Architecture: | Blocked By: Unknown/Multiple | Related Tickets: Test Case: | Blocking: | Differential Revisions: | -------------------------------------+------------------------------------- The LLVM mangler does not currently transform AVX instructions on x86-64 platforms, due to a missing #include. Also, it is significantly more complicated than necessary, due to the file into sections (not needed anymore), and is sensitive to the details of the whitespace in the assembly. I have attached a modified mangler that I believe to be simpler and more robust. I have not tested it, though, as I do not have a recent enough version of LLVM on my machine. I am marking this as `Runtime crash' because that is what would happen if the unchanged AVX instructions made their way into the executable. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10394 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10394: LLVM mangler doesn't mangle AVX instructions -------------------------------------+------------------------------------- Reporter: dobenour | Owner: Type: bug | Status: new Priority: normal | Milestone: 7.12.1 Component: Compiler (LLVM) | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Runtime crash | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by rwbarton): * cc: bgamari (added) Comment: In fact the CPP around the AVX rewriting stuff was broken anyways (should have been `#ifdef REWRITE_AVX` not `#if REWRITE_AVX`) so even if `x86_64_TARGET_ARCH` was set, the result would have been a CPP error. It looks like this never actually worked. Makes me wonder if we even need the AVX rewriting nowadays; or maybe we've told LLVM not to use these instructions, and could now allow it to; or maybe we can tell it not to assume the stack is 32-byte aligned. Your rewrite looks generally sensible, though I haven't examined it closely. cc'ing Ben since I think he did the conversion to use prefix data for tables-next-to-code. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10394#comment:1 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10394: LLVM mangler doesn't mangle AVX instructions -------------------------------------+------------------------------------- Reporter: dobenour | Owner: Type: bug | Status: patch Priority: normal | Milestone: 7.12.1 Component: Compiler (LLVM) | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Runtime crash | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Changes (by thomie): * status: new => patch Comment: Paging bgamari. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10394#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10394: LLVM mangler doesn't mangle AVX instructions -------------------------------------+------------------------------------- Reporter: dobenour | Owner: Type: bug | Status: patch Priority: normal | Milestone: 7.12.1 Component: Compiler (LLVM) | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Runtime crash | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: -------------------------------------+------------------------------------- Comment (by bgamari): Ahh, sorry, this somehow slipped through the cracks. I'll have a look first thing tomorrow. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10394#comment:3 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10394: LLVM mangler doesn't mangle AVX instructions -------------------------------------+------------------------------------- Reporter: dobenour | Owner: Type: bug | Status: patch Priority: normal | Milestone: 7.12.1 Component: Compiler (LLVM) | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Runtime crash | Unknown/Multiple Blocked By: | Test Case: Related Tickets: | Blocking: | Differential Revisions: Phab:D1034 -------------------------------------+------------------------------------- Changes (by bgamari): * differential: => Phab:D1034 Comment: I've opened Phab:D1034 with this. dobenour, you should feel free to commandeer this Diff so it has the proper attribution. I'll review the patch itself on Phab. Indeed it would be nice if we could eliminate this mangling altogether. I'll add it to my queue although that shouldn't discourage others from looking at this. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10394#comment:4 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10394: LLVM mangler doesn't mangle AVX instructions
-------------------------------------+-------------------------------------
Reporter: dobenour | Owner:
Type: bug | Status: patch
Priority: normal | Milestone: 7.12.1
Component: Compiler (LLVM) | Version: 7.11
Resolution: | Keywords:
Operating System: Unknown/Multiple | Architecture:
| Unknown/Multiple
Type of failure: Runtime crash | Test Case:
Blocked By: | Blocking:
Related Tickets: | Differential Revisions: Phab:D1034
-------------------------------------+-------------------------------------
Comment (by Ben Gamari

#10394: LLVM mangler doesn't mangle AVX instructions -------------------------------------+------------------------------------- Reporter: dobenour | Owner: Type: bug | Status: patch Priority: normal | Milestone: 8.0.1 Component: Compiler (LLVM) | Version: 7.11 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1034 Wiki Page: | -------------------------------------+------------------------------------- Comment (by thomie): What is the status here. Fixed? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10394#comment:7 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#10394: LLVM mangler doesn't mangle AVX instructions -------------------------------------+------------------------------------- Reporter: dobenour | Owner: Type: bug | Status: closed Priority: normal | Milestone: 8.0.1 Component: Compiler (LLVM) | Version: 7.11 Resolution: fixed | Keywords: Operating System: Unknown/Multiple | Architecture: | Unknown/Multiple Type of failure: Runtime crash | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Rev(s): Phab:D1034 Wiki Page: | -------------------------------------+------------------------------------- Changes (by bgamari): * status: patch => closed * resolution: => fixed Comment: This particular issue can be closed. The more general problem of the LLVM mangler we'll track as #11138. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/10394#comment:8 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC