Make exprIsConApp_maybe work better for literals strings
authorSimon Peyton Jones <simonpj@microsoft.com>
Thu, 23 Feb 2017 14:41:08 +0000 (14:41 +0000)
committerSimon Peyton Jones <simonpj@microsoft.com>
Fri, 24 Feb 2017 09:04:46 +0000 (09:04 +0000)
commita6e13d502ef46de854ec1babcd764ccce68c95e3
treef6ace9b7af1b394546a885f1b2bb0699b67ccc37
parentc88b7c9a06e387c3b9bdb359b9e1e4f3a9fba696
Make exprIsConApp_maybe work better for literals strings

There are two things here

* Use exprIsLiteral_maybe to "look through" a variable bound
  to a literal string.

* Add CONLIKE to the NOINLINE pragma for unpackCString# and
  unpackCStringUtf8#

See Trac #13317, Trac #10844, and
Note [exprIsConApp_maybe on literal strings] in CoreSubst

I did a nofib run and got essentially zero change except for one
2.2% improvement in allocation for 'pretty'.
compiler/coreSyn/CoreSubst.hs
libraries/ghc-prim/GHC/CString.hs
testsuite/tests/simplCore/should_compile/Makefile
testsuite/tests/simplCore/should_compile/T13317.hs [new file with mode: 0644]
testsuite/tests/simplCore/should_compile/T13317.stdout [new file with mode: 0644]
testsuite/tests/simplCore/should_compile/T3234.stderr
testsuite/tests/simplCore/should_compile/all.T