From c489415792c1491882df0235f589a36879e306db Mon Sep 17 00:00:00 2001 From: Alexey Radul Date: Mon, 26 Jun 2023 13:32:16 -0400 Subject: [PATCH] Test vectorizing through `tile` and its index set. --- tests/opt-tests.dx | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/opt-tests.dx b/tests/opt-tests.dx index 76cecb5a9..b53762008 100644 --- a/tests/opt-tests.dx +++ b/tests/opt-tests.dx @@ -211,3 +211,19 @@ _ = yield_accum (AddMonoid Int32) \result. -- CHECK: [[mat1:v#[0-9]+]]:<16xInt32> = vbroadcast -- CHECK: [[prodj:v#[0-9]+]]:<16xInt32> = %imul [[mat1]] [[mat2j]] -- CHECK: extend [[refj]] [[prodj]] + +"vectorizing through the `tile` combinator and its funny index set" +-- CHECK-LABEL: vectorizing through the `tile` combinator and its funny index set + +%passes vect +_ = yield_accum (AddMonoid Int32) \result. + tile((Fin 256), 32) \set. + for_ i:set. + ix = inject(i, to=(Fin 256)) + result!ix += xs[ix] +-- CHECK: seq (RawFin 0x8) +-- CHECK: seq (RawFin 0x2) +-- CHECK: [[refix:v#[0-9]+]]:(Ref {{v#[0-9]+}} <16xInt32>) = vrefslice +-- CHECK: [[xsix:v#[0-9]+]]:<16xInt32> = +-- CHECK-NEXT: vslice +-- CHECK: extend [[refix]] [[xsix]]