[all-commits] [llvm/llvm-project] b115c0: [RISCV] Fix a crash when lowering split float argu...

Fraser Cormack via All-commits all-commits at lists.llvm.org
Thu Jul 22 02:04:38 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: b115c038d2d4de15e240d15c6770df5c496b60b6
      https://github.com/llvm/llvm-project/commit/b115c038d2d4de15e240d15c6770df5c496b60b6
  Author: Fraser Cormack <fraser at codeplay.com>
  Date:   2021-07-22 (Thu, 22 Jul 2021)

  Changed paths:
    M llvm/lib/Target/RISCV/RISCVISelLowering.cpp
    A llvm/test/CodeGen/RISCV/calling-conv-vector-float.ll
    M llvm/test/CodeGen/RISCV/fastcc-float.ll

  Log Message:
  -----------
  [RISCV] Fix a crash when lowering split float arguments

Lowering certain float vectors without legal vector types could cause a
crash due to a bad interaction between passing floats via GPRs and
argument splitting. Split vector floats appear just like scalar floats.
Under certain situations we choose to pass these float arguments via
GPRs and use an XLenVT location and set the 'BCvt' info to track how
they must be converted back to floating-point values. However, later
logic for handling split arguments may take over, in which case we lose
the previous information and set the 'Indirect' info, thus incorrectly
lowering to integer types.

I don't believe that we would have come across the notion of split
floating-point arguments before. This patch addresses the issue by
updating the lowering so that split arguments are only passed indirectly
when they are scalar integer types.

This has some change to how we lower some larger illegal float vectors,
as can be seen in 'fastcc-float.ll' where the vector is now passed
partly in registers and partly on the stack.

Reviewed By: luismarques

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




More information about the All-commits mailing list