[all-commits] [llvm/llvm-project] 25391c: [RISCV] Teach computeKnownBits that vsetvli return...

Craig Topper via All-commits all-commits at lists.llvm.org
Thu Apr 29 08:08:57 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 25391cec3a81c3c2c4ac3f2ce0efda961766ab07
      https://github.com/llvm/llvm-project/commit/25391cec3a81c3c2c4ac3f2ce0efda961766ab07
  Author: Craig Topper <craig.topper at sifive.com>
  Date:   2021-04-29 (Thu, 29 Apr 2021)

  Changed paths:
    M llvm/lib/Analysis/ValueTracking.cpp
    M llvm/lib/Target/RISCV/RISCVISelLowering.cpp
    A llvm/test/CodeGen/RISCV/rvv/vsetvl-ext.ll
    A llvm/test/Transforms/InstCombine/RISCV/lit.local.cfg
    A llvm/test/Transforms/InstCombine/RISCV/riscv-vsetvli-knownbits.ll

  Log Message:
  -----------
  [RISCV] Teach computeKnownBits that vsetvli returns number less than 2^31.

This seems like a reasonable upper bound on VL. WG discussions for
the V spec would probably allow us to use 2^16 as an upper bound
on VLEN, but this is good enough for now.

This allows us to remove sext and zext if user happens to assign
the size_t result into an int and then uses it as a VL intrinsic
argument which is size_t.

Reviewed By: frasercrmck, rogfer01, arcbbb

Differential Revision: https://reviews.llvm.org/D101472




More information about the All-commits mailing list