[PATCH] D84705: [WebAssembly] Fixed 64-bit indices in br_table

Wouter van Oortmerssen via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 27 15:04:24 PDT 2020


aardappel created this revision.
aardappel added reviewers: tlively, dschuff, aheejin.
Herald added subscribers: llvm-commits, sunfish, hiraditya, jgravelle-google, sbc100.
Herald added a project: LLVM.

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).


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D84705

Files:
  llvm/lib/Target/WebAssembly/WebAssemblyFixBrTableDefaults.cpp
  llvm/test/CodeGen/WebAssembly/switch.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84705.281060.patch
Type: text/x-patch
Size: 9056 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200727/0db8ea73/attachment.bin>


More information about the llvm-commits mailing list