Add quotRem and quot built-in rules (#22152)
- Commit 1: add quotRem with dead binders rule
- Commit 2: add rule: (x
quot
l1)quot
l2 ==> xquot
(l1*l2) - Commit 3: fix 64-bit division primops to make them ok-for-speculation when divisor /= 0, just like the other ones
- Commit 4: also make
WordQuotRem2Op
ok-for-speculation
Edited by Sylvain Henry
Merge request reports
Activity
Filter activity
mentioned in issue #22152 (closed)
This seems to run into a Core Lint error:
*** Core Lint errors : in result of Simplifier *** libraries/ghc-prim/GHC/Classes.hs:195:15: error: Occurrence of a dead Id ipv_s5Ep In the RHS of $c==_a3xg :: TrName -> TrName -> Bool In the body of lambda with binder ds_d4ZN :: TrName In the body of lambda with binder ds_d4ZO :: TrName In the body of letrec with binders fail_d4ZW :: (# #) -> Bool In a case alternative: (TrNameS a_aU6 :: Addr#) In a case alternative: (TrNameD ipv_s5Ep :: [Char]) In an occurrence of ipv_s5Ep :: [Char] Substitution: <InScope = {} IdSubst = [] TvSubst = [] CvSubst = []>
added 212 commits
-
6a3d0eac...ed81b448 - 211 commits from branch
master
- 42d43f11 - Add quotRemInt rules (#22152 (closed))
-
6a3d0eac...ed81b448 - 211 commits from branch
added 473 commits
-
42d43f11...2648c09c - 469 commits from branch
master
- fc1d5672 - Add quotRem rules (#22152 (closed))
- 83c5fd40 - Add quot folding rule (#22152 (closed))
- d8ad57d4 - Make Int64/Word64 division ok for speculation too.
- 0a418005 - Make WordQuotRem2Op ok-for-speculation too
Toggle commit list-
42d43f11...2648c09c - 469 commits from branch
- Commit 1: I've changed the implementation to avoid messing with occurrence info. Hopefully it won't trigger core-lint this time!
- Commit 2: I've added the rule mentioned in the ticket
- Commit 3: I've fixed 64-bit division primops to make them ok-for-speculation when divisor /= 0, just like the other ones
- Commit 4: while I was here, I've made
WordQuotRem2Op
ok-for-speculation too
changed title from Draft: add quotRemInt rules (#22152 (closed)) to Add quotRem and quot built-in rules (#22152 (closed))
requested review from @AndreasK
- Resolved by Sylvain Henry
added 148 commits
-
0a418005...2592ab69 - 144 commits from branch
master
- df1ef060 - Add quotRem rules (#22152 (closed))
- e621dd86 - Add quot folding rule (#22152 (closed))
- c709a688 - Make Int64/Word64 division ok for speculation too.
- 0f7f43ff - Make WordQuotRem2Op ok-for-speculation too
Toggle commit list-
0a418005...2592ab69 - 144 commits from branch
- Resolved by Sylvain Henry
- Resolved by Sylvain Henry
- Resolved by Sylvain Henry
- Resolved by Sylvain Henry
268 277 Int32QuotOp -> mkPrimOpRule nm 2 [ nonZeroLit 1 >> binaryLit (int32Op2 quot) mentioned in merge request !10097 (closed)
- Resolved by Sylvain Henry
I will mark this as draft for now. There seems nothing wrong but at least simons comments should be addressed pre-merge.
Please register or sign in to reply