Commit Graph
8 Commits
Author SHA1 Message Date
Jacques Pienaar 58b44c8102 Reapply "Reapply "[mlir-query] Add function extraction feature to mlir-query""
Fix ASAN by erasing the op extracted post printing.

This reverts commit 732a5cba8c.
2024-03-03 05:56:56 -08:00
Jacques Pienaar 732a5cba8c Revert "Reapply "[mlir-query] Add function extraction feature to mlir-query""
Commit fails on sanitizers.

This reverts commit 22f34ea3b0.
2024-03-03 05:22:41 -08:00
Jacques Pienaar 22f34ea3b0 Reapply "[mlir-query] Add function extraction feature to mlir-query"
Fix build deps.

This reverts commit de55c2f869.
2024-03-03 03:37:10 -08:00
Mehdi Amini de55c2f869 Revert "[mlir-query] Add function extraction feature to mlir-query"
This reverts commit c66f2d0c4a.

The bot is broken.
2024-02-29 13:14:00 -08:00
Devajith Valaparambil Sreeramaswamy c66f2d0c4a [mlir-query] Add function extraction feature to mlir-query
This enables specifying the extract modifier to extract all matches into
a function. This currently does this very directly by converting all
operands to function arguments (ones due to results of other matched ops
are dropped) and all results as return values.

Differential Revision: https://reviews.llvm.org/D158693
2024-02-29 07:46:49 -08:00
Kazu Hirata abaa79b25d [mlir] Use StringRef::ltrim (NFC) 2024-01-08 21:49:32 -08:00
Kazu Hirata 88d319a29f [mlir] Use StringRef::{starts,ends}_with (NFC)
This patch replaces uses of StringRef::{starts,ends}with with
StringRef::{starts,ends}_with for consistency with
std::{string,string_view}::{starts,ends}_with in C++20.

I'm planning to deprecate and eventually remove
StringRef::{starts,ends}with.
2023-12-13 22:58:30 -08:00
Devajith 02d9f4d1f1 [mlir][mlir-query] Introduce mlir-query tool with autocomplete support
This commit adds the initial version of the mlir-query tool, which leverages the pre-existing matchers defined in mlir/include/mlir/IR/Matchers.h

The tool provides the following set of basic queries:

hasOpAttrName(string)
hasOpName(string)
isConstantOp()
isNegInfFloat()
isNegZeroFloat()
isNonZero()
isOne()
isOneFloat()
isPosInfFloat()
isPosZeroFloat()
isZero()
isZeroFloat()

Reviewed By: jpienaar

Differential Revision: https://reviews.llvm.org/D155127
2023-10-13 14:03:27 -07:00