@@ -611,16 +611,16 @@ struct UIToFPI1Pattern final : public OpConversionPattern<arith::UIToFPOp> {
611611// IndexCastOp
612612// ===----------------------------------------------------------------------===//
613613
614- // / Converts arith.index_cast to spirv.Select if the source type is i1
614+ // / Converts arith.index_cast to spirv.Select if the source type is i1.
615615struct IndexCastI1IndexPattern final
616616 : public OpConversionPattern<arith::IndexCastOp> {
617617 using OpConversionPattern::OpConversionPattern;
618618
619619 LogicalResult
620620 matchAndRewrite (arith::IndexCastOp op, OpAdaptor adaptor,
621621 ConversionPatternRewriter &rewriter) const override {
622- Type srcType = adaptor.getOperands (). front ().getType ();
623- if (!srcType. isInteger ( 1 ))
622+ Type srcType = adaptor.getIn ().getType ();
623+ if (!isBoolScalarOrVector (srcType ))
624624 return failure ();
625625
626626 Type dstType = getTypeConverter ()->convertType (op.getType ());
@@ -631,7 +631,7 @@ struct IndexCastI1IndexPattern final
631631 Value zero = spirv::ConstantOp::getZero (dstType, loc, rewriter);
632632 Value one = spirv::ConstantOp::getOne (dstType, loc, rewriter);
633633 rewriter.replaceOpWithNewOp <spirv::SelectOp>(
634- op, dstType, adaptor.getOperands (). front (), one, zero);
634+ op, dstType, adaptor.getIn (), one, zero);
635635 return success ();
636636 }
637637};
0 commit comments