1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-25 20:23:11 +01:00
llvm-mirror/test/CodeGen/SystemZ/cond-li.ll
Zhan Jun Liau f92effb44f [SystemZ] Recognize Load On Condition Immediate (LOCHI/LOGHI) opportunities
Summary: Add support for the z13 instructions LOCHI and LOCGHI which
conditionally load immediate values.  Add target instruction info hooks so
that if conversion will allow predication of LHI/LGHI.

Author: RolandF

Reviewers: uweigand

Subscribers: zhanjunl

Commiting on behalf of Roland.

Differential Revision: http://reviews.llvm.org/D22117

llvm-svn: 275086
2016-07-11 18:45:03 +00:00

24 lines
541 B
LLVM

; Test LOCHI/LOCGHI
;
; RUN: llc < %s -mtriple=s390x-linux-gnu -mcpu=z13 | FileCheck %s
; CHECK-LABEL: bar1:
; CHECK: lhi [[REG:%r[0-5]]], 42
; CHECK: chi %r2, 0
; CHECK: lochie [[REG]], 0
define signext i32 @bar1(i32 signext %x) {
%cmp = icmp ne i32 %x, 0
%.x = select i1 %cmp, i32 42, i32 0
ret i32 %.x
}
; CHECK-LABEL: bar2:
; CHECK: ltgr [[REG:%r[0-5]]], %r2
; CHECK: lghi %r2, 42
; CHECK: locghie %r2, 0
define signext i64 @bar2(i64 signext %x) {
%cmp = icmp ne i64 %x, 0
%.x = select i1 %cmp, i64 42, i64 0
ret i64 %.x
}