)]}'
{
  "commit": "e2b2815f8b1ce67805e8805f949ec58319845709",
  "tree": "2236bf042d95e72de1cfca6b30311566e20f4879",
  "parents": [
    "31ac291c91a4186df63eaf97456026a5acaa3711"
  ],
  "author": {
    "name": "Florian Walbroel",
    "email": "walbroel@roofline.ai",
    "time": "Mon Nov 16 09:59:54 2026 +0100"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Mon Nov 16 09:59:54 2026 +0100"
  },
  "message": "[LLVMCPU] Handle named and generic convolutions the same in strategy selection (#25252)\n\n## Context\n\nWe have inconsistent handling of named linalg operations v.s. generics.\nIdeally it should not matter in which form we see the operation, in all\ncases we should handle the same way if it is semantically identical.\n\nThe usage of `llvm::isa` can prevent this in later stages of the\npipeline, thus it is preferable to avoid checks on the type and rather\nuse the op interface instead e.g. `linalg::isaConvolutionOpInterface`\n\n## This PR\n\nLLVMCPU strategy selection had two checks on\n`linalg::ConvolutionOpInterface`, which only named convolution ops\nimplement:\n\n* `getVectorPreProcStrategy` returned `None` for them.\n* `MultiLoweringConfigGenerator::create` skipped lowering config\npropagation to the other ops in the dispatch.\n\nGlobalOptimization generalizes all convolutions, so in the\n`iree-compile` pipeline the root op is a `linalg.generic` and neither\ncheck fires. Their only effect was that the named and the generalized\nform of the same convolution selected different configurations when the\npass runs on named ops directly, as in the lit tests.\n\nThis PR removes both checks. It also drops the `isa\u003clinalg::GenericOp\u003e`\ncondition from the elementwise/reduction classification in\n`getVectorPreProcStrategy`, so named convolutions take the path the\ngeneralized ones already take on x86-64 and RISC-V as well.\n\n## Effect\n\nNo change to what `iree-compile` generates. I compiled 103 single-op\nprograms (convolutions, poolings, contractions, elementwise, reductions,\nQDQ variants) at default flags, with `--iree-opt-data-tiling`, and with\ndata tiling plus `--iree-llvmcpu-enable-ukernels\u003dall`, before and after\nthis change:\n\n| Target | Modules compared | Byte-identical |\n|---|---:|---:|\n| AArch64, Apple M4 host | 305 | 305 |\n| RISC-V 64, `spacemit-x60` | 305 | 305 |\n| x86-64, `haswell` | 305 | 305 |\n| x86-64, `skylake-avx512` | 305 | 305 |\n| AArch64 SVE, `neoverse-v1`, scalable vectorization | 277 | 277 |\n\nNamed convolutions fed directly to the pass now get what their\ngeneralized forms get: loop peeling on AArch64 and propagated lowering\nconfigs on fused producers and consumers.\n\n## Why remove the checks instead of extending them to generics\n\nI tried the other direction first, on the M4. Making generic\nconvolutions skip peeling, or skip config propagation, each changed the\nselected configuration for 29 convolution and pooling cases. Run time\nwas unchanged for all but one: a quantized 3x3 stride-2 NCHW convolution\nbecame about 1.45x slower either way (6.7 ms to 9.6 ms without peeling).\nIt is the only case where the vector tile (8) does not divide the\ndistribution tile (28). So the behavior the named ops had is the slower\none.\n\n## Test changes\n\n* `select_aarch64_lowering_strategy.mlir`: two named convolutions gain\n`enable_loop_peeling`, matching their `GENERIC` checks.\n* `select_aarch64_sve_lowering_strategy.mlir`: the fill of the named\ndepthwise convolution gains a propagated config.\n* `pipeline_tests.mlir`, the two pooling + pack tests for #20723: with\npropagation, the pooling\u0027s lowering config is adjusted for the pack\nconsumer, so the pack is fused into the distribution loop and no longer\ngoes through `iree_linalg_ext.map_store`. I rewrote the checks and\ncomments for that. These two tests therefore no longer cover the\n`map_store` fallback; it is still covered in\n`pipeline_disable_distribution_tests.mlir` and\n`tile_and_fuse_producer_consumer_anchoring_non_root_op.mlir`. This is\nthe output `iree-compile` already produces for this dispatch, since the\npooling arrives as a generic. Let me know if you would rather keep a\nnamed-op test that still exercises the fallback.\n\n🤖 Generated with [Claude Code](https://claude.com/claude-code)\n\nSigned-off-by: Florian Walbroel \u003cwalbroel@roofline.ai\u003e\nCo-authored-by: Claude Fable 5.2 \u003cnoreply@anthropic.com\u003e",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "1a27fdc7e983e6ae40990b1bb0a4aab0806294c7",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/Codegen/LLVMCPU/KernelDispatch.cpp",
      "new_id": "d0e26d0924e990a87644ad26a7fd9009b1d8dfcb",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/Codegen/LLVMCPU/KernelDispatch.cpp"
    },
    {
      "type": "modify",
      "old_id": "d0acc85df5679f131ed2f3b4ae67609a7d5ebd76",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/Codegen/LLVMCPU/test/pipeline_tests.mlir",
      "new_id": "64ab182bfbeff7010e2de877127ea0fe8c6645e2",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/Codegen/LLVMCPU/test/pipeline_tests.mlir"
    },
    {
      "type": "modify",
      "old_id": "553d595f4e30cee39e8b32ab0dbc44eef5794d58",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/Codegen/LLVMCPU/test/select_aarch64_lowering_strategy.mlir",
      "new_id": "d84d2b4f075928c46ee9158557278b4d9120dc58",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/Codegen/LLVMCPU/test/select_aarch64_lowering_strategy.mlir"
    },
    {
      "type": "modify",
      "old_id": "c22c451d709821665a89345272caf831e0ce0e59",
      "old_mode": 33188,
      "old_path": "compiler/src/iree/compiler/Codegen/LLVMCPU/test/select_aarch64_sve_lowering_strategy.mlir",
      "new_id": "0a948781cfe82ab3a57f14077ef1fb7fb3f25c15",
      "new_mode": 33188,
      "new_path": "compiler/src/iree/compiler/Codegen/LLVMCPU/test/select_aarch64_sve_lowering_strategy.mlir"
    }
  ]
}
