
#9661: Branchless ==# is compiled to branchy code -------------------------------------+------------------------------------- Reporter: dfeuer | Owner: bgamari Type: feature request | Status: new Priority: normal | Milestone: Component: Compiler | Version: 7.9 Resolution: | Keywords: Operating System: Unknown/Multiple | Architecture: Type of failure: Runtime | Unknown/Multiple performance bug | Test Case: Blocked By: | Blocking: Related Tickets: | Differential Revisions: D854 -------------------------------------+------------------------------------- Comment (by rwbarton): Sorry, my previous comment was poorly worded at best. I'm sure there are cases where the best non-branching code has better performance than the best branching code. However, I'm not at all convinced that it makes sense to try to give the user control over whether to generate branching or non- branching code. It's at odds with the notion of an optimizing compiler, and as I mentioned earlier even C compilers do not give you that kind of control once optimizations are enabled. GHC should just generate whatever it thinks is best, and if the user really needs to generate particular assembly, they can write that assembly manually. I would need to see some ''very'' dramatic numbers to change this point of view; and currently we have no numbers at all. I do think that expanding GHC's bag of tricks for post-Stg code generation (as in #10124 for example) is practical and worthwhile, though it will probably need more work in the native code generator as well for best results. -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/9661#comment:23 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler