blob: 9ca3a1339740c32d3061c9a3000edd5191cf9373 [file] [edit]
; RUN: clspv-opt -SignedCompareFixupPass -hack-scf %s -o %t.ll
; RUN: FileCheck %s < %t.ll
target datalayout = "e-p:32:32-i64:64-v16:16-v24:32-v32:32-v48:64-v96:128-v192:256-v256:256-v512:512-v1024:1024"
target triple = "spir-unknown-unknown"
define i1 @greater_than(i32 %x, i32 %y) {
entry:
%cmp = icmp sgt i32 %x, %y
ret i1 %cmp
}
; CHECK: [[sub1:%[a-zA-Z0-9_.]+]] = sub i32 %x, %y
; CHECK: [[sub2:%[a-zA-Z0-9_.]+]] = sub i32 [[sub1]], 1
; CHECK: [[and:%[a-zA-Z0-9_.]+]] = and i32 [[sub2]], -2147483648
; CHECK: [[cmp:%[a-zA-Z0-9_.]+]] = icmp eq i32 [[and]], 0
; CHECK: ret i1 [[cmp]]