This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Support fixed-length vector FP_ROUND & FP_EXTEND
ClosedPublic

Authored by frasercrmck on Feb 23 2021, 8:24 AM.

Details

Summary

This patch extends the support for vector FP_ROUND and FP_EXTEND by
including support for fixed-length vector types. Since fixed-length
vectors use "VL" nodes and scalable vectors can use the standard nodes,
there is slightly more to do in the fixed-length case. A helper function
was introduced to try and reduce the divergent paths. It is expected
that this function will similarly come in useful for lowering the
int-to-fp and fp-to-int operations for fixed-length vectors.

Diff Detail

Event Timeline

frasercrmck created this revision.Feb 23 2021, 8:24 AM
frasercrmck requested review of this revision.Feb 23 2021, 8:24 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 23 2021, 8:24 AM
craig.topper added inline comments.Feb 23 2021, 9:59 AM
llvm/lib/Target/RISCV/RISCVISelLowering.h
181

I doubt we need that TRUNC operand. I think its use in the regular node is for scalar call arguments.

frasercrmck marked an inline comment as done.
  • remove TRUNC operand from FP_ROUND_VL and simplify accordingly
llvm/lib/Target/RISCV/RISCVISelLowering.h
181

Fair enough. I was trying to match the standard node in case we ever wanted to use the same logic to process the two together without having to conditionally change operand indices. I'll get rid of it.

This revision is now accepted and ready to land.Feb 24 2021, 1:25 PM
  • rebase & regen tests