llvm.org GIT mirror llvm / c71ad5d
[Utils] update_llc_test_checks.py: support AMDGPU backend: AMDGCN, r600 triples Summary: Lack of that support has taken me by surprise. I need to add (or at least look at) some tests for https://reviews.llvm.org/D47980#1127615, and i don't really fancy doing that by hand. The asm pattern is quite similar to that of x86: https://godbolt.org/g/hfgeds just with `#` replaced with `;` Reviewers: spatel, RKSimon, MaskRay, tstellar, arsenm Reviewed By: arsenm Subscribers: arsenm, kzhuravl, wdng, yaxunl, dstuttard, tpr, t-tye, rampitec, bogner, mareko, llvm-commits Tags: #amdgpu Differential Revision: https://reviews.llvm.org/D48001 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@334396 91177308-0d34-0410-b5e6-96231b3b80d8 Roman Lebedev 2 years ago
1 changed file(s) with 19 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
3232 # This list is incomplete
3333 r'.Lfunc_end[0-9]+:\n',
3434 flags=(re.M | re.S))
35
36 ASM_FUNCTION_AMDGPU_RE = re.compile(
37 r'^_?(?P[^:]+):[ \t]*;+[ \t]*@(?P=func)\n[^:]*?'
38 r'(?P.*?)\n' # (body of the function)
39 # This list is incomplete
40 r'.Lfunc_end[0-9]+:\n',
41 flags=(re.M | re.S))
3542
3643 ASM_FUNCTION_MIPS_RE = re.compile(
3744 r'^_?(?P[^:]+):[ \t]*#+[ \t]*@(?P=func)\n[^:]*?' # f: (name of func)
115122 asm = common.SCRUB_TRAILING_WHITESPACE_RE.sub(r'', asm)
116123 return asm
117124
125 def scrub_asm_amdgpu(asm, args):
126 # Scrub runs of whitespace out of the assembly, but leave the leading
127 # whitespace in place.
128 asm = common.SCRUB_WHITESPACE_RE.sub(r' ', asm)
129 # Expand the tabs used for indentation.
130 asm = string.expandtabs(asm, 2)
131 # Strip trailing whitespace.
132 asm = common.SCRUB_TRAILING_WHITESPACE_RE.sub(r'', asm)
133 return asm
134
118135 def scrub_asm_arm_eabi(asm, args):
119136 # Scrub runs of whitespace out of the assembly, but leave the leading
120137 # whitespace in place.
187204 'x86': (scrub_asm_x86, ASM_FUNCTION_X86_RE),
188205 'i386': (scrub_asm_x86, ASM_FUNCTION_X86_RE),
189206 'aarch64': (scrub_asm_arm_eabi, ASM_FUNCTION_AARCH64_RE),
207 'r600': (scrub_asm_amdgpu, ASM_FUNCTION_AMDGPU_RE),
208 'amdgcn': (scrub_asm_amdgpu, ASM_FUNCTION_AMDGPU_RE),
190209 'arm-eabi': (scrub_asm_arm_eabi, ASM_FUNCTION_ARM_RE),
191210 'thumb-eabi': (scrub_asm_arm_eabi, ASM_FUNCTION_ARM_RE),
192211 'thumbv6': (scrub_asm_arm_eabi, ASM_FUNCTION_ARM_RE),