This is an archive of the discontinued LLVM Phabricator instance.

R600/SI: Try to form (f64 [s|u]int_to_fp i1)
AbandonedPublic

Authored by arsenm on Jan 14 2015, 9:53 AM.

Details

Reviewers
rampitec
Group Reviewers
Restricted Project
Summary

This is un-optimized by the DAG combiner now to avoid
the from-i1 conversion. We get slightly better code
by doing this than materializing the weird constants
since there is no 64-bit select which end up getting split
up. The expanded pattern also shows up in fceil / ffloor
lowering.

This is worse depending on the rate of v_cvt_f64_i32. I'm
not sure the scheduling models is accurate for every subtarget;
llvm-mca is saying v_cvt_f64_i32 is quarter rate but I believe
it is supposed to be half rate (or at least it used to be on older
subtargets)

Diff Detail

Event Timeline

arsenm updated this revision to Diff 18163.Jan 14 2015, 9:53 AM
arsenm retitled this revision from to R600/SI: Try to form (f64 [s|u]int_to_fp i1) .
arsenm updated this object.
arsenm edited the test plan for this revision. (Show Details)
arsenm added a subscriber: Unknown Object (MLST).
arsenm updated this revision to Diff 474949.Nov 12 2022, 10:44 AM
arsenm retitled this revision from R600/SI: Try to form (f64 [s|u]int_to_fp i1) to R600/SI: Try to form (f64 [s|u]int_to_fp i1).
arsenm edited the summary of this revision. (Show Details)
arsenm added a reviewer: Restricted Project.

Rebase 7 years into the future.

This optimization doesn't make sense if v_cvt_f64_i32 is quarter rate, which it is on some subtargets at least. I'm not sure the scheduler model is 100% accurate
for every subtarget, and it seems to always say it's quarter rate

Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptNov 12 2022, 10:44 AM
rampitec accepted this revision.Nov 28 2022, 12:45 PM

Looks reasonable, but description mentions R600/SI while it affects other targets. I.e. it needs to be retitled.

This revision is now accepted and ready to land.Nov 28 2022, 12:45 PM

Looks reasonable, but description mentions R600/SI while it affects other targets. I.e. it needs to be retitled.

It's slower assuming quarter rate conversions, which is what the scheduler thinks is the case. I was thinking of just abandoning this

Looks reasonable, but description mentions R600/SI while it affects other targets. I.e. it needs to be retitled.

It's slower assuming quarter rate conversions, which is what the scheduler thinks is the case. I was thinking of just abandoning this

Actually GFX11SpeedModel suggests it is even slower...

arsenm abandoned this revision.Jan 12 2023, 4:41 AM

This is only conditionally faster and it might not actually be. I don't have time to look into this