[PATCH] D107290: [PoC][RISCV] Add support for the vscale_range attribute

Fraser Cormack via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jan 21 08:50:32 PST 2022

frasercrmck added inline comments.
Herald added subscribers: eopXD, VincentWu, luke957, achieveartificialintelligence.

Comment at: llvm/lib/Target/RISCV/RISCVTargetMachine.cpp:101
+  } else {
+    RVVBitsMin = RVVVectorBitsMinOpt;
+    RVVBitsMax = RVVVectorBitsMaxOpt;
frasercrmck wrote:
> craig.topper wrote:
> > If clang always emits the attribute, are these options effectively dead for clang codegen?
> Yes, that's a good point - I'd missed that. I'm not sure the best way of keeping that ability apart from moving the options up to clang and dealing with the fallout from that. Which I'm not even sure we //can// deal with yet?
> Unless we make the options override the attribute, though that might be its own can of worms.
Well we now have `zvl` which kinda solve the "min" problem at the frontend level.

Thinking about it again, though, maybe it's not such a bad thing to have clang emit min=<zvl>, max=2^16/RVVBitsPerBlock and then allow backend codegen flags to override that. Then the onus is clearly on the user not to do anything wrong. We could assert if the user-provided values are clearly at odds with the attribute?

  rG LLVM Github Monorepo



More information about the cfe-commits mailing list