Commit Graph

275547 Commits

Author SHA1 Message Date
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
Kamil Rytarowski 99a91f6744 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
2017-11-03 20:39:51 +00:00
David Blaikie 526f30b8aa 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
2017-11-03 20:24:19 +00:00
Aaron Ballman 72f6563bb3 Replace a use of std::for_each() with llvm::for_each(); NFC.
llvm-svn: 317359
2017-11-03 20:09:17 +00:00
Martin Storsjo 1a9593b251 [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
2017-11-03 20:09:10 +00:00
Aaron Ballman 639ea374d6 Correcting some CRLFs that snuck in with my previous commit; NFC.
llvm-svn: 317357
2017-11-03 20:05:51 +00:00
Aaron Ballman ecf0e95267 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
2017-11-03 20:01:25 +00:00
Mitch Phillips 189ebb6976 [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
2017-11-03 20:00:05 +00:00
Craig Topper 8b6600363a [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
2017-11-03 19:37:41 +00:00
Jun Bum Lim 0eb1c2d63a Revert "Add CallSiteSplitting pass"
Revert due to Buildbot failure.

This reverts commit r317351.

llvm-svn: 317353
2017-11-03 19:17:11 +00:00
Jake Ehrlich c3a89eefd6 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
2017-11-03 19:15:06 +00:00
Jun Bum Lim 2a58933519 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
2017-11-03 19:01:57 +00:00
Jake Ehrlich 5de70d996c [llvm-objcopy] Add support for dwarf fission
This change adds support for dwarf fission.

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

llvm-svn: 317350
2017-11-03 18:58:41 +00:00
Evandro Menezes 9dcf099944 [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
2017-11-03 18:56:36 +00:00
Evgeny Stupachenko d699de2b50 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
2017-11-03 18:50:03 +00:00
Jonas Hahnfeld b71424fda5 Revert "Rename fields of ompt_frame_t"
This reverts commit r317338 which discarded some recent commits.

llvm-svn: 317347
2017-11-03 18:28:25 +00:00
Jonas Hahnfeld f0a1c65fb0 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
2017-11-03 18:28:19 +00:00
Adrian Prantl 8fe9fb0ae5 Revert "Invoke salvageDebugInfo from CodeGenPrepare's SinkCast()"
This reverts commit 317342 while investigating bot breakage.

llvm-svn: 317345
2017-11-03 18:26:36 +00:00