|
2 | 2 | # The PTX output of LLVM's NVPTX backend has a comment with the mangled function name |
3 | 3 | const PTX_FUNC_NAME_COMMENT_REGEX = r"// -- Begin function "m * MANGLED_NAME_REGEX * r"$"m |
4 | 4 |
|
5 | | -# Same with SASS but the name is surrounded by a lot of dashes |
6 | | -const SASS_FUNC_NAME_COMMENT_REGEX = r"//-{5,} .text."m * MANGLED_NAME_REGEX * r" -{5,}$"m |
7 | | - |
8 | 5 |
|
9 | 6 | function cleanup_code(::Val{:ptx}, c, dbinfo, cleanup_opts) |
10 | 7 | c = clean_function_name(PTX_FUNC_NAME_COMMENT_REGEX, c) |
@@ -60,28 +57,6 @@ function cleanup_code(::Val{:ptx}, c, dbinfo, cleanup_opts) |
60 | 57 | end |
61 | 58 |
|
62 | 59 |
|
63 | | -function cleanup_code(::Val{:sass}, c, dbinfo, cleanup_opts) |
64 | | - # SASS problems: |
65 | | - # Registers seem to be assigned randomly, changing from one call to another with the |
66 | | - # same input, as well as some immediate values (maybe related to the functions order in PTX?). |
67 | | - # Some instructions (only `MOV` from what I saw) might be ordered differently, or even |
68 | | - # in different numbers (max of what I could see is 1, but still surprising). |
69 | | - c = replace_llvm_module_name(c) |
70 | | - c = clean_function_name(SASS_FUNC_NAME_COMMENT_REGEX, c) |
71 | | - |
72 | | - extra_patterns = [] |
73 | | - if get(cleanup_opts, :demangle, true) |
74 | | - # Demangle only names which aren't the function's name |
75 | | - push!(extra_patterns, demangle_all()) |
76 | | - end |
77 | | - if !dbinfo |
78 | | - push!(extra_patterns, r"; Location .+\R" => "") # Remove location comments |
79 | | - end |
80 | | - |
81 | | - return replace(c, extra_patterns...) |
82 | | -end |
83 | | - |
84 | | - |
85 | 60 | function find_main_ptx_function(c) |
86 | 61 | # Matches any declaration of the form ".a1 .a2 some_name ( ..." and extracts ".a1 .a2" in group |
87 | 62 | # "attrs" and "some_name" in group "name". |
|
0 commit comments