)]}'
{
  "commit": "cebcce44cccc6829dd4854556c60cc6d2f59b28c",
  "tree": "e0cf134d4d1e30859967e876b2ee3ca116f9f8d0",
  "parents": [
    "17f674dbbcedecfde82f77e12a27bae2d8e79c2e"
  ],
  "author": {
    "name": "Jeff Law",
    "email": "jeffreyalaw@gmail.com",
    "time": "Mon Oct 12 20:51:11 2026 -0600"
  },
  "committer": {
    "name": "Jeff Law",
    "email": "jeffreyalaw@gmail.com",
    "time": "Mon Oct 12 20:53:41 2026 -0600"
  },
  "message": "[RISC-V][PR 127813] Add more czero patterns/splitters for RISC-V\n\nSo the first new pattern here is very straightforward.  It\u0027s essentially the\nsame pattern the VRULL guys did initially and I suggested they move towards the\nif-then-else form.  This bug clearly shows that pattern useful.\n\nThe two other patterns are more interesting.\n\nWe\u0027d really like to match the (and (neg (reg1)) (reg2)) when reg1 has a 0/1\nvalue as a czero, similarly for the inverse which uses (plus (reg1) (const_int\n-1)).   My first implementation checked nonzero_bits and matched that form\ndirectly generating the czero.  Review via an LLM flagged that problem.\n\nFor this testcase (and I think reasonably generally) we\u0027ll often see these\nwrapped by an IOR as part of a more general conditional move sequence\nconstructed from logicals with the IOR doing final selection.  So that\u0027s a 3-\u003e2\nsplit that we can recognize in combine (using nonzero_bits), then immediately\nrewrite into a form that doesn\u0027t require that test.  It\u0027s not ideal, but should\nbe enough to capture the most common cases.\n\nTested on riscv32-elf and riscv64-elf and bootstrapped and regression tested on\nthe k3.  c920 is being flaky so that\u0027ll have to spin overnight.  k1 is queued\nand will pick this up on its next run which starts in an hour or two.\n\nAnyway, pushing this to the trunk.  I\u0027ll keep the BZ open as Andrea wants to\ntackle some stuff up in match.pd in a generic way.\n\n\tPR tree-optimization/127813\ngcc/\n\t* config/riscv/zicond.md: Add new define_insn for czero expressed via\n\tlogical ops.  Add define_splits when related patterns are used by an\n\tIOR to select across two values.\n\ngcc/testsuite\n\t* gcc.target/riscv/pr127813.c: New test.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "99a8a4abf5b05f49bde9fc16d0f74931a58296a7",
      "old_mode": 33188,
      "old_path": "gcc/config/riscv/zicond.md",
      "new_id": "272bee519c7a411fe63ff2301152555317657a5b",
      "new_mode": 33188,
      "new_path": "gcc/config/riscv/zicond.md"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "d9578ee3e2971670eb60a8c2ffd844fce1286605",
      "new_mode": 33188,
      "new_path": "gcc/testsuite/gcc.target/riscv/pr127813.c"
    }
  ]
}
