From a55ff6aaddc74bce049ebb293f11c683e5f25776 Mon Sep 17 00:00:00 2001 From: Craig Topper Date: Sun, 17 Jul 2022 22:56:57 -0700 Subject: [PATCH] [Support][CodeGen] Fix spelling Divison->Division. NFC --- llvm/include/llvm/Support/DivisionByConstantInfo.h | 8 ++++---- llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp | 6 +++--- llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp | 6 ++++-- llvm/lib/Support/DivisionByConstantInfo.cpp | 8 ++++---- 4 files changed, 15 insertions(+), 13 deletions(-) diff --git a/llvm/include/llvm/Support/DivisionByConstantInfo.h b/llvm/include/llvm/Support/DivisionByConstantInfo.h index 896bc679885e..7d01613ce1c6 100644 --- a/llvm/include/llvm/Support/DivisionByConstantInfo.h +++ b/llvm/include/llvm/Support/DivisionByConstantInfo.h @@ -1,4 +1,4 @@ -//== llvm/Support/DivisonByConstantInfo.h - division by constant -*- C++ -*-==// +//===- llvm/Support/DivisionByConstantInfo.h ---------------------*- C++ -*-==// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -25,9 +25,9 @@ struct SignedDivisionByConstantInfo { }; /// Magic data for optimising unsigned division by a constant. -struct UnsignedDivisonByConstantInfo { - static UnsignedDivisonByConstantInfo get(const APInt &D, - unsigned LeadingZeros = 0); +struct UnsignedDivisionByConstantInfo { + static UnsignedDivisionByConstantInfo get(const APInt &D, + unsigned LeadingZeros = 0); APInt Magic; ///< magic number bool IsAdd; ///< add indicator unsigned ShiftAmount; ///< shift amount diff --git a/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp b/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp index e7166f9f6a1d..3a909dec5dcb 100644 --- a/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp +++ b/llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp @@ -4800,8 +4800,8 @@ MachineInstr *CombinerHelper::buildUDivUsingMul(MachineInstr &MI) { auto BuildUDIVPattern = [&](const Constant *C) { auto *CI = cast(C); const APInt &Divisor = CI->getValue(); - UnsignedDivisonByConstantInfo magics = - UnsignedDivisonByConstantInfo::get(Divisor); + UnsignedDivisionByConstantInfo magics = + UnsignedDivisionByConstantInfo::get(Divisor); unsigned PreShift = 0, PostShift = 0; // If the divisor is even, we can avoid using the expensive fixup by @@ -4810,7 +4810,7 @@ MachineInstr *CombinerHelper::buildUDivUsingMul(MachineInstr &MI) { PreShift = Divisor.countTrailingZeros(); // Get magic number for the shifted divisor. magics = - UnsignedDivisonByConstantInfo::get(Divisor.lshr(PreShift), PreShift); + UnsignedDivisionByConstantInfo::get(Divisor.lshr(PreShift), PreShift); assert(!magics.IsAdd && "Should use cheap fixup now"); } diff --git a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp index 131310af3150..50d0805f1693 100644 --- a/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp @@ -5905,7 +5905,8 @@ SDValue TargetLowering::BuildUDIV(SDNode *N, SelectionDAG &DAG, // FIXME: We should use a narrower constant when the upper // bits are known to be zero. const APInt& Divisor = C->getAPIntValue(); - UnsignedDivisonByConstantInfo magics = UnsignedDivisonByConstantInfo::get(Divisor); + UnsignedDivisionByConstantInfo magics = + UnsignedDivisionByConstantInfo::get(Divisor); unsigned PreShift = 0, PostShift = 0; // If the divisor is even, we can avoid using the expensive fixup by @@ -5913,7 +5914,8 @@ SDValue TargetLowering::BuildUDIV(SDNode *N, SelectionDAG &DAG, if (magics.IsAdd && !Divisor[0]) { PreShift = Divisor.countTrailingZeros(); // Get magic number for the shifted divisor. - magics = UnsignedDivisonByConstantInfo::get(Divisor.lshr(PreShift), PreShift); + magics = + UnsignedDivisionByConstantInfo::get(Divisor.lshr(PreShift), PreShift); assert(!magics.IsAdd && "Should use cheap fixup now"); } diff --git a/llvm/lib/Support/DivisionByConstantInfo.cpp b/llvm/lib/Support/DivisionByConstantInfo.cpp index 69f39386798c..35486674e02f 100644 --- a/llvm/lib/Support/DivisionByConstantInfo.cpp +++ b/llvm/lib/Support/DivisionByConstantInfo.cpp @@ -1,4 +1,4 @@ -//===----- DivisonByConstantInfo.cpp - division by constant -*- C++ -*-----===// +//===----- DivisionByConstantInfo.cpp - division by constant -*- C++ -*----===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. @@ -62,11 +62,11 @@ SignedDivisionByConstantInfo SignedDivisionByConstantInfo::get(const APInt &D) { /// S. Warren, Jr., chapter 10. /// LeadingZeros can be used to simplify the calculation if the upper bits /// of the divided value are known zero. -UnsignedDivisonByConstantInfo -UnsignedDivisonByConstantInfo::get(const APInt &D, unsigned LeadingZeros) { +UnsignedDivisionByConstantInfo +UnsignedDivisionByConstantInfo::get(const APInt &D, unsigned LeadingZeros) { unsigned P; APInt NC, Delta, Q1, R1, Q2, R2; - struct UnsignedDivisonByConstantInfo Retval; + struct UnsignedDivisionByConstantInfo Retval; Retval.IsAdd = false; // initialize "add" indicator APInt AllOnes = APInt::getAllOnes(D.getBitWidth()).lshr(LeadingZeros); APInt SignedMin = APInt::getSignedMinValue(D.getBitWidth());