mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 03:02:36 +01:00
[InstCombine][SVE] Skip scalable type for InstCombiner::getFlippedStrictnessPredicateAndConstant.
We cannot iterate on scalable vector, the number of elements is unknown at compile-time. Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D87918
This commit is contained in:
parent
4972772ef0
commit
3c26b4961e
@ -5260,8 +5260,8 @@ InstCombiner::getFlippedStrictnessPredicateAndConstant(CmpInst::Predicate Pred,
|
||||
// Bail out if the constant can't be safely incremented/decremented.
|
||||
if (!ConstantIsOk(CI))
|
||||
return llvm::None;
|
||||
} else if (auto *VTy = dyn_cast<VectorType>(Type)) {
|
||||
unsigned NumElts = cast<FixedVectorType>(VTy)->getNumElements();
|
||||
} else if (auto *FVTy = dyn_cast<FixedVectorType>(Type)) {
|
||||
unsigned NumElts = FVTy->getNumElements();
|
||||
for (unsigned i = 0; i != NumElts; ++i) {
|
||||
Constant *Elt = C->getAggregateElement(i);
|
||||
if (!Elt)
|
||||
|
11
test/Transforms/InstCombine/vscale_cmp.ll
Normal file
11
test/Transforms/InstCombine/vscale_cmp.ll
Normal file
@ -0,0 +1,11 @@
|
||||
; NOTE: Assertions have been autogenerated by utils/update_test_checks.py
|
||||
; RUN: opt < %s -instcombine -S | FileCheck %s
|
||||
|
||||
define <vscale x 2 x i1> @sge(<vscale x 2 x i8> %x) {
|
||||
; CHECK-LABEL: @sge(
|
||||
; CHECK-NEXT: [[CMP:%.*]] = icmp sge <vscale x 2 x i8> [[X:%.*]], zeroinitializer
|
||||
; CHECK-NEXT: ret <vscale x 2 x i1> [[CMP]]
|
||||
;
|
||||
%cmp = icmp sge <vscale x 2 x i8> %x, zeroinitializer
|
||||
ret <vscale x 2 x i1> %cmp
|
||||
}
|
Loading…
Reference in New Issue
Block a user