1 ; RUN: llc < %s -mtriple=aarch64-none-linux-gnu -mattr=+neon | FileCheck %s
2 ; RUN: llc < %s -mtriple=arm64-none-linux-gnu -mattr=+neon | FileCheck %s
4 ; Check that the DAGCombiner does not crash with an assertion failure
5 ; when performing a target specific combine to simplify a 'or' dag node
6 ; according to the following rule:
7 ; (or (and B, A), (and C, ~A)) => (VBSL A, B, C)
8 ; The assertion failure was caused by an invalid comparison between APInt
9 ; values with different 'BitWidth'.
11 define <8 x i8> @test1(<8 x i8> %a, <8 x i8> %b) {
12 %tmp1 = and <8 x i8> %a, < i8 -1, i8 -1, i8 0, i8 0, i8 -1, i8 -1, i8 0, i8 0 >
13 %tmp2 = and <8 x i8> %b, < i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0 >
14 %tmp3 = or <8 x i8> %tmp1, %tmp2
21 define <16 x i8> @test2(<16 x i8> %a, <16 x i8> %b) {
22 %tmp1 = and <16 x i8> %a, < i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1, i8 -1 >
23 %tmp2 = and <16 x i8> %b, < i8 -1, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0, i8 0 >
24 %tmp3 = or <16 x i8> %tmp1, %tmp2