1 ; RUN: llc < %s -march=nvptx -mcpu=sm_20 | FileCheck %s
2 ; RUN: llc < %s -march=nvptx64 -mcpu=sm_20 | FileCheck %s
3 ; RUN: %if ptxas && !ptxas-12.0 %{ llc < %s -march=nvptx -mcpu=sm_20 | %ptxas-verify -m32 %}
4 ; RUN: %if ptxas %{ llc < %s -march=nvptx64 -mcpu=sm_20 | %ptxas-verify %}
6 ; This test makes sure that the result of vector compares are properly
7 ; scalarized. If codegen fails, then the type legalizer incorrectly
8 ; tried to promote <2 x i1> to <2 x i8> and instruction selection failed.
10 ; CHECK-LABEL: .visible .func foo(
11 define void @foo(ptr %a, ptr %b, ptr %r1, ptr %r2) {
13 %aval = load <2 x i32>, ptr %a
15 %bval = load <2 x i32>, ptr %b
18 %res = icmp slt <2 x i32> %aval, %bval
19 %t1 = extractelement <2 x i1> %res, i32 0
20 %t2 = extractelement <2 x i1> %res, i32 1
21 ; CHECK: selp.u32 %r{{[0-9]+}}, 1, 0
22 ; CHECK: selp.u32 %r{{[0-9]+}}, 1, 0
23 %t1a = zext i1 %t1 to i32
24 %t2a = zext i1 %t2 to i32
27 store i32 %t1a, ptr %r1
28 store i32 %t2a, ptr %r2