-
Notifications
You must be signed in to change notification settings - Fork 201
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[C++ bridge] Switch from using arith ops to cc.cast (#1978)
* [C++ bridge] Switch from using arith ops to cc.cast The arith dialect provides a big menu of casting/conversion operations that we can use but which have their own rules and semantics. For example, the generation of a quantum circuit can involve aggressive constant propagation. By using an operation in a dialect we control (CC), we can implement folding and combing these operations in ways that are suitable to our domain and do not rely on decisions in the MLIR code that may be too conservative or too aggressive for our needs. [core] Add constant folding of cc.cast operations. These constant folding operations will eliminate cc.cast operations when they are converting the type of a constant input op. Update the tests. Add pattern to eliminate integer casts into an integer comparison. Add constant folding of complex.create. Apparently MLIR doesn't do this. Add cast complex to complex and various constant foldings. Add a new test. Add codegen expansion pattern. * Convert test to work with ARM.
- Loading branch information
1 parent
2bf1cb6
commit 20e78b8
Showing
29 changed files
with
587 additions
and
265 deletions.
There are no files selected for viewing
This file contains 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 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 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 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
Oops, something went wrong.