llvm.org GIT mirror llvm / a813b38 test / CodeGen / SystemZ / multiselect.ll
a813b38

Tree @a813b38 (Download .tar.gz)

multiselect.ll @a813b38raw · history · blame

; Test that multiple select statements using the same condition are expanded
; into a single conditional branch.
;
; RUN: llc < %s -mtriple=s390x-linux-gnu | FileCheck %s

define void @test(i32 signext %positive, double %base, double %offset, double* %rmin, double* %rmax) {
entry:
; CHECK: cijlh %r2, 0,
; CHECK-NOT: cij
; CHECK-NOT: je
; CHECK-NOT: jlh

  %tobool = icmp eq i32 %positive, 0
  %add = fadd double %base, %offset
  %min = select i1 %tobool, double %add, double %base
  %max = select i1 %tobool, double %base, double %add
  store double %min, double* %rmin, align 8
  store double %max, double* %rmax, align 8
  ret void
}