HomePhabricator

[RISCV] Support OR/XOR/AND reductions on vector masks

Authored by frasercrmck on Apr 7 2021, 2:03 AM.

Description

[RISCV] Support OR/XOR/AND reductions on vector masks

This patch adds RVV codegen support for OR/XOR/AND reductions for both
scalable- and fixed-length vector types. There are a few possible
codegen strategies for each -- vmfirst.m, vmsbf.m, and vmsif.m could be
used to some extent -- but the vpopc.m instruction was chosen since it
produces the scalar result in one instruction, after which scalar
instructions can finish off the computation.

The reductions are lowered identically for both scalable- and
fixed-length vectors, although some alternate strategies may be more
optimal on fixed-length vectors since it's cheaper to get the length of
those types.

Other reduction types were not deemed to be relevant for mask vectors.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D100030

Details

Committed
frasercrmckApr 8 2021, 1:46 AM
Reviewer
craig.topper
Differential Revision
D100030: [RISCV] Support OR/XOR/AND reductions on vector masks
Parents
rG8fcb114d002b: [OpenCL] Fix mipmap read_image return types
Branches
Unknown
Tags
Unknown