Rui Ueyama [Sat, 4 Nov 2017 23:57:51 +0000 (23:57 +0000)]
Inline a small function.
llvm-svn: 317428
Rui Ueyama [Sat, 4 Nov 2017 23:54:25 +0000 (23:54 +0000)]
Move OutputSectionFactory to LinkerScript.cpp. NFC.
That class is used only by LinkerScript.cpp, so we should move it to
that file. Also, it no longer has to be a "factory" class. It can just
be a non-member function.
llvm-svn: 317427
Rui Ueyama [Sat, 4 Nov 2017 23:09:43 +0000 (23:09 +0000)]
Rewrite addSymbolWrap and applySymbolWrap. NFCI.
r317396 changed the way how we handle the -defsym option. The option is
now handled using the infrastructure for the linker script.
We used to handle both -defsym and -wrap using the same set of functions
in the symbol table. Now, we don't need to do that.
This patch rewrites the functions so that they become more straightforward.
The new functions directly handle -wrap rather than abstract it.
llvm-svn: 317426
Rui Ueyama [Sat, 4 Nov 2017 22:32:56 +0000 (22:32 +0000)]
Remove dead code and update comment.
llvm-svn: 317425
Simon Pilgrim [Sat, 4 Nov 2017 21:18:06 +0000 (21:18 +0000)]
[X86][AVX] Regenerate test. NFCI.
llvm-svn: 317424
Martin Storsjo [Sat, 4 Nov 2017 21:01:31 +0000 (21:01 +0000)]
Add ifdefs around ELF specific parts of UnwindRegisters*.S for arm
This allows using dwarf exceptions on MinGW/ARM.
Differential Revision: https://reviews.llvm.org/D39534
llvm-svn: 317423
Harlan Haskins [Sat, 4 Nov 2017 20:31:20 +0000 (20:31 +0000)]
Use code voice for DIBuilder in LLVM C API
(This is a test commit)
llvm-svn: 317422
Roman Lebedev [Sat, 4 Nov 2017 20:27:47 +0000 (20:27 +0000)]
[Sema] Document+test the -Wsign-conversion change for enums in C code [NFC]
Basically a regression after r316268.
However the diagnostic is correct, but the test coverage is bad.
So just like rL316500, introduce yet more tests,
and adjust the release notes.
See https://bugs.llvm.org/show_bug.cgi?id=35200
llvm-svn: 317421
Aaron Ballman [Sat, 4 Nov 2017 20:07:16 +0000 (20:07 +0000)]
Move the llvm-tblgen project into the Tablegenning folder on IDEs like Visual Studio rather than leave it in the root directory. NFC.
llvm-svn: 317420
Aaron Ballman [Sat, 4 Nov 2017 20:06:49 +0000 (20:06 +0000)]
Move the clang-tblgen-targets project into the Misc folder on IDEs like Visual Studio rather than leave it in the root directory. NFC.
llvm-svn: 317419
Aaron Ballman [Sat, 4 Nov 2017 20:06:22 +0000 (20:06 +0000)]
Move the clang-tblgen project into the Clang tablegenning folder on IDEs like Visual Studio rather than leave it in the root directory. NFC.
llvm-svn: 317418
Aaron Ballman [Sat, 4 Nov 2017 20:00:21 +0000 (20:00 +0000)]
Move the libclang-headers project into the Misc folder on IDEs like Visual Studio rather than leave it in the root directory. NFC.
llvm-svn: 317417
Aaron Ballman [Sat, 4 Nov 2017 19:59:14 +0000 (19:59 +0000)]
Move the srpm, ocaml_make_directory, llvm_vcsrevision_h, and llvm-headers projects into the Misc folder on IDEs like Visual Studio rather than leave them in the root directory. NFC.
llvm-svn: 317416
Aaron Ballman [Sat, 4 Nov 2017 19:48:17 +0000 (19:48 +0000)]
Move the LLVMCFIVerify project into the Libraries folder on IDEs like Visual Studio rather than leave it in the root directory. NFC.
llvm-svn: 317415
Aaron Ballman [Sat, 4 Nov 2017 19:39:14 +0000 (19:39 +0000)]
Move these CMake projects into the Tests folder on IDEs like Visual Studio rather than leave it in the root directory. NFC.
llvm-svn: 317414
Craig Topper [Sat, 4 Nov 2017 18:26:41 +0000 (18:26 +0000)]
[X86] Don't use RCP14 and RSQRT14 for reciprocal estimations or for legacy SSE rcp/rsqrt intrinsics when AVX512 features are enabled.
Summary:
AVX512 added RCP14 and RSQRT instructions which improve accuracy over the legacy RCP and RSQRT instruction, but not enough accuracy to remove the need for a Newton Raphson refinement.
Currently we use these new instructions for the legacy packed SSE instrinics, but not the scalar instrinsics. And we use it for fast math optimization of division and reciprocal sqrt.
I think switching the legacy instrinsics maybe surprising to the user since it changes the answer based on which processor you're using regardless of any fastmath settings. It's also weird that we did something different between scalar and packed.
As far at the reciprocal estimation, I think it creates unnecessary deltas in our output behavior (and prevents EVEX->VEX). A little playing around with gcc and icc and godbolt suggest they don't change which instructions they use here.
This patch adds new X86ISD nodes for the RCP14/RSQRT14 and uses those for the new intrinsics. Leaving the old intrinsics to use the old instructions.
Going forward I think our focus should be on
-Supporting 512-bit vectors, which will have to use the RCP14/RSQRT14.
-Using RSQRT28/RCP28 to remove the Newton Raphson step on processors with AVX512ER
-Supporting double precision.
Reviewers: zvi, DavidKreitzer, RKSimon
Reviewed By: RKSimon
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D39583
llvm-svn: 317413
Craig Topper [Sat, 4 Nov 2017 18:26:39 +0000 (18:26 +0000)]
[X86] Regenerate a couple more tests that I missed in r317410.
llvm-svn: 317412
Tamas Berghammer [Sat, 4 Nov 2017 18:25:51 +0000 (18:25 +0000)]
Improve the posix core file triple detection
Summary:
Posix core files sometime don't contain enough information to correctly
detect the OS. If that is the case we should use the OS from the target
instead as it will contain usable information in more cases and if the
target and the core contain different OS-es then we are already in a
pretty bad state so moving from an unknown OS to a known (but possibly
incorrect) OS will do no harm.
We already had similar code in place for MIPS. This change tries to make
it more generic by using ArchSpec::MergeFrom and extends it to all
architectures but some MIPS specific issue prevent us from getting rid
of special casing MIPS.
Reviewers: clayborg, nitesh.jain
Subscribers: aemerson, sdardis, arichardson, kristof.beyls, lldb-commits
Differential Revision: https://reviews.llvm.org/D36046
llvm-svn: 317411
Craig Topper [Sat, 4 Nov 2017 18:10:03 +0000 (18:10 +0000)]
[X86] Teach EVEX->VEX pass to turn SHUFI32X4/SHUFF32X4/SHUFI64X/SHUFF64X2 into VPERM2F128/VPERM2I128.
This recovers some of the tests that were changed by r317403.
llvm-svn: 317410
Yaxun Liu [Sat, 4 Nov 2017 17:37:43 +0000 (17:37 +0000)]
[AMDGPU] Remove hardcoded address space value from AMDGPULibFunc
AMDGPULibFunc hardcodes address space values of the old address space mapping,
which causes invalid addrspacecast instructions and undefined functions in
APPSDK sample MonteCarloAsianDP.
This patch fixes that.
Differential Revision: https://reviews.llvm.org/D39616
llvm-svn: 317409
Sean Fertile [Sat, 4 Nov 2017 17:04:39 +0000 (17:04 +0000)]
[LTO][ThinLTO] Use the linker resolutions to mark global values as dso_local.
Now that we have a way to mark GlobalValues as local we can use the symbol
resolutions that the linker plugin provides as part of lto/thinlto link
step to refine the compilers view on what symbols will end up being local.
Originally commited as r317374, but reverted in r317395 to update some missed
tests.
Differential Revision: https://reviews.llvm.org/D35702
llvm-svn: 317408
Sanjay Patel [Sat, 4 Nov 2017 15:03:11 +0000 (15:03 +0000)]
[CodeGen] add remquo to list of recognized library calls
This is just an oversight because we already do recognize __builtin_remquo()
with the same signature.
http://en.cppreference.com/w/c/numeric/math/remquo
http://pubs.opengroup.org/onlinepubs/
9699919799/functions/remquo.html
Differential Revision: https://reviews.llvm.org/D39615
llvm-svn: 317407
George Rimar [Sat, 4 Nov 2017 09:11:27 +0000 (09:11 +0000)]
[ELF] - Stop using SectionKey for creating output sections.
Stop using SectionKey for creating output sections.
Initially SectionKey was designed because we merged section with
use of Flags and Alignment fields. Currently LLD merges them by name only,
except the case when -relocatable output is produced. In that case
we still merge sections only with the same flags and alignment.
There is probably no issue at all to stop using Flags and Alignment for -r and
just disable the merging in that case.
After doing that change we can get rid of using SectionKey. That is not only
simplifies the code, but also gives some perfomance boost.
I tried to link chrome and mozilla, results are next:
* chrome link time goes from 1,666750355s to 1,551585364s, that is about 7%.
* mozilla time changes from 3,
210261947 to 3,
153782940, or about 2%.
Differential revision: https://reviews.llvm.org/D39594
llvm-svn: 317406
George Rimar [Sat, 4 Nov 2017 08:20:30 +0000 (08:20 +0000)]
[ELF] - Fix error reporting with --strip-debug/--strip-all.
Currently LLD tries to use information about functions and variables location
taking it from debug sections. When --strip-* is given we discard such sections
and that breaks error reporting.
Patch stops discarding such sections and just removes them from InputSections list.
Differential revision: https://reviews.llvm.org/D39550
llvm-svn: 317405
NAKAMURA Takumi [Sat, 4 Nov 2017 06:55:55 +0000 (06:55 +0000)]
llvm/test/lit.cfg.py: Don't set the feature "llvm-64-bits" if -m32 is specified.
FIXME: LLVM_BUILD_32_BITS should modify host_triple.
llvm-svn: 317404
Craig Topper [Sat, 4 Nov 2017 06:44:47 +0000 (06:44 +0000)]
[X86] Teach shuffle lowering to use 256-bit SHUF128 when possible.
This allows masked operations to be used and allows the register allocator to use YMM16-31 if necessary.
As a follow up I'll look into teaching EVEX->VEX how to turn this back into PERM2X128 if any of the additional features don't work out.
llvm-svn: 317403
NAKAMURA Takumi [Sat, 4 Nov 2017 06:03:29 +0000 (06:03 +0000)]
CMake: Let LLVM_BUILD_32_BITS aware of large file.
llvm-svn: 317402
NAKAMURA Takumi [Sat, 4 Nov 2017 06:00:11 +0000 (06:00 +0000)]
llvm/test/Object/archive-SYM64-write.test: Delete large temp files. They are 8GiB total.
llvm-svn: 317401
Martell Malone [Sat, 4 Nov 2017 02:15:49 +0000 (02:15 +0000)]
CodeGenCXX: no default dllimport storage for mingw
GNU frontends don't have options like /MT, /MD
This fixes a few link error regressions with libc++ and libc++abi
Reviewers: rnk, mstorsjo, compnerd
Differential Revision: https://reviews.llvm.org/D33620
llvm-svn: 317398
Martell Malone [Sat, 4 Nov 2017 02:07:59 +0000 (02:07 +0000)]
[Driver] MinGW: Remove custom linker detection
This is a re-apply of rL313082 which was reverted in rL313088
In rL289668 the ability to specify the default linker at compile time
was added but because the MinGW driver used custom detection we could
not take advantage of this new CMAKE flag CLANG_DEFAULT_LINKER.
rL289668 added no test cases and the mingw driver was either overlooked
or purposefully skipped because it has some custom linker tests
Removing them here because they are covered by the generic case.
Reviewers: rnk
Differntial Revision: https://reviews.llvm.org/D37727
llvm-svn: 317397
Petr Hosek [Sat, 4 Nov 2017 02:03:58 +0000 (02:03 +0000)]
[ELF] Support expressions with -defsym option
Fixes PR34948.
Differential Revision: https://reviews.llvm.org/D39511
llvm-svn: 317396
Sean Fertile [Sat, 4 Nov 2017 01:54:20 +0000 (01:54 +0000)]
Revert "[LTO][ThinLTO] Use the linker resolutions to mark global values ..."
Changes more tests then expected on one of the build bots.
reverting to investigate.
This reverts https://llvm.org/svn/llvm-project/llvm/trunk@317374
llvm-svn: 317395
Richard Trieu [Sat, 4 Nov 2017 01:20:50 +0000 (01:20 +0000)]
Update ODR hashing tests
Add a mix of postive and negative tests to check that wrong Decls won't be
flagged in the diagnostic. Split the check everything test and moved the
pieces closer to where the related tests are.
llvm-svn: 317394
Davide Italiano [Sat, 4 Nov 2017 00:44:01 +0000 (00:44 +0000)]
[CallSiteSplitting] clang-format my last commit. NFCI.
Thanks to Rui for pointing out.
llvm-svn: 317393
Rui Ueyama [Sat, 4 Nov 2017 00:31:04 +0000 (00:31 +0000)]
Rename Body -> Sym.
This patch is mechanically created by
sed -i -e s/Body/Sym/g lld/ELF/*.{cpp,h}
and clang-format-diff.
llvm-svn: 317392
Mehdi Amini [Sat, 4 Nov 2017 00:07:20 +0000 (00:07 +0000)]
Fix CMake definitions of tsan runtime to make it installed by "install-compiler-rt"
Summary: The PARENT_TARGET was correctly set under APPLE but not under linux.
Reviewers: kubamracek, samsonov
Subscribers: dberris, mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D39621
llvm-svn: 317391
Kostya Kortchinsky [Fri, 3 Nov 2017 23:48:25 +0000 (23:48 +0000)]
[scudo] Rearrange #include order
Summary:
To be compliant with https://llvm.org/docs/CodingStandards.html#include-style,
system headers have to come after local headers.
Reviewers: alekseyshl
Reviewed By: alekseyshl
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D39623
llvm-svn: 317390
Alex Shlyapnikov [Fri, 3 Nov 2017 23:31:00 +0000 (23:31 +0000)]
[Sanitizers] Call NanoTime() conditionally.
Summary:
Call NanoTime() in primary 64 bit allocator only when necessary,
otherwise the unwarranted syscall causes problems in sandbox environments.
ReleaseToOSIntervalMs() conditional allows them to turn the feature off
with allocator_release_to_os_interval_ms=-1 flag.
Reviewers: eugenis
Subscribers: kubamracek, llvm-commits
Differential Revision: https://reviews.llvm.org/D39624
llvm-svn: 317386
Davide Italiano [Fri, 3 Nov 2017 23:03:38 +0000 (23:03 +0000)]
[CallSiteSplitting] Silence GCC's -Wparentheses. NFCI.
llvm-svn: 317385
Rui Ueyama [Fri, 3 Nov 2017 22:49:02 +0000 (22:49 +0000)]
[COFF] Avoid "Body" as a local variable name.
Since SymbolBody is gone, "Body" is not a good variable name.
This patch renames or eliminates them.
llvm-svn: 317384
Rui Ueyama [Fri, 3 Nov 2017 22:48:47 +0000 (22:48 +0000)]
Rename replaceBody -> replaceSymbol.
llvm-svn: 317383
Craig Topper [Fri, 3 Nov 2017 22:48:13 +0000 (22:48 +0000)]
[X86] Give unary PERMI priority over SHUF128 in lowerV8I64VectorShuffle to make it possible to fold a load.
llvm-svn: 317382
Eugene Zelenko [Fri, 3 Nov 2017 22:35:27 +0000 (22:35 +0000)]
[Basic] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 317381
Zachary Turner [Fri, 3 Nov 2017 22:33:49 +0000 (22:33 +0000)]
Fix variable name.
A mechanical rename caused an illegal name conflict between
a variable and a type, which was picked up by GCC.
llvm-svn: 317380
David Blaikie [Fri, 3 Nov 2017 22:32:11 +0000 (22:32 +0000)]
Move TargetFrameLowering.h to CodeGen where it's implemented
This header already includes a CodeGen header and is implemented in
lib/CodeGen, so move the header there to match.
This fixes a link error with modular codegeneration builds - where a
header and its implementation are circularly dependent and so need to be
in the same library, not split between two like this.
llvm-svn: 317379
Bob Haarman [Fri, 3 Nov 2017 22:23:19 +0000 (22:23 +0000)]
Revert "[ELF] - Teach LLD to use information from .debug_str for error reporting."
This reverts commit
00b7acb8f6c8a4663bb7c8396d217c210209b562.
It was causing some links to execute llvm_unreachable.
llvm-svn: 317378
Pavel Labath [Fri, 3 Nov 2017 22:12:50 +0000 (22:12 +0000)]
Remove ProcessGdbRemote::m_flags
The member is completely unused. Discussed on lldb-dev.
llvm-svn: 317377
Martin Storsjo [Fri, 3 Nov 2017 22:10:37 +0000 (22:10 +0000)]
[MinGW] Output debug info by default, unless the -s parameter is passed
Differential Revision: https://reviews.llvm.org/D39541
llvm-svn: 317376
Adrian Prantl [Fri, 3 Nov 2017 21:55:03 +0000 (21:55 +0000)]
Invoke salvageDebugInfo from CodeGenPrepare's SinkCast()
This preserves the debug info for the cast operation in the original location.
rdar://problem/
33460652
Reapplied r317340 with the test moved into an ARM-specific directory.
llvm-svn: 317375
Sean Fertile [Fri, 3 Nov 2017 21:45:55 +0000 (21:45 +0000)]
[LTO][ThinLTO] Use the linker resolutions to mark global values as dso_local.
Now that we have a way to mark GlobalValues as local we can use the symbol
resolutions that the linker plugin provides as part of lto/thinlto link
step to refine the compilers view on what symbols will end up being local.
Differential Revision: https://reviews.llvm.org/D35702
llvm-svn: 317374
Kevin Enderby [Fri, 3 Nov 2017 21:32:44 +0000 (21:32 +0000)]
Fix a crash in llvm-objdump when printing a bad x86_64 relocation in a Mach-O
file with a bad section number.
rdar://
35207539
llvm-svn: 317373
Alex Lorenz [Fri, 3 Nov 2017 21:31:10 +0000 (21:31 +0000)]
Add -fcxx-exceptions for ExtractionSemicolonPolicy.cpp to appease PS4 bots
llvm-svn: 317372
Peter Collingbourne [Fri, 3 Nov 2017 21:30:06 +0000 (21:30 +0000)]
Revert r317046, "Object: Move some code from ELF.h into ELF.cpp."
This change resulted in a measured 1.5-2% perf regression linking
chrome.
llvm-svn: 317371
Rui Ueyama [Fri, 3 Nov 2017 21:21:47 +0000 (21:21 +0000)]
Rename SymbolBody -> Symbol
Now that we have only SymbolBody as the symbol class. So, "SymbolBody"
is a bit strange name now. This is a mechanical change generated by
perl -i -pe s/SymbolBody/Symbol/g $(git grep -l SymbolBody lld/ELF lld/COFF)
nd clang-format-diff.
Differential Revision: https://reviews.llvm.org/D39459
llvm-svn: 317370
Kamil Rytarowski [Fri, 3 Nov 2017 21:08:52 +0000 (21:08 +0000)]
Late fixup in _lwp_exit on TSan/NetBSD
Call DestroyThreadState() before REAL(_lwp_exit)();
This variation is less racy.
Sponsored by <The NetBSD Foundation>
llvm-svn: 317369
Craig Topper [Fri, 3 Nov 2017 21:08:13 +0000 (21:08 +0000)]
[SimplifyCFG] When merging conditional stores, don't count the store we're merging against the PHINodeFoldingThreshold
Merging conditional stores tries to check to see if the code is if convertible after the store is moved. But the store hasn't been moved yet so its being counted against the threshold.
The patch adds 1 to the threshold comparison to make sure we don't count the store. I've adjusted a test to use a lower threshold to ensure we still do that conversion with the lower threshold.
Differential Revision: https://reviews.llvm.org/D39570
llvm-svn: 317368
Martin Storsjo [Fri, 3 Nov 2017 20:58:20 +0000 (20:58 +0000)]
[COFF] Autoexport symbols as data if they don't point to an executable section
This was already taken care of for the output def file.
Differential Revision: https://reviews.llvm.org/D39573
llvm-svn: 317367
David Blaikie [Fri, 3 Nov 2017 20:57:10 +0000 (20:57 +0000)]
GCOV: Move GCOV from IR & Support into ProfileData to fix layering
This class was split between libIR and libSupport, which breaks under
modular code generation. Move it into the one library that uses it,
ProfileData, to resolve this issue.
llvm-svn: 317366
David Blaikie [Fri, 3 Nov 2017 20:57:09 +0000 (20:57 +0000)]
llvm-objdump: Fix unused-lambda-capture warning by removing unused lambda capture
llvm-svn: 317365
Mitch Phillips [Fri, 3 Nov 2017 20:54:26 +0000 (20:54 +0000)]
[cfi-verify] Add blacklist parsing for result filtering.
Adds blacklist parsing behaviour for filtering results into four categories:
- Expected Protected: Things that are not in the blacklist and are protected.
- Unexpected Protected: Things that are in the blacklist and are protected.
- Expected Unprotected: Things that are in the blacklist and are unprotected.
- Unexpected Unprotected: Things that are not in the blacklist and are unprotected.
now can optionally be invoked with a second command line argument, which specifies the blacklist file that the binary was built with.
Current statistics for chromium:
Reviewers: vlad.tsyrklevich
Subscribers: mgorny, llvm-commits, pcc, kcc
Differential Revision: https://reviews.llvm.org/D39525
llvm-svn: 317364
Kamil Rytarowski [Fri, 3 Nov 2017 20:48:19 +0000 (20:48 +0000)]
Correct detection of a thread termination
Summary:
Stop using the Linux solution with pthread_key_create(3).
This approach does not work on NetBSD, because calling
the thread destructor is not the latest operation on a POSIX
thread entity. NetBSD's libpthread still calls at least
pthread_mutex_lock and pthread_mutex_unlock.
Detect _lwp_exit(2) call as it is really the latest operation
called from a detaching POSIX thread.
This resolves one set of crashes observed in
the Thread Sanitizer execution.
Sponsored by <The NetBSD Foundation>
Reviewers: joerg, kcc, vitalybuka, dvyukov, eugenis
Reviewed By: vitalybuka
Subscribers: llvm-commits, kubamracek, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D39618
llvm-svn: 317363
Jun Bum Lim [Fri, 3 Nov 2017 20:41:16 +0000 (20:41 +0000)]
Recommit r317351 : Add CallSiteSplitting pass
This recommit r317351 after fixing a buildbot failure.
Original commit message:
Summary:
This change add a pass which tries to split a call-site to pass
more constrained arguments if its argument is predicated in the control flow
so that we can expose better context to the later passes (e.g, inliner, jump
threading, or IPA-CP based function cloning, etc.).
As of now we support two cases :
1) If a call site is dominated by an OR condition and if any of its arguments
are predicated on this OR condition, try to split the condition with more
constrained arguments. For example, in the code below, we try to split the
call site since we can predicate the argument (ptr) based on the OR condition.
Split from :
if (!ptr || c)
callee(ptr);
to :
if (!ptr)
callee(null ptr) // set the known constant value
else if (c)
callee(nonnull ptr) // set non-null attribute in the argument
2) We can also split a call-site based on constant incoming values of a PHI
For example,
from :
BB0:
%c = icmp eq i32 %i1, %i2
br i1 %c, label %BB2, label %BB1
BB1:
br label %BB2
BB2:
%p = phi i32 [ 0, %BB0 ], [ 1, %BB1 ]
call void @bar(i32 %p)
to
BB0:
%c = icmp eq i32 %i1, %i2
br i1 %c, label %BB2-split0, label %BB1
BB1:
br label %BB2-split1
BB2-split0:
call void @bar(i32 0)
br label %BB2
BB2-split1:
call void @bar(i32 1)
br label %BB2
BB2:
%p = phi i32 [ 0, %BB2-split0 ], [ 1, %BB2-split1 ]
llvm-svn: 317362
Kamil Rytarowski [Fri, 3 Nov 2017 20:39:51 +0000 (20:39 +0000)]
Disable detection of on_exit()/TSan on NetBSD
Summary:
NetBSD does not ship with on_exit() function.
Introduce TSAN_MAYBE_INTERCEPT_ON_EXIT.
It looks like this addition fixes build for Darwin.
Sponsored by <The NetBSD Foundation>
Reviewers: vitalybuka, joerg, eugenis, dvyukov, kcc
Reviewed By: vitalybuka
Subscribers: llvm-commits, kubamracek, #sanitizers
Tags: #sanitizers
Differential Revision: https://reviews.llvm.org/D39617
llvm-svn: 317361
David Blaikie [Fri, 3 Nov 2017 20:24:19 +0000 (20:24 +0000)]
Modularize: Include some required headers
DenseMaps require the definition of a type to be available when using a
pointer to that type as a key to know how many bits are available for
tombstone/etc.
llvm-svn: 317360
Aaron Ballman [Fri, 3 Nov 2017 20:09:17 +0000 (20:09 +0000)]
Replace a use of std::for_each() with llvm::for_each(); NFC.
llvm-svn: 317359
Martin Storsjo [Fri, 3 Nov 2017 20:09:10 +0000 (20:09 +0000)]
[llvm-ar] Support an options string that start with a dash
Some projects call $AR like "$AR -crs output input1 input2".
Differential Revision: https://reviews.llvm.org/D39538
llvm-svn: 317358
Aaron Ballman [Fri, 3 Nov 2017 20:05:51 +0000 (20:05 +0000)]
Correcting some CRLFs that snuck in with my previous commit; NFC.
llvm-svn: 317357
Aaron Ballman [Fri, 3 Nov 2017 20:01:25 +0000 (20:01 +0000)]
Add llvm::for_each as a range-based extensions to <algorithm> and make use of it in some cases where it is a more clear alternative to std::for_each.
llvm-svn: 317356
Mitch Phillips [Fri, 3 Nov 2017 20:00:05 +0000 (20:00 +0000)]
[cfi-verify] Add an interesting unit test where undef search length changes result.
Add an interesting unit test, found by changing --search-length-undef from the default. Program handles it correctly but good for ensuring correctness on further changes :)
Reviewers: pcc
Subscribers: mgorny, llvm-commits, kcc, vlad.tsyrklevich
Differential Revision: https://reviews.llvm.org/D38658
llvm-svn: 317355
Craig Topper [Fri, 3 Nov 2017 19:37:41 +0000 (19:37 +0000)]
[X86] Promote athlon, athlon-xp, k8, and k8-sse3 to types instead of subtypes in getHostCPUName. NFCI
This removes the athlon type and simplifies the string decoding. We only really need these type/subtype breaks where we need to match libgcc/compiler-rt and these CPUs aren't part of that.
I'm looking into moving some of this information to a .def file to share with clang's __builtin_cpu_is handling. And while these CPUs aren't part of that the less lines I have to deal with in the .def file the better.
llvm-svn: 317354
Jun Bum Lim [Fri, 3 Nov 2017 19:17:11 +0000 (19:17 +0000)]
Revert "Add CallSiteSplitting pass"
Revert due to Buildbot failure.
This reverts commit r317351.
llvm-svn: 317353
Jake Ehrlich [Fri, 3 Nov 2017 19:15:06 +0000 (19:15 +0000)]
Reland "Add support for writing 64-bit symbol tables for archives when offsets become too large for 32-bit"
Tests were failing because some bots were running out of address
space and memory. Additionally the test was very slow. These issues
were solved by changing the test to take advantage of sparse filse and
restricting the test to run only on 64-bit systems.
This should fix https://bugs.llvm.org//show_bug.cgi?id=34189
This change makes it so that if writing a K_GNU style archive, you need
to output a > 32-bit offset it should output in K_GNU64 style instead.
Differential Revision: https://reviews.llvm.org/D36812
llvm-svn: 317352
Jun Bum Lim [Fri, 3 Nov 2017 19:01:57 +0000 (19:01 +0000)]
Add CallSiteSplitting pass
Summary:
This change add a pass which tries to split a call-site to pass
more constrained arguments if its argument is predicated in the control flow
so that we can expose better context to the later passes (e.g, inliner, jump
threading, or IPA-CP based function cloning, etc.).
As of now we support two cases :
1) If a call site is dominated by an OR condition and if any of its arguments
are predicated on this OR condition, try to split the condition with more
constrained arguments. For example, in the code below, we try to split the
call site since we can predicate the argument (ptr) based on the OR condition.
Split from :
if (!ptr || c)
callee(ptr);
to :
if (!ptr)
callee(null ptr) // set the known constant value
else if (c)
callee(nonnull ptr) // set non-null attribute in the argument
2) We can also split a call-site based on constant incoming values of a PHI
For example,
from :
BB0:
%c = icmp eq i32 %i1, %i2
br i1 %c, label %BB2, label %BB1
BB1:
br label %BB2
BB2:
%p = phi i32 [ 0, %BB0 ], [ 1, %BB1 ]
call void @bar(i32 %p)
to
BB0:
%c = icmp eq i32 %i1, %i2
br i1 %c, label %BB2-split0, label %BB1
BB1:
br label %BB2-split1
BB2-split0:
call void @bar(i32 0)
br label %BB2
BB2-split1:
call void @bar(i32 1)
br label %BB2
BB2:
%p = phi i32 [ 0, %BB2-split0 ], [ 1, %BB2-split1 ]
Reviewers: davidxl, huntergr, chandlerc, mcrosier, eraman, davide
Reviewed By: davidxl
Subscribers: sdesmalen, ashutosh.nema, fhahn, mssimpso, aemerson, mgorny, mehdi_amini, kristof.beyls, llvm-commits
Differential Revision: https://reviews.llvm.org/D39137
llvm-svn: 317351
Jake Ehrlich [Fri, 3 Nov 2017 18:58:41 +0000 (18:58 +0000)]
[llvm-objcopy] Add support for dwarf fission
This change adds support for dwarf fission.
Differential Revision: https://reviews.llvm.org/D39207
llvm-svn: 317350
Evandro Menezes [Fri, 3 Nov 2017 18:56:36 +0000 (18:56 +0000)]
[AArch64] Fix the number of iterations for the Newton series
The number of iterations was incorrectly determined for DP FP vector types
and the tests were insufficient to flag this issue.
Differential revision: https://reviews.llvm.org/D39507
llvm-svn: 317349
Evgeny Stupachenko [Fri, 3 Nov 2017 18:50:03 +0000 (18:50 +0000)]
The patch fixes PR35131
Summary:
Fix a misprint which led to false CTLZ recognition.
Reviewers: craig.topper
Differential Revision: https://reviews.llvm.org/D39585
From: Evgeny Stupachenko <evstupac@gmail.com>
llvm-svn: 317348
Jonas Hahnfeld [Fri, 3 Nov 2017 18:28:25 +0000 (18:28 +0000)]
Revert "Rename fields of ompt_frame_t"
This reverts commit r317338 which discarded some recent commits.
llvm-svn: 317347
Jonas Hahnfeld [Fri, 3 Nov 2017 18:28:19 +0000 (18:28 +0000)]
Revert "Updating implementation of OMPT as specified in OpenMP 5.0 Preview 2 (TR6)"
This reverts commit r317339 which discarded some recent commits.
llvm-svn: 317346
Adrian Prantl [Fri, 3 Nov 2017 18:26:36 +0000 (18:26 +0000)]
Revert "Invoke salvageDebugInfo from CodeGenPrepare's SinkCast()"
This reverts commit 317342 while investigating bot breakage.
llvm-svn: 317345
Alex Lorenz [Fri, 3 Nov 2017 18:21:06 +0000 (18:21 +0000)]
Move Extract.cpp that wasn't moved in r317343
llvm-svn: 317344
Alex Lorenz [Fri, 3 Nov 2017 18:11:22 +0000 (18:11 +0000)]
[refactor][extract] insert semicolons into extracted/inserted code
when needed
This commit implements the semicolon insertion logic into the extract
refactoring. The following rules are used:
- extracting expression: add terminating ';' to the extracted function.
- extracting statements that don't require terminating ';' (e.g. switch): add
terminating ';' to the callee.
- extracting statements with ';': move (if possible) the original ';' from the
callee and add terminating ';'.
- otherwise, add ';' to both places.
Differential Revision: https://reviews.llvm.org/D39441
llvm-svn: 317343
Craig Topper [Fri, 3 Nov 2017 18:02:46 +0000 (18:02 +0000)]
[CodeGen] Remove unnecessary semicolons to fix a warning. NFC
llvm-svn: 317342
Craig Topper [Fri, 3 Nov 2017 18:02:44 +0000 (18:02 +0000)]
[X86] Initialize Type and Subtype in getHostCPUName to 0.
llvm-svn: 317341
Adrian Prantl [Fri, 3 Nov 2017 18:00:02 +0000 (18:00 +0000)]
Invoke salvageDebugInfo from CodeGenPrepare's SinkCast()
This preserves the debug info for the cast operation in the original location.
rdar://problem/
33460652
llvm-svn: 317340
Joachim Protze [Fri, 3 Nov 2017 17:09:00 +0000 (17:09 +0000)]
Updating implementation of OMPT as specified in OpenMP 5.0 Preview 2 (TR6)
The TR6 document is expected to be publically released around November 15.
This patch does not implement OMPT for libomptarget.
Patch by Simon Convent and Joachim Protze
Differential Revision: https://reviews.llvm.org/D39182
llvm-svn: 317339
Joachim Protze [Fri, 3 Nov 2017 17:08:40 +0000 (17:08 +0000)]
Rename fields of ompt_frame_t
This is part of the renaming of data types from OpenMP TR4 to TR6
Patch by Simon Convent
Differential Revision: https://reviews.llvm.org/D39326
llvm-svn: 317338
Kostya Kortchinsky [Fri, 3 Nov 2017 17:04:13 +0000 (17:04 +0000)]
[Driver] Add Scudo as a possible -fsanitize= option
Summary:
This change adds Scudo as a possible Sanitizer option via -fsanitize=.
This allows for easier static & shared linking of the Scudo library, it allows
us to enforce PIE (otherwise the security of the allocator is moot), and check
for incompatible Sanitizers combo.
In its current form, Scudo is not compatible with any other Sanitizer, but the
plan is to make it work in conjunction with UBsan (-fsanitize=scudo,undefined),
which will require additional work outside of the scope of this change.
Reviewers: eugenis, kcc, alekseyshl
Reviewed By: eugenis, alekseyshl
Subscribers: llvm-commits, srhines
Differential Revision: https://reviews.llvm.org/D39334
llvm-svn: 317337
Sanjay Patel [Fri, 3 Nov 2017 16:27:27 +0000 (16:27 +0000)]
[CodeGen] add libcall attr tests to show errno-related diffs; NFC
See rL317220 for the builtin siblings.
llvm-svn: 317336
Jun Bum Lim [Fri, 3 Nov 2017 16:24:53 +0000 (16:24 +0000)]
[LICM] sink through non-trivially replicable PHI
Summary:
The current LICM allows sinking an instruction only when it is exposed to exit
blocks through a trivially replacable PHI of which all incoming values are the
same instruction. This change enhance LICM to sink a sinkable instruction
through non-trivially replacable PHIs by spliting predecessors of loop
exits.
Reviewers: hfinkel, majnemer, davidxl, bmakam, mcrosier, danielcdh, efriedma, jtony
Reviewed By: efriedma
Subscribers: nemanjai, dberlin, llvm-commits
Differential Revision: https://reviews.llvm.org/D37163
llvm-svn: 317335
Alexey Bataev [Fri, 3 Nov 2017 16:17:13 +0000 (16:17 +0000)]
[SLP] Test for PR23510, NFC.
llvm-svn: 317334
Eric Liu [Fri, 3 Nov 2017 16:03:56 +0000 (16:03 +0000)]
Use ToolExecutor framework in the sample tool-template.
llvm-svn: 317333
Eric Liu [Fri, 3 Nov 2017 15:57:27 +0000 (15:57 +0000)]
[Tooling] Fix linking of StandaloneToolExecutorPlugin.
llvm-svn: 317332
Simon Dardis [Fri, 3 Nov 2017 15:35:13 +0000 (15:35 +0000)]
[mips] Match 'ins' and its' variants with C++ code
Change the ISel matching of 'ins', 'dins[mu]' from tablegen code to
C++ code. This resolves an issue where ISel would select 'dins' instead
of 'dinsm' when the instructions size and position were individually in
range but their sum was out of range according to the ISA specification.
Reviewers: atanasyan
Differential Revision: https://reviews.llvm.org/D39117
llvm-svn: 317331
Andrew V. Tischenko [Fri, 3 Nov 2017 15:25:13 +0000 (15:25 +0000)]
Fix for Bug 34475 - LOCK/REP/REPNE prefixes emitted as instruction on their own.
Differential Revision: https://reviews.llvm.org/D39546
llvm-svn: 317330
Pavel Labath [Fri, 3 Nov 2017 15:22:36 +0000 (15:22 +0000)]
Add float/vector registers for ppc64le
Summary: Add read and write functions for VSX, VMX and float registers and fix watchpoint size
Reviewers: clayborg
Reviewed By: clayborg
Subscribers: eugene, labath, clayborg, nemanjai, kbarton, JDevlieghere, anajuliapc, gut, lbianc, lldb-commits
Differential Revision: https://reviews.llvm.org/D39487
Patch by: Alexandre Yukio Yamashita <alexandre.yamashita@eldorado.org.br>
llvm-svn: 317329
Eric Liu [Fri, 3 Nov 2017 15:20:57 +0000 (15:20 +0000)]
[Tooling] Put createExecutorFromCommandLineArgs implementation in a wrapper. NFC
llvm-svn: 317328
Don Hinton [Fri, 3 Nov 2017 14:59:36 +0000 (14:59 +0000)]
Add type to FileSpec::PathSyntax enum.
Summary:
Add type to FileSpec::PathSyntax enum to decrease size for
FileSpec on systems with 32 bit pointers.
Thanks to @zturner for pointing this out.
Differential Revision: https://reviews.llvm.org/D39574
llvm-svn: 317327
Pavel Labath [Fri, 3 Nov 2017 14:42:37 +0000 (14:42 +0000)]
Xfail test_stack_info_in_minidump test
The test has been failing since we enabled the i386 ABI plugin on
windows. See pr35193 for details.
llvm-svn: 317326
Krasimir Georgiev [Fri, 3 Nov 2017 14:38:07 +0000 (14:38 +0000)]
[clang-format] Sort using-declarations case sensitively with a special case for '_'
Summary:
This makes clang-format sort using declarations case-sensitive with the
exception that '_' comes just before 'A'. This is better than the current case
insensitive version, because it groups uppercase names in the same namespace
together.
Reviewers: bkramer
Reviewed By: bkramer
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D39549
llvm-svn: 317325
Anna Thomas [Fri, 3 Nov 2017 14:25:39 +0000 (14:25 +0000)]
[LoopPredication] NFC: Refactored code to separate out functions being reused
Summary:
Refactored the code to separate out common functions that are being
reused.
This is to reduce the changes for changes coming up wrt loop
predication with reverse loops.
This refactoring is what we have in our downstream code.
llvm-svn: 317324