Skip to content

Commit 27934bf

Browse files
committed
[GlobalIsel] Do not run getKnownBits if it is an exact udiv (NFC)
This should be better for compile times.
1 parent 5c9fc3c commit 27934bf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5180,7 +5180,9 @@ MachineInstr *CombinerHelper::buildUDivUsingMul(MachineInstr &MI) {
51805180
LLT ScalarShiftAmtTy = ShiftAmtTy.getScalarType();
51815181

51825182
unsigned KnownLeadingZeros =
5183-
KB ? KB->getKnownBits(LHS).countMinLeadingZeros() : 0;
5183+
(!MI.getFlag(MachineInstr::MIFlag::IsExact) && KB)
5184+
? KB->getKnownBits(LHS).countMinLeadingZeros()
5185+
: 0;
51845186
auto &MIB = Builder;
51855187

51865188
bool UseSRL = false;

0 commit comments

Comments
 (0)