[PATCH] D158364: [DAG] SimplifyDemandedBits - if we're only demanding the signbits, a MIN/MAX node can be simplified to a OR or AND node

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 31 11:27:44 PDT 2023


goldstein.w.n accepted this revision.
goldstein.w.n added a comment.
This revision is now accepted and ready to land.

LGTM



================
Comment at: llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp:2161
+    case ISD::SMAX:
+      // TODO: Add KnownBits::sge/sgt handling.
+      break;
----------------
RKSimon wrote:
> goldstein.w.n wrote:
> > Should compute Known for `smin`/`smax`? Imo also just fill in the TODO. Its not much code required.
> Adding smin/smax knownbits handling adds a couple of unrelated changes - I'd prefer to handle that separately. If you prefer, I can refactor the existing min/max cases into this new layout first (with existing functionality) and then fix the missing knownbits handling first?
No, fine to leave as todo I guess.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D158364



More information about the llvm-commits mailing list