blob: 12cc440e48d9d9db7d218a8d05bd2d7e7366d40c [file] [log] [blame]
Tom Stellard75aadc22012-12-11 21:25:42 +00001;RUN: llc < %s -march=r600 -mcpu=redwood | FileCheck %s
2
3;Test that a select with reversed True/False values is correctly lowered
4;to a SETNE_INT. There should only be one SETNE_INT instruction.
5
Vincent Lejeune7e2c8322013-09-04 19:53:46 +00006;CHECK: SETNE_INT T{{[0-9]+\.[XYZW], T[0-9]+\.[XYZW], T[0-9]+\.[XYZW]}}
Benjamin Kramer01b75cc2013-03-09 18:25:40 +00007;CHECK-NOT: SETNE_INT
Tom Stellard75aadc22012-12-11 21:25:42 +00008
Matt Arsenault3dbeefa2017-03-21 21:39:51 +00009define amdgpu_kernel void @test(i32 addrspace(1)* %out, i32 addrspace(1)* %in) {
Tom Stellard75aadc22012-12-11 21:25:42 +000010entry:
David Blaikiea79ac142015-02-27 21:17:42 +000011 %0 = load i32, i32 addrspace(1)* %in
David Blaikie79e6c742015-02-27 19:29:02 +000012 %arrayidx1 = getelementptr inbounds i32, i32 addrspace(1)* %in, i32 1
David Blaikiea79ac142015-02-27 21:17:42 +000013 %1 = load i32, i32 addrspace(1)* %arrayidx1
Tom Stellard75aadc22012-12-11 21:25:42 +000014 %cmp = icmp eq i32 %0, %1
15 %value = select i1 %cmp, i32 0, i32 -1
16 store i32 %value, i32 addrspace(1)* %out
17 ret void
18}