-
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
Open
Sh0g0-1758
wants to merge
38
commits into
llvm:main
Choose a base branch
from
Sh0g0-1758:mlir-canon
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
[mlir] Add Normalize pass #162266
Changes from all commits
Commits
Show all changes
38 commits
Select commit
Hold shift + click to select a range
3897342
setup the normalize pass
Sh0g0-1758 5aa301b
reorder instructions
Sh0g0-1758 dda4e0b
rename op results
Sh0g0-1758 fe9a6fa
naming scheme
Sh0g0-1758 1a8ef2f
initial and regular operand renaming
Sh0g0-1758 48aa67b
rename without folding with hashing
Sh0g0-1758 8a9efd1
operation folding
Sh0g0-1758 c94e6e6
nit
Sh0g0-1758 dab3957
Merge branch 'llvm:main' into mlir-canon
Sh0g0-1758 8c487ff
operand reordering in alphabetical order
Sh0g0-1758 9c0e866
refactor impl
Sh0g0-1758 0836dad
clang-format
Sh0g0-1758 ad15039
linux build fix
Sh0g0-1758 1256ff1
add reordering test
Sh0g0-1758 89218e9
add infinite loop test and fix block/func arg naming
Sh0g0-1758 f4d0c63
rename constants when used in an initial instruction
Sh0g0-1758 9ed096d
refactor repeated logic into foldOperations
Sh0g0-1758 bbbfe21
clang-format
Sh0g0-1758 22cdd91
fix infinite-loop test
Sh0g0-1758 76df868
nit
Sh0g0-1758 8387f1c
nit
Sh0g0-1758 1823295
test rename
Sh0g0-1758 7b590b0
adding usedef chain test
anant37289 9f86026
nit
Sh0g0-1758 2313810
add docs
Sh0g0-1758 57c0292
camelCase
Sh0g0-1758 9d8b682
fix redundant includes and namespacing
Sh0g0-1758 319bcae
nit
Sh0g0-1758 137f96c
nit
Sh0g0-1758 9049f11
nit
Sh0g0-1758 759e798
nit
Sh0g0-1758 4cfc8eb
nit
Sh0g0-1758 f663b14
early break
Sh0g0-1758 195f88e
use std::distance
Sh0g0-1758 ac6ce80
walk the module
Sh0g0-1758 d137381
Add side-effect testcases
anant37289 c9a742b
Merge branch 'main' into mlir-canon
Sh0g0-1758 bb41dc4
modify infinite-loop test into 2 variants with tree-like dependencies…
Sh0g0-1758 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 | ||
| ) |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.