[llvm] [SelectionDAG] Fix unsafe cases for loop.dependence.{war/raw}.mask (PR #168565)

Sander de Smalen via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 11 08:47:03 PST 2025


================
@@ -5461,11 +5461,16 @@ AArch64TargetLowering::LowerLOOP_DEPENDENCE_MASK(SDValue Op,
     return SDValue();
   }
 
+  unsigned LaneOffset = Op.getConstantOperandVal(3);
+  if (LaneOffset != 0)
+    return SDValue();
----------------
sdesmalen-arm wrote:

very minor nit: LaneOffset is otherwise unused. You could write this as:

```suggestion
  SDValue LaneOffset = Op.getOperand(3);
  if (LaneOffset->getAsZExtVal())
    return SDValue();
```
and replace other uses of `Op.getOperand(3)` by `LaneOffset`.

https://github.com/llvm/llvm-project/pull/168565


More information about the llvm-commits mailing list