[llvm] [SandboxVec][BottomUpVec] Use SeedCollector and slice seeds (PR #120826)

Jorge Gorbe Moya via llvm-commits llvm-commits at lists.llvm.org
Wed Jan 8 11:34:40 PST 2025


================
@@ -133,6 +133,16 @@ class VecUtils {
     assert(tryGetCommonScalarType(Bndl) && "Expected common scalar type!");
     return ScalarTy;
   }
+  /// \Returns the first integer power of 2 that is <= Num.
+  static unsigned getFloorPowerOf2(unsigned Num) {
+    if (Num == 0)
+      return Num;
+    unsigned Mask = Num;
+    Mask >>= 1;
+    for (int ShiftBy = 1; ShiftBy < 32; ShiftBy <<= 1)
----------------
slackito wrote:

Nit: Should 32 here depend on `sizeof(unsigned)` instead?

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


More information about the llvm-commits mailing list