platform/upstream/llvm.git
4 years agodoc: use the right url to bugzilla
Sylvestre Ledru [Sun, 22 Mar 2020 21:45:15 +0000 (22:45 +0100)]
doc: use the right url to bugzilla

4 years agoDoc: Links should use https
Sylvestre Ledru [Sun, 22 Mar 2020 21:42:03 +0000 (22:42 +0100)]
Doc: Links should use https

4 years ago[SCCP] Add a few more tests for conditional propagation,XOR.
Florian Hahn [Sat, 21 Mar 2020 23:38:37 +0000 (23:38 +0000)]
[SCCP] Add a few more tests for conditional propagation,XOR.

4 years agoupdate of the llvm doc: we moved to git
Sylvestre Ledru [Sun, 22 Mar 2020 21:31:18 +0000 (22:31 +0100)]
update of the llvm doc: we moved to git

4 years ago[X86] More accurately model the cost of horizontal reductions.
Craig Topper [Sun, 22 Mar 2020 18:09:55 +0000 (11:09 -0700)]
[X86] More accurately model the cost of horizontal reductions.

This patch attempts to more accurately model the reduction of
power of 2 vectors of types we natively support. This takes into
account the narrowing of vectors that occur as we go from 512
bits to 256 bits, to 128 bits. It also takes into account the use
of wider elements in the shuffles for the first 2 steps of a
reduction from 128 bits. And uses a v8i16 shift for the final step
of vXi8 reduction.

The default implementation uses the legalized type for the arithmetic
for all levels. And uses the single source permute cost of the
legalized type for all levels. This penalizes things like
lack of v16i8 pshufb on pre-sse3 targets and the splitting and
joining that needs to be done for integer types on AVX1. We never
need v16i8 shuffle for a reduction and we only need split AVX1 ops
when type the type wide and needs to be split. I think we're still
over costing splits and joins for AVX1, but we're closer now.

I've also removed all pairwise special casing because I don't
think we ever want to generate that on X86. I've also adjusted
the add handling to more accurately account for any type splitting
that occurs before we reach a legal type.

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

4 years agoclang/release notes: s/Subversion/git/
Sylvestre Ledru [Sun, 22 Mar 2020 21:18:40 +0000 (22:18 +0100)]
clang/release notes: s/Subversion/git/

4 years ago[mips] Implement .cpadd directive
Simon Atanasyan [Sun, 22 Mar 2020 17:20:00 +0000 (20:20 +0300)]
[mips] Implement .cpadd directive

This directive inserts code to add $gp to the argument's register when
support for position independent code is enabled.

For example, this code:
  .cpadd $4
expands to:
  addu $4, $4, $gp

4 years ago[mips] Implement sne pseudo instruction
Simon Atanasyan [Sun, 22 Mar 2020 17:10:00 +0000 (20:10 +0300)]
[mips] Implement sne pseudo instruction

The `sne Dst, Src1, Src2/Imm` pseudo instruction sets register `Dst` to
1 if register `Src1` is not equal to `Src2/Imm` and to 0 otherwise.

4 years ago[mips] Implement sle/sleu pseudo instructions
Simon Atanasyan [Sun, 22 Mar 2020 17:00:00 +0000 (20:00 +0300)]
[mips] Implement sle/sleu pseudo instructions

The `sle/sleu Dst, Src1, Src2/Imm` pseudo instructions set register
`Dst` to 1 if register `Src1` is less than or equal `Src2/Imm` and
to 0 otherwise.

4 years ago[mips] Remove instructions related to "wired paired single" from the P5600 model.
Simon Atanasyan [Sun, 22 Mar 2020 15:23:28 +0000 (18:23 +0300)]
[mips] Remove instructions related to "wired paired single" from the P5600 model.

4 years ago[mips] Add HasMips3D to the list of features unsupported by P5600 model.
Simon Atanasyan [Sun, 22 Mar 2020 15:22:23 +0000 (18:22 +0300)]
[mips] Add HasMips3D to the list of features unsupported by P5600 model.

4 years ago[mips] Rename target feature Mips3D => HasMips3D. NFC
Simon Atanasyan [Sun, 22 Mar 2020 15:18:25 +0000 (18:18 +0300)]
[mips] Rename target feature Mips3D => HasMips3D. NFC

4 years ago[mlir] Change include image to be toplevel
Jacques Pienaar [Sun, 22 Mar 2020 20:13:17 +0000 (13:13 -0700)]
[mlir] Change include image to be toplevel

This will match the changes mlir.llvm.org side.

4 years ago[libc][NFC] Fix typo in milliseconds
Alex Brachet [Sun, 22 Mar 2020 19:11:22 +0000 (15:11 -0400)]
[libc][NFC] Fix typo in milliseconds

4 years ago[NFC] Refactor handling of Xarch option
Yaxun (Sam) Liu [Thu, 19 Mar 2020 21:11:35 +0000 (17:11 -0400)]
[NFC] Refactor handling of Xarch option

Extract common code to a function. To prepare for
adding an option for CUDA/HIP host and device only
option.

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

4 years agoAdd Triple::isAMDGPU
Yaxun (Sam) Liu [Sun, 22 Mar 2020 17:43:33 +0000 (13:43 -0400)]
Add Triple::isAMDGPU

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

4 years ago[libc] Add signal
Alex Brachet [Sun, 22 Mar 2020 18:15:47 +0000 (14:15 -0400)]
[libc] Add signal

Summary:
This patch adds a Linux implementation for `signal`
It also fixes `ASSERT|EXPECT_THAT` macros

Reviewers: sivachandra, PaulkaToast, MaskRay

Reviewed By: sivachandra

Subscribers: mgorny, tschuett, libc-commits

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

4 years ago[X86] Remove maximum vector width restriction from combineLoopSADPattern.
Craig Topper [Sun, 22 Mar 2020 17:54:50 +0000 (10:54 -0700)]
[X86] Remove maximum vector width restriction from combineLoopSADPattern.

SplitsOpsAndApply will take care of any needed splitting correctly.
All that we need to check is that the vector element count is a
power of 2.

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

4 years agoRemove a dead function.
Nico Weber [Sun, 22 Mar 2020 17:27:51 +0000 (13:27 -0400)]
Remove a dead function.

4 years agoVerifier: Check bswap is supported size
Matt Arsenault [Sun, 22 Mar 2020 15:36:44 +0000 (11:36 -0400)]
Verifier: Check bswap is supported size

Make sure it is a multiple of 2 bytes as specified in the LangRef.

4 years ago[InstCombine] Remove ExpensiveCombines option
Nikita Popov [Sat, 21 Mar 2020 09:14:17 +0000 (10:14 +0100)]
[InstCombine] Remove ExpensiveCombines option

D75801 removed the last and only user of this option, so we can
drop it now. The original idea behind this was to only run expensive
transforms under -O3, but apart from the one known bits transform,
this has never really taken off. I believe nowadays the recommendation
is to put expensive transforms in AggressiveInstCombine instead,
though that isn't terribly popular either :)

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

4 years agoUtils: Mostly convert memcpy expansion to use Align
Matt Arsenault [Sun, 22 Mar 2020 14:45:36 +0000 (10:45 -0400)]
Utils: Mostly convert memcpy expansion to use Align

The TTI hooks aren't converted. I also think the intrinsics should
have mandatory alignment and never return MaybeAlign.

4 years ago[DAGCombiner] Require nsz for aggressive fma fold
Qiu Chaofan [Sun, 22 Mar 2020 15:10:07 +0000 (23:10 +0800)]
[DAGCombiner] Require nsz for aggressive fma fold

For folding pattern `x-(fma y,z,u*v) -> (fma -y,z,(fma -u,v,x))`, if
`yz` is 1, `uv` is -1 and `x` is -0, sign of result would be changed.

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

4 years ago[NFC] [PowerPC] Remove unsafe-fp-math in FMA test
Qiu Chaofan [Sun, 22 Mar 2020 14:40:49 +0000 (22:40 +0800)]
[NFC] [PowerPC] Remove unsafe-fp-math in FMA test

4 years ago[X86][SSE] Add some additional irregular AVG tests
Simon Pilgrim [Sun, 22 Mar 2020 14:02:08 +0000 (14:02 +0000)]
[X86][SSE] Add some additional irregular AVG tests

Finally resurrecting D56506 and want to improve test coverage.

4 years ago[ValueTracking] Avoid blind cast from Operator to Instruction
Bjorn Pettersson [Sun, 22 Mar 2020 11:16:42 +0000 (12:16 +0100)]
[ValueTracking] Avoid blind cast from Operator to Instruction

Summary:
Avoid blind cast from Operator to ExtractElementInst in
computeKnownBitsFromOperator. This resulted in some crashes
in downstream fuzzy testing. Instead we use getOperand directly
on the Operator when accessing the vector/index operands.

Haven't seen any problems with InsertElement and ShuffleVector,
but I believe those could be used in constant expressions as well.
So the same kind of fix as for ExtractElement was also applied for
InsertElement.

When it comes to ShuffleVector we now simply bail out if a dynamic
cast of the Operator to ShuffleVectorInst fails. I've got no
reproducer indicating problems for ShuffleVector, and a fix would be
slightly more complicated as getShuffleDemandedElts is involved.

Reviewers: RKSimon, nikic, spatel, efriedma

Reviewed By: RKSimon

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[SLP] Avoid repeated visitation in getVectorElementSize(); NFC
Nikita Popov [Sat, 21 Mar 2020 11:45:51 +0000 (12:45 +0100)]
[SLP] Avoid repeated visitation in getVectorElementSize(); NFC

We need to insert into the Visited set at the same time we insert
into the worklist. Otherwise we may end up pushing the same
instruction to the worklist multiple times, and only adding it to
the visited set later.

4 years ago[NFC] [PowerPC] Update FMA association test
Qiu Chaofan [Sun, 22 Mar 2020 12:55:32 +0000 (20:55 +0800)]
[NFC] [PowerPC] Update FMA association test

4 years ago[mlir] Move the testing pass for GpuKernelToCubin to the test/ directory
River Riddle [Sun, 22 Mar 2020 10:13:40 +0000 (03:13 -0700)]
[mlir] Move the testing pass for GpuKernelToCubin to the test/ directory

Summary:
This removes the static pass registration, and also cleans up some lingering technical debt.

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

4 years ago[mlir][NFC] Remove Analysis/Passes.h
River Riddle [Sat, 21 Mar 2020 22:09:01 +0000 (15:09 -0700)]
[mlir][NFC] Remove Analysis/Passes.h

Summary:
This file only contains references to test passes, and was never removed when the test passes were moved to the test/ directory.

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

4 years ago[mlir] Move several static cl::opts to be pass options instead.
River Riddle [Sat, 21 Mar 2020 22:08:49 +0000 (15:08 -0700)]
[mlir] Move several static cl::opts to be pass options instead.

This removes the reliance on global options, and also simplifies the pass registration.

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

4 years ago[LVI] Use SmallDenseMap for getValueFromCondition(); NFC
Nikita Popov [Sat, 21 Mar 2020 13:54:46 +0000 (14:54 +0100)]
[LVI] Use SmallDenseMap for getValueFromCondition(); NFC

For the common case, we will only insert one value into this map.

4 years ago[AsmPrinter] Simplify AsmPrinter::emitXXStructorList after D61547
Fangrui Song [Sun, 22 Mar 2020 06:01:46 +0000 (23:01 -0700)]
[AsmPrinter] Simplify AsmPrinter::emitXXStructorList after D61547

4 years agoDelete TargetLoweringObjectFile::Ctx
Fangrui Song [Sun, 22 Mar 2020 05:27:50 +0000 (22:27 -0700)]
Delete TargetLoweringObjectFile::Ctx

We can use the parent MCObjectFileInfo::Ctx which has the same value.

4 years ago[X86] Delete unneeded X86ELFTargetObjectFile::Initialize. NFC
Fangrui Song [Sun, 22 Mar 2020 05:03:42 +0000 (22:03 -0700)]
[X86] Delete unneeded X86ELFTargetObjectFile::Initialize. NFC

4 years agoRevert "EHScopeStack::Cleanup has virtual functions so the destructor should be too."
David Blaikie [Sun, 22 Mar 2020 04:17:33 +0000 (21:17 -0700)]
Revert "EHScopeStack::Cleanup has virtual functions so the destructor should be too."

This type was already well designed - having a protected destructor, and
derived classes being final/public non-virtual destructors, the type
couldn't be destroyed polymorphically & accidentally cause slicing.

This reverts commit 736385c0b49d42f398ffa1458883f0d182178ef4.

4 years ago[ORC] Move ostream operators for debugging output out of Core.h.
Lang Hames [Sun, 22 Mar 2020 01:25:37 +0000 (18:25 -0700)]
[ORC] Move ostream operators for debugging output out of Core.h.

DebugUtils.h seems like a more appropriate home for these.

4 years ago[X86] Add nonloop v64i8 test to sad.ll.
Craig Topper [Sun, 22 Mar 2020 00:37:42 +0000 (17:37 -0700)]
[X86] Add nonloop v64i8 test to sad.ll.

4 years ago[MLIR][NFC] fix memref type doc comment on dynamic shape
Uday Bondhugula [Sat, 21 Mar 2020 12:01:47 +0000 (17:31 +0530)]
[MLIR][NFC] fix memref type doc comment on dynamic shape

Fix memref type doc comment to state that -1 indicates a dynamically
shaped dimension and not any negative number.

Signed-off-by: Uday Bondhugula <uday@polymagelabs.com>
Differential Revision: https://reviews.llvm.org/D76557

4 years ago[X86] Add test for v4i8 loop sad pattern.
Craig Topper [Sat, 21 Mar 2020 22:27:21 +0000 (15:27 -0700)]
[X86] Add test for v4i8 loop sad pattern.

This cases produces a psadbw that doesn't need to be widened or
extracted so takes a slightly different code path in
combineLoopSADPattern.

4 years ago[gn build] Port 34fd007aaf8
LLVM GN Syncbot [Sat, 21 Mar 2020 20:48:15 +0000 (20:48 +0000)]
[gn build] Port 34fd007aaf8

4 years agoRevert "[ADT] Implement the Waymarking as an independent utility"
Ehud Katz [Sat, 21 Mar 2020 20:47:17 +0000 (22:47 +0200)]
Revert "[ADT] Implement the Waymarking as an independent utility"

This reverts commit 73cf8abbe695aede9aac804f960513bb7355004a.

4 years ago[libc++] tolerate missing diagnostic with modules enabled
Eric Fiselier [Sat, 21 Mar 2020 20:27:45 +0000 (16:27 -0400)]
[libc++] tolerate missing diagnostic with modules enabled

4 years agoThe generated code does not need to check for a null Decl; NFC.
Aaron Ballman [Sat, 21 Mar 2020 19:46:40 +0000 (15:46 -0400)]
The generated code does not need to check for a null Decl; NFC.

It is already assumed to be nonnull by the code calling diagAppertainsToDecl.

4 years ago[InstCombine] Add ctpop -> cttz combine tests (PR43513)
Simon Pilgrim [Sat, 21 Mar 2020 19:30:22 +0000 (19:30 +0000)]
[InstCombine] Add ctpop -> cttz combine tests (PR43513)

4 years ago[X86] getTargetShuffleAndZeroables - add insert_subvector(undef, sub, c) handling.
Simon Pilgrim [Sat, 21 Mar 2020 19:11:23 +0000 (19:11 +0000)]
[X86] getTargetShuffleAndZeroables - add insert_subvector(undef, sub, c) handling.

We often widen xmm/ymm vectors to ymm/zmm by insertion into an undef base vector. By letting getTargetShuffleAndZeroables track the undef elts we can help avoid a lot of unnecessary cross-lane shuffles.

Fixes PR44694

4 years ago[X86][AVX] Add HADDPD test case for PR44694
Simon Pilgrim [Sat, 21 Mar 2020 18:30:14 +0000 (18:30 +0000)]
[X86][AVX] Add HADDPD test case for PR44694

4 years ago[clang/docs] Fix various sphinx warnings/errors in docs.
Florian Hahn [Sat, 21 Mar 2020 15:57:19 +0000 (15:57 +0000)]
[clang/docs] Fix various sphinx warnings/errors in docs.

There are a few places with unexpected indents that trip over sphinx and
other syntax errors.

Also, the C++ syntax highlighting does not work for
    class [[gsl::Owner(int)]] IntOwner {

Use a regular code:: block instead.

There are a few other warnings errors remaining, of the form
'Duplicate explicit target name: "cmdoption-clang--prefix"'. They seem
to be caused by the following
  .. option:: -B<dir>, --prefix <arg>, --prefix=<arg>

I am no Restructured Text expert, but it seems like sphinx 1.8.5
tries to generate the same target for the --prefix <arg> and
--prefix=<arg>. This pops up in a lot of places and I am not sure how to
best resolve it

Reviewers: jfb, Bigcheese, dexonsmith, rjmccall

Reviewed By: rjmccall

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

4 years ago[obj2yaml] - Simplify and reduce `ELFDumper<ELFT>::dumpSections`. NFCI.
Georgii Rymar [Fri, 20 Mar 2020 14:53:58 +0000 (17:53 +0300)]
[obj2yaml] - Simplify and reduce `ELFDumper<ELFT>::dumpSections`. NFCI.

This method it a bit too large.
It is becoming inconvenient to update it.
This patch suggests a way to reduce and cleanup it.

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

4 years ago[libc++] Fix URL to llvm github
Eric Fiselier [Sat, 21 Mar 2020 14:13:50 +0000 (10:13 -0400)]
[libc++] Fix URL to llvm github

4 years ago[libc++] Rework buildbot configuration for the greater good.
Eric Fiselier [Sat, 21 Mar 2020 13:58:10 +0000 (09:58 -0400)]
[libc++] Rework buildbot configuration for the greater good.

This commit rewrites/removes the docker files used to create
the libc++ buildbots.

The major changes in this patch are:

1. Delete Dockerfiles used to build compilers. These have moved to
   github.com/efcs/compiler-images

2. Minimize the llvm-buildbot docker image. Instead of running the
buildbots from a committed docker image, the builders now build the
image on startup. This means changes to the docker file automatically
propogate to the builders (within ~24 hours without restart).

3. Version the compilers used by the builders. This means the bots
won't start failing because the apt.llvm.org clang package updated.

4 years ago[libc++] fix some non-modular tests
Eric Fiselier [Thu, 19 Mar 2020 20:59:22 +0000 (16:59 -0400)]
[libc++] fix some non-modular tests

4 years agotsan: fix deadlock with pthread_atfork callbacks
Dmitry Vyukov [Sat, 21 Mar 2020 12:34:50 +0000 (13:34 +0100)]
tsan: fix deadlock with pthread_atfork callbacks

This fixes the bug reported at:
https://groups.google.com/forum/#!topic/thread-sanitizer/e_zB9gYqFHM

A pthread_atfork callback triggers a data race
and we deadlock on the report_mtx. Ignore memory access
in the pthread_atfork callbacks to prevent the deadlock.

4 years ago[X86] Combine concat(shufps,shufps) -> shufps(concat,concat)
Simon Pilgrim [Sat, 21 Mar 2020 12:39:29 +0000 (12:39 +0000)]
[X86] Combine concat(shufps,shufps) -> shufps(concat,concat)

Now that rG18c19441d105 has improved VPERM2X128 handling, we can perform this to improve x64->x32 truncation without poor cross-lane issues.

Someday combineX86ShufflesRecursively will handle this, but we're still really bad at dealing with different vector widths.

4 years ago[ValueTracking] Short-circuit computeKnownBitsAddSub(); NFCI
Nikita Popov [Sat, 21 Mar 2020 11:14:53 +0000 (12:14 +0100)]
[ValueTracking] Short-circuit computeKnownBitsAddSub(); NFCI

If one operand is unknown (and we don't have nowrap), don't compute
the second operand.

Also don't create an unnecessary extra KnownBits variable, it's
okay to reuse KnownOut.

This reduces instructions on libclamav_md5.c by 40%.

4 years ago[gn build] Port 73cf8abbe69
LLVM GN Syncbot [Sat, 21 Mar 2020 12:33:41 +0000 (12:33 +0000)]
[gn build] Port 73cf8abbe69

4 years ago[ADT] Implement the Waymarking as an independent utility
Ehud Katz [Sat, 21 Mar 2020 12:30:32 +0000 (14:30 +0200)]
[ADT] Implement the Waymarking as an independent utility

This is the Waymarking algorithm implemented as an independent utility.
The utility is operating on a range of sequential elements.
First we "tag" the elements, by calling `fillWaymarks`.
Then we can "follow" the tags from every element inside the tagged
range, and reach the "head" (the first element), by calling
`followWaymarks`.

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

4 years agoRevert rGe6a7e3b5e3e7 "[X86][SSE] matchShuffleWithSHUFPD - add support for unary...
Simon Pilgrim [Sat, 21 Mar 2020 12:14:02 +0000 (12:14 +0000)]
Revert rGe6a7e3b5e3e7 "[X86][SSE] matchShuffleWithSHUFPD - add support for unary shuffles."

This reverts commit e6a7e3b5e3e779a3bfb617c8d9ed4302edab2cef.

Avoids register pressure regression reported at PR45263

4 years agoUpdate ConversionToLLVMDialect.md
Baden Hughes [Sat, 21 Mar 2020 05:32:40 +0000 (15:32 +1000)]
Update ConversionToLLVMDialect.md

Minor editorial/typographic fixes

4 years ago[clang] Fix crash during template sema checking
Guillaume Chatelet [Fri, 20 Mar 2020 15:23:49 +0000 (16:23 +0100)]
[clang] Fix crash during template sema checking

Summary: If the size parameter of `__builtin_memcpy_inline` comes from an un-instantiated template parameter current code would crash.

Reviewers: efriedma, courbet

Subscribers: cfe-commits

Tags: #clang

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

4 years agoRevert rGd5d8569df14e95e2c53d167bd1b37995bcbec565 "Fix static analysis warnings about...
Simon Pilgrim [Sat, 21 Mar 2020 11:39:34 +0000 (11:39 +0000)]
Revert rGd5d8569df14e95e2c53d167bd1b37995bcbec565 "Fix static analysis warnings about classes with virtual methods not having virtual destructors"

This reverts commit d5d8569df14e95e2c53d167bd1b37995bcbec565.

4 years agoFix static analysis warnings about classes with virtual methods not having virtual...
Simon Pilgrim [Fri, 20 Mar 2020 19:31:29 +0000 (19:31 +0000)]
Fix static analysis warnings about classes with virtual methods not having virtual destructors

4 years ago[InstCombine][X86] simplifyX86immShift - remove ConstantAggregateZero handling. NFC.
Simon Pilgrim [Fri, 20 Mar 2020 16:44:29 +0000 (16:44 +0000)]
[InstCombine][X86] simplifyX86immShift - remove ConstantAggregateZero handling. NFC.

The llvm::computeKnownBits path now handles this.

4 years ago[clang-tidy] my work: fix sphinx docs
abelkocsis [Sat, 21 Mar 2020 11:29:39 +0000 (12:29 +0100)]
[clang-tidy] my work: fix sphinx docs

4 years agoFix Wdocumentation warning. NFCI.
Simon Pilgrim [Sat, 21 Mar 2020 11:23:52 +0000 (11:23 +0000)]
Fix Wdocumentation warning. NFCI.

4 years agoFix Wdocumentation warning. NFCI.
Simon Pilgrim [Sat, 21 Mar 2020 11:20:45 +0000 (11:20 +0000)]
Fix Wdocumentation warning. NFCI.

4 years ago[gn build] Port 0f4c70dd3ec
LLVM GN Syncbot [Sat, 21 Mar 2020 11:04:46 +0000 (11:04 +0000)]
[gn build] Port 0f4c70dd3ec

4 years ago[clang-tidy] Add spuriously-wake-up-functions check
abelkocsis [Sat, 21 Mar 2020 11:02:00 +0000 (12:02 +0100)]
[clang-tidy] Add spuriously-wake-up-functions check

Summary:
According to
https://wiki.sei.cmu.edu/confluence/display/cplusplus/CON54-CPP.+Wrap+functions+that+can+spuriously+wake+up+in+a+loop
and
https://wiki.sei.cmu.edu/confluence/display/c/CON36-C.+Wrap+functions+that+can+spuriously+wake+up+in+a+loop
misc-spuriously-wake-up-functions check is created. The check finds
`cnd_wait` or `wait` function calls in an `IfStmt` and  warns the user to
replace it with a `WhileStmt` or use it with a lambda parameter.

Reviewers: aaron.ballman, alexfh, hokein, jfb, Charusso

Reviewed By: aaron.ballman

Subscribers: sylvestre.ledru, whisperity, Eugene.Zelenko, mgorny, dexonsmith, cfe-commits, gerazo, xazax.hun, steakhal, Charusso

Tags: #clang-tools-extra, #clang

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

4 years ago[DAG] Don't permit EXTLOAD when combining FSHL/FSHR consecutive loads (PR45265)
Simon Pilgrim [Sat, 21 Mar 2020 10:33:53 +0000 (10:33 +0000)]
[DAG] Don't permit EXTLOAD when combining FSHL/FSHR consecutive loads (PR45265)

Technically we can permit EXTLOAD of the LHS operand but only if all the extended bits are shifted out. Until we test coverage for that case, I'm just disabling this to fix PR45265.

4 years ago[clangd] Skip ClangdVFSTest.TestStackOverflow when address sanitizer is used
Bjorn Pettersson [Fri, 20 Mar 2020 22:16:32 +0000 (23:16 +0100)]
[clangd] Skip ClangdVFSTest.TestStackOverflow when address sanitizer is used

Summary:
The ClangdVFSTest.TestStackOverflow unittest does not seem to work
when building the test with address sanitizer activated. Afaict the
goal is to get a constexpr depth error, rather than stack overflow.
But with asan instrumentation we do get stack overflow complaints
from asan. As a workaround this patch simply disables the test case,
when being built with address sanitizer activated.

Reviewers: sammccall, Dmitry.Kozhevnikov

Reviewed By: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits, llvm-commits

Tags: #clang

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

4 years ago[WebAssembly] Add SIMD integer abs builtins
Thomas Lively [Sat, 21 Mar 2020 02:30:56 +0000 (19:30 -0700)]
[WebAssembly] Add SIMD integer abs builtins

Summary:
Since the conditional operator cannot be used with vector conditions
in C, we need a builtin to be able to express this operation in C
source.

Reviewers: aheejin

Subscribers: dschuff, sbc100, jgravelle-google, sunfish, cfe-commits

Tags: #clang

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

4 years ago[X86] Reland D71360 Clean up UseInitArray initialization for X86ELFTargetObjectFile
Fangrui Song [Fri, 20 Mar 2020 05:58:42 +0000 (22:58 -0700)]
[X86] Reland D71360 Clean up UseInitArray initialization for X86ELFTargetObjectFile

-fuse-init-array is now the CC1 default but TargetLoweringObjectFileELF::UseInitArray still defaults to false.
The following two unknown OS target triples continue using .ctors/.dtors because InitializeELF is not called.

clang -target i386 -c a.c
clang -target x86_64 -c a.c

This cleanup fixes this as a bonus.

X86SpeculativeLoadHardeningPass::tracePredStateThroughCall can call
MCContext::createTempSymbol before TargetLoweringObjectFileELF::Initialize().
We need to call TargetLoweringObjectFileELF::Initialize() ealier.

test/CodeGen/X86/speculative-load-hardening-indirect.ll

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

4 years agoRevert "Create basic SBEnvironment class"
Walter Erquinigo [Sat, 21 Mar 2020 02:25:27 +0000 (19:25 -0700)]
Revert "Create basic SBEnvironment class"

This reverts commit 34c0759f846447454714c8faa0e1753a8713637b.

4 years agoRevert "[lldb-vscode] Add missing launchCommands entry in the package.json"
Walter Erquinigo [Sat, 21 Mar 2020 02:25:12 +0000 (19:25 -0700)]
Revert "[lldb-vscode] Add missing launchCommands entry in the package.json"

This reverts commit a8c22ba4162976894b34b75fd12aced379e0569b.

4 years agoRevert "[lldb-vscode] Add inheritEnvironment option"
Walter Erquinigo [Sat, 21 Mar 2020 02:24:51 +0000 (19:24 -0700)]
Revert "[lldb-vscode] Add inheritEnvironment option"

This reverts commit 4ec6ebabfc3ec03d3ad4d3bdf05a7292d01391b3.

4 years agoCreate basic SBEnvironment class
Walter Erquinigo [Fri, 13 Mar 2020 00:20:01 +0000 (17:20 -0700)]
Create basic SBEnvironment class

Summary: Inspired by https://reviews.llvm.org/D74636, I'm introducing a basic version of Environment in the API. More functionalities can be added as needed.

Reviewers: labath, clayborg

Subscribers: mgorny, lldb-commits, diazhector98

Tags: #lldb

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

4 years ago[lldb-vscode] Add inheritEnvironment option
Hector Diaz [Thu, 19 Mar 2020 21:08:40 +0000 (14:08 -0700)]
[lldb-vscode] Add inheritEnvironment option

Summary:
If no custom launching is used, lldb-vscode launches a program with an empty environment by default. In some scenarios, the user might want to simply use the same environment as the IDE to have a set of working environment variables (e.g. PATH wouldn't be empty). In fact, most DAPs in VSCode have this behavior by default. In other cases the user definitely needs to set their custom environment, which is already supported. To make the first case easier for the user (e.g. not having to copy the PATH to the launch.json every time they want to debug simple programs that rely on PATH), a new option is now offered. inheritEnvironment will launch the program copying its own environment, and it's just a boolean flag.

{F11347695}

Reviewers: clayborg, aadsm, diazhector98, kusmour

Subscribers: labath, JDevlieghere, lldb-commits

Tags: #lldb

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

4 years ago[lldb-vscode] Add missing launchCommands entry in the package.json
Walter Erquinigo [Fri, 20 Mar 2020 21:36:45 +0000 (14:36 -0700)]
[lldb-vscode] Add missing launchCommands entry in the package.json

Summary:
https://reviews.llvm.org/D65363 introduced the launchCommands argument. However, it did not add
a corresponding definition in the package.json

Reviewers: clayborg, labath, kusmour, aadsm

Subscribers: lldb-commits

Tags: #lldb

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

4 years ago[cmake] Fix -stripped for umbrella library install targets
Shoaib Meenai [Sat, 21 Mar 2020 01:42:09 +0000 (18:42 -0700)]
[cmake] Fix -stripped for umbrella library install targets

Make the install-llvm-libraries-stripped and install-clang-libraries-stripped
targets depend on the individual library stripped install targets, so
that they actually install the libraries.

4 years agoPR45267: Don't reject pure-specifiers with escaped newlines in their '0' token.
Richard Smith [Sat, 21 Mar 2020 01:44:13 +0000 (18:44 -0700)]
PR45267: Don't reject pure-specifiers with escaped newlines in their '0' token.

4 years ago[lldb]/Tablegen] Use ElementType instead of DefaultValueUnsinged
Jonas Devlieghere [Sat, 21 Mar 2020 01:34:50 +0000 (18:34 -0700)]
[lldb]/Tablegen] Use ElementType instead of DefaultValueUnsinged

The fourth field in the property struct is the default unsigned or enum
value for all types, except for Array and Dictionary types. For those,
it is the element type. During the tablegen conversion, this was
incorrectly translated to DefaultValueUnsigned with a value
corresponding to the OptionValue: enum type. So for
OptionValue::eTypeString this became DefaultUnsignedValue<16>. This
patch extends the tablegen backend to understand ElementType to express
this as ElementType<"String">.

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

4 years ago[CodeGen] Emit destructor calls to destruct non-trivial C struct objects
Akira Hatanaka [Thu, 21 Nov 2019 02:13:44 +0000 (18:13 -0800)]
[CodeGen] Emit destructor calls to destruct non-trivial C struct objects
returned by function calls or loaded from volatile objects

rdar://problem/51867864

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

4 years agoUse values cached in ConstantExprs for expression evaluation where
Wyatt Childers [Fri, 20 Mar 2020 21:57:56 +0000 (14:57 -0700)]
Use values cached in ConstantExprs for expression evaluation where
present.

No functionality change intended.

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

4 years agoTemporarily Revert "[X86] Reland D71360 Clean up UseInitArray initialization for...
Eric Christopher [Sat, 21 Mar 2020 00:36:12 +0000 (17:36 -0700)]
Temporarily Revert "[X86] Reland D71360 Clean up UseInitArray initialization for X86ELFTargetObjectFile"
as it's causing msan failures.

This reverts commit 7899fe9da8d8df6f19ddcbbb877ea124d711c54b.

4 years ago[libc++] Temporarily disable an availability test that is broken
Louis Dionne [Sat, 21 Mar 2020 00:08:09 +0000 (20:08 -0400)]
[libc++] Temporarily disable an availability test that is broken

The current lit test suite doesn't really allow us to express that the
test should be disabled when testing the trunk variant of libc++, even
if we're running it on a supported macOS. Because of that, the test
is enabled when _LIBCPP_DISABLE_AVAILABILITY is defined, and the test
XPASSes.

4 years ago[libomptarget][nfc] Disable amdgcn rtl build. The cmake logic for finding llvm is...
JonChesterfield [Sat, 21 Mar 2020 00:01:03 +0000 (00:01 +0000)]
[libomptarget][nfc] Disable amdgcn rtl build. The cmake logic for finding llvm is misbehaving.

4 years ago[MLIR] Add an IfOp builder with results
nmostafa [Fri, 20 Mar 2020 20:20:45 +0000 (13:20 -0700)]
[MLIR] Add an IfOp builder with results

Summary:
Add an additional builder to IfOp to allow the operation to
define operands.

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

4 years ago[ValueTracking] Fix usage of DataLayout::getTypeStoreSize()
Huihui Zhang [Fri, 20 Mar 2020 23:52:03 +0000 (16:52 -0700)]
[ValueTracking] Fix usage of DataLayout::getTypeStoreSize()

Summary:
DataLayout::getTypeStoreSize() returns TypeSize.

For cases where it can not be scalable vector (e.g., GlobalVariable),
explicitly call TypeSize::getFixedSize().

For cases where scalable property doesn't matter, (e.g., check for
zero-sized type), use TypeSize::isNonZero().

Reviewers: sdesmalen, efriedma, apazos, reames

Reviewed By: efriedma

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years agoTemporarily Revert "Create basic SBEnvironment class"
Adrian Prantl [Fri, 20 Mar 2020 23:47:50 +0000 (16:47 -0700)]
Temporarily Revert "Create basic SBEnvironment class"

while investigating bot breakage.

This reverts commit 2dec82652e4b6424e46e7bd674cb6404e01e218e.

4 years agoDriver: Improve performance of getSDKName()
Adrian Prantl [Fri, 20 Mar 2020 23:40:57 +0000 (16:40 -0700)]
Driver: Improve performance of getSDKName()

The ".sdk" component is usually the last one in the -isysroot, so it
makes more sense to scan from the back. Also, technically, someone
could install Xcode into a directory ending with .sdk, which would
break this heuristic.

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

4 years ago[MLIR] Fix Xcode build due to incorrect library path
Aaron Smith [Fri, 20 Mar 2020 23:38:16 +0000 (16:38 -0700)]
[MLIR] Fix Xcode build due to incorrect library path

Two MLIR examples do not link because the library path is different when using Xcode vs Makefiles.
This change adds the configuration name to the library path when building with Xcode.

i.e. LLVM_BUILD_DIR/debug/lib

4 years ago[mlir][AVX512] Hotfix - Add cmake dependence on MLIRSideEffects
Nicolas Vasilache [Fri, 20 Mar 2020 23:34:52 +0000 (19:34 -0400)]
[mlir][AVX512] Hotfix - Add cmake dependence on MLIRSideEffects

4 years ago[libc++] Properly handle environment variables with '=' in them
Louis Dionne [Fri, 20 Mar 2020 23:28:36 +0000 (19:28 -0400)]
[libc++] Properly handle environment variables with '=' in them

4 years agoAllow remapping the sysroot with -fdebug-prefix-map.
Adrian Prantl [Wed, 18 Mar 2020 22:48:23 +0000 (15:48 -0700)]
Allow remapping the sysroot with -fdebug-prefix-map.

<rdar://problem/55685132>

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

4 years agoRevert "Allow remapping the sysroot with -fdebug-prefix-map."
Adrian Prantl [Fri, 20 Mar 2020 23:27:23 +0000 (16:27 -0700)]
Revert "Allow remapping the sysroot with -fdebug-prefix-map."

This reverts commit 6725c4836a5b3c11227869a6f456019a244aa29f.

4 years ago[clang-tidy] Merge common code between llvmlibc-restrict-system-libc-headers and...
Paula Toth [Fri, 20 Mar 2020 22:52:39 +0000 (15:52 -0700)]
[clang-tidy] Merge common code between llvmlibc-restrict-system-libc-headers and portability-restrict-system-includes

Summary:
Made llvmlibc::RestrictSystemLibcHeadersCheck a subclass of protability::RestrictSystemIncludesCheck to re-use common code between the two.
This also adds the ability to white list linux development headers.

Reviewers: aaron.ballman

Reviewed By: aaron.ballman

Subscribers: mgorny, xazax.hun, MaskRay, cfe-commits, sivachandra

Tags: #clang-tools-extra, #clang

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

4 years agoAllow remapping the sysroot with -fdebug-prefix-map.
Adrian Prantl [Wed, 18 Mar 2020 22:48:23 +0000 (15:48 -0700)]
Allow remapping the sysroot with -fdebug-prefix-map.

<rdar://problem/55685132>

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

4 years ago[libc++] Make the %run substitution closer to how .pass.cpp tests are executed
Louis Dionne [Fri, 20 Mar 2020 22:11:38 +0000 (18:11 -0400)]
[libc++] Make the %run substitution closer to how .pass.cpp tests are executed

Before this patch, the %run substitution did not contain the same
environment variables as normal `pass.cpp` tests. It also didn't
have the right working directory and the script wasn't aware of
potential file dependencies.

With this change, the combination of %build and %run in a .sh.cpp script
should match how pass.cpp tests are actually executed much more closely.

4 years ago[mlir] [VectorOps] Introduce vector.transpose
aartbik [Fri, 20 Mar 2020 21:18:21 +0000 (14:18 -0700)]
[mlir] [VectorOps] Introduce vector.transpose

Summary: Introduced in order to introduce specialized lowering passes that implement transposition operations efficiently.

Reviewers: nicolasvasilache, andydavis1

Reviewed By: nicolasvasilache

Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, llvm-commits

Tags: #llvm

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

4 years agoEnable CUDA offloading on aarch64 host
George Rokos [Fri, 20 Mar 2020 22:38:47 +0000 (15:38 -0700)]
Enable CUDA offloading on aarch64 host

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