Use drop_begin (NFC)
[mlir] move SCF headers to SCF/{IR,Transforms} respectivelyThis aligns the SCF dialect file layout with the majority of the dialects.Reviewed By: jpienaarDifferential Revision: https://reviews.
[mlir] move SCF headers to SCF/{IR,Transforms} respectivelyThis aligns the SCF dialect file layout with the majority of the dialects.Reviewed By: jpienaarDifferential Revision: https://reviews.llvm.org/D128049
show more ...
[mlir] Update accessors to prefixed form (NFC)Follow up from flipping dialects to both, flip accessor used to prefixedvariant ahead to flipping from _Both to _Prefixed. This just flips tothe acce
[mlir] Update accessors to prefixed form (NFC)Follow up from flipping dialects to both, flip accessor used to prefixedvariant ahead to flipping from _Both to _Prefixed. This just flips tothe accessors introduced in the preceding change which are just prefixedforms of the existing accessor changed from.Mechanical change using helper scripthttps://github.com/jpienaar/llvm-project/blob/main/clang-tools-extra/clang-tidy/misc/AddGetterCheck.cpp and clang-format.
[mlir] (NFC) Clean up bazel and CMake target namesAll dialect targets in bazel have been named *Dialect and all dialecttargets in CMake have been named MLIR*Dialect.
[mlir][emitc] Add a cast opThis adds a cast operation that allows to perform an explicit typeconversion. The cast op is emitted as a C-style cast. It can be appliedto integer, float, index and Em
[mlir][emitc] Add a cast opThis adds a cast operation that allows to perform an explicit typeconversion. The cast op is emitted as a C-style cast. It can be appliedto integer, float, index and EmitC types.Reviewed By: jpienaarDifferential Revision: https://reviews.llvm.org/D123514
[mlir][NFC] Shift a bunch of dialect includes from the .h to the .cppNow that dialect constructors are generated in the .cpp file, we candrop all of the dependent dialect includes from the .h file
[mlir][NFC] Shift a bunch of dialect includes from the .h to the .cppNow that dialect constructors are generated in the .cpp file, we candrop all of the dependent dialect includes from the .h file.Differential Revision: https://reviews.llvm.org/D124298
[mlir][emitc] Adapt to move of FuncOpReviewed By: rriddleDifferential Revision: https://reviews.llvm.org/D122305
[mlir:FunctionOpInterface] Rename the "type" attribute to "function_type"This removes any potential confusion with the `getType` accessorswhich correspond to SSA results of an operation, and makes
[mlir:FunctionOpInterface] Rename the "type" attribute to "function_type"This removes any potential confusion with the `getType` accessorswhich correspond to SSA results of an operation, and makes itclear what the intent is (i.e. to represent the type of the function).Differential Revision: https://reviews.llvm.org/D121762
[mlir][NFC] Move Translation.h to a Tools/mlir-translate directoryTranslation.h is currently awkwardly shoved into the top-level mlir, even though it isspecific to the mlir-translate tool. This co
[mlir][NFC] Move Translation.h to a Tools/mlir-translate directoryTranslation.h is currently awkwardly shoved into the top-level mlir, even though it isspecific to the mlir-translate tool. This commit moves it to a new Tools/mlir-translatedirectory, which is intended for libraries used to implement tools. It also splits thetranslate registry from the main entry point, to more closely mirror what mlir-optdoes.Differential Revision: https://reviews.llvm.org/D121026
[mlir] Rename the Standard dialect to the Func dialectThe last remaining operations in the standard dialect all revolve aroundFuncOp/function related constructs. This patch simply handles the init
[mlir] Rename the Standard dialect to the Func dialectThe last remaining operations in the standard dialect all revolve aroundFuncOp/function related constructs. This patch simply handles the initialrenaming (which by itself is already huge), but there are a large numberof cleanups unlocked/necessary afterwards:* Removing a bunch of unnecessary dependencies on Func* Cleaning up the From/ToStandard conversion passes* Preparing for the move of FuncOp to the Func dialectSee the discussion at https://discourse.llvm.org/t/standard-dialect-the-final-chapter/6061Differential Revision: https://reviews.llvm.org/D120624
[mlir][emitc] Add a variable opThis adds a variable op, emitted as C/C++ locale variable, which can beused if the `emitc.constant` op is not sufficient.As an example, the canonicalization pass w
[mlir][emitc] Add a variable opThis adds a variable op, emitted as C/C++ locale variable, which can beused if the `emitc.constant` op is not sufficient.As an example, the canonicalization pass would transform```mlir%0 = "emitc.constant"() {value = 0 : i32} : () -> i32%1 = "emitc.constant"() {value = 0 : i32} : () -> i32%2 = emitc.apply "&"(%0) : (i32) -> !emitc.ptr<i32>%3 = emitc.apply "&"(%1) : (i32) -> !emitc.ptr<i32>emitc.call "write"(%2, %3) : (!emitc.ptr<i32>, !emitc.ptr<i32>) -> ()```into```mlir%0 = "emitc.constant"() {value = 0 : i32} : () -> i32%1 = emitc.apply "&"(%0) : (i32) -> !emitc.ptr<i32>%2 = emitc.apply "&"(%0) : (i32) -> !emitc.ptr<i32>emitc.call "write"(%1, %2) : (!emitc.ptr<i32>, !emitc.ptr<i32>) -> ()```resulting in pointer aliasing, as %1 and %2 point to the same address.In such a case, the `emitc.variable` operation can be used instead.Reviewed By: jpienaarDifferential Revision: https://reviews.llvm.org/D120098
[mlir][emitc] Add a pointer typeAdds a pointer type to EmitC. The emission of pointers is so far onlypossible by using the `emitc.opaque` typeCo-authored-by: Simon Camphausen <simon.camphausen@i
[mlir][emitc] Add a pointer typeAdds a pointer type to EmitC. The emission of pointers is so far onlypossible by using the `emitc.opaque` typeCo-authored-by: Simon Camphausen <[email protected]>Reviewed By: jpienaarDifferential Revision: https://reviews.llvm.org/D119337
[mlir] Add missing dep to new cf dialect
[mlir] Split out a new ControlFlow dialect from StandardThis dialect is intended to model lower level/branch based control-flow constructs. The initial setof operations are: AssertOp, BranchOp, Co
[mlir] Split out a new ControlFlow dialect from StandardThis dialect is intended to model lower level/branch based control-flow constructs. The initial setof operations are: AssertOp, BranchOp, CondBranchOp, SwitchOp; all split out from the currentstandard dialect.See https://discourse.llvm.org/t/standard-dialect-the-final-chapter/6061Differential Revision: https://reviews.llvm.org/D118966
[mlir:Standard] Remove support for creating a `unit` ConstantOpThis is completely unused upstream, and does not really have well defined semanticson what this is supposed to do/how this fits into
[mlir:Standard] Remove support for creating a `unit` ConstantOpThis is completely unused upstream, and does not really have well defined semanticson what this is supposed to do/how this fits into the ecosystem. Given that, as part ofsplitting up the standard dialect it's best to just remove this behavior, instead of tryto awkwardly fit it somewhere upstream. Downstream users are encouraged todefine their own operations that clearly can define the semantics of this.This also uncovered several lingering uses of ConstantOp that weren'tupdated to use arith::ConstantOp, and worked during conversions becausethe constant was removed/converted into something else beforeverification.See https://llvm.discourse.group/t/standard-dialect-the-final-chapter/ for more discussion.Differential Revision: https://reviews.llvm.org/D118654
[mlir] Don't emit unused labelsStop the Cpp target from emitting unused labels. The previosly generatedcode generated warning if `-Wunused-label` is passed to a compiler.Co-authored-by: Simon Ca
[mlir] Don't emit unused labelsStop the Cpp target from emitting unused labels. The previosly generatedcode generated warning if `-Wunused-label` is passed to a compiler.Co-authored-by: Simon Camphausen <[email protected]>Reviewed By: jpienaarDifferential Revision: https://reviews.llvm.org/D118154
Apply clang-tidy fixes for performance-unnecessary-value-param to MLIR (NFC)
Apply clang-tidy fixes for performance-move-const-arg to MLIR (NFC)
Apply clang-tidy fixes for performance-unnecessary-value-param to MLIR (NFC)Reviewed By: MogballDifferential Revision: https://reviews.llvm.org/D116250
[mlir] Switching accessors to prefixed form (NFC)Makes eventual prefixing flag flip smaller change.
[mlir] Convert NamedAttribute to be a classNamedAttribute is currently represented as an std::pair, but thiscreates an extremely clunky .first/.second API. This commitconverts it to a class, with
[mlir] Convert NamedAttribute to be a classNamedAttribute is currently represented as an std::pair, but thiscreates an extremely clunky .first/.second API. This commitconverts it to a class, with better accessors (getName/getValue)and also opens the door for more convenient API in the future.Differential Revision: https://reviews.llvm.org/D113956
[mlir] Replace usages of Identifier with StringAttrIdentifier and StringAttr essentially serve the same purpose, i.e. to hold a string value. Keeping these seemingly identical pieces of functionali
[mlir] Replace usages of Identifier with StringAttrIdentifier and StringAttr essentially serve the same purpose, i.e. to hold a string value. Keeping these seemingly identical pieces of functionality separate has caused problems in certain situations:* Identifier has nice accessors that StringAttr doesn't* Identifier can't be used as an Attribute, meaning strings are often duplicated between Identifier/StringAttr (e.g. in PDL)The only thing that Identifier has that StringAttr doesn't is support for caching a dialect that is referenced by the string (e.g. dialect.foo). This functionality is added to StringAttr, as this is useful for StringAttr in generally the same ways it was useful for Identifier.Differential Revision: https://reviews.llvm.org/D113536
[mlir] Switch arith, llvm, std & shape dialects to accessors prefixed both form.Followinghttps://llvm.discourse.group/t/psa-ods-generated-accessors-will-change-to-have-a-get-prefix-update-you-apis
[mlir] Switch arith, llvm, std & shape dialects to accessors prefixed both form.Followinghttps://llvm.discourse.group/t/psa-ods-generated-accessors-will-change-to-have-a-get-prefix-update-you-apis/4476,this follows flipping these dialects to _Both prefixed form. Thischanges the accessors to have a prefix. This was possibly mostly withoutbreaking breaking changes if the existing convenience methods were used.(https://github.com/jpienaar/llvm-project/blob/main/clang-tools-extra/clang-tidy/misc/AddGetterCheck.cppwas used to migrate the callers post flipping, using the output fromOperator.cpp)Differential Revision: https://reviews.llvm.org/D112383
[MLIR] Replace std ops with arith dialect opsPrecursor: https://reviews.llvm.org/D110200Removed redundant ops from the standard dialect that were moved to the`arith` or `math` dialects.Renamed
[MLIR] Replace std ops with arith dialect opsPrecursor: https://reviews.llvm.org/D110200Removed redundant ops from the standard dialect that were moved to the`arith` or `math` dialects.Renamed all instances of operations in the codebase and in tests.Reviewed By: rriddle, jpienaarDifferential Revision: https://reviews.llvm.org/D110797
[mlir][emitc] Fix indent in CondBranchOp and block label1. Add missing indent in CondBranchOp2. Remove indent in block labelDifferential Revision: https://reviews.llvm.org/D109805
12