SuccessChanges

Summary

  1. LLVM Dialect: introduce llvm.global (details)
  2. Add support for vector ops in the LLVM dialect (details)
  3. Add a higher-order vector.extractelement operation in MLIR (details)
  4. Add a higher-order vector.outerproduct operation in MLIR (details)
  5. Allow linalg.view to change the underlying elemental type. (details)
  6. External library name mangling support for linalg. (details)
  7. Translation to LLVM: support llvm.global (details)
  8. LLVM dialect and translation: support global strings (details)
  9. Translation to LLVM IR: use LogicalResult instead of bool (details)
  10. NFC: Update usages of OwningRewritePatternList to pass by & instead of (details)
  11. NFC: Refactoring PatternSymbolResolver into SymbolInfoMap (details)
  12. NFC: Standardize the terminology used for parent ops/regions/etc. (details)
  13. Refactor DenseElementAttr::getValues methods to return full ranges for (details)
  14. ODS: Round out the definitions of the common integer attributes sizes, (details)
  15. NFC: Update pattern rewrite API to pass OwningRewritePatternList by (details)
  16. Add lowering of vector dialect to LLVM dialect. (details)
  17. LLVM dialect: introduce llvm.addressof to access globals (details)
  18. Update typo (details)
  19. Avoid passing in line/col for files not registered with SourceMgr. (details)
  20. Use unreachable post switch rather than default case. (details)
  21. Add start of textmate language grammar. (details)
  22. Express ownership transfer in PassManager API through std::unique_ptr (details)
  23. GenerateCubinAccessors: use LLVM dialect constants (details)
  24. LLVM dialect: introduce fmuladd intrinsic as operation (details)
  25. Fix indexing issue in lowering of linalg.slice (details)
  26. Add unreachable to avoid GCC -Wreturn-type warning (details)
  27. Add a utility script to auto-generate CHECK commands for mlir test (details)
  28. Move linalg.slice to ODS (details)
  29. Refactor linalg.view lowering to LLVM - NFC (details)
  30. Allow the use of the $cppClass template variable in verifier code (details)
  31. Move remaining linalg ops to ODS - NFC (details)
  32. Refactor ElementsAttr::getValue and DenseElementsAttr::getSplatValue. (details)
  33. Add support for Dialect interfaces. (details)
  34. ExecutionEngine: fix after upstream LLVM ORC update (details)
  35. Add BuiltIn EnumAttr to SPIR-V dialect (details)
  36. Simplify the classes that support SPIR-V conversion. (details)
  37. Extend vector.outerproduct with an optional 3rd argument (details)
  38. Remove C++11 requirement set in cmakelists (details)
  39. C++14 is now default enabled in LLVM, remove obsolete CMake flag. (details)
  40. Refactor DialectConversion to convert the signatures of blocks when they (details)
  41. [spirv] Extend spv.array with Layoutinfo (details)
  42. Fix minor typos in the documentation (details)
  43. NFC: Move the Type::is* predicates to StandardTypes.cpp (details)
  44. NFC: Refactor the PassInstrumentation framework to operate on Operation (details)
  45. NFC: Modernize and cleanup standard ops. PiperOrigin-RevId: 263891926 (details)
  46. Add spirv::GlobalVariableOp that allows module level definition of (details)
  47. NFC: Add header blocks to improve readability. PiperOrigin-RevId: (details)
  48. Change from llvm::make_unique to std::make_unique (details)
  49. InitLLVM already initializes PrettyStackTraceProgram (details)
  50. Add alignment support for llvm.alloca (details)
  51. Refactor linalg lowering to LLVM (details)
  52. [spirv] Add spv.ReturnValue (details)
  53. NFC: Move LLVMIR, SDBM, and StandardOps to the Dialect/ directory. (details)
  54. Fix parsing/printing of spv.globalVariable and  spv._address_of (details)
  55. NFC: Don't assume that all operation traits are within the 'OpTrait::' (details)
  56. Add support for Operation interfaces. (details)
  57. Add alignment support to linalg.buffer_alloc (details)
  58. Allow isolated regions to form isolated SSA name scopes in the printer. (details)
  59. Add DictionaryAttr to OpBase.td (details)
  60. Add a DialectConversion document detailing the conversion (details)
  61. Move Linalg and VectorOps dialects to the Dialect subdir - NFC (details)
  62. Fix minor typos and add missing syntax in the documentation. (details)
  63. Fix AffineExpr::simplifyAdd bug (details)
  64. Add support for LLVM lowering of binary ops on n-D vector types (details)
  65. LLVM dialect: prefix operations that correspond to intrinsics with (details)
  66. JitRunner: support entry functions returning void (details)
  67. ConvertLaunchFuncToCudaCalls: use LLVM dialect globals (details)
  68. Update Ch-2.md -- 406f1e8211f8f5017f44f46af750dec061e707a2 by Zhang (details)
  69. Update MLIR code examples in Passes.md doc to use new affine.load/store (details)
  70. Fix build of affine load/store with empty map (details)
  71. [spirv] Support (de)serialization of spv.struct (details)
  72. Add spv.specConstant and spv._reference_of (details)
  73. NFC: Move AffineOps dialect to the Dialect sub-directory. (details)
  74. NFC: Move the LangRef documentation on StandardOps to a new document. (details)
  75. NFC: Use a DenseSet instead of a DenseMap for (details)
  76. NFC: Keep the dialect list in the context sorted by namespace. (details)
  77. Materialize spv.constants at use sites (details)
  78. Support variadic ops in declarative rewrite rules (details)
  79. [spirv] Support i1 as bool type (details)
  80. Move the parser extensions for aliases currently on Dialect to a new (details)
  81. Add iterator support to ElementsAttr and SparseElementsAttr. (details)
  82. NFC: Make the ModuleState field in the ModulePrinter optional. (details)
  83. Automated rollback of commit b9dc2e481818315f2f0d87455349f497f6118a4c (details)
  84. [TableGen] Add a `StaticShapeMemRefOf` trait. (details)
  85. Add a hook to the OpAsmDialectInterface to allow providing a special (details)
  86. NFC: Update in-code documentation for function-type. PiperOrigin-RevId: (details)
  87. Fix minor typos in TestingGuide and OpDefinitions. (details)
  88. NFC: Update in-code documentation for type. PiperOrigin-RevId: 264734014 (details)
  89. Remove the wrapping function in SPIR-V (de)serialization (details)
  90. Reduce reliance on custom grown Jit implementation - NFC (details)
  91. Remove dead getLLVMLibraryCallImplDefinition in Linalg's (details)
  92. Point to spv.AccessChain when reporting spv.AccessChain errors (details)
  93. Avoid assigning to an unchecked Error. (details)
  94. Add support for generating operation interfaces from the ODS framework. (details)
  95. NFC: Fix path of LinalgLibraryOpInterfaces inc files. PiperOrigin-RevId: (details)
  96. Let LLVMOpLowering specify a PatternBenefit - NFC (details)
  97. Split out parsing location into separate functions per instance (details)
  98. Add Positive{I32,I64}Attr and HasAnyRankOfPred (details)
  99. [spirv] Add support for capability (de)serialization (details)
  100. NFC: Avoid reconstructing the OpInterface methods. PiperOrigin-RevId: (details)
  101. Avoid overflow when lowering linalg.slice (details)
  102. NFC: Remove mentions of the TensorFlow dialect from the langref. (details)
  103. NFC: Rework and cleanup the High-Level structure and Dialect sections. (details)
  104. [spirv] Add support for extension (de)serialization (details)
  105. NFC: Cleanup the type system section of the LangRef. (details)
  106. NFC: Cleanup the Attribute section in the LangRef. (details)
  107. Add iterator support to ElementsAttr and SparseElementsAttr. (details)
  108. Add I32ElementsAttr to OpBase (details)
  109. NFC: Move the operation, region, and block sections to after the dialect (details)
  110. Fix BufferAllocOp builder. (details)
  111. [spirv] NFC: move arithmetic and logical ops to separate files (details)
  112. NFC: Update in-code documentation. Make the two grammar definitions of (details)
  113. Introduce the ability for "isolated from above" ops to introduce (details)
  114. [spirv] NFC: move SPIR-V control flow ops to a separate file (details)
  115. Update Linalg slice and subview documentation - NFC (details)
  116. Add lowering of linalg.copy to an external C++ library and a test. (details)
  117. NFC: Add a note to 'applyPatternsGreedily' that it also performs (details)
  118. Add a linalg.transpose op (details)
  119. Lower linalg.transpose to LLVM dialect (details)
  120. Lower linalg.copy to LLVM dialect in the presence of transposes. (details)
  121. NFC: Update Ch.1 of the Toy tutorial. (details)
  122. NFC: Add doc for id-punct PiperOrigin-RevId: 265190168 (details)
  123. Support folding of ops with inner ops in GreedyPatternRewriteDriver. (details)
  124. Update documentation for custom rewrite specs. (details)
  125. NFC: Remove unnecessary context parameters from several Location (details)
  126. Add FPToSI/FPExt/FPTrunc cast ops to the LLVM dialect. (details)
  127. NFC: Remove the explicit context from Operation::create and (details)
  128. [spirv] Add Block decoration for spv.struct. (details)
  129. Enhance GPU To SPIR-V conversion to support builtins and load/store ops. (details)
  130. [spirv] Fix the entry block to start with OpLabel (details)
  131. Add 3 additional intrinsic ops to NVVM dialect, in preparation to (details)
  132. Update Ch.2 of the Toy tutorial. (details)
  133. Refactor / improve replaceAllMemRefUsesWith (details)
  134. Port mlir-cuda-runner to use dialect conversion framework. (details)
  135. Add implementation for tensor_load and tensor_store operations. (details)
  136. Tweak to the pretty type parser to recognize that `->` is a special (details)
  137. Generalize the analysis manager framework to work on any operation at (details)
  138. Fix the equality check of two floating point values (details)
  139. Add vim scripts for indent/syntax (details)
  140. Add verification for dimension attribute on GPUDialect index operations. (details)
  141. fix loop unroll and jam - operand mapping - imperfect nest case (details)
  142. Extend map canonicalization to propagate constant operands (details)
  143. Add tests to verify 0.0 is quantized correctly (details)
  144. Make dumping using generic form more robust when IR ill-formed (details)
  145. Refactor the 'walk' methods for operations. (details)
  146. Change the parseSource* methods to return OwningModuleRef instead of (details)
  147. Add spv.Branch and spv.BranchConditional (details)
  148. Add support for early exit walk methods. (details)
  149. Added a TableGen generator for structured data (details)
  150. Add mechanism to dump JIT-compiled objects to files (details)
  151. Generalize the pass hierarchy by adding a general OpPass<PassT, OpT>. (details)
  152. Fix StructsGenTest.cpp CMakeFile build error (details)
  153. Add TensorRankOf for ranked tensor types with specific ranks (details)
  154. Splits DictionaryAttr into DictionaryAttrBase and DictionaryAttr. This (details)
  155. Add a canonicalization to erase empty AffineForOps. (details)
  156. update vim syntax file (details)
  157. Add missing link dependency to MLIRTableGenTests (details)
  158. Add floating-point comparison operations to SPIR-V dialect. (details)
  159. Document that non-IR units are passed by non-const reference instead of (details)
  160. Add a link to the rational on lack of const for IR units in the (details)
  161. Add missing lowering to CFG in mlir-cpu-runner + related cleanup (details)
  162. Add a convenient `clone()` method on the `Op` class that forward to the (details)
  163. Add a `getUsedValuesDefinedAbove()` overload that takes an `Operation` (details)
  164. Add a new dialect interface for the OperationFolder (details)
  165. Refactor the pass manager to support operations other than (details)
  166. Enable OwningRewritePatternList insert overload with parameter pack only (details)
  167. Add Select operation to SPIR-V dialect. (details)
  168. Support bf16 in Builder::getZeroAttr (details)
  169. LLVM dialect: prefix auxiliary operations with "mlir." (details)
  170. Remove unused variables (details)
  171. Fix an invalid assert when processing escaped strings. (details)
  172. Add information about the SIG + Open Design meetings to the README. (details)
  173. Fix affine data copy generation corner cases/bugs (details)
  174. Add folding rule and dialect materialization hook for spv.constant (details)
  175. Utility to normalize memrefs with non-identity layout maps (details)
  176. Properly clone Linalg ops with regions (details)
  177. Mention clang-format in the developer guide (details)
  178. Update the syntax of splat attribute in LLVM.md (details)
  179. Add support for array-typed constants. (details)
  180. Make GPU kernel outlining inline constants. (details)
  181. Move Linalg dialect tests to test/Dialect/Linalg (details)
  182. pipeline-data-transfer: remove dead tag alloc's and improve test (details)
  183. Make isIsolatedAbove robuster to invalid IR (details)
  184. Move LLVMIR dialect tests from test/LLVMIR to test/Dialect and (details)
  185. Retain address space during MLIR > LLVM conversion. (details)
  186. Updated StructAttr to use the struct name for StorageType and (details)
  187. Use transform function on llvm::Module in the ExecutionEngine (details)
  188. Generalize I32ElementsAttr definition and introduce I64ElementsAttr (details)
  189. Make GPU kernel outlining test independent of value names. (details)
  190. Add the initial inlining infrastructure. (details)
  191. [spirv] Add spv.loop (details)
  192. Add support for conservatively inlining Affine operations. (details)
  193. Integer set + operands / affine if op canonicalization (details)
  194. Fix typos in Interfaces.md (details)
  195. Simplify Linalg ABI integration with external function calls. (details)
  196. Add custom builder for AffineIfOp (details)
  197. Restrict affine inlining to just Function operations. (details)
  198. Fix typo in the documentation for tensor_cast (NFC) (details)
  199. Add doc for declarative rewrite rules (details)
  200. Wrap debug dump in LLVM_DEBUG (details)
  201. Set mlir-cpu-runner JIT codegen opt level correctly (details)
  202. Refactor getUsedValuesDefinedAbove to expose a variant taking a callback (details)
  203. Use "final" instead of marking method virtual in override (NFC) (details)
  204. Refactor PassTiming to support nested pipelines. (details)
  205. Add `parseGenericOperation()` to the OpAsmParser (details)
  206. Addressing some late review comments on kernel inlining. (details)
  207. Add support for coalescing adjacent nested pass pipelines. (details)
  208. Add warpsize and laneid intrinsics to NVVM dialect. (details)
  209. Overload LLVM::TerminatorOp::build() for empty operands list. (details)
  210. Explicitly declare the OpPassManager move constructor to avoid undefined (details)
  211. Convert per channel fake quant attributes to type (details)
  212. [NFC] Rename ExpressedToUniformQuantizedType to ExpressedToQuantizedType (details)
  213. Add quant.const_fake_quant_per_axis op (details)
  214. Add pass generate per block in a function a GraphViz Dot graph with ops (details)
  215. Avoid sign-compare warning (details)
  216. Remove redundant qualification (details)
  217. Remove unused variable (details)
  218. Convert ConstFakeQuantPerAxis to qcast and dcast pair (details)
  219. Remove the constraint that min / max should stride zero (details)
  220. Add folding rule for spv.CompositeExtract (details)
  221. Don't leak TargetMachine in ExecutionEngine::setupTargetTriple (details)
  222. Fix a typo in comments. The Inequality and Equality explanations were (details)
  223. Add logical groups to NVVM op definitions. (details)
  224. Fix typos in SDBMTest.cpp (details)
  225. Rename SDBMPositiveExpr to SDBMTermExpr (details)
  226. [spirv] Add support for spv.loop (de)serialization (details)
  227. NFC: Clean up constant fold tests (details)
  228. Cmpf constant folding for nan and inf (details)
  229. Log name of the generated illegal operation name in DialectConversion (details)
  230. Fixing typo in documentation. (details)
  231. NFC: Update comments about rank constraints (details)
  232. Refactor pass pipeline command line parsing to support explicit pipeline (details)
  233. Improve verifier error reporting on type mismatch (NFC) (details)
  234. Forward diagnostics from untracked threads in ParallelDiagnosticHandler. (details)
  235. Add tablegen class for memrefs with rank constraints (details)
  236. NFC: Finish replacing FunctionPassBase/ModulePassBase with OpPassBase. (details)
  237. Update SPIR-V symbols and use GLSL450 instead of VulkanKHR (details)
  238. Add type constraints for shaped types with same rank and element count (details)
  239. Publicly expose the functionality to parse a textual pass pipeline. (details)
  240. add missing memref cast fold pattern for dim op (details)
  241. Verify that ModuleOps only contain dialect specific attributes. (details)
  242. Add pattern to canonicalize for loop bounds (details)
  243. Update QuickstartRewrites.md regarding op definition and rewrites (details)
  244. NFC: Fix stray character in error message: 1 -> ' PiperOrigin-RevId: (details)
  245. Clean up build trip count analysis method - avoid mutating IR (details)
  246. update normalizeMemRef utility; handle missing failure check + add more (details)
  247. NFC - Move explicit copy/dma generation utility out of pass and into (details)
  248. Add convenience methods to create i8 and i16 attributes in Builder. (details)
  249. NFC: Merge OpPass with OperationPass into just OperationPass. (details)
  250. NFC: Pass PassInstrumentations by unique_ptr instead of raw pointer. (details)
  251. Update the IRPrinter instrumentation to work on non function/module (details)
  252. NFC: Update the expected outputs of pass-timing. (details)
  253. NFC: Update the PassInstrumentation section. (details)
  254. Fix typo in test/AffineOps/ops.mlir (details)
  255. Update the pass registration section and add a sub-section on the (details)
  256. Add mechanism to specify extended instruction sets in SPIR-V. (details)
  257. Drop makePositionAttr and the like in favor of Builder::getI64ArrayAttr (details)
  258. Error out when kernel function is not found while translating GPU calls. (details)
  259. Unify how errors are emitted in LaunchFuncOp verification. (details)
  260. Introduce SDBMDirect expression into the SDBM expression hierarchy (details)
  261. Overhaul the SDBM expression kind hierarchy (details)
  262. [spirv] Add support for BitEnumAttr (details)
  263. Add support for multi-level value mapping to DialectConversion. (details)
  264. [spirv] Add support for function calls. (details)
  265. Autogenerate (de)serialization for Extended Instruction Sets (details)
  266. Add missing CMake dependency from libAnalysis to the Vector dialect (details)
  267. Add rewrite pattern to compose maps into affine load/stores (details)
  268. Change MLIR translation functions signature (details)
  269. Support file-to-file translation in mlir-translate (details)
  270. Add a preprocess pass to remove sequences that are problematic with (details)
  271. Register a -test-spirv-roundtrip hook to mlir-translate (details)
  272. Add (de)serialization support for OpRuntimeArray. (details)
  273. Add support to OpAsmParser for parsing unknown keywords. (details)
  274. Simplify SDBM expressions more aggressively in operators and conversions (details)
  275. SDBM: support sum expressions on the LHS of stripe expressions (details)
  276. Unify error messages to start with lower-case. (details)
  277. Support symbolic operands for memref replacement; fix memrefNormalize (details)
  278. Fix nested dominance relationship between parent results and child (details)
  279. NFC: Remove stray logging from ~Block(). PiperOrigin-RevId: 269941815 (details)
  280. Outline GPU kernel function into a nested module. (details)
  281. Add address space attribute to LLVMIR's GlobalOp. (details)
  282. NFC: Fix return indentation in generated op definitions. (details)
  283. Quantize attribute values by per axis quantization parameters (details)
  284. Automated rollback of commit 5684a12434f923d03b6870f2aa16226bfb0b38b6 (details)
  285. Allow specification of decorators on SPIR-V StructType members. (details)
  286. Remove unused import and two import forms (details)
  287. Add utility to extract strides from layout map in MemRefType. (details)
  288. Fix public build (details)
  289. Use SmallVectorImpl in getStrides (details)
  290. NFC: Pass OpAsmParser by reference instead of by pointer. (details)
  291. Avoid iterator invalidation when recursively computing pattern depth. (details)
  292. NFC: Pass OperationState by reference instead of by pointer. (details)
  293. NFC: Pass OpAsmPrinter by reference instead of by pointer. (details)
  294. Make GlobalOp's value attribute optional. (details)
  295. [ODS] Add support for FloatElementsAttr (details)
  296. Add a note about the use of recursion in the developer guide (details)
  297. Upgrade/fix/simplify store to load forwarding (details)
  298. [spirv] Add OpControlBarrier and OpMemoryBarrier. (details)
  299. minor spelling tweaks (details)
  300. Add integer sign- and zero-extension and truncation to standard. (details)
  301. Fix undefined reference to mlir::getElementTypeOrSelf(mlir::Type) (details)
  302. update layout map examples in doc, drop stale ones (details)
  303. Update TruncateIOp builder to pass OperationState by reference. (details)
  304. Specalize f32->i8/u8 Quanitization with C++ native arithmetic to (details)
  305. [NFC] Replace std::clamp with inline implementation. (details)
  306. Fix a number of Clang-Tidy warnings. (details)
  307. Outline GPU kernel function into a nested module. (details)
  308. Add variants of interleave that take separator (details)
  309. NFC: Fix warning for uninitialized field. PiperOrigin-RevId: 270704572 (details)
  310. Update the Pass, Analysis, and PassManager sections of WritingAPass.md. (details)
  311. Refactor DiagnosticEngine to support multiple registered diagnostic (details)
  312. Add interfaces for call-like/callable operations. (details)
  313. Add initial callgraph support. (details)
  314. Add convenience methods to set an OpBuilder insertion point after an (details)
  315. Simplify the way spirv::StructTypes are parsed. (details)
  316. Use constant's location for reporting errors in parsing of hex constant (details)
  317. Handle OpMemberName instruction in SPIR-V deserializer. (details)
  318. Let mlir-translate support -split-input-file (details)
  319. Make spirv::RuntimeArrayType part of spirv::CompositeType. (details)
  320. [spirv] NFC: clean up (de)serialization tests (details)
  321. Allow null Attribute for value when building GlobalOp. (details)
  322. Clone called functions into nested GPU module. (details)
  323. Normalize lowering of MemRef types (details)
  324. Introduce splat op + provide its LLVM lowering (details)
  325. Allow attaching descriptions to OpInterfaces and InterfaceMethods. (details)
  326. NFC: Add a description to the ODS interface example. PiperOrigin-RevId: (details)
  327. [spirv] Replace bitwiseCast with llvm::bit_cast (details)
  328. Add support for GLSL Binary ops, and use it to implement GLSL FMax. (details)
  329. NFC: Add 'const' dereference method to OperandTypeIterator. (details)
  330. Miscellaneous fixes to SPIR-V Deserializer (details below). (details)
  331. Forward declare LogicalResult as a struct to be consistent (details)
  332. Fix memref-stride-calculation on Windows (details)
  333. Add tablegen verification traits for comparing different properties (details)
  334. Emit function name being tested in TestMemRefStrideCalculation (details)
  335. Minor spelling tweaks (details)
  336. [spirv] Add SPV_UnaryOp and spv.FNegate (details)
  337. Change the return type of createPrintCFGGraphPass to match other passes. (details)
  338. Add spv.Bitcast operation to SPIR-V dialect (details)
  339. Remove unused variables and methods to address compiler warnings (details)
  340. Add AllReduceOp to GPU dialect with lowering to NVVM. (details)
  341. Drop support for memrefs from JitRunner (details)
  342. Decouple tiling from fusion in Linalg. (details)
  343. Make result ops generated output deterministic (details)
  344. Disable failing tests (details)
  345. [ROCm] Adding ROCDL Dialect. (details)
  346. Fix missing links in the documentation (details)
  347. Fix Documentation OpDefinitions.md (details)
  348. Fix JitRunner.cpp Error creation pattern and reactivate tests. (details)
  349. Promote MemRefDescriptor to a pointer to struct when passing function (details)
  350. NFC - clean up op accessor usage, std.load/store op verify, other stale (details)
  351. Add TODO to revisit coupling of CallOp to MemRefType lowering (details)
  352. Remove spurious debug spew in tests (details)
  353. Append a newline when dumping a Value. (details)
  354. Tablegen helpers for accessing properties of shaped types (details)
  355. Switch explicit create methods to match generated build's order (details)
  356. Fix syntax of 'call' and 'splat' ops (details)
  357. Fix a typo in Toy Chapter 2 tutorial documentation (details)
  358. update Rationale.md - remove outdated info (details)
  359. Add InferTypeOpTrait & enable generating its member function definition (details)
  360. Switch comments from GPU dialect terms to CUDA terms (NFC). (details)
  361. Fix MemRefType::getStrides corner case (details)
  362. Use MaybeAlign when setting alignment (details)
  363. Add support for Logical Ops in SPIR-V dialect (details)
  364. [DRR] Explain result type deduction in doc (details)
  365. Normalize MemRefType lowering to LLVM as strided MemRef descriptor (details)
  366. Adding some missing SPIR-V core and GLSL extended ops. (details)
  367. NFC: Change `classof` on registered operations to use pointer (details)
  368. Enable autogenerating OpInterface method declarations (details)
  369. Add missing file from cmakelist (details)
  370. Adding signed integer ops for abs, sign, min, and max in the GLSL (details)
  371. [spirv] Add array length check. (details)
  372. Format markdown list. (details)
  373. Pass the pointer of the parent pipeline collection pass to (details)
  374. Fold away reduction over 0 dimensions. (details)
  375. Add integer shift ops to LLVM dialect. (details)
  376. Add verification error message for ops that require at least one operand (details)
  377. Change all_reduce lowering to support 2D and 3D blocks. (details)
  378. [spirv] NFC: rename SPV_ArithmeticOp to SPV_ArithmeticBinaryOp (details)
  379. Unify Linalg types by using strided memrefs (details)
  380. Fix and simplify CallOp/CallIndirectOp to LLVM::CallOp conversion (details)
  381. Add a pair of hooks to DominanceInfo. (details)
  382. [spirv] Change enum case uniquing in gen_spirv_dialect.py (details)
  383. Show type even if elementsattr is elided in graph (details)
  384. [ROCm] Adding pass to lower GPU Dialect to ROCDL Dialect. (details)
  385. Replace spurious `long` stride type by int64_t - NFC (details)
  386. Fix example in OpInterfaces documentation (details)
  387. [spirv] Add support for spv.selection (details)
  388. Extract MemRefType::getStridesAndOffset as a free function and fix (details)
  389. Disallow index types in memrefs. (details)
  390. NFC: rename Conversion/ControlFlowToCFG to Conversion/LoopToStandard (details)
  391. Add parentheses around boolean operators in assert (details)
  392. Give modules a name (details)
  393. Make Module::getName return Optional<StringRef> (details)
  394. Add syntactic sugar for strided memref parsing. This CL implements the (details)
  395. Generalize parse/printBinaryOp to parse/printOneResultOp. (details)
  396. Add fpext and fptrunc to the Standard dialect and includes conversion to (details)
  397. Add `axis` attribute to the quant.stats op (details)
  398. Update the Inliner pass to work on SCCs of the CallGraph. (details)
  399. Add support for inlining calls with different arg/result types from the (details)
  400. Fix typos, NFC. (details)
  401. Moving the GPUIndexIntrinsicOpLowering template to a common location (details)
  402. Add missing Linalg lowerings to allow roundtrip.mlir to lower to LLVM (details)
  403. Replace constexpr MemRefType::kDynamicStrideOrOffset by a (details)
  404. Add some utility builder functions for SPIR-V operations. (details)
  405. Add spv.Undef op to support OpUndef instruction in SPIR-V. (details)
  406. Add missing dependency on the TypeInferOpInterface from the Test dialect (details)
  407. [spirv] Allow return ops to be in control flow ops (details)
  408. NFC: Cleanup test ops and traits tests (details)
  409. Allow element type traits to operate on scalars (details)
  410. Enable emitting dialect summary & description during op generation (details)
  411. Support reduction of partial warps. (details)
  412. Add OpaqueLoc to MLIR locations. (details)
  413. Fix CMake build after adding TestOpaqueLoc.cpp (details)
  414. Add DialectType and generate docs for dialect types (details)
  415. Support AllocOp terminal in Linalg::AliasAnalysis. (details)
  416. Start a minimal mlir_utils runtime library for testing debugging (details)
  417. Fix a comment in the OperationInterface example. (details)
  418. Change Block::getParent() to be a const function. This is only necessary (details)
  419. fix simplify-affine-structures bug (details)
  420. [spirv] Fix function entry block erase after moving to spv.selection (details)
  421. Update UndefOp (de)serialization to generate OpUndef at module level. (details)
  422. Add a new class, OpPrintingFlags, to enable programmatic control of (details)
  423. [spirv] Disable a crashing spv.loop test (details)
  424. Do not add spirv::BitcastOp for cast from signed to unsigned type. (details)
  425. Expose `fuseProducerOf` in Linalg/Utils/Utils.h. (details)
  426. Print result types when dumping graphviz. (details)
  427. Add a flag to the AsmPrinter for eliding large ElementsAttrs. (details)
  428. Update upgrade some uses of mlir::interleave API to take container (details)
  429. Use named modules for gpu.launch_func (details)
  430. Fuse GenerateCubinAccessors pass into LaunchFunctToCuda (details)
  431. GPUToCUDA: emit addressof directly instead of wrapping it into a getter (details)
  432. GPUToCUDA: attach CUBIN to the nested module rather than to the function (details)
  433. Linalg to LLVM lowering: decrease the reliance on symbol lookup in a (details)
  434. NFC: Remove unused default cl::opt value. (details)
  435. Add support for walking the uses of a symbol. (details)
  436. unroll and jam: fix order of jammed bodies (details)
  437. Add a PatternRewriter hook for cloning a region into another. (details)
  438. [spirv] Add a pass to decorate the composite types with layout info. (details)
  439. [ROCm] Fix the return type for the device function calls from i32 to (details)
  440. Add support for parsing/printing non bare-identifier SymbolRefs. (details)
  441. Add Instance Specific Pass Options. (details)
  442. Update the symbol utility methods to handle the case of unknown (details)
  443. Allow dynamic but ranked types in ops with SameOperandsAndResultShape (details)
  444. NFC: Fully qualify use of std::string. PiperOrigin-RevId: 273668957 (details)
  445. Assert that region is not cloned into itself. (details)
  446. Change to doxygen comments. NFC. (details)
  447. Add exp operation to LLVMOPs.td. (details)
  448. Update the usage and comments in define_inst.sh. (details)
  449. Add support for some multi-store cases in affine fusion (details)
  450. Fix Windows linkage error (details)
  451. Make SPIR-V lowering infrastructure follow Vulkan SPIR-V validation. (details)
  452. Guard rewriter insertion point during signature conversion. (details)
  453. Add ::printAsTextualPipeline to Pass and OpPassManager. (details)
  454. minor spelling tweaks (details)
  455. Pre-allocate space for results from a regex match that uses 3 match (details)
  456. Fix typo in QuantizedType method names (details)
  457. Add test for fix to tablegen for custom folders for ops that return a (details)
  458. Use llvm.func to define functions with wrapped LLVM IR function type (details)
  459. NFC: Cleanup of type checking tests (details)
  460. Mark GPU dialect as illegal when lowering to NVVM. (details)
  461. Python bindings: export index_cast (details)
  462. Remove the need to convert operations in regions of operations that have (details)
  463. Add support for canonicalizing callable regions during inlining. (details)
  464. Add trait for specified shapes matching (details)
  465. Add lowering of constant ops to SPIR-V. (details)
  466. Translation to LLVM: check the validity of module-level Ops (details)
  467. Standard-to-LLVM conversion: check that operands have LLVM types (details)
  468. NFC: Initialize pass manager option fields inline instead of the class (details)
  469. Add support for generating reproducers on pass crash and failure. (details)
  470. NFC: Print the generic op form after pass failure. (details)
  471. LLVM conversion: harden a test to check for LLVM funcs rather than any (details)
  472. Add unary ops and ExpOp to Standard Dialect. (details)
  473. Rename LLVM::exp and LLVM::fmuladd to LLVM::ExpOP and LLVM::FMulAddOp. (details)
  474. Drop obsolete code from std to llvm memref lowering (details)
  475. LLVM Dialect: introduce llvm.mlir.null operation (details)
  476. Emit LLVM IR equivalent of sizeof when lowering alloc operations (details)
  477. Add LLVM IR dialect hooks for FP128 and X86_FP80 types (details)
  478. Add lowering of VectorOps dialect to LLVM to the Linalg LLVM lowering (details)
  479. Fix linalg.subview behavior in (partially) static cases. (details)
  480. Use single quotes to wrap '@HOST_LDFLAGS@' in LIT config file (details)
  481. Allowing replacing non-root operations in DialectConversion. (details)
  482. NFC: Replace usages of Value::getKind with explicit isa/casts. (details)
  483. Merge Ch3 of the Toy tutorial into chapter 2. (details)
  484. AsmPrinter: avoid unused-variable warning (details)
  485. Expose mlir::parseType to bindings (details)
  486. Add conversion for splat of vectors of 2+D (details)
  487. Consistent use of int in mlir_runner_utils.cpp (details)
  488. Fix typos in LangRef and OpDefinitions (details)
  489. Update Chapter 3 to demonstrate pattern match and rewrite optimizations (details)
  490. Fix typos in InferTypeOpInterface. (details)
  491. Fix minor typos (details)
  492. [spirv] Add support for SpecId decoration on spv.specConstant (details)
  493. Fix typo (details)
  494. NFC: Split out ToyOpsIncGen into a separate CMakeLists.txt. (details)
  495. Fix typos (details)
  496. Fix typo (details)
  497. Add support for OpBitwiseOr, OpBitwiseXor, and OpBitwiseAnd in SPIR-V (details)
  498. NFC: Various code cleanups for Ch3. (details)
  499. NFC: Remove NoSideEffect traits from all ops except for ConstantOp. (details)
  500. Implement simple loop-invariant-code-motion based on dialect interfaces. (details)
  501. Fix typo in VectorOps.td (details)
  502. Fix CMake configuration after introduction of LICM and LoopLikeInterface (details)
  503. Add support for PatternRewriter::eraseOp. (details)
  504. Allow for remapping argument to a Value in SignatureConversion. (details)
  505. Support custom accumulator provided as region to gpu.all_reduce. (details)
  506. Makes spv.module generated by GPU->SPIRV conversion spec compliant (details)
  507. NFC: Update VectorOrTensor -> Shaped (details)
  508. Update comments in ast.toy (details)
  509. Update Chapter 4 of the Toy tutorial (details)
  510. Code cleanups on Ch.4 (details)
  511. Add ComplexType to TableGen with Tensor support (details)
  512. Fix typo in tutorial. (details)
  513. Add support for inlining toy call operations. (details)
  514. Add Ch.5 of the toy tutorial. (details)
  515. [spirv] Implement inliner interface (details)
  516. Fix invalid transpose in example and add proper verification. (details)
  517. Add LLVM_DEBUG in RewritersGen.cpp and Pattern.cpp (details)
  518. Fix RewriterGen to support using NativeCodeCall as auxiliary pattern (details)
  519. [DRR] Allow capturing and referencing no-result ops (details)
  520. Use a SmallVector instead of an ArrayRef to materialize a temporary (details)
  521. Rename LoopNestBuilder to AffineLoopNestBuilder - NFC (details)
  522. Allow '_' when pretty printing dialect symbols (details)
  523. [spirv] Add a canonicalization pattern for spv.selection. (details)
  524. Decouple Linalg promotion from Linalg tiling - NFC (details)
  525. Add Ch.6 of the Toy tutorial. (details)
  526. NFC: Delete the Linalg tutorial. (details)
  527. Add EDSC support for loop.for operations (details)
  528. Introduce a wrapper around ConversionPattern that operates on the (details)
  529. Automated rollback of commit b65c8bb5d6ab418bb3fcd0302aee19d3615d90f1 (details)
  530. NFC: Remove trivial builder get methods. (details)
  531. Add gpu.barrier op to synchronize invocations of a local workgroup. (details)
  532. Add documentation on restrictions to dialect conversion rewrites (details)
  533. Use StrEnumAttr for gpu.allreduce op instead of StringAttr to better (details)
  534. Fix OSS target name GPUtoNVVMTransforms -> MLIRGPUtoNVVMTransforms (details)
  535. Automated rollback of commit 575405f4d6762830c1c4520569de4e4ed3c8eed5 (details)
  536. [DRR] Use eraseOp() to replace no-result ops (details)
  537. Slightly rephrase a difficult-to-parse sentence. (details)
  538. Implement lowering of VectorTypeCastOp to LLVM (details)
  539. Lower vector transfer ops to loop.for operations. (details)
  540. Add support for function result attributes. (details)
  541. NFC: Rename SPIR-V serializer find*ID() to get*ID() to be consistent (details)
  542. NFC: Add missing include for StringMap. PiperOrigin-RevId: 275588019 (details)
  543. NFC: Cleanup the implementation of walkSymbolUses. (details)
  544. Get active source lane predicate from shuffle instruction. (details)
  545. Use new eraseOp instead of replaceOp with empty values (details)
  546. Slight rewording in toy ch2 to make persistence of name clearer (details)
  547. Add missing include to llvm Allocator.h (details)
  548. Add missing include to StringMap in Verifier and DialectConversion. (details)
  549. Add SourceMgrDiagnosticHandler to toy (details)
  550. Fix minor spelling tweaks (NFC) (details)
  551. Fix minor spelling tweaks (NFC) (details)
  552. [DRR] Address GCC warning by wrapping for statement body with {} (details)
  553. Update Ch1 to reflect new changes in the tutorial. (details)
  554. NFC: Fix typo : Retur -> Return PiperOrigin-RevId: 275745931 (details)
  555. Add a Symbol trait to simplify defining operations that represent (details)
  556. NFC: Elide the value of a UnitAttr within nested attribute dictionaries. (details)
  557. Unify GPU op definition names with other dialects. (details)
  558. NFC: Fix remaining usages of MulOp as matrix multiplication. (details)
  559. Cleanup and rewrite Ch-4.md. (details)
  560. Use LLVM_Type instead of AnyType in the definition of LLVM_CallOp (details)
  561. [spirv] Allow block arguments on spv.Branch(Conditional) (details)
  562. [DRR] Allow interleaved operands and attributes (details)
  563. NFC: Add support for parsing attributes programmatically via (details)
  564. NFC: Remove a right parenthesis from comment. PiperOrigin-RevId: (details)
  565. Expose optimizations flags in Python bindings (details)
  566. Update loop.for verifier message (details)
  567. Update chapter 3 code snippet to match the actual output of the code (details)
  568. Drop MemRefUtils from the ExecutionEngine (details)
  569. NFC: Remove references to the toy.generic attribute. (details)
  570. Fix "set-but-unused" warning in DialectConversion (details)
  571. Add @below and @above directives to verify-diagnostics. (details)
  572. Wrap ODS to 80 lines and remove const qualifier for local `int` variable (details)
  573. Add custom lowering of ExpOp for NVVM and ROCM. (details)
  574. Add missing dependency on MLIRIR on MLIREDSCInterface (details)
  575. Add support for replacing all uses of a symbol. (details)
  576. Convert the Canonicalize and CSE passes to generic Operation Passes. (details)
  577. [spirv] AccessChainOp canonicalization. (details)
  578. Add support for parsing multiple result name groups. (details)
  579. Define AnyRankedTensor Type in TableGen (details)
  580. Fix include guards and add tests for OpToFuncCallLowering. (details)
  581. Lookup function declaration in SymbolTable not ModuleOp. (details)
  582. Print reason why dynamic library could not be loaded during execution. (details)
  583. Add support for marking an operation as recursively legal. (details)
  584. Standardize Linalg transformations to take an OpBuilder and an (details)
  585. Parse locations in parseGenericOperation (details)
  586. [spirv] Support OpPhi using block arguments (details)
  587. Add a convenient operation build method for spirv::SelectOp (details)
  588. [spirv] Use LLVM graph traversal utility for PrettyBlockOrderVisitor (details)
  589. Bugfix: Keep worklistMap in sync with worklist in GreedyPatternRewriter (details)
  590. Add "[TOC]" to generated documentation (details)
  591. [spirv] Mark control flow ops as InFunctionScope (details)
  592. [spirv] Fix gen_spirv_dialect.py and add spv.Unreachable (details)
  593. Add basic support for declarative Linalg transformations (details)
  594. Fix segfault when no symbol is given to an constraint operand (details)
  595. Add a utility accessor 'has_single_element' for ranges. (details)
  596. Add support to GreedyPatternRewriter for erasing unreachable blocks. (details)
  597. Dump op location in createPrintOpGraphPass for easier debugging. (details)
  598. Use `not` to invert return code in expected to fail tests (details)
  599. [spirv] Add cast operations (details)
  600. NFC: Simplify UseRange::iterator to just be a (details)
  601. LinalgDependenceGraph: add const modifiers to accessors (details)
  602. Add a test.symbol_scope operation that has the SymbolTable Traits to the (details)
  603. Add a test for lowering GPU ops that cover cases where the symbol table (details)
  604. NFC: Use #ifndef in various .td files instead of #ifdef and #else (details)
  605. [mlir][llvm] Add missing cast ops (details)
  606. Add Linalg pattern for producer-consumer fusion (details)
  607. Support lowering of imperfectly nested loops into GPU dialect. (details)
  608. Move BitEnumAttr from SPIRVBase.td to OpBase.td (details)
  609. Delete spurious file (details)
  610. Add ReferToOp attribute constraint for SymbolRefAttr (details)
  611. Add DialectAsmParser/Printer classes to simplify dialect attribute and (details)
  612. Remove the need for passing a location to parseAttribute/parseType. (details)
  613. Refactor QuantOps TypeParser to use the DialectAsmParser methods (details)
  614. Refactor LinalgDialect::parseType to use the DialectAsmParser methods (details)
  615. Drop spurious debug spew. (details)
  616. Update the SPV dialect type parser to use the methods on (details)
  617. [NVVM] Add mma.sync operation. (details)
  618. Rename Region::RegionType to Region::BlockListType (details)
  619. Emit empty lines after headers when generating op docs (details)
  620. Add a PatternRewriter hook to merge blocks, and use it to support for (details)
  621. NFC: Rename parseOptionalAttributeDict -> parseOptionalAttrDict to match (details)
  622. [llvm] Add initial import of LLVM modules to mlir-translate (details)
  623. [llvm] Allow GlobalOp to take a region for complex initializers (details)
  624. Fix typos in the Standard Dialect documentation (details)
  625. Add (parse|print)OptionalAttrDictWithKeyword hooks to simplify parsing (details)
  626. NFC: Remove an extra space when printing the 'attributes' prefix before (details)
  627. Add support for the LLVM FNeg instruction (details)
  628. Add ViewOp to the StandardOps dialect, which casts a 1D/i8 element type (details)
  629. [DRR] List some limitations clearly in the doc (details)
  630. Add ViewOp verification for dynamic strides, and address some comments (details)
  631. Adding an m_NonZero constant integer matcher. (details)
  632. Add affine load/store/dma_start/dma_wait to dialect doc. (details)
  633. Add lowering of std.view to LLVM (details)
  634. Drop spurious test file (details)
  635. Replace some remnant uses of "inst" with "op". (details)
  636. NFC: Uniformize parser naming scheme in Toy tutorial to camelCase and (details)
  637. NFC: Tidy up the implementation of operations in the Toy tutorial (details)
  638. Add IndexedGenericOp to Linalg. (details)
  639. Update Linalg to use std.view (details)
  640. Add compatible query method to infer type interface (details)
  641. Fix parameter name and document option in linalg::promoteSubViews (details)
  642. Add canonicalizer for ViewOp which folds constants into the ViewOp (details)
  643. Add Ch-7 of the toy tutorial detailing how to define new types. (details)
  644. Swap operand order in std.view operation so that offset appears before (details)
  645. Fix asm printer for affine expr (details)
  646. mlir-translate: support -verify-diagnostics (details)
  647. Move description from GenericOpBase to linalg.(indexed_)generic. (details)
  648. [spirv] Add bit ops (details)
  649. Explicitly initialize isRecursivelyLegal (details)
  650. Look for SymbolRefAttr in KernelOutlining instead of hard-coding CallOp (details)
  651. Add a short TableGen HowTo to tutorial chapter 2. (details)
  652. Fix segfault (nullptr dereference) when passing a non-existent file to (details)
  653. Also consider index constants when folding integer arithmetics with (details)
  654. Adds std.subview operation which takes dynamic offsets, sizes and (details)
  655. Add support for nested symbol references. (details)
  656. Restructure comment lexing to not recurse. (details)
  657. Add support for alignment attribute in std.alloc. (details)
  658. Adds affine.min operation which returns the minimum value from a (details)
  659. Add LLVM lowering of std.subview (details)
  660. Update outdated comment for NativeCodeCall (details)
  661. Update textmate syntax file (details)
  662. Add a printer flag to use local scope when printing IR. (details)
  663. [spirv] Properly return when finding error in serialization (details)
  664. Add Conversion to lower loop::ForOp to spirv::LoopOp. (details)
  665. Expose an isSubclassOf() method on AttrConstraint (details)
  666. Add an option to print an operation if a diagnostic is emitted on it (details)
  667. Add support for OpPhi in loop header block (details)
  668. Make legality check in GPU->SPIR-V lowering of FuncOp kernel specific. (details)
  669. NFC: Change DictionaryAttr::get(StringRef) to use binary search instead (details)
  670. Add operations needed to support lowering of AffineExpr to SPIR-V. (details)
  671. Make VariableOp instructions be in the first block in the function. (details)
  672. Rename the current parseSymbolName to parseOptionalSymbolName (details)
  673. Create and begin writing glossary. (details)
  674. NFC: Refactor block signature conversion to not erase the original (details)
  675. Add FuncOp::eraseArgument (details)
  676. Fix glossary formatting. (details)
  677. Deprecate linalg.subview in favor of std.subview (details)
  678. Replace explicit concatenation by llvm::concat (details)
  679. Do not emit aliases when printing local form (details)
  680. Concentrate memref descriptor manipulation logic in one place (details)
  681. [doc] Add debugging tips in ODS and DRR doc regarding mlir-tblgen (details)
  682. Use MemRefDescriptor in Linalg-to-LLVM conversion (details)
  683. Move VectorOps to Tablegen - (almost) NFC (details)
  684. Adapt code to LLVM API updates. (details)
  685. Use MemRefDescriptor in Vector-to-LLVM convresion (details)
  686. Make positions of elements in MemRef descriptor private (details)
  687. Move Affine to Standard conversion to lib/Conversion (details)
  688. [ODS] Fix operation argument population to avoid crash (details)
  689. Add CMakeLists.txt for AffineToStandard conversion (details)
  690. Adds canonicalizer to SubViewOp which folds constants from base memref (details)
  691. NFC: Refactor Dialect Conversion targeting SPIR-V. (details)
  692. Refactor the LowerVectorTransfers pass to use the RewritePattern infra - (details)
  693. Expand on operation definition to clarify the difference between (details)
  694. Add more navigation to the MLIR toy tutorial. (details)
  695. Mark std.subview as no-sideeffect. (details)
  696. Mark std.view as no-sideeffect. (details)
  697. Templatize linalg::LowerToLoops - NFC (details)
  698. Use aggregate-parameter builder for ops having autogen type-deduction (details)
  699. Fix build warnings (details)
  700. Use simpler highlighting textmate syntax (details)
  701. Modify tutorial and other documentation for consistency, clarity, and (details)
  702. NFC: Convert CmpIPredicate in StandardOps to use EnumAttr (details)
  703. Clarify that identity maps are discarded from the MemRef type (details)
  704. [spirv] Add bit ops (details)
  705. Fix attribute dict syntax in the docs (details)
  706. Fix mismatched-tags warning (details)
  707. Rename CLI flags -lower-gpu-ops-to-*-ops to -convert-gpu-to-* (details)
  708. Implement folding of pattern dim(subview(_)[...][s1, ..., sn][...], i) (details)
  709. Standardize all VectorOps class names to be prefixed by Vector - NFC (details)
  710. Fix Affine Loop Fusion test case reported on github. This CL utilizies (details)
  711. ConvertStandardToLLVM: replace assertion with graceful failure (details)
  712. Also elide large array attribute in OpGraph Dump (details)
  713. [spirv] Add a canonicalizer for BitcastOp. (details)
  714. Fix gen_spirv_dialect.py regarding 1D/2D/3D Dim symbol name (details)
  715. Add a parseAttribute<AttrType> overload for the non-type case. (details)
  716. Fix SubViewOp stride calculation in constant folding. Adds unit tests (details)
  717. Drop unnecessary dependences from mlir-translate (details)
  718. Lower linalg.indexed_generic to loops. (details)
  719. Use SmallVectorImpl instead of SmallVector for function parameters (NFC) (details)
  720. Support SPIR-V constant op to take DenseElementsAttr as input. (details)
  721. Fix the shape of the outcome in the example code. (details)
  722. Add dialect-attribute-entry requirement to docs (details)
  723. Change conversion CLI flag from -lower-to-llvm to -convert-std-to-llvm (details)
  724. Add '*' and '?' and optional brace parse calls to the Parser (details)
  725. Add getRemappedValue to ConversionPatternRewriter (details)
  726. Add mention to avoid cl::opt for MLIR passes in the developer guide (details)
  727. Add a note on commit messages to our developer guide (details)
  728. Fix pretty printer corner case in mlir_runner_utils.cpp. (details)
  729. Add VectorOps.StridedSliceOp (details)
  730. Make type and rank explicit in mcuMemHostRegister function. (details)
  731. Add some CMake rules for installing headers, mlir-tblgen, and mlir-opt (details)
  732. Extend kernel outlining to also consider dim worth inlining. (details)
  733. Fix 'the the' typo. (details)
  734. Fix the comment to Region block iterators. (details)
  735. Add StridedMemRef<>::operator[] - NFC (details)
  736. Add a new OpAsmOpInterface to allow for ops to directly hook into the (details)
  737. Implement unrolling of vector ops to finer-grained vector ops as a (details)
  738. Changes to SubViewOp to make it more amenable to canonicalization. (details)
  739. Add multi-level DCE pass. (details)
  740. missing outer index %i in search_body (details)
  741. Verify subview op result has dynamic shape, when sizes are specified. (details)
  742. Add VectorContractionOp to the VectorOps dialect. (details)
  743. Merge DCE and unreachable block elimination into a new utility (details)
  744. Correctly parse empty affine maps. (details)
  745. Add a document detailing operation traits, how to define them, and the (details)
  746. NFC: Use Region::getBlocks to fix build failure with drop_begin. (details)
  747. Fixed typo in 2-d tiled layout (details)
  748. Fix OSS build (details)
  749. Don't force newline before function attributes (details)
  750. Add missing include after LLVM 049043b598ef5b12a5894c0c22db8608be70f517 (details)
  751. Split Linalg declarative patterns from specific test patterns - NFC (details)
  752. Drop unused function - NFC (details)
  753. Fix OSS builds - NFC (details)
  754. NFC: Add wrappers around DenseIntElementsAttr/DenseFPElementsAttr::get (details)
  755. Change CUDA tests to use print_memref. (details)
  756. Add support for using the ODS result names as the Asm result names for (details)
  757. Move Linalg Transforms that are actually Conversions - NFC (details)
  758. Add more detail about locations in Chapter 2 of tutorial. (details)
  759. Unify vector op names with other dialects. (details)
  760. Small formatting fix in Tutorial Ch2. (details)
  761. Add more canonicalizations for SubViewOp. (details)
  762. [spirv] Add a canonicalizer for `spirv::LogicalNotOp`. (details)
  763. Fix Windows Build (details)
  764. NFC: Remove unnecessarily guarded tablegen includes. (details)
  765. Make isValidSymbol more powerful (details)
  766. [spirv] NFC: rename test files and sort tests inside (details)
  767. NFC: Wire up DRR settings for SPIR-V canonicalization patterns (details)
  768. Support folding of StandardOps with DenseElementsAttr. (details)
  769. Introduce gpu.func (details)
  770. Add vector.insertelement op (details)
  771. Allow memref_cast from static strides to dynamic strides. (details)
  772. Introduce attributes that specify the final ABI for a spirv::ModuleOp. (details)
  773. De-duplicate EnumAttr overrides by defining defaults (details)
  774. Changing directory shortcut for CPU/GPU runner utils. (details)
  775. Update VectorContractionOp to take iterator types and index mapping (details)
  776. Add missing rule to generate SPIR-V ABI Attribute using tblgen to CMake. (details)
  777. NFC: Actually expose the implementation of createGPUToSPIRVLoweringPass. (details)
  778. Make std.divis and std.diviu support ElementsAttr folding. (details)
  779. Allow LLVM::ExtractElementOp to have non-i32 indices. (details)
  780. Add a vector.InsertStridedSliceOp (details)
  781. Use vector.InsertStridedSlice in Vector -> Vector unrolling (details)
  782. Add support for AttrSizedOperandSegments/AttrSizedResultSegments (details)
  783. Some minor corrections and improvements to LangRef (details)
  784. Relax restriction on affine_apply dim and symbol operands (details)
  785. Automated rollback of commit d60133f89bb08341718bb3132b19bc891f7d4f4d (details)
  786. Misc changes to lowering to SPIR-V. (details)
  787. Add OpenMP dialect to the dialect registry (details)
  788. [VectorOps] Add a BroadcastOp to the VectorOps dialect (details)
  789. Add create method that takes equivalent of OperationState with (details)
  790. [VectorOps] Refine BroadcastOp in VectorOps dialect (details)
  791. Implement Linalg to loops lowering as a pattern (details)
  792. Fixed typo in Toy tutorial (second var e -> var f) (details)
  793. [spirv] Add folders for spv.IAdd and spv.IMul (details)
  794. [spirv] NFC: Add getZero() and getOne() static method to ConstantOp (details)
  795. NFC: A few cleanups for SPIRVLowering (details)
  796. [Linalg] Change attribute n_loop_types to iterator (details)
  797. Split out FunctionLike printing/parsing into (details)
  798. [spirv] Check that operand of `spirv::CompositeExtractOp` is constant (details)
  799. Fixed typo in Ch-1 of Toy tutorial (details)
  800. Fix redundant convert and use NamedAttributeList as value (details)
  801. mlir-tblgen: Dump input records when no generator is set (details)
  802. Introduce Linkage attribute to the LLVM dialect (details)
  803. Lower linalg.indexed_generic with libcall to LLVM. (details)
  804. add missing '>' in Ch-2 (details)
  805. NFC: Update std.subview op to use AttrSizedOperandSegments (details)
  806. [DRR] Introduce `$_` to ignore op argument match (details)
  807. Add missing `>` to the description of std.view. (details)
  808. docs: minor spelling tweaks (details)
  809. Generate dialect documentations in the doc folder for every dialect (details)
  810. [ODS] Generate builders taking unwrapped value and defaults for (details)
  811. [VectorOps] Add legality rules to broadcast (details)
  812. NFC: use `&&` instead of `and` PiperOrigin-RevId: 283392575 (details)
  813. [spirv] NFC: reorder sections in SPIRVBase.td (details)
  814. Add linkage support to LLVMFuncOp (details)
  815. [Linalg] Update/fix documentation for linalg.indexed_generic. (details)
  816. [spirv] Add spv.SubgroupBallotKHROp (details)
  817. Extend conversion of SubViewOp to llvm to also support cases where size (details)
  818. AffineLoopFusion: Prevent fusion of multi-out-edge producer loops (details)
  819. Fix ViewOp to have at most one offset operand (details)
  820. Add python bindings for ArrayAttr, AffineMapAttr. (details)
  821. Add Python bindings for affine expressions with binary operators. (details)
  822. Convert MemRefType to a linearized array in SPIR-V lowering. (details)
  823. Allow analyses to provide a hook 'isInvalidated' to determine if they (details)
  824. Verifier: Better error message in case of successor operand mismatch. (details)
  825. Add CreateMaskOp to the VectorOps dialect. (details)
  826. Make diagnostic a bit clearer. (details)
  827. Add a pass to legalize operations before lowering to SPIR-V. (details)
  828. [spirv] Add spv.GroupNonUniformBallot (details)
  829. Refactor dependencies to expose Vector transformations as patterns - NFC (details)
  830. Avoid variable name conflict in MLIR tutorial code snippet (details)
  831. minor spelling tweaks (details)
  832. Adds support for unrolling single-result vector operations with iterator (details)
  833. Added new FAbs, FCeil, Cos, Neg, Sign, Tanh operations. (details)
  834. Loop coalescing: fix pointer chainsing in use-chain traversal (details)
  835. [spirv] Adding sqrt op in the GLSL extension. (details)
  836. NFC - fix name / comments - isAccessInvariant (details)
  837. Print out large elementsattr's such that they are parseable. (details)
  838. [spirv] Define a few more extensions in SPIRVBase.td (details)
  839. NFC: Fix mismatches between LangRef.md and actual parser implementation. (details)
  840. Drop MaterializeVectorTransfers in favor of simpler declarative (details)
  841. [CSE] NFC: Hash the attribute dictionary pointer instead of the list of (details)
  842. Add canonicalization patterns for vector CreateMaskOp and StridedSliceOp (details)
  843. Add a CL option to Standard to LLVM lowering to use alloca instead of (details)
  844. Add emitOptional(Error|Warning|Remark) functions to simplify emission (details)
  845. Optimize operation ordering to support non-congruent indices. (details)
  846. Add MLIRIR as a dependency to LLVM and related dialects (details)
  847. Move ModuleManager functionality into mlir::SymbolTable. (details)
  848. Fix MLIR Build after LLVM upstream JIT changes (getMainJITDylib removed) (details)
  849. [spirv] Fix nested loop (de)serialization (details)
  850. Add a flag to dump the current stack trace when emitting a diagnostic. (details)
  851. Add spv.AtomicCompareExchangeWeak (details)
  852. Allow specification of the workgroup size for GPUToSPIRV lowering. (details)
  853. Add support for instance specific pass statistics. (details)
  854. [spirv] Add CompositeInsertOp operation (details)
  855. Add UnrankedMemRef Type (details)
  856. Refactor the IRPrinting instrumentation to take a derivable config. (details)
  857. [Linalg] Add permutation information to tiling (details)
  858. Add include path to the TestDialect to fix broken build. (details)
  859. NFC: Add documentation for `-mlir-print-op-on-diagnostic` and (details)
  860. LLVM::AddressOfOp: properly take into account the address space (details)
  861. minor spelling tweaks (details)
  862. DimOp folding for alloc/view dynamic dimensions (details)
  863. [spirv] Reorder `erase` and `emplace` to avoid "invalid iterator (details)
  864. Unroll vector masks along with their associated vector arguments. (details)
  865. Use regex to fix failure when stats are disabled. (details)
  866. fix examples in comments (details)
  867. Add conversions of GPU func with memory attributions to LLVM/NVVM (details)
  868. Generate builder for ops that use InferTypeOpInterface trait in ODS (details)
  869. [VectorOps] Add lowering of vector.broadcast to LLVM IR (details)
  870. Provide a way to get the type of a ValueHandle. (details)
  871. Move GPU::FuncOp definition to ODS - NFC (details)
  872. LLVM::GlobalOp: take address space as builder argument (details)
  873. [VecOps] Rename vector.[insert|extract]element to just (details)
  874. Use named traits in the ODS definition of LLVMFuncOp (details)
  875. Move GPU::LaunchOp to ODS. NFC. (details)
  876. During serialization do a walk of ops in module to find spv.module. (details)
  877. Replace custom getBody method with an ODS-generated in gpu::LaunchOp (details)
  878. Change inferReturnTypes to return LogicalResult and values (details)
  879. NFC: Separate implementation and definition in (details)
  880. Fix langref code snippet - NFC (details)
  881. NFC - update doc, comments, vim syntax file (details)
  882. Add a flag to the IRPrinter instrumentation to only print after a pass (details)
  883. Improve Linalg documentation following the Structured Ops presentation. (details)
  884. Add a new ValueRange class. (details)
  885. Update the builder API to take ValueRange instead of ArrayRef<Value *> (details)
  886. NFC: Expose constFoldBinaryOp via a header (details)
  887. Add a layer of recursive matchers that compose. (details)
  888. Replace spurious SmallVector constructions with ValueRange (details)
  889. Post-submit cleanups in RecursiveMatchers (details)
  890. Add RegionRange for when need to abstract over different region (details)
  891. [StructuredOps][Linalg] Add a primitive pattern to rewrite the (details)
  892. Minor spelling tweaks (details)
  893. Unify vector op unrolling transformation. (details)
  894. Add lowering for module with gpu.kernel_module attribute. (details)
  895. ODS: Generate named accessors for raw attributes (details)
  896. Factor out commonly reusable names across structured ops dialects (details)
  897. [spirv] Add spv.IAdd, spv.ISub, and spv.IMul folders (details)
  898. [spirv] Add CompositeConstruct operation. (details)
  899. Fix minor spelling tweaks. (details)
  900. Add new indexed_accessor_range_base and indexed_accessor_range classes (details)
  901. Refactor the Block support classes. (details)
  902. [VectorOps] Fix off-by-one error in insert/extract validation (details)
  903. [VectorOps] Add a ShuffleOp to the VectorOps dialect (details)
  904. Fix build breakage on gcc-5 (details)
  905. Drop Markdown style annotations (details)
  906. Add a doc on guidelines for contributing a new dialect to the MLIR core (details)
  907. More convenience build methods for SPIR-V ops. (details)
  908. Add Py API for composing an affine expression with a map. Also allows (details)
  909. Uniformize Vector transforms as patterns on the model of Linalg - NFC (details)
  910. [Linalg] Add a Linalg iterator permutation transformation (details)
  911. Refactor the various operand/result/type iterators to use (details)
  912. Fold TestLinalgTilePermutePatterns into TestLinalgTransformPatterns - (details)
  913. Move gpu.launch_func to ODS. NFC (details)
  914. More affine expr simplifications for floordiv and mod (details)
  915. Add VectorOp transform pattern which splits vector TransferReadOps to (details)
  916. [VectorOps] Add lowering of vector.insert to LLVM IR (details)
  917. Add initial liveness analysis including test cases. (details)
  918. [Linalg] Add tiling for IndexedGenericOp with a region. (details)
  919. Add a function to get lowering patterns from GPU to NVVM. (details)
  920. Automated rollback of commit 98fbf41044d3364dbaf18db81b9e8d9520d14761 (details)
  921. Roll-forward initial liveness analysis including test cases. (details)
  922. NFC: Fix naming inconsistency: FuncOpLowering -> GPUFuncOpLowering. (details)
  923. Continue refactoring StructuredOps utilities (details)
  924. [spirv] Add lowering for std.fdiv, std.frem, std.fsub (details)
  925. Expose a convenience function to add interface attributes to a function. (details)
  926. Fix OSS build (details)
  927. Add missing CMake dependency for MLIRTestIR. (details)
  928. Add std.log* and llvm.intr.log* that correspond to the LLVMIR intrinsics (details)
  929. Make OpBuilder::insert virtual instead of OpBuilder::createOperation. (details)
  930. Switch from shfl.bfly to shfl.down. (details)
  931. Automated rollback of commit f68ac464d818629e0fe10c23b44ac782d64a12d2 (details)
  932. Move cpu runner utils templates to .h (details)
  933. Added lowering of `std.tanh` to llvm function call to `tanh` and (details)
  934. [Linalg] Add test for fusion of GenericOp with IndexedGenericOp. (details)
  935. Retire !linalg.buffer type - NFC (details)
  936. Add type inference variant for separate params builder generated (details)
  937. [VectorOps] Add lowering of vector.shuffle to LLVM IR (details)
  938. Fix logic on when to emit collective type but separate arg builder (details)
  939. NFC: Cleanup the various Op::print methods. (details)
  940. Fix maskAndClamp in gpu.all_reduce. (details)
  941. Add a type range for the XLA HLO dialect. (details)
  942. Try to fold operations in DialectConversion when trying to legalize. (details)
  943. Add a layer of EDSC for linalg.GenericOp (details)
  944. Skip generating C++ for "DeclareOpInterfaceMethods" in op interface gen. (details)
  945. Refactor various canonicalization patterns as in-place folds. (details)
  946. Apply a level of sugaring to the linalg.generic EDSC - NFC (details)
  947. Reconcile struct and class for NestedPatternMatchers - NFC (details)
  948. Add verifyCompatibleShape function overload with shapes (details)
  949. Splat op doc - fix misformat / update tablegen op desc. comment (details)
  950. Remove LLVM dependency on mlir::Module and instead check Traits. (details)
  951. Make memref promotion during std->LLVM lowering the default calling (details)
  952. Adds ExtractSlicesOp to the VectorOps dialect. (details)
  953. [VectorOps] Add [insert/extract]element definition together with (details)
  954. Remove unused variable (fix warning) NFC (details)
  955. [Linalg] Expose subview promotion as a declarative pattern (details)
  956. Make "LowerToCFG" an operation pass (details)
  957. Insert signature-converted blocks into a region with a parent operation. (details)
  958. Plug gpu.func into the GPU lowering pipelines (details)
  959. Add InsertSlicesOp to the VectorOps dialect. (details)
  960. Add edsc::ops for pointwise, conv and dilated_conv (details)
  961. [spirv] Re-enable nested loop (de)serialization test (details)
  962. Fix (de)serialization generation for SPV_ScopeAttr, (details)
  963. Add atomic operations to SPIR-V dialect. (details)
  964. Update vector op unrolling transformation to generate ExtractSlicesOp (details)
  965. Replace code with equivalent satisfiesLLVMModule() function call. (details)
  966. Add pattern rewrite which splits a vector TransferReadOp into slices (details)
  967. Integrate from upstream at revision e4fce659a759. (details)
  968. Add a new utility class TypeSwitch to ADT. (details)
  969. fix a typo in OpDefinitions doc (details)
  970. Add pattern rewrite to forward vector tuple elements to their users. (details)
  971. Homogenize the description of the MemRef conversion to the LLVM dialect (details)
  972. StdToLLVM conversion: drop getMemRefElementType utility function (details)
  973. ConversionToLLVMDialect doc: update the syntax for LLVM types (details)
  974. Make it possible to override the lowering of MemRef to the LLVM dialect. (details)
  975. Add missing virtual inliner interface method in SPIR-V dialect. (details)
  976. Add pattern rewrite which splits a vector TransferWriteOp into slices (details)
  977. NFC: Use TypeSwitch to simplify existing code. PiperOrigin-RevId: (details)
  978. NFC: Use this-> to appease GCC bug related to template lambda. (details)
  979. Add support for float and string attributes to the C API and python (details)
  980. Harden the requirements to memory attribution types in gpu.func (details)
  981. Fix line break in LangRef (details)
  982. Move function template definition to the header file. NFC (details)
  983. NFC: Remove unnecessary 'llvm::' prefix from uses of llvm symbols (details)
  984. Introduce prefetch op: affine -> std -> llvm intrinsic (details)
  985. NFC: Cleanup non-conforming usages of namespaces. (details)
  986. Update code block designations (details)
  987. Add support for providing a default implementation for an interface (details)
  988. NFC: Remove forbidden include of <iostream> (details)
  989. [VectorOps] Add vector.print definition, with lowering support (details)
  990. Added LLVM ops and lowering phases from standard dialect for FAbs, (details)
  991. Move the specializations of VectorTransferRewriter::matchAndRewrite back (details)
  992. Add a couple useful LLVM_DEBUG's to the inliner. (details)
  993. [VectorOps] Replace iostream with stdio in support lib for vector.print (details)
  994. Add runtime utils support for print_memref_i8 (details)
  995. Detemplatize ModuleTranslation::lookupValues (details)
  996. [VectorOps] minor cleanup: vector dialect "subscripts" are i32 (details)
  997. LLVMFuncOp: implement addEntryBlock (details)
  998. [VectorOps] Add vector ReshapeOp to the VectorOps dialect. (details)
  999. Restructure and update Linalg ODS and documentation - NFC (details)
  1000. [VectorOps] Update vector transfer_read/write ops to operatate on (details)
  1001. Unique trait list during ODS Operator trait construction (details)
  1002. Allow dialect to create friendly names for region arguments (details)
  1003. Add gpu.shuffle op. (details)
  1004. fix isValidDim for block arg case (details)
  1005. [VectorOps] remove redundant returns from invalid ops test (details)
  1006. [VectorOps] unify vector dialect "subscripts" (details)
  1007. NFC: Move the classes related to Pass options into a new header file (details)
  1008. Make Type and Attribute classes trivially copyable (details)
  1009. Add integer bit-shift operations to the standard dialect. (details)
  1010. NFC: Introduce new ValuePtr/ValueRef typedefs to simplify the transition (details)
  1011. Adjust License.txt file to use the LLVM license (details)
  1012. ReImplement the Value classes as value-typed objects wrapping an (details)
  1013. Automated rollback of commit f603a50109107b447b835dac11f0eb541288393e (details)
  1014. Resubmit: ReImplement the Value classes as value-typed objects wrapping (details)
  1015. Update SPIR-V.md (details)
  1016. Change the `notifyRootUpdated` API to be transaction based. (details)
  1017. NFC: Replace ValuePtr with Value and remove it now that Value is (details)
  1018. Refactor the way that pass options are specified. (details)
  1019. Remove pybind11-based bindings (details)
  1020. Adjust some MLIR paths and docs (details)
  1021. [DWARF] Check that all fields of a Unit Header are read. (details)
  1022. DebugInfo: Support dumping any exprloc as an expression (details)
  1023. NFC: Rename printOptionValue to printValue to fix MSVC build. (details)
  1024. test: correct flags for Windows (details)
Commit 6d8611b38f59e16c1c3bce5bfbb62714cb6c6674 by gardener
LLVM Dialect: introduce llvm.global
Introduce an operation that defines global constants and variables in
the LLVM dialect, to reflect the corresponding LLVM IR capability. This
operation is expected to live in the top-level module and behaves
similarly to llvm.constant.  It currently does not model many of the
attributes supported by the LLVM IR for global values (memory space,
alignment, thread-local, linkage) and will be extended as the relevant
use cases appear.
PiperOrigin-RevId: 262539445
The file was modifiedmlir/lib/LLVMIR/IR/LLVMDialect.cpp
The file was modifiedmlir/include/mlir/LLVMIR/LLVMOps.td
The file was modifiedmlir/g3doc/Dialects/LLVM.md
The file was addedmlir/test/LLVMIR/global.mlir
The file was modifiedmlir/lib/Parser/Parser.cpp
The file was modifiedmlir/include/mlir/IR/OpImplementation.h
Commit 92dc127ab347cbc4cb4b93db04109eea2a3c13e3 by gardener
Add support for vector ops in the LLVM dialect
This CL is step 1/n towards building a simple, programmable and portable
vector abstraction in MLIR that can go all the way down to generating
assembly vector code via LLVM's opt and llc tools.
This CL adds the 3 instructions `llvm.extractelement`,
`llvm.insertelement` and `llvm.shufflevector` as documented in the LLVM
LangRef "Vector Instructions" section.
The "Experimental Vector Reduction Intrinsics" are left out for now and
can be added in the future on a per-need basis.
Appropriate roundtrip and LLVM Target tests are added.
PiperOrigin-RevId: 262542095
The file was modifiedmlir/test/LLVMIR/roundtrip.mlir
The file was modifiedmlir/test/LLVMIR/invalid.mlir
The file was modifiedmlir/include/mlir/LLVMIR/LLVMDialect.h
The file was modifiedmlir/include/mlir/LLVMIR/LLVMOps.td
The file was modifiedmlir/lib/LLVMIR/IR/LLVMDialect.cpp
The file was modifiedmlir/test/Target/llvmir.mlir
Commit 39f1b9a053a38c8acafbc0244028c0e9d665f63b by gardener
Add a higher-order vector.extractelement operation in MLIR
This CL is step 2/n towards building a simple, programmable and portable
vector abstraction in MLIR that can go all the way down to generating
assembly vector code via LLVM's opt and llc tools.
This CL adds the vector.extractelement operation to the MLIR vector
dialect as well as the appropriate roundtrip test. Lowering to LLVM will
occur in the following CL.
PiperOrigin-RevId: 262545089
The file was modifiedmlir/lib/Analysis/VectorAnalysis.cpp
The file was modifiedmlir/lib/Transforms/Vectorize.cpp
The file was modifiedmlir/include/mlir/CMakeLists.txt
The file was modifiedmlir/lib/VectorOps/CMakeLists.txt
The file was addedmlir/test/Dialect/VectorOps/ops.mlir
The file was modifiedmlir/lib/Transforms/LowerVectorTransfers.cpp
The file was addedmlir/include/mlir/VectorOps/CMakeLists.txt
The file was addedmlir/test/Dialect/VectorOps/invalid.mlir
The file was addedmlir/include/mlir/VectorOps/VectorOps.td
The file was modifiedmlir/include/mlir/EDSC/Intrinsics.h
The file was modifiedmlir/lib/Transforms/MaterializeVectors.cpp
The file was modifiedmlir/lib/Analysis/LoopAnalysis.cpp
The file was modifiedmlir/include/mlir/VectorOps/VectorOps.h
The file was modifiedmlir/lib/VectorOps/DialectRegistration.cpp
The file was modifiedmlir/lib/VectorOps/VectorOps.cpp
Commit d2aba89f2e88d529ec203a7d9121c8451893e66b by gardener
Add a higher-order vector.outerproduct operation in MLIR
This CL is step 2/n towards building a simple, programmable and portable
vector abstraction in MLIR that can go all the way down to generating
assembly vector code via LLVM's opt and llc tools.
This CL adds the vector.outerproduct operation to the MLIR vector
dialect as well as the appropriate roundtrip test. Lowering to LLVM will
occur in the following CL.
PiperOrigin-RevId: 262552027
The file was modifiedmlir/include/mlir/VectorOps/VectorOps.td
The file was modifiedmlir/lib/VectorOps/VectorOps.cpp
The file was modifiedmlir/test/Dialect/VectorOps/invalid.mlir
The file was modifiedmlir/test/Dialect/VectorOps/ops.mlir
Commit 20f2d3b5981fd9a50c7e54a66fa88e6fac957a81 by gardener
Allow linalg.view to change the underlying elemental type.
This CL adds the ability for linalg.view to act as a bitcast operation.
This will be used when promoting views into faster memory and casting to
vector types.
In the process, linalg.view is moved to ODS.
PiperOrigin-RevId: 262556246
The file was modifiedmlir/include/mlir/Linalg/IR/LinalgOps.td
The file was modifiedmlir/lib/Linalg/Transforms/LowerToLLVMDialect.cpp
The file was modifiedmlir/test/Linalg/roundtrip.mlir
The file was modifiedmlir/lib/Linalg/IR/LinalgOps.cpp
The file was modifiedmlir/lib/Linalg/Analysis/DependenceAnalysis.cpp
The file was modifiedmlir/include/mlir/Linalg/IR/LinalgOps.h
The file was modifiedmlir/lib/Linalg/IR/LinalgTypes.cpp
Commit 59b473c231f6295bd4aa7199da5816caae5a5e3a by gardener
External library name mangling support for linalg.
This CL introduces the ability to generate the external library name for
Linalg operations. The problem is that neither mlir or C support
overloading and we want a simplified form of name mangling that is still
reasonable to read. This CL creates the name of the external call that
Linalg expects from the operation name and the type of its arguments.
The interface library names are updated and use new cases are added for
FillOp.
PiperOrigin-RevId: 262556833
The file was modifiedmlir/test/Linalg/llvm.mlir
The file was modifiedmlir/lib/Linalg/Transforms/LowerToLLVMDialect.cpp
The file was modifiedmlir/lib/Linalg/IR/LinalgOps.cpp
The file was modifiedmlir/test/mlir-cpu-runner/cblas_interface.cpp
The file was modifiedmlir/include/mlir/Linalg/IR/LinalgOps.h
The file was modifiedmlir/include/mlir/Linalg/IR/LinalgLibraryOps.td
The file was modifiedmlir/test/mlir-cpu-runner/linalg_integration_test.mlir
Commit b9ff2dd87edef4a750f2caccbd4923500f3d8405 by gardener
Translation to LLVM: support llvm.global
Add support for translating recently introduced llvm.global operations
to global variables in the LLVM IR proper.
PiperOrigin-RevId: 262564700
The file was modifiedmlir/include/mlir/Target/LLVMIR/ModuleTranslation.h
The file was modifiedmlir/lib/Target/LLVMIR/ModuleTranslation.cpp
The file was modifiedmlir/test/Target/llvmir.mlir
Commit 68451df267eda7961fca930ab29c6d38f43b97e2 by gardener
LLVM dialect and translation: support global strings
Unlike regular constant values, strings must be placed in some memory
and referred to through a pointer to that memory.  Until now, they were
not supported in function-local constant declarations with
`llvm.constant`. Introduce support for global strings using
`llvm.global`, which would translate them into global arrays in LLVM IR
and thus make sure they have some memory allocated for storage.
PiperOrigin-RevId: 262569316
The file was modifiedmlir/test/LLVMIR/global.mlir
The file was modifiedmlir/test/Target/llvmir.mlir
The file was modifiedmlir/lib/Target/LLVMIR/ModuleTranslation.cpp
The file was modifiedmlir/g3doc/Dialects/LLVM.md
The file was modifiedmlir/lib/LLVMIR/IR/LLVMDialect.cpp
The file was modifiedmlir/include/mlir/LLVMIR/LLVMDialect.h
Commit baa1ec22f742c3e1545404cb30d2073b87c7271b by gardener
Translation to LLVM IR: use LogicalResult instead of bool
The translation code predates the introduction of LogicalResult and was
relying on the obsolete LLVM convention of returning false on success.
Change it to use MLIR's LogicalResult abstraction instead. NFC.
PiperOrigin-RevId: 262589432
The file was modifiedmlir/tools/mlir-tblgen/LLVMIRConversionGen.cpp
The file was modifiedmlir/lib/Target/LLVMIR/ModuleTranslation.cpp
The file was modifiedmlir/lib/Target/LLVMIR/ConvertToNVVMIR.cpp
The file was modifiedmlir/include/mlir/Target/LLVMIR/ModuleTranslation.h
Commit 41968fb4753118afe5a9f4fecf184fac90d96fe6 by gardener
NFC: Update usages of OwningRewritePatternList to pass by & instead of
&&.
This will allow for reusing the same pattern list, which may be costly
to continually reconstruct, on multiple invocations.
PiperOrigin-RevId: 262664599
The file was modifiedmlir/lib/Linalg/Transforms/LowerToLoops.cpp
The file was modifiedmlir/include/mlir/IR/PatternMatch.h
The file was modifiedmlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp
The file was modifiedmlir/lib/Transforms/LowerVectorTransfers.cpp
The file was modifiedmlir/test/lib/TestDialect/TestPatterns.cpp
The file was modifiedmlir/examples/toy/Ch5/mlir/LateLowering.cpp
The file was modifiedmlir/lib/Dialect/QuantOps/Transforms/ConvertConst.cpp
The file was modifiedmlir/lib/Transforms/LowerAffine.cpp
The file was modifiedmlir/lib/Dialect/FxpMathOps/Transforms/LowerUniformRealMath.cpp
The file was modifiedmlir/lib/Transforms/DialectConversion.cpp
The file was modifiedmlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp
The file was modifiedmlir/lib/Dialect/QuantOps/Transforms/ConvertSimQuant.cpp
The file was modifiedmlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp
The file was modifiedmlir/include/mlir/Transforms/DialectConversion.h
The file was modifiedmlir/examples/Linalg/Linalg1/lib/ConvertToLLVMDialect.cpp
The file was modifiedmlir/examples/Linalg/Linalg3/lib/ConvertToLLVMDialect.cpp
The file was modifiedmlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRVPass.cpp
The file was modifiedmlir/lib/Quantizer/Transforms/RemoveInstrumentationPass.cpp
The file was modifiedmlir/lib/Linalg/Transforms/LowerToLLVMDialect.cpp
The file was modifiedmlir/lib/Transforms/Canonicalizer.cpp
The file was modifiedmlir/examples/toy/Ch5/mlir/EarlyLowering.cpp
The file was modifiedmlir/lib/Conversion/ControlFlowToCFG/ConvertControlFlowToCFG.cpp
The file was modifiedmlir/examples/Linalg/Linalg3/lib/Transforms.cpp
Commit ac68637ba94d05f413b1b963950c300fb2f81a99 by gardener
NFC: Refactoring PatternSymbolResolver into SymbolInfoMap
In declarative rewrite rules, a symbol can be bound to op arguments or
results in the source pattern, and it can be bound to op results in the
result pattern. This means given a symbol in the pattern, it can stands
for different things: op operand, op attribute, single op result, op
result pack. We need a better way to model this complexity so that we
can handle according to the specific kind a symbol corresponds to.
Created SymbolInfo class for maintaining the information regarding a
symbol. Also created a companion SymbolInfoMap class for a map of such
symbols, providing insertion and querying depending on use cases.
PiperOrigin-RevId: 262675515
The file was modifiedmlir/tools/mlir-tblgen/RewriterGen.cpp
The file was modifiedmlir/include/mlir/TableGen/Pattern.h
The file was modifiedmlir/lib/TableGen/Pattern.cpp
Commit 1e42954032cd4288963b652e1eeeb26915cf8eac by gardener
NFC: Standardize the terminology used for parent ops/regions/etc.
There are currently several different terms used to refer to a parent IR
unit in 'get' methods: getParent/getEnclosing/getContaining. This cl
standardizes all of these methods to use 'getParent*'.
PiperOrigin-RevId: 262680287
The file was modifiedmlir/lib/Analysis/Utils.cpp
The file was modifiedmlir/lib/Dialect/LoopOps/LoopOps.cpp
The file was modifiedmlir/examples/toy/Ch5/mlir/LateLowering.cpp
The file was modifiedmlir/test/lib/TestDialect/TestPatterns.cpp
The file was modifiedmlir/test/lib/Transforms/TestLoopParametricTiling.cpp
The file was modifiedmlir/include/mlir/IR/Region.h
The file was modifiedmlir/lib/Analysis/AffineAnalysis.cpp
The file was modifiedmlir/lib/Transforms/AffineDataCopyGeneration.cpp
The file was modifiedmlir/include/mlir/IR/Block.h
The file was modifiedmlir/lib/IR/Value.cpp
The file was modifiedmlir/include/mlir/IR/OpDefinition.h
The file was modifiedmlir/lib/IR/Region.cpp
The file was modifiedmlir/lib/Transforms/Utils/FoldUtils.cpp
The file was modifiedmlir/include/mlir/IR/Operation.h
The file was modifiedmlir/include/mlir/Transforms/RegionUtils.h
The file was modifiedmlir/include/mlir/IR/Value.h
The file was modifiedmlir/lib/AffineOps/AffineOps.cpp
The file was modifiedmlir/lib/IR/AsmPrinter.cpp
The file was modifiedmlir/lib/IR/Operation.cpp
The file was modifiedmlir/test/lib/Transforms/TestLoopMapping.cpp
The file was modifiedmlir/lib/Transforms/Utils/RegionUtils.cpp
The file was modifiedmlir/lib/Analysis/Dominance.cpp
The file was modifiedmlir/lib/IR/Block.cpp
Commit 300a2bda34eb64ea10f0f8f9895f82b87cad8aa9 by gardener
Refactor DenseElementAttr::getValues methods to return full ranges for
splats.
The current implementation only returns one element for the splat case,
which often comes as a surprise; leading to subtle/confusing bugs. The
new behavior will include an iterate over the full range of elements, as
defined by the shaped type, by providing the splat value for each
iterator index.
PiperOrigin-RevId: 262756780
The file was modifiedmlir/lib/Dialect/QuantOps/Utils/QuantizeUtils.cpp
The file was modifiedmlir/lib/IR/Attributes.cpp
The file was modifiedmlir/lib/IR/AsmPrinter.cpp
The file was modifiedmlir/include/mlir/IR/Attributes.h
Commit 40fc948e55c3512897a6d8c19d9a1ccccb17fb2c by gardener
ODS: Round out the definitions of the common integer attributes sizes,
adding 1/8/16 bit attrs.  NFC
PiperOrigin-RevId: 262843016
The file was modifiedmlir/include/mlir/IR/OpBase.td
Commit 5290e8c36d4e4aac4d8ce2726f6d373e87501945 by gardener
NFC: Update pattern rewrite API to pass OwningRewritePatternList by
const reference.
The pattern list is not modified by any of these APIs and should thus be
passed with const.
PiperOrigin-RevId: 262844002
The file was modifiedmlir/include/mlir/IR/PatternMatch.h
The file was modifiedmlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp
The file was modifiedmlir/include/mlir/Transforms/DialectConversion.h
The file was modifiedmlir/lib/IR/PatternMatch.cpp
The file was modifiedmlir/lib/Transforms/DialectConversion.cpp
Commit 252ada493276eace3e23802fb70ff3c7be53837d by gardener
Add lowering of vector dialect to LLVM dialect.
This CL is step 3/n towards building a simple, programmable and portable
vector abstraction in MLIR that can go all the way down to generating
assembly vector code via LLVM's opt and llc tools.
This CL adds support for converting MLIR n-D vector types to (n-1)-D
arrays of 1-D LLVM vectors and a conversion VectorToLLVM that lowers the
`vector.extractelement` and `vector.outerproduct` instructions to the
proper mix of `llvm.vectorshuffle`, `llvm.extractelement` and
`llvm.mulf`.
This has been independently verified to produce proper avx2 code.
Input:
``` func @vec_1d(%arg0: vector<4xf32>, %arg1: vector<8xf32>) ->
vector<8xf32> {
%2 = vector.outerproduct %arg0, %arg1 : vector<4xf32>, vector<8xf32>
%3 = vector.extractelement %2[0 : i32]: vector<4x8xf32>
return %3 : vector<8xf32>
}
```
Command:
``` mlir-opt vector-to-llvm.mlir -vector-lower-to-llvm-dialect
--disable-pass-threading | mlir-opt -lower-to-cfg -lower-to-llvm |
mlir-translate --mlir-to-llvmir | opt -O3 | llc -O3 -march=x86-64
-mcpu=haswell -mattr=fma,avx2
```
Output:
``` vec_1d:                                 # @vec_1d
# %bb.0:
       vbroadcastss    %xmm0, %ymm0
       vmulps  %ymm1, %ymm0, %ymm0
       retq
``` PiperOrigin-RevId: 262895929
The file was modifiedmlir/tools/mlir-opt/CMakeLists.txt
The file was modifiedmlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp
The file was addedmlir/test/Conversion/VectorToLLVM/vector-to-llvm.mlir
The file was modifiedmlir/lib/Conversion/CMakeLists.txt
The file was addedmlir/lib/Conversion/VectorToLLVM/VectorToLLVM.cpp
The file was addedmlir/include/mlir/Conversion/VectorToLLVM/VectorToLLVM.h
The file was modifiedmlir/g3doc/ConversionToLLVMDialect.md
The file was addedmlir/lib/Conversion/VectorToLLVM/CMakeLists.txt
Commit 2dd38b09c111ff6963c5c592c76e9b771a8f691f by gardener
LLVM dialect: introduce llvm.addressof to access globals
This instruction is a local counterpart of llvm.global that takes a
symbol reference to a global and produces an SSA value containing the
pointer to it. Used in combination, these two operations allow one to
use globals with other operations expecting SSA values.  At a cost of IR
indirection, we make sure the functions don't implicitly capture the
surrounding SSA values and remain suitable for parallel processing.
PiperOrigin-RevId: 262908622
The file was modifiedmlir/test/LLVMIR/global.mlir
The file was modifiedmlir/include/mlir/LLVMIR/LLVMOps.td
The file was modifiedmlir/include/mlir/Target/LLVMIR/ModuleTranslation.h
The file was modifiedmlir/g3doc/Dialects/LLVM.md
The file was modifiedmlir/lib/Target/LLVMIR/ModuleTranslation.cpp
The file was modifiedmlir/lib/LLVMIR/IR/LLVMDialect.cpp
The file was modifiedmlir/test/Target/llvmir.mlir
Commit fe2ea3003b1d0760a3ecef7a15cbfb9849ae5eea by gardener
Update typo
cond_br was accidentally typed as br_cond in a few examples.
PiperOrigin-RevId: 262929398
The file was modifiedmlir/g3doc/Rationale.md
The file was modifiedmlir/g3doc/LangRef.md
Commit 77ed5247bffc3b63f8d0fbba154bcd8e2ed5a66d by gardener
Avoid passing in line/col for files not registered with SourceMgr.
This can result in index expression overflow in "Loc.getPointer() -
ColumnNo" in SourgeMgr.
loc could also be prefixed to the message additionally in this case.
PiperOrigin-RevId: 262935408
The file was modifiedmlir/lib/IR/Diagnostics.cpp
Commit e6365f3d0282a9d260967f45509912b368aee12c by gardener
Use unreachable post switch rather than default case.
Prefer to enumerate all cases in the switch instead of using default to
allow compiler to flag missing cases. This also avoids
-Wcovered-switch-default warning.
PiperOrigin-RevId: 262935972
The file was modifiedmlir/lib/Target/LLVMIR/ModuleTranslation.cpp
Commit 532c652d6c5490f9d5380fc7d40837e6414c2ef8 by gardener
Add start of textmate language grammar.
Basic* grammar to start of with, this doesn't handle custom ops and
doesn't handle ops with regions. But useful enough to make reading the
.mlir files easier.
Followed the approach used for emacs & vim and placed in separate
directory under utils.
* I got a little bit carried away trying to handle attributes and tried
to do some custom op printing handling, but finally abandoned it. Also
first time writing a textmate grammar so I assume a lot can be improved
:)
PiperOrigin-RevId: 262985490
The file was addedmlir/utils/textmate/mlir.json
Commit 926fb685deadfed2042163145ac52311914bf5c2 by gardener
Express ownership transfer in PassManager API through std::unique_ptr
(NFC)
Since raw pointers are always passed around for IR construct without
implying any ownership transfer, it can be error prone to have implicit
ownership transferred the same way. For example this code can seem
harmless:
  Pass *pass = ....
pm.addPass(pass);
pm.addPass(pass);
pm.run(module);
PiperOrigin-RevId: 263053082
The file was modifiedmlir/lib/Dialect/QuantOps/Transforms/ConvertConst.cpp
The file was modifiedmlir/test/lib/TestDialect/TestPatterns.cpp
The file was modifiedmlir/lib/Dialect/GPU/Transforms/KernelOutlining.cpp
The file was modifiedmlir/examples/toy/Ch5/mlir/EarlyLowering.cpp
The file was modifiedmlir/include/mlir/Pass/PassRegistry.h
The file was modifiedmlir/lib/Transforms/StripDebugInfo.cpp
The file was modifiedmlir/examples/toy/Ch4/mlir/ShapeInferencePass.cpp
The file was modifiedmlir/lib/Transforms/LoopFusion.cpp
The file was modifiedmlir/examples/toy/Ch5/toyc.cpp
The file was modifiedmlir/test/lib/Transforms/TestConstantFold.cpp
The file was modifiedmlir/lib/Dialect/QuantOps/Transforms/ConvertSimQuant.cpp
The file was modifiedmlir/include/mlir/Dialect/GPU/Passes.h
The file was modifiedmlir/lib/Linalg/Transforms/Fusion.cpp
The file was modifiedmlir/lib/Transforms/Canonicalizer.cpp
The file was modifiedmlir/test/lib/Transforms/TestLoopFusion.cpp
The file was modifiedmlir/examples/toy/Ch4/toyc.cpp
The file was modifiedmlir/examples/toy/Ch5/mlir/LateLowering.cpp
The file was modifiedmlir/test/lib/Transforms/TestLoopMapping.cpp
The file was modifiedmlir/lib/Transforms/CSE.cpp
The file was modifiedmlir/lib/Pass/Pass.cpp
The file was modifiedmlir/test/lib/Transforms/TestVectorizationUtils.cpp
The file was modifiedmlir/lib/Quantizer/Transforms/AddDefaultStatsTestPass.cpp
The file was modifiedmlir/lib/Conversion/GPUToCUDA/GenerateCubinAccessors.cpp
The file was modifiedmlir/include/mlir/Quantizer/Transforms/Passes.h
The file was modifiedmlir/examples/toy/Ch5/include/toy/Passes.h
The file was modifiedmlir/examples/toy/Ch5/mlir/ShapeInferencePass.cpp
The file was modifiedmlir/examples/Linalg/Linalg3/include/linalg3/Transforms.h
The file was modifiedmlir/lib/Transforms/MemRefDataFlowOpt.cpp
The file was modifiedmlir/lib/Linalg/Transforms/Tiling.cpp
The file was modifiedmlir/lib/Conversion/GPUToCUDA/ConvertKernelFuncToCubin.cpp
The file was modifiedmlir/include/mlir/Transforms/Passes.h
The file was modifiedmlir/lib/Pass/PassDetail.h
The file was modifiedmlir/examples/toy/Ch4/include/toy/Passes.h
The file was modifiedmlir/lib/Transforms/LoopTiling.cpp
The file was modifiedmlir/lib/Transforms/LoopUnroll.cpp
The file was modifiedmlir/lib/Transforms/LoopInvariantCodeMotion.cpp
The file was modifiedmlir/lib/Transforms/SimplifyAffineStructures.cpp
The file was modifiedmlir/lib/Transforms/LoopCoalescing.cpp
The file was modifiedmlir/include/mlir/Dialect/SPIRV/Passes.h
The file was modifiedmlir/include/mlir/Pass/PassManager.h
The file was modifiedmlir/include/mlir/Pass/Pass.h
The file was modifiedmlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVMPass.h
The file was modifiedmlir/lib/Transforms/LoopUnrollAndJam.cpp
The file was modifiedmlir/lib/Transforms/LowerVectorTransfers.cpp
The file was modifiedmlir/lib/Quantizer/Transforms/InferQuantizedTypesPass.cpp
The file was modifiedmlir/include/mlir/Dialect/QuantOps/Passes.h
The file was modifiedmlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRVPass.cpp
The file was modifiedmlir/examples/Linalg/Linalg3/lib/Transforms.cpp
The file was modifiedmlir/lib/Conversion/LoopsToGPU/LoopsToGPUPass.cpp
The file was modifiedmlir/include/mlir/Conversion/LoopsToGPU/LoopsToGPUPass.h
The file was modifiedmlir/include/mlir/Linalg/Passes.h
The file was modifiedmlir/lib/Transforms/PipelineDataTransfer.cpp
The file was modifiedmlir/examples/toy/Ch5/include/toy/Lowering.h
The file was modifiedmlir/lib/Quantizer/Transforms/RemoveInstrumentationPass.cpp
The file was modifiedmlir/include/mlir/Conversion/GPUToCUDA/GPUToCUDAPass.h
The file was modifiedmlir/lib/Transforms/AffineDataCopyGeneration.cpp
The file was modifiedmlir/lib/Linalg/Transforms/LowerToLoops.cpp
The file was modifiedmlir/lib/Transforms/LowerAffine.cpp
The file was modifiedmlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp
The file was modifiedmlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp
The file was modifiedmlir/include/mlir/Conversion/GPUToNVVM/GPUToNVVMPass.h
The file was modifiedmlir/lib/Conversion/GPUToCUDA/ConvertLaunchFuncToCudaCalls.cpp
The file was modifiedmlir/lib/Linalg/Transforms/LowerToLLVMDialect.cpp
The file was modifiedmlir/lib/Transforms/MaterializeVectors.cpp
The file was modifiedmlir/lib/Transforms/Vectorize.cpp
The file was modifiedmlir/test/lib/Transforms/TestLoopParametricTiling.cpp
Commit 88de8b2a2bb09e4e3ebb829949e0256c3e86c609 by gardener
GenerateCubinAccessors: use LLVM dialect constants
The GenerateCubinAccessors was generating functions that fill
dynamically-allocated memory with the binary constant of a CUBIN
attached as a stirng attribute to the GPU kernel.  This approach was
taken to circumvent the missing support for global constants in the LLVM
dialect (and MLIR in general). Global constants were recently added to
the LLVM dialect.  Change the GenerateCubinAccessors pass to emit a
global constant array of characters and a function that returns a
pointer to the first character in the array.
PiperOrigin-RevId: 263092052
The file was modifiedmlir/test/Conversion/GPUToCUDA/insert-cubin-getter.mlir
The file was modifiedmlir/lib/Conversion/GPUToCUDA/GenerateCubinAccessors.cpp
Commit 5f0a843144289050844109f16693c86168135dac by gardener
LLVM dialect: introduce fmuladd intrinsic as operation
This operation is important to achieve decent performance in
computational kernels.  In LLVM, it is implemented as an intrinsic
(through function declaration and function call).  Thanks to MLIR's
extendable set of operations, it does not have to differentiate between
built-ins and intrinsics, so fmuladd is introduced as a general
type-polymorphic operation.  Custom printing and parsing will be added
later.
PiperOrigin-RevId: 263106305
The file was addedmlir/test/Target/llvmir-intrinsics.mlir
The file was modifiedmlir/include/mlir/LLVMIR/LLVMOps.td
Commit b09dfcb1d761fcf88ac80cfa98b7e39c45242286 by gardener
Fix indexing issue in lowering of linalg.slice
This CL fixes the stepping through operands when emitting the view sizes
of linalg.slice to LLVMIR. This is now consistent with the strides
emission.
A relevant test is added.
Fix suggested by Alex Zinenko, thanks!
PiperOrigin-RevId: 263150922
The file was modifiedmlir/test/Linalg/llvm.mlir
The file was modifiedmlir/lib/Linalg/Transforms/LowerToLLVMDialect.cpp
Commit 12ff145ebfb54358e16649e8cc888f76292e2f75 by gardener
Add unreachable to avoid GCC -Wreturn-type warning
GCC warns of control reaching end of non-void function (-Wreturn-type).
Closes tensorflow/mlir#75
PiperOrigin-RevId: 263214601
The file was modifiedmlir/lib/TableGen/Pattern.cpp
Commit a9d4015da9489786f063bea07029056e037cbdd3 by gardener
Add a utility script to auto-generate CHECK commands for mlir test
cases.
This script is a utility to add FileCheck patterns to an mlir file. The
script will heuristically insert CHECK/CHECK-LABEL commands for each
line within the file. By default this script will also try to insert
string substitution blocks for all SSA value names. The script is
designed to make adding checks to a test case fast, it is *not* designed
to be authoritative about what constitutes a good test!
Note: Some cases may not be handled well, e.g. operands to operations
with regions, but this script is only intended to be a starting point.
Example usage:
$ generate-test-checks.py foo.mlir
$ mlir-opt foo.mlir -transformation | generate-test-checks.py
module {
func @fold_extract_element(%arg0: index) -> (f32, f16, f16, i32) {
   %cst = constant 4.500000e+00 : f32
   %cst_0 = constant -2.000000e+00 : f16
   %cst_1 = constant 0.000000e+00 : f16
   %c64_i32 = constant 64 : i32
   return %cst, %cst_0, %cst_1, %c64_i32 : f32, f16, f16, i32
}
}
// CHECK-LABEL:   func @fold_extract_element(
// CHECK-SAME:                               [[VAL_0:%.*]]: index) ->
(f32, f16, f16, i32) {
// CHECK:           [[VAL_1:%.*]] = constant 4.500000e+00 : f32
// CHECK:           [[VAL_2:%.*]] = constant -2.000000e+00 : f16
// CHECK:           [[VAL_3:%.*]] = constant 0.000000e+00 : f16
// CHECK:           [[VAL_4:%.*]] = constant 64 : i32
// CHECK:           return [[VAL_1]], [[VAL_2]], [[VAL_3]], [[VAL_4]] :
f32, f16, f16, i32
// CHECK:         }
PiperOrigin-RevId: 263242983
The file was addedmlir/utils/generate-test-checks.py
Commit 4286c52ae8f1e8491c9031702691ce2d0d9c1366 by gardener
Move linalg.slice to ODS
PiperOrigin-RevId: 263334168
The file was modifiedmlir/lib/Linalg/Analysis/DependenceAnalysis.cpp
The file was addedmlir/test/Linalg/invalid.mlir
The file was modifiedmlir/lib/Linalg/IR/LinalgOps.cpp
The file was modifiedmlir/include/mlir/Linalg/IR/LinalgOps.h
The file was modifiedmlir/lib/Linalg/IR/LinalgTypes.cpp
The file was modifiedmlir/lib/Linalg/Transforms/LowerToLLVMDialect.cpp
The file was modifiedmlir/include/mlir/Linalg/IR/LinalgBase.td
The file was modifiedmlir/include/mlir/Linalg/IR/LinalgOps.td
The file was removedmlir/test/Linalg/invalid-generic-op.mlir
Commit 4f10c9b1cefe187947b9a3be60fc88c8548396e3 by gardener
Refactor linalg.view lowering to LLVM - NFC
This CL fuses the emission of size and stride information and makes it
clearer which indexings are stepped over when querying the positions.
This refactor was motivated by an index calculation bug in the stride
computation.
PiperOrigin-RevId: 263341610
The file was modifiedmlir/test/Linalg/llvm.mlir
The file was modifiedmlir/lib/Linalg/Transforms/LowerToLLVMDialect.cpp
Commit ae9ec43e4631d1624afd36f7618c0f7bbf9bd2a5 by gardener
Allow the use of the $cppClass template variable in verifier code
blocks.
PiperOrigin-RevId: 263378198
The file was modifiedmlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
Commit f32f291b375f25f86b93b8b1d41f0c8e98bf5ae4 by gardener
Move remaining linalg ops to ODS - NFC
This CL moves the linalg.load/range/store ops to ODS. Minor cleanups are
performed. Additional invalid IR tests are added for coverage.
PiperOrigin-RevId: 263432110
The file was modifiedmlir/include/mlir/Linalg/IR/LinalgOps.td
The file was modifiedmlir/lib/Linalg/IR/LinalgOps.cpp
The file was modifiedmlir/test/Linalg/roundtrip.mlir
The file was modifiedmlir/test/Linalg/invalid.mlir
The file was modifiedmlir/lib/Linalg/IR/LinalgTypes.cpp
The file was modifiedmlir/include/mlir/Linalg/IR/LinalgOps.h
Commit a481032a3313c44996c3414d91473b494ddb098e by gardener
Refactor ElementsAttr::getValue and DenseElementsAttr::getSplatValue.
All 'getValue' variants now require that the index is valid, queryable
via 'isValidIndex'. 'getSplatValue' now requires that the attribute is a
proper splat. This allows for querying these methods on DenseElementAttr
with all possible value types; e.g. float, int, APInt, etc. This also
allows for removing unnecessary conversions to Attribute that really
want the underlying value.
PiperOrigin-RevId: 263437337
The file was modifiedmlir/lib/IR/Attributes.cpp
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/Serializer.cpp
The file was modifiedmlir/lib/StandardOps/Ops.cpp
The file was modifiedmlir/include/mlir/IR/Attributes.h
The file was modifiedmlir/test/Transforms/constant-fold.mlir
The file was modifiedmlir/lib/Quantizer/Configurations/FxpMathConfig.cpp
The file was modifiedmlir/examples/toy/Ch5/mlir/LateLowering.cpp
The file was modifiedmlir/lib/Quantizer/Support/Statistics.cpp
Commit 92a7b1080eb055d3af031be2b88b0e487fdc1ff2 by gardener
Add support for Dialect interfaces.
Dialect interfaces are virtual apis registered to a specific dialect
instance. Dialect interfaces are generally useful for transformation
passes, or analyses, that want to opaquely operate on operations within
a given dialect. These interfaces generally involve wide coverage over
the entire dialect.
A dialect interface can be defined by inheriting from the CRTP base
class DialectInterfaceBase::Base. This class provides the necessary
utilities for registering an interface with the dialect so that it can
be looked up later. Dialects overriding an interface may register an
instance via 'Dialect::addInterfaces'. This API works very similarly to
the respective addOperations/addTypes/etc. This will allow for a
transformation/utility to later query the interface from an opaque
dialect instance via 'getInterface<T>'.
A utility class 'DialectInterfaceCollection' is also provided that will
collect all of the dialects that implement a specific interface within a
given module. This allows for simplifying the API of interface lookups.
PiperOrigin-RevId: 263489015
The file was addedmlir/include/mlir/IR/DialectInterface.h
The file was addedmlir/g3doc/Interfaces.md
The file was modifiedmlir/lib/IR/Dialect.cpp
The file was modifiedmlir/include/mlir/IR/Dialect.h
Commit 30e9c2fe4fe93f288307159ba2a3e762c7ab2304 by gardener
ExecutionEngine: fix after upstream LLVM ORC update
LLVM r368707 updated the APIs in
llvm::orc::DynamicLibrarySearchGenerator to use unique_ptr for holding
the instance of the generator.  Update our uses of
DynamicLibrarySearchGenerator in the ExecutionEngine to reflect that.
PiperOrigin-RevId: 263539855
The file was modifiedmlir/lib/ExecutionEngine/ExecutionEngine.cpp
Commit d71915420b39e2adacafe1a81fcdc37b9bf8c5c2 by gardener
Add BuiltIn EnumAttr to SPIR-V dialect
Generate the EnumAttr to represent BuiltIns in SPIR-V dialect. The
builtIn can be specified as a StringAttr with value being the name of
the builtin. Extend Decoration (de)serialization to handle BuiltIns.
Also fix an error in the SPIR-V dialect generator script.
PiperOrigin-RevId: 263596624
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/Serializer.cpp
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVOps.cpp
The file was modifiedmlir/test/Dialect/SPIRV/ops.mlir
The file was modifiedmlir/utils/spirv/gen_spirv_dialect.py
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVOps.td
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/Deserializer.cpp
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVBase.td
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/variables.mlir
Commit cc980aa41651c2cbfcbd9048fb0788f4aa9ae475 by gardener
Simplify the classes that support SPIR-V conversion.
Modify the Type converters to have a SPIRVBasicTypeConverter which only
handles conversion from standard types to SPIRV types. Rename
SPIRVEntryFnConverter to SPIRVTypeConverter. This contains the
SPIRVBasicTypeConverter within it.
Remove SPIRVFnLowering class and have separate utility methods to lower
a function as entry function or a non-entry function. The current setup
could end with diamond inheritence that is not very friendly to use.
For example, you could define the following Op conversion methods that
lower from a dialect "Foo" which resuls in diamond inheritance.
template<typename OpTy> class FooDialect : public SPIRVOpLowering<OpTy>
{...}; class FooFnLowering : public FooDialect, SPIRVFnLowering {...};
PiperOrigin-RevId: 263597101
The file was modifiedmlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.cpp
The file was modifiedmlir/include/mlir/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.h
The file was modifiedmlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp
Commit f826ceef3ce8bfea1b78ab7bb2c60c53eb13729a by gardener
Extend vector.outerproduct with an optional 3rd argument
This CL adds an optional third argument to the vector.outerproduct
instruction. When such a third argument is specified, it is added to the
result of the outerproduct and  is lowered to FMA intrinsic when the
lowering supports it.
In the future, we can add an attribute on the `vector.outerproduct`
instruction to modify the operations for which to emit code (e.g. "+/*",
"max/+", "min/+", "log/exp" ...).
This CL additionally performs minor cleanups in the vector lowering and
adds tests to improve coverage.
This has been independently verified to result in proper fma
instructions for haswell as follows.
Input:
``` func @outerproduct_add(%arg0: vector<17xf32>, %arg1: vector<8xf32>,
%arg2: vector<17x8xf32>) -> vector<17x8xf32> {
%2 = vector.outerproduct %arg0, %arg1, %arg2 : vector<17xf32>,
vector<8xf32>
return %2 : vector<17x8xf32>
}
}
```
Command:
``` mlir-opt vector-to-llvm.mlir -vector-lower-to-llvm-dialect
--disable-pass-threading | mlir-opt -lower-to-cfg -lower-to-llvm |
mlir-translate --mlir-to-llvmir | opt -O3 | llc -O3 -march=x86-64
-mcpu=haswell -mattr=fma,avx2
```
Output:
``` outerproduct_add:                       # @outerproduct_add
# %bb.0:
       ...
       vmovaps 112(%rbp), %ymm8
       vbroadcastss    %xmm0, %ymm0
       ...
       vbroadcastss    64(%rbp), %ymm15
       vfmadd213ps     144(%rbp), %ymm8, %ymm0 # ymm0 = (ymm8 * ymm0) +
mem
       ...
       vfmadd213ps     400(%rbp), %ymm8, %ymm9 # ymm9 = (ymm8 * ymm9) +
mem
       ...
``` PiperOrigin-RevId: 263743359
The file was modifiedmlir/test/Conversion/VectorToLLVM/vector-to-llvm.mlir
The file was modifiedmlir/lib/Conversion/VectorToLLVM/VectorToLLVM.cpp
The file was modifiedmlir/test/Dialect/VectorOps/ops.mlir
The file was modifiedmlir/test/Dialect/VectorOps/invalid.mlir
The file was modifiedmlir/include/mlir/Conversion/VectorToLLVM/VectorToLLVM.h
The file was modifiedmlir/lib/VectorOps/VectorOps.cpp
The file was modifiedmlir/include/mlir/VectorOps/VectorOps.td
Commit c93c938df28250abb6f980ddaf7b444fcabfa59a by gardener
Remove C++11 requirement set in cmakelists
C++14 is now the required.
PiperOrigin-RevId: 263772579
The file was modifiedmlir/CMakeLists.txt
Commit f79fc1c181a01037d3cbdbc272752c15e05b3c78 by gardener
C++14 is now default enabled in LLVM, remove obsolete CMake flag.
PiperOrigin-RevId: 263776602
The file was modifiedmlir/README.md
Commit 9c29273ddc4666dd2dc1df53cc2901a59bad0b03 by gardener
Refactor DialectConversion to convert the signatures of blocks when they
are moved.
Often we want to ensure that block arguments are converted before
operations that use them. This refactors the current implementation to
be cleaner/less frequent by triggering conversion when a set of blocks
are moved/inlined; or when legalization is successful.
PiperOrigin-RevId: 263795005
The file was modifiedmlir/lib/Transforms/DialectConversion.cpp
Commit cf358017e644c1b35fde151adc444ac058771b45 by gardener
[spirv] Extend spv.array with Layoutinfo
Extend spv.array with Layoutinfo to support (de)serialization.
Closes tensorflow/mlir#80
PiperOrigin-RevId: 263795304
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVTypes.h
The file was addedmlir/test/Dialect/SPIRV/Serialization/array_stride.mlir
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVDialect.cpp
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/Deserializer.cpp
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVTypes.cpp
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/Serializer.cpp
The file was modifiedmlir/test/Dialect/SPIRV/types.mlir
Commit 3191f9c5e074de8d9d220ee702d5298870bde032 by gardener
Fix minor typos in the documentation
PiperOrigin-RevId: 263805025
The file was modifiedmlir/g3doc/LangRef.md
The file was modifiedmlir/g3doc/Dialects/Affine.md
Commit 36c373129d2605a81fbb606b36f9e95b31e29a95 by gardener
NFC: Move the Type::is* predicates to StandardTypes.cpp
These methods are currently defined 'inline' in StandardTypes.h, but
this may create linker errors if StandardTypes.h isn't included at the
use site.
PiperOrigin-RevId: 263850328
The file was modifiedmlir/lib/IR/StandardTypes.cpp
The file was modifiedmlir/include/mlir/IR/StandardTypes.h
Commit 4fb971a9c4752f3e0e8407e0728fa57036400b90 by gardener
NFC: Refactor the PassInstrumentation framework to operate on Operation
instead of llvm::Any.
Now that functions and modules are operations, Operation makes more
sense as the opaque object to refer to both.
PiperOrigin-RevId: 263883913
The file was modifiedmlir/lib/Pass/PassTiming.cpp
The file was modifiedmlir/lib/Pass/IRPrinting.cpp
The file was modifiedmlir/g3doc/WritingAPass.md
The file was modifiedmlir/include/mlir/Pass/PassInstrumentation.h
The file was modifiedmlir/lib/Pass/Pass.cpp
Commit c268666f15ee5ad36ed39b0a38ec5bf9d58216d4 by gardener
NFC: Modernize and cleanup standard ops. PiperOrigin-RevId: 263891926
The file was modifiedmlir/lib/StandardOps/Ops.cpp
Commit d745101339f3e56f202311a0243d1ba7ef04f56a by gardener
Add spirv::GlobalVariableOp that allows module level definition of
variables
FuncOps in MLIR use explicit capture. So global variables defined in
module scope need to have a symbol name and this should be used to refer
to the variable within the function. This deviates from SPIR-V spec,
which assigns an SSA value to variables at all scopes that can be used
to refer to the variable, which requires SPIR-V functions to allow
implicit capture. To handle this add a new op, spirv::GlobalVariableOp
that can be used to define module scope variables. Since instructions
need an SSA value, an new spirv::AddressOfOp is added to convert a
symbol reference to an SSA value for use with other instructions. This
also means the spirv::EntryPointOp instruction needs to change to allow
initializers to be specified using symbol reference instead of SSA value
The current spirv::VariableOp which returns an SSA value (as defined by
SPIR-V spec) can still be used to define function-scope variables.
PiperOrigin-RevId: 263951109
The file was modifiedmlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.cpp
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/Deserializer.cpp
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/Serializer.cpp
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/entry_interface.mlir
The file was modifiedmlir/test/Dialect/SPIRV/ops.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/variables.mlir
The file was modifiedmlir/include/mlir/IR/OpBase.td
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/variables_init.mlir
The file was modifiedmlir/test/Conversion/GPUToSPIRV/simple.mlir
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVOps.cpp
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVStructureOps.td
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVOps.td
Commit dbf8538b64a61d0b93420b293b8508b158377757 by gardener
NFC: Add header blocks to improve readability. PiperOrigin-RevId:
263951251
The file was modifiedmlir/lib/IR/Types.cpp
Commit 79f53b0cf1fd204af0a09c8e085dd09a1ce0b6d9 by gardener
Change from llvm::make_unique to std::make_unique
Switch to C++14 standard method as llvm::make_unique has been removed (
https://reviews.llvm.org/D66259). Also mark some targets as c++14 to
ease next integrates.
PiperOrigin-RevId: 263953918
The file was modifiedmlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp
The file was modifiedmlir/lib/Transforms/AffineDataCopyGeneration.cpp
The file was modifiedmlir/g3doc/Tutorials/Toy/Ch-4.md
The file was modifiedmlir/lib/Transforms/LoopCoalescing.cpp
The file was modifiedmlir/lib/Pass/Pass.cpp
The file was modifiedmlir/test/lib/Transforms/TestVectorizationUtils.cpp
The file was modifiedmlir/lib/Transforms/LowerVectorTransfers.cpp
The file was modifiedmlir/include/mlir/IR/Dialect.h
The file was modifiedmlir/lib/Conversion/GPUToCUDA/ConvertKernelFuncToCubin.cpp
The file was modifiedmlir/tools/mlir-cuda-runner/mlir-cuda-runner.cpp
The file was modifiedmlir/examples/toy/Ch5/mlir/EarlyLowering.cpp
The file was modifiedmlir/lib/TableGen/Pattern.cpp
The file was modifiedmlir/lib/Quantizer/Configurations/FxpMathConfig.cpp
The file was modifiedmlir/lib/Transforms/LoopUnrollAndJam.cpp
The file was modifiedmlir/lib/Support/FileUtilities.cpp
The file was modifiedmlir/lib/Dialect/GPU/Transforms/KernelOutlining.cpp
The file was modifiedmlir/examples/toy/Ch1/include/toy/Parser.h
The file was modifiedmlir/lib/Transforms/CSE.cpp
The file was modifiedmlir/lib/Transforms/Utils/Utils.cpp
The file was modifiedmlir/test/lib/Transforms/TestConstantFold.cpp
The file was modifiedmlir/examples/toy/Ch5/mlir/LateLowering.cpp
The file was modifiedmlir/lib/Analysis/Dominance.cpp
The file was modifiedmlir/lib/Linalg/Transforms/LowerToLLVMDialect.cpp
The file was modifiedmlir/examples/toy/Ch4/include/toy/Parser.h
The file was modifiedmlir/lib/Conversion/LoopsToGPU/LoopsToGPUPass.cpp
The file was modifiedmlir/lib/Transforms/SimplifyAffineStructures.cpp
The file was modifiedmlir/include/mlir/Quantizer/Support/ConstraintAnalysisGraph.h
The file was modifiedmlir/lib/Transforms/Vectorize.cpp
The file was modifiedmlir/test/lib/TestDialect/TestPatterns.cpp
The file was modifiedmlir/include/mlir/IR/PatternMatch.h
The file was modifiedmlir/lib/Dialect/QuantOps/Transforms/ConvertSimQuant.cpp
The file was modifiedmlir/test/lib/Transforms/TestLoopMapping.cpp
The file was modifiedmlir/examples/toy/Ch5/include/toy/Parser.h
The file was modifiedmlir/lib/Transforms/PipelineDataTransfer.cpp
The file was modifiedmlir/lib/Analysis/AffineStructures.cpp
The file was modifiedmlir/examples/toy/Ch2/mlir/MLIRGen.cpp
The file was modifiedmlir/examples/toy/Ch3/mlir/MLIRGen.cpp
The file was modifiedmlir/lib/Transforms/LowerAffine.cpp
The file was modifiedmlir/lib/Transforms/MaterializeVectors.cpp
The file was modifiedmlir/lib/Transforms/StripDebugInfo.cpp
The file was modifiedmlir/test/lib/Transforms/TestLoopParametricTiling.cpp
The file was modifiedmlir/examples/toy/Ch4/mlir/ShapeInferencePass.cpp
The file was modifiedmlir/lib/Transforms/LoopInvariantCodeMotion.cpp
The file was modifiedmlir/lib/Analysis/Utils.cpp
The file was modifiedmlir/examples/toy/Ch5/mlir/ShapeInferencePass.cpp
The file was modifiedmlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp
The file was modifiedmlir/lib/Linalg/Transforms/LowerToLoops.cpp
The file was modifiedmlir/examples/Linalg/Linalg3/lib/Transforms.cpp
The file was modifiedmlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVMPass.h
The file was modifiedmlir/lib/Transforms/MemRefDataFlowOpt.cpp
The file was modifiedmlir/lib/Quantizer/Transforms/AddDefaultStatsTestPass.cpp
The file was modifiedmlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRVPass.cpp
The file was modifiedmlir/lib/ExecutionEngine/ExecutionEngine.cpp
The file was modifiedmlir/examples/toy/Ch3/include/toy/Parser.h
The file was modifiedmlir/examples/toy/Ch4/mlir/MLIRGen.cpp
The file was modifiedmlir/lib/Conversion/GPUToCUDA/ConvertLaunchFuncToCudaCalls.cpp
The file was modifiedmlir/include/mlir/Pass/PassRegistry.h
The file was modifiedmlir/lib/Quantizer/Transforms/RemoveInstrumentationPass.cpp
The file was modifiedmlir/lib/Quantizer/Support/ConstraintAnalysisGraph.cpp
The file was modifiedmlir/lib/Quantizer/Transforms/InferQuantizedTypesPass.cpp
The file was modifiedmlir/lib/Linalg/Transforms/Fusion.cpp
The file was modifiedmlir/include/mlir/Pass/AnalysisManager.h
The file was modifiedmlir/lib/Conversion/GPUToCUDA/GenerateCubinAccessors.cpp
The file was modifiedmlir/lib/Transforms/LoopFusion.cpp
The file was modifiedmlir/lib/Dialect/QuantOps/Transforms/ConvertConst.cpp
The file was modifiedmlir/lib/Transforms/Canonicalizer.cpp
The file was modifiedmlir/lib/Transforms/LoopUnroll.cpp
The file was modifiedmlir/include/mlir/Pass/Pass.h
The file was modifiedmlir/examples/toy/Ch2/include/toy/Parser.h
The file was modifiedmlir/examples/toy/Ch5/mlir/MLIRGen.cpp
The file was modifiedmlir/lib/Linalg/Transforms/Tiling.cpp
The file was modifiedmlir/lib/IR/Diagnostics.cpp
The file was modifiedmlir/lib/Transforms/LoopTiling.cpp
The file was modifiedmlir/test/lib/Transforms/TestLoopFusion.cpp
Commit 33a8642f537c409575a53b82f2607d730bdff639 by gardener
InitLLVM already initializes PrettyStackTraceProgram
Remove extra PrettyStackTraceProgram and use InitLLVM consistently.
PiperOrigin-RevId: 264041205
The file was modifiedmlir/tools/mlir-opt/mlir-opt.cpp
The file was modifiedmlir/tools/mlir-tblgen/mlir-tblgen.cpp
The file was modifiedmlir/lib/Support/JitRunner.cpp
The file was modifiedmlir/tools/mlir-translate/mlir-translate.cpp
Commit c9f37fca379035b6334b50380ef05b00026de0cc by gardener
Add alignment support for llvm.alloca
Extend the LLVM dialect AllocaOp with an alignment attribute.
PiperOrigin-RevId: 264068306
The file was modifiedmlir/test/LLVMIR/roundtrip.mlir
The file was modifiedmlir/test/LLVMIR/invalid.mlir
The file was modifiedmlir/lib/LLVMIR/IR/LLVMDialect.cpp
The file was modifiedmlir/include/mlir/LLVMIR/LLVMOps.td
The file was modifiedmlir/test/Target/llvmir.mlir
Commit 9bf69e6a2e9d1ef60ac9e4efa8fda9b6c3560e63 by gardener
Refactor linalg lowering to LLVM
The linalg.view type used to be lowered to a struct containing a data
pointer, offset, sizes/strides information. This was problematic when
passing to external functions due to ABI, struct padding and alignment
issues.
The linalg.view type is now lowered to LLVMIR as a *pointer* to a struct
containing the data pointer, offset and sizes/strides. This simplifies
the interfacing with external library functions and makes it trivial to
add new functions without creating a shim that would go from a value
type struct to a pointer type.
The consequences are that: 1. lowering explicitly uses llvm.alloca in
lieu of llvm.undef and performs the proper llvm.load/llvm.store where
relevant. 2. the shim creation function `getLLVMLibraryCallDefinition`
disappears. 3. views are passed by pointer, scalars are passed by value.
In the future, other structs will be passed by pointer (on a per-need
basis).
PiperOrigin-RevId: 264183671
The file was modifiedmlir/test/Linalg/llvm.mlir
The file was modifiedmlir/include/mlir/LLVMIR/LLVMOps.td
The file was modifiedmlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp
The file was modifiedmlir/test/mlir-cpu-runner/cblas_interface.cpp
The file was modifiedmlir/lib/Conversion/GPUToCUDA/ConvertLaunchFuncToCudaCalls.cpp
The file was modifiedmlir/lib/Linalg/Transforms/LowerToLLVMDialect.cpp
The file was modifiedmlir/include/mlir/Linalg/IR/LinalgBase.td
Commit 64abcd983ddcde4b9f27377fd718d04e88e35ab9 by gardener
[spirv] Add spv.ReturnValue
This CL adds the spv.ReturnValue op and its tests. Also adds a
InFunctionScope trait to make sure that the op stays inside a function.
To be consistent, ModuleOnly trait is changed to InModuleScope.
PiperOrigin-RevId: 264193081
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVBase.td
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVOps.cpp
The file was addedmlir/test/Dialect/SPIRV/Serialization/terminator.mlir
The file was modifiedmlir/test/Dialect/SPIRV/ops.mlir
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVOps.td
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVStructureOps.td
The file was modifiedmlir/test/Dialect/SPIRV/structure-ops.mlir
Commit ba0fa92524ce0aea2385858016bdb08bd941a10d by gardener
NFC: Move LLVMIR, SDBM, and StandardOps to the Dialect/ directory.
PiperOrigin-RevId: 264193915
The file was modifiedmlir/lib/Analysis/AffineAnalysis.cpp
The file was modifiedmlir/examples/toy/Ch5/mlir/EarlyLowering.cpp
The file was addedmlir/include/mlir/Dialect/LLVMIR/LLVMDialect.h
The file was modifiedmlir/lib/Transforms/LoopCoalescing.cpp
The file was modifiedmlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.cpp
The file was removedmlir/include/mlir/LLVMIR/LLVMOpBase.td
The file was modifiedmlir/lib/Transforms/LoopInvariantCodeMotion.cpp
The file was addedmlir/include/mlir/Dialect/SDBM/SDBMDialect.h
The file was addedmlir/lib/Dialect/SDBM/SDBMExprDetail.h
The file was modifiedmlir/test/SDBM/sdbm-api-test.cpp
The file was modifiedmlir/include/mlir/CMakeLists.txt
The file was modifiedmlir/lib/Conversion/GPUToCUDA/ConvertLaunchFuncToCudaCalls.cpp
The file was modifiedmlir/examples/toy/Ch4/mlir/ShapeInferencePass.cpp
The file was addedmlir/lib/Dialect/SDBM/CMakeLists.txt
The file was addedmlir/lib/Dialect/StandardOps/DialectRegistration.cpp
The file was modifiedmlir/test/lib/Transforms/TestConstantFold.cpp
The file was removedmlir/include/mlir/LLVMIR/LLVMDialect.h
The file was modifiedmlir/examples/Linalg/Linalg1/lib/ConvertToLLVMDialect.cpp
The file was modifiedmlir/examples/toy/Ch2/mlir/MLIRGen.cpp
The file was modifiedmlir/lib/Transforms/MemRefDataFlowOpt.cpp
The file was modifiedmlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp
The file was modifiedmlir/examples/toy/Ch5/mlir/ShapeInferencePass.cpp
The file was modifiedmlir/lib/Dialect/QuantOps/Transforms/ConvertConst.cpp
The file was addedmlir/include/mlir/Dialect/StandardOps/Ops.td
The file was addedmlir/lib/Dialect/StandardOps/CMakeLists.txt
The file was modifiedmlir/test/EDSC/builder-api-test.cpp
The file was modifiedmlir/lib/Dialect/GPU/IR/GPUDialect.cpp
The file was addedmlir/lib/Dialect/SDBM/SDBMDialect.cpp
The file was modifiedmlir/lib/Transforms/Utils/Utils.cpp
The file was addedmlir/lib/Dialect/StandardOps/Ops.cpp
The file was removedmlir/lib/StandardOps/DialectRegistration.cpp
The file was removedmlir/lib/SDBM/SDBMExprDetail.h
The file was modifiedmlir/include/mlir/Dialect/CMakeLists.txt
The file was addedmlir/lib/Dialect/LLVMIR/CMakeLists.txt
The file was removedmlir/include/mlir/StandardOps/Ops.h
The file was modifiedmlir/lib/Target/LLVMIR/ConvertToNVVMIR.cpp
The file was modifiedmlir/examples/toy/Ch5/mlir/MLIRGen.cpp
The file was modifiedmlir/lib/Transforms/Vectorize.cpp
The file was removedmlir/lib/LLVMIR/CMakeLists.txt
The file was modifiedmlir/include/mlir/Transforms/Utils.h
The file was modifiedmlir/lib/Analysis/AffineStructures.cpp
The file was modifiedmlir/examples/Linalg/Linalg1/include/linalg1/Common.h
The file was modifiedmlir/lib/Conversion/GPUToCUDA/GenerateCubinAccessors.cpp
The file was modifiedmlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp
The file was modifiedmlir/lib/Transforms/MaterializeVectors.cpp
The file was addedmlir/include/mlir/Dialect/StandardOps/Ops.h
The file was removedmlir/include/mlir/SDBM/SDBM.h
The file was removedmlir/lib/SDBM/SDBM.cpp
The file was modifiedmlir/lib/Dialect/CMakeLists.txt
The file was modifiedmlir/test/lib/Transforms/TestLoopFusion.cpp
The file was removedmlir/include/mlir/StandardOps/CMakeLists.txt
The file was modifiedmlir/lib/Analysis/Utils.cpp
The file was modifiedmlir/lib/Dialect/GPU/Transforms/KernelOutlining.cpp
The file was removedmlir/lib/SDBM/SDBMDialect.cpp
The file was modifiedmlir/tools/mlir-cuda-runner/mlir-cuda-runner.cpp
The file was modifiedmlir/examples/Linalg/Linalg1/lib/Common.cpp
The file was addedmlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
The file was modifiedmlir/lib/Dialect/LoopOps/LoopOps.cpp
The file was addedmlir/include/mlir/Dialect/StandardOps/CMakeLists.txt
The file was addedmlir/lib/Dialect/SDBM/SDBM.cpp
The file was modifiedmlir/lib/Transforms/LoopFusion.cpp
The file was modifiedmlir/lib/Dialect/FxpMathOps/Transforms/LowerUniformRealMath.cpp
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/ConvertFromBinary.cpp
The file was addedmlir/include/mlir/Dialect/LLVMIR/CMakeLists.txt
The file was modifiedmlir/lib/Conversion/VectorToLLVM/VectorToLLVM.cpp
The file was modifiedmlir/lib/Linalg/Utils/Utils.cpp
The file was removedmlir/include/mlir/SDBM/SDBMExpr.h
The file was modifiedmlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp
The file was removedmlir/include/mlir/StandardOps/Ops.td
The file was modifiedmlir/lib/AffineOps/AffineOps.cpp
The file was removedmlir/lib/LLVMIR/IR/LLVMDialect.cpp
The file was removedmlir/lib/StandardOps/Ops.cpp
The file was addedmlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
The file was addedmlir/include/mlir/Dialect/SDBM/SDBM.h
The file was modifiedmlir/lib/Conversion/ControlFlowToCFG/ConvertControlFlowToCFG.cpp
The file was modifiedmlir/lib/Transforms/PipelineDataTransfer.cpp
The file was addedmlir/include/mlir/Dialect/SDBM/SDBMExpr.h
The file was addedmlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp
The file was modifiedmlir/lib/Transforms/Utils/LoopFusionUtils.cpp
The file was modifiedmlir/examples/toy/Ch4/mlir/MLIRGen.cpp
The file was modifiedmlir/lib/Analysis/MemRefBoundCheck.cpp
The file was modifiedmlir/lib/Quantizer/Configurations/FxpMathConfig.cpp
The file was modifiedmlir/examples/Linalg/Linalg3/lib/ConvertToLLVMDialect.cpp
The file was modifiedmlir/examples/toy/Ch3/mlir/MLIRGen.cpp
The file was modifiedmlir/unittests/SDBM/SDBMTest.cpp
The file was removedmlir/include/mlir/LLVMIR/CMakeLists.txt
The file was modifiedmlir/lib/Analysis/VectorAnalysis.cpp
The file was modifiedmlir/lib/Linalg/Transforms/LowerToLLVMDialect.cpp
The file was modifiedmlir/lib/EDSC/Helpers.cpp
The file was modifiedmlir/lib/Transforms/LowerAffine.cpp
The file was modifiedmlir/lib/Transforms/AffineDataCopyGeneration.cpp
The file was removedmlir/lib/SDBM/CMakeLists.txt
The file was modifiedmlir/lib/Transforms/LowerVectorTransfers.cpp
The file was removedmlir/lib/LLVMIR/IR/NVVMDialect.cpp
The file was modifiedmlir/lib/Support/JitRunner.cpp
The file was modifiedmlir/include/mlir/EDSC/Builders.h
The file was modifiedmlir/examples/toy/Ch5/mlir/LateLowering.cpp
The file was removedmlir/include/mlir/LLVMIR/NVVMOps.td
The file was removedmlir/include/mlir/LLVMIR/NVVMDialect.h
The file was addedmlir/lib/Dialect/SDBM/SDBMExpr.cpp
The file was modifiedmlir/lib/Analysis/NestedMatcher.cpp
The file was removedmlir/lib/StandardOps/CMakeLists.txt
The file was modifiedmlir/lib/Linalg/Transforms/LowerToLoops.cpp
The file was modifiedmlir/lib/Conversion/LoopsToGPU/LoopsToGPU.cpp
The file was addedmlir/include/mlir/Dialect/LLVMIR/LLVMOpBase.td
The file was modifiedmlir/lib/Analysis/LoopAnalysis.cpp
The file was modifiedmlir/lib/Transforms/Utils/FoldUtils.cpp
The file was addedmlir/include/mlir/Dialect/LLVMIR/NVVMOps.td
The file was modifiedmlir/lib/Analysis/TestMemRefDependenceCheck.cpp
The file was modifiedmlir/lib/EDSC/Builders.cpp
The file was modifiedmlir/lib/CMakeLists.txt
The file was removedmlir/include/mlir/SDBM/SDBMDialect.h
The file was modifiedmlir/lib/Transforms/Utils/LoopUtils.cpp
The file was modifiedmlir/lib/Target/LLVMIR/ModuleTranslation.cpp
The file was modifiedmlir/examples/Linalg/Linalg1/include/linalg1/LLVMIntrinsics.h
The file was removedmlir/include/mlir/LLVMIR/LLVMOps.td
The file was addedmlir/include/mlir/Dialect/LLVMIR/NVVMDialect.h
The file was removedmlir/lib/SDBM/SDBMExpr.cpp
The file was modifiedmlir/lib/Conversion/StandardToSPIRV/StandardToSPIRV.td
Commit 377bfb3a142a83a8ecee5de5a6b5d571881fc2b6 by gardener
Fix parsing/printing of spv.globalVariable and  spv._address_of
Change the prining/parsing of spv.globalVariable to print the type of
the variable after the ':' to be consistent with MLIR convention. The
spv._address_of should print the variable type after the ':'. It was
mistakenly printing the address of the return value. Add a (missing)
test that should have caught that. Also move spv.globalVariable and
spv._address_of tests to structure-ops.mlir.
PiperOrigin-RevId: 264204686
The file was modifiedmlir/test/Dialect/SPIRV/structure-ops.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/variables.mlir
The file was modifiedmlir/test/Dialect/SPIRV/ops.mlir
The file was modifiedmlir/test/Conversion/GPUToSPIRV/simple.mlir
The file was addedmlir/test/Dialect/SPIRV/Serialization/variable_reference.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/variables_init.mlir
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVOps.cpp
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/entry_interface.mlir
Commit e152f0194fdaff632a5a9737d4ea057218871782 by gardener
NFC: Don't assume that all operation traits are within the 'OpTrait::'
namespace.
This places an unnecessary restriction that all traits are within this
namespace.
PiperOrigin-RevId: 264212000
The file was modifiedmlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
The file was modifiedmlir/tools/mlir-tblgen/RewriterGen.cpp
The file was modifiedmlir/include/mlir/IR/OpBase.td
Commit 8165f181d9a1ff503919d3625f6a48955a226b3c by gardener
Add support for Operation interfaces.
Operation interfaces, as the name suggests, are those registered at the
Operation level. These interfaces provide an opaque view into derived
operations, by providing a virtual interface that must be implemented.
As an example, the Linalg dialect implements an interface LinalgOp that
provides general queries about some of the dialects library operations.
These queries may provide things like: the number of parallel loops, the
number of inputs and outputs, etc.
Operation interfaces are defined by overriding the CRTP base class
OpInterface. This class takes as a template parameter, a `Traits` class
that defines a Concept and a Model class. These classes provide an
implementation of concept-based polymorphism, where the Concept defines
a set of virtual methods that are overridden by the Model that is
templated on the concrete operation type. It is important to note that
these classes should be pure in that they contain no non-static data
members.
PiperOrigin-RevId: 264218741
The file was modifiedmlir/include/mlir/Linalg/IR/LinalgLibraryOps.td
The file was modifiedmlir/g3doc/Interfaces.md
The file was modifiedmlir/include/mlir/IR/OperationSupport.h
The file was modifiedmlir/include/mlir/IR/OpDefinition.h
The file was modifiedmlir/include/mlir/IR/OpBase.td
The file was modifiedmlir/include/mlir/Linalg/IR/LinalgOps.h
Commit 36f48063ddb9eb43399d604f11653fc4c63894c9 by gardener
Add alignment support to linalg.buffer_alloc
This CL adds an integer attribute to linalg.buffer_alloc and lowering to
LLVM. The alignment is constrained to be a positive power of 2.
Lowering to LLVM produces the pattern:
```
%[[alloc:.*]] = llvm.call @malloc(%[[s]]) : (!llvm.i64) -> !llvm<"i8*">
%[[cast:.*]] = llvm.bitcast %[[alloc]] : !llvm<"i8*"> to !llvm.i64
%[[rem:.*]] = llvm.urem %[[cast]], %[[c16]] : !llvm.i64
%[[drem:.*]] = llvm.sub %[[c16]], %[[rem]] : !llvm.i64
%[[off:.*]] = llvm.urem %[[drem]], %[[c16]] : !llvm.i64
llvm.getelementptr %{{.*}}[%[[off]]] : (!llvm<"i8*">, !llvm.i64) ->
!llvm<"i8*">
```
where `ptr` is aligned on `align` by computing the address
`ptr + (align - ptr % align) % align`.
To allow dealloc op to still be able to free memory, additional
information is needed in the buffer type. The buffer type is thus
extended with an extra i8* for the base allocation address.
PiperOrigin-RevId: 264244455
The file was modifiedmlir/include/mlir/Linalg/IR/LinalgOps.td
The file was modifiedmlir/test/Linalg/roundtrip.mlir
The file was modifiedmlir/test/Linalg/invalid.mlir
The file was modifiedmlir/lib/Linalg/IR/LinalgOps.cpp
The file was modifiedmlir/test/Linalg/llvm.mlir
The file was modifiedmlir/test/mlir-cpu-runner/linalg_integration_test.mlir
The file was modifiedmlir/lib/Linalg/Transforms/LowerToLLVMDialect.cpp
Commit 305516fcd386d0d3e186cd78e23cabfcb9ebe1bb by gardener
Allow isolated regions to form isolated SSA name scopes in the printer.
This will allow for naming values the same as existing SSA values for
regions attached to operations that are isolated from above. This fits
in with how the system already allows separate name scopes for sibling
regions. This name shadowing can be enabled in the custom parser of
operations by setting the 'enableNameShadowing' flag to true when
calling 'parseRegion'.
%arg = constant 10 : i32 foo.op {
%arg = constant 10 : i32
}
PiperOrigin-RevId: 264255999
The file was modifiedmlir/test/IR/parser.mlir
The file was modifiedmlir/test/lib/TestDialect/TestOps.td
The file was modifiedmlir/test/Transforms/test-legalizer.mlir
The file was modifiedmlir/test/IR/invalid.mlir
The file was modifiedmlir/test/IR/invalid-ops.mlir
The file was modifiedmlir/lib/Parser/Parser.cpp
The file was modifiedmlir/test/lib/TestDialect/TestDialect.cpp
The file was modifiedmlir/include/mlir/IR/OpImplementation.h
The file was modifiedmlir/include/mlir/IR/OpBase.td
Commit 2277b9fb5c235dccfbfb803fd81f3ffe3c09872a by gardener
Add DictionaryAttr to OpBase.td
PiperOrigin-RevId: 264262369
The file was modifiedmlir/include/mlir/IR/OpBase.td
Commit 774b37b89b88e063aa4df47bd2637cf51283740c by gardener
Add a DialectConversion document detailing the conversion
infrastructure.
This is an important piece of the infrastructure that is missing proper
high level documentation on usage.
PiperOrigin-RevId: 264275482
The file was modifiedmlir/include/mlir/Transforms/DialectConversion.h
The file was addedmlir/g3doc/DialectConversion.md
Commit b628194013088e7b04f25d776908b4dd96ea7bbd by gardener
Move Linalg and VectorOps dialects to the Dialect subdir - NFC
PiperOrigin-RevId: 264277760
The file was removedmlir/include/mlir/VectorOps/CMakeLists.txt
The file was addedmlir/include/mlir/Dialect/Linalg/CMakeLists.txt
The file was removedmlir/lib/Linalg/Analysis/DependenceAnalysis.cpp
The file was modifiedmlir/lib/EDSC/Intrinsics.cpp
The file was addedmlir/include/mlir/Dialect/VectorOps/VectorOps.td
The file was addedmlir/lib/Dialect/Linalg/IR/LinalgTypes.cpp
The file was removedmlir/lib/Linalg/LinalgRegistration.cpp
The file was removedmlir/include/mlir/Linalg/CMakeLists.txt
The file was addedmlir/include/mlir/Dialect/Linalg/IR/LinalgTraits.h
The file was modifiedmlir/include/mlir/CMakeLists.txt
The file was addedmlir/include/mlir/Dialect/Linalg/IR/LinalgOps.h
The file was removedmlir/include/mlir/Linalg/IR/LinalgBase.td
The file was removedmlir/lib/VectorOps/DialectRegistration.cpp
The file was removedmlir/lib/Linalg/IR/LinalgOps.cpp
The file was modifiedmlir/lib/Transforms/Vectorize.cpp
The file was removedmlir/include/mlir/Linalg/IR/LinalgOps.h
The file was modifiedmlir/lib/Analysis/VectorAnalysis.cpp
The file was addedmlir/include/mlir/Dialect/Linalg/Utils/Utils.h
The file was modifiedmlir/lib/CMakeLists.txt
The file was addedmlir/include/mlir/Dialect/Linalg/IR/LinalgLibraryOps.td
The file was addedmlir/include/mlir/Dialect/Linalg/Analysis/DependenceAnalysis.h
The file was addedmlir/lib/Dialect/Linalg/Transforms/Tiling.cpp
The file was modifiedmlir/lib/Analysis/LoopAnalysis.cpp
The file was removedmlir/lib/Linalg/IR/LinalgTypes.cpp
The file was modifiedmlir/lib/Transforms/MaterializeVectors.cpp
The file was addedmlir/include/mlir/Dialect/Linalg/IR/LinalgBase.td
The file was addedmlir/include/mlir/Dialect/VectorOps/CMakeLists.txt
The file was addedmlir/lib/Dialect/Linalg/Transforms/LowerToLLVMDialect.cpp
The file was modifiedmlir/lib/Conversion/VectorToLLVM/VectorToLLVM.cpp
The file was removedmlir/include/mlir/VectorOps/VectorOps.h
The file was addedmlir/lib/Dialect/VectorOps/DialectRegistration.cpp
The file was addedmlir/include/mlir/Dialect/Linalg/IR/CMakeLists.txt
The file was removedmlir/include/mlir/Linalg/IR/LinalgOps.td
The file was modifiedmlir/include/mlir/Dialect/CMakeLists.txt
The file was addedmlir/include/mlir/Dialect/Linalg/IR/LinalgTypes.h
The file was addedmlir/include/mlir/Dialect/VectorOps/VectorOps.h
The file was addedmlir/lib/Dialect/Linalg/Utils/Utils.cpp
The file was removedmlir/lib/VectorOps/VectorOps.cpp
The file was removedmlir/lib/Linalg/Transforms/Fusion.cpp
The file was removedmlir/include/mlir/Linalg/IR/LinalgTraits.h
The file was addedmlir/include/mlir/Dialect/Linalg/Utils/Intrinsics.h
The file was removedmlir/include/mlir/Linalg/IR/CMakeLists.txt
The file was removedmlir/include/mlir/Linalg/Utils/Utils.h
The file was removedmlir/lib/Linalg/Transforms/Tiling.cpp
The file was addedmlir/include/mlir/Dialect/Linalg/Passes.h
The file was modifiedmlir/test/lit.site.cfg.py.in
The file was addedmlir/lib/Dialect/Linalg/Transforms/Fusion.cpp
The file was removedmlir/include/mlir/Linalg/Passes.h
The file was addedmlir/lib/Dialect/Linalg/Analysis/DependenceAnalysis.cpp
The file was addedmlir/lib/Dialect/Linalg/LinalgRegistration.cpp
The file was removedmlir/include/mlir/Linalg/Utils/Intrinsics.h
The file was removedmlir/include/mlir/Linalg/Analysis/DependenceAnalysis.h
The file was addedmlir/lib/Dialect/VectorOps/VectorOps.cpp
The file was addedmlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td
The file was addedmlir/lib/Dialect/Linalg/Transforms/LowerToLoops.cpp
The file was removedmlir/include/mlir/Linalg/IR/LinalgTypes.h
The file was removedmlir/include/mlir/VectorOps/VectorOps.td
The file was removedmlir/lib/Linalg/Transforms/LowerToLoops.cpp
The file was removedmlir/lib/Linalg/Utils/Utils.cpp
The file was modifiedmlir/lib/Transforms/LowerVectorTransfers.cpp
The file was removedmlir/lib/VectorOps/CMakeLists.txt
The file was addedmlir/lib/Dialect/VectorOps/CMakeLists.txt
The file was addedmlir/lib/Dialect/Linalg/CMakeLists.txt
The file was modifiedmlir/test/CMakeLists.txt
The file was modifiedmlir/include/mlir/EDSC/Builders.h
The file was removedmlir/include/mlir/Linalg/IR/LinalgLibraryOps.td
The file was modifiedmlir/lib/Dialect/CMakeLists.txt
The file was removedmlir/lib/Linalg/CMakeLists.txt
The file was addedmlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
The file was removedmlir/lib/Linalg/Transforms/LowerToLLVMDialect.cpp
Commit 92c485a3b82c1fd389e4ce27fd3f4d315b1d08b4 by gardener
Fix minor typos and add missing syntax in the documentation.
PiperOrigin-RevId: 264281501
The file was modifiedmlir/g3doc/LangRef.md
Commit 07ecb011a759ce8641c90caee239aadcaa39e7a9 by gardener
Fix AffineExpr::simplifyAdd bug
- fix missing check while simplifying an expression with floordiv to a
mod
- fixes issue tensorflow/mlir#82
Signed-off-by: Uday Bondhugula <uday@polymagelabs.com>
Closes tensorflow/mlir#84
PiperOrigin-RevId: 264338353
The file was modifiedmlir/lib/IR/AffineExpr.cpp
The file was modifiedmlir/test/IR/affine-map.mlir
Commit f55ac5c07643efa28a5bb621b08c0e5dc2f97f84 by gardener
Add support for LLVM lowering of binary ops on n-D vector types
This CL allows binary operations on n-D vector types to be lowered to
LLVMIR by performing an (n-1)-D extractvalue, 1-D vector operation and
an (n-1)-D insertvalue.
PiperOrigin-RevId: 264339118
The file was modifiedmlir/test/LLVMIR/convert-to-llvmir.mlir
The file was modifiedmlir/lib/IR/Builders.cpp
The file was modifiedmlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
The file was modifiedmlir/include/mlir/IR/Builders.h
The file was modifiedmlir/include/mlir/Dialect/LLVMIR/LLVMDialect.h
The file was modifiedmlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp
Commit 0f974817b5a1103ce5a17450dca7f09a16a4bd13 by gardener
LLVM dialect: prefix operations that correspond to intrinsics with
"intr."
LLVM intrinsics have an open name space and their names can potentially
overlap with names of LLVM instructions (LLVM intrinsics are functions,
not instructions).  In MLIR, LLVM intrinsics are modeled as operations,
so it needs to make sure their names cannot clash with the instructions.
Use the "intr." prefix for intrinsics in the LLVM dialect.
PiperOrigin-RevId: 264372173
The file was modifiedmlir/test/Target/llvmir-intrinsics.mlir
The file was modifiedmlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
The file was modifiedmlir/include/mlir/Dialect/VectorOps/VectorOps.td
The file was modifiedmlir/test/Conversion/VectorToLLVM/vector-to-llvm.mlir
Commit 0d82a292b0ddcee9737ac2a1234bedd3b149b7f1 by gardener
JitRunner: support entry functions returning void
JitRunner can use as entry points functions that produce either a single
'!llvm.f32' value or a list of memrefs.  Memref support is legacy and
was introduced before MLIR could lower memref allocation and
deallocation to malloc/free calls so as to allocate the memory
externally, and is likely to be dropped in the future since it
unconditionally runs affine+standard-to-llvm lowering on the module
instead of accepting the LLVM dialect.  CUDA runner relies on
memref-based flow in the runner without actually returning anything.
Introduce a runner flow to use functions that return void as entry
points.
PiperOrigin-RevId: 264381686
The file was modifiedmlir/lib/Support/JitRunner.cpp
The file was modifiedmlir/test/mlir-cuda-runner/gpu-to-cubin.mlir
Commit 006fcce44a2560c9a12e82c99a494971e5b1d7be by gardener
ConvertLaunchFuncToCudaCalls: use LLVM dialect globals
This conversion has been using a stack-allocated array of i8 to store
the null-terminated kernel name in order to pass it to the CUDA wrappers
expecting a C string because the LLVM dialect was missing support for
globals.  Now that the suport is introduced, use a global instead.
Refactor global string construction from GenerateCubinAccessors into a
common utility function living in the LLVM namespace.
PiperOrigin-RevId: 264382489
The file was modifiedmlir/lib/Conversion/GPUToCUDA/GenerateCubinAccessors.cpp
The file was modifiedmlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
The file was modifiedmlir/include/mlir/Conversion/GPUToCUDA/GPUToCUDAPass.h
The file was modifiedmlir/include/mlir/Dialect/LLVMIR/LLVMDialect.h
The file was modifiedmlir/lib/Conversion/GPUToCUDA/ConvertLaunchFuncToCudaCalls.cpp
The file was modifiedmlir/test/Conversion/GPUToCUDA/lower-launch-func-to-cuda.mlir
Commit 5c7fd5ff32591ed3dee15257238002e676563069 by gardener
Update Ch-2.md -- 406f1e8211f8f5017f44f46af750dec061e707a2 by Zhang
<5205699+Naville@users.noreply.github.com>:
Update Ch-2.md
Closes tensorflow/mlir#93
PiperOrigin-RevId: 264392995
The file was modifiedmlir/g3doc/Tutorials/Toy/Ch-2.md
Commit 3d32ca97767c28b508711b382c91153c64b2a807 by gardener
Update MLIR code examples in Passes.md doc to use new affine.load/store
dma_start/wait operations.
PiperOrigin-RevId: 264415037
The file was modifiedmlir/g3doc/Passes.md
Commit 9e6cf0d0258aa79b759db9c68a447071ab6ee4ab by gardener
Fix build of affine load/store with empty map
tensorflow/mlir#58 fixed and exercised verification of load/store ops
using empty affine maps. Unfortunately, it didn't exercise the creation
of them. This PR addresses that aspect. It removes the assumption of
AffineMap having at least one result and stores a pointer to MLIRContext
as member of AffineMap.
* Add empty map support to affine.store + test
* Move MLIRContext to AffineMapStorage
Closes tensorflow/mlir#74
PiperOrigin-RevId: 264416260
The file was modifiedmlir/lib/IR/AsmPrinter.cpp
The file was modifiedmlir/lib/IR/MLIRContext.cpp
The file was modifiedmlir/lib/AffineOps/AffineOps.cpp
The file was modifiedmlir/lib/IR/AffineMapDetail.h
The file was modifiedmlir/lib/IR/Attributes.cpp
The file was modifiedmlir/lib/IR/AffineMap.cpp
The file was modifiedmlir/test/EDSC/builder-api-test.cpp
The file was modifiedmlir/include/mlir/IR/AffineMap.h
Commit 82cf6051ee7157a2883210baab191345cbd075bc by gardener
[spirv] Support (de)serialization of spv.struct
Support (de)serialization of spv.struct with offset decorations.
Closes tensorflow/mlir#94
PiperOrigin-RevId: 264421427
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/Deserializer.cpp
The file was addedmlir/test/Dialect/SPIRV/Serialization/struct.mlir
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVBase.td
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/Serializer.cpp
Commit f4934bcc3e38812051f37a1aadbc4d20913ebadc by gardener
Add spv.specConstant and spv._reference_of
Similar to global variables, specialization constants also live in the
module scope and can be referenced by instructions in functions in
native SPIR-V. A direct modelling would be to allow functions in the
SPIR-V dialect to implicit capture, but it means we are losing the
ability to write passes for Functions. While in SPIR-V normally we want
to process the module as a whole, it's not common to see multiple
functions get used so we'd like to leave the door open for those cases.
Therefore, similar to global variables, we introduce spv.specConstant to
model three SPIR-V instructions: OpSpecConstantTrue,
OpSpecConstantFalse, and OpSpecConstant. They do not return SSA value
results; instead they have symbols and can only be referenced by the
symbols. To use it in a function, we need to have another op
spv._reference_of to turn the symbol into an SSA value. This breaks the
tie and makes functions still explicit capture. Previously
specialization constants were handled similarly as normal constants.
That is incorrect given that specialization constant actually acts more
like variable (without need to load and store). E.g., they cannot be
de-duplicated like normal constants.
This CL also refines various documents and comments.
PiperOrigin-RevId: 264455172
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVStructureOps.td
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/spec_constant.mlir
The file was modifiedmlir/test/Dialect/SPIRV/structure-ops.mlir
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/Deserializer.cpp
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/Serializer.cpp
The file was modifiedmlir/test/Dialect/SPIRV/ops.mlir
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVOps.cpp
Commit ffde975e215e8ccba2b96a05f66a5756bebc8b64 by gardener
NFC: Move AffineOps dialect to the Dialect sub-directory.
PiperOrigin-RevId: 264482571
The file was addedmlir/include/mlir/Dialect/AffineOps/AffineOpsBase.td
The file was modifiedmlir/lib/Analysis/MemRefBoundCheck.cpp
The file was modifiedmlir/lib/Transforms/LoopFusion.cpp
The file was modifiedmlir/lib/Conversion/LoopsToGPU/LoopsToGPUPass.cpp
The file was modifiedmlir/lib/Transforms/LowerAffine.cpp
The file was modifiedmlir/lib/Transforms/Utils/LoopUtils.cpp
The file was addedmlir/lib/Dialect/AffineOps/CMakeLists.txt
The file was modifiedmlir/test/lib/Transforms/TestVectorizationUtils.cpp
The file was modifiedmlir/lib/Analysis/AffineStructures.cpp
The file was modifiedmlir/include/mlir/CMakeLists.txt
The file was modifiedmlir/lib/Analysis/TestParallelismDetection.cpp
The file was modifiedmlir/lib/Analysis/VectorAnalysis.cpp
The file was modifiedmlir/lib/Dialect/CMakeLists.txt
The file was modifiedmlir/lib/Analysis/LoopAnalysis.cpp
The file was removedmlir/lib/AffineOps/CMakeLists.txt
The file was modifiedmlir/lib/Analysis/Utils.cpp
The file was addedmlir/lib/Dialect/AffineOps/AffineOps.cpp
The file was modifiedmlir/lib/Transforms/LoopUnrollAndJam.cpp
The file was modifiedmlir/lib/Transforms/LoopInvariantCodeMotion.cpp
The file was removedmlir/include/mlir/AffineOps/AffineOps.td
The file was modifiedmlir/lib/Analysis/AffineAnalysis.cpp
The file was modifiedmlir/lib/Conversion/LoopsToGPU/LoopsToGPU.cpp
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/LowerToLoops.cpp
The file was modifiedmlir/examples/Linalg/Linalg1/include/linalg1/Common.h
The file was addedmlir/include/mlir/Dialect/AffineOps/AffineOps.h
The file was removedmlir/include/mlir/AffineOps/AffineOpsBase.td
The file was modifiedmlir/lib/Transforms/MaterializeVectors.cpp
The file was modifiedmlir/lib/Transforms/Vectorize.cpp
The file was removedmlir/lib/AffineOps/AffineOps.cpp
The file was modifiedmlir/include/mlir/Dialect/CMakeLists.txt
The file was modifiedmlir/lib/Analysis/SliceAnalysis.cpp
The file was modifiedmlir/lib/Transforms/LoopUnroll.cpp
The file was addedmlir/include/mlir/Dialect/AffineOps/AffineOps.td
The file was addedmlir/include/mlir/Dialect/AffineOps/CMakeLists.txt
The file was removedmlir/include/mlir/AffineOps/CMakeLists.txt
The file was addedmlir/lib/Dialect/AffineOps/DialectRegistration.cpp
The file was modifiedmlir/test/lib/Transforms/TestConstantFold.cpp
The file was modifiedmlir/lib/Transforms/Utils/LoopFusionUtils.cpp
The file was modifiedmlir/lib/Analysis/NestedMatcher.cpp
The file was modifiedmlir/lib/Transforms/Utils/Utils.cpp
The file was modifiedmlir/lib/Transforms/MemRefDataFlowOpt.cpp
The file was modifiedmlir/examples/Linalg/Linalg4/lib/Transforms.cpp
The file was modifiedmlir/lib/CMakeLists.txt
The file was modifiedmlir/lib/Analysis/TestMemRefDependenceCheck.cpp
The file was modifiedmlir/test/EDSC/builder-api-test.cpp
The file was modifiedmlir/include/mlir/EDSC/Builders.h
The file was removedmlir/lib/AffineOps/DialectRegistration.cpp
The file was modifiedmlir/include/mlir/Dialect/Linalg/IR/LinalgLibraryOps.td
The file was removedmlir/include/mlir/AffineOps/AffineOps.h
The file was modifiedmlir/lib/Transforms/AffineDataCopyGeneration.cpp
The file was modifiedmlir/lib/Transforms/PipelineDataTransfer.cpp
The file was modifiedmlir/lib/Transforms/LoopTiling.cpp
The file was modifiedmlir/test/lib/Transforms/TestLoopFusion.cpp
Commit 35102ea2c3a98ee0707caea75711da77ac2b026b by gardener
NFC: Move the LangRef documentation on StandardOps to a new document.
The LangRef should contain documentation about the core system, and
standard ops is a dialect just like any other. This will also simplify
the transition when StandardOps is eventually split apart.
PiperOrigin-RevId: 264514988
The file was modifiedmlir/g3doc/Dialects/Affine.md
The file was modifiedmlir/g3doc/LangRef.md
The file was addedmlir/g3doc/Dialects/Standard.md
Commit 5e17730cdeed88551806e2587c65bb3690c7d06b by gardener
NFC: Use a DenseSet instead of a DenseMap for
DialectInterfaceCollection.
The interfaces are looked up by dialect, which can always be retrieved
from an interface instance.
PiperOrigin-RevId: 264516023
The file was modifiedmlir/include/mlir/IR/DialectInterface.h
The file was modifiedmlir/lib/IR/Dialect.cpp
Commit ad8b410f161d9bdf830771683a010cd97553676d by gardener
NFC: Keep the dialect list in the context sorted by namespace.
Most dialects are initialized statically, which does not have a
guaranteed initialization order. By keeping the dialect list sorted, we
can guarantee a deterministic iteration order of dialects.
PiperOrigin-RevId: 264522875
The file was modifiedmlir/lib/IR/MLIRContext.cpp
Commit 69cf811d5b73c78144dad6234ad94c7c90bed370 by gardener
Materialize spv.constants at use sites
In SPIR-V binary format, constants are placed at the module level and
referenced by instructions inside functions using their result
<id>s. To model this natively (using SSA values for result <id>s), it
means we need to have implicit capturing functions. We will lose the
ability to have function passes if going down that path.
Instead, this CL changes to materialize constants at their use sites in
deserialization. It's cheap to copy constants in MLIR given that
attributes is uniqued to MLIRContext. By localizing constants into
functions, we can preserve isolated functions.
PiperOrigin-RevId: 264582532
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/Deserializer.cpp
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/constant.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/variable_reference.mlir
Commit 31cfee60773c6277f652aab5fa1f8f824a551627 by gardener
Support variadic ops in declarative rewrite rules
This CL extends declarative rewrite rules to support matching and
generating ops with variadic operands/results. For this, the generated
`matchAndRewrite()` method for each pattern now are changed to
* Use "range" types for the local variables used to store captured
values (`operand_range` for operands, `ArrayRef<Value *>` for
values, *Op for results). This allows us to have a unified way
of handling both single values and value ranges.
* Create local variables for each operand for op creation. If the
operand is variadic, then a `SmallVector<Value*>` will be created
to collect all values for that operand; otherwise a `Value*` will
be created.
* Use a collective result type builder. All result types are
specified via a single parameter to the builder.
We can use one result pattern to replace multiple results of the matched
root op. When that happens, it will require specifying types for
multiple results. Add a new collective-type builder.
PiperOrigin-RevId: 264588559
The file was modifiedmlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
The file was modifiedmlir/test/lib/TestDialect/TestOps.td
The file was modifiedmlir/include/mlir/TableGen/Pattern.h
The file was modifiedmlir/lib/TableGen/Pattern.cpp
The file was modifiedmlir/test/mlir-tblgen/pattern.mlir
The file was modifiedmlir/tools/mlir-tblgen/RewriterGen.cpp
Commit 8d18fdf2d3dcd626ee326978ce6fdc948213fb4d by gardener
[spirv] Support i1 as bool type
PiperOrigin-RevId: 264612014
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVDialect.cpp
The file was modifiedmlir/test/Dialect/SPIRV/types.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/constant.mlir
Commit 7e1af594d2d3769d160659709a03b3a9bb22a6fa by gardener
Move the parser extensions for aliases currently on Dialect to a new
OpAsmDialectInterface.
This will allow for adding more hooks for controlling parser behavior
without bloating Dialect in the common case. This cl also adds iteration
support to the DialectInterfaceCollection.
PiperOrigin-RevId: 264627846
The file was modifiedmlir/include/mlir/IR/DialectInterface.h
The file was modifiedmlir/lib/IR/AsmPrinter.cpp
The file was modifiedmlir/include/mlir/IR/Dialect.h
The file was modifiedmlir/lib/IR/Dialect.cpp
The file was modifiedmlir/include/mlir/IR/OpImplementation.h
Commit b9dc2e481818315f2f0d87455349f497f6118a4c by gardener
Add iterator support to ElementsAttr and SparseElementsAttr.
This will allow iterating the values of a non-opaque ElementsAttr, with
all of the types currently supported by DenseElementsAttr. This should
help reduce the amount of specialization on DenseElementsAttr.
PiperOrigin-RevId: 264637293
The file was modifiedmlir/test/Target/llvmir.mlir
The file was modifiedmlir/lib/Target/LLVMIR/ModuleTranslation.cpp
The file was modifiedmlir/include/mlir/IR/Attributes.h
The file was modifiedmlir/lib/IR/Attributes.cpp
Commit 2e59b86541f61bbd7573c136b46b09599460876d by gardener
NFC: Make the ModuleState field in the ModulePrinter optional.
The ModuleState is only used for printing aliases, which is only done
when printing the top-level module.
PiperOrigin-RevId: 264664138
The file was modifiedmlir/lib/IR/AsmPrinter.cpp
Commit b6182213504412292de137f3dd1feee8b96ad511 by gardener
Automated rollback of commit b9dc2e481818315f2f0d87455349f497f6118a4c
PiperOrigin-RevId: 264672975
The file was modifiedmlir/lib/Target/LLVMIR/ModuleTranslation.cpp
The file was modifiedmlir/lib/IR/Attributes.cpp
The file was modifiedmlir/include/mlir/IR/Attributes.h
The file was modifiedmlir/test/Target/llvmir.mlir
Commit d661eda8114614bad69bb9901e30df941c6de061 by gardener
[TableGen] Add a `StaticShapeMemRefOf` trait.
The trait specifies that the `MemRefOf` has to have a static shape.
PiperOrigin-RevId: 264692758
The file was modifiedmlir/test/mlir-tblgen/types.mlir
The file was modifiedmlir/test/lib/TestDialect/TestOps.td
The file was modifiedmlir/include/mlir/IR/OpBase.td
Commit c400c9a1ec8659fadc04326da3d3f586e29d4c5d by gardener
Add a hook to the OpAsmDialectInterface to allow providing a special
name for the operation result.
This generalizes the current special handling for constant
operations(they get named 'cst'/'true'/'false'/etc.)
PiperOrigin-RevId: 264723379
The file was modifiedmlir/include/mlir/IR/OpImplementation.h
The file was modifiedmlir/lib/IR/AsmPrinter.cpp
The file was modifiedmlir/lib/Dialect/StandardOps/Ops.cpp
Commit 8869de5fbc5ea25899c379291270f9fe0305bca8 by gardener
NFC: Update in-code documentation for function-type. PiperOrigin-RevId:
264723462
The file was modifiedmlir/lib/Parser/Parser.cpp
Commit 35ad095305b9c13fb4db9b9c4ec5d1dc8748bce7 by gardener
Fix minor typos in TestingGuide and OpDefinitions.
PiperOrigin-RevId: 264733092
The file was modifiedmlir/g3doc/TestingGuide.md
The file was modifiedmlir/g3doc/OpDefinitions.md
Commit cc0d337620ceeee7db346024050334d622cfc2c2 by gardener
NFC: Update in-code documentation for type. PiperOrigin-RevId: 264734014
The file was modifiedmlir/lib/Parser/Parser.cpp
Commit 748edce6b831a453831bf8d8688fdbae68d44e14 by gardener
Remove the wrapping function in SPIR-V (de)serialization
Previously Module and Function are builtinn constructs in MLIR. Due to
the structural requirements we must wrap the SPIR-V module inside a
Function inside a Module. Now the requirement is lifted and we can
remove the wrapping function! :)
PiperOrigin-RevId: 264736051
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/struct.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/access_chain.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/variables_init.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/spec_constant.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/entry.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/constant.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/variables.mlir
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/ConvertToBinary.cpp
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/ConvertFromBinary.cpp
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/execution_mode.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/bin_ops.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/variable_reference.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/load_store.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/terminator.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/array_stride.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/entry_interface.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/minimal-module.mlir
Commit fe3594f745f70244c0c32b8b3287799ff2cdcbc7 by gardener
Reduce reliance on custom grown Jit implementation - NFC
This CL makes use of the standard LLVM LLJIT and removes the need for a
custom JIT implementation within MLIR.
To achieve this, one needs to clone (i.e. serde) the produced
llvm::Module into a new LLVMContext. This is currently necessary because
the llvm::LLVMContext is owned by the LLVMDialect, somewhat deep in the
call hierarchy.
In the future we should remove the reliance of serding the llvm::Module
by allowing the injection of an LLVMContext from the top-level.
Unfortunately this will require deeper API changes and impact multiple
places. It is therefore left for future work.
PiperOrigin-RevId: 264737459
The file was modifiedmlir/include/mlir/ExecutionEngine/ExecutionEngine.h
The file was modifiedmlir/lib/ExecutionEngine/ExecutionEngine.cpp
The file was modifiedmlir/lib/ExecutionEngine/CMakeLists.txt
Commit 62ced387e02a4ee7ad062462acaa0f9478c7deb7 by gardener
Remove dead getLLVMLibraryCallImplDefinition in Linalg's
LowerToLLVMDialect.cpp - NFC
PiperOrigin-RevId: 264740014
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/LowerToLLVMDialect.cpp
Commit 1d10eb162c89e84e8a4470e3c2b1b93e60dd2644 by gardener
Point to spv.AccessChain when reporting spv.AccessChain errors
PiperOrigin-RevId: 264742130
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVOps.cpp
The file was modifiedmlir/test/Dialect/SPIRV/ops.mlir
Commit 85bc8655f067f66f392124f06c91ca39ac065d57 by gardener
Avoid assigning to an unchecked Error.
Fixes tensorflow/mlir#97
PiperOrigin-RevId: 264743395
The file was modifiedmlir/lib/Support/JitRunner.cpp
Commit b9377d7ec6e6feca28a31df63e81eeb3e17b195b by gardener
Add support for generating operation interfaces from the ODS framework.
Operation interfaces generally require a bit of boilerplate code to
connect all of the pieces together. This cl introduces mechanisms in the
ODS to allow for generating operation interfaces via the 'OpInterface'
class.
Providing a definition of the `OpInterface` class will auto-generate the
c++ classes for the interface. An `OpInterface` includes a name, for the
c++ class, along with a list of interface methods. There are two types
of methods that can be used with an interface, `InterfaceMethod` and
`StaticInterfaceMethod`. They are both comprised of the same core
components, with the distinction that `StaticInterfaceMethod` models a
static method on the derived operation.
An `InterfaceMethod` is comprised of the following components:
   * ReturnType
     - A string corresponding to the c++ return type of the method.
   * MethodName
     - A string corresponding to the desired name of the method.
   * Arguments
     - A dag of strings that correspond to a c++ type and variable name
       respectively.
   * MethodBody (Optional)
     - An optional explicit implementation of the interface method.
def MyInterface : OpInterface<"MyInterface"> {
let methods = [
   // A simple non-static method with no inputs.
   InterfaceMethod<"unsigned", "foo">,
    // A new non-static method accepting an input argument.
   InterfaceMethod<"Value *", "bar", (ins "unsigned":$i)>,
    // Query a static property of the derived operation.
   StaticInterfaceMethod<"unsigned", "fooStatic">,
    // Provide the definition of a static interface method.
   // Note: `ConcreteOp` corresponds to the derived operation typename.
   StaticInterfaceMethod<"Operation *", "create",
     (ins "OpBuilder &":$builder, "Location":$loc), [{
       return builder.create<ConcreteOp>(loc);
   }]>,
    // Provide a definition of the non-static method.
   // Note: `op` corresponds to the derived operation variable.
   InterfaceMethod<"unsigned", "getNumInputsAndOutputs", (ins), [{
     return op.getNumInputs() + op.getNumOutputs();
   }]>,
];
PiperOrigin-RevId: 264754898
The file was modifiedmlir/g3doc/OpDefinitions.md
The file was modifiedmlir/include/mlir/Dialect/Linalg/IR/CMakeLists.txt
The file was modifiedmlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
The file was modifiedmlir/include/mlir/IR/OpBase.td
The file was modifiedmlir/g3doc/Interfaces.md
The file was modifiedmlir/include/mlir/Dialect/Linalg/IR/LinalgLibraryOps.td
The file was modifiedmlir/tools/mlir-tblgen/CMakeLists.txt
The file was modifiedmlir/include/mlir/Dialect/Linalg/IR/LinalgOps.h
The file was addedmlir/tools/mlir-tblgen/OpInterfacesGen.cpp
Commit 38d4e0b6a1b00beb93436a9bcd47c05b3953361c by gardener
NFC: Fix path of LinalgLibraryOpInterfaces inc files. PiperOrigin-RevId:
264827908
The file was modifiedmlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
The file was modifiedmlir/include/mlir/Dialect/Linalg/IR/LinalgOps.h
Commit fa592908afe6f5459f05ee82f8908869a66e12cc by gardener
Let LLVMOpLowering specify a PatternBenefit - NFC
Currently the benefit is always set to 1 which limits the ability to do
A->B->C lowering
PiperOrigin-RevId: 264854146
The file was modifiedmlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h
The file was modifiedmlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp
Commit 0c7f3f7108de731ebf1f2393c422ee24bccafb73 by gardener
Split out parsing location into separate functions per instance
Split out method into specialized instances + add an early exit. Should
be NFC, but simplifies reading the logic slightly IMHO.
PiperOrigin-RevId: 264855529
The file was modifiedmlir/lib/Parser/Parser.cpp
Commit b1ce4df505d7a4c04eac5fbabf4bb41216b3db8c by gardener
Add Positive{I32,I64}Attr and HasAnyRankOfPred
This commit adds `PositiveI32Attr` and `PositiveI64Attr` to match
positive integers but not zero nor negative integers.  This commit also
adds
`HasAnyRankOfPred` to match tensors with the specified ranks.
PiperOrigin-RevId: 264867046
The file was modifiedmlir/test/mlir-tblgen/types.mlir
The file was modifiedmlir/test/IR/attribute.mlir
The file was modifiedmlir/include/mlir/IR/OpBase.td
The file was modifiedmlir/test/lib/TestDialect/TestOps.td
Commit 27ed82f99c808289c56a6c51fd1cfe7c18fd73e1 by gardener
[spirv] Add support for capability (de)serialization
This CL pulls in capabilities defined in the spec and adds support for
(de)serialize capabilities of a spv.module.
PiperOrigin-RevId: 264877413
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/Deserializer.cpp
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVOps.cpp
The file was addedmlir/test/Dialect/SPIRV/Serialization/capability.mlir
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVBase.td
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/Serializer.cpp
The file was modifiedmlir/test/Dialect/SPIRV/structure-ops.mlir
Commit 140b28ec129f4f0906150f04b702978f08d7d87e by gardener
NFC: Avoid reconstructing the OpInterface methods. PiperOrigin-RevId:
264881293
The file was modifiedmlir/tools/mlir-tblgen/OpInterfacesGen.cpp
Commit 6f1d4bb8dfde5023aad26319e14d7e051dfc4d95 by gardener
Avoid overflow when lowering linalg.slice
linalg.subview used to lower to a slice with a bounded range resulting
in correct bounded accesses. However linalg.slice could still index out
of bounds. This CL moves the bounding to linalg.slice.
LLVM select and cmp ops gain a more idiomatic builder.
PiperOrigin-RevId: 264897125
The file was modifiedmlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/LowerToLLVMDialect.cpp
The file was modifiedmlir/test/Linalg/llvm.mlir
Commit 02c8b0689196a5e6e17ed5c44f5d2384f71dd69d by gardener
NFC: Remove mentions of the TensorFlow dialect from the langref.
PiperOrigin-RevId: 264904489
The file was modifiedmlir/g3doc/LangRef.md
Commit 986f93001a8c004e87b9999ca98e5184bb7c075f by gardener
NFC: Rework and cleanup the High-Level structure and Dialect sections.
Both sections are out-of-date and need to be updated. The dialect
section is particularly bad in that it never actually mentions what a
'Dialect' is.
PiperOrigin-RevId: 264937905
The file was modifiedmlir/g3doc/LangRef.md
Commit 51cbf97b53410f300329d39382af4511e36fa7b1 by gardener
[spirv] Add support for extension (de)serialization
Only a few important KHR extensions are registered to the SPIR-V dialect
for now.
PiperOrigin-RevId: 264939428
The file was modifiedmlir/test/Dialect/SPIRV/structure-ops.mlir
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/Deserializer.cpp
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVBase.td
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVOps.cpp
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/Serializer.cpp
The file was addedmlir/test/Dialect/SPIRV/Serialization/extension.mlir
Commit 9fc1657af09911e646650dc9086ab4bd790e34ef by gardener
NFC: Cleanup the type system section of the LangRef.
* Alphabetize the type definitions
* Make 'Dialect specific types' a type-system subsection
* Merge Builtin types and Standard types
PiperOrigin-RevId: 264947721
The file was modifiedmlir/g3doc/LangRef.md
Commit fc86c57bd09b455b141ce51abc20bf490e175447 by gardener
NFC: Cleanup the Attribute section in the LangRef.
* Add a section on dialect attribute values and attribute aliases
* Move FloatAttr into its alphabetically correct place
* Add a "Standard Attribute Values" section
PiperOrigin-RevId: 264959306
The file was modifiedmlir/g3doc/LangRef.md
Commit d906f84b52a6fea283d2f758cd1b98f450f12865 by gardener
Add iterator support to ElementsAttr and SparseElementsAttr.
This will allow iterating the values of a non-opaque ElementsAttr, with
all of the types currently supported by DenseElementsAttr. This should
help reduce the amount of specialization on DenseElementsAttr.
PiperOrigin-RevId: 264968151
The file was modifiedmlir/lib/IR/Attributes.cpp
The file was modifiedmlir/test/Target/llvmir.mlir
The file was modifiedmlir/lib/Target/LLVMIR/ModuleTranslation.cpp
The file was modifiedmlir/include/mlir/IR/Attributes.h
Commit a329d33b4fb7bab7dde086cc53ba5f64f99a50c1 by gardener
Add I32ElementsAttr to OpBase
PiperOrigin-RevId: 264969142
The file was modifiedmlir/test/mlir-tblgen/types.mlir
The file was modifiedmlir/test/lib/TestDialect/TestOps.td
The file was modifiedmlir/include/mlir/IR/OpBase.td
Commit f772d2c90cfa6d6c6d80ac652234108ab72c3c5a by gardener
NFC: Move the operation, region, and block sections to after the dialect
section.
Operations/Regions/Blocks represent the core IR building blocks and
should be introduced before types and attributes.
PiperOrigin-RevId: 265079103
The file was modifiedmlir/g3doc/LangRef.md
Commit 988dab0abc226b1b83f21cc5502f3d5070619caa by gardener
Fix BufferAllocOp builder.
One of the BufferAllocOp builders was improperly specified which
triggered infinite recursion. This CL fixes it.
PiperOrigin-RevId: 265080371
The file was modifiedmlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td
Commit 21b77fc11ff6b5046fba3920c56a95ac8199e237 by gardener
[spirv] NFC: move arithmetic and logical ops to separate files
This is purely moving code around for better file organization.
PiperOrigin-RevId: 265082517
The file was addedmlir/include/mlir/Dialect/SPIRV/SPIRVLogicalOps.td
The file was modifiedmlir/test/Dialect/SPIRV/ops.mlir
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVBase.td
The file was addedmlir/test/Dialect/SPIRV/logical-ops.mlir
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVStructureOps.td
The file was addedmlir/include/mlir/Dialect/SPIRV/SPIRVArithmeticOps.td
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVOps.td
The file was addedmlir/test/Dialect/SPIRV/arithmetic-ops.mlir
Commit 00177962ed13d58cd9d8825e093d7d25d3b9450f by gardener
NFC: Update in-code documentation. Make the two grammar definitions of
static-dimension-list consistent. PiperOrigin-RevId: 265084348
The file was modifiedmlir/lib/Parser/Parser.cpp
Commit 31a003dc3c17eba12f7dcb4dda626bc7ca41c0c5 by gardener
Introduce the ability for "isolated from above" ops to introduce
shadowing names for the basic block arguments in their body.
PiperOrigin-RevId: 265084627
The file was modifiedmlir/test/lib/TestDialect/TestOps.td
The file was modifiedmlir/lib/IR/AsmPrinter.cpp
The file was modifiedmlir/test/lib/TestDialect/TestDialect.cpp
The file was modifiedmlir/test/IR/parser.mlir
The file was modifiedmlir/include/mlir/IR/OpImplementation.h
Commit 0e131d83fe2efd8e993ef1e348f098fa90871e00 by gardener
[spirv] NFC: move SPIR-V control flow ops to a separate file
This CL is also purely moving code around for better file organization.
PiperOrigin-RevId: 265092566
The file was addedmlir/include/mlir/Dialect/SPIRV/SPIRVControlFlowOps.td
The file was addedmlir/test/Dialect/SPIRV/control-flow-ops.mlir
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVOps.td
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVOps.cpp
The file was modifiedmlir/test/Dialect/SPIRV/ops.mlir
Commit 3d409386a06a946b5f32e19f110f3faa81151ce3 by gardener
Update Linalg slice and subview documentation - NFC
PiperOrigin-RevId: 265092922
The file was modifiedmlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td
Commit 7f42b3d72130c2ef70e254fc89cb4a297fbdab7a by gardener
Add lowering of linalg.copy to an external C++ library and a test.
This CL extends support for lowering of linalg to external C++ libraries
with CopyOp. Currently this can only work when the permutation maps in
the copies are identity. Future support for permutations will be added
later.
PiperOrigin-RevId: 265093025
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/LowerToLLVMDialect.cpp
The file was modifiedmlir/test/mlir-cpu-runner/cblas_interface.cpp
The file was modifiedmlir/test/mlir-cpu-runner/linalg_integration_test.mlir
The file was modifiedmlir/test/Linalg/llvm.mlir
Commit 32052c841713ff22a3b44c42b83b3b88bc44d21b by gardener
NFC: Add a note to 'applyPatternsGreedily' that it also performs
folding/dce.
Fixes tensorflow/mlir#72
PiperOrigin-RevId: 265097597
The file was modifiedmlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp
The file was modifiedmlir/include/mlir/IR/PatternMatch.h
Commit 2c2c9ffd80c786775c7187d35a74b771f61d91e4 by gardener
Add a linalg.transpose op
A linalg.transpose op is a pure metadata operation that takes a view +
permutation map and produces another view of the same underlying data,
with a different reindexing. This is a pure metadata operation that does
not touch the underlying data.
Example:
```
%t = linalg.transpose %v (i, j) -> (j, i) : !linalg.view<?x?xf32>
```
PiperOrigin-RevId: 265139429
The file was modifiedmlir/test/Linalg/roundtrip.mlir
The file was modifiedmlir/test/Linalg/invalid.mlir
The file was modifiedmlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
The file was modifiedmlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td
Commit 28e28e5d651b19a3f2a22c4fe4209a9d3d8c2689 by gardener
Lower linalg.transpose to LLVM dialect
Add a conversion pattern that transforms a linalg.transpose op into:
  1. A function entry `alloca` operation to allocate a ViewDescriptor.
  2. A load of the ViewDescriptor from the pointer allocated in 1.
  3. Updates to the ViewDescriptor to introduce the data ptr, offset,
size
     and stride. Size and stride are permutations of the original
values.
  4. A store of the resulting ViewDescriptor to the alloca'ed pointer.
The linalg.transpose op is replaced by the alloca'ed pointer.
PiperOrigin-RevId: 265169112
The file was modifiedmlir/test/Linalg/llvm.mlir
The file was modifiedmlir/include/mlir/IR/Builders.h
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/LowerToLLVMDialect.cpp
Commit 46084c03f42f598f766028e63325dffd9d66b3d7 by gardener
Lower linalg.copy to LLVM dialect in the presence of transposes.
Add an extra RewritePattern that does not convert types to rewrite a
CopyOp that has non-identity permutations into a sequence of TransposeOp
followed by a CopyOp without such permutations.
This RewitePattern is made to fail in the non-permutation case so that
the conversion pattern can kick in to lower to LLVM.
This is an instance of A->A->B lowering where A->A is done by a
RewritePattern in case_1 and A->B is done by a ConversionPatternRewriter
when not(case_1).
PiperOrigin-RevId: 265171380
The file was modifiedmlir/test/Linalg/llvm.mlir
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/LowerToLLVMDialect.cpp
The file was modifiedmlir/include/mlir/Dialect/Linalg/IR/LinalgLibraryOps.td
Commit 4da37417adcd78e95bfa554dbbfd29026dad5f71 by gardener
NFC: Update Ch.1 of the Toy tutorial.
Change the use of 'array' to 'tensor' to reflect the new flow that the
tutorial will follow. Also tidy up some of the documentation, code
comments, and fix a few out-dated links.
PiperOrigin-RevId: 265174676
The file was modifiedmlir/g3doc/Tutorials/Toy/Ch-1.md
The file was modifiedmlir/examples/toy/Ch1/include/toy/Lexer.h
The file was modifiedmlir/examples/toy/Ch1/include/toy/AST.h
Commit 96e96e0243ea8a4ce4d179a368639a1a565768d7 by gardener
NFC: Add doc for id-punct PiperOrigin-RevId: 265190168
The file was modifiedmlir/lib/Parser/Lexer.cpp
Commit 6a501e3d1b6725bf63f9cf053f7674c042794d49 by gardener
Support folding of ops with inner ops in GreedyPatternRewriteDriver.
This fixes a bug when folding ops with inner ops and inner ops are still
being visited.
PiperOrigin-RevId: 265475780
The file was modifiedmlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp
The file was modifiedmlir/test/lib/TestDialect/TestDialect.cpp
The file was modifiedmlir/test/Transforms/test-canonicalize.mlir
The file was modifiedmlir/test/lib/TestDialect/TestOps.td
Commit cb8c451541390a4096584bb1fbe9501711d67c35 by gardener
Update documentation for custom rewrite specs.
PiperOrigin-RevId: 265485862
The file was modifiedmlir/g3doc/QuickstartRewrites.md
Commit 23251f9f3a3dd518bd7cc9c3289d3a04e58c07bc by gardener
NFC: Remove unnecessary context parameters from several Location
getters.
The context can be recovered by other means in these methods and doesn't
need to be passed explicitly.
PiperOrigin-RevId: 265532956
The file was modifiedmlir/lib/IR/Location.cpp
The file was modifiedmlir/include/mlir/IR/Location.h
The file was modifiedmlir/lib/Parser/Parser.cpp
Commit 761d57d1876919f47e3f4199f919efd233fd4cd9 by gardener
Add FPToSI/FPExt/FPTrunc cast ops to the LLVM dialect.
Closes tensorflow/mlir#99
PiperOrigin-RevId: 265538731
The file was modifiedmlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
The file was modifiedmlir/test/Target/llvmir.mlir
Commit 2f59f7687636d7140298bdc5fbbb5911e0d223ef by gardener
NFC: Remove the explicit context from Operation::create and
OperationState.
The context can easily be recovered from the Location in these
situations.
PiperOrigin-RevId: 265578574
The file was modifiedmlir/lib/IR/Operation.cpp
The file was modifiedmlir/include/mlir/IR/Operation.h
The file was modifiedmlir/unittests/IR/OperationSupportTest.cpp
The file was modifiedmlir/include/mlir/IR/OperationSupport.h
The file was modifiedmlir/test/lib/TestDialect/TestOps.td
The file was modifiedmlir/lib/Transforms/DialectConversion.cpp
The file was modifiedmlir/lib/Parser/Parser.cpp
The file was modifiedmlir/lib/IR/OperationSupport.cpp
Commit 8f2dfb51d4a448754f0c76a8f4d97643d73add3c by gardener
[spirv] Add Block decoration for spv.struct.
Add Block decoration for top-level spv.struct.
Closes tensorflow/mlir#102
PiperOrigin-RevId: 265716241
The file was modifiedmlir/unittests/Dialect/SPIRV/CMakeLists.txt
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/Serializer.cpp
The file was addedmlir/unittests/Dialect/SPIRV/SerializationTest.cpp
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/Deserializer.cpp
Commit 4ced99c085e62f681276a06e0ce842b190900d32 by gardener
Enhance GPU To SPIR-V conversion to support builtins and load/store ops.
To support a conversion of a simple load-compute-store kernel from GPU
dialect to SPIR-V dialect, the conversion of operations like
"gpu.block_dim", "gpu.thread_id" which allow threads to get the launch
conversion is needed. In SPIR-V these are specified as global variables
with builin attributes. This CL adds support to specify builtin
variables in SPIR-V conversion framework. This is used to convert the
relevant operations from GPU dialect to SPIR-V dialect. Also add support
for conversion of load/store operation in Standard dialect to SPIR-V
dialect. To simplify the conversion add a method to build a
spv.AccessChain operation that automatically determines the return type
based on the base pointer type and the indices provided.
PiperOrigin-RevId: 265718525
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVOps.td
The file was addedmlir/test/Conversion/GPUToSPIRV/builtins.mlir
The file was modifiedmlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVOps.cpp
The file was modifiedmlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.cpp
The file was modifiedmlir/include/mlir/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.h
The file was addedmlir/test/Conversion/GPUToSPIRV/load_store.mlir
The file was modifiedmlir/lib/Conversion/StandardToSPIRV/StandardToSPIRV.td
Commit 3af6b533812ce43b2b53f3c8ef905f73881ea7f8 by gardener
[spirv] Fix the entry block to start with OpLabel
Each basic block in SPIR-V must start with an OpLabel instruction. We
don't support control flow yet, so this CL just makes sure that the
entry block follows this rule and is valid.
PiperOrigin-RevId: 265718841
The file was modifiedmlir/unittests/Dialect/SPIRV/DeserializationTest.cpp
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVBase.td
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/Deserializer.cpp
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/Serializer.cpp
Commit 696fcb7520e13b8c712146b6bcb6a55815af660c by gardener
Add 3 additional intrinsic ops to NVVM dialect, in preparation to
implement block-wide reduce.
PiperOrigin-RevId: 265720077
The file was modifiedmlir/include/mlir/Dialect/LLVMIR/NVVMOps.td
The file was modifiedmlir/lib/Target/LLVMIR/ConvertToNVVMIR.cpp
The file was modifiedmlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp
The file was modifiedmlir/test/LLVMIR/nvvm.mlir
The file was modifiedmlir/test/Target/nvvmir.mlir
Commit 6f68def852c2443782b8ed61e9320d6aebb2ec76 by gardener
Update Ch.2 of the Toy tutorial.
The code and documentation for this chapter of the tutorial have been
updated to follow the new flow. The toy 'array' type has been replaced
by usages of the MLIR tensor type. The code has also been cleaned up and
modernized.
Closes tensorflow/mlir#101
PiperOrigin-RevId: 265744086
The file was modifiedmlir/examples/toy/Ch1/include/toy/AST.h
The file was modifiedmlir/examples/toy/Ch2/include/toy/AST.h
The file was modifiedmlir/examples/toy/Ch2/include/toy/Lexer.h
The file was modifiedmlir/examples/toy/Ch2/mlir/MLIRGen.cpp
The file was modifiedmlir/g3doc/Tutorials/Toy/Ch-2.md
The file was modifiedmlir/examples/toy/Ch2/toyc.cpp
The file was modifiedmlir/test/Examples/Toy/Ch2/codegen.toy
Commit aa2cee9cf53678dde2950087548f502009fec814 by gardener
Refactor / improve replaceAllMemRefUsesWith
Refactor replaceAllMemRefUsesWith to split it into two methods: the new
method does the replacement on a single op, and is used by the existing
one.
- make the methods return LogicalResult instead of bool
- Earlier, when replacement failed (due to non-deferencing uses of the
memref), the set of ops that had already been processed would have
been replaced leaving the IR in an inconsistent state. Now, a
pass is made over all ops to first check for non-deferencing
uses, and then replacement is performed. No test cases were affected
because all clients of this method were first checking for
non-deferencing uses before calling this method (for other reasons).
This isn't true for a use case in another upcoming PR (scalar
replacement); clients can now bail out with consistent IR on failure
of replaceAllMemRefUsesWith. Add test case.
- multiple deferencing uses of the same memref in a single op is
possible (we have no such use cases/scenarios), and this has always
remained unsupported. Add an assertion for this.
- minor fix to another test pipeline-data-transfer case.
Signed-off-by: Uday Bondhugula <uday@polymagelabs.com>
Closes tensorflow/mlir#87
PiperOrigin-RevId: 265808183
The file was modifiedmlir/lib/Transforms/LoopFusion.cpp
The file was modifiedmlir/test/Transforms/pipeline-data-transfer.mlir
The file was modifiedmlir/include/mlir/Transforms/Utils.h
The file was modifiedmlir/lib/Transforms/PipelineDataTransfer.cpp
The file was modifiedmlir/lib/Transforms/Utils/Utils.cpp
Commit 545c3e489f82cd14bbafbf45b99ef8be81ce6b62 by gardener
Port mlir-cuda-runner to use dialect conversion framework.
Instead of lowering the program in two steps (Standard->LLVM followed by
GPU->NVVM), leading to invalid IR inbetween, the runner now uses one
pattern based rewrite step to go directly from Standard+GPU to
LLVM+NVVM.
PiperOrigin-RevId: 265861934
The file was modifiedmlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp
The file was modifiedmlir/tools/mlir-cuda-runner/mlir-cuda-runner.cpp
The file was modifiedmlir/include/mlir/Conversion/GPUToNVVM/GPUToNVVMPass.h
The file was modifiedmlir/include/mlir/Dialect/LLVMIR/NVVMDialect.h
Commit c60c490356a8908b21315a72d813d148eddf146f by gardener
Add implementation for tensor_load and tensor_store operations.
This change adds definitions, parsing and verification for both ops.
PiperOrigin-RevId: 265954051
The file was modifiedmlir/lib/IR/Operation.cpp
The file was modifiedmlir/test/lib/TestDialect/TestOps.td
The file was modifiedmlir/test/IR/traits.mlir
The file was modifiedmlir/include/mlir/Dialect/StandardOps/Ops.td
The file was modifiedmlir/lib/Dialect/StandardOps/Ops.cpp
The file was modifiedmlir/test/IR/core-ops.mlir
The file was modifiedmlir/include/mlir/IR/OpBase.td
The file was modifiedmlir/include/mlir/IR/OpDefinition.h
Commit 22254116903763d49be0a9fff226fcce498c6772 by gardener
Tweak to the pretty type parser to recognize that `->` is a special
token.
Tweak to the pretty type parser to recognize that `->` is a special
token that shouldn't be split into two characters.  This change allows
dialect types to wrap function types as in `!my.ptr_type<(i32) -> i32>`.
Closes tensorflow/mlir#105
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/105
from schweitzpgi:parse-arrow 8b2d768053f419daae5a1a864121a44c4319acbe
PiperOrigin-RevId: 265986240
The file was modifiedmlir/test/IR/invalid.mlir
The file was modifiedmlir/lib/IR/AsmPrinter.cpp
The file was modifiedmlir/lib/Parser/Parser.cpp
The file was modifiedmlir/test/IR/parser.mlir
Commit 29099e03ce2f8e4546f3ba1086fb51749abc0c62 by gardener
Generalize the analysis manager framework to work on any operation at
any nesting.
The pass manager is moving towards being able to run on operations at
arbitrary nesting. An operation may have both parent and child
operations, and the AnalysisManager must be able to handle this
generalization. The AnalysisManager class now contains generic
'getCachedParentAnalysis' and 'getChildAnalysis/getCachedChildAnalysis'
functions to query analyses on parent/child operations. This removes the
hard coded nesting relationship between Module/Function.
PiperOrigin-RevId: 266003636
The file was modifiedmlir/unittests/Pass/AnalysisManagerTest.cpp
The file was modifiedmlir/g3doc/WritingAPass.md
The file was modifiedmlir/lib/Pass/PassDetail.h
The file was modifiedmlir/include/mlir/Pass/Pass.h
The file was modifiedmlir/lib/Pass/Pass.cpp
The file was modifiedmlir/include/mlir/Pass/AnalysisManager.h
Commit 7dd5efdf2c216330a1ae8d866ad4a0e0bf86265e by gardener
Fix the equality check of two floating point values
PiperOrigin-RevId: 266022088
The file was modifiedmlir/lib/Dialect/QuantOps/Utils/FakeQuantSupport.cpp
Commit e8d43cafe6a8a3db86324010d0e417307bfcb72f by gardener
Add vim scripts for indent/syntax
- some of it has been adapted from LLVM's vim utils
Signed-off-by: Uday Bondhugula <uday@polymagelabs.com>
Closes tensorflow/mlir#90
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/90
from bondhugula:vim 22b1c958818c4b09de0ec8e1d7a4893171a03dbf
PiperOrigin-RevId: 266071752
The file was addedmlir/utils/vim/ftdetect/mlir.vim
The file was removedmlir/utils/vim/mlir.vim
The file was addedmlir/utils/vim/README
The file was addedmlir/utils/vim/ftplugin/mlir.vim
The file was addedmlir/utils/vim/syntax/mlir.vim
The file was addedmlir/utils/vim/indent/mlir.vim
Commit e90542c03b998800f61272b56a12f2f98c47aca7 by gardener
Add verification for dimension attribute on GPUDialect index operations.
PiperOrigin-RevId: 266073204
The file was modifiedmlir/lib/Dialect/GPU/IR/GPUDialect.cpp
The file was modifiedmlir/include/mlir/Dialect/GPU/GPUOps.td
The file was modifiedmlir/test/Dialect/GPU/invalid.mlir
Commit bc2a543225abdd3876ae0b31fac89a3b31872d86 by gardener
fix loop unroll and jam - operand mapping - imperfect nest case
- fix operand mapping while cloning sub-blocks to jam - was incorrect
for imperfect nests where def/use was across sub-blocks
- strengthen/generalize the first test case to cover the previously
missed scenario
- clean up the other cases while on this.
Previously, unroll-jamming the following nest
```
   affine.for %arg0 = 0 to 2048 {
     %0 = alloc() : memref<512x10xf32>
     affine.for %arg1 = 0 to 10 {
       %1 = affine.load %0[%arg0, %arg1] : memref<512x10xf32>
     }
     dealloc %0 : memref<512x10xf32>
   }
```
would yield
```
     %0 = alloc() : memref<512x10xf32>
     %1 = affine.apply #map0(%arg0)
     %2 = alloc() : memref<512x10xf32>
     affine.for %arg1 = 0 to 10 {
       %4 = affine.load %0[%arg0, %arg1] : memref<512x10xf32>
       %5 = affine.apply #map0(%arg0)
       %6 = affine.load %0[%5, %arg1] : memref<512x10xf32>
     }
     dealloc %0 : memref<512x10xf32>
     %3 = affine.apply #map0(%arg0)
     dealloc %0 : memref<512x10xf32>
```
instead of
```
module {
   affine.for %arg0 = 0 to 2048 step 2 {
     %0 = alloc() : memref<512x10xf32>
     %1 = affine.apply #map0(%arg0)
     %2 = alloc() : memref<512x10xf32>
     affine.for %arg1 = 0 to 10 {
       %4 = affine.load %0[%arg0, %arg1] : memref<512x10xf32>
       %5 = affine.apply #map0(%arg0)
       %6 = affine.load %2[%5, %arg1] : memref<512x10xf32>
     }
     dealloc %0 : memref<512x10xf32>
     %3 = affine.apply #map0(%arg0)
     dealloc %2 : memref<512x10xf32>
   }
```
Signed-off-by: Uday Bondhugula <uday@polymagelabs.com>
Closes tensorflow/mlir#98
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/98
from bondhugula:ujam ddbc853f69b5608b3e8ff9b5ac1f6a5a0bb315a4
PiperOrigin-RevId: 266073460
The file was modifiedmlir/lib/Transforms/LoopUnrollAndJam.cpp
The file was modifiedmlir/test/Transforms/unroll-jam.mlir
Commit 4bb6f8ecdb54f4ee096d8f92603d628d0cac4ed6 by gardener
Extend map canonicalization to propagate constant operands
- extend canonicalizeMapAndOperands to propagate constant operands into
the map's expressions (and thus drop those operands).
- canonicalizeMapAndOperands previously only dropped duplicate and
unused operands; however, operands that were constants were
retained.
This change makes IR maps/expressions generated by various
utilities/passes even simpler; also makes some of the test checks more
accurate and simpler -- for eg., 0' instead of symbol(%{{.*}}).
Signed-off-by: Uday Bondhugula <uday@polymagelabs.com>
Closes tensorflow/mlir#107
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/107
from bondhugula:canonicalize-maps
c889a51486d14fbf7db489f224f881e7e1ff7d72 PiperOrigin-RevId: 266085289
The file was modifiedmlir/test/Transforms/pipeline-data-transfer.mlir
The file was modifiedmlir/examples/Linalg/Linalg4/Example.cpp
The file was modifiedmlir/test/Linalg/tile_conv.mlir
The file was modifiedmlir/test/AffineOps/canonicalize.mlir
The file was modifiedmlir/test/EDSC/builder-api-test.cpp
The file was modifiedmlir/lib/Dialect/AffineOps/AffineOps.cpp
The file was modifiedmlir/test/Transforms/loop-fusion.mlir
The file was modifiedmlir/test/Transforms/dma-generate.mlir
The file was modifiedmlir/test/Transforms/loop-fusion-slice-computation.mlir
Commit 6de6c2c13828742249377585fd1ef19d9cfd1773 by gardener
Add tests to verify 0.0 is quantized correctly
We should consider both signed and narrow_range cases.
PiperOrigin-RevId: 266167366
The file was modifiedmlir/test/Dialect/QuantOps/convert-const.mlir
The file was modifiedmlir/lib/Dialect/QuantOps/Utils/FakeQuantSupport.cpp
The file was modifiedmlir/test/Dialect/QuantOps/convert-fakequant.mlir
Commit a085700311cec4644381d71c6afeee021a7e8e25 by gardener
Make dumping using generic form more robust when IR ill-formed
PiperOrigin-RevId: 266198057
The file was modifiedmlir/lib/IR/AsmPrinter.cpp
The file was modifiedmlir/include/mlir/IR/OpImplementation.h
Commit 4bfae66d70aea0df4bf9948e51f4bfa8895a4f4e by gardener
Refactor the 'walk' methods for operations.
This change refactors and cleans up the implementation of the operation
walk methods. After this refactoring is that the explicit template
parameter for the operation type is no longer needed for the explicit op
walks. For example:
    op->walk<AffineForOp>([](AffineForOp op) { ... });
is now accomplished via:
    op->walk([](AffineForOp op) { ... });
PiperOrigin-RevId: 266209552
The file was addedmlir/lib/IR/Visitors.cpp
The file was modifiedmlir/lib/Transforms/Vectorize.cpp
The file was modifiedmlir/include/mlir/IR/OpDefinition.h
The file was modifiedmlir/lib/Transforms/Utils/LoopFusionUtils.cpp
The file was modifiedmlir/include/mlir/IR/Region.h
The file was modifiedmlir/lib/Analysis/TestParallelismDetection.cpp
The file was modifiedmlir/examples/Linalg/Linalg3/lib/Transforms.cpp
The file was modifiedmlir/lib/Transforms/LoopUnroll.cpp
The file was modifiedmlir/lib/IR/Block.cpp
The file was addedmlir/include/mlir/IR/Visitors.h
The file was modifiedmlir/examples/Linalg/Linalg2/Example.cpp
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/Tiling.cpp
The file was modifiedmlir/test/lib/Transforms/TestLoopMapping.cpp
The file was modifiedmlir/include/mlir/Support/LLVM.h
The file was modifiedmlir/lib/Conversion/GPUToCUDA/ConvertLaunchFuncToCudaCalls.cpp
The file was modifiedmlir/test/lib/Transforms/TestLoopParametricTiling.cpp
The file was modifiedmlir/lib/IR/Region.cpp
The file was modifiedmlir/lib/Transforms/LoopInvariantCodeMotion.cpp
The file was modifiedmlir/lib/IR/Operation.cpp
The file was modifiedmlir/lib/Transforms/MemRefDataFlowOpt.cpp
The file was modifiedmlir/lib/Dialect/GPU/Transforms/KernelOutlining.cpp
The file was modifiedmlir/lib/Transforms/LoopCoalescing.cpp
The file was modifiedmlir/include/mlir/IR/Operation.h
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/Fusion.cpp
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/LowerToLLVMDialect.cpp
The file was modifiedmlir/lib/Transforms/Utils/LoopUtils.cpp
The file was modifiedmlir/include/mlir/IR/Block.h
The file was modifiedmlir/lib/Transforms/PipelineDataTransfer.cpp
Commit 3ee3710fd1da25631eb99c2fe58360ccecd3d703 by gardener
Change the parseSource* methods to return OwningModuleRef instead of
ModuleOp.
This avoids potential memory leaks from misuse of the API.
PiperOrigin-RevId: 266305750
The file was modifiedmlir/lib/Parser/Parser.cpp
The file was modifiedmlir/include/mlir/Parser.h
Commit 4f6c29223ee5395dd955cefafce6f03ed99170e0 by gardener
Add spv.Branch and spv.BranchConditional
This CL just covers the op definition, its parsing, printing, and
verification. (De)serialization is to be implemented in a subsequent CL.
PiperOrigin-RevId: 266431077
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVControlFlowOps.td
The file was modifiedmlir/test/Dialect/SPIRV/control-flow-ops.mlir
The file was modifiedmlir/utils/spirv/gen_spirv_dialect.py
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVBase.td
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVOps.cpp
Commit 037742cdf2b9794941958a985e8a0d2023aaa70d by gardener
Add support for early exit walk methods.
This is done by providing a walk callback that returns a WalkResult.
This result is either `advance` or `interrupt`. `advance` means that the
walk should continue, whereas `interrupt` signals that the walk should
stop immediately. An example is shown below:
auto result = op->walk([](Operation *op) {
if (some_invariant)
   return WalkResult::interrupt();
return WalkResult::advance();
});
if (result.wasInterrupted())
...;
PiperOrigin-RevId: 266436700
The file was modifiedmlir/include/mlir/IR/Operation.h
The file was modifiedmlir/include/mlir/IR/Visitors.h
The file was modifiedmlir/lib/IR/Visitors.cpp
The file was modifiedmlir/lib/Analysis/Utils.cpp
The file was modifiedmlir/lib/Transforms/Utils/LoopFusionUtils.cpp
The file was modifiedmlir/include/mlir/IR/Block.h
The file was modifiedmlir/include/mlir/IR/Region.h
The file was modifiedmlir/include/mlir/IR/OpDefinition.h
Commit 8f90a442c3e3d4b727b013a520a3e9520bbd2784 by gardener
Added a TableGen generator for structured data
Similar to enum, added a generator for structured data. This provide
Dictionary that stores a fixed set of values and guarantees the values
are valid. It is intended to store a fixed number of values by a given
name.
PiperOrigin-RevId: 266437460
The file was addedmlir/unittests/TableGen/structs.td
The file was modifiedmlir/include/mlir/TableGen/Attribute.h
The file was modifiedmlir/unittests/TableGen/CMakeLists.txt
The file was addedmlir/unittests/TableGen/StructsGenTest.cpp
The file was modifiedmlir/lib/TableGen/Attribute.cpp
The file was addedmlir/tools/mlir-tblgen/StructsGen.cpp
The file was modifiedmlir/tools/mlir-tblgen/CMakeLists.txt
The file was modifiedmlir/include/mlir/IR/OpBase.td
Commit 06e8101034e71b95e1338662d27472492dae4d4b by gardener
Add mechanism to dump JIT-compiled objects to files
This commit introduces the bits to be able to dump JIT-compile objects
to external files by passing an object cache to OrcJit. The new
functionality is tested in mlir-cpu-runner under the flag
`dump-object-file`.
Closes tensorflow/mlir#95
PiperOrigin-RevId: 266439265
The file was modifiedmlir/test/mlir-cpu-runner/simple.mlir
The file was modifiedmlir/lib/ExecutionEngine/ExecutionEngine.cpp
The file was modifiedmlir/lib/Support/JitRunner.cpp
The file was modifiedmlir/include/mlir/ExecutionEngine/ExecutionEngine.h
Commit 1dd9bf47393afba3adad066fde950eb9c608f2cc by gardener
Generalize the pass hierarchy by adding a general OpPass<PassT, OpT>.
This pass class generalizes the current functionality between
FunctionPass and ModulePass, and allows for operating on any operation
type. The pass manager currently only supports OpPasses operating on
FuncOp and ModuleOp, but this restriction will be relaxed in follow-up
changes. A utility class OpPassBase<OpT> allows for generically
referring to operation specific passes: e.g. FunctionPassBase ==
OpPassBase<FuncOp>.
PiperOrigin-RevId: 266442239
The file was modifiedmlir/include/mlir/Transforms/ViewRegionGraph.h
The file was modifiedmlir/lib/Pass/PassDetail.h
The file was modifiedmlir/examples/Linalg/Linalg3/include/linalg3/Transforms.h
The file was modifiedmlir/include/mlir/Conversion/GPUToCUDA/GPUToCUDAPass.h
The file was modifiedmlir/include/mlir/Conversion/GPUToNVVM/GPUToNVVMPass.h
The file was modifiedmlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVMPass.h
The file was modifiedmlir/include/mlir/Dialect/FxpMathOps/Passes.h
The file was modifiedmlir/include/mlir/Pass/PassManager.h
The file was modifiedmlir/include/mlir/Transforms/Passes.h
The file was modifiedmlir/include/mlir/Conversion/LoopsToGPU/LoopsToGPUPass.h
The file was modifiedmlir/include/mlir/Dialect/QuantOps/Passes.h
The file was modifiedmlir/include/mlir/Analysis/Passes.h
The file was modifiedmlir/include/mlir/Dialect/GPU/Passes.h
The file was modifiedmlir/examples/Linalg/Linalg1/include/linalg1/Passes.h
The file was modifiedmlir/include/mlir/Pass/Pass.h
The file was modifiedmlir/include/mlir/Conversion/ControlFlowToCFG/ConvertControlFlowToCFG.h
The file was modifiedmlir/lib/Pass/Pass.cpp
The file was modifiedmlir/include/mlir/Conversion/VectorToLLVM/VectorToLLVM.h
The file was modifiedmlir/include/mlir/Dialect/Linalg/Passes.h
Commit 140757050b4321e40e5f8d81b3286943e92c1e4b by gardener
Fix StructsGenTest.cpp CMakeFile build error
PiperOrigin-RevId: 266452719
The file was modifiedmlir/unittests/TableGen/CMakeLists.txt
Commit 6b1d7f51ef038ec883a4c55f14d749df41774954 by gardener
Add TensorRankOf for ranked tensor types with specific ranks
This commit adds `TensorRankOf<types, typeNames, ranks>` to specify
ranked tensor types with the specified types and ranks.  For example,
`TensorRankOf<[I32, F32], ["i32", "F32"], [0, 1]>` matches
`tensor<i32>`,
`tensor<?xi32>`, `tensor<f32>`, or `tensor<?xf32>`.
PiperOrigin-RevId: 266461256
The file was modifiedmlir/include/mlir/IR/OpBase.td
The file was modifiedmlir/test/lib/TestDialect/TestOps.td
The file was modifiedmlir/test/mlir-tblgen/types.mlir
Commit 3d3f62323c820ed90bef4378ae2e3f23f542ca81 by gardener
Splits DictionaryAttr into DictionaryAttrBase and DictionaryAttr. This
maintains consistency with other *AttrBase/Attr splits.
PiperOrigin-RevId: 266469869
The file was modifiedmlir/include/mlir/IR/OpBase.td
Commit 9c8a8a7d0da011f1570733265020a40079127b05 by gardener
Add a canonicalization to erase empty AffineForOps.
AffineForOp themselves are pure and can be removed if there are no
internal operations.
PiperOrigin-RevId: 266481293
The file was modifiedmlir/lib/Dialect/AffineOps/AffineOps.cpp
The file was modifiedmlir/test/AffineOps/canonicalize.mlir
The file was modifiedmlir/lib/Transforms/LoopInvariantCodeMotion.cpp
The file was modifiedmlir/test/Transforms/loop-invariant-code-motion.mlir
Commit 20d3e71c3f429120bfc570d13674eb8a4c881dfe by gardener
update vim syntax file
- more highlighting: numbers, elemental types inside shaped types
- add some more keywords
Signed-off-by: Uday Bondhugula <uday@polymagelabs.com>
Closes tensorflow/mlir#110
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/110
from bondhugula:vim 029777db0ecb95bfc6453c0869af1c233d84d521
PiperOrigin-RevId: 266487768
The file was modifiedmlir/utils/vim/syntax/mlir.vim
Commit 5a7014c390918ea73684b37616d7a4f61d9b2f17 by gardener
Add missing link dependency to MLIRTableGenTests
PiperOrigin-RevId: 266561495
The file was modifiedmlir/unittests/TableGen/CMakeLists.txt
Commit 49c3e4a50819bfea464dca4290f9f61eac9540e2 by gardener
Add floating-point comparison operations to SPIR-V dialect.
Use the existing SPV_LogicalOp specification to add the floating-point
comparison operations (both ordered and unordered versions). To make it
easier to import the op-definitions automatically modify the dialect
generation script to update the different .td files based on whether the
operation is an arithmetic op, logical op, etc. Also allow specification
of multiple opcodes with define_inst.sh. Since this reuses the
SPV_LogicalOp framework, no tests specific to the floating point
comparison ops are added with this CL.
PiperOrigin-RevId: 266561634
The file was modifiedmlir/utils/spirv/define_inst.sh
The file was modifiedmlir/utils/spirv/gen_spirv_dialect.py
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVLogicalOps.td
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVBase.td
Commit d4d32f4cb86b36864676747ee72ee36d1ac2f421 by gardener
Document that non-IR units are passed by non-const reference instead of
pointer in general
PiperOrigin-RevId: 266583029
The file was modifiedmlir/g3doc/DeveloperGuide.md
Commit 2634273c59db653ab86bb99c5cdc9d87a01a8c5a by gardener
Add a link to the rational on lack of const for IR units in the
developer guide
PiperOrigin-RevId: 266583374
The file was modifiedmlir/g3doc/DeveloperGuide.md
Commit 765d60fd4d4dc93f45bd74e4fd397e92feeb1714 by gardener
Add missing lowering to CFG in mlir-cpu-runner + related cleanup
- the list of passes run by mlir-cpu-runner included -lower-affine and
-lower-to-llvm but was missing -lower-to-cfg (because -lower-affine at
some point used to lower straight to CFG); add -lower-to-cfg in
between. IR with affine ops can now be run by mlir-cpu-runner.
- update -lower-to-cfg to be consistent with other passes (create*Pass
methods
were changed to return unique ptrs, but -lower-to-cfg appears to have
been
missed).
- mlir-cpu-runner was unable to parse custom form of affine op's - fix
link options
- drop unnecessary run options from test/mlir-cpu-runner/simple.mlir
(none of the test cases had loops)
- -convert-to-llvmir was changed to -lower-to-llvm at some point, but
the
create pass method name wasn't updated (this pass converts/lowers to
LLVM
dialect as opposed to LLVM IR). Fix this.
(If we prefer "convert", the cmd-line options could be changed to
"-convert-to-llvm/cfg" then.)
Signed-off-by: Uday Bondhugula <uday@polymagelabs.com>
Closes tensorflow/mlir#115
PiperOrigin-RevId: 266666909
The file was modifiedmlir/test/mlir-cpu-runner/simple.mlir
The file was modifiedmlir/tools/mlir-cpu-runner/CMakeLists.txt
The file was modifiedmlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVMPass.h
The file was modifiedmlir/include/mlir/Conversion/ControlFlowToCFG/ConvertControlFlowToCFG.h
The file was modifiedmlir/bindings/python/pybind.cpp
The file was modifiedmlir/lib/Conversion/ControlFlowToCFG/ConvertControlFlowToCFG.cpp
The file was modifiedmlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp
The file was modifiedmlir/lib/Support/JitRunner.cpp
Commit 8ce2274d0d29cfd77d531ae0b3085ade5285dc4b by gardener
Add a convenient `clone()` method on the `Op` class that forward to the
underlying `Operation` (NFC)
PiperOrigin-RevId: 266685852
The file was modifiedmlir/include/mlir/IR/OpDefinition.h
The file was modifiedmlir/include/mlir/IR/Operation.h
Commit ce702fc8dafab9d8d0db4e61025c65db979cd701 by gardener
Add a `getUsedValuesDefinedAbove()` overload that takes an `Operation`
pointer (NFC)
This is a convenient utility around the existing
`getUsedValuesDefinedAbove()` that take two regions.
PiperOrigin-RevId: 266686854
The file was modifiedmlir/lib/Transforms/Utils/RegionUtils.cpp
The file was modifiedmlir/include/mlir/Transforms/RegionUtils.h
Commit 6563b1c4463472d5bdc83a3a62a1da1a3052ce18 by gardener
Add a new dialect interface for the OperationFolder
`OpFolderDialectInterface`.
This interface will allow for providing hooks to interrop with operation
folding. The first hook, 'shouldMaterializeInto', will allow for
controlling which region to insert materialized constants into. The
folder will generally materialize constants into the top-level isolated
region, this allows for materializing into a lower level ancestor region
if it is more profitable/correct.
PiperOrigin-RevId: 266702972
The file was modifiedmlir/lib/Transforms/Utils/FoldUtils.cpp
The file was modifiedmlir/include/mlir/Transforms/FoldUtils.h
The file was modifiedmlir/test/Transforms/constant-fold.mlir
The file was modifiedmlir/lib/Transforms/Utils/GreedyPatternRewriteDriver.cpp
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/LowerToLoops.cpp
The file was modifiedmlir/test/lib/TestDialect/TestDialect.cpp
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/Fusion.cpp
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/Tiling.cpp
The file was modifiedmlir/test/lib/TestDialect/TestOps.td
The file was modifiedmlir/test/lib/Transforms/TestConstantFold.cpp
Commit 5c036e682d7cd5b7898242670ebfad7bb270ee35 by gardener
Refactor the pass manager to support operations other than
FuncOp/ModuleOp.
This change generalizes the structure of the pass manager to allow
arbitrary nesting pass managers for other operations, at any level. The
only user visible change to existing code is the fact that a PassManager
must now provide an MLIRContext on construction. A new class
`OpPassManager` has been added that represents a pass manager on a
specific operation type. `PassManager` will remain the top-level entry
point into the pipeline, with OpPassManagers being nested underneath.
OpPassManagers will still be implicitly nested if the operation type on
the pass differs from the pass manager. To explicitly build a pipeline,
the 'nest' methods on OpPassManager may be used:
// Pass manager for the top-level module. PassManager pm(ctx);
// Nest a pipeline operating on FuncOp. OpPassManager &fpm =
pm.nest<FuncOp>(); fpm.addPass(...);
// Nest a pipeline under the FuncOp pipeline that operates on
spirv::ModuleOp OpPassManager &spvModulePM = pm.nest<spirv::ModuleOp>();
// Nest a pipeline on FuncOps inside of the spirv::ModuleOp.
OpPassManager &spvFuncPM = spvModulePM.nest<FuncOp>();
To help accomplish this a new general OperationPass is added that
operates on opaque Operations. This pass can be inserted in a pass
manager of any type to operate on any operation opaquely. An example of
this opaque OperationPass is a VerifierPass, that simply runs the
verifier opaquely on the current operation.
/// Pass to verify an operation and signal failure if necessary. class
VerifierPass : public OperationPass<VerifierPass> {
void runOnOperation() override {
   Operation *op = getOperation();
   if (failed(verify(op)))
     signalPassFailure();
   markAllAnalysesPreserved();
}
};
PiperOrigin-RevId: 266840344
The file was modifiedmlir/lib/Pass/Pass.cpp
The file was modifiedmlir/test/Pass/pass-timing.mlir
The file was modifiedmlir/include/mlir/Pass/Pass.h
The file was modifiedmlir/examples/Linalg/Linalg1/include/linalg1/Common.h
The file was modifiedmlir/examples/toy/Ch4/toyc.cpp
The file was modifiedmlir/lib/Pass/PassDetail.h
The file was modifiedmlir/lib/Support/JitRunner.cpp
The file was modifiedmlir/lib/Pass/IRPrinting.cpp
The file was modifiedmlir/bindings/python/pybind.cpp
The file was modifiedmlir/examples/Linalg/Linalg4/Example.cpp
The file was modifiedmlir/include/mlir/Pass/PassManager.h
The file was modifiedmlir/lib/Support/MlirOptMain.cpp
The file was modifiedmlir/tools/mlir-cuda-runner/mlir-cuda-runner.cpp
The file was modifiedmlir/g3doc/Tutorials/Toy/Ch-4.md
The file was modifiedmlir/examples/Linalg/Linalg3/Example.cpp
The file was modifiedmlir/examples/toy/Ch5/toyc.cpp
The file was modifiedmlir/lib/Pass/PassTiming.cpp
Commit c05890e890da37d9671169725c867ed0ca1e0b9d by gardener
Enable OwningRewritePatternList insert overload with parameter pack only
when there is at least one template pattern type
Also remove the other insert overload with pattern pointer as there are
no existing users nor any potential known use-case.
PiperOrigin-RevId: 266842920
The file was modifiedmlir/include/mlir/IR/PatternMatch.h
Commit 2acd0dbf05aac71dca030ba6a4141e68ca509916 by gardener
Add Select operation to SPIR-V dialect.
The SelectOp models the semantics of OpSelect from SPIR-V spec.
PiperOrigin-RevId: 266849559
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVLogicalOps.td
The file was modifiedmlir/test/Dialect/SPIRV/arithmetic-ops.mlir
The file was modifiedmlir/test/Dialect/SPIRV/ops.mlir
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVOps.cpp
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVBase.td
The file was addedmlir/test/Dialect/SPIRV/Serialization/select.mlir
Commit da646505c5bc5f03252c7a83bbeb890e5b3a19fa by gardener
Support bf16 in Builder::getZeroAttr
PiperOrigin-RevId: 266863802
The file was modifiedmlir/lib/IR/Builders.cpp
Commit c335d9d3137b9db6c17b7cdbf45ddf80f651c6c1 by gardener
LLVM dialect: prefix auxiliary operations with "mlir."
Some of the operations in the LLVM dialect are required to model the
LLVM IR in MLIR, for example "constant" operations are needed to declare
a constant value since MLIR, unlike LLVM, does not support immediate
values as operands.  To avoid confusion with actual LLVM operations, we
prefix such axuiliary operations with "mlir.".
PiperOrigin-RevId: 266942838
The file was modifiedmlir/test/LLVMIR/convert-funcs.mlir
The file was modifiedmlir/test/LLVMIR/convert-memref-ops.mlir
The file was modifiedmlir/test/LLVMIR/global.mlir
The file was modifiedmlir/test/LLVMIR/roundtrip.mlir
The file was modifiedmlir/lib/Target/LLVMIR/ModuleTranslation.cpp
The file was modifiedmlir/test/Conversion/VectorToLLVM/vector-to-llvm.mlir
The file was modifiedmlir/test/Examples/Linalg/Linalg1.mlir
The file was modifiedmlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
The file was modifiedmlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
The file was modifiedmlir/g3doc/Dialects/LLVM.md
The file was modifiedmlir/g3doc/Tutorials/Toy/Ch-5.md
The file was modifiedmlir/test/Conversion/GPUToCUDA/lower-launch-func-to-cuda.mlir
The file was modifiedmlir/test/LLVMIR/convert-to-llvmir.mlir
The file was modifiedmlir/include/mlir/Target/LLVMIR/ModuleTranslation.h
The file was modifiedmlir/test/Conversion/GPUToCUDA/insert-cubin-getter.mlir
The file was modifiedmlir/g3doc/ConversionToLLVMDialect.md
The file was modifiedmlir/test/Linalg/llvm.mlir
The file was modifiedmlir/test/Target/llvmir.mlir
Commit 6eb910a59c05b694166cf082634ee0ad35da4079 by gardener
Remove unused variables
Remove unused variables and attributes from BaseViewConversionHelper on
mlir/lib/Dialect/Linalg/Transforms/LowerToLLVMDialect.cpp
Closes tensorflow/mlir#116
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/116
from alexst07:fix-warnings 5f638e4677492cf71a9cc040eeb6b57427d32e06
PiperOrigin-RevId: 266972082
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/LowerToLLVMDialect.cpp
Commit 61ee7d640c5a8ebe555385889b30e1b8ffb64961 by gardener
Fix an invalid assert when processing escaped strings.
The assert assumed that the escaped character could not appear at the
end of the string.
Fixes tensorflow/mlir#117
PiperOrigin-RevId: 266975471
The file was modifiedmlir/lib/Parser/Token.cpp
The file was modifiedmlir/test/IR/parser.mlir
Commit 2a55998f7cd5ff13fb9bc9bc929fcdb2e72934e4 by gardener
  Add information about the SIG + Open Design meetings to the README.
PiperOrigin-RevId: 266978247
The file was modifiedmlir/README.md
Commit b1ef9dc22c067599cdb5832c05ad852f07716543 by gardener
Fix affine data copy generation corner cases/bugs
- the [begin, end) range identified for copying could end in between the
block, which makes hoisting invalid in some cases. Change the range
identification to always end with end of block.
- add test case to exercise these (with fast mem capacity set to minimal
so
that single element memref buffers are generated at the innermost loop)
- the location of begin/end of the block range for data copying was
being confused with the insert points for copy in and copy out code.
In cases, where we choose to hoist transfers, these are separate.
- when copy loops are single iteration ones, promote their bodies at
the end of the pass.
- change default fast mem space to 1 (setting it to zero made it
generate DMA op's that won't verify in the default case - since the
DMA ops have a check for src/dest memref spaces being different).
Signed-off-by: Uday Bondhugula <uday@polymagelabs.com> Co-Authored-By:
Mehdi Amini <joker.eph@gmail.com>
Closes tensorflow/mlir#88
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/88
from bondhugula:datacopy 88697267c45e850c3ced87671e16e4a930c02a42
PiperOrigin-RevId: 266980911
The file was modifiedmlir/lib/Transforms/AffineDataCopyGeneration.cpp
The file was modifiedmlir/test/Transforms/affine-data-copy.mlir
Commit 5593e005c676609c4b9bbf332fe894784d98d09f by gardener
Add folding rule and dialect materialization hook for spv.constant
This will allow us to use MLIR's folding infrastructure to deduplicate
SPIR-V constants.
This CL also changed isValidSPIRVType in SPIRVDialect to a static
method.
PiperOrigin-RevId: 266984403
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVTypes.h
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVDialect.h
The file was modifiedmlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.cpp
The file was modifiedmlir/test/Dialect/SPIRV/structure-ops.mlir
The file was modifiedmlir/include/mlir/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.h
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVStructureOps.td
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVDialect.cpp
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVOps.cpp
The file was modifiedmlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp
The file was addedmlir/test/Dialect/SPIRV/canonicalize.mlir
Commit 54d674f51e525e9186dc1f7d7df1b4d8e757e4ad by gardener
Utility to normalize memrefs with non-identity layout maps
- introduce utility to convert memrefs with non-identity layout maps to
ones with identity layout maps: convert the type and rewrite/remap all
its uses
- add this utility to -simplify-affine-structures pass for testing
purposes
Signed-off-by: Uday Bondhugula <uday@polymagelabs.com>
Closes tensorflow/mlir#104
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/104
from bondhugula:memref-normalize
f2c914aa1890e8860326c9e33f9aa160b3d65e6d PiperOrigin-RevId: 266985317
The file was modifiedmlir/include/mlir/Transforms/Passes.h
The file was modifiedmlir/include/mlir/Analysis/AffineStructures.h
The file was modifiedmlir/lib/Transforms/Utils/Utils.cpp
The file was modifiedmlir/lib/Transforms/SimplifyAffineStructures.cpp
The file was modifiedmlir/lib/Analysis/AffineStructures.cpp
The file was addedmlir/test/Transforms/memref-normalize.mlir
The file was modifiedmlir/include/mlir/Transforms/Utils.h
Commit 0c8ad3aafb06a59e8642b085cb8abb5b13351ad3 by gardener
Properly clone Linalg ops with regions
This CL adds support for proper cloning of Linalg ops that have regions
(i.e. the generic linalg op). This is used to properly implement tiling
and fusion for such ops. Adequate tests are added.
PiperOrigin-RevId: 267027176
The file was modifiedmlir/include/mlir/Dialect/Linalg/IR/LinalgOps.h
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/Tiling.cpp
The file was modifiedmlir/include/mlir/Dialect/Linalg/IR/LinalgLibraryOps.td
The file was modifiedmlir/test/Linalg/fusion.mlir
The file was modifiedmlir/test/Linalg/tile.mlir
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/Fusion.cpp
Commit 7818a60e37c2cdbeb4b208b9da6e99efefc6267c by gardener
Mention clang-format in the developer guide
PiperOrigin-RevId: 267114122
The file was modifiedmlir/g3doc/DeveloperGuide.md
Commit 71d27dfc3b242158a46993e3e061e18940d81cf2 by gardener
Update the syntax of splat attribute in LLVM.md
The syntax for splat attributes changed, but was not updated in the
description of the LLVM dialect constant operations in LLVM.md.  Update
the document to use the correct syntax.  Also add a dialect roundtrip
test for such attribute, which was previously missing.
PiperOrigin-RevId: 267116305
The file was modifiedmlir/test/LLVMIR/roundtrip.mlir
The file was modifiedmlir/g3doc/Dialects/LLVM.md
Commit 2f13df13b0bb481702fc83eb50c273deadb55f20 by gardener
Add support for array-typed constants.
PiperOrigin-RevId: 267121729
The file was modifiedmlir/test/Target/llvmir.mlir
The file was modifiedmlir/lib/Target/LLVMIR/ModuleTranslation.cpp
Commit dfd06af562e93e767000e96c436846caea847c38 by gardener
Make GPU kernel outlining inline constants.
It is generally beneficial to pass less arguments to a kernel, so
cloning constants into the kernel is beneficial.
PiperOrigin-RevId: 267139084
The file was modifiedmlir/test/Dialect/GPU/outlining.mlir
The file was modifiedmlir/lib/Dialect/GPU/Transforms/KernelOutlining.cpp
Commit 639522950906446a4fb9a8d440c35509ba89259d by gardener
Move Linalg dialect tests to test/Dialect/Linalg
This was missing from the commit that moved the Linalg dialect to
lib/Dialect.
PiperOrigin-RevId: 267141176
The file was addedmlir/test/Dialect/Linalg/fusion.mlir
The file was addedmlir/test/Dialect/Linalg/invalid.mlir
The file was addedmlir/test/Dialect/Linalg/loops.mlir
The file was addedmlir/test/Dialect/Linalg/roundtrip.mlir
The file was addedmlir/test/Dialect/Linalg/llvm.mlir
The file was addedmlir/test/Dialect/Linalg/promote.mlir
The file was removedmlir/test/Linalg/tile_conv.mlir
The file was removedmlir/test/Linalg/roundtrip.mlir
The file was addedmlir/test/Dialect/Linalg/canonicalize.mlir
The file was removedmlir/test/Linalg/tile.mlir
The file was removedmlir/test/Linalg/invalid.mlir
The file was removedmlir/test/Linalg/llvm.mlir
The file was removedmlir/test/Linalg/canonicalize.mlir
The file was addedmlir/test/Dialect/Linalg/fusion-2-level.mlir
The file was addedmlir/test/Dialect/Linalg/tile_conv.mlir
The file was removedmlir/test/Linalg/fusion.mlir
The file was removedmlir/test/Linalg/fusion-2-level.mlir
The file was removedmlir/test/Linalg/loops.mlir
The file was removedmlir/test/Linalg/promote.mlir
The file was addedmlir/test/Dialect/Linalg/tile.mlir
Commit 8c9dc690eb5c02fff486147b0496ff523743a49a by gardener
pipeline-data-transfer: remove dead tag alloc's and improve test
coverage for replaceMemRefUsesWith / pipeline-data-transfer
- address remaining comments from PR tensorflow/mlir#87 for better test
coverage for
pipeline-data-transfer/replaceAllMemRefUsesWith
- remove dead tag allocs the same way they are removed for the replaced
buffers
Signed-off-by: Uday Bondhugula <uday@polymagelabs.com>
Closes tensorflow/mlir#106
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/106
from bondhugula:followup 9e868666d047e8d43e5f82f43e4093b838c710fa
PiperOrigin-RevId: 267144774
The file was modifiedmlir/lib/Transforms/Utils/Utils.cpp
The file was modifiedmlir/test/Transforms/pipeline-data-transfer.mlir
The file was modifiedmlir/lib/Transforms/AffineDataCopyGeneration.cpp
The file was modifiedmlir/lib/Transforms/PipelineDataTransfer.cpp
Commit 636bcbade07d7f4ba1545fd9cf09c08db5c8f23c by gardener
Make isIsolatedAbove robuster to invalid IR
This function is only called from the verifier.
PiperOrigin-RevId: 267145495
The file was modifiedmlir/lib/IR/Region.cpp
Commit c6f8adad8e752b26ed63d874779722e3e448e836 by gardener
Move LLVMIR dialect tests from test/LLVMIR to test/Dialect and
test/Conversion
This follows up on the recent restructuring that moved the dialects
under lib/Dialect and inter-dialect conversions to lib/Conversion.
Originally, the tests for both the LLVMIR dialect itself and the
conversion from Standard to LLVMIR dialect lived under test/LLVMIR.
This no longer reflects the code structure.  Move the tests to either
test/Dialect/LLVMIR or test/Conversion/StandardToLLVM depending on the
features they exercise.
PiperOrigin-RevId: 267159219
The file was removedmlir/test/LLVMIR/convert-to-llvmir.mlir
The file was addedmlir/test/Dialect/LLVMIR/global.mlir
The file was removedmlir/test/LLVMIR/roundtrip.mlir
The file was addedmlir/test/Conversion/StandardToLLVM/convert-to-llvmir.mlir
The file was removedmlir/test/LLVMIR/nvvm.mlir
The file was addedmlir/test/Dialect/LLVMIR/nvvm.mlir
The file was removedmlir/test/LLVMIR/terminator.mlir
The file was addedmlir/test/Conversion/StandardToLLVM/convert-argattrs.mlir
The file was removedmlir/test/LLVMIR/global.mlir
The file was addedmlir/test/Dialect/LLVMIR/invalid.mlir
The file was addedmlir/test/Conversion/StandardToLLVM/convert-memref-ops.mlir
The file was addedmlir/test/Conversion/StandardToLLVM/convert-funcs.mlir
The file was removedmlir/test/LLVMIR/convert-argattrs.mlir
The file was addedmlir/test/Dialect/LLVMIR/func.mlir
The file was removedmlir/test/LLVMIR/func.mlir
The file was removedmlir/test/LLVMIR/convert-funcs.mlir
The file was addedmlir/test/Dialect/LLVMIR/roundtrip.mlir
The file was removedmlir/test/LLVMIR/invalid.mlir
The file was addedmlir/test/Dialect/LLVMIR/terminator.mlir
The file was removedmlir/test/LLVMIR/convert-memref-ops.mlir
Commit b5652720c1f1be0a6b4d5cfb543f0c4efdae94a0 by gardener
Retain address space during MLIR > LLVM conversion.
PiperOrigin-RevId: 267206460
The file was modifiedmlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp
The file was addedmlir/test/Conversion/StandardToLLVM/standard-to-llvm.mlir
Commit 0369ed34cb334aca522a9b9be29437908939e749 by gardener
Updated StructAttr to use the struct name for StorageType and
ReturnType.
PiperOrigin-RevId: 267266687
The file was modifiedmlir/include/mlir/IR/OpBase.td
Commit cf26e5faf57bc57e1c58e0886092baf047990761 by gardener
Use transform function on llvm::Module in the ExecutionEngine
The refactoring of ExecutionEngine dropped the usage of the irTransform
function used to pass -O3 and other options to LLVM. As a consequence,
the proper optimizations do not kick in in LLMV-land.
This CL makes use of the transform function and allows producing avx512
instructions, on an internal example, when using:
`mlir-cpu-runner -dump-object-file=1 -object-filename=foo.o` combined
with `objdump -D foo.o`.
Assembly produced resembles:
```
   2b2e:       62 72 7d 48 18 04 0e    vbroadcastss (%rsi,%rcx,1),%zmm8
   2b35:       62 71 7c 48 28 ce       vmovaps %zmm6,%zmm9
   2b3b:       62 72 3d 48 a8 c9       vfmadd213ps %zmm1,%zmm8,%zmm9
   2b41:       62 f1 7c 48 28 cf       vmovaps %zmm7,%zmm1
   2b47:       62 f2 3d 48 a8 c8       vfmadd213ps %zmm0,%zmm8,%zmm1
   2b4d:       62 f2 7d 48 18 44 0e    vbroadcastss
0x4(%rsi,%rcx,1),%zmm0
   2b54:       01
   2b55:       62 71 7c 48 28 c6       vmovaps %zmm6,%zmm8
   2b5b:       62 72 7d 48 a8 c3       vfmadd213ps %zmm3,%zmm0,%zmm8
   2b61:       62 f1 7c 48 28 df       vmovaps %zmm7,%zmm3
   2b67:       62 f2 7d 48 a8 da       vfmadd213ps %zmm2,%zmm0,%zmm3
   2b6d:       62 f2 7d 48 18 44 0e    vbroadcastss
0x8(%rsi,%rcx,1),%zmm0
   2b74:       02
   2b75:       62 f2 7d 48 a8 f5       vfmadd213ps %zmm5,%zmm0,%zmm6
   2b7b:       62 f2 7d 48 a8 fc       vfmadd213ps %zmm4,%zmm0,%zmm7
``` etc.
Fixes tensorflow/mlir#120
PiperOrigin-RevId: 267281097
The file was modifiedmlir/lib/ExecutionEngine/ExecutionEngine.cpp
Commit 33ac6f043b11712c8ce25573d1dd9abf88b826b7 by gardener
Generalize I32ElementsAttr definition and introduce I64ElementsAttr
Also, fix constBuilderCall to return attribute of the storage class
DenseIntElementsAttr
PiperOrigin-RevId: 267305813
The file was modifiedmlir/test/mlir-tblgen/pattern.mlir
The file was modifiedmlir/test/lib/TestDialect/TestOps.td
The file was modifiedmlir/include/mlir/IR/OpBase.td
Commit 7eb25cd367c1bf43a04e72ccde5ba4f84121c76f by gardener
Make GPU kernel outlining test independent of value names.
PiperOrigin-RevId: 267323604
The file was modifiedmlir/test/Dialect/GPU/outlining.mlir
Commit 0ba00878876316a43c7e7c38a30439adca9d5774 by gardener
Add the initial inlining infrastructure.
This defines a set of initial utilities for inlining a region(or a
FuncOp), and defines a simple inliner pass for testing purposes. A new
dialect interface is defined, DialectInlinerInterface, that allows for
dialects to override hooks controlling inlining legality. The interface
currently provides the following hooks, but these are just premilinary
and should be changed/added to/modified as necessary:
* isLegalToInline
- Determine if a region can be inlined into one of this dialect, *or*
if an operation of this dialect can be inlined into a given region.
* shouldAnalyzeRecursively
- Determine if an operation with regions should be analyzed recursively
for legality. This allows for child operations to be closed off from the
legality checks for operations like lambdas.
* handleTerminator
- Process a terminator that has been inlined.
This cl adds support for inlining StandardOps, but other dialects will
be added in followups as necessary.
PiperOrigin-RevId: 267426759
The file was addedmlir/test/Transforms/inlining.mlir
The file was addedmlir/include/mlir/Transforms/InliningUtils.h
The file was modifiedmlir/test/lib/Transforms/CMakeLists.txt
The file was modifiedmlir/test/lib/TestDialect/TestDialect.cpp
The file was addedmlir/test/lib/Transforms/TestInlining.cpp
The file was modifiedmlir/lib/Dialect/StandardOps/Ops.cpp
The file was modifiedmlir/test/lib/TestDialect/TestOps.td
The file was modifiedmlir/lib/Transforms/Utils/CMakeLists.txt
The file was addedmlir/lib/Transforms/Inliner.cpp
The file was modifiedmlir/lib/Transforms/CMakeLists.txt
The file was addedmlir/test/Transforms/test-inlining.mlir
The file was addedmlir/lib/Transforms/Utils/InliningUtils.cpp
Commit 916eb980b09a3c5303aa2e700eb6fc234c043ce6 by gardener
[spirv] Add spv.loop
SPIR-V can explicitly declare structured control-flow constructs using
merge instructions. These explicitly declare a header block before the
control flow diverges and a merge block where control flow subsequently
converges. These blocks delimit constructs that must nest, and can only
be entered and exited in structured ways.
Instead of having a `spv.LoopMerge` op to directly model loop merge
instruction for indicating the merge and continue target, we use regions
to delimit the boundary of the loop: the merge target is the next op
following the `spv.loop` op and the continue target is the block that
has a back-edge pointing to the entry block inside the `spv.loop`'s
region. This way it's easier to discover all blocks belonging to a
construct and it plays nicer with the MLIR system.
Updated the SPIR-V.md doc.
PiperOrigin-RevId: 267431010
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVBase.td
The file was modifiedmlir/g3doc/Dialects/SPIR-V.md
The file was modifiedmlir/test/Dialect/SPIRV/control-flow-ops.mlir
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVOps.cpp
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVControlFlowOps.td
Commit 85bc4889b34a954a61d3509349954fcef34fa7b6 by gardener
Add support for conservatively inlining Affine operations.
This commit defines an initial implementation of the
DialectInlinerInterface for the AffineOps dialect. This change allows
for affine operations to be inlined into any region that is not an
affine region. Inlining into affine regions requires special handling
for dimension/symbol identifiers that will be added in followups.
PiperOrigin-RevId: 267467078
The file was modifiedmlir/lib/Dialect/AffineOps/AffineOps.cpp
The file was addedmlir/test/AffineOps/inlining.mlir
Commit 854a384f509fb198fc82c0440b82a7f8c21d73fb by gardener
Integer set + operands / affine if op canonicalization
- turn canonicalizeMapAndOperands into a template that works on both
sets and maps, and use it to introduce a utility to canonicalize an
affine integer set and its operands
- add pattern to canonicalize affine if op's.
- rename IntegerSet::getNumOperands -> IntegerSet::getNumInputs to be
consistent with AffineMap
- add missing accessors for IntegerSet
Doesn't need extensive testing since canonicalizeSetAndOperands just
reuses canonicalizeMapAndOperands' logic, and the latter is tested on
affine.apply map + operands; the new method works the same way on an
integer set + operands of an affine if op for example.
Signed-off-by: Uday Bondhugula <uday@polymagelabs.com>
Closes tensorflow/mlir#112
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/112
from bondhugula:set-canonicalize
eff72f23250b96fa7d9f5caff3877440f5de2cec PiperOrigin-RevId: 267532876
The file was modifiedmlir/include/mlir/Dialect/AffineOps/AffineOps.h
The file was modifiedmlir/lib/Analysis/AffineStructures.cpp
The file was modifiedmlir/include/mlir/IR/IntegerSet.h
The file was modifiedmlir/test/AffineOps/canonicalize.mlir
The file was modifiedmlir/lib/IR/IntegerSet.cpp
The file was modifiedmlir/include/mlir/Dialect/AffineOps/AffineOps.td
The file was modifiedmlir/lib/Dialect/AffineOps/AffineOps.cpp
Commit 5b62a2ac6d1685d56ae7c4c15ccc035b2168dcc2 by gardener
Fix typos in Interfaces.md
PiperOrigin-RevId: 267548530
The file was modifiedmlir/g3doc/Interfaces.md
Commit 1b8eff8fcd80fa40792d24953373b54e6da1305f by gardener
Simplify Linalg ABI integration with external function calls.
View descriptors are converted to *pointer to* LLVM struct to avoid ABI
issues related to C struct packing. This creates unnecessary complexity
and hampers unification with memrefs. Instead, this CL makes view
descriptors convert to LLVM struct (as it was originally) and promotes
all structs to pointers right before calling an external function.
PiperOrigin-RevId: 267602693
The file was modifiedmlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h
The file was modifiedmlir/test/Dialect/Linalg/llvm.mlir
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/LowerToLLVMDialect.cpp
Commit 8154370b49b3de5276622d0e65c73a5a0f17f56d by gardener
Add custom builder for AffineIfOp
Closes tensorflow/mlir#109
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/109
from nmostafa:nmostafa/AffineIfOp
7dbf2115f0092ffab26381ea8704aa05a0253971 PiperOrigin-RevId: 267633077
The file was modifiedmlir/include/mlir/Dialect/AffineOps/AffineOps.td
The file was modifiedmlir/test/EDSC/builder-api-test.cpp
The file was modifiedmlir/lib/Dialect/AffineOps/AffineOps.cpp
The file was modifiedmlir/include/mlir/EDSC/Intrinsics.h
Commit b78410fd81625653c1706df7085bf69d26e59f3f by gardener
Restrict affine inlining to just Function operations.
The current restrictions on dim/symbols require a top-level symbol for
the conservative case of a non-affine region. This should be relaxed in
the future.
PiperOrigin-RevId: 267641838
The file was modifiedmlir/lib/Dialect/AffineOps/AffineOps.cpp
Commit 06398f32f61dd1ee52853ea1a5d1c863a402ac5b by gardener
Fix typo in the documentation for tensor_cast (NFC)
PiperOrigin-RevId: 267650411
The file was modifiedmlir/include/mlir/Dialect/StandardOps/Ops.td
Commit 6e5d1b9d62c91d9c0358be88310bc20949168508 by gardener
Add doc for declarative rewrite rules
This doc serves as a manual for table-driven declarative rewrite rules.
It lists all the details regarding supported mechanisms.
PiperOrigin-RevId: 267761702
The file was addedmlir/g3doc/DeclarativeRewrites.md
The file was modifiedmlir/g3doc/OpDefinitions.md
Commit 53bb528b192a3c965e37f0ca4ac480f8db956070 by gardener
Wrap debug dump in LLVM_DEBUG
PiperOrigin-RevId: 267774506
The file was modifiedmlir/lib/ExecutionEngine/ExecutionEngine.cpp
Commit 713ab0dde796f65e6289f9af1f3fe279d17554d0 by gardener
Set mlir-cpu-runner JIT codegen opt level correctly
- the JIT codegen was being run at the default -O0 level; instead,
propagate the opt level from the cmd line.
Signed-off-by: Uday Bondhugula <uday@polymagelabs.com>
Closes tensorflow/mlir#123
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/123
from bondhugula:jit-runner 3b055e47f94c9a48bf487f6400787478738cda02
PiperOrigin-RevId: 267778586
The file was modifiedmlir/lib/Support/JitRunner.cpp
The file was modifiedmlir/include/mlir/ExecutionEngine/ExecutionEngine.h
The file was modifiedmlir/lib/ExecutionEngine/ExecutionEngine.cpp
Commit 6443583bfd9ca8d1934c5ab240dc11b44c7cc0d4 by gardener
Refactor getUsedValuesDefinedAbove to expose a variant taking a callback
(NFC)
This will allow clients to implement a different collection strategy on
these values, including collecting each uses within the region for
example.
PiperOrigin-RevId: 267803978
The file was modifiedmlir/include/mlir/Transforms/RegionUtils.h
The file was modifiedmlir/lib/Transforms/Utils/RegionUtils.cpp
Commit cbb6f09ce8416e8752dffe17641400b547eb71ca by gardener
Use "final" instead of marking method virtual in override (NFC)
This is the only example for overriding this interface in the repo,
let's try to make it right as it may be taken as a reference when
implemented in other dialects
PiperOrigin-RevId: 267811123
The file was modifiedmlir/test/lib/TestDialect/TestDialect.cpp
Commit 120509a6b22b7532849e22c093b912ef4a1d0c73 by gardener
Refactor PassTiming to support nested pipelines.
This is done via a new set of instrumentation hooks
runBeforePipeline/runAfterPipeline, that signal the lifetime of a pass
pipeline on a specific operation type. These hooks also provide the
parent thread of the pipeline, allowing for accurate merging of timers
running on different threads.
PiperOrigin-RevId: 267909193
The file was modifiedmlir/test/lib/CMakeLists.txt
The file was modifiedmlir/lib/Pass/PassTiming.cpp
The file was modifiedmlir/lib/Pass/Pass.cpp
The file was modifiedmlir/tools/mlir-opt/CMakeLists.txt
The file was modifiedmlir/include/mlir/Pass/PassInstrumentation.h
The file was modifiedmlir/test/Pass/pass-timing.mlir
The file was addedmlir/test/lib/Pass/TestPassManager.cpp
The file was modifiedmlir/lib/Pass/PassDetail.h
The file was addedmlir/test/lib/Pass/CMakeLists.txt
Commit 42b60d34fc3dfbad2b26568cf1cd903685df3a3e by gardener
Add `parseGenericOperation()` to the OpAsmParser
This method parses an operation in its generic form, from the current
parser state. This is the symmetric of OpAsmPrinter::printGenericOp().
An immediate use case is illustrated in the test dialect, where an
operation wraps another one in its region and makes use of a single-line
pretty-print form.
PiperOrigin-RevId: 267930869
The file was modifiedmlir/lib/Parser/Parser.cpp
The file was addedmlir/test/IR/wrapping_op.mlir
The file was modifiedmlir/test/lib/TestDialect/TestOps.td
The file was modifiedmlir/include/mlir/IR/OpImplementation.h
The file was modifiedmlir/test/lib/TestDialect/TestDialect.cpp
Commit 318ff019cf703ece10df791b2da8307f3248baee by gardener
Addressing some late review comments on kernel inlining.
Just formatting and better lit tests, no functional change.
PiperOrigin-RevId: 267942907
The file was modifiedmlir/lib/Dialect/GPU/Transforms/KernelOutlining.cpp
The file was modifiedmlir/test/Dialect/GPU/outlining.mlir
Commit e702875d16b58601bdc05d1d51e33105e0b03b0d by gardener
Add support for coalescing adjacent nested pass pipelines.
This allows for parallelizing across pipelines of multiple operation
types. AdaptorPasses can now hold pass managers for multiple operation
types and will dispatch based upon the operation being operated on.
PiperOrigin-RevId: 268017344
The file was modifiedmlir/lib/Pass/Pass.cpp
The file was modifiedmlir/lib/Pass/PassTiming.cpp
The file was modifiedmlir/lib/Pass/PassDetail.h
The file was modifiedmlir/include/mlir/Pass/PassManager.h
The file was modifiedmlir/test/Pass/pass-timing.mlir
Commit 5e65dafbfa8e996a13d38b064a1aa3e9986d05bf by gardener
Add warpsize and laneid intrinsics to NVVM dialect.
PiperOrigin-RevId: 268041263
The file was modifiedmlir/test/Target/nvvmir.mlir
The file was modifiedmlir/include/mlir/Dialect/LLVMIR/NVVMOps.td
Commit 36508528c71606341af77ab755ecf63d9c09249b by gardener
Overload LLVM::TerminatorOp::build() for empty operands list.
PiperOrigin-RevId: 268041584
The file was modifiedmlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp
The file was modifiedmlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
Commit 893c86fff7efa87c8d81e6f6e7a200a0b3f7ece5 by gardener
Explicitly declare the OpPassManager move constructor to avoid undefined
errors.
Some compilers will try to auto-generate the destructor, instead of
using the user provided destructor, when creating a default move
constructor.
PiperOrigin-RevId: 268067367
The file was modifiedmlir/include/mlir/Pass/PassManager.h
The file was modifiedmlir/lib/Pass/Pass.cpp
Commit 27d776fa6d04e3ca47c42f5b9a90413c7243c35a by gardener
Convert per channel fake quant attributes to type
For per channel fake quant attributes, the returned type should be
UniformQuantizedPerAxisType. Currently, this method isn't under test
because we haven't added the quant_ConstFakeQuantPerAxis op and the
convert method.
PiperOrigin-RevId: 268084017
The file was modifiedmlir/include/mlir/Dialect/QuantOps/FakeQuantSupport.h
The file was modifiedmlir/lib/Dialect/QuantOps/Utils/FakeQuantSupport.cpp
Commit d3a6dbc0b895bdfdae3627c00d35066c4f51b032 by gardener
[NFC] Rename ExpressedToUniformQuantizedType to ExpressedToQuantizedType
PiperOrigin-RevId: 268090906
The file was modifiedmlir/lib/Dialect/QuantOps/Transforms/ConvertSimQuant.cpp
The file was modifiedmlir/include/mlir/Dialect/QuantOps/UniformSupport.h
The file was modifiedmlir/lib/Dialect/QuantOps/Utils/UniformSupport.cpp
Commit f4ae4762bf7d64d7ca46d05206955c9b44cedc49 by gardener
Add quant.const_fake_quant_per_axis op
Comparing to the existing quant.const_fake_quant op, the min and max
attributes of this new op is for each channel of last dimension of the
input.
PiperOrigin-RevId: 268093722
The file was modifiedmlir/test/Dialect/QuantOps/parse-ops.mlir
The file was modifiedmlir/include/mlir/Dialect/QuantOps/QuantOps.td
Commit 2660623a88d10df9ea7976d5e80704c5c7aab981 by gardener
Add pass generate per block in a function a GraphViz Dot graph with ops
as nodes
* Add GraphTraits that treat a block as a graph, Operation* as node and
use-relationship for edges;
- Just basic graph output;
* Add use iterator to iterate over all uses of an Operation;
* Add testing pass to generate op graph;
This does not support arbitrary operations other than function nor
nested regions yet.
PiperOrigin-RevId: 268121782
The file was addedmlir/lib/Transforms/ViewOpGraph.cpp
The file was addedmlir/include/mlir/Transforms/ViewOpGraph.h
The file was modifiedmlir/lib/IR/Operation.cpp
The file was modifiedmlir/lib/Transforms/CMakeLists.txt
The file was modifiedmlir/include/mlir/IR/Operation.h
Commit af27f4c74665030889176596d65690bb768f3adc by gardener
Avoid sign-compare warning
PiperOrigin-RevId: 268132321
The file was modifiedmlir/unittests/TableGen/StructsGenTest.cpp
Commit a23f69a37b33a627bf37acc8438883043041980e by gardener
Remove redundant qualification
Address GCC error: extra qualification not allowed [-fpermissive]
PiperOrigin-RevId: 268133737
The file was modifiedmlir/lib/Transforms/ViewOpGraph.cpp
Commit 277b6136ee78e621a1737e35956d1a9317ff096d by gardener
Remove unused variable
PiperOrigin-RevId: 268173638
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/LowerToLLVMDialect.cpp
Commit c68d5467d604d2b1e06a704133370f51a99df11d by gardener
Convert ConstFakeQuantPerAxis to qcast and dcast pair
This is also to add the test to the fakeQuantAttrsToType for per-channel
fake quant.
PiperOrigin-RevId: 268260032
The file was modifiedmlir/lib/Dialect/QuantOps/Utils/FakeQuantSupport.cpp
The file was modifiedmlir/test/Dialect/QuantOps/convert-fakequant.mlir
The file was modifiedmlir/lib/Dialect/QuantOps/Transforms/ConvertSimQuant.cpp
Commit cf0a7823390818273892a3be5820c09403a15ec7 by gardener
Remove the constraint that min / max should stride zero
Since we apply nudging for the zero point to make sure the nudged zerop
points can be in the range of [qmin, qmax], the constraint that rmin /
rmax should stride zero isn't necessary.
This also matches the documentation of tensorflow's
FakeQuantWithMinMaxArgs op, where min and max don't need to stride zero:
https://www.tensorflow.org/api_docs/python/tf/quantization/fake_quant_with_min_max_args
PiperOrigin-RevId: 268296285
The file was modifiedmlir/test/Dialect/QuantOps/convert-fakequant.mlir
The file was modifiedmlir/test/Dialect/QuantOps/convert-fakequant-invalid.mlir
The file was modifiedmlir/lib/Dialect/QuantOps/Utils/FakeQuantSupport.cpp
Commit ee8cbccacfc8755d1692ff64ad98876917a08b30 by gardener
Add folding rule for spv.CompositeExtract
If the composite is a constant, we can fold it away. This only supports
vector and array constants for now, given that struct constant is not
supported in spv.constant yet.
PiperOrigin-RevId: 268350340
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVOps.td
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVOps.cpp
The file was modifiedmlir/test/Dialect/SPIRV/canonicalize.mlir
Commit d732aaf2cb24b1b759adc9dccd34e0a3b18fef13 by gardener
Don't leak TargetMachine in ExecutionEngine::setupTargetTriple
PiperOrigin-RevId: 268361054
The file was modifiedmlir/lib/ExecutionEngine/ExecutionEngine.cpp
Commit 6f8321f06f0772676e42bc93feca7605a8feb8ea by gardener
Fix a typo in comments. The Inequality and Equality explanations were
apparently reversed.
PiperOrigin-RevId: 268395163
The file was modifiedmlir/include/mlir/Analysis/AffineStructures.h
Commit bc9b52f2ed71ee938f30591b8b6c6f549f53fc88 by gardener
Add logical groups to NVVM op definitions.
PiperOrigin-RevId: 268436116
The file was modifiedmlir/include/mlir/Dialect/LLVMIR/NVVMOps.td
Commit 9037f28cb4e19d311478dbe2596edda64c37f5af by gardener
Fix typos in SDBMTest.cpp
PiperOrigin-RevId: 268443146
The file was modifiedmlir/unittests/SDBM/SDBMTest.cpp
Commit e15356f8edab9ce4b4edbaf2e988d6b38adb59cc by gardener
Rename SDBMPositiveExpr to SDBMTermExpr
This better reflects how this kind of expressions is used and avoids the
potential confusion since the expression can take negative values.  Term
expressions comprise dimensions, symbols and stripe expressions.  In an
SDBM domain, a stripe expression always corresponds to a variable, input
or temporary.  This expression can appear anywhere an input variable
can, including on the LHS of other stripe expressions.
PiperOrigin-RevId: 268486066
The file was modifiedmlir/lib/Dialect/SDBM/SDBMExprDetail.h
The file was modifiedmlir/lib/Dialect/SDBM/SDBMExpr.cpp
The file was modifiedmlir/include/mlir/Dialect/SDBM/SDBM.h
The file was modifiedmlir/include/mlir/Dialect/SDBM/SDBMExpr.h
The file was modifiedmlir/unittests/SDBM/SDBMTest.cpp
The file was modifiedmlir/lib/Dialect/SDBM/SDBM.cpp
Commit a84bc68accc5103621df3b1661153c419ecafed7 by gardener
[spirv] Add support for spv.loop (de)serialization
This CL adds support for serializing and deserializing spv.loop ops.
This adds support for spv.Branch and spv.BranchConditional op
(de)serialization, too, because they are needed for spv.loop.
PiperOrigin-RevId: 268536962
The file was addedmlir/test/Dialect/SPIRV/Serialization/loop.mlir
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVControlFlowOps.td
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/Deserializer.cpp
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/Serializer.cpp
The file was modifiedmlir/lib/IR/Function.cpp
The file was modifiedmlir/include/mlir/IR/Function.h
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVOps.cpp
Commit f39a599e46de8ea1c18e30216df516d22395df2f by gardener
NFC: Clean up constant fold tests
Use variable captures to make constant folding tests less sensitive to
printer/parser implementation details.
See guidelines at
https://github.com/tensorflow/mlir/blob/master/g3doc/TestingGuide.md
PiperOrigin-RevId: 268780812
The file was modifiedmlir/test/Transforms/constant-fold.mlir
Commit 2ccbb3f1ceeb326309c0685305d1dfd38d5dbcc2 by gardener
Cmpf constant folding for nan and inf
PiperOrigin-RevId: 268783645
The file was modifiedmlir/test/Transforms/constant-fold.mlir
The file was modifiedmlir/lib/Dialect/StandardOps/Ops.cpp
Commit 1854c64c7cc57e9fe44404578408f732f58b9715 by gardener
Log name of the generated illegal operation name in DialectConversion
debug mode
PiperOrigin-RevId: 268859399
The file was modifiedmlir/lib/Transforms/DialectConversion.cpp
Commit 6cce275301d196a1033c84c7f48df5e8932c03f7 by gardener
Fixing typo in documentation.
PiperOrigin-RevId: 268877189
The file was modifiedmlir/g3doc/WritingAPass.md
Commit 70653ed6003ee39e59d7a8d72059ed798ef2e000 by gardener
NFC: Update comments about rank constraints
These refer to ranked tensors, but are actually applicable to any shaped
type
PiperOrigin-RevId: 268931789
The file was modifiedmlir/include/mlir/IR/OpBase.td
Commit 9274ed66ef30bf605b468ae1aba11363e879c930 by gardener
Refactor pass pipeline command line parsing to support explicit pipeline
strings.
This allows for explicitly specifying the pipeline to add to the pass
manager. This includes the nesting structure, as well as the
passes/pipelines to run. A textual pipeline string is defined as a
series of names, each of which may in itself recursively contain a
nested pipeline description. A name is either the name of a registered
pass, or pass pipeline, (e.g. "cse") or the name of an operation type
(e.g. "func").
For example, the following pipeline:
$ mlir-opt foo.mlir -cse -canonicalize -lower-to-llvm
Could now be specified as:
$ mlir-opt foo.mlir -pass-pipeline='func(cse, canonicalize),
lower-to-llvm'
This will allow for running pipelines on nested operations, like say
spirv modules. This does not remove any of the current functionality,
and in fact can be used in unison. The new option is available via
'pass-pipeline'.
PiperOrigin-RevId: 268954279
The file was modifiedmlir/include/mlir/Pass/PassRegistry.h
The file was addedmlir/test/Pass/pipeline-parsing.mlir
The file was modifiedmlir/tools/mlir-opt/mlir-opt.cpp
The file was modifiedmlir/lib/Pass/PassManagerOptions.cpp
The file was modifiedmlir/test/lib/Pass/TestPassManager.cpp
The file was modifiedmlir/lib/Support/MlirOptMain.cpp
The file was modifiedmlir/include/mlir/Support/MlirOptMain.h
The file was modifiedmlir/lib/Pass/PassRegistry.cpp
The file was modifiedmlir/include/mlir/Pass/PassManager.h
The file was modifiedmlir/lib/Pass/Pass.cpp
Commit d3787e58654c15f8bfacc3471eba056f34782055 by gardener
Improve verifier error reporting on type mismatch (NFC)
Before this change, it only reports expected type but not exact type, so
it's hard to troubleshoot.
PiperOrigin-RevId: 268961078
The file was modifiedmlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
Commit 8a1cdeb31bd56d6eb5182a3ca3e019ca9654ef39 by gardener
Forward diagnostics from untracked threads in ParallelDiagnosticHandler.
This allows for the use of multiple ParallelDiagnosticHandlers without
having them conflict with each other.
PiperOrigin-RevId: 268967407
The file was modifiedmlir/g3doc/Diagnostics.md
The file was modifiedmlir/lib/Pass/Pass.cpp
The file was modifiedmlir/lib/IR/Diagnostics.cpp
The file was modifiedmlir/include/mlir/IR/Diagnostics.h
Commit a260436714b35584bbc1cdd39834b5556b991178 by gardener
Add tablegen class for memrefs with rank constraints
PiperOrigin-RevId: 268968004
The file was modifiedmlir/test/mlir-tblgen/types.mlir
The file was modifiedmlir/include/mlir/IR/OpBase.td
The file was modifiedmlir/test/lib/TestDialect/TestOps.td
Commit f1b100c77ba005899c60f3dea74607d5daad3f52 by gardener
NFC: Finish replacing FunctionPassBase/ModulePassBase with OpPassBase.
These directives were temporary during the generalization of
FunctionPass/ModulePass to OpPass.
PiperOrigin-RevId: 268970259
The file was modifiedmlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp
The file was modifiedmlir/include/mlir/Conversion/ControlFlowToCFG/ConvertControlFlowToCFG.h
The file was modifiedmlir/include/mlir/Dialect/GPU/Passes.h
The file was modifiedmlir/lib/Transforms/Canonicalizer.cpp
The file was modifiedmlir/lib/Transforms/SimplifyAffineStructures.cpp
The file was modifiedmlir/lib/Conversion/GPUToCUDA/GenerateCubinAccessors.cpp
The file was modifiedmlir/lib/Quantizer/Transforms/RemoveInstrumentationPass.cpp
The file was modifiedmlir/lib/Analysis/MemRefBoundCheck.cpp
The file was modifiedmlir/lib/Conversion/VectorToLLVM/VectorToLLVM.cpp
The file was modifiedmlir/include/mlir/Dialect/QuantOps/Passes.h
The file was modifiedmlir/lib/Transforms/LowerVectorTransfers.cpp
The file was modifiedmlir/lib/Conversion/ControlFlowToCFG/ConvertControlFlowToCFG.cpp
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/Fusion.cpp
The file was modifiedmlir/lib/Quantizer/Transforms/InferQuantizedTypesPass.cpp
The file was modifiedmlir/lib/Quantizer/Transforms/AddDefaultStatsTestPass.cpp
The file was modifiedmlir/include/mlir/Conversion/GPUToCUDA/GPUToCUDAPass.h
The file was modifiedmlir/lib/Transforms/StripDebugInfo.cpp
The file was modifiedmlir/lib/Transforms/AffineDataCopyGeneration.cpp
The file was modifiedmlir/include/mlir/Analysis/Passes.h
The file was modifiedmlir/lib/Dialect/FxpMathOps/Transforms/LowerUniformRealMath.cpp
The file was modifiedmlir/lib/Transforms/ViewOpGraph.cpp
The file was modifiedmlir/include/mlir/Conversion/LoopsToGPU/LoopsToGPUPass.h
The file was modifiedmlir/lib/Dialect/GPU/Transforms/KernelOutlining.cpp
The file was modifiedmlir/test/lib/Transforms/TestLoopParametricTiling.cpp
The file was modifiedmlir/lib/Transforms/LoopUnroll.cpp
The file was modifiedmlir/lib/Transforms/LoopFusion.cpp
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/Tiling.cpp
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/LowerToLLVMDialect.cpp
The file was modifiedmlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp
The file was modifiedmlir/lib/Transforms/LoopUnrollAndJam.cpp
The file was modifiedmlir/lib/Conversion/GPUToCUDA/ConvertLaunchFuncToCudaCalls.cpp
The file was modifiedmlir/lib/Conversion/LoopsToGPU/LoopsToGPUPass.cpp
The file was modifiedmlir/tools/mlir-cuda-runner/mlir-cuda-runner.cpp
The file was modifiedmlir/include/mlir/Quantizer/Transforms/Passes.h
The file was modifiedmlir/lib/Dialect/QuantOps/Transforms/ConvertSimQuant.cpp
The file was modifiedmlir/test/lib/Transforms/TestVectorizationUtils.cpp
The file was modifiedmlir/lib/Transforms/CSE.cpp
The file was modifiedmlir/examples/Linalg/Linalg1/lib/ConvertToLLVMDialect.cpp
The file was modifiedmlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/LowerToLoops.cpp
The file was modifiedmlir/lib/Analysis/TestParallelismDetection.cpp
The file was modifiedmlir/lib/Transforms/MaterializeVectors.cpp
The file was modifiedmlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVMPass.h
The file was modifiedmlir/lib/Transforms/MemRefDataFlowOpt.cpp
The file was modifiedmlir/test/lib/Transforms/TestConstantFold.cpp
The file was modifiedmlir/examples/Linalg/Linalg1/include/linalg1/Passes.h
The file was modifiedmlir/lib/Conversion/GPUToCUDA/ConvertKernelFuncToCubin.cpp
The file was modifiedmlir/lib/Transforms/PipelineDataTransfer.cpp
The file was modifiedmlir/include/mlir/Conversion/VectorToLLVM/VectorToLLVM.h
The file was modifiedmlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRVPass.cpp
The file was modifiedmlir/include/mlir/Transforms/Passes.h
The file was modifiedmlir/lib/Transforms/LoopInvariantCodeMotion.cpp
The file was modifiedmlir/lib/Dialect/QuantOps/Transforms/ConvertConst.cpp
The file was modifiedmlir/include/mlir/Conversion/GPUToNVVM/GPUToNVVMPass.h
The file was modifiedmlir/examples/Linalg/Linalg3/lib/Transforms.cpp
The file was modifiedmlir/include/mlir/Pass/Pass.h
The file was modifiedmlir/include/mlir/Dialect/Linalg/Passes.h
The file was modifiedmlir/lib/Analysis/TestMemRefDependenceCheck.cpp
The file was modifiedmlir/lib/Transforms/LoopCoalescing.cpp
The file was modifiedmlir/examples/Linalg/Linalg3/include/linalg3/Transforms.h
The file was modifiedmlir/test/lib/Transforms/TestLoopFusion.cpp
The file was modifiedmlir/include/mlir/Dialect/FxpMathOps/Passes.h
The file was modifiedmlir/lib/Transforms/ViewRegionGraph.cpp
The file was modifiedmlir/lib/Transforms/LoopTiling.cpp
The file was modifiedmlir/include/mlir/Transforms/ViewOpGraph.h
The file was modifiedmlir/include/mlir/Transforms/ViewRegionGraph.h
The file was modifiedmlir/include/mlir/Dialect/SPIRV/Passes.h
The file was modifiedmlir/lib/Transforms/LowerAffine.cpp
The file was modifiedmlir/lib/Transforms/Vectorize.cpp
Commit 113aadddf99377d7205ef840b3292bbf55648d97 by gardener
Update SPIR-V symbols and use GLSL450 instead of VulkanKHR
SPIR-V recently publishes v1.5, which brings a bunch of symbols into
core. So the suffix "KHR"/"EXT"/etc. is removed from the symbols. We use
a script to pull information from the spec directly.
Also changed conversion and tests to use GLSL450 instead of VulkanKHR
memory model. GLSL450 is still the main memory model supported by Vulkan
shaders and it does not require extra capability to enable.
PiperOrigin-RevId: 268992661
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/execution_mode.mlir
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVBase.td
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/minimal-module.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/select.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/variables_init.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/entry.mlir
The file was modifiedmlir/test/Dialect/SPIRV/control-flow-ops.mlir
The file was modifiedmlir/test/Dialect/SPIRV/structure-ops.mlir
The file was modifiedmlir/test/Conversion/GPUToSPIRV/builtins.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/entry_interface.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/access_chain.mlir
The file was modifiedmlir/test/Dialect/SPIRV/ops.mlir
The file was modifiedmlir/test/Conversion/GPUToSPIRV/simple.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/variable_reference.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/array_stride.mlir
The file was modifiedmlir/lib/Conversion/GPUToSPIRV/GPUToSPIRV.cpp
The file was modifiedmlir/test/Conversion/GPUToSPIRV/load_store.mlir
The file was modifiedmlir/utils/spirv/gen_spirv_dialect.py
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/struct.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/variables.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/bin_ops.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/load_store.mlir
Commit efbd3e461017a471eece97ef4f8392c3ad092eab by gardener
Add type constraints for shaped types with same rank and element count
PiperOrigin-RevId: 269000237
The file was modifiedmlir/test/mlir-tblgen/types.mlir
The file was modifiedmlir/test/lib/TestDialect/TestOps.td
The file was modifiedmlir/include/mlir/IR/OpBase.td
Commit d780bdef2050f6485396e73220ec76455c563c17 by gardener
Publicly expose the functionality to parse a textual pass pipeline.
This allows for users other than those on the command line to apply a
textual description of a pipeline to a given pass manager.
PiperOrigin-RevId: 269017028
The file was modifiedmlir/include/mlir/Pass/PassRegistry.h
The file was modifiedmlir/lib/Pass/PassRegistry.cpp
The file was modifiedmlir/test/lib/Pass/TestPassManager.cpp
The file was modifiedmlir/test/Pass/pipeline-parsing.mlir
Commit 1e6a93b7cae61c777ec4ce06a5f6d7d2b81af0ea by gardener
add missing memref cast fold pattern for dim op
- add missing canonicalization pattern to fold memref_cast + dim to
dim (needed to propagate constant when folding a dynamic shape to
a static one)
- also fix an outdated/inconsistent comment in StandardOps/Ops.td
Signed-off-by: Uday Bondhugula <uday@polymagelabs.com>
Closes tensorflow/mlir#126
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/126
from bondhugula:quickfix 4566e75e49685c532faffff91d64c5d83d4da524
PiperOrigin-RevId: 269020058
The file was modifiedmlir/test/Transforms/canonicalize.mlir
The file was modifiedmlir/include/mlir/Dialect/StandardOps/Ops.td
The file was modifiedmlir/lib/Dialect/StandardOps/Ops.cpp
Commit 4e48beadbb45830f6ad45ee463a2159cdc8933a0 by gardener
Verify that ModuleOps only contain dialect specific attributes.
ModuleOp has no expected operations, so only dialect-specific attributes
are valid.
PiperOrigin-RevId: 269020062
The file was modifiedmlir/lib/IR/Module.cpp
The file was modifiedmlir/test/IR/invalid-module-op.mlir
Commit f2eb0f02fabae7d03f24d8112600b0137c8265ac by gardener
Add pattern to canonicalize for loop bounds
- add pattern to canonicalize affine.for loop bounds (using
canonicalizeMapAndOperands)
- rename AffineForLoopBoundFolder -> AffineForLoopBoundFolder for
consistency
Signed-off-by: Uday Bondhugula <uday@polymagelabs.com>
Closes tensorflow/mlir#111
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/111
from bondhugula:bound-canonicalize
ee8fb7f43a7ffd45f6df3f53c95098d8b7e494c7 PiperOrigin-RevId: 269041220
The file was modifiedmlir/examples/Linalg/Linalg3/Example.cpp
The file was modifiedmlir/examples/Linalg/Linalg4/Example.cpp
The file was modifiedmlir/test/AffineOps/canonicalize.mlir
The file was modifiedmlir/lib/Dialect/AffineOps/AffineOps.cpp
Commit aac8fa8c4770b142d095007b99a9276f75182172 by gardener
Update QuickstartRewrites.md regarding op definition and rewrites
This CL updates the doc with recent changes. It also adds a section on
registering and using the auto-generated patterns.
PiperOrigin-RevId: 269086830
The file was modifiedmlir/g3doc/QuickstartRewrites.md
Commit 2de18fb84df66e0850b1b66a4cc8a701e6bbe008 by gardener
NFC: Fix stray character in error message: 1 -> ' PiperOrigin-RevId:
269091468
The file was modifiedmlir/lib/IR/Module.cpp
Commit 018cfa94d963f2a62eeba15e84f101a108476b95 by gardener
Clean up build trip count analysis method - avoid mutating IR
- NFC - on any pass/utility logic/output.
- Resolve TODO; the method building loop trip count maps was
creating and deleting affine.apply ops (transforming IR from under
analysis!, strictly speaking). Introduce AffineValueMap::difference to
do this correctly (without the need to create any IR).
- Move AffineApplyNormalizer out so that its methods are reusable from
AffineStructures.cpp; add a helper method 'normalize' to it. Fix
AffineApplyNormalize::renumberOneDim (Issue tensorflow/mlir#89).
- Trim includes on files touched.
- add test case on a scenario previously not covered
Signed-off-by: Uday Bondhugula <uday@polymagelabs.com>
Closes tensorflow/mlir#133
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/133
from bondhugula:trip-count-build
7fc34d857f7788f98b641792cafad6f5bd50e47b PiperOrigin-RevId: 269101118
The file was modifiedmlir/lib/Dialect/AffineOps/AffineOps.cpp
The file was modifiedmlir/test/Transforms/unroll.mlir
The file was modifiedmlir/include/mlir/Analysis/AffineStructures.h
The file was modifiedmlir/lib/Analysis/LoopAnalysis.cpp
The file was modifiedmlir/include/mlir/Dialect/AffineOps/AffineOps.h
The file was modifiedmlir/lib/Analysis/AffineStructures.cpp
Commit 1366467a3ba9c489bbabe27f89cf6af404601149 by gardener
update normalizeMemRef utility; handle missing failure check + add more
tests
- take care of symbolic operands with alloc
- add missing check for compose map failure and a test case
- add test cases on strides
- drop incorrect check for one-to-one'ness
Signed-off-by: Uday Bondhugula <uday@polymagelabs.com>
Closes tensorflow/mlir#132
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/132
from bondhugula:normalize-memrefs
8aebf285fb0d7c19269d85255aed644657e327b7 PiperOrigin-RevId: 269105947
The file was modifiedmlir/test/Transforms/memref-normalize.mlir
The file was modifiedmlir/lib/Transforms/Utils/Utils.cpp
The file was modifiedmlir/include/mlir/Dialect/StandardOps/Ops.td
Commit 4f32ae61b4b75ee729ef9a43e4678d55d8deeef3 by gardener
NFC - Move explicit copy/dma generation utility out of pass and into
LoopUtils
- turn copy/dma generation method into a utility in LoopUtils, allowing
it to be reused elsewhere.
- no functional/logic change to the pass/utility
- trim down header includes in files affected
Signed-off-by: Uday Bondhugula <uday@polymagelabs.com>
Closes tensorflow/mlir#124
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/124
from bondhugula:datacopy 9f346e62e5bd9dd1986720a30a35f302eb4d3252
PiperOrigin-RevId: 269106088
The file was modifiedmlir/lib/Transforms/AffineDataCopyGeneration.cpp
The file was modifiedmlir/lib/Transforms/Utils/LoopUtils.cpp
The file was modifiedmlir/include/mlir/Transforms/LoopUtils.h
Commit 38e7226606d218bb4d7b7a5c1541c5d81ca0cf14 by gardener
Add convenience methods to create i8 and i16 attributes in Builder.
PiperOrigin-RevId: 269120226
The file was modifiedmlir/include/mlir/IR/Builders.h
The file was modifiedmlir/lib/IR/Builders.cpp
Commit cb1bcba69beeeb259eaf15d36892b1922046c525 by gardener
NFC: Merge OpPass with OperationPass into just OperationPass.
OperationPass' are defined exactly the same way as they are now:
  class DerivedPass :  public OperationPass<DerivedPass>;
OpPass' are now defined as OperationPass, but with an additional
template parameter for the operation type:
  class DerivedPass :  public OperationPass<DerivedPass, FuncOp>;
PiperOrigin-RevId: 269122410
The file was modifiedmlir/include/mlir/Pass/PassManager.h
The file was modifiedmlir/lib/Pass/Pass.cpp
The file was modifiedmlir/include/mlir/Pass/Pass.h
Commit bbe65b46f567021f2b77925ec2a1112b5fd1e1e1 by gardener
NFC: Pass PassInstrumentations by unique_ptr instead of raw pointer.
This makes the ownership model explicit, and removes potential user
errors.
PiperOrigin-RevId: 269122834
The file was modifiedmlir/g3doc/WritingAPass.md
The file was modifiedmlir/lib/Pass/PassTiming.cpp
The file was modifiedmlir/lib/Pass/IRPrinting.cpp
The file was modifiedmlir/lib/Pass/Pass.cpp
The file was modifiedmlir/include/mlir/Pass/PassManager.h
The file was modifiedmlir/include/mlir/Pass/PassInstrumentation.h
Commit d37777c440af424b5d5129c0f54326d89c7b6da6 by gardener
Update the IRPrinter instrumentation to work on non function/module
operations.
This is necessary now that the pass manager may work on different types
of operations.
PiperOrigin-RevId: 269139669
The file was modifiedmlir/g3doc/WritingAPass.md
The file was modifiedmlir/test/Pass/ir-printing.mlir
The file was modifiedmlir/lib/Pass/PassManagerOptions.cpp
The file was modifiedmlir/lib/Pass/IRPrinting.cpp
Commit bbc6d48d1c63827d8fc4557f4784a6225a6efc5c by gardener
NFC: Update the expected outputs of pass-timing.
The output of the pass timing instrumentation has been changed now that
the pass hierarchy has been generalized.
PiperOrigin-RevId: 269140277
The file was modifiedmlir/g3doc/WritingAPass.md
Commit f22011ccbad1a8a55260069d195a17d5ae275b41 by gardener
NFC: Update the PassInstrumentation section.
This section has grown stale as the pass infrastructure has been
generalized.
PiperOrigin-RevId: 269140863
The file was modifiedmlir/g3doc/WritingAPass.md
Commit 16eac9656082e3414cc29499ef55a3a6ed54b5cb by gardener
Fix typo in test/AffineOps/ops.mlir
Closes tensorflow/mlir#135
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/135
from bondhugula:patch-1 539a7f1b43d09ef539b2fd15875f8ac765600263
PiperOrigin-RevId: 269187507
The file was modifiedmlir/test/AffineOps/ops.mlir
Commit faaa1ced1002acef661cfd352c32c1cb86c22726 by gardener
Update the pass registration section and add a sub-section on the
textual pipeline specification.
Now that the pass manager is generalized, and nested/arbritrary
pipelines are possible, it is important to document how to specify these
types of pipelines from the command line.
PiperOrigin-RevId: 269207681
The file was modifiedmlir/g3doc/WritingAPass.md
Commit 9814b3fa0ddc497f215813ca261dc97214e53295 by gardener
Add mechanism to specify extended instruction sets in SPIR-V.
Add support for specifying extended instructions sets. The operations in
SPIR-V dialect are named as 'spv.<extension-name>.<op-name>'. Use this
mechanism to define a 'Exp' operation from GLSL(450) instructions. Later
CLs will add support for (de)serialization of these operations, and
update the dialect generation scripts to auto-generate the specification
using the spec directly.
Additional changes: Add a Type Constraint to OpBase.td to check for
vector of specified lengths. This is used to check that the vector type
used in SPIR-V dialect are of lengths 2, 3 or 4. Update SPIRVBase.td to
use this Type constraints for vectors.
PiperOrigin-RevId: 269234377
The file was addedmlir/include/mlir/Dialect/SPIRV/SPIRVGLSLOps.td
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVBase.td
The file was modifiedmlir/lib/Conversion/StandardToSPIRV/StandardToSPIRV.td
The file was modifiedmlir/lib/Dialect/SPIRV/CMakeLists.txt
The file was modifiedmlir/include/mlir/Dialect/SPIRV/CMakeLists.txt
The file was modifiedmlir/include/mlir/IR/OpBase.td
The file was addedmlir/lib/Dialect/SPIRV/SPIRVGLSLOps.cpp
The file was addedmlir/include/mlir/Dialect/SPIRV/SPIRVGLSLOps.h
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVDialect.cpp
The file was addedmlir/test/Dialect/SPIRV/glslops.mlir
Commit 6755dfdec9e4af64109d5767ad374d1d5fd2c95d by gardener
Drop makePositionAttr and the like in favor of Builder::getI64ArrayAttr
The helper functions makePositionAttr() and positionAttr() were
originally introduced in the lowering-to-LLVM-dialect pass to construct
integer array attributes that are used for static positions in
extract/insertelement. Constructing an integer array attribute being
fairly common, a utility function Builder::getI64ArrayAttr was later
introduced into the Builder API.  Drop makePositionAttr and similar
homegrown functions and use that API instead. PiperOrigin-RevId:
269295836
The file was modifiedmlir/lib/Conversion/VectorToLLVM/VectorToLLVM.cpp
The file was modifiedmlir/examples/Linalg/Linalg1/lib/ConvertToLLVMDialect.cpp
The file was modifiedmlir/examples/Linalg/Linalg3/lib/ConvertToLLVMDialect.cpp
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/LowerToLLVMDialect.cpp
Commit 1da0290c4b7c24d222d4f9d323f719c6707cb840 by gardener
Error out when kernel function is not found while translating GPU calls.
PiperOrigin-RevId: 269327909
The file was modifiedmlir/lib/Conversion/GPUToCUDA/ConvertLaunchFuncToCudaCalls.cpp
Commit 0ce64b0bf36198446721f2c9aaa3fee0b0abd98c by gardener
Unify how errors are emitted in LaunchFuncOp verification.
PiperOrigin-RevId: 269331869
The file was modifiedmlir/lib/Dialect/GPU/IR/GPUDialect.cpp
Commit e94db619d9727ba18732158996204e782be47d5d by gardener
Introduce SDBMDirect expression into the SDBM expression hierarchy
Direct expressions are those that do not negate any of the variables
they involve.  They include input expressions (dimensions and symbols),
stripe and sum expressions, and combinations of those.  Reifying direct
expressions as a class is a precondition for enabling additions on the
LHS of a stripe expression.
PiperOrigin-RevId: 269336031
The file was modifiedmlir/unittests/SDBM/SDBMTest.cpp
The file was modifiedmlir/include/mlir/Dialect/SDBM/SDBMExpr.h
Commit cb3ecb5291ad71c74cd9db7903fffc0ad4019ff1 by gardener
Overhaul the SDBM expression kind hierarchy
Swap the allowed nesting of sum and diff expressions: now a diff
expression can contain a sum expression, but only on the left hand side.
A difference of two expressions sum must be canonicalized by grouping
their constant terms in a single expression.  This change of sturcture
became possible thanks to the introduction of the "direct" super-kind.
It is necessary to enable support of sum expressions on the left hand
side of the stripe expression.
SDBM expressions are now grouped into the following structure
- expression
- varying
   - direct
     - sum <- (term, constant)
     - term
       - symbol
       - dimension
       - stripe <- (term, constant)
   - negation <- (direct)
   - difference <- (direct, term)
- constant The notation <- (...) denotes the types of subexpressions a
compound expression can combine.
PiperOrigin-RevId: 269337222
The file was modifiedmlir/include/mlir/Dialect/SDBM/SDBMExpr.h
The file was modifiedmlir/lib/Dialect/SDBM/SDBMExprDetail.h
The file was modifiedmlir/lib/Dialect/SDBM/SDBMExpr.cpp
The file was modifiedmlir/unittests/SDBM/SDBMTest.cpp
The file was modifiedmlir/test/SDBM/sdbm-api-test.cpp
Commit 6934a337f099f4ccb22625e1bf440b3356f8c09f by gardener
[spirv] Add support for BitEnumAttr
Certain enum classes in SPIR-V, like function/loop control and memory
access, are bitmasks. This CL introduces a BitEnumAttr to properly model
this and drive auto-generation of verification code and utility
functions. We still store the attribute using an 32-bit IntegerAttr for
minimal memory footprint and easy (de)serialization. But utility
conversion functions are adjusted to inspect each bit and generate
"|"-concatenated strings for the bits; vice versa.
Each such enum class has a "None" case that means no bit is set. We need
special handling for "None". Because of this, the logic is not general
anymore. So right now the definition is placed in the SPIR-V dialect. If
later this turns out to be useful for other dialects, then we can see
how to properly adjust it and move to OpBase.td.
Added tests for SPV_MemoryAccess to check and demonstrate.
PiperOrigin-RevId: 269350620
The file was modifiedmlir/include/mlir/IR/OpBase.td
The file was modifiedmlir/lib/TableGen/Attribute.cpp
The file was modifiedmlir/include/mlir/Dialect/SPIRV/CMakeLists.txt
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVOps.cpp
The file was modifiedmlir/utils/spirv/gen_spirv_dialect.py
The file was modifiedmlir/test/Dialect/SPIRV/ops.mlir
The file was modifiedmlir/include/mlir/TableGen/Attribute.h
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVTypes.cpp
The file was modifiedmlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp
The file was modifiedmlir/tools/mlir-tblgen/EnumsGen.cpp
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVTypes.h
The file was modifiedmlir/lib/Dialect/SPIRV/CMakeLists.txt
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVBase.td
The file was addedmlir/tools/mlir-tblgen/EnumsGen.h
Commit 9619ba10d47a11b968efe835afb040be1c8c63cc by gardener
Add support for multi-level value mapping to DialectConversion.
When performing A->B->C conversion, an operation may still refer to an
operand of A. This makes it necessary to unmap through multiple levels
of replacement for a specific value.
PiperOrigin-RevId: 269367859
The file was addedmlir/test/Transforms/test-legalizer-full.mlir
The file was modifiedmlir/test/lib/TestDialect/TestPatterns.cpp
The file was modifiedmlir/test/lib/TestDialect/TestOps.td
The file was modifiedmlir/lib/Transforms/DialectConversion.cpp
The file was modifiedmlir/test/Transforms/test-legalizer-analysis.mlir
Commit 8a34d5d18cdd509f06945b512ea889133c7b3a0e by gardener
[spirv] Add support for function calls.
Add spv.FunctionCall operation and (de)serialization.
Closes tensorflow/mlir#137
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/137
from denis0x0D:sandbox/function_call_op
e2e6f07d21e7f23e8b44c7df8a8ab784f3356ce4 PiperOrigin-RevId: 269437167
The file was addedmlir/test/Dialect/SPIRV/Serialization/function_call.mlir
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVControlFlowOps.td
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVOps.cpp
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/Serializer.cpp
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVBase.td
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/Deserializer.cpp
The file was modifiedmlir/test/Dialect/SPIRV/control-flow-ops.mlir
Commit 2d86ad79f0021eb5612f1b37d5a3de5160e919fb by gardener
Autogenerate (de)serialization for Extended Instruction Sets
A generic mechanism for (de)serialization of extended instruction sets
is added with this CL. To facilitate this, a new class
"SPV_ExtendedInstSetOp" is added which is a base class for all
operations corresponding to extended instruction sets. The methods to
(de)serialization such ops as well as its dispatch is generated
automatically.
The behavior controlled by autogenSerialization and hasOpcode is also
slightly modified to enable this. They are now decoupled. 1) Setting
hasOpcode=1 means the operation has a corresponding
  opcode in SPIR-V binary format, and its dispatch for
  (de)serialization is automatically generated. 2) Setting
autogenSerialization=1 generates the function for
  (de)serialization automatically. So now it is possible to have
hasOpcode=0 and autogenSerialization=1
(for example SPV_ExtendedInstSetOp).
Since the dispatch functions is also auto-generated, the input file
needs to contain all operations. To this effect, SPIRVGLSLOps.td is
included into SPIRVOps.td. This makes the previously added
SPIRVGLSLOps.h and SPIRVGLSLOps.cpp unnecessary, and are deleted.
The SPIRVUtilsGen.cpp is also changed to make better use of
formatv,making the code more readable.
PiperOrigin-RevId: 269456263
The file was addedmlir/test/Dialect/SPIRV/Serialization/glslops.mlir
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVBase.td
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVGLSLOps.td
The file was removedmlir/include/mlir/Dialect/SPIRV/SPIRVGLSLOps.h
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVDialect.cpp
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVOps.td
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVControlFlowOps.td
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/Serializer.cpp
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/Deserializer.cpp
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVStructureOps.td
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVOps.cpp
The file was modifiedmlir/include/mlir/Dialect/SPIRV/CMakeLists.txt
The file was modifiedmlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp
The file was removedmlir/lib/Dialect/SPIRV/SPIRVGLSLOps.cpp
The file was modifiedmlir/test/Dialect/SPIRV/glslops.mlir
The file was modifiedmlir/lib/Dialect/SPIRV/CMakeLists.txt
Commit 62e1faa6f6bd9f49b1bb68ba01e543850ebff5d0 by gardener
Add missing CMake dependency from libAnalysis to the Vector dialect
Fixes tensorflow/mlir#138
PiperOrigin-RevId: 269509668
The file was modifiedmlir/lib/Analysis/CMakeLists.txt
Commit bd7de6d4dfb82df21f36c1c331cba87a4d0118f7 by gardener
Add rewrite pattern to compose maps into affine load/stores
- add canonicalization pattern to compose maps into affine loads/stores;
templatize the pattern and reuse it for affine.apply as well
- rename getIndices -> getMapOperands() (getIndices is confusing since
these are no longer the indices themselves but operands to the map
whose results are the indices). This also makes the accessor uniform
across affine.apply/load/store. Change arg names on the affine
load/store builder to avoid confusion. Drop an unused confusing build
method on AffineStoreOp.
- update incomplete doc comment for canonicalizeMapAndOperands (this was
missed from a previous update).
Addresses issue tensorflow/mlir#121
Signed-off-by: Uday Bondhugula <uday@polymagelabs.com>
Closes tensorflow/mlir#122
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/122
from bondhugula:compose-load-store
e71de1771e56a85c4282c10cb43f30cef0701c4f PiperOrigin-RevId: 269619540
The file was modifiedmlir/test/Transforms/canonicalize.mlir
The file was modifiedmlir/lib/Transforms/Vectorize.cpp
The file was modifiedmlir/lib/Dialect/AffineOps/AffineOps.cpp
The file was modifiedmlir/lib/Analysis/Utils.cpp
The file was modifiedmlir/include/mlir/Dialect/AffineOps/AffineOps.h
The file was modifiedmlir/test/AffineOps/canonicalize.mlir
The file was modifiedmlir/lib/Analysis/LoopAnalysis.cpp
The file was modifiedmlir/lib/Transforms/LowerAffine.cpp
Commit b00a522b801015f0c3d3ac7c3db1eddafca603cb by gardener
Change MLIR translation functions signature
This CL changes translation functions to take MemoryBuffer as input and
raw_ostream as output. It is generally better to avoid handling files
directly in a library (unless the library is specifically for file
manipulation) and we can unify all file handling to the mlir-translate
binary itself.
PiperOrigin-RevId: 269625911
The file was modifiedmlir/include/mlir/Support/TranslateClParser.h
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/ConvertToBinary.cpp
The file was modifiedmlir/lib/Support/TranslateClParser.cpp
The file was modifiedmlir/lib/Target/LLVMIR/ConvertToLLVMIR.cpp
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/ConvertFromBinary.cpp
The file was modifiedmlir/tools/mlir-translate/mlir-translate.cpp
The file was modifiedmlir/lib/Target/LLVMIR/ConvertToNVVMIR.cpp
The file was modifiedmlir/include/mlir/Translation.h
Commit b991e8b1e40cca25a6ed1b52ffe4a71a39cb72fb by gardener
Support file-to-file translation in mlir-translate
Existing translations are either from MLIR or to MLIR. To support cases
like round-tripping some external format via MLIR, one must chain two
mlir-translate invocations together using pipes. This can be problematic
to support -split-input-file in mlir-translate given that it won't work
across pipes.
Motivated by the above, this CL adds another translation category that
allows file to file. This gives users more freedom.
PiperOrigin-RevId: 269636438
The file was modifiedmlir/lib/Translation/Translation.cpp
The file was modifiedmlir/include/mlir/Translation.h
The file was modifiedmlir/lib/Support/TranslateClParser.cpp
Commit 3e2ac62b7d54e37a8b55dfc2e9654a0eef2c6fd6 by gardener
Add a preprocess pass to remove sequences that are problematic with
FileCheck
Add a preprocess phase to rewrite parts of the input line that may be
problematic with filecheck. This change adds preprocessing to escape
'[[' bracket sequences, as these are used by FileCheck for variables.
PiperOrigin-RevId: 269648490
The file was modifiedmlir/utils/generate-test-checks.py
Commit af45ca844fb4dcfbd9f84586a1f55c1352d25242 by gardener
Register a -test-spirv-roundtrip hook to mlir-translate
This CL registers a new mlir-translate hook, -test-spirv-roundtrip, for
testing SPIR-V serialization and deserialization round-trip.
This CL also moves the existing -serialize-spirv and
-deserialize-spirv hooks to one source file.
PiperOrigin-RevId: 269659528
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/spec_constant.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/loop.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/variables_init.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/terminator.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/entry.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/load_store.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/variables.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/struct.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/variable_reference.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/capability.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/select.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/entry_interface.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/function_call.mlir
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/CMakeLists.txt
The file was removedmlir/lib/Dialect/SPIRV/Serialization/ConvertFromBinary.cpp
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/extension.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/glslops.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/access_chain.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/array_stride.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/execution_mode.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/constant.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/minimal-module.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/bin_ops.mlir
The file was addedmlir/lib/Dialect/SPIRV/Serialization/TranslateRegistration.cpp
The file was removedmlir/lib/Dialect/SPIRV/Serialization/ConvertToBinary.cpp
Commit 9330c1b9a1d70711294be25db98289929385f6fe by gardener
Add (de)serialization support for OpRuntimeArray.
Update the SPIR-V (de)serialization to handle RuntimeArrayType.
PiperOrigin-RevId: 269667196
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVBase.td
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/Serializer.cpp
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/Deserializer.cpp
The file was addedmlir/test/Dialect/SPIRV/Serialization/rtarray.mlir
Commit b58d9aee11000c2ccfd4905750b15fa7e2681323 by gardener
Add support to OpAsmParser for parsing unknown keywords.
This is useful in several cases, for example a user may want to sugar
the syntax of a string(as we do with custom operation syntax), or avoid
many nested ifs for  parsing a set of known keywords.
PiperOrigin-RevId: 269695451
The file was modifiedmlir/include/mlir/IR/OpImplementation.h
The file was modifiedmlir/test/lib/TestDialect/TestOps.td
The file was modifiedmlir/test/IR/parser.mlir
The file was modifiedmlir/lib/Parser/Parser.cpp
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVOps.cpp
The file was modifiedmlir/lib/Dialect/GPU/IR/GPUDialect.cpp
The file was modifiedmlir/test/lib/TestDialect/TestDialect.cpp
Commit a15e0ce1ba5fa049052b92583abb196f49f1e70c by gardener
Simplify SDBM expressions more aggressively in operators and conversions
Extend SDBM simplification patterns to support more cases where the
addition of two expressions each involving one or two variables would
result in a sum expression that only contains one variable and thus
remains in the SDBM domain. This is made possible by the new canonical
structure of SDBM where the constant term appears once.  This
simplification will be necessary to support round-tripping of stripe
expressions containing constant terms on the LHS through affine
expressions.
PiperOrigin-RevId: 269757732
The file was modifiedmlir/lib/Dialect/SDBM/SDBMExpr.cpp
The file was modifiedmlir/include/mlir/Dialect/SDBM/SDBMExpr.h
The file was modifiedmlir/unittests/SDBM/SDBMTest.cpp
Commit 5709aeb9930776bfaee81bb51d9b2c0b0142c395 by gardener
SDBM: support sum expressions on the LHS of stripe expressions
Introduce support for applying the stripe operator to sum expressions,
as in
(x + A) # B = x + A - (x + A) mod B. This is required to represent a
combination of tiling and padding in the SDBM framework, and is a valid
SDBM construct that was not originally supported.
PiperOrigin-RevId: 269758807
The file was modifiedmlir/lib/Dialect/SDBM/SDBMExpr.cpp
The file was modifiedmlir/include/mlir/Dialect/SDBM/SDBMExpr.h
The file was modifiedmlir/lib/Dialect/SDBM/SDBM.cpp
The file was modifiedmlir/unittests/SDBM/SDBMTest.cpp
Commit 1c73be76d84a04499b7e9ac5dfe129c204880dd8 by gardener
Unify error messages to start with lower-case.
PiperOrigin-RevId: 269803466
The file was modifiedmlir/examples/toy/Ch5/mlir/ShapeInferencePass.cpp
The file was modifiedmlir/lib/Transforms/MaterializeVectors.cpp
The file was modifiedmlir/examples/toy/Ch5/mlir/LateLowering.cpp
The file was modifiedmlir/examples/toy/Ch4/mlir/ToyDialect.cpp
The file was modifiedmlir/lib/Conversion/GPUToCUDA/ConvertLaunchFuncToCudaCalls.cpp
The file was modifiedmlir/lib/Analysis/SliceAnalysis.cpp
The file was modifiedmlir/lib/Conversion/GPUToCUDA/ConvertKernelFuncToCubin.cpp
The file was modifiedmlir/examples/toy/Ch4/mlir/MLIRGen.cpp
The file was modifiedmlir/lib/Analysis/Utils.cpp
The file was modifiedmlir/examples/toy/Ch2/mlir/MLIRGen.cpp
The file was modifiedmlir/examples/toy/Ch3/mlir/MLIRGen.cpp
The file was modifiedmlir/examples/toy/Ch5/mlir/MLIRGen.cpp
The file was modifiedmlir/examples/toy/Ch3/mlir/ToyDialect.cpp
The file was modifiedmlir/lib/Transforms/Utils/LoopUtils.cpp
The file was modifiedmlir/examples/toy/Ch5/mlir/ToyDialect.cpp
The file was modifiedmlir/examples/toy/Ch4/mlir/ShapeInferencePass.cpp
Commit 727a50ae2db4492a8c3168647996abacd75d0622 by gardener
Support symbolic operands for memref replacement; fix memrefNormalize
- allow symbols in index remapping provided for memref replacement
- fix memref normalize crash on cases with layout maps with symbols
Signed-off-by: Uday Bondhugula <uday@polymagelabs.com> Reported by: Alex
Zinenko
Closes tensorflow/mlir#139
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/139
from bondhugula:memref-rep-symbols
2f48c1fdb5d4c58915bbddbd9f07b18541819233 PiperOrigin-RevId: 269851182
The file was modifiedmlir/test/Transforms/memref-normalize.mlir
The file was modifiedmlir/lib/Transforms/LoopFusion.cpp
The file was modifiedmlir/lib/Transforms/PipelineDataTransfer.cpp
The file was modifiedmlir/include/mlir/Dialect/StandardOps/Ops.td
The file was modifiedmlir/include/mlir/Transforms/Utils.h
The file was modifiedmlir/lib/Transforms/Utils/LoopUtils.cpp
The file was modifiedmlir/lib/Transforms/Utils/Utils.cpp
Commit 35df51086aefa1420784a096fd406febadae315a by gardener
Fix nested dominance relationship between parent results and child
operations.
This modifies DominanceInfo::properlyDominates(Value *value, Operation
*op) to return false if the value is defined by a parent operation of
'op'. This prevents using values defined by the parent operation from
within any child regions.
PiperOrigin-RevId: 269934920
The file was modifiedmlir/test/IR/invalid.mlir
The file was modifiedmlir/lib/Analysis/Dominance.cpp
The file was modifiedmlir/include/mlir/IR/Operation.h
The file was modifiedmlir/lib/IR/Operation.cpp
Commit 25f0f769aa7de1338158becbe614856802d43e1a by gardener
NFC: Remove stray logging from ~Block(). PiperOrigin-RevId: 269941815
The file was modifiedmlir/lib/IR/Block.cpp
Commit 5684a12434f923d03b6870f2aa16226bfb0b38b6 by gardener
Outline GPU kernel function into a nested module.
When outlining GPU kernels, put the kernel function inside a nested
module. Then use a nested pipeline to generate the cubins, independently
per kernel. In a final pass, move the cubins back to the parent module.
PiperOrigin-RevId: 269987720
The file was modifiedmlir/lib/Dialect/GPU/Transforms/KernelOutlining.cpp
The file was modifiedmlir/test/Conversion/GPUToCUDA/insert-cubin-getter.mlir
The file was modifiedmlir/include/mlir/Dialect/GPU/GPUDialect.h
The file was modifiedmlir/tools/mlir-cuda-runner/mlir-cuda-runner.cpp
The file was modifiedmlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp
The file was modifiedmlir/lib/Conversion/GPUToCUDA/ConvertKernelFuncToCubin.cpp
The file was modifiedmlir/test/Conversion/GPUToCUDA/lower-nvvm-kernel-to-cubin.mlir
The file was modifiedmlir/lib/Conversion/GPUToCUDA/GenerateCubinAccessors.cpp
The file was modifiedmlir/include/mlir/Conversion/GPUToNVVM/GPUToNVVMPass.h
The file was modifiedmlir/test/Conversion/GPUToNVVM/gpu-to-nvvm.mlir
The file was modifiedmlir/test/Dialect/GPU/outlining.mlir
Commit e79bfefb89201de52b9c8d609b67b416d3982977 by gardener
Add address space attribute to LLVMIR's GlobalOp.
PiperOrigin-RevId: 270012505
The file was modifiedmlir/lib/Target/LLVMIR/ModuleTranslation.cpp
The file was modifiedmlir/test/Dialect/LLVMIR/global.mlir
The file was modifiedmlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
The file was modifiedmlir/test/Target/llvmir.mlir
Commit 5f86dc5fc9fe909dbcc03043fc5f960be00e1024 by gardener
NFC: Fix return indentation in generated op definitions.
PiperOrigin-RevId: 270070670
The file was modifiedmlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
Commit c8961d408ee0f48e3156e3c4248bba9a43579f1f by gardener
Quantize attribute values by per axis quantization parameters
A new converter with per axis quantization parameters is added to
quantize a dense elements attribute. For each slice along the
quantization axis, it creates an uniform quantized value converter, with
different scale and zero point, and quantizes the values in the slice.
The current implementation doesn't handle sparse elements attributes.
PiperOrigin-RevId: 270121986
The file was modifiedmlir/lib/Dialect/QuantOps/Utils/UniformSupport.cpp
The file was modifiedmlir/include/mlir/Dialect/QuantOps/UniformSupport.h
The file was modifiedmlir/test/Dialect/QuantOps/convert-const.mlir
The file was modifiedmlir/lib/Dialect/QuantOps/Utils/QuantizeUtils.cpp
Commit 2df646bef6e7665fdb8523613d82e7d4a5013217 by gardener
Automated rollback of commit 5684a12434f923d03b6870f2aa16226bfb0b38b6
PiperOrigin-RevId: 270126672
The file was modifiedmlir/lib/Conversion/GPUToCUDA/ConvertKernelFuncToCubin.cpp
The file was modifiedmlir/include/mlir/Dialect/GPU/GPUDialect.h
The file was modifiedmlir/lib/Dialect/GPU/Transforms/KernelOutlining.cpp
The file was modifiedmlir/lib/Conversion/GPUToCUDA/GenerateCubinAccessors.cpp
The file was modifiedmlir/test/Conversion/GPUToNVVM/gpu-to-nvvm.mlir
The file was modifiedmlir/test/Conversion/GPUToCUDA/lower-nvvm-kernel-to-cubin.mlir
The file was modifiedmlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp
The file was modifiedmlir/test/Conversion/GPUToCUDA/insert-cubin-getter.mlir
The file was modifiedmlir/test/Dialect/GPU/outlining.mlir
The file was modifiedmlir/include/mlir/Conversion/GPUToNVVM/GPUToNVVMPass.h
The file was modifiedmlir/tools/mlir-cuda-runner/mlir-cuda-runner.cpp
Commit 9a4f5d2ee324f536cede769c10022d1ce7b875f1 by gardener
Allow specification of decorators on SPIR-V StructType members.
Allow specification of decorators on SPIR-V StructType members. If the
struct has layout information, these decorations are to be specified
after the offset specification of the member. These decorations are
emitted as OpMemberDecorate instructions on the struct <id>. Update
(de)serialization to handle these decorations.
PiperOrigin-RevId: 270130136
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVTypes.h
The file was modifiedmlir/g3doc/Dialects/SPIR-V.md
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVDialect.cpp
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/Serializer.cpp
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/Deserializer.cpp
The file was modifiedmlir/test/Dialect/SPIRV/types.mlir
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVTypes.cpp
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/struct.mlir
Commit 5002e98b92bbf300b41b7a7af6492d7c1bd662f4 by gardener
Remove unused import and two import forms
argparse was imported with both 'import' and 'import from' and string
import was unused,
PiperOrigin-RevId: 270164488
The file was modifiedmlir/utils/generate-test-checks.py
Commit a00b5682776555ed378d67ae2569d12c4e9b112d by gardener
Add utility to extract strides from layout map in MemRefType.
The RFC for unifying Linalg and Affine compilation passes into an
end-to-end flow discusses the notion of a strided MemRef
(https://groups.google.com/a/tensorflow.org/forum/#!topic/mlir/MaL8m2nXuio).
This CL adds helper functions to extract strides from the layout map
which in turn will allow converting between a strided form of the type
and a layout map.
For now strides are only computed on a single affine map with a single
result (i.e. the closed subset of linearization maps that are compatible
with striding semantics). This restriction will be reevaluated / lifted
in the future based on concrete use cases.
PiperOrigin-RevId: 270284686
The file was modifiedmlir/lib/IR/StandardTypes.cpp
The file was modifiedmlir/include/mlir/IR/StandardTypes.h
The file was addedmlir/test/AffineOps/memref-stride-calculation.mlir
The file was addedmlir/test/lib/Transforms/TestMemRefStrideCalculation.cpp
Commit daf3b855100c56552ed44f796e31184c274e33f8 by gardener
Fix public build
TestMemRefStrideCalculation.cpp was missing
PiperOrigin-RevId: 270304543
The file was modifiedmlir/test/lib/Transforms/CMakeLists.txt
Commit d8fda38ceac490ef47a4b8bf1a692030dd2d92e8 by gardener
Use SmallVectorImpl in getStrides
No need to force a particular size on the user of the API.
PiperOrigin-RevId: 270310570
The file was modifiedmlir/include/mlir/IR/StandardTypes.h
The file was modifiedmlir/lib/IR/StandardTypes.cpp
Commit 2797517ecf89df597a49d670b633cae3de6c4c5a by gardener
NFC: Pass OpAsmParser by reference instead of by pointer.
MLIR follows the LLVM style of pass-by-reference.
PiperOrigin-RevId: 270315612
The file was modifiedmlir/examples/Linalg/Linalg2/include/linalg2/TensorOps-inl.h
The file was modifiedmlir/include/mlir/Dialect/GPU/GPUDialect.h
The file was modifiedmlir/include/mlir/Dialect/StandardOps/Ops.td
The file was modifiedmlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp
The file was modifiedmlir/include/mlir/IR/FunctionSupport.h
The file was modifiedmlir/include/mlir/IR/OperationSupport.h
The file was modifiedmlir/examples/Linalg/Linalg1/include/linalg1/SliceOp.h
The file was modifiedmlir/test/mlir-tblgen/op-decl.td
The file was modifiedmlir/lib/IR/Operation.cpp
The file was modifiedmlir/examples/Linalg/Linalg3/include/linalg3/LoadStoreOps.h
The file was modifiedmlir/lib/Dialect/StandardOps/Ops.cpp
The file was modifiedmlir/examples/Linalg/Linalg1/include/linalg1/RangeOp.h
The file was modifiedmlir/examples/Linalg/Linalg1/include/linalg1/ViewOp.h
The file was modifiedmlir/examples/Linalg/Linalg3/lib/LoadStoreOps.cpp
The file was modifiedmlir/include/mlir/IR/Function.h
The file was modifiedmlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
The file was modifiedmlir/include/mlir/Dialect/AffineOps/AffineOps.td
The file was modifiedmlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td
The file was modifiedmlir/lib/IR/Function.cpp
The file was modifiedmlir/examples/Linalg/Linalg1/lib/RangeOp.cpp
The file was modifiedmlir/lib/Dialect/AffineOps/AffineOps.cpp
The file was modifiedmlir/examples/Linalg/Linalg1/lib/SliceOp.cpp
The file was modifiedmlir/include/mlir/IR/OpDefinition.h
The file was modifiedmlir/include/mlir/Dialect/AffineOps/AffineOps.h
The file was modifiedmlir/include/mlir/Dialect/LoopOps/LoopOps.td
The file was modifiedmlir/test/lib/TestDialect/TestDialect.cpp
The file was modifiedmlir/lib/Dialect/VectorOps/VectorOps.cpp
The file was modifiedmlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
The file was modifiedmlir/examples/Linalg/Linalg2/include/linalg2/TensorOps.h
The file was modifiedmlir/lib/Parser/Parser.cpp
The file was modifiedmlir/lib/IR/FunctionSupport.cpp
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVOps.cpp
The file was modifiedmlir/lib/IR/Module.cpp
The file was modifiedmlir/examples/Linalg/Linalg1/lib/ViewOp.cpp
The file was modifiedmlir/lib/Dialect/GPU/IR/GPUDialect.cpp
The file was modifiedmlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
The file was modifiedmlir/include/mlir/Dialect/VectorOps/VectorOps.h
The file was modifiedmlir/examples/Linalg/Linalg2/lib/TensorOps.cpp
The file was modifiedmlir/lib/Dialect/LoopOps/LoopOps.cpp
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVBase.td
The file was modifiedmlir/include/mlir/Dialect/VectorOps/VectorOps.td
The file was modifiedmlir/include/mlir/IR/Module.h
The file was modifiedmlir/include/mlir/Dialect/StandardOps/Ops.h
The file was modifiedmlir/test/lib/TestDialect/TestOps.td
Commit 91125d33ed9a46495a50338ce206ddf5c461a763 by gardener
Avoid iterator invalidation when recursively computing pattern depth.
computeDepth calls itself recursively, which may insert into
minPatternDepth. minPatternDepth is a DenseMap, which invalidates
iterators on insertion, so this may lead to asan failures.
PiperOrigin-RevId: 270374203
The file was modifiedmlir/lib/Transforms/DialectConversion.cpp
Commit 729727ebc7e9e5b27e73b1ae0fdaa4bb7c312098 by gardener
NFC: Pass OperationState by reference instead of by pointer.
MLIR follows the LLVM convention of passing by reference instead of by
pointer.
PiperOrigin-RevId: 270396945
The file was modifiedmlir/examples/Linalg/Linalg3/include/linalg3/LoadStoreOps.h
The file was modifiedmlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
The file was modifiedmlir/examples/Linalg/Linalg2/include/linalg2/TensorOps-inl.h
The file was modifiedmlir/include/mlir/Dialect/VectorOps/VectorOps.td
The file was modifiedmlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
The file was modifiedmlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
The file was modifiedmlir/examples/Linalg/Linalg1/lib/ViewOp.cpp
The file was modifiedmlir/lib/Dialect/AffineOps/AffineOps.cpp
The file was modifiedmlir/lib/Parser/Parser.cpp
The file was modifiedmlir/examples/toy/Ch5/mlir/ToyDialect.cpp
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVBase.td
The file was modifiedmlir/include/mlir/Dialect/VectorOps/VectorOps.h
The file was modifiedmlir/lib/IR/Function.cpp
The file was modifiedmlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td
The file was modifiedmlir/include/mlir/Dialect/GPU/GPUDialect.h
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVControlFlowOps.td
The file was modifiedmlir/examples/Linalg/Linalg2/lib/TensorOps.cpp
The file was modifiedmlir/include/mlir/IR/FunctionSupport.h
The file was modifiedmlir/include/mlir/IR/OpDefinition.h
The file was modifiedmlir/lib/Dialect/VectorOps/VectorOps.cpp
The file was modifiedmlir/test/lib/TestDialect/TestOps.td
The file was modifiedmlir/unittests/Dialect/SPIRV/SerializationTest.cpp
The file was modifiedmlir/include/mlir/Dialect/Linalg/IR/LinalgLibraryOps.td
The file was modifiedmlir/include/mlir/IR/OpBase.td
The file was modifiedmlir/lib/IR/Module.cpp
The file was modifiedmlir/include/mlir/IR/Function.h
The file was modifiedmlir/lib/Dialect/StandardOps/Ops.cpp
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/Deserializer.cpp
The file was modifiedmlir/examples/Linalg/Linalg1/include/linalg1/ViewOp.h
The file was modifiedmlir/examples/Linalg/Linalg2/include/linalg2/TensorOps.h
The file was modifiedmlir/include/mlir/IR/PatternMatch.h
The file was modifiedmlir/examples/Linalg/Linalg1/include/linalg1/RangeOp.h
The file was modifiedmlir/test/mlir-tblgen/op-attribute.td
The file was modifiedmlir/lib/Dialect/LoopOps/LoopOps.cpp
The file was modifiedmlir/examples/Linalg/Linalg1/include/linalg1/SliceOp.h
The file was modifiedmlir/lib/IR/FunctionSupport.cpp
The file was modifiedmlir/include/mlir/Dialect/StandardOps/Ops.h
The file was modifiedmlir/include/mlir/IR/Builders.h
The file was modifiedmlir/lib/IR/Operation.cpp
The file was modifiedmlir/examples/toy/Ch3/mlir/ToyDialect.cpp
The file was modifiedmlir/examples/toy/Ch4/mlir/ToyDialect.cpp
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVStructureOps.td
The file was modifiedmlir/include/mlir/IR/OperationSupport.h
The file was modifiedmlir/g3doc/Tutorials/Toy/Ch-3.md
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVOps.cpp
The file was modifiedmlir/test/mlir-tblgen/op-decl.td
The file was modifiedmlir/include/mlir/Dialect/AffineOps/AffineOps.td
The file was modifiedmlir/include/mlir/Dialect/StandardOps/Ops.td
The file was modifiedmlir/examples/Linalg/Linalg3/lib/LoadStoreOps.cpp
The file was modifiedmlir/examples/toy/Ch3/include/toy/Dialect.h
The file was modifiedmlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
The file was modifiedmlir/test/lib/TestDialect/TestDialect.cpp
The file was modifiedmlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp
The file was modifiedmlir/test/mlir-tblgen/op-result.td
The file was modifiedmlir/examples/toy/Ch5/include/toy/Dialect.h
The file was modifiedmlir/examples/Linalg/Linalg1/lib/SliceOp.cpp
The file was modifiedmlir/include/mlir/IR/Module.h
The file was modifiedmlir/lib/Dialect/GPU/IR/GPUDialect.cpp
The file was modifiedmlir/g3doc/OpDefinitions.md
The file was modifiedmlir/examples/Linalg/Linalg1/lib/RangeOp.cpp
The file was modifiedmlir/examples/toy/Ch4/include/toy/Dialect.h
The file was modifiedmlir/include/mlir/Dialect/AffineOps/AffineOps.h
The file was modifiedmlir/test/mlir-tblgen/op-operand.td
The file was modifiedmlir/g3doc/Tutorials/Linalg/Ch-1.md
The file was modifiedmlir/include/mlir/Dialect/LoopOps/LoopOps.td
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVOps.td
Commit 3a643de92b4c1a93b0725f171f4384c8dd941dd5 by gardener
NFC: Pass OpAsmPrinter by reference instead of by pointer.
MLIR follows the LLVM style of pass-by-reference.
PiperOrigin-RevId: 270401378
The file was modifiedmlir/lib/IR/FunctionSupport.cpp
The file was modifiedmlir/lib/Dialect/GPU/IR/GPUDialect.cpp
The file was modifiedmlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVOps.cpp
The file was modifiedmlir/examples/Linalg/Linalg1/lib/RangeOp.cpp
The file was modifiedmlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
The file was modifiedmlir/lib/Dialect/VectorOps/VectorOps.cpp
The file was modifiedmlir/test/mlir-tblgen/op-decl.td
The file was modifiedmlir/examples/Linalg/Linalg2/include/linalg2/TensorOps.h
The file was modifiedmlir/test/lib/TestDialect/TestDialect.cpp
The file was modifiedmlir/examples/Linalg/Linalg1/include/linalg1/ViewOp.h
The file was modifiedmlir/include/mlir/IR/OperationSupport.h
The file was modifiedmlir/lib/Dialect/LLVMIR/IR/NVVMDialect.cpp
The file was modifiedmlir/include/mlir/IR/FunctionSupport.h
The file was modifiedmlir/examples/Linalg/Linalg1/include/linalg1/RangeOp.h
The file was modifiedmlir/lib/IR/Module.cpp
The file was modifiedmlir/examples/Linalg/Linalg1/lib/ViewOp.cpp
The file was modifiedmlir/lib/IR/AsmPrinter.cpp
The file was modifiedmlir/lib/IR/Operation.cpp
The file was modifiedmlir/include/mlir/IR/Module.h
The file was modifiedmlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
The file was modifiedmlir/examples/Linalg/Linalg1/lib/SliceOp.cpp
The file was modifiedmlir/examples/Linalg/Linalg3/lib/LoadStoreOps.cpp
The file was modifiedmlir/include/mlir/Dialect/GPU/GPUOps.td
The file was modifiedmlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVBase.td
The file was modifiedmlir/include/mlir/Dialect/GPU/GPUDialect.h
The file was modifiedmlir/lib/Dialect/AffineOps/AffineOps.cpp
The file was modifiedmlir/include/mlir/Dialect/AffineOps/AffineOps.td
The file was modifiedmlir/include/mlir/Dialect/VectorOps/VectorOps.h
The file was modifiedmlir/include/mlir/Dialect/VectorOps/VectorOps.td
The file was modifiedmlir/lib/IR/Function.cpp
The file was modifiedmlir/include/mlir/Dialect/AffineOps/AffineOps.h
The file was modifiedmlir/include/mlir/IR/Function.h
The file was modifiedmlir/lib/Dialect/LoopOps/LoopOps.cpp
The file was modifiedmlir/include/mlir/Dialect/StandardOps/Ops.td
The file was modifiedmlir/include/mlir/IR/OpDefinition.h
The file was modifiedmlir/examples/Linalg/Linalg2/lib/TensorOps.cpp
The file was modifiedmlir/examples/Linalg/Linalg1/include/linalg1/SliceOp.h
The file was modifiedmlir/include/mlir/Dialect/LoopOps/LoopOps.td
The file was modifiedmlir/include/mlir/Dialect/StandardOps/Ops.h
The file was modifiedmlir/lib/Dialect/StandardOps/Ops.cpp
The file was modifiedmlir/examples/Linalg/Linalg2/include/linalg2/TensorOps-inl.h
The file was modifiedmlir/examples/Linalg/Linalg3/include/linalg3/LoadStoreOps.h
The file was modifiedmlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
The file was modifiedmlir/test/lib/TestDialect/TestOps.td
Commit 33a3a91ba2decbf5187228e0fdd528c05b6b963c by gardener
Make GlobalOp's value attribute optional.
Make GlobalOp's value attribute an OptionalAttr. Change code that uses
the value to handle 'nullopt'. Translate an unitialized value attribute
to llvm::UndefValue.
PiperOrigin-RevId: 270423646
The file was modifiedmlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
The file was modifiedmlir/test/Target/llvmir.mlir
The file was modifiedmlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
The file was modifiedmlir/lib/Target/LLVMIR/ModuleTranslation.cpp
The file was modifiedmlir/test/Dialect/LLVMIR/global.mlir
Commit 8e4906362edba6ea763497c8a050a66291c3b087 by gardener
[ODS] Add support for FloatElementsAttr
This CL adds a new FloatElementsAttr definition to ODS for float
elements attributes of a certain type.
Tests are added to show both verification and how to use it in patterns.
PiperOrigin-RevId: 270455487
The file was modifiedmlir/include/mlir/IR/OpBase.td
The file was modifiedmlir/test/lib/TestDialect/TestOps.td
The file was modifiedmlir/test/mlir-tblgen/pattern.mlir
The file was modifiedmlir/test/IR/attribute.mlir
Commit 4d880d09e0ce2d026ff1313b596151102420ad2b by gardener
Add a note about the use of recursion in the developer guide
PiperOrigin-RevId: 270455509
The file was modifiedmlir/g3doc/DeveloperGuide.md
Commit f559c38c28caf67576d23a8f9e3f02c88ecc13e4 by gardener
Upgrade/fix/simplify store to load forwarding
- fix store to load forwarding for a certain set of cases (where
forwarding shouldn't have happened); use AffineValueMap difference
based MemRefAccess equality checking; utility logic is also greatly
simplified
- add missing equality/inequality operators for AffineExpr ==/!= ints
- add == != operators on MemRefAccess
Closes tensorflow/mlir#136
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/136
from bondhugula:store-load-forwarding
d79fd1add8bcfbd9fa71d841a6a9905340dcd792 PiperOrigin-RevId: 270457011
The file was modifiedmlir/include/mlir/Analysis/AffineAnalysis.h
The file was modifiedmlir/include/mlir/Analysis/AffineStructures.h
The file was modifiedmlir/lib/Analysis/AffineStructures.cpp
The file was modifiedmlir/include/mlir/IR/AffineExpr.h
The file was modifiedmlir/lib/Transforms/MemRefDataFlowOpt.cpp
The file was modifiedmlir/lib/Analysis/Utils.cpp
The file was modifiedmlir/test/Transforms/memref-dataflow-opt.mlir
The file was modifiedmlir/lib/IR/AffineExpr.cpp
Commit 2ec8e2be1f01aaec0a9543ed90dd8f472c037a45 by gardener
[spirv] Add OpControlBarrier and OpMemoryBarrier.
Add OpControlBarrier and OpMemoryBarrier (de)serialization.
Closes tensorflow/mlir#130
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/130
from denis0x0D:sandbox/memory_barrier
2e3fff16bca44904dc1039592cb9a65d526faea8 PiperOrigin-RevId: 270457478
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/Serializer.cpp
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVOps.cpp
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVBase.td
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVOps.td
The file was modifiedmlir/test/Dialect/SPIRV/ops.mlir
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/Deserializer.cpp
The file was modifiedmlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp
The file was addedmlir/test/Dialect/SPIRV/Serialization/barrier.mlir
Commit a26bb0346e88a09a28ba8f2eb5e74136084c161e by gardener
minor spelling tweaks
Closes tensorflow/mlir#143
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/143
from brettkoonce:minor_sp_demo 76bdf7c121a824417969627fc15e50259356a2fa
PiperOrigin-RevId: 270462293
The file was modifiedmlir/g3doc/OpDefinitions.md
The file was modifiedmlir/g3doc/TestingGuide.md
Commit 2c11997d4857ceacebf4124aa73725e2b584c6dd by gardener
Add integer sign- and zero-extension and truncation to standard.
This adds sign- and zero-extension and truncation of integer types to
the standard dialects. This allows to perform integer type conversions
without having to go to the LLVM dialect and introduce custom type casts
(between standard and LLVM integer types).
Closes tensorflow/mlir#134
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/134
from ombre5733:sext-zext-trunc-in-std
c7657bc84c0ca66b304e53ec03797e09152e4d31 PiperOrigin-RevId: 270479722
The file was modifiedmlir/lib/Dialect/StandardOps/Ops.cpp
The file was modifiedmlir/include/mlir/Dialect/StandardOps/Ops.td
The file was modifiedmlir/test/IR/invalid-ops.mlir
The file was modifiedmlir/test/Target/llvmir.mlir
The file was modifiedmlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp
The file was modifiedmlir/test/Conversion/StandardToLLVM/convert-to-llvmir.mlir
The file was modifiedmlir/test/IR/core-ops.mlir
Commit 6414c0855605e2cf96b9f4f918b4e06a69fe0abe by gardener
Fix undefined reference to mlir::getElementTypeOrSelf(mlir::Type)
Fix undefined reference: mlir/lib/Dialect/StandardOps/Ops.cpp:2029:
undefined reference to `mlir::getElementTypeOrSelf(mlir::Type)'
Closes tensorflow/mlir#144
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/144
from denis0x0D:sandbox/fix_undef
494d4f7fa2e98ba21954d2b2f7ec1776b9397e08 PiperOrigin-RevId: 270545190
The file was modifiedmlir/lib/Dialect/StandardOps/CMakeLists.txt
Commit 08ae1bb83014e84dfe5e335a3d7e835321542f9d by gardener
update layout map examples in doc, drop stale ones
- add more examples for affine layout maps showing various use
cases
- affine map range sizes were removed from code, but examples in
LangRef weren't updated
Signed-off-by: Uday Bondhugula <uday@polymagelabs.com>
Closes tensorflow/mlir#142
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/142
from bondhugula:doc 3291a8784bc69883f7a7cead21445fc8118aaad2
PiperOrigin-RevId: 270548991
The file was modifiedmlir/g3doc/LangRef.md
Commit 541f1945d105b0b2c076da27abb7e58d34ca3d90 by gardener
Update TruncateIOp builder to pass OperationState by reference.
PiperOrigin-RevId: 270560295
The file was modifiedmlir/include/mlir/Dialect/StandardOps/Ops.td
Commit 54f4522a5c9c321648fbc52e787fef811205f3c6 by gardener
Specalize f32->i8/u8 Quanitization with C++ native arithmetic to
optimize performance.
The CL adds a rounding mode flag to the class and changes the default to
rmNearestTiesToAway from rmNearestTiesToEven because 1) Tensorflow
QuantizeV2 ops uses rmNearestTiesToAway; 2) the specialization only
implements rmNearestTiesToAway.
PiperOrigin-RevId: 270600739
The file was modifiedmlir/include/mlir/Dialect/QuantOps/UniformSupport.h
The file was modifiedmlir/test/Dialect/QuantOps/convert-const.mlir
Commit f1442f1eff482ff1d331e0f9871590063e7546bd by gardener
[NFC] Replace std::clamp with inline implementation.
std::clamp is not in C++14, thus replace it with std::min and std::max.
PiperOrigin-RevId: 270604708
The file was modifiedmlir/include/mlir/Dialect/QuantOps/UniformSupport.h
Commit c900d4994e609ac0f4730d0cdd918eae958e9d28 by gardener
Fix a number of Clang-Tidy warnings.
PiperOrigin-RevId: 270632324
The file was modifiedmlir/lib/Conversion/VectorToLLVM/VectorToLLVM.cpp
The file was modifiedmlir/lib/Pass/PassTiming.cpp
The file was modifiedmlir/lib/Analysis/AffineStructures.cpp
The file was modifiedmlir/lib/Transforms/LowerVectorTransfers.cpp
The file was modifiedmlir/lib/Transforms/Utils/LoopUtils.cpp
The file was modifiedmlir/lib/Parser/Lexer.cpp
The file was modifiedmlir/lib/Dialect/FxpMathOps/Transforms/LowerUniformRealMath.cpp
The file was modifiedmlir/test/lib/TestDialect/TestDialect.cpp
The file was modifiedmlir/lib/Pass/Pass.cpp
The file was modifiedmlir/lib/Transforms/ViewRegionGraph.cpp
The file was modifiedmlir/examples/Linalg/Linalg1/lib/Analysis.cpp
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/Fusion.cpp
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/LowerToLLVMDialect.cpp
The file was modifiedmlir/lib/Transforms/AffineDataCopyGeneration.cpp
The file was modifiedmlir/lib/Parser/Parser.cpp
The file was modifiedmlir/lib/IR/AsmPrinter.cpp
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/Serializer.cpp
The file was modifiedmlir/examples/Linalg/Linalg3/lib/Transforms.cpp
The file was modifiedmlir/lib/IR/Diagnostics.cpp
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/LowerToLoops.cpp
The file was modifiedmlir/lib/Transforms/LowerAffine.cpp
The file was modifiedmlir/lib/Conversion/StandardToSPIRV/ConvertStandardToSPIRV.cpp
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/Tiling.cpp
Commit b8676da1fc5e7d371a76defbd1b4a93a41fe2e33 by gardener
Outline GPU kernel function into a nested module.
Roll forward of commit 5684a12.
When outlining GPU kernels, put the kernel function inside a nested
module. Then use a nested pipeline to generate the cubins, independently
per kernel. In a final pass, move the cubins back to the parent module.
PiperOrigin-RevId: 270639748
The file was modifiedmlir/test/Conversion/GPUToCUDA/insert-cubin-getter.mlir
The file was modifiedmlir/test/Dialect/GPU/outlining.mlir
The file was modifiedmlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp
The file was modifiedmlir/test/Conversion/GPUToNVVM/gpu-to-nvvm.mlir
The file was modifiedmlir/lib/Conversion/GPUToCUDA/ConvertKernelFuncToCubin.cpp
The file was modifiedmlir/lib/Conversion/GPUToCUDA/GenerateCubinAccessors.cpp
The file was modifiedmlir/lib/Dialect/GPU/Transforms/KernelOutlining.cpp
The file was modifiedmlir/test/Conversion/GPUToCUDA/lower-nvvm-kernel-to-cubin.mlir
The file was modifiedmlir/tools/mlir-cuda-runner/mlir-cuda-runner.cpp
The file was modifiedmlir/include/mlir/Dialect/GPU/GPUDialect.h
The file was modifiedmlir/include/mlir/Conversion/GPUToNVVM/GPUToNVVMPass.h
Commit 59e3b30af05357adc41344a4451b2e7629baf64e by gardener
Add variants of interleave that take separator
Make the common case of string separator easier to specify.
PiperOrigin-RevId: 270697581
The file was modifiedmlir/include/mlir/Support/STLExtras.h
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVDialect.cpp
Commit 4b6b58ec0f391b09acbb65c4bc8cf97f9eec685b by gardener
NFC: Fix warning for uninitialized field. PiperOrigin-RevId: 270704572
The file was modifiedmlir/lib/Pass/PassRegistry.cpp
Commit 3eade4304656fd20773a24b7e0c3b183b3e7b426 by gardener
Update the Pass, Analysis, and PassManager sections of WritingAPass.md.
These have become out-of-date with the pass manager generalization.
PiperOrigin-RevId: 270719105
The file was modifiedmlir/g3doc/WritingAPass.md
Commit c61991ef01c34aa2d09fe6d16aead943b7fba2fa by gardener
Refactor DiagnosticEngine to support multiple registered diagnostic
handlers.
This fixes a problem with current save-restore pattern of diagnostics
handlers, as there may be a thread race between when the previous
handler is destroyed. For example, this occurs when using multiple
ParallelDiagnosticHandlers asynchronously:
Handler A Handler B | - LifeTime - |    Restore A here. Handler C | ---
LifeTime ---| Restore B after it has been destroyed.
The new design allows for multiple handlers to be registered in a stack
like fashion. Handlers can return success() to signal that they have
fully processed a diagnostic, or failure to propagate otherwise.
PiperOrigin-RevId: 270720625
The file was modifiedmlir/include/mlir/IR/Diagnostics.h
The file was modifiedmlir/lib/IR/Diagnostics.cpp
The file was modifiedmlir/unittests/Dialect/SPIRV/DeserializationTest.cpp
The file was modifiedmlir/g3doc/Diagnostics.md
Commit 8965011fadf24f4986b0d9c00fc6af0f2b13ee28 by gardener
Add interfaces for call-like/callable operations.
These two operation interfaces will be used in a followup to support
building a callgraph:
* CallOpInterface
- Operations providing this interface are call-like, and have a "call"
target. A call target may be a symbol reference, via SymbolRefAttr, or a
SSA value.
* CallableOpInterface
- Operations providing this interfaces define destinations to call-like
operations, e.g. FuncOp. These operations may define any number of
callable regions.
PiperOrigin-RevId: 270723300
The file was modifiedmlir/lib/Analysis/CMakeLists.txt
The file was modifiedmlir/lib/IR/CMakeLists.txt
The file was modifiedmlir/lib/Support/CMakeLists.txt
The file was addedmlir/include/mlir/Analysis/CallInterfaces.td
The file was modifiedmlir/lib/Dialect/StandardOps/CMakeLists.txt
The file was addedmlir/include/mlir/Analysis/CallInterfaces.h
The file was modifiedmlir/include/mlir/Dialect/StandardOps/Ops.h
The file was modifiedmlir/include/mlir/CMakeLists.txt
The file was addedmlir/include/mlir/Analysis/CMakeLists.txt
The file was modifiedmlir/test/lib/TestDialect/TestOps.td
The file was modifiedmlir/include/mlir/IR/Function.h
The file was modifiedmlir/test/lib/TestDialect/TestDialect.h
The file was addedmlir/lib/Analysis/CallGraph.cpp
The file was modifiedmlir/include/mlir/Dialect/StandardOps/Ops.td
The file was modifiedmlir/include/mlir/IR/Attributes.h
Commit 8cb405a8bed4a6a3782591c5eb447a83857f94c8 by gardener
Add initial callgraph support.
Using the two call interfaces, CallOpInterface and CallableOpInterface,
this change adds support for an initial multi-level CallGraph. This call
graph builds a set of nodes for each callable region, and connects them
via edges. An edge may be any of the following types:
* Abstract
- An edge not produced by a call operation, used for connecting to
internal nodes from external nodes.
* Call
- A call edge is an edge defined via a call-like operation.
* Child
- This is an artificial edge connecting nested callgraph nodes.
This callgraph will be used, and improved upon, to begin supporting more
interesting interprocedural analyses and transformation. In a followup,
this callgraph will be used to support more complex inlining support.
PiperOrigin-RevId: 270724968
The file was addedmlir/test/lib/Transforms/TestCallGraph.cpp
The file was modifiedmlir/test/lib/Transforms/CMakeLists.txt
The file was modifiedmlir/include/mlir/IR/SymbolTable.h
The file was modifiedmlir/lib/Analysis/CallGraph.cpp
The file was addedmlir/test/Analysis/test-callgraph.mlir
The file was addedmlir/include/mlir/Analysis/CallGraph.h
The file was modifiedmlir/lib/IR/SymbolTable.cpp
Commit 5583252173682098a4dfa0fff0fc225b7e2f1034 by gardener
Add convenience methods to set an OpBuilder insertion point after an
Operation (NFC)
PiperOrigin-RevId: 270727180
The file was modifiedmlir/lib/Transforms/PipelineDataTransfer.cpp
The file was modifiedmlir/include/mlir/IR/Builders.h
The file was modifiedmlir/examples/toy/Ch5/mlir/ShapeInferencePass.cpp
The file was modifiedmlir/lib/Conversion/GPUToCUDA/GenerateCubinAccessors.cpp
Commit 98d1d3fc437f5d2b9b3dc99ab79ee734c8127072 by gardener
Simplify the way spirv::StructTypes are parsed.
The existing logic to parse spirv::StructTypes is very brittle. This
change simplifies the parsing logic a lot. The simplification also
allows for memberdecorations to be separated by commas instead of spaces
(which was an artifact of the existing parsing logic). The change also
needs a modification to mlir::parseType to return the number of chars
parsed. Adding a new parseType method to do so.
Also allow specification of spirv::StructType with no members.
PiperOrigin-RevId: 270739672
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/struct.mlir
The file was modifiedmlir/test/IR/invalid.mlir
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVTypes.h
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/Deserializer.cpp
The file was modifiedmlir/lib/Parser/Parser.cpp
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVDialect.cpp
The file was modifiedmlir/include/mlir/Parser.h
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVTypes.cpp
The file was modifiedmlir/test/Dialect/SPIRV/types.mlir
Commit 4a862fbd6337bb926e7a88ed4749b726e1a09ed9 by gardener
Use constant's location for reporting errors in parsing of hex constant
Before this the line following the error would be reported in some
cases.
PiperOrigin-RevId: 270778722
The file was modifiedmlir/lib/Parser/Parser.cpp
The file was modifiedmlir/test/IR/invalid.mlir
Commit 75906bd565a199edb6b9b8088236376d6234a9a6 by gardener
Handle OpMemberName instruction in SPIR-V deserializer.
Sdd support in deserializer for OpMemberName instruction. For now the
name is just processed and not associated with the spirv::StructType
being built. That needs an enhancement to spirv::StructTypes itself. Add
tests to check for errors reported during deserialization with some
refactoring to common out some utility functions. PiperOrigin-RevId:
270794524
The file was modifiedmlir/unittests/Dialect/SPIRV/DeserializationTest.cpp
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/Serializer.cpp
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/Deserializer.cpp
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/SPIRVBinaryUtils.cpp
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVBinaryUtils.h
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVBase.td
The file was modifiedmlir/test/Dialect/SPIRV/ops.mlir
Commit 0e7edcfe7e434221c46fac2a4166c672cbb35de5 by gardener
Let mlir-translate support -split-input-file
Similar to mlir-opt, having a -split-input-file mode is quite useful in
mlir-translate. It allows to put logically related tests in the same
test file for better organization.
PiperOrigin-RevId: 270805467
The file was modifiedmlir/tools/mlir-translate/mlir-translate.cpp
The file was addedmlir/lib/Support/ToolUtilities.cpp
The file was modifiedmlir/lib/Support/CMakeLists.txt
The file was addedmlir/include/mlir/Support/ToolUtilities.h
The file was modifiedmlir/lib/Support/MlirOptMain.cpp
Commit 69af46875479c33cf40fdad96f1517260f9f33fb by gardener
Make spirv::RuntimeArrayType part of spirv::CompositeType.
According to SPIR-V spec, spirv::CompositeType includes
spirv::RuntimeArrayType. This allows using objects of
spirv::RuntimeArrayType with spirv::AccessChainOp. PiperOrigin-RevId:
270809492
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVTypes.cpp
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVTypes.h
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVBase.td
The file was modifiedmlir/test/Dialect/SPIRV/ops.mlir
Commit 6caa4f500b149fd74086e60ff5dbcd33a826c30e by gardener
[spirv] NFC: clean up (de)serialization tests
This CL uses the newly added -split-input-file CLI option to
mlir-translate to combine certain (de)serialization tests. It also
renames certain test filenames.
PiperOrigin-RevId: 270816324
The file was removedmlir/test/Dialect/SPIRV/Serialization/variables_init.mlir
The file was removedmlir/test/Dialect/SPIRV/Serialization/entry_interface.mlir
The file was removedmlir/test/Dialect/SPIRV/Serialization/function_call.mlir
The file was addedmlir/test/Dialect/SPIRV/Serialization/function-call.mlir
The file was addedmlir/test/Dialect/SPIRV/Serialization/entry-point.mlir
The file was addedmlir/test/Dialect/SPIRV/Serialization/arithmetic-ops.mlir
The file was addedmlir/test/Dialect/SPIRV/Serialization/glsl-ops.mlir
The file was removedmlir/test/Dialect/SPIRV/Serialization/array_stride.mlir
The file was removedmlir/test/Dialect/SPIRV/Serialization/select.mlir
The file was removedmlir/test/Dialect/SPIRV/Serialization/variable_reference.mlir
The file was removedmlir/test/Dialect/SPIRV/Serialization/access_chain.mlir
The file was removedmlir/test/Dialect/SPIRV/Serialization/minimal-module.mlir
The file was addedmlir/test/Dialect/SPIRV/Serialization/execution-mode.mlir
The file was removedmlir/test/Dialect/SPIRV/Serialization/rtarray.mlir
The file was addedmlir/test/Dialect/SPIRV/Serialization/spec-constant.mlir
The file was addedmlir/test/Dialect/SPIRV/Serialization/memory-ops.mlir
The file was removedmlir/test/Dialect/SPIRV/Serialization/execution_mode.mlir
The file was removedmlir/test/Dialect/SPIRV/Serialization/spec_constant.mlir
The file was removedmlir/test/Dialect/SPIRV/Serialization/extension.mlir
The file was removedmlir/test/Dialect/SPIRV/Serialization/glslops.mlir
The file was removedmlir/test/Dialect/SPIRV/Serialization/capability.mlir
The file was addedmlir/test/Dialect/SPIRV/Serialization/array.mlir
The file was removedmlir/test/Dialect/SPIRV/Serialization/entry.mlir
The file was removedmlir/test/Dialect/SPIRV/Serialization/bin_ops.mlir
The file was addedmlir/test/Dialect/SPIRV/Serialization/logical-ops.mlir
The file was addedmlir/test/Dialect/SPIRV/Serialization/global-variable.mlir
The file was removedmlir/test/Dialect/SPIRV/Serialization/load_store.mlir
The file was addedmlir/test/Dialect/SPIRV/Serialization/module.mlir
The file was removedmlir/test/Dialect/SPIRV/Serialization/variables.mlir
Commit eba6014cdc1cc1a9d9732a2e9010afde2d9d898e by gardener
Allow null Attribute for value when building GlobalOp.
PiperOrigin-RevId: 270853596
The file was modifiedmlir/lib/Dialect/LLVMIR/IR/LLVMDialect.cpp
Commit 74cdbf5909e57b42b6ed5b3b6eea4f76448a7d48 by gardener
Clone called functions into nested GPU module.
PiperOrigin-RevId: 270891190
The file was modifiedmlir/test/Dialect/GPU/outlining.mlir
The file was modifiedmlir/lib/Dialect/GPU/Transforms/KernelOutlining.cpp
Commit 42d8fa667bcdb81ad305e64a4d6fb0ff1cc4cc3d by gardener
Normalize lowering of MemRef types
The RFC for unifying Linalg and Affine compilation passes into an
end-to-end flow with a predictable ABI and linkage to external function
calls raised the question of why we have variable sized descriptors for
memrefs depending on whether they have static or dynamic dimensions
(https://groups.google.com/a/tensorflow.org/forum/#!topic/mlir/MaL8m2nXuio).
This CL standardizes the ABI on the rank of the memrefs. The LLVM struct
for a memref becomes equivalent to:
``` template <typename Elem, size_t Rank> struct {
Elem *ptr;
int64_t sizes[Rank];
};
```
PiperOrigin-RevId: 270947276
The file was modifiedmlir/test/Conversion/StandardToLLVM/convert-argattrs.mlir
The file was modifiedmlir/test/Conversion/StandardToLLVM/convert-to-llvmir.mlir
The file was modifiedmlir/examples/Linalg/Linalg1/lib/ConvertToLLVMDialect.cpp
The file was modifiedmlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp
The file was modifiedmlir/examples/toy/Ch5/mlir/LateLowering.cpp
The file was modifiedmlir/g3doc/ConversionToLLVMDialect.md
The file was modifiedmlir/test/Examples/Linalg/Linalg1.mlir
The file was modifiedmlir/test/Conversion/StandardToLLVM/standard-to-llvm.mlir
The file was modifiedmlir/test/Conversion/StandardToLLVM/convert-memref-ops.mlir
Commit 458ede8775d0180434692cada24c12eb25839efc by gardener
Introduce splat op + provide its LLVM lowering
- introduce splat op in standard dialect (currently for int/float/index
input
type, output type can be vector or statically shaped tensor)
- implement LLVM lowering (when result type is 1-d vector)
- add constant folding hook for it
- while on Ops.cpp, fix some stale names
Signed-off-by: Uday Bondhugula <uday@polymagelabs.com>
Closes tensorflow/mlir#141
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/141
from bondhugula:splat 48976a6aa0a75be6d91187db6418de989e03eb51
PiperOrigin-RevId: 270965304
The file was modifiedmlir/test/IR/core-ops.mlir
The file was modifiedmlir/utils/vim/syntax/mlir.vim
The file was modifiedmlir/test/Conversion/StandardToLLVM/convert-to-llvmir.mlir
The file was modifiedmlir/g3doc/LangRef.md
The file was modifiedmlir/include/mlir/Dialect/StandardOps/Ops.td
The file was modifiedmlir/g3doc/Dialects/Standard.md
The file was modifiedmlir/lib/Dialect/StandardOps/Ops.cpp
The file was modifiedmlir/test/Transforms/constant-fold.mlir
The file was modifiedmlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp
The file was modifiedmlir/test/IR/invalid-ops.mlir
Commit 635544fc120cc3956f909af08d861dca9b709fef by gardener
Allow attaching descriptions to OpInterfaces and InterfaceMethods.
This change adds support for documenting interfaces and their methods. A
tablegen generator for the interface documentation is also
added(gen-op-interface-doc).
Documentation is added to an OpInterface via the `description` field:
def MyOpInterface : OpInterface<"MyOpInterface"> {
let description = [{
   My interface is very interesting.
}];
}
Documentation is added to an InterfaceMethod via a new `description`
field that comes right before the optional body:
InterfaceMethod<"void", "foo", (ins), [{
This is the foo method.
}]>,
PiperOrigin-RevId: 270965485
The file was modifiedmlir/tools/mlir-tblgen/OpInterfacesGen.cpp
The file was modifiedmlir/include/mlir/IR/OpBase.td
The file was modifiedmlir/g3doc/OpDefinitions.md
The file was modifiedmlir/tools/mlir-tblgen/OpDocGen.cpp
The file was modifiedmlir/include/mlir/Analysis/CallInterfaces.td
The file was modifiedmlir/include/mlir/Dialect/Linalg/IR/LinalgLibraryOps.td
The file was addedmlir/tools/mlir-tblgen/DocGenUtilities.h
Commit f7ad5b411c7b051565d9a3c372882f44f1719e0b by gardener
NFC: Add a description to the ODS interface example. PiperOrigin-RevId:
270978748
The file was modifiedmlir/g3doc/Interfaces.md
Commit cf00feed037bdd9d2d53d3ff34fc90378247038a by gardener
[spirv] Replace bitwiseCast with llvm::bit_cast
PiperOrigin-RevId: 271035618
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVOps.cpp
Commit c5284fe85ed547a25007f67ce5449a34f0d1f3a1 by gardener
Add support for GLSL Binary ops, and use it to implement GLSL FMax.
A base class is added to implement all GLSL Binary operations and is
used to implement the FMax operation. The existing framework already
generates all the necessary (de)serialization code.
PiperOrigin-RevId: 271037166
The file was modifiedmlir/test/Dialect/SPIRV/glslops.mlir
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/glsl-ops.mlir
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVGLSLOps.td
Commit 03db4223598a6757f3ac7dc5f65135fe5e508e17 by gardener
NFC: Add 'const' dereference method to OperandTypeIterator.
The deference provided by mapped_iterator is non-const.
PiperOrigin-RevId: 271051375
The file was modifiedmlir/include/mlir/IR/Operation.h
Commit 3a4bee0fe1883dfad62233675513c61fdaa060f5 by gardener
Miscellaneous fixes to SPIR-V Deserializer (details below).
1) Process and ignore the following debug instructions: OpSource,
OpSourceContinued, OpSourceExtension, OpString, OpModuleProcessed. 2)
While processing OpTypeInt instruction, ignore the signedness
specification. Currently MLIR doesnt make a distinction between signed
and unsigned integer types. 3) Process and ignore BufferBlock decoration
(similar to Buffer decoration). StructType needs to be enhanced to track
this attribute since its needed for proper validation checks. 4) Report
better error for unhandled instruction during deserialization.
PiperOrigin-RevId: 271057060
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/Deserializer.cpp
The file was modifiedmlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVBase.td
Commit 4e32dc9b8ae3735a49f8e4ce23a620044f51c55f by gardener
Forward declare LogicalResult as a struct to be consistent
This addresses a MSVC linker error saying splitAndProcessBuffer was
unresolved.
PiperOrigin-RevId: 271126570
The file was modifiedmlir/include/mlir/Support/ToolUtilities.h
Commit b76c4f878025f112af28f38e4a88ce97e2c249cd by gardener
Fix memref-stride-calculation on Windows
Call llvm::outs().flush() to make sure we don't mix streams. Remove
CHECK-LABEL to avoid assuming the relative order between the additional
info and the output IR.
PiperOrigin-RevId: 271131100
The file was modifiedmlir/test/AffineOps/memref-stride-calculation.mlir
The file was modifiedmlir/test/lib/Transforms/TestMemRefStrideCalculation.cpp
Commit 9b7435fb50230621b5660a8d3dad51c40c6c348d by gardener
Add tablegen verification traits for comparing different properties
This allows things like comparing the rank of one operand to the size of
another that specifies indices into it.
PiperOrigin-RevId: 271150439
The file was modifiedmlir/test/lib/TestDialect/TestOps.td
The file was modifiedmlir/test/mlir-tblgen/types.mlir
The file was modifiedmlir/include/mlir/IR/OpBase.td
Commit 3848baec69e3e5f67b5cefb59543a701553a1b09 by gardener
Emit function name being tested in TestMemRefStrideCalculation
Bring back CHECK-LABEL post
PiperOrigin-RevId: 271166428
The file was modifiedmlir/test/AffineOps/memref-stride-calculation.mlir
The file was modifiedmlir/test/lib/Transforms/TestMemRefStrideCalculation.cpp
Commit a2bce652af5ed78ff2463cfe927f880e8bb54b49 by gardener
Minor spelling tweaks
Closes tensorflow/mlir#145
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/145
from kiszk:spelling_tweaks_g3doc
ae9140aab5b797441e880d43e557903585815e40 PiperOrigin-RevId: 271173907
The file was modifiedmlir/g3doc/MLIRForGraphAlgorithms.md
The file was modifiedmlir/g3doc/Dialects/LLVM.md
The file was modifiedmlir/g3doc/GenericDAGRewriter.md
The file was modifiedmlir/g3doc/DefiningAttributesAndTypes.md
The file was modifiedmlir/g3doc/RationaleSimplifiedPolyhedralForm.md
The file was modifiedmlir/g3doc/Rationale.md
The file was modifiedmlir/g3doc/Tutorials/Toy/Ch-1.md
The file was modifiedmlir/g3doc/QuickstartRewrites.md
The file was modifiedmlir/g3doc/Dialects/Vector.md
The file was modifiedmlir/g3doc/DeclarativeRewrites.md
The file was modifiedmlir/g3doc/DeveloperGuide.md
The file was modifiedmlir/g3doc/Dialects/Affine.md
The file was modifiedmlir/g3doc/Dialects/SPIR-V.md
The file was modifiedmlir/g3doc/Quantization.md
The file was modifiedmlir/g3doc/Canonicalization.md
The file was modifiedmlir/g3doc/TestingGuide.md
The file was modifiedmlir/g3doc/LangRef.md
The file was modifiedmlir/g3doc/Tutorials/Linalg/LLVMConversion.md
The file was modifiedmlir/g3doc/OpDefinitions.md
The file was modifiedmlir/g3doc/Tutorials/Linalg/Ch-1.md
Commit ae13c28f3f69843fc1b98d63be42f3b00ce8d2a0 by gardener
[spirv] Add SPV_UnaryOp and spv.FNegate
This CL also moves common parsers and printers to the same section in
SPIRVOps.cpp.
PiperOrigin-RevId: 271233546
The file was modifiedmlir/test/Dialect/SPIRV/arithmetic-ops.mlir
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVArithmeticOps.td
The file was modifiedmlir/test/Dialect/SPIRV/Serialization/arithmetic-ops.mlir
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVGLSLOps.td
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVBase.td
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVOps.cpp
The file was modifiedmlir/utils/spirv/gen_spirv_dialect.py
Commit 47a7021cc3b0858e53c52a468b234a3f1a4c4abf by gardener
Change the return type of createPrintCFGGraphPass to match other passes.
PiperOrigin-RevId: 271252404
The file was modifiedmlir/lib/Transforms/ViewRegionGraph.cpp
The file was modifiedmlir/include/mlir/Transforms/ViewRegionGraph.h
Commit 6f0e65441c5cd018e8b0ad5c340435c0ee57eea1 by gardener
Add spv.Bitcast operation to SPIR-V dialect
Support the OpBitcast instruction of SPIR-V using the spv.Bitcast
operation. The semantics implemented in the dialect differ from the
SPIR-V spec in that the dialect does not allow conversion to/from
pointer types from/to non-pointer types.
PiperOrigin-RevId: 271255957
The file was modifiedmlir/test/Dialect/SPIRV/ops.mlir
The file was addedmlir/test/Dialect/SPIRV/Serialization/cast-ops.mlir
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVBase.td
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVOps.cpp
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVOps.td
Commit 94298cea933991b29dcb7f340725bc25e78cebcf by gardener
Remove unused variables and methods to address compiler warnings
PiperOrigin-RevId: 271256784
The file was modifiedmlir/lib/Dialect/SPIRV/Serialization/Deserializer.cpp
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/LowerToLLVMDialect.cpp
The file was modifiedmlir/lib/TableGen/Pattern.cpp
The file was modifiedmlir/tools/mlir-tblgen/SPIRVUtilsGen.cpp
Commit 116dac00baa6870aec2a2b469b2d6f95c2fbb316 by gardener
Add AllReduceOp to GPU dialect with lowering to NVVM.
The reduction operation is currently fixed to "add", and the scope is
fixed to "workgroup".
The implementation is currently limited to sizes that are multiple 32
(warp size) and no larger than 1024.
PiperOrigin-RevId: 271290265
The file was addedmlir/test/mlir-cuda-runner/all-reduce.mlir
The file was modifiedmlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp
The file was modifiedmlir/test/Dialect/GPU/ops.mlir
The file was modifiedmlir/include/mlir/Dialect/GPU/GPUOps.td
The file was modifiedmlir/test/Conversion/GPUToNVVM/gpu-to-nvvm.mlir
Commit 99be3351b874444498c03a87e2aeec6f2f8c208d by gardener
Drop support for memrefs from JitRunner
The support for functions taking and returning memrefs of floats was
introduced in the first version of the runner, created before MLIR had
reliable lowering of allocation/deallocation to library calls.  It
forcibly runs MLIR transformation convering affine, loop and standard
dialects into the LLVM dialect, unlike the other runner flows that
accept the LLVM dialect directly. Memref support leads to more complex
layering and is generally fragile.  Drop it in favor of functions
returning a scalar, or library-based function calls to print memrefs and
other data structures.
PiperOrigin-RevId: 271330839
The file was modifiedmlir/lib/Support/JitRunner.cpp
The file was modifiedmlir/test/mlir-cpu-runner/simple.mlir
The file was modifiedmlir/tools/mlir-cpu-runner/CMakeLists.txt
Commit 445232df0b43cd8a6fdf34392626c61f819c94f2 by gardener
Decouple tiling from fusion in Linalg.
This CL modifies the linalg-fusion pass such that it does not tile
anymore as part of the pass. Tiling is a separate concern that enables
linalg fusion but should happen before. This makes fusion more
composable with other decisions. In particular the fusion pass now
becomes greedy and only applies the transformation on a best-effort
basis.
This should also let fusion work in a multi-hop fashion with chains of
producer/consumers.
Since the fusion pass does not perform tiling anymore, tests are
rewritten to be in pretiled form and make the intent of the test clearer
(albeit more verbose).
PiperOrigin-RevId: 271357741
The file was modifiedmlir/include/mlir/Dialect/Linalg/Passes.h
The file was modifiedmlir/lib/Dialect/Linalg/Analysis/DependenceAnalysis.cpp
The file was modifiedmlir/lib/Dialect/Linalg/CMakeLists.txt
The file was modifiedmlir/test/Dialect/Linalg/fusion-2-level.mlir
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/Fusion.cpp
The file was modifiedmlir/test/Dialect/Linalg/fusion.mlir
Commit 19841775d4c18385379b7fcec52b05e58b82026b by gardener
Make result ops generated output deterministic
Sort the result ops reported in lexographical order.
PiperOrigin-RevId: 271426258
The file was modifiedmlir/tools/mlir-tblgen/RewriterGen.cpp
Commit 7385d8789560a392971c60426c7d17569551bd32 by gardener
Disable failing tests
PiperOrigin-RevId: 271460509
The file was modifiedmlir/test/mlir-cpu-runner/simple.mlir
The file was modifiedmlir/test/mlir-cpu-runner/linalg_integration_test.mlir
Commit fee40fef5c37fee2b398d4d6ec28958bf5c0c0f5 by gardener
[ROCm] Adding ROCDL Dialect.
This commit introduces the ROCDL Dialect (i.e. the ROCDL ops + the code
to lower those ROCDL ops to LLWM intrinsics/functions). Think of ROCDL
Dialect as analogous to the NVVM Dialect, but for AMD GPUs. This patch
contains just the essentials needed to get a simple example up and
running. We expect to make further additions to the ROCDL Dialect.
This is the first of 3 commits, the follow-up will be:
* add a pass that lowers GPU Dialect to ROCDL Dialect
* add a "mlir-rocm-runner" utility
Closes tensorflow/mlir#146
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/146
from deven-amd:deven-rocdl-dialect
e78e8005c75a78912631116c78dc844fcc4b0de9 PiperOrigin-RevId: 271511259
The file was addedmlir/lib/Dialect/LLVMIR/IR/ROCDLDialect.cpp
The file was addedmlir/lib/Target/LLVMIR/ConvertToROCDLIR.cpp
The file was modifiedmlir/include/mlir/Dialect/LLVMIR/CMakeLists.txt
The file was addedmlir/include/mlir/Dialect/LLVMIR/ROCDLOps.td
The file was modifiedmlir/tools/mlir-translate/CMakeLists.txt
The file was modifiedmlir/lib/Dialect/LLVMIR/CMakeLists.txt
The file was addedmlir/include/mlir/Target/ROCDLIR.h
The file was addedmlir/test/Dialect/LLVMIR/rocdl.mlir
The file was modifiedmlir/lib/Target/CMakeLists.txt
The file was addedmlir/test/Target/rocdl.mlir
The file was modifiedmlir/tools/mlir-opt/CMakeLists.txt
The file was addedmlir/include/mlir/Dialect/LLVMIR/ROCDLDialect.h
Commit 18f4a37836a2de53b043053239b825bb2a3282dd by gardener
Fix missing links in the documentation
Closes tensorflow/mlir#149
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/149
from kiszk:missing_links_g3doc 5f98bc279649d54ea3dcf9fe0e17be6ad6d6cb8f
PiperOrigin-RevId: 271568274
The file was modifiedmlir/g3doc/Tutorials/Toy/Ch-1.md
The file was modifiedmlir/g3doc/LangRef.md
The file was modifiedmlir/g3doc/WritingAPass.md
The file was modifiedmlir/g3doc/Dialects/Affine.md
The file was modifiedmlir/g3doc/OpDefinitions.md
The file was modifiedmlir/g3doc/Dialects/Vector.md
Commit e39b5a19ba2e5ed89975c1906ae2994b4d70cca8 by gardener
Fix Documentation OpDefinitions.md
Add missing semicolon for the builders example.
Closes tensorflow/mlir#150
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/150
from denis0x0D:sandbox/doc_fix 07e3680e678bf141a70af7747136e9fde7b4cc0a
PiperOrigin-RevId: 271568527
The file was modifiedmlir/g3doc/OpDefinitions.md
Commit 6543e99fe51b9077d8185ba9741770adc5f7cde5 by gardener
Fix JitRunner.cpp Error creation pattern and reactivate tests.
linalg_integration_test.mlir and simple.mlir were temporarily disabled
due to an OSS-only failure.
The issue is that, once created, an llvm::Error must be explicitly
checked before it can be discarded or overwritten.
This CL fixes the issue and reenable the test.
PiperOrigin-RevId: 271589651
The file was modifiedmlir/test/mlir-cpu-runner/simple.mlir
The file was modifiedmlir/test/mlir-cpu-runner/linalg_integration_test.mlir
The file was modifiedmlir/lib/Support/JitRunner.cpp
Commit ddf737c5da728f25c5e0413bc737d04b2d92df96 by gardener
Promote MemRefDescriptor to a pointer to struct when passing function
boundaries in LLVMLowering.
The strided MemRef RFC discusses a normalized descriptor and interaction
with library calls
(https://groups.google.com/a/tensorflow.org/forum/#!topic/mlir/MaL8m2nXuio).
Lowering of nested LLVM structs as value types does not play nicely with
externally compiled C/C++ functions due to ABI issues. Solving the ABI
problem generally is a very complex problem and most likely involves
taking a dependence on clang that we do not want atm.
A simple workaround is to pass pointers to memref descriptors at
function boundaries, which this CL implement.
PiperOrigin-RevId: 271591708
The file was modifiedmlir/test/Dialect/GPU/invalid.mlir
The file was modifiedmlir/lib/Conversion/GPUToCUDA/ConvertLaunchFuncToCudaCalls.cpp
The file was modifiedmlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp
The file was modifiedmlir/test/Examples/Linalg/Linalg1.mlir
The file was modifiedmlir/test/Conversion/StandardToLLVM/convert-memref-ops.mlir
The file was modifiedmlir/include/mlir/Conversion/StandardToLLVM/ConvertStandardToLLVM.h
The file was modifiedmlir/tools/mlir-cuda-runner/cuda-runtime-wrappers.cpp
The file was modifiedmlir/test/Conversion/StandardToLLVM/standard-to-llvm.mlir
The file was modifiedmlir/test/Conversion/StandardToLLVM/convert-funcs.mlir
The file was modifiedmlir/examples/Linalg/Linalg3/Execution.cpp
The file was modifiedmlir/lib/Dialect/GPU/IR/GPUDialect.cpp
The file was modifiedmlir/test/Conversion/StandardToLLVM/convert-argattrs.mlir
The file was modifiedmlir/include/mlir/Transforms/DialectConversion.h
The file was modifiedmlir/lib/Transforms/DialectConversion.cpp
Commit 74eabdd14eb3ed697d6dc4d72c3423ec81dd80f4 by gardener
NFC - clean up op accessor usage, std.load/store op verify, other stale
info
- also remove stale terminology/references in docs
Signed-off-by: Uday Bondhugula <uday@polymagelabs.com>
Closes tensorflow/mlir#148
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/148
from bondhugula:cleanup e846b641a3c2936e874138aff480a23cdbf66591
PiperOrigin-RevId: 271618279
The file was modifiedmlir/lib/Transforms/Utils/LoopFusionUtils.cpp
The file was modifiedmlir/lib/Transforms/Utils/LoopUtils.cpp
The file was modifiedmlir/include/mlir/Dialect/AffineOps/AffineOps.h
The file was modifiedmlir/include/mlir/Analysis/NestedMatcher.h
The file was modifiedmlir/lib/Dialect/StandardOps/Ops.cpp
The file was modifiedmlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
The file was modifiedmlir/lib/Dialect/AffineOps/AffineOps.cpp
The file was modifiedmlir/g3doc/Rationale.md
The file was modifiedmlir/lib/Transforms/MaterializeVectors.cpp
The file was modifiedmlir/include/mlir/Dialect/StandardOps/Ops.td
The file was modifiedmlir/lib/Transforms/LowerAffine.cpp
The file was modifiedmlir/lib/Transforms/LoopTiling.cpp
The file was modifiedmlir/test/IR/core-ops.mlir
Commit bc4984e4f7c40ae9a51c84bcd3c4bb4c876b0b13 by gardener
Add TODO to revisit coupling of CallOp to MemRefType lowering
PiperOrigin-RevId: 271619132
The file was modifiedmlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp
Commit b569c969f0e3aec63f13b97b99a05f70a17867ad by gardener
Remove spurious debug spew in tests
PiperOrigin-RevId: 271624731
The file was modifiedmlir/test/Examples/Linalg/Linalg1.mlir
The file was modifiedmlir/test/Conversion/StandardToLLVM/standard-to-llvm.mlir
The file was modifiedmlir/test/Conversion/StandardToLLVM/convert-funcs.mlir
The file was modifiedmlir/test/Conversion/StandardToLLVM/convert-memref-ops.mlir
Commit 5f8dff936b3015f161537a65b5e64a5f93cb2322 by gardener
Append a newline when dumping a Value.
This is more consistent with other dump methods. Otherwise successive
Value dumps are concatenated in same line, hurting readability.
PiperOrigin-RevId: 271669846
The file was modifiedmlir/lib/IR/AsmPrinter.cpp
Commit e7c3ca92f846fd757fd755b2fa0c908bb1775b1b by gardener
Tablegen helpers for accessing properties of shaped types
Tablegen's lack of functions continues to be annoying
PiperOrigin-RevId: 271680947
The file was modifiedmlir/include/mlir/IR/OpBase.td
The file was modifiedmlir/test/lib/TestDialect/TestOps.td
Commit c57f202c8cbb14f3f8a403056c56011cd10f93c9 by gardener
Switch explicit create methods to match generated build's order
The generated build methods have result type before the arguments
(operands and attributes, which are also now adjacent in the explicit
create method). This also results in changing the create method's
ordering to match most build method's ordering.
PiperOrigin-RevId: 271755054
The file was modifiedmlir/unittests/IR/OperationSupportTest.cpp
The file was modifiedmlir/lib/Parser/Parser.cpp
The file was modifiedmlir/lib/IR/Operation.cpp
The file was modifiedmlir/lib/Transforms/DialectConversion.cpp
The file was modifiedmlir/include/mlir/IR/Operation.h
Commit b6cec098f930932a557a3db6a8a9cab65e27e62a by gardener
Fix syntax of 'call' and 'splat' ops
- fix missing return value syntax on call / splat ops
- reflow cond_br / store op syntax
Closes tensorflow/mlir#161
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/161
from bondhugula:patch-1 2beb5bdcb387a5e7c52438985f79e2987d3b3ebe
PiperOrigin-RevId: 271876453
The file was modifiedmlir/g3doc/Dialects/Standard.md
Commit 0db0fe3c0396f1b43ea7fd7588d01a5d947350af by gardener
Fix a typo in Toy Chapter 2 tutorial documentation
Closes tensorflow/mlir#155
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/155
from Robertorosmaninho:patch-1 232ac4e1253948c7f3150515e93abe50fcec2f96
PiperOrigin-RevId: 271876515
The file was modifiedmlir/g3doc/Tutorials/Toy/Ch-2.md
Commit f45a39256603a2cb7f6818cc6a07d9029bf703d2 by gardener
update Rationale.md - remove outdated info
- removing outdated/confusing info
- the affine dialect is missing documentation on
affine.load/affine.store; the references herein have to be updated
once that's updated.
Signed-off-by: Uday Bondhugula <uday@polymagelabs.com>
Closes tensorflow/mlir#159
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/159
from bondhugula:doc 86dd794f2d0d7fd097dde5764c62eb406ed4f910
PiperOrigin-RevId: 271876525
The file was modifiedmlir/g3doc/Rationale.md
Commit e5a43186d38c239380c22c2629dff748677c4bd1 by gardener
Add InferTypeOpTrait & enable generating its member function definition
Use OpInterfaces to add an interface for ops defining a return type
function.
This change does not use this trait in any meaningful way, I'll use it
in a follow up to generalize and unify some of the op type
traits/constraints. Also, currently the infer type function can only be
manually specified in C++, that should rather be the fallback in future.
PiperOrigin-RevId: 271883746
The file was addedmlir/include/mlir/Analysis/InferTypeOpInterface.h
The file was addedmlir/lib/Analysis/InferTypeOpInterface.cpp
The file was modifiedmlir/include/mlir/Analysis/CMakeLists.txt
The file was modifiedmlir/test/lib/TestDialect/TestOps.td
The file was modifiedmlir/test/lib/TestDialect/TestPatterns.cpp
The file was modifiedmlir/lib/Analysis/CMakeLists.txt
The file was addedmlir/test/mlir-tblgen/return-types.mlir
The file was modifiedmlir/test/lib/TestDialect/TestDialect.cpp
The file was addedmlir/include/mlir/Analysis/InferTypeOpInterface.td
The file was modifiedmlir/test/lib/TestDialect/TestDialect.h
Commit 3d9679bde4de0250207ee6282a5359df41e54e75 by gardener
Switch comments from GPU dialect terms to CUDA terms (NFC).
local workgroup -> block, subgroup -> warp, invocation -> thread.
PiperOrigin-RevId: 271946342
The file was modifiedmlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp
Commit 1ce524623cd6150e7938e42c9301720af198fde5 by gardener
Fix MemRefType::getStrides corner case
MemRefType::getStrides uses AffineExpr::walk which operates in
post-order from the leaves. In order to compute strides properly, it
needs to escape on terminal nodes and analyze binary ops only. This did
not work for AffineExpr that consist of a single term (i.e. without a
binary op).
This CL fixes the corner case and adds relevant tests.
PiperOrigin-RevId: 271975746
The file was modifiedmlir/lib/IR/StandardTypes.cpp
The file was modifiedmlir/include/mlir/IR/StandardTypes.h
The file was modifiedmlir/test/AffineOps/memref-stride-calculation.mlir
The file was modifiedmlir/test/lib/Transforms/TestMemRefStrideCalculation.cpp
Commit a932f0786c25db7607470925021758b40cbb9835 by gardener
Use MaybeAlign when setting alignment
PiperOrigin-RevId: 272000548
The file was modifiedmlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
Commit 2f7bb1e25f1be3ee5c6dce72aa1eced4c823f123 by gardener
Add support for Logical Ops in SPIR-V dialect
Add operations corresponding to OpLogicalAnd, OpLogicalNot,
OpLogicalEqual, OpLogicalNotEqual and OpLogicalOr instructions in SPIR-V
dialect. This needs changes to class hierarchy in SPIR-V TableGen files
to split SPIRVLogicalOp into SPIRVLogicalUnaryOp and
SPIRVLogicalBinaryOp. All derived classes of SPIRVLogicalOp are updated
accordingly.
Update the spirv dialect generation script to 1) Allow specifying base
class to use for instruction spec generation and file name to generate
the specification in separately. 2) Use the existing descriptions for
operations. 3) Update define_inst.sh to also invoke define_opcode.sh to
also define the corresponding SPIR-V instruction opcode enum.
PiperOrigin-RevId: 272014876
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVBase.td
The file was modifiedmlir/test/Dialect/SPIRV/ops.mlir
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVLogicalOps.td
The file was modifiedmlir/utils/spirv/gen_spirv_dialect.py
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVOps.cpp
The file was modifiedmlir/utils/spirv/define_inst.sh
Commit 2713f3638e5905f5fb938a84fadd950040f4bbf9 by gardener
[DRR] Explain result type deduction in doc
PiperOrigin-RevId: 272031467
The file was modifiedmlir/g3doc/DeclarativeRewrites.md
Commit 923b33ea16ac8734bc7430ccb4cc4169d0bce785 by gardener
Normalize MemRefType lowering to LLVM as strided MemRef descriptor
This CL finishes the implementation of the lowering part of the [strided
memref
RFC](https://groups.google.com/a/tensorflow.org/forum/#!topic/mlir/MaL8m2nXuio).
Strided memrefs correspond conceptually to the following templated C++
struct:
``` template <typename Elem, size_t Rank> struct {
Elem *ptr;
int64_t offset;
int64_t sizes[Rank];
int64_t strides[Rank];
};
``` The linearization procedure for address calculation for strided
memrefs is the same as for linalg views:
`base_offset + SUM_i index_i * stride_i`.
The following CL will unify Linalg and Standard by removing !linalg.view
in favor of strided memrefs.
PiperOrigin-RevId: 272033399
The file was modifiedmlir/g3doc/ConversionToLLVMDialect.md
The file was modifiedmlir/lib/IR/StandardTypes.cpp
The file was modifiedmlir/include/mlir/IR/StandardTypes.h
The file was modifiedmlir/examples/Linalg/Linalg3/Execution.cpp
The file was modifiedmlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp
The file was modifiedmlir/test/lib/Transforms/TestMemRefStrideCalculation.cpp
The file was modifiedmlir/test/Conversion/StandardToLLVM/standard-to-llvm.mlir
The file was modifiedmlir/tools/mlir-cuda-runner/cuda-runtime-wrappers.cpp
The file was modifiedmlir/test/Conversion/StandardToLLVM/convert-to-llvmir.mlir
The file was modifiedmlir/test/Conversion/StandardToLLVM/convert-argattrs.mlir
The file was modifiedmlir/examples/Linalg/Linalg1/lib/ConvertToLLVMDialect.cpp
The file was modifiedmlir/test/Examples/Linalg/Linalg1.mlir
The file was modifiedmlir/test/Conversion/StandardToLLVM/convert-memref-ops.mlir
Commit c97a9320a0eb20c7cba5bb23e4ff5ca46cadd4e0 by gardener
Adding some missing SPIR-V core and GLSL extended ops.
PiperOrigin-RevId: 272039887
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVBase.td
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVGLSLOps.td
Commit 8e67039e31dc77f4762173c45052928983d0cb4e by gardener
NFC: Change `classof` on registered operations to use pointer
comparison.
The current implementation always uses string comparison, but if the
operation is registered the AbstractOperation instance can be used to
provide faster pointer comparison.
PiperOrigin-RevId: 272041333
The file was modifiedmlir/include/mlir/IR/OpDefinition.h
Commit 0b81eb928b3882ccb63e38ef26348fd0fb75c2cd by gardener
Enable autogenerating OpInterface method declarations
Add DeclareOpInterfaceFunctions to enable specifying whether
OpInterfaceMethods for an OpInterface should be generated automatically.
This avoids needing to declare the extra methods, while also allowing
adding function declaration by way of trait/inheritance.
Most of this change is mechanical/extracting classes to be reusable.
PiperOrigin-RevId: 272042739
The file was modifiedmlir/tools/mlir-tblgen/OpInterfacesGen.cpp
The file was modifiedmlir/include/mlir/IR/OpBase.td
The file was modifiedmlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
The file was modifiedmlir/test/lib/TestDialect/TestOps.td
The file was modifiedmlir/include/mlir/TableGen/OpTrait.h
The file was addedmlir/include/mlir/TableGen/OpInterfaces.h
The file was modifiedmlir/g3doc/OpDefinitions.md
The file was addedmlir/lib/TableGen/OpInterfaces.cpp
The file was modifiedmlir/lib/TableGen/OpTrait.cpp
Commit f015b020f3dc4cfddd7fee9b5dd1d8474bdc98bc by gardener
Add missing file from cmakelist
PiperOrigin-RevId: 272054623
The file was modifiedmlir/lib/TableGen/CMakeLists.txt
Commit 5ef8b2d31e708b7fd87715b4cc94233501651cab by gardener
Adding signed integer ops for abs, sign, min, and max in the GLSL
extension.
PiperOrigin-RevId: 272067942
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVGLSLOps.td
Commit 219421ece7426d7e28c81c98b17bc3a6da77f0dd by gardener
[spirv] Add array length check.
According to the SPIR-V spec:
"Length is the number of elements in the array. It must be at least 1."
Closes tensorflow/mlir#160
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/160
from denis0x0D:sandbox/array_len
0840dc0986ad0088a3aa7d5d8d3e97d489377ed9 PiperOrigin-RevId: 272094669
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVDialect.cpp
The file was modifiedmlir/lib/Dialect/SPIRV/SPIRVTypes.cpp
The file was modifiedmlir/test/Dialect/SPIRV/types.mlir
Commit fb41df9c4adb8249660623480a77e31146eb8d85 by gardener
Format markdown list.
PiperOrigin-RevId: 272095611
The file was modifiedmlir/g3doc/Rationale.md
Commit 1c649d57857d866daf2439b50c17eb835754e2dc by gardener
Pass the pointer of the parent pipeline collection pass to
PassInstrumentation::run*Pipeline.
For the cases where there are multiple levels of nested pass managers,
the parent thread ID is not enough to distinguish the parent of a given
pass pipeline. Passing in the parent pass gives an exact anchor point.
PiperOrigin-RevId: 272105461
The file was modifiedmlir/lib/Pass/PassTiming.cpp
The file was modifiedmlir/include/mlir/Pass/PassInstrumentation.h
The file was modifiedmlir/lib/Pass/Pass.cpp
Commit 66bcd05bb7ed1653d3dc1619c20dcaa858471c9f by gardener
Fold away reduction over 0 dimensions.
PiperOrigin-RevId: 272113564
The file was modifiedmlir/tools/mlir-tblgen/OpDefinitionsGen.cpp
Commit f479f816f99aea10f1f2d09282b90c7695a8b0c6 by gardener
Add integer shift ops to LLVM dialect.
PiperOrigin-RevId: 272140049
The file was modifiedmlir/test/Target/llvmir.mlir
The file was modifiedmlir/include/mlir/Dialect/LLVMIR/LLVMOps.td
Commit 8503ffbe3af8a7b9c30f668353054a3721263374 by gardener
Add verification error message for ops that require at least one operand
or result.
PiperOrigin-RevId: 272153634
The file was modifiedmlir/lib/IR/Operation.cpp
The file was modifiedmlir/test/lib/TestDialect/TestOps.td
The file was modifiedmlir/test/IR/traits.mlir
Commit 1129931a625b19b57800c938f528b53f9ce737c1 by gardener
Change all_reduce lowering to support 2D and 3D blocks.
Perform second reduce only with first warp. This requires an additional
__sync_threads(), but doesn't need special handling when the last warp
is small. This simplifies support for block sizes that are not multiple
of 32.
Supporting partial warp reduce will be done in a separate CL.
PiperOrigin-RevId: 272168917
The file was modifiedmlir/test/mlir-cuda-runner/all-reduce.mlir
The file was modifiedmlir/lib/Conversion/GPUToNVVM/LowerGpuOpsToNVVMOps.cpp
Commit f8ae7396130d7483b7038fa3639751980e8e5dc4 by gardener
[spirv] NFC: rename SPV_ArithmeticOp to SPV_ArithmeticBinaryOp
Also rename SPV_UnaryArithmeticOp to SPV_ArithmeticUnaryOp to be
consistent.
PiperOrigin-RevId: 272173974
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVArithmeticOps.td
Commit e36337a998a6be39d65872eab3e3e2291b6518b9 by gardener
Unify Linalg types by using strided memrefs
This CL finishes the implementation of the Linalg + Affine type
unification of the [strided memref
RFC](https://groups.google.com/a/tensorflow.org/forum/#!topic/mlir/MaL8m2nXuio).
As a consequence, the !linalg.view type, linalg::DimOp, linalg::LoadOp
and linalg::StoreOp can now disappear and Linalg can use standard types
everywhere.
PiperOrigin-RevId: 272187165
The file was modifiedmlir/lib/IR/StandardTypes.cpp
The file was modifiedmlir/include/mlir/Dialect/Linalg/IR/LinalgBase.td
The file was modifiedmlir/test/lib/Transforms/TestMemRefStrideCalculation.cpp
The file was modifiedmlir/lib/Dialect/Linalg/IR/LinalgTypes.cpp
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/Tiling.cpp
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/LowerToLoops.cpp
The file was modifiedmlir/include/mlir/Dialect/Linalg/IR/LinalgLibraryOps.td
The file was modifiedmlir/lib/Dialect/Linalg/Analysis/DependenceAnalysis.cpp
The file was modifiedmlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp
The file was modifiedmlir/include/mlir/Dialect/Linalg/Utils/Intrinsics.h
The file was modifiedmlir/include/mlir/IR/OpBase.td
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/Fusion.cpp
The file was modifiedmlir/include/mlir/Dialect/Linalg/Utils/Utils.h
The file was modifiedmlir/include/mlir/Dialect/Linalg/IR/LinalgTypes.h
The file was modifiedmlir/test/Dialect/Linalg/fusion-2-level.mlir
The file was modifiedmlir/test/Dialect/Linalg/tile.mlir
The file was removedmlir/test/Dialect/Linalg/canonicalize.mlir
The file was modifiedmlir/include/mlir/Dialect/Linalg/IR/LinalgOps.td
The file was modifiedmlir/test/Dialect/Linalg/loops.mlir
The file was modifiedmlir/include/mlir/IR/StandardTypes.h
The file was modifiedmlir/test/Dialect/Linalg/tile_conv.mlir
The file was modifiedmlir/test/mlir-cpu-runner/linalg_integration_test.mlir
The file was modifiedmlir/test/Dialect/Linalg/roundtrip.mlir
The file was modifiedmlir/include/mlir/Dialect/Linalg/IR/LinalgOps.h
The file was modifiedmlir/test/mlir-cpu-runner/cblas_interface.cpp
The file was modifiedmlir/test/Dialect/Linalg/promote.mlir
The file was modifiedmlir/lib/Dialect/Linalg/Transforms/LowerToLLVMDialect.cpp
The file was modifiedmlir/test/Dialect/Linalg/llvm.mlir
The file was modifiedmlir/include/mlir/Dialect/Linalg/IR/LinalgTraits.h
The file was modifiedmlir/test/Dialect/Linalg/fusion.mlir
The file was modifiedmlir/test/Dialect/Linalg/invalid.mlir
The file was modifiedmlir/lib/Dialect/Linalg/IR/LinalgOps.cpp
Commit c760f233b30ef3f93dfe3380fb85437460180465 by gardener
Fix and simplify CallOp/CallIndirectOp to LLVM::CallOp conversion
A recent ABI compatibility change affected the conversion from standard
CallOp/CallIndirectOp to LLVM::CallOp by changing its signature. In
order to analyze the signature, the code was looking up the callee
symbol in the module. This is incorrect since, during the conversion,
the module may contain both the original and the converted function op
that have the same symbol name. There is no strict guarantee on which of
the two symbols will be found by the lookup. The conversion was not
failing because the type legalizer converts the LLVM types to themselves
making the original and the converted function signatures ultimately
produce the same type.
Instead of looking up the function signature to get the list of result
types, use the types of the CallOp/CallIndirectOp results which must
match those of the function in valid IR. These types are guaranteed to
be the original, unconverted types when converting the operation.
Furthermore, this avoids the need to perform a lookup of a symbol name
in the module which may be expensive.
Finally, propagate attributes as-is from the original op to the
converted op since they share the attribute name for the callee of
direct calls and the rest of attributes are not affected by the
conversion. This removes the need for additional contorsions between
direct and indirect calls to extract the name of the optional callee
attribute only to insert it back. This also prevents the conversion from
unintentionally dropping the other attributes of the op.
PiperOrigin-RevId: 272218871
The file was modifiedmlir/test/Conversion/StandardToLLVM/convert-to-llvmir.mlir
The file was modifiedmlir/lib/Conversion/StandardToLLVM/ConvertStandardToLLVM.cpp
Commit 9e6dde3977911628a1f5f531a5462b58b79658ee by gardener
Add a pair of hooks to DominanceInfo.
This exposes hooks for accessing internal dominance nodes, and updating
the internal DFS numbers.
Closes tensorflow/mlir#151
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/151
from schweitzpgi:dominance_hooks
69d14214a423b816cbd59feffcacdd02f3b5f921 PiperOrigin-RevId: 272287352
The file was modifiedmlir/include/mlir/Analysis/Dominance.h
The file was modifiedmlir/lib/Analysis/Dominance.cpp
Commit 3597711bdd18d21e5f36b7dff9c26c65c7c98452 by gardener
[spirv] Change enum case uniquing in gen_spirv_dialect.py
In SPIR-V we can have multiple symbols corresponding to the same enum
value. This is because when an extension is introduced into the core
spec, its suffix is typically removed, e.g., 'VulkanKHR' memory model
becomes 'Vulkan' memory model in SPIR-V 1.5.
Previously we just keep the first symbol for an enum value. That symbol
is not necessarily a better one. This CL changes to sort symbols,
grouped by enum values, alphabetically and then keep the first one,
which is typically shorter and without the extension suffix. We also fix
up certain ones like HlslSemanticGOOGLE.
PiperOrigin-RevId: 272290363
The file was modifiedmlir/include/mlir/Dialect/SPIRV/SPIRVBase.td
The file was modifiedmlir/utils/spirv/gen_spirv_dialect.py
Commit 2b86e27dbd822ee972da8ab71ec1b368302127c0 by gardener
Show type even if elementsattr is elided in graph
The type is quite useful for debugging and shouldn't be too large.
PiperOrigin-RevId: 272390311
The file was modifiedmlir/lib/Transforms/ViewOpGraph.cpp
Commit e81b3129b465b3b6a79ad041f27921e80fe69e71 by gardener
[ROCm] Adding pass to lower GPU Dialect to ROCDL Dialect.
This is a follow-up to the PRtensorflow/mlir#146 which introduced the
ROCDL Dialect. This PR introduces a pass to lower GPU Dialect to the
ROCDL Dialect. As with the previous PR, this one builds on the work done
by @whchung, and addresses most of the review comments in the original
PR.
Closes tensorflow/mlir#154
COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/mlir/pull/154
from deven-amd:deven-lower-gpu-to-rocdl
809893e08236da5ab6a38e3459692fa04247773d PiperOrigin-RevId: 272390729
The file was addedmlir/include/mlir/Conversion/GPUToROCDL/GPUToROCDLPass.h