Closed bdunderscore closed 4 years ago
Note to self: Before merging, I need to audit to make sure that in cases where (implicit) type conversion is required, we don't attempt to use the same heap variable for the pre-conversion type, to avoid unnecessary extra heap allocations.
Verified that casts work as intended, should be ready for review now.
👍 will do, thanks!
Found a bug in array indexing that could result in unnecessary copies, will add some more commits to fix shortly.
Regression:
uint x;
x <<= 1;
seems to fail to compile now. Will update later tonight.
@Merlin-san I've backed out the const conversion changes from this branch. It's looking like the const conversion stuff will be more complicated than I thought, requiring interactions with function call inference, so it's probably best to leave it until there's an IR as you suggested.
This change introduces two related optimization to reduce unnecessary copies:
As part of this, we also fix some issues where function call parameters or array expressions would not respect proper order of operations.
Fixes: #15