From 49301ad6226d9a83d110bee8c419615dd94f5ded Mon Sep 17 00:00:00 2001 From: Andrew Martin Date: Wed, 13 Nov 2019 11:20:05 -0500 Subject: Implement cstringLength# and FinalPtr This function and its accompanying rule resolve issue #5218. A future PR to the bytestring library will make the internal Data.ByteString.Internal.unsafePackAddress compute string length with cstringLength#. This will improve the status quo because it is eligible for constant folding. Additionally, introduce a new data constructor to ForeignPtrContents named FinalPtr. This additional data constructor, when used in the IsString instance for ByteString, leads to more Core-to-Core optimization opportunities, fewer runtime allocations, and smaller binaries. Also, this commit re-exports all the functions from GHC.CString (including cstringLength#) in GHC.Exts. It also adds a new test driver. This test driver is used to perform substring matches on Core that is dumped after all the simplifier passes. In this commit, it is used to check that constant folding of cstringLength# works. --- testsuite/.gitignore | 1 + 1 file changed, 1 insertion(+) (limited to 'testsuite/.gitignore') diff --git a/testsuite/.gitignore b/testsuite/.gitignore index 737c9f2385..76980608c2 100644 --- a/testsuite/.gitignore +++ b/testsuite/.gitignore @@ -43,6 +43,7 @@ Thumbs.db *.prof.sample.normalised *.run.stdout *.run.stderr +*.dump-simpl *.hp tests/**/*.ps -- cgit v1.2.1