[all-commits] [llvm/llvm-project] aab903: [Attributes] Add a method to check if an Attribute...

topperc via All-commits all-commits at lists.llvm.org
Fri Aug 28 13:25:13 PDT 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: aab90384a3a7a475bc1a969405d112c886ce8077
      https://github.com/llvm/llvm-project/commit/aab90384a3a7a475bc1a969405d112c886ce8077
  Author: Craig Topper <craig.topper at intel.com>
  Date:   2020-08-28 (Fri, 28 Aug 2020)

  Changed paths:
    M llvm/include/llvm/IR/Attributes.h
    M llvm/lib/CodeGen/XRayInstrumentation.cpp
    M llvm/lib/IR/AttributeImpl.h
    M llvm/lib/IR/Attributes.cpp
    M llvm/lib/Target/AArch64/AArch64TargetMachine.cpp
    M llvm/lib/Target/AMDGPU/AMDGPUTargetMachine.cpp
    M llvm/lib/Target/ARM/ARMTargetMachine.cpp
    M llvm/lib/Target/Hexagon/HexagonTargetMachine.cpp
    M llvm/lib/Target/Mips/MipsTargetMachine.cpp
    M llvm/lib/Target/PowerPC/PPCTargetMachine.cpp
    M llvm/lib/Target/RISCV/RISCVTargetMachine.cpp
    M llvm/lib/Target/Sparc/SparcTargetMachine.cpp
    M llvm/lib/Target/SystemZ/SystemZTargetMachine.cpp
    M llvm/lib/Target/WebAssembly/WebAssemblyTargetMachine.cpp
    M llvm/lib/Target/X86/X86TargetMachine.cpp
    M llvm/lib/Transforms/IPO/LowerTypeTests.cpp
    M llvm/lib/Transforms/IPO/WholeProgramDevirt.cpp

  Log Message:
  -----------
  [Attributes] Add a method to check if an Attribute has AttrKind None. Use instead of hasAttribute(Attribute::None)

There's a special case in hasAttribute for None when pImpl is null. If pImpl is not null we dispatch to pImpl->hasAttribute which will always return false for Attribute::None.

So if we just want to check for None its sufficient to just check that pImpl is null. Which can even be done inline.

This patch adds a helper for that case which I hope will speed up our getSubtargetImpl implementations.

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




More information about the All-commits mailing list