[PATCH] D141005: [lld][WebAssembly] Fix memory.fill argument in 64-bit mode
Sam Clegg via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Jan 4 11:30:58 PST 2023
sbc100 created this revision.
Herald added subscribers: pmatos, asb, wingo, ecnelises, sunfish, jgravelle-google, dschuff.
Herald added a project: All.
sbc100 requested review of this revision.
Herald added subscribers: llvm-commits, aheejin.
Herald added a project: LLVM.
This only effects folks building with wasm64 + shared memory which
is not currently a supported configuration in emscripten or any other
wasm toolchain.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D141005
Files:
lld/test/wasm/data-segments.ll
lld/wasm/Writer.cpp
Index: lld/wasm/Writer.cpp
===================================================================
--- lld/wasm/Writer.cpp
+++ lld/wasm/Writer.cpp
@@ -1225,7 +1225,7 @@
if (s->isBss) {
writeI32Const(os, 0, "fill value");
- writeI32Const(os, s->size, "memory region size");
+ writePtrConst(os, s->size, is64, "memory region size");
writeU8(os, WASM_OPCODE_MISC_PREFIX, "bulk-memory prefix");
writeUleb128(os, WASM_OPCODE_MEMORY_FILL, "memory.fill");
writeU8(os, 0, "memory index immediate");
Index: lld/test/wasm/data-segments.ll
===================================================================
--- lld/test/wasm/data-segments.ll
+++ lld/test/wasm/data-segments.ll
@@ -222,7 +222,7 @@
; PIC-DIS-NEXT: global.get 1
; PIC-DIS-NEXT: [[PTR]].add
; DIS-NEXT: i32.const 0
-; DIS-NEXT: i32.const 10000
+; DIS-NEXT: [[PTR]].const 10000
; DIS-NEXT: memory.fill 0
; NOPIC-DIS-NEXT: [[PTR]].const 11064
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D141005.486349.patch
Type: text/x-patch
Size: 1058 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230104/19809a42/attachment.bin>
More information about the llvm-commits
mailing list