@@ -22,32 +22,27 @@ multiclass BULK_I<dag oops_r, dag iops_r, dag oops_s, dag iops_s,
22
22
23
23
// Bespoke types and nodes for bulk memory ops
24
24
25
- // memory.copy (may trap on empty ranges)
26
- def wasm_memory_copy_t : SDTypeProfile<0, 5,
25
+ def wasm_memcpylike_t : SDTypeProfile<0, 5,
27
26
[SDTCisInt<0>, SDTCisInt<1>, SDTCisPtrTy<2>, SDTCisPtrTy<3>, SDTCisInt<4>]
28
27
>;
29
- def wasm_memory_copy : SDNode<"WebAssemblyISD::MEMORY_COPY", wasm_memory_copy_t,
28
+ def wasm_memsetlike_t : SDTypeProfile<0, 4,
29
+ [SDTCisInt<0>, SDTCisPtrTy<1>, SDTCisInt<2>, SDTCisInt<3>]
30
+ >;
31
+
32
+ // memory.copy (may trap on empty ranges)
33
+ def wasm_memory_copy : SDNode<"WebAssemblyISD::MEMORY_COPY", wasm_memcpylike_t,
30
34
[SDNPHasChain, SDNPMayLoad, SDNPMayStore]>;
31
35
32
36
// memory.copy with a branch to avoid trapping
33
- def wasm_memcpy_t : SDTypeProfile<0, 5,
34
- [SDTCisInt<0>, SDTCisInt<1>, SDTCisPtrTy<2>, SDTCisPtrTy<3>, SDTCisInt<4>]
35
- >;
36
- def wasm_memcpy : SDNode<"WebAssemblyISD::MEMCPY", wasm_memcpy_t,
37
+ def wasm_memcpy : SDNode<"WebAssemblyISD::MEMCPY", wasm_memcpylike_t,
37
38
[SDNPHasChain, SDNPMayLoad, SDNPMayStore]>;
38
39
39
40
// memory.fill (may trap on empty ranges)
40
- def wasm_memory_fill_t : SDTypeProfile<0, 4,
41
- [SDTCisInt<0>, SDTCisPtrTy<1>, SDTCisInt<2>, SDTCisInt<3>]
42
- >;
43
- def wasm_memory_fill : SDNode<"WebAssemblyISD::MEMORY_FILL", wasm_memory_fill_t,
41
+ def wasm_memory_fill : SDNode<"WebAssemblyISD::MEMORY_FILL", wasm_memsetlike_t,
44
42
[SDNPHasChain, SDNPMayStore]>;
45
43
46
44
// memory.fill with a branch to avoid trapping
47
- def wasm_memset_t : SDTypeProfile<0, 4,
48
- [SDTCisInt<0>, SDTCisPtrTy<1>, SDTCisInt<2>, SDTCisInt<3>]
49
- >;
50
- def wasm_memset : SDNode<"WebAssemblyISD::MEMSET", wasm_memset_t,
45
+ def wasm_memset : SDNode<"WebAssemblyISD::MEMSET", wasm_memsetlike_t,
51
46
[SDNPHasChain, SDNPMayStore]>;
52
47
53
48
// A multiclass for defining Wasm's raw bulk-memory `memory.*` instructions.
0 commit comments