[PATCH] D152876: [InstCombine] Expand `foldBinOpShiftWithShift` to handle multiple binops

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jun 14 01:24:46 PDT 2023


goldstein.w.n added a comment.

In D152876#4420131 <https://reviews.llvm.org/D152876#4420131>, @nikic wrote:

> Is it possible to handle just the case `binop(optional_binop1(shift), optional_binop2(shift))`? I believe that's all that is necessary for the motivating cases and should allow a much cleaner implementation.

I started with just making all the binop checks optional and found myself using a vec anyways. As is, I don't think the current generic logic has any additional special cases that we wouldn't need to handle with 3-total binops. (i.e there is never special control flow b.c we may have more than 1 binop assosiated with a given shift, its basically all the same for handling 0/1). The `NumInnerOps == 1` stuff would also be needed for 3-total case.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152876



More information about the llvm-commits mailing list