brintos

brintos / llvm-project-archived public Read only

0
0
Text · 2.9 KiB · 639a8ac Raw
74 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 42; RUN: opt < %s -passes=float2int -S | FileCheck %s -check-prefixes=CHECK,NONE3; RUN: opt < %s -passes=float2int -S --data-layout="n64" | FileCheck %s -check-prefixes=CHECK,ONLY644; RUN: opt < %s -passes=float2int -S --data-layout="n8:16:32:64"| FileCheck %s -check-prefixes=CHECK,MULTIPLE5; RUN: opt < %s -passes=float2int -S --data-layout="e-m:o-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"| FileCheck %s -check-prefixes=CHECK,PR-791586 7define i32 @pr79158(i32 %x) {8; CHECK-LABEL: define i32 @pr79158(9; CHECK-SAME: i32 [[X:%.*]]) {10; CHECK-NEXT:  entry:11; CHECK-NEXT:    [[CMP:%.*]] = icmp sgt i32 [[X]], 012; CHECK-NEXT:    [[TMP0:%.*]] = zext i1 [[CMP]] to i6413; CHECK-NEXT:    [[MUL1:%.*]] = mul i64 [[TMP0]], 429496729514; CHECK-NEXT:    [[TMP1:%.*]] = trunc i64 [[MUL1]] to i3215; CHECK-NEXT:    ret i32 [[TMP1]]16;17entry:18  %cmp = icmp sgt i32 %x, 019  %conv = uitofp i1 %cmp to double20  %mul = fmul double %conv, 0x41EFFFFFFFE0000021  %conv1 = fptoui double %mul to i3222  ret i32 %conv123}24 25define i32 @pr79158_2(i32 %x) {26; NONE-LABEL: define i32 @pr79158_2(27; NONE-SAME: i32 [[X:%.*]]) {28; NONE-NEXT:  entry:29; NONE-NEXT:    [[CMP:%.*]] = icmp sgt i32 [[X]], 030; NONE-NEXT:    [[TMP0:%.*]] = zext i1 [[CMP]] to i3231; NONE-NEXT:    [[MUL1:%.*]] = mul i32 [[TMP0]], 25532; NONE-NEXT:    [[TMP1:%.*]] = trunc i32 [[MUL1]] to i833; NONE-NEXT:    [[CONV2:%.*]] = zext i8 [[TMP1]] to i3234; NONE-NEXT:    ret i32 [[CONV2]]35;36; ONLY64-LABEL: define i32 @pr79158_2(37; ONLY64-SAME: i32 [[X:%.*]]) {38; ONLY64-NEXT:  entry:39; ONLY64-NEXT:    [[CMP:%.*]] = icmp sgt i32 [[X]], 040; ONLY64-NEXT:    [[TMP0:%.*]] = zext i1 [[CMP]] to i6441; ONLY64-NEXT:    [[MUL1:%.*]] = mul i64 [[TMP0]], 25542; ONLY64-NEXT:    [[TMP1:%.*]] = trunc i64 [[MUL1]] to i843; ONLY64-NEXT:    [[CONV2:%.*]] = zext i8 [[TMP1]] to i3244; ONLY64-NEXT:    ret i32 [[CONV2]]45;46; MULTIPLE-LABEL: define i32 @pr79158_2(47; MULTIPLE-SAME: i32 [[X:%.*]]) {48; MULTIPLE-NEXT:  entry:49; MULTIPLE-NEXT:    [[CMP:%.*]] = icmp sgt i32 [[X]], 050; MULTIPLE-NEXT:    [[TMP0:%.*]] = zext i1 [[CMP]] to i1651; MULTIPLE-NEXT:    [[MUL1:%.*]] = mul i16 [[TMP0]], 25552; MULTIPLE-NEXT:    [[TMP1:%.*]] = trunc i16 [[MUL1]] to i853; MULTIPLE-NEXT:    [[CONV2:%.*]] = zext i8 [[TMP1]] to i3254; MULTIPLE-NEXT:    ret i32 [[CONV2]]55;56; PR-79158-LABEL: define i32 @pr79158_2(57; PR-79158-SAME: i32 [[X:%.*]]) {58; PR-79158-NEXT:  entry:59; PR-79158-NEXT:    [[CMP:%.*]] = icmp sgt i32 [[X]], 060; PR-79158-NEXT:    [[TMP0:%.*]] = zext i1 [[CMP]] to i1661; PR-79158-NEXT:    [[MUL1:%.*]] = mul i16 [[TMP0]], 25562; PR-79158-NEXT:    [[TMP1:%.*]] = trunc i16 [[MUL1]] to i863; PR-79158-NEXT:    [[CONV2:%.*]] = zext i8 [[TMP1]] to i3264; PR-79158-NEXT:    ret i32 [[CONV2]]65;66entry:67  %cmp = icmp sgt i32 %x, 068  %conv = uitofp i1 %cmp to float69  %mul = fmul float %conv, 2.550000e+0270  %conv1 = fptoui float %mul to i871  %conv2 = zext i8 %conv1 to i3272  ret i32 %conv273}74