@@ -360,8 +360,8 @@ void cir::ConditionOp::getSuccessorRegions(
360360 regions.emplace_back (&await.getSuspend (), await.getSuspend ().getArguments ());
361361}
362362
363- MutableOperandRange cir::ConditionOp::getMutableSuccessorOperands (
364- RegionSuccessor /* successor*/ ) {
363+ MutableOperandRange
364+ cir::ConditionOp::getMutableSuccessorOperands ( RegionSuccessor /* successor*/ ) {
365365 // No values are yielded to the successor region.
366366 return MutableOperandRange (getOperation (), 0 , 0 );
367367}
@@ -944,14 +944,23 @@ OpFoldResult cir::ComplexCreateOp::fold(FoldAdaptor adaptor) {
944944// ===----------------------------------------------------------------------===//
945945
946946LogicalResult cir::ComplexRealOp::verify () {
947- if (getType () != getOperand ().getType ().getElementType ()) {
947+ mlir::Type operandTy = getOperand ().getType ();
948+ if (auto complexOperandTy = mlir::dyn_cast<cir::ComplexType>(operandTy)) {
949+ operandTy = complexOperandTy.getElementType ();
950+ }
951+
952+ if (getType () != operandTy) {
948953 emitOpError () << " : result type does not match operand type" ;
949954 return failure ();
950955 }
956+
951957 return success ();
952958}
953959
954960OpFoldResult cir::ComplexRealOp::fold (FoldAdaptor adaptor) {
961+ if (!mlir::isa<cir::ComplexType>(getOperand ().getType ()))
962+ return nullptr ;
963+
955964 if (auto complexCreateOp = getOperand ().getDefiningOp <cir::ComplexCreateOp>())
956965 return complexCreateOp.getOperand (0 );
957966
@@ -1525,8 +1534,7 @@ void cir::ScopeOp::getSuccessorRegions(
15251534 mlir::RegionBranchPoint point, SmallVectorImpl<RegionSuccessor> ®ions) {
15261535 // The only region always branch back to the parent operation.
15271536 if (!point.isParent ()) {
1528- regions.push_back (
1529- RegionSuccessor (getOperation (), this ->getODSResults (0 )));
1537+ regions.push_back (RegionSuccessor (getOperation (), this ->getODSResults (0 )));
15301538 return ;
15311539 }
15321540
@@ -1787,8 +1795,8 @@ void cir::TernaryOp::build(
17871795// YieldOp
17881796// ===----------------------------------------------------------------------===//
17891797
1790- MutableOperandRange cir::YieldOp::getMutableSuccessorOperands (
1791- RegionSuccessor successor) {
1798+ MutableOperandRange
1799+ cir::YieldOp::getMutableSuccessorOperands ( RegionSuccessor successor) {
17921800 Operation *op = getOperation ();
17931801 if (auto loop = dyn_cast<LoopOpInterface>(op->getParentOp ())) {
17941802 if (op->getParentRegion () == &loop.getCond ())
0 commit comments