Commit Graph

298108 Commits

Author SHA1 Message Date
Dean Michael Berris 4cae04873b [XRay] Use correct type for PID records
Previously we've been reading and writing the wrong types which only
worked in little endian implementations. This time we're writing the
same typed values the runtime is using, and reading them appropriately
as well.

llvm-svn: 341241
2018-08-31 19:32:46 +00:00
Tim Northover cc8f593d29 Tests: fix tests encoding specific hash values for 32-bit systems.
I changed the seed slightly, but forgot to run the tests on a 32-bit system, so
tests which hard-code a specific hash value started breaking.

llvm-svn: 341240
2018-08-31 19:24:37 +00:00
Dean Michael Berris 250c56d127 [XRay] Use correct type for thread ID parsing
Previously we were reading only a uint16_t when we really needed to read
an int32_t from the log.

llvm-svn: 341239
2018-08-31 19:11:19 +00:00
Sid Manning b1c9813042 [Hexagon] Add support for getRegisterByName.
Support required to build the Hexagon Linux kernel.

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

llvm-svn: 341238
2018-08-31 19:08:23 +00:00
Dean Michael Berris 7975e274da [XRay] Improve test matching granularity (NFC)
Simplify matchers for unittest to better isolate which differences there
are that we're finding in failures.

llvm-svn: 341237
2018-08-31 18:56:42 +00:00
Dean Michael Berris 3fc4cbfe10 [XRay] Change function record reader to be endian-aware
This change allows us to let the compiler do the right thing for when
handling big-endian and little-endian records for FDR mode function
records.

Previously, we assumed that the encoding was little-endian that reading
the first byte to look for the function id and function record types was
ordered in a little-endian manner. This change allows us to better
handle function records where the first four bytes may actually be
encoded in big-endian thus giving us the wrong bytes where we're seeking
the function information from.

This is a follow-up to D51210 and D51289.

