[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
Tue Apr 23 04:49:39 PDT 2024


dc03-work wrote:

> Remove the freeze code. You cannot look through freeze. It is unsafe.

Hmm, the problem with the test case I'm looking at is that select gets optimized to an and with a freeze, so removing the freeze fold will make this patch unable to fix that test case. Is it still not ok to look through a freeze if it only has one use? I would really like the freeze to be optimized how it is with this patch... At the very least, if the semantics of freeze in GMIR match LLVM IR, then Alive2 does not have issues with optimizing this way for a single-use freeze: https://alive2.llvm.org/ce/z/apgovD.

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


More information about the llvm-commits mailing list