This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Supplement SH*ADDUW instructions pattern
AbandonedPublic

Authored by Jimerlife on Jan 6 2022, 1:05 AM.

Diff Detail

Event Timeline

Jimerlife created this revision.Jan 6 2022, 1:05 AM
Jimerlife requested review of this revision.Jan 6 2022, 1:05 AM
jacquesguan added inline comments.
llvm/lib/Target/RISCV/RISCVInstrInfoZb.td
1039

Does the InstCombine canonicalize mul X, 2 to shl X, 1?

It would be better to sperate the test and your optimization to two patches. First create the test patch, then the optimization patch, and select the first one as the second one's parent. So we can see obvious changes by you.

craig.topper added inline comments.Jan 6 2022, 9:02 AM
llvm/lib/Target/RISCV/RISCVInstrInfoZb.td
1039

InstCombine and DAGCombine both canonicalize mul by power 2 to shifts.

llvm/test/CodeGen/RISCV/rv64zba.ll
210

These tests cases pass without your change

Jimerlife abandoned this revision.Jan 7 2022, 12:16 AM