Skip to content

Commit 208d674

Browse files
committed
divsi -> floordivsi
1 parent 80b45cc commit 208d674

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

mlir/lib/Dialect/Arith/IR/ValueBoundsOpInterfaceImpl.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,12 @@ struct MulIOpInterface
7575
}
7676
};
7777

78-
struct DivSIOpInterface
79-
: public ValueBoundsOpInterface::ExternalModel<DivSIOpInterface, DivSIOp> {
78+
struct FloorDivSIOpInterface
79+
: public ValueBoundsOpInterface::ExternalModel<FloorDivSIOpInterface,
80+
FloorDivSIOp> {
8081
void populateBoundsForIndexValue(Operation *op, Value value,
8182
ValueBoundsConstraintSet &cstr) const {
82-
auto divSIOp = cast<DivSIOp>(op);
83+
auto divSIOp = cast<FloorDivSIOp>(op);
8384
assert(value == divSIOp.getResult() && "invalid value");
8485

8586
AffineExpr lhs = cstr.getExpr(divSIOp.getLhs());
@@ -170,7 +171,7 @@ void mlir::arith::registerValueBoundsOpInterfaceExternalModels(
170171
arith::ConstantOp::attachInterface<arith::ConstantOpInterface>(*ctx);
171172
arith::SubIOp::attachInterface<arith::SubIOpInterface>(*ctx);
172173
arith::MulIOp::attachInterface<arith::MulIOpInterface>(*ctx);
173-
arith::DivSIOp::attachInterface<arith::DivSIOpInterface>(*ctx);
174+
arith::FloorDivSIOp::attachInterface<arith::FloorDivSIOpInterface>(*ctx);
174175
arith::SelectOp::attachInterface<arith::SelectOpInterface>(*ctx);
175176
});
176177
}

mlir/test/Dialect/Arith/value-bounds-op-interface-impl.mlir

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,21 +66,21 @@ func.func @arith_muli_non_pure(%a: index, %b: index) -> index {
6666
// -----
6767

6868
// CHECK: #[[$map:.*]] = affine_map<()[s0] -> (s0 floordiv 5)>
69-
// CHECK-LABEL: func @arith_divsi(
69+
// CHECK-LABEL: func @arith_floordivsi(
7070
// CHECK-SAME: %[[a:.*]]: index
7171
// CHECK: %[[apply:.*]] = affine.apply #[[$map]]()[%[[a]]]
7272
// CHECK: return %[[apply]]
73-
func.func @arith_divsi(%a: index) -> index {
73+
func.func @arith_floordivsi(%a: index) -> index {
7474
%0 = arith.constant 5 : index
75-
%1 = arith.divsi %a, %0 : index
75+
%1 = arith.floordivsi %a, %0 : index
7676
%2 = "test.reify_bound"(%1) : (index) -> (index)
7777
return %2 : index
7878
}
7979

8080
// -----
8181

82-
func.func @arith_divsi_non_pure(%a: index, %b: index) -> index {
83-
%0 = arith.divsi %a, %b : index
82+
func.func @arith_floordivsi_non_pure(%a: index, %b: index) -> index {
83+
%0 = arith.floordivsi %a, %b : index
8484
// Semi-affine expressions (such as "symbol * symbol") are not supported.
8585
// expected-error @below{{could not reify bound}}
8686
%1 = "test.reify_bound"(%0) : (index) -> (index)

0 commit comments

Comments
 (0)