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

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: remove TODO 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
« no previous file with comments | « src/llvm2ice.cpp ('k') | tests_lit/llvm2ice_tests/nacl-other-intrinsics.ll » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: szdiff.py
diff --git a/szdiff.py b/szdiff.py
index 9b8d613e1a20625e5a9985654d4dc4c384daba2b..046982ea2b87b540b3213e3f03ff8d6bbaecb2a0 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\..*i\d+\*', # intrinsic calls w/ pointer args
+ ' i\d+\* @llvm\.', # intrinsic calls w/ pointer ret
' 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:
« no previous file with comments | « src/llvm2ice.cpp ('k') | tests_lit/llvm2ice_tests/nacl-other-intrinsics.ll » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698