summaryrefslogtreecommitdiff
path: root/compiler/prelude/PrimOp.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/prelude/PrimOp.hs')
-rw-r--r--compiler/prelude/PrimOp.hs7
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/prelude/PrimOp.hs b/compiler/prelude/PrimOp.hs
index cc632169ef..3a849060ff 100644
--- a/compiler/prelude/PrimOp.hs
+++ b/compiler/prelude/PrimOp.hs
@@ -22,7 +22,7 @@ module PrimOp (
primOpOkForSpeculation, primOpOkForSideEffects,
primOpIsCheap, primOpFixity,
- getPrimOpResultInfo, PrimOpResultInfo(..),
+ getPrimOpResultInfo, isComparisonPrimOp, PrimOpResultInfo(..),
PrimCall(..)
) where
@@ -552,6 +552,11 @@ primOpOcc op = case primOpInfo op of
Compare occ _ -> occ
GenPrimOp occ _ _ _ -> occ
+isComparisonPrimOp :: PrimOp -> Bool
+isComparisonPrimOp op = case primOpInfo op of
+ Compare {} -> True
+ _ -> False
+
-- primOpSig is like primOpType but gives the result split apart:
-- (type variables, argument types, result type)
-- It also gives arity, strictness info