[Git][ghc/ghc][wip/andreask/inline_div] Always inline divInt and modInt in phase zero.
Andreas Klebinger
gitlab at gitlab.haskell.org
Fri Apr 17 10:46:12 UTC 2020
Andreas Klebinger pushed to branch wip/andreask/inline_div at Glasgow Haskell Compiler / GHC
Commits:
c77b9961 by Andreas Klebinger at 2020-04-17T12:44:13+02:00
Always inline divInt and modInt in phase zero.
This prevents the overhead of a function call for
operations which really only need to be a few instructions.
By always inlining them in phase zero we can:
* Match on them via rules in earlier phases.
* Can constant fold on them in phase zero by
rules on their underlying primitives.
This fixes #18067
- - - - -
1 changed file:
- libraries/ghc-prim/GHC/Classes.hs
Changes:
=====================================
libraries/ghc-prim/GHC/Classes.hs
=====================================
@@ -545,8 +545,8 @@ not False = True
-- put them
-- These functions have built-in rules.
-{-# NOINLINE [0] divInt# #-}
-{-# NOINLINE [0] modInt# #-}
+{-# INLINE [0] divInt# #-}
+{-# INLINE [0] modInt# #-}
divInt# :: Int# -> Int# -> Int#
x# `divInt#` y#
-- Be careful NOT to overflow if we do any additional arithmetic
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c77b99613a4e4e1ecb41ae4e98a15932d41ebb99
--
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/c77b99613a4e4e1ecb41ae4e98a15932d41ebb99
You're receiving this email because of your account on gitlab.haskell.org.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200417/a6c62bb0/attachment.html>
More information about the ghc-commits
mailing list