diff options
author | Sylvain Henry <sylvain@haskus.fr> | 2023-01-27 14:10:50 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2023-04-13 08:50:33 -0400 |
commit | 1148ac723d6a879593dc4e7941a49b8e74e4c7d7 (patch) | |
tree | 2af3c25e75c9fd22e1e754ce260e917b742f11dc /compiler/GHC | |
parent | 4dd021227559e1bc70cdaed12e45ff5459c33d27 (diff) | |
download | haskell-1148ac723d6a879593dc4e7941a49b8e74e4c7d7.tar.gz |
Make Int64/Word64 division ok for speculation too.
Only when the divisor is definitely non-zero.
Diffstat (limited to 'compiler/GHC')
-rw-r--r-- | compiler/GHC/Builtin/PrimOps.hs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/compiler/GHC/Builtin/PrimOps.hs b/compiler/GHC/Builtin/PrimOps.hs index c9f0d56aaf..a6faaa09b1 100644 --- a/compiler/GHC/Builtin/PrimOps.hs +++ b/compiler/GHC/Builtin/PrimOps.hs @@ -551,36 +551,42 @@ primOpIsCheap op = primOpOkForSpeculation op primOpIsDiv :: PrimOp -> Bool primOpIsDiv op = case op of - -- TODO: quotRemWord2, Int64, Word64 + -- TODO: quotRemWord2 IntQuotOp -> True Int8QuotOp -> True Int16QuotOp -> True Int32QuotOp -> True + Int64QuotOp -> True IntRemOp -> True Int8RemOp -> True Int16RemOp -> True Int32RemOp -> True + Int64RemOp -> True IntQuotRemOp -> True Int8QuotRemOp -> True Int16QuotRemOp -> True Int32QuotRemOp -> True + -- Int64QuotRemOp doesn't exist (yet) WordQuotOp -> True Word8QuotOp -> True Word16QuotOp -> True Word32QuotOp -> True + Word64QuotOp -> True WordRemOp -> True Word8RemOp -> True Word16RemOp -> True Word32RemOp -> True + Word64RemOp -> True WordQuotRemOp -> True Word8QuotRemOp -> True Word16QuotRemOp -> True Word32QuotRemOp -> True + -- Word64QuotRemOp doesn't exist (yet) FloatDivOp -> True DoubleDivOp -> True |