From e61d2d47c4942c829ec98016be5aa5ae36982524 Mon Sep 17 00:00:00 2001 From: Sylvain Henry Date: Fri, 30 Apr 2021 11:28:21 +0200 Subject: Make sized division primops ok-for-spec (#19026) --- compiler/GHC/Core/Utils.hs | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) (limited to 'compiler/GHC/Core/Utils.hs') diff --git a/compiler/GHC/Core/Utils.hs b/compiler/GHC/Core/Utils.hs index cee7d4f68b..01b35f4b1f 100644 --- a/compiler/GHC/Core/Utils.hs +++ b/compiler/GHC/Core/Utils.hs @@ -1633,7 +1633,7 @@ app_ok primop_ok fun args -- to take the arguments into account PrimOpId op - | isDivOp op + | primOpIsDiv op , [arg1, Lit lit] <- args -> not (isZeroLit lit) && expr_ok primop_ok arg1 -- Special case for dividing operations that fail @@ -1686,19 +1686,6 @@ altsAreExhaustive (Alt con1 _ _ : alts) -- we behave conservatively here -- I don't think it's important -- enough to deserve special treatment --- | True of dyadic operators that can fail only if the second arg is zero! -isDivOp :: PrimOp -> Bool --- This function probably belongs in GHC.Builtin.PrimOps, or even in --- an automagically generated file.. but it's such a --- special case I thought I'd leave it here for now. -isDivOp IntQuotOp = True -isDivOp IntRemOp = True -isDivOp WordQuotOp = True -isDivOp WordRemOp = True -isDivOp FloatDivOp = True -isDivOp DoubleDivOp = True -isDivOp _ = False - {- Note [exprOkForSpeculation: case expressions] ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ exprOkForSpeculation accepts very special case expressions. -- cgit v1.2.1