Commit Graph

278587 Commits

Author SHA1 Message Date
Rafael Espindola b308cace84 Fix crash on invalid.
We would fail an assert if a shared library had a local symbol after
sh_info.

llvm-svn: 320667
2017-12-14 05:01:49 +00:00
Matthias Braun 5dd72adbec MC/AsmPrinter: Reduce code duplication.
Factor out duplicated code emitting mach-o version-min specifiers.

This should be NFC but happens to fix a bug where the code in
MCMachoStreamer didn't take the version skew between darwin and macos
versions into account.

llvm-svn: 320666
2017-12-14 03:59:24 +00:00
Kostya Kortchinsky 123adb5073 [scudo] Disabling the interface test on armhf
Summary:
I will investigate the breakage tomorrow, disable on armhf to turn the bots
green over the night.

http://lab.llvm.org:8011/builders/clang-cmake-thumbv7-a15-full-sh/builds/2952/steps/ninja%20check%202/logs/FAIL%3A%20Scudo-armhf%3A%3A%20interface.cpp

This is post https://reviews.llvm.org/D41128.

Reviewers: alekseyshl

Subscribers: aemerson, kristof.beyls, llvm-commits, #sanitizers

Differential Revision: https://reviews.llvm.org/D41218

llvm-svn: 320665
2017-12-14 02:54:11 +00:00
Dean Michael Berris 504b0c28f3 [XRay][compiler-rt] Coalesce calls to mprotect to reduce patching overhead
Summary:
Before this change, XRay would conservatively patch sections of the code
one sled at a time. Upon testing/profiling, this turns out to take an
inordinate amount of time and cycles. For an instrumented clang binary,
the cycles spent both in the patching/unpatching routine constituted 4%
of the cycles -- this didn't count the time spent in the kernel while
performing the mprotect calls in quick succession.

With this change, we're coalescing the number of calls to mprotect from
being linear to the number of instrumentation points, to now being a
lower constant when patching all the sleds through `__xray_patch()` or
`__xray_unpatch()`. In the case of calling `__xray_patch_function()` or
`__xray_unpatch_function()` we're now doing an mprotect call once for
all the sleds for that function (reduction of at least 2x calls to
mprotect).

Reviewers: kpw, eizan

Subscribers: llvm-commits

Differential Revision: https://reviews.llvm.org/D41153

llvm-svn: 320664
2017-12-14 02:51:20 +00:00
Kamil Rytarowski 6c18f027ff Set of corrections for MSan/NetBSD
Summary:
Changes:

 - Don't attempt to intercept GLIBC specific functions like __strtol_internal.
   This is required to stop intercepting it as we leak dlerror(3) for dlsym(3)
   that cannot manage to find a symbol.
 - Correct interception of fstatat(2).
 - Don't run a test for fgetgrent_r() that is missing on NetBSD.
 - Correct link_map location (offset) in Obj_Entry on x86_64 and i386.
 - Stop intercepting getpshared-like functions in pthread(3). This is feature
   is not enabled by default on NetBSD as it's unfinished.
 - Switch intercepting from UTMP to UTMPX functions.

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, vitalybuka, eugenis, kcc

Reviewed By: vitalybuka

Subscribers: llvm-commits, srhines, kubamracek, #sanitizers

Tags: #sanitizers

Differential Revision: https://reviews.llvm.org/D41053

llvm-svn: 320663
2017-12-14 01:20:16 +00:00
Sam Clegg 30b013bac8 [WebAssembly] Update YAML expected output after llvm change
See: https://reviews.llvm.org/D41202

Differential Revision: https://reviews.llvm.org/D41210

llvm-svn: 320662
2017-12-14 00:34:25 +00:00
Matthias Braun 0148c88c08 MC: Add support for mach-o build_version
LC_BUILD_VERSION is a new load command superseding the previously used
LC_XXX_MIN_VERSION commands. This adds an assembler directive along with
encoding/streaming support.

llvm-svn: 320661
2017-12-14 00:12:46 +00:00
Kuba Mracek 2c1fa4feb1 [asan] Use linker initialization for the allocator
This saves ~2 MB of dirty memory footprint. Can be a big deal on mobile devices especially when running multiple processes with ASan.

Differential Revision: https://reviews.llvm.org/D40627

llvm-svn: 320660
2017-12-14 00:07:15 +00:00
Kuba Mracek eb18bc5d22 [sanitizer] Use MADV_FREE on Darwin/BSD to release pages to the OS
MADV_DONTNEED on Linux actually mark the pages as free to be overwritten with zeroes, but on Darwin and BSD, it's just an advisory flag (the OS cannot discard the content). We should use MADV_FREE on Darwin and BSD.

Differential Revision: https://reviews.llvm.org/D40666

llvm-svn: 320659
2017-12-14 00:04:30 +00:00
Petr Hosek 34ea06b09e [CMake] Pass LLVM_HAVE_LINK_VERSION_SCRIPT to external projects
Some external projects depend on this LLVM CMake variable.

Differential Revision: https://reviews.llvm.org/D41205

llvm-svn: 320658
2017-12-13 23:49:51 +00:00
Shoaib Meenai a9844566d3 [cmake] Add support for case-sensitive Windows SDKs
When the Windows SDK is hosted on a case-sensitive filesystem (e.g. when
compiling on Linux and not using ciopfs), we can automatically generate
a VFS overlay for headers and symlinks for libraries.

Differential Revision: https://reviews.llvm.org/D41156

llvm-svn: 320657
2017-12-13 23:38:12 +00:00
Shoaib Meenai 02fd152297 [cmake] Support host architectures other than x64
Allow building for other architectures when cross-compiling for Windows.

Differential Revision: https://reviews.llvm.org/D41158

llvm-svn: 320656
2017-12-13 23:12:38 +00:00
Craig Topper f82867c95a Recommit r320461 "[X86] Use regular expressions more aggressively to reduce the number of scheduler entries needed for FMA3 instructions."
I've hopefully sidestepped the MSVC issue that caused it to be reverted. We no longer include the Sched enum from X86GenInstrInfo.inc on the X86 target. So hopefully MSVC's preprocessor will skip over it and nothing will notice the 11000 character enum name.

Original commit message:

When the scheduler tables are generated by tablegen, the instructions are divided up into groups based on their default scheduling information and how they are referenced by groups for each processor. For any set of instructions that are matched by a specific InstRW line, that group of instructions is guaranteed to not be in a group with any other instructions. So in general, the more InstRW class definitions are created, the more groups we end up with in the generated files. Particularly if a lot of the InstRW lines only match to single instructions, which is true of a large number of the Intel scheduler models.

This change alone reduces the number of instructions groups from ~6000 to ~5500. And there's lots more we could do.

llvm-svn: 320655
2017-12-13 23:11:30 +00:00
Rafael Espindola f4fb5fd752 Move Repl to SectionBase.
It is currently in InputSectionBase. Only InputSections are used in
ICF, so Repl should be move to InputSection to clear the class
hierarchy or, like this patch does, to SectionBase for convenience.

The convenience of having it on the base class is that we can just
access the replacement without having to first check if it is an
InputSection. It is a bit less code and a bit faster as some of this
code is very hot.

I got up to 1.77% improvement in clang-gdb-index and no regressions
according to lnt.

llvm-svn: 320654
2017-12-13 22:59:23 +00:00
Sanjay Patel 558a465473 [EarlyCSE] recognize swapped variants of abs/nabs as equivalent
Extends https://reviews.llvm.org/rL320640

Differential Revision: https://reviews.llvm.org/D41136

llvm-svn: 320653
2017-12-13 22:57:35 +00:00
Rui Ueyama d44a81c3a8 Inline a small function.
Differential Revision: https://reviews.llvm.org/D41204

llvm-svn: 320652
2017-12-13 22:53:59 +00:00
Simon Pilgrim 5af7a6ddf2 [X86] Add missing MULX32 schedule test
llvm-svn: 320651
2017-12-13 22:43:55 +00:00
Yaxun Liu a5315a040d CodeGen: Fix assertion in machine inst sheduler due to llvm.dbg.value
Two issues were found about machine inst scheduler when compiling ProRender
with -g for amdgcn target:

GCNScheduleDAGMILive::schedule tries to update LiveIntervals for DBG_VALUE, which it
should not since DBG_VALUE is not mapped in LiveIntervals.

when DBG_VALUE is the last instruction of MBB, ScheduleDAGInstrs::buildSchedGraph and
ScheduleDAGMILive::scheduleMI does not move RPTracker properly, which causes assertion.

This patch fixes that.

Differential Revision: https://reviews.llvm.org/D41132

llvm-svn: 320650
2017-12-13 22:38:09 +00:00
Zachary Turner 048f8f99bf [CodeView] Teach clang to emit the .debug$H COFF section.
Currently this is an LLVM extension to the COFF spec which is
experimental and intended to speed up linking.  For now it is
behind a hidden cl::opt flag, but in the future we can move it
to a "real" cc1 flag and have the driver pass it through whenever
it is appropriate.

The patch to actually make use of this section in lld will come
in a followup.

Differential Revision: https://reviews.llvm.org/D40917

llvm-svn: 320649
2017-12-13 22:33:58 +00:00
Michael Zolotukhin 67b04bd8ac Recover some overzealously removed includes.
llvm-svn: 320648
2017-12-13 22:21:02 +00:00
Sanjay Patel 37373dd512 [EarlyCSE] add tests for swapped abs/nabs; NFC
llvm-svn: 320647
2017-12-13 22:19:40 +00:00
Hans Wennborg 886b2f868d Speculative build fix for llvm-pdbdump on Linux after Michael's #include removals
llvm-svn: 320646
2017-12-13 22:12:58 +00:00
Hans Wennborg 86f0b70f37 Speculative build fix for lld on Linux after Michael's #include removals
llvm-svn: 320645
2017-12-13 22:12:57 +00:00
Simon Pilgrim 49dbfe7de9 [X86] Add CLWB schedule test
llvm-svn: 320644
2017-12-13 22:09:09 +00:00
Matt Morehouse 6e294952b6 [libFuzzer] Add dummy call of LLVMFuzzerTestOneInput to afl_driver.
Summary:
Add dummy call of LLVMFuzzerTestOneInput to afl_driver before it starts
executing on actual inputs. Do this so that first time initialization
performed by LLVMFuzzerTestOneInput is not considered code covered by
a particular input.

Patch By: metzman

Reviewers: kcc, morehouse

Reviewed By: kcc

Subscribers: llvm-commits, Sanitizers

Differential Revision: https://reviews.llvm.org/D41193

llvm-svn: 320643
2017-12-13 22:02:44 +00:00
Sam Clegg 0fc5599f52 [WebAssembly] Use bitfield types in wasm YAML representation
Differential Revision: https://reviews.llvm.org/D41202

llvm-svn: 320642
2017-12-13 22:02:25 +00:00
Brian M. Rzycki 580bc3c8fa Reverting [JumpThreading] Preservation of DT and LVI across the pass
Stage 2 bootstrap failed:
http://lab.llvm.org:8011/builders/clang-x86_64-linux-selfhost-modules-2/builds/14434

llvm-svn: 320641
2017-12-13 22:01:17 +00:00
Sanjay Patel 3c7a35de7f [EarlyCSE] recognize commuted and swapped variants of min/max as equivalent (PR35642)
As shown in:
https://bugs.llvm.org/show_bug.cgi?id=35642
...we can have different forms of min/max, so we should recognize those here in EarlyCSE 
similar to how we already handle binops and compares that can commute.

Differential Revision: https://reviews.llvm.org/D41136

llvm-svn: 320640
2017-12-13 21:58:15 +00:00
Sam Clegg 75f8360e28 [WebAssembly] Add linking metatdata test coverage for wasm2yaml
Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish

Differential Revision: https://reviews.llvm.org/D41196

llvm-svn: 320639
2017-12-13 21:53:40 +00:00
Peter Collingbourne 6010880bd1 IRGen: When performing CFI checks, load vtable pointer from vbase when necessary.
Under the Microsoft ABI, it is possible for an object not to have
a virtual table pointer of its own if all of its virtual functions
were introduced by virtual bases. In that case, we need to load the
vtable pointer from one of the virtual bases and perform the type
check using its type.

Differential Revision: https://reviews.llvm.org/D41036

llvm-svn: 320638
2017-12-13 21:53:04 +00:00
Simon Pilgrim 14318c5b31 [X86] Move ADX schedule tests out of schedule-x86_64.ll
llvm-svn: 320637
2017-12-13 21:49:09 +00:00
Michael Zolotukhin ad24af7f58 Remove redundant includes from lib/Target/X86.
llvm-svn: 320636
2017-12-13 21:31:19 +00:00
Michael Zolotukhin caf9ea6aa0 Remove redundant includes from lib/Target/ARM.
llvm-svn: 320635
2017-12-13 21:31:17 +00:00
Michael Zolotukhin a859bd9ced Remove redundant includes from lib/Target/AArch64.
llvm-svn: 320634
2017-12-13 21:31:16 +00:00
Michael Zolotukhin eb905c7e41 Remove redundant includes from lib/Target/*.cpp.
llvm-svn: 320633
2017-12-13 21:31:14 +00:00
Michael Zolotukhin 4d6b43ca94 Remove redundant includes from utils/TableGen.
llvm-svn: 320632
2017-12-13 21:31:13 +00:00
Michael Zolotukhin 62602a476a Remove redundant includes from tools.
llvm-svn: 320631
2017-12-13 21:31:10 +00:00
Michael Zolotukhin 5c0ab473f2 Remove redundant includes from unittests.
llvm-svn: 320630
2017-12-13 21:31:05 +00:00
Michael Zolotukhin d8920b1c44 Remove redundant includes from various places.
llvm-svn: 320629
2017-12-13 21:31:03 +00:00
Michael Zolotukhin 6af4f232b5 Remove redundant includes from lib/Transforms.
llvm-svn: 320628
2017-12-13 21:31:01 +00:00
Michael Zolotukhin da9f402677 Remove redundant includes from lib/Support.
llvm-svn: 320627
2017-12-13 21:30:58 +00:00
Michael Zolotukhin 6c02f9b884 Remove redundant includes from lib/ProfileData.
llvm-svn: 320626
2017-12-13 21:30:57 +00:00
Michael Zolotukhin fdfbab2baf Remove redundant includes from lib/Object.
llvm-svn: 320625
2017-12-13 21:30:55 +00:00
Michael Zolotukhin 910c0129c8 Remove redundant includes from lib/MC.
llvm-svn: 320624
2017-12-13 21:30:54 +00:00
Michael Zolotukhin e893b46b4a Remove redundant includes from lib/LTO.
llvm-svn: 320623
2017-12-13 21:30:53 +00:00
Michael Zolotukhin f05cb4374d Remove redundant includes from lib/IR.
llvm-svn: 320622
2017-12-13 21:30:52 +00:00
Michael Zolotukhin a44d5fe333 Remove redundant includes from lib/ExecutionEngine.
llvm-svn: 320621
2017-12-13 21:30:50 +00:00
Michael Zolotukhin 0c169bf7f7 Remove redundant includes from lib/DebugInfo.
llvm-svn: 320620
2017-12-13 21:30:49 +00:00
Michael Zolotukhin c468b648fd Remove redundant includes from lib/CodeGen.
llvm-svn: 320619
2017-12-13 21:30:47 +00:00
Michael Zolotukhin bda7dd5c31 Remove redundant includes from lib/Bitcode.
llvm-svn: 320618
2017-12-13 21:30:45 +00:00