Add constant folding rule (#16402)

    narrowN (x .&. m)
    m .&. (2^N-1) = 2^N-1
    ==> narrowN x

e.g.  narrow16 (x .&. 0x12FFFF) ==> narrow16 x
24 jobs for master in 401 minutes and 26 seconds (queued for 5 seconds)
Status Job ID Name Coverage
  Lint
passed #215464
lint
lint-linters

00:00:13

passed #215467
lint
lint-submods-branch

00:00:15

passed #215465
lint
lint-testsuite

00:00:15

passed #215466
lint
typecheck-testsuite

00:00:13

 
  Quick Build
passed #215468
x86_64-linux
hadrian-ghc-in-ghci

00:15:35

 
  Build
passed #215471
x86_64-linux
release-x86_64-linux-deb9

01:33:08

passed #215470
x86_64-linux
validate-x86_64-linux-deb9-debug

02:30:35

passed #215472
x86_64-linux
validate-x86_64-linux-deb9-dwarf

01:40:17

passed #215469
x86_64-linux
validate-x86_64-linux-deb9-hadrian

02:38:44

 
  Full Build
failed #215475
aarch64-linux allowed to fail
validate-aarch64-linux-deb9

03:11:08

failed #215476
armv7-linux allowed to fail
validate-armv7-linux-deb9

03:18:05

passed #215477
x86_64-linux
validate-i386-linux-deb9

01:04:23

passed #215474
x86_64-darwin
validate-x86_64-darwin

01:06:29

passed #215478
x86_64-linux
validate-x86_64-linux-deb9-integer-simple

01:22:57

passed #215473
x86_64-linux
validate-x86_64-linux-deb9-unreg-hadrian

02:18:46

passed #215479
x86_64-linux
validate-x86_64-linux-fedora27

01:05:13

failed #215481
x86_64-windows allowed to fail
validate-x86_64-windows

02:43:50

failed #215480
x86_64-windows allowed to fail
validate-x86_64-windows-hadrian

01:27:19

 
  Cleanup
passed #215482
x86_64-darwin
cleanup-darwin

00:00:11

 
  Packaging
passed #215483
x86_64-linux
doc-tarball

00:03:45

 
  Testing
manual #215484
x86_64-linux allowed to fail manual
hackage
passed #215485
x86_64-linux
perf-nofib

00:23:27

 
  Deploy
passed #215486
x86_64-linux
pages

00:01:01

passed pages:deploy

00:00:06

 
Name Stage Failure
failed
validate-armv7-linux-deb9 Full Build
Uploading artifacts...
ghc-armv7-linux-deb9.tar.xz: found 1 matching files
junit.xml: found 1 matching files

performance-metrics.tsv: found 1 matching files

Uploading artifacts to coordinator... ok
id=215476 responseStatus=201 Created token=S7JF9sSy
Uploading artifacts...
junit.xml: found 1 matching files

Uploading artifacts to coordinator... ok
id=215476 responseStatus=201 Created token=S7JF9sSy
ERROR: Job failed: exit code 1
failed
validate-x86_64-windows-hadrian Full Build
ghc.tar.xz: found 1 matching files                 
WARNING: junit.xml: no matching files
WARNING: Failed to load system CertPool:crypto/x509: system root pool is not available on Windows
Uploading artifacts to coordinator... ok
id=215480 responseStatus=201 Created token=uLb2_vY1
Uploading artifacts...
Runtime platform
arch=amd64 os=windows pid=6096 revision=1f513601 version=11.10.1
WARNING: junit.xml: no matching files
ERROR: No files to upload
ERROR: Job failed: exit status 1
failed
validate-x86_64-windows Full Build
junit.xml: found 1 matching files                  
WARNING: Failed to load system CertPool:crypto/x509: system root pool is not available on Windows
Uploading artifacts to coordinator... ok
id=215481 responseStatus=201 Created token=Qp-SGyyu
Uploading artifacts...
Runtime platform
arch=amd64 os=windows pid=2908 revision=1f513601 version=11.10.1
junit.xml: found 1 matching files

WARNING: Failed to load system CertPool:crypto/x509: system root pool is not available on Windows
Uploading artifacts to coordinator... ok
id=215481 responseStatus=201 Created token=Qp-SGyyu
ERROR: Job failed: exit status 2
failed
validate-aarch64-linux-deb9 Full Build
Uploading artifacts...
ghc-aarch64-linux-deb9.tar.xz: found 1 matching files
junit.xml: found 1 matching files

performance-metrics.tsv: found 1 matching files

Uploading artifacts to coordinator... ok
id=215475 responseStatus=201 Created token=5U3UDPDK
Uploading artifacts...
junit.xml: found 1 matching files

Uploading artifacts to coordinator... ok
id=215475 responseStatus=201 Created token=5U3UDPDK
ERROR: Job failed: exit code 1