platform/upstream/llvm.git
4 years ago[InstCombine] Refactor optimizeExp2() (NFC)
Evandro Menezes [Fri, 9 Aug 2019 17:22:56 +0000 (17:22 +0000)]
[InstCombine] Refactor optimizeExp2() (NFC)

Refactor `LibCallSimplifier::optimizeExp2()` to use the new
`emitBinaryFloatFnCall()` version that fetches the function name from TLI.

llvm-svn: 368457

4 years agoRename PCH/leakfiles test so it runs on bots.
Sam McCall [Fri, 9 Aug 2019 17:13:56 +0000 (17:13 +0000)]
Rename PCH/leakfiles test so it runs on bots.

llvm-svn: 368455

4 years agoEven more warnings utilizing gsl::Owner/gsl::Pointer annotations
Gabor Horvath [Fri, 9 Aug 2019 17:11:32 +0000 (17:11 +0000)]
Even more warnings utilizing gsl::Owner/gsl::Pointer annotations

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

llvm-svn: 368454

4 years ago[Transforms] Add a emitBinaryFloatFnCall() version that fetches the function name...
Evandro Menezes [Fri, 9 Aug 2019 17:06:46 +0000 (17:06 +0000)]
[Transforms] Add a emitBinaryFloatFnCall() version that fetches the function name from TLI

Add the counterpart to a similar function for single operands.

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

llvm-svn: 368453

4 years ago[Transforms] Fix comments for hasFloatFn() and getFloatFnName() (NFC)
Evandro Menezes [Fri, 9 Aug 2019 16:59:14 +0000 (16:59 +0000)]
[Transforms] Fix comments for hasFloatFn() and getFloatFnName() (NFC)

llvm-svn: 368452

4 years agoPrint reasonable representations of type names in llvm-nm, readelf and readobj
Sunil Srivastava [Fri, 9 Aug 2019 16:54:51 +0000 (16:54 +0000)]
Print reasonable representations of type names in llvm-nm, readelf and readobj

For type values that do not have proper names, print reasonable representation
in llvm-nm, llvm-readobj and llvm-readelf, matching GNU tools.s

Fixes PR41713.

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

llvm-svn: 368451

4 years agoTitle: Improve Loop Cache Analysis LIT tests.
Whitney Tsang [Fri, 9 Aug 2019 16:18:22 +0000 (16:18 +0000)]
Title: Improve Loop Cache Analysis LIT tests.
Summary: Make LIT tests unsensitive to analysis output order.
Authored By: etiotto

llvm-svn: 368450

4 years ago[Transforms] Rename hasUnaryFloatFn() and getUnaryFloatFn() (NFC)
Evandro Menezes [Fri, 9 Aug 2019 16:04:18 +0000 (16:04 +0000)]
[Transforms] Rename hasUnaryFloatFn() and getUnaryFloatFn() (NFC)

Rename `hasUnaryFloatFn()` to `hasFloatFn()` and `getUnaryFloatFn()` to `getFloatFnName()`.

llvm-svn: 368449

4 years ago[compiler-rt] FuzzedDataProvider: use C++ headers only instead of a C/C++ mix.
Max Moroz [Fri, 9 Aug 2019 16:00:53 +0000 (16:00 +0000)]
[compiler-rt] FuzzedDataProvider: use C++ headers only instead of a C/C++ mix.

Reviewers: Dor1s

Reviewed By: Dor1s

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

Tags: #llvm, #sanitizers

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

llvm-svn: 368448

4 years ago[NFC] Added tests for D65898
David Bolvansky [Fri, 9 Aug 2019 15:52:26 +0000 (15:52 +0000)]
[NFC] Added tests for D65898

llvm-svn: 368447

4 years agoMore warnings regarding gsl::Pointer and gsl::Owner attributes
Gabor Horvath [Fri, 9 Aug 2019 15:16:35 +0000 (15:16 +0000)]
More warnings regarding gsl::Pointer and gsl::Owner attributes

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

llvm-svn: 368446

4 years ago[AArch64][x86] add tests for pessimization of expression with X*2.0 (PR32939); NFC
Sanjay Patel [Fri, 9 Aug 2019 14:52:31 +0000 (14:52 +0000)]
[AArch64][x86] add tests for pessimization of expression with X*2.0 (PR32939); NFC

llvm-svn: 368445

4 years ago[lldb][NFC] Assert on invalid cursors positions when creating CompletionRequest
Raphael Isemann [Fri, 9 Aug 2019 14:32:50 +0000 (14:32 +0000)]
[lldb][NFC] Assert on invalid cursors positions when creating CompletionRequest

Before we just triggered undefined behavior on invalid positions.

llvm-svn: 368444

4 years ago[DAGCombiner] remove redundant fold for X*1.0; NFC
Sanjay Patel [Fri, 9 Aug 2019 14:30:59 +0000 (14:30 +0000)]
[DAGCombiner] remove redundant fold for X*1.0; NFC

This is handled at node creation time (similar to X/1.0)
after:
rL357029
(no fast-math-flags needed)

llvm-svn: 368443

4 years ago[lldb][NFC] Remove unused IRForTarget::BuildRelocation
Raphael Isemann [Fri, 9 Aug 2019 14:21:27 +0000 (14:21 +0000)]
[lldb][NFC] Remove unused IRForTarget::BuildRelocation

llvm-svn: 368442

4 years ago[MachinePipeliner] Avoid indeterminate order in FuncUnitSorter
Jinsong Ji [Fri, 9 Aug 2019 14:10:57 +0000 (14:10 +0000)]
[MachinePipeliner] Avoid indeterminate order in FuncUnitSorter

Summary:
This is exposed by adding a new testcase in PowerPC in
https://reviews.llvm.org/rL367732

The testcase got different output on different platform, hence breaking
buildbots.

The problem is that we get differnt FuncUnitOrder when calculateResMII.

The root cause is:
1. Two MachineInstr might get SAME priority(MFUsx) from minFuncUnits.
2. Current comparison operator() will return `MFUs1 > MFUs2`.
3. We use iterators for MachineInstr, so the input to FuncUnitSorter
   might be different on differnt platform due to the iterator nature.

So for two MI with same MFU, their order is actually depends on the
iterator order, which is platform (implemtation) dependent.

This is risky, and may cause cross-compiling problems.

The fix is to check make sure we assign a determine order when they are
equal.

Reviewers: bcahoon, hfinkel, jmolloy

Subscribers: nemanjai, hiraditya, MaskRay, llvm-commits

Tags: #llvm

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

llvm-svn: 368441

4 years ago[sanitizer] Update symbolizer/scripts/global_symbols.txt
Benjamin Kramer [Fri, 9 Aug 2019 14:03:30 +0000 (14:03 +0000)]
[sanitizer] Update symbolizer/scripts/global_symbols.txt

llvm-svn: 368440

4 years agoTitle: Loop Cache Analysis
Whitney Tsang [Fri, 9 Aug 2019 13:56:29 +0000 (13:56 +0000)]
Title: Loop Cache Analysis
Summary: Implement a new analysis to estimate the number of cache lines
required by a loop nest.
The analysis is largely based on the following paper:

Compiler Optimizations for Improving Data Locality
By: Steve Carr, Katherine S. McKinley, Chau-Wen Tseng
http://www.cs.utexas.edu/users/mckinley/papers/asplos-1994.pdf
The analysis considers temporal reuse (accesses to the same memory
location) and spatial reuse (accesses to memory locations within a cache
line). For simplicity the analysis considers memory accesses in the
innermost loop in a loop nest, and thus determines the number of cache
lines used when the loop L in loop nest LN is placed in the innermost
position.

The result of the analysis can be used to drive several transformations.
As an example, loop interchange could use it determine which loops in a
perfect loop nest should be interchanged to maximize cache reuse.
Similarly, loop distribution could be enhanced to take into
consideration cache reuse between arrays when distributing a loop to
eliminate vectorization inhibiting dependencies.

The general approach taken to estimate the number of cache lines used by
the memory references in the inner loop of a loop nest is:

Partition memory references that exhibit temporal or spatial reuse into
reference groups.
For each loop L in the a loop nest LN: a. Compute the cost of the
reference group b. Compute the 'cache cost' of the loop nest by summing
up the reference groups costs
For further details of the algorithm please refer to the paper.
Authored By: etiotto
Reviewers: hfinkel, Meinersbur, jdoerfert, kbarton, bmahjour, anemet,
fhahn
Reviewed By: Meinersbur
Subscribers: reames, nemanjai, MaskRay, wuzish, Hahnfeld, xusx595,
venkataramanan.kumar.llvm, greened, dmgreen, steleman, fhahn, xblvaOO,
Whitney, mgorny, hiraditya, mgrang, jsji, llvm-commits
Tag: LLVM
Differential Revision: https://reviews.llvm.org/D63459

llvm-svn: 368439

4 years ago[X86][SSE] Swap X86ISD::BLENDV inputs with an inverted selection mask (PR42825)
Simon Pilgrim [Fri, 9 Aug 2019 12:44:20 +0000 (12:44 +0000)]
[X86][SSE] Swap X86ISD::BLENDV inputs with an inverted selection mask (PR42825)

As discussed on PR42825, if we are inverting the selection mask we can just swap the inputs and avoid the inversion.

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

llvm-svn: 368438

4 years ago[GlobalOpt] prevent crashing on large integer types (PR42932)
Sanjay Patel [Fri, 9 Aug 2019 12:43:25 +0000 (12:43 +0000)]
[GlobalOpt] prevent crashing on large integer types (PR42932)

This is a minimal fix (copy the predicate for the assert) to
prevent the crashing seen in:
https://bugs.llvm.org/show_bug.cgi?id=42932
...when converting a constant integer of arbitrary width to uint64_t.

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

llvm-svn: 368437

4 years ago[MCA] Fix MSVC 19.16 build with libc++
Andrea Di Biagio [Fri, 9 Aug 2019 12:41:24 +0000 (12:41 +0000)]
[MCA] Fix MSVC 19.16 build with libc++

MSVC (19.16) wants to see the definition of Instruction in
`std::pair<unsigned, const Instruction &> SourceRef` to decide
if it is assignable.

Patch by Orivej Desh.

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

llvm-svn: 368436

4 years ago[llvm-readelf]Print filename for multiple inputs and fix formatting regression
James Henderson [Fri, 9 Aug 2019 12:30:08 +0000 (12:30 +0000)]
[llvm-readelf]Print filename for multiple inputs and fix formatting regression

This patch addresses two closely related bugs:
https://bugs.llvm.org/show_bug.cgi?id=42930 and
https://bugs.llvm.org/show_bug.cgi?id=42931.

GNU readelf prints the file name for every input unless there is only
one input and that input is not an archive. This patch adds the printing
for multiple inputs. A previous change did it for archives, but
introduced a regression with GNU compatibility for single-output
formatting, resulting in a spurious initial blank line. This is fixed in
this patch too.

Reviewed by: grimar, MaskRay

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

llvm-svn: 368435

4 years ago[clangd] Added highlighting for constructor initializers.
Johan Vikstrom [Fri, 9 Aug 2019 12:19:10 +0000 (12:19 +0000)]
[clangd] Added highlighting for constructor initializers.

Summary: Constructor initializers were not being highlighted. This adds highlighting for them by using TraverseConstructorInitializer. Uses the Traverse* because there is no visit for CXXCtorInitializer.

Reviewers: hokein, ilya-biryukov

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

Tags: #clang

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

llvm-svn: 368434

4 years ago[Mips][Codegen] Fix fast-isel mixing of FGR64 and AFGR64 registers
Simon Atanasyan [Fri, 9 Aug 2019 12:02:32 +0000 (12:02 +0000)]
[Mips][Codegen] Fix fast-isel mixing of FGR64 and AFGR64 registers

Fast-isel was picking AFGR64 register class for processing call
arguments when +fp64 options was used. We simply check is option +fp64
is used and pick appropriate register.

Patch by Mirko Brkusanin.

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

llvm-svn: 368433

4 years ago[MCA] Add flag -show-encoding to llvm-mca.
Andrea Di Biagio [Fri, 9 Aug 2019 11:26:27 +0000 (11:26 +0000)]
[MCA] Add flag -show-encoding to llvm-mca.

Flag -show-encoding enables the printing of instruction encodings as part of the
the instruction info view.

Example (with flags -mtriple=x86_64--  -mcpu=btver2):

Instruction Info:
[1]: #uOps
[2]: Latency
[3]: RThroughput
[4]: MayLoad
[5]: MayStore
[6]: HasSideEffects (U)
[7]: Encoding Size

