[llvm] [AArch64] treat `@llvm.ssub.sat` the same as `@llvm.aarch64.neon.sqsub` (PR #140454)

via llvm-commits llvm-commits at lists.llvm.org
Thu May 29 05:11:13 PDT 2025


================
@@ -1622,8 +1622,10 @@ bool AArch64LegalizerInfo::legalizeSmallCMGlobalValue(
 
 bool AArch64LegalizerInfo::legalizeIntrinsic(LegalizerHelper &Helper,
                                              MachineInstr &MI) const {
-  auto LowerBinOp = [&MI](unsigned Opcode) {
-    MachineIRBuilder MIB(MI);
+  MachineIRBuilder MIB(MI);
----------------
SpencerAbson wrote:

Sorry if I was unclear, I meant in my last comment that this statement could be `MachineIRBuilder &MIB = Helper.MIRBuilder;`?

Since this function is invoked as
```
if (isa<GIntrinsic>(MI))
    return LI.legalizeIntrinsic(*this, MI) ? Legalized : UnableToLegalize;
```

So it should be configured in the same way that the local `MachineIRBuilder MIB(MI)` would be.  There is also another use of `MachineIRBuilder &MIB = Helper.MIRBuilder;` under `Intrinsic::get_dynamic_area_offset:` that we could remove.


I realise that this code cleanup is a little irrelevant to this patch (which LGTM overall), so I'd understand if you'd rather not push more changes.


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


More information about the llvm-commits mailing list