[PATCH] D40268: [utils][mips] Add support for mips for update_llc_checks.py
Simon Dardis via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun Nov 26 11:23:13 PST 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL319001: [utils][mips] Add support for mips for update_llc_checks.py (authored by sdardis).
Changed prior to commit:
https://reviews.llvm.org/D40268?vs=123650&id=124310#toc
Repository:
rL LLVM
https://reviews.llvm.org/D40268
Files:
llvm/trunk/utils/update_llc_test_checks.py
Index: llvm/trunk/utils/update_llc_test_checks.py
===================================================================
--- llvm/trunk/utils/update_llc_test_checks.py
+++ llvm/trunk/utils/update_llc_test_checks.py
@@ -47,6 +47,15 @@
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
+ r'(?P<body>.*?)\n' # (body of the function)
+ r'(?:^[ \t]+\.(set|end).*?\n)+' # Mips+LLVM standard asm epilogue
+ r'(\$|\.L)func_end[0-9]+:\n', # $func_end0: (mips32 - O32) or
+ # .Lfunc_end0: (mips64 - NewABI)
+ flags=(re.M | re.S))
+
ASM_FUNCTION_PPC_RE = re.compile(
r'^_?(?P<func>[^:]+):[ \t]*#+[ \t]*@(?P=func)\n'
r'\.Lfunc_begin[0-9]+:\n'
@@ -141,6 +150,16 @@
asm = SCRUB_TRAILING_WHITESPACE_RE.sub(r'', asm)
return asm
+def scrub_asm_mips(asm, args):
+ # Scrub runs of whitespace out of the assembly, but leave the leading
+ # whitespace in place.
+ asm = SCRUB_WHITESPACE_RE.sub(r' ', asm)
+ # Expand the tabs used for indentation.
+ asm = string.expandtabs(asm, 2)
+ # Strip trailing whitespace.
+ asm = SCRUB_TRAILING_WHITESPACE_RE.sub(r'', asm)
+ return asm
+
def scrub_asm_riscv(asm, args):
# Scrub runs of whitespace out of the assembly, but leave the leading
# whitespace in place.
@@ -175,6 +194,7 @@
'thumb-eabi': (scrub_asm_arm_eabi, ASM_FUNCTION_ARM_RE),
'thumbv8-eabi': (scrub_asm_arm_eabi, ASM_FUNCTION_ARM_RE),
'armeb-eabi': (scrub_asm_arm_eabi, ASM_FUNCTION_ARM_RE),
+ 'mips': (scrub_asm_mips, ASM_FUNCTION_MIPS_RE),
'powerpc64': (scrub_asm_powerpc64, ASM_FUNCTION_PPC_RE),
'powerpc64le': (scrub_asm_powerpc64, ASM_FUNCTION_PPC_RE),
'riscv32': (scrub_asm_riscv, ASM_FUNCTION_RISCV_RE),
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D40268.124310.patch
Type: text/x-patch
Size: 1980 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20171126/2dedc276/attachment.bin>
More information about the llvm-commits
mailing list