[1]    [2]    [3]    [4]    [5]    [6]    [7]    Encodings:     Instructions:
 1      2     1.00                         4     c5 f0 59 d0    vmulps   %xmm0, %xmm1, %xmm2
 1      4     1.00                         4     c5 eb 7c da    vhaddps  %xmm2, %xmm2, %xmm3
 1      4     1.00                         4     c5 e3 7c e3    vhaddps  %xmm3, %xmm3, %xmm4

In this example, column Encoding Size is the size in bytes of the instruction
encoding. Column Encodings reports the actual instruction encodings as byte
sequences in hex (objdump style).

The computation of encodings is done by a utility class named mca::CodeEmitter.

In future, I plan to expose the CodeEmitter to the instruction builder, so that
information about instruction encoding sizes can be used by the simulator. That
would be a first step towards simulating the throughput from the decoders in the
hardware frontend.

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

llvm-svn: 368432

4 years ago[AArch64] Set pref. func. align to 8 bytes on Neoverse E1 & Cortex-A65
Pablo Barrio [Fri, 9 Aug 2019 11:05:15 +0000 (11:05 +0000)]
[AArch64] Set pref. func. align to 8 bytes on Neoverse E1 & Cortex-A65

Summary:
The Arm Neoverse E1 and Cortex-A65 Software Optimization Guide [1][2],
Section "4.7 Branch instruction alignment" state:

"It is preferable for branch targets, including subroutine entry points,
to be placed on aligned 64-bit boundaries to maximize instruction fetch
efficiency."

This patch sets the preferred function alignment on Neoverse E1 and
Cortex-A65 to 2^3=8B. This was already the case in some Cortex-A CPUs
such as Cortex-A53.

[1] https://developer.arm.com/docs/swog466751/latest/arm-neoversetm-e1-core-software-optimization-guide
[2] https://developer.arm.com/docs/swog010045/latest/arm-cortex-a65-core-software-optimization-guide

Reviewers: dmgreen, fhahn, samparker

Subscribers: javed.absar, kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 368431

4 years ago[llvm-readobj] - Remove `error(llvm::Expected<T> &&E)`
George Rimar [Fri, 9 Aug 2019 11:03:21 +0000 (11:03 +0000)]
[llvm-readobj] - Remove `error(llvm::Expected<T> &&E)`

This is a bit strange method. It works like a unwrapOrError,
but named error. It does not report an Input name.
I removed it.

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

llvm-svn: 368430

4 years ago[clangd] Use raw rename functions to implement the rename.
Haojian Wu [Fri, 9 Aug 2019 10:55:22 +0000 (10:55 +0000)]
[clangd] Use raw rename functions to implement the rename.

Summary:
The API provided by refactoring lib doesn't provide enough flexibility
to get clangd's rename to behave as we expect. Instead, we replace it
with the low-level rename functions, which give us more control.

Bonus:
- performance, previously we visit the TU to find all occurrences,
  now we just visit top-level decls from main file;
- fix a bug where we wrongly filter out the main file replacement due to the
  different relative/absolute file path;

Reviewers: sammccall

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

Tags: #clang

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

llvm-svn: 368429

4 years ago[llvm-readobj] - Remove deprecated unwrapOrError(Expected<T> EO).
George Rimar [Fri, 9 Aug 2019 10:53:12 +0000 (10:53 +0000)]
[llvm-readobj] - Remove deprecated unwrapOrError(Expected<T> EO).

This patch changes the code to use a modern unwrapOrError(StringRef Input, Expected<T> EO)
version that contains the input source name and removes the deprecated version.

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

llvm-svn: 368428

4 years ago[lldb][NFC] Unify InstrList typedef in IRForTarget
Raphael Isemann [Fri, 9 Aug 2019 10:01:51 +0000 (10:01 +0000)]
[lldb][NFC] Unify InstrList typedef in IRForTarget

llvm-svn: 368425

4 years ago[lldb][NFC] Fix warning about missing switch cases
Raphael Isemann [Fri, 9 Aug 2019 09:58:47 +0000 (09:58 +0000)]
[lldb][NFC] Fix warning about missing switch cases

These types were recently added in D62960 but it seems the patch didn't
consider LLDB which causes a bunch of compiler warnings about
missing enum values. It seems this feature isn't fully implemented yet,
so I don't think we can write any test for this. For now lets just add
the missing types to our usual list of unsupported types.

llvm-svn: 368424

4 years agoAArch64: support TLS on Darwin platforms in GlobalISel.
Tim Northover [Fri, 9 Aug 2019 09:32:38 +0000 (09:32 +0000)]
AArch64: support TLS on Darwin platforms in GlobalISel.

All TLS access on Darwin is in the "general dynamic" form where we call
a function to resolve the address, so implementation is pretty simple.

llvm-svn: 368418

4 years ago[lldb] Refactor guard variable checks in IRForTarget
Raphael Isemann [Fri, 9 Aug 2019 09:27:04 +0000 (09:27 +0000)]
[lldb] Refactor guard variable checks in IRForTarget

Not NFC as this will probably fix a wrong guard variable check
on Windows. Not sure though what Windows test can now be safely
enabled.

llvm-svn: 368417

4 years agoMinidump/Windows: Fix module lookup
Pavel Labath [Fri, 9 Aug 2019 09:10:50 +0000 (09:10 +0000)]
Minidump/Windows: Fix module lookup

Summary:
When opening a minidump, we were failing to find an executable because
we were searching for i386-unknown-windows, whereas we recognize the
pe/coff files as i386-pc-windows. This fixes the triple computation code
in the minidump parser to match pe/coff, and adds an appropriate test.

NB: I'm not sure setting the vendor to "pc" is really correct for
arm(64) windows, but right now that seems to match what we do in the
pe/coff case (ArchSpec.cpp:935).

Reviewers: clayborg, amccarth

Subscribers: javed.absar, kristof.beyls, rnk, markmentovai, lldb-commits

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

llvm-svn: 368416

4 years ago[lldb][NFC] Clean up logging in IRForTarget
Raphael Isemann [Fri, 9 Aug 2019 08:54:01 +0000 (08:54 +0000)]
[lldb][NFC] Clean up logging in IRForTarget

llvm-svn: 368415

4 years agoAdd SVE opaque built-in types
Richard Sandiford [Fri, 9 Aug 2019 08:52:54 +0000 (08:52 +0000)]
Add SVE opaque built-in types

This patch adds the SVE built-in types defined by the Procedure Call
Standard for the Arm Architecture:

   https://developer.arm.com/docs/100986/0000

It handles the types in all relevant places that deal with built-in types.
At the moment, some of these places bail out with an error, including:

   (1) trying to generate LLVM IR for the types
   (2) trying to generate debug info for the types
   (3) trying to mangle the types using the Microsoft C++ ABI
   (4) trying to @encode the types in Objective C

(1) and (2) are fixed by follow-on patches but (unlike this patch)
they deal mostly with target-specific LLVM details, so seemed like
a logically separate change.  There is currently no spec for (3) and
(4), so reporting an error seems like the correct behaviour for now.

The intention is that the types will become sizeless types:

   http://lists.llvm.org/pipermail/cfe-dev/2019-June/062523.html

The main purpose of the sizeless type extension is to diagnose
impossible or dangerous uses of the types, such as any that would
require sizeof to have a meaningful defined value.

Until then, the patch sets the alignments of the types to the values
specified in the link above.  It also sets the sizes of the types to
zero, which is chosen to be consistently wrong and shouldn't affect
correctly-written code (i.e. code that would compile even with the
sizeless type extension).

The patch adds the common subset of functionality needed to test the
sizeless type extension on the one hand and to provide SVE intrinsic
functions on the other.  After this patch, the two pieces of work are
essentially independent.

The patch is based on one by Graham Hunter:

   https://reviews.llvm.org/D59245

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

llvm-svn: 368413

4 years ago[llvm-readobj] - Remove unwrapOrError(ErrorOr<T> EO) helper.
George Rimar [Fri, 9 Aug 2019 08:29:26 +0000 (08:29 +0000)]
[llvm-readobj] - Remove unwrapOrError(ErrorOr<T> EO) helper.

It is outdated. Using of Expected<> is preferred, also it does
not provide a way to report a file name.

I updated the code to use the modern version of unwrapOrError instead.

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

llvm-svn: 368410

4 years ago[ELF] For VS-style diagnostics, prefer printing full paths in the header.
Igor Kudrin [Fri, 9 Aug 2019 08:29:03 +0000 (08:29 +0000)]
[ELF] For VS-style diagnostics, prefer printing full paths in the header.

The filename part in the message header is used by Visual Studio
to fill Error List so that a user can click on an item and jump
to the mentioned location. If we use only the name of a source file
and not the full path, Visual Studio might be unable to find the right
file or, even worse, show a wrong one.

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

llvm-svn: 368409

4 years agoGlobalISel: pack various parameters for lowerCall into a struct.
Tim Northover [Fri, 9 Aug 2019 08:26:38 +0000 (08:26 +0000)]
GlobalISel: pack various parameters for lowerCall into a struct.

I've now needed to add an extra parameter to this call twice recently. Not only
is the signature getting extremely unwieldy, but just updating all of the
callsites and implementations is a pain. Putting the parameters in a struct
sidesteps both issues.

llvm-svn: 368408

4 years ago[lldb][NFC] Remove last C string uses from IRForTarget
Raphael Isemann [Fri, 9 Aug 2019 08:10:02 +0000 (08:10 +0000)]
[lldb][NFC] Remove last C string uses from IRForTarget

llvm-svn: 368406

4 years ago[lldb][NFC] Use range-based for-loops in IRForTarget
Raphael Isemann [Fri, 9 Aug 2019 07:59:18 +0000 (07:59 +0000)]
[lldb][NFC] Use range-based for-loops in IRForTarget

llvm-svn: 368405

4 years ago[ARM][ParallelDSP] Replace SExt uses
Sam Parker [Fri, 9 Aug 2019 07:48:50 +0000 (07:48 +0000)]
[ARM][ParallelDSP] Replace SExt uses

As loads are combined and widened, we replaced their sext users
operands whereas we should have been replacing the uses of the sext.
I've added a load of tests, with only a few of them originally
causing assertion failures, the rest improve pattern coverage.

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

llvm-svn: 368404

4 years ago[clangd] Fixed printTemplateSpecializationArgs not printing partial variable speciali...
Johan Vikstrom [Fri, 9 Aug 2019 07:35:16 +0000 (07:35 +0000)]
[clangd] Fixed printTemplateSpecializationArgs not printing partial variable specialization arguments.

Summary:
printTemplateSpecializationArgs was not printing partial variable specialization args. This adds an additional If clause where we check if it's a VariableTemplatePartialSpecializationDecl and returns the ArgumentLocs if that's the case.
Also adds tests for printTemplateSpecializationArgs in ASTTests.cpp.

Reviewers: hokein, ilya-biryukov

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

Tags: #clang

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

llvm-svn: 368403

4 years ago[AST] No longer visiting CXXMethodDecl bodies created by compiler when method was...
Johan Vikstrom [Fri, 9 Aug 2019 07:30:28 +0000 (07:30 +0000)]
[AST] No longer visiting CXXMethodDecl bodies created by compiler when method was default created.

Summary:
Clang generates function bodies and puts them in the AST for default methods if it is defaulted outside the class definition.

`
struct A {
   A &operator=(A &&O);
};

A &A::operator=(A &&O) = default;
`

This will generate a function body for the `A &A::operator=(A &&O)` and put it in the AST. This body should not be visited if implicit code is not visited as it is implicit.

This was causing SemanticHighlighting in clangd to generate duplicate tokens and putting them in weird places.

Reviewers: hokein, ilya-biryukov, gribozavr

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

Tags: #clang

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

llvm-svn: 368402

4 years ago[InstSimplify] Report "Changed" also when only deleting dead instructions
Bjorn Pettersson [Fri, 9 Aug 2019 07:08:25 +0000 (07:08 +0000)]
[InstSimplify] Report "Changed" also when only deleting dead instructions

Summary:
Make sure that we report that changes has been made
by InstSimplify also in situations when only trivially
dead instructions has been removed. If for example a call
is removed the call graph must be updated.

Bug seem to have been introduced by llvm-svn r367173
(commit 02b9e45a7e4b81), since the code in question
was rewritten in that commit.

Reviewers: spatel, chandlerc, foad

Reviewed By: spatel

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 368401

4 years ago[X86] Remove code that expands truncating stores from combineStore.
Craig Topper [Fri, 9 Aug 2019 06:59:53 +0000 (06:59 +0000)]
[X86] Remove code that expands truncating stores from combineStore.

We shouldn't form trunc stores that need to be expanded now that
we are using widening legalization.

llvm-svn: 368400

4 years agoUse ASSERT_THAT_ERROR instead of logAllUnhandledErrors/exit
Dmitri Gribenko [Fri, 9 Aug 2019 06:14:54 +0000 (06:14 +0000)]
Use ASSERT_THAT_ERROR instead of logAllUnhandledErrors/exit

Summary: ASSERT_THAT_ERROR looks like the intended helper for use in tests.

Reviewers: plotfi, jkorous, compnerd

Subscribers: mgorny, dexonsmith, cfe-commits

Tags: #clang

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

llvm-svn: 368399

4 years agoFix rpath for MacOS/iOS
Haibo Huang [Fri, 9 Aug 2019 06:05:32 +0000 (06:05 +0000)]
Fix rpath for MacOS/iOS

Summary: libs can be installed to ../lib64.

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

llvm-svn: 368398

4 years ago[X86] Remove stale FIXME from combineMaskedStore. NFC
Craig Topper [Fri, 9 Aug 2019 05:55:41 +0000 (05:55 +0000)]
[X86] Remove stale FIXME from combineMaskedStore. NFC

I believe PR34584 was tracking that FIXME, but its since been
closed and a test case was added.

llvm-svn: 368397

4 years ago[X86] Remove DAG combine expansion of extending masked load and truncating masked...
Craig Topper [Fri, 9 Aug 2019 05:53:37 +0000 (05:53 +0000)]
[X86] Remove DAG combine expansion of extending masked load and truncating masked store.

The only way to generate these was through promoting legalization
of narrow vectors, but we widen those types now. So we shouldn't
produce these nodes.

llvm-svn: 368396

4 years ago[X86] Remove handler for (U/S)(ADD/SUB)SAT from ReplaceNodeResults. Remove TypeWidenV...
Craig Topper [Fri, 9 Aug 2019 05:17:52 +0000 (05:17 +0000)]
[X86] Remove handler for (U/S)(ADD/SUB)SAT from ReplaceNodeResults. Remove TypeWidenVector check from code that handles X86ISD::VPMADDWD and X86ISD::AVG.

More unneeded code since we now legalize narrow vectors by widening.

llvm-svn: 368395

4 years ago[X86] Remove ISD::SETCC handling from ReplaceNodeResults.
Craig Topper [Fri, 9 Aug 2019 05:17:48 +0000 (05:17 +0000)]
[X86] Remove ISD::SETCC handling from ReplaceNodeResults.

This is no longer needed since we widen v2i32 instead of promoting.

llvm-svn: 368394

4 years ago[clang][NFC] Consolidating usage of "FinalPhase" in Driver::BuildActions.
Puyan Lotfi [Fri, 9 Aug 2019 04:55:09 +0000 (04:55 +0000)]
[clang][NFC] Consolidating usage of "FinalPhase" in Driver::BuildActions.

I am working to remove this concept of the "FinalPhase" in the clang driver,
but it is used in a lot of different places to do argument handling for
different combinations of phase pipelines and arguments. I am trying to
consolidate most of the uses of "FinalPhase" into its own separate scope.
Eventually, in a subsequent patch I will move all of this stuff to a separate
function, and have more of the complication phase list construction setup into
types::getComplicationPhases.

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

llvm-svn: 368393

4 years ago[PowerPC] [Clang] Port SSE3, SSSE3 and SSE4 intrinsics to PowerPC
Qiu Chaofan [Fri, 9 Aug 2019 03:39:55 +0000 (03:39 +0000)]
[PowerPC] [Clang] Port SSE3, SSSE3 and SSE4 intrinsics to PowerPC

Port existing headers which include x86 intrinsics implementation to
PowerPC platform (using Altivec), along with tests. Also, tests about
including these intrinsic headers are combined.

The headers are mainly developed by Steven Munroe, with contributions
from Paul Clarke, Bill Schmidt, Jinsong Ji and Zixuan Wu.

Reviewed By: Jinsong Ji

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

llvm-svn: 368392

4 years ago[X86] Simplify ISD::LOAD handling in ReplaceNodeResults and ISD::STORE handling in...
Craig Topper [Fri, 9 Aug 2019 03:09:43 +0000 (03:09 +0000)]
[X86] Simplify ISD::LOAD handling in ReplaceNodeResults and ISD::STORE handling in LowerStore now that v2i32 is widened to v4i32.

llvm-svn: 368390

4 years ago[X86] Merge v2f32 and v2i32 gather/scatter handling in ReplaceNodeResults/LowerMSCATT...
Craig Topper [Fri, 9 Aug 2019 03:09:28 +0000 (03:09 +0000)]
[X86] Merge v2f32 and v2i32 gather/scatter handling in ReplaceNodeResults/LowerMSCATTER now that v2i32 is also widened like v2f32.

llvm-svn: 368389

4 years ago[X86] Now unreachable handling for f64->v2i32/v4i16/v8i8 bitcasts from ReplaceNodeRes...
Craig Topper [Fri, 9 Aug 2019 03:09:19 +0000 (03:09 +0000)]
[X86] Now unreachable handling for f64->v2i32/v4i16/v8i8 bitcasts from ReplaceNodeResults.

We rely on the generic type legalizer for this now.

llvm-svn: 368388

4 years ago[X86] Simplify ReplaceNodeResults handling for FP_TO_SINT/UINT for vectors to only...
Craig Topper [Fri, 9 Aug 2019 03:09:10 +0000 (03:09 +0000)]
[X86] Simplify ReplaceNodeResults handling for FP_TO_SINT/UINT for vectors to only handle widening.

llvm-svn: 368387

4 years ago[X86] Simplify ReplaceNodeResults handling for SIGN_EXTEND/ZERO_EXTEND/TRUNCATE for...
Craig Topper [Fri, 9 Aug 2019 03:08:54 +0000 (03:08 +0000)]
[X86] Simplify ReplaceNodeResults handling for SIGN_EXTEND/ZERO_EXTEND/TRUNCATE for vectors to only handle widening.

llvm-svn: 368386

4 years ago[X86] Simplify ReplaceNodeResults handling for UDIV/UREM/SDIV/SREM for vectors to...
Craig Topper [Fri, 9 Aug 2019 03:08:45 +0000 (03:08 +0000)]
[X86] Simplify ReplaceNodeResults handling for UDIV/UREM/SDIV/SREM for vectors to only handle widening.

llvm-svn: 368385

4 years ago[X86] Remove vector promotion handling from the ReplaceNodeResults ISD::MUL handling...
Craig Topper [Fri, 9 Aug 2019 03:08:28 +0000 (03:08 +0000)]
[X86] Remove vector promotion handling from the ReplaceNodeResults ISD::MUL handling code.

We now widen illegal vector types so we don't need this anymore.

llvm-svn: 368384

4 years ago[analyzer] CastValueChecker: Model castAs(), getAs()
Csaba Dabis [Fri, 9 Aug 2019 02:24:42 +0000 (02:24 +0000)]
[analyzer] CastValueChecker: Model castAs(), getAs()

Summary: Thanks to Kristóf Umann for the great idea!

Reviewed By: NoQ

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

llvm-svn: 368383

4 years ago[analyzer] ConditionBRVisitor: Fix HTML PathDiagnosticPopUpPieces
Csaba Dabis [Fri, 9 Aug 2019 02:20:44 +0000 (02:20 +0000)]
[analyzer] ConditionBRVisitor: Fix HTML PathDiagnosticPopUpPieces

Summary:
A condition could be a multi-line expression where we create the highlight
in separated chunks. PathDiagnosticPopUpPiece is not made for that purpose,
it cannot be added to multiple lines because we have only one ending part
which contains all the notes. So that it cannot have multiple endings and
therefore this patch narrows down the ranges of the highlight to the given
interesting variable of the condition. It prevents HTML-breaking injections.

Reviewed By: NoQ

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

llvm-svn: 368382

4 years ago[clang-scan-deps] Add minimizer support for C++20 modules.
Michael J. Spencer [Fri, 9 Aug 2019 02:01:10 +0000 (02:01 +0000)]
[clang-scan-deps] Add minimizer support for C++20 modules.

This only adds support to the minimizer, it doesn't actually capture the dependencies yet.

llvm-svn: 368381

4 years ago[ELF] Expand regions for gaps due to explicit address
Fangrui Song [Fri, 9 Aug 2019 01:25:49 +0000 (01:25 +0000)]
[ELF] Expand regions for gaps due to explicit address

If the dot gets moved by an explicit section address, an empty gap between sections could be created. The encompassing region for the section being parsed needs to be expanded to include the gap.

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

Patch by Gabriel Smith!

llvm-svn: 368379

4 years agoDebugInfo: Explicitly handle errors when parsing unit DIEs
David Blaikie [Fri, 9 Aug 2019 01:14:36 +0000 (01:14 +0000)]
DebugInfo: Explicitly handle errors when parsing unit DIEs

This ensures these errors produce a non-zero exit and improves the
context (providing the name of the input object and section being
parsed).

llvm-svn: 368378

4 years agoDebugInfo/DWARF: Provide some (pretty half-hearted) error handling access when parsin...
David Blaikie [Fri, 9 Aug 2019 01:14:33 +0000 (01:14 +0000)]
DebugInfo/DWARF: Provide some (pretty half-hearted) error handling access when parsing units

This isn't the most robust error handling API, but does allow clients to
opt-in to getting Errors they can handle. I suspect the long-term
solution would be to move away from the lazy unit parsing and have an
explicit step that parses the unit and then allows access to the other
APIs that require a parsed unit.

llvm-dwarfdump could be expanded to use this (or newer/better API) to
demonstrate the benefit of it - but for now lld will use this in a
follow-up cl which ensures lld can exit non-zero on errors like this (&
provide more descriptive diagnostics including which object file the
error came from).

(error access to later errors when parsing nested DIEs would be good too
- but, again, exposing that without it being a hassle for every consumer
may be tricky)

llvm-svn: 368377

4 years agoELF: Move sections referred to by __start_/__stop_ symbols into the main partition.
Peter Collingbourne [Fri, 9 Aug 2019 00:57:54 +0000 (00:57 +0000)]
ELF: Move sections referred to by __start_/__stop_ symbols into the main partition.

In the case where C identifier sections have SHF_LINK_ORDER they will most
likely be placed in the same partition as the section that they are associated
with. But unless this happens to be the main partition, this will cause them
to be excluded from the range covered by the __start_ and __stop_ symbols,
which may lead to incorrect program behaviour. So we need to move them
all into the main partition so that they will be covered by the __start_
and __stop_ symbols.

We may want to refine this approach later and allow different __start_/__stop_
symbol values for different partitions. This would only make sense for
relocations from SHT_NOTE sections since they are duplicated into each
partition.

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

llvm-svn: 368375

4 years ago[asan_symbolize] Fix bug where the frame counter was not incremented.
Dan Liew [Fri, 9 Aug 2019 00:52:07 +0000 (00:52 +0000)]
[asan_symbolize] Fix bug where the frame counter was not incremented.

Summary:
This bug occurred when a plug-in requested that a binary not be
symbolized while the script is trying to symbolize a stack frame. In
this case `self.frame_no` would not be incremented. This would cause
subsequent stack frames that are symbolized to be incorrectly numbered.

To fix this `get_symbolized_lines()` has been modified to take an
argument that indicates whether the stack frame counter should
incremented. In `process_line_posix()` `get_symbolized_lines(None, ...)`
is now used in in the case where we don't want to symbolize a line so
that we can keep the frame counter increment in a single function.

A test case is included. The test uses a dummy plugin that always asks
`asan_symbolize.py` script to not symbolize the first binary that the
script asks about. Prior to the patch this would cause the output to
script to look something like

```
  #0 0x0
  #0 0x0 in do_access
  #1 0x0 in main
```

rdar://problem/49476995

Reviewers: kubamracek, yln, samsonov, dvyukov, vitalybuka

Subscribers: #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

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

llvm-svn: 368373

4 years ago[lld][WebAssembly] Don't create optional symbols when outputing an object file
Sam Clegg [Thu, 8 Aug 2019 23:56:21 +0000 (23:56 +0000)]
[lld][WebAssembly] Don't create optional symbols when outputing an object file

Summary: This was a bug in rL368310.  I'm working on a test case now.

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

llvm-svn: 368369

4 years agoChange the return type of UpgradeARCRuntimeCalls to void
Akira Hatanaka [Thu, 8 Aug 2019 23:33:17 +0000 (23:33 +0000)]
Change the return type of UpgradeARCRuntimeCalls to void

Nothing is using the function return.

llvm-svn: 368367

4 years agoRemove else-after-return
David Blaikie [Thu, 8 Aug 2019 23:17:23 +0000 (23:17 +0000)]
Remove else-after-return

llvm-svn: 368364

4 years agoFix -DBUILD_SHARED_LIBS=ON build after rL368358
Sam Clegg [Thu, 8 Aug 2019 23:00:28 +0000 (23:00 +0000)]
Fix -DBUILD_SHARED_LIBS=ON build after rL368358

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

llvm-svn: 368363

4 years agoFix llvm.aarch64.irg properties.
Evgeniy Stepanov [Thu, 8 Aug 2019 22:42:48 +0000 (22:42 +0000)]
Fix llvm.aarch64.irg properties.

Summary:
IRG does not access any memory.
Replace IntrInaccessibleMemOnly with IntrNoMem | IntrHasSideEffects.

Reviewers: chill

Subscribers: javed.absar, kristof.beyls, llvm-commits

Tags: #llvm

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

llvm-svn: 368362

4 years ago[WebAssembly][lld] control __data_end export with config->shared
Guanzhong Chen [Thu, 8 Aug 2019 22:40:04 +0000 (22:40 +0000)]
[WebAssembly][lld] control __data_end export with config->shared

Summary:
Emscripten expects `__data_end` to show up in PIC code as long as it's not
linked with `--shared`.

Currently, Emscripten breaks with latest LLVM because `__data_end` is controlled
by `config->isPic` instead of `config->shared`.`

Reviewers: tlively, sbc100

Reviewed By: sbc100

Subscribers: dschuff, jgravelle-google, aheejin, sunfish, llvm-commits

Tags: #llvm

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

llvm-svn: 368361

4 years ago[InstCombine][NFC] Added comments about constants in tests for pow->exp2 fold
David Bolvansky [Thu, 8 Aug 2019 22:37:51 +0000 (22:37 +0000)]
[InstCombine][NFC] Added comments about constants in tests for pow->exp2 fold

llvm-svn: 368360

4 years ago[lldb][NFC] Modernize IRForTarget::CreateResultVariable
Raphael Isemann [Thu, 8 Aug 2019 22:19:16 +0000 (22:19 +0000)]
[lldb][NFC] Modernize IRForTarget::CreateResultVariable

llvm-svn: 368359

4 years agoAdded Delta IR Reduction Tool
Diego Trevino Ferrer [Thu, 8 Aug 2019 22:16:33 +0000 (22:16 +0000)]
Added Delta IR Reduction Tool

Summary: Tool parses input IR file, and runs the delta debugging algorithm to reduce the functions inside the input file.

Reviewers: alexshap, chandlerc

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

> llvm-svn: 368071

llvm-svn: 368358

4 years agoLinker: Add support for GlobalIFunc.
Peter Collingbourne [Thu, 8 Aug 2019 22:09:18 +0000 (22:09 +0000)]
Linker: Add support for GlobalIFunc.

GlobalAlias and GlobalIFunc ought to be treated the same by the IR
linker, so we can generalize the code to be in terms of their common
base class GlobalIndirectSymbol.

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

llvm-svn: 368357

4 years agoMark clang-scan-deps test as requiring thread support
Reid Kleckner [Thu, 8 Aug 2019 21:45:59 +0000 (21:45 +0000)]
Mark clang-scan-deps test as requiring thread support

Otherwise the test calls a pure virtual method and crashes. Perhaps this
could be improved.

llvm-svn: 368354

4 years ago[lldb][NFC] Move to StringRef in some places in IRForTarget
Raphael Isemann [Thu, 8 Aug 2019 21:43:21 +0000 (21:43 +0000)]
[lldb][NFC] Move to StringRef in some places in IRForTarget

llvm-svn: 368353

4 years ago[lldb] Fix HAVE_LIBCOMPRESSION
Haibo Huang [Thu, 8 Aug 2019 21:42:33 +0000 (21:42 +0000)]
[lldb] Fix HAVE_LIBCOMPRESSION

Summary:
This test doesn't make sense. Change to be consistent with what we did
in GDBRemoteCommunication.cpp.

Reviewers: labath

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 368352

4 years agohwasan: Add a code model check for tagged globals.
Peter Collingbourne [Thu, 8 Aug 2019 21:40:00 +0000 (21:40 +0000)]
hwasan: Add a code model check for tagged globals.

See D65364 for the code model requirements for tagged globals. Because
of the relocations used these requirements cannot be checked at link
time so they must be checked at runtime.

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

llvm-svn: 368351

4 years ago[LICM] Support unary FNeg in LICM
Cameron McInally [Thu, 8 Aug 2019 21:38:31 +0000 (21:38 +0000)]
[LICM] Support unary FNeg in LICM

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

llvm-svn: 368350

4 years ago[X86] Improve codegen of v8i64->v8i16 and v16i32->v16i8 truncate with avx512vl, avx51...
Craig Topper [Thu, 8 Aug 2019 21:36:47 +0000 (21:36 +0000)]
[X86] Improve codegen of v8i64->v8i16 and v16i32->v16i8 truncate with avx512vl, avx512bw, min-legal-vector-width<=256 and prefer-vector-width=256

Under this configuration we'll want to split the v8i64 or v16i32 into two vectors. The default legalization will try to truncate each of those 256-bit pieces one step to 128-bit, concatenate those, then truncate one more time from the new 256 to 128 bits.

With this patch we now truncate the two splits to 64-bits then concatenate those. We have to do this two different ways depending on whether have widening legalization enabled. Without widening legalization we have to manually construct X86ISD::VTRUNC to prevent the ISD::TRUNCATE with a narrow result being promoted to 128 bits with a larger element type than what we want followed by something like a pshufb to grab the lower half of each element to finish the job. With widening legalization we just get the right thing. When we switch to widening by default we can just delete the other code path.

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

llvm-svn: 368349

4 years agoFix up fd limit diagnosis code
Reid Kleckner [Thu, 8 Aug 2019 21:35:03 +0000 (21:35 +0000)]
Fix up fd limit diagnosis code

Apparently Windows returns the "invalid argument" error code when the
path contains invalid characters such as '<'. The
test/Preprocessor/include-likely-typo.c test does this, so it was
failing after r368322.

Also, the diagnostic requires two arguments, so add the filename.

llvm-svn: 368348

4 years ago[lldb][NFC] Directly use StringRef instead of temporary std::string
Raphael Isemann [Thu, 8 Aug 2019 21:22:21 +0000 (21:22 +0000)]
[lldb][NFC] Directly use StringRef instead of temporary std::string

llvm-svn: 368346

4 years agoSymbolFileDWARF: Unconditionally scan through clang modules. NFCish
Adrian Prantl [Thu, 8 Aug 2019 21:16:01 +0000 (21:16 +0000)]
SymbolFileDWARF: Unconditionally scan through clang modules. NFCish

When looking up a type by name, also scan through any referenced Clang
modules regardsless of whether a type with this name has been
found. This is NFCish (= a potential performance regression) for Clang
projects, but necessary in mixed Swift and Objective-C projects (and
tested in swift-lldb).

This only affects projects compiled with -gmodules that were not run
through dsymutil.

llvm-svn: 368345

4 years ago[SelectionDAG][X86] Move setcc mask splitting for mload/mstore/mgather/mscatter from...
Craig Topper [Thu, 8 Aug 2019 21:14:08 +0000 (21:14 +0000)]
[SelectionDAG][X86] Move setcc mask splitting for mload/mstore/mgather/mscatter from DAGCombiner to the type legalizer.

We may be able to look to how VSELECT is handled to further
improve this, but this appears to be neutral or an improvement
on the test cases we have.

llvm-svn: 368344

4 years ago[LegalizeTypes] Remove SplitVSETCC helper and just call SplitVecRes_SETCC.
Craig Topper [Thu, 8 Aug 2019 21:13:58 +0000 (21:13 +0000)]
[LegalizeTypes] Remove SplitVSETCC helper and just call SplitVecRes_SETCC.

llvm-svn: 368343

4 years ago[Attributor][NFC] Include only what is needed
Johannes Doerfert [Thu, 8 Aug 2019 20:54:23 +0000 (20:54 +0000)]
[Attributor][NFC] Include only what is needed

llvm-svn: 368341

4 years agoFix a comment which was incorrect.
Jim Ingham [Thu, 8 Aug 2019 20:47:40 +0000 (20:47 +0000)]
Fix a comment which was incorrect.

llvm-svn: 368340

4 years ago[MBP] Disable aggressive loop rotate in plain mode
Guozhi Wei [Thu, 8 Aug 2019 20:25:23 +0000 (20:25 +0000)]
[MBP] Disable aggressive loop rotate in plain mode

Patch https://reviews.llvm.org/D43256 introduced more aggressive loop layout optimization which depends on profile information. If profile information is not available, the statically estimated profile information(generated by BranchProbabilityInfo.cpp) is used. If user program doesn't behave as BranchProbabilityInfo.cpp expected, the layout may be worse.

To be conservative this patch restores the original layout algorithm in plain mode. But user can still try the aggressive layout optimization with -force-precise-rotation-cost=true.

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

llvm-svn: 368339

4 years ago[analyzer] Fix scan-build's plist output in plist-html mode.
Artem Dergachev [Thu, 8 Aug 2019 20:22:32 +0000 (20:22 +0000)]
[analyzer] Fix scan-build's plist output in plist-html mode.

r366941 accidentally made it delete all plist files
as soon as they're produced.

llvm-svn: 368338

4 years ago[clang] add REQUIRES: linux to driver test case
Brian Cain [Thu, 8 Aug 2019 20:12:54 +0000 (20:12 +0000)]
[clang] add REQUIRES: linux to driver test case

The test case explicitly leverages linux, so should include it as
a test requirement.

llvm-svn: 368334

4 years agogn build: Merge r368331.
Peter Collingbourne [Thu, 8 Aug 2019 20:11:23 +0000 (20:11 +0000)]
gn build: Merge r368331.

llvm-svn: 368333

4 years ago[clang] add REQUIRES to driver test case
Brian Cain [Thu, 8 Aug 2019 20:04:39 +0000 (20:04 +0000)]
[clang] add REQUIRES to driver test case

The test case explicitly leverages x86, so should include it as
a test requirement.

llvm-svn: 368332

4 years ago[compiler-rt] Add ConsumeProbability and ConsumeFloatingPoint methods to FDP.
Max Moroz [Thu, 8 Aug 2019 19:49:37 +0000 (19:49 +0000)]
[compiler-rt] Add ConsumeProbability and ConsumeFloatingPoint methods to FDP.

Summary:
Also slightly cleaned up the comments and changed the header's extension
back to `.h` as per comments on https://reviews.llvm.org/D65812.

New methods added:

* `ConsumeProbability` returns [0.0, 1.0] by consuming an unsigned integer value
   from the input data and dividing that value by the integer's max value.
* `ConsumeFloatingPointInRange` returns a floating point value in the given
   range. Relies on `ConsumeProbability` method. This method does not have the
   limitation of `std::uniform_real_distribution` that requires the given range
   to be <= the floating point type's max. If the range is too large, this
   implementation will additionally call `ConsumeBool` to decide whether the
   result will be in the first or the second half of the range.
* `ConsumeFloatingPoint` returns a floating point value in the range
  `[std::numeric_limits<T>::lowest(), std::numeric_limits<T>::min()]`.

Tested on Linux, Mac, Windows.

Reviewers: morehouse

Reviewed By: morehouse

Subscribers: kubamracek, mgorny, dberris, delcypher, #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

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

llvm-svn: 368331

4 years agoRemove unused and undocumented data_offset parameter (NFC)
Adrian Prantl [Thu, 8 Aug 2019 19:22:32 +0000 (19:22 +0000)]
Remove unused and undocumented data_offset parameter (NFC)

Value::GetValueAsData() takes an undocumented parameter called
data_offset that is always 0.

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

llvm-svn: 368330

4 years agolit: Bump version to 0.10.0
Tom Stellard [Thu, 8 Aug 2019 19:22:23 +0000 (19:22 +0000)]
lit: Bump version to 0.10.0

Reviewers: hans

Subscribers: hans, delcypher, llvm-commits

Tags: #llvm

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

llvm-svn: 368329