Flatten nested casts in the simple optimizer

Normally, we aren’t supposed to generated any nested casts, since mkCast
takes care to flatten them, but the simple optimizer didn’t use mkCast,
so they could show up after inlining. This isn’t really a problem, since
the simplifier will clean them up immediately anyway, but it can clutter
the -ddump-ds output, and it’s an extremely easy fix.

closes #18112
23 jobs for !3189 with simple-opt-fuse-casts in 495 minutes and 50 seconds (queued for 3 seconds)
latest detached
Status Job ID Name Coverage
  Lint
passed #324151
lint
ghc-linters

00:00:13

passed #324152
lint
lint-linters

00:00:13

passed #324155
lint
lint-submods

00:00:19

passed #324153
lint
lint-testsuite

00:00:15

passed #324154
lint
typecheck-testsuite

00:00:14

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

00:06:53

 
  Build
passed #324157
x86_64-linux
validate-x86_64-linux-deb9-hadrian

01:33:15

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

03:03:16

passed #324161
armv7-linux
validate-armv7-linux-deb9

03:54:12

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

01:37:09

failed #324169
new-x86_64-windows test allowed to fail
validate-i386-windows

00:04:44

passed #324159
x86_64-darwin
validate-x86_64-darwin

01:10:41

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

02:07:22

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

02:40:14

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

01:58:42

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

02:49:53

passed #324166
x86_64-linux
validate-x86_64-linux-fedora27

02:20:38

failed #324168
new-x86_64-windows test allowed to fail
validate-x86_64-windows

01:01:33

failed #324167
new-x86_64-windows test allowed to fail
validate-x86_64-windows-hadrian

05:00:53

 
  Cleanup
passed #324170
x86_64-darwin
cleanup-darwin

00:00:11

 
  Packaging
failed #324171
x86_64-linux allowed to fail
doc-tarball

00:00:37

 
  Testing
manual #324172
x86_64-linux allowed to fail manual
hackage
passed #324173
x86_64-linux
perf-nofib

00:37:34

 
Name Stage Failure
failed
doc-tarball Packaging
Entering 'nofib'
Entering 'utils/haddock'
Entering 'utils/hsc2hs'
Downloading artifacts for validate-x86_64-linux-deb9-debug (324163)...
Downloading artifacts from coordinator... ok id=324163 responseStatus=200 OK token=vBYBmssV
Authenticating with credentials from job payload (GitLab Registry)
$ if [ ! -f "$LINUX_BINDIST" ]; then # collapsed multi-line command
Error: ghc-x86_64-mingw32.tar.xz does not exist. Did the 64-bit Windows job fail?
ERROR: Job failed: exit code 1
failed
validate-i386-windows Full Build
Git branch:   12-4-stable
GO version: go1.10.8
Built: 2019-10-28T12:49:51+0000
OS/Arch: windows/amd64
Uploading artifacts...
Runtime platform
arch=amd64 os=windows pid=4100 revision=05161b14 version=12.4.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
Git branch:   12-9-stable
GO version: go1.13.8
Built: 2020-03-20T13:02:39+0000
OS/Arch: windows/amd64
Uploading artifacts...
Runtime platform
arch=amd64 os=windows pid=6840 revision=4c96e5ad version=12.9.0
WARNING: junit.xml: no matching files
ERROR: No files to upload
ERROR: Job failed: exit status 1
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=324160 responseStatus=201 Created token=AGGcr3E9
Uploading artifacts...
junit.xml: found 1 matching files

Uploading artifacts to coordinator... ok
id=324160 responseStatus=201 Created token=AGGcr3E9
ERROR: Job failed: exit code 1
failed
validate-x86_64-windows-hadrian Full Build The script exceeded the maximum execution time set for the job
   C:/GitLabRunner/builds/2WeHDSFP/0/lexi.lambda/ghc/tmp/ghctest-enuubppe/test   spaces/testsuite/tests/plugins/test-hooks-plugin.run         test-hooks-plugin [fragile] (normal)

Appending 0 stats to file: C:\GitLabRunner\builds\2WeHDSFP\0\lexi.lambda\ghc/performance-metrics.tsv



Running after_script
Uploading artifacts for failed job
ERROR: Job failed: execution took longer than 5h0m0s seconds