platform/upstream/llvm.git
5 years agoAvoid using short identifiers in some tests
Pavel Labath [Fri, 31 Aug 2018 18:25:01 +0000 (18:25 +0000)]
Avoid using short identifiers in some tests

This applies the same workaround  as r321271 to other tests. The root
problem is that lldb finds an internal symbol with the same name in the
debug info of system libraries, and then fails to disambiguate between
the two.

llvm-svn: 341235

5 years ago[X86] Add kshift intrinsics to match gcc and icc.
Craig Topper [Fri, 31 Aug 2018 18:22:52 +0000 (18:22 +0000)]
[X86] Add kshift intrinsics to match gcc and icc.

This adds the following intrinsics:
_kshiftli_mask8
_kshiftli_mask16
_kshiftli_mask32
_kshiftli_mask64
_kshiftri_mask8
_kshiftri_mask16
_kshiftri_mask32
_kshiftri_mask64

llvm-svn: 341234

5 years agoFix a comment to use the correct variable name.
Frederic Riss [Fri, 31 Aug 2018 18:14:53 +0000 (18:14 +0000)]
Fix a comment to use the correct variable name.

llvm-svn: 341233

5 years agoExport public functions implemented in assembly on Windows.
Charles Davis [Fri, 31 Aug 2018 18:11:48 +0000 (18:11 +0000)]
Export public functions implemented in assembly on Windows.

Summary:
By default, symbols aren't visible outside of the module that defines
them. To make them visible, they must be exported. The easiest way to do
that is to embed an `-export:symname` directive into the object file.

Reviewers: mstorsjo, rnk

Subscribers: christof, cfe-commits

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

llvm-svn: 341232

5 years agoRefactor Addlibgcc to make the when and what logic more straightfoward.
Sterling Augustine [Fri, 31 Aug 2018 17:59:03 +0000 (17:59 +0000)]
Refactor Addlibgcc to make the when and what logic more straightfoward.

Add Android tests.

llvm-svn: 341231

5 years ago[XRay] Fix FunctionRecord serialization
Dean Michael Berris [Fri, 31 Aug 2018 17:49:59 +0000 (17:49 +0000)]
[XRay] Fix FunctionRecord serialization

This change makes the writer implementation more consistent with the way
fields are written down to avoid assumptions on bitfield order and
padding. We also fix an inconsistency between the type returned by the
`delta()` accessor to match the data member it's returning.

This is a follow-up to D51289 and D51210.

llvm-svn: 341230

5 years ago[hwasan] Fix new[] with zero size.
Evgeniy Stepanov [Fri, 31 Aug 2018 17:49:49 +0000 (17:49 +0000)]
[hwasan] Fix new[] with zero size.

Fixes "allocator is out of memory trying to allocate 0x0 bytes" by
always allocating at least one byte.

llvm-svn: 341229

5 years ago[DebugInfo] Common behavior for error types
Alexandre Ganea [Fri, 31 Aug 2018 17:41:58 +0000 (17:41 +0000)]
[DebugInfo] Common behavior for error types

Following D50807, and heading towards D50664, this intermediary change does the following:

1. Upgrade all custom Error types in llvm/trunk/lib/DebugInfo/ to use the new StringError behavior (D50807).
2. Implement std::is_error_code_enum and make_error_code() for DebugInfo error enumerations.
3. Rename GenericError -> PDBError (the file will be renamed in a subsequent commit)
4. Update custom error messages to follow the same formatting: (\w\s*)+\.
5. Keep generic "file not found" (ENOENT) errors as they are in PDB code. Previously, there used to be a custom enumeration for that purpose.
6. Remove a few extraneous LF in log() implementations. Printing LF is a responsability at a higher level, not at the error level.

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

llvm-svn: 341228

5 years ago[X86] Add support for turning vXi1 shuffles into KSHIFTL/KSHIFTR.
Craig Topper [Fri, 31 Aug 2018 17:17:21 +0000 (17:17 +0000)]
[X86] Add support for turning vXi1 shuffles into KSHIFTL/KSHIFTR.

This patch recognizes shuffles that shift elements and fill with zeros. I've copied and modified the shift matching code we use for normal vector registers to do this. I'm not sure if there's a good way to share more of this code without making the existing function more complex than it already is.

This will be used to enable kshift intrinsics in clang.

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

llvm-svn: 341227

5 years ago[XRay] Make Trace loading endian-aware
Dean Michael Berris [Fri, 31 Aug 2018 17:06:28 +0000 (17:06 +0000)]
[XRay] Make Trace loading endian-aware

This change makes the XRay Trace loading functions first use a
little-endian data extractor, then on failures try a big-endian data
extractor. Without this change, the trace loading facility will not work
with data written from a big-endian machine.

Follow-up to D51210 and D51289.

llvm-svn: 341226

5 years ago[XRay] Make the FDRTraceWriter Endian-aware
Dean Michael Berris [Fri, 31 Aug 2018 16:08:38 +0000 (16:08 +0000)]
[XRay] Make the FDRTraceWriter Endian-aware

Before this patch, the FDRTraceWriter would not take endianness into
account when writing data into the output stream.

This is a follow-up to D51289 and D51210.

llvm-svn: 341223

5 years ago[X86][BtVer2] Remove wrong ReadAdvance from AVX vbroadcast(ss|sd|f128) instructions.
Andrea Di Biagio [Fri, 31 Aug 2018 16:05:48 +0000 (16:05 +0000)]
[X86][BtVer2] Remove wrong ReadAdvance from AVX vbroadcast(ss|sd|f128) instructions.

The presence of a ReadAdvance for input operand #0 is problematic
because it changes the input latency of the register used as the base address
for the folded load.

A broadcast cannot start executing if the load address hasn't been computed yet.

In the llvm-mca example, the VBROADCASTSS is dependent on the address generated
by the LEAQ.  That means, it cannot start until LEAQ reaches the write-back
stage. If we apply ReadAdvance, then we wrongly assume that the load can start 3
cycles in advance.

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

llvm-svn: 341222

5 years ago[mips] Fix `mtc1` and `mfc1` definitions for microMIPS R6
Simon Atanasyan [Fri, 31 Aug 2018 15:57:17 +0000 (15:57 +0000)]
[mips] Fix `mtc1` and `mfc1` definitions for microMIPS R6

The `mtc1` and `mfc1` definitions in the MipsInstrFPU.td have MMRel,
but do not have StdMMR6Rel tags. When these instructions are emitted
for microMIPS R6 targets, `Mips::MipsR62MicroMipsR6` nor
`Mips::Std2MicroMipsR6` cannot find correct op-codes and as a result the
backend uses mips32 variant of the instructions encoding.

The patch fixes this problem by adding the StdMMR6Rel tag and check
instructions encoding in the test case.

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

llvm-svn: 341221

5 years agoAMDGPU: Restrict extract_vector_elt combine to loads
Matt Arsenault [Fri, 31 Aug 2018 15:39:52 +0000 (15:39 +0000)]
AMDGPU: Restrict extract_vector_elt combine to loads

The intention is to enable the extract_vector_elt load combine,
and doing this for other operations interferes with more
useful optimizations on vectors.

Handle any type of load since in principle we should do the
same combine for the various load intrinsics.

llvm-svn: 341219

5 years agoAMDGPU: Actually commit re-run of update_llc_test_checks
Matt Arsenault [Fri, 31 Aug 2018 15:05:06 +0000 (15:05 +0000)]
AMDGPU: Actually commit re-run of update_llc_test_checks

llvm-svn: 341218

5 years agoFix existing code for SEH on ARM to compile correctly
Martin Storsjo [Fri, 31 Aug 2018 14:56:55 +0000 (14:56 +0000)]
Fix existing code for SEH on ARM to compile correctly

Even though SEH for ARM is incomplete, make what code already exists
at least compile correctly.

The _LIBUNWIND_CURSOR_SIZE wasn't correct.

ARM (and AArch64) have a DISPATCHER_CONTEXT field named TargetPc
instead of TargetIp.

For the libunwind.h UNW_* constants, there is no UNW_ARM_PC, only
UNW_ARM_IP.

Don't use 'r' as loop variable when 'r' already is a Registers_arm
member.

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

llvm-svn: 341217

5 years ago[Wasm] Add missing EOF checks for floats
Jonas Devlieghere [Fri, 31 Aug 2018 14:54:01 +0000 (14:54 +0000)]
[Wasm] Add missing EOF checks for floats

Adds the same checks we already do for ints to floats.

Fixes: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8698
llvm-svn: 341216

5 years agoSLPVectorizer: Fix assert with different sized address spaces
Matt Arsenault [Fri, 31 Aug 2018 14:34:53 +0000 (14:34 +0000)]
SLPVectorizer: Fix assert with different sized address spaces

llvm-svn: 341215

5 years agoAMDGPU: Fix broken generated check lines
Matt Arsenault [Fri, 31 Aug 2018 14:34:22 +0000 (14:34 +0000)]
AMDGPU: Fix broken generated check lines

This was incorrectly using the same check prefix for multiple lines

llvm-svn: 341214

5 years ago[X86] Add llvm-mca tests that show how operand latency is wrongly computed for SSE...
Andrea Di Biagio [Fri, 31 Aug 2018 14:12:13 +0000 (14:12 +0000)]
[X86] Add llvm-mca tests that show how operand latency is wrongly computed for SSE sqrtss/sd and rcpss.

According to the timeline view, sqrtss/sd/rcpss start executing before the load
address for the memory operand is available.
This problem is caused by the presence of a ReadAfterLd (a ReadAdvance). Those
unary operations should not specify a ReadAdvance at all.

llvm-svn: 341213

5 years ago[DEBUGINFO] Add support for emission of the debug directives only.
Alexey Bataev [Fri, 31 Aug 2018 13:56:14 +0000 (13:56 +0000)]
[DEBUGINFO] Add support for emission of the debug directives only.

Summary:
Added option -gline-directives-only to support emission of the debug directives
only. It behaves very similar to -gline-tables-only, except that it sets
llvm debug info emission kind to
llvm::DICompileUnit::DebugDirectivesOnly.

Reviewers: echristo

