[PATCH] D145002: [DAGCombiner] Make `(zext (sgt X, -1))` -> `(srl (not X), N-1)` work if typeof(zext)!=typeof(X)

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 12 00:52:03 PDT 2023


craig.topper added inline comments.


================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:12711
+      (VT == XVT ||
+       (VT.getSizeInBits() > 8 && N->getOpcode() == ISD::ZERO_EXTEND))) {
     // Invert and smear/shift the sign bit:
----------------
goldstein.w.n wrote:
> Should this be behind a new `TLI` flag? Particularly not sure if the `i8` case is generic or just `x86`.
Wouldn't a return be represented by X86ISD::RET_GLUE at this point? It's not a machine opcode.

But also there would be a CopyToReg node as the user to connect the SDNode to a physical register like AL.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D145002



More information about the llvm-commits mailing list