Skip to content

Commit

Permalink
Move the statement out of assertion.
Browse files Browse the repository at this point in the history
Signed-off-by: hanhanW <[email protected]>
  • Loading branch information
hanhanW committed Jan 13, 2025
1 parent 24b9679 commit c2756a0
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -193,9 +193,13 @@ static LogicalResult duplicateExecutablesPerAffinityVariant(
SmallVector<Attribute> newEntryPoints;
SmallVector<IREE::Stream::AffinityAttr> execAffinities;
// Sanity checks. It should already meet the requirement because they are
// checked in step 1.
assert(affinityAnalysis.tryLookupExecutionAffinity(dispatchOp,
execAffinities));
// checked in step 1. This can not be wrapped by an assertion because it
// could be dropped by compiler.
if (!affinityAnalysis.tryLookupExecutionAffinity(dispatchOp,
execAffinities)) {
return failure();
}

assert(execAffinities.size() == 1);
SmallVector<Attribute> operandAttrs = resourceAffinities[dispatchOp];
dispatchOp.forEachEntryPointAttr([&](SymbolRefAttr entryPoint) {
Expand Down

0 comments on commit c2756a0

Please sign in to comment.