[PATCH] D145002: [DAGCombiner] Make `(zext (sgt X, -1))` -> `(srl (not X), N-1)` work if typeof(zext)!=typeof(X)
Simon Pilgrim via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Mar 2 04:04:47 PST 2023
RKSimon added inline comments.
================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:2578
Not.getOperand(0), ShAmt);
+ if (ShiftVT != VT)
+ NewShift = DAG.getZExtOrTrunc(NewShift, DL, VT);
----------------
RKSimon wrote:
> Don't bother with the if() - getZExtOrTrunc checks this anyway
For IsAdd don't we need getSExtOrTrunc? AFAICT we're after a 0/-1 value for Add and a 0/1 value for Sub?
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