diff options
author | Chandler Carruth <chandlerc@gmail.com> | 2018-04-03 09:57:05 +0000 |
---|---|---|
committer | Chandler Carruth <chandlerc@gmail.com> | 2018-04-03 09:57:05 +0000 |
commit | 6646becd0c94fb2ead7b2b944f2f7ebf40d5d8ba (patch) | |
tree | 1e442ea7938c1a3d5c9dd9a75dc10bcfde759bf7 /llvm/utils/UpdateTestChecks/asm.py | |
parent | ac70668cff76f28c22d84cc81a8966216d2732c2 (diff) | |
download | bcm5719-llvm-6646becd0c94fb2ead7b2b944f2f7ebf40d5d8ba.tar.gz bcm5719-llvm-6646becd0c94fb2ead7b2b944f2f7ebf40d5d8ba.zip |
[x86] Extend my goofy SP offset scrubbing for llc test cases to actually
do explicit scrubbing of the offsets of stack spills and reloads.
You can always turn this off in order to test specific stack slot usage.
We were already hiding most of this, but the new logic hides it more
generically. Notably, we should effectively hide stack slot churn in
functions that have a frame pointer now, and should also hide it when
changing a function from stack pointer to frame pointer. That transition
already changes enough to be clearly noticed in the test case diff,
showing *every* spill and reload is really noisy without benefit. See
the test case I ran this on as a classic example.
llvm-svn: 329055
Diffstat (limited to 'llvm/utils/UpdateTestChecks/asm.py')
-rw-r--r-- | llvm/utils/UpdateTestChecks/asm.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/utils/UpdateTestChecks/asm.py b/llvm/utils/UpdateTestChecks/asm.py index c98dfc9eeac..45b8efb882f 100644 --- a/llvm/utils/UpdateTestChecks/asm.py +++ b/llvm/utils/UpdateTestChecks/asm.py @@ -75,6 +75,10 @@ SCRUB_X86_SHUFFLES_RE = ( re.compile( r'^(\s*\w+) [^#\n]+#+ ((?:[xyz]mm\d+|mem)( \{%k\d+\}( \{z\})?)? = .*)$', flags=re.M)) +SCRUB_X86_SPILL_RELOAD_RE = ( + re.compile( + r'-?\d+\(%([er])[sb]p\)(.*(?:Spill|Reload))$', + flags=re.M)) 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]+') @@ -88,6 +92,9 @@ def scrub_asm_x86(asm, args): asm = string.expandtabs(asm, 2) # Detect shuffle asm comments and hide the operands in favor of the comments. asm = SCRUB_X86_SHUFFLES_RE.sub(r'\1 {{.*#+}} \2', asm) + # Detect stack spills and reloads and hide their exact offset and whether + # they used the stack pointer or frame pointer. + asm = SCRUB_X86_SPILL_RELOAD_RE.sub(r'{{[-0-9]+}}(%\1[sb]p)\2', asm) # Generically match the stack offset of a memory operand. asm = SCRUB_X86_SP_RE.sub(r'{{[0-9]+}}(%\1)', asm) # Generically match a RIP-relative memory operand. |