This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Fix non-sensical intrinsic names in rv64i-single-softfloat.ll. NFC
ClosedPublic

Authored by craig.topper on Nov 9 2021, 5:06 PM.

Details

Summary

Many of these had an extra 'f' at the beginning of their name that
caused them to not be treated as intrinsics.

I'm not sure what fpround was supposed to be so I deleted it.

frem was changed from an intrinsic too an instruction.

Diff Detail

Event Timeline

craig.topper created this revision.Nov 9 2021, 5:06 PM
craig.topper requested review of this revision.Nov 9 2021, 5:06 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 9 2021, 5:06 PM
Herald added a subscriber: MaskRay. · View Herald Transcript
jrtc27 added a comment.Nov 9 2021, 5:14 PM

Looks like they've been broken the whole time; see D65497. Also no clue what fpround is meant to be, all seven (floor, ceil, trunc, rint, nearbyint, round, roundeven) of the rounding intrinsics are already tested (modulo the typos).

Looks like they've been broken the whole time; see D65497. Also no clue what fpround is meant to be, all seven (floor, ceil, trunc, rint, nearbyint, round, roundeven) of the rounding intrinsics are already tested (modulo the typos).

This is the only place these are tested with softfloat isn't it?

jrtc27 added a comment.Nov 9 2021, 5:23 PM

Looks like they've been broken the whole time; see D65497. Also no clue what fpround is meant to be, all seven (floor, ceil, trunc, rint, nearbyint, round, roundeven) of the rounding intrinsics are already tested (modulo the typos).

This is the only place these are tested with softfloat isn't it?

Looks like it. I don't know why there aren't just RVxxI versions in the {float,double}-intrinsics.ll files; this seems like unnecessary duplication of effort, is under-tested due to not having any RV32I tests and rv64i-double-softfloat.ll is comparatively minimal.

jrtc27 added a comment.EditedNov 9 2021, 5:26 PM

I also don't understand why we're not getting tail calls here. Well, the intrinsic calls could be explained by using call rather than tail call in the IR, but I really don't get why the fadd etc instructions aren't converted to tail calls. Does LegalizeFloatTypes just fail to mark its libcalls as tail call candidates?

I also don't understand why we're not getting tail calls here. Well, the intrinsic calls could be explained by using call rather than tail call in the IR, but I really don't get why the fadd etc instructions aren't converted to tail calls. Does LegalizeFloatTypes just fail to mark its libcalls as tail call candidates?

I think the TargetLowering::makeLibCall used by LegalizeFloatTypes doesn't set the tail call bit.

luismarques accepted this revision.Nov 11 2021, 3:54 AM

LGTM.

I don't know why there aren't just RVxxI versions in the {float,double}-intrinsics.ll files; this seems like unnecessary duplication of effort, is under-tested due to not having any RV32I tests and rv64i-double-softfloat.ll is comparatively minimal.

@craig.topper Is this something you'd be interested in addressing in a revised version of this patch or in a follow-up patch?

This revision is now accepted and ready to land.Nov 11 2021, 3:54 AM

LGTM.

I don't know why there aren't just RVxxI versions in the {float,double}-intrinsics.ll files; this seems like unnecessary duplication of effort, is under-tested due to not having any RV32I tests and rv64i-double-softfloat.ll is comparatively minimal.

@craig.topper Is this something you'd be interested in addressing in a revised version of this patch or in a follow-up patch?

I'll work on it in a follow-up.