-
Notifications
You must be signed in to change notification settings - Fork 465
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Propagate INLINE pragmas to PIR (#5183)
This is easy to do, and gives the user a bit more control over inlining. As a bonus, it looks like GHC adds inline pragmas to some things like `DFun`s (dictionary selectors), which is also to our advantage.
- Loading branch information
Showing
14 changed files
with
203 additions
and
167 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
({cpu: 26160853908 | ||
| mem: 112212048}) | ||
({cpu: 26010640908 | ||
| mem: 111558948}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
({cpu: 7353687298 | ||
| mem: 27547140}) | ||
({cpu: 7264792298 | ||
| mem: 27160640}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
({cpu: 14180259305 | ||
| mem: 54764242}) | ||
({cpu: 14076759305 | ||
| mem: 54314242}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
({cpu: 191451412648 | ||
| mem: 725118580}) | ||
({cpu: 190421748648 | ||
| mem: 720641780}) |
3 changes: 3 additions & 0 deletions
3
...-tx-plugin/changelog.d/20230228_124254_michael.peyton-jones_propagate_inline.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
### Added | ||
|
||
- `INLINE` pragmas from Haskell source are now propagated to Plutus IR, so they are guaranteed to be inlined. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
let ~fAdditiveSemigroupInteger : (\a -> a -> a -> a) integer | ||
= \(x : integer) (y : integer) -> addInteger x y | ||
!bad_name : all a. (\a -> a -> a -> a) a -> a -> a -> a | ||
= /\a -> \(v : (\a -> a -> a -> a) a) -> v | ||
~a : integer = bad_name {integer} fAdditiveSemigroupInteger 1 2 | ||
let ~a : integer = addInteger 1 2 | ||
data Bool | Bool_match where | ||
True : Bool | ||
False : Bool | ||
in Bool_match | ||
(ifThenElse {Bool} (lessThanInteger 3 4) True False) {all dead. integer} | ||
(/\dead -> 5) (/\dead -> bad_name {integer} fAdditiveSemigroupInteger a a) | ||
{all dead. dead} | ||
(/\dead -> 5) (/\dead -> | ||
let !x : integer = a | ||
!y : integer = a | ||
in addInteger x y) {all dead. dead} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
({cpu: 2152017 | ||
| mem: 6406}) | ||
({cpu: 1416017 | ||
| mem: 3206}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,12 @@ | ||
let ~fAdditiveSemigroupInteger : (\a -> a -> a -> a) integer | ||
= \(x : integer) (y : integer) -> addInteger x y | ||
!bad_name : all a. (\a -> a -> a -> a) a -> a -> a -> a | ||
= /\a -> \(v : (\a -> a -> a -> a) a) -> v | ||
~a : integer = bad_name {integer} fAdditiveSemigroupInteger 1 2 | ||
let ~a : integer = addInteger 1 2 | ||
data Bool | Bool_match where | ||
True : Bool | ||
False : Bool | ||
in Bool_match | ||
(ifThenElse {Bool} (lessThanInteger 3 4) True False) {integer -> integer} | ||
(\(x : integer) -> bad_name {integer} fAdditiveSemigroupInteger x 5) | ||
(\(x : integer) -> | ||
bad_name | ||
{integer} fAdditiveSemigroupInteger (bad_name | ||
{integer} | ||
fAdditiveSemigroupInteger x a) | ||
a) (bad_name {integer} fAdditiveSemigroupInteger 6 7) | ||
(\(x : integer) -> addInteger x 5) (\(x : integer) -> | ||
let !x : integer | ||
= let !y : integer = a | ||
in addInteger x y | ||
!y : integer = a | ||
in addInteger x y) (addInteger 6 7) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
({cpu: 6533580630 | ||
| mem: 22220573}) | ||
({cpu: 6420742630 | ||
| mem: 21729973}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
({cpu: 15479457 | ||
| mem: 51292}) | ||
({cpu: 13616457 | ||
| mem: 43192}) |
Oops, something went wrong.