HomePhabricator

[WebAssembly] Fixed 64-bit indices in br_table

Authored by aardappel on Jul 27 2020, 2:59 PM.

Description

[WebAssembly] Fixed 64-bit indices in br_table

LLVM selection dag assumes "switch" indices are pointer sized, which causes problems for our 32-bit br_table. The new function ensures 32-bit operands don't get unnecessarily extended, and 64-bit operands get truncated.

Note that the changes to the existing test test exactly that: the addition of -NEXT in 2 places ensures no extension is inserted (which the test previously ignored) and that the wrap is present (previously omitted in wasm64 mode).

Differential Revision: https://reviews.llvm.org/D84705

Details

Committed
aardappelJul 30 2020, 10:52 AM
Differential Revision
D84705: [WebAssembly] Fixed 64-bit indices in br_table
Parents
rG5b32518f96ca: [AMDGPU] Do not use undef on indirect source
Branches
Unknown
Tags
Unknown