[llvm] Fold SVE mul and mul_u to neg during isel (PR #160828)

Paul Walker via llvm-commits llvm-commits at lists.llvm.org
Tue Sep 30 07:07:04 PDT 2025


================
@@ -730,6 +730,21 @@ let Predicates = [HasSVE_or_SME] in {
   defm ABS_ZPmZ  : sve_int_un_pred_arit<  0b110, "abs",  AArch64abs_mt>;
   defm NEG_ZPmZ  : sve_int_un_pred_arit<  0b111, "neg",  AArch64neg_mt>;
 
+  // mul x (splat -1) -> neg x
+  let Predicates = [HasSVE_or_SME] in {
----------------
paulwalker-arm wrote:

Just for clarity: You do need to target guard patterns but in this instance the patterns are already inside the require target guard.

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


More information about the llvm-commits mailing list