[PATCH] D115327: [WebAssembly] Fix reftype load/store match with idx from call
Paulo Matos via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jan 13 02:05:07 PST 2022
This revision was automatically updated to reflect the committed changes.
Closed by commit rG97ef15ad7697: [WebAssembly] Fix reftype load/store match with idx from call (authored by pmatos).
Changed prior to commit:
https://reviews.llvm.org/D115327?vs=398922&id=399596#toc
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D115327/new/
https://reviews.llvm.org/D115327
Files:
llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
llvm/test/CodeGen/WebAssembly/externref-tableset.ll
Index: llvm/test/CodeGen/WebAssembly/externref-tableset.ll
===================================================================
--- llvm/test/CodeGen/WebAssembly/externref-tableset.ll
+++ llvm/test/CodeGen/WebAssembly/externref-tableset.ll
@@ -79,4 +79,19 @@
ret void
}
+declare i32 @get_table_slot() local_unnamed_addr
+
+define void @set_externref_table_with_id_from_call(%externref %g) {
+; CHECK-LABEL: set_externref_table_with_id_from_call:
+; CHECK-NEXT: .functype set_externref_table_with_id_from_call (externref) -> ()
+; CHECK-NEXT: call get_table_slot
+; CHECK-NEXT: local.get 0
+; CHECK-NEXT: table.set externref_table
+; CHECK-NEXT: end_function
+ %id = call i32 @get_table_slot()
+ %p = getelementptr [0 x %externref], [0 x %externref] addrspace (1)* @externref_table, i32 0, i32 %id
+ store %externref %g, %externref addrspace(1)* %p
+ ret void
+}
+
; CHECK: .tabletype externref_table, externref
Index: llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
===================================================================
--- llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
+++ llvm/lib/Target/WebAssembly/WebAssemblyISelLowering.cpp
@@ -1491,8 +1491,7 @@
if (GA) {
// We are in Case 2 above.
Idx = Base->getOperand(1);
- if (!Idx || GA->getNumValues() != 1 || Idx->getNumValues() != 1)
- return false;
+ assert(GA->getNumValues() == 1);
} else {
// This might be Case 1 above (or an error)
SDValue V = Base->getOperand(0);
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D115327.399596.patch
Type: text/x-patch
Size: 1543 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220113/07f3a9e5/attachment.bin>
More information about the llvm-commits
mailing list