)]}'
{
  "commit": "3a49a5a0ca38798c0e4bfe037e154dce2b9398b0",
  "tree": "6c66b852a28b415c62db9a8b230660ecfb00fb36",
  "parents": [
    "6f899a7b464c5b55f32fb6115e6df6ee98ef2743"
  ],
  "author": {
    "name": "Luke Lau",
    "email": "luke@igalia.com",
    "time": "Fri Oct 30 00:16:00 2026 +0800"
  },
  "committer": {
    "name": "Luke Lau",
    "email": "luke@igalia.com",
    "time": "Thu Nov 12 18:29:50 2026 +0800"
  },
  "message": "[VPlan] Allow early exit loops with side effects by masking in the vector loop.\n\nWhen all blocks with side effects are dominated by every early exit, we can vectorize the loop if we mask off any lanes past the exit. We can do this with control flow:\n\n```mermaid\nflowchart TD\n  header --\u003e exiting\n  exiting --\u003e| exit mask | sideeffects --\u003e latch --\u003e latch.split\n  exiting --\u003e| !exit mask | latch.split\n```\n\nFor every early exiting block we add a branch to the latch on `!mask.beforefirst(exitcond)`. This is implemented in UncountableExitStyle::ReadOnly which is now renamed to MaskedHandleExitInVectorLoop.\n\nThis is a complementary exit style to MaskedHandleExitInScalarLoop. If any of the side effects aren\u0027t dominated by the early exit it still falls back to the scalar loop style, which is why none of the existing early exit side effect tests changed. Masking in loop is profitable for RISC-V and I\u0027m assuming it\u0027s also profitable for AArch64 too, but if not then we can add a TTI hook for a preferred exit style.\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "128adbf60f1f22860e3e0f03e0a257907e3eb5f3",
      "old_mode": 33188,
      "old_path": "llvm/lib/Transforms/Vectorize/LoopVectorize.cpp",
      "new_id": "8a4800a80a22f41ab0d0088c028159091522540f",
      "new_mode": 33188,
      "new_path": "llvm/lib/Transforms/Vectorize/LoopVectorize.cpp"
    },
    {
      "type": "modify",
      "old_id": "d27473af8a7ca5c4c316f0639af6bbbb121b108d",
      "old_mode": 33188,
      "old_path": "llvm/lib/Transforms/Vectorize/VPlan.h",
      "new_id": "d2354f58aba100e90ebdf09f74e1985dcfd44d58",
      "new_mode": 33188,
      "new_path": "llvm/lib/Transforms/Vectorize/VPlan.h"
    },
    {
      "type": "modify",
      "old_id": "8a026aba613855e27b1a5faea92a2f983e491b62",
      "old_mode": 33188,
      "old_path": "llvm/lib/Transforms/Vectorize/VPlanConstruction.cpp",
      "new_id": "db47293ca8476d4e05bc537b6380ed166a7fba12",
      "new_mode": 33188,
      "new_path": "llvm/lib/Transforms/Vectorize/VPlanConstruction.cpp"
    },
    {
      "type": "modify",
      "old_id": "c75441a3ed272900f2498e045a92f2e47acb2015",
      "old_mode": 33188,
      "old_path": "llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp",
      "new_id": "548ddc68f4f398b045aae0c5644951a050697866",
      "new_mode": 33188,
      "new_path": "llvm/lib/Transforms/Vectorize/VPlanTransforms.cpp"
    },
    {
      "type": "modify",
      "old_id": "573ee73e76a439b3dd8b208abc80863404712d9e",
      "old_mode": 33188,
      "old_path": "llvm/test/Transforms/LoopVectorize/RISCV/early_exit_with_stores.ll",
      "new_id": "8ba6d5f81679e5fbe27c0dcd959d4d0977fce715",
      "new_mode": 33188,
      "new_path": "llvm/test/Transforms/LoopVectorize/RISCV/early_exit_with_stores.ll"
    },
    {
      "type": "modify",
      "old_id": "3635a51a925dadb4c365f456c7e20442084d5a40",
      "old_mode": 33188,
      "old_path": "llvm/test/Transforms/LoopVectorize/X86/early_exit_with_stores.ll",
      "new_id": "8ffc6ba186b301a1bf42c232e5b3540549951367",
      "new_mode": 33188,
      "new_path": "llvm/test/Transforms/LoopVectorize/X86/early_exit_with_stores.ll"
    },
    {
      "type": "modify",
      "old_id": "139c9992cc38d73ba85fe84f7a571ff0b01f3aac",
      "old_mode": 33188,
      "old_path": "llvm/test/Transforms/LoopVectorize/early_exit_with_stores.ll",
      "new_id": "d4f5ef95e5da73de6531448c5fbe124f24f9fe6b",
      "new_mode": 33188,
      "new_path": "llvm/test/Transforms/LoopVectorize/early_exit_with_stores.ll"
    },
    {
      "type": "modify",
      "old_id": "e006ed7e4bd124f8d37dafbfeb98220a09b51435",
      "old_mode": 33188,
      "old_path": "llvm/unittests/Transforms/Vectorize/VPlanVerifierTest.cpp",
      "new_id": "aaf677b894d2a5429fde30d6cb470a5bd01f5483",
      "new_mode": 33188,
      "new_path": "llvm/unittests/Transforms/Vectorize/VPlanVerifierTest.cpp"
    }
  ]
}
