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 input-register-conflict checking in native registerizeHarder #3080

Merged
merged 2 commits into from
Dec 15, 2014
Merged

Fix input-register-conflict checking in native registerizeHarder #3080

merged 2 commits into from
Dec 15, 2014

Conversation

rfk
Copy link
Contributor

@rfk rfk commented Dec 15, 2014

This seems to fix the issue mentioned at d8f7e89#commitcomment-8956410, where the native registerizeHarder pass would sometimes use more registers than necessary.

In the js version, the block->firstKillLoc[name] <= inputDeadLoc[reg] comparison would return false when inputDeadLockreg] is undefined. AFAICT for the C++ version, inputDeadLoc[reg] will return zero when reg is not in the map, which can cause the comparison to be true. So we should handle missing entries explicitly in this case.

(I also fixed some grammar/typos in comments that I noticed while I was in there)

@kripken
Copy link
Member

kripken commented Dec 15, 2014

Thanks!

Yeah, in C++ it inserts a zero by default. This is one of the things it is easy to mess up when converting between the two languages ;)

kripken added a commit that referenced this pull request Dec 15, 2014
Fix input-register-conflict checking in native registerizeHarder
@kripken kripken merged commit 76bb84e into emscripten-core:incoming Dec 15, 2014
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