Skip to content

Commit 32769c7

Browse files
committed
!fixup avoid overflow
1 parent 86c5a81 commit 32769c7

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3263,9 +3263,9 @@ Instruction *InstCombinerImpl::visitCallInst(CallInst &CI) {
32633263
if (!UO || isa<Argument>(UO))
32643264
continue;
32653265

3266-
auto Known = computeKnownBits(RK.WasOn, 0, nullptr);
3267-
unsigned KnownAlign = 1 << Known.countMinTrailingZeros();
3268-
if (KnownAlign < RK.ArgValue)
3266+
KnownBits Known = computeKnownBits(RK.WasOn, 0, nullptr);
3267+
unsigned TZ = std::min(Known.countMinTrailingZeros(), 63);
3268+
if ((1ULL << TZ) < RK.ArgValue)
32693269
continue;
32703270
auto *New = CallBase::removeOperandBundle(II, OBU.getTagID());
32713271
return New;

0 commit comments

Comments
 (0)