This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Use default promotion for (i32 (shl 1, X)) on RV64 when Zbs is enabled.
ClosedPublic

Authored by craig.topper on Apr 20 2022, 8:54 AM.

Details

Summary

This improves opportunities to use bset/bclr/binv. Unfortunately,
there are no W versions of these instrcutions so this isn't always
a clear win. If we use SLLW we get free sign extend and shift masking,
but need to put a 1 in a register and can't remove an or/xor. If
we use bset/bclr/binv we remove the immediate materializationg and
logic op, but might need a mask on the shift amount and sext.w.

Diff Detail

Event Timeline

craig.topper created this revision.Apr 20 2022, 8:54 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 20 2022, 8:54 AM
craig.topper requested review of this revision.Apr 20 2022, 8:54 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 20 2022, 8:54 AM
This revision is now accepted and ready to land.Apr 20 2022, 9:09 AM
Miss_Grape added inline comments.
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
6827

clang-format

Miss_Grape added inline comments.Apr 20 2022, 8:04 PM
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
6827

sorry,I didn't look carefully

This revision was landed with ongoing or failed builds.Apr 28 2022, 9:59 AM
This revision was automatically updated to reflect the committed changes.