Commit Graph

311007 Commits

Author SHA1 Message Date
Jonathan Peyton e47d32f165 [OpenMP] Make use of sched_yield optional in runtime
This patch cleans up the yielding code and makes it optional. An
environment variable, KMP_USE_YIELD, was added. Yielding is still
on by default (KMP_USE_YIELD=1), but can be turned off completely
(KMP_USE_YIELD=0), or turned on only when oversubscription is detected
(KMP_USE_YIELD=2). Note that oversubscription cannot always be detected
by the runtime (for example, when the runtime is initialized and the
process forks, oversubscription cannot be detected currently over
multiple instances of the runtime).

Because yielding can be controlled by user now, the library mode
settings (from KMP_LIBRARY) for throughput and turnaround have been
adjusted by altering blocktime, unless that was also explicitly set.

In the original code, there were a number of places where a double yield
might have been done under oversubscription. This version checks
oversubscription and if that's not going to yield, then it does
the spin check.

Patch by Terry Wilmarth

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

llvm-svn: 355120
2019-02-28 19:11:29 +00:00
Rong Xu 23452e1c85 [PGO] Update InstrProfData.inc to sync with llvm
llvm-svn: 355119
2019-02-28 19:06:02 +00:00
Sanjay Patel 4a47f5f550 [InstCombine] fold adds of constants separated by sext/zext
This is part of a transform that may be done in the backend:
D13757
...but it should always be beneficial to fold this sooner in IR
for all targets.

https://rise4fun.com/Alive/vaiW

  Name: sext add nsw
  %add = add nsw i8 %i, C0
  %ext = sext i8 %add to i32
  %r = add i32 %ext, C1
  =>
  %s = sext i8 %i to i32
  %r = add i32 %s, sext(C0)+C1

  Name: zext add nuw
  %add = add nuw i8 %i, C0
  %ext = zext i8 %add to i16
  %r = add i16 %ext, C1
  =>
  %s = zext i8 %i to i16
  %r = add i16 %s, zext(C0)+C1

llvm-svn: 355118
2019-02-28 19:05:26 +00:00
Craig Topper 8b1703fc1d [X86] Add test case that was supposed to go with r355116.
llvm-svn: 355117
2019-02-28 18:50:16 +00:00
Craig Topper 38427c47b9 [X86] Don't peek through bitcasts before checking ISD::isBuildVectorOfConstantSDNodes in combineTruncatedArithmetic
We don't have any combines that can look through a bitcast to truncate a build vector of constants. So the truncate will stick around and give us something like this pattern (binop (trunc X), (trunc (bitcast (build_vector)))) which has two truncates in it. Which will be reversed by hoistLogicOpWithSameOpcodeHands in the generic DAG combiner. Thus causing an infinite loop.

Even if we had a combine for (truncate (bitcast (build_vector))), I think it would need to be implemented in getNode otherwise DAG combiner visit ordering would probably still visit the binop first and reverse it. Or combineTruncatedArithmetic would need to do its own constant folding.

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

llvm-svn: 355116
2019-02-28 18:49:29 +00:00
Amara Emerson 8d70e6425c Revert "[AArch64][GlobalISel] Add support for 64 bit vector shuffle using TBL1."
Seems to break some neon intrinsics tests.

llvm-svn: 355115
2019-02-28 18:47:29 +00:00
Jonas Devlieghere f9b0b9a504 [dsymutil] Use rfind for paths with parentheses
Dsymutil gets library member information is through the ambiguous
/path/to/archive.a(member.o). The current logic we use would get
confused by additional parentheses. Using rfind mitigates this issue.

llvm-svn: 355114
2019-02-28 18:46:04 +00:00
Julian Lettner ce65261fae [NFC][Sanitizer] Weak linkage is not available on Windows
The concept of weak linkage is not available on Windows. The available
workarounds in LLVM/sanitizer runtimes have their own problems. Define a
separte symbol ubsan_GetStackTrace to work around the issue now. At lest
this way it is painfully obvious that we still have to do more cleanup.

Follow-up to revision: https://reviews.llvm.org/D58651

llvm-svn: 355113
2019-02-28 18:42:14 +00:00
Thomas Lively f3b4f99007 [WebAssembly] Remove uses of ThreadModel
Summary:
In the clang UI, replaces -mthread-model posix with -matomics as the
source of truth on threading. In the backend, replaces
-thread-model=posix with the atomics target feature, which is now
collected on the WebAssemblyTargetMachine along with all other used
features. These collected features will also be used to emit the
target features section in the future.

The default configuration for the backend is thread-model=posix and no
atomics, which was previously an invalid configuration. This change
makes the default valid because the thread model is ignored.

A side effect of this change is that objects are never emitted with
passive segments. It will instead be up to the linker to decide
whether sections should be active or passive based on whether atomics
are used in the final link.

Reviewers: aheejin, sbc100, dschuff

Subscribers: mehdi_amini, jgravelle-google, hiraditya, sunfish, steven_wu, dexonsmith, rupprecht, jfb, jdoerfert, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

llvm-svn: 355112
2019-02-28 18:39:08 +00:00
Philip Reames 9915b1fa4a [Tests] Strengthen LICM test corpus to show alignment striping. (part 2)
This should have been part of r355110, but my brain isn't quite awake yet, despite the coffee.  Per the original submit comment... Doing scalar promotion w/o being able to prove the alignment of the hoisted load or sunk store is a bug.  Update tests to actually show the alignment so that impact of the patch which fixes this can be seen.

llvm-svn: 355111
2019-02-28 18:17:51 +00:00
Philip Reames 63a67527a4 [Tests] Strengthen LICM test corpus to show alignment striping
Doing scalar promotion w/o being able to prove the alignment of the hoisted load or sunk store is a bug.  Update tests to actually show the alignment so that impact of the patch which fixes this can be seen.

llvm-svn: 355110
2019-02-28 18:08:04 +00:00
Nikita Popov af2b0bef43 [ValueTracking] More accurate unsigned sub overflow detection
Second part of D58593.

Compute precise overflow conditions based on all known bits, rather
than just the sign bits. Unsigned a - b overflows iff a < b, and we
can determine whether this always/never happens based on the minimal
and maximal values achievable for a and b subject to the known bits
constraint.

llvm-svn: 355109
2019-02-28 18:04:20 +00:00
Jonas Toth ab10947b34 [clang-tidy] fix documentation link in list of clang-tidy checks
llvm-svn: 355108
2019-02-28 17:53:51 +00:00
Tom Stellard d20073f47b llvm-config: Include -stdlib= in --cxxflags
Summary:
This was removed in r349068, but it is needed when llvm is compiled
using the non-default c++ standard library on a platform.

Reviewers: sylvestre.ledru, infinity0, mgorny, cuviper

Reviewed By: sylvestre.ledru

Subscribers: jdoerfert, llvm-commits

Tags: #llvm

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

llvm-svn: 355107
2019-02-28 17:31:59 +00:00
Yaxun Liu fd2c5c05fc Partial revert of r353952: [HIP] Handle compile -m options and propagate into LLC
Remove comments and tests about passing -mcode-object-v3 to driver since it does
not work. Other -m options are OK.

Also put back -mattr=-code-object-v3 since HIP is still not ready for code object
v3.

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

llvm-svn: 355106
2019-02-28 17:08:26 +00:00
Chijun Sima 586187639a Make MergeBlockIntoPredecessor conformant to the precondition of calling DTU.applyUpdates
Summary:
It is mentioned in the document of DTU that "It is illegal to submit any update that has already been submitted, i.e., you are supposed not to insert an existent edge or delete a nonexistent edge." It is dangerous to violet this rule because DomTree and PostDomTree occasionally crash on this scenario.

This patch fixes `MergeBlockIntoPredecessor`, making it conformant to this precondition.

Reviewers: kuhar, brzycki, chandlerc

