Skip to content

Commit 4dedd25

Browse files
committed
Test updates.
1 parent 2e061f9 commit 4dedd25

File tree

9 files changed

+24
-21
lines changed

9 files changed

+24
-21
lines changed

clang/lib/Basic/Targets/WebAssembly.cpp

-1
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ bool WebAssemblyTargetInfo::initFeatureMap(
165165
Features["mutable-globals"] = true;
166166
Features["nontrapping-fptoint"] = true;
167167
Features["reference-types"] = true;
168-
Features["call-indirect-overlong"] = true;
169168
Features["sign-ext"] = true;
170169
};
171170
auto addLime1Features = [&]() {

lld/test/wasm/lto/Inputs/libcall-archive.ll

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ define void @memcpy() #0 {
55
ret void
66
}
77

8-
attributes #0 = { "target-features"="-bulk-memory" }
8+
attributes #0 = { "target-features"="-bulk-memory,-bulk-memory-opt" }

lld/test/wasm/lto/libcall-archive.ll

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ entry:
1616

1717
declare void @llvm.memcpy.p0.p0.i64(ptr nocapture, ptr nocapture, i64, i1)
1818

19-
attributes #0 = { "target-features"="-bulk-memory" }
19+
attributes #0 = { "target-features"="-bulk-memory,-bulk-memory-opt" }
2020

2121
; CHECK: - Type: CUSTOM
2222
; CHECK-NEXT: Name: name

lld/test/wasm/lto/stub-library-libcall.s

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# RUN: llvm-mc -filetype=obj -triple=wasm32-unknown-unknown -o %t_main.o %t/main.s
33
# RUN: llvm-as %S/Inputs/foo.ll -o %t_foo.o
44
# RUN: llvm-as %S/Inputs/libcall.ll -o %t_libcall.o
5-
# RUN: wasm-ld -mllvm -mattr=-bulk-memory %t_main.o %t_libcall.o %t_foo.o %p/Inputs/stub.so -o %t.wasm
5+
# RUN: wasm-ld -mllvm -mattr=-bulk-memory,-bulk-memory-opt %t_main.o %t_libcall.o %t_foo.o %p/Inputs/stub.so -o %t.wasm
66
# RUN: obj2yaml %t.wasm | FileCheck %s
77

88
# The function `func_with_libcall` will generate an undefined reference to
@@ -12,7 +12,7 @@
1212
# If %t_foo.o is not included in the link we get an undefined symbol reported
1313
# to the dependency of memcpy on the foo export:
1414

15-
# RUN: not wasm-ld -mllvm -mattr=-bulk-memory %t_main.o %t_libcall.o %p/Inputs/stub.so -o %t.wasm 2>&1 | FileCheck --check-prefix=MISSING %s
15+
# RUN: not wasm-ld -mllvm -mattr=-bulk-memory,-bulk-memory-opt %t_main.o %t_libcall.o %p/Inputs/stub.so -o %t.wasm 2>&1 | FileCheck --check-prefix=MISSING %s
1616
# MISSING: stub.so: undefined symbol: foo. Required by memcpy
1717

1818
#--- main.s

lld/test/wasm/multi-table.s

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ call_indirect_explicit_tables:
2626
call_indirect table_b, () -> ()
2727
end_function
2828

29-
# RT-MVP: wasm-ld: error: object file not built with 'reference-types' feature conflicts with import of table table_a by file
29+
# RT-MVP: wasm-ld: error: object file not built with 'call-indirect-overlong' feature conflicts with import of table table_a by file
3030

3131
# CHECK: --- !WASM
3232
# CHECK-NEXT: FileHeader:

llvm/lib/Target/WebAssembly/WebAssemblyInstrBulkMemory.td

+6-6
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,13 @@
1111
///
1212
//===----------------------------------------------------------------------===//
1313

14-
// Instruction requiring HasBulkMemory and the bulk memory prefix byte
14+
// Instruction requiring HasBulkMemoryOpt and the bulk memory prefix byte
1515
multiclass BULK_I<dag oops_r, dag iops_r, dag oops_s, dag iops_s,
1616
list<dag> pattern_r, string asmstr_r = "",
1717
string asmstr_s = "", bits<32> simdop = -1> {
1818
defm "" : I<oops_r, iops_r, oops_s, iops_s, pattern_r, asmstr_r, asmstr_s,
19-
!or(0xfc00, !and(0xff, simdop))>;
19+
!or(0xfc00, !and(0xff, simdop))>,
20+
Requires<[HasBulkMemoryOpt]>;
2021
}
2122

2223
// Bespoke types and nodes for bulk memory ops
@@ -51,8 +52,7 @@ defm INIT_A#B :
5152
(outs), (ins i32imm_op:$seg, i32imm_op:$idx),
5253
[],
5354
"memory.init\t$seg, $idx, $dest, $offset, $size",
54-
"memory.init\t$seg, $idx", 0x08>,
55-
Requires<[HasBulkMemory]>;
55+
"memory.init\t$seg, $idx", 0x08>;
5656

5757
let mayLoad = 1, mayStore = 1 in
5858
defm COPY_A#B :
@@ -89,14 +89,14 @@ defm CPY_A#B : I<(outs), (ins i32imm_op:$src_idx, i32imm_op:$dst_idx,
8989
rc:$dst, rc:$src, rc:$len
9090
)],
9191
"", "", 0>,
92-
Requires<[HasBulkMemory]>;
92+
Requires<[HasBulkMemoryOpt]>;
9393

