[ConstraintElimination] Skip compares with scalable vector types.
Materializing scalable vectors with boolean values is not implemented yet. Skip those cases for now and leave a TODO.
This commit is contained in:
parent
40e9947317
commit
74d8628cf7
|
@ -754,6 +754,13 @@ static Constant *getScalarConstOrSplat(ConstantInt *C, Type *Ty) {
|
|||
|
||||
static bool checkAndReplaceCondition(CmpInst *Cmp, ConstraintInfo &Info) {
|
||||
LLVM_DEBUG(dbgs() << "Checking " << *Cmp << "\n");
|
||||
|
||||
// TODO: Implement splat of boolean value for scalable vectors.
|
||||
if (isa<ScalableVectorType>(Cmp->getType())) {
|
||||
LLVM_DEBUG(dbgs() << " skipping due to scalable vectors\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
CmpInst::Predicate Pred = Cmp->getPredicate();
|
||||
Value *A = Cmp->getOperand(0);
|
||||
Value *B = Cmp->getOperand(1);
|
||||
|
|
|
@ -34,3 +34,26 @@ define <2 x i1> @test.vectorgep.ult.false(<2 x ptr> %vec) {
|
|||
%t.1 = icmp ult <2 x ptr> %gep.1, %vec
|
||||
ret <2 x i1> %t.1
|
||||
}
|
||||
|
||||
|
||||
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> [[T_1]]
|
||||
;
|
||||
%gep.1 = getelementptr inbounds i32, <vscale x 2 x ptr> %vec, i64 1
|
||||
%t.1 = icmp ult <vscale x 2 x ptr> %vec, %gep.1
|
||||
ret <vscale x 2 x i1> %t.1
|
||||
}
|
||||
|
||||
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> [[T_1]]
|
||||
;
|
||||
%gep.1 = getelementptr inbounds i32, <vscale x 2 x ptr> %vec, i64 1
|
||||
%t.1 = icmp ult <vscale x 2 x ptr> %gep.1, %vec
|
||||
ret <vscale x 2 x i1> %t.1
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue