summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support/Unix
diff options
context:
space:
mode:
authorDavid Blaikie <dblaikie@gmail.com>2017-06-12 22:16:49 +0000
committerDavid Blaikie <dblaikie@gmail.com>2017-06-12 22:16:49 +0000
commit602a5bbb32e88ce0ae71e90bd76e22d0b5e006c7 (patch)
tree8357fe7f6999cd5ff22c5bb089c48f55fdec3797 /llvm/lib/Support/Unix
parentd5e999f1305fd6d665236d56a915fc1594b23424 (diff)
downloadbcm5719-llvm-602a5bbb32e88ce0ae71e90bd76e22d0b5e006c7.tar.gz
bcm5719-llvm-602a5bbb32e88ce0ae71e90bd76e22d0b5e006c7.zip
Support: Don't set RLIMIT_AS on child processes when applying a memory limit
It doesn't seem relevant to set an address space limit - this isn't important in any sense that I'm aware & it gets in the way of things that use a lot of address space, like llvm-symbolizer. This came up when I realized that bugpoint regression tests were much slower with -gsplit-dwarf than plain -g. Turned out that bugpoint subprocesses (opt, etc) were crashing and doing symbolization - but bugpoint runs those subprocesses with a 400MB memory limit. So with plain -g, mmaping the opt binary would exceed the memory limit, fail, and thus be really fast - no symbolization occurred. Whereas with -gsplit-dwarf, comically, having less to map in, it would succeed and then spend lots of time symbolizing. I've fixed at least the critical part of bugpoint's perf problem there by adding an option to allow bugpoint to disable symbolization. Thus improving the perfromance for -gsplit-dwarf and making the -g-esque speed available without this quirk/accidental benefit. llvm-svn: 305242
Diffstat (limited to 'llvm/lib/Support/Unix')
-rw-r--r--llvm/lib/Support/Unix/Program.inc10
1 files changed, 0 insertions, 10 deletions
diff --git a/llvm/lib/Support/Unix/Program.inc b/llvm/lib/Support/Unix/Program.inc
index 7d3537e2072..2df0eaff47e 100644
--- a/llvm/lib/Support/Unix/Program.inc
+++ b/llvm/lib/Support/Unix/Program.inc
@@ -163,16 +163,6 @@ static void SetMemoryLimits (unsigned size)
r.rlim_cur = limit;
setrlimit (RLIMIT_RSS, &r);
#endif
-#ifdef RLIMIT_AS // e.g. NetBSD doesn't have it.
- // Don't set virtual memory limit if built with any Sanitizer. They need 80Tb
- // of virtual memory for shadow memory mapping.
-#if !LLVM_MEMORY_SANITIZER_BUILD && !LLVM_ADDRESS_SANITIZER_BUILD
- // Virtual memory.
- getrlimit (RLIMIT_AS, &r);
- r.rlim_cur = limit;
- setrlimit (RLIMIT_AS, &r);
-#endif
-#endif
#endif
}
OpenPOWER on IntegriCloud