[PATCH] D68949: [DAGCombiner] fold select-of-constants based on sign-bit test

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 14 12:56:37 PDT 2019


craig.topper added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:8208
+  }
+  return SDValue();
+}
----------------
spatel wrote:
> craig.topper wrote:
> > What about i8 X > -1 ? 0 : C1  or do we canonicalize that to i8 X < 0 ? C1 : 0?
> Instcombine canonicalizes those commuted patterns in IR, but it's not handled in SDAG. Worth duplicating?
If InstCombine gets it that's probably fine. Can we add a comment here?


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

https://reviews.llvm.org/D68949





More information about the llvm-commits mailing list