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

Phoebe Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 12 01:04:26 PDT 2023


pengfei 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:
----------------
craig.topper wrote:
> 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.
Yes, you are right, thanks @craig.topper


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