Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(501)

Unified Diff: szdiff.py

Issue 321993002: Add a few Subzero intrinsics (not the atomic ones yet). (Closed) Base URL: https://chromium.googlesource.com/native_client/pnacl-subzero.git@master
Patch Set: tweak test some Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: szdiff.py
diff --git a/szdiff.py b/szdiff.py
index 9b8d613e1a20625e5a9985654d4dc4c384daba2b..0ca739674875ff614632178111d3d44f9dd98e25 100755
--- a/szdiff.py
+++ b/szdiff.py
@@ -43,14 +43,23 @@ if __name__ == '__main__':
tail_call = re.compile(' tail call ');
trailing_comment = re.compile(';.*')
ignore_pattern = re.compile('^ *$|^declare|^@')
+ prev_line = None
for line in bitcode:
+ if prev_line:
+ line = prev_line + line
+ prev_line = None
# Convert tail call into regular (non-tail) call.
line = tail_call.sub(' call ', line)
# Remove trailing comments and spaces.
line = trailing_comment.sub('', line).rstrip()
# Ignore blanks lines, forward declarations, and variable definitions.
- if not ignore_pattern.search(line):
- llc_out.append(line)
+ if ignore_pattern.search(line):
+ continue
+ # SZ doesn't break up long lines, but LLVM does. Normalize to SZ.
+ if line.endswith(','):
+ prev_line = line
+ continue
+ llc_out.append(line)
# Compare sz_out and llc_out line by line, but ignore pairs of
# lines where the llc line matches a certain pattern.
@@ -61,6 +70,8 @@ if __name__ == '__main__':
'|'.join([' -[0-9]', # negative constants
' (float|double) [-0-9]', # FP constants
' (float|double) %\w+, [-0-9]',
+ ' @llvm\..*\*', # intrinsic calls w/ pointer args
+ ' i.*\* @llvm\.', # intrinsic calls w/ pointer ret
Jim Stichnoth 2014/06/12 20:52:07 Maybe this should be more precise like: i\d+ \* @
jvoung (off chromium) 2014/06/16 20:51:59 Done.
' inttoptr ', # inttoptr pointer types
' ptrtoint ', # ptrtoint pointer types
' bitcast .*\* .* to .*\*' # bitcast pointer types
@@ -72,8 +83,8 @@ if __name__ == '__main__':
if llc_line and ignore_pattern.search(llc_line):
lines_diff += 1
continue
- if sz_line: print 'SZ>' + sz_line
- if llc_line: print 'LL>' + llc_line
+ if sz_line: print 'SZ (%d)> %s' % (lines_total, sz_line)
+ if llc_line: print 'LL (%d)> %s' % (lines_total, llc_line)
return_code = 1
if return_code == 0:

Powered by Google App Engine
This is Rietveld 408576698