[llvm] [InstCombine] Move extends across identity shuffles. (PR #146901)
Florian Hahn via llvm-commits
llvm-commits at lists.llvm.org
Tue Jul 8 04:58:47 PDT 2025
https://github.com/fhahn commented:
> Not an objection, but a possible point of concern. We canonicalize shuffles after binary operators, and unary operators. Having the shuffle canonicalized before the casts seems slightly inconsistent. We should canonicalize one direction or the other, but is pulling the shuffle early the right choice? I have no strong opinion here, just raising the question for consideration.
Yes that's a slight inconsentency, but casts seem perhaps different enough to warrant separate treatement, as extending casts on wider vectors are usually more expensive than on narrower vectors. So moving them earlier should never make things worse, whereas moving after the cast could make things worse in practice.
https://github.com/llvm/llvm-project/pull/146901
More information about the llvm-commits
mailing list