platform/upstream/llvm.git
6 years ago[AMDGPU] Avoid using divergent value in mubuf addr64 descriptor
Tim Renouf [Thu, 2 Aug 2018 22:53:57 +0000 (22:53 +0000)]
[AMDGPU] Avoid using divergent value in mubuf addr64 descriptor

Summary:
This fixes a problem where a load from global+idx generated incorrect
code on <=gfx7 when the index is divergent.

Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl, dstuttard, t-tye, llvm-commits

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

Change-Id: Ib4d177d6254b1dd3f8ec0203fdddec94bd8bc5ed
llvm-svn: 338779

6 years ago[MS Demangler] Fix some tests that are no longer broken.
Zachary Turner [Thu, 2 Aug 2018 22:37:40 +0000 (22:37 +0000)]
[MS Demangler] Fix some tests that are no longer broken.

These were fixed with earlier patches, but had not yet been
re-enabled.

llvm-svn: 338778

6 years ago[analyzer] Obtain a ReturnStmt from a CFGAutomaticObjDtor.
Reka Kovacs [Thu, 2 Aug 2018 22:31:03 +0000 (22:31 +0000)]
[analyzer] Obtain a ReturnStmt from a CFGAutomaticObjDtor.

The CoreEngine only gives us a ReturnStmt if the last element in the
CFGBlock is a CFGStmt, otherwise the ReturnStmt is nullptr.
This patch adds support for the case when the last element is a
CFGAutomaticObjDtor, by returning its TriggerStmt as a ReturnStmt.

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

llvm-svn: 338777

6 years ago[libFuzzer] Initial implementation of weighted mutation leveraging during runtime.
Max Moroz [Thu, 2 Aug 2018 22:30:03 +0000 (22:30 +0000)]
[libFuzzer] Initial implementation of weighted mutation leveraging during runtime.

Summary:
Added functions that calculate stats while fuzz targets are running and give
mutations weight based on how much new coverage they provide, and choose better
performing mutations more often.

Patch by Kodé Williams (@kodewilliams).

Reviewers: Dor1s, metzman, morehouse

Reviewed By: Dor1s, morehouse

Subscribers: delcypher, kcc, llvm-commits, #sanitizers

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

llvm-svn: 338776

6 years ago[analyzer] Add a safety check to InnerPointerChecker.
Reka Kovacs [Thu, 2 Aug 2018 22:19:57 +0000 (22:19 +0000)]
[analyzer] Add a safety check to InnerPointerChecker.

Do not crash if the CXXRecordDecl of an object is not available.

llvm-svn: 338775

6 years ago[Hexagon] Simplify CFG after atomic expansion
Krzysztof Parzyszek [Thu, 2 Aug 2018 22:17:53 +0000 (22:17 +0000)]
[Hexagon] Simplify CFG after atomic expansion

This will remove suboptimal branching from the generated ll/sc loops.
The extra simplification pass affects a lot of testcases, which have
been modified to accommodate this change: either by modifying the
test to become immune to the CFG simplification, or (less preferablt)
by adding option -hexagon-initial-cfg-clenaup=0.

llvm-svn: 338774

6 years ago[lldb] Remove unused variable.
David L. Jones [Thu, 2 Aug 2018 21:45:05 +0000 (21:45 +0000)]
[lldb] Remove unused variable.

The use of this variable was removed in r338734. It now causes unused variable warnings.

llvm-svn: 338772

6 years ago[WebAssembly] Support for atomic.wait / atomic.wake builtins
Heejin Ahn [Thu, 2 Aug 2018 21:44:40 +0000 (21:44 +0000)]
[WebAssembly] Support for atomic.wait / atomic.wake builtins

Summary:
Add support for atomic.wait / atomic.wake builtins based on the Wasm
thread proposal.

Reviewers: dschuff

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

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

llvm-svn: 338771

6 years ago[WebAssembly] Support for atomic.wait / atomic.wake instructions
Heejin Ahn [Thu, 2 Aug 2018 21:44:24 +0000 (21:44 +0000)]
[WebAssembly] Support for atomic.wait / atomic.wake instructions

Summary:
This adds support for atomic.wait / atomic.wake instructions in the wasm
thread proposal.

Reviewers: dschuff

Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits

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

llvm-svn: 338770

6 years ago[lldbsuite, windows] Mark tests as XFAIL on Windows or skip them
Stella Stamenova [Thu, 2 Aug 2018 21:26:19 +0000 (21:26 +0000)]
[lldbsuite, windows] Mark tests as XFAIL on Windows or skip them

Summary:
1) Several tests that are flakey on windows fail the run even if they are marked as expected to be flakey. This is because they fail frequently enough that even a retry won't help
2) Skip several tests on Windows that will occasionally hang rather than failing or exiting. This is causing the entire test suite to hang

Reviewers: asmith, labath, zturner

Reviewed By: zturner

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

llvm-svn: 338769

6 years ago[Unittests] Fix returning string in SolveQuadraticEquationWrap
Krzysztof Parzyszek [Thu, 2 Aug 2018 20:45:06 +0000 (20:45 +0000)]
[Unittests] Fix returning string in SolveQuadraticEquationWrap

Returning a Twine caused runtime failures. Convert it to std::string
before retuning.

llvm-svn: 338768

6 years agoSet IsUsedInRegularObj in a consistent manor between COFF, ELF and wasm. NFC
Sam Clegg [Thu, 2 Aug 2018 20:39:19 +0000 (20:39 +0000)]
Set IsUsedInRegularObj in a consistent manor between COFF, ELF and wasm.  NFC

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

