[PATCH] D89346: [SelectionDAG][X86] Enable SimplifySetCC CTPOP transforms for vector splats

Sanjay Patel via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 19 06:42:08 PDT 2020


spatel added a reviewer: davezarzycki.
spatel accepted this revision.
spatel added a comment.
This revision is now accepted and ready to land.

@davezarzycki - do you still want to add tests that would be affected by this patch (it might already be done, but I missed it)?

LGTM other than the code comment nits.



================
Comment at: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:3402
   if ((Cond == ISD::SETULT && C1 == 2) || (Cond == ISD::SETUGT && C1 == 1)) {
+    // If this is a vector CTPOP, keep the CTPOP if its legal.
+    if (VT.isVector() && TLI.isOperationLegal(ISD::CTPOP, CTVT))
----------------
The comment doesn't explain the motivation for not using the more common isOperationLegalOrCustom() clause or ignoring legality for scalars.
Add something about the x86 motivation and possibly a TODO about changing that?

Grammar police: "if it is"


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89346



More information about the llvm-commits mailing list