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

wazevo: pass address.wast #1649

Merged
merged 1 commit into from
Aug 22, 2023
Merged

wazevo: pass address.wast #1649

merged 1 commit into from
Aug 22, 2023

Conversation

mathetake
Copy link
Member

@mathetake mathetake commented Aug 22, 2023

Signed-off-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
Comment on lines -191 to +195
if _, ok := info.defs[def]; ok {
// This must be a bug in lowering logic in the ISA-specific code.
// In short, a virtual register must be defined only once because that's the invariant of
// liveness analysis result used in the current implementation. If you reach here, you can either
// use "temporary" physical register (like x27 in AArch64), or simply allocate a new virtual
// register for the additional definition. In any ways, such a new virtual register doesn't cost
// at all in the final code because they are instantly killed and won't interfere with other
// virtual registers later on.
//
// TODO: this should be enforced globally, not just per block. But that can be costly to check.
panic(fmt.Sprintf("BUG: multiple definitions found for a virtual register %s", def.String()))
if _, ok := info.defs[def]; !ok {
// This means that this VReg is defined multiple times in a series of instructions
// e.g. loading arbitrary constant in arm64, and we only need the earliest
// definition to construct live range.
info.defs[def] = pos
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI @evacchi I relaxed the restriction from #1639

@mathetake mathetake marked this pull request as ready for review August 22, 2023 22:58
@mathetake mathetake merged commit adaa417 into main Aug 22, 2023
51 of 52 checks passed
@mathetake mathetake deleted the wazevoaddress branch August 22, 2023 23:04
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.

1 participant