[all-commits] [llvm/llvm-project] 8cc0cd: [SLP] Support FAdd/FSub as interchangeable instruc...
Alexey Bataev via All-commits
all-commits at lists.llvm.org
Thu Jul 9 10:18:42 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 8cc0cd82e1c6c0e6a44cedea74ee623abfd960a3
https://github.com/llvm/llvm-project/commit/8cc0cd82e1c6c0e6a44cedea74ee623abfd960a3
Author: Alexey Bataev <a.bataev at outlook.com>
Date: 2026-07-09 (Thu, 09 Jul 2026)
Changed paths:
M llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
M llvm/test/Transforms/SLPVectorizer/AArch64/vec3-reorder-reshuffle.ll
M llvm/test/Transforms/SLPVectorizer/RISCV/unordered-loads-operands.ll
M llvm/test/Transforms/SLPVectorizer/X86/buildvector-shuffle-with-root.ll
M llvm/test/Transforms/SLPVectorizer/X86/crash_clear_undefs.ll
M llvm/test/Transforms/SLPVectorizer/X86/gathered-loads-non-full-reg.ll
M llvm/test/Transforms/SLPVectorizer/X86/reorder-vf-to-resize.ll
M llvm/test/Transforms/SLPVectorizer/X86/reorder_with_external_users.ll
M llvm/test/Transforms/SLPVectorizer/X86/vec3-reorder-reshuffle.ll
M llvm/test/Transforms/SLPVectorizer/X86/vect_copyable_in_binops.ll
M llvm/test/Transforms/SLPVectorizer/X86/vectorize-widest-phis.ll
M llvm/test/Transforms/SLPVectorizer/jumbled_store_crash.ll
M llvm/test/Transforms/SLPVectorizer/semanticly-same.ll
Log Message:
-----------
[SLP] Support FAdd/FSub as interchangeable instructions
fadd(x, c) and fsub(x, c) are interchangeable via fadd(x, -c), so treat
them like the existing Add/Sub/Mul/Shl/AShr/And/Or/Xor interchange in
BinOpSameOpcodeHelper. This lets a mixed fadd/fsub bundle vectorize as
a single op instead of needing an alt-shuffle/split node.
Restrict the interchange to a constant RHS. A constant LHS (e.g.
"0.0 - x") cannot be moved to the other opcode without also swapping
the variable operand, which would misalign it against lanes that keep
their native opcode and produce a node too expensive to vectorize.
Reviewers: hiraditya, bababuck, RKSimon
Pull Request: https://github.com/llvm/llvm-project/pull/208002
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