[PATCH] D65984: [GlobalISel] Make the InstructionSelector instance non-const, allowing state to be maintained.

Amara Emerson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 8 16:27:57 PDT 2019


aemerson created this revision.
aemerson added reviewers: paquette, qcolombet, dsanders, arsenm, bogner.
Herald added subscribers: Petar.Avramovic, volkan, jfb, atanasyan, jrtc27, hiraditya, kristof.beyls, javed.absar, rovka, nhaehnle, wdng, jvesely, sdardis.
Herald added a project: LLVM.

Currently we can't keep any state in the selector object that we get from subtarget. As a result we have to plumb through all our variables through multiple functions. This change makes it non-const and adds a virtual init() method to allow further state to be captured for each target.

AArch64 makes use of this in this patch to cache a call to hasFnAttribute() which is expensive to call, and is used on each selection of G_BRCOND.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D65984

Files:
  llvm/include/llvm/CodeGen/GlobalISel/InstructionSelector.h
  llvm/include/llvm/CodeGen/TargetSubtargetInfo.h
  llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp
  llvm/lib/Target/AArch64/AArch64InstructionSelector.cpp
  llvm/lib/Target/AArch64/AArch64Subtarget.cpp
  llvm/lib/Target/AArch64/AArch64Subtarget.h
  llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
  llvm/lib/Target/AMDGPU/AMDGPUInstructionSelector.h
  llvm/lib/Target/AMDGPU/AMDGPUSubtarget.h
  llvm/lib/Target/ARM/ARMInstructionSelector.cpp
  llvm/lib/Target/ARM/ARMSubtarget.cpp
  llvm/lib/Target/ARM/ARMSubtarget.h
  llvm/lib/Target/Mips/MipsInstructionSelector.cpp
  llvm/lib/Target/Mips/MipsSubtarget.cpp
  llvm/lib/Target/Mips/MipsSubtarget.h
  llvm/lib/Target/X86/X86InstructionSelector.cpp
  llvm/lib/Target/X86/X86Subtarget.cpp
  llvm/lib/Target/X86/X86Subtarget.h

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D65984.214258.patch
Type: text/x-patch
Size: 20970 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190808/566d113e/attachment.bin>


More information about the llvm-commits mailing list