summaryrefslogtreecommitdiffstats
path: root/llvm/utils/UpdateTestChecks/asm.py
diff options
context:
space:
mode:
authorRoman Lebedev <lebedev.ri@gmail.com>2019-06-05 14:08:01 +0000
committerRoman Lebedev <lebedev.ri@gmail.com>2019-06-05 14:08:01 +0000
commit54bd6c840e37bd738253d6ee5e7c2c571dd66860 (patch)
tree2770e52546b3607cbd87c324d1a65dffb633a29e /llvm/utils/UpdateTestChecks/asm.py
parent5145b1e4421adb3ac7e558cb88c9a2100ccb2b44 (diff)
downloadbcm5719-llvm-54bd6c840e37bd738253d6ee5e7c2c571dd66860.tar.gz
bcm5719-llvm-54bd6c840e37bd738253d6ee5e7c2c571dd66860.zip
UpdateTestChecks: hexagon support
Summary: These tests are being affected by an upcoming patch, so having an understandable (autogenerated) diff is helpful. This target, again, prefers `-march`: ``` llvm/test/CodeGen/Hexagon$ grep -r triple | wc -l 467 llvm/test/CodeGen/Hexagon$ grep -r march | wc -l 1167 ``` Reviewers: RKSimon, kparzysz Reviewed By: kparzysz Subscribers: xbolva00, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62867 llvm-svn: 362605
Diffstat (limited to 'llvm/utils/UpdateTestChecks/asm.py')
-rw-r--r--llvm/utils/UpdateTestChecks/asm.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/llvm/utils/UpdateTestChecks/asm.py b/llvm/utils/UpdateTestChecks/asm.py
index 7fb93fab565..a27cd04205b 100644
--- a/llvm/utils/UpdateTestChecks/asm.py
+++ b/llvm/utils/UpdateTestChecks/asm.py
@@ -42,6 +42,13 @@ ASM_FUNCTION_AMDGPU_RE = re.compile(
r'.Lfunc_end[0-9]+:\n',
flags=(re.M | re.S))
+ASM_FUNCTION_HEXAGON_RE = re.compile(
+ r'^_?(?P<func>[^:]+):[ \t]*//[ \t]*@(?P=func)\n[^:]*?'
+ r'(?P<body>.*?)\n' # (body of the function)
+ # This list is incomplete
+ r'.Lfunc_end[0-9]+:\n',
+ flags=(re.M | re.S))
+
ASM_FUNCTION_MIPS_RE = re.compile(
r'^_?(?P<func>[^:]+):[ \t]*#+[ \t]*@(?P=func)\n[^:]*?' # f: (name of func)
r'(?:^[ \t]+\.(frame|f?mask|set).*?\n)+' # Mips+LLVM standard asm prologue
@@ -161,6 +168,16 @@ def scrub_asm_arm_eabi(asm, args):
asm = common.SCRUB_TRAILING_WHITESPACE_RE.sub(r'', asm)
return asm
+def scrub_asm_hexagon(asm, args):
+ # Scrub runs of whitespace out of the assembly, but leave the leading
+ # whitespace in place.
+ asm = common.SCRUB_WHITESPACE_RE.sub(r' ', asm)
+ # Expand the tabs used for indentation.
+ asm = string.expandtabs(asm, 2)
+ # Strip trailing whitespace.
+ asm = common.SCRUB_TRAILING_WHITESPACE_RE.sub(r'', asm)
+ return asm
+
def scrub_asm_powerpc(asm, args):
# Scrub runs of whitespace out of the assembly, but leave the leading
# whitespace in place.
@@ -239,6 +256,7 @@ def get_triple_from_march(march):
'r600': 'r600',
'mips': 'mips',
'sparc': 'sparc',
+ 'hexagon': 'hexagon',
}
for prefix, triple in triples.items():
if march.startswith(prefix):
@@ -254,6 +272,7 @@ def build_function_body_dictionary_for_triple(args, raw_tool_output, triple, pre
'i386': (scrub_asm_x86, ASM_FUNCTION_X86_RE),
'arm64-eabi': (scrub_asm_arm_eabi, ASM_FUNCTION_AARCH64_RE),
'aarch64': (scrub_asm_arm_eabi, ASM_FUNCTION_AARCH64_RE),
+ 'hexagon': (scrub_asm_hexagon, ASM_FUNCTION_HEXAGON_RE),
'r600': (scrub_asm_amdgpu, ASM_FUNCTION_AMDGPU_RE),
'amdgcn': (scrub_asm_amdgpu, ASM_FUNCTION_AMDGPU_RE),
'arm-eabi': (scrub_asm_arm_eabi, ASM_FUNCTION_ARM_RE),
OpenPOWER on IntegriCloud