[llvm] 1b235b0 - ValueTracking: Add baseline tests for fcmp with non-0/inf constants
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Mon Sep 11 10:05:45 PDT 2023
Author: Matt Arsenault
Date: 2023-09-11T20:03:03+03:00
New Revision: 1b235b087ba218304973a92d781e6a3ac3b468df
URL: https://github.com/llvm/llvm-project/commit/1b235b087ba218304973a92d781e6a3ac3b468df
DIFF: https://github.com/llvm/llvm-project/commit/1b235b087ba218304973a92d781e6a3ac3b468df.diff
LOG: ValueTracking: Add baseline tests for fcmp with non-0/inf constants
Currently assumes only do anything for fcmps that perform an exact
class test.
Added:
llvm/test/Transforms/InstSimplify/assume-fcmp-constant-implies-class.ll
Modified:
llvm/test/Transforms/Attributor/nofpclass-implied-by-fcmp.ll
llvm/test/Transforms/InstSimplify/floating-point-compare.ll
Removed:
################################################################################
diff --git a/llvm/test/Transforms/Attributor/nofpclass-implied-by-fcmp.ll b/llvm/test/Transforms/Attributor/nofpclass-implied-by-fcmp.ll
index 19a518a44d48e50..396b8c84fc898c9 100644
--- a/llvm/test/Transforms/Attributor/nofpclass-implied-by-fcmp.ll
+++ b/llvm/test/Transforms/Attributor/nofpclass-implied-by-fcmp.ll
@@ -1096,6 +1096,62 @@ define float @clamp_fabs_is_is_ole_smallest_normal_to_0(float %arg) {
ret float %select
}
+define float @clamp_fabs_oeq_smallest_normal_to_zero(float %arg) {
+; CHECK-LABEL: define float @clamp_fabs_oeq_smallest_normal_to_zero(
+; CHECK-SAME: float [[ARG:%.*]]) #[[ATTR2]] {
+; CHECK-NEXT: [[FABS_ARG:%.*]] = call float @llvm.fabs.f32(float [[ARG]]) #[[ATTR4]]
+; CHECK-NEXT: [[IS_OEQ_SMALLEST_NORMAL:%.*]] = fcmp oeq float [[FABS_ARG]], 0x3810000000000000
+; CHECK-NEXT: [[SELECT:%.*]] = select i1 [[IS_OEQ_SMALLEST_NORMAL]], float 0.000000e+00, float [[ARG]]
+; CHECK-NEXT: ret float [[SELECT]]
+;
+ %fabs.arg = call float @llvm.fabs.f32(float %arg)
+ %is.oeq.smallest.normal = fcmp oeq float %fabs.arg, 0x3810000000000000
+ %select = select i1 %is.oeq.smallest.normal, float 0.0, float %arg
+ ret float %select
+}
+
+define float @clamp_fabs_one_smallest_normal_to_zero(float %arg) {
+; CHECK-LABEL: define float @clamp_fabs_one_smallest_normal_to_zero(
+; CHECK-SAME: float [[ARG:%.*]]) #[[ATTR2]] {
+; CHECK-NEXT: [[FABS_ARG:%.*]] = call float @llvm.fabs.f32(float [[ARG]]) #[[ATTR4]]
+; CHECK-NEXT: [[IS_ONE_SMALLEST_NORMAL:%.*]] = fcmp one float [[FABS_ARG]], 0x3810000000000000
+; CHECK-NEXT: [[SELECT:%.*]] = select i1 [[IS_ONE_SMALLEST_NORMAL]], float 0.000000e+00, float [[ARG]]
+; CHECK-NEXT: ret float [[SELECT]]
+;
+ %fabs.arg = call float @llvm.fabs.f32(float %arg)
+ %is.one.smallest.normal = fcmp one float %fabs.arg, 0x3810000000000000
+ %select = select i1 %is.one.smallest.normal, float 0.0, float %arg
+ ret float %select
+}
+
+define float @clamp_fabs_ueq_smallest_normal_to_zero(float %arg) {
+; CHECK-LABEL: define float @clamp_fabs_ueq_smallest_normal_to_zero(
+; CHECK-SAME: float [[ARG:%.*]]) #[[ATTR2]] {
+; CHECK-NEXT: [[FABS_ARG:%.*]] = call float @llvm.fabs.f32(float [[ARG]]) #[[ATTR4]]
+; CHECK-NEXT: [[IS_UEQ_SMALLEST_NORMAL:%.*]] = fcmp ueq float [[FABS_ARG]], 0x3810000000000000
+; CHECK-NEXT: [[SELECT:%.*]] = select i1 [[IS_UEQ_SMALLEST_NORMAL]], float 0.000000e+00, float [[ARG]]
+; CHECK-NEXT: ret float [[SELECT]]
+;
+ %fabs.arg = call float @llvm.fabs.f32(float %arg)
+ %is.ueq.smallest.normal = fcmp ueq float %fabs.arg, 0x3810000000000000
+ %select = select i1 %is.ueq.smallest.normal, float 0.0, float %arg
+ ret float %select
+}
+
+define float @clamp_fabs_une_smallest_normal_to_zero(float %arg) {
+; CHECK-LABEL: define float @clamp_fabs_une_smallest_normal_to_zero(
+; CHECK-SAME: float [[ARG:%.*]]) #[[ATTR2]] {
+; CHECK-NEXT: [[FABS_ARG:%.*]] = call float @llvm.fabs.f32(float [[ARG]]) #[[ATTR4]]
+; CHECK-NEXT: [[IS_UNE_SMALLEST_NORMAL:%.*]] = fcmp une float [[FABS_ARG]], 0x3810000000000000
+; CHECK-NEXT: [[SELECT:%.*]] = select i1 [[IS_UNE_SMALLEST_NORMAL]], float 0.000000e+00, float [[ARG]]
+; CHECK-NEXT: ret float [[SELECT]]
+;
+ %fabs.arg = call float @llvm.fabs.f32(float %arg)
+ %is.une.smallest.normal = fcmp une float %fabs.arg, 0x3810000000000000
+ %select = select i1 %is.une.smallest.normal, float 0.0, float %arg
+ ret float %select
+}
+
;---------------------------------------------------------------------
; compare fabs to negative normal
;---------------------------------------------------------------------
@@ -2167,5 +2223,177 @@ define float @ret_assumed_uge_known_negative(float %arg, float %unknown) {
ret float %arg
}
+;---------------------------------------------------------------------
+; assume compare to smallest normal
+;---------------------------------------------------------------------
+
+define float @assume_oeq_smallest_normal(float %arg) {
+; CHECK-LABEL: define float @assume_oeq_smallest_normal(
+; CHECK-SAME: float returned [[ARG:%.*]]) #[[ATTR3]] {
+; CHECK-NEXT: [[IS_OEQ_SMALLEST_NORMAL:%.*]] = fcmp oeq float [[ARG]], 0x3810000000000000
+; CHECK-NEXT: call void @llvm.assume(i1 noundef [[IS_OEQ_SMALLEST_NORMAL]]) #[[ATTR5]]
+; CHECK-NEXT: ret float [[ARG]]
+;
+ %is.oeq.smallest.normal = fcmp oeq float %arg, 0x3810000000000000
+ call void @llvm.assume(i1 %is.oeq.smallest.normal)
+ ret float %arg
+}
+
+define float @assume_one_smallest_normal(float %arg) {
+; CHECK-LABEL: define float @assume_one_smallest_normal(
+; CHECK-SAME: float returned [[ARG:%.*]]) #[[ATTR3]] {
+; CHECK-NEXT: [[IS_ONE_SMALLEST_NORMAL:%.*]] = fcmp one float [[ARG]], 0x3810000000000000
+; CHECK-NEXT: call void @llvm.assume(i1 noundef [[IS_ONE_SMALLEST_NORMAL]]) #[[ATTR5]]
+; CHECK-NEXT: ret float [[ARG]]
+;
+ %is.one.smallest.normal = fcmp one float %arg, 0x3810000000000000
+ call void @llvm.assume(i1 %is.one.smallest.normal)
+ ret float %arg
+}
+
+define float @assume_ueq_smallest_normal(float %arg) {
+; CHECK-LABEL: define float @assume_ueq_smallest_normal(
+; CHECK-SAME: float returned [[ARG:%.*]]) #[[ATTR3]] {
+; CHECK-NEXT: [[IS_UEQ_SMALLEST_NORMAL:%.*]] = fcmp ueq float [[ARG]], 0x3810000000000000
+; CHECK-NEXT: call void @llvm.assume(i1 noundef [[IS_UEQ_SMALLEST_NORMAL]]) #[[ATTR5]]
+; CHECK-NEXT: ret float [[ARG]]
+;
+ %is.ueq.smallest.normal = fcmp ueq float %arg, 0x3810000000000000
+ call void @llvm.assume(i1 %is.ueq.smallest.normal)
+ ret float %arg
+}
+
+define float @assume_une_smallest_normal(float %arg) {
+; CHECK-LABEL: define float @assume_une_smallest_normal(
+; CHECK-SAME: float returned [[ARG:%.*]]) #[[ATTR3]] {
+; CHECK-NEXT: [[IS_UNE_SMALLEST_NORMAL:%.*]] = fcmp une float [[ARG]], 0x3810000000000000
+; CHECK-NEXT: call void @llvm.assume(i1 noundef [[IS_UNE_SMALLEST_NORMAL]]) #[[ATTR5]]
+; CHECK-NEXT: ret float [[ARG]]
+;
+ %is.une.smallest.normal = fcmp une float %arg, 0x3810000000000000
+ call void @llvm.assume(i1 %is.une.smallest.normal)
+ ret float %arg
+}
+
+define float @assume_ord_smallest_normal(float %arg) {
+; CHECK-LABEL: define nofpclass(nan) float @assume_ord_smallest_normal(
+; CHECK-SAME: float returned nofpclass(nan) [[ARG:%.*]]) #[[ATTR3]] {
+; CHECK-NEXT: [[IS_ORD_SMALLEST_NORMAL:%.*]] = fcmp ord float [[ARG]], 0x3810000000000000
+; CHECK-NEXT: call void @llvm.assume(i1 noundef [[IS_ORD_SMALLEST_NORMAL]]) #[[ATTR5]]
+; CHECK-NEXT: ret float [[ARG]]
+;
+ %is.ord.smallest.normal = fcmp ord float %arg, 0x3810000000000000
+ call void @llvm.assume(i1 %is.ord.smallest.normal)
+ ret float %arg
+}
+
+define float @assume_uno_smallest_normal(float %arg) {
+; CHECK-LABEL: define nofpclass(inf zero sub norm) float @assume_uno_smallest_normal(
+; CHECK-SAME: float returned nofpclass(inf zero sub norm) [[ARG:%.*]]) #[[ATTR3]] {
+; CHECK-NEXT: [[IS_UNO_SMALLEST_NORMAL:%.*]] = fcmp uno float [[ARG]], 0x3810000000000000
+; CHECK-NEXT: call void @llvm.assume(i1 noundef [[IS_UNO_SMALLEST_NORMAL]]) #[[ATTR5]]
+; CHECK-NEXT: ret float [[ARG]]
+;
+ %is.uno.smallest.normal = fcmp uno float %arg, 0x3810000000000000
+ call void @llvm.assume(i1 %is.uno.smallest.normal)
+ ret float %arg
+}
+
+define float @assume_fabs_oeq_smallest_normal(float %arg) {
+; CHECK-LABEL: define float @assume_fabs_oeq_smallest_normal(
+; CHECK-SAME: float returned [[ARG:%.*]]) #[[ATTR3]] {
+; CHECK-NEXT: [[FABS_ARG:%.*]] = call float @llvm.fabs.f32(float [[ARG]]) #[[ATTR4]]
+; CHECK-NEXT: [[IS_OEQ_SMALLEST_NORMAL:%.*]] = fcmp oeq float [[FABS_ARG]], 0x3810000000000000
+; CHECK-NEXT: call void @llvm.assume(i1 noundef [[IS_OEQ_SMALLEST_NORMAL]]) #[[ATTR5]]
+; CHECK-NEXT: ret float [[ARG]]
+;
+ %fabs.arg = call float @llvm.fabs.f32(float %arg)
+ %is.oeq.smallest.normal = fcmp oeq float %fabs.arg, 0x3810000000000000
+ call void @llvm.assume(i1 %is.oeq.smallest.normal)
+ ret float %arg
+}
+
+define float @assume_fabs_one_smallest_normal(float %arg) {
+; CHECK-LABEL: define float @assume_fabs_one_smallest_normal(
+; CHECK-SAME: float returned [[ARG:%.*]]) #[[ATTR3]] {
+; CHECK-NEXT: [[FABS_ARG:%.*]] = call float @llvm.fabs.f32(float [[ARG]]) #[[ATTR4]]
+; CHECK-NEXT: [[IS_ONE_SMALLEST_NORMAL:%.*]] = fcmp one float [[FABS_ARG]], 0x3810000000000000
+; CHECK-NEXT: call void @llvm.assume(i1 noundef [[IS_ONE_SMALLEST_NORMAL]]) #[[ATTR5]]
+; CHECK-NEXT: ret float [[ARG]]
+;
+ %fabs.arg = call float @llvm.fabs.f32(float %arg)
+ %is.one.smallest.normal = fcmp one float %fabs.arg, 0x3810000000000000
+ call void @llvm.assume(i1 %is.one.smallest.normal)
+ ret float %arg
+}
+
+define float @assume_fabs_ueq_smallest_normal(float %arg) {
+; CHECK-LABEL: define float @assume_fabs_ueq_smallest_normal(
+; CHECK-SAME: float returned [[ARG:%.*]]) #[[ATTR3]] {
+; CHECK-NEXT: [[FABS_ARG:%.*]] = call float @llvm.fabs.f32(float [[ARG]]) #[[ATTR4]]
+; CHECK-NEXT: [[IS_UEQ_SMALLEST_NORMAL:%.*]] = fcmp ueq float [[FABS_ARG]], 0x3810000000000000
+; CHECK-NEXT: call void @llvm.assume(i1 noundef [[IS_UEQ_SMALLEST_NORMAL]]) #[[ATTR5]]
+; CHECK-NEXT: ret float [[ARG]]
+;
+ %fabs.arg = call float @llvm.fabs.f32(float %arg)
+ %is.ueq.smallest.normal = fcmp ueq float %fabs.arg, 0x3810000000000000
+ call void @llvm.assume(i1 %is.ueq.smallest.normal)
+ ret float %arg
+}
+
+define float @assume_fabs_une_smallest_normal(float %arg) {
+; CHECK-LABEL: define float @assume_fabs_une_smallest_normal(
+; CHECK-SAME: float returned [[ARG:%.*]]) #[[ATTR3]] {
+; CHECK-NEXT: [[FABS_ARG:%.*]] = call float @llvm.fabs.f32(float [[ARG]]) #[[ATTR4]]
+; CHECK-NEXT: [[IS_UNE_SMALLEST_NORMAL:%.*]] = fcmp une float [[FABS_ARG]], 0x3810000000000000
+; CHECK-NEXT: call void @llvm.assume(i1 noundef [[IS_UNE_SMALLEST_NORMAL]]) #[[ATTR5]]
+; CHECK-NEXT: ret float [[ARG]]
+;
+ %fabs.arg = call float @llvm.fabs.f32(float %arg)
+ %is.une.smallest.normal = fcmp une float %fabs.arg, 0x3810000000000000
+ call void @llvm.assume(i1 %is.une.smallest.normal)
+ ret float %arg
+}
+
+define float @assume_fabs_ord_smallest_normal(float %arg) {
+; CHECK-LABEL: define float @assume_fabs_ord_smallest_normal(
+; CHECK-SAME: float returned [[ARG:%.*]]) #[[ATTR3]] {
+; CHECK-NEXT: [[FABS_ARG:%.*]] = call float @llvm.fabs.f32(float [[ARG]]) #[[ATTR4]]
+; CHECK-NEXT: [[IS_ORD_SMALLEST_NORMAL:%.*]] = fcmp ord float [[FABS_ARG]], 0x3810000000000000
+; CHECK-NEXT: call void @llvm.assume(i1 noundef [[IS_ORD_SMALLEST_NORMAL]]) #[[ATTR5]]
+; CHECK-NEXT: ret float [[ARG]]
+;
+ %fabs.arg = call float @llvm.fabs.f32(float %arg)
+ %is.ord.smallest.normal = fcmp ord float %fabs.arg, 0x3810000000000000
+ call void @llvm.assume(i1 %is.ord.smallest.normal)
+ ret float %arg
+}
+
+define float @assume_fabs_uno_smallest_normal(float %arg) {
+; CHECK-LABEL: define float @assume_fabs_uno_smallest_normal(
+; CHECK-SAME: float returned [[ARG:%.*]]) #[[ATTR3]] {
+; CHECK-NEXT: [[FABS_ARG:%.*]] = call float @llvm.fabs.f32(float [[ARG]]) #[[ATTR4]]
+; CHECK-NEXT: [[IS_UNO_SMALLEST_NORMAL:%.*]] = fcmp uno float [[FABS_ARG]], 0x3810000000000000
+; CHECK-NEXT: call void @llvm.assume(i1 noundef [[IS_UNO_SMALLEST_NORMAL]]) #[[ATTR5]]
+; CHECK-NEXT: ret float [[ARG]]
+;
+ %fabs.arg = call float @llvm.fabs.f32(float %arg)
+ %is.uno.smallest.normal = fcmp uno float %fabs.arg, 0x3810000000000000
+ call void @llvm.assume(i1 %is.uno.smallest.normal)
+ ret float %arg
+}
+
+define float @assume_oeq_smallest_normal_known_pos(float nofpclass(ninf nsub nnorm nzero) %arg) {
+; CHECK-LABEL: define nofpclass(ninf nzero nsub nnorm) float @assume_oeq_smallest_normal_known_pos(
+; CHECK-SAME: float returned nofpclass(ninf nzero nsub nnorm) [[ARG:%.*]]) #[[ATTR3]] {
+; CHECK-NEXT: [[IS_OEQ_SMALLEST_NORMAL:%.*]] = fcmp oeq float [[ARG]], 0x3810000000000000
+; CHECK-NEXT: call void @llvm.assume(i1 noundef [[IS_OEQ_SMALLEST_NORMAL]]) #[[ATTR5]]
+; CHECK-NEXT: ret float [[ARG]]
+;
+ %is.oeq.smallest.normal = fcmp oeq float %arg, 0x3810000000000000
+ call void @llvm.assume(i1 %is.oeq.smallest.normal)
+ ret float %arg
+}
+
;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
; TUNIT: {{.*}}
diff --git a/llvm/test/Transforms/InstSimplify/assume-fcmp-constant-implies-class.ll b/llvm/test/Transforms/InstSimplify/assume-fcmp-constant-implies-class.ll
new file mode 100644
index 000000000000000..e6d5e409bbabf4a
--- /dev/null
+++ b/llvm/test/Transforms/InstSimplify/assume-fcmp-constant-implies-class.ll
@@ -0,0 +1,3040 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 3
+; RUN: opt -S -passes=instsimplify %s | FileCheck %s
+
+; Test that we're able to make use of assumes of fcmps with constants
+; that aren't 0/inf/smallest-normal. Range checks can exclude certain
+; classes.
+
+declare void @llvm.assume(i1 noundef) #0
+
+; --------------------------------------------------------------------
+; Test assume x < -1.0 with compares to 0
+; --------------------------------------------------------------------
+
+define i1 @assume_olt_neg1__oeq_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_olt_neg1__oeq_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLT_NEG1:%.*]] = fcmp olt float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp oeq float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %olt.neg1 = fcmp olt float %arg, -1.0
+ call void @llvm.assume(i1 %olt.neg1)
+ %cmp = fcmp oeq float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_olt_neg1__ogt_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_olt_neg1__ogt_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLT_NEG1:%.*]] = fcmp olt float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ogt float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %olt.neg1 = fcmp olt float %arg, -1.0
+ call void @llvm.assume(i1 %olt.neg1)
+ %cmp = fcmp ogt float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_olt_neg1__oge_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_olt_neg1__oge_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLT_NEG1:%.*]] = fcmp olt float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp oge float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %olt.neg1 = fcmp olt float %arg, -1.0
+ call void @llvm.assume(i1 %olt.neg1)
+ %cmp = fcmp oge float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_olt_neg1__olt_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_olt_neg1__olt_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLT_NEG1:%.*]] = fcmp olt float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp olt float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %olt.neg1 = fcmp olt float %arg, -1.0
+ call void @llvm.assume(i1 %olt.neg1)
+ %cmp = fcmp olt float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_olt_neg1__ole_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_olt_neg1__ole_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLT_NEG1:%.*]] = fcmp olt float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ole float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %olt.neg1 = fcmp olt float %arg, -1.0
+ call void @llvm.assume(i1 %olt.neg1)
+ %cmp = fcmp ole float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_olt_neg1__one_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_olt_neg1__one_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLT_NEG1:%.*]] = fcmp olt float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp one float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %olt.neg1 = fcmp olt float %arg, -1.0
+ call void @llvm.assume(i1 %olt.neg1)
+ %cmp = fcmp one float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_olt_neg1__ord_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_olt_neg1__ord_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLT_NEG1:%.*]] = fcmp olt float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ord float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %olt.neg1 = fcmp olt float %arg, -1.0
+ call void @llvm.assume(i1 %olt.neg1)
+ %cmp = fcmp ord float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_olt_neg1__ueq_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_olt_neg1__ueq_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLT_NEG1:%.*]] = fcmp olt float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ueq float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %olt.neg1 = fcmp olt float %arg, -1.0
+ call void @llvm.assume(i1 %olt.neg1)
+ %cmp = fcmp ueq float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_olt_neg1__ugt_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_olt_neg1__ugt_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLT_NEG1:%.*]] = fcmp olt float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ugt float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %olt.neg1 = fcmp olt float %arg, -1.0
+ call void @llvm.assume(i1 %olt.neg1)
+ %cmp = fcmp ugt float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_olt_neg1__uge_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_olt_neg1__uge_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLT_NEG1:%.*]] = fcmp olt float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp uge float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %olt.neg1 = fcmp olt float %arg, -1.0
+ call void @llvm.assume(i1 %olt.neg1)
+ %cmp = fcmp uge float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_olt_neg1__ult_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_olt_neg1__ult_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLT_NEG1:%.*]] = fcmp olt float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ult float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %olt.neg1 = fcmp olt float %arg, -1.0
+ call void @llvm.assume(i1 %olt.neg1)
+ %cmp = fcmp ult float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_olt_neg1__ule_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_olt_neg1__ule_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLT_NEG1:%.*]] = fcmp olt float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ule float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %olt.neg1 = fcmp olt float %arg, -1.0
+ call void @llvm.assume(i1 %olt.neg1)
+ %cmp = fcmp ule float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_olt_neg1__une_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_olt_neg1__une_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLT_NEG1:%.*]] = fcmp olt float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp une float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %olt.neg1 = fcmp olt float %arg, -1.0
+ call void @llvm.assume(i1 %olt.neg1)
+ %cmp = fcmp une float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_olt_neg1__uno_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_olt_neg1__uno_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLT_NEG1:%.*]] = fcmp olt float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp uno float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %olt.neg1 = fcmp olt float %arg, -1.0
+ call void @llvm.assume(i1 %olt.neg1)
+ %cmp = fcmp uno float %arg, 0.0
+ ret i1 %cmp
+}
+
+; --------------------------------------------------------------------
+; Test assume x <= -1.0 with compares to 0
+; --------------------------------------------------------------------
+
+define i1 @assume_ole_neg1__oeq_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ole_neg1__oeq_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLE_NEG1:%.*]] = fcmp ole float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp oeq float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ole.neg1 = fcmp ole float %arg, -1.0
+ call void @llvm.assume(i1 %ole.neg1)
+ %cmp = fcmp oeq float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ole_neg1__ogt_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ole_neg1__ogt_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLE_NEG1:%.*]] = fcmp ole float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ogt float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ole.neg1 = fcmp ole float %arg, -1.0
+ call void @llvm.assume(i1 %ole.neg1)
+ %cmp = fcmp ogt float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ole_neg1__oge_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ole_neg1__oge_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLE_NEG1:%.*]] = fcmp ole float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp oge float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ole.neg1 = fcmp ole float %arg, -1.0
+ call void @llvm.assume(i1 %ole.neg1)
+ %cmp = fcmp oge float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ole_neg1__olt_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ole_neg1__olt_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLE_NEG1:%.*]] = fcmp ole float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp olt float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ole.neg1 = fcmp ole float %arg, -1.0
+ call void @llvm.assume(i1 %ole.neg1)
+ %cmp = fcmp olt float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ole_neg1__ole_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ole_neg1__ole_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLE_NEG1:%.*]] = fcmp ole float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ole float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ole.neg1 = fcmp ole float %arg, -1.0
+ call void @llvm.assume(i1 %ole.neg1)
+ %cmp = fcmp ole float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ole_neg1__one_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ole_neg1__one_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLE_NEG1:%.*]] = fcmp ole float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp one float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ole.neg1 = fcmp ole float %arg, -1.0
+ call void @llvm.assume(i1 %ole.neg1)
+ %cmp = fcmp one float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ole_neg1__ord_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ole_neg1__ord_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLE_NEG1:%.*]] = fcmp ole float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ord float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ole.neg1 = fcmp ole float %arg, -1.0
+ call void @llvm.assume(i1 %ole.neg1)
+ %cmp = fcmp ord float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ole_neg1__ueq_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ole_neg1__ueq_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLE_NEG1:%.*]] = fcmp ole float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ueq float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ole.neg1 = fcmp ole float %arg, -1.0
+ call void @llvm.assume(i1 %ole.neg1)
+ %cmp = fcmp ueq float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ole_neg1__ugt_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ole_neg1__ugt_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLE_NEG1:%.*]] = fcmp ole float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ugt float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ole.neg1 = fcmp ole float %arg, -1.0
+ call void @llvm.assume(i1 %ole.neg1)
+ %cmp = fcmp ugt float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ole_neg1__uge_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ole_neg1__uge_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLE_NEG1:%.*]] = fcmp ole float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp uge float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ole.neg1 = fcmp ole float %arg, -1.0
+ call void @llvm.assume(i1 %ole.neg1)
+ %cmp = fcmp uge float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ole_neg1__ult_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ole_neg1__ult_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLE_NEG1:%.*]] = fcmp ole float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ult float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ole.neg1 = fcmp ole float %arg, -1.0
+ call void @llvm.assume(i1 %ole.neg1)
+ %cmp = fcmp ult float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ole_neg1__ule_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ole_neg1__ule_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLE_NEG1:%.*]] = fcmp ole float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ule float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ole.neg1 = fcmp ole float %arg, -1.0
+ call void @llvm.assume(i1 %ole.neg1)
+ %cmp = fcmp ule float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ole_neg1__une_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ole_neg1__une_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLE_NEG1:%.*]] = fcmp ole float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp une float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ole.neg1 = fcmp ole float %arg, -1.0
+ call void @llvm.assume(i1 %ole.neg1)
+ %cmp = fcmp une float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ole_neg1__uno_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ole_neg1__uno_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLE_NEG1:%.*]] = fcmp ole float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp uno float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ole.neg1 = fcmp ole float %arg, -1.0
+ call void @llvm.assume(i1 %ole.neg1)
+ %cmp = fcmp uno float %arg, 0.0
+ ret i1 %cmp
+}
+
+; --------------------------------------------------------------------
+; Test assume x > -1.0 with compares to 0
+; --------------------------------------------------------------------
+
+define i1 @assume_ogt_neg1__oeq_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ogt_neg1__oeq_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGT_NEG1:%.*]] = fcmp ogt float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp oeq float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ogt.neg1 = fcmp ogt float %arg, -1.0
+ call void @llvm.assume(i1 %ogt.neg1)
+ %cmp = fcmp oeq float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ogt_neg1__ogt_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ogt_neg1__ogt_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGT_NEG1:%.*]] = fcmp ogt float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ogt float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ogt.neg1 = fcmp ogt float %arg, -1.0
+ call void @llvm.assume(i1 %ogt.neg1)
+ %cmp = fcmp ogt float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ogt_neg1__oge_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ogt_neg1__oge_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGT_NEG1:%.*]] = fcmp ogt float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp oge float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ogt.neg1 = fcmp ogt float %arg, -1.0
+ call void @llvm.assume(i1 %ogt.neg1)
+ %cmp = fcmp oge float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ogt_neg1__olt_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ogt_neg1__olt_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGT_NEG1:%.*]] = fcmp ogt float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp olt float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ogt.neg1 = fcmp ogt float %arg, -1.0
+ call void @llvm.assume(i1 %ogt.neg1)
+ %cmp = fcmp olt float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ogt_neg1__ole_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ogt_neg1__ole_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGT_NEG1:%.*]] = fcmp ogt float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ole float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ogt.neg1 = fcmp ogt float %arg, -1.0
+ call void @llvm.assume(i1 %ogt.neg1)
+ %cmp = fcmp ole float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ogt_neg1__one_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ogt_neg1__one_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGT_NEG1:%.*]] = fcmp ogt float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp one float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ogt.neg1 = fcmp ogt float %arg, -1.0
+ call void @llvm.assume(i1 %ogt.neg1)
+ %cmp = fcmp one float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ogt_neg1__ord_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ogt_neg1__ord_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGT_NEG1:%.*]] = fcmp ogt float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ord float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ogt.neg1 = fcmp ogt float %arg, -1.0
+ call void @llvm.assume(i1 %ogt.neg1)
+ %cmp = fcmp ord float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ogt_neg1__ueq_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ogt_neg1__ueq_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGT_NEG1:%.*]] = fcmp ogt float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ueq float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ogt.neg1 = fcmp ogt float %arg, -1.0
+ call void @llvm.assume(i1 %ogt.neg1)
+ %cmp = fcmp ueq float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ogt_neg1__ugt_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ogt_neg1__ugt_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGT_NEG1:%.*]] = fcmp ogt float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ugt float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ogt.neg1 = fcmp ogt float %arg, -1.0
+ call void @llvm.assume(i1 %ogt.neg1)
+ %cmp = fcmp ugt float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ogt_neg1__uge_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ogt_neg1__uge_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGT_NEG1:%.*]] = fcmp ogt float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp uge float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ogt.neg1 = fcmp ogt float %arg, -1.0
+ call void @llvm.assume(i1 %ogt.neg1)
+ %cmp = fcmp uge float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ogt_neg1__ult_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ogt_neg1__ult_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGT_NEG1:%.*]] = fcmp ogt float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ult float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ogt.neg1 = fcmp ogt float %arg, -1.0
+ call void @llvm.assume(i1 %ogt.neg1)
+ %cmp = fcmp ult float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ogt_neg1__ule_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ogt_neg1__ule_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGT_NEG1:%.*]] = fcmp ogt float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ule float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ogt.neg1 = fcmp ogt float %arg, -1.0
+ call void @llvm.assume(i1 %ogt.neg1)
+ %cmp = fcmp ule float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ogt_neg1__une_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ogt_neg1__une_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGT_NEG1:%.*]] = fcmp ogt float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp une float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ogt.neg1 = fcmp ogt float %arg, -1.0
+ call void @llvm.assume(i1 %ogt.neg1)
+ %cmp = fcmp une float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ogt_neg1__uno_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ogt_neg1__uno_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGT_NEG1:%.*]] = fcmp ogt float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp uno float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ogt.neg1 = fcmp ogt float %arg, -1.0
+ call void @llvm.assume(i1 %ogt.neg1)
+ %cmp = fcmp uno float %arg, 0.0
+ ret i1 %cmp
+}
+
+; --------------------------------------------------------------------
+; Test assume x >= -1.0 with compares to 0
+; --------------------------------------------------------------------
+
+define i1 @assume_oge_neg1__oeq_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_oge_neg1__oeq_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGE_NEG1:%.*]] = fcmp oge float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp oeq float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %oge.neg1 = fcmp oge float %arg, -1.0
+ call void @llvm.assume(i1 %oge.neg1)
+ %cmp = fcmp oeq float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_oge_neg1__ogt_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_oge_neg1__ogt_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGE_NEG1:%.*]] = fcmp oge float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ogt float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %oge.neg1 = fcmp oge float %arg, -1.0
+ call void @llvm.assume(i1 %oge.neg1)
+ %cmp = fcmp ogt float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_oge_neg1__oge_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_oge_neg1__oge_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGE_NEG1:%.*]] = fcmp oge float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp oge float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %oge.neg1 = fcmp oge float %arg, -1.0
+ call void @llvm.assume(i1 %oge.neg1)
+ %cmp = fcmp oge float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_oge_neg1__olt_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_oge_neg1__olt_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGE_NEG1:%.*]] = fcmp oge float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp olt float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %oge.neg1 = fcmp oge float %arg, -1.0
+ call void @llvm.assume(i1 %oge.neg1)
+ %cmp = fcmp olt float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_oge_neg1__ole_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_oge_neg1__ole_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGE_NEG1:%.*]] = fcmp oge float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ole float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %oge.neg1 = fcmp oge float %arg, -1.0
+ call void @llvm.assume(i1 %oge.neg1)
+ %cmp = fcmp ole float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_oge_neg1__one_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_oge_neg1__one_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGE_NEG1:%.*]] = fcmp oge float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp one float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %oge.neg1 = fcmp oge float %arg, -1.0
+ call void @llvm.assume(i1 %oge.neg1)
+ %cmp = fcmp one float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_oge_neg1__ord_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_oge_neg1__ord_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGE_NEG1:%.*]] = fcmp oge float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ord float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %oge.neg1 = fcmp oge float %arg, -1.0
+ call void @llvm.assume(i1 %oge.neg1)
+ %cmp = fcmp ord float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_oge_neg1__ueq_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_oge_neg1__ueq_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGE_NEG1:%.*]] = fcmp oge float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ueq float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %oge.neg1 = fcmp oge float %arg, -1.0
+ call void @llvm.assume(i1 %oge.neg1)
+ %cmp = fcmp ueq float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_oge_neg1__ugt_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_oge_neg1__ugt_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGE_NEG1:%.*]] = fcmp oge float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ugt float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %oge.neg1 = fcmp oge float %arg, -1.0
+ call void @llvm.assume(i1 %oge.neg1)
+ %cmp = fcmp ugt float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_oge_neg1__uge_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_oge_neg1__uge_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGE_NEG1:%.*]] = fcmp oge float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp uge float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %oge.neg1 = fcmp oge float %arg, -1.0
+ call void @llvm.assume(i1 %oge.neg1)
+ %cmp = fcmp uge float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_oge_neg1__ult_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_oge_neg1__ult_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGE_NEG1:%.*]] = fcmp oge float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ult float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %oge.neg1 = fcmp oge float %arg, -1.0
+ call void @llvm.assume(i1 %oge.neg1)
+ %cmp = fcmp ult float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_oge_neg1__ule_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_oge_neg1__ule_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGE_NEG1:%.*]] = fcmp oge float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ule float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %oge.neg1 = fcmp oge float %arg, -1.0
+ call void @llvm.assume(i1 %oge.neg1)
+ %cmp = fcmp ule float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_oge_neg1__une_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_oge_neg1__une_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGE_NEG1:%.*]] = fcmp oge float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp une float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %oge.neg1 = fcmp oge float %arg, -1.0
+ call void @llvm.assume(i1 %oge.neg1)
+ %cmp = fcmp une float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_oge_neg1__uno_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_oge_neg1__uno_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGE_NEG1:%.*]] = fcmp oge float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp uno float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %oge.neg1 = fcmp oge float %arg, -1.0
+ call void @llvm.assume(i1 %oge.neg1)
+ %cmp = fcmp uno float %arg, 0.0
+ ret i1 %cmp
+}
+
+; --------------------------------------------------------------------
+; Test assume x u>= -1.0 with compares to 0
+; --------------------------------------------------------------------
+
+define i1 @assume_uge_neg1__oeq_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_uge_neg1__oeq_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGE_NEG1:%.*]] = fcmp uge float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp oeq float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %uge.neg1 = fcmp uge float %arg, -1.0
+ call void @llvm.assume(i1 %uge.neg1)
+ %cmp = fcmp oeq float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_uge_neg1__ogt_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_uge_neg1__ogt_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGE_NEG1:%.*]] = fcmp uge float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ogt float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %uge.neg1 = fcmp uge float %arg, -1.0
+ call void @llvm.assume(i1 %uge.neg1)
+ %cmp = fcmp ogt float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_uge_neg1__oge_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_uge_neg1__oge_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGE_NEG1:%.*]] = fcmp uge float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp oge float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %uge.neg1 = fcmp uge float %arg, -1.0
+ call void @llvm.assume(i1 %uge.neg1)
+ %cmp = fcmp oge float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_uge_neg1__olt_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_uge_neg1__olt_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGE_NEG1:%.*]] = fcmp uge float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp olt float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %uge.neg1 = fcmp uge float %arg, -1.0
+ call void @llvm.assume(i1 %uge.neg1)
+ %cmp = fcmp olt float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_uge_neg1__ole_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_uge_neg1__ole_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGE_NEG1:%.*]] = fcmp uge float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ole float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %uge.neg1 = fcmp uge float %arg, -1.0
+ call void @llvm.assume(i1 %uge.neg1)
+ %cmp = fcmp ole float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_uge_neg1__one_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_uge_neg1__one_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGE_NEG1:%.*]] = fcmp uge float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp one float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %uge.neg1 = fcmp uge float %arg, -1.0
+ call void @llvm.assume(i1 %uge.neg1)
+ %cmp = fcmp one float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_uge_neg1__ord_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_uge_neg1__ord_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGE_NEG1:%.*]] = fcmp uge float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ord float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %uge.neg1 = fcmp uge float %arg, -1.0
+ call void @llvm.assume(i1 %uge.neg1)
+ %cmp = fcmp ord float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_uge_neg1__ueq_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_uge_neg1__ueq_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGE_NEG1:%.*]] = fcmp uge float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ueq float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %uge.neg1 = fcmp uge float %arg, -1.0
+ call void @llvm.assume(i1 %uge.neg1)
+ %cmp = fcmp ueq float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_uge_neg1__ugt_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_uge_neg1__ugt_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGE_NEG1:%.*]] = fcmp uge float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ugt float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %uge.neg1 = fcmp uge float %arg, -1.0
+ call void @llvm.assume(i1 %uge.neg1)
+ %cmp = fcmp ugt float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_uge_neg1__uge_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_uge_neg1__uge_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGE_NEG1:%.*]] = fcmp uge float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp uge float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %uge.neg1 = fcmp uge float %arg, -1.0
+ call void @llvm.assume(i1 %uge.neg1)
+ %cmp = fcmp uge float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_uge_neg1__ult_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_uge_neg1__ult_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGE_NEG1:%.*]] = fcmp uge float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ult float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %uge.neg1 = fcmp uge float %arg, -1.0
+ call void @llvm.assume(i1 %uge.neg1)
+ %cmp = fcmp ult float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_uge_neg1__ule_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_uge_neg1__ule_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGE_NEG1:%.*]] = fcmp uge float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ule float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %uge.neg1 = fcmp uge float %arg, -1.0
+ call void @llvm.assume(i1 %uge.neg1)
+ %cmp = fcmp ule float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_uge_neg1__une_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_uge_neg1__une_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGE_NEG1:%.*]] = fcmp uge float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp une float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %uge.neg1 = fcmp uge float %arg, -1.0
+ call void @llvm.assume(i1 %uge.neg1)
+ %cmp = fcmp une float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_uge_neg1__uno_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_uge_neg1__uno_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGE_NEG1:%.*]] = fcmp uge float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp uno float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %uge.neg1 = fcmp uge float %arg, -1.0
+ call void @llvm.assume(i1 %uge.neg1)
+ %cmp = fcmp uno float %arg, 0.0
+ ret i1 %cmp
+}
+
+; --------------------------------------------------------------------
+; Test assume x u> -1.0 with compares to 0
+; --------------------------------------------------------------------
+
+define i1 @assume_ugt_neg1__oeq_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ugt_neg1__oeq_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGT_NEG1:%.*]] = fcmp ugt float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp oeq float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ugt.neg1 = fcmp ugt float %arg, -1.0
+ call void @llvm.assume(i1 %ugt.neg1)
+ %cmp = fcmp oeq float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ugt_neg1__ogt_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ugt_neg1__ogt_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGT_NEG1:%.*]] = fcmp ugt float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ogt float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ugt.neg1 = fcmp ugt float %arg, -1.0
+ call void @llvm.assume(i1 %ugt.neg1)
+ %cmp = fcmp ogt float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ugt_neg1__oge_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ugt_neg1__oge_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGT_NEG1:%.*]] = fcmp ugt float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp oge float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ugt.neg1 = fcmp ugt float %arg, -1.0
+ call void @llvm.assume(i1 %ugt.neg1)
+ %cmp = fcmp oge float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ugt_neg1__olt_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ugt_neg1__olt_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGT_NEG1:%.*]] = fcmp ugt float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp olt float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ugt.neg1 = fcmp ugt float %arg, -1.0
+ call void @llvm.assume(i1 %ugt.neg1)
+ %cmp = fcmp olt float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ugt_neg1__ole_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ugt_neg1__ole_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGT_NEG1:%.*]] = fcmp ugt float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ole float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ugt.neg1 = fcmp ugt float %arg, -1.0
+ call void @llvm.assume(i1 %ugt.neg1)
+ %cmp = fcmp ole float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ugt_neg1__one_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ugt_neg1__one_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGT_NEG1:%.*]] = fcmp ugt float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp one float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ugt.neg1 = fcmp ugt float %arg, -1.0
+ call void @llvm.assume(i1 %ugt.neg1)
+ %cmp = fcmp one float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ugt_neg1__ord_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ugt_neg1__ord_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGT_NEG1:%.*]] = fcmp ugt float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ord float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ugt.neg1 = fcmp ugt float %arg, -1.0
+ call void @llvm.assume(i1 %ugt.neg1)
+ %cmp = fcmp ord float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ugt_neg1__ueq_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ugt_neg1__ueq_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGT_NEG1:%.*]] = fcmp ugt float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ueq float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ugt.neg1 = fcmp ugt float %arg, -1.0
+ call void @llvm.assume(i1 %ugt.neg1)
+ %cmp = fcmp ueq float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ugt_neg1__ugt_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ugt_neg1__ugt_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGT_NEG1:%.*]] = fcmp ugt float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ugt float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ugt.neg1 = fcmp ugt float %arg, -1.0
+ call void @llvm.assume(i1 %ugt.neg1)
+ %cmp = fcmp ugt float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ugt_neg1__uge_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ugt_neg1__uge_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGT_NEG1:%.*]] = fcmp ugt float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp uge float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ugt.neg1 = fcmp ugt float %arg, -1.0
+ call void @llvm.assume(i1 %ugt.neg1)
+ %cmp = fcmp uge float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ugt_neg1__ult_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ugt_neg1__ult_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGT_NEG1:%.*]] = fcmp ugt float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ult float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ugt.neg1 = fcmp ugt float %arg, -1.0
+ call void @llvm.assume(i1 %ugt.neg1)
+ %cmp = fcmp ult float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ugt_neg1__ule_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ugt_neg1__ule_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGT_NEG1:%.*]] = fcmp ugt float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ule float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ugt.neg1 = fcmp ugt float %arg, -1.0
+ call void @llvm.assume(i1 %ugt.neg1)
+ %cmp = fcmp ule float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ugt_neg1__une_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ugt_neg1__une_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGT_NEG1:%.*]] = fcmp ugt float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp une float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ugt.neg1 = fcmp ugt float %arg, -1.0
+ call void @llvm.assume(i1 %ugt.neg1)
+ %cmp = fcmp une float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ugt_neg1__uno_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ugt_neg1__uno_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGT_NEG1:%.*]] = fcmp ugt float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp uno float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ugt.neg1 = fcmp ugt float %arg, -1.0
+ call void @llvm.assume(i1 %ugt.neg1)
+ %cmp = fcmp uno float %arg, 0.0
+ ret i1 %cmp
+}
+
+; --------------------------------------------------------------------
+; Test assume x u<= -1.0 with compares to 0
+; --------------------------------------------------------------------
+
+define i1 @assume_ule_neg1__oeq_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ule_neg1__oeq_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[ULE_NEG1:%.*]] = fcmp ule float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[ULE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp oeq float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ule.neg1 = fcmp ule float %arg, -1.0
+ call void @llvm.assume(i1 %ule.neg1)
+ %cmp = fcmp oeq float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ule_neg1__ogt_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ule_neg1__ogt_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[ULE_NEG1:%.*]] = fcmp ule float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[ULE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ogt float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ule.neg1 = fcmp ule float %arg, -1.0
+ call void @llvm.assume(i1 %ule.neg1)
+ %cmp = fcmp ogt float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ule_neg1__oge_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ule_neg1__oge_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[ULE_NEG1:%.*]] = fcmp ule float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[ULE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp oge float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ule.neg1 = fcmp ule float %arg, -1.0
+ call void @llvm.assume(i1 %ule.neg1)
+ %cmp = fcmp oge float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ule_neg1__olt_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ule_neg1__olt_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[ULE_NEG1:%.*]] = fcmp ule float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[ULE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp olt float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ule.neg1 = fcmp ule float %arg, -1.0
+ call void @llvm.assume(i1 %ule.neg1)
+ %cmp = fcmp olt float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ule_neg1__ole_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ule_neg1__ole_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[ULE_NEG1:%.*]] = fcmp ule float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[ULE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ole float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ule.neg1 = fcmp ule float %arg, -1.0
+ call void @llvm.assume(i1 %ule.neg1)
+ %cmp = fcmp ole float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ule_neg1__one_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ule_neg1__one_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[ULE_NEG1:%.*]] = fcmp ule float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[ULE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp one float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ule.neg1 = fcmp ule float %arg, -1.0
+ call void @llvm.assume(i1 %ule.neg1)
+ %cmp = fcmp one float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ule_neg1__ord_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ule_neg1__ord_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[ULE_NEG1:%.*]] = fcmp ule float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[ULE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ord float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ule.neg1 = fcmp ule float %arg, -1.0
+ call void @llvm.assume(i1 %ule.neg1)
+ %cmp = fcmp ord float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ule_neg1__ueq_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ule_neg1__ueq_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[ULE_NEG1:%.*]] = fcmp ule float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[ULE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ueq float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ule.neg1 = fcmp ule float %arg, -1.0
+ call void @llvm.assume(i1 %ule.neg1)
+ %cmp = fcmp ueq float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ule_neg1__ugt_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ule_neg1__ugt_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[ULE_NEG1:%.*]] = fcmp ule float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[ULE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ugt float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ule.neg1 = fcmp ule float %arg, -1.0
+ call void @llvm.assume(i1 %ule.neg1)
+ %cmp = fcmp ugt float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ule_neg1__uge_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ule_neg1__uge_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[ULE_NEG1:%.*]] = fcmp ule float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[ULE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp uge float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ule.neg1 = fcmp ule float %arg, -1.0
+ call void @llvm.assume(i1 %ule.neg1)
+ %cmp = fcmp uge float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ule_neg1__ult_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ule_neg1__ult_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[ULE_NEG1:%.*]] = fcmp ule float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[ULE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ult float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ule.neg1 = fcmp ule float %arg, -1.0
+ call void @llvm.assume(i1 %ule.neg1)
+ %cmp = fcmp ult float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ule_neg1__ule_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ule_neg1__ule_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[ULE_NEG1:%.*]] = fcmp ule float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[ULE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ule float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ule.neg1 = fcmp ule float %arg, -1.0
+ call void @llvm.assume(i1 %ule.neg1)
+ %cmp = fcmp ule float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ule_neg1__une_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ule_neg1__une_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[ULE_NEG1:%.*]] = fcmp ule float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[ULE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp une float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ule.neg1 = fcmp ule float %arg, -1.0
+ call void @llvm.assume(i1 %ule.neg1)
+ %cmp = fcmp une float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ule_neg1__uno_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ule_neg1__uno_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[ULE_NEG1:%.*]] = fcmp ule float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[ULE_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp uno float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ule.neg1 = fcmp ule float %arg, -1.0
+ call void @llvm.assume(i1 %ule.neg1)
+ %cmp = fcmp uno float %arg, 0.0
+ ret i1 %cmp
+}
+
+; --------------------------------------------------------------------
+; Test assume x u< -1.0 with compares to 0
+; --------------------------------------------------------------------
+
+define i1 @assume_ult_neg1__oeq_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ult_neg1__oeq_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[ULT_NEG1:%.*]] = fcmp ult float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[ULT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp oeq float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ult.neg1 = fcmp ult float %arg, -1.0
+ call void @llvm.assume(i1 %ult.neg1)
+ %cmp = fcmp oeq float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ult_neg1__ogt_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ult_neg1__ogt_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[ULT_NEG1:%.*]] = fcmp ult float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[ULT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ogt float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ult.neg1 = fcmp ult float %arg, -1.0
+ call void @llvm.assume(i1 %ult.neg1)
+ %cmp = fcmp ogt float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ult_neg1__oge_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ult_neg1__oge_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[ULT_NEG1:%.*]] = fcmp ult float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[ULT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp oge float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ult.neg1 = fcmp ult float %arg, -1.0
+ call void @llvm.assume(i1 %ult.neg1)
+ %cmp = fcmp oge float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ult_neg1__olt_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ult_neg1__olt_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[ULT_NEG1:%.*]] = fcmp ult float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[ULT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp olt float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ult.neg1 = fcmp ult float %arg, -1.0
+ call void @llvm.assume(i1 %ult.neg1)
+ %cmp = fcmp olt float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ult_neg1__ole_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ult_neg1__ole_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[ULT_NEG1:%.*]] = fcmp ult float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[ULT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ole float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ult.neg1 = fcmp ult float %arg, -1.0
+ call void @llvm.assume(i1 %ult.neg1)
+ %cmp = fcmp ole float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ult_neg1__one_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ult_neg1__one_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[ULT_NEG1:%.*]] = fcmp ult float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[ULT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp one float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ult.neg1 = fcmp ult float %arg, -1.0
+ call void @llvm.assume(i1 %ult.neg1)
+ %cmp = fcmp one float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ult_neg1__ord_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ult_neg1__ord_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[ULT_NEG1:%.*]] = fcmp ult float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[ULT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ord float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ult.neg1 = fcmp ult float %arg, -1.0
+ call void @llvm.assume(i1 %ult.neg1)
+ %cmp = fcmp ord float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ult_neg1__ueq_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ult_neg1__ueq_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[ULT_NEG1:%.*]] = fcmp ult float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[ULT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ueq float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ult.neg1 = fcmp ult float %arg, -1.0
+ call void @llvm.assume(i1 %ult.neg1)
+ %cmp = fcmp ueq float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ult_neg1__ugt_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ult_neg1__ugt_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[ULT_NEG1:%.*]] = fcmp ult float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[ULT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ugt float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ult.neg1 = fcmp ult float %arg, -1.0
+ call void @llvm.assume(i1 %ult.neg1)
+ %cmp = fcmp ugt float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ult_neg1__uge_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ult_neg1__uge_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[ULT_NEG1:%.*]] = fcmp ult float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[ULT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp uge float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ult.neg1 = fcmp ult float %arg, -1.0
+ call void @llvm.assume(i1 %ult.neg1)
+ %cmp = fcmp uge float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ult_neg1__ult_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ult_neg1__ult_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[ULT_NEG1:%.*]] = fcmp ult float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[ULT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ult float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ult.neg1 = fcmp ult float %arg, -1.0
+ call void @llvm.assume(i1 %ult.neg1)
+ %cmp = fcmp ult float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ult_neg1__ule_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ult_neg1__ule_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[ULT_NEG1:%.*]] = fcmp ult float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[ULT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ule float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ult.neg1 = fcmp ult float %arg, -1.0
+ call void @llvm.assume(i1 %ult.neg1)
+ %cmp = fcmp ule float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ult_neg1__une_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ult_neg1__une_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[ULT_NEG1:%.*]] = fcmp ult float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[ULT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp une float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ult.neg1 = fcmp ult float %arg, -1.0
+ call void @llvm.assume(i1 %ult.neg1)
+ %cmp = fcmp une float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ult_neg1__uno_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ult_neg1__uno_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[ULT_NEG1:%.*]] = fcmp ult float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[ULT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp uno float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ult.neg1 = fcmp ult float %arg, -1.0
+ call void @llvm.assume(i1 %ult.neg1)
+ %cmp = fcmp uno float %arg, 0.0
+ ret i1 %cmp
+}
+
+; --------------------------------------------------------------------
+; Test assume x == 0 with compares to 0
+; --------------------------------------------------------------------
+
+define i1 @assume_oeq_0__oeq_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_oeq_0__oeq_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OEQ_0:%.*]] = fcmp oeq float [[ARG]], 0.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OEQ_0]])
+; CHECK-NEXT: ret i1 true
+;
+ %oeq.0 = fcmp oeq float %arg, 0.0
+ call void @llvm.assume(i1 %oeq.0)
+ %cmp = fcmp oeq float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_oeq_0__ueq_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_oeq_0__ueq_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OEQ_0:%.*]] = fcmp oeq float [[ARG]], 0.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OEQ_0]])
+; CHECK-NEXT: ret i1 true
+;
+ %oeq.0 = fcmp oeq float %arg, 0.0
+ call void @llvm.assume(i1 %oeq.0)
+ %cmp = fcmp ueq float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_one_0__oeq_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_one_0__oeq_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OEQ_0:%.*]] = fcmp one float [[ARG]], 0.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OEQ_0]])
+; CHECK-NEXT: ret i1 false
+;
+ %oeq.0 = fcmp one float %arg, 0.0
+ call void @llvm.assume(i1 %oeq.0)
+ %cmp = fcmp oeq float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ueq_0__oeq_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ueq_0__oeq_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OEQ_0:%.*]] = fcmp ueq float [[ARG]], 0.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OEQ_0]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp oeq float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %oeq.0 = fcmp ueq float %arg, 0.0
+ call void @llvm.assume(i1 %oeq.0)
+ %cmp = fcmp oeq float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ueq_0__ueq_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ueq_0__ueq_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UEQ_0:%.*]] = fcmp ueq float [[ARG]], 0.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UEQ_0]])
+; CHECK-NEXT: ret i1 true
+;
+ %ueq.0 = fcmp ueq float %arg, 0.0
+ call void @llvm.assume(i1 %ueq.0)
+ %cmp = fcmp ueq float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_one_0__ueq_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_one_0__ueq_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[ONE_0:%.*]] = fcmp one float [[ARG]], 0.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[ONE_0]])
+; CHECK-NEXT: ret i1 false
+;
+ %one.0 = fcmp one float %arg, 0.0
+ call void @llvm.assume(i1 %one.0)
+ %cmp = fcmp ueq float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_one_0__one_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_one_0__one_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[ONE_0:%.*]] = fcmp one float [[ARG]], 0.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[ONE_0]])
+; CHECK-NEXT: ret i1 true
+;
+ %one.0 = fcmp one float %arg, 0.0
+ call void @llvm.assume(i1 %one.0)
+ %cmp = fcmp one float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_une_0__oeq_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_une_0__oeq_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[ONE_0:%.*]] = fcmp une float [[ARG]], 0.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[ONE_0]])
+; CHECK-NEXT: ret i1 false
+;
+ %one.0 = fcmp une float %arg, 0.0
+ call void @llvm.assume(i1 %one.0)
+ %cmp = fcmp oeq float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_une_0__one_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_une_0__one_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[ONE_0:%.*]] = fcmp une float [[ARG]], 0.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[ONE_0]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp one float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %one.0 = fcmp une float %arg, 0.0
+ call void @llvm.assume(i1 %one.0)
+ %cmp = fcmp one float %arg, 0.0
+ ret i1 %cmp
+}
+
+; --------------------------------------------------------------------
+; Test assume x < 1.0 with compares to 0
+; --------------------------------------------------------------------
+
+define i1 @assume_olt_pos1__oeq_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_olt_pos1__oeq_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLT_POS1:%.*]] = fcmp olt float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLT_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp oeq float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %olt.pos1 = fcmp olt float %arg, 1.0
+ call void @llvm.assume(i1 %olt.pos1)
+ %cmp = fcmp oeq float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_olt_pos1__ogt_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_olt_pos1__ogt_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLT_POS1:%.*]] = fcmp olt float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLT_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ogt float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %olt.pos1 = fcmp olt float %arg, 1.0
+ call void @llvm.assume(i1 %olt.pos1)
+ %cmp = fcmp ogt float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_olt_pos1__oge_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_olt_pos1__oge_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLT_POS1:%.*]] = fcmp olt float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLT_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp oge float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %olt.pos1 = fcmp olt float %arg, 1.0
+ call void @llvm.assume(i1 %olt.pos1)
+ %cmp = fcmp oge float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_olt_pos1__olt_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_olt_pos1__olt_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLT_POS1:%.*]] = fcmp olt float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLT_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp olt float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %olt.pos1 = fcmp olt float %arg, 1.0
+ call void @llvm.assume(i1 %olt.pos1)
+ %cmp = fcmp olt float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_olt_pos1__ole_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_olt_pos1__ole_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLT_POS1:%.*]] = fcmp olt float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLT_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ole float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %olt.pos1 = fcmp olt float %arg, 1.0
+ call void @llvm.assume(i1 %olt.pos1)
+ %cmp = fcmp ole float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_olt_pos1__one_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_olt_pos1__one_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLT_POS1:%.*]] = fcmp olt float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLT_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp one float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %olt.pos1 = fcmp olt float %arg, 1.0
+ call void @llvm.assume(i1 %olt.pos1)
+ %cmp = fcmp one float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_olt_pos1__ord_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_olt_pos1__ord_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLT_POS1:%.*]] = fcmp olt float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLT_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ord float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %olt.pos1 = fcmp olt float %arg, 1.0
+ call void @llvm.assume(i1 %olt.pos1)
+ %cmp = fcmp ord float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_olt_pos1__ueq_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_olt_pos1__ueq_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLT_POS1:%.*]] = fcmp olt float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLT_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ueq float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %olt.pos1 = fcmp olt float %arg, 1.0
+ call void @llvm.assume(i1 %olt.pos1)
+ %cmp = fcmp ueq float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_olt_pos1__ugt_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_olt_pos1__ugt_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLT_POS1:%.*]] = fcmp olt float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLT_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ugt float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %olt.pos1 = fcmp olt float %arg, 1.0
+ call void @llvm.assume(i1 %olt.pos1)
+ %cmp = fcmp ugt float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_olt_pos1__uge_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_olt_pos1__uge_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLT_POS1:%.*]] = fcmp olt float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLT_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp uge float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %olt.pos1 = fcmp olt float %arg, 1.0
+ call void @llvm.assume(i1 %olt.pos1)
+ %cmp = fcmp uge float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_olt_pos1__ult_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_olt_pos1__ult_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLT_POS1:%.*]] = fcmp olt float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLT_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ult float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %olt.pos1 = fcmp olt float %arg, 1.0
+ call void @llvm.assume(i1 %olt.pos1)
+ %cmp = fcmp ult float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_olt_pos1__ule_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_olt_pos1__ule_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLT_POS1:%.*]] = fcmp olt float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLT_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ule float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %olt.pos1 = fcmp olt float %arg, 1.0
+ call void @llvm.assume(i1 %olt.pos1)
+ %cmp = fcmp ule float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_olt_pos1__une_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_olt_pos1__une_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLT_POS1:%.*]] = fcmp olt float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLT_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp une float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %olt.pos1 = fcmp olt float %arg, 1.0
+ call void @llvm.assume(i1 %olt.pos1)
+ %cmp = fcmp une float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_olt_pos1__uno_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_olt_pos1__uno_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLT_POS1:%.*]] = fcmp olt float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLT_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp uno float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %olt.pos1 = fcmp olt float %arg, 1.0
+ call void @llvm.assume(i1 %olt.pos1)
+ %cmp = fcmp uno float %arg, 0.0
+ ret i1 %cmp
+}
+
+; --------------------------------------------------------------------
+; Test assume x <= 1.0 with compares to 0
+; --------------------------------------------------------------------
+
+define i1 @assume_ole_pos1__oeq_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ole_pos1__oeq_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLE_POS1:%.*]] = fcmp ole float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLE_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp oeq float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ole.pos1 = fcmp ole float %arg, 1.0
+ call void @llvm.assume(i1 %ole.pos1)
+ %cmp = fcmp oeq float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ole_pos1__ogt_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ole_pos1__ogt_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLE_POS1:%.*]] = fcmp ole float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLE_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ogt float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ole.pos1 = fcmp ole float %arg, 1.0
+ call void @llvm.assume(i1 %ole.pos1)
+ %cmp = fcmp ogt float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ole_pos1__oge_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ole_pos1__oge_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLE_POS1:%.*]] = fcmp ole float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLE_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp oge float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ole.pos1 = fcmp ole float %arg, 1.0
+ call void @llvm.assume(i1 %ole.pos1)
+ %cmp = fcmp oge float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ole_pos1__olt_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ole_pos1__olt_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLE_POS1:%.*]] = fcmp ole float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLE_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp olt float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ole.pos1 = fcmp ole float %arg, 1.0
+ call void @llvm.assume(i1 %ole.pos1)
+ %cmp = fcmp olt float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ole_pos1__ole_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ole_pos1__ole_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLE_POS1:%.*]] = fcmp ole float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLE_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ole float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ole.pos1 = fcmp ole float %arg, 1.0
+ call void @llvm.assume(i1 %ole.pos1)
+ %cmp = fcmp ole float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ole_pos1__one_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ole_pos1__one_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLE_POS1:%.*]] = fcmp ole float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLE_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp one float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ole.pos1 = fcmp ole float %arg, 1.0
+ call void @llvm.assume(i1 %ole.pos1)
+ %cmp = fcmp one float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ole_pos1__ord_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ole_pos1__ord_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLE_POS1:%.*]] = fcmp ole float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLE_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ord float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ole.pos1 = fcmp ole float %arg, 1.0
+ call void @llvm.assume(i1 %ole.pos1)
+ %cmp = fcmp ord float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ole_pos1__ueq_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ole_pos1__ueq_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLE_POS1:%.*]] = fcmp ole float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLE_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ueq float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ole.pos1 = fcmp ole float %arg, 1.0
+ call void @llvm.assume(i1 %ole.pos1)
+ %cmp = fcmp ueq float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ole_pos1__ugt_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ole_pos1__ugt_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLE_POS1:%.*]] = fcmp ole float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLE_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ugt float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ole.pos1 = fcmp ole float %arg, 1.0
+ call void @llvm.assume(i1 %ole.pos1)
+ %cmp = fcmp ugt float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ole_pos1__uge_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ole_pos1__uge_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLE_POS1:%.*]] = fcmp ole float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLE_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp uge float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ole.pos1 = fcmp ole float %arg, 1.0
+ call void @llvm.assume(i1 %ole.pos1)
+ %cmp = fcmp uge float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ole_pos1__ult_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ole_pos1__ult_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLE_POS1:%.*]] = fcmp ole float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLE_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ult float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ole.pos1 = fcmp ole float %arg, 1.0
+ call void @llvm.assume(i1 %ole.pos1)
+ %cmp = fcmp ult float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ole_pos1__ule_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ole_pos1__ule_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLE_POS1:%.*]] = fcmp ole float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLE_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ule float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ole.pos1 = fcmp ole float %arg, 1.0
+ call void @llvm.assume(i1 %ole.pos1)
+ %cmp = fcmp ule float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ole_pos1__une_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ole_pos1__une_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLE_POS1:%.*]] = fcmp ole float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLE_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp une float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ole.pos1 = fcmp ole float %arg, 1.0
+ call void @llvm.assume(i1 %ole.pos1)
+ %cmp = fcmp une float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ole_pos1__uno_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ole_pos1__uno_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLE_POS1:%.*]] = fcmp ole float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLE_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp uno float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ole.pos1 = fcmp ole float %arg, 1.0
+ call void @llvm.assume(i1 %ole.pos1)
+ %cmp = fcmp uno float %arg, 0.0
+ ret i1 %cmp
+}
+
+; --------------------------------------------------------------------
+; Test assume x > 1.0 with compares to 0
+; --------------------------------------------------------------------
+
+define i1 @assume_ogt_pos1__oeq_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ogt_pos1__oeq_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGT_POS1:%.*]] = fcmp ogt float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGT_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp oeq float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ogt.pos1 = fcmp ogt float %arg, 1.0
+ call void @llvm.assume(i1 %ogt.pos1)
+ %cmp = fcmp oeq float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ogt_pos1__ogt_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ogt_pos1__ogt_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGT_POS1:%.*]] = fcmp ogt float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGT_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ogt float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ogt.pos1 = fcmp ogt float %arg, 1.0
+ call void @llvm.assume(i1 %ogt.pos1)
+ %cmp = fcmp ogt float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ogt_pos1__oge_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ogt_pos1__oge_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGT_POS1:%.*]] = fcmp ogt float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGT_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp oge float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ogt.pos1 = fcmp ogt float %arg, 1.0
+ call void @llvm.assume(i1 %ogt.pos1)
+ %cmp = fcmp oge float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ogt_pos1__olt_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ogt_pos1__olt_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGT_POS1:%.*]] = fcmp ogt float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGT_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp olt float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ogt.pos1 = fcmp ogt float %arg, 1.0
+ call void @llvm.assume(i1 %ogt.pos1)
+ %cmp = fcmp olt float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ogt_pos1__ole_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ogt_pos1__ole_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGT_POS1:%.*]] = fcmp ogt float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGT_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ole float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ogt.pos1 = fcmp ogt float %arg, 1.0
+ call void @llvm.assume(i1 %ogt.pos1)
+ %cmp = fcmp ole float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ogt_pos1__one_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ogt_pos1__one_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGT_POS1:%.*]] = fcmp ogt float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGT_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp one float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ogt.pos1 = fcmp ogt float %arg, 1.0
+ call void @llvm.assume(i1 %ogt.pos1)
+ %cmp = fcmp one float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ogt_pos1__ord_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ogt_pos1__ord_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGT_POS1:%.*]] = fcmp ogt float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGT_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ord float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ogt.pos1 = fcmp ogt float %arg, 1.0
+ call void @llvm.assume(i1 %ogt.pos1)
+ %cmp = fcmp ord float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ogt_pos1__ueq_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ogt_pos1__ueq_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGT_POS1:%.*]] = fcmp ogt float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGT_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ueq float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ogt.pos1 = fcmp ogt float %arg, 1.0
+ call void @llvm.assume(i1 %ogt.pos1)
+ %cmp = fcmp ueq float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ogt_pos1__ugt_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ogt_pos1__ugt_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGT_POS1:%.*]] = fcmp ogt float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGT_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ugt float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ogt.pos1 = fcmp ogt float %arg, 1.0
+ call void @llvm.assume(i1 %ogt.pos1)
+ %cmp = fcmp ugt float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ogt_pos1__uge_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ogt_pos1__uge_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGT_POS1:%.*]] = fcmp ogt float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGT_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp uge float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ogt.pos1 = fcmp ogt float %arg, 1.0
+ call void @llvm.assume(i1 %ogt.pos1)
+ %cmp = fcmp uge float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ogt_pos1__ult_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ogt_pos1__ult_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGT_POS1:%.*]] = fcmp ogt float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGT_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ult float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ogt.pos1 = fcmp ogt float %arg, 1.0
+ call void @llvm.assume(i1 %ogt.pos1)
+ %cmp = fcmp ult float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ogt_pos1__ule_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ogt_pos1__ule_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGT_POS1:%.*]] = fcmp ogt float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGT_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ule float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ogt.pos1 = fcmp ogt float %arg, 1.0
+ call void @llvm.assume(i1 %ogt.pos1)
+ %cmp = fcmp ule float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ogt_pos1__une_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ogt_pos1__une_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGT_POS1:%.*]] = fcmp ogt float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGT_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp une float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ogt.pos1 = fcmp ogt float %arg, 1.0
+ call void @llvm.assume(i1 %ogt.pos1)
+ %cmp = fcmp une float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ogt_pos1__uno_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ogt_pos1__uno_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGT_POS1:%.*]] = fcmp ogt float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGT_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp uno float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ogt.pos1 = fcmp ogt float %arg, 1.0
+ call void @llvm.assume(i1 %ogt.pos1)
+ %cmp = fcmp uno float %arg, 0.0
+ ret i1 %cmp
+}
+
+; --------------------------------------------------------------------
+; Test assume x >= 1.0 with compares to 0
+; --------------------------------------------------------------------
+
+define i1 @assume_oge_pos1__oeq_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_oge_pos1__oeq_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGE_POS1:%.*]] = fcmp oge float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGE_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp oeq float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %oge.pos1 = fcmp oge float %arg, 1.0
+ call void @llvm.assume(i1 %oge.pos1)
+ %cmp = fcmp oeq float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_oge_pos1__ogt_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_oge_pos1__ogt_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGE_POS1:%.*]] = fcmp oge float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGE_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ogt float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %oge.pos1 = fcmp oge float %arg, 1.0
+ call void @llvm.assume(i1 %oge.pos1)
+ %cmp = fcmp ogt float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_oge_pos1__oge_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_oge_pos1__oge_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGE_POS1:%.*]] = fcmp oge float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGE_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp oge float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %oge.pos1 = fcmp oge float %arg, 1.0
+ call void @llvm.assume(i1 %oge.pos1)
+ %cmp = fcmp oge float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_oge_pos1__olt_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_oge_pos1__olt_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGE_POS1:%.*]] = fcmp oge float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGE_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp olt float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %oge.pos1 = fcmp oge float %arg, 1.0
+ call void @llvm.assume(i1 %oge.pos1)
+ %cmp = fcmp olt float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_oge_pos1__ole_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_oge_pos1__ole_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGE_POS1:%.*]] = fcmp oge float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGE_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ole float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %oge.pos1 = fcmp oge float %arg, 1.0
+ call void @llvm.assume(i1 %oge.pos1)
+ %cmp = fcmp ole float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_oge_pos1__one_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_oge_pos1__one_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGE_POS1:%.*]] = fcmp oge float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGE_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp one float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %oge.pos1 = fcmp oge float %arg, 1.0
+ call void @llvm.assume(i1 %oge.pos1)
+ %cmp = fcmp one float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_oge_pos1__ord_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_oge_pos1__ord_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGE_POS1:%.*]] = fcmp oge float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGE_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ord float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %oge.pos1 = fcmp oge float %arg, 1.0
+ call void @llvm.assume(i1 %oge.pos1)
+ %cmp = fcmp ord float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_oge_pos1__ueq_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_oge_pos1__ueq_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGE_POS1:%.*]] = fcmp oge float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGE_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ueq float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %oge.pos1 = fcmp oge float %arg, 1.0
+ call void @llvm.assume(i1 %oge.pos1)
+ %cmp = fcmp ueq float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_oge_pos1__ugt_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_oge_pos1__ugt_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGE_POS1:%.*]] = fcmp oge float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGE_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ugt float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %oge.pos1 = fcmp oge float %arg, 1.0
+ call void @llvm.assume(i1 %oge.pos1)
+ %cmp = fcmp ugt float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_oge_pos1__uge_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_oge_pos1__uge_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGE_POS1:%.*]] = fcmp oge float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGE_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp uge float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %oge.pos1 = fcmp oge float %arg, 1.0
+ call void @llvm.assume(i1 %oge.pos1)
+ %cmp = fcmp uge float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_oge_pos1__ult_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_oge_pos1__ult_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGE_POS1:%.*]] = fcmp oge float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGE_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ult float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %oge.pos1 = fcmp oge float %arg, 1.0
+ call void @llvm.assume(i1 %oge.pos1)
+ %cmp = fcmp ult float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_oge_pos1__ule_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_oge_pos1__ule_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGE_POS1:%.*]] = fcmp oge float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGE_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ule float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %oge.pos1 = fcmp oge float %arg, 1.0
+ call void @llvm.assume(i1 %oge.pos1)
+ %cmp = fcmp ule float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_oge_pos1__une_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_oge_pos1__une_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGE_POS1:%.*]] = fcmp oge float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGE_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp une float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %oge.pos1 = fcmp oge float %arg, 1.0
+ call void @llvm.assume(i1 %oge.pos1)
+ %cmp = fcmp une float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_oge_pos1__uno_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_oge_pos1__uno_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OGE_POS1:%.*]] = fcmp oge float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OGE_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp uno float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %oge.pos1 = fcmp oge float %arg, 1.0
+ call void @llvm.assume(i1 %oge.pos1)
+ %cmp = fcmp uno float %arg, 0.0
+ ret i1 %cmp
+}
+
+; --------------------------------------------------------------------
+; Test assume x u> 1.0 with compares to 0
+; --------------------------------------------------------------------
+
+define i1 @assume_ugt_pos1__oeq_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ugt_pos1__oeq_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGT_POS1:%.*]] = fcmp ugt float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGT_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp oeq float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ugt.pos1 = fcmp ugt float %arg, 1.0
+ call void @llvm.assume(i1 %ugt.pos1)
+ %cmp = fcmp oeq float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ugt_pos1__ogt_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ugt_pos1__ogt_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGT_POS1:%.*]] = fcmp ugt float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGT_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ogt float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ugt.pos1 = fcmp ugt float %arg, 1.0
+ call void @llvm.assume(i1 %ugt.pos1)
+ %cmp = fcmp ogt float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ugt_pos1__oge_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ugt_pos1__oge_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGT_POS1:%.*]] = fcmp ugt float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGT_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp oge float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ugt.pos1 = fcmp ugt float %arg, 1.0
+ call void @llvm.assume(i1 %ugt.pos1)
+ %cmp = fcmp oge float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ugt_pos1__olt_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ugt_pos1__olt_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGT_POS1:%.*]] = fcmp ugt float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGT_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp olt float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ugt.pos1 = fcmp ugt float %arg, 1.0
+ call void @llvm.assume(i1 %ugt.pos1)
+ %cmp = fcmp olt float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ugt_pos1__ole_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ugt_pos1__ole_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGT_POS1:%.*]] = fcmp ugt float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGT_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ole float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ugt.pos1 = fcmp ugt float %arg, 1.0
+ call void @llvm.assume(i1 %ugt.pos1)
+ %cmp = fcmp ole float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ugt_pos1__one_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ugt_pos1__one_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGT_POS1:%.*]] = fcmp ugt float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGT_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp one float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ugt.pos1 = fcmp ugt float %arg, 1.0
+ call void @llvm.assume(i1 %ugt.pos1)
+ %cmp = fcmp one float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ugt_pos1__ord_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ugt_pos1__ord_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGT_POS1:%.*]] = fcmp ugt float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGT_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ord float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ugt.pos1 = fcmp ugt float %arg, 1.0
+ call void @llvm.assume(i1 %ugt.pos1)
+ %cmp = fcmp ord float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ugt_pos1__ueq_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ugt_pos1__ueq_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGT_POS1:%.*]] = fcmp ugt float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGT_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ueq float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ugt.pos1 = fcmp ugt float %arg, 1.0
+ call void @llvm.assume(i1 %ugt.pos1)
+ %cmp = fcmp ueq float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ugt_pos1__ugt_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ugt_pos1__ugt_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGT_POS1:%.*]] = fcmp ugt float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGT_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ugt float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ugt.pos1 = fcmp ugt float %arg, 1.0
+ call void @llvm.assume(i1 %ugt.pos1)
+ %cmp = fcmp ugt float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ugt_pos1__uge_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ugt_pos1__uge_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGT_POS1:%.*]] = fcmp ugt float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGT_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp uge float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ugt.pos1 = fcmp ugt float %arg, 1.0
+ call void @llvm.assume(i1 %ugt.pos1)
+ %cmp = fcmp uge float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ugt_pos1__ult_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ugt_pos1__ult_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGT_POS1:%.*]] = fcmp ugt float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGT_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ult float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ugt.pos1 = fcmp ugt float %arg, 1.0
+ call void @llvm.assume(i1 %ugt.pos1)
+ %cmp = fcmp ult float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ugt_pos1__ule_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ugt_pos1__ule_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGT_POS1:%.*]] = fcmp ugt float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGT_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ule float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ugt.pos1 = fcmp ugt float %arg, 1.0
+ call void @llvm.assume(i1 %ugt.pos1)
+ %cmp = fcmp ule float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ugt_pos1__une_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ugt_pos1__une_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGT_POS1:%.*]] = fcmp ugt float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGT_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp une float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ugt.pos1 = fcmp ugt float %arg, 1.0
+ call void @llvm.assume(i1 %ugt.pos1)
+ %cmp = fcmp une float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_ugt_pos1__uno_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_ugt_pos1__uno_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGT_POS1:%.*]] = fcmp ugt float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGT_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp uno float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %ugt.pos1 = fcmp ugt float %arg, 1.0
+ call void @llvm.assume(i1 %ugt.pos1)
+ %cmp = fcmp uno float %arg, 0.0
+ ret i1 %cmp
+}
+
+; --------------------------------------------------------------------
+; Test assume x u>= 1.0 with compares to 0
+; --------------------------------------------------------------------
+
+define i1 @assume_uge_pos1__oeq_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_uge_pos1__oeq_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGE_POS1:%.*]] = fcmp uge float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGE_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp oeq float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %uge.pos1 = fcmp uge float %arg, 1.0
+ call void @llvm.assume(i1 %uge.pos1)
+ %cmp = fcmp oeq float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_uge_pos1__ogt_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_uge_pos1__ogt_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGE_POS1:%.*]] = fcmp uge float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGE_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ogt float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %uge.pos1 = fcmp uge float %arg, 1.0
+ call void @llvm.assume(i1 %uge.pos1)
+ %cmp = fcmp ogt float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_uge_pos1__oge_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_uge_pos1__oge_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGE_POS1:%.*]] = fcmp uge float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGE_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp oge float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %uge.pos1 = fcmp uge float %arg, 1.0
+ call void @llvm.assume(i1 %uge.pos1)
+ %cmp = fcmp oge float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_uge_pos1__olt_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_uge_pos1__olt_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGE_POS1:%.*]] = fcmp uge float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGE_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp olt float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %uge.pos1 = fcmp uge float %arg, 1.0
+ call void @llvm.assume(i1 %uge.pos1)
+ %cmp = fcmp olt float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_uge_pos1__ole_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_uge_pos1__ole_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGE_POS1:%.*]] = fcmp uge float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGE_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ole float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %uge.pos1 = fcmp uge float %arg, 1.0
+ call void @llvm.assume(i1 %uge.pos1)
+ %cmp = fcmp ole float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_uge_pos1__one_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_uge_pos1__one_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGE_POS1:%.*]] = fcmp uge float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGE_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp one float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %uge.pos1 = fcmp uge float %arg, 1.0
+ call void @llvm.assume(i1 %uge.pos1)
+ %cmp = fcmp one float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_uge_pos1__ord_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_uge_pos1__ord_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGE_POS1:%.*]] = fcmp uge float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGE_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ord float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %uge.pos1 = fcmp uge float %arg, 1.0
+ call void @llvm.assume(i1 %uge.pos1)
+ %cmp = fcmp ord float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_uge_pos1__ueq_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_uge_pos1__ueq_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGE_POS1:%.*]] = fcmp uge float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGE_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ueq float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %uge.pos1 = fcmp uge float %arg, 1.0
+ call void @llvm.assume(i1 %uge.pos1)
+ %cmp = fcmp ueq float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_uge_pos1__ugt_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_uge_pos1__ugt_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGE_POS1:%.*]] = fcmp uge float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGE_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ugt float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %uge.pos1 = fcmp uge float %arg, 1.0
+ call void @llvm.assume(i1 %uge.pos1)
+ %cmp = fcmp ugt float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_uge_pos1__uge_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_uge_pos1__uge_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGE_POS1:%.*]] = fcmp uge float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGE_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp uge float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %uge.pos1 = fcmp uge float %arg, 1.0
+ call void @llvm.assume(i1 %uge.pos1)
+ %cmp = fcmp uge float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_uge_pos1__ult_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_uge_pos1__ult_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGE_POS1:%.*]] = fcmp uge float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGE_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ult float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %uge.pos1 = fcmp uge float %arg, 1.0
+ call void @llvm.assume(i1 %uge.pos1)
+ %cmp = fcmp ult float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_uge_pos1__ule_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_uge_pos1__ule_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGE_POS1:%.*]] = fcmp uge float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGE_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp ule float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %uge.pos1 = fcmp uge float %arg, 1.0
+ call void @llvm.assume(i1 %uge.pos1)
+ %cmp = fcmp ule float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_uge_pos1__une_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_uge_pos1__une_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGE_POS1:%.*]] = fcmp uge float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGE_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp une float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %uge.pos1 = fcmp uge float %arg, 1.0
+ call void @llvm.assume(i1 %uge.pos1)
+ %cmp = fcmp une float %arg, 0.0
+ ret i1 %cmp
+}
+
+define i1 @assume_uge_pos1__uno_0(float %arg) {
+; CHECK-LABEL: define i1 @assume_uge_pos1__uno_0(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[UGE_POS1:%.*]] = fcmp uge float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[UGE_POS1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp uno float [[ARG]], 0.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %uge.pos1 = fcmp uge float %arg, 1.0
+ call void @llvm.assume(i1 %uge.pos1)
+ %cmp = fcmp uno float %arg, 0.0
+ ret i1 %cmp
+}
+
+; --------------------------------------------------------------------
+; Test assume x < -1.0 with compares to inf
+; --------------------------------------------------------------------
+
+define i1 @assume_olt_neg1__oeq_inf(float %arg) {
+; CHECK-LABEL: define i1 @assume_olt_neg1__oeq_inf(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLT_NEG1:%.*]] = fcmp olt float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp oeq float [[ARG]], 0x7FF0000000000000
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %olt.neg1 = fcmp olt float %arg, -1.0
+ call void @llvm.assume(i1 %olt.neg1)
+ %cmp = fcmp oeq float %arg, 0x7FF0000000000000
+ ret i1 %cmp
+}
+
+define i1 @assume_olt_neg1__one_inf(float %arg) {
+; CHECK-LABEL: define i1 @assume_olt_neg1__one_inf(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLT_NEG1:%.*]] = fcmp olt float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp one float [[ARG]], 0x7FF0000000000000
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %olt.neg1 = fcmp olt float %arg, -1.0
+ call void @llvm.assume(i1 %olt.neg1)
+ %cmp = fcmp one float %arg, 0x7FF0000000000000
+ ret i1 %cmp
+}
+
+define i1 @assume_olt_neg1__oeq_ninf(float %arg) {
+; CHECK-LABEL: define i1 @assume_olt_neg1__oeq_ninf(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLT_NEG1:%.*]] = fcmp olt float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp oeq float [[ARG]], 0xFFF0000000000000
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %olt.neg1 = fcmp olt float %arg, -1.0
+ call void @llvm.assume(i1 %olt.neg1)
+ %cmp = fcmp oeq float %arg, 0xFFF0000000000000
+ ret i1 %cmp
+}
+
+define i1 @assume_olt_neg1__one_ninf(float %arg) {
+; CHECK-LABEL: define i1 @assume_olt_neg1__one_ninf(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLT_NEG1:%.*]] = fcmp olt float [[ARG]], -1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLT_NEG1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp one float [[ARG]], 0xFFF0000000000000
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %olt.neg1 = fcmp olt float %arg, -1.0
+ call void @llvm.assume(i1 %olt.neg1)
+ %cmp = fcmp one float %arg, 0xFFF0000000000000
+ ret i1 %cmp
+}
+
+; --------------------------------------------------------------------
+; Other
+; --------------------------------------------------------------------
+
+define i1 @assume_olt_1__oeq_2(float %arg) {
+; CHECK-LABEL: define i1 @assume_olt_1__oeq_2(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLT_1:%.*]] = fcmp olt float [[ARG]], 1.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLT_1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp oeq float [[ARG]], 2.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %olt.1 = fcmp olt float %arg, 1.0
+ call void @llvm.assume(i1 %olt.1)
+ %cmp = fcmp oeq float %arg, 2.0
+ ret i1 %cmp
+}
+
+; Ideally would fold to false
+define i1 @assume_ogt_2__oeq_2(float %arg) {
+; CHECK-LABEL: define i1 @assume_ogt_2__oeq_2(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLT_1:%.*]] = fcmp ogt float [[ARG]], 2.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLT_1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp oeq float [[ARG]], 2.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %olt.1 = fcmp ogt float %arg, 2.0
+ call void @llvm.assume(i1 %olt.1)
+ %cmp = fcmp oeq float %arg, 2.0
+ ret i1 %cmp
+}
+
+define i1 @assume_olt_2__olt_1(float %arg) {
+; CHECK-LABEL: define i1 @assume_olt_2__olt_1(
+; CHECK-SAME: float [[ARG:%.*]]) {
+; CHECK-NEXT: [[OLT_1:%.*]] = fcmp olt float [[ARG]], 2.000000e+00
+; CHECK-NEXT: call void @llvm.assume(i1 [[OLT_1]])
+; CHECK-NEXT: [[CMP:%.*]] = fcmp olt float [[ARG]], 1.000000e+00
+; CHECK-NEXT: ret i1 [[CMP]]
+;
+ %olt.1 = fcmp olt float %arg, 2.0
+ call void @llvm.assume(i1 %olt.1)
+ %cmp = fcmp olt float %arg, 1.0
+ ret i1 %cmp
+}
+
+attributes #0 = { nocallback nofree nosync nounwind willreturn memory(inaccessiblemem: readwrite) }
diff --git a/llvm/test/Transforms/InstSimplify/floating-point-compare.ll b/llvm/test/Transforms/InstSimplify/floating-point-compare.ll
index 62dd37d9b74e62c..3c1794c81284d74 100644
--- a/llvm/test/Transforms/InstSimplify/floating-point-compare.ll
+++ b/llvm/test/Transforms/InstSimplify/floating-point-compare.ll
@@ -11,6 +11,15 @@ define i1 @inf0(double %arg) {
ret i1 %tmp
}
+define i1 @inf0_fabs(double %arg) {
+; CHECK-LABEL: @inf0_fabs(
+; CHECK-NEXT: ret i1 false
+;
+ %fabs.arg = call double @llvm.fabs.f64(double %arg)
+ %tmp = fcmp ogt double %fabs.arg, 0x7FF0000000000000
+ ret i1 %tmp
+}
+
define i1 @inf1(double %arg) {
; CHECK-LABEL: @inf1(
; CHECK-NEXT: ret i1 true
@@ -19,6 +28,15 @@ define i1 @inf1(double %arg) {
ret i1 %tmp
}
+define i1 @inf1_fabs(double %arg) {
+; CHECK-LABEL: @inf1_fabs(
+; CHECK-NEXT: ret i1 true
+;
+ %fabs.arg = call double @llvm.fabs.f64(double %arg)
+ %tmp = fcmp ule double %fabs.arg, 0x7FF0000000000000
+ ret i1 %tmp
+}
+
; Negative infinity
define i1 @ninf0(double %arg) {
@@ -29,6 +47,15 @@ define i1 @ninf0(double %arg) {
ret i1 %tmp
}
+define i1 @ninf0_fabs(double %arg) {
+; CHECK-LABEL: @ninf0_fabs(
+; CHECK-NEXT: ret i1 false
+;
+ %fabs.arg = call double @llvm.fabs.f64(double %arg)
+ %tmp = fcmp olt double %fabs.arg, 0xFFF0000000000000
+ ret i1 %tmp
+}
+
define i1 @ninf1(double %arg) {
; CHECK-LABEL: @ninf1(
; CHECK-NEXT: ret i1 true
@@ -37,6 +64,15 @@ define i1 @ninf1(double %arg) {
ret i1 %tmp
}
+define i1 @ninf1_fabs(double %arg) {
+; CHECK-LABEL: @ninf1_fabs(
+; CHECK-NEXT: ret i1 true
+;
+ %fabs.arg = call double @llvm.fabs.f64(double %arg)
+ %tmp = fcmp uge double %fabs.arg, 0xFFF0000000000000
+ ret i1 %tmp
+}
+
; NaNs
define i1 @nan0(double %arg) {
@@ -1652,6 +1688,87 @@ bb:
ret float %i5
}
+define i1 @is_olt_smallest_normal_dynamic(float %x) "denormal-fp-math"="dynamic,dynamic" {
+; CHECK-LABEL: @is_olt_smallest_normal_dynamic(
+; CHECK-NEXT: [[IS_DENORM_OR_ZERO:%.*]] = fcmp olt float [[X:%.*]], 0x3810000000000000
+; CHECK-NEXT: ret i1 [[IS_DENORM_OR_ZERO]]
+;
+ %is.denorm.or.zero = fcmp olt float %x, 0x3810000000000000
+ ret i1 %is.denorm.or.zero
+}
+
+define i1 @is_olt_smallest_normal_ieee(float %x) "denormal-fp-math"="dynamic,ieee" {
+; CHECK-LABEL: @is_olt_smallest_normal_ieee(
+; CHECK-NEXT: [[IS_DENORM_OR_ZERO:%.*]] = fcmp olt float [[X:%.*]], 0x3810000000000000
+; CHECK-NEXT: ret i1 [[IS_DENORM_OR_ZERO]]
+;
+ %is.denorm.or.zero = fcmp olt float %x, 0x3810000000000000
+ ret i1 %is.denorm.or.zero
+}
+
+define i1 @is_olt_smallest_normal_preserve_sign(float %x) "denormal-fp-math"="dynamic,preserve-sign" {
+; CHECK-LABEL: @is_olt_smallest_normal_preserve_sign(
+; CHECK-NEXT: [[IS_DENORM_OR_ZERO:%.*]] = fcmp olt float [[X:%.*]], 0x3810000000000000
+; CHECK-NEXT: ret i1 [[IS_DENORM_OR_ZERO]]
+;
+ %is.denorm.or.zero = fcmp olt float %x, 0x3810000000000000
+ ret i1 %is.denorm.or.zero
+}
+
+define i1 @is_olt_smallest_normal_positive_zero(float %x) "denormal-fp-math"="dynamic,positive-zero" {
+; CHECK-LABEL: @is_olt_smallest_normal_positive_zero(
+; CHECK-NEXT: [[IS_DENORM_OR_ZERO:%.*]] = fcmp olt float [[X:%.*]], 0x3810000000000000
+; CHECK-NEXT: ret i1 [[IS_DENORM_OR_ZERO]]
+;
+ %is.denorm.or.zero = fcmp olt float %x, 0x3810000000000000
+ ret i1 %is.denorm.or.zero
+}
+
+define i1 @is_fabs_olt_smallest_normal_dynamic(float %x) "denormal-fp-math"="dynamic,dynamic" {
+; CHECK-LABEL: @is_fabs_olt_smallest_normal_dynamic(
+; CHECK-NEXT: [[FABS_X:%.*]] = call float @llvm.fabs.f32(float [[X:%.*]])
+; CHECK-NEXT: [[IS_DENORM_OR_ZERO:%.*]] = fcmp olt float [[FABS_X]], 0x3810000000000000
+; CHECK-NEXT: ret i1 [[IS_DENORM_OR_ZERO]]
+;
+ %fabs.x = call float @llvm.fabs.f32(float %x)
+ %is.denorm.or.zero = fcmp olt float %fabs.x, 0x3810000000000000
+ ret i1 %is.denorm.or.zero
+}
+
+define i1 @is_fabs_olt_smallest_normal_ieee(float %x) "denormal-fp-math"="dynamic,ieee" {
+; CHECK-LABEL: @is_fabs_olt_smallest_normal_ieee(
+; CHECK-NEXT: [[FABS_X:%.*]] = call float @llvm.fabs.f32(float [[X:%.*]])
+; CHECK-NEXT: [[IS_DENORM_OR_ZERO:%.*]] = fcmp olt float [[FABS_X]], 0x3810000000000000
+; CHECK-NEXT: ret i1 [[IS_DENORM_OR_ZERO]]
+;
+ %fabs.x = call float @llvm.fabs.f32(float %x)
+ %is.denorm.or.zero = fcmp olt float %fabs.x, 0x3810000000000000
+ ret i1 %is.denorm.or.zero
+}
+
+define i1 @is_fabs_olt_smallest_normal_preserve_sign(float %x) "denormal-fp-math"="dynamic,preserve-sign" {
+; CHECK-LABEL: @is_fabs_olt_smallest_normal_preserve_sign(
+; CHECK-NEXT: [[FABS_X:%.*]] = call float @llvm.fabs.f32(float [[X:%.*]])
+; CHECK-NEXT: [[IS_DENORM_OR_ZERO:%.*]] = fcmp olt float [[FABS_X]], 0x3810000000000000
+; CHECK-NEXT: ret i1 [[IS_DENORM_OR_ZERO]]
+;
+ %fabs.x = call float @llvm.fabs.f32(float %x)
+ %is.denorm.or.zero = fcmp olt float %fabs.x, 0x3810000000000000
+ ret i1 %is.denorm.or.zero
+}
+
+define i1 @is_fabs_olt_smallest_normal_positive_zero(float %x) "denormal-fp-math"="dynamic,positive-zero" {
+; CHECK-LABEL: @is_fabs_olt_smallest_normal_positive_zero(
+; CHECK-NEXT: [[FABS_X:%.*]] = call float @llvm.fabs.f32(float [[X:%.*]])
+; CHECK-NEXT: [[IS_DENORM_OR_ZERO:%.*]] = fcmp olt float [[FABS_X]], 0x3810000000000000
+; CHECK-NEXT: ret i1 [[IS_DENORM_OR_ZERO]]
+;
+ %fabs.x = call float @llvm.fabs.f32(float %x)
+ %is.denorm.or.zero = fcmp olt float %fabs.x, 0x3810000000000000
+ ret i1 %is.denorm.or.zero
+}
+
+
declare <2 x double> @llvm.fabs.v2f64(<2 x double>)
declare <2 x float> @llvm.fabs.v2f32(<2 x float>)
declare <2 x float> @llvm.maxnum.v2f32(<2 x float>, <2 x float>)
More information about the llvm-commits
mailing list