This is an archive of the discontinued LLVM Phabricator instance.

[RISCV][NFC] Tests for indirect float conversion
AbandonedPublic

Authored by lenary on Apr 27 2020, 2:21 AM.

Details

Reviewers
luismarques
Summary

I worked on some patterns to address the code generated by these
examples, which came out of some differential testing against GCC. The patterns
will be in a follow-up patch.

Diff Detail

Event Timeline

lenary created this revision.Apr 27 2020, 2:21 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 27 2020, 2:21 AM
asb added inline comments.Apr 30 2020, 2:09 AM
llvm/test/CodeGen/RISCV/double-convert-indirect.ll
10 ↗(On Diff #260245)

If I'm interpreting this comment correctly, you're neglecting to test rv32if/rv64if because your planned optimisation won't improve things (but feel in principle it should be possible to optimise)? If so, I think it would be better to include the rv32if/rv64if cases here too, even if we don't have a solution on the horizon.

lenary marked an inline comment as done.Apr 30 2020, 3:46 AM
lenary added inline comments.
llvm/test/CodeGen/RISCV/double-convert-indirect.ll
10 ↗(On Diff #260245)

You are interpreting correctly.

It might be possible to optimise, but not with normal SelectionDAG patterns, because on RV32IF the legaliser has already turned the two operations we want to match on into libcalls.

I can look at doing a follow-up DAGCombiner patch (which would run before the legaliser), but it's not clear to me that this is valid on every architecture, because I'm not super familiar with floats. I can post a draft DAGCombiner patch and seek feedback?

asb added inline comments.Apr 30 2020, 4:42 AM
llvm/test/CodeGen/RISCV/double-convert-indirect.ll
10 ↗(On Diff #260245)

A DAGCombiner patch might be interesting, but actually I was just suggesting that this test case contain check lines for RV32IF and RV64IF so that we'll be sure to pick it up if some other change means codegen for those cases improves too.

lenary marked an inline comment as done.Apr 30 2020, 5:07 AM
lenary added inline comments.
llvm/test/CodeGen/RISCV/double-convert-indirect.ll
10 ↗(On Diff #260245)

Ok, sure. I'll add those lines and also rename it so it's clear it's for all FP extensions, not just the D extension.

lenary updated this revision to Diff 261192.Apr 30 2020, 5:08 AM

Address @asb's feedback

  • Renamed the test
  • Added lines for F-extension only runs, showing libcalls.
lenary retitled this revision from [RISCV] Tests for indirect float conversion to [RISCV][NFC] Tests for indirect float conversion.Apr 30 2020, 5:10 AM
lenary abandoned this revision.May 31 2020, 11:32 AM