[RISCV] Bugfix for floats passed on the stack with the ILP32 ABI on RV32F
authorAlex Bradbury <asb@lowrisc.org>
Thu, 4 Oct 2018 07:28:49 +0000 (07:28 +0000)
committerAlex Bradbury <asb@lowrisc.org>
Thu, 4 Oct 2018 07:28:49 +0000 (07:28 +0000)
commite96b7c88a3a908c21b925ef0f61ef93475b222ca
treea2155ce2b593080b899bda86413bedd6b5f646e2
parent217ed1ffff851fab885867435108f6096b28a4d2
[RISCV] Bugfix for floats passed on the stack with the ILP32 ABI on RV32F

f32 values passed on the stack would previously cause an assertion in
unpackFromMemLoc.. This would only trigger in the presence of the F extension
making f32 a legal type. Otherwise the f32 would be legalized.

This patch fixes that by keeping LocVT=f32 when a float is passed on the
stack. It also adds test coverage for this case, and tests that also
demonstrate lw/sw/flw/fsw will be selected when most profitable. i.e. there is
no unnecessary i32<->f32 conversion in registers.

llvm-svn: 343756
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
llvm/test/CodeGen/RISCV/calling-conv-rv32f-ilp32.ll [new file with mode: 0644]