This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Refactor getDefaultVLOps. NFC.
ClosedPublic

Authored by HanKuanChen on Nov 14 2022, 10:06 PM.

Details

Summary

Current getDefaultVLOps can only deduce VL from a MVT. However,
sometimes users have already known VL value. This commit will provide a
uniform interface to get VL instead of calling DAG.getConstant.

Diff Detail

Event Timeline

HanKuanChen created this revision.Nov 14 2022, 10:06 PM
HanKuanChen requested review of this revision.Nov 14 2022, 10:06 PM
craig.topper added inline comments.Nov 14 2022, 10:14 PM
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
1850

"Default" doesn't make sense anymore.

And it Ops shouldn't be plural if it returns a single value.

1854

This can be shorted to

return DAG.getConstant(NumElts, DL, Subtarget.getXLenVT());

Fix getDefaultVLOps name and implementation.

This revision is now accepted and ready to land.Nov 15 2022, 2:55 PM
This revision was landed with ongoing or failed builds.Nov 15 2022, 6:12 PM
This revision was automatically updated to reflect the committed changes.