)]}'
{
  "commit": "cd382327de38eabaa9de6edd72783b860b864a27",
  "tree": "acc975fe18c717232fe42c5f85ba78accdf9628c",
  "parents": [
    "dd8ea95cb9607aa0c54baec192a8e37bb86e79cf"
  ],
  "author": {
    "name": "Valentin Churavy",
    "email": "v.churavy@gmail.com",
    "time": "Mon Sep 28 23:25:57 2026 +0200"
  },
  "committer": {
    "name": "Valentin Churavy",
    "email": "v.churavy@gmail.com",
    "time": "Mon Sep 28 23:33:00 2026 +0200"
  },
  "message": "Share one cache between identical loads in loops\n\nIn IR that has not been CSE\u0027d (e.g. `x[i] * x[i]` straight from the\nfrontend with only mem2reg/SROA applied), two loads of the same address\nin the same loop iteration were cached separately for the reverse pass,\ndoubling the tape memory (and memcpy traffic) for that value, in both\ncombined and split (augmented primal tape) mode.\n\nAdd RemoveRedundantLoads to preprocessForClone for reverse modes: a\nsimple load inside a loop is replaced by an earlier simple load that\n - has the same type and an address with the same SCEV,\n - dominates it, from the same loop or an enclosing one,\n - carries identical (non-debug) metadata, and\n - has no instruction in between that may write the memory read\n   (writesToMemoryReadBy with AA), nor a fence or convergent call.\nBoth loads then provably yield the same value, so replacing one with\nthe other is a pure primal-level CSE and the cache is created once.\n\nThe transform can be disabled with -enzyme-dedup-loads\u003d0; rematbude.ll,\nwhich deliberately uses two identical loads to exercise a caching\nchoice, now passes that flag. New test: ReverseMode/dedupload.ll.\n\nCo-Authored-By: Claude Opus 5.5 (1M context) \u003cnoreply@anthropic.com\u003e\nClaude-Session: https://claude.ai/code/session_019RNZGgCdK1fbT2WPQpR7Br\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "d825cbd43349fadaeab04cedf88a6b3a355c5fb3",
      "old_mode": 33188,
      "old_path": "enzyme/Enzyme/FunctionUtils.cpp",
      "new_id": "74ac2da04228efd3d0585b878a0225f74bf4119c",
      "new_mode": 33188,
      "new_path": "enzyme/Enzyme/FunctionUtils.cpp"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "bf3918171aaac65207b0391d69f89a027847496a",
      "new_mode": 33188,
      "new_path": "enzyme/test/Enzyme/ReverseMode/dedupload.ll"
    },
    {
      "type": "modify",
      "old_id": "3b1c781a16e5573c3a1d2bb67e9f67bfa16fb1e7",
      "old_mode": 33188,
      "old_path": "enzyme/test/Enzyme/ReverseMode/rematbude.ll",
      "new_id": "297ddeb31d823e9d58fd335cb15877a108f48ba6",
      "new_mode": 33188,
      "new_path": "enzyme/test/Enzyme/ReverseMode/rematbude.ll"
    }
  ]
}
