This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Form GORCI from (or (rotl/rotr X, Bitwidth/2), X).
ClosedPublic

Authored by craig.topper on Nov 29 2020, 1:49 PM.

Details

Summary

A rotate by half the bitwidth swaps the bottom and top half which is the same as one of the MSB GREVI stage.

We have to do this as a special combine because we prefer to keep (rotl/rotr X, BitWidth/2) as a rotate rather than a single stage GREVI.

Diff Detail

Unit TestsFailed

Event Timeline

craig.topper created this revision.Nov 29 2020, 1:49 PM
Herald added a project: Restricted Project. · View Herald TranscriptNov 29 2020, 1:49 PM
craig.topper requested review of this revision.Nov 29 2020, 1:49 PM

It might be worth mentioning somewhere (the commit message?) why this isn't done by matching (rotl/rotr X, Bitwidth/2) as GREVI and then matching GORCI through that. Presumably we'd like to match GREVI of rotl/rotr too, for instance?

craig.topper edited the summary of this revision. (Show Details)

Rebase

This revision is now accepted and ready to land.Dec 7 2020, 8:49 AM