[PATCH] D128758: [RISCV] Refine known bits for READ_VLENB

Craig Topper via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jun 28 13:51:38 PDT 2022


craig.topper added inline comments.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:9395
+    const unsigned MaxVLenB = Subtarget.getRealMaxVLen() / 8;
+     if (MinVLenB > 0)
+       Known.Zero.setLowBits(Log2_32(MinVLenB));
----------------
Is every possible for this to be zero. I would think you'd need a READ_VLENB to be generated with all vector extensions disabled.


================
Comment at: llvm/lib/Target/RISCV/RISCVISelLowering.cpp:9399
+    if (MaxVLenB == MinVLenB)
+      Known = KnownBits::makeConstant(APInt(BitWidth, MinVLenB));
     break;
----------------
reames wrote:
> craig.topper wrote:
> > Just to make sure I understand, given the Known.Zero that was already done. This is equivalent to Known.One.setBit(Log2_32(MinVLenB))?
> Yep, would you prefer I write it that way?  
Yeah. Let's write it that way.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D128758/new/

https://reviews.llvm.org/D128758



More information about the llvm-commits mailing list