Skip to content

Commit ca2a4b7

Browse files
committed
Capitalisation of magics variable
1 parent 5d19601 commit ca2a4b7

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5642,29 +5642,29 @@ MachineInstr *CombinerHelper::buildSDivUsingMul(MachineInstr &MI) const {
56425642
auto *CI = cast<ConstantInt>(C);
56435643
const APInt &Divisor = CI->getValue();
56445644

5645-
SignedDivisionByConstantInfo magics =
5645+
SignedDivisionByConstantInfo Magics =
56465646
SignedDivisionByConstantInfo::get(Divisor);
56475647
int NumeratorFactor = 0;
56485648
int ShiftMask = -1;
56495649

56505650
if (Divisor.isOne() || Divisor.isAllOnes()) {
56515651
// If d is +1/-1, we just multiply the numerator by +1/-1.
56525652
NumeratorFactor = Divisor.getSExtValue();
5653-
magics.Magic = 0;
5654-
magics.ShiftAmount = 0;
5653+
Magics.Magic = 0;
5654+
Magics.ShiftAmount = 0;
56555655
ShiftMask = 0;
5656-
} else if (Divisor.isStrictlyPositive() && magics.Magic.isNegative()) {
5656+
} else if (Divisor.isStrictlyPositive() && Magics.Magic.isNegative()) {
56575657
// If d > 0 and m < 0, add the numerator.
56585658
NumeratorFactor = 1;
5659-
} else if (Divisor.isNegative() && magics.Magic.isStrictlyPositive()) {
5659+
} else if (Divisor.isNegative() && Magics.Magic.isStrictlyPositive()) {
56605660
// If d < 0 and m > 0, subtract the numerator.
56615661
NumeratorFactor = -1;
56625662
}
56635663

5664-
MagicFactors.push_back(MIB.buildConstant(ScalarTy, magics.Magic).getReg(0));
5664+
MagicFactors.push_back(MIB.buildConstant(ScalarTy, Magics.Magic).getReg(0));
56655665
Factors.push_back(MIB.buildConstant(ScalarTy, NumeratorFactor).getReg(0));
56665666
Shifts.push_back(
5667-
MIB.buildConstant(ScalarShiftAmtTy, magics.ShiftAmount).getReg(0));
5667+
MIB.buildConstant(ScalarShiftAmtTy, Magics.ShiftAmount).getReg(0));
56685668
ShiftMasks.push_back(MIB.buildConstant(ScalarTy, ShiftMask).getReg(0));
56695669

56705670
return true;

llvm/test/CodeGen/AArch64/combine-sdiv.ll

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
; RUN: llc < %s -mtriple=aarch64-unknown-unknown -global-isel=0 | FileCheck %s --check-prefixes=CHECK,CHECK-SD
33
; RUN: llc < %s -mtriple=aarch64-unknown-unknown -global-isel=1 | FileCheck %s --check-prefixes=CHECK,CHECK-GI
44

5-
; These tests are taken from the combine-udiv.ll in X86.
5+
; These tests are taken from the combine-sdiv.ll in X86.
66
define i32 @combine_sdiv_by_one(i32 %x) {
77
; CHECK-LABEL: combine_sdiv_by_one:
88
; CHECK: // %bb.0:

0 commit comments

Comments
 (0)