| ; 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) } |