aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/UpdateTestChecks/common.py
diff options
context:
space:
mode:
authorMatthias Braun <matze@braunis.de>2023-11-21 17:08:44 -0800
committerGitHub <noreply@github.com>2023-11-21 17:08:44 -0800
commit331111277a3e80aedd1a6877524feadfbcb41a88 (patch)
treee56baeb0fc554690ac0b2617ebc70f1fb0026ab3 /llvm/utils/UpdateTestChecks/common.py
parentd213220a9ac031133fa360b94a343f3d09f01ea8 (diff)
downloadllvm-331111277a3e80aedd1a6877524feadfbcb41a88.zip
llvm-331111277a3e80aedd1a6877524feadfbcb41a88.tar.gz
llvm-331111277a3e80aedd1a6877524feadfbcb41a88.tar.bz2
Support BranchProbabilityInfo in update_analyze_test_checks.py (#72943)
- Change `BranchProbabilityPrinterPass` output to match expectations of `update_analyze_test_checks.py`. - Add `Branch Probability Analysis` to list of supported analyses. - Process `llvm/test/Analysis/BranchProbabilityInfo/basic.ll` with `update_analyze_test_checks.py` as proof of concept. Leaving the other tests unchanged to reduce the amount of churn.
Diffstat (limited to 'llvm/utils/UpdateTestChecks/common.py')
-rw-r--r--llvm/utils/UpdateTestChecks/common.py15
1 files changed, 9 insertions, 6 deletions
diff --git a/llvm/utils/UpdateTestChecks/common.py b/llvm/utils/UpdateTestChecks/common.py
index d1fd884..5c3775e 100644
--- a/llvm/utils/UpdateTestChecks/common.py
+++ b/llvm/utils/UpdateTestChecks/common.py
@@ -32,6 +32,14 @@ Version changelog:
DEFAULT_VERSION = 4
+SUPPORTED_ANALYSES = {
+ "Branch Probability Analysis",
+ "Cost Model Analysis",
+ "Loop Access Analysis",
+ "Scalar Evolution Analysis",
+}
+
+
class Regex(object):
"""Wrap a compiled regular expression object to allow deep copy of a regexp.
This is required for the deep copy done in do_scrub.
@@ -773,12 +781,7 @@ class FunctionTestBuilder:
)
if "analysis" in m.groupdict():
analysis = m.group("analysis")
- supported_analyses = {
- "cost model analysis",
- "scalar evolution analysis",
- "loop access analysis",
- }
- if analysis.lower() not in supported_analyses:
+ if analysis not in SUPPORTED_ANALYSES:
warn("Unsupported analysis mode: %r!" % (analysis,))
if func.startswith("stress"):
# We only use the last line of the function body for stress tests.