[llvm] [instcombine] Pull sext/zext through reduce.or/and (PR #99394)
Philip Reames via llvm-commits
llvm-commits at lists.llvm.org
Thu Jul 18 10:23:56 PDT 2024
preames wrote:
> We usually try not to do bitwidth changing transforms on vectors in InstCombine, because we don't have information on operation legality here. How confident are you that this transform is profitable for all vector types on all architectures?
>
> The alternative is to do this based on cost model in VectorCombine -- which incidentally already has foldTruncFromReductions which is basically this for for trunc rather than zext/sext, so should be easy to extend to other cast kinds...
I'm going to take the VectorCombine approach here as that seems to be path of least resistance. It does feel very strange to me not to have canonicalization for vector operations in InstCombine. This particular transform seems much more like a canonicalization than a cost based optimization to me.
https://github.com/llvm/llvm-project/pull/99394
More information about the llvm-commits
mailing list