Subscribers: aprantl, fedor.sergeev, JDevlieghere, cfe-commits

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

llvm-svn: 341212

5 years ago[clangd] Flatten out Symbol::Details. It was ill-conceived, sorry.
Sam McCall [Fri, 31 Aug 2018 13:55:01 +0000 (13:55 +0000)]
[clangd] Flatten out Symbol::Details. It was ill-conceived, sorry.

Reviewers: ioeric

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

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

llvm-svn: 341211

5 years ago[AddressSpace] Use the macro to set hidden visibility on LocalAddressSpace.
Charles Davis [Fri, 31 Aug 2018 13:41:05 +0000 (13:41 +0000)]
[AddressSpace] Use the macro to set hidden visibility on LocalAddressSpace.

Summary:
That attribute has no effect on Windows anyway--classes are hidden by
default.

Reviewers: mstorsjo, rnk

Subscribers: christof, cfe-commits

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

llvm-svn: 341210

5 years ago[llvm-objdump] Keep the memory buffer from the dSYM alive when using -g -dsym
Francis Visoiu Mistrih [Fri, 31 Aug 2018 13:10:54 +0000 (13:10 +0000)]
[llvm-objdump] Keep the memory buffer from the dSYM alive when using -g -dsym

When using -g and -dsym, llvm-objdump opens the dsym file and keeps the
MachOObjectFile alive, while the memory buffer that the MachOObjectFile
was based on gets destroyed.

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

llvm-svn: 341209

5 years ago[clangd] Collect symbol occurrences in SymbolCollector.
Haojian Wu [Fri, 31 Aug 2018 12:54:13 +0000 (12:54 +0000)]
[clangd] Collect symbol occurrences in SymbolCollector.

SymbolCollector will be used for two cases:
 - collect Symbol type only, used for indexing preamble AST.
 - collect Symbol and SymbolOccurrences, used for indexing main AST.

For finding local references from the AST, we will implement it in other ways.

llvm-svn: 341208

5 years ago[LLD] Add test missed from r341206. NFC.
Ben Dunbobbin [Fri, 31 Aug 2018 12:09:21 +0000 (12:09 +0000)]
[LLD] Add test missed from r341206. NFC.

llvm-svn: 341207

5 years ago[LLD] Check too large offsets into merge sections earlier
Ben Dunbobbin [Fri, 31 Aug 2018 11:51:51 +0000 (11:51 +0000)]
[LLD] Check too large offsets into merge sections earlier

This patch moves the checking for too large offsets into merge sections
earlier.

Without this change the large offset generated in the added test-case
will cause an assert (as it happens to be a value reserved as a
"tombstone" in the DenseMap implementation) when OffsetMap is queried in
getSectionPiece().

To simplify the code and avoid future mistakes I have refactored so that
there is only one function that looks up offsets in the OffsetMap.

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

llvm-svn: 341206

5 years ago[XRay] Remove array for Metadata Record Types
Dean Michael Berris [Fri, 31 Aug 2018 11:41:08 +0000 (11:41 +0000)]
[XRay] Remove array for Metadata Record Types

This simplifies the implementation of the metadata lookup by using
scoped enums, rather than using enum classes. This way we can get the
number-name mapping without having to resort to comments.

Follow-up to D51289.

llvm-svn: 341205

5 years ago[GlobalISel][X86] Add the support for G_FPTRUNC
Alexander Ivchenko [Fri, 31 Aug 2018 11:26:51 +0000 (11:26 +0000)]
[GlobalISel][X86] Add the support for G_FPTRUNC

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

llvm-svn: 341202

5 years ago[GlobalISel][X86_64] Support for G_FPTOSI
Alexander Ivchenko [Fri, 31 Aug 2018 11:16:58 +0000 (11:16 +0000)]
[GlobalISel][X86_64] Support for G_FPTOSI

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

llvm-svn: 341200

5 years ago[GlobalIsel][X86] Support for llvm.trap intrinsic
Alexander Ivchenko [Fri, 31 Aug 2018 11:05:13 +0000 (11:05 +0000)]
[GlobalIsel][X86] Support for llvm.trap intrinsic

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

llvm-svn: 341199

5 years ago[NFC] Fix unused variable warning in X86RegisterBankInfo.cpp
Alexander Ivchenko [Fri, 31 Aug 2018 10:39:54 +0000 (10:39 +0000)]
[NFC] Fix unused variable warning in X86RegisterBankInfo.cpp

llvm-svn: 341198

5 years ago[X86][BtVer2] Add an llvm-mca test that shows how the read latency of AVX broadcastss...
Andrea Di Biagio [Fri, 31 Aug 2018 10:39:33 +0000 (10:39 +0000)]
[X86][BtVer2] Add an llvm-mca test that shows how the read latency of AVX broadcastss on ymm registers is incorrectly set.

llvm-svn: 341197

5 years ago[XRay] Attempt to fix failure on Windows
Dean Michael Berris [Fri, 31 Aug 2018 10:03:52 +0000 (10:03 +0000)]
[XRay] Attempt to fix failure on Windows

Original version of the code relied on implementation-defined order of bitfields.

Follow-up on D51210.

