)]}'
{
  "commit": "df183c780225a5c896abaede5d86a16b960616df",
  "tree": "0a897cfa86980c2c25bcb9a380392c145dd4b5ad",
  "parents": [
    "02b19219d9c625da0a7f8eb9342a1620714e36e0"
  ],
  "author": {
    "name": "Aditya Trivedi",
    "email": "120598696+adit4443ya@users.noreply.github.com",
    "time": "Tue Oct 20 14:35:32 2026 +0530"
  },
  "committer": {
    "name": "Copybara-Service",
    "email": "copybara-worker@google.com",
    "time": "Tue Oct 20 02:11:24 2026 -0700"
  },
  "message": " [mlir][flang][OpenMP] Privatize LINEAR list items with linear privatizers; support ALLOCATABLE (#228827)\n\nFlang miscompiled `LINEAR` on an `ALLOCATABLE` list item (#182401). The\nlinear\noperand was the descriptor reference, but `linear_var_types` held the\nelement\ntype, so translation created an undersized private copy and the program\ncrashed.\n\nThis patch makes linear list items use privatizer recipes, the same way\n`private` and `reduction` do.\n\n**MLIR**\n- The `linear` clause on `omp.wsloop` and `omp.simd` now carries a\nprivatizer\n  symbol and an entry block argument for each list item:\n  ```mlir\n  omp.private {type \u003d linear} @x.linear : i32\nomp.simd linear(@x.linear %x -\u003e %arg0 : !llvm.ptr \u003d %step : i32)\nlinear_var_types([i32]) {\n  ```\n- New `linear` `DataSharingType` for `omp.private`. Also an optional\n  `data_address` region that yields the address of the underlying linear\n  value when the privatized type wraps it (e.g. a Fortran descriptor).\n- Verifier checks:\n- a linear clause must use a `linear` privatizer whose type matches its\n    list item;\n  - `linear` privatizers can\u0027t be used in other clauses;\n  - `data_address` is only allowed on `linear` privatizers, which can\u0027t\n    have a copy region;\n  - `omp.declare_simd` doesn\u0027t accept linear privatizers.\n\n**Translation**\n- Linear variables are allocated, initialized and deallocated through\nthe\n  existing private-variable path.\n- The start value is read from the original variable, the private copy\nis\n  set to `start + iv * step`, and the value from the last iteration is\ncopied back. All accesses go through the `data_address` region when the\n  privatizer has one.\n- The old `.linear_result` temporary and the in-place rewrite of the\n  original variable are removed.\n\n**Flang**\n- `processLinear` and the implicit linear IV of `simd` now create\n`linear`\n  privatizers through `DataSharingProcessor`. For an allocatable, the\n  recipe has a `data_address` region (`fir.load` + `fir.box_addr`).\n- For composite `do simd` and `distribute parallel do simd`, linear\n  privatizers go on `omp.wsloop`.\n- Lowering linear without delayed privatization now emits a TODO.\n\nFixes #182401\n\nGitOrigin-RevId: ac5d3955cd1931f71109caa8c026319ca69ca252\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "15d30905aadcdacc22e6c911ed13b29cfc7f7fcc",
      "old_mode": 33188,
      "old_path": "include/flang/Lower/Support/Utils.h",
      "new_id": "afd4f220eaf86411e76b35064cf15388ffae45a9",
      "new_mode": 33188,
      "new_path": "include/flang/Lower/Support/Utils.h"
    },
    {
      "type": "modify",
      "old_id": "0a648e9612ec421382952f3661f9e7d9b3abf5c3",
      "old_mode": 33188,
      "old_path": "include/flang/Support/OpenMP-utils.h",
      "new_id": "3512a72ab01e8984f9756262b8039e0a11956538",
      "new_mode": 33188,
      "new_path": "include/flang/Support/OpenMP-utils.h"
    },
    {
      "type": "modify",
      "old_id": "b1f29bb23361f0d77a2c9c831a259f777f57f3ca",
      "old_mode": 33188,
      "old_path": "lib/Lower/OpenMP/ClauseProcessor.cpp",
      "new_id": "34961d3d44ba2f45d1a4382db05f5a01de3b41b9",
      "new_mode": 33188,
      "new_path": "lib/Lower/OpenMP/ClauseProcessor.cpp"
    },
    {
      "type": "modify",
      "old_id": "6b0e0cf606f48f040adf0cd1ce93d853d425530d",
      "old_mode": 33188,
      "old_path": "lib/Lower/OpenMP/ClauseProcessor.h",
      "new_id": "33f44754bb84ba2ae10aea81033b9eeb80df9db8",
      "new_mode": 33188,
      "new_path": "lib/Lower/OpenMP/ClauseProcessor.h"
    },
    {
      "type": "modify",
      "old_id": "98561803ea8bbe19c1ade598e3cf5cb8a0e342bb",
      "old_mode": 33188,
      "old_path": "lib/Lower/OpenMP/DataSharingProcessor.cpp",
      "new_id": "e18aaab1a3812779fd12141b4e45e1c8efa7b34b",
      "new_mode": 33188,
      "new_path": "lib/Lower/OpenMP/DataSharingProcessor.cpp"
    },
    {
      "type": "modify",
      "old_id": "73044c304800ba986e70ff22ec008b831d5e5aa4",
      "old_mode": 33188,
      "old_path": "lib/Lower/OpenMP/DataSharingProcessor.h",
      "new_id": "0c0c2ab04a0b10887b6a324c44ad02949dd72127",
      "new_mode": 33188,
      "new_path": "lib/Lower/OpenMP/DataSharingProcessor.h"
    },
    {
      "type": "modify",
      "old_id": "57978826c5d014ce4527d9689f31cb08940953e9",
      "old_mode": 33188,
      "old_path": "lib/Lower/OpenMP/OpenMP.cpp",
      "new_id": "abe1df79f6aef24ba5e1bf3e5481c2e59313f63c",
      "new_mode": 33188,
      "new_path": "lib/Lower/OpenMP/OpenMP.cpp"
    },
    {
      "type": "modify",
      "old_id": "056e7a5af6431a6ba792409ba765a84f060c46e7",
      "old_mode": 33188,
      "old_path": "lib/Lower/Support/Utils.cpp",
      "new_id": "c5440820d7eb09743ecc435d2558f9b78f1a2540",
      "new_mode": 33188,
      "new_path": "lib/Lower/Support/Utils.cpp"
    },
    {
      "type": "modify",
      "old_id": "b8db9e9bd72eb0b46b95a67374a3a32960e06f2a",
      "old_mode": 33188,
      "old_path": "lib/Support/OpenMP-utils.cpp",
      "new_id": "dc7e69ba1bba713ac204bf979191aeeaec445dcd",
      "new_mode": 33188,
      "new_path": "lib/Support/OpenMP-utils.cpp"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "a550529c2f22f58e74e5da638e5c7fc2d71fcfa0",
      "new_mode": 33188,
      "new_path": "test/Lower/OpenMP/Todo/linear-no-delayed-privatization.f90"
    },
    {
      "type": "modify",
      "old_id": "35d4080f2041d9cc69c35a75bce698f1a8a022e3",
      "old_mode": 33188,
      "old_path": "test/Lower/OpenMP/composite_simd_linear.f90",
      "new_id": "8a4f11c08daa8a2ac70b82ae6e1a69282f78064a",
      "new_mode": 33188,
      "new_path": "test/Lower/OpenMP/composite_simd_linear.f90"
    },
    {
      "type": "modify",
      "old_id": "112ab98e4cd27442cdc203737a16bb3af00a4453",
      "old_mode": 33188,
      "old_path": "test/Lower/OpenMP/compound-version-override.f90",
      "new_id": "01a89c8ef9c32f18ed3746092187339566fdd328",
      "new_mode": 33188,
      "new_path": "test/Lower/OpenMP/compound-version-override.f90"
    },
    {
      "type": "modify",
      "old_id": "44b6e342b99f034e34e587db456fc304192c9cc2",
      "old_mode": 33188,
      "old_path": "test/Lower/OpenMP/distribute-parallel-do-simd.f90",
      "new_id": "067c6f700ee90169297167a3943ec0838951b899",
      "new_mode": 33188,
      "new_path": "test/Lower/OpenMP/distribute-parallel-do-simd.f90"
    },
    {
      "type": "modify",
      "old_id": "d01cda1083d81db14b0159e3ae8061273d5ee317",
      "old_mode": 33188,
      "old_path": "test/Lower/OpenMP/distribute-simd.f90",
      "new_id": "69b1a507ead788a134d2d4b9282dc7fb29ac89b5",
      "new_mode": 33188,
      "new_path": "test/Lower/OpenMP/distribute-simd.f90"
    },
    {
      "type": "modify",
      "old_id": "5f80f25152b53b9c2e9e578d3b89c1cfc3e3cbca",
      "old_mode": 33188,
      "old_path": "test/Lower/OpenMP/indirect-reference-privatization.f90",
      "new_id": "9ff831bd4484c923fc5fe7d2e86b95fed7e5c045",
      "new_mode": 33188,
      "new_path": "test/Lower/OpenMP/indirect-reference-privatization.f90"
    },
    {
      "type": "add",
      "old_id": "0000000000000000000000000000000000000000",
      "old_mode": 0,
      "old_path": "/dev/null",
      "new_id": "b6b62f5cf6872e5cee890cc1475b4ba55d3a6486",
      "new_mode": 33188,
      "new_path": "test/Lower/OpenMP/linear-allocatable.f90"
    },
    {
      "type": "modify",
      "old_id": "47dfe92aca952bd6d7dc6f1d18f39df6c646859b",
      "old_mode": 33188,
      "old_path": "test/Lower/OpenMP/linear_modifier.f90",
      "new_id": "1d3c507c617a277499177a76e511a29bfc1d4a13",
      "new_mode": 33188,
      "new_path": "test/Lower/OpenMP/linear_modifier.f90"
    },
    {
      "type": "modify",
      "old_id": "e96c3fe65b0f8685942fb47182463ee62aa9990a",
      "old_mode": 33188,
      "old_path": "test/Lower/OpenMP/metadirective-loop.f90",
      "new_id": "81dfac22c9ae77a9e3457e263018674935137909",
      "new_mode": 33188,
      "new_path": "test/Lower/OpenMP/metadirective-loop.f90"
    },
    {
      "type": "modify",
      "old_id": "1149bdb30023314cb9a790109e5af77f860badbf",
      "old_mode": 33188,
      "old_path": "test/Lower/OpenMP/simd-linear.f90",
      "new_id": "ef2fcafff39bf367a61f34cc75ebc97ff28ca347",
      "new_mode": 33188,
      "new_path": "test/Lower/OpenMP/simd-linear.f90"
    },
    {
      "type": "modify",
      "old_id": "a9fcf56175027f5998fa5e725e50e312c1864251",
      "old_mode": 33188,
      "old_path": "test/Lower/OpenMP/wsloop-linear.f90",
      "new_id": "886ec1426c5933c6368bdfd67177d0fd96ab783d",
      "new_mode": 33188,
      "new_path": "test/Lower/OpenMP/wsloop-linear.f90"
    },
    {
      "type": "modify",
      "old_id": "61b4d9e0dd7ddc830a76fb89d97252d03354488f",
      "old_mode": 33188,
      "old_path": "test/Lower/OpenMP/wsloop-simd.f90",
      "new_id": "639e6e4b6ef41b8ef2c06ffdaa4abb5c7edd4dd2",
      "new_mode": 33188,
      "new_path": "test/Lower/OpenMP/wsloop-simd.f90"
    }
  ]
}
