[PATCH] D146121: [DAG] Move lshr narrowing from visitANDLike to SimplifyDemandedBits

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 11 17:14:35 PDT 2023


goldstein.w.n added a comment.

In D146121#4491315 <https://reviews.llvm.org/D146121#4491315>, @RKSimon wrote:

> any more thoughts/comments?

One more comment.

I noticed in: D154805 <https://reviews.llvm.org/D154805> that for the scalars the `(shl (add x, c1), c2)` is not properly folding to `(add (shl x, c2), c1 << c2)`. This is because before reaching `visitSHL` (and performing the fold), the `shl` gets shrunk and its wrapped in an `ANY_EXTEND`.

This patch seems like to cause similiar issues. I'm still generally infavor as we can always update the folds, but is a slight concern that we may be adding a layer of indirection that not all folds work with.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D146121



More information about the llvm-commits mailing list