llvm-svn: 341194

5 years ago[GlobalIsel][X86] Support for G_FCMP
Alexander Ivchenko [Fri, 31 Aug 2018 09:38:27 +0000 (09:38 +0000)]
[GlobalIsel][X86] Support for G_FCMP

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

llvm-svn: 341193

5 years agoTry to unbreak internal_sysctl() for MacOSX
Kamil Rytarowski [Fri, 31 Aug 2018 09:35:33 +0000 (09:35 +0000)]
Try to unbreak internal_sysctl() for MacOSX

Cast the 5th argument to (void *), removing cast.

llvm-svn: 341192

5 years agoFix MSVC "not all control paths return a value" warning. NFCI.
Simon Pilgrim [Fri, 31 Aug 2018 09:24:09 +0000 (09:24 +0000)]
Fix MSVC "not all control paths return a value" warning. NFCI.

llvm-svn: 341191

5 years ago[NFC] Cleanup Dex
Kirill Bobyrev [Fri, 31 Aug 2018 09:17:02 +0000 (09:17 +0000)]
[NFC] Cleanup Dex

* Use consistent assertion messages in iterators implementations
* Silence a bunch of clang-tidy warnings: use `emplace_back` instead of
  `push_back` where possible, make sure arguments have the same name in
  header and implementation file, use for loop over ranges where possible

Reviewed by: ioeric

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

llvm-svn: 341190

5 years ago[XRay] FDRProducerConsumerTest: unbreak (gcc?) build
Roman Lebedev [Fri, 31 Aug 2018 08:59:15 +0000 (08:59 +0000)]
[XRay] FDRProducerConsumerTest: unbreak (gcc?) build

/build/llvm/unittests/XRay/FDRProducerConsumerTest.cpp:90:27: error: declaration of ‘std::unique_ptr<llvm::xray::Record> llvm::xray::{anonymous}::RoundTripTest<T>::Record’ [-fpermissive]
   std::unique_ptr<Record> Record;
                           ^~~~~~
In file included from /build/llvm/include/llvm/XRay/FDRLogBuilder.h:12,
                 from /build/llvm/unittests/XRay/FDRProducerConsumerTest.cpp:15:
