)]}'
{
  "commit": "48ce7bb0388e26eeae149ee23db2308dcc1e3c4a",
  "tree": "a2db1803434e9c6bb0157b24fe4047e6bf13f261",
  "parents": [
    "f51eca20cf5ff825edc8f2d3eb51b80af5e5794b"
  ],
  "author": {
    "name": "David Sherwood",
    "email": "david.sherwood@arm.com",
    "time": "Wed Jan 14 07:28:38 2026 +0000"
  },
  "committer": {
    "name": "GitHub",
    "email": "noreply@github.com",
    "time": "Wed Jan 14 07:28:38 2026 +0000"
  },
  "message": "[LV] Fix bug in setVectorizedCallDecision (#175742)\n\nThere is a bug in this logic:\n\n```\n   InstructionCost Cost \u003d ScalarCost;\n   InstWidening Decision \u003d CM_Scalarize;\n\n   if (VectorCost \u003c\u003d Cost) {\n     Cost \u003d VectorCost;\n     Decision \u003d CM_VectorCall;\n   }\n\n   if (IntrinsicCost \u003c\u003d Cost) {\n     Cost \u003d IntrinsicCost;\n     Decision \u003d CM_IntrinsicCall;\n   }\n```\n\nbecause it assumes that the comparisons behave sensibly in the face of\ninvalid costs. Unfortunately, PR #174835 exposes an issue when\nattempting to vectorise the new test\nuadd_with_overflow_i32 for AArch64 targets. Specifically, there are\nsituations where all costs are invalid (e.g. VF\u003dvscale x 1), but some\ncosts are more invalid than others. For example, when querying the\nintrinsic cost via the TTI hook we get an invalid cost with a non-zero\nvalue, whereas the vector cost is invalid with a zero value. That leads\nto us erroneously choosing CM_VectorCall as the call widening decision,\ndespite the lack of a vector math variant. Inevitably this causes\ncrashes because we create a VPCallWidenRecipe without a variant\nfunction.\n\nFix this by only performing comparisons if the costs are valid. It now\nleads to us choosing CM_Scalarize more often, but it\u0027s a toin coss\nanyway between CM_Scalarize and CM_IntrinsicCall when both strategies\nare invalid. Potentially we could also create a new strategy called\nCM_Invalid, and avoid the creation of VPlans entirely.",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "3e25c82624ed76d3cd1ef31237e409d3b0563e74",
      "old_mode": 33188,
      "old_path": "llvm/lib/Transforms/Vectorize/LoopVectorize.cpp",
      "new_id": "1cc2416743c871048e407f922bb7718901c2d705",
      "new_mode": 33188,
      "new_path": "llvm/lib/Transforms/Vectorize/LoopVectorize.cpp"
    },
    {
      "type": "modify",
      "old_id": "0656e8356af9734a6043fea3428864471eda07e7",
      "old_mode": 33188,
      "old_path": "llvm/test/Transforms/LoopVectorize/AArch64/multiple-result-intrinsics.ll",
      "new_id": "66247a4f8100e019a52b3fb2ef00e3866fd145b3",
      "new_mode": 33188,
      "new_path": "llvm/test/Transforms/LoopVectorize/AArch64/multiple-result-intrinsics.ll"
    }
  ]
}
