This came about while investigating ways to handle D145468 in a more generic manner, which involves trying harder to fold and(zext(x),c) -> zext(and(x,c))
Alive2: https://alive2.llvm.org/ce/z/7fXtDt (generic fold)
Paths 
  |  Differential  D145855  
[X86] matchAddressRecursively - support zext(and(shl(x,c1)),c2) -> shl(zext(and(x, c2 >> c1),c1) ClosedPublic Authored by RKSimon on Mar 11 2023, 12:28 PM. 
Details Summary This came about while investigating ways to handle D145468 in a more generic manner, which involves trying harder to fold and(zext(x),c) -> zext(and(x,c)) Alive2: https://alive2.llvm.org/ce/z/7fXtDt (generic fold) 
Diff Detail 
 Event TimelineComment Actions LGTM. 
 This revision is now accepted and ready to land.Mar 11 2023, 6:09 PM Closed by commit rG47208f8d3437: [X86] matchAddressRecursively - support zext(and(shl(x,c1)),c2) -> shl(zext(and… (authored by RKSimon).  ·  Explain WhyMar 12 2023, 1:49 AM This revision was automatically updated to reflect the committed changes. 
Revision Contents 
 
Diff 504415 llvm/lib/Target/X86/X86ISelDAGToDAG.cpp
 llvm/test/CodeGen/X86/lea-dagdag.ll
  | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Nit: this should also be common out e.g., unsigned ShAmtV = ShAmtC->getZExtValue().