This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Move -riscv-v-vector-bits-max/min options to RISCVTargetMachine.
ClosedPublic

Authored by craig.topper on Dec 19 2022, 12:08 AM.

Diff Detail

Event Timeline

craig.topper created this revision.Dec 19 2022, 12:08 AM
craig.topper requested review of this revision.Dec 19 2022, 12:08 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 19 2022, 12:08 AM
This revision is now accepted and ready to land.Dec 19 2022, 12:14 AM
eopXD added inline comments.Dec 19 2022, 12:15 AM
llvm/lib/Target/RISCV/RISCVSubtarget.cpp
132

Maybe add comment that 0 is default value when -riscv-v-vector-bits-max is not set.

To be very paranoid, do we need check if user is specifying max to -2, which the option's datatype does allow?

llvm/lib/Target/RISCV/RISCVTargetMachine.cpp
159

Maybe leverage Twine here?

reames accepted this revision.Dec 19 2022, 8:17 AM

LGTM

craig.topper added inline comments.Dec 20 2022, 12:06 PM
llvm/lib/Target/RISCV/RISCVSubtarget.cpp
132

We should detect -2 as being out of bounds in RISCVTargetMachine.cpp

llvm/lib/Target/RISCV/RISCVTargetMachine.cpp
159

I don't think Twine is useful here. SmallString doesn't have any methods that take a Twine. So we'd have to convert the Twine to a std::string.