)]}'
{
  "commit": "28d4e33b654be3f839cf2cb362aed92beaaa671c",
  "tree": "4b79be4723ac6c6dd9f4821de57b80cd4c806977",
  "parents": [
    "06e4728f83e5c41c4e075fc5014f4aea696b6417"
  ],
  "author": {
    "name": "Pankaj Dwivedi",
    "email": "pankajkumar.divedi@amd.com",
    "time": "Wed Dec 17 17:53:00 2025 +0530"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Wed Dec 17 17:53:00 2025 +0530"
  },
  "message": "[AMDGPU][SIInsertWaitCnt] Optimize loadcnt insertion at function boundaries (#169647)\n\nOn GFX12+, GLOBAL_INV increments the loadcnt counter but does not write\nresults to any VGPRs. Previously, we unconditionally inserted\ns_wait_loadcnt 0 at function returns even when the only pending loadcnt\nwas from GLOBAL_INV instructions.\n\nThis patch optimizes waitcnt insertion by skipping the loadcnt wait at\nfunction boundaries when no VGPRs have pending loads. This is determined\nby checking if any VGPR has a score greater than the lower bound for\nLOAD_CNT - if not, the pending loadcnt must be from non-VGPR-writing\ninstructions like GLOBAL_INV.\n\nThe optimization is limited to GFX12+ targets where GLOBAL_INV exists\nand uses the extended wait count instructions.\n\nThis is a follow-up optimization to PR #135340 which added tracking for\nGLOBAL_INV in the waitcnt pass.",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "ab7f5590045994d05fe400ac64f5f50557a23875",
      "old_mode": 33188,
      "old_path": "llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp",
      "new_id": "e21583ae0876f0c81eaf9f365388a1d3012a2ec4",
      "new_mode": 33188,
      "new_path": "llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp"
    },
    {
      "type": "modify",
      "old_id": "8063b29c299859815a8f7f0abf814ab4f65b960f",
      "old_mode": 33188,
      "old_path": "llvm/test/CodeGen/AMDGPU/GlobalISel/atomicrmw_fmax.ll",
      "new_id": "32f539a267e67fd0f0f18f3a9d2724b39a2ca144",
      "new_mode": 33188,
      "new_path": "llvm/test/CodeGen/AMDGPU/GlobalISel/atomicrmw_fmax.ll"
    },
    {
      "type": "modify",
      "old_id": "5b0b602bd99ba57d47d580cb7b3bbe53064eef82",
      "old_mode": 33188,
      "old_path": "llvm/test/CodeGen/AMDGPU/GlobalISel/atomicrmw_fmin.ll",
      "new_id": "be0ef85b217dee9f3dcec2a89f8b5222cc14816a",
      "new_mode": 33188,
      "new_path": "llvm/test/CodeGen/AMDGPU/GlobalISel/atomicrmw_fmin.ll"
    },
    {
      "type": "modify",
      "old_id": "58586129fb4e9059e8f3ec3b704fd3d2b14d2f06",
      "old_mode": 33188,
      "old_path": "llvm/test/CodeGen/AMDGPU/GlobalISel/fp64-atomics-gfx90a.ll",
      "new_id": "1d0b423c1e0c5687740ec2235642a2bea3915bc3",
      "new_mode": 33188,
      "new_path": "llvm/test/CodeGen/AMDGPU/GlobalISel/fp64-atomics-gfx90a.ll"
    },
    {
      "type": "modify",
      "old_id": "b75eb737534e919cbc12e145b104da55f967c239",
      "old_mode": 33188,
      "old_path": "llvm/test/CodeGen/AMDGPU/GlobalISel/mubuf-global.ll",
      "new_id": "5c80c27c3d28043ae2d94c21b402caecc79908b0",
      "new_mode": 33188,
      "new_path": "llvm/test/CodeGen/AMDGPU/GlobalISel/mubuf-global.ll"
    },
    {
      "type": "modify",
      "old_id": "e7adfa01b663311e8b69874bfe35f31d21331878",
      "old_mode": 33188,
      "old_path": "llvm/test/CodeGen/AMDGPU/atomicrmw-expand.ll",
      "new_id": "18e2ae291940435c13a7a20a8f12bdcd70cac2b6",
      "new_mode": 33188,
      "new_path": "llvm/test/CodeGen/AMDGPU/atomicrmw-expand.ll"
    },
    {
      "type": "modify",
      "old_id": "ce8ffab77ac85a88afaf48917e2242e866db06eb",
      "old_mode": 33188,
      "old_path": "llvm/test/CodeGen/AMDGPU/atomicrmw_usub_cond.ll",
      "new_id": "e58ccfd331845bdd6d8ec8dd77e42012dadb7caf",
      "new_mode": 33188,
      "new_path": "llvm/test/CodeGen/AMDGPU/atomicrmw_usub_cond.ll"
    },
    {
      "type": "modify",
      "old_id": "708556aae76fe78b5491e72750f78c33ef796b8d",
      "old_mode": 33188,
      "old_path": "llvm/test/CodeGen/AMDGPU/atomicrmw_usub_sat.ll",
      "new_id": "cd0995eabd1bbb929bceb87a6bd93b5dfd4b176f",
      "new_mode": 33188,
      "new_path": "llvm/test/CodeGen/AMDGPU/atomicrmw_usub_sat.ll"
    },
    {
      "type": "modify",
      "old_id": "efb75e95212b2aba7effd4d222929da5bf8a5e7b",
      "old_mode": 33188,
      "old_path": "llvm/test/CodeGen/AMDGPU/buffer-fat-pointer-atomicrmw-fadd.ll",
      "new_id": "70e7ec2ea8b678017dcb614eeced0e8f43f29282",
      "new_mode": 33188,
      "new_path": "llvm/test/CodeGen/AMDGPU/buffer-fat-pointer-atomicrmw-fadd.ll"
    },
    {
      "type": "modify",
      "old_id": "f3bf8c664f7a61bd9d91dac13fa8bfcd21b181b9",
      "old_mode": 33188,
      "old_path": "llvm/test/CodeGen/AMDGPU/buffer-fat-pointer-atomicrmw-fmax.ll",
      "new_id": "064b36cc261b3d346523e0b9fd3e12d927c88ed9",
      "new_mode": 33188,
      "new_path": "llvm/test/CodeGen/AMDGPU/buffer-fat-pointer-atomicrmw-fmax.ll"
    },
    {
      "type": "modify",
      "old_id": "d1dc76f3213756928b1a7c8a6ab18f7d09c44598",
      "old_mode": 33188,
      "old_path": "llvm/test/CodeGen/AMDGPU/buffer-fat-pointer-atomicrmw-fmin.ll",
      "new_id": "c8e7540124fd9a1c28b4f49872135a05de45da0b",
      "new_mode": 33188,
      "new_path": "llvm/test/CodeGen/AMDGPU/buffer-fat-pointer-atomicrmw-fmin.ll"
    },
    {
      "type": "modify",
      "old_id": "25bad218926f34140b295bf2de5645e5d35838eb",
      "old_mode": 33188,
      "old_path": "llvm/test/CodeGen/AMDGPU/buffer-fat-pointer-atomicrmw-usub_cond.ll",
      "new_id": "2414290ccd62dc60885e447304a19d9aa40b4afe",
      "new_mode": 33188,
      "new_path": "llvm/test/CodeGen/AMDGPU/buffer-fat-pointer-atomicrmw-usub_cond.ll"
    },
    {
      "type": "modify",
      "old_id": "836830cfa418aead66d0ae3c97ad391962f579e9",
      "old_mode": 33188,
      "old_path": "llvm/test/CodeGen/AMDGPU/buffer-fat-pointer-atomicrmw-usub_sat.ll",
      "new_id": "b4400e6f779cc3cf152fa1523fa6b32de7c98990",
      "new_mode": 33188,
      "new_path": "llvm/test/CodeGen/AMDGPU/buffer-fat-pointer-atomicrmw-usub_sat.ll"
    },
    {
      "type": "modify",
      "old_id": "66d8b3f54d77964c01e223fa6983b511f65e6c59",
      "old_mode": 33188,
      "old_path": "llvm/test/CodeGen/AMDGPU/flat-atomicrmw-fadd.ll",
      "new_id": "0bc1fca0409c3624c7751209888fb388144a233e",
      "new_mode": 33188,
      "new_path": "llvm/test/CodeGen/AMDGPU/flat-atomicrmw-fadd.ll"
    },
    {
      "type": "modify",
      "old_id": "8aa1a35f3c6083370c03abd6f2d83dc41486d5b7",
      "old_mode": 33188,
      "old_path": "llvm/test/CodeGen/AMDGPU/flat-atomicrmw-fmax.ll",
      "new_id": "6831485790abce9aec96d7cf818b35d14a902901",
      "new_mode": 33188,
      "new_path": "llvm/test/CodeGen/AMDGPU/flat-atomicrmw-fmax.ll"
    },
    {
      "type": "modify",
      "old_id": "be3143da0a95c6a44b379c2bb6a23bc4c6722a9f",
      "old_mode": 33188,
      "old_path": "llvm/test/CodeGen/AMDGPU/flat-atomicrmw-fmin.ll",
      "new_id": "4c659f9ca917413a60f9d3ba174febd12a540a06",
      "new_mode": 33188,
      "new_path": "llvm/test/CodeGen/AMDGPU/flat-atomicrmw-fmin.ll"
    },
    {
      "type": "modify",
      "old_id": "37fad11cd5039e5e88246096f9431913012e34d8",
      "old_mode": 33188,
      "old_path": "llvm/test/CodeGen/AMDGPU/flat-atomicrmw-fsub.ll",
      "new_id": "9166ad3043472652d4e7d667fc0313de76e68f16",
      "new_mode": 33188,
      "new_path": "llvm/test/CodeGen/AMDGPU/flat-atomicrmw-fsub.ll"
    },
    {
      "type": "modify",
      "old_id": "6ae3cfb7e106a9263248e3a10c914098e4de48ce",
      "old_mode": 33188,
      "old_path": "llvm/test/CodeGen/AMDGPU/flat-saddr-atomics.ll",
      "new_id": "bfeeae68d4cafe62cebeacec96bb2b107ca5f913",
      "new_mode": 33188,
      "new_path": "llvm/test/CodeGen/AMDGPU/flat-saddr-atomics.ll"
    },
    {
      "type": "modify",
      "old_id": "8b7c49b5931afa7849d28d214b5fdafc8d6e9144",
      "old_mode": 33188,
      "old_path": "llvm/test/CodeGen/AMDGPU/flat-saddr-load.ll",
      "new_id": "63520f5ffd50ae1901a91db8f612b0ec9af2d4c1",
      "new_mode": 33188,
      "new_path": "llvm/test/CodeGen/AMDGPU/flat-saddr-load.ll"
    },
    {
      "type": "modify",
      "old_id": "66d859fbd66eeb23f802da0bf9a7a294297e3efb",
      "old_mode": 33188,
      "old_path": "llvm/test/CodeGen/AMDGPU/fp-atomics-gfx942.ll",
      "new_id": "c9d4fd901158c1781c5ad22e88ef063c90d419b2",
      "new_mode": 33188,
      "new_path": "llvm/test/CodeGen/AMDGPU/fp-atomics-gfx942.ll"
    },
    {
      "type": "modify",
      "old_id": "d1db407cdbe0795d62efb6e5bd7a379123123220",
      "old_mode": 33188,
      "old_path": "llvm/test/CodeGen/AMDGPU/fp64-atomics-gfx90a.ll",
      "new_id": "608c48d20793bab57ac6be2e107327b769b3de00",
      "new_mode": 33188,
      "new_path": "llvm/test/CodeGen/AMDGPU/fp64-atomics-gfx90a.ll"
    },
    {
      "type": "modify",
      "old_id": "21e5994819997a85f3f7f11d090ff7fc24185470",
      "old_mode": 33188,
      "old_path": "llvm/test/CodeGen/AMDGPU/global-atomicrmw-fadd.ll",
      "new_id": "8febea5445efcfbe9fbf576345a0612b86a115aa",
      "new_mode": 33188,
      "new_path": "llvm/test/CodeGen/AMDGPU/global-atomicrmw-fadd.ll"
    },
    {
      "type": "modify",
      "old_id": "dbd48d2a7cf8fca06b8b4f6fe9e193c73ef255aa",
      "old_mode": 33188,
      "old_path": "llvm/test/CodeGen/AMDGPU/global-atomicrmw-fmax.ll",
      "new_id": "31ec099d41cfeb70637b6680192a91ab1bdf4213",
      "new_mode": 33188,
      "new_path": "llvm/test/CodeGen/AMDGPU/global-atomicrmw-fmax.ll"
    },
    {
      "type": "modify",
      "old_id": "7930ad8a154049dff077a7553f910b5d9c667f0e",
      "old_mode": 33188,
      "old_path": "llvm/test/CodeGen/AMDGPU/global-atomicrmw-fmin.ll",
      "new_id": "64d42356e8968084cf639155c69d6bd6ff259e94",
      "new_mode": 33188,
      "new_path": "llvm/test/CodeGen/AMDGPU/global-atomicrmw-fmin.ll"
    },
    {
      "type": "modify",
      "old_id": "b79d0df960a0f3e46a5d9c127eb2918a3a2d8e8b",
      "old_mode": 33188,
      "old_path": "llvm/test/CodeGen/AMDGPU/global-atomicrmw-fsub.ll",
      "new_id": "940918a5437b34193c71f025a28c6581ee737dac",
      "new_mode": 33188,
      "new_path": "llvm/test/CodeGen/AMDGPU/global-atomicrmw-fsub.ll"
    },
    {
      "type": "modify",
      "old_id": "6fd1285c0a345524e9e37d09fd1395e502d4906b",
      "old_mode": 33188,
      "old_path": "llvm/test/CodeGen/AMDGPU/global-saddr-atomics-min-max-system.ll",
      "new_id": "63d63da56080b649523f250465cc6f404b01f6f2",
      "new_mode": 33188,
      "new_path": "llvm/test/CodeGen/AMDGPU/global-saddr-atomics-min-max-system.ll"
    },
    {
      "type": "modify",
      "old_id": "d297955f109aba60778de7b3ea211875675fedab",
      "old_mode": 33188,
      "old_path": "llvm/test/CodeGen/AMDGPU/global-saddr-atomics.ll",
      "new_id": "58f7c4340276d1c1c95e8d4074cda9fb2c50063e",
      "new_mode": 33188,
      "new_path": "llvm/test/CodeGen/AMDGPU/global-saddr-atomics.ll"
    },
    {
      "type": "modify",
      "old_id": "890ebddf36801b6b8bafec1300a880ab68e1912e",
      "old_mode": 33188,
      "old_path": "llvm/test/CodeGen/AMDGPU/global-saddr-load.ll",
      "new_id": "eb1d950a904671d5dc7da8f133eb16aa6ca15f06",
      "new_mode": 33188,
      "new_path": "llvm/test/CodeGen/AMDGPU/global-saddr-load.ll"
    },
    {
      "type": "modify",
      "old_id": "d4867dbaa14b3e9f2c64e7e00127c76454d04168",
      "old_mode": 33188,
      "old_path": "llvm/test/CodeGen/AMDGPU/insert_waitcnt_for_precise_memory.ll",
      "new_id": "b91967bca72d8c19cc9208c7a95a9292597747d1",
      "new_mode": 33188,
      "new_path": "llvm/test/CodeGen/AMDGPU/insert_waitcnt_for_precise_memory.ll"
    },
    {
      "type": "modify",
      "old_id": "614a221d43d53de5f08430d7fb8261b4a6bd8218",
      "old_mode": 33188,
      "old_path": "llvm/test/CodeGen/AMDGPU/llvm.amdgcn.cooperative.atomic-agent.ll",
      "new_id": "95e9ab26dbca7314f65ff625fd74d80ac45f49b1",
      "new_mode": 33188,
      "new_path": "llvm/test/CodeGen/AMDGPU/llvm.amdgcn.cooperative.atomic-agent.ll"
    },
    {
      "type": "modify",
      "old_id": "c4234cc0de06a58e48713be60d3d1ec9c2ac48f6",
      "old_mode": 33188,
      "old_path": "llvm/test/CodeGen/AMDGPU/llvm.amdgcn.cooperative.atomic-system.ll",
      "new_id": "b18590fb14a024c3a2d5c4d1b94c41f2f3081c1a",
      "new_mode": 33188,
      "new_path": "llvm/test/CodeGen/AMDGPU/llvm.amdgcn.cooperative.atomic-system.ll"
    },
    {
      "type": "modify",
      "old_id": "0a7e662975b4173dcd2055752e857e04e5d0465c",
      "old_mode": 33188,
      "old_path": "llvm/test/CodeGen/AMDGPU/local-atomicrmw-fadd.ll",
      "new_id": "96c4c3e74b384fe84f0c0e09b7c05e0c2c48aa81",
      "new_mode": 33188,
      "new_path": "llvm/test/CodeGen/AMDGPU/local-atomicrmw-fadd.ll"
    },
    {
      "type": "modify",
      "old_id": "657a90d71b8ee699b105d9ce10dc84aa24506c89",
      "old_mode": 33188,
      "old_path": "llvm/test/CodeGen/AMDGPU/local-atomicrmw-fmax.ll",
      "new_id": "e0745fda6c0034ed8ba42d0624ca7d93ef4fbbe7",
      "new_mode": 33188,
      "new_path": "llvm/test/CodeGen/AMDGPU/local-atomicrmw-fmax.ll"
    },
    {
      "type": "modify",
      "old_id": "1144291ec95d7e65e94f2e2d90a924c1bf2bf4e6",
      "old_mode": 33188,
      "old_path": "llvm/test/CodeGen/AMDGPU/local-atomicrmw-fmin.ll",
      "new_id": "a03d02691a8b4b37a634e5a5578cc2a2477a235a",
      "new_mode": 33188,
      "new_path": "llvm/test/CodeGen/AMDGPU/local-atomicrmw-fmin.ll"
    },
    {
      "type": "modify",
      "old_id": "dfe37fda186cb3828e212310e6edcf3984db93fe",
      "old_mode": 33188,
      "old_path": "llvm/test/CodeGen/AMDGPU/local-atomicrmw-fsub.ll",
      "new_id": "27dc54969380bede2a9386b9276960048832c6b6",
      "new_mode": 33188,
      "new_path": "llvm/test/CodeGen/AMDGPU/local-atomicrmw-fsub.ll"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "5068843d170273b93b92dc4c18772b1ff5c714da",
      "new_mode": 33188,
      "new_path": "llvm/test/CodeGen/AMDGPU/waitcnt-func-global-inv.mir"
    }
  ]
}
