summaryrefslogtreecommitdiff
path: root/llvm/test/CodeGen/WebAssembly/function-pointer64.ll
AgeCommit message (Collapse)Author
2024-12-02[WebAssembly] Define call-indirect-overlong and bulk-memory-opt features ↵Dan Gohman
(#117087) This defines some new target features. These are subsets of existing features that reflect implementation concerns: - "call-indirect-overlong" - implied by "reference-types"; just the overlong encoding for the `call_indirect` immediate, and not the actual reference types. - "bulk-memory-opt" - implied by "bulk-memory": just `memory.copy` and `memory.fill`, and not the other instructions in the bulk-memory proposal. This is split out from https://github.com/llvm/llvm-project/pull/112035. --------- Co-authored-by: Heejin Ahn <aheejin@gmail.com>
2024-07-01[WebAssembly] Update generic and bleeding-edge CPUs (#96584)Heejin Ahn
This updates the list of features in 'generic' and 'bleeding-edge' CPUs in the backend to match https://github.com/llvm/llvm-project/blob/4e0a0eae58f7a6998866719f7eb970096a2a52e9/clang/lib/Basic/Targets/WebAssembly.cpp#L150-L178 This updates existing CodeGen tests in a way that, if a test has separate RUN lines for a reference-types test and a non-reference-types test, I added -mattr=-reference-types to the no-reftype test's RUN command line. I didn't delete existing -mattr=+reference-types lines in reftype tests because having it helps readability. Also, when tests is not really about reference-types but they have to updated because they happen to contain call_indirect lines because now call_indirect will take __indirect_function_table as an argument, I just added the table argument to the expected output. `target-features-cpus.ll` has been updated reflecting the newly added features.
2024-05-23[WebAssembly] Use 64-bit table when targeting wasm64 (#92042)Sam Clegg
See https://github.com/WebAssembly/memory64/issues/51
2022-12-19[WebAssembly] Convert some tests to opaque pointers (NFC)Nikita Popov
2022-03-22[WebAssembly] Always emit functype directives for defined functionsAlex Bradbury
This fixes bug <https://github.com/llvm/llvm-project/issues/54022>. For now this means that defined functions will have two .functype directives emitted. Given discussion in that bug has suggested interest in moving towards using something other than .functype to mark the beginning of a function (which would, as a side-effect, solve this issue), this patch doesn't attempt to avoid that duplication. Some test cases that used CHECK-LABEL: foo rather than CHECK-LABEL: foo: are broken by this change. This patch updates those test cases to always have a colon at the end of the CHECK-LABEL string. Differential Revision: https://reviews.llvm.org/D122134
2021-07-14[WebAssembly] Remove datalayout strings from llc testsThomas Lively
The data layout strings do not have any effect on llc tests and will become misleadingly out of date as we continue to update the canonical data layout, so remove them from the tests. Differential Revision: https://reviews.llvm.org/D105842
2021-03-24[WebAssembly] Rename WasmLimits::Initial to ::Minimum. NFC.Andy Wingo
This patch renames the "Initial" member of WasmLimits to the name used in the spec, "Minimum". In the core WebAssembly specification, the Limits data type has one required "min" member and one optional "max" member, indicating the minimum required size of the corresponding table or memory, and the maximum size, if any. Although the WebAssembly spec does instantiate locally-defined tables and memories with the initial size being equal to the minimum size, it can't impose such a requirement for imports. It doesn't make sense to require an initial size for a memory import, for example. The compiler can only sensibly express the minimum and maximum sizes. See https://github.com/WebAssembly/js-types/blob/master/proposals/js-types/Overview.md#naming-of-size-limits for a related discussion that agrees that the right name of "initial" is "minimum" when querying the type of a table or memory from JavaScript. (Of course it still makes sense for JS to speak in terms of an initial size when it explicitly instantiates memories and tables.) Differential Revision: https://reviews.llvm.org/D99186
2021-03-03[WebAssembly] Swap operand order of call_indirect in text formatAndy Wingo
The WebAssembly text and binary formats have different operand orders for the "type" and "table" fields of call_indirect (and return_call_indirect). In LLVM we use the binary order for the MCInstr, but when we produce or consume the text format we should use the text order. For compilation units targetting WebAssembly 1.0 (without the reference types feature), we omit the table operand entirely. Differential Revision: https://reviews.llvm.org/D97761
2021-03-01[WebAssembly] call_indirect issues table number relocsAndy Wingo
If the reference-types feature is enabled, call_indirect will explicitly reference its corresponding function table via TABLE_NUMBER relocations against a table symbol. Also, as before, address-taken functions can also cause the function table to be created, only with reference-types they additionally cause a symbol table entry to be emitted. Differential Revision: https://reviews.llvm.org/D90948
2021-02-23Revert "[WebAssembly] call_indirect issues table number relocs"Andy Wingo
This reverts commit 861dbe1a021e6439af837b72b219fb9c449a57ae. It broke emscripten -- see https://reviews.llvm.org/D90948#2578843.
2021-02-22[WebAssembly] call_indirect issues table number relocsAndy Wingo
If the reference-types feature is enabled, call_indirect will explicitly reference its corresponding function table via `TABLE_NUMBER` relocations against a table symbol. Also, as before, address-taken functions can also cause the function table to be created, only with reference-types they additionally cause a symbol table entry to be emitted. We abuse the used-in-reloc flag on symbols to indicate which tables should end up in the symbol table. We do this because unfortunately older wasm-ld will carp if it see a table symbol. Differential Revision: https://reviews.llvm.org/D90948
2021-01-19Revert "[WebAssembly] call_indirect issues table number relocs"Sam Clegg
This reverts commit 418df4a6ab35d343cc0f2608c90a73dd9b8d0ab1. This change broke emscripten tests, I believe because it started generating 5-byte a wide table index in the call_indirect instruction. Neither v8 nor wabt seem to be able to handle that. The spec currently says that this is single 0x0 byte and: "In future versions of WebAssembly, the zero byte occurring in the encoding of the call_indirectcall_indirect instruction may be used to index additional tables." So we need to revisit this change. For backwards compat I guess we need to guarantee that __indirect_function_table is always at address zero. We could also consider making this a single-byte relocation with and assert if have more than 127 tables (for now). Differential Revision: https://reviews.llvm.org/D95005
2021-01-19[WebAssembly] call_indirect issues table number relocsAndy Wingo
This patch changes to make call_indirect explicitly refer to the corresponding function table, residualizing TABLE_NUMBER relocs against it. With this change, wasm-ld now sees all references to tables, and can link multiple tables. Differential Revision: https://reviews.llvm.org/D90948
2020-11-18Reland "[lib/Support/YAMLTraits] - Don't print leading zeroes when dumping ↵Georgii Rymar
Hex8/Hex16/Hex32 types." (https://reviews.llvm.org/D90930). This reverts reverting commit fc40a03323a4b265ccbed34a07e281b13c5e8367 and fixes LLD (MachO/wasm) tests that failed previously.
2020-11-18Revert "[lib/Support/YAMLTraits] - Don't print leading zeroes when dumping ↵Georgii Rymar
Hex8/Hex16/Hex32 types." This reverts commit 65fd17c241e22e1671e81efdb683687369c2feb3. It breaks LLD/MachO tests that seems use obj2yaml the check the output.
2020-11-18[lib/Support/YAMLTraits] - Don't print leading zeroes when dumping ↵Georgii Rymar
Hex8/Hex16/Hex32 types. When we produce an YAML output, we also print leading zeroes currently. An output might look like this: ``` - Name: .dynsym Type: SHT_DYNSYM Address: 0x0000000000001000 EntSize: 0x0000000000000018 ``` There are probably no reason to print leading zeroes. It just makes harder to read values. This patch stops printing them. The output becomes like: ``` - Name: .dynsym Type: SHT_DYNSYM Address: 0x1000 EntSize: 0x18 ``` This affects obj2yaml mostly, but also dsymutil and llvm-xray tools output. Differential revision: https://reviews.llvm.org/D90930
2020-07-16[WebAssembly] 64-bit (function) pointer fixes.Wouter van Oortmerssen
Accounting for the fact that Wasm function indices are 32-bit, but in wasm64 we want uniform 64-bit pointers. Includes reloc types for 64-bit table indices. Differential Revision: https://reviews.llvm.org/D83729