Skip to content

Commit

Permalink
Test vectorizing through tile and its index set.
Browse files Browse the repository at this point in the history
  • Loading branch information
axch committed Jun 26, 2023
1 parent d11c73c commit 06054ca
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/opt-tests.dx
Original file line number Diff line number Diff line change
Expand Up @@ -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]]

0 comments on commit 06054ca

Please sign in to comment.