9494
let usesCustomInserter = 1, isCodeGenOnly = 1, mayStore = 1 in
9595
defm SET_A#B : I<(outs), (ins i32imm_op:$idx, rc:$dst, I32:$value, rc:$size),
9696
(outs), (ins i32imm_op:$idx),
9797
[(wasm_memset (i32 imm:$idx), rc:$dst, I32:$value, rc:$size)],
9898
"", "", 0>,
99-
Requires<[HasBulkMemory]>;
99+
Requires<[HasBulkMemoryOpt]>;
100100

101101
}
102102

llvm/test/CodeGen/WebAssembly/call-indirect.ll

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
; RUN: llc < %s -asm-verbose=false -mattr=-reference-types,call-indirect-overlong -O2 | FileCheck --check-prefixes=CHECK,NOREF %s
1+
; RUN: llc < %s -asm-verbose=false -mattr=-reference-types,-call-indirect-overlong -O2 | FileCheck --check-prefixes=CHECK,NOREF %s
22
; RUN: llc < %s -asm-verbose=false -mattr=+call-indirect-overlong -O2 | FileCheck --check-prefixes=CHECK,REF %s
33
; RUN: llc < %s -asm-verbose=false -O2 --filetype=obj | obj2yaml | FileCheck --check-prefix=OBJ %s
44

llvm/test/CodeGen/WebAssembly/disable-feature.ll

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2-
; RUN: llc < %s -mattr=-sign-ext,-bulk-memory | FileCheck %s
2+
; RUN: llc < %s -mattr=-sign-ext,-bulk-memory,-bulk-memory-opt | FileCheck %s
33

44
target triple = "wasm32-unknown-unknown"
55

@@ -21,7 +21,7 @@ define i8 @not_use_extend8_s(i8 %v, i8 %x) {
2121
ret i8 %a
2222
}
2323

24-
attributes #0 = { "target-features"="+bulk-memory," }
24+
attributes #0 = { "target-features"="+bulk-memory-opt" }
2525

2626
declare void @llvm.memset.p0.i32(ptr, i8, i32, i1)
2727

llvm/test/CodeGen/WebAssembly/target-features-cpus.ll

+10-6
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,14 @@ target triple = "wasm32-unknown-unknown"
1414

1515
; generic: +call-indirect-overlong, +multivalue, +mutable-globals, +reference-types, +sign-ext
1616
; GENERIC-LABEL: .custom_section.target_features,"",@
17-
; GENERIC-NEXT: .int8 6
17+
; GENERIC-NEXT: .int8 8
1818
; GENERIC-NEXT: .int8 43
1919
; GENERIC-NEXT: .int8 11
2020
; GENERIC-NEXT: .ascii "bulk-memory"
2121
; GENERIC-NEXT: .int8 43
22+
; GENERIC-NEXT: .int8 15
23+
; GENERIC-NEXT: .ascii "bulk-memory-opt"
24+
; GENERIC-NEXT: .int8 43
2225
; GENERIC-NEXT: .int8 22
2326
; GENERIC-NEXT: .ascii "call-indirect-overlong"
2427
; GENERIC-NEXT: .int8 43
@@ -37,15 +40,16 @@ target triple = "wasm32-unknown-unknown"
3740
; GENERIC-NEXT: .int8 8
3841
; GENERIC-NEXT: .ascii "sign-ext"
3942

40-
; lime1: +bulk-memory-opt, +call-indirect-overlong, +extended-const, +multivalue, +mutable-globals, +nontrapping-fptoint, +sign-ext
43+
; lime1: +bulk-memory-opt, +call-indirect-overlong, +extended-const, +multivalue,
44+
; +mutable-globals, +nontrapping-fptoint, +sign-ext
4145
; LIME1-LABEL: .custom_section.target_features,"",@
42-
; LIME1-NEXT: .int8 6
46+
; LIME1-NEXT: .int8 7
4347
; LIME1-NEXT: .int8 43
4448
; LIME1-NEXT: .int8 15
45-
; LIME1-NEXT: .int8 "bulk-memory-opt"
49+
; LIME1-NEXT: .ascii "bulk-memory-opt"
4650
; LIME1-NEXT: .int8 43
4751
; LIME1-NEXT: .int8 22
48-
; LIME1-NEXT: .int8 "call-indirect-overlong"
52+
; LIME1-NEXT: .ascii "call-indirect-overlong"
4953
; LIME1-NEXT: .int8 43
5054
; LIME1-NEXT: .int8 14
5155
; LIME1-NEXT: .ascii "extended-const"
@@ -68,7 +72,7 @@ target triple = "wasm32-unknown-unknown"
6872
; +mutable-globals, +nontrapping-fptoint, +relaxed-simd,
6973
; +reference-types, +simd128, +sign-ext, +tail-call
7074
; BLEEDING-EDGE-LABEL: .section .custom_section.target_features,"",@
71-
; BLEEDING-EDGE-NEXT: .int8 14
75+
; BLEEDING-EDGE-NEXT: .int8 16
7276
; BLEEDING-EDGE-NEXT: .int8 43
7377
; BLEEDING-EDGE-NEXT: .int8 7
7478
; BLEEDING-EDGE-NEXT: .ascii "atomics"

0 commit comments

Comments
 (0)