]> granicus.if.org Git - llvm/commit
[GlobalISel] Make the InstructionSelector instance non-const, allowing state to be...
authorAmara Emerson <aemerson@apple.com>
Tue, 13 Aug 2019 06:26:59 +0000 (06:26 +0000)
committerAmara Emerson <aemerson@apple.com>
Tue, 13 Aug 2019 06:26:59 +0000 (06:26 +0000)
commit7c19e0123aabc5ce10aa50048bcbae00c0b558cd
treede21916a23620bbc219878e2eedaf5530b29ad19
parent9888e170c06c35465552d690e852b2b677d7849a
[GlobalISel] Make the InstructionSelector instance non-const, allowing state to be maintained.

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.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@368652 91177308-0d34-0410-b5e6-96231b3b80d8
18 files changed:
include/llvm/CodeGen/GlobalISel/InstructionSelector.h
include/llvm/CodeGen/TargetSubtargetInfo.h
lib/CodeGen/GlobalISel/InstructionSelect.cpp
lib/Target/AArch64/AArch64InstructionSelector.cpp
lib/Target/AArch64/AArch64Subtarget.cpp
lib/Target/AArch64/AArch64Subtarget.h
lib/Target/AMDGPU/AMDGPUInstructionSelector.cpp
lib/Target/AMDGPU/AMDGPUInstructionSelector.h
lib/Target/AMDGPU/AMDGPUSubtarget.h
lib/Target/ARM/ARMInstructionSelector.cpp
lib/Target/ARM/ARMSubtarget.cpp
lib/Target/ARM/ARMSubtarget.h
lib/Target/Mips/MipsInstructionSelector.cpp
lib/Target/Mips/MipsSubtarget.cpp
lib/Target/Mips/MipsSubtarget.h
lib/Target/X86/X86InstructionSelector.cpp
lib/Target/X86/X86Subtarget.cpp
lib/Target/X86/X86Subtarget.h