summaryrefslogtreecommitdiff
path: root/compiler/optimizing/graph_checker.h
diff options
context:
space:
mode:
author Santiago Aboy Solanes <solanes@google.com> 2022-12-16 19:28:47 +0000
committer Santiago Aboy Solanes <solanes@google.com> 2023-01-13 16:19:02 +0000
commit74da668328e1c501742a864d23ba8c114ece5e64 (patch)
treea8e6d643230ff9bec8ae8878cd8d1021b813a3e5 /compiler/optimizing/graph_checker.h
parent1f3861de4cacb51eacbb624e377b9dc7d7f96cc1 (diff)
Update the graph flags and check consistency
Check that the flags are up to date in graph checker. Mainly a correctness check CL but it brings slight code size reduction (e.g. not needing vreg info if HasMonitorOperations is false). Update loop_optimization_test to stop using `LocalRun` directly as it meant that it was breaking assumptions (i.e. top_loop_ was nullptr when it was expected to have a value). Bug: 264278131 Test: art/test/testrunner/testrunner.py --host --64 --optimizing -b Change-Id: I29765b3be46d4bd7c91ea9c80f7565a3c88fae2e
Diffstat (limited to 'compiler/optimizing/graph_checker.h')
-rw-r--r--compiler/optimizing/graph_checker.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/compiler/optimizing/graph_checker.h b/compiler/optimizing/graph_checker.h
index 738c0d6d3e..674798e20b 100644
--- a/compiler/optimizing/graph_checker.h
+++ b/compiler/optimizing/graph_checker.h
@@ -66,6 +66,7 @@ class GraphChecker : public HGraphDelegateVisitor {
void VisitDeoptimize(HDeoptimize* instruction) override;
void VisitIf(HIf* instruction) override;
void VisitInstanceOf(HInstanceOf* check) override;
+ void VisitInvoke(HInvoke* invoke) override;
void VisitInvokeStaticOrDirect(HInvokeStaticOrDirect* invoke) override;
void VisitLoadException(HLoadException* load) override;
void VisitMonitorOperation(HMonitorOperation* monitor_operation) override;
@@ -126,6 +127,11 @@ class GraphChecker : public HGraphDelegateVisitor {
ArenaVector<std::string> errors_;
private:
+ void VisitReversePostOrder();
+
+ // Checks that the graph's flags are set correctly.
+ void CheckGraphFlags();
+
// String displayed before dumped errors.
const char* const dump_prefix_;
ScopedArenaAllocator allocator_;
@@ -138,6 +144,17 @@ class GraphChecker : public HGraphDelegateVisitor {
// Used to access target information.
CodeGenerator* codegen_;
+ struct FlagInfo {
+ bool seen_try_boundary = false;
+ bool seen_monitor_operation = false;
+ bool seen_loop = false;
+ bool seen_irreducible_loop = false;
+ bool seen_SIMD = false;
+ bool seen_bounds_checks = false;
+ bool seen_always_throwing_invokes = false;
+ };
+ FlagInfo flag_info_;
+
DISALLOW_COPY_AND_ASSIGN(GraphChecker);
};