Skip to content

Commit 39c0e4a

Browse files
committed
[WebAssembly][NFC] Simplify SIMD bitconvert pattern
Differential Revision: https://reviews.llvm.org/D106680
1 parent 4079037 commit 39c0e4a

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1292,14 +1292,10 @@ defm : NarrowingStorePatGlobalAddrOffOnly<I32x4, store_v4i16_trunc_v4i32>;
12921292

12931293
// Bitcasts are nops
12941294
// Matching bitcast t1 to t1 causes strange errors, so avoid repeating types
1295-
foreach t1 = [v16i8, v8i16, v4i32, v2i64, v4f32, v2f64] in
1296-
foreach t2 = !foldl(
1297-
[]<ValueType>, [v16i8, v8i16, v4i32, v2i64, v4f32, v2f64],
1298-
acc, cur, !if(!eq(!cast<string>(t1), !cast<string>(cur)),
1299-
acc, !listconcat(acc, [cur])
1300-
)
1301-
) in
1302-
def : Pat<(t1 (bitconvert (t2 V128:$v))), (t1 V128:$v)>;
1295+
foreach t1 = AllVecs in
1296+
foreach t2 = AllVecs in
1297+
if !ne(t1, t2) then
1298+
def : Pat<(t1.vt (bitconvert (t2.vt V128:$v))), (t1.vt V128:$v)>;
13031299

13041300
// Extended pairwise addition
13051301
defm "" : SIMDConvert<I16x8, I8x16, int_wasm_extadd_pairwise_signed,

0 commit comments

Comments
 (0)