Skip to content

Conversation

yamt
Copy link
Contributor

@yamt yamt commented Feb 9, 2024

No description provided.

src/abi/stack.h Outdated
WASM_UNREACHABLE("unhandled pointerType");
}
block->list.push_back(builder.makeGlobalSet(stackPointer->name, added));
block->list.push_back(builder.makeLocalSet(local, added));
Copy link
Member

Choose a reason for hiding this comment

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

This is the cause of the error on CI, I think - the added node is reused here, but each node is only allowed to appear once in the IR.

The sub operation could be stored in another local but maybe there is a nicer way.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the cause of the error on CI, I think - the added node is reused here, but each node is only allowed to appear once in the IR.

i didn't know that. thank you. fixed.

The sub operation could be stored in another local but maybe there is a nicer way.

i guess it can be something like:

global.get $sp i32.const xxx i32.sub local.tee yyy global.set $sp 

but i'm not sure how it can be done with binaryen IR builder API.

Copy link
Member

Choose a reason for hiding this comment

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

You can use builder.makeLocalTee to replace the makeLocalSet/Get pair here. That is, something like makeGlobalSet(makeLocalTee(..)).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thank you. done.

@kripken kripken merged commit 78516ae into WebAssembly:main Feb 13, 2024
radekdoulik pushed a commit to dotnet/binaryen that referenced this pull request Jul 12, 2024
The LLVM wasm backend grows the stack downwards, and this pass did not fully account for that before.
@gkdn gkdn mentioned this pull request Aug 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants