The scalar start/accumulator value of the fadd- and fmul reduction
should match the result type of the reduction, as well as the vector
element-type of the input vector. Although this was not explicitly
specified in the LangRef, it was taken for granted in code implementing
the reductions. The patch also fixes the LangRef by adding this
constraint.
Details
Details
- Reviewers
RKSimon aemerson efriedma spatel nikic - Commits
- rZORG7cb5c154450d: Match types of accumulator and result for llvm.experimental.vector.reduce.
rG7cb5c154450d: Match types of accumulator and result for llvm.experimental.vector.reduce.
rGf83cccf917c1: Match types of accumulator and result for llvm.experimental.vector.reduce.
rL361133: Match types of accumulator and result for llvm.experimental.vector.reduce.
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
This looks good, but please also update existing tests that specify three types in the intrinstic name. Here's ones I found:
- test/CodeGen/X86/haddsub.ll
- test/CodeGen/X86/vector-reduce-fadd-fast.ll
- test/CodeGen/X86/vector-reduce-fadd.ll
- test/CodeGen/X86/vector-reduce-fmul-fast.ll
- test/CodeGen/X86/vector-reduce-fmul.ll
Looks like AArch64/Generic tests already use the (previously incorrect and now correct) two type form.