-
-
Notifications
You must be signed in to change notification settings - Fork 40
Peephole optims, var scoping (fixes #153) #349
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
845fe68
Fixes #153
eldritchconundrum fb976dc
Remove unused assignment followed by re-assignment
eldritchconundrum 55e01d8
Remove pure expressions statements
eldritchconundrum 8c2510a
Compact declaration followed by re-assignment
eldritchconundrum f0aef83
Merge branch 'master' into peephole-optim
eldritchconundrum 71acb9d
Fix transformation edge case
eldritchconundrum f6db2c5
Style fix
eldritchconundrum 0e00965
Update compression logs
laurentlb 908d130
Fix compilation of test shaders
eldritchconundrum 4ade6d1
fix compilation
laurentlb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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,24 +1,24 @@ | ||
clod.frag... 8897 => 1528.145 | ||
mouton/mouton.vert... 17026 => 2457.862 | ||
audio-flight-v2.frag 4538 => 891.404 | ||
buoy.frag 4097 => 624.156 | ||
controllable-machinery.frag 7720 => 1220.140 | ||
ed-209.frag 7768 => 1340.423 | ||
buoy.frag 4094 => 622.550 | ||
controllable-machinery.frag 7708 => 1220.329 | ||
ed-209.frag 7766 => 1341.089 | ||
elevated.hlsl 3405 => 603.218 | ||
endeavour.frag 2605 => 534.116 | ||
from-the-seas-to-the-stars.frag 14292 => 2328.094 | ||
frozen-wasteland.frag 4583 => 806.518 | ||
kinder_painter.frag 2867 => 447.669 | ||
frozen-wasteland.frag 4578 => 806.452 | ||
kinder_painter.frag 2865 => 445.014 | ||
leizex.frag 2298 => 510.191 | ||
lunaquatic.frag 5247 => 1049.030 | ||
mandelbulb.frag 2370 => 538.322 | ||
ohanami.frag 3256 => 722.517 | ||
orchard.frag 5537 => 1022.773 | ||
oscars_chair.frag 4651 => 986.364 | ||
robin.frag 6297 => 1053.367 | ||
robin.frag 6295 => 1052.336 | ||
slisesix.frag 4573 => 931.855 | ||
terrarium.frag 3626 => 746.585 | ||
terrarium.frag 3624 => 745.827 | ||
the_real_party_is_in_your_pocket.frag 12111 => 1794.687 | ||
valley_ball.glsl 4386 => 888.496 | ||
yx_long_way_from_home.frag 2947 => 606.406 | ||
Total: 135097 => 23632.338 | ||
Total: 135069 => 23627.076 |
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,13 +1,13 @@ | ||
int n; | ||
float n; | ||
float a(float s) | ||
{ | ||
s=3.; | ||
n=2.; | ||
return s; | ||
} | ||
float main() | ||
float b() | ||
{ | ||
float t=3.; | ||
t-=1.; | ||
return a(1.)+a(5.); | ||
} | ||
} |
This file contains hidden or 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 hidden or 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 hidden or 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 |
---|---|---|
|
@@ -28,10 +28,7 @@ float inl6() | |
return 2.*baz; | ||
} | ||
void notevil() | ||
{ | ||
float x=101.; | ||
x=42.; | ||
} | ||
{} | ||
float inl7() | ||
{ | ||
notevil(); | ||
|
This file contains hidden or 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 |
---|---|---|
|
@@ -29,8 +29,7 @@ float inl6() | |
} | ||
void notevil() | ||
{ | ||
float x=101.; | ||
x=42.; | ||
float x=42.; | ||
} | ||
float inl7() | ||
{ | ||
|
This file contains hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider replacing idents with a boolean, if you just want to know if we've found identName
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it might be more useful to return the names, in case we want to search multiple names without visiting the tree multiple times.