Optimise remainders by powers of two (trac#14437)
ClosedPublic

Authored by Bodigrim on Nov 11 2017, 7:48 PM.

Details

Summary

Add special cases for MO_{S,U}_Rem by powers of two to CmmOpt.cmmMachOpFoldM

Test Plan

validate

Diff Detail

Repository
rGHC Glasgow Haskell Compiler
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.
Bodigrim created this revision.Nov 11 2017, 7:48 PM
bgamari requested changes to this revision.Nov 14 2017, 10:50 AM

This looks reasonable. Just a few small changes for clarity.

compiler/cmm/CmmOpt.hs
373

A set of pens around

x `quot` 2^p

would be nice.

375

Should both of these read MO_S_Shr? I'm having a bit of trouble following this logic.

This revision now requires changes to proceed.Nov 14 2017, 10:50 AM
Bodigrim updated this revision to Diff 14671.Nov 14 2017, 12:38 PM

Fix comments, following review suggestions.

Bodigrim marked 2 inline comments as done.Nov 14 2017, 12:40 PM
This revision is now accepted and ready to land.Nov 17 2017, 10:11 AM
This revision was automatically updated to reflect the committed changes.