[llvm] [GISel][CombinerHelper] Combine and(trunc(x), trunc(y)) -> trunc(and(x, y)) (PR #89023)

Dhruv Chawla via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 24 01:25:42 PDT 2024


dc03-work wrote:

https://github.com/llvm/llvm-project/pull/89023#issuecomment-2061312745 ping @jayfoad

> > Instcombine handles freeze separately. We are going to follow that pattern:
> > https://github.com/llvm/llvm-project/blob/dc8f6a8cdad427345a60f5142411617df521c303/llvm/lib/Analysis/InstructionSimplify.cpp#L6935
> 
> Okay, I guess that would be the visit here:
> 
> https://github.com/llvm/llvm-project/blob/dc8f6a8cdad427345a60f5142411617df521c303/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp#L4481
> 
> ? I believe my patch would require porting
> https://github.com/llvm/llvm-project/blob/dc8f6a8cdad427345a60f5142411617df521c303/llvm/lib/Transforms/InstCombine/InstructionCombining.cpp#L4298
> 
> to the Combiner.

Also ping @arsenm and @davemgreen, I'm interested in hearing your thoughts on this. I am currently leaning towards adding this transform that InstCombine does to GlobalISel, which will handle the case I'm matching with this patch.

https://github.com/llvm/llvm-project/pull/89023


More information about the llvm-commits mailing list