llvm-svn: 338767

6 years agoFix assertion failure when emitting code for a merged lambda.
Richard Smith [Thu, 2 Aug 2018 20:30:52 +0000 (20:30 +0000)]
Fix assertion failure when emitting code for a merged lambda.

llvm-svn: 338766

6 years ago[X86] Autogenerate complete checks. NFC
Craig Topper [Thu, 2 Aug 2018 20:28:45 +0000 (20:28 +0000)]
[X86] Autogenerate complete checks. NFC

llvm-svn: 338765

6 years ago[ORC] Add a re-exports fallback definition generator.
Lang Hames [Thu, 2 Aug 2018 20:13:58 +0000 (20:13 +0000)]
[ORC] Add a re-exports fallback definition generator.

An instance of ReexportsFallbackDefinitionGenerator can be attached to a VSO
(via setFallbackDefinitionGenerator) to re-export symbols on demandy from a
backing VSO.

llvm-svn: 338764

6 years agoReland "[clang-doc] Refactoring mapper to map by scope"
Julie Hockett [Thu, 2 Aug 2018 20:10:17 +0000 (20:10 +0000)]
Reland "[clang-doc] Refactoring mapper to map by scope"

Relanding with a minor change to prevent an assertion on release bots.

The result of this adjusted mapper pass is that all Function and Enum
infos are absorbed into the info of their enclosing scope (i.e. the class
or namespace in which they are defined). Namespace and Record infos are
passed along to the final output, but the second pass creates a reference
to each in its parent scope. As a result, the top-level final outputs are
Namespaces and Records.

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

llvm-svn: 338763

6 years ago[Support] Add an enable bit to our DebugCounters
George Burgess IV [Thu, 2 Aug 2018 19:50:27 +0000 (19:50 +0000)]
[Support] Add an enable bit to our DebugCounters

r337748 made us start incrementing DebugCounters all of the time. This
makes tsan unhappy in multithreaded environments.

Since it doesn't make much sense to use DebugCounters with multiple
threads, this patch makes us only count anything if the user passed a
-debug-counter option or if some other piece of code explicitly asks
for it (e.g. the pass in D50031).

The amount of global state here makes writing a unittest for this
behavior somewhat awkward. So, no test is provided.

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

llvm-svn: 338762

6 years agoUnbreak build after r338758: specify lambda return type explicitly
Krzysztof Parzyszek [Thu, 2 Aug 2018 19:38:18 +0000 (19:38 +0000)]
Unbreak build after r338758: specify lambda return type explicitly

llvm-svn: 338760

6 years ago[DebugInfo/DWARF] Remove redundant iterator type. NFC
Paul Robinson [Thu, 2 Aug 2018 19:29:38 +0000 (19:29 +0000)]
[DebugInfo/DWARF] Remove redundant iterator type. NFC

llvm-svn: 338759

6 years ago[SCEV] Properly solve quadratic equations
Krzysztof Parzyszek [Thu, 2 Aug 2018 19:13:35 +0000 (19:13 +0000)]
[SCEV] Properly solve quadratic equations

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

llvm-svn: 338758

6 years ago[OpenMP] Fix doacross testing for gcc
Jonathan Peyton [Thu, 2 Aug 2018 19:13:07 +0000 (19:13 +0000)]
[OpenMP] Fix doacross testing for gcc

This patch adds a test using the doacross clauses in OpenMP and removes gcc from
testing kmp_doacross_check.c which is only testing the kmp rather than the
gomp interface.

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

llvm-svn: 338757

6 years ago[analyzer] Fix tests.
George Karpenkov [Thu, 2 Aug 2018 18:41:25 +0000 (18:41 +0000)]
[analyzer] Fix tests.

llvm-svn: 338756

6 years ago[Support] [NFC] change comment about retries in createUniqueEntity
Bob Haarman [Thu, 2 Aug 2018 18:27:21 +0000 (18:27 +0000)]
[Support] [NFC] change comment about retries in createUniqueEntity

Rewording as requested on D50126 after the change was pushed.

llvm-svn: 338755

6 years agoAMDGPU: Fix missing declaration of queue ptr builtin
Matt Arsenault [Thu, 2 Aug 2018 18:24:55 +0000 (18:24 +0000)]
AMDGPU: Fix missing declaration of queue ptr builtin

llvm-svn: 338754

6 years ago[analyzer] Forward arguments in registerChecker to avoid accidental copies
George Karpenkov [Thu, 2 Aug 2018 18:17:01 +0000 (18:17 +0000)]
[analyzer] Forward arguments in registerChecker to avoid accidental copies

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

llvm-svn: 338753

6 years ago[NFC] clang-format cleanup of a couple files in llvm-objcopy.
Puyan Lotfi [Thu, 2 Aug 2018 18:16:52 +0000 (18:16 +0000)]
[NFC] clang-format cleanup of a couple files in llvm-objcopy.

llvm-svn: 338752

6 years agoCMake: Remove LLVM_DYLIB_SYMBOL_VERSIONING
Tom Stellard [Thu, 2 Aug 2018 18:16:10 +0000 (18:16 +0000)]
CMake: Remove LLVM_DYLIB_SYMBOL_VERSIONING

Summary:
This option is no longer needed since r300496 added symbol
versioning by default

Reviewers: sylvestre.ledru, beanz, mgorny

Reviewed By: mgorny

Subscribers: llvm-commits

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

llvm-svn: 338751

6 years ago[LLD] Update split stack support to handle more generic prologues. Improve error...
Jordan Rupprecht [Thu, 2 Aug 2018 18:13:40 +0000 (18:13 +0000)]
[LLD] Update split stack support to handle more generic prologues. Improve error handling. Add test file for better code-coverage. Update tests to be more complete.

Submitting patch on behalf of saugustine.

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

llvm-svn: 338750

6 years agoWork around more GCC miscompiles exposed by r338464.
Martin Storsjo [Thu, 2 Aug 2018 18:12:08 +0000 (18:12 +0000)]
Work around more GCC miscompiles exposed by r338464.

This is the same fix as in r338478, for another occurrance of the
same pattern from r338464.

See gcc.gnu.org/PR86769 for details of the bug.

llvm-svn: 338749

6 years agoRevert "[clang-doc] Refactoring mapper to map by scope"
Julie Hockett [Thu, 2 Aug 2018 18:01:37 +0000 (18:01 +0000)]
Revert "[clang-doc] Refactoring mapper to map by scope"

This reverts commit r338738 as it's breaking the bots.

llvm-svn: 338748

6 years ago[itanium demangler] Support dot suffixes on block invocation functions
Erik Pilkington [Thu, 2 Aug 2018 17:45:01 +0000 (17:45 +0000)]
[itanium demangler] Support dot suffixes on block invocation functions

rdar://32378759

llvm-svn: 338747

6 years agoFix CMake build.
Zachary Turner [Thu, 2 Aug 2018 17:44:41 +0000 (17:44 +0000)]
Fix CMake build.

Some new files were committed to the repository but not added
to the CMakeLists.txt, so this patch fixes the build.

llvm-svn: 338746

6 years ago[Support] fix TempFile infinite loop and permission denied errors
Bob Haarman [Thu, 2 Aug 2018 17:41:38 +0000 (17:41 +0000)]
[Support] fix TempFile infinite loop and permission denied errors

Summary:
On Windows, TempFile::create() was prone to failing with permission
denied errors when a process created many tempfiles without providing
a model large enough to accommodate them. There was also a problem
with createUniqueEntity getting into an infinite loop when all names
permitted by the model are in use. This change fixes both of these
problems and adds a unit test for them.

Reviewers: pcc, rnk, zturner

Reviewed By: zturner

Subscribers: inglorion, hiraditya, llvm-commits

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

llvm-svn: 338745

6 years ago[WebAssembly] Ensure bitcasts that would result in invalid wasm are removed by FixFun...
Sam Clegg [Thu, 2 Aug 2018 17:38:06 +0000 (17:38 +0000)]
[WebAssembly] Ensure bitcasts that would result in invalid wasm are removed by FixFunctionBitcasts

Rather than allowing invalid bitcasts to be lowered to wasm
call instructions that won't validate, generate wrappers that
contain unreachable thereby delaying the error until runtime.

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

llvm-svn: 338744

6 years ago__c11_atomic_load's _Atomic can be const
JF Bastien [Thu, 2 Aug 2018 17:35:46 +0000 (17:35 +0000)]
__c11_atomic_load's _Atomic can be const

Summary:
C++11 onwards specs the non-member functions atomic_load and atomic_load_explicit as taking the atomic<T> by const (potentially volatile) pointer. C11, in its infinite wisdom, decided to drop the const, and C17 will fix this with DR459 (the current draft forgot to fix B.16, but that’s not the normative part).

clang’s lib/Headers/stdatomic.h implements these as #define to the __c11_* equivalent, which are builtins with custom typecheck. Fix the typecheck.

D47613 takes care of the libc++ side.

Discussion: http://lists.llvm.org/pipermail/cfe-dev/2018-May/058129.html

<rdar://problem/27426936>

Reviewers: rsmith

Subscribers: cfe-commits

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

llvm-svn: 338743

6 years agoFix one more warning.
Zachary Turner [Thu, 2 Aug 2018 17:33:33 +0000 (17:33 +0000)]
Fix one more warning.

llvm-svn: 338742

6 years ago[c-index-test] Use correct executable path to discover resource directory.
Volodymyr Sapsai [Thu, 2 Aug 2018 17:29:53 +0000 (17:29 +0000)]
[c-index-test] Use correct executable path to discover resource directory.

Driver builds resource directory path based on provided executable path.
Instead of string "clang" use actual executable path.

rdar://problem/42699514

Reviewers: nathawes, akyrtzi, bob.wilson

Reviewed By: akyrtzi

Subscribers: dexonsmith, cfe-commits

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

llvm-svn: 338741

6 years agoUpdate the LLVM VS integration to sign the assembly.
Zachary Turner [Thu, 2 Aug 2018 17:20:31 +0000 (17:20 +0000)]
Update the LLVM VS integration to sign the assembly.

llvm-svn: 338740

6 years agoFix a couple of warnings.
Zachary Turner [Thu, 2 Aug 2018 17:18:01 +0000 (17:18 +0000)]
Fix a couple of warnings.

llvm-svn: 338739

6 years ago[clang-doc] Refactoring mapper to map by scope
Julie Hockett [Thu, 2 Aug 2018 17:17:19 +0000 (17:17 +0000)]
[clang-doc] Refactoring mapper to map by scope

The result of this adjusted mapper pass is that all Function and Enum
infos are absorbed into the info of their enclosing scope (i.e. the
class or namespace in which they are defined). Namespace and Record
infos are passed along to the final output, but the second pass creates
a reference to each in its parent scope. As a result, the top-level final
outputs are Namespaces and Records.

llvm-svn: 338738

6 years agoUse %.*s instead of %*s when formatting strings with explicit length.
Zachary Turner [Thu, 2 Aug 2018 17:08:24 +0000 (17:08 +0000)]
Use %.*s instead of %*s when formatting strings with explicit length.

llvm-svn: 338737

6 years ago[MS Demangler] Resolve back-references lazily.
Zachary Turner [Thu, 2 Aug 2018 17:08:03 +0000 (17:08 +0000)]
[MS Demangler] Resolve back-references lazily.

We need to both record and resolve back-references lazily due to
not being able to know until a demangling is complete whether or
not a name should go into the back-reference table..  This patch
implements lazy resolution of back-references, but we still have
eager recording of back-references.  This will be fixed in a
subsequent patch.

llvm-svn: 338736

6 years ago[X86] Allow fake unary unpckhpd and movhlps to be commuted for execution domain fixin...
Craig Topper [Thu, 2 Aug 2018 16:48:01 +0000 (16:48 +0000)]
[X86] Allow fake unary unpckhpd and movhlps to be commuted for execution domain fixing purposes

These instructions perform the same operation, but the semantic of which operand is destroyed is reversed. If the same register is used as both operands we can change the execution domain without worrying about this difference.

Unfortunately, this really only works in cases where the input register is killed by the instruction. If its not killed, the two address isntruction pass inserts a copy that will become a move instruction. This makes the instruction use different physical registers that contain the same data at the time the unpck/movhlps executes. I've considered using a unary pseudo instruction with tied operand to trick the two address instruction pass. We could then expand the pseudo post regalloc to get the same physical register on both inputs.

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

llvm-svn: 338735

6 years agoAdd support for ARM and ARM64 breakpad generated minidump files
Greg Clayton [Thu, 2 Aug 2018 16:46:15 +0000 (16:46 +0000)]
Add support for ARM and ARM64 breakpad generated minidump files

In this patch I add support for ARM and ARM64 break pad files. There are two flavors of ARM: Apple where FP is R7, and non Apple where FP is R11. Added minimal tests that load up ARM64 and the two flavors or ARM core files with a single thread and known register values in each register. Each register is checked for the exact value.

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

llvm-svn: 338734

6 years agoAdd byte counting mechanism to LLDB's Stream class.
Raphael Isemann [Thu, 2 Aug 2018 16:38:34 +0000 (16:38 +0000)]
Add byte counting mechanism to LLDB's Stream class.

Summary:
This patch allows LLDB's Stream class to count the bytes it has written to so far.

There are two major motivations for this patch:

The first one is that this will allow us to get rid of all the handwritten byte counting code
we have in LLDB so far. Examples for this are pretty much all functions in LLDB that
take a Stream to write to and return a size_t, which usually represents the bytes written.

By moving to this centralized byte counting mechanism, we hopefully can avoid some
tricky errors that happen when some code forgets to count the written bytes while
writing something to a stream.

The second motivation is that this is needed for the migration away from LLDB's `Stream`
and towards LLVM's `raw_ostream`. My current plan is to start offering a fake raw_ostream
class that just forwards to a LLDB Stream.

However, for this raw_ostream wrapper we need to fulfill the raw_ostream interface with
LLDB's Stream, which currently lacks the ability to count the bytes written so far (which
raw_ostream exposes by it's `tell()` method). By adding this functionality it is trivial to start
rolling out our raw_ostream wrapper (and then eventually completely move to raw_ostream).

Also, once this fake raw_ostream is available, we can start replacing our own code writing
to LLDB's Stream by LLVM code writing to raw_ostream. The best example for this is the
LEB128 encoding we currently ship, which can be replaced with by LLVM's version which
accepts an raw_ostream.

From the point of view of the pure source changes this test does, we essentially just renamed
the Write implementation in Stream to `WriteImpl` while the `Write` method everyone is using
to write its raw bytes is now just forwarding and counting the written bytes.

Reviewers: labath, davide

Reviewed By: labath

Subscribers: JDevlieghere, lldb-commits

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

llvm-svn: 338733

6 years ago[analyzer] Make RegionVector use const reference
Fangrui Song [Thu, 2 Aug 2018 16:29:36 +0000 (16:29 +0000)]
[analyzer] Make RegionVector use const reference

llvm-svn: 338732

6 years ago[SLC] Refactor simplification of pow() (NFC)
Evandro Menezes [Thu, 2 Aug 2018 15:43:57 +0000 (15:43 +0000)]
[SLC] Refactor simplification of pow() (NFC)

llvm-svn: 338730

6 years ago[X86][SSE] Add uniform/non-uniform exact sdiv vector tests covering all paths
Simon Pilgrim [Thu, 2 Aug 2018 15:34:51 +0000 (15:34 +0000)]
[X86][SSE] Add uniform/non-uniform exact sdiv vector tests covering all paths

Regenerated tests and tested on 64-bit (AVX2) as well.

llvm-svn: 338729

6 years ago[InstCombine] [NFC] Tests for select with binop fold
David Bolvansky [Thu, 2 Aug 2018 14:59:23 +0000 (14:59 +0000)]
[InstCombine] [NFC] Tests for select with binop fold

llvm-svn: 338727

6 years ago[LLD][ELF] - Remove dead check from adjustSplitStackFunctionPrologues().
George Rimar [Thu, 2 Aug 2018 14:44:39 +0000 (14:44 +0000)]
[LLD][ELF] - Remove dead check from adjustSplitStackFunctionPrologues().

In according to the comment, undefined symbol should never reach there.
So, should be able to remove the check. I am assuming this is NFC.

llvm-svn: 338723

6 years ago[LLD][ELF] - An attemp to fix BB after rL338718.
George Rimar [Thu, 2 Aug 2018 14:34:39 +0000 (14:34 +0000)]
[LLD][ELF] - An attemp to fix BB after rL338718.

BB is unhappy :`-(
http://lab.llvm.org:8011/builders/lld-perf-testsuite/builds/5632

llvm-svn: 338722

6 years ago[OMPT] Disable by default on Windows
Jonas Hahnfeld [Thu, 2 Aug 2018 14:34:08 +0000 (14:34 +0000)]
[OMPT] Disable by default on Windows

This is broken per PR36561 and PR36574, so disable it for now until
somebody interested can take a look. OMPT can still be activated manually
by passing -DLIBOMP_OMPT_SUPPORT=ON during configuration.

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

llvm-svn: 338721

6 years ago[tests] Add annotations for taskloop features
Jonas Hahnfeld [Thu, 2 Aug 2018 14:34:03 +0000 (14:34 +0000)]
[tests] Add annotations for taskloop features

Only supported since GCC 6 and Intel 17.0. However GCC 6.3.0 is
crashing on two of the tests, so disable them as well...

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

llvm-svn: 338720

6 years ago[InstSimplify] move minnum/maxnum with undef fold from instcombine
Sanjay Patel [Thu, 2 Aug 2018 14:33:40 +0000 (14:33 +0000)]
[InstSimplify] move minnum/maxnum with undef fold from instcombine

llvm-svn: 338719

6 years ago[LLD][ELF] - Remove excessive cases from getRelocTargetVA(). NFC.
George Rimar [Thu, 2 Aug 2018 14:15:02 +0000 (14:15 +0000)]
[LLD][ELF] - Remove excessive cases from getRelocTargetVA(). NFC.

There is no point to explicitly proccess the expressions this patch removes.
We already have a llvm_unreachable for the default case.

llvm-svn: 338718

6 years ago[ARM][NFC] Follow up of r338568
Sjoerd Meijer [Thu, 2 Aug 2018 14:04:48 +0000 (14:04 +0000)]
[ARM][NFC] Follow up of r338568

I disabled more tests than necessary, this enables them.

llvm-svn: 338717

6 years ago[ValueTracking] fix maxnum miscompile for cannotBeOrderedLessThanZero (PR37776)
Sanjay Patel [Thu, 2 Aug 2018 13:46:20 +0000 (13:46 +0000)]
[ValueTracking] fix maxnum miscompile for cannotBeOrderedLessThanZero (PR37776)

This adds the NAN checks suggested in PR37776:
https://bugs.llvm.org/show_bug.cgi?id=37776

If both operands to maxnum are NAN, that should get constant folded, so we don't
have to handle that case. This is the same assumption as other FP ops in this
function. Returning 'false' is always conservatively correct.

Copying from the bug report:

Currently, we have this for "when is cannotBeOrderedLessThanZero
(mustBePositiveOrNaN) true for maxnum":
               L
        -------------------
        | Pos | Neg | NaN |
   ------------------------
   |Pos |  x  |  x  |  x  |
   ------------------------
 R |Neg |  x  |     |  x  |
   ------------------------
   |NaN |  x  |  x  |  x  |
   ------------------------

The cases with (Neg & NaN) are wrong. We should have:

                L
        -------------------
        | Pos | Neg | NaN |
   ------------------------
   |Pos |  x  |  x  |  x  |
   ------------------------
 R |Neg |  x  |     |     |
   ------------------------
   |NaN |  x  |     |  x  |
   ------------------------

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

llvm-svn: 338716

6 years agoDAG: Fix vector widening fcanonicalize
Matt Arsenault [Thu, 2 Aug 2018 13:43:53 +0000 (13:43 +0000)]
DAG: Fix vector widening fcanonicalize

llvm-svn: 338715

6 years agoAMDGPU: Fix scalarizing v4f16 fcanonicalize
Matt Arsenault [Thu, 2 Aug 2018 13:43:42 +0000 (13:43 +0000)]
AMDGPU: Fix scalarizing v4f16 fcanonicalize

llvm-svn: 338714

6 years ago[LLD][ELF] - Remove dead code. NFC.
George Rimar [Thu, 2 Aug 2018 13:18:49 +0000 (13:18 +0000)]
[LLD][ELF] - Remove dead code. NFC.

It does not seem that this code is alive.
I seems was needed previously but we fixed it.

If it is still needed, it needs new tests,
but for now I do not know how to trigger it,
and so I removed it.

llvm-svn: 338713

6 years agoMove ClangHighlighter.cpp to hopefully better place in Xcode project.
Tim Northover [Thu, 2 Aug 2018 12:50:23 +0000 (12:50 +0000)]
Move ClangHighlighter.cpp to hopefully better place in Xcode project.

But with a write-only format, who can really say?

llvm-svn: 338712

6 years ago[llvm-ar] Fix help text test. NFC.
Ben Dunbobbin [Thu, 2 Aug 2018 12:27:01 +0000 (12:27 +0000)]
[llvm-ar] Fix help text test. NFC.

Missed from @338703

llvm-svn: 338709

6 years ago[LLD][ELF] - Remove redundant code. NFC.
George Rimar [Thu, 2 Aug 2018 12:20:36 +0000 (12:20 +0000)]
[LLD][ELF] - Remove redundant code. NFC.

Code was never executed with our test cases,
though it is valid and I think we can always run it.
This improves code coverage.

llvm-svn: 338708

6 years agoTry to make builtin address space declarations not useless
Matt Arsenault [Thu, 2 Aug 2018 12:14:28 +0000 (12:14 +0000)]
Try to make builtin address space declarations not useless

The way address space declarations for builtins currently work
is nearly useless. The code assumes the address spaces used for
builtins is a confusingly named "target address space" from user
code using __attribute__((address_space(N))) that matches
the builtin declaration. There's no way to use this to declare
a builtin that returns a language specific address space.
The terminology used is highly cofusing since it has nothing
to do with the the address space selected by the target to use
for a language address space.

This feature is essentially unused as-is. AMDGPU and NVPTX
are the only in-tree targets attempting to use this. The AMDGPU
builtins certainly do not behave as intended (i.e. all of the
builtins returning pointers can never compile because the numbered
address space never matches the expected named address space).

The NVPTX builtins are missing tests for some, and the others
seem to rely on an implicit addrspacecast.

Change the used address space for builtins based on a target
hook to allow using a language address space for a builtin.
This allows the same builtin declaration to be used for multiple
languages with similarly purposed address spaces (e.g. the same
AMDGPU builtin can be used in OpenCL and CUDA even though the
constant address spaces are arbitarily different).

This breaks the possibility of using arbitrary numbered
address spaces alongside the named address spaces for builtins.
If this is an issue we probably need to introduce another builtin
declaration character to distinguish language address spaces from
so-called "target address spaces".

llvm-svn: 338707

6 years agoclang-format: fix a crash in comment wraps.
Martin Probst [Thu, 2 Aug 2018 11:52:08 +0000 (11:52 +0000)]
clang-format: fix a crash in comment wraps.

Summary:
Previously, clang-format would crash if it tried to wrap an overlong
single line comment, because two parts of the code inserted a break in
the same location.

    /** heregoesalongcommentwithnospace */

This wasn't previously noticed as it could only trigger for an overlong
single line comment that did have no breaking opportunities except for a
whitespace at the very beginning.

This also introduces a check for JavaScript to not ever wrap a comment
before an opening curly brace:

    /** @mods {donotbreakbeforethecurly} */

This is because some machinery parsing these tags sometimes supports
breaks before a possible `{`, but in some other cases does not.
Previously clang-format was careful never to wrap a line with certain
tags on it. The better solution is to specifically disable wrapping
before the problematic token: this allows wrapping and aligning comments
but still avoids the problem.

Reviewers: krasimir

Subscribers: cfe-commits

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

llvm-svn: 338706

6 years ago[lld] Make tests calling llvm-ar more robust
Chris Jackson [Thu, 2 Aug 2018 11:33:54 +0000 (11:33 +0000)]
[lld] Make tests calling llvm-ar more robust

Some lit tests that call llvm-ar use the 'r' flag. If the target archive
already exists and is in a corrupt state, this can cause the test to fail. We
have added 'rm -f' calls before the llvm-ar calls to increase the
robustness of the tests.

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

llvm-svn: 338705

6 years ago[llvm-ar] Correct help text
Ben Dunbobbin [Thu, 2 Aug 2018 11:27:38 +0000 (11:27 +0000)]
[llvm-ar] Correct help text

Corrected and simplified the help text.

It was clearly too difficult to maintain before (see e.g. @227296) making it
simpler and more consistent it should help people keep it up to date.

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

llvm-svn: 338703

6 years ago[llvm-mca] Use a vector to store ResourceState objects in the ResourceManager.
Andrea Di Biagio [Thu, 2 Aug 2018 11:12:35 +0000 (11:12 +0000)]
[llvm-mca] Use a vector to store ResourceState objects in the ResourceManager.

We don't need to use a map to store ResourceState objects. The number of
processor resources is known statically from the scheduling model. We can
therefore use a vector, and reserve a slot for each processor resource that we
want to simulate.
Every time the ResourceManager queries the ResourceState vector, the index to
the vector of ResourceState objects can be easily computed from the processor
resource mask.

This drastically reduces the time complexity of method ResourceManager::use() and
method ResourceManager::release(). This patch gives an average speedup of 12%.

llvm-svn: 338702

6 years ago[llvm-exegesis] Rename InstructionInstance into InstructionBuilder.
Guillaume Chatelet [Thu, 2 Aug 2018 11:12:02 +0000 (11:12 +0000)]
[llvm-exegesis] Rename InstructionInstance into InstructionBuilder.

Summary: Non functional change.

Subscribers: tschuett, courbet, llvm-commits

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

llvm-svn: 338701

6 years agoAdd header guard to asan_report.h
Filipe Cabecinhas [Thu, 2 Aug 2018 11:05:07 +0000 (11:05 +0000)]
Add header guard to asan_report.h

llvm-svn: 338700

6 years ago[LLD][ELF] - Simplify. NFC.
George Rimar [Thu, 2 Aug 2018 10:59:28 +0000 (10:59 +0000)]
[LLD][ELF] - Simplify. NFC.

isHeaderSection can be useful I believe,
but probably not right now and not
for this case.

llvm-svn: 338699

6 years ago[X86][SSE] Add more UDIV nonuniform-constant vector tests
Simon Pilgrim [Thu, 2 Aug 2018 10:53:53 +0000 (10:53 +0000)]
[X86][SSE] Add more UDIV nonuniform-constant vector tests

Ensure we cover all paths for vector data as requested on D49248

llvm-svn: 338698

6 years ago[LLD] Do not overwrite LMAOffset of PT_LOAD header
George Rimar [Thu, 2 Aug 2018 10:45:46 +0000 (10:45 +0000)]
[LLD] Do not overwrite LMAOffset of PT_LOAD header

Patch by Konstantin Schwarz!

If more than a single output section is added to a PT_LOAD header,
only the first section should set the LMAOffset of the segment.
Otherwise, we get a load-address overlap error

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

llvm-svn: 338697

6 years agoReplace hardcoded format styles in a few tools with the default style in libFormat.
Eric Liu [Thu, 2 Aug 2018 10:30:56 +0000 (10:30 +0000)]
Replace hardcoded format styles in a few tools with the default style in libFormat.

llvm-svn: 338696

6 years agoUnit test for Symtab::InitNameIndexes
Stefan Granitz [Thu, 2 Aug 2018 10:13:18 +0000 (10:13 +0000)]
Unit test for Symtab::InitNameIndexes

Summary: In order to exploit the potential of LLVM's new ItaniumPartialDemangler for indexing in LLDB, we expect conceptual changes in the implementation of the InitNameIndexes function. Here is a unit test that aims at covering all relevant code paths in that function.

Reviewers: labath, jingham, JDevlieghere

Reviewed By: JDevlieghere

Subscribers: friss, teemperor, davide, clayborg, erik.pilkington, lldb-commits, mgorny

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

llvm-svn: 338695

6 years agoAdd include guard
Stefan Granitz [Thu, 2 Aug 2018 09:45:59 +0000 (09:45 +0000)]
Add include guard

Summary: Add missing include guard LLVM_DEMANGLE_DEMANGLE_H in llvm/Demangle/Demangle.h

Reviewers: erik.pilkington

Subscribers: llvm-commits

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

llvm-svn: 338694

6 years ago[X86][SSE] Pull out duplicate VSELECT to shuffle mask code. NFCI.
Simon Pilgrim [Thu, 2 Aug 2018 09:20:27 +0000 (09:20 +0000)]
[X86][SSE] Pull out duplicate VSELECT to shuffle mask code. NFCI.

llvm-svn: 338693

6 years ago[GlobalISel] Fix typo with missed override specifier
Alexander Ivchenko [Thu, 2 Aug 2018 08:55:05 +0000 (08:55 +0000)]
[GlobalISel] Fix typo with missed override specifier

llvm-svn: 338689

6 years ago[emacs] Indent statement continuation to match clang-format
Andrew Savonichev [Thu, 2 Aug 2018 08:50:41 +0000 (08:50 +0000)]
[emacs] Indent statement continuation to match clang-format

Summary:
Was:

  int LongVariableName =
    veryLongFunctionNameThatExceeds80ColumnsRule(SomeParameter);

  int ShortVar = veryLongFunctionNameThatStillFitsIntoOneLine(SomeParameter)
    .nowThisDoesntFit()
    .andThis()

Now:

  int LongVariableName =
      veryLongFunctionNameThatExceeds80ColumnsRule(SomeParameter);

  int ShortVar = veryLongFunctionNameThatStillFitsIntoOneLine(SomeParameter)
                     .nowThisDoesntFit()
                     .andThis()

Reviewers: espindola, MaskRay

Reviewed By: MaskRay

Subscribers: greened, llvm-commits

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

llvm-svn: 338686

6 years ago[GlobalISel] Rewrite CallLowering::lowerReturn to accept multiple VRegs per Value
Alexander Ivchenko [Thu, 2 Aug 2018 08:33:31 +0000 (08:33 +0000)]
[GlobalISel] Rewrite CallLowering::lowerReturn to accept multiple VRegs per Value

This is logical continuation of https://reviews.llvm.org/D46018 (r332449)

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

llvm-svn: 338685

6 years ago[LLD] Only increase LMARegion if different from MemRegion
George Rimar [Thu, 2 Aug 2018 08:13:56 +0000 (08:13 +0000)]
[LLD] Only increase LMARegion if different from MemRegion

Patch by Konstantin Schwarz!

If both the MemRegion and LMARegion are set for an output section in
a linker script, we should only increase the LMARegion if it is
different from the MemRegion. Otherwise, we reserve the memory twice.

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

llvm-svn: 338684

6 years agoutils/release/tag.sh: add debuginfo-tests to project list
Hans Wennborg [Thu, 2 Aug 2018 08:10:34 +0000 (08:10 +0000)]
utils/release/tag.sh: add debuginfo-tests to project list

llvm-svn: 338682

6 years ago[LLD] - Improve handling of AT> linker script commands
George Rimar [Thu, 2 Aug 2018 08:07:07 +0000 (08:07 +0000)]
[LLD] - Improve handling of AT> linker script commands

Patch by Konstantin Schwarz!

The condition to create a new phdr must also check the usage of "AT>"
linker script command, and create a new PT_LOAD header if a new LMARegion is used.

This fixes PR38307

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

llvm-svn: 338679

6 years agolit: bump version number
Hans Wennborg [Thu, 2 Aug 2018 07:48:44 +0000 (07:48 +0000)]
lit: bump version number

llvm-svn: 338677

6 years ago[UnJ] Add debug messages for why loops are not unrolled. NFC
David Green [Thu, 2 Aug 2018 07:30:53 +0000 (07:30 +0000)]
[UnJ] Add debug messages for why loops are not unrolled. NFC

Adds some cleaned up debug messages from back when I was writing this.
Hopefully useful to others (and myself) as to why unroll and jam is not
transforming as expected.

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

llvm-svn: 338676

6 years agoTest commit access
Michael Wu [Thu, 2 Aug 2018 07:28:11 +0000 (07:28 +0000)]
Test commit access

llvm-svn: 338675

6 years ago[AArch64] Add support for got relocated LDR's
David Green [Thu, 2 Aug 2018 06:24:40 +0000 (06:24 +0000)]
[AArch64] Add support for got relocated LDR's

As a part of adding the tiny codemodel, we need to support ldr's with :got:
relocations on them. This seems to be mostly already done, just needs the
relocation type support.

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

llvm-svn: 338673

6 years agoTest commit.
Kito Cheng [Thu, 2 Aug 2018 05:38:18 +0000 (05:38 +0000)]
Test commit.

llvm-svn: 338672

6 years ago[LICM] Factor out fault legality from canHoistOrSinkInst [NFC]
Philip Reames [Thu, 2 Aug 2018 04:08:04 +0000 (04:08 +0000)]
[LICM] Factor out fault legality from canHoistOrSinkInst [NFC]

This method has three callers, each of which wanted distinct handling:
1) Sinking into a loop is moving an instruction known to execute before a loop into the loop.  We don't need to worry about introducing a fault at all in this case.
2) Hoisting from a loop into a preheader already duplicated the check in the caller.
3) Sinking from the loop into an exit block was the only true user of the code within the routine.  For the moment, this has just been lifted into the caller, but up next is examining the logic more carefully.  Whitelisting of loads and calls - while consistent with the previous code - is rather suspicious.  Either way, a behavior change is worthy of it's own patch.

llvm-svn: 338671

6 years ago[LICM] Expand tests to highlight an oddity in sinking implementation
Philip Reames [Thu, 2 Aug 2018 03:54:29 +0000 (03:54 +0000)]
[LICM] Expand tests to highlight an oddity in sinking implementation

llvm-svn: 338670

6 years agoAdded missing highlighter files to XCode project
Raphael Isemann [Thu, 2 Aug 2018 03:01:09 +0000 (03:01 +0000)]
Added missing highlighter files to XCode project

llvm-svn: 338669

6 years agoImplement P1023: constexpr comparison operators for std::array
Marshall Clow [Thu, 2 Aug 2018 02:11:06 +0000 (02:11 +0000)]
Implement P1023: constexpr comparison operators for std::array

llvm-svn: 338668

6 years ago[analyzer] Extend NoStoreFuncVisitor to follow fields.
George Karpenkov [Thu, 2 Aug 2018 02:02:40 +0000 (02:02 +0000)]
[analyzer] Extend NoStoreFuncVisitor to follow fields.

rdar://39701823

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

llvm-svn: 338667

6 years agoImplement P0887: The identity metafunction
Marshall Clow [Thu, 2 Aug 2018 01:56:02 +0000 (01:56 +0000)]
Implement P0887: The identity metafunction

llvm-svn: 338666

6 years agoFix FCOPYSIGN expansion
Lei Liu [Thu, 2 Aug 2018 01:54:12 +0000 (01:54 +0000)]
Fix FCOPYSIGN expansion

In expansion of FCOPYSIGN, the shift node is missing when the two
operands of FCOPYSIGN are of the same size. We should always generate
shift node (if the required shift bit is not zero) to put the sign
bit into the right position, regardless of the size of underlying
types.

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

llvm-svn: 338665

6 years agoPass triple to RUN line to fix failing bots.
Akira Hatanaka [Thu, 2 Aug 2018 01:52:17 +0000 (01:52 +0000)]
Pass triple to RUN line to fix failing bots.

This is a follow-up to r338656.

llvm-svn: 338664

6 years ago[LICM] hoisting/sinking legality - bail early for unsupported instructions
Philip Reames [Thu, 2 Aug 2018 00:54:14 +0000 (00:54 +0000)]
[LICM] hoisting/sinking legality - bail early for unsupported instructions

Originally, this was part of a larger refactoring I'd planned, but had to abandoned.  I figured the minor improvement in readability was worthwhile.

llvm-svn: 338663

6 years ago[LLDB] Added syntax highlighting support
Raphael Isemann [Thu, 2 Aug 2018 00:30:15 +0000 (00:30 +0000)]
[LLDB] Added syntax highlighting support

Summary:
This patch adds syntax highlighting support to LLDB. When enabled (and lldb is allowed
to use colors), printed source code is annotated with the ANSI color escape sequences.

So far we have only one highlighter which is based on Clang and is responsible for all
languages that are supported by Clang. It essentially just runs the raw lexer over the input
and then surrounds the specific tokens with the configured escape sequences.

Reviewers: zturner, davide

Reviewed By: davide

Subscribers: labath, teemperor, llvm-commits, mgorny, lldb-commits

Tags: #lldb

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

llvm-svn: 338662

6 years ago[libFuzzer] use absolute distance in addition to the hamming distance in value profil...
Kostya Serebryany [Thu, 2 Aug 2018 00:24:49 +0000 (00:24 +0000)]
[libFuzzer] use absolute distance in addition to the hamming distance in value profiling; our A/B testing have (somewhat weak) indication that this provides an additional signal for corpus expansion

llvm-svn: 338661

6 years ago[ADT] Add some documentation for GraphTraits.
Tim Shen [Thu, 2 Aug 2018 00:21:12 +0000 (00:21 +0000)]
[ADT] Add some documentation for GraphTraits.

Summary: Add some context for GraphTraits.

Reviewers: dblaikie, asbirlea

Subscribers: sanjoy, jlebar, bixia, dexonsmith, llvm-commits

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

llvm-svn: 338660