File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
mlir/lib/Dialect/Affine/IR Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -2562,10 +2562,10 @@ bool mlir::affine::isAffineInductionVar(Value val) {
2562
2562
2563
2563
AffineForOp mlir::affine::getForInductionVarOwner (Value val) {
2564
2564
auto ivArg = llvm::dyn_cast<BlockArgument>(val);
2565
- if (!ivArg || !ivArg.getOwner ())
2565
+ if (!ivArg || !ivArg.getOwner () || !ivArg. getOwner ()-> getParent () )
2566
2566
return AffineForOp ();
2567
- auto *containingInst = ivArg. getOwner ()-> getParent ()-> getParentOp ();
2568
- if ( auto forOp = dyn_cast <AffineForOp>(containingInst ))
2567
+ if ( auto forOp =
2568
+ ivArg. getOwner ()-> getParent ()-> getParentOfType <AffineForOp>())
2569
2569
// Check to make sure `val` is the induction variable, not an iter_arg.
2570
2570
return forOp.getInductionVar () == val ? forOp : AffineForOp ();
2571
2571
return AffineForOp ();
You can’t perform that action at this time.
0 commit comments