This is an archive of the discontinued LLVM Phabricator instance.

[DAG][ARM][MIPS][RISCV] Improve funnel shift promotion to use 'double shift' patterns
ClosedPublic

Authored by RKSimon on Oct 9 2020, 9:05 AM.

Details

Summary

Based on a discussion on D88783, if we're promoting a funnel shift to a width at least twice the size as the original type, then we can use the 'double shift' patterns (shifting the concatenated sources).

This is proving to be useful for RISCV64 which performs i32 ops as promoted i64 ops.

Diff Detail

Event Timeline

RKSimon created this revision.Oct 9 2020, 9:05 AM
Herald added a project: Restricted Project. · View Herald TranscriptOct 9 2020, 9:05 AM
RKSimon requested review of this revision.Oct 9 2020, 9:05 AM
craig.topper added inline comments.
llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
1154

Can we use DAG.getZeroExtendInReg here with the old VT?

RKSimon updated this revision to Diff 297428.Oct 10 2020, 11:38 AM
RKSimon retitled this revision from [DAG][RISCV] Improve funnel shift promotion to use 'double shift' patterns to [DAG][ARM][MIPS][RISCV] Improve funnel shift promotion to use 'double shift' patterns.
RKSimon added reviewers: efriedma, atanasyan.

Use getZeroExtendInReg and refresh with ARM/MIPS changes

foad accepted this revision.Oct 12 2020, 1:56 AM

Looks good to me if the target maintainers are happy.

llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
1131–1132

Move this comment to line 1162.

This revision is now accepted and ready to land.Oct 12 2020, 1:56 AM
lenary accepted this revision.Oct 12 2020, 1:58 AM

RISC-V Changes LGTM

atanasyan accepted this revision.Oct 12 2020, 2:02 AM

MIPS changes LGTM

This revision was landed with ongoing or failed builds.Oct 12 2020, 6:20 AM
This revision was automatically updated to reflect the committed changes.