Commit Graph

326155 Commits

Author SHA1 Message Date
Alexey Bataev 4812941776 [OPENMP][NVPTX]Fix parallel level counter in non-SPMD mode.
Summary:
In non-SPMD mode we may end up with the divergent threads when trying to
increment/decrement parallel level counter. It may lead to incorrect
calculations of the parallel level and wrong results when threads are
divergent. We need to reconverge the threads before trying to modify the
parallel level counter.

Reviewers: grokos, jdoerfert

Subscribers: guansong, openmp-commits, caomhin, kkwli0

Tags: #openmp

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

llvm-svn: 370803
2019-09-03 18:11:50 +00:00
Raphael Isemann b187eef616 [lldb][NFC] Remove unused overload of File::Read
Summary: It's neither used or tested here and in swift-lldb, so let's get rid of it.

Reviewers: #lldb, davide

Reviewed By: #lldb, davide

Subscribers: davide, JDevlieghere, lldb-commits

Tags: #lldb

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

llvm-svn: 370802
2019-09-03 18:11:14 +00:00
Richard Smith 03c13e5718 Disable stack exhaustion test on NetBSD, where either the detection or
recovery mechanism does not appear to work.

llvm-svn: 370801
2019-09-03 18:00:44 +00:00
Ed Maste 5289bbe4d4 ld.lld.1: explain long options may use one or two dashes
Obtained from FreeBSD r329003

llvm-svn: 370800
2019-09-03 17:58:30 +00:00
Ed Maste 174e083345 ld.lld.1: stylistic changes suggested by igor
igor is an automated man page "proofreader" from FreeBSD - see
http://www.wonkity.com/~wblock/igor/igor.pdf

No content change.

llvm-svn: 370799
2019-09-03 17:58:24 +00:00
Kristof Umann 1b439659a8 [analyzer] NonNullParamChecker and CStringChecker parameter number in checker message
There are some functions which can't be given a null pointer as parameter either
because it has a nonnull attribute or it is declared to have undefined behavior
(e.g. strcmp()). Sometimes it is hard to determine from the checker message
which parameter is null at the invocation, so now this information is included
in the message.

This commit fixes https://bugs.llvm.org/show_bug.cgi?id=39358

Reviewed By: NoQ, Szelethus, whisperity

Patch by Tibor Brunner!

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

llvm-svn: 370798
2019-09-03 17:57:01 +00:00
Louis Dionne 79b476150b [libc++] Mark usage of _Atomic with __extension__
An upcoming change in Clang will flag _Atomic as being a C11 extension.
To avoid generating this warning in libc++, this commit marks the only
use of _Atomic with the __extension__ extension, which suppresses such
warnings.

llvm-svn: 370796
2019-09-03 17:52:18 +00:00
Richard Smith 03d2567f91 [www] Mark items complete in Clang 9 as 'Clang 9' rather than 'SVN'.
Don't turn the boxes green yet, since Clang 9 hasn't been released.

llvm-svn: 370795
2019-09-03 17:49:51 +00:00
Artem Belevich ce94ec661f [CUDA] Use activemask.b32 instruction to implement __activemask w/ CUDA-9.2+
vote.ballot instruction is gone in recent CUDA versions and
vote.sync.ballot can not be used because it needs a thread mask parameter.
Fortunately PTX 6.2 (introduced with CUDA-9.2) provides activemask.b32
instruction for this.

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

llvm-svn: 370792
2019-09-03 17:31:58 +00:00
Philip Reames 37e2f5f125 [GVN] Propagate simple equalities from assumes within the tail of the block
This extends the existing logic for propagating constant expressions in an analogous manner for what we do across basic blocks. The core point is that we chose some order of operands, and canonicalize uses towards that one.

The heuristic used is inspired by the one used across blocks; in a follow up change, I'd plan to common them so that the cross block version uses the slightly stronger ordering herein. 

As noted by the TODOs in the code, there's a good amount of room for improving the existing code and making it more powerful.  Some follow up work planned.

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

llvm-svn: 370791
2019-09-03 17:31:19 +00:00
Jessica Paquette 15036acb05 [AArch64][GlobalISel] Don't import i64imm_32bit pattern at -O0
This pattern, when imported at -O0 adds an extra copy via the SUBREG_TO_REG.

This is because the SUBREG_TO_REG is not eliminated. At all other opt levels,
it is eliminated.

This is a 1% geomean code size savings at -O0 on CTMark.

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

llvm-svn: 370789
2019-09-03 17:21:12 +00:00
Roman Lebedev bdd65351d3 Revert r370454 "[LoopIdiomRecognize] BCmp loop idiom recognition"
https://bugs.llvm.org/show_bug.cgi?id=43206 was filed,
claiming that there is a miscompilation.
Reverting until i investigate.

This reverts commit r370454

llvm-svn: 370788
2019-09-03 17:14:56 +00:00
Jonas Devlieghere e44f2eb315 [test] Addres TestConcurrentMany*.py flakiness on macOS
On "fast" macOS machines, the TestConcurrentMany*.py tests would fail
randomly with different numbers of breakpoints, watchpoints, etc. This
seems to be avoidable by giving the threads a little time to breath
after the passing the synchronization barrier. This is far from a
structural fix but it reduces the flakiness.

llvm-svn: 370785
2019-09-03 17:04:04 +00:00
Philip Reames 154a944a80 [Tests/GVN] Precommit requested test additions from D66977
llvm-svn: 370784
2019-09-03 17:02:55 +00:00
Jon Chesterfield bbdd282371 [libomptarget] Refactor activemask macro to inline function
Summary:
[libomptarget] Refactor activemask macro to inline function
See also abandoned D66846, split into this diff and others.

Reviewers: jdoerfert, ABataev, grokos, ronlieb, gregrodgers

Reviewed By: jdoerfert, ABataev

Subscribers: openmp-commits

Tags: #openmp

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

llvm-svn: 370781
2019-09-03 16:31:30 +00:00
Ed Maste dfde7b09c8 clang: default to DWARF 4 for FreeBSD 12.0 and later
Older FreeBSD versions included GDB 6.1 and had other tools that were
unable to handle debug information newer than DWARF 2.  Those tools have
since been updated.  (An old version of GDB is still kept for kernel
crash handling, but the kernel is compiled with an explicit -gdwarf2.)

Reviewed by:	dim
Differential Revision:	https://reviews.llvm.org/D66760

llvm-svn: 370779
2019-09-03 16:30:21 +00:00
Jonas Devlieghere 063aac6cf3 [test] Remove print statements and verify that the symbol exists
This removes some (commented out) print statements and adds a line that
verifies that uses image list to check the symbol.

llvm-svn: 370777
2019-09-03 16:26:44 +00:00
Raphael Isemann f792054fd2 [lldb][NFC] Disable added frame select and all log option test on windows
llvm-svn: 370776
2019-09-03 16:21:57 +00:00
Gabor Horvath 6f98400189 [LifetimeAnalysis] Fix some false positives
Differential Revision: https://reviews.llvm.org/D66806

llvm-svn: 370773
2019-09-03 16:17:24 +00:00
Simon Pilgrim af7f1a1959 [cmake] Improve comment describing the C4245 warning. NFCI.
llvm-svn: 370772
2019-09-03 16:11:37 +00:00
Kerry McLaughlin 7b5c6b8d86 [SVE][Inline-Asm] Fix -Wimplicit-fallthrough in AArch64ISelLowering.cpp
Summary: Adds break to 'x' case in getRegForInlineAsmConstraint added by D66302, fixing the unintentional fallthrough.

Reviewers: sdesmalen, rovka, cameron.mcinally, greened, gribozavr, ruiu

Reviewed By: sdesmalen

Subscribers: bjope, javed.absar, tschuett, kristof.beyls, rkruppe, psnobl, llvm-commits, cfe-commits

Tags: #llvm

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

llvm-svn: 370769
2019-09-03 15:45:42 +00:00
Sam McCall 19cefc2878 [clangd] Move getBeginningOfIdentifier from ClangdUnit to SourceCode. Drop dependencies on ClangdUnit from some headers. NFC
llvm-svn: 370768
2019-09-03 15:34:47 +00:00
Kristof Umann 3b18b050b8 [analyzer] Add a checker option to detect nested dead stores
Enables the users to specify an optional flag which would warn for more dead
stores.
Previously it ignored if the dead store happened e.g. in an if condition.

if ((X = generate())) { // dead store to X
}

This patch introduces the `WarnForDeadNestedAssignments` option to the checker,
which is `false` by default - so this change would not affect any previous
users.
I have updated the code, tests and the docs as well. If I missed something, tell
me.

I also ran the analysis on Clang which generated 14 more reports compared to the
unmodified version. All of them seemed reasonable for me.

Related previous patches:
rGf224820b45c6847b91071da8d7ade59f373b96f3

Reviewers: NoQ, krememek, Szelethus, baloghadamsoftware

Reviewed By: Szelethus

Patch by Balázs Benics!

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

llvm-svn: 370767
2019-09-03 15:22:43 +00:00
Michael Liao de52403843 [clangd] Remove redundant semi-colon.
llvm-svn: 370763
2019-09-03 15:02:46 +00:00
Simon Pilgrim 99525bbe49 [X86] Merge 2 consecutive HasInt256 branches. NFCI.
llvm-svn: 370761
2019-09-03 14:39:06 +00:00
Haojian Wu 67853ac4e0 [clang-tidy] Fix a false positive in unused-using-decl check
The previous matcher "hasAnyTemplateArgument(templateArgument())" only
matches the first template argument, but the check wants to iterate all
template arguments. This patch fixes this.

Also some refactorings in this patch (to make the code reusable).

llvm-svn: 370760
2019-09-03 14:13:00 +00:00
Sam McCall 97e5de522e [clangd] Decouple macro/decl-under-cursor finding. Don't pretend there can be multiple macros. NFC.
llvm-svn: 370759
2019-09-03 14:12:48 +00:00
Ilya Biryukov 72379548eb [clangd] Fix a data race in test code
Found by TSan, thanks bkramer for pointing this out.

llvm-svn: 370758
2019-09-03 13:56:03 +00:00
Sam McCall 80195e7d1c [clangd] Wrong attribute on debug function in r370746
llvm-svn: 370757
2019-09-03 13:54:27 +00:00
Ed Maste 1b6ee802c6 compiler-rt: use 64-bit time_t for all FreeBSD archs except i386
At present only i386 has 32-bit time_t on FreeBSD.

Reviewed by:	dim
Differential Revision:	https://reviews.llvm.org/D66758

llvm-svn: 370756
2019-09-03 13:44:47 +00:00
Ed Maste 14cf2b20ca compiler-rt: use more __sanitizer_time_t on FreeBSD
A few structs were using long for time_t members.  NFC.

Reviewed by:	devnexen
Differential Revision:	https://reviews.llvm.org/D66756

llvm-svn: 370755
2019-09-03 13:41:51 +00:00
Jonas Paulsson a0a811739d [SystemZ] Recognize INLINEASM_BR in backend.
SystemZInstrInfo::analyzeBranch() needs to check for INLINEASM_BR
instructions, or it will crash.

Review: Ulrich Weigand
llvm-svn: 370753
2019-09-03 13:31:22 +00:00
Nico Weber 600f5c5727 gn build: (manually) merge r370499
llvm-svn: 370752
2019-09-03 13:17:16 +00:00
Simon Pilgrim 54b989cf98 Fix MSVC "not all control paths return a value" warning. NFCI.
llvm-svn: 370750
2019-09-03 13:05:13 +00:00
Nico Weber 5f9aea72d6 gn build: Merge r370746
llvm-svn: 370749
2019-09-03 13:01:17 +00:00
Michal Gorny 3276fffc17 [lldb] Replace std::call_once() with llvm::call_once()
Remove the single instance of std::call_once() in lldbTarget library
with llvm::call_once().  The former fails to build on NetBSD when
combined with llvm::once_flag (which replaced std::once_flag
in r369618), and combining the two is probably generally incorrect
anyway.

llvm-svn: 370748
2019-09-03 12:31:24 +00:00
Sam McCall 489cc589c5 [clangd] Add targetDecl(), which determines what declaration an AST node refers to.
Summary:
This is the first part of an effort to "unbundle" our libIndex use into separate
concerns (AST traversal, token<->node mapping, node<->decl mapping,
decl<->decl relationshipes).

Currently, clangd relies on libIndex to associate tokens, AST nodes, and decls.
This leads to rather convoluted implementations of e.g. hover and
extract-function, which are not naturally thought of as indexing applications.

The idea is that by decoupling different concerns, we make them easier
to use, test, and combine, and more efficient when only one part is needed.
There are some synergies between e.g. traversal and finding
relationships between decls, hopefully the benefits outweight these.

Reviewers: kadircet, ilya-biryukov

Subscribers: mgorny, MaskRay, jkorous, arphaman, jfb, cfe-commits

Tags: #clang

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

llvm-svn: 370746
2019-09-03 11:35:50 +00:00
David Green 2f3574c168 [ARM] Ignore Implicit CPSR regs when lowering from Machine to MC operands
The code here seems to date back to r134705, when tablegen lowering was first
being added. I don't believe that we need to include CPSR implicit operands on
the MCInst. This now works more like other backends (like AArch64), where all
implicit registers are skipped.

This allows the AliasInst for CSEL's to match correctly, as can be seen in the
test changes.

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

llvm-svn: 370745
2019-09-03 11:30:54 +00:00
Sven van Haastregt 92b2be1e92 [OpenCL] Drop spurious semicolon in generated file; NFC
llvm-svn: 370744
2019-09-03 11:23:24 +00:00
Jonas Paulsson f12415812c [SystemZ] Add support for fentry.
SystemZAsmPrinter now properly emits function calls to __fentry__.

Review: Ulrich Weigand
llvm-svn: 370743
2019-09-03 11:21:12 +00:00
David Green 61973d978b [ARM] Invert CSEL predicates if the opposite is a simpler constant to materialise
This moves ConstantMaterializationCost into ARMBaseInstrInfo so that it can
also be used in ISel Lowering, adding codesize values to the computed costs, to
be able to compare either approximate instruction counts or codesize costs.

It also adds a HasLowerConstantMaterializationCost, which compares the
ConstantMaterializationCost of two values, returning true if the first is
smaller either in instruction count/codesize, or falling back to the other in
the case that they are equal.

This is used in constant CSEL lowering to invert the predicate if the opposite
is easier to materialise.

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

llvm-svn: 370741
2019-09-03 11:06:24 +00:00
David Bolvansky 54904aba47 Fixit for -Wfinal-dtor-non-final-class
llvm-svn: 370740
2019-09-03 10:54:25 +00:00
David Green 57cc65ff47 [ARM] Generate 8.1-m CSINC, CSNEG and CSINV instructions.
Arm 8.1-M adds a number of related CSEL instructions, including CSINC, CSNEG and CSINV. These choose between two values given the content in CPSR and a condition, performing an increment, negation or inverse of the false value.

This adds some selection for them, either from constant values or patterns. It does not include CSEL directly, which is currently not always making code better. It is still useful, but we will have to check more carefully where it should and shouldn't be used.

Code by Ranjeet Singh and Simon Tatham, with some modifications from me.

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

llvm-svn: 370739
2019-09-03 10:53:07 +00:00
David Green a1ae7e3734 [ARM] Add csel tests. NFC
llvm-svn: 370738
2019-09-03 10:32:46 +00:00
David Bolvansky c50da3d052 Added fixit notes for -Wfinal-dtor-non-final-class
llvm-svn: 370737
2019-09-03 10:32:21 +00:00
Simon Atanasyan 25d5b54542 [mips] Switch to the `.text` section after emitting asm file preamble
Now the last `.section` directive in the MIPS asm file preamble
is the `.section .mdebug.abi`. If assembler code injected for example
by the LLVM `module asm` or the C ` __asm` directives do not contain
explicit switching to the `.text` section it goes to the `.mdebug.abi`
section. It might be unexpected to the user and in fact for example
breaks building some existing code like FreeBSD libc [1].

The patch forces switching to the `.text` section after emitting MIPS
assembler file preamble.

[1] https://bugs.llvm.org/show_bug.cgi?id=43119

Fix PR43119.

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

llvm-svn: 370735
2019-09-03 10:24:07 +00:00
Raphael Isemann 607c92afda [lldb] Test 'frame select -r' and fix that INT32_MIN breaks the option parser
llvm-svn: 370734
2019-09-03 10:15:45 +00:00
Raphael Isemann 99f9f1f2d8 [lldb][NFC] Test 'command delete'
llvm-svn: 370733
2019-09-03 10:13:45 +00:00
David Green 3e8d5f335d [ARM] Fix MVE ldst offset ranges
We were using isShiftedInt<7, Shift>(RHSC) to detect the ranges of offsets to
fold into MVE loads/stores. The instructions actually take a 7 bit unsigned
integer which is either added or subtracted. So something more like
isShiftedUInt<7, Shift>(abs(RHSC)).

Instead I've changes this to use the isScaledConstantInRange method, same as in
SelectT2AddrModeImm7Offset used by pre/post inc, which seemed to already be
getting this correct.

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

llvm-svn: 370731
2019-09-03 09:57:02 +00:00
Oliver Stannard 3be2df2418 [ARM][MVE] Decoding of VMSR doesn't diagnose some unpredictable encodings
Decoding of VMSR doesn't diagnose some unpredictable encodings, as the unpredictable bits are not correctly set.

Diff-reduce this instruction's internals WRT VMRS so I can see the differences better. Mostly this is s/src/Rt/g.

Fill in the "should-be-(0)" bits.

Designate the Unpredictable{} bits for both VMRS and VMSR.

Patch by Mark Murray!

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

llvm-svn: 370729
2019-09-03 09:55:30 +00:00