[llvm] [RISCV] Add TSFlag for reading past VL behaviour. NFCI (PR #149704)

Luke Lau via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 23 01:58:27 PDT 2025


================
@@ -1315,7 +1287,8 @@ RISCVVLOptimizer::getMinimumVLForUser(const MachineOperand &UserOp) const {
     return std::nullopt;
   }
 
-  if (mayReadPastVL(UserMI)) {
+  if (RISCVII::readsPastVL(
----------------
lukel97 wrote:

After looking at this a bit I think it's a bit hairy trying to add it in RISCVInstrPredicates.td, since we would be relying on regexes to match the vendor prefixes for these pseudos.

I then did some profiling to see how much time is spent actually doing these pseudo table lookups. I compiled TSVC since it was "vector-heavy", with -march=rva23u64 -O3 on a release build of clang. Out of the 2.4 seconds it took to run, less than 1ms was spent in getRVVMCOpcode. So maybe we don't actually really need to worry about the performance.

https://github.com/llvm/llvm-project/pull/149704


More information about the llvm-commits mailing list