@@ -3167,38 +3167,19 @@ LogicalResult ScanOp::verify() {
31673167 return emitError (
31683168 " Exactly one of EXCLUSIVE or INCLUSIVE clause is expected" );
31693169 }
3170- const OperandRange &scanVars =
3171- hasExclusiveVars () ? getExclusiveVars () : getInclusiveVars ();
3172- auto verifyScanVarsInReduction = [&scanVars](ValueRange reductionVars) {
3173- for (const auto &it : scanVars)
3174- if (!llvm::is_contained (reductionVars, it))
3175- return false ;
3176- return true ;
3177- };
31783170 if (mlir::omp::WsloopOp parentWsLoopOp =
31793171 (*this )->getParentOfType <mlir::omp::WsloopOp>()) {
31803172 if (parentWsLoopOp.getReductionModAttr () &&
31813173 parentWsLoopOp.getReductionModAttr ().getValue () ==
31823174 mlir::omp::ReductionModifier::inscan) {
3183- auto iface = llvm::cast<mlir::omp::BlockArgOpenMPOpInterface>(
3184- parentWsLoopOp.getOperation ());
3185- if (!verifyScanVarsInReduction (iface.getReductionBlockArgs ())) {
3186- return emitError (
3187- " List item should appear in REDUCTION clause of the parent" );
3188- }
31893175 return success ();
31903176 }
3191- } else if (mlir::omp::SimdOp parentSimdOp =
3192- (*this )->getParentOfType <mlir::omp::SimdOp>()) {
3177+ }
3178+ if (mlir::omp::SimdOp parentSimdOp =
3179+ (*this )->getParentOfType <mlir::omp::SimdOp>()) {
31933180 if (parentSimdOp.getReductionModAttr () &&
31943181 parentSimdOp.getReductionModAttr ().getValue () ==
31953182 mlir::omp::ReductionModifier::inscan) {
3196- auto iface = llvm::cast<mlir::omp::BlockArgOpenMPOpInterface>(
3197- parentSimdOp.getOperation ());
3198- if (!verifyScanVarsInReduction (iface.getReductionBlockArgs ())) {
3199- return emitError (
3200- " List item should appear in REDUCTION clause of the parent" );
3201- }
32023183 return success ();
32033184 }
32043185 }
0 commit comments