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

via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 9 09:39:45 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)
----------------
vporpo wrote:

Done.

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


More information about the llvm-commits mailing list