From: Sanjay Patel Date: Fri, 20 Oct 2017 21:55:23 +0000 (+0000) Subject: [utils, x86] add regex for retl/retq to reduce duplicated FileChecking (PR35003) X-Git-Tag: llvmorg-6.0.0-rc1~5247 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f1735a58edd9d92b14d9b5d7e3cbab27de5a3019;p=platform%2Fupstream%2Fllvm.git [utils, x86] add regex for retl/retq to reduce duplicated FileChecking (PR35003) llvm-svn: 316242 --- diff --git a/llvm/utils/update_llc_test_checks.py b/llvm/utils/update_llc_test_checks.py index 02bcc2d..73d9a6f 100755 --- a/llvm/utils/update_llc_test_checks.py +++ b/llvm/utils/update_llc_test_checks.py @@ -79,6 +79,7 @@ SCRUB_X86_SHUFFLES_RE = ( SCRUB_X86_SP_RE = re.compile(r'\d+\(%(esp|rsp)\)') SCRUB_X86_RIP_RE = re.compile(r'[.\w]+\(%rip\)') SCRUB_X86_LCP_RE = re.compile(r'\.LCPI[0-9]+_[0-9]+') +SCRUB_X86_RET_RE = re.compile(r'ret[l|q]') RUN_LINE_RE = re.compile('^\s*;\s*RUN:\s*(.*)$') TRIPLE_ARG_RE = re.compile(r'-mtriple=([^ ]+)') @@ -101,6 +102,8 @@ def scrub_asm_x86(asm): asm = SCRUB_X86_RIP_RE.sub(r'{{.*}}(%rip)', asm) # Generically match a LCP symbol. asm = SCRUB_X86_LCP_RE.sub(r'{{\.LCPI.*}}', asm) + # Avoid generating different checks for 32- and 64-bit because of 'retl' vs 'retq'. + asm = SCRUB_X86_RET_RE.sub(r'ret{{[l|q]}}', asm) # Strip kill operands inserted into the asm. asm = SCRUB_KILL_COMMENT_RE.sub('', asm) # Strip trailing whitespace.