1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-18 18:42:46 +02:00

[PowerPC][UpdateTestChecks] Remove the extra # when scrubbing loop comments

Summary:
The patch D63957 is to avoid empty string when scrubbing loop comments,
it will replace loop comments to a `#`, that's correct.
But if the line has something else not only loop comments, we will get
a extra `#`.
The patch is to remove the extra `#`.

Reviewed By: jsji

Differential Revision: https://reviews.llvm.org/D77357
This commit is contained in:
Kang Zhang 2020-04-10 06:09:01 +00:00
parent fde93e0fb6
commit 367540d524
4 changed files with 765 additions and 762 deletions

File diff suppressed because it is too large Load Diff

View File

@ -5,11 +5,11 @@ define void @test(i8* %ptr, i8 %cmp, i8 %val) {
; PPC64LE-LABEL: test: ; PPC64LE-LABEL: test:
; PPC64LE: # %bb.0: ; PPC64LE: # %bb.0:
; PPC64LE-NEXT: rlwinm 4, 4, 0, 24, 31 ; PPC64LE-NEXT: rlwinm 4, 4, 0, 24, 31
; PPC64LE-NEXT: .LBB0_1: # ; PPC64LE-NEXT: .LBB0_1:
; PPC64LE-NEXT: lbarx 6, 0, 3 ; PPC64LE-NEXT: lbarx 6, 0, 3
; PPC64LE-NEXT: cmpw 4, 6 ; PPC64LE-NEXT: cmpw 4, 6
; PPC64LE-NEXT: bne 0, .LBB0_3 ; PPC64LE-NEXT: bne 0, .LBB0_3
; PPC64LE-NEXT: # %bb.2: # ; PPC64LE-NEXT: # %bb.2:
; PPC64LE-NEXT: stbcx. 5, 0, 3 ; PPC64LE-NEXT: stbcx. 5, 0, 3
; PPC64LE-NEXT: beqlr 0 ; PPC64LE-NEXT: beqlr 0
; PPC64LE-NEXT: b .LBB0_1 ; PPC64LE-NEXT: b .LBB0_1

View File

@ -233,6 +233,8 @@ def scrub_asm_powerpc(asm, args):
asm = common.SCRUB_LOOP_COMMENT_RE.sub(r'#', asm) asm = common.SCRUB_LOOP_COMMENT_RE.sub(r'#', asm)
# Strip trailing whitespace. # Strip trailing whitespace.
asm = common.SCRUB_TRAILING_WHITESPACE_RE.sub(r'', asm) asm = common.SCRUB_TRAILING_WHITESPACE_RE.sub(r'', asm)
# Stripe the tailing token '#', except the line only has token '#'.
asm = common.SCRUB_TAILING_COMMENT_TOKEN_RE.sub(r'', asm)
return asm return asm
def scrub_asm_mips(asm, args): def scrub_asm_mips(asm, args):

View File

@ -89,6 +89,7 @@ SCRUB_TRAILING_WHITESPACE_AND_ATTRIBUTES_RE = re.compile(r'([ \t]|(#[0-9]+))+$',
SCRUB_KILL_COMMENT_RE = re.compile(r'^ *#+ +kill:.*\n') SCRUB_KILL_COMMENT_RE = re.compile(r'^ *#+ +kill:.*\n')
SCRUB_LOOP_COMMENT_RE = re.compile( SCRUB_LOOP_COMMENT_RE = re.compile(
r'# =>This Inner Loop Header:.*|# in Loop:.*', flags=re.M) r'# =>This Inner Loop Header:.*|# in Loop:.*', flags=re.M)
SCRUB_TAILING_COMMENT_TOKEN_RE = re.compile(r'(?<=\S)+[ \t]*#$', flags=re.M)
def error(msg, test_file=None): def error(msg, test_file=None):