Commit 3ddfcc95 authored by Ben Gamari's avatar Ben Gamari Committed by Ben Gamari

PrelRules: Fix constant folding for WordRemOp

Test Plan: Validate with testcase in D2002

Reviewers: austin, simonpj

Reviewed By: simonpj

Subscribers: simonpj, thomie

Differential Revision: https://phabricator.haskell.org/D2004

GHC Trac Issues: #11702
parent 220a0b93
......@@ -134,7 +134,12 @@ primOpRules nm WordMulOp = mkPrimOpRule nm 2 [ binaryLit (wordOp2 (*))
primOpRules nm WordQuotOp = mkPrimOpRule nm 2 [ nonZeroLit 1 >> binaryLit (wordOp2 quot)
, rightIdentityDynFlags onew ]
primOpRules nm WordRemOp = mkPrimOpRule nm 2 [ nonZeroLit 1 >> binaryLit (wordOp2 rem)
, rightIdentityDynFlags onew ]
, leftZero zerow
, do l <- getLiteral 1
dflags <- getDynFlags
guard (l == onew dflags)
retLit zerow
, equalArgs >> retLit zerow ]
primOpRules nm AndOp = mkPrimOpRule nm 2 [ binaryLit (wordOp2 (.&.))
, idempotent
, zeroElem zerow ]
......
......@@ -66,4 +66,4 @@ test('T9407', normal, compile_and_run, [''])
test('T9810', normal, compile_and_run, [''])
test('T10011', normal, compile_and_run, [''])
test('T10962', omit_ways(['ghci']), compile_and_run, [''])
test('T11702', expect_broken(11702), compile_and_run, [''])
test('T11702', normal, compile_and_run, [''])
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment