Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: llvm/llvm-project
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: main
Choose a base ref
...
head repository: Xilinx/llvm-project
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: feature/fused-ops
Choose a head ref
Can’t automatically merge. Don’t worry, you can still create the pull request.

Commits on Dec 15, 2021

  1. adding linalg custom op:linalg.conv2d_relu

    akafik authored and ljfitz committed Dec 15, 2021
    Copy the full SHA
    1d79875 View commit details

Commits on Dec 21, 2021

  1. Copy the full SHA
    52909b2 View commit details

Commits on Dec 22, 2021

  1. Copy the full SHA
    82b694f View commit details

Commits on Dec 23, 2021

  1. Copy the full SHA
    4e78e3f View commit details

Commits on Jan 11, 2022

  1. Copy the full SHA
    52f0c98 View commit details

Commits on Feb 10, 2022

  1. Copy the full SHA
    773bcb6 View commit details

Commits on Feb 11, 2022

  1. Regen core named ops

    oowekyala committed Feb 11, 2022
    Copy the full SHA
    fadcbf6 View commit details

Commits on Mar 1, 2022

  1. Copy the full SHA
    cb82c6f View commit details

Commits on Mar 16, 2022

  1. Copy the full SHA
    e19c519 View commit details

Commits on Apr 4, 2022

  1. Fix syntax of fused ops

    ljfitz committed Apr 4, 2022
    Copy the full SHA
    c717915 View commit details

Commits on May 9, 2022

  1. core_named_ops.py: Add conv2d_elemwise_add op to linalg

    Philipp Braun committed May 9, 2022
    Copy the full SHA
    0acd0c6 View commit details

Commits on May 16, 2022

  1. Add set of tensor add ops

    Philipp Braun committed May 16, 2022
    Copy the full SHA
    1d5e7eb View commit details

Commits on May 17, 2022

  1. ops/core_named_ops.py: Update structured ops

    Philipp Braun committed May 17, 2022
    Copy the full SHA
    03bf7a7 View commit details

Commits on May 23, 2022

  1. LinAlg: Add softmax operator

    Simon Boehm committed May 23, 2022
    Copy the full SHA
    ccdd278 View commit details

Commits on May 24, 2022

  1. Merge feature/fused-ops structured linalg ops

    Philipp Braun committed May 24, 2022
    Copy the full SHA
    7c5b0dd View commit details
  2. Update linalg structured ops

    Philipp Braun committed May 24, 2022
    Copy the full SHA
    cbee3dd View commit details
  3. Copy the full SHA
    11d9aba View commit details
  4. Merge llvm bump changes

    Philipp Braun committed May 24, 2022
    Copy the full SHA
    b7e8c59 View commit details

Commits on May 25, 2022

  1. Softmax: Add verifier for dim attribute

    Simon Boehm committed May 25, 2022
    Copy the full SHA
    25e61f2 View commit details

Commits on May 30, 2022

  1. Rebased karlf.FXML-737.fused-generalization.

    Karl Friebel committed May 30, 2022
    Copy the full SHA
    21abc45 View commit details

Commits on May 31, 2022

  1. Merge pull request #6 from ljfitz/sboehm.FXML-636_Add_softmax

    LinAlg: Add softmax operator
    ljfitz authored May 31, 2022
    Copy the full SHA
    21df845 View commit details
  2. Merge pull request #4 from ljfitz/philippb.FXML-639.conv2d_eltwise_add

    FXML-639: Conv2d with tensor add
    ljfitz authored May 31, 2022
    Copy the full SHA
    33f444d View commit details
  3. Changed func to func.func.

    Karl Friebel committed May 31, 2022
    Copy the full SHA
    16672d3 View commit details
  4. Merged branch .

    Karl Friebel committed May 31, 2022
    Copy the full SHA
    e06a2fc View commit details
  5. Added support for fused elementwise add ops.

    Karl Friebel committed May 31, 2022
    Copy the full SHA
    c6c48e6 View commit details
  6. Added support for SoftmaxOp.

    Karl Friebel committed May 31, 2022
    Copy the full SHA
    420a5f1 View commit details

Commits on Jun 2, 2022

  1. Copy the full SHA
    98b193b View commit details
  2. Merge pull request #8 from ljfitz/karlf.FXML-737.fused-generalization

    Implemented `--linalg-unfuse` for fused operator.
    ljfitz authored Jun 2, 2022
    Copy the full SHA
    c4ca688 View commit details

Commits on Jun 8, 2022

  1. Implemented fused op base.

    KFAFSP committed Jun 8, 2022
    Copy the full SHA
    1f94b37 View commit details

Commits on Jun 9, 2022

  1. Implemented FusedOp canonicalizations.

    Karl Friebel committed Jun 9, 2022
    Copy the full SHA
    0094803 View commit details
  2. Fixed typo in UnfusePass tests.

    Karl Friebel committed Jun 9, 2022
    Copy the full SHA
    044b9c7 View commit details
  3. Added operator classification basics.

    Karl Friebel committed Jun 9, 2022
    Copy the full SHA
    125dc4e View commit details
  4. Added structural fusion pass base.

    Karl Friebel committed Jun 9, 2022
    Copy the full SHA
    f32f941 View commit details

Commits on Jun 10, 2022

  1. Implemented structural fusion strategies.

    Karl Friebel committed Jun 10, 2022
    Copy the full SHA
    af5cccb View commit details

Commits on Jun 13, 2022

  1. Fixed consumer fusion and recursive uses.

    Karl Friebel committed Jun 13, 2022
    Copy the full SHA
    9ce26dc View commit details

Commits on Jun 14, 2022

  1. Copy the full SHA
    c914b49 View commit details

Commits on Jun 27, 2022

  1. Merge pull request #10 from ljfitz/liam.add_msh_and_msw_to_conv2d_lre…

    …lu_maxpool
    
    Improve the representation of the fused strides from conv2d and maxpool
    ljfitz authored Jun 27, 2022
    Copy the full SHA
    27e60b8 View commit details

Commits on Jun 28, 2022

  1. Fix attr name in Unfuse.cpp

    oowekyala committed Jun 28, 2022
    Copy the full SHA
    4545d3b View commit details

Commits on Jun 29, 2022

  1. Copy the full SHA
    c451495 View commit details
  2. Copy the full SHA
    4db213c View commit details
  3. Apply suggestions from code review

    Co-authored-by: Liam Fitzpatrick <liam.fitzpatrick@xilinx.com>
    KFAFSP and ljfitz authored Jun 29, 2022
    Copy the full SHA
    81284e5 View commit details
  4. Addressed more review comments.

    Karl Friebel committed Jun 29, 2022
    Copy the full SHA
    1937705 View commit details
  5. Merge pull request #9 from ljfitz/karlf.FXML-699.linalg-fused

    Implemented `linalg.fused` wrapper operation
    ljfitz authored Jun 29, 2022
    Copy the full SHA
    11bfa18 View commit details

Commits on Jul 5, 2022

  1. Copy the full SHA
    f6b97ef View commit details
  2. Copy the full SHA
    2a77e0e View commit details

Commits on Jul 6, 2022

  1. Merge pull request #12 from ljfitz/liam.fused_add_order

    Liam.fused add order
    ljfitz authored Jul 6, 2022
    Copy the full SHA
    e93b725 View commit details

Commits on Jul 11, 2022

  1. Copy the full SHA
    4972327 View commit details
  2. Fixed uncapture in DropUnusedCaptures pattern.

    Karl Friebel committed Jul 11, 2022
    Copy the full SHA
    3c0938d View commit details
  3. Copy the full SHA
    b2ea864 View commit details

Commits on Jul 13, 2022

  1. Copy the full SHA
    1aca188 View commit details
Showing with 15,473 additions and 1,081 deletions.
  1. +13 −6 .github/workflows/llvm-project-tests.yml
  2. +26 −0 .github/workflows/mlir-tests.yml
  3. +1 −1 .github/workflows/pr-code-format.yml
  4. +1 −1 clang/cmake/modules/AddClang.cmake
  5. +4 −0 llvm/cmake/modules/AddLLVM.cmake
  6. +4 −1 llvm/lib/Analysis/Lint.cpp
  7. +0 −5 llvm/lib/IR/Verifier.cpp
  8. +1 −1 llvm/test/CodeGen/AArch64/GlobalISel/vastart.ll
  9. +7 −0 llvm/test/Other/lint.ll
  10. +0 −8 llvm/test/Verifier/variadic.ll
  11. +4 −0 mlir/docs/Dialects/emitc.md
  12. +2 −0 mlir/include/mlir-c/BuiltinAttributes.h
  13. +5 −0 mlir/include/mlir-c/Pass.h
  14. +91 −0 mlir/include/mlir/Analysis/AffineExprBounds.h
  15. +3 −1 mlir/include/mlir/Conversion/FuncToEmitC/FuncToEmitC.h
  16. +4 −1 mlir/include/mlir/Conversion/MathToLibm/MathToLibm.h
  17. +1 −0 mlir/include/mlir/Conversion/Passes.h
  18. +29 −4 mlir/include/mlir/Conversion/Passes.td
  19. +3 −1 mlir/include/mlir/Conversion/SCFToEmitC/SCFToEmitC.h
  20. +3 −1 mlir/include/mlir/Conversion/TosaToArith/TosaToArith.h
  21. +5 −1 mlir/include/mlir/Conversion/TosaToLinalg/TosaToLinalg.h
  22. +26 −0 mlir/include/mlir/Conversion/UBToEmitC/UBToEmitC.h
  23. +2 −1 mlir/include/mlir/Dialect/Affine/IR/AffineOps.td
  24. +7 −1 mlir/include/mlir/Dialect/Affine/Utils.h
  25. +13 −0 mlir/include/mlir/Dialect/EmitC/IR/EmitC.h
  26. +86 −9 mlir/include/mlir/Dialect/EmitC/IR/EmitC.td
  27. +9 −2 mlir/include/mlir/Dialect/EmitC/IR/EmitCTypes.td
  28. +43 −0 mlir/include/mlir/Dialect/EmitC/IR/FunctionOpAssembly.h
  29. +4 −0 mlir/include/mlir/Dialect/EmitC/Transforms/Passes.h
  30. +10 −0 mlir/include/mlir/Dialect/EmitC/Transforms/Passes.td
  31. +11 −0 mlir/include/mlir/Dialect/Func/Transforms/Passes.td
  32. +0 −5 mlir/include/mlir/Dialect/Linalg/IR/LinalgInterfaces.td
  33. +5 −0 mlir/include/mlir/Dialect/Linalg/Passes.td
  34. +2 −1 mlir/include/mlir/Dialect/Linalg/Transforms/Transforms.h
  35. +69 −0 mlir/include/mlir/Dialect/PDL/IR/Builtins.h
  36. +7 −5 mlir/include/mlir/Dialect/PDL/IR/PDLOps.td
  37. +13 −5 mlir/include/mlir/Dialect/PDLInterp/IR/PDLInterpOps.td
  38. +51 −18 mlir/include/mlir/Dialect/Tosa/IR/TosaOps.td
  39. +5 −2 mlir/include/mlir/Dialect/Tosa/IR/TosaTypesBase.td
  40. +3 −4 mlir/include/mlir/Dialect/Tosa/Transforms/Passes.h
  41. +12 −6 mlir/include/mlir/Dialect/Tosa/Transforms/Passes.td
  42. +5 −0 mlir/include/mlir/IR/AffineExpr.h
  43. +18 −0 mlir/include/mlir/IR/BuiltinAttributes.td
  44. +11 −0 mlir/include/mlir/IR/OperationSupport.h
  45. +0 −2 mlir/include/mlir/IR/PDLPatternMatch.h.inc
  46. +13 −3 mlir/include/mlir/IR/PatternMatch.h
  47. +4 −0 mlir/include/mlir/Pass/PassManager.h
  48. +4 −1 mlir/include/mlir/Target/Cpp/CppEmitter.h
  49. +14 −10 mlir/include/mlir/Tools/PDLL/AST/Nodes.h
  50. +4 −1 mlir/include/mlir/Tools/PDLL/Parser/Parser.h
  51. +2 −1 mlir/include/mlir/Transforms/Passes.h
  52. +198 −0 mlir/lib/Analysis/AffineExprBounds.cpp
  53. +1 −0 mlir/lib/Analysis/CMakeLists.txt
  54. +8 −2 mlir/lib/Bindings/Python/IRAttributes.cpp
  55. +8 −0 mlir/lib/Bindings/Python/Pass.cpp
  56. +3 −0 mlir/lib/CAPI/IR/BuiltinAttributes.cpp
  57. +5 −0 mlir/lib/CAPI/IR/Pass.cpp
  58. +79 −7 mlir/lib/Conversion/ArithToEmitC/ArithToEmitC.cpp
  59. +1 −0 mlir/lib/Conversion/CMakeLists.txt
  60. +35 −7 mlir/lib/Conversion/FuncToEmitC/FuncToEmitC.cpp
  61. +9 −1 mlir/lib/Conversion/FuncToEmitC/FuncToEmitCPass.cpp
  62. +22 −4 mlir/lib/Conversion/MathToLibm/MathToLibm.cpp
  63. +73 −3 mlir/lib/Conversion/MemRefToEmitC/MemRefToEmitC.cpp
  64. +2 −0 mlir/lib/Conversion/MemRefToEmitC/MemRefToEmitCPass.cpp
  65. +3 −2 mlir/lib/Conversion/PDLToPDLInterp/PDLToPDLInterp.cpp
  66. +28 −9 mlir/lib/Conversion/PDLToPDLInterp/PredicateTree.cpp
  67. +141 −66 mlir/lib/Conversion/SCFToEmitC/SCFToEmitC.cpp
  68. +18 −7 mlir/lib/Conversion/TosaToArith/TosaToArith.cpp
  69. +5 −1 mlir/lib/Conversion/TosaToArith/TosaToArithPass.cpp
  70. +317 −126 mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp
  71. +124 −25 mlir/lib/Conversion/TosaToLinalg/TosaToLinalgNamed.cpp
  72. +6 −1 mlir/lib/Conversion/TosaToLinalg/TosaToLinalgNamedPass.cpp
  73. +15 −3 mlir/lib/Conversion/TosaToLinalg/TosaToLinalgPass.cpp
  74. +2 −0 mlir/lib/Conversion/TosaToTensor/TosaToTensorPass.cpp
  75. +17 −0 mlir/lib/Conversion/UBToEmitC/CMakeLists.txt
  76. +111 −0 mlir/lib/Conversion/UBToEmitC/UBToEmitC.cpp
  77. +13 −3 mlir/lib/Dialect/Affine/IR/AffineOps.cpp
  78. +15 −8 mlir/lib/Dialect/Affine/Utils/Utils.cpp
  79. +1 −0 mlir/lib/Dialect/EmitC/IR/CMakeLists.txt
  80. +209 −14 mlir/lib/Dialect/EmitC/IR/EmitC.cpp
  81. +317 −0 mlir/lib/Dialect/EmitC/IR/FunctionOpAssembly.cpp
  82. +1 −0 mlir/lib/Dialect/EmitC/Transforms/CMakeLists.txt
  83. +106 −0 mlir/lib/Dialect/EmitC/Transforms/EliminateLibm.cpp
  84. +47 −0 mlir/lib/Dialect/Func/Transforms/AnnotateFunctionType.cpp
  85. +1 −0 mlir/lib/Dialect/Func/Transforms/CMakeLists.txt
  86. +0 −13 mlir/lib/Dialect/Linalg/IR/LinalgInterfaces.cpp
  87. +1 −1 mlir/lib/Dialect/Linalg/Transforms/ConstantFold.cpp
  88. +8 −6 mlir/lib/Dialect/Linalg/Transforms/ElementwiseOpFusion.cpp
  89. +12 −4 mlir/lib/Dialect/Linalg/Transforms/TilingInterfaceImpl.cpp
  90. +45 −12 mlir/lib/Dialect/Linalg/Utils/Utils.cpp
  91. +25 −9 mlir/lib/Dialect/MemRef/Transforms/NormalizeMemRefs.cpp
  92. +378 −0 mlir/lib/Dialect/PDL/IR/Builtins.cpp
  93. +1 −0 mlir/lib/Dialect/PDL/IR/CMakeLists.txt
  94. +31 −14 mlir/lib/Dialect/PDL/IR/PDL.cpp
  95. +22 −12 mlir/lib/Dialect/PDLInterp/IR/PDLInterp.cpp
  96. +6 −0 mlir/lib/Dialect/SCF/Transforms/TileUsingInterface.cpp
  97. +0 −17 mlir/lib/Dialect/Tensor/IR/TensorTilingInterfaceImpl.cpp
  98. +516 −33 mlir/lib/Dialect/Tosa/IR/TosaCanonicalizations.cpp
  99. +82 −3 mlir/lib/Dialect/Tosa/IR/TosaOps.cpp
  100. +1,864 −136 mlir/lib/Dialect/Tosa/Transforms/TosaFolders.cpp
  101. +10 −8 mlir/lib/Dialect/Tosa/Transforms/TosaLayerwiseConstantFoldPass.cpp
  102. +36 −0 mlir/lib/IR/AffineExpr.cpp
  103. +124 −24 mlir/lib/IR/AsmPrinter.cpp
  104. +77 −0 mlir/lib/Pass/IRPrinting.cpp
  105. +7 −0 mlir/lib/Pass/PassManagerOptions.cpp
  106. +17 −0 mlir/lib/Rewrite/ByteCode.cpp
  107. +3 −0 mlir/lib/Rewrite/FrozenRewritePatternSet.cpp
  108. +13 −1 mlir/lib/Target/Cpp/TranslateRegistration.cpp
  109. +261 −53 mlir/lib/Target/Cpp/TranslateToCpp.cpp
  110. +1 −1 mlir/lib/Tools/PDLL/AST/NodePrinter.cpp
  111. +9 −7 mlir/lib/Tools/PDLL/AST/Nodes.cpp
  112. +8 −2 mlir/lib/Tools/PDLL/CodeGen/MLIRGen.cpp
  113. +77 −5 mlir/lib/Tools/PDLL/Parser/Lexer.cpp
  114. +27 −0 mlir/lib/Tools/PDLL/Parser/Lexer.h
  115. +650 −12 mlir/lib/Tools/PDLL/Parser/Parser.cpp
  116. +6 −1 mlir/lib/Tools/mlir-pdll-lsp-server/PDLLServer.cpp
  117. +5 −0 mlir/lib/Transforms/CSE.cpp
  118. +23 −12 mlir/lib/Transforms/ControlFlowSink.cpp
  119. +1 −0 mlir/python/mlir/_mlir_libs/_mlir/passmanager.pyi
  120. +217 −0 mlir/test/Analysis/test-affine-expr-bounds.mlir
  121. +134 −22 mlir/test/Conversion/ArithToEmitC/arith-to-emitc-unsupported.mlir
  122. +19 −0 mlir/test/Conversion/ArithToEmitC/arith-to-emitc.mlir
  123. +30 −0 mlir/test/Conversion/FuncToEmitC/func-to-emitc.mlir
  124. +62 −62 mlir/test/Conversion/MathToLibm/convert-to-libm.mlir
  125. +41 −0 mlir/test/Conversion/MathToLibm/nearbyint.mlir
  126. +8 −0 mlir/test/Conversion/MathToLibm/roundeven-failed.mlir
  127. +16 −0 mlir/test/Conversion/MemRefToEmitC/memref-to-emitc-failed.mlir
  128. +48 −5 mlir/test/Conversion/MemRefToEmitC/memref-to-emitc.mlir
  129. +35 −0 mlir/test/Conversion/PDLToPDLInterp/pdl-to-pdl-interp-matcher.mlir
  130. +16 −0 mlir/test/Conversion/PDLToPDLInterp/pdl-to-pdl-interp-rewriter.mlir
  131. +24 −0 mlir/test/Conversion/PDLToPDLInterp/use-constraint-result.mlir
  132. +73 −4 mlir/test/Conversion/SCFToEmitC/for.mlir
  133. +27 −0 mlir/test/Conversion/SCFToEmitC/if.mlir
  134. +33 −0 mlir/test/Conversion/SCFToEmitC/nest-for-if.mlir
  135. +6 −3 mlir/test/Conversion/SCFToEmitC/switch.mlir
  136. +9 −5 mlir/test/Conversion/TosaToArith/tosa-to-arith.mlir
  137. +18 −0 mlir/test/Conversion/TosaToLinalg/tosa-to-linalg-i2.mlir
  138. +25 −0 mlir/test/Conversion/TosaToLinalg/tosa-to-linalg-named-i2.mlir
  139. +74 −0 mlir/test/Conversion/TosaToLinalg/tosa-to-linalg-named-matmul-single-batch.mlir
  140. +13 −0 mlir/test/Conversion/TosaToLinalg/tosa-to-linalg-named.mlir
  141. +3 −1 mlir/test/Conversion/TosaToLinalg/tosa-to-linalg-pipeline.mlir
  142. +15 −0 mlir/test/Conversion/TosaToLinalg/tosa-to-linalg-ui3.mlir
  143. +110 −15 mlir/test/Conversion/TosaToLinalg/tosa-to-linalg.mlir
  144. +26 −1 mlir/test/Conversion/TosaToTensor/tosa-to-tensor.mlir
  145. +15 −0 mlir/test/Conversion/UBToEmitC/convert-ub-to-emitc-no-init.mlir
  146. +23 −0 mlir/test/Conversion/UBToEmitC/convert-ub-to-emitc-unsupported.mlir
  147. +12 −0 mlir/test/Conversion/UBToEmitC/convert-ub-to-emitc.mlir
  148. +88 −0 mlir/test/Dialect/Affine/control-flow-sink.mlir
  149. +2 −2 mlir/test/Dialect/Affine/invalid.mlir
  150. +15 −0 mlir/test/Dialect/Bufferization/Transforms/one-shot-module-bufferize-bodiless-functions-results.mlir
  151. +29 −0 mlir/test/Dialect/EmitC/eliminate_libm.mlir
  152. +27 −0 mlir/test/Dialect/EmitC/func.mlir
  153. +84 −2 mlir/test/Dialect/EmitC/invalid_ops.mlir
  154. +77 −9 mlir/test/Dialect/EmitC/invalid_types.mlir
  155. +36 −4 mlir/test/Dialect/EmitC/ops.mlir
  156. +9 −1 mlir/test/Dialect/EmitC/types.mlir
  157. +27 −0 mlir/test/Dialect/Func/annotate-types.mlir
  158. +13 −0 mlir/test/Dialect/Linalg/fusion-elementwise-ops-no-remove-outs-deps.mlir
  159. +29 −0 mlir/test/Dialect/Linalg/fusion-elementwise-ops.mlir
  160. +25 −0 mlir/test/Dialect/Linalg/tile-offset.mlir
  161. +78 −0 mlir/test/Dialect/Linalg/tile-tensors.mlir
  162. +42 −1 mlir/test/Dialect/Linalg/transform-op-fuse-into-containing.mlir
  163. +14 −0 mlir/test/Dialect/MemRef/normalize-memrefs.mlir
  164. +36 −0 mlir/test/Dialect/PDL/ops.mlir
  165. +3 −0 mlir/test/Dialect/PDLInterp/ops.mlir
  166. +0 −41 mlir/test/Dialect/Tensor/tiling.mlir
  167. +476 −10 mlir/test/Dialect/Tosa/canonicalize.mlir
  168. +87 −0 mlir/test/Dialect/Tosa/canonicalize_with_debuginfo.mlir
  169. +150 −0 mlir/test/Dialect/Tosa/constant-add-opt.mlir
  170. +74 −0 mlir/test/Dialect/Tosa/constant-bitwise-and.mlir
  171. +61 −0 mlir/test/Dialect/Tosa/constant-bitwise-not.mlir
  172. +73 −0 mlir/test/Dialect/Tosa/constant-bitwise-or.mlir
  173. +24 −0 mlir/test/Dialect/Tosa/constant-cast-opt-disable-int-folding.mlir
  174. +335 −0 mlir/test/Dialect/Tosa/constant-cast-opt.mlir
  175. +135 −0 mlir/test/Dialect/Tosa/constant-ceil.mlir
  176. +91 −0 mlir/test/Dialect/Tosa/constant-clamp-opt.mlir
  177. +75 −0 mlir/test/Dialect/Tosa/constant-cos.mlir
  178. +97 −0 mlir/test/Dialect/Tosa/constant-equal.mlir
  179. +155 −0 mlir/test/Dialect/Tosa/constant-erf.mlir
  180. +158 −0 mlir/test/Dialect/Tosa/constant-exp.mlir
  181. +131 −0 mlir/test/Dialect/Tosa/constant-floor.mlir
  182. +97 −0 mlir/test/Dialect/Tosa/constant-greater-equal.mlir
  183. +97 −0 mlir/test/Dialect/Tosa/constant-greater-fold.mlir
  184. +159 −0 mlir/test/Dialect/Tosa/constant-log.mlir
  185. +12 −0 mlir/test/Dialect/Tosa/constant-logical_not-fold.mlir
  186. +71 −0 mlir/test/Dialect/Tosa/constant-matmul.mlir
  187. +96 −0 mlir/test/Dialect/Tosa/constant-maximum.mlir
  188. +96 −0 mlir/test/Dialect/Tosa/constant-minimum.mlir
  189. +190 −0 mlir/test/Dialect/Tosa/constant-mul-opt.mlir
  190. +253 −30 mlir/test/Dialect/Tosa/constant-op-fold.mlir
  191. +13 −0 mlir/test/Dialect/Tosa/constant-pad-multi-user.mlir
  192. +121 −0 mlir/test/Dialect/Tosa/constant-pad.mlir
  193. +102 −0 mlir/test/Dialect/Tosa/constant-pow-opt.mlir
  194. +23 −0 mlir/test/Dialect/Tosa/constant-reciprocal-fold-multi-user.mlir
  195. +38 −0 mlir/test/Dialect/Tosa/constant-reshape-fold.mlir
  196. +147 −0 mlir/test/Dialect/Tosa/constant-rsqrt-opt.mlir
  197. +75 −0 mlir/test/Dialect/Tosa/constant-sin.mlir
  198. +13 −0 mlir/test/Dialect/Tosa/constant-slice-multi-user.mlir
  199. +172 −0 mlir/test/Dialect/Tosa/constant-slice.mlir
  200. +150 −0 mlir/test/Dialect/Tosa/constant-sub.mlir
  201. +145 −0 mlir/test/Dialect/Tosa/constant-tile.mlir
  202. +13 −15 mlir/test/Dialect/Tosa/fold_concats.mlir
  203. +58 −10 mlir/test/Dialect/Tosa/invalid.mlir
  204. +44 −0 mlir/test/Dialect/Tosa/reduce_rank5.mlir
  205. +4 −4 mlir/test/Dialect/Tosa/tosa-infer-shapes.mlir
  206. +34 −0 mlir/test/IR/mlir-newline-after-attr.mlir
  207. +11 −0 mlir/test/IR/test-region-attr-aliasing.mlir
  208. +26 −0 mlir/test/Pass/reproducer-before-all.mlir
  209. +31 −0 mlir/test/Rewrite/pdl-bytecode.mlir
  210. +9 −0 mlir/test/Target/Cpp/cast.mlir
  211. +10 −0 mlir/test/Target/Cpp/common-cpp.mlir
  212. +14 −0 mlir/test/Target/Cpp/declare_func.mlir
  213. +66 −0 mlir/test/Target/Cpp/emitc-constants-as-variables.mlir
  214. +20 −20 mlir/test/Target/Cpp/for.mlir
  215. +9 −0 mlir/test/Target/Cpp/func.mlir
  216. +3 −0 mlir/test/Target/Cpp/global.mlir
  217. +8 −0 mlir/test/Target/Cpp/invalid.mlir
  218. +1 −1 mlir/test/Target/Cpp/lvalue.mlir
  219. +14 −0 mlir/test/Target/Cpp/template_arg_names.mlir
  220. +29 −0 mlir/test/Target/Cpp/tu.mlir
  221. +10 −0 mlir/test/Target/Cpp/types.mlir
  222. +38 −2 mlir/test/Target/Cpp/verbatim.mlir
  223. +48 −0 mlir/test/Transforms/cse_with_locations.mlir
  224. +1 −0 mlir/test/lib/IR/CMakeLists.txt
  225. +190 −0 mlir/test/lib/IR/TestAffineExpressionBounds.cpp
  226. +7 −0 mlir/test/lib/Tools/PDLL/TestPDLL.pdll
  227. +18 −1 mlir/test/lit.cfg.py
  228. +4 −4 mlir/test/mlir-pdll/CodeGen/MLIR/decl.pdll
  229. +215 −1 mlir/test/mlir-pdll/CodeGen/MLIR/expr.pdll
  230. +9 −0 mlir/test/mlir-pdll/Integration/test-pdll.mlir
  231. +21 −0 mlir/test/mlir-pdll/Parser/block-comment-failure.pdll
  232. +67 −0 mlir/test/mlir-pdll/Parser/block-comment.pdll
  233. +246 −1 mlir/test/mlir-pdll/Parser/expr-failure.pdll
  234. +322 −3 mlir/test/mlir-pdll/Parser/expr.pdll
  235. +11 −0 mlir/test/mlir-pdll/Parser/include-file-and-file-which-includes-first-file-with-once-00.pdll
  236. +11 −0 mlir/test/mlir-pdll/Parser/include-file-and-file-which-includes-first-file-with-once-01.pdll
  237. +9 −0 mlir/test/mlir-pdll/Parser/include-file-twice-with-once.pdll
  238. +5 −0 mlir/test/mlir-pdll/Parser/include-file-twice-without-once.pdll
  239. +5 −0 mlir/test/mlir-pdll/Parser/include/include-file-with-include.pdll
  240. +5 −0 mlir/test/mlir-pdll/Parser/include/included-with-once.pdll
  241. +22 −1 mlir/test/mlir-pdll/Parser/stmt-failure.pdll
  242. +4 −0 mlir/test/python/dialects/builtin.py
  243. +13 −13 mlir/test/python/dialects/pdl_ops.py
  244. +4 −0 mlir/test/python/ir/array_attributes.py
  245. +4 −0 mlir/test/python/ir/attributes.py
  246. +2 −0 mlir/tools/mlir-opt/mlir-opt.cpp
  247. +11 −3 mlir/tools/mlir-pdll/mlir-pdll.cpp
  248. +1 −0 mlir/unittests/Dialect/CMakeLists.txt
  249. +799 −0 mlir/unittests/Dialect/PDL/BuiltinTest.cpp
  250. +8 −0 mlir/unittests/Dialect/PDL/CMakeLists.txt
  251. +54 −0 mlir/unittests/IR/AttributeTest.cpp
19 changes: 13 additions & 6 deletions .github/workflows/llvm-project-tests.yml
Original file line number Diff line number Diff line change
@@ -14,7 +14,7 @@ on:
required: false
os_list:
required: false
default: '["ubuntu-latest", "windows-2019", "macOS-13"]'
default: '["ubuntu-latest"]'
python_version:
required: false
type: string
@@ -39,7 +39,7 @@ on:
type: string
# Use windows-2019 due to:
# https://developercommunity.visualstudio.com/t/Prev-Issue---with-__assume-isnan-/1597317
default: '["ubuntu-latest", "windows-2019", "macOS-13"]'
default: '["ubuntu-latest"]'

python_version:
required: false
@@ -60,6 +60,7 @@ jobs:
runs-on: ${{ matrix.os }}
container:
image: ${{(startsWith(matrix.os, 'ubuntu') && 'ghcr.io/llvm/ci-ubuntu-22.04:latest') || null}}
options: --user root
volumes:
- /mnt/:/mnt/
strategy:
@@ -76,10 +77,10 @@ jobs:
# python3.10.6 libraries instead of the 64-bit libraries when building
# lldb. Using this setup-python action to make 3.10 the default
# python fixes this.
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: ${{ inputs.python_version }}
#- name: Setup Python
# uses: actions/setup-python@v4
# with:
# python-version: ${{ inputs.python_version }}
- name: Install Ninja
if: runner.os != 'Linux'
uses: llvm/actions/install-ninja@main
@@ -89,6 +90,12 @@ jobs:
- uses: actions/checkout@v4
with:
fetch-depth: 250
- name: Install requirements.txt
if: inputs.projects == 'mlir'
run: |
apt-get update
apt-get install -y python3-pip
pip install -r mlir/python/requirements.txt
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1
with:
26 changes: 26 additions & 0 deletions .github/workflows/mlir-tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: MLIR Tests

permissions:
contents: read

on:
workflow_dispatch:
pull_request:
# Only builds on push populate the ccache that can be used by PRs
push:
branches: [ main, feature/fused-ops ]

concurrency:
# Skip intermediate builds: always.
# Cancel intermediate builds: only if it is a pull request build.
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

jobs:
check_mlir:
name: Test mlir
uses: ./.github/workflows/llvm-project-tests.yml
with:
build_target: check-mlir
projects: mlir
extra_cmake_args: -DMLIR_ENABLE_BINDINGS_PYTHON=ON
2 changes: 1 addition & 1 deletion .github/workflows/pr-code-format.yml
Original file line number Diff line number Diff line change
@@ -6,6 +6,7 @@ permissions:
on:
pull_request:
branches:
- feature/fused-ops
- main
- 'users/**'

@@ -16,7 +17,6 @@ jobs:
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number }}
cancel-in-progress: true
if: github.repository == 'llvm/llvm-project'
steps:
- name: Fetch LLVM sources
uses: actions/checkout@v4
2 changes: 1 addition & 1 deletion clang/cmake/modules/AddClang.cmake
Original file line number Diff line number Diff line change
@@ -212,7 +212,7 @@ endmacro()

function(clang_target_link_libraries target type)
if (TARGET obj.${target})
target_link_libraries(obj.${target} ${ARGN})
target_link_libraries(obj.${target} PUBLIC ${ARGN})
endif()

get_property(LLVM_DRIVER_TOOLS GLOBAL PROPERTY LLVM_DRIVER_TOOLS)
4 changes: 4 additions & 0 deletions llvm/cmake/modules/AddLLVM.cmake
Original file line number Diff line number Diff line change
@@ -590,6 +590,10 @@ function(llvm_add_library name)
# result in generating header files. Add a dependendency so that
# the generated header is created before this object library.
if(ARG_LINK_LIBS)
# Link to LINK_LIBS to record which of their include directories
# are system directories. This information is not available in
# INCLUDE_DIRECTORIES property.
target_link_libraries(${obj_name} PRIVATE ${ARG_LINK_LIBS})
cmake_parse_arguments(LINK_LIBS_ARG
""
""
5 changes: 4 additions & 1 deletion llvm/lib/Analysis/Lint.cpp
Original file line number Diff line number Diff line change
@@ -339,7 +339,10 @@ void Lint::visitCallBase(CallBase &I) {
}

case Intrinsic::vastart:
// vastart in non-varargs function is rejected by the verifier
Check(I.getParent()->getParent()->isVarArg(),
"Undefined behavior: va_start called in a non-varargs function",
&I);

visitMemoryReference(I, MemoryLocation::getForArgument(&I, 0, TLI),
std::nullopt, nullptr, MemRef::Read | MemRef::Write);
break;
5 changes: 0 additions & 5 deletions llvm/lib/IR/Verifier.cpp
Original file line number Diff line number Diff line change
@@ -5952,11 +5952,6 @@ void Verifier::visitIntrinsicCall(Intrinsic::ID ID, CallBase &Call) {

break;
}
case Intrinsic::vastart: {
Check(Call.getFunction()->isVarArg(),
"va_start called in a non-varargs function");
break;
}
case Intrinsic::vector_reduce_and:
case Intrinsic::vector_reduce_or:
case Intrinsic::vector_reduce_xor:
2 changes: 1 addition & 1 deletion llvm/test/CodeGen/AArch64/GlobalISel/vastart.ll
Original file line number Diff line number Diff line change
@@ -3,7 +3,7 @@


declare void @llvm.va_start(ptr)
define void @test_va_start(ptr %list, ...) {
define void @test_va_start(ptr %list) {
; CHECK-LABEL: name: test_va_start
; CHECK: [[LIST:%[0-9]+]]:_(p0) = COPY $x0
; CHECK-IOS: G_VASTART [[LIST]](p0) :: (store (s64) into %ir.list, align 1)
7 changes: 7 additions & 0 deletions llvm/test/Other/lint.ll
Original file line number Diff line number Diff line change
@@ -124,6 +124,13 @@ define void @0() nounwind {
ret void
}

; CHECK: va_start called in a non-varargs function
declare void @llvm.va_start(ptr)
define void @not_vararg(ptr %p) nounwind {
call void @llvm.va_start(ptr %p)
ret void
}

; CHECK: Undefined behavior: Branch to non-blockaddress
define void @use_indbr() {
indirectbr ptr @foo, [label %block]
8 changes: 0 additions & 8 deletions llvm/test/Verifier/variadic.ll

This file was deleted.

4 changes: 4 additions & 0 deletions mlir/docs/Dialects/emitc.md
Original file line number Diff line number Diff line change
@@ -12,10 +12,14 @@ The following convention is followed:
operation, C++20 is required.
* If `ssize_t` is used, then the code requires the POSIX header `sys/types.h`
or any of the C++ headers in which the type is defined.
* If `emitc.array` with a dimension of size zero, then the code
requires [a GCC extension](https://gcc.gnu.org/onlinedocs/gcc/Zero-Length.html).
* If `_Float16` is used, the code requires the support of C additional
floating types.
* If `__bf16` is used, the code requires a compiler that supports it, such as
GCC or Clang.
* If `ub.posion` values should be initialized and have an opaque type,
C++ is generated.
* Else the generated code is compatible with C99.

These restrictions are neither inherent to the EmitC dialect itself nor to the
2 changes: 2 additions & 0 deletions mlir/include/mlir-c/BuiltinAttributes.h
Original file line number Diff line number Diff line change
@@ -556,6 +556,8 @@ MLIR_CAPI_EXPORTED int64_t
mlirDenseElementsAttrGetInt64Value(MlirAttribute attr, intptr_t pos);
MLIR_CAPI_EXPORTED uint64_t
mlirDenseElementsAttrGetUInt64Value(MlirAttribute attr, intptr_t pos);
MLIR_CAPI_EXPORTED size_t mlirDenseElementsAttrGetIndexValue(MlirAttribute attr,
intptr_t pos);
MLIR_CAPI_EXPORTED float mlirDenseElementsAttrGetFloatValue(MlirAttribute attr,
intptr_t pos);
MLIR_CAPI_EXPORTED double
5 changes: 5 additions & 0 deletions mlir/include/mlir-c/Pass.h
Original file line number Diff line number Diff line change
@@ -80,6 +80,11 @@ MLIR_CAPI_EXPORTED void mlirPassManagerEnableIRPrinting(
bool printModuleScope, bool printAfterOnlyOnChange,
bool printAfterOnlyOnFailure);

/// Enable lir-reproducer-before-all.
MLIR_CAPI_EXPORTED void
mlirPassManagerEnableReproducerBeforeAll(MlirPassManager passManager,
MlirStringRef outputDir);

/// Enable / disable verify-each.
MLIR_CAPI_EXPORTED void
mlirPassManagerEnableVerifier(MlirPassManager passManager, bool enable);
91 changes: 91 additions & 0 deletions mlir/include/mlir/Analysis/AffineExprBounds.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
//===- AffineExprBounds.h - Compute bounds of affine expressions *- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
//
// This header file defines an analysis of affine expressions to compute their
// ranges (lower/upper bounds) in a given context.
//
//===----------------------------------------------------------------------===//
#ifndef MLIR_ANALYSIS_AFFINEEXPRBOUNDS_H
#define MLIR_ANALYSIS_AFFINEEXPRBOUNDS_H

#include "mlir/IR/AffineExprVisitor.h"
#include "mlir/IR/Attributes.h"
#include "mlir/IR/BuiltinAttributes.h"
#include "mlir/Interfaces/InferIntRangeInterface.h"

#include "mlir/IR/AffineExpr.h"
#include "mlir/IR/AffineMap.h"
#include "mlir/Support/LogicalResult.h"

using namespace mlir;

/// This visitor computes the bounds of affine expressions, using as context the
/// bounds of the dimensions of the expression.
///
/// Example:
/// Given bounds 0 <= d0 <= 99 and 0 <= d1 <= 199, we can compute the bounds
/// of the following expression:
/// lb(2 * d0 + 3 * d1) = 0
/// ub(2 * d0 + 3 * d1) = 795
///
/// * The bounds given in the context are inclusive, and the bounds returned
/// are also inclusive.
/// * If bounds are not available for a dimension, std::nullopt can be used
/// instead. The bounds of an expression that involves it will be std::nullopt.
/// * Limitations:
/// - Parametric expressions (using symbols) are not supported.
/// - Unsigned FloorDiv is currently not supported.
class AffineExprBoundsVisitor
: public AffineExprVisitor<AffineExprBoundsVisitor, LogicalResult> {
public:
/// Initialize the context (bounds) with APInt. All bounds must have the same
/// signedness and bit width.
AffineExprBoundsVisitor(ArrayRef<std::optional<APInt>> constLowerBounds,
ArrayRef<std::optional<APInt>> constUpperBounds,
bool boundsSigned, uint64_t bitWidth,
MLIRContext *context);

/// Initialize the context (bounds) with 64-bit signed integers. This allows
/// to directly map index-type values such as Linalg op bounds, which are
/// represented as int64_t.
AffineExprBoundsVisitor(ArrayRef<std::optional<int64_t>> constLowerBounds,
ArrayRef<std::optional<int64_t>> constUpperBounds,
MLIRContext *context);

/// Get the upper bound of \p expr using the context bounds.
std::optional<APInt> getUpperBound(AffineExpr expr);
std::optional<int64_t> getIndexUpperBound(AffineExpr expr);

/// Get the lower bound of \p expr using the context bounds.
std::optional<APInt> getLowerBound(AffineExpr expr);
std::optional<int64_t> getIndexLowerBound(AffineExpr expr);

// These methods are directly called by the AffineExprVisitor base class.
LogicalResult visitMulExpr(AffineBinaryOpExpr expr);
LogicalResult visitAddExpr(AffineBinaryOpExpr expr);
LogicalResult visitDimExpr(AffineDimExpr expr);
LogicalResult visitSymbolExpr(AffineSymbolExpr expr);
LogicalResult visitConstantExpr(AffineConstantExpr expr);
LogicalResult visitCeilDivExpr(AffineBinaryOpExpr expr);
LogicalResult visitFloorDivExpr(AffineBinaryOpExpr expr);
LogicalResult visitModExpr(AffineBinaryOpExpr expr);

private:
bool boundsSigned;
uint64_t bitWidth;
void inferBinOpRange(
AffineBinaryOpExpr expr,
const std::function<ConstantIntRanges(ArrayRef<ConstantIntRanges>)>
&opInference);

/// Bounds that have been computed for subexpressions are memoized and reused.
llvm::DenseMap<AffineExpr, APInt> lb;
llvm::DenseMap<AffineExpr, APInt> ub;
};

#endif // MLIR_ANALYSIS_AFFINEEXPRBOUNDS_H
4 changes: 3 additions & 1 deletion mlir/include/mlir/Conversion/FuncToEmitC/FuncToEmitC.h
Original file line number Diff line number Diff line change
@@ -9,10 +9,12 @@
#ifndef MLIR_CONVERSION_FUNCTOEMITC_FUNCTOEMITC_H
#define MLIR_CONVERSION_FUNCTOEMITC_FUNCTOEMITC_H

#include "mlir/Transforms/DialectConversion.h"
namespace mlir {
class RewritePatternSet;

void populateFuncToEmitCPatterns(RewritePatternSet &patterns);
void populateFuncToEmitCPatterns(RewritePatternSet &patterns,
TypeConverter &typeConverter);
} // namespace mlir

#endif // MLIR_CONVERSION_FUNCTOEMITC_FUNCTOEMITC_H
5 changes: 4 additions & 1 deletion mlir/include/mlir/Conversion/MathToLibm/MathToLibm.h
Original file line number Diff line number Diff line change
@@ -19,10 +19,13 @@ class OperationPass;

/// Populate the given list with patterns that convert from Math to Libm calls.
/// If log1pBenefit is present, use it instead of benefit for the Log1p op.
void populateMathToLibmConversionPatterns(RewritePatternSet &patterns);
void populateMathToLibmConversionPatterns(
RewritePatternSet &patterns, const ConvertMathToLibmOptions &options);

/// Create a pass to convert Math operations to libm calls.
std::unique_ptr<OperationPass<ModuleOp>> createConvertMathToLibmPass();
std::unique_ptr<OperationPass<ModuleOp>>
createConvertMathToLibmPass(const ConvertMathToLibmOptions &options);

} // namespace mlir

1 change: 1 addition & 0 deletions mlir/include/mlir/Conversion/Passes.h
Original file line number Diff line number Diff line change
@@ -71,6 +71,7 @@
#include "mlir/Conversion/TosaToMLProgram/TosaToMLProgram.h"
#include "mlir/Conversion/TosaToSCF/TosaToSCF.h"
#include "mlir/Conversion/TosaToTensor/TosaToTensor.h"
#include "mlir/Conversion/UBToEmitC/UBToEmitC.h"
#include "mlir/Conversion/UBToLLVM/UBToLLVM.h"
#include "mlir/Conversion/UBToSPIRV/UBToSPIRV.h"
#include "mlir/Conversion/VectorToArmSME/VectorToArmSME.h"
33 changes: 29 additions & 4 deletions mlir/include/mlir/Conversion/Passes.td
Original file line number Diff line number Diff line change
@@ -738,6 +738,12 @@ def ConvertMathToLibm : Pass<"convert-math-to-libm", "ModuleOp"> {
"func::FuncDialect",
"vector::VectorDialect",
];
let options = [
Option<"allowC23Features", "allow-c23-features", "bool", "true",
"Allow calls to C23-specific functions">,
Option<"roundingModeIsDefault", "rounding-mode-is-default", "bool", "false",
"Assume default rounding mode">
];
}

//===----------------------------------------------------------------------===//
@@ -1186,13 +1192,13 @@ def TosaToLinalgNamed
Pass that converts TOSA operations to the equivalent operations using the
Linalg named operations.
}];

let options = [
Option<"preferConv2DKernelLayoutHWCF", "prefer-conv2d-kernel-layout-hwcf",
Option<"preferConv2DKernelLayoutHWCF", "prefer-conv2d-kernel-layout-hwcf",
"bool", /*default=*/"false",
"Prefer generating linalg.conv_2d_nhwc_hwcf over linalg.conv_2d_nhwc_fhwc">
"Prefer generating linalg.conv_2d_nhwc_hwcf over linalg.conv_2d_nhwc_fhwc">,
Option<"useMatmulForSingleBatch", "use-matmul-for-single-batch", "bool", /*default=*/"false",
"Use linalg.matmul for 1x batch size instead of linalg.batch_matmul.">
];

let constructor = "tosa::createTosaToLinalgNamed()";
}

@@ -1241,6 +1247,25 @@ def TosaToTensor : Pass<"tosa-to-tensor"> {
let constructor = "tosa::createTosaToTensor()";
}

//===----------------------------------------------------------------------===//
// UBToEmitC
//===----------------------------------------------------------------------===//

def ConvertUBToEmitC : Pass<"convert-ub-to-emitc"> {
let summary = "Convert UB dialect to EmitC dialect";
let description = [{
This pass converts supported UB ops to EmitC dialect.
When the initialization of values is enabled and some types are opaque, the
generated code is C++.
}];
let dependentDialects = ["emitc::EmitCDialect"];
let options = [
Option<"noInitialization", "no-initialization", "bool",
/*default=*/"false",
"Do not initialize the generated variables">,
];
}

//===----------------------------------------------------------------------===//
// UBToLLVM
//===----------------------------------------------------------------------===//
Loading