/build/llvm/include/llvm/XRay/FDRRecords.h:28:7: error: changes meaning of ‘Record’ from ‘class llvm::xray::Record’ [-fpermissive]
 class Record {
       ^~~~~~

llvm-svn: 341189

5 years ago[NFC][X86][AArch64] A few more patterns for [lack of] signed truncation check pattern...
Roman Lebedev [Fri, 31 Aug 2018 08:52:03 +0000 (08:52 +0000)]
[NFC][X86][AArch64] A few more patterns for [lack of] signed truncation check pattern.[NFC][X86][AArch64] A few more patterns for [lack of] signed truncation check pattern.

llvm-svn: 341188

5 years agoTry to fix internal_sysctl() for MacOSX
Kamil Rytarowski [Fri, 31 Aug 2018 08:51:29 +0000 (08:51 +0000)]
Try to fix internal_sysctl() for MacOSX

Cast the first argument to (int *) removing const.

llvm-svn: 341187

5 years agoXFail one more VSCode test which fails under heavy load
Pavel Labath [Fri, 31 Aug 2018 08:31:27 +0000 (08:31 +0000)]
XFail one more VSCode test which fails under heavy load

llvm-svn: 341186

5 years ago[X86][BtVer2] Fix WriteFShuffle256 schedule write info.
Andrea Di Biagio [Fri, 31 Aug 2018 08:30:47 +0000 (08:30 +0000)]
[X86][BtVer2] Fix WriteFShuffle256 schedule write info.

This patch fixes the number of micro opcodes, and processor resource cycles for
the following AVX instructions:

vinsertf128rr/rm
vperm2f128rr/rm
vbroadcastf128

Tests have been regenerated using the usual scripts in the llvm/utils directory.

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

llvm-svn: 341185

5 years agoNFC: Fix build failure after rL341182
Kirill Bobyrev [Fri, 31 Aug 2018 08:29:48 +0000 (08:29 +0000)]
NFC: Fix build failure after rL341182

Didn't rename another variable reference.

llvm-svn: 341184

5 years agoImprove portability of internal_sysctl()
Kamil Rytarowski [Fri, 31 Aug 2018 08:24:23 +0000 (08:24 +0000)]
Improve portability of internal_sysctl()

Add an explicit cast from uptr to size_t to prevent potential type mismatch.

llvm-svn: 341183

5 years ago[NFC] Use LLVM naming conventions within FileDistance
Kirill Bobyrev [Fri, 31 Aug 2018 08:19:50 +0000 (08:19 +0000)]
[NFC] Use LLVM naming conventions within FileDistance

Reviewed by: sammccall

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

llvm-svn: 341182

5 years agoAdd internal_sysctl() used by FreeBSD, NetBSD, OpenBSD and MacOSX
Kamil Rytarowski [Fri, 31 Aug 2018 08:10:06 +0000 (08:10 +0000)]
Add internal_sysctl() used by FreeBSD, NetBSD, OpenBSD and MacOSX

Summary:
Switch local sysctl(2) calls to internal_sysctl().

This is a preparation for introduction of interceptors for
the sysctl*() family of functions and switching `internal_sysctl*()`
to libc calls bypassing interceptors.

No functional change intended with this revision.

Reviewers: vitalybuka, joerg, kcc

Reviewed By: vitalybuka

Subscribers: kubamracek, llvm-commits, #sanitizers

Tags: #sanitizers

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

llvm-svn: 341181

5 years ago[XRay] FDR Record Producer/Consumer Implementation
Dean Michael Berris [Fri, 31 Aug 2018 08:04:56 +0000 (08:04 +0000)]
[XRay] FDR Record Producer/Consumer Implementation

Summary:
This patch defines two new base types called `RecordProducer` and
`RecordConsumer` which have default implementations for convenience
(particularly for testing).

A `RecordProducer` implementation has one member function called
`produce()` which serves as a factory constructor for `Record`
instances. This code exercises the `RecordInitializer` code path in the
implementation for `FileBasedRecordProducer`.

A `RecordConsumer` has a single member function called `consume(...)`
which, as the name implies, consumes instances of
`std::unique_ptr<Record>`. We have two implementations, one of which is
used in the test to generate a vector of `std::unique_ptr<Record>`
similar to how the `LogBuilder` implementation works.

We introduce a test in `FDRProducerConsumerTest` which ensures that
records we write through the `FDRTraceWriter` can be loaded by the
`FileBasedRecordProducer`. The record(s) loaded this way are written
again through the `FDRTraceWriter` into a separate string, which we then
compare. This ensures that the read-in bytes to create the `Record`
instances in memory can be replicated when written out through the
`FDRTraceWriter`.

This change depends on D51210 and is part of the refactoring of D50441
into smaller, more focused changes.

Reviewers: eizan, kpw

Subscribers: mgorny, hiraditya, llvm-commits

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

llvm-svn: 341180

5 years ago[ELF] [ARM] Don't mix 'ip' and 'r12' as names for the same register in comments....
Martin Storsjo [Fri, 31 Aug 2018 08:03:33 +0000 (08:03 +0000)]
[ELF] [ARM] Don't mix 'ip' and 'r12' as names for the same register in comments. NFC.

llvm-svn: 341179

5 years ago[AArch64] Hook up the missed machine operand flag name for MO_DLLIMPORT
Martin Storsjo [Fri, 31 Aug 2018 08:00:34 +0000 (08:00 +0000)]
[AArch64] Hook up the missed machine operand flag name for MO_DLLIMPORT

llvm-svn: 341178

5 years ago[MinGW] [X86] Pass true for the second parameter to StubValueTy for MO_COFFSTUB....
Martin Storsjo [Fri, 31 Aug 2018 08:00:31 +0000 (08:00 +0000)]
[MinGW] [X86] Pass true for the second parameter to StubValueTy for MO_COFFSTUB. NFC.

These stubs should never be emitted for internal symbols, and
nothing in AsmPrinter ever actually use this value when producing
the stubs for COFF anyway.

llvm-svn: 341177

5 years ago[MinGW] [ARM] Add stubs for potential automatic dllimported variables
Martin Storsjo [Fri, 31 Aug 2018 08:00:25 +0000 (08:00 +0000)]
[MinGW] [ARM] Add stubs for potential automatic dllimported variables

The runtime pseudo relocations can't handle the ARM format embedded
addresses in movw/movt pairs. By using stubs, the potentially
dllimported addresses can be touched up by the runtime pseudo relocation
framework.

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

llvm-svn: 341176

5 years ago[COFF] When doing automatic dll imports, replace whole .refptr.<var> chunks with...
Martin Storsjo [Fri, 31 Aug 2018 07:45:20 +0000 (07:45 +0000)]
[COFF] When doing automatic dll imports, replace whole .refptr.<var> chunks with __imp_<var>

After fixing up the runtime pseudo relocation, the .refptr.<var>
will be a plain pointer with the same value as the IAT entry itself.
To save a little binary size and reduce the number of runtime pseudo
relocations, redirect references to the IAT entry (via the __imp_<var>
symbol) itself and discard the .refptr.<var> chunk (as long as the
same section chunk doesn't contain anything else than the single
pointer).

As there are now cases for both setting the Live variable to true
and false externally, remove the accessors and setters and just make
the variable public instead.

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

llvm-svn: 341175

5 years ago[X86] Don't do anything in ReplaceNodeResults for (v2i32 (fptoui/fptosi v2f32)) when...
Craig Topper [Fri, 31 Aug 2018 07:05:39 +0000 (07:05 +0000)]
[X86] Don't do anything in ReplaceNodeResults for (v2i32 (fptoui/fptosi v2f32)) when -x86-experimental-vector-widening-legalization is on.

We don't need to do our own widening, the generic legalizer can do it.

llvm-svn: 341174

5 years ago[X86] Add a -x86-experimental-vector-widening command line to vec_fp_to_int.ll.
Craig Topper [Fri, 31 Aug 2018 07:05:38 +0000 (07:05 +0000)]
[X86] Add a -x86-experimental-vector-widening command line to vec_fp_to_int.ll.

llvm-svn: 341173

5 years ago[X86] Don't custom widen (v2i32 (setcc v2f32)) when -x86-experimental-vector-widening...
Craig Topper [Fri, 31 Aug 2018 07:05:37 +0000 (07:05 +0000)]
[X86] Don't custom widen (v2i32 (setcc v2f32)) when -x86-experimental-vector-widening-legalization is in effect.

We aren't doing anything than what the generic legalizer will do so just let it do it.

llvm-svn: 341172

5 years ago[X86] Add -x86-experimental-vector-widening-legalization run line to avx512-cvt.ll
Craig Topper [Fri, 31 Aug 2018 07:05:36 +0000 (07:05 +0000)]
[X86] Add -x86-experimental-vector-widening-legalization run line to avx512-cvt.ll

This will cover the (v2i32 (setcc v2f32)) case in replaceNodeResults. That code shouldn't be needed at all in this mode. A future patch will skip it.

llvm-svn: 341171

5 years ago[hwasan] move code around to remove an opaque class definition (HwasanThreadLocalMall...
Kostya Serebryany [Fri, 31 Aug 2018 06:08:48 +0000 (06:08 +0000)]
[hwasan] move code around to remove an opaque class definition (HwasanThreadLocalMallocStorage) that had incorrect size and used 10x more than needed RAM (500K instead of 50K per thread)

llvm-svn: 341170

5 years agoAMDGPU: Remove obsolete tests
Matt Arsenault [Fri, 31 Aug 2018 06:07:45 +0000 (06:07 +0000)]
AMDGPU: Remove obsolete tests

llvm-svn: 341169

5 years agoAMDGPU: Stop forcing internalize at -O0
Matt Arsenault [Fri, 31 Aug 2018 06:02:36 +0000 (06:02 +0000)]
AMDGPU: Stop forcing internalize at -O0

This doesn't really matter if clang is always emitting
the visibility as hidden by default.

llvm-svn: 341168

5 years agoFix a typo in mac SIP workaround
Pavel Labath [Fri, 31 Aug 2018 06:01:02 +0000 (06:01 +0000)]
Fix a typo in mac SIP workaround

presumably the or subexpression was meant to be evaluated first. The way
it is now means that we apply the workaround for any python in `/usr`,
which matches pretty much every unix system.

llvm-svn: 341167

5 years ago[hwasan] simplify the code, NFC
Kostya Serebryany [Fri, 31 Aug 2018 05:55:18 +0000 (05:55 +0000)]
[hwasan] simplify the code, NFC

llvm-svn: 341166

5 years agoAMDGPU: Remove remnants of old address space mapping
Matt Arsenault [Fri, 31 Aug 2018 05:49:54 +0000 (05:49 +0000)]
AMDGPU: Remove remnants of old address space mapping

llvm-svn: 341165

5 years agoIncrease qHostInfo packet timeout
Pavel Labath [Fri, 31 Aug 2018 05:34:03 +0000 (05:34 +0000)]
Increase qHostInfo packet timeout

Host info computation can involve DNS traffic (to compute the remote
host name). On very unreliable networks (such as free WiFi on trains),
this can take several seconds to complete or timeout. Increase the
qHostInfo timeout to account for this.

llvm-svn: 341164

5 years agoSilence some "control reaches end of non-void function" warnings with gcc
Pavel Labath [Fri, 31 Aug 2018 05:18:11 +0000 (05:18 +0000)]
Silence some "control reaches end of non-void function" warnings with gcc

llvm-svn: 341163

5 years ago[hwasan] more heap-buffer-overflow tests
Kostya Serebryany [Fri, 31 Aug 2018 05:05:01 +0000 (05:05 +0000)]
[hwasan] more heap-buffer-overflow tests

llvm-svn: 341162

5 years ago[clang-move] Explicitly ignore implicit UsingDirectiveDecls instead of depending...
Argyrios Kyrtzidis [Fri, 31 Aug 2018 03:51:33 +0000 (03:51 +0000)]
[clang-move] Explicitly ignore implicit UsingDirectiveDecls instead of depending on them missing source locations

This is adjustment to allow the logic to work even if implicit UsingDirectiveDecls get actual source locations.
There should be no functionality change.

llvm-svn: 341161

5 years ago[hwasan] report heap-buffer-overflow location, once, not once per each live thread
Kostya Serebryany [Fri, 31 Aug 2018 03:29:09 +0000 (03:29 +0000)]
[hwasan] report heap-buffer-overflow location, once, not once per each live thread

llvm-svn: 341160

5 years ago[hwasan] properly report heap-buffer-overflow
Kostya Serebryany [Fri, 31 Aug 2018 03:18:31 +0000 (03:18 +0000)]
[hwasan] properly report heap-buffer-overflow

llvm-svn: 341159

5 years ago[hwasan] fix the build on Linux Ubuntu 14.04. We don't need __hwasan_shadow on Linux...
Kostya Serebryany [Fri, 31 Aug 2018 02:38:23 +0000 (02:38 +0000)]
[hwasan] fix the build on Linux Ubuntu 14.04. We don't need __hwasan_shadow on Linux at all

llvm-svn: 341158

5 years agoFixed missing sidebars on the website
Raphael Isemann [Fri, 31 Aug 2018 02:07:05 +0000 (02:07 +0000)]
Fixed missing sidebars on the website

We didn't mark these HTML files as executable, which means that
the SSI includes for including the sidebar didn't work.

llvm-svn: 341157

5 years ago[hwasan] make malloc(0) return nullptr, add basic address description for stack addresses
Kostya Serebryany [Fri, 31 Aug 2018 01:38:00 +0000 (01:38 +0000)]
[hwasan] make malloc(0) return nullptr, add basic address description for stack addresses

llvm-svn: 341156

5 years ago[ORC] Remove a stray debugging output line left in a unit test.
Lang Hames [Fri, 31 Aug 2018 00:53:53 +0000 (00:53 +0000)]
[ORC] Remove a stray debugging output line left in a unit test.

llvm-svn: 341155

5 years ago[ORC] Add utilities to RTDyldObjectLinkingLayer2 to simplify symbol flag
Lang Hames [Fri, 31 Aug 2018 00:53:17 +0000 (00:53 +0000)]
[ORC] Add utilities to RTDyldObjectLinkingLayer2 to simplify symbol flag
management and materialization responsibility registration.

The setOverrideObjectFlagsWithResponsibilityFlags method instructs
RTDyldObjectlinkingLayer2 to override the symbol flags produced by RuntimeDyld with
the flags provided by the MaterializationResponsibility instance. This can be used
to enable symbol visibility (hidden/exported) for COFF object files, which do not
currently support the SF_Exported flag.

The setAutoClaimResponsibilityForObjectSymbols method instructs
RTDyldObjectLinkingLayer2 to claim responsibility for any symbols provided by a
given object file that were not already in the MaterializationResponsibility
instance. Setting this flag allows higher-level program representations (e.g.
LLVM IR) to be added based on only a subset of the symbols they provide, without
having to write intervening layers to scan and add the additional symbols. This
trades diagnostic quality for convenience however: If all symbols are enumerated
up-front then clashes can be detected and reported early. If this option is set,
clashes for the additional symbols may not be detected until late, and detection
may depend on the flow of control through JIT'd code.

llvm-svn: 341154

5 years ago[PPC64] Improve a test ppc64_entry_point.s
Fangrui Song [Fri, 31 Aug 2018 00:33:16 +0000 (00:33 +0000)]
[PPC64] Improve a test ppc64_entry_point.s

Rename to ppc64-entry-point.s
Deduplicate .text dump of little-endian big-endian

llvm-svn: 341153

5 years agoImport lit.llvm after rL341130
Fangrui Song [Fri, 31 Aug 2018 00:26:46 +0000 (00:26 +0000)]
Import lit.llvm after rL341130

llvm-svn: 341152

5 years agoImport lit.llvm after rC341132
Fangrui Song [Fri, 31 Aug 2018 00:24:36 +0000 (00:24 +0000)]
Import lit.llvm after rC341132

llvm-svn: 341151

5 years agoImport lit.llvm after rLLD341134
Fangrui Song [Fri, 31 Aug 2018 00:23:09 +0000 (00:23 +0000)]
Import lit.llvm after rLLD341134

llvm-svn: 341150

5 years agoImport lit.llvm after rL341135
Fangrui Song [Fri, 31 Aug 2018 00:22:20 +0000 (00:22 +0000)]
Import lit.llvm after rL341135

llvm-svn: 341149

5 years ago[PPC64] Improve a test ppc64-toc-rel.s
Fangrui Song [Fri, 31 Aug 2018 00:16:22 +0000 (00:16 +0000)]
[PPC64] Improve a test ppc64-toc-rel.s

Deduplicate dump of .text .data for little-endian and big-endian
Fix a RELOCS-NE check line typo

llvm-svn: 341148

5 years agoRevert "[NFC] Add severe validation of InstructionPrecedenceTracking" for discussion
Max Kazantsev [Fri, 31 Aug 2018 00:01:54 +0000 (00:01 +0000)]
Revert "[NFC] Add severe validation of InstructionPrecedenceTracking" for discussion

llvm-svn: 341147

5 years agoRemove vestiges of configure buildsystem
Stephen Kelly [Thu, 30 Aug 2018 23:41:03 +0000 (23:41 +0000)]
Remove vestiges of configure buildsystem

Summary:

Subscribers: mgorny, cfe-commits

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

llvm-svn: 341146

5 years agoAdd preload option to clang-query
Stephen Kelly [Thu, 30 Aug 2018 23:25:44 +0000 (23:25 +0000)]
Add preload option to clang-query

Summary: This allows loading a file with pre-defined let commands for example.

Subscribers: cfe-commits

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

llvm-svn: 341145

5 years agoExtract runCommandsInFile method
Stephen Kelly [Thu, 30 Aug 2018 23:25:38 +0000 (23:25 +0000)]
Extract runCommandsInFile method

Subscribers: cfe-commits

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

llvm-svn: 341144

5 years ago[hwasan] fix the linux-only pthread_create interceptor and reinstate the two threaded...
Kostya Serebryany [Thu, 30 Aug 2018 23:22:26 +0000 (23:22 +0000)]
[hwasan] fix the linux-only pthread_create interceptor and reinstate the two threaded tests

llvm-svn: 341143

5 years agoAllow binding to NamedValue resulting from let expression
Stephen Kelly [Thu, 30 Aug 2018 23:11:09 +0000 (23:11 +0000)]
Allow binding to NamedValue resulting from let expression

Subscribers: cfe-commits

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

llvm-svn: 341142

5 years agoExtract parseBindID method
Stephen Kelly [Thu, 30 Aug 2018 23:11:01 +0000 (23:11 +0000)]
Extract parseBindID method

Subscribers: cfe-commits

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

llvm-svn: 341141

5 years agoAdd dump() method for SourceRange
Stephen Kelly [Thu, 30 Aug 2018 23:10:52 +0000 (23:10 +0000)]
Add dump() method for SourceRange

Subscribers: cfe-commits

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

llvm-svn: 341140

5 years ago[PPC64] Remove unused -z notext from a test
Fangrui Song [Thu, 30 Aug 2018 23:01:00 +0000 (23:01 +0000)]
[PPC64] Remove unused -z notext from a test

llvm-svn: 341139

5 years ago[NFC] adding initial intersect test for Node to Instruction association
Michael Berg [Thu, 30 Aug 2018 22:43:34 +0000 (22:43 +0000)]
[NFC] adding initial intersect test for Node to Instruction association

llvm-svn: 341138

5 years ago[Hexagon] Check validity of register class when generating bitsplit
Krzysztof Parzyszek [Thu, 30 Aug 2018 22:26:43 +0000 (22:26 +0000)]
[Hexagon] Check validity of register class when generating bitsplit

llvm-svn: 341137

5 years ago[ARM] Enable GEP offset splitting for 32-bit ARM.
Eli Friedman [Thu, 30 Aug 2018 22:18:27 +0000 (22:18 +0000)]
[ARM] Enable GEP offset splitting for 32-bit ARM.

It has essentially the same benefit it has on 64-bit ARM: it
substantially reduces the number of constants used by large GEP
operations. Seems to be generally helpful across a few different
codebases I've tried.

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

llvm-svn: 341136

5 years agoRemove LIT_SITE_CFG_IN_FOOTER, llvm
Nico Weber [Thu, 30 Aug 2018 22:13:34 +0000 (22:13 +0000)]
Remove LIT_SITE_CFG_IN_FOOTER, llvm

It's always replaced with the same (short) static string, so just put that
there directly.

No intended behavior change.
https://reviews.llvm.org/D51357

llvm-svn: 341135

5 years agoRemove LIT_SITE_CFG_IN_FOOTER, lld
Nico Weber [Thu, 30 Aug 2018 22:12:16 +0000 (22:12 +0000)]
Remove LIT_SITE_CFG_IN_FOOTER, lld

It's always replaced with the same (short) static string, so just put that
there directly.

No intended behavior change.
https://reviews.llvm.org/D51357

llvm-svn: 341134

5 years ago[hwasan] use thread-local ring buffers to properly report heap-use-after-free
Kostya Serebryany [Thu, 30 Aug 2018 22:11:56 +0000 (22:11 +0000)]
[hwasan] use thread-local ring buffers to properly report heap-use-after-free

llvm-svn: 341133

5 years agoRemove LIT_SITE_CFG_IN_FOOTER, clang
Nico Weber [Thu, 30 Aug 2018 22:11:16 +0000 (22:11 +0000)]
Remove LIT_SITE_CFG_IN_FOOTER, clang

It's always replaced with the same (short) static string, so just put that
there directly.

No intended behavior change.
https://reviews.llvm.org/D51357

llvm-svn: 341132

5 years ago[WebAssembly] Update utility functions with SIMD types
Thomas Lively [Thu, 30 Aug 2018 22:10:43 +0000 (22:10 +0000)]
[WebAssembly] Update utility functions with SIMD types

Reviewers: aheejin, dschuff

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

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

llvm-svn: 341131

5 years agoRemove LIT_SITE_CFG_IN_FOOTER, clang-tools-extra
Nico Weber [Thu, 30 Aug 2018 22:10:13 +0000 (22:10 +0000)]
Remove LIT_SITE_CFG_IN_FOOTER, clang-tools-extra

It's always replaced with the same (short) static string, so just put that
there directly.

No intended behavior change.
https://reviews.llvm.org/D51357

llvm-svn: 341130

5 years ago[hwasan] temporarily remove two tests to silence the bots
Kostya Serebryany [Thu, 30 Aug 2018 22:07:09 +0000 (22:07 +0000)]
[hwasan] temporarily remove two tests to silence the bots

llvm-svn: 341129

5 years ago[WebAssembly] Vector conversions
Thomas Lively [Thu, 30 Aug 2018 21:43:51 +0000 (21:43 +0000)]
[WebAssembly] Vector conversions

Summary:
Lowers away bitconverts between vector types. This CL depends
on D51383.

Reviewers: aheejin, dschuff

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

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

llvm-svn: 341128