[PATCH] D133399: [DAGCombiner] Fold (mul (sra X, BW-1), Y) -> (neg (and (sra X, BW-1), Y))
Simon Pilgrim via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 7 09:30:34 PDT 2022
RKSimon added inline comments.
================
Comment at: llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp:3953
+ SelectionDAG &DAG) {
+ if (N0.getOpcode() != ISD::SRA)
+ return SDValue();
----------------
craig.topper wrote:
> RKSimon wrote:
> > Would this work more generally if we tested for NumSignBits == BitWidth instead?
> It’s starts picking up vectors of constants if we do that and it wasn’t clear that the test changes were improvements.
>
> I can add a TODO?
Yes a TODO would be fine
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D133399/new/
https://reviews.llvm.org/D133399
More information about the llvm-commits
mailing list