summaryrefslogtreecommitdiff
path: root/compiler/optimizing/register_allocator.cc
diff options
context:
space:
mode:
author Eric Holk <eholk@google.com> 2020-02-12 09:10:21 -0800
committer Eric Holk <eholk@google.com> 2020-02-21 18:51:23 +0000
commit1868de9c954e057c30ff9a086a213c86a75d7fb6 (patch)
treecea533316ad0d1605a62620571426c28fbae147b /compiler/optimizing/register_allocator.cc
parent5b768893456ca3a998b7a2a93490229febbec1cf (diff)
Refactor inliner
This change rearranges some of the inliner code. The main goal is to make some of the larger functions more readable and make clearer how to modify the inliner in the future. Some of the specific changes include: * Code to find the actually call target has been factored into a separate method. * The call to TryInlineFromEarlyCache has been made into an early exit rather than a fall through case. This lowers the indentation level for the main inline case. * Split the initial checks for whether inlining is possible into IsInliningAllowed, IsInliningSupported, and IsInliningBudgetAvailable. This is to make it more clear why these restrictions are in place. Note that some of these checks are now in a different order. * Factor the checks that come after the inlined body has been optimized into a separate method. These haven't been further broken down yet, but this would be worthwhile future work. * Remove CanAllocateRegistersFor. We should be able to allocate registers for any compiler we support, and if not, this should be caught when we try to allocate registers instead. Bug: 149392334 Test: ./test/testrunner/testrunner.py --host --optimizing --no-jvmti --ndebug \ --64 Change-Id: Ic1b919e306b7b93944ee5686e2a487b2190c087c
Diffstat (limited to 'compiler/optimizing/register_allocator.cc')
-rw-r--r--compiler/optimizing/register_allocator.cc9
1 files changed, 0 insertions, 9 deletions
diff --git a/compiler/optimizing/register_allocator.cc b/compiler/optimizing/register_allocator.cc
index 793df98210..a9c217fc4f 100644
--- a/compiler/optimizing/register_allocator.cc
+++ b/compiler/optimizing/register_allocator.cc
@@ -68,15 +68,6 @@ RegisterAllocator::~RegisterAllocator() {
}
}
-bool RegisterAllocator::CanAllocateRegistersFor(const HGraph& graph ATTRIBUTE_UNUSED,
- InstructionSet instruction_set) {
- return instruction_set == InstructionSet::kArm
- || instruction_set == InstructionSet::kArm64
- || instruction_set == InstructionSet::kThumb2
- || instruction_set == InstructionSet::kX86
- || instruction_set == InstructionSet::kX86_64;
-}
-
class AllRangesIterator : public ValueObject {
public:
explicit AllRangesIterator(LiveInterval* interval)