[PATCH] D144379: [AArch64] Fix abs(sub nsw) -> absd

Dave Green via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Feb 20 05:22:35 PST 2023


dmgreen added a comment.

Can you make sure you upload with full context (-U999999), as per https://llvm.org/docs/DeveloperPolicy.html#making-and-submitting-a-patch. It can help to make the patch easier to review.



================
Comment at: llvm/include/llvm/CodeGen/TargetLowering.h:801
+  // prevent loss of sub_nsw pattern.
+  virtual bool preferABDToABS(EVT VT) const {
+    return isOperationLegalOrCustom(ISD::ABDS, VT);
----------------
Perhaps preferABDSToABSWithNSW? It would be good to add the "nsw" part, as there are other ways to produce ABDS


================
Comment at: llvm/test/CodeGen/AArch64/neon-saba.ll:1
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
+; RUN: llc < %s | FileCheck %s
----------------
Nothing in this file seems to change. We already have abd tests for the nsw cases in neon-abd.ll.

If you would like to add saba tests too, perhaps split this off into a separate commit? It can be good to do that anyway to see the differences in generated code in the patch.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D144379/new/

https://reviews.llvm.org/D144379



More information about the llvm-commits mailing list