summaryrefslogtreecommitdiff
path: root/compiler/optimizing
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/optimizing')
-rw-r--r--compiler/optimizing/block_builder.cc5
-rw-r--r--compiler/optimizing/block_builder.h2
-rw-r--r--compiler/optimizing/builder.cc13
-rw-r--r--compiler/optimizing/builder.h2
4 files changed, 4 insertions, 18 deletions
diff --git a/compiler/optimizing/block_builder.cc b/compiler/optimizing/block_builder.cc
index 9da2bfb8ef..12c260a146 100644
--- a/compiler/optimizing/block_builder.cc
+++ b/compiler/optimizing/block_builder.cc
@@ -38,8 +38,7 @@ HBasicBlockBuilder::HBasicBlockBuilder(HGraph* graph,
nullptr,
local_allocator->Adapter(kArenaAllocGraphBuilder)),
throwing_blocks_(kDefaultNumberOfThrowingBlocks,
- local_allocator->Adapter(kArenaAllocGraphBuilder)),
- number_of_branches_(0u) {}
+ local_allocator->Adapter(kArenaAllocGraphBuilder)) {}
HBasicBlock* HBasicBlockBuilder::MaybeCreateBlockAt(uint32_t dex_pc) {
return MaybeCreateBlockAt(dex_pc, dex_pc);
@@ -101,10 +100,8 @@ bool HBasicBlockBuilder::CreateBranchTargets() {
const Instruction& instruction = pair.Inst();
if (instruction.IsBranch()) {
- number_of_branches_++;
MaybeCreateBlockAt(dex_pc + instruction.GetTargetOffset());
} else if (instruction.IsSwitch()) {
- number_of_branches_++; // count as at least one branch (b/77652521)
DexSwitchTable table(instruction, dex_pc);
for (DexSwitchTableIterator s_it(table); !s_it.Done(); s_it.Advance()) {
MaybeCreateBlockAt(dex_pc + s_it.CurrentTargetOffset());
diff --git a/compiler/optimizing/block_builder.h b/compiler/optimizing/block_builder.h
index 1aa9375e5a..ce1fb6f054 100644
--- a/compiler/optimizing/block_builder.h
+++ b/compiler/optimizing/block_builder.h
@@ -42,7 +42,6 @@ class HBasicBlockBuilder : public ValueObject {
// Creates basic blocks in `graph_` for compiling an intrinsic.
void BuildIntrinsic();
- size_t GetNumberOfBranches() const { return number_of_branches_; }
HBasicBlock* GetBlockAt(uint32_t dex_pc) const { return branch_targets_[dex_pc]; }
private:
@@ -79,7 +78,6 @@ class HBasicBlockBuilder : public ValueObject {
ScopedArenaAllocator* const local_allocator_;
ScopedArenaVector<HBasicBlock*> branch_targets_;
ScopedArenaVector<HBasicBlock*> throwing_blocks_;
- size_t number_of_branches_;
static constexpr size_t kDefaultNumberOfThrowingBlocks = 2u;
diff --git a/compiler/optimizing/builder.cc b/compiler/optimizing/builder.cc
index 48d1a9da2f..9233ea4fcd 100644
--- a/compiler/optimizing/builder.cc
+++ b/compiler/optimizing/builder.cc
@@ -63,7 +63,7 @@ HGraphBuilder::HGraphBuilder(HGraph* graph,
compilation_stats_(nullptr),
return_type_(return_type) {}
-bool HGraphBuilder::SkipCompilation(size_t number_of_branches) {
+bool HGraphBuilder::SkipCompilation() {
if (code_generator_ == nullptr) {
// Note that the codegen is null when unit testing.
return false;
@@ -84,15 +84,6 @@ bool HGraphBuilder::SkipCompilation(size_t number_of_branches) {
return true;
}
- // If it's large and contains no branches, it's likely to be machine generated initialization.
- if (compiler_options.IsLargeMethod(code_units) && (number_of_branches == 0)) {
- VLOG(compiler) << "Skip compilation of large method with no branch "
- << dex_file_->PrettyMethod(dex_compilation_unit_->GetDexMethodIndex())
- << ": " << code_units << " code units";
- MaybeRecordStat(compilation_stats_, MethodCompilationStat::kNotCompiledLargeMethodNoBranches);
- return true;
- }
-
return false;
}
@@ -131,7 +122,7 @@ GraphAnalysisResult HGraphBuilder::BuildGraph() {
// 2) Decide whether to skip this method based on its code size and number
// of branches.
- if (SkipCompilation(block_builder.GetNumberOfBranches())) {
+ if (SkipCompilation()) {
return kAnalysisSkipped;
}
diff --git a/compiler/optimizing/builder.h b/compiler/optimizing/builder.h
index ef225d9a6a..b81b2f0d11 100644
--- a/compiler/optimizing/builder.h
+++ b/compiler/optimizing/builder.h
@@ -53,7 +53,7 @@ class HGraphBuilder : public ValueObject {
static constexpr const char* kBuilderPassName = "builder";
private:
- bool SkipCompilation(size_t number_of_branches);
+ bool SkipCompilation();
HGraph* const graph_;
const DexFile* const dex_file_;