[llvm] [WebAssembly] Fold unsigned offset (PR #145829)
via llvm-commits
llvm-commits at lists.llvm.org
Wed Jul 2 08:48:57 PDT 2025
================
@@ -66,18 +66,18 @@ try.cont: ; preds = %entry, %catch.start
; CHECK-LABEL: test1:
; In static linking, we load GCC_except_table as a constant directly.
-; NOPIC: i[[PTR]].const $push[[CONTEXT:.*]]=, __wasm_lpad_context
+; NOPIC: i[[PTR]].const $push[[CONTEXT:.*]]=, [[ALIGNMENT]]
; NOPIC-NEXT: i[[PTR]].const $push[[EXCEPT_TABLE:.*]]=, GCC_except_table1
-; NOPIC-NEXT: i[[PTR]].store {{[48]}}($pop[[CONTEXT]]), $pop[[EXCEPT_TABLE]]
+; NOPIC-NEXT: i[[PTR]].store __wasm_lpad_context($pop[[CONTEXT]]), $pop[[EXCEPT_TABLE]]
----------------
badumbatish wrote:
i tried swapping Addr and Offset in WebAssemblyISelDAGToDAG and it seems it generates bad machine code on several test case, for example: cfg-stackify-eh.ll
```
*** Bad machine code: Expected a register operand. ***
- function: two_catches
- basic block: %bb.1 catch.start (0x149811920)
- instruction: STORE_I32_A32 2, killed %3:i32, @__wasm_lpad_context, killed %2:i32, implicit-def dead $arguments :: (store (s32) into `ptr getelementptr inbounds ({ i32, ptr, i32 }, ptr @__wasm_lpad_context, i32 0, i32 1)`)
- operand 2: @__wasm_lpad_context
*** Bad machine code: Expected a register operand. ***
- function: two_catches
- basic block: %bb.1 catch.start (0x149811920)
- instruction: %1:i32 = LOAD_I32_A32 2, killed %6:i32, @__wasm_lpad_context, implicit-def dead $arguments :: (dereferenceable load (s32) from `ptr getelementptr inbounds ({ i32, ptr, i32 }, ptr @__wasm_lpad_context, i32 0, i32 2)`)
- operand 3: @__wasm_lpad_context
LLVM ERROR: Found 2 machine code errors.
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
```
https://github.com/llvm/llvm-project/pull/145829
More information about the llvm-commits
mailing list