Reviewed By: brzycki

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 355105
2019-02-28 16:47:18 +00:00
Amara Emerson 85c3afd7f6 [AArch64][GlobalISel] Add support for 64 bit vector shuffle using TBL1.
This extends the existing support for shufflevector to handle cases like
<2 x float>, which we can implement by concating the vectors and using a TBL1.

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

llvm-svn: 355104
2019-02-28 16:43:11 +00:00
Pavel Labath 5d4d168c3c [cmake] Move LLDB_DISABLE_LIBEDIT handling code into a central place
This was previously scattered between the main CMakeLists.txt file and
LLDBGenerateConfig.cmake and LLDBConfig.cmake. This caused the some of
the code to be executed in incorrect order. Specifically, the check for
el_winsertstr was done before libedit_LIBRARIES was computed, and so it
always failed on the first run.

Moving it the two checks to a central place makes sure this doesn't
happen again and improves the overall readability.

llvm-svn: 355103
2019-02-28 16:04:54 +00:00
Jonas Toth 5fbeff797a [clang-tidy] redirection in list of checks adjusted
llvm-svn: 355102
2019-02-28 15:56:40 +00:00
Kadir Cetinkaya 1b1b1a6135 [Target][ARM] Add a usage for SrcSz to unbreak build-bots without assertions
llvm-svn: 355101
2019-02-28 15:55:11 +00:00
Jonas Toth ed571d77d2 [clang-tidy] include cppcoreguidelines-explicit-virtual-functions in list of checks and fix redirection
llvm-svn: 355100
2019-02-28 15:47:10 +00:00
Bjorn Pettersson d30f308a9f Add support for computing "zext of value" in KnownBits. NFCI
Summary:
The description of KnownBits::zext() and
KnownBits::zextOrTrunc() has confusingly been telling
that the operation is equivalent to zero extending the
value we're tracking. That has not been true, instead
the user has been forced to explicitly set the extended
bits as known zero afterwards.

This patch adds a second argument to KnownBits::zext()
and KnownBits::zextOrTrunc() to control if the extended
bits should be considered as known zero or as unknown.

Reviewers: craig.topper, RKSimon

Reviewed By: RKSimon

Subscribers: javed.absar, hiraditya, jdoerfert, llvm-commits

Tags: #llvm

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

llvm-svn: 355099
2019-02-28 15:45:29 +00:00
Jonas Toth 3a24cb00eb [clang-tidy] documentation fixing the actual correct file
llvm-svn: 355098
2019-02-28 15:39:47 +00:00
Jonas Toth eae176f142 [clang-tidy] tryfix documenation continued
llvm-svn: 355097
2019-02-28 15:28:36 +00:00
Gabor Marton a006b80a74 [CTU] Do not allow different CPP dialects in CTU
Summary:
If CPP dialects are different then return with error.

Consider this STL code:
  template<typename _Alloc>
    struct __alloc_traits
  #if __cplusplus >= 201103L
    : std::allocator_traits<_Alloc>
  #endif
    { // ...
    };
This class template would create ODR errors during merging the two units,
since in one translation unit the class template has a base class, however
in the other unit it has none.

Reviewers: xazax.hun, a_sidorin, r.stahl

Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, cfe-commits

Tags: #clang

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

llvm-svn: 355096
2019-02-28 15:24:59 +00:00
Jonas Toth df58719979 [clang-tidy] another issue in documentation, double empty line seemed to confuse code-block
llvm-svn: 355095
2019-02-28 15:18:54 +00:00
Jonas Toth 0023b130cf [clang-tidy] attempt to fix documentation build-error
llvm-svn: 355094
2019-02-28 15:01:17 +00:00
Jonas Toth da666233fe [clang-tidy] added cppcoreguidelines-explicit-virtual-functions
Addresses the bugzilla bug #30397. (https://bugs.llvm.org/show_bug.cgi?id=30397)
modernize-use-override suggests that destructors require the override specifier
and the CPP core guidelines do not recommend this.

Patch by lewmpk.

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

llvm-svn: 355093
2019-02-28 14:55:12 +00:00
Dmitri Gribenko 2098b86b96 Added missing license headers
Reviewers: ioeric

Subscribers: jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

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

llvm-svn: 355092
2019-02-28 14:01:11 +00:00
Dmitri Gribenko 7344188b72 Use ArrayRef::copy, instead of copying data manually
Reviewers: ioeric

Subscribers: jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

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

llvm-svn: 355091
2019-02-28 14:00:26 +00:00
Dmitri Gribenko cb83ea6274 Moved Ref into its own header and implementation file
Reviewers: ioeric

Subscribers: mgorny, jkorous, mgrang, arphaman, kadircet, cfe-commits

Tags: #clang

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

llvm-svn: 355090
2019-02-28 13:49:25 +00:00
Clement Courbet 58724a61ac [clang-tidy] bugprone-string-integer-assignment: Reduce false positives.
Summary: Detect a few expressions as likely character expressions, see PR27723.

Reviewers: xazax.hun, alexfh

Subscribers: rnkovacs, jdoerfert, cfe-commits

Tags: #clang

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

llvm-svn: 355089
2019-02-28 13:39:01 +00:00
Dmitri Gribenko 08b49b5338 Moved Symbol into its own header and implementation file
Reviewers: ioeric

Subscribers: mgorny, jkorous, arphaman, kadircet, jdoerfert, cfe-commits

Tags: #clang

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

llvm-svn: 355088
2019-02-28 13:23:03 +00:00
Stefan Pintilie a073a18460 [PowerPC] Removed STATISTIC that was causing build errors.
llvm-svn: 355087
2019-02-28 12:40:28 +00:00
Dmitri Gribenko dba22a3908 Moved SymbolOrigin into its own header and implementation file
Reviewers: ioeric

Subscribers: mgorny, jkorous, arphaman, kadircet, jdoerfert, cfe-commits

Tags: #clang

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

llvm-svn: 355086
2019-02-28 12:31:49 +00:00
Stefan Pintilie bd5429ef38 [PowerPC] Move the stack pointer update instruction later in the prologue and earlier in the epilogue.
Move the stdu instruction in the prologue and epilogue.
This should provide a small performance boost in functions that are able to do
this. I've kept this change rather conservative at the moment and functions
with frame pointers or base pointers will not try to move the stack pointer
update.

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

llvm-svn: 355085
2019-02-28 12:23:28 +00:00
Simon Pilgrim 134bc19079 [X86][AVX] Remove superfluous insert_subvector(zero, bitcast(x)) -> bitcast(insert_subvector(zero, x)) fold
This is caught by other existing bitcast folds.

llvm-svn: 355084
2019-02-28 11:39:52 +00:00
Diana Picus cf0ff638bc [ARM GlobalISel] Make arm_i32imm an IntImmLeaf
This gets rid of some duplication in the TableGen definition, but it
forces us to keep both a pointer and a reference to the subtarget in the
ARMInstructionSelector. That is pretty ugly but it might be a reasonable
trade-off, since the TableGen descriptions should outlive the code in
the selector (or in the worst case we can update to use just the
reference when we get rid of DAGISel).

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

llvm-svn: 355083
2019-02-28 11:13:05 +00:00
Dmitri Gribenko 5306a71480 Moved SymbolLocation into its own header and implementation file
Reviewers: ioeric

Subscribers: mgorny, jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

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

llvm-svn: 355082
2019-02-28 11:02:01 +00:00
Dmitri Gribenko ed2539a608 Moved DenseMap support for SymbolID into SymbolID.h
llvm-svn: 355081
2019-02-28 11:00:44 +00:00
Dmitri Gribenko 60e52f5e3d Fixed typos in a test: s/CEHCK/CHECK/
Reviewers: ilya-biryukov, serge-sans-paille

Subscribers: delcypher, llvm-commits

Tags: #llvm

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

llvm-svn: 355080
2019-02-28 10:58:13 +00:00
Dmitri Gribenko 3d0576bbaf Fixed a typo in the test s/CEHCK/CHECK/
Summary:
Turns out the test was not correct, I had to adjust the test to work.  I
also added CHECK-LABELs for better error messages from FileCheck while
I'm here.

Reviewers: jsji

Subscribers: nemanjai, eraman, llvm-commits

Tags: #llvm

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

llvm-svn: 355079
2019-02-28 10:56:39 +00:00
Simon Pilgrim 87aeff8bbb [X86][AVX] Fold vf64 concat_vectors(movddup(x),movddup(x)) -> broadcast(x)
llvm-svn: 355078
2019-02-28 10:53:58 +00:00
Diana Picus 3b7beafc77 [ARM GlobalISel] Support global variables for Thumb2
Add the same level of support as for ARM mode (i.e. still no TLS
support).

In most cases, it is sufficient to replace the opcodes with the
t2-equivalent, but there are some idiosyncrasies that I decided to
preserve because I don't understand the full implications:
* For ARM we use LDRi12 to load from constant pools, but for Thumb we
  use t2LDRpci (I'm not sure if the ideal would be to use t2LDRi12 for
  Thumb as well, or to use LDRcp for ARM).
* For Thumb we don't have an equivalent for MOV|LDRLIT_ga_pcrel_ldr, so
  we have to generate MOV|LDRLIT_ga_pcrel plus a load from GOT.

The tests are in separate files because they're hard enough to read even
without doubling the number of checks.

llvm-svn: 355077
2019-02-28 10:42:47 +00:00
Clement Courbet ff5e4bcad0 [clang-tidy] misc-string-integer-assignment: fix false positive
Summary:
using CodePoint = uint32_t;
CodePoint cp;
basic_string<CodePoint> s;
s += cp;

See PR27723.

Reviewers: xazax.hun, alexfh

Subscribers: rnkovacs, cfe-commits

Tags: #clang

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

llvm-svn: 355076
2019-02-28 10:33:32 +00:00
George Rimar c6846b8800 [LLD][ELF] - Stop using binary input in invalid/tls-symbol.s test. NFCI.
We can use yaml2obj instead, patch does this.

llvm-svn: 355075
2019-02-28 09:24:12 +00:00
George Rimar bf447a5bb5 [llvm-objdump] - Improve the error message for "removing a section that is used by relocation" case.
This refines/improves the error message introduced in D58625

Differential revision: https://reviews.llvm.org/D58709

llvm-svn: 355074
2019-02-28 08:21:50 +00:00
George Rimar 7b4fce12b3 [llvm-readobj] - Fix the invalid dumping of the dynamic sections without terminating DT_NULL entry.
This is https://bugs.llvm.org/show_bug.cgi?id=40861,

Previously llvm-readobj would print the DT_NULL sometimes
for the dynamic section that has no terminator entry.

The logic of printDynamicTable was a bit overcomplicated.
I rewrote it slightly to fix the issue and commented.

Differential revision: https://reviews.llvm.org/D58716

llvm-svn: 355073
2019-02-28 08:15:59 +00:00
Nikita Popov 6c57395fb4 [ValueTracking] More accurate unsigned add overflow detection
Part of D58593.

Compute precise overflow conditions based on all known bits, rather
than just the sign bits. Unsigned a + b overflows iff a > ~b, and we
can determine whether this always/never happens based on the minimal
and maximal values achievable for a and ~b subject to the known bits
constraint.

llvm-svn: 355072
2019-02-28 08:11:20 +00:00
Craig Topper 6ca7398a1e [X86] Use PreprocessISelDAG to convert vector sra/srl/shl to the X86 specific variable shift ISD opcodes.
These allows use to use the same set of isel patterns for sra/srl/shl which are undefined for out of range shifts and intrinsic shifts which aren't undefined.

Doing this late allows DAG combine to have every opportunity to optimize the sra/srl/shl nodes.

This removes about 7000 bytes from the isel table and simplies the td files.

llvm-svn: 355071
2019-02-28 07:21:26 +00:00