This is an archive of the discontinued LLVM Phabricator instance.

[MIPS] Fix lowering of irregular vector arguments
ClosedPublic

Authored by LemonBoy on Mar 8 2021, 8:52 AM.

Details

Summary

The code deciding how to split the vector in register-sized integers used the integer division operator, thus rounding down the result.
Correct the computation for irregularly-sized types (non-power-of-two, non multiple of 8) by rounding the division result upwards.

Diff Detail

Event Timeline

LemonBoy created this revision.Mar 8 2021, 8:52 AM
LemonBoy requested review of this revision.Mar 8 2021, 8:52 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 8 2021, 8:52 AM
LemonBoy updated this revision to Diff 329045.Mar 8 2021, 9:12 AM

Apply clang-format

LemonBoy updated this revision to Diff 329055.Mar 8 2021, 9:57 AM

Apply the TRUNCATE + BITCAST strategy everywhere, at least on MIPS the generated code is noticeably better.

I have not checked the patch carefully yet. But it looks like some tests was removed. For example MIPS64R5EL-LABEL: i8_2... Is it intended?

I have not checked the patch carefully yet. But it looks like some tests was removed. For example MIPS64R5EL-LABEL: i8_2... Is it intended?

That's update_llc_test_checks.py collapsing tests showing the same output, eg. MIPS64R5 and MIPS64R5EL.

I see. Thanks. One more question - is it possible to split the patch: one for "fixing a couple of rounding issues" and another for "Introducing a few more conversion rules"?

Sure. I'll have the first one introduce the SelectionDAG rules and the second one introduce the fixes for the MIPS codegen together with the various tests.

LemonBoy updated this revision to Diff 329398.Mar 9 2021, 10:58 AM

Split this patch, the SelectionDAG part is in D98273

LemonBoy retitled this revision from [MIPS] Fix lowering of vectors of non-power-of-two elements to [MIPS] Fix lowering of irregular vector arguments.Mar 9 2021, 11:03 AM
LemonBoy edited the summary of this revision. (Show Details)
LemonBoy removed a reviewer: craig.topper.
This revision is now accepted and ready to land.Mar 10 2021, 2:37 AM
This revision was landed with ongoing or failed builds.Mar 11 2021, 10:56 AM
This revision was automatically updated to reflect the committed changes.