From e49efc14a17f32b2801dfa481081a0cabc083fe7 Mon Sep 17 00:00:00 2001 From: Martin Liska Date: Thu, 9 Jun 2016 13:37:41 +0200 Subject: Add edge predictions pruning * analyze_brprob.py: Cover new dump output format. * predict.c (dump_prediction): Add new argument. (enum predictor_reason): New enum. (struct predictor_hash): New struct. (predictor_hash::hash): New function. (predictor_hash::equal): Likewise. (not_removed_prediction_p): New function. (prune_predictions_for_bb): Likewise. (combine_predictions_for_bb): Prune predictions. * g++.dg/predict-loop-exit-1.C: Scan for a new dump format. * g++.dg/predict-loop-exit-2.C: Likewise. * g++.dg/predict-loop-exit-3.C: Likewise. * gcc.dg/predict-1.c: Likewise. * gcc.dg/predict-2.c: Likewise. * gcc.dg/predict-3.c: Likewise. * gcc.dg/predict-4.c: Likewise. * gcc.dg/predict-5.c: Likewise. * gcc.dg/predict-6.c: Likewise. * gcc.dg/predict-7.c: Likewise. From-SVN: r237255 --- contrib/analyze_brprob.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'contrib/analyze_brprob.py') diff --git a/contrib/analyze_brprob.py b/contrib/analyze_brprob.py index 36371ff..9416eed 100755 --- a/contrib/analyze_brprob.py +++ b/contrib/analyze_brprob.py @@ -122,14 +122,14 @@ if len(sys.argv) != 2: exit(1) profile = Profile(sys.argv[1]) -r = re.compile(' (.*) heuristics: (.*)%.*exec ([0-9]*) hit ([0-9]*)') +r = re.compile(' (.*) heuristics( of edge [0-9]*->[0-9]*)?( \\(.*\\))?: (.*)%.*exec ([0-9]*) hit ([0-9]*)') for l in open(profile.filename).readlines(): m = r.match(l) - if m != None: + if m != None and m.group(3) == None: name = m.group(1) - prediction = float(m.group(2)) - count = int(m.group(3)) - hits = int(m.group(4)) + prediction = float(m.group(4)) + count = int(m.group(5)) + hits = int(m.group(6)) profile.add(name, prediction, count, hits) -- cgit v1.1