This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Optimize (sext.w, srli) to sraiw with Zba.
ClosedPublic

Authored by Chenbing.Zheng on Feb 24 2022, 3:15 AM.

Details

Summary

In this patch, we add a more narrower exclusion for
zeroext (srl x) -> srli (slli x), so that it provides an opportunity for the selection of sraiw.

Diff Detail

Event Timeline

Chenbing.Zheng created this revision.Feb 24 2022, 3:15 AM
Chenbing.Zheng requested review of this revision.Feb 24 2022, 3:15 AM
craig.topper added inline comments.Feb 24 2022, 9:03 AM
llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
776

Don't you also need to check that C3 is 32?

Address comments

Chenbing.Zheng marked an inline comment as done.Feb 24 2022, 7:23 PM
Chenbing.Zheng added inline comments.
llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
776

Thanks, I think so.

Chenbing.Zheng marked an inline comment as done.Feb 24 2022, 7:34 PM
Chenbing.Zheng added inline comments.
llvm/lib/Target/RISCV/RISCVISelDAGToDAG.cpp
776

Thanks, I think so.

I mean I agree with you

This revision is now accepted and ready to land.Feb 26 2022, 10:59 PM
This revision was landed with ongoing or failed builds.Feb 27 2022, 6:35 PM
This revision was automatically updated to reflect the committed changes.