[all-commits] [llvm/llvm-project] d0c1ea: [InstCombine] Pull unary shuffles through fneg/fab...
Luke Lau via All-commits
all-commits at lists.llvm.org
Mon Jun 30 02:40:35 PDT 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: d0c1ea928c5c4a99689ff3dcbf1ca578d56b80a3
https://github.com/llvm/llvm-project/commit/d0c1ea928c5c4a99689ff3dcbf1ca578d56b80a3
Author: Luke Lau <luke at igalia.com>
Date: 2025-06-30 (Mon, 30 Jun 2025)
Changed paths:
M llvm/lib/Transforms/InstCombine/InstCombineAddSub.cpp
M llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
M llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
M llvm/test/Transforms/InstCombine/matrix-multiplication-negation.ll
M llvm/test/Transforms/InstCombine/vec_shuffle-inseltpoison.ll
M llvm/test/Transforms/InstCombine/vec_shuffle.ll
M llvm/test/Transforms/SLPVectorizer/X86/alternate-cast-inseltpoison.ll
M llvm/test/Transforms/SLPVectorizer/X86/alternate-cast.ll
Log Message:
-----------
[InstCombine] Pull unary shuffles through fneg/fabs (#144933)
This canonicalizes fneg/fabs (shuffle X, poison, mask) -> shuffle
(fneg/fabs X), posion, mask
This undoes part of b331a7ebc1e02f9939d1a4a1509e7eb6cdda3d38 and
a8f13dbdeb31be37ee15b5febb7cc2137bbece67, but keeps the binary shuffle
case i.e. shuffle fneg, fneg, mask.
By pulling out the shuffle we bring it inline with the same
canonicalisation we perform on binary ops and intrinsics, which the
original commit acknowledges it goes in the opposite direction.
However nowadays VectorCombine is more powerful and can do more
optimisations when the shuffle is pulled out, so I think we should
revisit this. In particular we get more shuffles folded and can perform
scalarization.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list