summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2018-07-23 21:14:35 +0000
committerReid Kleckner <rnk@google.com>2018-07-23 21:14:35 +0000
commitd3db945575b2ea5a11e0bf304e17590ead7bc795 (patch)
tree113626e1e1718ab94dd38c83b8dbbbf258b8e056 /utils
parente6aaf315db3bfeb265febd0d3115d63d2257265f (diff)
Re-land r335297 "[X86] Implement more of x86-64 large and medium PIC code models"
Don't try to generate large PIC code for non-ELF targets. Neither COFF nor MachO have relocations for large position independent code, and users have been using "large PIC" code models to JIT 64-bit code for a while now. With this change, if they are generating ELF code, their JITed code will truly be PIC, but if they target MachO or COFF, it will contain 64-bit immediates that directly reference external symbols. For a JIT, that's perfectly fine. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@337740 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r--utils/UpdateTestChecks/asm.py5
-rwxr-xr-xutils/update_llc_test_checks.py5
2 files changed, 8 insertions, 2 deletions
diff --git a/utils/UpdateTestChecks/asm.py b/utils/UpdateTestChecks/asm.py
index e3f148934aa..726a653d151 100644
--- a/utils/UpdateTestChecks/asm.py
+++ b/utils/UpdateTestChecks/asm.py
@@ -110,8 +110,9 @@ def scrub_asm_x86(asm, args):
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.
- asm = SCRUB_X86_RIP_RE.sub(r'{{.*}}(%rip)', asm)
+ if getattr(args, 'x86_scrub_rip', False):
+ # Generically match a RIP-relative memory operand.
+ asm = SCRUB_X86_RIP_RE.sub(r'{{.*}}(%rip)', asm)
# Generically match a LCP symbol.
asm = SCRUB_X86_LCP_RE.sub(r'{{\.LCPI.*}}', asm)
if getattr(args, 'extra_scrub', False):
diff --git a/utils/update_llc_test_checks.py b/utils/update_llc_test_checks.py
index f7d94cdbd78..09b49a763b6 100755
--- a/utils/update_llc_test_checks.py
+++ b/utils/update_llc_test_checks.py
@@ -30,6 +30,11 @@ def main():
parser.add_argument(
'--extra_scrub', action='store_true',
help='Always use additional regex to further reduce diffs between various subtargets')
+ parser.add_argument(
+ '--x86_scrub_rip', action='store_true', default=True,
+ help='Use more regex for x86 matching to reduce diffs between various subtargets')
+ parser.add_argument(
+ '--no_x86_scrub_rip', action='store_false', dest='x86_scrub_rip')
parser.add_argument('tests', nargs='+')
args = parser.parse_args()