[PATCH] D152568: [InstCombine] Transform `(binop1 (binop2 (lshift X,Amt),Mask),(lshift Y,Amt))`

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 13 15:30:21 PDT 2023


goldstein.w.n added inline comments.


================
Comment at: llvm/test/Transforms/InstCombine/or-shifted-masks.ll:133
 ; CHECK-NEXT:    [[I4:%.*]] = and i32 [[I3]], 480
 ; CHECK-NEXT:    [[I5:%.*]] = or i32 [[I4]], [[I2]]
 ; CHECK-NEXT:    br label [[END:%.*]]
----------------
goldstein.w.n wrote:
> nikic wrote:
> > nikic wrote:
> > > This highlights another possible extension: We can have an extra binop on both sides, not just on one.
> > Tested this patch together with D151807, and it looks like handling this case would be needed to get the patterns in one instcombine run instead of instcombine,early-cse,instcombine.
> kk, working on a follow up patch.
I'm going to push this one first as is and split multi-binop version to new patch. Handling generic chains necessitates an entire rewrite + alot more complexity so may end up not being worth it if its more modularly done across multiple passes.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D152568



More information about the llvm-commits mailing list