From 643f7199058e12c5d32da5752b940f569a58c3c9 Mon Sep 17 00:00:00 2001 From: Rob Suderman Date: Wed, 7 Aug 2024 18:10:58 -0700 Subject: [PATCH] Add canonicalization pass for torch import (#18150) It is possible for post decomposition that there will be available canonicalizations. Added the pass to support the cleanup. --- compiler/plugins/input/Torch/InputConversion/Passes.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/compiler/plugins/input/Torch/InputConversion/Passes.cpp b/compiler/plugins/input/Torch/InputConversion/Passes.cpp index 8f51c617a357..00ab1a444854 100644 --- a/compiler/plugins/input/Torch/InputConversion/Passes.cpp +++ b/compiler/plugins/input/Torch/InputConversion/Passes.cpp @@ -50,6 +50,7 @@ void createTorchToIREEPipeline( pm.addNestedPass( torch::Torch::createDecomposeComplexOpsPass(emptyArrayRef)); pm.addNestedPass(torch::Torch::createFuseQuantizedOpsPass()); + pm.addNestedPass(createCanonicalizerPass()); pm.addNestedPass(torch::Torch::createScalarizeShapesPass()); pm.addNestedPass(torch::createConvertTorchToTMTensorPass()); pm.addNestedPass(