This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Add isCommutable to ADD/ADDW/MUL/AND/OR/XOR/MIN/MAX/CLMUL
ClosedPublic

Authored by craig.topper on Apr 18 2022, 5:41 PM.

Diff Detail

Event Timeline

craig.topper created this revision.Apr 18 2022, 5:41 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 18 2022, 5:41 PM
craig.topper requested review of this revision.Apr 18 2022, 5:41 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 18 2022, 5:41 PM

Might be clearer as let isCommutable = 1/true in on each def? There aren't that many of them, so that keeps it self-documenting and avoids long argument lists.

Fix 80 column violations and add an inline comment to the new template argument.

Might be clearer as let isCommutable = 1/true in on each def? There aren't that many of them, so that keeps it self-documenting and avoids long argument lists.

I've added an inline comment. Not sure if that's more acceptable or not. This way it keeps every instruction having the same number of lines so it's more regular than adding in extra let lines. I could be persuaded to add the let isCommutable if others feel strongly.

Include the Zb instructions that also use ALU_rr

craig.topper retitled this revision from [RISCV] Add isCommutable to ADD/ADDW/MUL/AND/OR/XOR. to [RISCV] Add isCommutable to ADD/ADDW/MUL/AND/OR/XOR/MIN/MAX/CLMUL.Apr 19 2022, 1:57 PM

Add MachineCSE test for ADD and ADDW. I can exhaustively test the other instructions if anyone thinks that's important.

reames accepted this revision.Apr 25 2022, 9:34 AM
reames added a subscriber: reames.

LGTM

This revision is now accepted and ready to land.Apr 25 2022, 9:34 AM