-
Notifications
You must be signed in to change notification settings - Fork 15.3k
[mlir] Add Normalize pass #162266
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
[mlir] Add Normalize pass #162266
Changes from 26 commits
3897342
5aa301b
dda4e0b
fe9a6fa
1a8ef2f
48aa67b
8a9efd1
c94e6e6
dab3957
8c487ff
9c0e866
0836dad
ad15039
1256ff1
89218e9
f4d0c63
9ed096d
bbbfe21
22cdd91
76df868
8387f1c
1823295
7b590b0
9f86026
2313810
57c0292
9d8b682
319bcae
137f96c
9049f11
759e798
4cfc8eb
f663b14
195f88e
ac6ce80
d137381
c9a742b
bb41dc4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| //===- Normalize.h - Conversion from MLIR to its canonical form -*- C++ -*-===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #ifndef MLIR_CONVERSION_NORMALIZE_NORMALIZE_H | ||
| #define MLIR_CONVERSION_NORMALIZE_NORMALIZE_H | ||
|
|
||
| #include <memory> | ||
|
|
||
| namespace mlir { | ||
| class Pass; | ||
|
|
||
| #define GEN_PASS_DECL_NORMALIZE | ||
| #include "mlir/Conversion/Passes.h.inc" | ||
|
|
||
| } // namespace mlir | ||
|
|
||
| #endif // MLIR_CONVERSION_NORMALIZE_NORMALIZE_H |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -45,6 +45,7 @@ add_subdirectory(MemRefToLLVM) | |
| add_subdirectory(MemRefToSPIRV) | ||
| add_subdirectory(ShardToMPI) | ||
| add_subdirectory(MPIToLLVM) | ||
| add_subdirectory(Normalize) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just +1 to Alex's point that this isn't a Conversion in MLIR terminology (https://mlir.llvm.org/getting_started/Glossary/#conversion). Transforms could be better spot, although I was indeed also wondering if in Tools directory wouldn't be better as it is rather specific when one runs this. |
||
| add_subdirectory(NVGPUToNVVM) | ||
| add_subdirectory(NVVMToLLVM) | ||
| add_subdirectory(OpenACCToSCF) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| add_mlir_conversion_library(MLIRNormalize | ||
| Normalize.cpp | ||
|
|
||
| ADDITIONAL_HEADER_DIRS | ||
| ${MLIR_MAIN_INCLUDE_DIR}/mlir/Conversion/Normalize | ||
|
|
||
| DEPENDS | ||
| MLIRConversionPassIncGen | ||
|
|
||
| LINK_COMPONENTS | ||
| Core | ||
|
|
||
| LINK_LIBS PUBLIC | ||
| MLIRArithDialect | ||
| MLIRControlFlowDialect | ||
| MLIRFuncDialect | ||
| MLIRLLVMDialect | ||
| MLIRMathDialect | ||
| MLIRPass | ||
| MLIRSCFDialect | ||
| MLIRTransforms | ||
| MLIRVectorDialect | ||
| MLIRVectorUtils | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it required to be a ModuleOp pass? Does it need to be at symbol table scope?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well we do need the top-level module operation to collect all the output operations and thus reorder/rename regular/initial operations if they have not been visited earlier by another output operation using them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't quite follow this. I may be missing what you are saying as I think this is true and could work even for functions/doesn't even need to be on top-level ops. But it does need to (correct me if I'm wrong) run sequentially due to rng update ordering.