[llvm] [SelectionDAG] Fix bug related to demanded bits/elts for BITCAST (PR #139085)
Björn Pettersson via llvm-commits
llvm-commits at lists.llvm.org
Fri May 16 08:31:08 PDT 2025
bjope wrote:
> So this is what we're fighting I guess? https://alive2.llvm.org/ce/z/rqp6yU
>
Yes, I think that is same thing (but wit IR and not selection DAG).
Often I guess it doesn't cause problems. Downstream we started to see miscompiles after the patch (https://github.com/llvm/llvm-project/pull/136701) that introduced the "zext of poison into poison" fold. The custom lowering of BITCAST for our downstream target would use a zext/shift/or kind of pattern to lower the bitcasted vector, and while we've been lucky that it worked in the past (even with a poisoned element before the bitcast) we now just got poison back.
I'm still not fully clear on how to proceed here. This patch, as is, does leave a lot to think about. The experiment with passing around "not really demanded elements but we must not make undemanded elements more poisonous" got a bit messy after awhile. I could perhaps add it to this patch anyway to show what I've been trying to do.
https://github.com/llvm/llvm-project/pull/139085
More information about the llvm-commits
mailing list