This is an archive of the discontinued LLVM Phabricator instance.

[WebAssembly][WIP] Vector conversions
AbandonedPublic

Authored by tlively on Aug 29 2018, 2:28 PM.

Details

Summary

This unfinished CL lowers away bitconverts between vector
types in the common case but exposes some hairy stackification issues
when v2i64 and v2f64 are not enabled.

Diff Detail

Event Timeline

tlively created this revision.Aug 29 2018, 2:28 PM
tlively added inline comments.Aug 29 2018, 2:32 PM
lib/Target/WebAssembly/WebAssemblyRegStackify.cpp
569

@aardappel This solution for the problem described in the comment fixes my own test, but causes crashes in the stackification tests. I assume this function is doing other work besides creating a TEE that cannot be skipped. Could you suggest a more robust way to fix this problem?

aheejin added inline comments.Aug 29 2018, 3:08 PM
lib/Target/WebAssembly/WebAssemblyRegStackify.cpp
569

(We talked in person and I'm gonna summarize it here)
Giving those instructions fake opcodes (like 0) can be one solution too.

aardappel added inline comments.Aug 30 2018, 10:30 AM
lib/Target/WebAssembly/WebAssemblyRegStackify.cpp
569

Yes, we'd really want to avoid checks like this, as disabling the explicit locals is something pretty hacky we only do to keep current tests happy.

I think the easiest solution is to convert the affected test to work with explicit locals?

tlively abandoned this revision.Aug 30 2018, 10:59 AM

Superseded by D51498

tlively added inline comments.Aug 30 2018, 11:22 AM
lib/Target/WebAssembly/WebAssemblyRegStackify.cpp
569

Would it be useful to convert the tests to work with explicit locals or is there some other benefit to disabling them?

aardappel added inline comments.Aug 30 2018, 12:09 PM
lib/Target/WebAssembly/WebAssemblyRegStackify.cpp
569

Yes, that is generally useful, we'd like to move to a world where there is as little use of this flag (and --wasm-keep-registers) as possible, with the exception maybe of test that specifically are about the handling of locals and registers in IR.
The presence of these flags complicates matters, e.g. we are still not able to assume in MC that all instructions are the stack versions.