-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Avoid temp variable assignments #6575
Merged
Merged
Changes from 18 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
ac44f59
Avoid temp variable assignments
ehsantn ee30e18
Fix definitions after removing temp vars
ehsantn 80b6aaa
Fix typeof_global() to support user provided type for same variable
ehsantn 9b1ed7d
Update parfor reduction handling to not assuming extra temp assignment
ehsantn c53de53
Merge branch 'master' into ehsan/avoid_tmp_vars
ehsantn 77b66d7
Handle replaced temp vars in later assignments
ehsantn 74ddbc8
Handle chained unpack
ehsantn 01ecb02
Avoid creating new inplace binop cases
ehsantn 008efe8
avoid replacing lhs of inplace_binop
ehsantn 2b5597c
avoid removing extra assign in replace_returns since needed for reduc…
ehsantn e5a9772
create tmp var for parfor lowering array value replacement
ehsantn 10700a8
proper check for call/binop reductions
ehsantn e8b6382
handle both cases are reduction detection
ehsantn 63bc44d
handle SetItem/SetAttr case in chained assignment
ehsantn b958d8b
fix copy propagation test
ehsantn a182952
fix dead code elimination tests
ehsantn d3db219
fix ir_utils test function match
ehsantn 92f0071
Merge branch 'master' into ehsan/avoid_tmp_vars
ehsantn e5d537e
Update numba/core/typeinfer.py
ehsantn 2bd6ce4
remove unrelated file
ehsantn 34016d4
add suggested change in array expr
ehsantn b763436
Fix typo in type check
ehsantn ca58e53
Test for temp assignment removal in Interpreter
ehsantn f9f9716
fix flake8
ehsantn 4aec70c
Tests for chained assignment corner cases
ehsantn File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
Empty file.
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
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
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
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
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 |
---|---|---|
|
@@ -30,7 +30,8 @@ | |
|
||
|
||
def test_will_propagate(b, z, w): | ||
x = 3 | ||
x1 = 3 | ||
x = x1 | ||
if b > 0: | ||
y = z + w | ||
else: | ||
|
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 |
---|---|---|
|
@@ -235,4 +235,3 @@ def test_invalid_unpack(self): | |
|
||
if __name__ == '__main__': | ||
unittest.main() | ||
|
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.
Both items in the
class_or_tuple
arg are the same.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.
Good catch. Fixed.