[llvm] [LLVM] treat `@llvm.ssub.sat` the same as `@llvm.aarch64.neon.sqsub` (PR #140454)
David Green via llvm-commits
llvm-commits at lists.llvm.org
Sun May 18 07:14:16 PDT 2025
================
@@ -1795,6 +1795,14 @@ bool AArch64LegalizerInfo::legalizeIntrinsic(LegalizerHelper &Helper,
MI.eraseFromParent();
return true;
}
+ case Intrinsic::aarch64_neon_sqadd:
+ return LowerBinOp(TargetOpcode::G_SADDSAT);
+ case Intrinsic::aarch64_neon_sqsub:
+ return LowerBinOp(TargetOpcode::G_SSUBSAT);
+ case Intrinsic::aarch64_neon_uqadd:
+ return LowerBinOp(TargetOpcode::G_UADDSAT);
+ case Intrinsic::aarch64_neon_uqsub:
+ return LowerBinOp(TargetOpcode::G_USUBSAT);
----------------
davemgreen wrote:
Yeah I think that sounds OK. Can you make it similar to the SDAG variants where it checks for isVector() before doing the conversion? (I'm not sure what the scalar intrinsics will do at the moment in gisel, but lets get the vector variants done first).
You might need to update the tests too.
https://github.com/llvm/llvm-project/pull/140454
More information about the llvm-commits
mailing list