Skip to content

Commit

Permalink
Address comments
Browse files Browse the repository at this point in the history
  • Loading branch information
josel-amd committed Sep 18, 2024
1 parent 276cbea commit c391a49
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion mlir/lib/Dialect/Affine/IR/AffineOps.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2806,7 +2806,8 @@ LogicalResult AffineIfOp::verify() {

// Verify that the operands are valid dimension/symbols.
if (failed(verifyDimAndSymbolIdentifiers(*this, getOperands(),
condition.getNumDims(), true)))
condition.getNumDims(),
/*allowNonAffineDimOperands=*/true)))
return failure();

return success();
Expand Down
4 changes: 3 additions & 1 deletion mlir/test/Dialect/Affine/invalid.mlir
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ func.func @affine_for_upper_bound_invalid_sym() {
func.func @affine_if_invalid_dim(%arg : index) {
affine.for %n0 = 0 to 7 {
%dim = arith.addi %arg, %arg : index

// Non-affine operand %dim has been made legal as input to affine.if.
// expected-error@+1 {{operand cannot be used as a symbol}}
affine.if #set0(%dim)[%n0] {}
}
return
Expand All @@ -108,6 +109,7 @@ func.func @affine_if_invalid_dim(%arg : index) {

func.func @affine_if_invalid_sym() {
affine.for %i0 = 0 to 7 {
// expected-error@+1 {{operand cannot be used as a symbol}}
affine.if #set0(%i0)[%i0] {}
}
return
Expand Down

0 comments on commit c391a49

Please sign in to comment.