We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent de0abc0 commit 26ae69aCopy full SHA for 26ae69a
llvm/test/Transforms/Float2Int/pr79158.ll
@@ -0,0 +1,19 @@
1
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
2
+; RUN: opt < %s -passes=float2int -S | FileCheck %s
3
+
4
+define i32 @pr79158(i32 %x) {
5
+; CHECK-LABEL: define i32 @pr79158(
6
+; CHECK-SAME: i32 [[X:%.*]]) {
7
+; CHECK-NEXT: entry:
8
+; CHECK-NEXT: [[CMP_I:%.*]] = icmp sgt i32 [[X]], 0
9
+; CHECK-NEXT: [[TMP0:%.*]] = zext i1 [[CMP_I]] to i32
10
+; CHECK-NEXT: [[MUL_I1:%.*]] = mul i32 [[TMP0]], 2147483647
11
+; CHECK-NEXT: ret i32 [[MUL_I1]]
12
+;
13
+entry:
14
+ %cmp = icmp sgt i32 %x, 0
15
+ %conv = uitofp i1 %cmp to double
16
+ %mul = fmul double %conv, 0x41EFFFFFFFE00000
17
+ %conv1 = fptoui double %mul to i32
18
+ ret i32 %conv1
19
+}
0 commit comments