@@ -655,7 +655,7 @@ LogicalResult cir::CastOp::verify() {
655655 auto resComplexTy = mlir::dyn_cast<cir::ComplexType>(resType);
656656 if (!resComplexTy)
657657 return emitOpError () << " requires !cir.complex type for result" ;
658- if (srcType != resComplexTy.getElementTy ())
658+ if (srcType != resComplexTy.getElementType ())
659659 return emitOpError () << " requires source type match result element type" ;
660660 return success ();
661661 }
@@ -665,7 +665,7 @@ LogicalResult cir::CastOp::verify() {
665665 auto resComplexTy = mlir::dyn_cast<cir::ComplexType>(resType);
666666 if (!resComplexTy)
667667 return emitOpError () << " requires !cir.complex type for result" ;
668- if (srcType != resComplexTy.getElementTy ())
668+ if (srcType != resComplexTy.getElementType ())
669669 return emitOpError () << " requires source type match result element type" ;
670670 return success ();
671671 }
@@ -675,7 +675,7 @@ LogicalResult cir::CastOp::verify() {
675675 return emitOpError () << " requires !cir.complex type for source" ;
676676 if (!mlir::isa<cir::CIRFPTypeInterface>(resType))
677677 return emitOpError () << " requires !cir.float type for result" ;
678- if (srcComplexTy.getElementTy () != resType)
678+ if (srcComplexTy.getElementType () != resType)
679679 return emitOpError () << " requires source element type match result type" ;
680680 return success ();
681681 }
@@ -685,71 +685,66 @@ LogicalResult cir::CastOp::verify() {
685685 return emitOpError () << " requires !cir.complex type for source" ;
686686 if (!mlir::isa<cir::IntType>(resType))
687687 return emitOpError () << " requires !cir.int type for result" ;
688- if (srcComplexTy.getElementTy () != resType)
688+ if (srcComplexTy.getElementType () != resType)
689689 return emitOpError () << " requires source element type match result type" ;
690690 return success ();
691691 }
692692 case cir::CastKind::float_complex_to_bool: {
693693 auto srcComplexTy = mlir::dyn_cast<cir::ComplexType>(srcType);
694- if (!srcComplexTy ||
695- !mlir::isa<cir::CIRFPTypeInterface>(srcComplexTy.getElementTy ()))
694+ if (!srcComplexTy || !srcComplexTy.isFloatingPointComplex ())
696695 return emitOpError ()
697- << " requires !cir.complex<!cir.float> type for source" ;
696+ << " requires floating point !cir.complex type for source" ;
698697 if (!mlir::isa<cir::BoolType>(resType))
699698 return emitOpError () << " requires !cir.bool type for result" ;
700699 return success ();
701700 }
702701 case cir::CastKind::int_complex_to_bool: {
703702 auto srcComplexTy = mlir::dyn_cast<cir::ComplexType>(srcType);
704- if (!srcComplexTy || !mlir::isa<cir::IntType>( srcComplexTy.getElementTy () ))
703+ if (!srcComplexTy || !srcComplexTy.isIntegerComplex ( ))
705704 return emitOpError ()
706- << " requires !cir.complex<!cir.float> type for source" ;
705+ << " requires floating point !cir.complex type for source" ;
707706 if (!mlir::isa<cir::BoolType>(resType))
708707 return emitOpError () << " requires !cir.bool type for result" ;
709708 return success ();
710709 }
711710 case cir::CastKind::float_complex: {
712711 auto srcComplexTy = mlir::dyn_cast<cir::ComplexType>(srcType);
713- if (!srcComplexTy ||
714- !mlir::isa<cir::CIRFPTypeInterface>(srcComplexTy.getElementTy ()))
712+ if (!srcComplexTy || !srcComplexTy.isFloatingPointComplex ())
715713 return emitOpError ()
716- << " requires !cir.complex<!cir.float> type for source" ;
714+ << " requires floating point !cir.complex type for source" ;
717715 auto resComplexTy = mlir::dyn_cast<cir::ComplexType>(resType);
718- if (!resComplexTy ||
719- !mlir::isa<cir::CIRFPTypeInterface>(resComplexTy.getElementTy ()))
716+ if (!resComplexTy || !resComplexTy.isFloatingPointComplex ())
720717 return emitOpError ()
721- << " requires !cir.complex<!cir.float> type for result" ;
718+ << " requires floating point !cir.complex type for result" ;
722719 return success ();
723720 }
724721 case cir::CastKind::float_complex_to_int_complex: {
725722 auto srcComplexTy = mlir::dyn_cast<cir::ComplexType>(srcType);
726- if (!srcComplexTy ||
727- !mlir::isa<cir::CIRFPTypeInterface>(srcComplexTy.getElementTy ()))
723+ if (!srcComplexTy || !srcComplexTy.isFloatingPointComplex ())
728724 return emitOpError ()
729- << " requires !cir.complex<!cir.float> type for source" ;
725+ << " requires floating point !cir.complex type for source" ;
730726 auto resComplexTy = mlir::dyn_cast<cir::ComplexType>(resType);
731- if (!resComplexTy || !mlir::isa<cir::IntType>( resComplexTy.getElementTy () ))
732- return emitOpError () << " requires !cir.complex<!cir.int> type for result" ;
727+ if (!resComplexTy || !resComplexTy.isIntegerComplex ( ))
728+ return emitOpError () << " requires integer !cir.complex type for result" ;
733729 return success ();
734730 }
735731 case cir::CastKind::int_complex: {
736732 auto srcComplexTy = mlir::dyn_cast<cir::ComplexType>(srcType);
737- if (!srcComplexTy || !mlir::isa<cir::IntType>( srcComplexTy.getElementTy () ))
738- return emitOpError () << " requires !cir.complex<!cir.int> type for source" ;
733+ if (!srcComplexTy || !srcComplexTy.isIntegerComplex ( ))
734+ return emitOpError () << " requires integer !cir.complex type for source" ;
739735 auto resComplexTy = mlir::dyn_cast<cir::ComplexType>(resType);
740- if (!resComplexTy || !mlir::isa<cir::IntType>( resComplexTy.getElementTy () ))
741- return emitOpError () << " requires !cir.complex<!cir.int> type for result" ;
736+ if (!resComplexTy || !resComplexTy.isIntegerComplex ( ))
737+ return emitOpError () << " requires integer !cir.complex type for result" ;
742738 return success ();
743739 }
744740 case cir::CastKind::int_complex_to_float_complex: {
745741 auto srcComplexTy = mlir::dyn_cast<cir::ComplexType>(srcType);
746- if (!srcComplexTy || !mlir::isa<cir::IntType>( srcComplexTy.getElementTy () ))
747- return emitOpError () << " requires !cir.complex<!cir.int> type for source" ;
742+ if (!srcComplexTy || !srcComplexTy.isIntegerComplex ( ))
743+ return emitOpError () << " requires integer !cir.complex type for source" ;
748744 auto resComplexTy = mlir::dyn_cast<cir::ComplexType>(resType);
749- if (!resComplexTy ||
750- !mlir::isa<cir::CIRFPTypeInterface>(resComplexTy.getElementTy ()))
745+ if (!resComplexTy || !resComplexTy.isFloatingPointComplex ())
751746 return emitOpError ()
752- << " requires !cir.complex<!cir.float> type for result" ;
747+ << " requires floating point !cir.complex type for result" ;
753748 return success ();
754749 }
755750 case cir::CastKind::member_ptr_to_bool: {
@@ -912,7 +907,7 @@ LogicalResult cir::DerivedMethodOp::verify() {
912907// ===----------------------------------------------------------------------===//
913908
914909LogicalResult cir::ComplexCreateOp::verify () {
915- if (getType ().getElementTy () != getReal ().getType ()) {
910+ if (getType ().getElementType () != getReal ().getType ()) {
916911 emitOpError ()
917912 << " operand type of cir.complex.create does not match its result type" ;
918913 return failure ();
@@ -945,7 +940,7 @@ OpFoldResult cir::ComplexCreateOp::fold(FoldAdaptor adaptor) {
945940// ===----------------------------------------------------------------------===//
946941
947942LogicalResult cir::ComplexRealOp::verify () {
948- if (getType () != getOperand ().getType ().getElementTy ()) {
943+ if (getType () != getOperand ().getType ().getElementType ()) {
949944 emitOpError () << " cir.complex.real result type does not match operand type" ;
950945 return failure ();
951946 }
@@ -960,7 +955,7 @@ OpFoldResult cir::ComplexRealOp::fold(FoldAdaptor adaptor) {
960955}
961956
962957LogicalResult cir::ComplexImagOp::verify () {
963- if (getType () != getOperand ().getType ().getElementTy ()) {
958+ if (getType () != getOperand ().getType ().getElementType ()) {
964959 emitOpError () << " cir.complex.imag result type does not match operand type" ;
965960 return failure ();
966961 }
@@ -984,7 +979,7 @@ LogicalResult cir::ComplexRealPtrOp::verify() {
984979 auto operandPointeeTy =
985980 mlir::cast<cir::ComplexType>(operandPtrTy.getPointee ());
986981
987- if (resultPointeeTy != operandPointeeTy.getElementTy ()) {
982+ if (resultPointeeTy != operandPointeeTy.getElementType ()) {
988983 emitOpError ()
989984 << " cir.complex.real_ptr result type does not match operand type" ;
990985 return failure ();
@@ -999,7 +994,7 @@ LogicalResult cir::ComplexImagPtrOp::verify() {
999994 auto operandPointeeTy =
1000995 mlir::cast<cir::ComplexType>(operandPtrTy.getPointee ());
1001996
1002- if (resultPointeeTy != operandPointeeTy.getElementTy ()) {
997+ if (resultPointeeTy != operandPointeeTy.getElementType ()) {
1003998 emitOpError ()
1004999 << " cir.complex.imag_ptr result type does not match operand type" ;
10051000 return failure ();
0 commit comments