[all-commits] [llvm/llvm-project] 735f46: [APInt] Normalize naming on keep constructors / pr...

Chris Lattner via All-commits all-commits at lists.llvm.org
Thu Sep 9 09:50:40 PDT 2021


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 735f46715d90fd0ff48dd44d1007302640ab4d11
      https://github.com/llvm/llvm-project/commit/735f46715d90fd0ff48dd44d1007302640ab4d11
  Author: Chris Lattner <clattner at nondot.org>
  Date:   2021-09-09 (Thu, 09 Sep 2021)

  Changed paths:
    M clang/lib/AST/ExprConstant.cpp
    M clang/lib/CodeGen/CGExpr.cpp
    M clang/lib/Sema/SemaExprCXX.cpp
    M clang/lib/Sema/SemaOpenMP.cpp
    M clang/lib/StaticAnalyzer/Core/MemRegion.cpp
    M lldb/source/Plugins/Instruction/MIPS/EmulateInstructionMIPS.cpp
    M lldb/source/Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.cpp
    M lldb/source/Utility/Scalar.cpp
    M llvm/include/llvm/ADT/APInt.h
    M llvm/include/llvm/ADT/APSInt.h
    M llvm/include/llvm/CodeGen/BasicTTIImpl.h
    M llvm/include/llvm/CodeGen/GlobalISel/LegalizationArtifactCombiner.h
    M llvm/include/llvm/CodeGen/SelectionDAG.h
    M llvm/include/llvm/IR/Constants.h
    M llvm/include/llvm/IR/PatternMatch.h
    M llvm/include/llvm/Support/KnownBits.h
    M llvm/include/llvm/Transforms/InstCombine/InstCombiner.h
    M llvm/lib/Analysis/DemandedBits.cpp
    M llvm/lib/Analysis/DependenceAnalysis.cpp
    M llvm/lib/Analysis/InlineCost.cpp
    M llvm/lib/Analysis/InstructionSimplify.cpp
    M llvm/lib/Analysis/LazyValueInfo.cpp
    M llvm/lib/Analysis/MemoryBuiltins.cpp
    M llvm/lib/Analysis/StackSafetyAnalysis.cpp
    M llvm/lib/Analysis/ValueTracking.cpp
    M llvm/lib/Analysis/VectorUtils.cpp
    M llvm/lib/CodeGen/GlobalISel/CombinerHelper.cpp
    M llvm/lib/CodeGen/GlobalISel/GISelKnownBits.cpp
    M llvm/lib/CodeGen/GlobalISel/LegalizerHelper.cpp
    M llvm/lib/CodeGen/InterleavedLoadCombinePass.cpp
    M llvm/lib/CodeGen/SelectionDAG/DAGCombiner.cpp
    M llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
    M llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
    M llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
    M llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
    M llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
    M llvm/lib/CodeGen/SelectionDAG/TargetLowering.cpp
    M llvm/lib/CodeGen/SwitchLoweringUtils.cpp
    M llvm/lib/CodeGen/TargetLoweringObjectFileImpl.cpp
    M llvm/lib/CodeGen/TypePromotion.cpp
    M llvm/lib/IR/ConstantFold.cpp
    M llvm/lib/IR/ConstantRange.cpp
    M llvm/lib/IR/Constants.cpp
    M llvm/lib/IR/Instructions.cpp
    M llvm/lib/IR/Type.cpp
    M llvm/lib/MCA/InstrBuilder.cpp
    M llvm/lib/Support/APFixedPoint.cpp
    M llvm/lib/Support/APFloat.cpp
    M llvm/lib/Support/APInt.cpp
    M llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
    M llvm/lib/Target/AMDGPU/AMDGPUISelDAGToDAG.cpp
    M llvm/lib/Target/ARM/ARMISelLowering.cpp
    M llvm/lib/Target/Lanai/LanaiISelLowering.cpp
    M llvm/lib/Target/M68k/M68kISelLowering.cpp
    M llvm/lib/Target/PowerPC/PPCISelLowering.cpp
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    M llvm/lib/Target/X86/X86InstCombineIntrinsic.cpp
    M llvm/lib/Target/X86/X86TargetTransformInfo.cpp
    M llvm/lib/Transforms/AggressiveInstCombine/AggressiveInstCombine.cpp
    M llvm/lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
    M llvm/lib/Transforms/InstCombine/InstCombineCalls.cpp
    M llvm/lib/Transforms/InstCombine/InstCombineCompares.cpp
    M llvm/lib/Transforms/InstCombine/InstCombineSelect.cpp
    M llvm/lib/Transforms/InstCombine/InstCombineShifts.cpp
    M llvm/lib/Transforms/InstCombine/InstCombineSimplifyDemanded.cpp
    M llvm/lib/Transforms/InstCombine/InstCombineVectorOps.cpp
    M llvm/lib/Transforms/InstCombine/InstructionCombining.cpp
    M llvm/lib/Transforms/Scalar/CorrelatedValuePropagation.cpp
    M llvm/lib/Transforms/Scalar/Float2Int.cpp
    M llvm/lib/Transforms/Scalar/Reassociate.cpp
    M llvm/lib/Transforms/Utils/Local.cpp
    M llvm/lib/Transforms/Utils/ScalarEvolutionExpander.cpp
    M llvm/lib/Transforms/Vectorize/LoopVectorize.cpp
    M llvm/lib/Transforms/Vectorize/SLPVectorizer.cpp
    M llvm/tools/llvm-stress/llvm-stress.cpp
    M llvm/unittests/ADT/APIntTest.cpp
    M llvm/unittests/CodeGen/GlobalISel/KnownBitsTest.cpp
    M llvm/unittests/CodeGen/GlobalISel/KnownBitsVectorTest.cpp
    M llvm/unittests/IR/ConstantRangeTest.cpp
    M llvm/unittests/IR/PatternMatch.cpp
    M llvm/unittests/Support/KnownBitsTest.cpp
    M mlir/lib/Conversion/TosaToLinalg/TosaToLinalg.cpp
    M mlir/lib/Dialect/StandardOps/IR/Ops.cpp
    M mlir/lib/IR/BuiltinAttributes.cpp

  Log Message:
  -----------
  [APInt] Normalize naming on keep constructors / predicate methods.

This renames the primary methods for creating a zero value to `getZero`
instead of `getNullValue` and renames predicates like `isAllOnesValue`
to simply `isAllOnes`.  This achieves two things:

1) This starts standardizing predicates across the LLVM codebase,
   following (in this case) ConstantInt.  The word "Value" doesn't
   convey anything of merit, and is missing in some of the other things.

2) Calling an integer "null" doesn't make any sense.  The original sin
   here is mine and I've regretted it for years.  This moves us to calling
   it "zero" instead, which is correct!

APInt is widely used and I don't think anyone is keen to take massive source
breakage on anything so core, at least not all in one go.  As such, this
doesn't actually delete any entrypoints, it "soft deprecates" them with a
comment.

Included in this patch are changes to a bunch of the codebase, but there are
more.  We should normalize SelectionDAG and other APIs as well, which would
make the API change more mechanical.

Differential Revision: https://reviews.llvm.org/D109483




More information about the All-commits mailing list