)]}'
{
  "commit": "dce490e529ead7885852950394d520de1f53b917",
  "tree": "541bd54c593efd792ca7fd9d02af0b4e3860b211",
  "parents": [
    "4811c67d62b840a7f5d3320de0b15ba96e27d2e4"
  ],
  "author": {
    "name": "Craig Topper",
    "email": "craig.topper@sifive.com",
    "time": "Thu May 29 12:33:16 2025 -0700"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Thu May 29 12:33:16 2025 -0700"
  },
  "message": "[RISCV] Custom type legalize MVT::i8 BITREVERSE to BREV8. (#142001)\n\nIf we\u0027re only reversing a single byte, we can use BREV8 directly.\n\nIf we let it type legalize we\u0027ll get (srl (bitreverse X), XLen-8). In op\nlegalization, we\u0027ll expand that to (srl (brev8 (bswap X)), XLen - 8).\nThen, SimplifyDemandedBits can reduce it to (srl (brev8 (shl X, XLen -\n8)), XLen - 8). We could add a DAGCombine to pull the shl through the\nbrev8 to put it next to the srl which will allow it to become (and\n(brev8 X), 255). Unless we can prove the upper XLen-8 bits are 0 or that\nthey aren\u0027t demanded, we can\u0027t remove the `and`.\n\nBy emitting BREV8 directly when we still know the type is i8, we can\navoid this. We already DAGCombine i16 and i32 (bitreverse (bswap X)) to\nBREV8 early for the same reason.\n\nI\u0027ve added an i7 test case so we can still see the opportunity for\nimprovement on weird sizes.\n\nFixes the RISC-V part of #141863.",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "452256cf1d21eb9ef1f33175a04e55bbe1885a90",
      "old_mode": 33188,
      "old_path": "llvm/lib/Target/RISCV/RISCVISelLowering.cpp",
      "new_id": "a9685bd30dcad77c5d09acea77920e06bffb59b1",
      "new_mode": 33188,
      "new_path": "llvm/lib/Target/RISCV/RISCVISelLowering.cpp"
    },
    {
      "type": "modify",
      "old_id": "1afb03b346a1a904a3fd1c737da01ae38f0baaa4",
      "old_mode": 33188,
      "old_path": "llvm/test/CodeGen/RISCV/bswap-bitreverse.ll",
      "new_id": "35ab6c8d0cab56824f25a8da65eda9dedba10e5c",
      "new_mode": 33188,
      "new_path": "llvm/test/CodeGen/RISCV/bswap-bitreverse.ll"
    }
  ]
}
