3 ; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z196 | FileCheck %s
6 define i32 @f1(i32 %a, i32 %b, i32 %limit) {
9 ; CHECK: locrhe %r2, %r3
11 %cond = icmp ult i32 %limit, 42
12 %res = select i1 %cond, i32 %a, i32 %b
17 define i64 @f2(i64 %a, i64 %b, i64 %limit) {
19 ; CHECK: clgfi %r4, 42
20 ; CHECK: locgrhe %r2, %r3
22 %cond = icmp ult i64 %limit, 42
23 %res = select i1 %cond, i64 %a, i64 %b
27 ; Test LOCR in a case that could use COMPARE AND BRANCH. We prefer using
29 define i32 @f3(i32 %a, i32 %b, i32 %limit) {
32 ; CHECK: locrlh %r2, %r3
34 %cond = icmp eq i32 %limit, 42
35 %res = select i1 %cond, i32 %a, i32 %b
39 ; ...and again for LOCGR.
40 define i64 @f4(i64 %a, i64 %b, i64 %limit) {
43 ; CHECK: locgrlh %r2, %r3
45 %cond = icmp eq i64 %limit, 42
46 %res = select i1 %cond, i64 %a, i64 %b