[llvm] [GlobalISel][AArch64] Legalize G_FABS and G_FNEG for SVE (PR #114784)
Thorsten Schütt via llvm-commits
llvm-commits at lists.llvm.org
Wed Nov 13 14:07:27 PST 2024
tschuett wrote:
Thank you for your write-up!
fneg from LLVM-IR is roughly equivalent to G_FNEG. They can be scalar or vectorized, but they are not predicated.
G_FNEG may become legal for SVE after this PR.
We state def : GINodeEquiv<G_FNEG, fneg>; We use this mechanism to scrape patterns from tablegen. It works for NEON. For SVE there are no patterns. You know better than me. FNEG_ZPmZ_D is predicated and merging. If we want to continue with the pattern approach, we need SVE patterns for fneg. As neither fneg nor G_FNEG are predicated, we have to stick ptrues on FNEG_ZPmZ_D. It leaves not much space for optimizing predicates. We might add more combines into tablegen for optimizations.
https://github.com/llvm/llvm-project/pull/114784
More information about the llvm-commits
mailing list