diff options
author | marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-06-09 11:37:41 +0000 |
---|---|---|
committer | marxin <marxin@138bc75d-0d04-0410-961f-82ee72b054a4> | 2016-06-09 11:37:41 +0000 |
commit | 3f76cceb6e57244bef5d666a9057eab4f9abb92e (patch) | |
tree | e3753f419888a5394694e152cd1c15fd95083483 /contrib | |
parent | 59ae3d1b3967a500466a0b9b8c6c88373f2a8410 (diff) | |
download | gcc-3f76cceb6e57244bef5d666a9057eab4f9abb92e.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@237255 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'contrib')
-rw-r--r-- | contrib/ChangeLog | 4 | ||||
-rwxr-xr-x | contrib/analyze_brprob.py | 10 |
2 files changed, 9 insertions, 5 deletions
diff --git a/contrib/ChangeLog b/contrib/ChangeLog index edb1df7b311..6c80c1edbe3 100644 --- a/contrib/ChangeLog +++ b/contrib/ChangeLog @@ -1,3 +1,7 @@ +2016-06-09 Martin Liska <mliska@suse.cz> + + * analyze_brprob.py: Cover new dump output format. + 2016-06-07 Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE> * update-copyright.py (LibMudflapFilter): Remove. diff --git a/contrib/analyze_brprob.py b/contrib/analyze_brprob.py index 36371ff26ff..9416eed3b44 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) |