[PATCH] D142344: [DAGCombiner] Add Transform for `(and/or (eq/ne A,Pow2),(eq/ne A,-Pow2))`->`(eq/ne (and (and A,Pow2),~(Pow2*2)), 0)`

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 23 11:40:38 PST 2023


goldstein.w.n added inline comments.


================
Comment at: llvm/include/llvm/CodeGen/TargetLowering.h:4014
+                                                  const SDNode *SETCC0,
+                                                  const SDNode *SETCC1) const {
+    return false;
----------------
RKSimon wrote:
> Drop the const from the SDNode args?
> Drop the const from the SDNode args?

Really? All the surrounding "should I do this" functions seem to use consts:

```
  virtual bool isDesirableToCommuteWithShift(const SDNode *N,
                                             CombineLevel Level) const {
    return true;
  }
...
  virtual bool isDesirableToCombineLogicOpOfSETCC(const SDNode *LogicOp,
                                                  const SDNode *SETCC0,
                                                  const SDNode *SETCC1) const {
    return false;
  }

...
  virtual bool isDesirableToCommuteXorWithShift(const SDNode *N) const {
    return true;
  }

```


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D142344



More information about the llvm-commits mailing list