Skip to content

Commit

Permalink
add test for vector splat literals (#1119)
Browse files Browse the repository at this point in the history
Vector splat literals have been introduced recently in LLVM, and the
llvm_util in Alive2 already handles this. However, the test suite misses
coverage for splat literals.
  • Loading branch information
artagnon authored Nov 29, 2024
1 parent 708948d commit d96d198
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions tests/alive-tv/vector/vector-splat-literal.srctgt.ll
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
define <2 x i8> @src(<2 x i8> %x) {
%rem.i = srem <2 x i8> %x, splat(i8 2)
%cmp.i = icmp slt <2 x i8> %rem.i, zeroinitializer
%add.i = select <2 x i1> %cmp.i, <2 x i8> splat(i8 2), <2 x i8> zeroinitializer
ret <2 x i8> %add.i
}

define <2 x i8> @tgt(<2 x i8> %x) {
%rem.i = srem <2 x i8> %x, splat(i8 2)
%tmp1 = and <2 x i8> %rem.i, splat(i8 2)
ret <2 x i8> %tmp1
}

0 comments on commit d96d198

Please sign in to comment.