@@ -3309,12 +3309,13 @@ LogicalResult OperationConverter::convertOperations(ArrayRef<Operation *> ops) {
3309
3309
// / Try to reconcile all given UnrealizedConversionCastOps and store the
3310
3310
// / left-over ops in `remainingCastOps` (if provided). See documentation in
3311
3311
// / DialectConversion.h for more details.
3312
- // / The `isCastOpOfInterestFn` is used to filter the cast ops to proceed: the algorithm may
3313
- // / visit an operand (or user) which is a cast op, but will not try to reconcile it if not in the
3314
- // / filtered set.
3312
+ // / The `isCastOpOfInterestFn` is used to filter the cast ops to proceed: the
3313
+ // / algorithm may visit an operand (or user) which is a cast op, but will not
3314
+ // / try to reconcile it if not in the filtered set.
3315
3315
template <typename RangeT>
3316
3316
static void reconcileUnrealizedCastsImpl (
3317
- RangeT castOps, function_ref<bool (UnrealizedConversionCastOp)> isCastOpOfInterestFn,
3317
+ RangeT castOps,
3318
+ function_ref<bool (UnrealizedConversionCastOp)> isCastOpOfInterestFn,
3318
3319
SmallVectorImpl<UnrealizedConversionCastOp> *remainingCastOps) {
3319
3320
// A worklist of cast ops to process.
3320
3321
SetVector<UnrealizedConversionCastOp> worklist (llvm::from_range, castOps);
@@ -3375,21 +3376,23 @@ static void reconcileUnrealizedCastsImpl(
3375
3376
// Successfully inserted: process reachable input cast ops.
3376
3377
for (Value v : op->getOperands ())
3377
3378
if (auto castOp = v.getDefiningOp <UnrealizedConversionCastOp>())
3378
- if (isCastOpFn (castOp))
3379
+ if (isCastOpOfInterestFn (castOp))
3379
3380
worklist.push_back (castOp);
3380
3381
}
3381
3382
}
3382
3383
};
3383
3384
3384
3385
// Find all alive cast ops.
3385
3386
for (UnrealizedConversionCastOp op : castOps) {
3386
- // The op may have been marked live already as being an operand of another live cast op.
3387
- if (liveOps.contains (op.getOperation ()) continue ;
3387
+ // The op may have been marked live already as being an operand of another
3388
+ // live cast op.
3389
+ if (liveOps.contains (op.getOperation ()))
3390
+ continue ;
3388
3391
// If any of the users is not a cast op, mark the current op (and its
3389
3392
// input ops) as live.
3390
3393
if (llvm::any_of (op->getUsers (), [&](Operation *user) {
3391
3394
auto castOp = dyn_cast<UnrealizedConversionCastOp>(user);
3392
- return !castOp || !isCastOpFn (castOp);
3395
+ return !castOp || !isCastOpOfInterestFn (castOp);
3393
3396
}))
3394
3397
markOpLive (op);
3395
3398
}
0 commit comments