diff options
-rw-r--r-- | llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp | 5 | ||||
-rw-r--r-- | llvm/test/Transforms/InstCombine/exact.ll | 4 |
2 files changed, 1 insertions, 8 deletions
diff --git a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp index a5647715f31..d05b8d10e3c 100644 --- a/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp +++ b/llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp @@ -1876,11 +1876,6 @@ Instruction *InstCombiner::foldICmpShrConstant(ICmpInst &Cmp, if (IsAShr && (!Shr->isExact() || ShAmtVal == TypeBits - 1)) return nullptr; - // FIXME: This check restricts this fold to scalar types. - ConstantInt *ShAmt = dyn_cast<ConstantInt>(Shr->getOperand(1)); - if (!ShAmt) - return nullptr; - // Revisit the shift (to delete it). Worklist.Add(Shr); diff --git a/llvm/test/Transforms/InstCombine/exact.ll b/llvm/test/Transforms/InstCombine/exact.ll index f93bc8eff6b..cf10b70dd5c 100644 --- a/llvm/test/Transforms/InstCombine/exact.ll +++ b/llvm/test/Transforms/InstCombine/exact.ll @@ -120,11 +120,9 @@ define i1 @ashr_icmp2(i64 %X) { ret i1 %Z } -; FIXME: Vectors should fold the same way. define <2 x i1> @ashr_icmp2_vec(<2 x i64> %X) { ; CHECK-LABEL: @ashr_icmp2_vec( -; CHECK-NEXT: [[Y:%.*]] = ashr exact <2 x i64> %X, <i64 2, i64 2> -; CHECK-NEXT: [[Z:%.*]] = icmp slt <2 x i64> [[Y]], <i64 4, i64 4> +; CHECK-NEXT: [[Z:%.*]] = icmp slt <2 x i64> %X, <i64 16, i64 16> ; CHECK-NEXT: ret <2 x i1> [[Z]] ; %Y = ashr exact <2 x i64> %X, <i64 2, i64 2> |