This patch makes possible generating NVPTX assembly check lines with
update_llc_test_checks.py utility.
Details
Diff Detail
Unit Tests
Event Timeline
llvm/utils/UpdateTestChecks/asm.py | ||
---|---|---|
184 | There may be other attributes (e.g. .weak) and they may come in different order. | |
430 | It would be great to document what the function is expected to return. | |
503 | The third field is a label_suffix, but it's not clear why it's ( for NVPTX. Looks like it's supposed to serve as a terminator for the CHECK-LABEL (i.e. it's a suffix in terms of FileCheck, but not necessarily in terms of the actual asm labels). I wonder if we can incorporate this suffix into a named regex match group, so we don't have to pass it explicitly. |
llvm/utils/UpdateTestChecks/asm.py | ||
---|---|---|
503 |
I suppose that I used a wrong term for naming that, and maybe I should rename that to function_decl_suffix or something like this. .visible .entry square(int *, int)( .param .u64 square(int *, int)_param_0, .param .u32 square(int *, int)_param_1 ) In other assemblies, function "declarations" are just labels looking like foo:. So I introduced this new suffix field, because we need to have some marker of function start. Previously, a colon after label was hardcoded.
Unfortunately, that seems to be even more non-transparent - this was the first way that I tried and failed. Regex named group func is intended to hold the same function name as IR function has. Here is code from add_checks function from common.py: # If we do not have output for this prefix we skip it. if not func_dict[checkprefix][func_name]: continue I also don't like that separate suffix field, but have no idea how to get rid of it in a nice way. |
llvm/utils/UpdateTestChecks/asm.py | ||
---|---|---|
503 |
I was thinking of adding the separator as yet another named group within the existing RE for function parameters: The named group 'func' remains unchanged, but now you can extract the separator via its own named group, save it along with the function name and later retrieve and use it in add_checks. To minimize churn, the separator group may be optional and would default to ':' which would work for existing targets. |
LGTM, but I'll defer to UpdateTestChecks owners for the final approval.
llvm/utils/UpdateTestChecks/common.py | ||
---|---|---|
493–497 | Existence of the named group can be checked directly: func_name_separator = m.group('func_name_separator') if 'func_name_separator' in m.groupdict() else ":" |
llvm/utils/UpdateTestChecks/common.py | ||
---|---|---|
493–497 | Thanks for useful advice! Fixed. |
@lattner Hello Chris, could you please suggest a reviewer for this patch? I'm not sure who is the owner of this part of repository. Thanks!
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/nvptx-basic.ll | ||
---|---|---|
21 | nit: keep just one blank line | |
42 | nit: delete trailing blank line | |
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/nvptx-basic.ll.expected | ||
81 | opaque pointers have been enabled today. |
llvm/test/tools/UpdateTestChecks/update_llc_test_checks/Inputs/nvptx-basic.ll.expected | ||
---|---|---|
81 | Fixed, thanks! |
nit: keep just one blank line