Skip to content
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

Fix inverted condition in NativeRewriter #217

Merged
merged 1 commit into from
Feb 19, 2024

Conversation

DutChen18
Copy link
Member

In PR #210, this condition was accidentally inverted. The only change here is to uninvert it again.

I assume this wasn't causing any issues because most functions only have one BasicBlock. I'm not sure the if statement makes any sense to begin with, but it's hard to tell without an example of a function that has multiple BasicBlocks. The surrounding loop does more than just look for a lower constructor, it also calls PromoteMemToReg on some alloca instructions, so it seems weird to exit early when the lower constructor was found.

I'm ignoring all of these concerns for now, and only revert condition back to what it was before PR #210, regardless of whether this behaviour was correct or not.

In PR #210, this condition was accidentally inverted. The only change
here is to uninvert it again.

I assume this wasn't causing any issues because most functions only have
one BasicBlock. I'm not sure the if statement makes any sense to begin
with, but it's hard to tell without an example of a function that has
multiple BasicBlocks. The surrounding loop does more than just look for
a lower constructor, it also calls `PromoteMemToReg` on some alloca
instructions, so it seems weird to exit early when the lower constructor
was found.

I'm ignoring all of these concerns for now, and only revert condition
back to what it was before PR #210, regardless of whether this behaviour
was correct or not.
@DutChen18 DutChen18 requested a review from yuri91 February 19, 2024 14:57
@yuri91 yuri91 merged commit 8d76c47 into master Feb 19, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants