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