File tree Expand file tree Collapse file tree 1 file changed +2
-4
lines changed
llvm/lib/Transforms/Vectorize Expand file tree Collapse file tree 1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -2516,8 +2516,7 @@ bool VectorCombine::shrinkType(llvm::Instruction &I) {
2516
2516
// Check that the expression overall uses at most the same number of bits as
2517
2517
// ZExted
2518
2518
KnownBits KB = computeKnownBits (&I, *DL);
2519
- unsigned IBW = KB.getBitWidth () - KB.Zero .countLeadingOnes ();
2520
- if (IBW > BW)
2519
+ if (KB.countMaxActiveBits () > BW)
2521
2520
return false ;
2522
2521
2523
2522
// Calculate costs of leaving current IR as it is and moving ZExt operation
@@ -2546,8 +2545,7 @@ bool VectorCombine::shrinkType(llvm::Instruction &I) {
2546
2545
2547
2546
// Check if we can propagate ZExt through its other users
2548
2547
KB = computeKnownBits (UI, *DL);
2549
- unsigned UBW = KB.getBitWidth () - KB.countMinLeadingZeros ();
2550
- if (UBW > BW)
2548
+ if (KB.countMaxActiveBits () > BW)
2551
2549
return false ;
2552
2550
2553
2551
CurrentCost += TTI.getArithmeticInstrCost (UI->getOpcode (), BigTy, CostKind);
You can’t perform that action at this time.
0 commit comments