[AArch64 - SVE]: Use SVE to lower reduce.fadd.
Enable custom-lowering of NEON-like fixed-width vector versions of @llvm.vector.reduce.fadd to use SVE's fadda instruction, if SVE is enabled.
Details
Diff Detail
- Repository
- rG LLVM Github Monorepo
Unit Tests
Time | Test | |
---|---|---|
60,040 ms | x64 debian > MLIR.Examples/standalone::test.toy | |
60,040 ms | x64 debian > libFuzzer.libFuzzer::value-profile-load.test |
Event Timeline
llvm/lib/Target/AArch64/AArch64ISelLowering.cpp | ||
---|---|---|
1384–1385 | This is quite a limited set of types. I wonder if it actually supports VECREDUCE_SEQ_FADD for e.g. <8 x float> when the vector length is 256, or <8 x double> when the vector length is 512. Can you try this out? Some other code in this file iterates through all possible FP/integer values and uses useSVEForFixedLengthVectorVT() to determine whether SVE should be used. This function has an option named OverrideNEON, which you can use to make it work for 128bit vectors. | |
llvm/test/CodeGen/AArch64/sve-fixed-length-fadd-reduce.ll | ||
2 ↗ | (On Diff #455261) | Could you also add some RUN lines for other vector lengths? |
llvm/test/CodeGen/AArch64/sve-fixed-length-fadd-reduce.ll | ||
---|---|---|
65 ↗ | (On Diff #455261) | This is just an fadd, and is probably simpler to leave as it was before. |
llvm/test/CodeGen/AArch64/sve-fixed-length-fadd-reduce.ll | ||
---|---|---|
1 ↗ | (On Diff #455261) | Hi @hassnaa-arm, could you just reuse the existing fixed-length tests in CodeGen/AArch64/sve-fixed-length-fp-reduce.ll and just add another RUN line: ; RUN: llc -aarch64-sve-vector-bits-min=128 < %s | FileCheck %s -check-prefixes=CHECK,VBITS_GE_128 That test file already contains many of the tests added here. |
2 ↗ | (On Diff #455261) | I think if we reuse sve-fixed-length-fp-reduce.ll, then we get the other lengths for free? |
This is quite a limited set of types. I wonder if it actually supports VECREDUCE_SEQ_FADD for e.g. <8 x float> when the vector length is 256, or <8 x double> when the vector length is 512. Can you try this out?
Some other code in this file iterates through all possible FP/integer values and uses useSVEForFixedLengthVectorVT() to determine whether SVE should be used. This function has an option named OverrideNEON, which you can use to make it work for 128bit vectors.