Commit Graph

275514 Commits

Author SHA1 Message Date
Aaron Ballman a5ee69a010 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
2017-11-04 19:59:14 +00:00
Aaron Ballman 207751ade7 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
2017-11-04 19:48:17 +00:00
Aaron Ballman cecf7145e9 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
2017-11-04 19:39:14 +00:00
Craig Topper 692c8efe30 [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
2017-11-04 18:26:41 +00:00
Craig Topper be1f219050 [X86] Regenerate a couple more tests that I missed in r317410.
llvm-svn: 317412
2017-11-04 18:26:39 +00:00
Tamas Berghammer 7cb7df2bbf 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
2017-11-04 18:25:51 +00:00
Craig Topper e5d44cefea [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
2017-11-04 18:10:03 +00:00
Yaxun Liu 0d9673cff2 [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
2017-11-04 17:37:43 +00:00
Sean Fertile 4595a915f6 [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
2017-11-04 17:04:39 +00:00
Sanjay Patel c919758075 [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
2017-11-04 15:03:11 +00:00
George Rimar 343e8227b7 [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
2017-11-04 09:11:27 +00:00
George Rimar ddd2424929 [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
2017-11-04 08:20:30 +00:00
NAKAMURA Takumi 448a3e5785 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
2017-11-04 06:55:55 +00:00
Craig Topper a96d62b360 [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
2017-11-04 06:44:47 +00:00
NAKAMURA Takumi 965429ee52 CMake: Let LLVM_BUILD_32_BITS aware of large file.
llvm-svn: 317402
2017-11-04 06:03:29 +00:00
NAKAMURA Takumi 1ac3ae743d llvm/test/Object/archive-SYM64-write.test: Delete large temp files. They are 8GiB total.
llvm-svn: 317401
2017-11-04 06:00:11 +00:00
Martell Malone b22e600484 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
2017-11-04 02:15:49 +00:00
Martell Malone db5b34ce30 [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
2017-11-04 02:07:59 +00:00
Petr Hosek 8c7e8cce99 [ELF] Support expressions with -defsym option
Fixes PR34948.

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

llvm-svn: 317396
2017-11-04 02:03:58 +00:00
Sean Fertile 39770ca0a1 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
2017-11-04 01:54:20 +00:00
Richard Trieu 73cf924104 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
2017-11-04 01:20:50 +00:00
Davide Italiano c7c05ae4be [CallSiteSplitting] clang-format my last commit. NFCI.
Thanks to Rui for pointing out.

llvm-svn: 317393
2017-11-04 00:44:01 +00:00
Rui Ueyama 48882249dd 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
2017-11-04 00:31:04 +00:00
Mehdi Amini a2a539e4c5 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
2017-11-04 00:07:20 +00:00
Kostya Kortchinsky 4a0ebbfe97 [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
2017-11-03 23:48:25 +00:00
Alex Shlyapnikov 32224fe842 [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
2017-11-03 23:31:00 +00:00
Davide Italiano 91b4790b33 [CallSiteSplitting] Silence GCC's -Wparentheses. NFCI.
llvm-svn: 317385
2017-11-03 23:03:38 +00:00
Rui Ueyama 7782abe5e6 [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
2017-11-03 22:49:02 +00:00
Rui Ueyama f483da0038 Rename replaceBody -> replaceSymbol.
llvm-svn: 317383
2017-11-03 22:48:47 +00:00
Craig Topper d21a53f246 [X86] Give unary PERMI priority over SHUF128 in lowerV8I64VectorShuffle to make it possible to fold a load.
llvm-svn: 317382
2017-11-03 22:48:13 +00:00
Eugene Zelenko 918e0ca77a [Basic] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
llvm-svn: 317381
2017-11-03 22:35:27 +00:00
Zachary Turner a104d558d0 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
2017-11-03 22:33:49 +00:00
David Blaikie 1be62f0327 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
2017-11-03 22:32:11 +00:00
Bob Haarman 3fae5a6179 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
2017-11-03 22:23:19 +00:00
Pavel Labath a964012cd2 Remove ProcessGdbRemote::m_flags
The member is completely unused. Discussed on lldb-dev.

llvm-svn: 317377
2017-11-03 22:12:50 +00:00
Martin Storsjo 068512dfb9 [MinGW] Output debug info by default, unless the -s parameter is passed
Differential Revision: https://reviews.llvm.org/D39541

llvm-svn: 317376
2017-11-03 22:10:37 +00:00
Adrian Prantl 261ac8b23c 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
2017-11-03 21:55:03 +00:00
Sean Fertile 36528c2a9b [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
2017-11-03 21:45:55 +00:00
Kevin Enderby 3fc9188fa8 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
2017-11-03 21:32:44 +00:00
Alex Lorenz 3cee7cfb30 Add -fcxx-exceptions for ExtractionSemicolonPolicy.cpp to appease PS4 bots
llvm-svn: 317372
2017-11-03 21:31:10 +00:00
Peter Collingbourne c2935db629 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
2017-11-03 21:30:06 +00:00
Rui Ueyama f52496e1e0 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
2017-11-03 21:21:47 +00:00
Kamil Rytarowski e6b53dad42 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
2017-11-03 21:08:52 +00:00
Craig Topper 12463779d3 [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
2017-11-03 21:08:13 +00:00
Martin Storsjo dc95dbfcab [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
2017-11-03 20:58:20 +00:00
David Blaikie 34eb96b03f 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
2017-11-03 20:57:10 +00:00
David Blaikie 998ff81f7c llvm-objdump: Fix unused-lambda-capture warning by removing unused lambda capture
llvm-svn: 317365
2017-11-03 20:57:09 +00:00
Mitch Phillips c15bdf5598 [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
2017-11-03 20:54:26 +00:00
Kamil Rytarowski 55435b7427 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
2017-11-03 20:48:19 +00:00
Jun Bum Lim 0c99007db1 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
2017-11-03 20:41:16 +00:00