20 lines
704 B
LLVM
20 lines
704 B
LLVM
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
|
|
; RUN: opt < %s -passes=float2int -S | FileCheck %s
|
|
|
|
define i32 @pr79158(i32 %x) {
|
|
; CHECK-LABEL: define i32 @pr79158(
|
|
; CHECK-SAME: i32 [[X:%.*]]) {
|
|
; CHECK-NEXT: entry:
|
|
; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i32 [[X]], 0
|
|
; CHECK-NEXT: [[TMP0:%.*]] = zext i1 [[CMP]] to i64
|
|
; CHECK-NEXT: [[MUL1:%.*]] = mul i64 [[TMP0]], 4294967295
|
|
; CHECK-NEXT: [[TMP1:%.*]] = trunc i64 [[MUL1]] to i32
|
|
; CHECK-NEXT: ret i32 [[TMP1]]
|
|
;
|
|
entry:
|
|
%cmp = icmp sgt i32 %x, 0
|
|
%conv = uitofp i1 %cmp to double
|
|
%mul = fmul double %conv, 0x41EFFFFFFFE00000
|
|
%conv1 = fptoui double %mul to i32
|
|
ret i32 %conv1
|
|
}
|