[llvm] 13ffde3 - [ConstraintElim] Remove dead compares after simplification.
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Thu Aug 24 14:13:47 PDT 2023
Author: Florian Hahn
Date: 2023-08-24T22:12:57+01:00
New Revision: 13ffde316a8541d77116bd18f73efada236617f3
URL: https://github.com/llvm/llvm-project/commit/13ffde316a8541d77116bd18f73efada236617f3
DIFF: https://github.com/llvm/llvm-project/commit/13ffde316a8541d77116bd18f73efada236617f3.diff
LOG: [ConstraintElim] Remove dead compares after simplification.
Remove compares after replacing all uses. Cleaning dead compares can
enable additional simplifications when adjusting the position of the
pass slightly. In particular, it seems like the additional dead
instructions may prevent SimplifyCFG performing some folds.
Reviewed By: nikic
Differential Revision: https://reviews.llvm.org/D158760
Added:
Modified:
llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
llvm/test/Transforms/ConstraintElimination/add-nsw.ll
llvm/test/Transforms/ConstraintElimination/add-nuw.ll
llvm/test/Transforms/ConstraintElimination/analysis-invalidation.ll
llvm/test/Transforms/ConstraintElimination/and-implied-by-operands.ll
llvm/test/Transforms/ConstraintElimination/and.ll
llvm/test/Transforms/ConstraintElimination/assumes.ll
llvm/test/Transforms/ConstraintElimination/cond-used-in-phi.ll
llvm/test/Transforms/ConstraintElimination/constants-signed-predicates.ll
llvm/test/Transforms/ConstraintElimination/constants-unsigned-predicates.ll
llvm/test/Transforms/ConstraintElimination/decompose-with-temporary-indices.ll
llvm/test/Transforms/ConstraintElimination/dom.ll
llvm/test/Transforms/ConstraintElimination/empty-constraint.ll
llvm/test/Transforms/ConstraintElimination/eq.ll
llvm/test/Transforms/ConstraintElimination/gep-add-multiple-indices.ll
llvm/test/Transforms/ConstraintElimination/gep-arithmetic-add.ll
llvm/test/Transforms/ConstraintElimination/gep-arithmetic-different-types.ll
llvm/test/Transforms/ConstraintElimination/gep-arithmetic-signed-predicates.ll
llvm/test/Transforms/ConstraintElimination/gep-arithmetic.ll
llvm/test/Transforms/ConstraintElimination/gep-chains.ll
llvm/test/Transforms/ConstraintElimination/gep-constexpr.ll
llvm/test/Transforms/ConstraintElimination/gep-sub.ll
llvm/test/Transforms/ConstraintElimination/geps-i32-pointer-indexes.ll
llvm/test/Transforms/ConstraintElimination/geps-pointers-to-arrays.ll
llvm/test/Transforms/ConstraintElimination/geps-pointers-to-structs.ll
llvm/test/Transforms/ConstraintElimination/geps-ptrvector.ll
llvm/test/Transforms/ConstraintElimination/geps-unsigned-predicates.ll
llvm/test/Transforms/ConstraintElimination/invoke.ll
llvm/test/Transforms/ConstraintElimination/large-constant-ints.ll
llvm/test/Transforms/ConstraintElimination/large-system-growth.ll
llvm/test/Transforms/ConstraintElimination/loops-header-tested-base.ll
llvm/test/Transforms/ConstraintElimination/loops-header-tested-pointer-cmps.ll
llvm/test/Transforms/ConstraintElimination/loops-header-tested-pointer-iv.ll
llvm/test/Transforms/ConstraintElimination/loops.ll
llvm/test/Transforms/ConstraintElimination/max-row-limit.ll
llvm/test/Transforms/ConstraintElimination/minmax.ll
llvm/test/Transforms/ConstraintElimination/mixed-signed-unsigned-predicates.ll
llvm/test/Transforms/ConstraintElimination/mul-nsw.ll
llvm/test/Transforms/ConstraintElimination/mul.ll
llvm/test/Transforms/ConstraintElimination/ne.ll
llvm/test/Transforms/ConstraintElimination/or.ll
llvm/test/Transforms/ConstraintElimination/pointercast.ll
llvm/test/Transforms/ConstraintElimination/range_checks.ll
llvm/test/Transforms/ConstraintElimination/sge.ll
llvm/test/Transforms/ConstraintElimination/shl.ll
llvm/test/Transforms/ConstraintElimination/signed-query-unsigned-system.ll
llvm/test/Transforms/ConstraintElimination/sub-nuw.ll
llvm/test/Transforms/ConstraintElimination/switch.ll
llvm/test/Transforms/ConstraintElimination/transfer-signed-facts-to-unsigned.ll
llvm/test/Transforms/ConstraintElimination/transfer-unsigned-facts-to-signed.ll
llvm/test/Transforms/ConstraintElimination/uge.ll
llvm/test/Transforms/ConstraintElimination/ugt-ule.ll
llvm/test/Transforms/ConstraintElimination/ule.ll
llvm/test/Transforms/ConstraintElimination/uses-in-different-blocks.ll
llvm/test/Transforms/ConstraintElimination/vector-compares.ll
llvm/test/Transforms/ConstraintElimination/wrapping-math.ll
llvm/test/Transforms/ConstraintElimination/zext-for-per-formula-reasoning.ll
llvm/test/Transforms/ConstraintElimination/zext.ll
Removed:
################################################################################
diff --git a/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp b/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
index 15628d32280d8e..bc0fa09b9e3e30 100644
--- a/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
+++ b/llvm/lib/Transforms/Scalar/ConstraintElimination.cpp
@@ -1069,7 +1069,8 @@ static std::optional<bool> checkCondition(CmpInst *Cmp, ConstraintInfo &Info,
static bool checkAndReplaceCondition(
CmpInst *Cmp, ConstraintInfo &Info, unsigned NumIn, unsigned NumOut,
Instruction *ContextInst, Module *ReproducerModule,
- ArrayRef<ReproducerEntry> ReproducerCondStack, DominatorTree &DT) {
+ ArrayRef<ReproducerEntry> ReproducerCondStack, DominatorTree &DT,
+ SmallVectorImpl<Instruction *> &ToRemove) {
auto ReplaceCmpWithConstant = [&](CmpInst *Cmp, bool IsTrue) {
generateReproducer(Cmp, ReproducerModule, ReproducerCondStack, Info, DT);
Constant *ConstantC = ConstantInt::getBool(
@@ -1090,6 +1091,8 @@ static bool checkAndReplaceCondition(
return !II || II->getIntrinsicID() != Intrinsic::assume;
});
NumCondsRemoved++;
+ if (Cmp->use_empty())
+ ToRemove.push_back(Cmp);
return true;
};
@@ -1355,7 +1358,7 @@ static bool eliminateConstraints(Function &F, DominatorTree &DT,
} else if (auto *Cmp = dyn_cast<ICmpInst>(Inst)) {
bool Simplified = checkAndReplaceCondition(
Cmp, Info, CB.NumIn, CB.NumOut, CB.getContextInst(),
- ReproducerModule.get(), ReproducerCondStack, S.DT);
+ ReproducerModule.get(), ReproducerCondStack, S.DT, ToRemove);
if (!Simplified && match(CB.getContextInst(),
m_LogicalAnd(m_Value(), m_Specific(Inst)))) {
Simplified =
diff --git a/llvm/test/Transforms/ConstraintElimination/add-nsw.ll b/llvm/test/Transforms/ConstraintElimination/add-nsw.ll
index 88bb43576a4e17..59ea575f444092 100644
--- a/llvm/test/Transforms/ConstraintElimination/add-nsw.ll
+++ b/llvm/test/Transforms/ConstraintElimination/add-nsw.ll
@@ -64,16 +64,12 @@ define void @test.not.sge.slt(i8 %start, i8 %high) {
; CHECK: if.then:
; CHECK-NEXT: ret void
; CHECK: if.end:
-; CHECK-NEXT: [[T_0:%.*]] = icmp slt i8 [[START]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_1:%.*]] = add nsw i8 [[START]], 1
-; CHECK-NEXT: [[T_1:%.*]] = icmp slt i8 [[START_1]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_2:%.*]] = add nsw i8 [[START]], 2
-; CHECK-NEXT: [[T_2:%.*]] = icmp slt i8 [[START_2]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_3:%.*]] = add nsw i8 [[START]], 3
-; CHECK-NEXT: [[T_3:%.*]] = icmp slt i8 [[START_3]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_4:%.*]] = add nsw i8 [[START]], 4
; CHECK-NEXT: [[C_4:%.*]] = icmp slt i8 [[START_4]], [[HIGH]]
@@ -120,10 +116,8 @@ define void @test.decompose.nonconst(i8 %a, i8 %b, i8 %c, i8 %d) {
; CHECK-NEXT: br i1 [[AND_1]], label [[IF_THEN_2:%.*]], label [[IF_END]]
; CHECK: if.then.2:
; CHECK-NEXT: [[ADD_0:%.*]] = add nsw i8 [[A]], [[B]]
-; CHECK-NEXT: [[T_0:%.*]] = icmp sge i8 [[ADD_0]], [[C]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[ADD_1:%.*]] = add nsw i8 [[A]], [[A]]
-; CHECK-NEXT: [[T_1:%.*]] = icmp sge i8 [[ADD_0]], [[C]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[ADD_2:%.*]] = add nsw i8 [[A]], [[D:%.*]]
; CHECK-NEXT: [[C_4:%.*]] = icmp sge i8 [[ADD_2]], [[C]]
@@ -218,10 +212,8 @@ define void @test.sge.slt.add.neg(i8 %start, i8 %high) {
; CHECK-NEXT: [[C_4:%.*]] = icmp slt i8 [[START_2]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 [[C_4]])
; CHECK-NEXT: [[START_3:%.*]] = add nsw i8 [[START]], -3
-; CHECK-NEXT: [[T_1:%.*]] = icmp slt i8 [[START_3]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_4:%.*]] = add nsw i8 [[START]], -4
-; CHECK-NEXT: [[T_2:%.*]] = icmp slt i8 [[START_4]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: ret void
;
@@ -254,7 +246,6 @@ define i1 @test_ult_add_nsw_pos_1(i8 %start, i8 %high) {
; CHECK-NEXT: [[ADD_EXT:%.*]] = add nsw i16 [[START_EXT]], 3
; CHECK-NEXT: [[C_1:%.*]] = icmp ult i16 [[ADD_EXT]], [[HIGH_EXT]]
; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
-; CHECK-NEXT: [[T:%.*]] = icmp ult i16 [[START_EXT]], [[HIGH_EXT]]
; CHECK-NEXT: ret i1 true
;
entry:
@@ -276,7 +267,6 @@ define i1 @test_ult_add_nsw_pos_1_assume_pos(i8 %start, i8 %high) {
; CHECK-NEXT: [[ADD:%.*]] = add nsw i8 [[START]], 3
; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[ADD]], [[HIGH:%.*]]
; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
-; CHECK-NEXT: [[T:%.*]] = icmp ult i8 [[START]], [[HIGH]]
; CHECK-NEXT: ret i1 true
;
entry:
@@ -316,7 +306,6 @@ define i1 @test_ult_add_nsw_pos_1_cmp_no_ext(i8 %start, i8 %high) {
; CHECK-NEXT: [[ADD_EXT:%.*]] = add nsw i16 [[START_EXT]], 3
; CHECK-NEXT: [[C_1:%.*]] = icmp ult i16 [[ADD_EXT]], [[HIGH_EXT]]
; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
-; CHECK-NEXT: [[T:%.*]] = icmp ult i8 [[START]], [[HIGH]]
; CHECK-NEXT: ret i1 true
;
entry:
@@ -338,7 +327,6 @@ define i1 @test_ult_add_nsw_pos_2(i8 %start, i8 %high) {
; CHECK-NEXT: [[ADD_EXT:%.*]] = add nsw i16 [[START_EXT]], 3
; CHECK-NEXT: [[C_1:%.*]] = icmp ult i16 [[ADD_EXT]], [[HIGH_EXT]]
; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
-; CHECK-NEXT: [[F:%.*]] = icmp uge i16 [[START_EXT]], [[HIGH_EXT]]
; CHECK-NEXT: ret i1 false
;
entry:
@@ -360,7 +348,6 @@ define i1 @test_ult_add_nsw_pos_2_assume_pos(i8 %start, i8 %high) {
; CHECK-NEXT: [[ADD:%.*]] = add nsw i8 [[START]], 3
; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[ADD]], [[HIGH:%.*]]
; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
-; CHECK-NEXT: [[F:%.*]] = icmp uge i8 [[START]], [[HIGH]]
; CHECK-NEXT: ret i1 false
;
entry:
@@ -382,7 +369,6 @@ define i1 @test_ult_add_nsw_pos_2_cmp_no_ext(i8 %start, i8 %high) {
; CHECK-NEXT: [[ADD_EXT:%.*]] = add nsw i16 [[START_EXT]], 3
; CHECK-NEXT: [[C_1:%.*]] = icmp ult i16 [[ADD_EXT]], [[HIGH_EXT]]
; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
-; CHECK-NEXT: [[C:%.*]] = icmp uge i8 [[START]], [[HIGH]]
; CHECK-NEXT: ret i1 false
;
entry:
@@ -453,7 +439,6 @@ define i1 @test_ult_add_nsw_pos_4(i8 %start, i8 %high) {
; CHECK-NEXT: [[C_1:%.*]] = icmp ult i16 [[ADD_EXT]], [[HIGH_EXT]]
; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
; CHECK-NEXT: [[ADD_2:%.*]] = add nsw i16 [[START_EXT]], 2
-; CHECK-NEXT: [[C:%.*]] = icmp ult i16 [[ADD_2]], [[HIGH_EXT]]
; CHECK-NEXT: ret i1 true
;
entry:
@@ -477,7 +462,6 @@ define i1 @test_ult_add_nsw_pos_4_assume_pos(i8 %start, i8 %high) {
; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[ADD]], [[HIGH:%.*]]
; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
; CHECK-NEXT: [[ADD_2:%.*]] = add nsw i8 [[START]], 2
-; CHECK-NEXT: [[C:%.*]] = icmp ult i8 [[ADD_2]], [[HIGH]]
; CHECK-NEXT: ret i1 true
;
entry:
@@ -679,7 +663,6 @@ define i1 @test_ult_add_nsw_var_8_all_pos(i8 %start, i8 %off.1, i8 %off.2, i8 %h
; CHECK-NEXT: [[OFF_1_ULT:%.*]] = icmp ult i8 [[OFF_1]], [[OFF_2]]
; CHECK-NEXT: call void @llvm.assume(i1 [[OFF_1_ULT]])
; CHECK-NEXT: [[ADD_OFF_2:%.*]] = add nsw i8 [[START]], [[OFF_1]]
-; CHECK-NEXT: [[C:%.*]] = icmp ult i8 [[ADD_OFF_2]], [[HIGH]]
; CHECK-NEXT: ret i1 true
;
entry:
diff --git a/llvm/test/Transforms/ConstraintElimination/add-nuw.ll b/llvm/test/Transforms/ConstraintElimination/add-nuw.ll
index e8ac51bd9c6b52..67d90e5fd24df6 100644
--- a/llvm/test/Transforms/ConstraintElimination/add-nuw.ll
+++ b/llvm/test/Transforms/ConstraintElimination/add-nuw.ll
@@ -10,16 +10,12 @@ define void @test.not.uge.ult(i8 %start, i8 %low, i8 %high) {
; CHECK: if.then:
; CHECK-NEXT: ret void
; CHECK: if.end:
-; CHECK-NEXT: [[T_0:%.*]] = icmp ult i8 [[START]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_1:%.*]] = add nuw i8 [[START]], 1
-; CHECK-NEXT: [[T_1:%.*]] = icmp ult i8 [[START_1]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_2:%.*]] = add nuw i8 [[START]], 2
-; CHECK-NEXT: [[T_2:%.*]] = icmp ult i8 [[START_2]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_3:%.*]] = add nuw i8 [[START]], 3
-; CHECK-NEXT: [[T_3:%.*]] = icmp ult i8 [[START_3]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_4:%.*]] = add nuw i8 [[START]], 4
; CHECK-NEXT: [[C_4:%.*]] = icmp ult i8 [[START_4]], [[HIGH]]
@@ -61,19 +57,14 @@ define void @test.not.uge.ule(i8 %start, i8 %low, i8 %high) {
; CHECK: if.then:
; CHECK-NEXT: ret void
; CHECK: if.end:
-; CHECK-NEXT: [[T_0:%.*]] = icmp ule i8 [[START]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_1:%.*]] = add nuw i8 [[START]], 1
-; CHECK-NEXT: [[T_1:%.*]] = icmp ule i8 [[START_1]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_2:%.*]] = add nuw i8 [[START]], 2
-; CHECK-NEXT: [[T_2:%.*]] = icmp ule i8 [[START_2]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_3:%.*]] = add nuw i8 [[START]], 3
-; CHECK-NEXT: [[T_3:%.*]] = icmp ule i8 [[START_3]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_4:%.*]] = add nuw i8 [[START]], 4
-; CHECK-NEXT: [[T_4:%.*]] = icmp ule i8 [[START_4]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_5:%.*]] = add nuw i8 [[START]], 5
; CHECK-NEXT: [[C_5:%.*]] = icmp ule i8 [[START_5]], [[HIGH]]
@@ -120,19 +111,14 @@ define void @test.not.uge.ugt(i8 %start, i8 %low, i8 %high) {
; CHECK: if.then:
; CHECK-NEXT: ret void
; CHECK: if.end:
-; CHECK-NEXT: [[F_0:%.*]] = icmp ugt i8 [[START]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[START_1:%.*]] = add nuw i8 [[START]], 1
-; CHECK-NEXT: [[F_1:%.*]] = icmp ugt i8 [[START_1]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[START_2:%.*]] = add nuw i8 [[START]], 2
-; CHECK-NEXT: [[F_2:%.*]] = icmp ugt i8 [[START_2]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[START_3:%.*]] = add nuw i8 [[START]], 3
-; CHECK-NEXT: [[F_3:%.*]] = icmp ugt i8 [[START_3]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[START_4:%.*]] = add nuw i8 [[START]], 4
-; CHECK-NEXT: [[F_4:%.*]] = icmp ugt i8 [[START_4]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[START_5:%.*]] = add nuw i8 [[START]], 5
; CHECK-NEXT: [[C_5:%.*]] = icmp ugt i8 [[START_5]], [[HIGH]]
@@ -183,16 +169,12 @@ define void @test.not.uge.uge(i8 %start, i8 %low, i8 %high) {
; CHECK: if.then:
; CHECK-NEXT: ret void
; CHECK: if.end:
-; CHECK-NEXT: [[F_0:%.*]] = icmp ugt i8 [[START]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[START_1:%.*]] = add nuw i8 [[START]], 1
-; CHECK-NEXT: [[F_1:%.*]] = icmp uge i8 [[START_1]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[START_2:%.*]] = add nuw i8 [[START]], 2
-; CHECK-NEXT: [[F_2:%.*]] = icmp uge i8 [[START_2]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[START_3:%.*]] = add nuw i8 [[START]], 3
-; CHECK-NEXT: [[F_3:%.*]] = icmp uge i8 [[START_3]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[START_4:%.*]] = add nuw i8 [[START]], 4
; CHECK-NEXT: [[C_4:%.*]] = icmp uge i8 [[START_4]], [[HIGH]]
@@ -251,10 +233,8 @@ define void @test.decompose.nonconst(i8 %a, i8 %b, i8 %c, i8 %d) {
; CHECK-NEXT: br i1 [[AND_1]], label [[IF_THEN_2:%.*]], label [[IF_END]]
; CHECK: if.then.2:
; CHECK-NEXT: [[ADD_0:%.*]] = add nuw i8 [[A]], [[B]]
-; CHECK-NEXT: [[T_0:%.*]] = icmp uge i8 [[ADD_0]], [[C]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[ADD_1:%.*]] = add nuw i8 [[A]], [[A]]
-; CHECK-NEXT: [[T_1:%.*]] = icmp uge i8 [[ADD_0]], [[C]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[ADD_2:%.*]] = add nuw i8 [[A]], [[D:%.*]]
; CHECK-NEXT: [[C_4:%.*]] = icmp uge i8 [[ADD_2]], [[C]]
@@ -343,7 +323,6 @@ define i1 @test_n_must_ule_1_due_to_nuw(i8 %n, i8 %i) {
; CHECK-NEXT: [[C_1:%.*]] = icmp uge i8 [[I]], [[ADD]]
; CHECK-NEXT: br i1 [[C_1]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
; CHECK: if.then:
-; CHECK-NEXT: [[T:%.*]] = icmp ule i8 [[N]], 1
; CHECK-NEXT: ret i1 true
; CHECK: if.end:
; CHECK-NEXT: [[F:%.*]] = icmp ule i8 [[N]], 1
@@ -402,7 +381,6 @@ define i1 @test_n_must_ule_2_due_to_nuw(i8 %n, i8 %i) {
; CHECK-NEXT: [[C_1:%.*]] = icmp uge i8 [[I]], [[ADD]]
; CHECK-NEXT: br i1 [[C_1]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
; CHECK: if.then:
-; CHECK-NEXT: [[T:%.*]] = icmp ule i8 [[N]], 2
; CHECK-NEXT: ret i1 true
; CHECK: if.end:
; CHECK-NEXT: [[F:%.*]] = icmp ule i8 [[N]], 2
@@ -462,7 +440,6 @@ define i1 @add_nuw_neg_pr54224_i16(i16 %a) {
; CHECK-NEXT: [[C_1:%.*]] = icmp ugt i16 0, [[NEG2]]
; CHECK-NEXT: br i1 [[C_1]], label [[EXIT_1:%.*]], label [[EXIT_2:%.*]]
; CHECK: exit.1:
-; CHECK-NEXT: [[C_2:%.*]] = icmp ugt i16 [[A]], 0
; CHECK-NEXT: ret i1 false
; CHECK: exit.2:
; CHECK-NEXT: [[C_3:%.*]] = icmp ugt i16 [[A]], 0
@@ -516,13 +493,11 @@ define i1 @add_nuw_neg2_i8(i8 %a) {
; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[NEG2]], -2
; CHECK-NEXT: br i1 [[C_1]], label [[EXIT_1:%.*]], label [[EXIT_2:%.*]]
; CHECK: exit.1:
-; CHECK-NEXT: [[T_1:%.*]] = icmp ult i8 [[A]], 2
; CHECK-NEXT: [[C_2:%.*]] = icmp ult i8 [[A]], 1
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, [[C_2]]
; CHECK-NEXT: ret i1 [[RES_1]]
; CHECK: exit.2:
; CHECK-NEXT: [[C_3:%.*]] = icmp ult i8 [[A]], 3
-; CHECK-NEXT: [[F_1:%.*]] = icmp ult i8 [[A]], 2
; CHECK-NEXT: [[RES_2:%.*]] = xor i1 [[C_3]], false
; CHECK-NEXT: ret i1 [[RES_2]]
;
@@ -588,7 +563,6 @@ define i1 @test_chained_adds_nuw_1(i8 %a, i8 %b) {
; CHECK-NEXT: call void @llvm.assume(i1 [[C_B]])
; CHECK-NEXT: [[ADD_1:%.*]] = add nuw i8 [[A]], [[B]]
; CHECK-NEXT: [[ADD_2:%.*]] = add nuw i8 [[ADD_1]], 2
-; CHECK-NEXT: [[T_1:%.*]] = icmp uge i8 [[ADD_2]], 13
; CHECK-NEXT: [[C_1:%.*]] = icmp uge i8 [[ADD_2]], 14
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, [[C_1]]
; CHECK-NEXT: ret i1 [[RES_1]]
@@ -616,7 +590,6 @@ define i1 @test_chained_adds_nuw_2(i8 %a, i8 %b) {
; CHECK-NEXT: [[ADD_1:%.*]] = add nuw i8 [[A]], [[B]]
; CHECK-NEXT: [[ADD_2:%.*]] = add nuw i8 [[ADD_1]], 2
; CHECK-NEXT: [[ADD_3:%.*]] = add nuw i8 [[ADD_2]], [[A]]
-; CHECK-NEXT: [[T_1:%.*]] = icmp uge i8 [[ADD_3]], 18
; CHECK-NEXT: [[C_1:%.*]] = icmp uge i8 [[ADD_3]], 19
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, [[C_1]]
; CHECK-NEXT: ret i1 [[RES_1]]
@@ -645,7 +618,6 @@ define i1 @test_chained_adds_nuw_3(i8 %a, i8 %b) {
; CHECK-NEXT: [[ADD_1:%.*]] = add nuw i8 [[A]], 2
; CHECK-NEXT: [[ADD_2:%.*]] = add nuw i8 [[ADD_1]], [[B]]
; CHECK-NEXT: [[ADD_3:%.*]] = add nuw i8 [[ADD_2]], [[A]]
-; CHECK-NEXT: [[T_1:%.*]] = icmp uge i8 [[ADD_3]], 18
; CHECK-NEXT: [[C_1:%.*]] = icmp uge i8 [[ADD_3]], 19
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, [[C_1]]
; CHECK-NEXT: ret i1 [[RES_1]]
@@ -674,7 +646,6 @@ define i1 @test_chained_adds_nuw_4(i8 %a, i8 %b) {
; CHECK-NEXT: [[ADD_1:%.*]] = add nuw i8 [[A]], 2
; CHECK-NEXT: [[ADD_2:%.*]] = add nuw i8 [[ADD_1]], [[B]]
; CHECK-NEXT: [[ADD_3:%.*]] = add nuw i8 [[ADD_2]], 10
-; CHECK-NEXT: [[T_1:%.*]] = icmp uge i8 [[ADD_3]], 23
; CHECK-NEXT: [[C_1:%.*]] = icmp uge i8 [[ADD_3]], 24
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, [[C_1]]
; CHECK-NEXT: ret i1 [[RES_1]]
diff --git a/llvm/test/Transforms/ConstraintElimination/analysis-invalidation.ll b/llvm/test/Transforms/ConstraintElimination/analysis-invalidation.ll
index 2e82cbed101eb4..ba6e455d32e74e 100644
--- a/llvm/test/Transforms/ConstraintElimination/analysis-invalidation.ll
+++ b/llvm/test/Transforms/ConstraintElimination/analysis-invalidation.ll
@@ -1,3 +1,4 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 2
; RUN: opt -passes='require<demanded-bits>,constraint-elimination,require<demanded-bits>' -disable-verify -verify-analysis-invalidation=false -debug-pass-manager -disable-output %s 2>&1 | FileCheck %s
; Check that constraint-elimination properly invalidates anlyses.
@@ -65,3 +66,5 @@ bb1:
bb2:
ret i1 false
}
+;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
+; CHECK: {{.*}}
diff --git a/llvm/test/Transforms/ConstraintElimination/and-implied-by-operands.ll b/llvm/test/Transforms/ConstraintElimination/and-implied-by-operands.ll
index 8796bdcf086775..22f20f739b9e6f 100644
--- a/llvm/test/Transforms/ConstraintElimination/and-implied-by-operands.ll
+++ b/llvm/test/Transforms/ConstraintElimination/and-implied-by-operands.ll
@@ -138,7 +138,6 @@ define i1 @test_remove_variables(i1 %c, ptr %A, i64 %B, ptr %C) {
; CHECK: else.2:
; CHECK-NEXT: ret i1 false
; CHECK: exit:
-; CHECK-NEXT: [[T:%.*]] = icmp eq ptr null, null
; CHECK-NEXT: ret i1 true
;
entry:
@@ -167,7 +166,6 @@ define i1 @test_and_op_0_simplified(i32 %v) {
; CHECK-LABEL: @test_and_op_0_simplified(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[C_1:%.*]] = icmp sgt i32 [[V:%.*]], 0
-; CHECK-NEXT: [[T_1:%.*]] = icmp sgt i32 0, 0
; CHECK-NEXT: [[AND:%.*]] = and i1 false, [[C_1]]
; CHECK-NEXT: ret i1 [[AND]]
;
@@ -182,7 +180,6 @@ define i1 @test_and_op_1_simplified(i32 %v) {
; CHECK-LABEL: @test_and_op_1_simplified(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[C_1:%.*]] = icmp sgt i32 [[V:%.*]], 0
-; CHECK-NEXT: [[T_1:%.*]] = icmp sgt i32 0, 0
; CHECK-NEXT: [[AND:%.*]] = and i1 [[C_1]], false
; CHECK-NEXT: ret i1 [[AND]]
;
diff --git a/llvm/test/Transforms/ConstraintElimination/and.ll b/llvm/test/Transforms/ConstraintElimination/and.ll
index 91bd01c97ef971..71c030c5e0c3d9 100644
--- a/llvm/test/Transforms/ConstraintElimination/and.ll
+++ b/llvm/test/Transforms/ConstraintElimination/and.ll
@@ -11,10 +11,7 @@ define i1 @test_and_ule(i4 %x, i4 %y, i4 %z, i4 %a) {
; CHECK-NEXT: [[AND:%.*]] = and i1 [[C_1]], [[C_2]]
; CHECK-NEXT: br i1 [[AND]], label [[BB1:%.*]], label [[EXIT:%.*]]
; CHECK: bb1:
-; CHECK-NEXT: [[T_1:%.*]] = icmp ule i4 [[X]], [[Z]]
-; CHECK-NEXT: [[T_2:%.*]] = icmp ule i4 [[X]], [[Y]]
; CHECK-NEXT: [[R_1:%.*]] = xor i1 true, true
-; CHECK-NEXT: [[T_3:%.*]] = icmp ule i4 [[Y]], [[Z]]
; CHECK-NEXT: [[R_2:%.*]] = xor i1 [[R_1]], true
; CHECK-NEXT: [[C_3:%.*]] = icmp ule i4 [[X]], [[A:%.*]]
; CHECK-NEXT: [[R_3:%.*]] = xor i1 [[R_2]], [[C_3]]
@@ -72,10 +69,7 @@ define i1 @test_and_select_ule(i4 %x, i4 %y, i4 %z, i4 %a) {
; CHECK-NEXT: [[AND:%.*]] = select i1 [[C_1]], i1 [[C_2]], i1 false
; CHECK-NEXT: br i1 [[AND]], label [[BB1:%.*]], label [[EXIT:%.*]]
; CHECK: bb1:
-; CHECK-NEXT: [[T_1:%.*]] = icmp ule i4 [[X]], [[Z]]
-; CHECK-NEXT: [[T_2:%.*]] = icmp ule i4 [[X]], [[Y]]
; CHECK-NEXT: [[R_1:%.*]] = xor i1 true, true
-; CHECK-NEXT: [[T_3:%.*]] = icmp ule i4 [[Y]], [[Z]]
; CHECK-NEXT: [[R_2:%.*]] = xor i1 [[R_1]], true
; CHECK-NEXT: [[C_3:%.*]] = icmp ule i4 [[X]], [[A:%.*]]
; CHECK-NEXT: [[R_3:%.*]] = xor i1 [[R_2]], [[C_3]]
@@ -153,10 +147,9 @@ define i1 @test_and_condition_trivially_false(i1 %c, ptr %ptr.1, i8 %idx, ptr %p
; CHECK-NEXT: entry:
; CHECK-NEXT: br i1 [[C:%.*]], label [[THEN:%.*]], label [[EXIT_3:%.*]]
; CHECK: then:
-; CHECK-NEXT: [[CMP_1:%.*]] = icmp ugt ptr [[PTR_2:%.*]], [[PTR_2]]
; CHECK-NEXT: [[IDX_EXT:%.*]] = zext i8 [[IDX:%.*]] to i16
; CHECK-NEXT: [[GEP_IDX_EXT:%.*]] = getelementptr inbounds i8, ptr [[PTR_1:%.*]], i16 [[IDX_EXT]]
-; CHECK-NEXT: [[CMP_2:%.*]] = icmp ult ptr [[PTR_2]], [[GEP_IDX_EXT]]
+; CHECK-NEXT: [[CMP_2:%.*]] = icmp ult ptr [[PTR_2:%.*]], [[GEP_IDX_EXT]]
; CHECK-NEXT: [[AND:%.*]] = and i1 false, [[CMP_2]]
; CHECK-NEXT: br i1 [[AND]], label [[EXIT_1:%.*]], label [[EXIT_2:%.*]]
; CHECK: exit.1:
@@ -201,14 +194,9 @@ define i1 @test_and_chain_ule_1(i4 %x, i4 %y, i4 %z, i4 %a) {
; CHECK-NEXT: [[AND_3:%.*]] = and i1 [[C_4]], [[AND_2]]
; CHECK-NEXT: br i1 [[AND_3]], label [[BB1:%.*]], label [[EXIT:%.*]]
; CHECK: bb1:
-; CHECK-NEXT: [[T_1:%.*]] = icmp ule i4 [[X]], [[Z]]
-; CHECK-NEXT: [[T_2:%.*]] = icmp ule i4 [[X]], [[Y]]
; CHECK-NEXT: [[R_1:%.*]] = xor i1 true, true
-; CHECK-NEXT: [[T_3:%.*]] = icmp ule i4 [[Y]], [[Z]]
; CHECK-NEXT: [[R_2:%.*]] = xor i1 [[R_1]], true
-; CHECK-NEXT: [[T_4:%.*]] = icmp ule i4 3, [[X]]
; CHECK-NEXT: [[R_3:%.*]] = xor i1 [[R_2]], true
-; CHECK-NEXT: [[T_5:%.*]] = icmp ule i4 3, [[A]]
; CHECK-NEXT: [[R_4:%.*]] = xor i1 [[R_3]], true
; CHECK-NEXT: [[C_5:%.*]] = icmp ule i4 [[X]], [[A]]
; CHECK-NEXT: [[R_5:%.*]] = xor i1 [[R_4]], [[C_5]]
@@ -289,14 +277,9 @@ define i1 @test_and_chain_ule_2(i4 %x, i4 %y, i4 %z, i4 %a) {
; CHECK-NEXT: [[AND_3:%.*]] = and i1 [[AND_1]], [[AND_2]]
; CHECK-NEXT: br i1 [[AND_3]], label [[BB1:%.*]], label [[EXIT:%.*]]
; CHECK: bb1:
-; CHECK-NEXT: [[T_1:%.*]] = icmp ule i4 [[X]], [[Z]]
-; CHECK-NEXT: [[T_2:%.*]] = icmp ule i4 [[X]], [[Y]]
; CHECK-NEXT: [[R_1:%.*]] = xor i1 true, true
-; CHECK-NEXT: [[T_3:%.*]] = icmp ule i4 [[Y]], [[Z]]
; CHECK-NEXT: [[R_2:%.*]] = xor i1 [[R_1]], true
-; CHECK-NEXT: [[T_4:%.*]] = icmp ule i4 3, [[X]]
; CHECK-NEXT: [[R_3:%.*]] = xor i1 [[R_2]], true
-; CHECK-NEXT: [[T_5:%.*]] = icmp ule i4 3, [[A]]
; CHECK-NEXT: [[R_4:%.*]] = xor i1 [[R_3]], true
; CHECK-NEXT: [[C_5:%.*]] = icmp ule i4 [[X]], [[A]]
; CHECK-NEXT: [[R_5:%.*]] = xor i1 [[R_4]], [[C_5]]
@@ -378,10 +361,7 @@ define i1 @test_and_chain_with_other_insts_ule(i4 %x, i4 %y, i4 %z, i4 %a, i1 %a
; CHECK-NEXT: [[AND_3:%.*]] = and i1 [[AND_1]], [[AND_2]]
; CHECK-NEXT: br i1 [[AND_3]], label [[BB1:%.*]], label [[EXIT:%.*]]
; CHECK: bb1:
-; CHECK-NEXT: [[T_1:%.*]] = icmp ule i4 [[X]], [[Z]]
-; CHECK-NEXT: [[T_2:%.*]] = icmp ule i4 [[X]], [[Y]]
; CHECK-NEXT: [[R_1:%.*]] = xor i1 true, true
-; CHECK-NEXT: [[T_3:%.*]] = icmp ule i4 [[Y]], [[Z]]
; CHECK-NEXT: [[R_2:%.*]] = xor i1 [[R_1]], true
; CHECK-NEXT: [[C_4:%.*]] = icmp ule i4 3, [[X]]
; CHECK-NEXT: [[R_3:%.*]] = xor i1 [[R_2]], [[C_4]]
@@ -465,13 +445,10 @@ define i1 @test_and_chain_select_ule(i4 %x, i4 %y, i4 %z, i4 %a) {
; CHECK-NEXT: br i1 [[AND_3]], label [[BB1:%.*]], label [[EXIT:%.*]]
; CHECK: bb1:
; CHECK-NEXT: [[T_1:%.*]] = icmp ule i4 [[X]], [[Z]]
-; CHECK-NEXT: [[T_2:%.*]] = icmp ule i4 [[X]], [[Y]]
; CHECK-NEXT: [[R_1:%.*]] = xor i1 [[T_1]], true
; CHECK-NEXT: [[T_3:%.*]] = icmp ule i4 [[Y]], [[Z]]
; CHECK-NEXT: [[R_2:%.*]] = xor i1 [[R_1]], [[T_3]]
-; CHECK-NEXT: [[T_4:%.*]] = icmp ule i4 3, [[X]]
; CHECK-NEXT: [[R_3:%.*]] = xor i1 [[R_2]], true
-; CHECK-NEXT: [[T_5:%.*]] = icmp ule i4 3, [[A]]
; CHECK-NEXT: [[R_4:%.*]] = xor i1 [[R_3]], true
; CHECK-NEXT: [[C_5:%.*]] = icmp ule i4 [[X]], [[A]]
; CHECK-NEXT: [[R_5:%.*]] = xor i1 [[R_4]], [[C_5]]
diff --git a/llvm/test/Transforms/ConstraintElimination/assumes.ll b/llvm/test/Transforms/ConstraintElimination/assumes.ll
index fd1f2cb2935387..5ec231fab15d6f 100644
--- a/llvm/test/Transforms/ConstraintElimination/assumes.ll
+++ b/llvm/test/Transforms/ConstraintElimination/assumes.ll
@@ -14,16 +14,12 @@ define i1 @assume_dominates(i8 %a, i8 %b, i1 %c) {
; CHECK-NEXT: call void @llvm.assume(i1 [[CMP_1]])
; CHECK-NEXT: br i1 [[C:%.*]], label [[THEN:%.*]], label [[ELSE:%.*]]
; CHECK: then:
-; CHECK-NEXT: [[T_1:%.*]] = icmp ule i8 [[ADD_1]], [[B]]
-; CHECK-NEXT: [[T_2:%.*]] = icmp ule i8 [[A]], [[B]]
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, true
; CHECK-NEXT: [[ADD_2:%.*]] = add nuw nsw i8 [[A]], 2
; CHECK-NEXT: [[C_1:%.*]] = icmp ule i8 [[ADD_2]], [[B]]
; CHECK-NEXT: [[RES_2:%.*]] = xor i1 [[RES_1]], [[C_1]]
; CHECK-NEXT: ret i1 [[RES_2]]
; CHECK: else:
-; CHECK-NEXT: [[T_3:%.*]] = icmp ule i8 [[ADD_1]], [[B]]
-; CHECK-NEXT: [[T_4:%.*]] = icmp ule i8 [[A]], [[B]]
; CHECK-NEXT: [[RES_3:%.*]] = xor i1 true, true
; CHECK-NEXT: [[ADD_2_1:%.*]] = add nuw nsw i8 [[A]], 2
; CHECK-NEXT: [[C_2:%.*]] = icmp ule i8 [[ADD_2_1]], [[B]]
@@ -62,16 +58,12 @@ define i1 @assume_dominates_with_may_unwind_call_before_assume(i8 %a, i8 %b, i1
; CHECK-NEXT: call void @llvm.assume(i1 [[CMP_1]])
; CHECK-NEXT: br i1 [[C:%.*]], label [[THEN:%.*]], label [[ELSE:%.*]]
; CHECK: then:
-; CHECK-NEXT: [[T_1:%.*]] = icmp ule i8 [[ADD_1]], [[B]]
-; CHECK-NEXT: [[T_2:%.*]] = icmp ule i8 [[A]], [[B]]
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, true
; CHECK-NEXT: [[ADD_2:%.*]] = add nuw nsw i8 [[A]], 2
; CHECK-NEXT: [[C_1:%.*]] = icmp ule i8 [[ADD_2]], [[B]]
; CHECK-NEXT: [[RES_2:%.*]] = xor i1 [[RES_1]], [[C_1]]
; CHECK-NEXT: ret i1 [[RES_2]]
; CHECK: else:
-; CHECK-NEXT: [[T_3:%.*]] = icmp ule i8 [[ADD_1]], [[B]]
-; CHECK-NEXT: [[T_4:%.*]] = icmp ule i8 [[A]], [[B]]
; CHECK-NEXT: [[RES_3:%.*]] = xor i1 true, true
; CHECK-NEXT: [[ADD_2_1:%.*]] = add nuw nsw i8 [[A]], 2
; CHECK-NEXT: [[C_2:%.*]] = icmp ule i8 [[ADD_2_1]], [[B]]
@@ -111,16 +103,12 @@ define i1 @assume_dominates_with_may_unwind_call_after_assume(i8 %a, i8 %b, i1 %
; CHECK-NEXT: call void @may_unwind()
; CHECK-NEXT: br i1 [[C:%.*]], label [[THEN:%.*]], label [[ELSE:%.*]]
; CHECK: then:
-; CHECK-NEXT: [[T_1:%.*]] = icmp ule i8 [[ADD_1]], [[B]]
-; CHECK-NEXT: [[T_2:%.*]] = icmp ule i8 [[A]], [[B]]
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, true
; CHECK-NEXT: [[ADD_2:%.*]] = add nuw nsw i8 [[A]], 2
; CHECK-NEXT: [[C_1:%.*]] = icmp ule i8 [[ADD_2]], [[B]]
; CHECK-NEXT: [[RES_2:%.*]] = xor i1 [[RES_1]], [[C_1]]
; CHECK-NEXT: ret i1 [[RES_2]]
; CHECK: else:
-; CHECK-NEXT: [[T_3:%.*]] = icmp ule i8 [[ADD_1]], [[B]]
-; CHECK-NEXT: [[T_4:%.*]] = icmp ule i8 [[A]], [[B]]
; CHECK-NEXT: [[RES_3:%.*]] = xor i1 true, true
; CHECK-NEXT: [[ADD_2_1:%.*]] = add nuw nsw i8 [[A]], 2
; CHECK-NEXT: [[C_2:%.*]] = icmp ule i8 [[ADD_2_1]], [[B]]
@@ -188,7 +176,6 @@ define i1 @assume_dominates_successor_with_may_unwind_call_before_assume_uncond_
; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
; CHECK-NEXT: br label [[EXIT:%.*]]
; CHECK: exit:
-; CHECK-NEXT: [[C_2:%.*]] = icmp eq i16 [[A]], 0
; CHECK-NEXT: ret i1 true
;
entry:
@@ -263,8 +250,6 @@ define i1 @assume_single_bb(i8 %a, i8 %b, i1 %c) {
; CHECK-NEXT: [[ADD_1:%.*]] = add nuw nsw i8 [[A:%.*]], 1
; CHECK-NEXT: [[CMP_1:%.*]] = icmp ule i8 [[ADD_1]], [[B:%.*]]
; CHECK-NEXT: call void @llvm.assume(i1 [[CMP_1]])
-; CHECK-NEXT: [[T_1:%.*]] = icmp ule i8 [[ADD_1]], [[B]]
-; CHECK-NEXT: [[T_2:%.*]] = icmp ule i8 [[A]], [[B]]
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, true
; CHECK-NEXT: [[ADD_2:%.*]] = add nuw nsw i8 [[A]], 2
; CHECK-NEXT: [[C_1:%.*]] = icmp ule i8 [[ADD_2]], [[B]]
@@ -290,8 +275,6 @@ define i1 @assume_same_bb(i8 %a, i8 %b, i1 %c) {
; CHECK-NEXT: br i1 [[C:%.*]], label [[THEN:%.*]], label [[ELSE:%.*]]
; CHECK: then:
; CHECK-NEXT: call void @llvm.assume(i1 [[CMP_1]])
-; CHECK-NEXT: [[T_1:%.*]] = icmp ule i8 [[ADD_1]], [[B]]
-; CHECK-NEXT: [[T_2:%.*]] = icmp ule i8 [[A]], [[B]]
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, true
; CHECK-NEXT: [[ADD_2:%.*]] = add nuw nsw i8 [[A]], 2
; CHECK-NEXT: [[C_1:%.*]] = icmp ule i8 [[ADD_2]], [[B]]
@@ -335,8 +318,6 @@ define i1 @assume_same_bb2(i8 %a, i8 %b, i1 %c) {
; CHECK-NEXT: [[ADD_1:%.*]] = add nuw nsw i8 [[A:%.*]], 1
; CHECK-NEXT: [[CMP_1:%.*]] = icmp ule i8 [[ADD_1]], [[B:%.*]]
; CHECK-NEXT: call void @llvm.assume(i1 [[CMP_1]])
-; CHECK-NEXT: [[T_1:%.*]] = icmp ule i8 [[ADD_1]], [[B]]
-; CHECK-NEXT: [[T_2:%.*]] = icmp ule i8 [[A]], [[B]]
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, true
; CHECK-NEXT: [[ADD_2:%.*]] = add nuw nsw i8 [[A]], 2
; CHECK-NEXT: [[C_1:%.*]] = icmp ule i8 [[ADD_2]], [[B]]
@@ -369,8 +350,6 @@ define i1 @assume_same_bb_after_may_exiting_call(i8 %a, i8 %b, i1 %c) {
; CHECK-NEXT: [[CMP_1:%.*]] = icmp ule i8 [[ADD_1]], [[B:%.*]]
; CHECK-NEXT: call void @may_unwind()
; CHECK-NEXT: call void @llvm.assume(i1 [[CMP_1]])
-; CHECK-NEXT: [[T_1:%.*]] = icmp ule i8 [[ADD_1]], [[B]]
-; CHECK-NEXT: [[T_2:%.*]] = icmp ule i8 [[A]], [[B]]
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, true
; CHECK-NEXT: [[ADD_2:%.*]] = add nuw nsw i8 [[A]], 2
; CHECK-NEXT: [[C_1:%.*]] = icmp ule i8 [[ADD_2]], [[B]]
@@ -403,8 +382,6 @@ define i1 @assume_same_bb_before_may_exiting_call(i8 %a, i8 %b, i1 %c) {
; CHECK-NEXT: [[CMP_1:%.*]] = icmp ule i8 [[ADD_1]], [[B:%.*]]
; CHECK-NEXT: call void @llvm.assume(i1 [[CMP_1]])
; CHECK-NEXT: call void @may_unwind()
-; CHECK-NEXT: [[T_1:%.*]] = icmp ule i8 [[ADD_1]], [[B]]
-; CHECK-NEXT: [[T_2:%.*]] = icmp ule i8 [[A]], [[B]]
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, true
; CHECK-NEXT: [[ADD_2:%.*]] = add nuw nsw i8 [[A]], 2
; CHECK-NEXT: [[C_1:%.*]] = icmp ule i8 [[ADD_2]], [[B]]
@@ -432,11 +409,9 @@ exit:
define i1 @assume_same_bb_after_condition(i8 %a, i8 %b, i1 %c) {
; CHECK-LABEL: @assume_same_bb_after_condition(
; CHECK-NEXT: [[ADD_1:%.*]] = add nuw nsw i8 [[A:%.*]], 1
-; CHECK-NEXT: [[T_1:%.*]] = icmp ule i8 [[ADD_1]], [[B:%.*]]
-; CHECK-NEXT: [[T_2:%.*]] = icmp ule i8 [[A]], [[B]]
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, true
; CHECK-NEXT: [[ADD_2:%.*]] = add nuw nsw i8 [[A]], 2
-; CHECK-NEXT: [[C_1:%.*]] = icmp ule i8 [[ADD_2]], [[B]]
+; CHECK-NEXT: [[C_1:%.*]] = icmp ule i8 [[ADD_2]], [[B:%.*]]
; CHECK-NEXT: [[RES_2:%.*]] = xor i1 [[RES_1]], [[C_1]]
; CHECK-NEXT: [[CMP_1:%.*]] = icmp ule i8 [[ADD_1]], [[B]]
; CHECK-NEXT: call void @llvm.assume(i1 [[CMP_1]])
@@ -508,7 +483,6 @@ define i1 @assume_single_bb_conditions_after_assume(i8 %a, i8 %b, i1 %c) {
; CHECK-NEXT: call void @use(i1 [[C_1]])
; CHECK-NEXT: call void @may_unwind()
; CHECK-NEXT: call void @llvm.assume(i1 [[CMP_1]])
-; CHECK-NEXT: [[T_2:%.*]] = icmp ule i8 [[A]], [[B]]
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, true
; CHECK-NEXT: [[ADD_2:%.*]] = add nuw nsw i8 [[A]], 2
; CHECK-NEXT: [[C_2:%.*]] = icmp ule i8 [[ADD_2]], [[B]]
@@ -570,7 +544,6 @@ define i1 @all_uses_after_assume(i8 %a, i8 %b, i1 %c) {
; CHECK-NEXT: [[ADD_1:%.*]] = add nuw nsw i8 [[A:%.*]], 1
; CHECK-NEXT: [[CMP_1:%.*]] = icmp ule i8 [[ADD_1]], [[B:%.*]]
; CHECK-NEXT: [[C_1:%.*]] = icmp ule i8 [[ADD_1]], [[B]]
-; CHECK-NEXT: [[T_2:%.*]] = icmp ule i8 [[A]], [[B]]
; CHECK-NEXT: call void @use(i1 [[C_1]])
; CHECK-NEXT: call void @may_unwind()
; CHECK-NEXT: call void @llvm.assume(i1 [[CMP_1]])
diff --git a/llvm/test/Transforms/ConstraintElimination/cond-used-in-phi.ll b/llvm/test/Transforms/ConstraintElimination/cond-used-in-phi.ll
index b14c4437c1b59d..d38c46b0256385 100644
--- a/llvm/test/Transforms/ConstraintElimination/cond-used-in-phi.ll
+++ b/llvm/test/Transforms/ConstraintElimination/cond-used-in-phi.ll
@@ -12,7 +12,6 @@ define void @phi_loop_1(i8 %x) {
; CHECK: loop:
; CHECK-NEXT: [[IV:%.*]] = phi i8 [ 0, [[ENTRY:%.*]] ], [ [[IV_NEXT:%.*]], [[LOOP]] ]
; CHECK-NEXT: [[C_PHI:%.*]] = phi i1 [ false, [[ENTRY]] ], [ true, [[LOOP]] ]
-; CHECK-NEXT: [[T_1:%.*]] = icmp uge i8 [[X]], 8
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[IV_NEXT]] = add i8 [[IV]], 1
; CHECK-NEXT: [[EC:%.*]] = icmp ult i8 [[IV_NEXT]], 3
@@ -54,7 +53,6 @@ define void @phi_loop_2(i8 %x) {
; CHECK-NEXT: br label [[LOOP_2:%.*]]
; CHECK: loop.2:
; CHECK-NEXT: [[IV:%.*]] = phi i8 [ 0, [[LOOP_1_HEADER]] ], [ [[IV_NEXT:%.*]], [[LOOP_2]] ]
-; CHECK-NEXT: [[T_1:%.*]] = icmp uge i8 [[X]], 8
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[IV_NEXT]] = add i8 [[IV]], 1
; CHECK-NEXT: [[EC:%.*]] = icmp ult i8 [[IV_NEXT]], 3
@@ -104,7 +102,6 @@ define void @phi_loop_3(i8 %x, i1 %c) {
; CHECK-NEXT: [[C_PHI:%.*]] = phi i1 [ false, [[ENTRY]] ], [ true, [[LOOP_LATCH]] ]
; CHECK-NEXT: br i1 [[C:%.*]], label [[LOOP_LATCH]], label [[LOOP_EXIT:%.*]]
; CHECK: loop.latch:
-; CHECK-NEXT: [[T_1:%.*]] = icmp uge i8 [[X]], 8
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[IV_NEXT]] = add i8 [[IV]], 1
; CHECK-NEXT: [[EC:%.*]] = icmp ult i8 [[IV_NEXT]], 3
@@ -145,7 +142,6 @@ define i1 @test_if_then_1(i8 %x) {
; CHECK-NEXT: [[CMP1:%.*]] = icmp sgt i8 [[X:%.*]], 1
; CHECK-NEXT: br i1 [[CMP1]], label [[IF:%.*]], label [[JOIN:%.*]]
; CHECK: if:
-; CHECK-NEXT: [[CMP2:%.*]] = icmp sgt i8 [[X]], 0
; CHECK-NEXT: br label [[JOIN]]
; CHECK: join:
; CHECK-NEXT: [[PHI:%.*]] = phi i1 [ true, [[IF]] ], [ false, [[ENTRY:%.*]] ]
@@ -168,10 +164,9 @@ join:
define i1 @test_if_then_2(i1 %c, i8 %x) {
; CHECK-LABEL: @test_if_then_2(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[CMP2:%.*]] = icmp sgt i8 [[X:%.*]], 0
; CHECK-NEXT: br i1 [[C:%.*]], label [[IF:%.*]], label [[JOIN:%.*]]
; CHECK: if:
-; CHECK-NEXT: [[CMP1:%.*]] = icmp sgt i8 [[X]], 1
+; CHECK-NEXT: [[CMP1:%.*]] = icmp sgt i8 [[X:%.*]], 1
; CHECK-NEXT: call void @llvm.assume(i1 [[CMP1]])
; CHECK-NEXT: br label [[JOIN]]
; CHECK: join:
@@ -228,7 +223,6 @@ define i1 @test_if_then_4(i1 %c.0, i8 %x) {
; CHECK-NEXT: br i1 [[C_0:%.*]], label [[IF:%.*]], label [[JOIN:%.*]]
; CHECK: if:
; CHECK-NEXT: [[CMP1:%.*]] = icmp sgt i8 [[X:%.*]], 1
-; CHECK-NEXT: [[CMP2:%.*]] = icmp sgt i8 [[X]], 1
; CHECK-NEXT: br i1 [[CMP1]], label [[THEN_1:%.*]], label [[ELSE_1:%.*]]
; CHECK: then.1:
; CHECK-NEXT: br label [[JOIN]]
diff --git a/llvm/test/Transforms/ConstraintElimination/constants-signed-predicates.ll b/llvm/test/Transforms/ConstraintElimination/constants-signed-predicates.ll
index ada29a2e7c014a..bedc569cb42529 100644
--- a/llvm/test/Transforms/ConstraintElimination/constants-signed-predicates.ll
+++ b/llvm/test/Transforms/ConstraintElimination/constants-signed-predicates.ll
@@ -4,14 +4,9 @@
define i1 @test_slt() {
; CHECK-LABEL: @test_slt(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[T_0:%.*]] = icmp slt i8 10, 11
-; CHECK-NEXT: [[F_0:%.*]] = icmp slt i8 10, 10
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, false
-; CHECK-NEXT: [[F_1:%.*]] = icmp slt i8 10, 9
; CHECK-NEXT: [[RES_2:%.*]] = xor i1 [[RES_1]], false
-; CHECK-NEXT: [[F_2:%.*]] = icmp slt i8 10, -10
; CHECK-NEXT: [[RES_3:%.*]] = xor i1 [[RES_2]], false
-; CHECK-NEXT: [[T_1:%.*]] = icmp slt i8 10, 11
; CHECK-NEXT: [[RES_4:%.*]] = xor i1 [[RES_3]], true
; CHECK-NEXT: ret i1 [[RES_4]]
;
@@ -31,14 +26,9 @@ entry:
define i1 @test_sgt() {
; CHECK-LABEL: @test_sgt(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[T_0:%.*]] = icmp sgt i8 11, 10
-; CHECK-NEXT: [[F_0:%.*]] = icmp sgt i8 10, 10
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, false
-; CHECK-NEXT: [[F_1:%.*]] = icmp sgt i8 9, 10
; CHECK-NEXT: [[RES_2:%.*]] = xor i1 [[RES_1]], false
-; CHECK-NEXT: [[F_2:%.*]] = icmp sgt i8 -10, 10
; CHECK-NEXT: [[RES_3:%.*]] = xor i1 [[RES_2]], false
-; CHECK-NEXT: [[T_1:%.*]] = icmp sgt i8 -1, -2
; CHECK-NEXT: [[RES_4:%.*]] = xor i1 [[RES_3]], true
; CHECK-NEXT: ret i1 [[RES_4]]
;
@@ -62,7 +52,6 @@ define i1 @test_slt_gep_1(ptr %base) {
; CHECK-NEXT: [[GEP_1:%.*]] = getelementptr inbounds i8, ptr [[BASE:%.*]], i8 1
; CHECK-NEXT: [[T_0:%.*]] = icmp slt ptr [[BASE]], [[GEP_1]]
; CHECK-NEXT: [[GEP_0:%.*]] = getelementptr inbounds i8, ptr [[BASE]], i8 0
-; CHECK-NEXT: [[F_0:%.*]] = icmp slt ptr [[BASE]], [[GEP_0]]
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 [[T_0]], false
; CHECK-NEXT: [[C_1:%.*]] = icmp slt ptr [[GEP_1]], [[BASE]]
; CHECK-NEXT: [[RES_2:%.*]] = xor i1 [[RES_1]], [[C_1]]
diff --git a/llvm/test/Transforms/ConstraintElimination/constants-unsigned-predicates.ll b/llvm/test/Transforms/ConstraintElimination/constants-unsigned-predicates.ll
index 99ff34e901fdae..9e3d63b7b5165a 100644
--- a/llvm/test/Transforms/ConstraintElimination/constants-unsigned-predicates.ll
+++ b/llvm/test/Transforms/ConstraintElimination/constants-unsigned-predicates.ll
@@ -4,12 +4,8 @@
define i1 @test_ult() {
; CHECK-LABEL: @test_ult(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[T_0:%.*]] = icmp ult i8 10, 11
-; CHECK-NEXT: [[F_0:%.*]] = icmp ult i8 10, 10
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, false
-; CHECK-NEXT: [[F_1:%.*]] = icmp ult i8 10, 9
; CHECK-NEXT: [[RES_2:%.*]] = xor i1 [[RES_1]], false
-; CHECK-NEXT: [[T_1:%.*]] = icmp ult i8 10, -10
; CHECK-NEXT: [[RES_3:%.*]] = xor i1 [[RES_2]], true
; CHECK-NEXT: ret i1 [[RES_3]]
;
@@ -29,11 +25,8 @@ define i1 @test_ult_gep_1(ptr %base) {
; CHECK-LABEL: @test_ult_gep_1(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[GEP_1:%.*]] = getelementptr inbounds i8, ptr [[BASE:%.*]], i8 1
-; CHECK-NEXT: [[T_0:%.*]] = icmp ult ptr [[BASE]], [[GEP_1]]
; CHECK-NEXT: [[GEP_0:%.*]] = getelementptr inbounds i8, ptr [[BASE]], i8 0
-; CHECK-NEXT: [[F_0:%.*]] = icmp ult ptr [[BASE]], [[GEP_0]]
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, false
-; CHECK-NEXT: [[F_1:%.*]] = icmp ult ptr [[GEP_1]], [[BASE]]
; CHECK-NEXT: [[RES_2:%.*]] = xor i1 [[RES_1]], false
; CHECK-NEXT: ret i1 [[RES_2]]
;
@@ -51,7 +44,6 @@ entry:
define i1 @test_ult_gep_2(ptr %base) {
; CHECK-LABEL: @test_ult_gep_2(
; CHECK-NEXT: [[GEP_SUB_1:%.*]] = getelementptr inbounds i8, ptr [[BASE:%.*]], i8 -1
-; CHECK-NEXT: [[C_1:%.*]] = icmp ult ptr [[BASE]], [[GEP_SUB_1]]
; CHECK-NEXT: ret i1 false
;
%gep.sub.1 = getelementptr inbounds i8, ptr %base, i8 -1
@@ -73,10 +65,7 @@ define i1 @test_ult_gep_3(ptr %base) {
define i1 @test_eq() {
; CHECK-LABEL: @test_eq(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[F_0:%.*]] = icmp eq i8 10, 11
-; CHECK-NEXT: [[T_0:%.*]] = icmp eq i8 10, 10
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, false
-; CHECK-NEXT: [[F_1:%.*]] = icmp eq i8 10, 9
; CHECK-NEXT: [[RES_2:%.*]] = xor i1 [[RES_1]], false
; CHECK-NEXT: ret i1 [[RES_2]]
;
@@ -92,10 +81,7 @@ entry:
define i1 @test_ne() {
; CHECK-LABEL: @test_ne(
; CHECK-NEXT: entry:
-; CHECK-NEXT: [[T_0:%.*]] = icmp ne i8 10, 11
-; CHECK-NEXT: [[F_0:%.*]] = icmp ne i8 10, 10
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, false
-; CHECK-NEXT: [[T_1:%.*]] = icmp ne i8 10, 9
; CHECK-NEXT: [[RES_2:%.*]] = xor i1 [[RES_1]], true
; CHECK-NEXT: ret i1 [[RES_2]]
;
diff --git a/llvm/test/Transforms/ConstraintElimination/decompose-with-temporary-indices.ll b/llvm/test/Transforms/ConstraintElimination/decompose-with-temporary-indices.ll
index 6beece98e8b2e8..bb1f1c7fd0bc8d 100644
--- a/llvm/test/Transforms/ConstraintElimination/decompose-with-temporary-indices.ll
+++ b/llvm/test/Transforms/ConstraintElimination/decompose-with-temporary-indices.ll
@@ -13,8 +13,6 @@ define i1 @test_uge_temporary_indices_decompose(i8 %start, i8 %n, i8 %idx) {
; CHECK-NEXT: [[START_ADD_1:%.*]] = add nuw nsw i8 [[START]], 1
; CHECK-NEXT: br i1 [[CMP_PRE]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
; CHECK: if.then:
-; CHECK-NEXT: [[T_0:%.*]] = icmp ult i8 [[START_ADD_IDX]], [[START_ADD_N]]
-; CHECK-NEXT: [[F_0:%.*]] = icmp uge i8 [[START_ADD_IDX]], [[START_ADD_N]]
; CHECK-NEXT: [[R_1:%.*]] = xor i1 true, false
; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START_ADD_1]], [[START_ADD_N]]
; CHECK-NEXT: [[R_2:%.*]] = xor i1 [[R_1]], [[C_1]]
@@ -22,8 +20,6 @@ define i1 @test_uge_temporary_indices_decompose(i8 %start, i8 %n, i8 %idx) {
; CHECK-NEXT: [[R_3:%.*]] = xor i1 [[R_2]], [[C_2]]
; CHECK-NEXT: ret i1 [[R_3]]
; CHECK: if.end:
-; CHECK-NEXT: [[F_1:%.*]] = icmp ult i8 [[START_ADD_IDX]], [[START_ADD_N]]
-; CHECK-NEXT: [[T_1:%.*]] = icmp uge i8 [[START_ADD_IDX]], [[START_ADD_N]]
; CHECK-NEXT: [[R_4:%.*]] = xor i1 false, true
; CHECK-NEXT: [[C_3:%.*]] = icmp ult i8 [[START_ADD_1]], [[START_ADD_N]]
; CHECK-NEXT: [[R_5:%.*]] = xor i1 [[R_4]], [[C_3]]
diff --git a/llvm/test/Transforms/ConstraintElimination/dom.ll b/llvm/test/Transforms/ConstraintElimination/dom.ll
index 80d843eaf8ed83..7397360b23ec15 100644
--- a/llvm/test/Transforms/ConstraintElimination/dom.ll
+++ b/llvm/test/Transforms/ConstraintElimination/dom.ll
@@ -12,7 +12,6 @@ define i1 @test1(i8 %x) {
; CHECK-NEXT: [[C_1:%.*]] = icmp ule i8 [[X:%.*]], 10
; CHECK-NEXT: br i1 [[C_1]], label [[BB1:%.*]], label [[BB2:%.*]]
; CHECK: bb1:
-; CHECK-NEXT: [[C_2:%.*]] = icmp ule i8 [[X]], 10
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: br label [[BB2]]
; CHECK: bb2:
@@ -39,7 +38,6 @@ define i1 @test_chain_1(i8 %x) {
; CHECK-NEXT: [[C_1:%.*]] = icmp ule i8 [[X:%.*]], 10
; CHECK-NEXT: br i1 [[C_1]], label [[THEN:%.*]], label [[ELSE:%.*]]
; CHECK: then:
-; CHECK-NEXT: [[C_2:%.*]] = icmp ule i8 [[X]], 10
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: br label [[EXIT:%.*]]
; CHECK: else:
@@ -73,7 +71,6 @@ define i1 @test_chain_2(i8 %x) {
; CHECK: then:
; CHECK-NEXT: br label [[EXIT:%.*]]
; CHECK: else:
-; CHECK-NEXT: [[C_2:%.*]] = icmp ule i8 [[X]], 10
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: br label [[EXIT]]
; CHECK: exit:
@@ -106,7 +103,6 @@ define i1 @test2(i8 %x) {
; CHECK-NEXT: [[C_2:%.*]] = icmp ugt i8 [[X]], 10
; CHECK-NEXT: ret i1 [[C_2]]
; CHECK: bb2:
-; CHECK-NEXT: [[C_3:%.*]] = icmp ule i8 [[X]], 10
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: br label [[BB1]]
;
@@ -136,7 +132,6 @@ define i1 @test3(i8 %x, i1 %c) {
; CHECK-NEXT: [[C_2:%.*]] = icmp ule i8 [[X]], 10
; CHECK-NEXT: ret i1 [[C_2]]
; CHECK: bb2:
-; CHECK-NEXT: [[C_3:%.*]] = icmp ugt i8 [[X]], 10
; CHECK-NEXT: ret i1 true
;
entry:
@@ -163,7 +158,6 @@ define i1 @test4(i8 %x, i1 %c) {
; CHECK-NEXT: [[C_1:%.*]] = icmp ule i8 [[X:%.*]], 10
; CHECK-NEXT: br i1 [[C_1]], label [[BB1:%.*]], label [[BB2]]
; CHECK: bb1:
-; CHECK-NEXT: [[C_2:%.*]] = icmp ule i8 [[X]], 10
; CHECK-NEXT: ret i1 true
; CHECK: bb2:
; CHECK-NEXT: [[C_3:%.*]] = icmp ugt i8 [[X]], 10
@@ -194,9 +188,7 @@ define i1 @test_cond_from_preheader(i8 %x, i1 %c) {
; CHECK-NEXT: [[C_1:%.*]] = icmp ule i8 [[X:%.*]], 10
; CHECK-NEXT: br i1 [[C_1]], label [[LOOP:%.*]], label [[BB2]]
; CHECK: loop:
-; CHECK-NEXT: [[T_1:%.*]] = icmp ule i8 [[X]], 10
; CHECK-NEXT: call void @use(i1 true)
-; CHECK-NEXT: [[F_1:%.*]] = icmp ugt i8 [[X]], 10
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[C_2:%.*]] = icmp ule i8 [[X]], 9
; CHECK-NEXT: call void @use(i1 [[C_2]])
@@ -204,7 +196,6 @@ define i1 @test_cond_from_preheader(i8 %x, i1 %c) {
; CHECK-NEXT: call void @use(i1 [[C_3]])
; CHECK-NEXT: br i1 true, label [[EXIT:%.*]], label [[LOOP]]
; CHECK: exit:
-; CHECK-NEXT: [[C_4:%.*]] = icmp ule i8 [[X]], 10
; CHECK-NEXT: ret i1 true
; CHECK: bb2:
; CHECK-NEXT: [[C_5:%.*]] = icmp ugt i8 [[X]], 10
@@ -247,9 +238,7 @@ define i1 @test_cond_from_preheader_successors_flipped(i8 %x, i1 %c) {
; CHECK-NEXT: [[C_1:%.*]] = icmp ule i8 [[X:%.*]], 10
; CHECK-NEXT: br i1 [[C_1]], label [[BB2]], label [[LOOP:%.*]]
; CHECK: loop:
-; CHECK-NEXT: [[F_1:%.*]] = icmp ule i8 [[X]], 10
; CHECK-NEXT: call void @use(i1 false)
-; CHECK-NEXT: [[T_1:%.*]] = icmp ugt i8 [[X]], 10
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[C_2:%.*]] = icmp ule i8 [[X]], 11
; CHECK-NEXT: call void @use(i1 [[C_2]])
@@ -257,7 +246,6 @@ define i1 @test_cond_from_preheader_successors_flipped(i8 %x, i1 %c) {
; CHECK-NEXT: call void @use(i1 [[C_3]])
; CHECK-NEXT: br i1 true, label [[EXIT:%.*]], label [[LOOP]]
; CHECK: exit:
-; CHECK-NEXT: [[F_2:%.*]] = icmp ule i8 [[X]], 10
; CHECK-NEXT: ret i1 false
; CHECK: bb2:
; CHECK-NEXT: [[C_5:%.*]] = icmp ugt i8 [[X]], 10
@@ -305,16 +293,12 @@ define i1 @test_cond_from_preheader_and(i8 %x, i8 %y, i1 %c) {
; CHECK-NEXT: [[AND:%.*]] = and i1 [[X_1]], [[Y_1]]
; CHECK-NEXT: br i1 [[AND]], label [[LOOP:%.*]], label [[EXIT_1:%.*]]
; CHECK: loop:
-; CHECK-NEXT: [[T_1:%.*]] = icmp ule i8 [[X]], 10
-; CHECK-NEXT: [[F_1:%.*]] = icmp ugt i8 [[X]], 10
; CHECK-NEXT: [[R_1:%.*]] = xor i1 true, false
; CHECK-NEXT: [[C_1:%.*]] = icmp ule i8 [[X]], 9
; CHECK-NEXT: [[R_2:%.*]] = xor i1 [[R_1]], [[C_1]]
; CHECK-NEXT: [[C_2:%.*]] = icmp ugt i8 [[X]], 9
; CHECK-NEXT: [[R_3:%.*]] = xor i1 [[R_2]], [[C_2]]
-; CHECK-NEXT: [[T_2:%.*]] = icmp ugt i8 [[Y]], 99
; CHECK-NEXT: [[R_4:%.*]] = xor i1 [[R_3]], true
-; CHECK-NEXT: [[F_2:%.*]] = icmp ule i8 [[Y]], 99
; CHECK-NEXT: [[R_5:%.*]] = xor i1 [[R_4]], false
; CHECK-NEXT: [[C_3:%.*]] = icmp ugt i8 [[Y]], 100
; CHECK-NEXT: [[R_6:%.*]] = xor i1 [[R_5]], [[C_3]]
@@ -402,7 +386,6 @@ define i1 @test_cond_from_preheader_and_successors_flipped(i8 %x, i8 %y, i1 %c)
; CHECK-NEXT: call void @use(i1 [[R_7]])
; CHECK-NEXT: br i1 true, label [[EXIT]], label [[LOOP]]
; CHECK: exit.1:
-; CHECK-NEXT: [[T_1:%.*]] = icmp ugt i8 [[Y]], 10
; CHECK-NEXT: ret i1 true
;
entry:
@@ -458,16 +441,12 @@ define i1 @test_cond_from_preheader_or(i8 %x, i8 %y, i1 %c) {
; CHECK-NEXT: [[OR:%.*]] = or i1 [[X_1]], [[Y_1]]
; CHECK-NEXT: br i1 [[OR]], label [[EXIT_1:%.*]], label [[LOOP:%.*]]
; CHECK: loop:
-; CHECK-NEXT: [[T_1:%.*]] = icmp ugt i8 [[X]], 10
-; CHECK-NEXT: [[F_1:%.*]] = icmp ule i8 [[X]], 10
; CHECK-NEXT: [[R_1:%.*]] = xor i1 true, false
; CHECK-NEXT: [[C_1:%.*]] = icmp ugt i8 [[X]], 11
; CHECK-NEXT: [[R_2:%.*]] = xor i1 [[R_1]], [[C_1]]
; CHECK-NEXT: [[C_2:%.*]] = icmp ule i8 [[X]], 11
; CHECK-NEXT: [[R_3:%.*]] = xor i1 [[R_2]], [[C_2]]
-; CHECK-NEXT: [[T_2:%.*]] = icmp ule i8 [[Y]], 99
; CHECK-NEXT: [[R_4:%.*]] = xor i1 [[R_3]], true
-; CHECK-NEXT: [[F_2:%.*]] = icmp ugt i8 [[Y]], 99
; CHECK-NEXT: [[R_5:%.*]] = xor i1 [[R_4]], false
; CHECK-NEXT: [[C_3:%.*]] = icmp ule i8 [[Y]], 98
; CHECK-NEXT: [[R_6:%.*]] = xor i1 [[R_5]], [[C_3]]
@@ -550,7 +529,6 @@ define i1 @test_cond_from_preheader_or_successor_flipped(i8 %x, i8 %y, i1 %c) {
; CHECK-NEXT: call void @use(i1 [[R_7]])
; CHECK-NEXT: br i1 true, label [[EXIT]], label [[LOOP]]
; CHECK: exit.1:
-; CHECK-NEXT: [[T_1:%.*]] = icmp ule i8 [[Y]], 100
; CHECK-NEXT: ret i1 true
;
entry:
diff --git a/llvm/test/Transforms/ConstraintElimination/empty-constraint.ll b/llvm/test/Transforms/ConstraintElimination/empty-constraint.ll
index b7b150e242069f..4d9e060ce1814d 100644
--- a/llvm/test/Transforms/ConstraintElimination/empty-constraint.ll
+++ b/llvm/test/Transforms/ConstraintElimination/empty-constraint.ll
@@ -6,12 +6,10 @@
define i1 @test_1_always_false(i32 %A, i32 %B) {
; CHECK-LABEL: @test_1_always_false(
-; CHECK-NEXT: [[C_1:%.*]] = icmp ugt i32 [[A:%.*]], [[A]]
; CHECK-NEXT: br i1 false, label [[IF_END_I16:%.*]], label [[IF_THEN_I10:%.*]]
; CHECK: if.then.i10:
; CHECK-NEXT: ret i1 false
; CHECK: if.end.i16:
-; CHECK-NEXT: [[C_2:%.*]] = icmp ugt i32 [[A]], [[A]]
; CHECK-NEXT: ret i1 false
;
%c.1 = icmp ugt i32 %A, %A
@@ -32,7 +30,6 @@ define i1 @test_2_always_true(i32 %A, i32 %B) {
; CHECK: if.then.i10:
; CHECK-NEXT: ret i1 false
; CHECK: if.end.i16:
-; CHECK-NEXT: [[C_2:%.*]] = icmp uge i32 [[A]], [[A]]
; CHECK-NEXT: ret i1 true
;
%c.1 = icmp uge i32 %A, %B
diff --git a/llvm/test/Transforms/ConstraintElimination/eq.ll b/llvm/test/Transforms/ConstraintElimination/eq.ll
index 2fff2900f3e310..a9e4dffdcebb0d 100644
--- a/llvm/test/Transforms/ConstraintElimination/eq.ll
+++ b/llvm/test/Transforms/ConstraintElimination/eq.ll
@@ -9,16 +9,10 @@ define i1 @test_eq_1(i8 %a, i8 %b) {
; CHECK-NEXT: [[CMP:%.*]] = icmp eq i8 [[A:%.*]], [[B:%.*]]
; CHECK-NEXT: br i1 [[CMP]], label [[THEN:%.*]], label [[ELSE:%.*]]
; CHECK: then:
-; CHECK-NEXT: [[T_1:%.*]] = icmp uge i8 [[A]], [[B]]
-; CHECK-NEXT: [[T_2:%.*]] = icmp ule i8 [[A]], [[B]]
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, true
-; CHECK-NEXT: [[T_3:%.*]] = icmp eq i8 [[A]], [[B]]
; CHECK-NEXT: [[RES_2:%.*]] = xor i1 [[RES_1]], true
-; CHECK-NEXT: [[T_4:%.*]] = icmp eq i8 [[B]], [[A]]
; CHECK-NEXT: [[RES_3:%.*]] = xor i1 [[RES_2]], true
-; CHECK-NEXT: [[F_1:%.*]] = icmp ugt i8 [[B]], [[A]]
; CHECK-NEXT: [[RES_4:%.*]] = xor i1 [[RES_3]], false
-; CHECK-NEXT: [[F_2:%.*]] = icmp ult i8 [[B]], [[A]]
; CHECK-NEXT: [[RES_5:%.*]] = xor i1 [[RES_4]], false
; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[B]], 99
; CHECK-NEXT: [[RES_6:%.*]] = xor i1 [[RES_5]], [[C_1]]
@@ -95,14 +89,9 @@ define i1 @test_eq_2(i8 %a, i8 %b) {
; CHECK-NEXT: [[PRE_3:%.*]] = icmp ult i8 [[B]], 100
; CHECK-NEXT: br i1 [[PRE_3]], label [[THEN_THEN:%.*]], label [[THEN_ELSE:%.*]]
; CHECK: then.then:
-; CHECK-NEXT: [[T_1:%.*]] = icmp ult i8 [[A]], 100
-; CHECK-NEXT: [[T_2:%.*]] = icmp ult i8 [[B]], 100
; CHECK-NEXT: [[XOR_1:%.*]] = xor i1 true, true
-; CHECK-NEXT: [[F_1:%.*]] = icmp uge i8 [[A]], 100
; CHECK-NEXT: [[XOR_2:%.*]] = xor i1 [[XOR_1]], false
-; CHECK-NEXT: [[F_2:%.*]] = icmp uge i8 [[B]], 100
; CHECK-NEXT: [[XOR_3:%.*]] = xor i1 [[XOR_2]], false
-; CHECK-NEXT: [[F_3_1:%.*]] = icmp ugt i8 [[A]], 99
; CHECK-NEXT: [[XOR_4:%.*]] = xor i1 [[XOR_3]], false
; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[A]], 99
; CHECK-NEXT: [[XOR_5:%.*]] = xor i1 [[XOR_4]], [[C_1]]
@@ -110,18 +99,11 @@ define i1 @test_eq_2(i8 %a, i8 %b) {
; CHECK-NEXT: [[XOR_6:%.*]] = xor i1 [[XOR_5]], [[C_1]]
; CHECK-NEXT: ret i1 [[XOR_6]]
; CHECK: then.else:
-; CHECK-NEXT: [[F_4:%.*]] = icmp ult i8 [[A]], 100
-; CHECK-NEXT: [[F_5:%.*]] = icmp ult i8 [[B]], 100
; CHECK-NEXT: [[XOR_7:%.*]] = xor i1 false, false
-; CHECK-NEXT: [[T_3:%.*]] = icmp uge i8 [[A]], 100
; CHECK-NEXT: [[XOR_8:%.*]] = xor i1 [[XOR_7]], true
-; CHECK-NEXT: [[T_4:%.*]] = icmp uge i8 [[B]], 100
; CHECK-NEXT: [[XOR_9:%.*]] = xor i1 [[XOR_8]], true
-; CHECK-NEXT: [[T_5:%.*]] = icmp ugt i8 [[A]], 99
; CHECK-NEXT: [[XOR_10:%.*]] = xor i1 [[XOR_9]], true
-; CHECK-NEXT: [[C_3:%.*]] = icmp ult i8 [[A]], 99
; CHECK-NEXT: [[XOR_11:%.*]] = xor i1 [[XOR_10]], false
-; CHECK-NEXT: [[C_4:%.*]] = icmp ugt i8 [[A]], 98
; CHECK-NEXT: [[XOR_12:%.*]] = xor i1 [[XOR_11]], true
; CHECK-NEXT: ret i1 [[XOR_12]]
; CHECK: else:
@@ -197,14 +179,9 @@ define i1 @test_eq_as_uge_ule_(i8 %a, i8 %b) {
; CHECK-NEXT: [[PRE_3:%.*]] = icmp ult i8 [[B]], 100
; CHECK-NEXT: br i1 [[PRE_3]], label [[THEN_THEN:%.*]], label [[THEN_ELSE:%.*]]
; CHECK: then.then:
-; CHECK-NEXT: [[T_1:%.*]] = icmp ult i8 [[A]], 100
-; CHECK-NEXT: [[T_2:%.*]] = icmp ult i8 [[B]], 100
; CHECK-NEXT: [[XOR_1:%.*]] = xor i1 true, true
-; CHECK-NEXT: [[F_1:%.*]] = icmp uge i8 [[A]], 100
; CHECK-NEXT: [[XOR_2:%.*]] = xor i1 [[XOR_1]], false
-; CHECK-NEXT: [[F_2:%.*]] = icmp uge i8 [[B]], 100
; CHECK-NEXT: [[XOR_3:%.*]] = xor i1 [[XOR_2]], false
-; CHECK-NEXT: [[F_3_1:%.*]] = icmp ugt i8 [[A]], 99
; CHECK-NEXT: [[XOR_4:%.*]] = xor i1 [[XOR_3]], false
; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[A]], 99
; CHECK-NEXT: [[XOR_5:%.*]] = xor i1 [[XOR_4]], [[C_1]]
@@ -212,18 +189,11 @@ define i1 @test_eq_as_uge_ule_(i8 %a, i8 %b) {
; CHECK-NEXT: [[XOR_6:%.*]] = xor i1 [[XOR_5]], [[C_1]]
; CHECK-NEXT: ret i1 [[XOR_6]]
; CHECK: then.else:
-; CHECK-NEXT: [[F_4:%.*]] = icmp ult i8 [[A]], 100
-; CHECK-NEXT: [[F_5:%.*]] = icmp ult i8 [[B]], 100
; CHECK-NEXT: [[XOR_7:%.*]] = xor i1 false, false
-; CHECK-NEXT: [[T_3:%.*]] = icmp uge i8 [[A]], 100
; CHECK-NEXT: [[XOR_8:%.*]] = xor i1 [[XOR_7]], true
-; CHECK-NEXT: [[T_4:%.*]] = icmp uge i8 [[B]], 100
; CHECK-NEXT: [[XOR_9:%.*]] = xor i1 [[XOR_8]], true
-; CHECK-NEXT: [[T_5:%.*]] = icmp ugt i8 [[A]], 99
; CHECK-NEXT: [[XOR_10:%.*]] = xor i1 [[XOR_9]], true
-; CHECK-NEXT: [[C_3:%.*]] = icmp ult i8 [[A]], 99
; CHECK-NEXT: [[XOR_11:%.*]] = xor i1 [[XOR_10]], false
-; CHECK-NEXT: [[C_4:%.*]] = icmp ugt i8 [[A]], 98
; CHECK-NEXT: [[XOR_12:%.*]] = xor i1 [[XOR_11]], true
; CHECK-NEXT: ret i1 [[XOR_12]]
; CHECK: else:
@@ -298,14 +268,9 @@ define i1 @test_eq_ult_and(i8 %a, i8 %b) {
; CHECK-NEXT: [[PRE_AND:%.*]] = and i1 [[PRE_1]], [[PRE_2]]
; CHECK-NEXT: br i1 [[PRE_AND]], label [[THEN:%.*]], label [[ELSE:%.*]]
; CHECK: then:
-; CHECK-NEXT: [[T_1:%.*]] = icmp ult i8 [[A]], 100
-; CHECK-NEXT: [[T_2:%.*]] = icmp ult i8 [[B]], 100
; CHECK-NEXT: [[XOR_1:%.*]] = xor i1 true, true
-; CHECK-NEXT: [[F_1:%.*]] = icmp uge i8 [[A]], 100
; CHECK-NEXT: [[XOR_2:%.*]] = xor i1 [[XOR_1]], false
-; CHECK-NEXT: [[F_2:%.*]] = icmp uge i8 [[B]], 100
; CHECK-NEXT: [[XOR_3:%.*]] = xor i1 [[XOR_2]], false
-; CHECK-NEXT: [[F_3_1:%.*]] = icmp ugt i8 [[A]], 99
; CHECK-NEXT: [[XOR_4:%.*]] = xor i1 [[XOR_3]], false
; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[A]], 99
; CHECK-NEXT: [[XOR_5:%.*]] = xor i1 [[XOR_4]], [[C_1]]
@@ -384,7 +349,6 @@ define i1 @assume_b_plus_1_ult_a(i64 %a, i64 %b) {
; CHECK-NEXT: [[TMP1:%.*]] = add nuw i64 [[B:%.*]], 1
; CHECK-NEXT: [[TMP2:%.*]] = icmp ult i64 [[TMP1]], [[A:%.*]]
; CHECK-NEXT: tail call void @llvm.assume(i1 [[TMP2]])
-; CHECK-NEXT: [[TMP3:%.*]] = icmp eq i64 [[A]], [[B]]
; CHECK-NEXT: ret i1 false
;
%1 = add nuw i64 %b, 1
@@ -399,7 +363,6 @@ define i1 @assume_a_plus_1_eq_b(i64 %a, i64 %b) {
; CHECK-NEXT: [[TMP1:%.*]] = add nuw i64 [[A:%.*]], 1
; CHECK-NEXT: [[TMP2:%.*]] = icmp eq i64 [[TMP1]], [[B:%.*]]
; CHECK-NEXT: tail call void @llvm.assume(i1 [[TMP2]])
-; CHECK-NEXT: [[TMP3:%.*]] = icmp eq i64 [[A]], [[B]]
; CHECK-NEXT: ret i1 false
;
%1 = add nuw i64 %a, 1
@@ -435,10 +398,8 @@ define i1 @test_transitivity_of_equality_and_plus_1(i64 %a, i64 %b, i64 %c) {
; CHECK-NEXT: [[BC_EQ:%.*]] = icmp eq i64 [[B]], [[C:%.*]]
; CHECK-NEXT: br i1 [[BC_EQ]], label [[BC_EQUAL:%.*]], label [[NOT_EQ]]
; CHECK: bc_equal:
-; CHECK-NEXT: [[AC_EQ:%.*]] = icmp eq i64 [[A]], [[C]]
; CHECK-NEXT: [[A_PLUS_1:%.*]] = add nuw i64 [[A]], 1
; CHECK-NEXT: [[C_PLUS_1:%.*]] = add nuw i64 [[C]], 1
-; CHECK-NEXT: [[AC_PLUS_1_EQ:%.*]] = icmp eq i64 [[A_PLUS_1]], [[C_PLUS_1]]
; CHECK-NEXT: [[RESULT:%.*]] = and i1 true, true
; CHECK-NEXT: ret i1 [[RESULT]]
; CHECK: not_eq:
diff --git a/llvm/test/Transforms/ConstraintElimination/gep-add-multiple-indices.ll b/llvm/test/Transforms/ConstraintElimination/gep-add-multiple-indices.ll
index 1eb4bf0d4b7192..34a6c7786831ed 100644
--- a/llvm/test/Transforms/ConstraintElimination/gep-add-multiple-indices.ll
+++ b/llvm/test/Transforms/ConstraintElimination/gep-add-multiple-indices.ll
@@ -8,7 +8,6 @@ define i1 @test_outer_gep_last_index_no_overflow_all_inbounds_1(ptr %dst) {
; CHECK-NEXT: [[DST_0:%.*]] = getelementptr inbounds ptr, ptr [[DST:%.*]], i64 0
; CHECK-NEXT: [[UPPER:%.*]] = getelementptr inbounds ptr, ptr [[DST]], i64 2
; CHECK-NEXT: [[GEP_1:%.*]] = getelementptr inbounds [2 x i32], ptr [[DST_0]], i64 1, i64 1
-; CHECK-NEXT: [[C_1:%.*]] = icmp ult ptr [[GEP_1]], [[UPPER]]
; CHECK-NEXT: ret i1 true
;
%dst.0 = getelementptr inbounds ptr, ptr %dst, i64 0
@@ -23,7 +22,6 @@ define i1 @test_outer_gep_last_index_no_overflow_all_inbounds_2(ptr %dst) {
; CHECK-NEXT: [[DST_0:%.*]] = getelementptr inbounds ptr, ptr [[DST:%.*]], i64 0
; CHECK-NEXT: [[UPPER:%.*]] = getelementptr inbounds ptr, ptr [[DST]], i64 3
; CHECK-NEXT: [[GEP_1:%.*]] = getelementptr inbounds [2 x i32], ptr [[DST_0]], i64 1, i64 1
-; CHECK-NEXT: [[C_1:%.*]] = icmp ult ptr [[GEP_1]], [[UPPER]]
; CHECK-NEXT: ret i1 true
;
%dst.0 = getelementptr inbounds ptr, ptr %dst, i64 0
@@ -38,7 +36,6 @@ define i1 @test_outer_gep_last_index_overflow_all_inbounds(ptr %dst) {
; CHECK-NEXT: [[DST_0:%.*]] = getelementptr inbounds ptr, ptr [[DST:%.*]], i64 0
; CHECK-NEXT: [[UPPER:%.*]] = getelementptr inbounds ptr, ptr [[DST]], i64 2
; CHECK-NEXT: [[GEP_1:%.*]] = getelementptr inbounds [2 x i32], ptr [[DST_0]], i64 1, i64 2
-; CHECK-NEXT: [[C:%.*]] = icmp ult ptr [[GEP_1]], [[UPPER]]
; CHECK-NEXT: ret i1 false
;
%dst.0 = getelementptr inbounds ptr, ptr %dst, i64 0
@@ -202,7 +199,6 @@ define i1 @test_inner_gep_multi_index(ptr %dst) {
; CHECK-NEXT: [[DST_0:%.*]] = getelementptr inbounds ptr, ptr [[DST:%.*]], i64 0
; CHECK-NEXT: [[UPPER:%.*]] = getelementptr inbounds ptr, ptr [[DST]], i64 2
; CHECK-NEXT: [[GEP_1:%.*]] = getelementptr inbounds [2 x i32], ptr [[DST_0]], i64 1, i64 1
-; CHECK-NEXT: [[C_1:%.*]] = icmp ult ptr [[GEP_1]], [[UPPER]]
; CHECK-NEXT: ret i1 true
;
%dst.0 = getelementptr inbounds ptr, ptr %dst, i64 0
diff --git a/llvm/test/Transforms/ConstraintElimination/gep-arithmetic-add.ll b/llvm/test/Transforms/ConstraintElimination/gep-arithmetic-add.ll
index c56ca5af4c253a..64126036ab2819 100644
--- a/llvm/test/Transforms/ConstraintElimination/gep-arithmetic-add.ll
+++ b/llvm/test/Transforms/ConstraintElimination/gep-arithmetic-add.ll
@@ -294,7 +294,6 @@ define i4 @ptr_N_step_zext_n_zext(ptr %src, ptr %lower, ptr %upper, i16 %N, i16
; CHECK: ptr.check:
; CHECK-NEXT: [[SRC_STEP:%.*]] = getelementptr inbounds i8, ptr [[SRC]], i32 [[STEP_ADD_1_EXT]]
; CHECK-NEXT: [[CMP_STEP_START:%.*]] = icmp ult ptr [[SRC_STEP]], [[LOWER]]
-; CHECK-NEXT: [[CMP_STEP_END:%.*]] = icmp uge ptr [[SRC_STEP]], [[UPPER]]
; CHECK-NEXT: [[OR_CHECK:%.*]] = or i1 [[CMP_STEP_START]], false
; CHECK-NEXT: br i1 [[OR_CHECK]], label [[TRAP_BB]], label [[EXIT]]
; CHECK: exit:
diff --git a/llvm/test/Transforms/ConstraintElimination/gep-arithmetic-
diff erent-types.ll b/llvm/test/Transforms/ConstraintElimination/gep-arithmetic-
diff erent-types.ll
index 149a9bc35b4215..fe67e0a822d9af 100644
--- a/llvm/test/Transforms/ConstraintElimination/gep-arithmetic-
diff erent-types.ll
+++ b/llvm/test/Transforms/ConstraintElimination/gep-arithmetic-
diff erent-types.ll
@@ -11,7 +11,6 @@ define i1 @gep_constant_positive_index(ptr %A, ptr %upper) {
; CHECK-NEXT: [[ADD_I16_4:%.*]] = getelementptr inbounds i16, ptr [[A]], i64 4
; CHECK-NEXT: [[C_1:%.*]] = icmp ult ptr [[ADD_I16_4]], [[UPPER]]
; CHECK-NEXT: [[ADD_I16_2:%.*]] = getelementptr inbounds i16, ptr [[A]], i64 2
-; CHECK-NEXT: [[T_1:%.*]] = icmp ult ptr [[ADD_I16_2]], [[UPPER]]
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 [[C_1]], true
; CHECK-NEXT: ret i1 [[RES_1]]
;
@@ -35,7 +34,6 @@ define i1 @gep_constant_positive_index_chained(ptr %A, ptr %upper) {
; CHECK-NEXT: call void @llvm.assume(i1 [[C_0]])
; CHECK-NEXT: [[ADD_I8_1:%.*]] = getelementptr inbounds i8, ptr [[A]], i64 1
; CHECK-NEXT: [[ADD_I16_1:%.*]] = getelementptr inbounds i16, ptr [[ADD_I8_1]], i64 1
-; CHECK-NEXT: [[T_1:%.*]] = icmp ult ptr [[ADD_I16_1]], [[UPPER]]
; CHECK-NEXT: [[ADD_I16_2:%.*]] = getelementptr inbounds i16, ptr [[ADD_I8_1]], i64 2
; CHECK-NEXT: [[C_1:%.*]] = icmp ult ptr [[ADD_I16_2]], [[UPPER]]
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, [[C_1]]
@@ -65,7 +63,6 @@ define i1 @gep_var_positive_index(ptr %A, ptr %upper, i8 %idx) {
; CHECK-NEXT: [[ADD_I32_IDX:%.*]] = getelementptr inbounds i32, ptr [[A]], i8 [[IDX]]
; CHECK-NEXT: [[C_1:%.*]] = icmp ult ptr [[ADD_I32_IDX]], [[UPPER]]
; CHECK-NEXT: [[ADD_I8_IDX:%.*]] = getelementptr inbounds i8, ptr [[A]], i8 [[IDX]]
-; CHECK-NEXT: [[T_1:%.*]] = icmp ult ptr [[ADD_I8_IDX]], [[UPPER]]
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 [[C_1]], true
; CHECK-NEXT: ret i1 [[RES_1]]
;
@@ -95,7 +92,6 @@ define i1 @gep_add_nsw_positive_index(ptr %A, ptr %upper, i8 %idx) {
; CHECK-NEXT: [[ADD_I32_IDX_1:%.*]] = getelementptr inbounds i32, ptr [[A]], i8 [[IDX_1]]
; CHECK-NEXT: [[C_1:%.*]] = icmp ult ptr [[ADD_I32_IDX_1]], [[UPPER]]
; CHECK-NEXT: [[ADD_I8_IDX_1:%.*]] = getelementptr inbounds i8, ptr [[A]], i8 [[IDX_1]]
-; CHECK-NEXT: [[T_1:%.*]] = icmp ult ptr [[ADD_I8_IDX_1]], [[UPPER]]
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 [[C_1]], true
; CHECK-NEXT: [[ADD_I16_IDX_1:%.*]] = getelementptr inbounds i16, ptr [[A]], i8 [[IDX_1]]
; CHECK-NEXT: [[C_2:%.*]] = icmp ult ptr [[ADD_I16_IDX_1]], [[UPPER]]
@@ -167,7 +163,6 @@ define i1 @gep_zext_add_nuw_nsw_index(ptr %A, ptr %upper, i8 %idx) {
; CHECK-NEXT: [[ADD_I32_IDX_1:%.*]] = getelementptr inbounds i32, ptr [[A]], i16 [[IDX_1_EXT]]
; CHECK-NEXT: [[C_1:%.*]] = icmp ult ptr [[ADD_I32_IDX_1]], [[UPPER]]
; CHECK-NEXT: [[ADD_I8_IDX_1:%.*]] = getelementptr inbounds i8, ptr [[A]], i16 [[IDX_1_EXT]]
-; CHECK-NEXT: [[T_1:%.*]] = icmp ult ptr [[ADD_I8_IDX_1]], [[UPPER]]
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 [[C_1]], true
; CHECK-NEXT: [[ADD_I16_IDX_1:%.*]] = getelementptr inbounds i16, ptr [[A]], i16 [[IDX_1_EXT]]
; CHECK-NEXT: [[C_2:%.*]] = icmp ult ptr [[ADD_I16_IDX_1]], [[UPPER]]
@@ -207,7 +202,6 @@ define i1 @gep_zext_add_nuw_index(ptr %A, ptr %upper, i8 %idx) {
; CHECK-NEXT: [[ADD_I32_IDX_1:%.*]] = getelementptr inbounds i32, ptr [[A]], i16 [[IDX_1_EXT]]
; CHECK-NEXT: [[C_1:%.*]] = icmp ult ptr [[ADD_I32_IDX_1]], [[UPPER]]
; CHECK-NEXT: [[ADD_I8_IDX_1:%.*]] = getelementptr inbounds i8, ptr [[A]], i16 [[IDX_1_EXT]]
-; CHECK-NEXT: [[T_1:%.*]] = icmp ult ptr [[ADD_I8_IDX_1]], [[UPPER]]
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 [[C_1]], true
; CHECK-NEXT: ret i1 [[RES_1]]
;
@@ -269,7 +263,6 @@ define i1 @gep_zext_index(ptr %A, ptr %upper, i8 %idx.1, i8 %idx.2) {
; CHECK-NEXT: [[ADD_I32_IDX_1:%.*]] = getelementptr inbounds i32, ptr [[A]], i16 [[IDX_1_EXT]]
; CHECK-NEXT: [[C_1:%.*]] = icmp ult ptr [[ADD_I32_IDX_1]], [[ADD_I8_IDX_2]]
; CHECK-NEXT: [[ADD_I8_IDX_1:%.*]] = getelementptr inbounds i8, ptr [[A]], i16 [[IDX_1_EXT]]
-; CHECK-NEXT: [[T_1:%.*]] = icmp ult ptr [[ADD_I8_IDX_1]], [[ADD_I8_IDX_2]]
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 [[C_1]], true
; CHECK-NEXT: ret i1 [[RES_1]]
;
@@ -334,7 +327,6 @@ define i1 @gep_zext_shl_nuw_index(ptr %A, ptr %upper, i8 %idx) {
; CHECK-NEXT: [[ADD_I32_IDX_1:%.*]] = getelementptr inbounds i32, ptr [[A]], i16 [[IDX_1_EXT]]
; CHECK-NEXT: [[C_1:%.*]] = icmp ult ptr [[ADD_I32_IDX_1]], [[UPPER]]
; CHECK-NEXT: [[ADD_I8_IDX_1:%.*]] = getelementptr inbounds i8, ptr [[A]], i16 [[IDX_1_EXT]]
-; CHECK-NEXT: [[T_1:%.*]] = icmp ult ptr [[ADD_I8_IDX_1]], [[UPPER]]
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 [[C_1]], true
; CHECK-NEXT: ret i1 [[RES_1]]
;
@@ -370,10 +362,8 @@ define i1 @gep_add_nsw_positive_index_struct(ptr %A, ptr %upper, i8 %idx) {
; CHECK-NEXT: [[ADD_I32_IDX_1:%.*]] = getelementptr inbounds i32, ptr [[A]], i8 [[IDX_1]]
; CHECK-NEXT: [[T_1:%.*]] = icmp ult ptr [[ADD_I32_IDX_1]], [[UPPER]]
; CHECK-NEXT: [[ADD_I8_IDX_1:%.*]] = getelementptr inbounds i8, ptr [[A]], i8 [[IDX_1]]
-; CHECK-NEXT: [[T_2:%.*]] = icmp ult ptr [[ADD_I8_IDX_1]], [[UPPER]]
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 [[T_1]], true
; CHECK-NEXT: [[ADD_I16_IDX_1:%.*]] = getelementptr inbounds i16, ptr [[A]], i8 [[IDX_1]]
-; CHECK-NEXT: [[T_3:%.*]] = icmp ult ptr [[ADD_I16_IDX_1]], [[UPPER]]
; CHECK-NEXT: [[RES_2:%.*]] = xor i1 [[RES_1]], true
; CHECK-NEXT: [[ADD_I64_IDX_1:%.*]] = getelementptr inbounds i64, ptr [[A]], i8 [[IDX_1]]
; CHECK-NEXT: [[C_1:%.*]] = icmp ult ptr [[ADD_I64_IDX_1]], [[UPPER]]
@@ -413,7 +403,6 @@ define i1 @gep_constant_positive_index_fixed_vector_ty(ptr %A, ptr %upper) {
; CHECK-NEXT: [[ADD_I16_4:%.*]] = getelementptr inbounds <4 x i16>, ptr [[A]], i64 4
; CHECK-NEXT: [[C_1:%.*]] = icmp ult ptr [[ADD_I16_4]], [[UPPER]]
; CHECK-NEXT: [[ADD_I16_2:%.*]] = getelementptr inbounds <4 x i16>, ptr [[A]], i64 2
-; CHECK-NEXT: [[T_1:%.*]] = icmp ult ptr [[ADD_I16_2]], [[UPPER]]
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 [[C_1]], true
; CHECK-NEXT: ret i1 [[RES_1]]
;
diff --git a/llvm/test/Transforms/ConstraintElimination/gep-arithmetic-signed-predicates.ll b/llvm/test/Transforms/ConstraintElimination/gep-arithmetic-signed-predicates.ll
index 436b77fff688b3..d8ed479f3ee671 100644
--- a/llvm/test/Transforms/ConstraintElimination/gep-arithmetic-signed-predicates.ll
+++ b/llvm/test/Transforms/ConstraintElimination/gep-arithmetic-signed-predicates.ll
@@ -11,7 +11,6 @@ define i1 @gep_constant_positive_index(ptr %dst, ptr %lower, ptr %upper) {
; CHECK-NEXT: [[AND:%.*]] = and i1 [[PRE_DST_LOWER]], [[PRE_DST_UPPER]]
; CHECK-NEXT: br i1 [[AND]], label [[THEN:%.*]], label [[ELSE:%.*]]
; CHECK: then:
-; CHECK-NEXT: [[CMP_DST_LOWER:%.*]] = icmp sge ptr [[DST]], [[LOWER]]
; CHECK-NEXT: [[CMP_DST_UPPER:%.*]] = icmp slt ptr [[DST]], [[UPPER]]
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, [[CMP_DST_UPPER]]
; CHECK-NEXT: [[DST_ADD_3:%.*]] = getelementptr inbounds i8, ptr [[DST]], i64 3
@@ -20,7 +19,6 @@ define i1 @gep_constant_positive_index(ptr %dst, ptr %lower, ptr %upper) {
; CHECK-NEXT: [[RES_2:%.*]] = xor i1 [[RES_1]], [[CMP_DST_ADD_3_LOWER]]
; CHECK-NEXT: [[RES_3:%.*]] = xor i1 [[RES_2]], [[CMP_DST_ADD_3_UPPER]]
; CHECK-NEXT: [[CMP_DST_ADD_4_LOWER:%.*]] = icmp sge ptr [[DST_ADD_4]], [[LOWER]]
-; CHECK-NEXT: [[CMP_DST_ADD_4_UPPER:%.*]] = icmp slt ptr [[DST_ADD_4]], [[UPPER]]
; CHECK-NEXT: [[RES_4:%.*]] = xor i1 [[RES_3]], [[CMP_DST_ADD_4_LOWER]]
; CHECK-NEXT: [[RES_5:%.*]] = xor i1 [[RES_4]], true
; CHECK-NEXT: [[DST_ADD_5:%.*]] = getelementptr inbounds i8, ptr [[DST]], i64 5
@@ -70,7 +68,6 @@ define i1 @gep_constant_negative_index(ptr %dst, ptr %lower, ptr %upper) {
; CHECK-NEXT: [[AND:%.*]] = and i1 [[PRE_DST_LOWER]], [[PRE_DST_UPPER]]
; CHECK-NEXT: br i1 [[AND]], label [[THEN:%.*]], label [[ELSE:%.*]]
; CHECK: then:
-; CHECK-NEXT: [[CMP_DST_LOWER:%.*]] = icmp sge ptr [[DST]], [[LOWER]]
; CHECK-NEXT: [[CMP_DST_UPPER:%.*]] = icmp slt ptr [[DST]], [[UPPER]]
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, [[CMP_DST_UPPER]]
; CHECK-NEXT: [[DST_SUB_3:%.*]] = getelementptr inbounds i8, ptr [[DST]], i64 -3
@@ -79,7 +76,6 @@ define i1 @gep_constant_negative_index(ptr %dst, ptr %lower, ptr %upper) {
; CHECK-NEXT: [[RES_2:%.*]] = xor i1 [[RES_1]], [[CMP_DST_SUB_3_LOWER]]
; CHECK-NEXT: [[RES_3:%.*]] = xor i1 [[RES_2]], [[CMP_DST_SUB_3_UPPER]]
; CHECK-NEXT: [[CMP_DST_SUB_4_LOWER:%.*]] = icmp sge ptr [[DST_SUB_4]], [[LOWER]]
-; CHECK-NEXT: [[CMP_DST_SUB_4_UPPER:%.*]] = icmp slt ptr [[DST_SUB_4]], [[UPPER]]
; CHECK-NEXT: [[RES_4:%.*]] = xor i1 [[RES_3]], [[CMP_DST_SUB_4_LOWER]]
; CHECK-NEXT: [[RES_5:%.*]] = xor i1 [[RES_4]], true
; CHECK-NEXT: [[DST_SUB_5:%.*]] = getelementptr inbounds i8, ptr [[DST]], i64 -5
@@ -280,7 +276,6 @@ define i4 @ptr_N_and_step_signed_positive_explicit_check_constant_step(ptr %src,
; CHECK: trap.bb:
; CHECK-NEXT: ret i4 2
; CHECK: step.check:
-; CHECK-NEXT: [[STEP_SGE_0:%.*]] = icmp sge i16 [[STEP]], 0
; CHECK-NEXT: [[STEP_SLT_N:%.*]] = icmp slt i16 [[STEP]], [[N]]
; CHECK-NEXT: [[AND_2:%.*]] = and i1 true, [[STEP_SLT_N]]
; CHECK-NEXT: br i1 [[AND_2]], label [[PTR_CHECK:%.*]], label [[EXIT:%.*]]
diff --git a/llvm/test/Transforms/ConstraintElimination/gep-arithmetic.ll b/llvm/test/Transforms/ConstraintElimination/gep-arithmetic.ll
index 2978b83ebc2a85..2575e4935ca46c 100644
--- a/llvm/test/Transforms/ConstraintElimination/gep-arithmetic.ll
+++ b/llvm/test/Transforms/ConstraintElimination/gep-arithmetic.ll
@@ -11,20 +11,13 @@ define i1 @gep_constant_positive_index(ptr %dst, ptr %lower, ptr %upper) {
; CHECK-NEXT: [[AND:%.*]] = and i1 [[PRE_DST_LOWER]], [[PRE_DST_UPPER]]
; CHECK-NEXT: br i1 [[AND]], label [[THEN:%.*]], label [[ELSE:%.*]]
; CHECK: then:
-; CHECK-NEXT: [[CMP_DST_LOWER:%.*]] = icmp uge ptr [[DST]], [[LOWER]]
-; CHECK-NEXT: [[CMP_DST_UPPER:%.*]] = icmp ult ptr [[DST]], [[UPPER]]
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, true
; CHECK-NEXT: [[DST_ADD_3:%.*]] = getelementptr inbounds i8, ptr [[DST]], i64 3
-; CHECK-NEXT: [[CMP_DST_ADD_3_LOWER:%.*]] = icmp uge ptr [[DST_ADD_3]], [[LOWER]]
-; CHECK-NEXT: [[CMP_DST_ADD_3_UPPER:%.*]] = icmp ult ptr [[DST_ADD_3]], [[UPPER]]
; CHECK-NEXT: [[RES_2:%.*]] = xor i1 [[RES_1]], true
; CHECK-NEXT: [[RES_3:%.*]] = xor i1 [[RES_2]], true
-; CHECK-NEXT: [[CMP_DST_ADD_4_LOWER:%.*]] = icmp uge ptr [[DST_ADD_4]], [[LOWER]]
-; CHECK-NEXT: [[CMP_DST_ADD_4_UPPER:%.*]] = icmp ult ptr [[DST_ADD_4]], [[UPPER]]
; CHECK-NEXT: [[RES_4:%.*]] = xor i1 [[RES_3]], true
; CHECK-NEXT: [[RES_5:%.*]] = xor i1 [[RES_4]], true
; CHECK-NEXT: [[DST_ADD_5:%.*]] = getelementptr inbounds i8, ptr [[DST]], i64 5
-; CHECK-NEXT: [[CMP_DST_ADD_5_LOWER:%.*]] = icmp uge ptr [[DST_ADD_5]], [[LOWER]]
; CHECK-NEXT: [[CMP_DST_ADD_5_UPPER:%.*]] = icmp ult ptr [[DST_ADD_5]], [[UPPER]]
; CHECK-NEXT: [[RES_6:%.*]] = xor i1 [[RES_5]], true
; CHECK-NEXT: [[RES_7:%.*]] = xor i1 [[RES_6]], [[CMP_DST_ADD_5_UPPER]]
@@ -70,7 +63,6 @@ define i1 @gep_constant_negative_index(ptr %dst, ptr %lower, ptr %upper) {
; CHECK-NEXT: [[AND:%.*]] = and i1 [[PRE_DST_LOWER]], [[PRE_DST_UPPER]]
; CHECK-NEXT: br i1 [[AND]], label [[THEN:%.*]], label [[ELSE:%.*]]
; CHECK: then:
-; CHECK-NEXT: [[CMP_DST_LOWER:%.*]] = icmp uge ptr [[DST]], [[LOWER]]
; CHECK-NEXT: [[CMP_DST_UPPER:%.*]] = icmp ult ptr [[DST]], [[UPPER]]
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, [[CMP_DST_UPPER]]
; CHECK-NEXT: [[DST_SUB_3:%.*]] = getelementptr inbounds i8, ptr [[DST]], i64 -3
@@ -79,12 +71,10 @@ define i1 @gep_constant_negative_index(ptr %dst, ptr %lower, ptr %upper) {
; CHECK-NEXT: [[RES_2:%.*]] = xor i1 [[RES_1]], [[CMP_DST_SUB_3_LOWER]]
; CHECK-NEXT: [[RES_3:%.*]] = xor i1 [[RES_2]], [[CMP_DST_SUB_3_UPPER]]
; CHECK-NEXT: [[CMP_DST_SUB_4_LOWER:%.*]] = icmp uge ptr [[DST_SUB_4]], [[LOWER]]
-; CHECK-NEXT: [[CMP_DST_SUB_4_UPPER:%.*]] = icmp ult ptr [[DST_SUB_4]], [[UPPER]]
; CHECK-NEXT: [[RES_4:%.*]] = xor i1 [[RES_3]], [[CMP_DST_SUB_4_LOWER]]
; CHECK-NEXT: [[RES_5:%.*]] = xor i1 [[RES_4]], true
; CHECK-NEXT: [[DST_SUB_5:%.*]] = getelementptr inbounds i8, ptr [[DST]], i64 -5
; CHECK-NEXT: [[CMP_DST_SUB_5_LOWER:%.*]] = icmp uge ptr [[DST_SUB_5]], [[LOWER]]
-; CHECK-NEXT: [[CMP_DST_SUB_5_UPPER:%.*]] = icmp ult ptr [[DST_SUB_5]], [[UPPER]]
; CHECK-NEXT: [[RES_6:%.*]] = xor i1 [[RES_5]], [[CMP_DST_SUB_5_LOWER]]
; CHECK-NEXT: [[RES_7:%.*]] = xor i1 [[RES_6]], true
; CHECK-NEXT: ret i1 [[RES_7]]
@@ -173,8 +163,6 @@ define i4 @ptr_N_signed_positive_explicit_check_constant_step(ptr %src, ptr %low
; CHECK-NEXT: br i1 [[STEP_ULT_N]], label [[PTR_CHECK:%.*]], label [[EXIT:%.*]]
; CHECK: ptr.check:
; CHECK-NEXT: [[SRC_STEP:%.*]] = getelementptr inbounds i8, ptr [[SRC]], i16 1
-; CHECK-NEXT: [[CMP_STEP_START:%.*]] = icmp ult ptr [[SRC_STEP]], [[LOWER]]
-; CHECK-NEXT: [[CMP_STEP_END:%.*]] = icmp uge ptr [[SRC_STEP]], [[UPPER]]
; CHECK-NEXT: [[OR_CHECK:%.*]] = or i1 false, false
; CHECK-NEXT: br i1 [[OR_CHECK]], label [[TRAP_BB]], label [[EXIT]]
; CHECK: exit:
@@ -280,14 +268,11 @@ define i4 @ptr_N_and_step_signed_positive_explicit_check_constant_step(ptr %src,
; CHECK: trap.bb:
; CHECK-NEXT: ret i4 2
; CHECK: step.check:
-; CHECK-NEXT: [[STEP_UGE_0:%.*]] = icmp uge i16 [[STEP]], 0
; CHECK-NEXT: [[STEP_ULT_N:%.*]] = icmp ult i16 [[STEP]], [[N]]
; CHECK-NEXT: [[AND_2:%.*]] = and i1 true, [[STEP_ULT_N]]
; CHECK-NEXT: br i1 [[AND_2]], label [[PTR_CHECK:%.*]], label [[EXIT:%.*]]
; CHECK: ptr.check:
; CHECK-NEXT: [[SRC_STEP:%.*]] = getelementptr inbounds i8, ptr [[SRC]], i16 1
-; CHECK-NEXT: [[CMP_STEP_START:%.*]] = icmp ult ptr [[SRC_STEP]], [[LOWER]]
-; CHECK-NEXT: [[CMP_STEP_END:%.*]] = icmp uge ptr [[SRC_STEP]], [[UPPER]]
; CHECK-NEXT: [[OR_CHECK:%.*]] = or i1 false, false
; CHECK-NEXT: br i1 [[OR_CHECK]], label [[TRAP_BB]], label [[EXIT]]
; CHECK: exit:
@@ -346,7 +331,6 @@ define i4 @ptr_N_and_step_signed_positive_unsigned_checks_only(ptr %src, ptr %lo
; CHECK-NEXT: br i1 [[AND_2]], label [[PTR_CHECK:%.*]], label [[EXIT:%.*]]
; CHECK: ptr.check:
; CHECK-NEXT: [[SRC_STEP:%.*]] = getelementptr inbounds i8, ptr [[SRC]], i16 1
-; CHECK-NEXT: [[CMP_STEP_START:%.*]] = icmp ult ptr [[SRC_STEP]], [[LOWER]]
; CHECK-NEXT: [[CMP_STEP_END:%.*]] = icmp uge ptr [[SRC_STEP]], [[UPPER]]
; CHECK-NEXT: [[OR_CHECK:%.*]] = or i1 false, [[CMP_STEP_END]]
; CHECK-NEXT: br i1 [[OR_CHECK]], label [[TRAP_BB]], label [[EXIT]]
@@ -403,8 +387,6 @@ define i4 @ptr_N_signed_positive(ptr %src, ptr %lower, ptr %upper, i16 %N, i16 %
; CHECK-NEXT: br i1 [[AND_STEP]], label [[PTR_CHECK:%.*]], label [[EXIT:%.*]]
; CHECK: ptr.check:
; CHECK-NEXT: [[SRC_STEP:%.*]] = getelementptr inbounds i8, ptr [[SRC]], i16 [[STEP]]
-; CHECK-NEXT: [[CMP_STEP_START:%.*]] = icmp ult ptr [[SRC_STEP]], [[LOWER]]
-; CHECK-NEXT: [[CMP_STEP_END:%.*]] = icmp uge ptr [[SRC_STEP]], [[UPPER]]
; CHECK-NEXT: [[OR_CHECK:%.*]] = or i1 false, false
; CHECK-NEXT: br i1 [[OR_CHECK]], label [[TRAP_BB]], label [[EXIT]]
; CHECK: exit:
diff --git a/llvm/test/Transforms/ConstraintElimination/gep-chains.ll b/llvm/test/Transforms/ConstraintElimination/gep-chains.ll
index 705d7f5e8e685f..5e2416462bddca 100644
--- a/llvm/test/Transforms/ConstraintElimination/gep-chains.ll
+++ b/llvm/test/Transforms/ConstraintElimination/gep-chains.ll
@@ -9,12 +9,9 @@ define i1 @gep_add_1_uge_inbounds(ptr %dst, ptr %lower) {
; CHECK-NEXT: call void @llvm.assume(i1 [[PRE]])
; CHECK-NEXT: [[DST_ADD_3:%.*]] = getelementptr inbounds i8, ptr [[DST]], i64 3
; CHECK-NEXT: [[DST_ADD_1:%.*]] = getelementptr inbounds i8, ptr [[DST]], i64 1
-; CHECK-NEXT: [[CMP_ADD_1:%.*]] = icmp uge ptr [[DST_ADD_1]], [[LOWER]]
; CHECK-NEXT: [[DST_ADD_2:%.*]] = getelementptr inbounds i8, ptr [[DST_ADD_1]], i64 1
-; CHECK-NEXT: [[CMP_ADD_3:%.*]] = icmp uge ptr [[DST_ADD_3]], [[LOWER]]
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, true
; CHECK-NEXT: [[DST_ADD_4:%.*]] = getelementptr inbounds i8, ptr [[DST_ADD_3]], i64 3
-; CHECK-NEXT: [[CMP_ADD_4:%.*]] = icmp uge ptr [[DST_ADD_4]], [[LOWER]]
; CHECK-NEXT: [[RES_2:%.*]] = xor i1 [[RES_1]], true
; CHECK-NEXT: ret i1 [[RES_2]]
;
@@ -67,9 +64,7 @@ define i1 @gep_add_1_uge_only_inner_inbounds(ptr %dst, ptr %lower) {
; CHECK-NEXT: call void @llvm.assume(i1 [[PRE]])
; CHECK-NEXT: [[DST_ADD_3:%.*]] = getelementptr inbounds i8, ptr [[DST]], i64 3
; CHECK-NEXT: [[DST_ADD_1:%.*]] = getelementptr inbounds i8, ptr [[DST]], i64 1
-; CHECK-NEXT: [[CMP_ADD_1:%.*]] = icmp uge ptr [[DST_ADD_1]], [[LOWER]]
; CHECK-NEXT: [[DST_ADD_2:%.*]] = getelementptr i8, ptr [[DST_ADD_1]], i64 1
-; CHECK-NEXT: [[CMP_ADD_3:%.*]] = icmp uge ptr [[DST_ADD_3]], [[LOWER]]
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, true
; CHECK-NEXT: [[DST_ADD_4:%.*]] = getelementptr i8, ptr [[DST_ADD_3]], i64 3
; CHECK-NEXT: [[CMP_ADD_4:%.*]] = icmp uge ptr [[DST_ADD_4]], [[LOWER]]
@@ -155,9 +150,7 @@ define i1 @gep_add_1_ult(ptr %dst, ptr %lower, ptr %upper) {
; CHECK-NEXT: call void @llvm.assume(i1 [[PRE]])
; CHECK-NEXT: [[DST_ADD_1:%.*]] = getelementptr inbounds i8, ptr [[DST]], i64 1
; CHECK-NEXT: [[DST_ADD_3:%.*]] = getelementptr inbounds i8, ptr [[DST_ADD_1]], i64 2
-; CHECK-NEXT: [[CMP_ADD_3:%.*]] = icmp ult ptr [[DST_ADD_3]], [[UPPER]]
; CHECK-NEXT: [[DST_ADD_4:%.*]] = getelementptr inbounds i8, ptr [[DST_ADD_1]], i64 3
-; CHECK-NEXT: [[CMP_ADD_4:%.*]] = icmp ult ptr [[DST_ADD_4]], [[UPPER]]
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, true
; CHECK-NEXT: [[DST_ADD_5:%.*]] = getelementptr inbounds i8, ptr [[DST_ADD_1]], i64 4
; CHECK-NEXT: [[CMP_ADD_5:%.*]] = icmp ult ptr [[DST_ADD_5]], [[UPPER]]
@@ -188,7 +181,6 @@ define i1 @gep_add_ult_var_idx(ptr %dst, ptr %upper, i8 %idx) {
; CHECK-NEXT: [[PRE:%.*]] = icmp ult ptr [[DST_ADD_IDX]], [[UPPER:%.*]]
; CHECK-NEXT: call void @llvm.assume(i1 [[PRE]])
; CHECK-NEXT: [[DST_ADD_1:%.*]] = getelementptr inbounds i8, ptr [[DST_ADD_IDX]], i64 1
-; CHECK-NEXT: [[CMP_ADD_1:%.*]] = icmp ule ptr [[DST_ADD_1]], [[UPPER]]
; CHECK-NEXT: [[DST_ADD_2:%.*]] = getelementptr inbounds i8, ptr [[DST_ADD_IDX]], i64 2
; CHECK-NEXT: [[CMP_ADD_2:%.*]] = icmp ule ptr [[DST_ADD_2]], [[UPPER]]
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, [[CMP_ADD_2]]
@@ -217,7 +209,6 @@ define i1 @gep_add_ult_var_idx_sgt_1(ptr %dst, ptr %upper, i8 %idx) {
; CHECK-NEXT: [[PRE:%.*]] = icmp ult ptr [[DST_ADD_IDX]], [[UPPER:%.*]]
; CHECK-NEXT: call void @llvm.assume(i1 [[PRE]])
; CHECK-NEXT: [[DST_ADD_1:%.*]] = getelementptr inbounds i8, ptr [[DST_ADD_IDX]], i64 1
-; CHECK-NEXT: [[CMP_ADD_1:%.*]] = icmp ule ptr [[DST_ADD_1]], [[UPPER]]
; CHECK-NEXT: [[DST_ADD_2:%.*]] = getelementptr inbounds i8, ptr [[DST_ADD_IDX]], i64 2
; CHECK-NEXT: [[CMP_ADD_2:%.*]] = icmp ule ptr [[DST_ADD_2]], [[UPPER]]
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, [[CMP_ADD_2]]
@@ -251,9 +242,7 @@ define i1 @gep_add_1_ult_var_idx_inbounds(ptr %dst, ptr %upper, i8 %len, i8 %idx
; CHECK-NEXT: [[IDX_EXT:%.*]] = zext i8 [[IDX]] to i16
; CHECK-NEXT: [[DST_ADD_IDX:%.*]] = getelementptr inbounds i8, ptr [[DST]], i16 [[IDX_EXT]]
; CHECK-NEXT: [[DST_ADD_IDX_1:%.*]] = getelementptr inbounds i8, ptr [[DST_ADD_IDX]], i64 1
-; CHECK-NEXT: [[CMP_IDX_1:%.*]] = icmp ult ptr [[DST_ADD_IDX_1]], [[UPPER]]
; CHECK-NEXT: [[DST_ADD_IDX_2:%.*]] = getelementptr inbounds i8, ptr [[DST_ADD_IDX]], i64 2
-; CHECK-NEXT: [[CMP_IDX_2:%.*]] = icmp ult ptr [[DST_ADD_IDX_2]], [[UPPER]]
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, true
; CHECK-NEXT: [[DST_ADD_IDX_3:%.*]] = getelementptr inbounds i8, ptr [[DST_ADD_IDX]], i64 3
; CHECK-NEXT: [[CMP_IDX_3:%.*]] = icmp ult ptr [[DST_ADD_IDX_3]], [[UPPER]]
diff --git a/llvm/test/Transforms/ConstraintElimination/gep-constexpr.ll b/llvm/test/Transforms/ConstraintElimination/gep-constexpr.ll
index ff7488673657c0..cd57e0713417b1 100644
--- a/llvm/test/Transforms/ConstraintElimination/gep-constexpr.ll
+++ b/llvm/test/Transforms/ConstraintElimination/gep-constexpr.ll
@@ -12,7 +12,6 @@ define i1 @gep_constexpr_index_lt_upper(i32 noundef %i) {
; CHECK-NEXT: call void @llvm.assume(i1 [[CMP]])
; CHECK-NEXT: [[IDXPROM:%.*]] = zext i32 [[I]] to i64
; CHECK-NEXT: [[UPPER:%.*]] = getelementptr inbounds i16, ptr @arr1, i64 [[IDXPROM]]
-; CHECK-NEXT: [[C_1:%.*]] = icmp ult ptr [[UPPER]], getelementptr inbounds ([3 x i16], ptr @arr1, i64 1, i64 0)
; CHECK-NEXT: ret i1 true
;
entry:
diff --git a/llvm/test/Transforms/ConstraintElimination/gep-sub.ll b/llvm/test/Transforms/ConstraintElimination/gep-sub.ll
index 3effb6a20d0caf..2e33674dda2b7d 100644
--- a/llvm/test/Transforms/ConstraintElimination/gep-sub.ll
+++ b/llvm/test/Transforms/ConstraintElimination/gep-sub.ll
@@ -9,9 +9,7 @@ define i1 @gep_sub_1_uge_inbounds(ptr %dst, ptr %lower) {
; CHECK-NEXT: call void @llvm.assume(i1 [[PRE]])
; CHECK-NEXT: [[DST_ADD_3:%.*]] = getelementptr inbounds i8, ptr [[DST]], i64 3
; CHECK-NEXT: [[DST_SUB_1:%.*]] = getelementptr inbounds i8, ptr [[DST_ADD_3]], i64 -1
-; CHECK-NEXT: [[CMP_SUB_1:%.*]] = icmp uge ptr [[DST_SUB_1]], [[LOWER]]
; CHECK-NEXT: [[DST_SUB_3:%.*]] = getelementptr inbounds i8, ptr [[DST_ADD_3]], i64 -3
-; CHECK-NEXT: [[CMP_SUB_3:%.*]] = icmp uge ptr [[DST_SUB_3]], [[LOWER]]
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, true
; CHECK-NEXT: [[DST_SUB_4:%.*]] = getelementptr inbounds i8, ptr [[DST_ADD_3]], i64 -4
; CHECK-NEXT: [[CMP_SUB_4:%.*]] = icmp uge ptr [[DST_SUB_4]], [[LOWER]]
@@ -126,9 +124,7 @@ define i1 @gep_sub_1_ult(ptr %dst, ptr %upper) {
; CHECK-NEXT: call void @llvm.assume(i1 [[PRE]])
; CHECK-NEXT: [[DST_ADD_3:%.*]] = getelementptr inbounds i8, ptr [[DST]], i64 3
; CHECK-NEXT: [[DST_SUB_1:%.*]] = getelementptr inbounds i8, ptr [[DST_ADD_3]], i64 -1
-; CHECK-NEXT: [[CMP_SUB_1:%.*]] = icmp ult ptr [[DST_SUB_1]], [[UPPER]]
; CHECK-NEXT: [[DST_SUB_3:%.*]] = getelementptr inbounds i8, ptr [[DST_ADD_3]], i64 -3
-; CHECK-NEXT: [[CMP_SUB_3:%.*]] = icmp ult ptr [[DST_SUB_3]], [[UPPER]]
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, true
; CHECK-NEXT: ret i1 [[RES_1]]
;
@@ -153,7 +149,6 @@ define i1 @gep_sub_ult_var_idx(ptr %dst, ptr %upper, i8 %idx) {
; CHECK-NEXT: [[PRE:%.*]] = icmp ult ptr [[DST_ADD_IDX]], [[UPPER:%.*]]
; CHECK-NEXT: call void @llvm.assume(i1 [[PRE]])
; CHECK-NEXT: [[DST_SUB_1:%.*]] = getelementptr inbounds i8, ptr [[DST_ADD_IDX]], i64 -1
-; CHECK-NEXT: [[CMP_SUB_1:%.*]] = icmp ult ptr [[DST_SUB_1]], [[UPPER]]
; CHECK-NEXT: [[DST_SUB_2:%.*]] = getelementptr inbounds i8, ptr [[DST_ADD_IDX]], i64 -2
; CHECK-NEXT: [[CMP_SUB_2:%.*]] = icmp ult ptr [[DST_SUB_2]], [[UPPER]]
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, [[CMP_SUB_2]]
@@ -192,9 +187,7 @@ define i1 @gep_sub_ult_var_idx_sgt_1(ptr %dst, ptr %upper, i8 %idx) {
; CHECK-NEXT: [[PRE:%.*]] = icmp ult ptr [[DST_ADD_IDX]], [[UPPER:%.*]]
; CHECK-NEXT: call void @llvm.assume(i1 [[PRE]])
; CHECK-NEXT: [[DST_SUB_1:%.*]] = getelementptr inbounds i8, ptr [[DST_ADD_IDX]], i64 -1
-; CHECK-NEXT: [[CMP_SUB_1:%.*]] = icmp ult ptr [[DST_SUB_1]], [[UPPER]]
; CHECK-NEXT: [[DST_SUB_2:%.*]] = getelementptr inbounds i8, ptr [[DST_ADD_IDX]], i64 -2
-; CHECK-NEXT: [[CMP_SUB_2:%.*]] = icmp ult ptr [[DST_SUB_2]], [[UPPER]]
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, true
; CHECK-NEXT: [[DST_SUB_3:%.*]] = getelementptr inbounds i8, ptr [[DST_ADD_IDX]], i64 -3
; CHECK-NEXT: [[CMP_SUB_3:%.*]] = icmp ult ptr [[DST_SUB_3]], [[UPPER]]
@@ -231,7 +224,6 @@ define i1 @gep_sub_1_ult_var_idx_inbounds(ptr %dst, ptr %upper, i8 %len, i8 %idx
; CHECK-NEXT: call void @llvm.assume(i1 [[CMP_IDX_ULT_LEN]])
; CHECK-NEXT: [[IDX_EXT:%.*]] = zext i8 [[IDX]] to i16
; CHECK-NEXT: [[DST_ADD_IDX:%.*]] = getelementptr inbounds i8, ptr [[DST]], i16 [[IDX_EXT]]
-; CHECK-NEXT: [[CMP_IDX:%.*]] = icmp ult ptr [[DST_ADD_IDX]], [[UPPER]]
; CHECK-NEXT: ret i1 true
;
%not.zero = icmp ne i8 %len, 0
@@ -355,7 +347,6 @@ define i1 @gep_sub_2_ult_var_idx_inbounds_len_sge_2(ptr %dst, ptr %upper, i8 %le
; CHECK-NEXT: call void @llvm.assume(i1 [[CMP_IDX_ULT_LEN]])
; CHECK-NEXT: [[IDX_EXT:%.*]] = zext i8 [[IDX]] to i16
; CHECK-NEXT: [[DST_ADD_IDX:%.*]] = getelementptr inbounds i8, ptr [[DST]], i16 [[IDX_EXT]]
-; CHECK-NEXT: [[CMP_IDX:%.*]] = icmp ult ptr [[DST_ADD_IDX]], [[UPPER]]
; CHECK-NEXT: ret i1 true
;
%sge.2 = icmp sge i8 %len, 2
@@ -386,7 +377,6 @@ define i1 @gep_sub_2_ult_var_idx_inbounds_len_uge_2(ptr %dst, ptr %upper, i8 %le
; CHECK-NEXT: call void @llvm.assume(i1 [[CMP_IDX_ULT_LEN]])
; CHECK-NEXT: [[IDX_EXT:%.*]] = zext i8 [[IDX]] to i16
; CHECK-NEXT: [[DST_ADD_IDX:%.*]] = getelementptr inbounds i8, ptr [[DST]], i16 [[IDX_EXT]]
-; CHECK-NEXT: [[CMP_IDX:%.*]] = icmp ult ptr [[DST_ADD_IDX]], [[UPPER]]
; CHECK-NEXT: ret i1 true
;
%uge.2 = icmp uge i8 %len, 2
@@ -526,7 +516,6 @@ define i1 @gep_i16_sub_1_uge_inbounds(ptr %dst, ptr %lower) {
; CHECK-NEXT: call void @llvm.assume(i1 [[PRE]])
; CHECK-NEXT: [[DST_ADD_3:%.*]] = getelementptr inbounds i8, ptr [[DST]], i64 3
; CHECK-NEXT: [[DST_SUB_1:%.*]] = getelementptr inbounds i16, ptr [[DST_ADD_3]], i64 -1
-; CHECK-NEXT: [[CMP_SUB_1:%.*]] = icmp ule ptr [[DST_SUB_1]], [[LOWER]]
; CHECK-NEXT: [[DST_SUB_2:%.*]] = getelementptr inbounds i16, ptr [[DST_ADD_3]], i64 -2
; CHECK-NEXT: [[CMP_SUB_2:%.*]] = icmp ule ptr [[DST_SUB_2]], [[DST]]
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 false, [[CMP_SUB_2]]
diff --git a/llvm/test/Transforms/ConstraintElimination/geps-i32-pointer-indexes.ll b/llvm/test/Transforms/ConstraintElimination/geps-i32-pointer-indexes.ll
index 225a73b3495557..71941bb9b2ce2c 100644
--- a/llvm/test/Transforms/ConstraintElimination/geps-i32-pointer-indexes.ll
+++ b/llvm/test/Transforms/ConstraintElimination/geps-i32-pointer-indexes.ll
@@ -10,7 +10,6 @@ define i1 @gep_idx_implicit_truncate(ptr %dst, i64 %off) {
; CHECK-NEXT: [[POS:%.*]] = icmp sge i64 [[OFF:%.*]], 0
; CHECK-NEXT: call void @llvm.assume(i1 [[POS]])
; CHECK-NEXT: [[GEP_OFF:%.*]] = getelementptr inbounds i8, ptr [[DST:%.*]], i64 [[OFF]]
-; CHECK-NEXT: [[CMP:%.*]] = icmp ule ptr [[DST]], [[GEP_OFF]]
; CHECK-NEXT: ret i1 true
;
%pos = icmp sge i64 %off, 0
diff --git a/llvm/test/Transforms/ConstraintElimination/geps-pointers-to-arrays.ll b/llvm/test/Transforms/ConstraintElimination/geps-pointers-to-arrays.ll
index db8140167ed968..366cfac120a488 100644
--- a/llvm/test/Transforms/ConstraintElimination/geps-pointers-to-arrays.ll
+++ b/llvm/test/Transforms/ConstraintElimination/geps-pointers-to-arrays.ll
@@ -9,7 +9,6 @@ define void @pointer.to.array.test.ult.true.due.to.first.dimension(ptr %start, p
; CHECK-NEXT: br i1 [[C_1]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
; CHECK: if.then:
; CHECK-NEXT: [[START_0:%.*]] = getelementptr inbounds [10 x i8], ptr [[START]], i64 5, i64 0
-; CHECK-NEXT: [[C_0:%.*]] = icmp ult ptr [[START_0]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: ret void
; CHECK: if.end:
@@ -67,7 +66,6 @@ define void @pointer.to.array.test.ult.true.due.to.second.dimension(ptr %start,
; CHECK-NEXT: br i1 [[C_1]], label [[IF_THEN:%.*]], label [[IF_END:%.*]]
; CHECK: if.then:
; CHECK-NEXT: [[START_0:%.*]] = getelementptr inbounds [10 x i8], ptr [[START]], i64 5, i64 0
-; CHECK-NEXT: [[C_0:%.*]] = icmp ult ptr [[START_0]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: ret void
; CHECK: if.end:
diff --git a/llvm/test/Transforms/ConstraintElimination/geps-pointers-to-structs.ll b/llvm/test/Transforms/ConstraintElimination/geps-pointers-to-structs.ll
index 305ff8a24fd0d6..e72f1ee9b37069 100644
--- a/llvm/test/Transforms/ConstraintElimination/geps-pointers-to-structs.ll
+++ b/llvm/test/Transforms/ConstraintElimination/geps-pointers-to-structs.ll
@@ -14,7 +14,6 @@ define i1 @test.ult.true.due.to.first.dimension(ptr %start, ptr %high) {
; CHECK: if.then:
; CHECK-NEXT: [[START_0:%.*]] = getelementptr inbounds [[STRUCT_1]], ptr [[START]], i64 5, i32 0
; CHECK-NEXT: [[START_0_CAST:%.*]] = bitcast ptr [[START_0]] to ptr
-; CHECK-NEXT: [[C_0:%.*]] = icmp ult ptr [[START_0_CAST]], [[HIGH]]
; CHECK-NEXT: ret i1 true
; CHECK: if.end:
; CHECK-NEXT: ret i1 true
@@ -48,7 +47,6 @@ define i1 @test.ult.true.due.to.first.dimension.var.index.0(ptr %start, ptr %hig
; CHECK-NEXT: [[IDX_EXT:%.*]] = zext i32 [[IDX]] to i64
; CHECK-NEXT: [[START_0:%.*]] = getelementptr inbounds [[STRUCT_1]], ptr [[START]], i64 [[IDX_EXT]], i32 0
; CHECK-NEXT: [[START_0_CAST:%.*]] = bitcast ptr [[START_0]] to ptr
-; CHECK-NEXT: [[C_0:%.*]] = icmp ult ptr [[START_0_CAST]], [[HIGH]]
; CHECK-NEXT: ret i1 true
; CHECK: if.end:
; CHECK-NEXT: ret i1 true
@@ -85,7 +83,6 @@ define i1 @test.ult.true.due.to.first.dimension.var.index.1(ptr %start, ptr %hig
; CHECK-NEXT: [[IDX_EXT:%.*]] = zext i32 [[IDX]] to i64
; CHECK-NEXT: [[START_0:%.*]] = getelementptr inbounds [[STRUCT_1]], ptr [[START]], i64 [[IDX_EXT]], i32 1
; CHECK-NEXT: [[START_0_CAST:%.*]] = bitcast ptr [[START_0]] to ptr
-; CHECK-NEXT: [[C_0:%.*]] = icmp ult ptr [[START_0_CAST]], [[HIGH]]
; CHECK-NEXT: ret i1 true
; CHECK: if.end:
; CHECK-NEXT: ret i1 true
@@ -121,7 +118,6 @@ define i1 @test.ult.true.due.to.first.dimension.var.index.2(ptr %start, ptr %hig
; CHECK: if.then:
; CHECK-NEXT: [[IDX_EXT:%.*]] = zext i32 [[IDX]] to i64
; CHECK-NEXT: [[START_0:%.*]] = getelementptr inbounds [[STRUCT_1]], ptr [[START]], i64 [[IDX_EXT]], i32 2
-; CHECK-NEXT: [[C_0:%.*]] = icmp ult ptr [[START_0]], [[HIGH]]
; CHECK-NEXT: ret i1 true
; CHECK: if.end:
; CHECK-NEXT: ret i1 true
@@ -184,7 +180,6 @@ define i1 @test.ult.true.due.to.second.dimension(ptr %start, ptr %high) {
; CHECK: if.then:
; CHECK-NEXT: [[START_0:%.*]] = getelementptr inbounds [[STRUCT_1]], ptr [[START]], i64 5, i32 1
; CHECK-NEXT: [[START_0_CAST:%.*]] = bitcast ptr [[START_0]] to ptr
-; CHECK-NEXT: [[C_0:%.*]] = icmp ult ptr [[START_0_CAST]], [[HIGH]]
; CHECK-NEXT: ret i1 true
; CHECK: if.end:
; CHECK-NEXT: ret i1 true
@@ -305,7 +300,6 @@ define i1 @ptr.int.struct.test.ult.true.due.to.first.dimension(ptr %start, ptr %
; CHECK: if.then:
; CHECK-NEXT: [[START_0:%.*]] = getelementptr inbounds [[STRUCT_2]], ptr [[START]], i64 6, i32 0
; CHECK-NEXT: [[START_0_CAST:%.*]] = bitcast ptr [[START_0]] to ptr
-; CHECK-NEXT: [[C_0:%.*]] = icmp ult ptr [[START_0_CAST]], [[HIGH]]
; CHECK-NEXT: ret i1 true
; CHECK: if.end:
; CHECK-NEXT: ret i1 true
@@ -339,7 +333,6 @@ define i1 @ptr.int.struct.test.ult.true.due.to.third.dimension.var.index(ptr %st
; CHECK-NEXT: [[IDX_EXT:%.*]] = zext i32 [[IDX]] to i64
; CHECK-NEXT: [[START_0:%.*]] = getelementptr inbounds [[STRUCT_2]], ptr [[START]], i64 6, i32 1, i64 [[IDX_EXT]]
; CHECK-NEXT: [[START_0_CAST:%.*]] = bitcast ptr [[START_0]] to ptr
-; CHECK-NEXT: [[C_0:%.*]] = icmp ult ptr [[START_0_CAST]], [[HIGH]]
; CHECK-NEXT: ret i1 true
; CHECK: if.end:
; CHECK-NEXT: ret i1 true
diff --git a/llvm/test/Transforms/ConstraintElimination/geps-ptrvector.ll b/llvm/test/Transforms/ConstraintElimination/geps-ptrvector.ll
index 051f764bb8bc25..88df92fbada075 100644
--- a/llvm/test/Transforms/ConstraintElimination/geps-ptrvector.ll
+++ b/llvm/test/Transforms/ConstraintElimination/geps-ptrvector.ll
@@ -16,7 +16,6 @@ define <2 x i1> @test.vectorgep(<2 x ptr> %vec) {
define <2 x i1> @test.vectorgep.ult.true(<2 x ptr> %vec) {
; CHECK-LABEL: @test.vectorgep.ult.true(
; CHECK-NEXT: [[GEP_1:%.*]] = getelementptr inbounds i32, <2 x ptr> [[VEC:%.*]], i64 1
-; CHECK-NEXT: [[T_1:%.*]] = icmp ult <2 x ptr> [[VEC]], [[GEP_1]]
; CHECK-NEXT: ret <2 x i1> <i1 true, i1 true>
;
%gep.1 = getelementptr inbounds i32, <2 x ptr> %vec, i64 1
@@ -27,7 +26,6 @@ define <2 x i1> @test.vectorgep.ult.true(<2 x ptr> %vec) {
define <2 x i1> @test.vectorgep.ult.false(<2 x ptr> %vec) {
; CHECK-LABEL: @test.vectorgep.ult.false(
; CHECK-NEXT: [[GEP_1:%.*]] = getelementptr inbounds i32, <2 x ptr> [[VEC:%.*]], i64 1
-; CHECK-NEXT: [[T_1:%.*]] = icmp ult <2 x ptr> [[GEP_1]], [[VEC]]
; CHECK-NEXT: ret <2 x i1> zeroinitializer
;
%gep.1 = getelementptr inbounds i32, <2 x ptr> %vec, i64 1
@@ -39,7 +37,6 @@ define <2 x i1> @test.vectorgep.ult.false(<2 x ptr> %vec) {
define <vscale x 2 x i1> @test.scalable.vectorgep.ult.true(<vscale x 2 x ptr> %vec) {
; CHECK-LABEL: @test.scalable.vectorgep.ult.true(
; CHECK-NEXT: [[GEP_1:%.*]] = getelementptr inbounds i32, <vscale x 2 x ptr> [[VEC:%.*]], i64 1
-; CHECK-NEXT: [[T_1:%.*]] = icmp ult <vscale x 2 x ptr> [[VEC]], [[GEP_1]]
; CHECK-NEXT: ret <vscale x 2 x i1> shufflevector (<vscale x 2 x i1> insertelement (<vscale x 2 x i1> poison, i1 true, i64 0), <vscale x 2 x i1> poison, <vscale x 2 x i32> zeroinitializer)
;
%gep.1 = getelementptr inbounds i32, <vscale x 2 x ptr> %vec, i64 1
@@ -50,7 +47,6 @@ define <vscale x 2 x i1> @test.scalable.vectorgep.ult.true(<vscale x 2 x ptr> %v
define <vscale x 2 x i1> @test.scalable.vectorgep.ult.false(<vscale x 2 x ptr> %vec) {
; CHECK-LABEL: @test.scalable.vectorgep.ult.false(
; CHECK-NEXT: [[GEP_1:%.*]] = getelementptr inbounds i32, <vscale x 2 x ptr> [[VEC:%.*]], i64 1
-; CHECK-NEXT: [[T_1:%.*]] = icmp ult <vscale x 2 x ptr> [[GEP_1]], [[VEC]]
; CHECK-NEXT: ret <vscale x 2 x i1> zeroinitializer
;
%gep.1 = getelementptr inbounds i32, <vscale x 2 x ptr> %vec, i64 1
diff --git a/llvm/test/Transforms/ConstraintElimination/geps-unsigned-predicates.ll b/llvm/test/Transforms/ConstraintElimination/geps-unsigned-predicates.ll
index 51eb96c38c1c82..6b185bc6238132 100644
--- a/llvm/test/Transforms/ConstraintElimination/geps-unsigned-predicates.ll
+++ b/llvm/test/Transforms/ConstraintElimination/geps-unsigned-predicates.ll
@@ -14,7 +14,6 @@ define i32 @test.ult(ptr readonly %src, ptr readnone %min, ptr readnone %max) {
; CHECK: check.3.min:
; CHECK-NEXT: [[L0:%.*]] = load i32, ptr [[SRC]], align 4
; CHECK-NEXT: [[ADD_PTR_I36:%.*]] = getelementptr inbounds i32, ptr [[SRC]], i64 3
-; CHECK-NEXT: [[C_3_MIN:%.*]] = icmp ult ptr [[ADD_PTR_I36]], [[MIN]]
; CHECK-NEXT: br i1 false, label [[TRAP]], label [[CHECK_3_MAX:%.*]]
; CHECK: check.3.max:
; CHECK-NEXT: [[C_3_MAX:%.*]] = icmp ult ptr [[ADD_PTR_I36]], [[MAX]]
@@ -22,18 +21,14 @@ define i32 @test.ult(ptr readonly %src, ptr readnone %min, ptr readnone %max) {
; CHECK: check.1.min:
; CHECK-NEXT: [[L1:%.*]] = load i32, ptr [[ADD_PTR_I36]], align 4
; CHECK-NEXT: [[ADD_PTR_I29:%.*]] = getelementptr inbounds i32, ptr [[SRC]], i64 1
-; CHECK-NEXT: [[C_1_MIN:%.*]] = icmp ult ptr [[ADD_PTR_I29]], [[MIN]]
; CHECK-NEXT: br i1 false, label [[TRAP]], label [[CHECK_1_MAX:%.*]]
; CHECK: check.1.max:
-; CHECK-NEXT: [[C_1_MAX:%.*]] = icmp ult ptr [[ADD_PTR_I29]], [[MAX]]
; CHECK-NEXT: br i1 true, label [[CHECK_2_MIN:%.*]], label [[TRAP]]
; CHECK: check.2.min:
; CHECK-NEXT: [[L2:%.*]] = load i32, ptr [[ADD_PTR_I29]], align 4
; CHECK-NEXT: [[ADD_PTR_I:%.*]] = getelementptr inbounds i32, ptr [[SRC]], i64 2
-; CHECK-NEXT: [[C_2_MIN:%.*]] = icmp ult ptr [[ADD_PTR_I]], [[MIN]]
; CHECK-NEXT: br i1 false, label [[TRAP]], label [[CHECK_2_MAX:%.*]]
; CHECK: check.2.max:
-; CHECK-NEXT: [[C_2_MAX:%.*]] = icmp ult ptr [[ADD_PTR_I]], [[MAX]]
; CHECK-NEXT: br i1 true, label [[EXIT:%.*]], label [[TRAP]]
; CHECK: exit:
; CHECK-NEXT: [[L3:%.*]] = load i32, ptr [[ADD_PTR_I]], align 4
@@ -191,16 +186,12 @@ define void @test.not.uge.ult(ptr %start, ptr %low, ptr %high) {
; CHECK: if.then:
; CHECK-NEXT: ret void
; CHECK: if.end:
-; CHECK-NEXT: [[T_0:%.*]] = icmp ult ptr [[START]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_1:%.*]] = getelementptr inbounds i8, ptr [[START]], i64 1
-; CHECK-NEXT: [[T_1:%.*]] = icmp ult ptr [[START_1]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_2:%.*]] = getelementptr inbounds i8, ptr [[START]], i64 2
-; CHECK-NEXT: [[T_2:%.*]] = icmp ult ptr [[START_2]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_3:%.*]] = getelementptr inbounds i8, ptr [[START]], i64 3
-; CHECK-NEXT: [[T_3:%.*]] = icmp ult ptr [[START_3]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_4:%.*]] = getelementptr inbounds i8, ptr [[START]], i64 4
; CHECK-NEXT: [[C_4:%.*]] = icmp ult ptr [[START_4]], [[HIGH]]
@@ -294,19 +285,14 @@ define void @test.not.uge.ule(ptr %start, ptr %low, ptr %high) {
; CHECK: if.then:
; CHECK-NEXT: ret void
; CHECK: if.end:
-; CHECK-NEXT: [[T_0:%.*]] = icmp ule ptr [[START]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_1:%.*]] = getelementptr inbounds i8, ptr [[START]], i64 1
-; CHECK-NEXT: [[T_1:%.*]] = icmp ule ptr [[START_1]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_2:%.*]] = getelementptr inbounds i8, ptr [[START]], i64 2
-; CHECK-NEXT: [[T_2:%.*]] = icmp ule ptr [[START_2]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_3:%.*]] = getelementptr inbounds i8, ptr [[START]], i64 3
-; CHECK-NEXT: [[T_3:%.*]] = icmp ule ptr [[START_3]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_4:%.*]] = getelementptr inbounds i8, ptr [[START]], i64 4
-; CHECK-NEXT: [[T_4:%.*]] = icmp ule ptr [[START_4]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_5:%.*]] = getelementptr inbounds i8, ptr [[START]], i64 5
; CHECK-NEXT: [[C_5:%.*]] = icmp ule ptr [[START_5]], [[HIGH]]
@@ -351,19 +337,14 @@ define void @test.not.uge.ugt(ptr %start, ptr %low, ptr %high) {
; CHECK: if.then:
; CHECK-NEXT: ret void
; CHECK: if.end:
-; CHECK-NEXT: [[F_0:%.*]] = icmp ugt ptr [[START]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[START_1:%.*]] = getelementptr inbounds i8, ptr [[START]], i64 1
-; CHECK-NEXT: [[F_1:%.*]] = icmp ugt ptr [[START_1]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[START_2:%.*]] = getelementptr inbounds i8, ptr [[START]], i64 2
-; CHECK-NEXT: [[F_2:%.*]] = icmp ugt ptr [[START_2]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[START_3:%.*]] = getelementptr inbounds i8, ptr [[START]], i64 3
-; CHECK-NEXT: [[F_3:%.*]] = icmp ugt ptr [[START_3]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[START_4:%.*]] = getelementptr inbounds i8, ptr [[START]], i64 4
-; CHECK-NEXT: [[F_4:%.*]] = icmp ugt ptr [[START_4]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[START_5:%.*]] = getelementptr inbounds i8, ptr [[START]], i64 5
; CHECK-NEXT: [[C_5:%.*]] = icmp ugt ptr [[START_5]], [[HIGH]]
@@ -408,16 +389,12 @@ define void @test.not.uge.uge(ptr %start, ptr %low, ptr %high) {
; CHECK: if.then:
; CHECK-NEXT: ret void
; CHECK: if.end:
-; CHECK-NEXT: [[F_0:%.*]] = icmp ugt ptr [[START]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[START_1:%.*]] = getelementptr inbounds i8, ptr [[START]], i64 1
-; CHECK-NEXT: [[F_1:%.*]] = icmp uge ptr [[START_1]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[START_2:%.*]] = getelementptr inbounds i8, ptr [[START]], i64 2
-; CHECK-NEXT: [[F_2:%.*]] = icmp uge ptr [[START_2]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[START_3:%.*]] = getelementptr inbounds i8, ptr [[START]], i64 3
-; CHECK-NEXT: [[F_3:%.*]] = icmp uge ptr [[START_3]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[START_4:%.*]] = getelementptr inbounds i8, ptr [[START]], i64 4
; CHECK-NEXT: [[C_4:%.*]] = icmp uge ptr [[START_4]], [[HIGH]]
@@ -512,7 +489,6 @@ define void @test.ult.gep.shl(ptr readonly %src, ptr readnone %max, i8 %idx) {
; CHECK: check.max:
; CHECK-NEXT: [[IDX_SHL_1:%.*]] = shl nuw nsw i8 [[IDX]], 1
; CHECK-NEXT: [[ADD_PTR_SHL_1:%.*]] = getelementptr inbounds i32, ptr [[SRC]], i8 [[IDX_SHL_1]]
-; CHECK-NEXT: [[C_MAX_0:%.*]] = icmp ult ptr [[ADD_PTR_SHL_1]], [[MAX]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[IDX_SHL_2:%.*]] = shl nuw i8 [[IDX]], 2
; CHECK-NEXT: [[ADD_PTR_SHL_2:%.*]] = getelementptr inbounds i32, ptr [[SRC]], i8 [[IDX_SHL_2]]
@@ -576,7 +552,6 @@ define void @test.ult.gep.shl.zext(ptr readonly %src, ptr readnone %max, i32 %id
; CHECK-NEXT: [[IDX_SHL:%.*]] = shl nuw i32 [[IDX]], 1
; CHECK-NEXT: [[EXT_1:%.*]] = zext i32 [[IDX_SHL]] to i64
; CHECK-NEXT: [[ADD_PTR_SHL:%.*]] = getelementptr inbounds i32, ptr [[SRC]], i64 [[EXT_1]]
-; CHECK-NEXT: [[C_MAX_0:%.*]] = icmp ult ptr [[ADD_PTR_SHL]], [[MAX]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[IDX_SHL_NOT_NUW:%.*]] = shl i32 [[IDX]], 1
; CHECK-NEXT: [[EXT_2:%.*]] = zext i32 [[IDX_SHL_NOT_NUW]] to i64
diff --git a/llvm/test/Transforms/ConstraintElimination/invoke.ll b/llvm/test/Transforms/ConstraintElimination/invoke.ll
index 4bbc3a9fe60a0a..5d57d1c078fe3b 100644
--- a/llvm/test/Transforms/ConstraintElimination/invoke.ll
+++ b/llvm/test/Transforms/ConstraintElimination/invoke.ll
@@ -14,14 +14,12 @@ define i1 @test_invoke_in_block_with_assume(i32 %x) personality ptr @__gxx_perso
; CHECK-NEXT: invoke void @may_unwind()
; CHECK-NEXT: to label [[CONT:%.*]] unwind label [[LPAD:%.*]]
; CHECK: cont:
-; CHECK-NEXT: [[T_1:%.*]] = icmp ult i32 [[X]], 10
; CHECK-NEXT: [[C_2:%.*]] = icmp ult i32 [[X]], 9
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, [[C_2]]
; CHECK-NEXT: ret i1 [[RES_1]]
; CHECK: lpad:
; CHECK-NEXT: [[LP:%.*]] = landingpad { ptr, i32 }
; CHECK-NEXT: filter [0 x ptr] zeroinitializer
-; CHECK-NEXT: [[T_2:%.*]] = icmp ult i32 [[X]], 10
; CHECK-NEXT: [[C_3:%.*]] = icmp ult i32 [[X]], 9
; CHECK-NEXT: [[RES_2:%.*]] = xor i1 true, [[C_3]]
; CHECK-NEXT: ret i1 [[RES_2]]
diff --git a/llvm/test/Transforms/ConstraintElimination/large-constant-ints.ll b/llvm/test/Transforms/ConstraintElimination/large-constant-ints.ll
index fa8a4a60eac145..64db02600f77be 100644
--- a/llvm/test/Transforms/ConstraintElimination/large-constant-ints.ll
+++ b/llvm/test/Transforms/ConstraintElimination/large-constant-ints.ll
@@ -104,7 +104,6 @@ define i1 @sub_decomp_i80(i80 %a) {
; CHECK-NEXT: br i1 [[C]], label [[THEN:%.*]], label [[ELSE:%.*]]
; CHECK: then:
; CHECK-NEXT: [[SUB_1:%.*]] = sub nuw i80 [[A]], 1973801615886922022913
-; CHECK-NEXT: [[C_1:%.*]] = icmp ult i80 [[SUB_1]], 1346612317380797267967
; CHECK-NEXT: ret i1 true
; CHECK: else:
; CHECK-NEXT: ret i1 false
@@ -131,7 +130,6 @@ define i1 @gep_decomp_i80(ptr %a) {
; CHECK-NEXT: br i1 [[C]], label [[THEN:%.*]], label [[ELSE:%.*]]
; CHECK: then:
; CHECK-NEXT: [[GEP_1:%.*]] = getelementptr inbounds i8, ptr [[A]], i80 1973801615886922022913
-; CHECK-NEXT: [[C_1:%.*]] = icmp eq ptr [[GEP_1]], null
; CHECK-NEXT: ret i1 true
; CHECK: else:
; CHECK-NEXT: ret i1 false
@@ -334,7 +332,6 @@ define i1 @gep_decomp_large_index_63_bits(ptr %a) {
; CHECK-NEXT: [[GEP_2:%.*]] = getelementptr inbounds i64, ptr [[A]], i64 9223372036854775805
; CHECK-NEXT: [[NE:%.*]] = icmp ne ptr [[GEP_1]], [[GEP_2]]
; CHECK-NEXT: call void @llvm.assume(i1 [[NE]])
-; CHECK-NEXT: [[CMP_ULE:%.*]] = icmp ule ptr [[GEP_1]], [[GEP_2]]
; CHECK-NEXT: [[CMP_UGE:%.*]] = icmp uge ptr [[GEP_1]], [[GEP_2]]
; CHECK-NEXT: [[RES:%.*]] = xor i1 true, true
; CHECK-NEXT: ret i1 [[RES]]
@@ -358,7 +355,6 @@ define i1 @gep_decomp_large_index_63_bits_chained_overflow(ptr %a) {
; CHECK-NEXT: [[GEP_3:%.*]] = getelementptr inbounds i64, ptr [[GEP_2]], i64 1152921504606846976
; CHECK-NEXT: [[NE:%.*]] = icmp ne ptr [[GEP_1]], [[GEP_3]]
; CHECK-NEXT: call void @llvm.assume(i1 [[NE]])
-; CHECK-NEXT: [[CMP_ULE:%.*]] = icmp ule ptr [[GEP_1]], [[GEP_3]]
; CHECK-NEXT: [[CMP_UGE:%.*]] = icmp uge ptr [[GEP_1]], [[GEP_3]]
; CHECK-NEXT: [[RES:%.*]] = xor i1 true, true
; CHECK-NEXT: ret i1 [[RES]]
@@ -384,7 +380,6 @@ define i1 @gep_decomp_large_index_63_bits_overflow_struct(ptr %a) {
; CHECK-NEXT: [[GEP_2:%.*]] = getelementptr inbounds [[STRUCT:%.*]], ptr [[A]], i64 8937376004704240, i32 1, i32 1
; CHECK-NEXT: [[NE:%.*]] = icmp ne ptr [[GEP_1]], [[GEP_2]]
; CHECK-NEXT: call void @llvm.assume(i1 [[NE]])
-; CHECK-NEXT: [[CMP_ULE:%.*]] = icmp ule ptr [[GEP_1]], [[GEP_2]]
; CHECK-NEXT: [[CMP_UGE:%.*]] = icmp uge ptr [[GEP_1]], [[GEP_2]]
; CHECK-NEXT: [[RES:%.*]] = xor i1 false, false
; CHECK-NEXT: ret i1 [[RES]]
diff --git a/llvm/test/Transforms/ConstraintElimination/large-system-growth.ll b/llvm/test/Transforms/ConstraintElimination/large-system-growth.ll
index d91406d74b80ea..147bc4210d5570 100644
--- a/llvm/test/Transforms/ConstraintElimination/large-system-growth.ll
+++ b/llvm/test/Transforms/ConstraintElimination/large-system-growth.ll
@@ -21,7 +21,6 @@ define void @test(i64 %x, ptr %y, ptr %z, ptr %w) {
; CHECK-NEXT: [[TMP36:%.*]] = icmp ult ptr [[Y]], [[Z]]
; CHECK-NEXT: br i1 [[TMP36]], label [[EARLY_EXIT]], label [[BB38:%.*]]
; CHECK: bb38:
-; CHECK-NEXT: [[TMP41:%.*]] = icmp ult ptr [[Y]], [[Z]]
; CHECK-NEXT: br i1 false, label [[EARLY_EXIT]], label [[BB43:%.*]]
; CHECK: bb43:
; CHECK-NEXT: [[TMP47:%.*]] = getelementptr inbounds i8, ptr [[W:%.*]], i64 [[X]]
@@ -35,7 +34,6 @@ define void @test(i64 %x, ptr %y, ptr %z, ptr %w) {
; CHECK-NEXT: [[TMP57:%.*]] = icmp ult ptr [[W]], [[Y]]
; CHECK-NEXT: br i1 [[TMP57]], label [[BB59:%.*]], label [[EARLY_EXIT]]
; CHECK: bb59:
-; CHECK-NEXT: [[TMP60:%.*]] = icmp ult ptr [[W]], [[Y]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: ret void
;
diff --git a/llvm/test/Transforms/ConstraintElimination/loops-header-tested-base.ll b/llvm/test/Transforms/ConstraintElimination/loops-header-tested-base.ll
index 24f6b1edfaa392..8245e84108e426 100644
--- a/llvm/test/Transforms/ConstraintElimination/loops-header-tested-base.ll
+++ b/llvm/test/Transforms/ConstraintElimination/loops-header-tested-base.ll
@@ -12,9 +12,7 @@ define void @loop_phi_pos_start_value(i32 %y, i1 %c, i32 %n) {
; CHECK-NEXT: [[C_1:%.*]] = icmp slt i32 [[X]], [[N:%.*]]
; CHECK-NEXT: br i1 [[C_1]], label [[LOOP_LATCH]], label [[EXIT]]
; CHECK: loop.latch:
-; CHECK-NEXT: [[F_1:%.*]] = icmp sle i32 [[X]], [[N]]
; CHECK-NEXT: call void @use(i1 true)
-; CHECK-NEXT: [[T_1:%.*]] = icmp sgt i32 [[X]], [[N]]
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[T_2:%.*]] = icmp sge i32 [[X]], 10
; CHECK-NEXT: call void @use(i1 [[T_2]])
@@ -76,9 +74,7 @@ define void @loop_phi_neg_start_value(i32 %y, i1 %c, i32 %n) {
; CHECK-NEXT: [[C_1:%.*]] = icmp slt i32 [[X]], [[N:%.*]]
; CHECK-NEXT: br i1 [[C_1]], label [[LOOP_LATCH]], label [[EXIT]]
; CHECK: loop.latch:
-; CHECK-NEXT: [[F_1:%.*]] = icmp sle i32 [[X]], [[N]]
; CHECK-NEXT: call void @use(i1 true)
-; CHECK-NEXT: [[T_1:%.*]] = icmp sgt i32 [[X]], [[N]]
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[T_2:%.*]] = icmp sge i32 [[X]], -10
; CHECK-NEXT: call void @use(i1 [[T_2]])
@@ -144,9 +140,7 @@ define void @loop_count_down(i32 %y, i1 %c, i32 %n) {
; CHECK-NEXT: call void @use(i1 [[F_1]])
; CHECK-NEXT: [[T_1:%.*]] = icmp sgt i32 [[X]], [[N]]
; CHECK-NEXT: call void @use(i1 [[T_1]])
-; CHECK-NEXT: [[T_2:%.*]] = icmp sge i32 [[X]], 0
; CHECK-NEXT: call void @use(i1 true)
-; CHECK-NEXT: [[T_3:%.*]] = icmp sge i32 [[X]], -1
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[C_2:%.*]] = icmp sle i32 [[X]], 9
; CHECK-NEXT: call void @use(i1 [[C_2]])
@@ -208,9 +202,7 @@ define void @loop_latch_may_not_executed(i32 %y, i1 %c, i32 %n) {
; CHECK-NEXT: [[C_1:%.*]] = icmp ugt i32 [[X]], [[N:%.*]]
; CHECK-NEXT: br i1 [[C_1]], label [[LOOP_LATCH]], label [[EXIT]]
; CHECK: loop.latch:
-; CHECK-NEXT: [[F_1:%.*]] = icmp ule i32 [[X]], [[N]]
; CHECK-NEXT: call void @use(i1 false)
-; CHECK-NEXT: [[T_1:%.*]] = icmp ugt i32 [[X]], [[N]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[C_2:%.*]] = icmp ule i32 [[X]], 9
; CHECK-NEXT: call void @use(i1 [[C_2]])
@@ -260,13 +252,9 @@ define void @loop_latch_not_executed_constant_bound(i32 %y, i1 %c) {
; CHECK-NEXT: [[C_1:%.*]] = icmp ugt i32 [[X]], 10
; CHECK-NEXT: br i1 [[C_1]], label [[LOOP_LATCH]], label [[EXIT]]
; CHECK: loop.latch:
-; CHECK-NEXT: [[T_1:%.*]] = icmp ule i32 [[X]], 10
; CHECK-NEXT: call void @use(i1 false)
-; CHECK-NEXT: [[F_1:%.*]] = icmp ugt i32 [[X]], 10
; CHECK-NEXT: call void @use(i1 true)
-; CHECK-NEXT: [[C_2:%.*]] = icmp ule i32 [[X]], 9
; CHECK-NEXT: call void @use(i1 false)
-; CHECK-NEXT: [[C_3:%.*]] = icmp ugt i32 [[X]], 9
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[X_NEXT]] = add i32 [[X]], 1
; CHECK-NEXT: br label [[LOOP_HEADER]]
@@ -323,7 +311,6 @@ define void @loop_iv_cond_variable_bound(i32 %n) {
; CHECK-NEXT: [[CMP:%.*]] = icmp ult i32 [[IV]], [[N]]
; CHECK-NEXT: br i1 [[CMP]], label [[LOOP_LATCH]], label [[EXIT:%.*]]
; CHECK: loop.latch:
-; CHECK-NEXT: [[T_4:%.*]] = icmp ule i32 [[IV]], [[N]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[C_3:%.*]] = icmp ult i32 [[IV]], 2
; CHECK-NEXT: call void @use(i1 [[C_3]])
@@ -389,11 +376,8 @@ define void @loop_iv_cond_constant_bound() {
; CHECK-NEXT: [[CMP:%.*]] = icmp ult i32 [[IV]], 2
; CHECK-NEXT: br i1 [[CMP]], label [[LOOP_LATCH]], label [[EXIT:%.*]]
; CHECK: loop.latch:
-; CHECK-NEXT: [[T_4:%.*]] = icmp ule i32 [[IV]], 2
; CHECK-NEXT: call void @use(i1 true)
-; CHECK-NEXT: [[C_3:%.*]] = icmp ult i32 [[IV]], 2
; CHECK-NEXT: call void @use(i1 true)
-; CHECK-NEXT: [[C_4:%.*]] = icmp ugt i32 [[IV]], 1
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[IV_NEXT]] = add nuw nsw i32 [[IV]], 1
; CHECK-NEXT: br label [[LOOP_HEADER]]
diff --git a/llvm/test/Transforms/ConstraintElimination/loops-header-tested-pointer-cmps.ll b/llvm/test/Transforms/ConstraintElimination/loops-header-tested-pointer-cmps.ll
index b5daafc16ffc3a..e7116670ef89b9 100644
--- a/llvm/test/Transforms/ConstraintElimination/loops-header-tested-pointer-cmps.ll
+++ b/llvm/test/Transforms/ConstraintElimination/loops-header-tested-pointer-cmps.ll
@@ -660,7 +660,6 @@ define void @test_ptr_need_one_upper_check(ptr readonly %src, ptr %dst, i32 %n)
; CHECK: loop.latch:
; CHECK-NEXT: [[DST_UPPER:%.*]] = getelementptr inbounds i32, ptr [[DST:%.*]], i64 [[TMP0]]
; CHECK-NEXT: [[DST_IDX:%.*]] = getelementptr inbounds i32, ptr [[DST]], i64 [[IDXPROM]]
-; CHECK-NEXT: [[CMP_DST_IDX_UPPER:%.*]] = icmp ult ptr [[DST_IDX]], [[DST_UPPER]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: br i1 true, label [[LOOP_LATCH_2]], label [[EXIT]]
; CHECK: loop.latch.2:
diff --git a/llvm/test/Transforms/ConstraintElimination/loops-header-tested-pointer-iv.ll b/llvm/test/Transforms/ConstraintElimination/loops-header-tested-pointer-iv.ll
index 00cd3a77fbaadf..9cb27a44bd7012 100644
--- a/llvm/test/Transforms/ConstraintElimination/loops-header-tested-pointer-iv.ll
+++ b/llvm/test/Transforms/ConstraintElimination/loops-header-tested-pointer-iv.ll
@@ -17,7 +17,6 @@ define void @loop_pointer_iv(ptr %start, ptr %end, ptr %upper) {
; CHECK-NEXT: [[C_1:%.*]] = icmp ule ptr [[IV]], [[END]]
; CHECK-NEXT: br i1 [[C_1]], label [[LOOP_LATCH]], label [[EXIT]]
; CHECK: loop.latch:
-; CHECK-NEXT: [[T_1:%.*]] = icmp ult ptr [[IV]], [[UPPER]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[IV_NEXT]] = getelementptr inbounds i8, ptr [[IV]], i8 1
; CHECK-NEXT: br label [[LOOP_HEADER]]
@@ -61,7 +60,6 @@ define void @loop_pointer_iv_null_start(ptr %end, ptr %upper) {
; CHECK-NEXT: [[C_3:%.*]] = icmp ule ptr [[IV]], [[END]]
; CHECK-NEXT: br i1 [[C_3]], label [[LOOP_LATCH]], label [[EXIT]]
; CHECK: loop.latch:
-; CHECK-NEXT: [[C_4:%.*]] = icmp ult ptr [[IV]], [[UPPER]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[IV_NEXT]] = getelementptr inbounds i8, ptr [[IV]], i8 1
; CHECK-NEXT: br label [[LOOP_HEADER]]
diff --git a/llvm/test/Transforms/ConstraintElimination/loops.ll b/llvm/test/Transforms/ConstraintElimination/loops.ll
index df008a9c33ebea..25d4ac436ce8c1 100644
--- a/llvm/test/Transforms/ConstraintElimination/loops.ll
+++ b/llvm/test/Transforms/ConstraintElimination/loops.ll
@@ -60,9 +60,7 @@ define i32 @loop_header_dom(i32 %y, i1 %c) {
; CHECK-NEXT: [[C_1:%.*]] = icmp ule i32 [[X]], 10
; CHECK-NEXT: br i1 [[C_1]], label [[LOOP_LATCH]], label [[EXIT]]
; CHECK: loop.latch:
-; CHECK-NEXT: [[T_1:%.*]] = icmp ule i32 [[X]], 10
; CHECK-NEXT: call void @use(i1 true)
-; CHECK-NEXT: [[F_1:%.*]] = icmp ugt i32 [[X]], 10
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[C_2:%.*]] = icmp ule i32 [[X]], 9
; CHECK-NEXT: call void @use(i1 [[C_2]])
@@ -112,9 +110,7 @@ define i32 @loop_header_dom_successors_flipped(i32 %y, i1 %c) {
; CHECK-NEXT: [[C_1:%.*]] = icmp ule i32 [[X]], 10
; CHECK-NEXT: br i1 [[C_1]], label [[EXIT]], label [[LOOP_LATCH]]
; CHECK: loop.latch:
-; CHECK-NEXT: [[F_1:%.*]] = icmp ule i32 [[X]], 10
; CHECK-NEXT: call void @use(i1 false)
-; CHECK-NEXT: [[T_1:%.*]] = icmp ugt i32 [[X]], 10
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[C_2:%.*]] = icmp ugt i32 [[X]], 11
; CHECK-NEXT: call void @use(i1 [[C_2]])
@@ -166,17 +162,13 @@ define void @loop_header_dom_or(i32 %y, i1 %c, i32 %start) {
; CHECK-NEXT: [[OR:%.*]] = or i1 [[X_1]], [[Y_1]]
; CHECK-NEXT: br i1 [[OR]], label [[EXIT]], label [[LOOP_LATCH]]
; CHECK: loop.latch:
-; CHECK-NEXT: [[T_1:%.*]] = icmp ugt i32 [[X]], 10
; CHECK-NEXT: call void @use(i1 true)
-; CHECK-NEXT: [[F_1:%.*]] = icmp ule i32 [[X]], 10
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[C_1:%.*]] = icmp ugt i32 [[X]], 11
; CHECK-NEXT: call void @use(i1 [[C_1]])
; CHECK-NEXT: [[C_2:%.*]] = icmp ule i32 [[X]], 11
; CHECK-NEXT: call void @use(i1 [[C_2]])
-; CHECK-NEXT: [[T_2:%.*]] = icmp ule i32 [[Y]], 99
; CHECK-NEXT: call void @use(i1 true)
-; CHECK-NEXT: [[F_2:%.*]] = icmp ugt i32 [[Y]], 99
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[C_3:%.*]] = icmp ule i32 [[Y]], 98
; CHECK-NEXT: call void @use(i1 [[C_3]])
@@ -319,17 +311,13 @@ define void @loop_header_dom_and(i32 %y, i1 %c) {
; CHECK-NEXT: [[AND:%.*]] = and i1 [[X_1]], [[Y_1]]
; CHECK-NEXT: br i1 [[AND]], label [[LOOP_LATCH]], label [[EXIT_1:%.*]]
; CHECK: loop.latch:
-; CHECK-NEXT: [[T_1:%.*]] = icmp ule i32 [[X]], 10
; CHECK-NEXT: call void @use(i1 true)
-; CHECK-NEXT: [[F_1:%.*]] = icmp ugt i32 [[X]], 10
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[C_1:%.*]] = icmp ule i32 [[X]], 9
; CHECK-NEXT: call void @use(i1 [[C_1]])
; CHECK-NEXT: [[C_2:%.*]] = icmp ugt i32 [[X]], 9
; CHECK-NEXT: call void @use(i1 [[C_2]])
-; CHECK-NEXT: [[T_2:%.*]] = icmp ugt i32 [[Y]], 99
; CHECK-NEXT: call void @use(i1 true)
-; CHECK-NEXT: [[F_2:%.*]] = icmp ule i32 [[Y]], 99
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[C_3:%.*]] = icmp ugt i32 [[Y]], 100
; CHECK-NEXT: call void @use(i1 [[C_3]])
@@ -421,7 +409,6 @@ define void @loop_header_dom_and_successors_flipped(i32 %y, i1 %c) {
; CHECK-NEXT: [[X_NEXT]] = add i32 [[X]], 1
; CHECK-NEXT: br label [[LOOP_HEADER]]
; CHECK: exit.1:
-; CHECK-NEXT: [[T_1:%.*]] = icmp ugt i32 [[Y]], 10
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: ret void
;
diff --git a/llvm/test/Transforms/ConstraintElimination/max-row-limit.ll b/llvm/test/Transforms/ConstraintElimination/max-row-limit.ll
index 2f830b7e98d3c5..752e012791ee45 100644
--- a/llvm/test/Transforms/ConstraintElimination/max-row-limit.ll
+++ b/llvm/test/Transforms/ConstraintElimination/max-row-limit.ll
@@ -5,28 +5,48 @@
define i1 @test_max_row_limit(i32 %l0, i32 %l1, i32 %l2, i32 %l3, i32 %l4) {
-; COMMON-LABEL: @test_max_row_limit(
-; COMMON-NEXT: bb0:
-; COMMON-NEXT: [[C0:%.*]] = icmp uge i32 [[L0:%.*]], 100
-; COMMON-NEXT: br i1 [[C0]], label [[BB1:%.*]], label [[EXIT:%.*]]
-; COMMON: bb1:
-; COMMON-NEXT: [[C1:%.*]] = icmp uge i32 [[L1:%.*]], 100
-; COMMON-NEXT: br i1 [[C1]], label [[BB2:%.*]], label [[EXIT]]
-; COMMON: bb2:
-; COMMON-NEXT: [[C2:%.*]] = icmp uge i32 [[L2:%.*]], 100
-; COMMON-NEXT: br i1 [[C2]], label [[BB3:%.*]], label [[EXIT]]
-; COMMON: bb3:
-; COMMON-NEXT: [[C3:%.*]] = icmp uge i32 [[L3:%.*]], 100
-; COMMON-NEXT: br i1 [[C3]], label [[BB4:%.*]], label [[EXIT]]
-; COMMON: bb4:
-; COMMON-NEXT: [[C4:%.*]] = icmp uge i32 [[L4:%.*]], 100
-; COMMON-NEXT: br i1 [[C4]], label [[BB5:%.*]], label [[EXIT]]
-; COMMON: bb5:
-; COMMON-NEXT: [[C5:%.*]] = icmp uge i32 [[L4]], 100
-; SIMP-NEXT: ret i1 true
+; SIMP-LABEL: @test_max_row_limit(
+; SIMP-NEXT: bb0:
+; SIMP-NEXT: [[C0:%.*]] = icmp uge i32 [[L0:%.*]], 100
+; SIMP-NEXT: br i1 [[C0]], label [[BB1:%.*]], label [[EXIT:%.*]]
+; SIMP: bb1:
+; SIMP-NEXT: [[C1:%.*]] = icmp uge i32 [[L1:%.*]], 100
+; SIMP-NEXT: br i1 [[C1]], label [[BB2:%.*]], label [[EXIT]]
+; SIMP: bb2:
+; SIMP-NEXT: [[C2:%.*]] = icmp uge i32 [[L2:%.*]], 100
+; SIMP-NEXT: br i1 [[C2]], label [[BB3:%.*]], label [[EXIT]]
+; SIMP: bb3:
+; SIMP-NEXT: [[C3:%.*]] = icmp uge i32 [[L3:%.*]], 100
+; SIMP-NEXT: br i1 [[C3]], label [[BB4:%.*]], label [[EXIT]]
+; SIMP: bb4:
+; SIMP-NEXT: [[C4:%.*]] = icmp uge i32 [[L4:%.*]], 100
+; SIMP-NEXT: br i1 [[C4]], label [[BB5:%.*]], label [[EXIT]]
+; SIMP: bb5:
+; SIMP-NEXT: ret i1 true
+; SIMP: exit:
+; SIMP-NEXT: ret i1 false
+;
+; NOSIMP-LABEL: @test_max_row_limit(
+; NOSIMP-NEXT: bb0:
+; NOSIMP-NEXT: [[C0:%.*]] = icmp uge i32 [[L0:%.*]], 100
+; NOSIMP-NEXT: br i1 [[C0]], label [[BB1:%.*]], label [[EXIT:%.*]]
+; NOSIMP: bb1:
+; NOSIMP-NEXT: [[C1:%.*]] = icmp uge i32 [[L1:%.*]], 100
+; NOSIMP-NEXT: br i1 [[C1]], label [[BB2:%.*]], label [[EXIT]]
+; NOSIMP: bb2:
+; NOSIMP-NEXT: [[C2:%.*]] = icmp uge i32 [[L2:%.*]], 100
+; NOSIMP-NEXT: br i1 [[C2]], label [[BB3:%.*]], label [[EXIT]]
+; NOSIMP: bb3:
+; NOSIMP-NEXT: [[C3:%.*]] = icmp uge i32 [[L3:%.*]], 100
+; NOSIMP-NEXT: br i1 [[C3]], label [[BB4:%.*]], label [[EXIT]]
+; NOSIMP: bb4:
+; NOSIMP-NEXT: [[C4:%.*]] = icmp uge i32 [[L4:%.*]], 100
+; NOSIMP-NEXT: br i1 [[C4]], label [[BB5:%.*]], label [[EXIT]]
+; NOSIMP: bb5:
+; NOSIMP-NEXT: [[C5:%.*]] = icmp uge i32 [[L4]], 100
; NOSIMP-NEXT: ret i1 [[C5]]
-; COMMON: exit:
-; COMMON-NEXT: ret i1 false
+; NOSIMP: exit:
+; NOSIMP-NEXT: ret i1 false
;
bb0:
%c0 = icmp uge i32 %l0, 100
@@ -55,3 +75,5 @@ bb5:
exit:
ret i1 false
}
+;; NOTE: These prefixes are unused and the list is autogenerated. Do not add tests below this line:
+; COMMON: {{.*}}
diff --git a/llvm/test/Transforms/ConstraintElimination/minmax.ll b/llvm/test/Transforms/ConstraintElimination/minmax.ll
index 43a9b6931b3292..a31cf6845ad67d 100644
--- a/llvm/test/Transforms/ConstraintElimination/minmax.ll
+++ b/llvm/test/Transforms/ConstraintElimination/minmax.ll
@@ -9,8 +9,6 @@ define i1 @umax_ugt(i32 %x, i32 %y) {
; CHECK-NEXT: [[CMP:%.*]] = icmp ugt i32 [[Y]], [[MAX]]
; CHECK-NEXT: br i1 [[CMP]], label [[IF:%.*]], label [[END:%.*]]
; CHECK: if:
-; CHECK-NEXT: [[CMP2:%.*]] = icmp ugt i32 [[Y]], [[X]]
-; CHECK-NEXT: [[CMP3:%.*]] = icmp uge i32 [[Y]], [[X]]
; CHECK-NEXT: [[RET:%.*]] = xor i1 true, true
; CHECK-NEXT: ret i1 [[RET]]
; CHECK: end:
@@ -38,7 +36,6 @@ define i1 @umax_uge(i32 %x, i32 %y) {
; CHECK-NEXT: br i1 [[CMP]], label [[IF:%.*]], label [[END:%.*]]
; CHECK: if:
; CHECK-NEXT: [[CMP2:%.*]] = icmp ugt i32 [[Y]], [[X]]
-; CHECK-NEXT: [[CMP3:%.*]] = icmp uge i32 [[Y]], [[X]]
; CHECK-NEXT: [[RET:%.*]] = xor i1 [[CMP2]], true
; CHECK-NEXT: ret i1 [[RET]]
; CHECK: end:
@@ -65,8 +62,6 @@ define i1 @umin_ult(i32 %x, i32 %y) {
; CHECK-NEXT: [[CMP:%.*]] = icmp ult i32 [[Y]], [[MIN]]
; CHECK-NEXT: br i1 [[CMP]], label [[IF:%.*]], label [[END:%.*]]
; CHECK: if:
-; CHECK-NEXT: [[CMP2:%.*]] = icmp ult i32 [[Y]], [[X]]
-; CHECK-NEXT: [[CMP3:%.*]] = icmp ule i32 [[Y]], [[X]]
; CHECK-NEXT: [[RET:%.*]] = xor i1 true, true
; CHECK-NEXT: ret i1 [[RET]]
; CHECK: end:
@@ -94,7 +89,6 @@ define i1 @umin_ule(i32 %x, i32 %y) {
; CHECK-NEXT: br i1 [[CMP]], label [[IF:%.*]], label [[END:%.*]]
; CHECK: if:
; CHECK-NEXT: [[CMP2:%.*]] = icmp ult i32 [[Y]], [[X]]
-; CHECK-NEXT: [[CMP3:%.*]] = icmp ule i32 [[Y]], [[X]]
; CHECK-NEXT: [[RET:%.*]] = xor i1 [[CMP2]], true
; CHECK-NEXT: ret i1 [[RET]]
; CHECK: end:
@@ -121,8 +115,6 @@ define i1 @smax_sgt(i32 %x, i32 %y) {
; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i32 [[Y]], [[MAX]]
; CHECK-NEXT: br i1 [[CMP]], label [[IF:%.*]], label [[END:%.*]]
; CHECK: if:
-; CHECK-NEXT: [[CMP2:%.*]] = icmp sgt i32 [[Y]], [[X]]
-; CHECK-NEXT: [[CMP3:%.*]] = icmp sge i32 [[Y]], [[X]]
; CHECK-NEXT: [[RET:%.*]] = xor i1 true, true
; CHECK-NEXT: ret i1 [[RET]]
; CHECK: end:
@@ -150,7 +142,6 @@ define i1 @smax_sge(i32 %x, i32 %y) {
; CHECK-NEXT: br i1 [[CMP]], label [[IF:%.*]], label [[END:%.*]]
; CHECK: if:
; CHECK-NEXT: [[CMP2:%.*]] = icmp sgt i32 [[Y]], [[X]]
-; CHECK-NEXT: [[CMP3:%.*]] = icmp sge i32 [[Y]], [[X]]
; CHECK-NEXT: [[RET:%.*]] = xor i1 [[CMP2]], true
; CHECK-NEXT: ret i1 [[RET]]
; CHECK: end:
@@ -177,8 +168,6 @@ define i1 @smin_slt(i32 %x, i32 %y) {
; CHECK-NEXT: [[CMP:%.*]] = icmp slt i32 [[Y]], [[MIN]]
; CHECK-NEXT: br i1 [[CMP]], label [[IF:%.*]], label [[END:%.*]]
; CHECK: if:
-; CHECK-NEXT: [[CMP2:%.*]] = icmp slt i32 [[Y]], [[X]]
-; CHECK-NEXT: [[CMP3:%.*]] = icmp sle i32 [[Y]], [[X]]
; CHECK-NEXT: [[RET:%.*]] = xor i1 true, true
; CHECK-NEXT: ret i1 [[RET]]
; CHECK: end:
@@ -206,7 +195,6 @@ define i1 @smin_sle(i32 %x, i32 %y) {
; CHECK-NEXT: br i1 [[CMP]], label [[IF:%.*]], label [[END:%.*]]
; CHECK: if:
; CHECK-NEXT: [[CMP2:%.*]] = icmp slt i32 [[Y]], [[X]]
-; CHECK-NEXT: [[CMP3:%.*]] = icmp sle i32 [[Y]], [[X]]
; CHECK-NEXT: [[RET:%.*]] = xor i1 [[CMP2]], true
; CHECK-NEXT: ret i1 [[RET]]
; CHECK: end:
@@ -234,7 +222,6 @@ define i1 @umax_uge_ugt_with_add_nuw(i32 %x, i32 %y) {
; CHECK-NEXT: [[CMP:%.*]] = icmp uge i32 [[Y]], [[SUM]]
; CHECK-NEXT: br i1 [[CMP]], label [[IF:%.*]], label [[END:%.*]]
; CHECK: if:
-; CHECK-NEXT: [[CMP2:%.*]] = icmp ugt i32 [[Y]], [[X]]
; CHECK-NEXT: ret i1 true
; CHECK: end:
; CHECK-NEXT: ret i1 false
@@ -295,8 +282,6 @@ define i1 @umax_ugt_ugt_both(i32 %x, i32 %y, i32 %z) {
; CHECK-NEXT: [[CMP:%.*]] = icmp ugt i32 [[Z]], [[MAX]]
; CHECK-NEXT: br i1 [[CMP]], label [[IF:%.*]], label [[END:%.*]]
; CHECK: if:
-; CHECK-NEXT: [[CMP2:%.*]] = icmp ugt i32 [[Z]], [[X]]
-; CHECK-NEXT: [[CMP3:%.*]] = icmp ugt i32 [[Z]], [[Y]]
; CHECK-NEXT: [[AND:%.*]] = xor i1 true, true
; CHECK-NEXT: ret i1 [[AND]]
; CHECK: end:
@@ -321,8 +306,6 @@ define i1 @smin_branchless(i32 %x, i32 %y) {
; CHECK-SAME: (i32 [[X:%.*]], i32 [[Y:%.*]]) {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[MIN:%.*]] = call i32 @llvm.smin.i32(i32 [[X]], i32 [[Y]])
-; CHECK-NEXT: [[CMP1:%.*]] = icmp sle i32 [[MIN]], [[X]]
-; CHECK-NEXT: [[CMP2:%.*]] = icmp sgt i32 [[MIN]], [[X]]
; CHECK-NEXT: [[RET:%.*]] = xor i1 true, false
; CHECK-NEXT: ret i1 [[RET]]
;
diff --git a/llvm/test/Transforms/ConstraintElimination/mixed-signed-unsigned-predicates.ll b/llvm/test/Transforms/ConstraintElimination/mixed-signed-unsigned-predicates.ll
index 2dc9efd4df765d..757a949fbc2d71 100644
--- a/llvm/test/Transforms/ConstraintElimination/mixed-signed-unsigned-predicates.ll
+++ b/llvm/test/Transforms/ConstraintElimination/mixed-signed-unsigned-predicates.ll
@@ -13,7 +13,6 @@ define i1 @test_add_nuw(i8 %start, i8 %low, i8 %high) {
; CHECK-NEXT: [[UC_4:%.*]] = icmp uge i8 [[START_1_1]], [[HIGH]]
; CHECK-NEXT: [[RES_11:%.*]] = xor i1 [[UC_3]], [[UC_4]]
; CHECK-NEXT: [[START_3_1:%.*]] = add nuw i8 [[START]], 3
-; CHECK-NEXT: [[T_0:%.*]] = icmp uge i8 [[START_3_1]], [[HIGH]]
; CHECK-NEXT: [[RES_12:%.*]] = xor i1 [[RES_11]], true
; CHECK-NEXT: [[UC_5:%.*]] = icmp ugt i8 [[START_3_1]], [[HIGH]]
; CHECK-NEXT: [[RES_13:%.*]] = xor i1 [[RES_12]], [[UC_5]]
@@ -23,23 +22,19 @@ define i1 @test_add_nuw(i8 %start, i8 %low, i8 %high) {
; CHECK-NEXT: [[RES_15:%.*]] = xor i1 [[RES_14]], [[SC_9]]
; CHECK-NEXT: ret i1 [[RES_15]]
; CHECK: if.else:
-; CHECK-NEXT: [[F_0:%.*]] = icmp ugt i8 [[START]], [[HIGH]]
; CHECK-NEXT: [[START_1:%.*]] = add nuw i8 [[START]], 1
-; CHECK-NEXT: [[F_1:%.*]] = icmp uge i8 [[START_1]], [[HIGH]]
; CHECK-NEXT: [[RES_0:%.*]] = xor i1 false, false
; CHECK-NEXT: [[SC_1:%.*]] = icmp sgt i8 [[START]], [[HIGH]]
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 [[RES_0]], [[SC_1]]
; CHECK-NEXT: [[SC_2:%.*]] = icmp sge i8 [[START_1]], [[HIGH]]
; CHECK-NEXT: [[RES_2:%.*]] = xor i1 [[RES_1]], [[SC_2]]
; CHECK-NEXT: [[START_2:%.*]] = add nuw i8 [[START]], 2
-; CHECK-NEXT: [[F_2:%.*]] = icmp uge i8 [[START_2]], [[HIGH]]
; CHECK-NEXT: [[RES_3:%.*]] = xor i1 [[RES_2]], false
; CHECK-NEXT: [[SC_3:%.*]] = icmp sge i8 [[START_2]], [[HIGH]]
; CHECK-NEXT: [[RES_4:%.*]] = xor i1 [[RES_3]], [[SC_3]]
; CHECK-NEXT: [[SC_4:%.*]] = icmp sle i8 [[START_2]], [[START_1]]
; CHECK-NEXT: [[RES_5:%.*]] = xor i1 [[RES_4]], [[SC_4]]
; CHECK-NEXT: [[START_3:%.*]] = add nuw i8 [[START]], 3
-; CHECK-NEXT: [[F_3:%.*]] = icmp uge i8 [[START_3]], [[HIGH]]
; CHECK-NEXT: [[RES_6:%.*]] = xor i1 [[RES_5]], false
; CHECK-NEXT: [[SC_5:%.*]] = icmp sge i8 [[START_3]], [[START_1]]
; CHECK-NEXT: [[RES_7:%.*]] = xor i1 [[RES_6]], [[SC_5]]
@@ -147,7 +142,6 @@ define i1 @test_add_nsw(i8 %start, i8 %low, i8 %high) {
; CHECK-NEXT: [[START_1:%.*]] = add nuw i8 [[START]], 1
; CHECK-NEXT: [[F_1:%.*]] = icmp uge i8 [[START_1]], [[HIGH]]
; CHECK-NEXT: [[RES_0:%.*]] = xor i1 [[F_0]], [[F_1]]
-; CHECK-NEXT: [[SC_1:%.*]] = icmp sgt i8 [[START]], [[HIGH]]
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 [[RES_0]], false
; CHECK-NEXT: [[SC_2:%.*]] = icmp sge i8 [[START_1]], [[HIGH]]
; CHECK-NEXT: [[RES_2:%.*]] = xor i1 [[RES_1]], [[SC_2]]
@@ -248,14 +242,10 @@ define i1 @test_sub_nuw(i8 %start, i8 %low, i8 %high) {
; CHECK-NEXT: [[C_1:%.*]] = icmp uge i8 [[ADD_PTR_I]], [[HIGH:%.*]]
; CHECK-NEXT: br i1 [[C_1]], label [[IF_THEN:%.*]], label [[IF_ELSE:%.*]]
; CHECK: if.then:
-; CHECK-NEXT: [[UC_3:%.*]] = icmp ugt i8 [[START]], [[HIGH]]
; CHECK-NEXT: [[START_1_1:%.*]] = sub nuw i8 [[START]], 1
-; CHECK-NEXT: [[UC_4:%.*]] = icmp uge i8 [[START_1_1]], [[HIGH]]
; CHECK-NEXT: [[RES_11:%.*]] = xor i1 true, true
; CHECK-NEXT: [[START_3_1:%.*]] = add nuw i8 [[START]], 3
-; CHECK-NEXT: [[T_0:%.*]] = icmp uge i8 [[START_3_1]], [[HIGH]]
; CHECK-NEXT: [[RES_12:%.*]] = xor i1 [[RES_11]], true
-; CHECK-NEXT: [[UC_5:%.*]] = icmp ugt i8 [[START_3_1]], [[HIGH]]
; CHECK-NEXT: [[RES_13:%.*]] = xor i1 [[RES_12]], true
; CHECK-NEXT: [[SC_8:%.*]] = icmp sge i8 [[START_1_1]], [[HIGH]]
; CHECK-NEXT: [[RES_14:%.*]] = xor i1 [[RES_13]], [[SC_8]]
@@ -279,12 +269,10 @@ define i1 @test_sub_nuw(i8 %start, i8 %low, i8 %high) {
; CHECK-NEXT: [[SC_4:%.*]] = icmp sle i8 [[START_2]], [[START_1]]
; CHECK-NEXT: [[RES_5:%.*]] = xor i1 [[RES_4]], [[SC_4]]
; CHECK-NEXT: [[START_3:%.*]] = sub nuw i8 [[START]], 3
-; CHECK-NEXT: [[F_3:%.*]] = icmp uge i8 [[START_3]], [[HIGH]]
; CHECK-NEXT: [[RES_6:%.*]] = xor i1 [[RES_5]], false
; CHECK-NEXT: [[SC_5:%.*]] = icmp sge i8 [[START_3]], [[START_1]]
; CHECK-NEXT: [[RES_7:%.*]] = xor i1 [[RES_6]], [[SC_5]]
; CHECK-NEXT: [[START_4:%.*]] = sub nuw i8 [[START]], 4
-; CHECK-NEXT: [[UC_2:%.*]] = icmp uge i8 [[START_4]], [[HIGH]]
; CHECK-NEXT: [[RES_8:%.*]] = xor i1 [[RES_7]], false
; CHECK-NEXT: [[SC_6:%.*]] = icmp sge i8 [[START_4]], [[START_1]]
; CHECK-NEXT: [[RES_9:%.*]] = xor i1 [[RES_8]], [[SC_6]]
@@ -370,7 +358,6 @@ define i1 @test_and_ule_sge(i32 %x, i32 %y, i32 %z, i32 %a) {
; CHECK-NEXT: br i1 [[AND]], label [[THEN:%.*]], label [[ELSE:%.*]]
; CHECK: then:
; CHECK-NEXT: [[UC_1:%.*]] = icmp ule i32 [[X]], [[Z]]
-; CHECK-NEXT: [[UC_2:%.*]] = icmp ule i32 [[X]], [[Y]]
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 [[UC_1]], true
; CHECK-NEXT: [[UC_3:%.*]] = icmp ule i32 [[Y]], [[Z]]
; CHECK-NEXT: [[RES_2:%.*]] = xor i1 [[RES_1]], [[UC_3]]
@@ -380,7 +367,6 @@ define i1 @test_and_ule_sge(i32 %x, i32 %y, i32 %z, i32 %a) {
; CHECK-NEXT: [[RES_5:%.*]] = xor i1 [[RES_4]], [[SC_1]]
; CHECK-NEXT: [[SC_2:%.*]] = icmp sle i32 [[X]], [[Y]]
; CHECK-NEXT: [[RES_6:%.*]] = xor i1 [[RES_5]], [[SC_2]]
-; CHECK-NEXT: [[SC_3:%.*]] = icmp sle i32 [[Y]], [[Z]]
; CHECK-NEXT: [[RES_7:%.*]] = xor i1 [[RES_6]], true
; CHECK-NEXT: [[SC_4:%.*]] = icmp sle i32 [[X]], [[A]]
; CHECK-NEXT: [[RES_8:%.*]] = xor i1 [[RES_7]], [[SC_4]]
diff --git a/llvm/test/Transforms/ConstraintElimination/mul-nsw.ll b/llvm/test/Transforms/ConstraintElimination/mul-nsw.ll
index 241798dac925af..f2f6a91ebc9e82 100644
--- a/llvm/test/Transforms/ConstraintElimination/mul-nsw.ll
+++ b/llvm/test/Transforms/ConstraintElimination/mul-nsw.ll
@@ -13,16 +13,12 @@ define void @slt_mul_nsw_3_known_positive_1(i8 %start, i8 %high) {
; CHECK-NEXT: [[AND:%.*]] = and i1 [[C_1]], [[C_2]]
; CHECK-NEXT: br i1 [[AND]], label [[THEN:%.*]], label [[ELSE:%.*]]
; CHECK: then:
-; CHECK-NEXT: [[T_0:%.*]] = icmp slt i8 [[START]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_1:%.*]] = mul nsw i8 [[START]], 1
-; CHECK-NEXT: [[T_1:%.*]] = icmp slt i8 [[START_1]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_2:%.*]] = mul nsw i8 [[START]], 2
-; CHECK-NEXT: [[T_2:%.*]] = icmp slt i8 [[START_2]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_3:%.*]] = mul nsw i8 [[START]], 3
-; CHECK-NEXT: [[T_3:%.*]] = icmp slt i8 [[START_3]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_4:%.*]] = mul nsw i8 [[START]], 4
; CHECK-NEXT: [[C_3:%.*]] = icmp slt i8 [[START_4]], [[HIGH]]
@@ -335,16 +331,12 @@ define void @slt_mul_nsw_neg_3_known_negative_1(i8 %start, i8 %high) {
; CHECK-NEXT: [[AND:%.*]] = and i1 [[C_1]], [[C_2]]
; CHECK-NEXT: br i1 [[AND]], label [[THEN:%.*]], label [[ELSE:%.*]]
; CHECK: then:
-; CHECK-NEXT: [[T_0:%.*]] = icmp slt i8 [[START]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_1:%.*]] = mul nsw i8 [[START]], -1
-; CHECK-NEXT: [[T_1:%.*]] = icmp slt i8 [[START_1]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_2:%.*]] = mul nsw i8 [[START]], -2
-; CHECK-NEXT: [[T_2:%.*]] = icmp slt i8 [[START_2]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_3:%.*]] = mul nsw i8 [[START]], -3
-; CHECK-NEXT: [[T_3:%.*]] = icmp slt i8 [[START_3]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_4:%.*]] = mul nsw i8 [[START]], -4
; CHECK-NEXT: [[C_3:%.*]] = icmp slt i8 [[START_4]], [[HIGH]]
@@ -454,10 +446,8 @@ define void @slt_mul_nsw_3_known_negative_1(i8 %start, i8 %high) {
; CHECK-NEXT: [[C_5:%.*]] = icmp slt i8 [[START_2]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 [[C_5]])
; CHECK-NEXT: [[START_3:%.*]] = mul nsw i8 [[START]], 3
-; CHECK-NEXT: [[T_0:%.*]] = icmp slt i8 [[START_3]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_4:%.*]] = mul nsw i8 [[START]], 4
-; CHECK-NEXT: [[T_1:%.*]] = icmp slt i8 [[START_4]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: ret void
; CHECK: else:
@@ -564,10 +554,8 @@ define void @slt_mul_nsw_neg_3_known_positive_1(i8 %start, i8 %high) {
; CHECK-NEXT: [[C_5:%.*]] = icmp slt i8 [[START_2]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 [[C_5]])
; CHECK-NEXT: [[START_3:%.*]] = mul nsw i8 [[START]], -3
-; CHECK-NEXT: [[T_0:%.*]] = icmp slt i8 [[START_3]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_4:%.*]] = mul nsw i8 [[START]], -4
-; CHECK-NEXT: [[T_1:%.*]] = icmp slt i8 [[START_4]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: ret void
; CHECK: else:
@@ -665,16 +653,12 @@ define void @slt_mul_nsw_3_known_nonnegative_1(i8 %start, i8 %high) {
; CHECK-NEXT: [[AND:%.*]] = and i1 [[C_1]], [[C_2]]
; CHECK-NEXT: br i1 [[AND]], label [[THEN:%.*]], label [[ELSE:%.*]]
; CHECK: then:
-; CHECK-NEXT: [[T_0:%.*]] = icmp slt i8 [[START]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_1:%.*]] = mul nsw i8 [[START]], 1
-; CHECK-NEXT: [[T_1:%.*]] = icmp slt i8 [[START_1]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_2:%.*]] = mul nsw i8 [[START]], 2
-; CHECK-NEXT: [[T_2:%.*]] = icmp slt i8 [[START_2]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_3:%.*]] = mul nsw i8 [[START]], 3
-; CHECK-NEXT: [[T_3:%.*]] = icmp slt i8 [[START_3]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_4:%.*]] = mul nsw i8 [[START]], 4
; CHECK-NEXT: [[C_3:%.*]] = icmp slt i8 [[START_4]], [[HIGH]]
diff --git a/llvm/test/Transforms/ConstraintElimination/mul.ll b/llvm/test/Transforms/ConstraintElimination/mul.ll
index 29d08c0af2a9d2..c8a1d31a48d564 100644
--- a/llvm/test/Transforms/ConstraintElimination/mul.ll
+++ b/llvm/test/Transforms/ConstraintElimination/mul.ll
@@ -49,7 +49,6 @@ define i1 @test_mul_const_nuw_unsigned_3(i8 %start, i8 %high) {
; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
; CHECK-NEXT: [[START_MUL_2:%.*]] = mul nuw i8 [[START]], 2
; CHECK-NEXT: [[START_ADD_1:%.*]] = add nuw i8 [[START]], [[START]]
-; CHECK-NEXT: [[T:%.*]] = icmp ule i8 [[START_ADD_1]], [[START_MUL_2]]
; CHECK-NEXT: ret i1 true
;
entry:
@@ -72,7 +71,6 @@ define i1 @test_mul_const_nuw_unsigned_4(i8 %start, i8 %high) {
; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
; CHECK-NEXT: [[START_MUL_2:%.*]] = mul nuw i8 [[START]], 2
; CHECK-NEXT: [[START_ADD_1:%.*]] = add nuw i8 [[START]], [[START]]
-; CHECK-NEXT: [[F:%.*]] = icmp ult i8 [[START_ADD_1]], [[START_MUL_2]]
; CHECK-NEXT: ret i1 false
;
entry:
@@ -95,7 +93,6 @@ define i1 @test_mul_const_nuw_unsigned_5(i8 %start, i8 %high) {
; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
; CHECK-NEXT: [[START_ADD_1:%.*]] = add nuw i8 [[START]], [[START]]
; CHECK-NEXT: [[START_ADD_2:%.*]] = add nuw i8 [[START_ADD_1]], [[START_ADD_1]]
-; CHECK-NEXT: [[T_4:%.*]] = icmp ule i8 [[START_ADD_2]], [[START_MUL_4]]
; CHECK-NEXT: ret i1 true
;
entry:
@@ -117,7 +114,6 @@ define i1 @test_mul_const_nuw_unsigned_6(i8 %start, i8 %high) {
; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
; CHECK-NEXT: [[START_ADD_1:%.*]] = add nuw i8 [[START]], [[START]]
; CHECK-NEXT: [[START_ADD_2:%.*]] = add nuw i8 [[START_ADD_1]], [[START_ADD_1]]
-; CHECK-NEXT: [[F_2:%.*]] = icmp ult i8 [[START_ADD_2]], [[START_MUL_4]]
; CHECK-NEXT: ret i1 false
;
entry:
@@ -141,7 +137,6 @@ define i1 @test_mul_const_nuw_unsigned_7(i8 %start, i8 %high) {
; CHECK-NEXT: [[START_ADD_1:%.*]] = add nuw i8 [[START]], [[START]]
; CHECK-NEXT: [[START_ADD_2:%.*]] = add nuw i8 [[START_ADD_1]], [[START_ADD_1]]
; CHECK-NEXT: [[START_ADD_2_1:%.*]] = add nuw i8 [[START_ADD_2]], 1
-; CHECK-NEXT: [[F_3:%.*]] = icmp ule i8 [[START_ADD_2_1]], [[START_MUL_4]]
; CHECK-NEXT: ret i1 false
;
entry:
@@ -220,7 +215,6 @@ define i1 @test_mul_const_nuw_unsigned_10(i8 %start, i8 %high) {
; CHECK-NEXT: [[C_0:%.*]] = icmp ult i8 [[START]], [[START_MUL_5]]
; CHECK-NEXT: call void @llvm.assume(i1 [[C_0]])
; CHECK-NEXT: [[START_MUL_3:%.*]] = mul nuw i8 [[START]], 3
-; CHECK-NEXT: [[T_1:%.*]] = icmp ule i8 [[START_MUL_3]], [[START_MUL_5]]
; CHECK-NEXT: ret i1 true
;
entry:
@@ -240,7 +234,6 @@ define i1 @test_mul_const_nuw_unsigned_11(i8 %start, i8 %high) {
; CHECK-NEXT: [[C_0:%.*]] = icmp ult i8 [[START]], [[START_MUL_5]]
; CHECK-NEXT: call void @llvm.assume(i1 [[C_0]])
; CHECK-NEXT: [[START_MUL_3:%.*]] = mul nuw i8 [[START]], 3
-; CHECK-NEXT: [[C_1:%.*]] = icmp ule i8 [[START_MUL_5]], [[START_MUL_3]]
; CHECK-NEXT: ret i1 false
;
entry:
@@ -260,7 +253,6 @@ define i1 @test_mul_const_nuw_unsigned_12(i8 %start) {
; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START]], [[START_MUL_3]]
; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
; CHECK-NEXT: [[START_MUL_5:%.*]] = mul nuw i8 [[START]], 5
-; CHECK-NEXT: [[T_1:%.*]] = icmp ule i8 [[START_MUL_3]], [[START_MUL_5]]
; CHECK-NEXT: ret i1 true
;
entry:
@@ -280,7 +272,6 @@ define i1 @test_mul_const_nuw_unsigned_13(i8 %start) {
; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START]], [[START_MUL_3]]
; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
; CHECK-NEXT: [[START_MUL_5:%.*]] = mul nuw i8 [[START]], 5
-; CHECK-NEXT: [[F_1:%.*]] = icmp ule i8 [[START_MUL_5]], [[START_MUL_3]]
; CHECK-NEXT: ret i1 false
;
entry:
@@ -424,7 +415,6 @@ define i1 @test_mul_add_const_nuw_unsigned_3(i8 %start, i8 %high) {
; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
; CHECK-NEXT: [[START_ADD_1:%.*]] = add nuw i8 [[START]], [[START]]
; CHECK-NEXT: [[START_ADD_2:%.*]] = add nuw i8 [[START_ADD_1]], [[START_ADD_1]]
-; CHECK-NEXT: [[T_3:%.*]] = icmp ule i8 [[START_ADD_2]], [[START_MUL_4]]
; CHECK-NEXT: ret i1 true
;
entry:
@@ -449,7 +439,6 @@ define i1 @test_mul_add_const_nuw_unsigned_4(i8 %start, i8 %high) {
; CHECK-NEXT: [[START_MUL_2:%.*]] = mul nuw i8 [[START]], 2
; CHECK-NEXT: [[START_ADD_1:%.*]] = add nuw i8 [[START]], [[START]]
; CHECK-NEXT: [[START_ADD_2:%.*]] = add nuw i8 [[START_ADD_1]], [[START_ADD_1]]
-; CHECK-NEXT: [[T_4:%.*]] = icmp ult i8 [[START_ADD_2]], [[START_MUL_4]]
; CHECK-NEXT: ret i1 true
;
entry:
@@ -475,7 +464,6 @@ define i1 @test_mul_add_const_nuw_unsigned_5(i8 %start, i8 %high) {
; CHECK-NEXT: [[START_ADD_1:%.*]] = add nuw i8 [[START]], [[START]]
; CHECK-NEXT: [[START_ADD_2:%.*]] = add nuw i8 [[START_ADD_1]], [[START_ADD_1]]
; CHECK-NEXT: [[START_ADD_2_12:%.*]] = add nuw i8 [[START_ADD_2]], 12
-; CHECK-NEXT: [[T_5:%.*]] = icmp ule i8 [[START_ADD_2_12]], [[START_MUL_4]]
; CHECK-NEXT: ret i1 true
;
entry:
@@ -501,7 +489,6 @@ define i1 @test_mul_add_const_nuw_unsigned_6(i8 %start, i8 %high) {
; CHECK-NEXT: [[START_ADD_1:%.*]] = add nuw i8 [[START]], [[START]]
; CHECK-NEXT: [[START_ADD_2:%.*]] = add nuw i8 [[START_ADD_1]], [[START_ADD_1]]
; CHECK-NEXT: [[START_ADD_2_13:%.*]] = add nuw i8 [[START_ADD_2]], 13
-; CHECK-NEXT: [[F_1:%.*]] = icmp ule i8 [[START_ADD_2_13]], [[START_MUL_4]]
; CHECK-NEXT: ret i1 false
;
entry:
diff --git a/llvm/test/Transforms/ConstraintElimination/ne.ll b/llvm/test/Transforms/ConstraintElimination/ne.ll
index 33fe6b6db6eb4d..566e73dc8d626e 100644
--- a/llvm/test/Transforms/ConstraintElimination/ne.ll
+++ b/llvm/test/Transforms/ConstraintElimination/ne.ll
@@ -9,14 +9,11 @@ define i1 @test_eq_ne_0(i8 %a, i8 %b) {
; CHECK-NEXT: [[CMP:%.*]] = icmp eq i8 [[A:%.*]], 0
; CHECK-NEXT: br i1 [[CMP]], label [[THEN:%.*]], label [[ELSE:%.*]]
; CHECK: then:
-; CHECK-NEXT: [[F_1:%.*]] = icmp ne i8 [[A]], 0
-; CHECK-NEXT: [[C_1:%.*]] = icmp ne i8 [[A]], 1
; CHECK-NEXT: [[C_2:%.*]] = icmp ne i8 [[A]], [[B:%.*]]
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 false, true
; CHECK-NEXT: [[RES_2:%.*]] = xor i1 [[RES_1]], [[C_2]]
; CHECK-NEXT: ret i1 [[RES_2]]
; CHECK: else:
-; CHECK-NEXT: [[T_1:%.*]] = icmp ne i8 [[A]], 0
; CHECK-NEXT: [[C_3:%.*]] = icmp ne i8 [[A]], 1
; CHECK-NEXT: [[C_4:%.*]] = icmp ne i8 [[A]], [[B]]
; CHECK-NEXT: [[RES_3:%.*]] = xor i1 true, [[C_3]]
@@ -50,18 +47,14 @@ define i1 @test_ne_eq_0(i8 %a, i8 %b) {
; CHECK-NEXT: [[CMP:%.*]] = icmp ne i8 [[A:%.*]], 0
; CHECK-NEXT: br i1 [[CMP]], label [[THEN:%.*]], label [[ELSE:%.*]]
; CHECK: then:
-; CHECK-NEXT: [[T_1:%.*]] = icmp ne i8 [[A]], 0
; CHECK-NEXT: [[C_1:%.*]] = icmp ne i8 [[A]], 1
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, [[C_1]]
; CHECK-NEXT: [[C_2:%.*]] = icmp ne i8 [[A]], [[B:%.*]]
; CHECK-NEXT: [[RES_2:%.*]] = xor i1 [[RES_1]], [[C_2]]
; CHECK-NEXT: [[C_3:%.*]] = icmp eq i8 [[A]], [[B]]
; CHECK-NEXT: [[RES_3:%.*]] = xor i1 [[RES_2]], [[C_3]]
-; CHECK-NEXT: [[C_4:%.*]] = icmp eq i8 [[A]], 0
; CHECK-NEXT: [[RES_4:%.*]] = xor i1 [[RES_3]], false
-; CHECK-NEXT: [[T_2:%.*]] = icmp ugt i8 [[A]], 0
; CHECK-NEXT: [[RES_5:%.*]] = xor i1 [[RES_4]], true
-; CHECK-NEXT: [[T_3:%.*]] = icmp uge i8 [[A]], 1
; CHECK-NEXT: [[RES_6:%.*]] = xor i1 [[RES_5]], true
; CHECK-NEXT: [[C_5:%.*]] = icmp ugt i8 [[A]], 1
; CHECK-NEXT: [[RES_7:%.*]] = xor i1 [[RES_6]], [[C_5]]
@@ -69,20 +62,14 @@ define i1 @test_ne_eq_0(i8 %a, i8 %b) {
; CHECK-NEXT: [[RES_8:%.*]] = xor i1 [[RES_7]], [[C_6]]
; CHECK-NEXT: ret i1 [[RES_8]]
; CHECK: else:
-; CHECK-NEXT: [[F_1:%.*]] = icmp ne i8 [[A]], 0
-; CHECK-NEXT: [[C_7:%.*]] = icmp ne i8 [[A]], 1
; CHECK-NEXT: [[RES_9:%.*]] = xor i1 false, true
; CHECK-NEXT: [[C_8:%.*]] = icmp ne i8 [[A]], [[B]]
; CHECK-NEXT: [[RES_10:%.*]] = xor i1 [[RES_9]], [[C_8]]
; CHECK-NEXT: [[C_9:%.*]] = icmp eq i8 [[A]], [[B]]
; CHECK-NEXT: [[RES_11:%.*]] = xor i1 [[RES_10]], [[C_9]]
-; CHECK-NEXT: [[C_10:%.*]] = icmp eq i8 [[A]], 0
; CHECK-NEXT: [[RES_12:%.*]] = xor i1 [[RES_11]], true
-; CHECK-NEXT: [[F_2:%.*]] = icmp ugt i8 [[A]], 0
; CHECK-NEXT: [[RES_13:%.*]] = xor i1 [[RES_12]], false
-; CHECK-NEXT: [[F_3:%.*]] = icmp uge i8 [[A]], 1
; CHECK-NEXT: [[RES_14:%.*]] = xor i1 [[RES_13]], false
-; CHECK-NEXT: [[C_11:%.*]] = icmp ugt i8 [[A]], 1
; CHECK-NEXT: [[RES_15:%.*]] = xor i1 [[RES_14]], false
; CHECK-NEXT: [[C_12:%.*]] = icmp sgt i8 [[A]], 0
; CHECK-NEXT: [[RES_16:%.*]] = xor i1 [[RES_15]], [[C_12]]
@@ -155,8 +142,6 @@ define i1 @test_eq_ne_1(i8 %a, i8 %b) {
; CHECK-NEXT: [[CMP:%.*]] = icmp eq i8 [[A:%.*]], 1
; CHECK-NEXT: br i1 [[CMP]], label [[THEN:%.*]], label [[ELSE:%.*]]
; CHECK: then:
-; CHECK-NEXT: [[F_1:%.*]] = icmp ne i8 [[A]], 0
-; CHECK-NEXT: [[C_1:%.*]] = icmp ne i8 [[A]], 1
; CHECK-NEXT: [[C_2:%.*]] = icmp ne i8 [[A]], [[B:%.*]]
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, false
; CHECK-NEXT: [[RES_2:%.*]] = xor i1 [[RES_1]], [[C_2]]
@@ -215,20 +200,14 @@ define i1 @test_ne_eq_1(i8 %a, i8 %b) {
; CHECK-NEXT: [[RES_8:%.*]] = xor i1 [[RES_7]], [[C_6]]
; CHECK-NEXT: ret i1 [[RES_8]]
; CHECK: else:
-; CHECK-NEXT: [[T_2:%.*]] = icmp ne i8 [[A]], 0
-; CHECK-NEXT: [[C_9:%.*]] = icmp ne i8 [[A]], 1
; CHECK-NEXT: [[RES_9:%.*]] = xor i1 true, false
; CHECK-NEXT: [[C_10:%.*]] = icmp ne i8 [[A]], [[B]]
; CHECK-NEXT: [[RES_10:%.*]] = xor i1 [[RES_9]], [[C_10]]
; CHECK-NEXT: [[C_11:%.*]] = icmp eq i8 [[A]], [[B]]
; CHECK-NEXT: [[RES_11:%.*]] = xor i1 [[RES_10]], [[C_11]]
-; CHECK-NEXT: [[F_1:%.*]] = icmp eq i8 [[A]], 0
; CHECK-NEXT: [[RES_12:%.*]] = xor i1 [[RES_11]], false
-; CHECK-NEXT: [[T_3:%.*]] = icmp ugt i8 [[A]], 0
; CHECK-NEXT: [[RES_13:%.*]] = xor i1 [[RES_12]], true
-; CHECK-NEXT: [[T_4:%.*]] = icmp uge i8 [[A]], 1
; CHECK-NEXT: [[RES_14:%.*]] = xor i1 [[RES_13]], true
-; CHECK-NEXT: [[F_2:%.*]] = icmp ugt i8 [[A]], 1
; CHECK-NEXT: [[RES_15:%.*]] = xor i1 [[RES_14]], false
; CHECK-NEXT: [[C_12:%.*]] = icmp sgt i8 [[A]], 0
; CHECK-NEXT: [[RES_16:%.*]] = xor i1 [[RES_15]], [[C_12]]
@@ -300,7 +279,6 @@ define i1 @assume_b_plus_1_ult_a(i64 %a, i64 %b) {
; CHECK-NEXT: [[TMP1:%.*]] = add nuw i64 [[B:%.*]], 1
; CHECK-NEXT: [[TMP2:%.*]] = icmp ult i64 [[TMP1]], [[A:%.*]]
; CHECK-NEXT: tail call void @llvm.assume(i1 [[TMP2]])
-; CHECK-NEXT: [[TMP3:%.*]] = icmp ne i64 [[A]], [[B]]
; CHECK-NEXT: ret i1 true
;
%1 = add nuw i64 %b, 1
@@ -316,7 +294,6 @@ define i1 @assume_a_gt_b_and_b_ge_c(i64 %a, i64 %b, i64 %c) {
; CHECK-NEXT: tail call void @llvm.assume(i1 [[TMP1]])
; CHECK-NEXT: [[TMP2:%.*]] = icmp uge i64 [[B]], [[C:%.*]]
; CHECK-NEXT: tail call void @llvm.assume(i1 [[TMP2]])
-; CHECK-NEXT: [[TMP3:%.*]] = icmp ne i64 [[A]], [[C]]
; CHECK-NEXT: ret i1 true
;
%1 = icmp ugt i64 %a, %b
diff --git a/llvm/test/Transforms/ConstraintElimination/or.ll b/llvm/test/Transforms/ConstraintElimination/or.ll
index 511aef06ce2f21..4f46f546bd32f3 100644
--- a/llvm/test/Transforms/ConstraintElimination/or.ll
+++ b/llvm/test/Transforms/ConstraintElimination/or.ll
@@ -17,15 +17,11 @@ define void @test_or_ule(i4 %x, i4 %y, i4 %z, i4 %a) {
; CHECK-NEXT: call void @use(i1 [[C_4]])
; CHECK-NEXT: ret void
; CHECK: exit:
-; CHECK-NEXT: [[F_1:%.*]] = icmp ule i4 [[X]], [[Z]]
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[C_5:%.*]] = icmp ule i4 [[X]], [[A]]
; CHECK-NEXT: call void @use(i1 [[C_5]])
-; CHECK-NEXT: [[T_1:%.*]] = icmp ugt i4 [[Y]], [[Z]]
; CHECK-NEXT: call void @use(i1 true)
-; CHECK-NEXT: [[T_2:%.*]] = icmp ugt i4 [[X]], [[Y]]
; CHECK-NEXT: call void @use(i1 true)
-; CHECK-NEXT: [[T_3:%.*]] = icmp ugt i4 [[X]], [[Z]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: ret void
;
@@ -78,15 +74,11 @@ define void @test_or_select_ule(i4 %x, i4 %y, i4 %z, i4 %a) {
; CHECK-NEXT: call void @use(i1 [[C_4]])
; CHECK-NEXT: ret void
; CHECK: exit:
-; CHECK-NEXT: [[F_1:%.*]] = icmp ule i4 [[X]], [[Z]]
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[C_5:%.*]] = icmp ule i4 [[X]], [[A]]
; CHECK-NEXT: call void @use(i1 [[C_5]])
-; CHECK-NEXT: [[T_1:%.*]] = icmp ugt i4 [[Y]], [[Z]]
; CHECK-NEXT: call void @use(i1 true)
-; CHECK-NEXT: [[T_2:%.*]] = icmp ugt i4 [[X]], [[Y]]
; CHECK-NEXT: call void @use(i1 true)
-; CHECK-NEXT: [[T_3:%.*]] = icmp ugt i4 [[X]], [[Z]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: ret void
;
@@ -143,16 +135,10 @@ define i1 @test_or_chain_ule_1(i4 %x, i4 %y, i4 %z, i4 %a, i4 %b) {
; CHECK-NEXT: [[RES_2:%.*]] = xor i1 [[RES_1]], [[C_7]]
; CHECK-NEXT: ret i1 [[RES_2]]
; CHECK: exit:
-; CHECK-NEXT: [[F_1:%.*]] = icmp ule i4 [[X]], [[Z]]
-; CHECK-NEXT: [[F_2:%.*]] = icmp ule i4 2, [[X]]
; CHECK-NEXT: [[RES_3:%.*]] = xor i1 false, false
-; CHECK-NEXT: [[T_1:%.*]] = icmp ugt i4 [[Y]], [[Z]]
; CHECK-NEXT: [[RES_4:%.*]] = xor i1 [[RES_3]], true
-; CHECK-NEXT: [[T_2:%.*]] = icmp ugt i4 [[X]], [[Y]]
; CHECK-NEXT: [[RES_5:%.*]] = xor i1 [[RES_4]], true
-; CHECK-NEXT: [[T_3:%.*]] = icmp ugt i4 [[X]], [[Z]]
; CHECK-NEXT: [[RES_6:%.*]] = xor i1 [[RES_5]], true
-; CHECK-NEXT: [[T_4:%.*]] = icmp ugt i4 2, [[A]]
; CHECK-NEXT: [[RES_7:%.*]] = xor i1 [[RES_6]], true
; CHECK-NEXT: [[C_8:%.*]] = icmp ule i4 [[X]], [[A]]
; CHECK-NEXT: [[RES_8:%.*]] = xor i1 [[RES_7]], [[C_8]]
@@ -224,16 +210,10 @@ define i1 @test_or_chain_ule_2(i4 %x, i4 %y, i4 %z, i4 %a, i4 %b) {
; CHECK-NEXT: [[RES_2:%.*]] = xor i1 [[RES_1]], [[C_7]]
; CHECK-NEXT: ret i1 [[RES_2]]
; CHECK: exit:
-; CHECK-NEXT: [[F_1:%.*]] = icmp ule i4 [[X]], [[Z]]
-; CHECK-NEXT: [[F_2:%.*]] = icmp ule i4 2, [[X]]
; CHECK-NEXT: [[RES_3:%.*]] = xor i1 false, false
-; CHECK-NEXT: [[T_1:%.*]] = icmp ugt i4 [[Y]], [[Z]]
; CHECK-NEXT: [[RES_4:%.*]] = xor i1 [[RES_3]], true
-; CHECK-NEXT: [[T_2:%.*]] = icmp ugt i4 [[X]], [[Y]]
; CHECK-NEXT: [[RES_5:%.*]] = xor i1 [[RES_4]], true
-; CHECK-NEXT: [[T_3:%.*]] = icmp ugt i4 [[X]], [[Z]]
; CHECK-NEXT: [[RES_6:%.*]] = xor i1 [[RES_5]], true
-; CHECK-NEXT: [[T_4:%.*]] = icmp ugt i4 2, [[A]]
; CHECK-NEXT: [[RES_7:%.*]] = xor i1 [[RES_6]], true
; CHECK-NEXT: [[C_8:%.*]] = icmp ule i4 [[X]], [[A]]
; CHECK-NEXT: [[RES_8:%.*]] = xor i1 [[RES_7]], [[C_8]]
@@ -306,12 +286,8 @@ define i1 @test_or_chain_with_other_conds_ule(i4 %x, i4 %y, i4 %z, i4 %a, i1 %ar
; CHECK-NEXT: [[RES_2:%.*]] = xor i1 [[RES_1]], [[C_7]]
; CHECK-NEXT: ret i1 [[RES_2]]
; CHECK: exit:
-; CHECK-NEXT: [[F_1:%.*]] = icmp ule i4 [[X]], [[Z]]
-; CHECK-NEXT: [[T_1:%.*]] = icmp ugt i4 [[Y]], [[Z]]
; CHECK-NEXT: [[RES_3:%.*]] = xor i1 false, true
-; CHECK-NEXT: [[T_2:%.*]] = icmp ugt i4 [[X]], [[Y]]
; CHECK-NEXT: [[RES_4:%.*]] = xor i1 [[RES_3]], true
-; CHECK-NEXT: [[T_3:%.*]] = icmp ugt i4 [[X]], [[Z]]
; CHECK-NEXT: [[RES_5:%.*]] = xor i1 [[RES_4]], true
; CHECK-NEXT: [[C_8:%.*]] = icmp ule i4 [[X]], [[A]]
; CHECK-NEXT: [[RES_6:%.*]] = xor i1 [[RES_5]], [[C_8]]
@@ -371,12 +347,8 @@ define i1 @test_or_chain_with_and_ule(i4 %x, i4 %y, i4 %z, i4 %a, i4 %b) {
; CHECK-NEXT: [[RES_2:%.*]] = xor i1 [[RES_1]], [[C_7]]
; CHECK-NEXT: ret i1 [[RES_2]]
; CHECK: exit:
-; CHECK-NEXT: [[F_1:%.*]] = icmp ule i4 [[X]], [[Z]]
-; CHECK-NEXT: [[T_1:%.*]] = icmp ugt i4 [[Y]], [[Z]]
; CHECK-NEXT: [[RES_3:%.*]] = xor i1 false, true
-; CHECK-NEXT: [[T_2:%.*]] = icmp ugt i4 [[X]], [[Y]]
; CHECK-NEXT: [[RES_4:%.*]] = xor i1 [[RES_3]], true
-; CHECK-NEXT: [[T_3:%.*]] = icmp ugt i4 [[X]], [[Z]]
; CHECK-NEXT: [[RES_5:%.*]] = xor i1 [[RES_4]], true
; CHECK-NEXT: [[C_8:%.*]] = icmp ule i4 [[X]], [[A]]
; CHECK-NEXT: [[RES_6:%.*]] = xor i1 [[RES_5]], [[C_8]]
@@ -450,16 +422,12 @@ define void @test_or_as_add_ult(i8 %init_val, i8 %high) {
; CHECK-NEXT: call void @use(i1 [[F_2]])
; CHECK-NEXT: ret void
; CHECK: end:
-; CHECK-NEXT: [[T_0:%.*]] = icmp ult i8 [[START]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_1:%.*]] = or i8 [[START]], 1
-; CHECK-NEXT: [[T_1:%.*]] = icmp ult i8 [[START_1]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_2:%.*]] = or i8 [[START]], 2
-; CHECK-NEXT: [[T_2:%.*]] = icmp ult i8 [[START_2]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_3:%.*]] = or i8 [[START]], 3
-; CHECK-NEXT: [[T_3:%.*]] = icmp ult i8 [[START_3]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_4:%.*]] = or i8 [[START]], 4
; CHECK-NEXT: [[C_4:%.*]] = icmp ult i8 [[START_4]], [[HIGH]]
@@ -519,16 +487,12 @@ define void @test_or_as_add_ule(i8 %init_val, i8 %high) {
; CHECK-NEXT: call void @use(i1 [[F_2]])
; CHECK-NEXT: ret void
; CHECK: end:
-; CHECK-NEXT: [[T_0:%.*]] = icmp ule i8 [[START]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_1:%.*]] = or i8 [[START]], 1
-; CHECK-NEXT: [[T_1:%.*]] = icmp ule i8 [[START_1]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_2:%.*]] = or i8 [[START]], 2
-; CHECK-NEXT: [[T_2:%.*]] = icmp ule i8 [[START_2]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_3:%.*]] = or i8 [[START]], 3
-; CHECK-NEXT: [[T_3:%.*]] = icmp ule i8 [[START_3]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_4:%.*]] = or i8 [[START]], 4
; CHECK-NEXT: [[T_4:%.*]] = icmp ule i8 [[START_4]], [[HIGH]]
@@ -595,16 +559,12 @@ define void @test_or_as_add_ugt(i8 %init_val, i8 %high) {
; CHECK-NEXT: call void @use(i1 [[T_2]])
; CHECK-NEXT: ret void
; CHECK: end:
-; CHECK-NEXT: [[F_0:%.*]] = icmp ugt i8 [[START]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[START_1:%.*]] = or i8 [[START]], 1
-; CHECK-NEXT: [[F_1:%.*]] = icmp ugt i8 [[START_1]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[START_2:%.*]] = or i8 [[START]], 2
-; CHECK-NEXT: [[F_2:%.*]] = icmp ugt i8 [[START_2]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[START_3:%.*]] = or i8 [[START]], 3
-; CHECK-NEXT: [[F_3:%.*]] = icmp ugt i8 [[START_3]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[START_4:%.*]] = or i8 [[START]], 4
; CHECK-NEXT: [[F_4:%.*]] = icmp ugt i8 [[START_4]], [[HIGH]]
@@ -670,16 +630,12 @@ define void @test_or_as_add_uge(i8 %init_val, i8 %high) {
; CHECK-NEXT: call void @use(i1 [[T_2]])
; CHECK-NEXT: ret void
; CHECK: end:
-; CHECK-NEXT: [[F_0:%.*]] = icmp ugt i8 [[START]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[START_1:%.*]] = or i8 [[START]], 1
-; CHECK-NEXT: [[F_1:%.*]] = icmp uge i8 [[START_1]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[START_2:%.*]] = or i8 [[START]], 2
-; CHECK-NEXT: [[F_2:%.*]] = icmp uge i8 [[START_2]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[START_3:%.*]] = or i8 [[START]], 3
-; CHECK-NEXT: [[F_3:%.*]] = icmp uge i8 [[START_3]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[START_4:%.*]] = or i8 [[START]], 4
; CHECK-NEXT: [[C_4:%.*]] = icmp uge i8 [[START_4]], [[HIGH]]
diff --git a/llvm/test/Transforms/ConstraintElimination/pointercast.ll b/llvm/test/Transforms/ConstraintElimination/pointercast.ll
index 1e01c2a30b8912..75130269ed2ab1 100644
--- a/llvm/test/Transforms/ConstraintElimination/pointercast.ll
+++ b/llvm/test/Transforms/ConstraintElimination/pointercast.ll
@@ -15,19 +15,13 @@ define i1 @gep0_and_cmp(ptr readonly %src, ptr readnone %min, ptr readnone %max)
; CHECK: trap:
; CHECK-NEXT: ret i1 false
; CHECK: checks:
-; CHECK-NEXT: [[C_3_MIN:%.*]] = icmp ult ptr [[GEP_3]], [[MIN]]
; CHECK-NEXT: [[C_3_MAX:%.*]] = icmp ult ptr [[GEP_3]], [[MAX]]
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 false, [[C_3_MAX]]
; CHECK-NEXT: [[GEP_1:%.*]] = getelementptr inbounds i32, ptr [[SRC]], i64 1
-; CHECK-NEXT: [[C_1_MIN:%.*]] = icmp ult ptr [[GEP_1]], [[MIN]]
-; CHECK-NEXT: [[C_1_MAX:%.*]] = icmp ult ptr [[GEP_1]], [[MAX]]
; CHECK-NEXT: [[RES_2:%.*]] = xor i1 false, true
; CHECK-NEXT: [[GEP_2:%.*]] = getelementptr inbounds i32, ptr [[SRC]], i64 2
-; CHECK-NEXT: [[C_2_MIN:%.*]] = icmp ult ptr [[GEP_2]], [[MIN]]
-; CHECK-NEXT: [[C_2_MAX:%.*]] = icmp ult ptr [[GEP_2]], [[MAX]]
; CHECK-NEXT: [[RES_3:%.*]] = xor i1 false, true
; CHECK-NEXT: [[GEP_4:%.*]] = getelementptr inbounds i32, ptr [[SRC]], i64 4
-; CHECK-NEXT: [[C_4_MIN:%.*]] = icmp ult ptr [[GEP_4]], [[MIN]]
; CHECK-NEXT: [[C_4_MAX:%.*]] = icmp ult ptr [[GEP_4]], [[MAX]]
; CHECK-NEXT: [[RES_4:%.*]] = xor i1 false, [[C_4_MAX]]
; CHECK-NEXT: [[RES_5:%.*]] = xor i1 [[RES_1]], [[RES_2]]
diff --git a/llvm/test/Transforms/ConstraintElimination/range_checks.ll b/llvm/test/Transforms/ConstraintElimination/range_checks.ll
index dcda0e7696ee59..fc3b46b180b4a4 100644
--- a/llvm/test/Transforms/ConstraintElimination/range_checks.ll
+++ b/llvm/test/Transforms/ConstraintElimination/range_checks.ll
@@ -17,7 +17,6 @@ define i32 @test_01(ptr %p, ptr %array, i32 %min_length) {
; CHECK-NEXT: [[IN_BOUNDS:%.*]] = icmp ult i32 [[IDX]], [[MIN_LENGTH:%.*]]
; CHECK-NEXT: br i1 [[IN_BOUNDS]], label [[RANGE_CHECK_BLOCK:%.*]], label [[OUT_OF_BOUNDS:%.*]]
; CHECK: range_check_block:
-; CHECK-NEXT: [[RANGE_CHECK:%.*]] = icmp ult i32 [[IDX]], [[MIN_LENGTH]]
; CHECK-NEXT: br i1 true, label [[BACKEDGE]], label [[RANGE_CHECK_FAILED:%.*]]
; CHECK: backedge:
; CHECK-NEXT: [[ARR_PTR:%.*]] = getelementptr i32, ptr [[ARRAY:%.*]], i32 [[IDX]]
@@ -81,7 +80,6 @@ define i32 @test_02(ptr %p, ptr %array, i32 %length, i32 %min_length) {
; CHECK-NEXT: [[IN_BOUNDS:%.*]] = icmp ult i32 [[IDX]], [[MIN_LENGTH]]
; CHECK-NEXT: br i1 [[IN_BOUNDS]], label [[RANGE_CHECK_BLOCK:%.*]], label [[OUT_OF_BOUNDS:%.*]]
; CHECK: range_check_block:
-; CHECK-NEXT: [[RANGE_CHECK:%.*]] = icmp ult i32 [[IDX]], [[LENGTH]]
; CHECK-NEXT: br i1 true, label [[BACKEDGE]], label [[RANGE_CHECK_FAILED:%.*]]
; CHECK: backedge:
; CHECK-NEXT: [[ARR_PTR:%.*]] = getelementptr i32, ptr [[ARRAY:%.*]], i32 [[IDX]]
diff --git a/llvm/test/Transforms/ConstraintElimination/sge.ll b/llvm/test/Transforms/ConstraintElimination/sge.ll
index d3ffa2ac69046d..d02006b9cd28ff 100644
--- a/llvm/test/Transforms/ConstraintElimination/sge.ll
+++ b/llvm/test/Transforms/ConstraintElimination/sge.ll
@@ -9,7 +9,6 @@ define void @test_1_variable_constraint(i32 %x, i32 %y, i32 %z) {
; CHECK-NEXT: [[C_1:%.*]] = icmp sge i32 [[X:%.*]], [[Y:%.*]]
; CHECK-NEXT: br i1 [[C_1]], label [[BB1:%.*]], label [[BB2:%.*]]
; CHECK: bb1:
-; CHECK-NEXT: [[T_1:%.*]] = icmp sge i32 [[X]], [[Y]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[C_2:%.*]] = icmp sge i32 [[X]], 10
; CHECK-NEXT: call void @use(i1 [[C_2]])
@@ -19,9 +18,7 @@ define void @test_1_variable_constraint(i32 %x, i32 %y, i32 %z) {
; CHECK-NEXT: call void @use(i1 [[C_4]])
; CHECK-NEXT: ret void
; CHECK: bb2:
-; CHECK-NEXT: [[T_2:%.*]] = icmp sge i32 [[Y]], [[X]]
; CHECK-NEXT: call void @use(i1 true)
-; CHECK-NEXT: [[F_1:%.*]] = icmp sge i32 [[X]], [[Y]]
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[C_5:%.*]] = icmp sge i32 [[X]], 10
; CHECK-NEXT: call void @use(i1 [[C_5]])
@@ -62,9 +59,7 @@ define void @test_1_constant_constraint(i32 %x) {
; CHECK-NEXT: [[C_1:%.*]] = icmp sge i32 [[X:%.*]], 10
; CHECK-NEXT: br i1 [[C_1]], label [[BB1:%.*]], label [[BB2:%.*]]
; CHECK: bb1:
-; CHECK-NEXT: [[T_1:%.*]] = icmp sge i32 [[X]], 10
; CHECK-NEXT: call void @use(i1 true)
-; CHECK-NEXT: [[T_2:%.*]] = icmp sge i32 [[X]], 9
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[C_2:%.*]] = icmp sge i32 [[X]], 11
; CHECK-NEXT: call void @use(i1 [[C_2]])
@@ -72,11 +67,8 @@ define void @test_1_constant_constraint(i32 %x) {
; CHECK-NEXT: call void @use(i1 [[C_4]])
; CHECK-NEXT: ret void
; CHECK: bb2:
-; CHECK-NEXT: [[T_3:%.*]] = icmp sge i32 11, [[X]]
; CHECK-NEXT: call void @use(i1 true)
-; CHECK-NEXT: [[F_1:%.*]] = icmp sge i32 [[X]], 10
; CHECK-NEXT: call void @use(i1 false)
-; CHECK-NEXT: [[F_1_1:%.*]] = icmp sge i32 [[X]], 10
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[C_5:%.*]] = icmp sge i32 [[X]], 9
; CHECK-NEXT: call void @use(i1 [[C_5]])
@@ -124,7 +116,6 @@ define i32 @test1(i32 %x, i32 %y, i32 %z) {
; CHECK-NEXT: [[C_2:%.*]] = icmp sge i32 [[Y]], [[Z:%.*]]
; CHECK-NEXT: br i1 [[C_2]], label [[BB2:%.*]], label [[EXIT]]
; CHECK: bb2:
-; CHECK-NEXT: [[C_3:%.*]] = icmp sge i32 [[X]], [[Z]]
; CHECK-NEXT: br i1 true, label [[BB3:%.*]], label [[EXIT]]
; CHECK: bb3:
; CHECK-NEXT: ret i32 10
@@ -223,7 +214,6 @@ define i32 @test4(i32 %x, i32 %y, i32 %z) {
; CHECK-NEXT: [[C_2:%.*]] = icmp sge i32 [[Y]], [[Z:%.*]]
; CHECK-NEXT: br i1 [[C_2]], label [[BB2:%.*]], label [[EXIT]]
; CHECK: bb2:
-; CHECK-NEXT: [[T_1:%.*]] = icmp sge i32 [[X]], [[Z]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[U_1:%.*]] = icmp eq i32 [[X]], [[Z]]
; CHECK-NEXT: call void @use(i1 [[U_1]])
@@ -257,10 +247,8 @@ define i1 @sge_sgt(i32 %x, i32 %y, i32 %z) {
; CHECK-NEXT: [[C_1:%.*]] = icmp sgt i32 [[X:%.*]], -1
; CHECK-NEXT: br i1 [[C_1]], label [[THEN:%.*]], label [[ELSE:%.*]]
; CHECK: then:
-; CHECK-NEXT: [[T_1:%.*]] = icmp sge i32 [[X]], 0
; CHECK-NEXT: ret i1 true
; CHECK: else:
-; CHECK-NEXT: [[F_1:%.*]] = icmp sge i32 [[X]], 0
; CHECK-NEXT: ret i1 false
;
entry:
diff --git a/llvm/test/Transforms/ConstraintElimination/shl.ll b/llvm/test/Transforms/ConstraintElimination/shl.ll
index 6d196f77da1c9b..982e0e74583335 100644
--- a/llvm/test/Transforms/ConstraintElimination/shl.ll
+++ b/llvm/test/Transforms/ConstraintElimination/shl.ll
@@ -219,7 +219,6 @@ define i1 @test_shl_const_nuw_unsigned_10(i8 %start, i8 %high) {
; CHECK-NEXT: [[C_0:%.*]] = icmp ult i8 [[START]], [[START_SHL_5]]
; CHECK-NEXT: call void @llvm.assume(i1 [[C_0]])
; CHECK-NEXT: [[START_SHL_3:%.*]] = shl nuw i8 [[START]], 3
-; CHECK-NEXT: [[T_1:%.*]] = icmp ule i8 [[START_SHL_3]], [[START_SHL_5]]
; CHECK-NEXT: ret i1 true
;
entry:
@@ -239,7 +238,6 @@ define i1 @test_shl_const_nuw_unsigned_11(i8 %start, i8 %high) {
; CHECK-NEXT: [[C_0:%.*]] = icmp ult i8 [[START]], [[START_SHL_5]]
; CHECK-NEXT: call void @llvm.assume(i1 [[C_0]])
; CHECK-NEXT: [[START_SHL_3:%.*]] = shl nuw i8 [[START]], 3
-; CHECK-NEXT: [[C_1:%.*]] = icmp ule i8 [[START_SHL_5]], [[START_SHL_3]]
; CHECK-NEXT: ret i1 false
;
entry:
@@ -259,7 +257,6 @@ define i1 @test_shl_const_nuw_unsigned_12(i8 %start) {
; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[START]], [[START_SHL_3]]
; CHECK-NEXT: call void @llvm.assume(i1 [[C_1]])
; CHECK-NEXT: [[START_SHL_5:%.*]] = shl nuw i8 [[START]], 5
-; CHECK-NEXT: [[T_1:%.*]] = icmp ule i8 [[START_SHL_3]], [[START_SHL_5]]
; CHECK-NEXT: ret i1 true
;
entry:
@@ -1280,7 +1277,6 @@ define i1 @shl_55() {
; CHECK-LABEL: @shl_55(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[SHL_UB:%.*]] = shl nuw nsw i256 1, 55
-; CHECK-NEXT: [[SHL_CMP:%.*]] = icmp uge i256 [[SHL_UB]], 1
; CHECK-NEXT: ret i1 true
;
entry:
diff --git a/llvm/test/Transforms/ConstraintElimination/signed-query-unsigned-system.ll b/llvm/test/Transforms/ConstraintElimination/signed-query-unsigned-system.ll
index 104002886bfae6..f5f7cc222f5a82 100644
--- a/llvm/test/Transforms/ConstraintElimination/signed-query-unsigned-system.ll
+++ b/llvm/test/Transforms/ConstraintElimination/signed-query-unsigned-system.ll
@@ -8,7 +8,6 @@ define i1 @sge_0_unsigned_a_ne_0(i8 %a) {
; CHECK-NEXT: [[A_NE_0:%.*]] = icmp ne i8 [[A:%.*]], 0
; CHECK-NEXT: call void @llvm.assume(i1 [[A_NE_0]])
; CHECK-NEXT: [[EXT:%.*]] = zext i8 [[A]] to i16
-; CHECK-NEXT: [[T:%.*]] = icmp sge i16 [[EXT]], 0
; CHECK-NEXT: ret i1 true
;
%a.ne.0 = icmp ne i8 %a, 0
@@ -23,7 +22,6 @@ define i1 @sgt_0_unsigned_a_ne_0(i8 %a) {
; CHECK-NEXT: [[A_NE_0:%.*]] = icmp ne i8 [[A:%.*]], 0
; CHECK-NEXT: call void @llvm.assume(i1 [[A_NE_0]])
; CHECK-NEXT: [[EXT:%.*]] = zext i8 [[A]] to i16
-; CHECK-NEXT: [[T:%.*]] = icmp sgt i16 [[EXT]], 0
; CHECK-NEXT: ret i1 true
;
%a.ne.0 = icmp ne i8 %a, 0
@@ -38,7 +36,6 @@ define i1 @sgt_0_unsigned_a_sgt_0(i8 %a) {
; CHECK-NEXT: [[A_SGT_0:%.*]] = icmp sgt i8 [[A:%.*]], 0
; CHECK-NEXT: call void @llvm.assume(i1 [[A_SGT_0]])
; CHECK-NEXT: [[EXT:%.*]] = zext i8 [[A]] to i16
-; CHECK-NEXT: [[T:%.*]] = icmp sgt i16 [[EXT]], 0
; CHECK-NEXT: ret i1 true
;
%a.sgt.0 = icmp sgt i8 %a, 0
@@ -53,7 +50,6 @@ define i1 @sge_0_unsigned_a_sge_0(i8 %a) {
; CHECK-NEXT: [[A_SGE_0:%.*]] = icmp sge i8 [[A:%.*]], 0
; CHECK-NEXT: call void @llvm.assume(i1 [[A_SGE_0]])
; CHECK-NEXT: [[EXT:%.*]] = zext i8 [[A]] to i16
-; CHECK-NEXT: [[T:%.*]] = icmp sge i16 [[EXT]], 0
; CHECK-NEXT: ret i1 true
;
%a.sge.0 = icmp sge i8 %a, 0
@@ -68,7 +64,6 @@ define i1 @sgt_0_unsigned_a_ugt_0(i8 %a) {
; CHECK-NEXT: [[A_UGT_0:%.*]] = icmp ugt i8 [[A:%.*]], 0
; CHECK-NEXT: call void @llvm.assume(i1 [[A_UGT_0]])
; CHECK-NEXT: [[EXT:%.*]] = zext i8 [[A]] to i16
-; CHECK-NEXT: [[T:%.*]] = icmp sgt i16 [[EXT]], 0
; CHECK-NEXT: ret i1 true
;
%a.ugt.0 = icmp ugt i8 %a, 0
@@ -98,7 +93,6 @@ define i1 @sgt_1_unsigned_a_ugt_1(i8 %a) {
; CHECK-NEXT: [[A_UGT_1:%.*]] = icmp ugt i8 [[A:%.*]], 1
; CHECK-NEXT: call void @llvm.assume(i1 [[A_UGT_1]])
; CHECK-NEXT: [[EXT:%.*]] = zext i8 [[A]] to i16
-; CHECK-NEXT: [[T:%.*]] = icmp sgt i16 [[EXT]], 1
; CHECK-NEXT: ret i1 true
;
%a.ugt.1 = icmp ugt i8 %a, 1
@@ -133,7 +127,6 @@ define i1 @sgt_0_unsigned_a_ugt_neg_10(i8 %a) {
; CHECK-NEXT: [[A_UGT_0:%.*]] = icmp ugt i8 [[A:%.*]], 10
; CHECK-NEXT: call void @llvm.assume(i1 [[A_UGT_0]])
; CHECK-NEXT: [[EXT:%.*]] = zext i8 [[A]] to i16
-; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i16 [[EXT]], 0
; CHECK-NEXT: ret i1 true
;
%a.ugt.0 = icmp ugt i8 %a, 10
@@ -148,7 +141,6 @@ define i1 @sge_neg_1_sge_0_known(i8 %a) {
; CHECK-NEXT: [[EXT:%.*]] = zext i8 [[A:%.*]] to i16
; CHECK-NEXT: [[A_NE_0:%.*]] = icmp sge i16 [[EXT]], 0
; CHECK-NEXT: call void @llvm.assume(i1 [[A_NE_0]])
-; CHECK-NEXT: [[T:%.*]] = icmp sge i16 [[EXT]], -1
; CHECK-NEXT: ret i1 true
;
%ext = zext i8 %a to i16
diff --git a/llvm/test/Transforms/ConstraintElimination/sub-nuw.ll b/llvm/test/Transforms/ConstraintElimination/sub-nuw.ll
index 3a9c04939307fb..30051080178e18 100644
--- a/llvm/test/Transforms/ConstraintElimination/sub-nuw.ll
+++ b/llvm/test/Transforms/ConstraintElimination/sub-nuw.ll
@@ -19,10 +19,8 @@ define void @test.not.uge.ult(i8 %start, i8 %low, i8 %high) {
; CHECK-NEXT: [[T_2:%.*]] = icmp ult i8 [[START_2]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 [[T_2]])
; CHECK-NEXT: [[START_3:%.*]] = sub nuw i8 [[START]], 3
-; CHECK-NEXT: [[T_3:%.*]] = icmp ult i8 [[START_3]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_4:%.*]] = sub nuw i8 [[START]], 4
-; CHECK-NEXT: [[C_4:%.*]] = icmp ult i8 [[START_4]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: ret void
;
@@ -67,16 +65,12 @@ define void @test.not.uge.ule(i8 %start, i8 %low, i8 %high) {
; CHECK-NEXT: [[T_1:%.*]] = icmp ule i8 [[START_1]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 [[T_1]])
; CHECK-NEXT: [[START_2:%.*]] = sub nuw i8 [[START]], 2
-; CHECK-NEXT: [[T_2:%.*]] = icmp ule i8 [[START_2]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_3:%.*]] = sub nuw i8 [[START]], 3
-; CHECK-NEXT: [[T_3:%.*]] = icmp ule i8 [[START_3]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_4:%.*]] = sub nuw i8 [[START]], 4
-; CHECK-NEXT: [[T_4:%.*]] = icmp ule i8 [[START_4]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[START_5:%.*]] = sub nuw i8 [[START]], 5
-; CHECK-NEXT: [[C_5:%.*]] = icmp ule i8 [[START_5]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: ret void
;
@@ -126,16 +120,12 @@ define void @test.not.uge.ugt(i8 %start, i8 %low, i8 %high) {
; CHECK-NEXT: [[F_1:%.*]] = icmp ugt i8 [[START_1]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 [[F_1]])
; CHECK-NEXT: [[START_2:%.*]] = sub nuw i8 [[START]], 2
-; CHECK-NEXT: [[F_2:%.*]] = icmp ugt i8 [[START_2]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[START_3:%.*]] = sub nuw i8 [[START]], 3
-; CHECK-NEXT: [[F_3:%.*]] = icmp ugt i8 [[START_3]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[START_4:%.*]] = sub nuw i8 [[START]], 4
-; CHECK-NEXT: [[F_4:%.*]] = icmp ugt i8 [[START_4]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[START_5:%.*]] = sub nuw i8 [[START]], 5
-; CHECK-NEXT: [[C_5:%.*]] = icmp ugt i8 [[START_5]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: ret void
;
@@ -192,13 +182,10 @@ define void @test.not.uge.uge(i8 %start, i8 %low, i8 %high) {
; CHECK-NEXT: [[F_2:%.*]] = icmp uge i8 [[START_2]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 [[F_2]])
; CHECK-NEXT: [[START_3:%.*]] = sub nuw i8 [[START]], 3
-; CHECK-NEXT: [[F_3:%.*]] = icmp uge i8 [[START_3]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[START_4:%.*]] = sub nuw i8 [[START]], 4
-; CHECK-NEXT: [[C_4:%.*]] = icmp uge i8 [[START_4]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[START_5:%.*]] = sub nuw i8 [[START]], 5
-; CHECK-NEXT: [[C_5:%.*]] = icmp uge i8 [[START_5]], [[HIGH]]
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: ret void
;
@@ -283,7 +270,6 @@ define i1 @sub_nuw_i16_simp(i16 %a) {
; CHECK-NEXT: [[C_2:%.*]] = icmp ugt i16 [[A]], 0
; CHECK-NEXT: ret i1 [[C_2]]
; CHECK: exit.2:
-; CHECK-NEXT: [[C_3:%.*]] = icmp ugt i16 [[A]], 0
; CHECK-NEXT: ret i1 true
;
entry:
@@ -310,7 +296,6 @@ define i1 @sub_nuw_i64_simp(i64 %a) {
; CHECK-NEXT: [[C_2:%.*]] = icmp ugt i64 [[A]], 0
; CHECK-NEXT: ret i1 [[C_2]]
; CHECK: exit.2:
-; CHECK-NEXT: [[C_3:%.*]] = icmp ugt i64 [[A]], 0
; CHECK-NEXT: ret i1 true
;
entry:
@@ -334,7 +319,6 @@ define i1 @sub_nuw_neg_i16(i16 %a) {
; CHECK-NEXT: [[C_1:%.*]] = icmp ugt i16 0, [[NEG2]]
; CHECK-NEXT: br i1 [[C_1]], label [[EXIT_1:%.*]], label [[EXIT_2:%.*]]
; CHECK: exit.1:
-; CHECK-NEXT: [[C_2:%.*]] = icmp ugt i16 [[A]], 0
; CHECK-NEXT: ret i1 false
; CHECK: exit.2:
; CHECK-NEXT: [[C_3:%.*]] = icmp ugt i16 [[A]], 0
diff --git a/llvm/test/Transforms/ConstraintElimination/switch.ll b/llvm/test/Transforms/ConstraintElimination/switch.ll
index 632a0ba4764385..a102979c498e01 100644
--- a/llvm/test/Transforms/ConstraintElimination/switch.ll
+++ b/llvm/test/Transforms/ConstraintElimination/switch.ll
@@ -13,12 +13,10 @@ define i1 @test_switch_in_block_with_assume(i32 %x) {
; CHECK-NEXT: i32 1, label [[EXIT_2:%.*]]
; CHECK-NEXT: ]
; CHECK: exit.1:
-; CHECK-NEXT: [[T_1:%.*]] = icmp ult i32 [[X]], 10
; CHECK-NEXT: [[C_2:%.*]] = icmp ult i32 [[X]], 9
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, [[C_2]]
; CHECK-NEXT: ret i1 [[RES_1]]
; CHECK: exit.2:
-; CHECK-NEXT: [[T_2:%.*]] = icmp ult i32 [[X]], 10
; CHECK-NEXT: [[C_3:%.*]] = icmp ult i32 [[X]], 9
; CHECK-NEXT: [[RES_2:%.*]] = xor i1 true, [[C_3]]
; CHECK-NEXT: ret i1 [[RES_2]]
diff --git a/llvm/test/Transforms/ConstraintElimination/transfer-signed-facts-to-unsigned.ll b/llvm/test/Transforms/ConstraintElimination/transfer-signed-facts-to-unsigned.ll
index a2d40ab26c554d..9a0f24c8adcc57 100644
--- a/llvm/test/Transforms/ConstraintElimination/transfer-signed-facts-to-unsigned.ll
+++ b/llvm/test/Transforms/ConstraintElimination/transfer-signed-facts-to-unsigned.ll
@@ -9,8 +9,6 @@ define i1 @len_known_positive_via_idx_1(i8 %len, i8 %idx) {
; CHECK-NEXT: [[AND_1:%.*]] = and i1 [[IDX_POS]], [[IDX_SLT_LEN]]
; CHECK-NEXT: br i1 [[AND_1]], label [[THEN_1:%.*]], label [[ELSE:%.*]]
; CHECK: then.1:
-; CHECK-NEXT: [[T_1:%.*]] = icmp ult i8 [[IDX]], [[LEN]]
-; CHECK-NEXT: [[T_2:%.*]] = icmp sge i8 [[LEN]], 0
; CHECK-NEXT: [[C_1:%.*]] = icmp sge i8 [[LEN]], 2
; CHECK-NEXT: [[C_2:%.*]] = icmp sge i8 [[LEN]], 2
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, true
@@ -48,8 +46,6 @@ define i1 @len_known_positive_via_idx_2(i8 %len, i8 %idx) {
; CHECK-NEXT: [[AND_1:%.*]] = and i1 [[IDX_SLT_LEN]], [[IDX_POS]]
; CHECK-NEXT: br i1 [[AND_1]], label [[THEN_1:%.*]], label [[ELSE:%.*]]
; CHECK: then.1:
-; CHECK-NEXT: [[T_1:%.*]] = icmp ult i8 [[IDX]], [[LEN]]
-; CHECK-NEXT: [[T_2:%.*]] = icmp sge i8 [[LEN]], 0
; CHECK-NEXT: [[C_1:%.*]] = icmp sge i8 [[LEN]], 2
; CHECK-NEXT: [[C_2:%.*]] = icmp sge i8 [[LEN]], 2
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, true
@@ -162,7 +158,6 @@ define i1 @cnt_positive_sgt_against_base(ptr %p, i32 %cnt) {
; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i32 [[CNT:%.*]], -1
; CHECK-NEXT: tail call void @llvm.assume(i1 [[CMP]])
; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i32, ptr [[P:%.*]], i32 [[CNT]]
-; CHECK-NEXT: [[CMP_1:%.*]] = icmp uge ptr [[ADD_PTR]], [[P]]
; CHECK-NEXT: br i1 true, label [[THEN:%.*]], label [[ELSE:%.*]]
; CHECK: then:
; CHECK-NEXT: ret i1 false
@@ -244,7 +239,6 @@ define i1 @cnt_positive_sgt_against_base_with_zext(ptr %p, i32 %cnt) {
; CHECK-NEXT: tail call void @llvm.assume(i1 [[CMP]])
; CHECK-NEXT: [[EXT:%.*]] = zext i32 [[CNT]] to i64
; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i32, ptr [[P:%.*]], i64 [[EXT]]
-; CHECK-NEXT: [[CMP_1:%.*]] = icmp uge ptr [[ADD_PTR]], [[P]]
; CHECK-NEXT: br i1 true, label [[THEN:%.*]], label [[ELSE:%.*]]
; CHECK: then:
; CHECK-NEXT: ret i1 false
@@ -273,7 +267,6 @@ define i1 @cnt_positive_sge_against_base_with_zext(ptr %p, i32 %cnt) {
; CHECK-NEXT: tail call void @llvm.assume(i1 [[CMP]])
; CHECK-NEXT: [[EXT:%.*]] = zext i32 [[CNT]] to i64
; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i32, ptr [[P:%.*]], i64 [[EXT]]
-; CHECK-NEXT: [[CMP_1:%.*]] = icmp uge ptr [[ADD_PTR]], [[P]]
; CHECK-NEXT: br i1 true, label [[THEN:%.*]], label [[ELSE:%.*]]
; CHECK: then:
; CHECK-NEXT: ret i1 false
@@ -302,7 +295,6 @@ define i1 @cnt_not_known_positive_sgt_against_base_with_zext(ptr %p, i32 %cnt) {
; CHECK-NEXT: tail call void @llvm.assume(i1 [[CMP]])
; CHECK-NEXT: [[EXT:%.*]] = zext i32 [[CNT]] to i64
; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i32, ptr [[P:%.*]], i64 [[EXT]]
-; CHECK-NEXT: [[CMP_1:%.*]] = icmp uge ptr [[ADD_PTR]], [[P]]
; CHECK-NEXT: br i1 true, label [[THEN:%.*]], label [[ELSE:%.*]]
; CHECK: then:
; CHECK-NEXT: ret i1 false
@@ -331,7 +323,6 @@ define i1 @cnt_not_known_positive_sge_against_base_with_zext(ptr %p, i32 %cnt) {
; CHECK-NEXT: tail call void @llvm.assume(i1 [[CMP]])
; CHECK-NEXT: [[EXT:%.*]] = zext i32 [[CNT]] to i64
; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i32, ptr [[P:%.*]], i64 [[EXT]]
-; CHECK-NEXT: [[CMP_1:%.*]] = icmp uge ptr [[ADD_PTR]], [[P]]
; CHECK-NEXT: br i1 true, label [[THEN:%.*]], label [[ELSE:%.*]]
; CHECK: then:
; CHECK-NEXT: ret i1 false
@@ -391,7 +382,6 @@ define i1 @cnt_positive_from_assume_check_against_base_struct_ugt_with_zext(ptr
; CHECK-NEXT: tail call void @llvm.assume(i1 [[CMP]])
; CHECK-NEXT: [[EXT:%.*]] = zext i32 [[CNT]] to i64
; CHECK-NEXT: [[GEP_EXT:%.*]] = getelementptr inbounds [[T:%.*]], ptr [[P:%.*]], i64 0, i32 1, i64 [[EXT]]
-; CHECK-NEXT: [[CMP_1:%.*]] = icmp ugt ptr [[GEP_EXT]], [[P]]
; CHECK-NEXT: br i1 true, label [[THEN:%.*]], label [[ELSE:%.*]]
; CHECK: then:
; CHECK-NEXT: ret i1 false
@@ -423,7 +413,6 @@ define i1 @cnt_positive_from_branch_check_against_base_struct_ugt_with_zext(ptr
; CHECK: check:
; CHECK-NEXT: [[EXT:%.*]] = zext i32 [[CNT]] to i64
; CHECK-NEXT: [[GEP_EXT:%.*]] = getelementptr inbounds [[T:%.*]], ptr [[P:%.*]], i64 0, i32 1, i64 [[EXT]]
-; CHECK-NEXT: [[CMP_1:%.*]] = icmp ugt ptr [[GEP_EXT]], [[P]]
; CHECK-NEXT: br i1 true, label [[THEN:%.*]], label [[ELSE]]
; CHECK: then:
; CHECK-NEXT: ret i1 false
@@ -458,7 +447,6 @@ define i1 @cnt_not_known_positive_from_branch_check_against_base_struct_ugt_with
; CHECK: check:
; CHECK-NEXT: [[EXT:%.*]] = zext i32 [[CNT]] to i64
; CHECK-NEXT: [[GEP_EXT:%.*]] = getelementptr inbounds [[T:%.*]], ptr [[P:%.*]], i64 0, i32 1, i64 [[EXT]]
-; CHECK-NEXT: [[CMP_1:%.*]] = icmp ugt ptr [[GEP_EXT]], [[P]]
; CHECK-NEXT: br i1 true, label [[THEN:%.*]], label [[ELSE]]
; CHECK: then:
; CHECK-NEXT: ret i1 false
@@ -489,12 +477,9 @@ define i1 @sge_2(i8 %idx) {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[CMP:%.*]] = icmp sge i8 [[IDX:%.*]], 2
; CHECK-NEXT: call void @llvm.assume(i1 [[CMP]])
-; CHECK-NEXT: [[T_1:%.*]] = icmp uge i8 [[IDX]], 2
-; CHECK-NEXT: [[T_2:%.*]] = icmp uge i8 [[IDX]], 1
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, true
; CHECK-NEXT: [[C_1:%.*]] = icmp uge i8 [[IDX]], 3
; CHECK-NEXT: [[RES_2:%.*]] = xor i1 [[RES_1]], [[C_1]]
-; CHECK-NEXT: [[F_1:%.*]] = icmp ult i8 [[IDX]], 2
; CHECK-NEXT: [[RES_3:%.*]] = xor i1 [[RES_2]], false
; CHECK-NEXT: ret i1 [[RES_3]]
;
@@ -555,7 +540,6 @@ define i1 @sgt_known_neg(i8 %idx) {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i8 [[IDX:%.*]], -1
; CHECK-NEXT: call void @llvm.assume(i1 [[CMP]])
-; CHECK-NEXT: [[T_1:%.*]] = icmp uge i8 [[IDX]], 0
; CHECK-NEXT: [[T_2:%.*]] = icmp uge i8 [[IDX]], 1
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, [[T_2]]
; CHECK-NEXT: [[C_1:%.*]] = icmp ugt i8 [[IDX]], -1
@@ -578,8 +562,6 @@ define i1 @sgt_known_pos(i8 %idx) {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i8 [[IDX:%.*]], 2
; CHECK-NEXT: call void @llvm.assume(i1 [[CMP]])
-; CHECK-NEXT: [[T_1:%.*]] = icmp ugt i8 [[IDX]], 2
-; CHECK-NEXT: [[T_2:%.*]] = icmp ugt i8 [[IDX]], 1
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, true
; CHECK-NEXT: [[C_1:%.*]] = icmp ugt i8 [[IDX]], 3
; CHECK-NEXT: [[RES_2:%.*]] = xor i1 [[RES_1]], [[C_1]]
@@ -601,7 +583,6 @@ define i1 @sgt_to_ugt(i8 %a) {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i8 [[A:%.*]], 2
; CHECK-NEXT: call void @llvm.assume(i1 [[CMP]])
-; CHECK-NEXT: [[T_1:%.*]] = icmp ugt i8 [[A]], 2
; CHECK-NEXT: ret i1 true
;
entry:
@@ -616,7 +597,6 @@ define i1 @sgt_to_ugt_less(i8 %a) {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[CMP:%.*]] = icmp sgt i8 [[A:%.*]], 2
; CHECK-NEXT: call void @llvm.assume(i1 [[CMP]])
-; CHECK-NEXT: [[T_1:%.*]] = icmp ugt i8 [[A]], 1
; CHECK-NEXT: ret i1 true
;
entry:
@@ -633,7 +613,6 @@ define i1 @sgt_to_ugt_var(i8 %a, i8 %b) {
; CHECK-NEXT: [[CMP_2:%.*]] = icmp sgt i8 [[B]], 0
; CHECK-NEXT: call void @llvm.assume(i1 [[CMP]])
; CHECK-NEXT: call void @llvm.assume(i1 [[CMP_2]])
-; CHECK-NEXT: [[T_1:%.*]] = icmp ugt i8 [[A]], [[B]]
; CHECK-NEXT: ret i1 true
;
entry:
@@ -714,8 +693,6 @@ define i1 @slt_first_op_known_pos(i8 %idx) {
; CHECK-NEXT: entry:
; CHECK-NEXT: [[CMP:%.*]] = icmp slt i8 2, [[IDX:%.*]]
; CHECK-NEXT: call void @llvm.assume(i1 [[CMP]])
-; CHECK-NEXT: [[T_1:%.*]] = icmp ult i8 2, [[IDX]]
-; CHECK-NEXT: [[T_2:%.*]] = icmp ult i8 1, [[IDX]]
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, true
; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 3, [[IDX]]
; CHECK-NEXT: [[RES_2:%.*]] = xor i1 [[RES_1]], [[C_1]]
diff --git a/llvm/test/Transforms/ConstraintElimination/transfer-unsigned-facts-to-signed.ll b/llvm/test/Transforms/ConstraintElimination/transfer-unsigned-facts-to-signed.ll
index 21abc75d9ba251..34b27dd42e338a 100644
--- a/llvm/test/Transforms/ConstraintElimination/transfer-unsigned-facts-to-signed.ll
+++ b/llvm/test/Transforms/ConstraintElimination/transfer-unsigned-facts-to-signed.ll
@@ -9,12 +9,9 @@ define i1 @idx_known_positive_via_len_1(i8 %len, i8 %idx) {
; CHECK-NEXT: [[AND_1:%.*]] = and i1 [[LEN_POS]], [[IDX_ULT_LEN]]
; CHECK-NEXT: br i1 [[AND_1]], label [[THEN_1:%.*]], label [[ELSE:%.*]]
; CHECK: then.1:
-; CHECK-NEXT: [[T_1:%.*]] = icmp ult i8 [[IDX]], [[LEN]]
-; CHECK-NEXT: [[T_2:%.*]] = icmp sge i8 [[IDX]], 0
; CHECK-NEXT: [[R_1:%.*]] = xor i1 true, true
; CHECK-NEXT: [[C_1:%.*]] = icmp sge i8 [[IDX]], 1
; CHECK-NEXT: [[R_2:%.*]] = xor i1 [[R_1]], [[C_1]]
-; CHECK-NEXT: [[C_2:%.*]] = icmp sge i8 [[LEN]], 1
; CHECK-NEXT: [[R_3:%.*]] = xor i1 [[R_2]], true
; CHECK-NEXT: ret i1 [[R_3]]
; CHECK: else:
@@ -53,12 +50,9 @@ define i1 @idx_known_positive_via_len_2(i8 %len, i8 %idx) {
; CHECK-NEXT: [[AND_1:%.*]] = and i1 [[IDX_ULT_LEN]], [[LEN_POS]]
; CHECK-NEXT: br i1 [[AND_1]], label [[THEN_1:%.*]], label [[ELSE:%.*]]
; CHECK: then.1:
-; CHECK-NEXT: [[T_1:%.*]] = icmp ult i8 [[IDX]], [[LEN]]
-; CHECK-NEXT: [[T_2:%.*]] = icmp sge i8 [[IDX]], 0
; CHECK-NEXT: [[R_1:%.*]] = xor i1 true, true
; CHECK-NEXT: [[C_1:%.*]] = icmp sge i8 [[IDX]], 1
; CHECK-NEXT: [[R_2:%.*]] = xor i1 [[R_1]], [[C_1]]
-; CHECK-NEXT: [[C_2:%.*]] = icmp sge i8 [[LEN]], 1
; CHECK-NEXT: [[R_3:%.*]] = xor i1 [[R_2]], true
; CHECK-NEXT: ret i1 [[R_3]]
; CHECK: else:
@@ -98,7 +92,6 @@ define i1 @idx_not_known_positive_via_len_uge(i8 %len, i8 %idx) {
; CHECK-NEXT: [[AND_1:%.*]] = and i1 [[LEN_POS]], [[IDX_ULT_LEN]]
; CHECK-NEXT: br i1 [[AND_1]], label [[THEN_1:%.*]], label [[ELSE:%.*]]
; CHECK: then.1:
-; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[IDX]], [[LEN]]
; CHECK-NEXT: [[C_2:%.*]] = icmp sge i8 [[IDX]], 0
; CHECK-NEXT: [[R_1:%.*]] = xor i1 true, [[C_2]]
; CHECK-NEXT: [[C_3:%.*]] = icmp sge i8 [[IDX]], 1
@@ -140,7 +133,6 @@ define i1 @idx_not_known_positive_via_len(i8 %len, i8 %idx) {
; CHECK-NEXT: [[IDX_ULT_LEN:%.*]] = icmp ult i8 [[IDX:%.*]], [[LEN:%.*]]
; CHECK-NEXT: br i1 [[IDX_ULT_LEN]], label [[THEN_1:%.*]], label [[ELSE:%.*]]
; CHECK: then.1:
-; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[IDX]], [[LEN]]
; CHECK-NEXT: [[C_2:%.*]] = icmp sge i8 [[IDX]], 0
; CHECK-NEXT: [[R_1:%.*]] = xor i1 true, [[C_2]]
; CHECK-NEXT: [[C_3:%.*]] = icmp sge i8 [[IDX]], 1
@@ -178,10 +170,7 @@ define i1 @ult_signed_pos_constant(i8 %a) {
; CHECK-NEXT: [[A_ULT_4:%.*]] = icmp ult i8 [[A:%.*]], 4
; CHECK-NEXT: br i1 [[A_ULT_4]], label [[THEN:%.*]], label [[ELSE:%.*]]
; CHECK: then:
-; CHECK-NEXT: [[T_0:%.*]] = icmp sge i8 [[A]], 0
-; CHECK-NEXT: [[T_1:%.*]] = icmp slt i8 [[A]], 4
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, true
-; CHECK-NEXT: [[C_0:%.*]] = icmp slt i8 [[A]], 5
; CHECK-NEXT: [[RES_2:%.*]] = xor i1 [[RES_1]], true
; CHECK-NEXT: ret i1 [[RES_2]]
; CHECK: else:
diff --git a/llvm/test/Transforms/ConstraintElimination/uge.ll b/llvm/test/Transforms/ConstraintElimination/uge.ll
index 55419c10224015..2ac078eefe14bc 100644
--- a/llvm/test/Transforms/ConstraintElimination/uge.ll
+++ b/llvm/test/Transforms/ConstraintElimination/uge.ll
@@ -9,7 +9,6 @@ define void @test_1_variable_constraint(i8 %x, i8 %y, i8 %z) {
; CHECK-NEXT: [[C_1:%.*]] = icmp uge i8 [[X:%.*]], [[Y:%.*]]
; CHECK-NEXT: br i1 [[C_1]], label [[BB1:%.*]], label [[BB2:%.*]]
; CHECK: bb1:
-; CHECK-NEXT: [[T_1:%.*]] = icmp uge i8 [[X]], [[Y]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[C_2:%.*]] = icmp uge i8 [[X]], 10
; CHECK-NEXT: call void @use(i1 [[C_2]])
@@ -19,9 +18,7 @@ define void @test_1_variable_constraint(i8 %x, i8 %y, i8 %z) {
; CHECK-NEXT: call void @use(i1 [[C_4]])
; CHECK-NEXT: ret void
; CHECK: bb2:
-; CHECK-NEXT: [[T_2:%.*]] = icmp uge i8 [[Y]], [[X]]
; CHECK-NEXT: call void @use(i1 true)
-; CHECK-NEXT: [[F_1:%.*]] = icmp uge i8 [[X]], [[Y]]
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[C_5:%.*]] = icmp uge i8 [[X]], 10
; CHECK-NEXT: call void @use(i1 [[C_5]])
@@ -62,9 +59,7 @@ define void @test_1_constant_constraint(i8 %x) {
; CHECK-NEXT: [[C_1:%.*]] = icmp uge i8 [[X:%.*]], 10
; CHECK-NEXT: br i1 [[C_1]], label [[BB1:%.*]], label [[BB2:%.*]]
; CHECK: bb1:
-; CHECK-NEXT: [[T_1:%.*]] = icmp uge i8 [[X]], 10
; CHECK-NEXT: call void @use(i1 true)
-; CHECK-NEXT: [[T_2:%.*]] = icmp uge i8 [[X]], 9
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[C_2:%.*]] = icmp uge i8 [[X]], 11
; CHECK-NEXT: call void @use(i1 [[C_2]])
@@ -72,11 +67,8 @@ define void @test_1_constant_constraint(i8 %x) {
; CHECK-NEXT: call void @use(i1 [[C_4]])
; CHECK-NEXT: ret void
; CHECK: bb2:
-; CHECK-NEXT: [[T_3:%.*]] = icmp uge i8 11, [[X]]
; CHECK-NEXT: call void @use(i1 true)
-; CHECK-NEXT: [[F_1:%.*]] = icmp uge i8 [[X]], 10
; CHECK-NEXT: call void @use(i1 false)
-; CHECK-NEXT: [[F_1_1:%.*]] = icmp uge i8 [[X]], 10
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[C_5:%.*]] = icmp uge i8 [[X]], 9
; CHECK-NEXT: call void @use(i1 [[C_5]])
@@ -124,7 +116,6 @@ define i8 @test1(i8 %x, i8 %y, i8 %z) {
; CHECK-NEXT: [[C_2:%.*]] = icmp uge i8 [[Y]], [[Z:%.*]]
; CHECK-NEXT: br i1 [[C_2]], label [[BB2:%.*]], label [[EXIT]]
; CHECK: bb2:
-; CHECK-NEXT: [[C_3:%.*]] = icmp uge i8 [[X]], [[Z]]
; CHECK-NEXT: br i1 true, label [[BB3:%.*]], label [[EXIT]]
; CHECK: bb3:
; CHECK-NEXT: ret i8 10
@@ -224,7 +215,6 @@ define i8 @test4(i8 %x, i8 %y, i8 %z) {
; CHECK-NEXT: [[C_2:%.*]] = icmp uge i8 [[Y]], [[Z:%.*]]
; CHECK-NEXT: br i1 [[C_2]], label [[BB2:%.*]], label [[EXIT]]
; CHECK: bb2:
-; CHECK-NEXT: [[T_1:%.*]] = icmp uge i8 [[X]], [[Z]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[U_1:%.*]] = icmp eq i8 [[X]], [[Z]]
; CHECK-NEXT: call void @use(i1 [[U_1]])
diff --git a/llvm/test/Transforms/ConstraintElimination/ugt-ule.ll b/llvm/test/Transforms/ConstraintElimination/ugt-ule.ll
index 80f58618adb7ae..468a23fda7f134 100644
--- a/llvm/test/Transforms/ConstraintElimination/ugt-ule.ll
+++ b/llvm/test/Transforms/ConstraintElimination/ugt-ule.ll
@@ -9,13 +9,11 @@ define void @test(ptr %m, ptr %ptr) {
; CHECK-NEXT: [[CMP_1:%.*]] = icmp ult ptr [[M:%.*]], [[PTR:%.*]]
; CHECK-NEXT: br i1 [[CMP_1]], label [[BB_1:%.*]], label [[BB_2:%.*]]
; CHECK: bb.1:
-; CHECK-NEXT: [[CMP_2:%.*]] = icmp uge ptr [[M]], [[PTR]]
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: ret void
; CHECK: bb.2:
; CHECK-NEXT: br label [[BB_2_NEXT:%.*]]
; CHECK: bb.2.next:
-; CHECK-NEXT: [[CMP_3:%.*]] = icmp uge ptr [[M]], [[PTR]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: ret void
;
diff --git a/llvm/test/Transforms/ConstraintElimination/ule.ll b/llvm/test/Transforms/ConstraintElimination/ule.ll
index 20bb1f1bbf28cb..6d82c372521840 100644
--- a/llvm/test/Transforms/ConstraintElimination/ule.ll
+++ b/llvm/test/Transforms/ConstraintElimination/ule.ll
@@ -9,7 +9,6 @@ define void @test_1_variable_constraint(i8 %x, i8 %y, i8 %z) {
; CHECK-NEXT: [[C_1:%.*]] = icmp ule i8 [[X:%.*]], [[Y:%.*]]
; CHECK-NEXT: br i1 [[C_1]], label [[BB1:%.*]], label [[BB2:%.*]]
; CHECK: bb1:
-; CHECK-NEXT: [[T_1:%.*]] = icmp ule i8 [[X]], [[Y]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[C_2:%.*]] = icmp ule i8 [[X]], 10
; CHECK-NEXT: call void @use(i1 [[C_2]])
@@ -19,9 +18,7 @@ define void @test_1_variable_constraint(i8 %x, i8 %y, i8 %z) {
; CHECK-NEXT: call void @use(i1 [[C_4]])
; CHECK-NEXT: ret void
; CHECK: bb2:
-; CHECK-NEXT: [[T_2:%.*]] = icmp ule i8 [[Y]], [[X]]
; CHECK-NEXT: call void @use(i1 true)
-; CHECK-NEXT: [[F_1:%.*]] = icmp ule i8 [[X]], [[Y]]
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[C_5:%.*]] = icmp ule i8 [[X]], 10
; CHECK-NEXT: call void @use(i1 [[C_5]])
@@ -62,9 +59,7 @@ define void @test_1_constant_constraint(i8 %x) {
; CHECK-NEXT: [[C_1:%.*]] = icmp ule i8 [[X:%.*]], 10
; CHECK-NEXT: br i1 [[C_1]], label [[BB1:%.*]], label [[BB2:%.*]]
; CHECK: bb1:
-; CHECK-NEXT: [[T_1:%.*]] = icmp ule i8 [[X]], 10
; CHECK-NEXT: call void @use(i1 true)
-; CHECK-NEXT: [[T_2:%.*]] = icmp ule i8 [[X]], 11
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[C_2:%.*]] = icmp ule i8 [[X]], 9
; CHECK-NEXT: call void @use(i1 [[C_2]])
@@ -72,11 +67,8 @@ define void @test_1_constant_constraint(i8 %x) {
; CHECK-NEXT: call void @use(i1 [[C_4]])
; CHECK-NEXT: ret void
; CHECK: bb2:
-; CHECK-NEXT: [[T_3:%.*]] = icmp ule i8 10, [[X]]
; CHECK-NEXT: call void @use(i1 true)
-; CHECK-NEXT: [[F_1:%.*]] = icmp ule i8 [[X]], 9
; CHECK-NEXT: call void @use(i1 false)
-; CHECK-NEXT: [[F_1_1:%.*]] = icmp ule i8 [[X]], 10
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[C_5:%.*]] = icmp ule i8 [[X]], 11
; CHECK-NEXT: call void @use(i1 [[C_5]])
@@ -125,7 +117,6 @@ define i8 @test1(i8 %x, i8 %y, i8 %z) {
; CHECK-NEXT: [[C_2:%.*]] = icmp ule i8 [[Y]], [[Z:%.*]]
; CHECK-NEXT: br i1 [[C_2]], label [[BB2:%.*]], label [[EXIT]]
; CHECK: bb2:
-; CHECK-NEXT: [[C_3:%.*]] = icmp ule i8 [[X]], [[Z]]
; CHECK-NEXT: br i1 true, label [[BB3:%.*]], label [[EXIT]]
; CHECK: bb3:
; CHECK-NEXT: ret i8 10
@@ -225,7 +216,6 @@ define i8 @test4(i8 %x, i8 %y, i8 %z) {
; CHECK-NEXT: [[C_2:%.*]] = icmp ule i8 [[Y]], [[Z:%.*]]
; CHECK-NEXT: br i1 [[C_2]], label [[BB2:%.*]], label [[EXIT]]
; CHECK: bb2:
-; CHECK-NEXT: [[T_1:%.*]] = icmp ule i8 [[X]], [[Z]]
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: [[U_1:%.*]] = icmp eq i8 [[X]], [[Z]]
; CHECK-NEXT: call void @use(i1 [[U_1]])
diff --git a/llvm/test/Transforms/ConstraintElimination/uses-in-
diff erent-blocks.ll b/llvm/test/Transforms/ConstraintElimination/uses-in-
diff erent-blocks.ll
index 021f338a735ed8..6a2fb027e32355 100644
--- a/llvm/test/Transforms/ConstraintElimination/uses-in-
diff erent-blocks.ll
+++ b/llvm/test/Transforms/ConstraintElimination/uses-in-
diff erent-blocks.ll
@@ -5,7 +5,6 @@ define i1 @test_conds_single_use_in_
diff erent_blocks(i8 %x) {
; CHECK-LABEL: @test_conds_single_use_in_
diff erent_blocks(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[C_1:%.*]] = icmp ugt i8 [[X:%.*]], 10
-; CHECK-NEXT: [[T_1:%.*]] = icmp ugt i8 [[X]], 5
; CHECK-NEXT: [[C_2:%.*]] = icmp ugt i8 [[X]], 5
; CHECK-NEXT: br i1 [[C_1]], label [[THEN:%.*]], label [[ELSE:%.*]]
; CHECK: then:
@@ -31,8 +30,7 @@ define i1 @test_conds_single_use_in_
diff erent_blocks_2(i8 %x, i8 %y) {
; CHECK-LABEL: @test_conds_single_use_in_
diff erent_blocks_2(
; CHECK-NEXT: entry:
; CHECK-NEXT: [[C_1:%.*]] = icmp ugt i8 [[X:%.*]], 10
-; CHECK-NEXT: [[T_1:%.*]] = icmp ugt i8 [[Y:%.*]], 5
-; CHECK-NEXT: [[C_2:%.*]] = icmp ugt i8 [[Y]], [[X]]
+; CHECK-NEXT: [[C_2:%.*]] = icmp ugt i8 [[Y:%.*]], [[X]]
; CHECK-NEXT: [[C_3:%.*]] = icmp ugt i8 [[Y]], 5
; CHECK-NEXT: br i1 [[C_1]], label [[THEN_1:%.*]], label [[ELSE:%.*]]
; CHECK: then.1:
@@ -70,7 +68,6 @@ define i1 @test_conds_multiple_uses_in_
diff erent_blocks_2(i8 %x, i8 %y) {
; CHECK-NEXT: [[T_1:%.*]] = icmp ugt i8 [[Y:%.*]], 5
; CHECK-NEXT: call void @llvm.assume(i1 [[T_1]])
; CHECK-NEXT: [[C_2:%.*]] = icmp ugt i8 [[Y]], [[X]]
-; CHECK-NEXT: [[C_3:%.*]] = icmp ugt i8 [[Y]], 5
; CHECK-NEXT: br i1 [[C_1]], label [[THEN_1:%.*]], label [[ELSE:%.*]]
; CHECK: then.1:
; CHECK-NEXT: br i1 [[C_2]], label [[THEN_2:%.*]], label [[ELSE]]
diff --git a/llvm/test/Transforms/ConstraintElimination/vector-compares.ll b/llvm/test/Transforms/ConstraintElimination/vector-compares.ll
index 5bc9d6b4aeb5c9..3fa0e18ec5cf2c 100644
--- a/llvm/test/Transforms/ConstraintElimination/vector-compares.ll
+++ b/llvm/test/Transforms/ConstraintElimination/vector-compares.ll
@@ -13,9 +13,7 @@ define void @test_vector_iv(i32 %x, i1 %c) {
; CHECK-NEXT: br i1 [[C_1]], label [[LOOP:%.*]], label [[BB2]]
; CHECK: loop:
; CHECK-NEXT: [[IV:%.*]] = phi <4 x i8> [ zeroinitializer, [[PRE]] ], [ [[IV_NEXT:%.*]], [[LOOP]] ]
-; CHECK-NEXT: [[T_1:%.*]] = icmp ule i32 [[X]], 10
; CHECK-NEXT: call void @use(i1 true)
-; CHECK-NEXT: [[F_1:%.*]] = icmp ugt i32 [[X]], 10
; CHECK-NEXT: call void @use(i1 false)
; CHECK-NEXT: [[C_2:%.*]] = icmp ule i32 [[X]], 9
; CHECK-NEXT: call void @use(i1 [[C_2]])
@@ -26,7 +24,6 @@ define void @test_vector_iv(i32 %x, i1 %c) {
; CHECK-NEXT: [[EC:%.*]] = icmp eq i8 [[E]], 100
; CHECK-NEXT: br i1 [[EC]], label [[EXIT:%.*]], label [[LOOP]]
; CHECK: exit:
-; CHECK-NEXT: [[C_4:%.*]] = icmp ule i32 [[X]], 10
; CHECK-NEXT: call void @use(i1 true)
; CHECK-NEXT: ret void
; CHECK: bb2:
diff --git a/llvm/test/Transforms/ConstraintElimination/wrapping-math.ll b/llvm/test/Transforms/ConstraintElimination/wrapping-math.ll
index 55312348adbfaa..09dea55ba01c7d 100644
--- a/llvm/test/Transforms/ConstraintElimination/wrapping-math.ll
+++ b/llvm/test/Transforms/ConstraintElimination/wrapping-math.ll
@@ -21,7 +21,6 @@ define i1 @wrapping_add_known_1(i8 %a) {
; CHECK-NEXT: br i1 [[PRE]], label [[THEN:%.*]], label [[ELSE:%.*]]
; CHECK: then:
; CHECK-NEXT: [[SUB_1:%.*]] = add i8 [[A]], -1
-; CHECK-NEXT: [[C_1:%.*]] = icmp eq i8 [[SUB_1]], 0
; CHECK-NEXT: ret i1 true
; CHECK: else:
; CHECK-NEXT: [[SUB_2:%.*]] = add i8 [[A]], -1
@@ -82,7 +81,6 @@ define i1 @test_48253_eq_ne(i8 %a, i8 %b) {
; CHECK-NEXT: br i1 [[OR]], label [[EXIT_1:%.*]], label [[IF_END:%.*]]
; CHECK: if.end:
; CHECK-NEXT: [[SUB_1:%.*]] = add i8 [[B]], -1
-; CHECK-NEXT: [[T_1:%.*]] = icmp ult i8 [[SUB_1]], [[A]]
; CHECK-NEXT: [[SUB_2:%.*]] = add i8 [[B]], -2
; CHECK-NEXT: [[C_2:%.*]] = icmp ult i8 [[SUB_2]], [[A]]
; CHECK-NEXT: [[XOR_1:%.*]] = xor i1 true, [[C_2]]
@@ -131,10 +129,7 @@ define i1 @test_ult(i8 %a, i8 %b) {
; CHECK-NEXT: [[ADD_1:%.*]] = add i8 [[A]], 1
; CHECK-NEXT: br i1 [[AND]], label [[IF_END:%.*]], label [[EXIT_1:%.*]]
; CHECK: if.end:
-; CHECK-NEXT: [[T_1:%.*]] = icmp ult i8 [[SUB_1]], [[B]]
-; CHECK-NEXT: [[T_2:%.*]] = icmp ult i8 [[SUB_2]], [[B]]
; CHECK-NEXT: [[XOR_1:%.*]] = xor i1 true, true
-; CHECK-NEXT: [[T_3:%.*]] = icmp ult i8 [[SUB_3]], [[B]]
; CHECK-NEXT: [[XOR_2:%.*]] = xor i1 [[XOR_1]], true
; CHECK-NEXT: [[C_1:%.*]] = icmp ult i8 [[SUB_4]], [[B]]
; CHECK-NEXT: [[XOR_3:%.*]] = xor i1 [[XOR_2]], [[C_1]]
@@ -279,10 +274,7 @@ define i1 @wrapping_add_known_1_add_nuw(i8 %a) {
; CHECK-NEXT: call void @llvm.assume(i1 [[PRE]])
; CHECK-NEXT: [[SUB_1:%.*]] = add i8 [[A]], -1
; CHECK-NEXT: [[ADD:%.*]] = add nuw i8 [[SUB_1]], 10
-; CHECK-NEXT: [[T_1:%.*]] = icmp uge i8 [[ADD]], 10
-; CHECK-NEXT: [[T_2:%.*]] = icmp ule i8 [[ADD]], 10
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, true
-; CHECK-NEXT: [[F_1:%.*]] = icmp ult i8 [[ADD]], 10
; CHECK-NEXT: [[RES_2:%.*]] = xor i1 [[RES_1]], false
; CHECK-NEXT: ret i1 [[RES_2]]
;
@@ -306,10 +298,7 @@ define i1 @add_nuw_wrapping_add_known_1(i8 %a) {
; CHECK-NEXT: call void @llvm.assume(i1 [[PRE]])
; CHECK-NEXT: [[ADD:%.*]] = add nuw i8 [[A]], 10
; CHECK-NEXT: [[SUB_1:%.*]] = add i8 [[ADD]], -1
-; CHECK-NEXT: [[T_1:%.*]] = icmp uge i8 [[SUB_1]], 10
-; CHECK-NEXT: [[T_2:%.*]] = icmp ule i8 [[SUB_1]], 10
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, true
-; CHECK-NEXT: [[F_1:%.*]] = icmp ult i8 [[SUB_1]], 10
; CHECK-NEXT: [[RES_2:%.*]] = xor i1 [[RES_1]], false
; CHECK-NEXT: ret i1 [[RES_2]]
;
diff --git a/llvm/test/Transforms/ConstraintElimination/zext-for-per-formula-reasoning.ll b/llvm/test/Transforms/ConstraintElimination/zext-for-per-formula-reasoning.ll
index 54cb7127d0688f..63f5d4d4ba347b 100644
--- a/llvm/test/Transforms/ConstraintElimination/zext-for-per-formula-reasoning.ll
+++ b/llvm/test/Transforms/ConstraintElimination/zext-for-per-formula-reasoning.ll
@@ -9,7 +9,6 @@ define i1 @test(i8 %x, i8 %y) {
; CHECK-NEXT: [[CMP_0:%.*]] = icmp uge i8 [[ADD]], 10
; CHECK-NEXT: tail call void @llvm.assume(i1 [[CMP_0]])
; CHECK-NEXT: [[EXT:%.*]] = zext i8 [[X]] to i16
-; CHECK-NEXT: [[T_1:%.*]] = icmp uge i16 [[EXT]], 0
; CHECK-NEXT: [[C_1:%.*]] = icmp uge i16 [[EXT]], 1
; CHECK-NEXT: [[RES:%.*]] = xor i1 true, [[C_1]]
; CHECK-NEXT: ret i1 [[RES]]
@@ -31,9 +30,7 @@ define i1 @test2(i8 %x, i8 %y) {
; CHECK-NEXT: tail call void @llvm.assume(i1 [[CMP_0]])
; CHECK-NEXT: [[EXT:%.*]] = zext i8 [[X]] to i16
; CHECK-NEXT: [[ADD_1:%.*]] = add nuw nsw i16 [[EXT]], 1
-; CHECK-NEXT: [[T_1:%.*]] = icmp uge i16 [[ADD_1]], 1
; CHECK-NEXT: [[C_1:%.*]] = icmp uge i16 [[ADD_1]], 2
-; CHECK-NEXT: [[F_1:%.*]] = icmp ult i16 [[ADD_1]], 1
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, [[C_1]]
; CHECK-NEXT: [[RES_2:%.*]] = xor i1 [[RES_1]], false
; CHECK-NEXT: [[C_2:%.*]] = icmp sge i16 [[ADD_1]], 1
@@ -63,8 +60,6 @@ define i1 @gep_zext_idx(ptr %p, i8 %cnt, i8 %off) {
; CHECK-NEXT: tail call void @llvm.assume(i1 [[CMP]])
; CHECK-NEXT: [[EXT:%.*]] = zext i8 [[CNT]] to i16
; CHECK-NEXT: [[ADD_PTR:%.*]] = getelementptr inbounds i32, ptr [[P:%.*]], i16 [[EXT]]
-; CHECK-NEXT: [[T_1:%.*]] = icmp uge ptr [[ADD_PTR]], [[P]]
-; CHECK-NEXT: [[F_1:%.*]] = icmp ult ptr [[ADD_PTR]], [[P]]
; CHECK-NEXT: [[GEP_11:%.*]] = getelementptr inbounds i32, ptr [[P]], i16 11
; CHECK-NEXT: [[C_1:%.*]] = icmp ugt ptr [[ADD_PTR]], [[GEP_11]]
; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, false
diff --git a/llvm/test/Transforms/ConstraintElimination/zext.ll b/llvm/test/Transforms/ConstraintElimination/zext.ll
index 1101ce27ca1a87..d78328701b0392 100644
--- a/llvm/test/Transforms/ConstraintElimination/zext.ll
+++ b/llvm/test/Transforms/ConstraintElimination/zext.ll
@@ -8,7 +8,6 @@ define i1 @uge_zext(i8 %x, i16 %y) {
; CHECK-NEXT: [[C_1:%.*]] = icmp uge i16 [[X_EXT]], [[Y:%.*]]
; CHECK-NEXT: br i1 [[C_1]], label [[BB1:%.*]], label [[BB2:%.*]]
; CHECK: bb1:
-; CHECK-NEXT: [[T_1:%.*]] = icmp uge i16 [[X_EXT]], [[Y]]
; CHECK-NEXT: [[C_2:%.*]] = icmp uge i16 [[X_EXT]], 10
; CHECK-NEXT: [[R_1:%.*]] = xor i1 true, [[C_2]]
; CHECK-NEXT: [[C_3:%.*]] = icmp uge i16 [[Y]], [[X_EXT]]
@@ -17,8 +16,6 @@ define i1 @uge_zext(i8 %x, i16 %y) {
; CHECK-NEXT: [[R_3:%.*]] = xor i1 [[R_2]], [[C_4]]
; CHECK-NEXT: ret i1 [[R_3]]
; CHECK: bb2:
-; CHECK-NEXT: [[T_2:%.*]] = icmp uge i16 [[Y]], [[X_EXT]]
-; CHECK-NEXT: [[F_1:%.*]] = icmp uge i16 [[X_EXT]], [[Y]]
; CHECK-NEXT: [[R_4:%.*]] = xor i1 true, false
; CHECK-NEXT: [[C_5:%.*]] = icmp uge i16 [[X_EXT]], 10
; CHECK-NEXT: [[R_5:%.*]] = xor i1 [[R_4]], [[C_5]]
@@ -60,7 +57,6 @@ define i1 @uge_compare_short_and_extended(i8 %x, i8 %y) {
; CHECK-NEXT: [[Y_EXT:%.*]] = zext i8 [[Y]] to i16
; CHECK-NEXT: br i1 [[C_1]], label [[BB1:%.*]], label [[BB2:%.*]]
; CHECK: bb1:
-; CHECK-NEXT: [[T_1:%.*]] = icmp uge i16 [[X_EXT]], [[Y_EXT]]
; CHECK-NEXT: [[C_2:%.*]] = icmp uge i16 [[X_EXT]], 10
; CHECK-NEXT: [[R_1:%.*]] = xor i1 true, [[C_2]]
; CHECK-NEXT: [[C_3:%.*]] = icmp sge i16 [[Y_EXT]], [[X_EXT]]
@@ -69,8 +65,6 @@ define i1 @uge_compare_short_and_extended(i8 %x, i8 %y) {
; CHECK-NEXT: [[R_3:%.*]] = xor i1 [[R_2]], [[C_4]]
; CHECK-NEXT: ret i1 [[R_3]]
; CHECK: bb2:
-; CHECK-NEXT: [[T_2:%.*]] = icmp uge i16 [[Y_EXT]], [[X_EXT]]
-; CHECK-NEXT: [[F_1:%.*]] = icmp uge i16 [[X_EXT]], [[Y_EXT]]
; CHECK-NEXT: [[R_4:%.*]] = xor i1 true, false
; CHECK-NEXT: [[C_5:%.*]] = icmp uge i16 [[X_EXT]], 10
; CHECK-NEXT: [[R_5:%.*]] = xor i1 [[R_4]], [[C_5]]
@@ -123,8 +117,6 @@ define i1 @uge_zext_add(i8 %x, i16 %y) {
; CHECK-NEXT: [[R_3:%.*]] = xor i1 [[R_2]], [[C_4]]
; CHECK-NEXT: ret i1 [[R_3]]
; CHECK: bb2:
-; CHECK-NEXT: [[T_2:%.*]] = icmp uge i16 [[Y]], [[X_EXT]]
-; CHECK-NEXT: [[F_1:%.*]] = icmp uge i16 [[X_EXT]], [[Y]]
; CHECK-NEXT: [[R_4:%.*]] = xor i1 true, false
; CHECK-NEXT: [[C_5:%.*]] = icmp uge i16 [[X_EXT]], 10
; CHECK-NEXT: [[R_5:%.*]] = xor i1 [[R_4]], [[C_5]]
@@ -167,7 +159,6 @@ define i1 @sge_zext(i8 %x, i16 %y) {
; CHECK-NEXT: [[C_1:%.*]] = icmp sge i16 [[X_EXT]], [[Y:%.*]]
; CHECK-NEXT: br i1 [[C_1]], label [[BB1:%.*]], label [[BB2:%.*]]
; CHECK: bb1:
-; CHECK-NEXT: [[T_1:%.*]] = icmp sge i16 [[X_EXT]], [[Y]]
; CHECK-NEXT: [[C_2:%.*]] = icmp sge i16 [[X_EXT]], 10
; CHECK-NEXT: [[R_1:%.*]] = xor i1 true, [[C_2]]
; CHECK-NEXT: [[C_3:%.*]] = icmp sge i16 [[Y]], [[X_EXT]]
@@ -176,8 +167,6 @@ define i1 @sge_zext(i8 %x, i16 %y) {
; CHECK-NEXT: [[R_3:%.*]] = xor i1 [[R_2]], [[C_4]]
; CHECK-NEXT: ret i1 [[R_3]]
; CHECK: bb2:
-; CHECK-NEXT: [[T_2:%.*]] = icmp sge i16 [[Y]], [[X_EXT]]
-; CHECK-NEXT: [[F_1:%.*]] = icmp sge i16 [[X_EXT]], [[Y]]
; CHECK-NEXT: [[R_4:%.*]] = xor i1 true, false
; CHECK-NEXT: [[C_5:%.*]] = icmp sge i16 [[X_EXT]], 10
; CHECK-NEXT: [[R_5:%.*]] = xor i1 [[R_4]], [[C_5]]
@@ -266,6 +255,21 @@ bb2:
}
define i1 @test_pr58009_const_zext() {
+; CHECK-LABEL: @test_pr58009_const_zext(
+; CHECK-NEXT: entry:
+; CHECK-NEXT: [[EXT_T_1:%.*]] = zext i1 true to i16
+; CHECK-NEXT: [[EXT_T_2:%.*]] = zext i1 true to i16
+; CHECK-NEXT: [[RES_1:%.*]] = xor i1 true, false
+; CHECK-NEXT: [[EXT_F_1:%.*]] = zext i1 false to i16
+; CHECK-NEXT: [[EXT_F_2:%.*]] = zext i1 false to i16
+; CHECK-NEXT: [[RES_2:%.*]] = xor i1 [[RES_1]], true
+; CHECK-NEXT: [[RES_3:%.*]] = xor i1 [[RES_2]], false
+; CHECK-NEXT: [[T_3:%.*]] = icmp ult i16 [[EXT_F_1]], [[EXT_T_2]]
+; CHECK-NEXT: [[F_3:%.*]] = icmp ugt i16 [[EXT_F_1]], [[EXT_T_2]]
+; CHECK-NEXT: [[RES_4:%.*]] = xor i1 [[RES_3]], [[T_3]]
+; CHECK-NEXT: [[RES_5:%.*]] = xor i1 [[RES_4]], [[F_3]]
+; CHECK-NEXT: ret i1 [[RES_5]]
+;
entry:
%ext.t.1 = zext i1 true to i16
%ext.t.2 = zext i1 true to i16
More information about the llvm-commits
mailing list