[GHC] #15876: Function versioning instead of compilation flags...

#15876: Function versioning instead of compilation flags... -------------------------------------+------------------------------------- Reporter: MichalGajda | Owner: (none) Type: feature | Status: new request | Priority: normal | Milestone: 8.6.3 Component: Compiler | Version: 8.6.2 (Linking) | Keywords: simd, | Operating System: Unknown/Multiple flavors, speed | Architecture: | Type of failure: None/Unknown Unknown/Multiple | Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- Wanting to take advantage of SIMD, we need to compile a different implementation of certain core libraries functions (like `ByteString` c_memchr to make it 16x faster). This would require recompiling most of the libraries for new flags. Instead, it would be much simpler to add function versioning a la GCC: https://lwn.net/Articles/691932/ This would allow us to write code like this: {-# target(avx512) #-} c_memchr = ...SIMD code... {-# !target(avx512) #-} c_memchr = ...current code... We currently use special libraries for these kind of speedups, but it would be much better to use SIMD across few key functions in all libraries to get 16x speedups across the board (`c_memchr` for parsing.) Ideally we could also use it to remove some of _flavoring_ in the future. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15876 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler

#15876: Function versioning instead of compilation flags... -------------------------------------+------------------------------------- Reporter: MichalGajda | Owner: (none) Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 8.6.2 (Linking) | Keywords: simd, Resolution: | flavors, speed 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 bgamari): Indeed this is an intriguing opportunity. Perhaps you would like to give it a try? -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/15876#comment:2 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler
participants (1)
-
GHC