[PATCH] D99940: [ARM] Combine sub 0, csinc X, Y, CC -> csinv -X, Y, CC

Malhar via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 6 08:34:52 PDT 2021


malharJ added a comment.

I don't have much context, but I'm just wondering if a similar optimization for csneg might be useful ?
sub(0, csneg( X, Y, <cc>) ) = csinv -X, -Y-1



================
Comment at: llvm/lib/Target/ARM/ARMISelLowering.cpp:12824
 
+// Combine sub 0, csinc X, Y, CC -> csinv -X, Y, CC
+//   providing -X is as cheap as X (currently, just a constant).
----------------
Do you think this would be better worded as:
Fold (sub 0, ( ARMcsinc X, Y, CC) ) -> (ARMcsinv -X, Y, CC)


================
Comment at: llvm/test/CodeGen/Thumb2/mve-vmovimm.ll:523
 ; CHECKLE-NEXT:    mov.w r1, #15
-; CHECKLE-NEXT:    cset r0, eq
-; CHECKLE-NEXT:    rsbs r0, r0, #0
+; CHECKLE-NEXT:    csetm r0, eq
 ; CHECKLE-NEXT:    ands r0, r1
----------------
Is the new assembly equivalent to the old one: ie, does this set the condition codes ?


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

https://reviews.llvm.org/D99940



More information about the llvm-commits mailing list