llvm-svn: 341236
2018-08-31 18:36:58 +00:00
Pavel Labath 332447f4b4 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
2018-08-31 18:25:01 +00:00
Craig Topper 2aa8efc820 [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
2018-08-31 18:22:52 +00:00
Frederic Riss 7f03f3d7f9 Fix a comment to use the correct variable name.
llvm-svn: 341233
2018-08-31 18:14:53 +00:00
Charles Davis 805173c84d 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
2018-08-31 18:11:48 +00:00
Sterling Augustine 1c04e1f552 Refactor Addlibgcc to make the when and what logic more straightfoward.
Add Android tests.

llvm-svn: 341231
2018-08-31 17:59:03 +00:00
Dean Michael Berris c1dceee50b [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
2018-08-31 17:49:59 +00:00
Evgeniy Stepanov 5abf7d90ac [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
2018-08-31 17:49:49 +00:00
Alexandre Ganea 6a7efef4af [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
2018-08-31 17:41:58 +00:00
Craig Topper b7bb9f0078 [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
2018-08-31 17:17:21 +00:00
Dean Michael Berris 5b7548c653 [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
2018-08-31 17:06:28 +00:00
Dean Michael Berris 98717978c9 [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
2018-08-31 16:08:38 +00:00
Andrea Di Biagio a59ec4efa0 [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
2018-08-31 16:05:48 +00:00
Simon Atanasyan 3785e84cf2 [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
2018-08-31 15:57:17 +00:00
Matt Arsenault bf07a50a98 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
2018-08-31 15:39:52 +00:00
Matt Arsenault 6f35f0c212 AMDGPU: Actually commit re-run of update_llc_test_checks
llvm-svn: 341218
2018-08-31 15:05:06 +00:00
Martin Storsjo a2646444d2 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
2018-08-31 14:56:55 +00:00
Jonas Devlieghere e3d6b9786e [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
2018-08-31 14:54:01 +00:00
Matt Arsenault c807ce0ee4 SLPVectorizer: Fix assert with different sized address spaces
llvm-svn: 341215
2018-08-31 14:34:53 +00:00
Matt Arsenault 28c16bd534 AMDGPU: Fix broken generated check lines
This was incorrectly using the same check prefix for multiple lines

llvm-svn: 341214
2018-08-31 14:34:22 +00:00
Andrea Di Biagio 69da3f3df6 [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
2018-08-31 14:12:13 +00:00
Alexey Bataev 80e1b5eb34 [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
2018-08-31 13:56:14 +00:00
Sam McCall 2e5700f038 [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
2018-08-31 13:55:01 +00:00
Charles Davis 226570dcfc [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
2018-08-31 13:41:05 +00:00
Francis Visoiu Mistrih 8e864be70a [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
2018-08-31 13:10:54 +00:00
Haojian Wu d81e3146e3 [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
2018-08-31 12:54:13 +00:00
Ben Dunbobbin d2c2c57f52 [LLD] Add test missed from r341206. NFC.
llvm-svn: 341207
2018-08-31 12:09:21 +00:00
Ben Dunbobbin df6f0ad210 [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
2018-08-31 11:51:51 +00:00
Dean Michael Berris fc774e29d2 [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
2018-08-31 11:41:08 +00:00
Alexander Ivchenko 9d053074a1 [GlobalISel][X86] Add the support for G_FPTRUNC
Differential Revision: https://reviews.llvm.org/D49855

llvm-svn: 341202
2018-08-31 11:26:51 +00:00
Alexander Ivchenko 9b0b492653 [GlobalISel][X86_64] Support for G_FPTOSI
Differential Revision: https://reviews.llvm.org/D49183

llvm-svn: 341200
2018-08-31 11:16:58 +00:00
Alexander Ivchenko 58a5d6fde7 [GlobalIsel][X86] Support for llvm.trap intrinsic
Differential Revision: https://reviews.llvm.org/D49180

llvm-svn: 341199
2018-08-31 11:05:13 +00:00
Alexander Ivchenko 5b8418983c [NFC] Fix unused variable warning in X86RegisterBankInfo.cpp
llvm-svn: 341198
2018-08-31 10:39:54 +00:00
Andrea Di Biagio 0e21ca1278 [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
2018-08-31 10:39:33 +00:00
Dean Michael Berris 7a07a41cbb [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
2018-08-31 10:03:52 +00:00
Alexander Ivchenko a26a364e75 [GlobalIsel][X86] Support for G_FCMP
Differential Revision: https://reviews.llvm.org/D49172

llvm-svn: 341193
2018-08-31 09:38:27 +00:00
Kamil Rytarowski 43b15cddac Try to unbreak internal_sysctl() for MacOSX
Cast the 5th argument to (void *), removing cast.

llvm-svn: 341192
2018-08-31 09:35:33 +00:00
Simon Pilgrim 95f4120f09 Fix MSVC "not all control paths return a value" warning. NFCI.
llvm-svn: 341191
2018-08-31 09:24:09 +00:00
Kirill Bobyrev 493b1627ca [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
2018-08-31 09:17:02 +00:00
Roman Lebedev a8c22c0894 [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
2018-08-31 08:59:15 +00:00
Roman Lebedev 75c2961b76 [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
2018-08-31 08:52:03 +00:00
Kamil Rytarowski 1125e78045 Try to fix internal_sysctl() for MacOSX
Cast the first argument to (int *) removing const.

llvm-svn: 341187
2018-08-31 08:51:29 +00:00
Pavel Labath 8b0853a6da XFail one more VSCode test which fails under heavy load
llvm-svn: 341186
2018-08-31 08:31:27 +00:00
Andrea Di Biagio b998eae2f2 [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
2018-08-31 08:30:47 +00:00
Kirill Bobyrev c38b3f0308 NFC: Fix build failure after rL341182
Didn't rename another variable reference.

llvm-svn: 341184
2018-08-31 08:29:48 +00:00