@@ -13,25 +13,19 @@ See the License for the specific language governing permissions and
1313limitations under the License.
1414==============================================================================*/
1515
16- #include " shardy/dialect/sdy/transforms/import/apply_sharding_constraints.h"
17-
1816#include < cassert>
1917#include < functional>
20- #include < memory>
2118
2219#include " llvm/ADT/STLExtras.h"
23- #include " llvm/Support/CommandLine.h"
2420#include " mlir/IR/Builders.h"
2521#include " mlir/IR/BuiltinAttributes.h"
2622#include " mlir/IR/BuiltinOps.h"
2723#include " mlir/IR/MLIRContext.h"
2824#include " mlir/IR/Value.h"
2925#include " mlir/IR/ValueRange.h"
30- #include " mlir/Pass/Pass.h"
3126#include " mlir/Support/LLVM.h"
3227#include " shardy/dialect/sdy/ir/dialect.h"
3328#include " shardy/dialect/sdy/ir/utils.h"
34- #include " shardy/dialect/sdy/transforms/common/propagation_options.h"
3529#include " shardy/dialect/sdy/transforms/import/passes.h" // IWYU pragma: keep
3630#include " shardy/dialect/sdy/transforms/propagation/debugging/source_sharding.h"
3731#include " shardy/dialect/sdy/transforms/propagation/op_sharding_rule_registry.h"
@@ -239,14 +233,7 @@ struct ApplyShardingConstraintsPass
239233 ApplyShardingConstraintsPass (const ApplyShardingConstraintsPass& other)
240234 : ApplyShardingConstraintsPassBase<ApplyShardingConstraintsPass>(other) {
241235 debugShardingOrigins = other.debugShardingOrigins ;
242- debugPropagationEdgeSharding = other.debugPropagationEdgeSharding ;
243- }
244-
245- // Constructor to be used when creating the pass programmatically with
246- // options.
247- explicit ApplyShardingConstraintsPass (const PropagationOptions& options) {
248- debugShardingOrigins = options.debugShardingOrigins ;
249- debugPropagationEdgeSharding = options.debugPropagationEdgeSharding ;
236+ debugPropagationEdges = other.debugPropagationEdges ;
250237 }
251238
252239 void runOnOperation () final {
@@ -255,7 +242,7 @@ struct ApplyShardingConstraintsPass
255242
256243 // Prepare debugging handler for sharding origins and edge sources.
257244 ShardingDebugMappings mappings (debugShardingOrigins,
258- debugPropagationEdgeSharding );
245+ debugPropagationEdges );
259246 SourceShardingHandler handler (&mappings);
260247 // Prepare the handler and register it to the context.
261248 handler.prepareHandler (moduleOp);
@@ -315,26 +302,9 @@ struct ApplyShardingConstraintsPass
315302 context.registerActionHandler (nullptr );
316303 handler.saveOnModule (moduleOp);
317304 }
318-
319- Option<bool > debugShardingOrigins{
320- *this , " debug-sharding-origins" ,
321- llvm::cl::desc (" whether to save sharding origin information" ),
322- llvm::cl::init (false )};
323-
324- Option<bool > debugPropagationEdgeSharding{
325- *this , " debug-propagation-edge-sharding" ,
326- llvm::cl::desc (" whether to save propagation edge information" ),
327- llvm::cl::init (false )};
328305};
329306
330307} // namespace
331308
332- // This function can be used to create the pass with specific options
333- // programmatically.
334- std::unique_ptr<Pass> createApplyShardingConstraintsPass (
335- const PropagationOptions& options) {
336- return std::make_unique<ApplyShardingConstraintsPass>(options);
337- }
338-
339309} // namespace sdy
340310} // namespace mlir
0 commit comments