Commit Graph

291958 Commits

Author SHA1 Message Date
Luke Geeson dc54b37414 [AArch64] Corrected FP16 Intrinsic range checks in Clang + added Sema tests
Summary:
This fixes the ranges for the vcvth family of FP16 intrinsics in the clang front end. Previously it was accepting incorrect ranges
-Changed builtin range checking in SemaChecking
-added tests SemaCheck changes - included in  their own file since no similar one exists
-modified existing tests to reflect new ranges

Reviewers: SjoerdMeijer, javed.absar

Reviewed By: SjoerdMeijer

Subscribers: kristof.beyls, cfe-commits

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

llvm-svn: 334489
2018-06-12 09:54:27 +00:00
Luke Geeson dc82aa44e6 [AArch64] Audit on rL333879 to fix FP16 64bit bitpatterns
llvm-svn: 334488
2018-06-12 09:35:20 +00:00
Peter Wu 14db2509ac [ASAN] fix fgets and fgets_fputs tests failure
Some systems (Android) might not have /etc/passwd. Fixes r334450.

llvm-svn: 334487
2018-06-12 09:27:18 +00:00
Simon Pilgrim cfd96329f0 [CostModel][X86] Add extra Identity shuffle mask cost tests (D47986)
llvm-svn: 334486
2018-06-12 09:18:13 +00:00
Eric Liu 6de95ece44 [clangd] Support proximity paths in index fuzzy find.
Reviewers: sammccall

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

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

llvm-svn: 334485
2018-06-12 08:48:20 +00:00
Alexander Richardson 127176e59e [ELF][MIPS] Fix TLS GOT entries for local symbols in shared libraries
Summary:
Previously LLD would not add any dynamic relocations and write a module
index of 1 which is not correct for the shared library case.
This can happen when a thread-local global variable is marked as local with
a version script. With this change I am now able to link all of the FreeBSD
base system for MIPS64 with LLD.

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

llvm-svn: 334483
2018-06-12 08:00:38 +00:00
Craig Topper 88c230265b [X86] Add NotMemoryFoldable to the VPCOMPRESS instructions.
llvm-svn: 334481
2018-06-12 07:32:19 +00:00
Craig Topper 4cdb153dde [X86] Don't add stores to the autogenerated load folding tables if the register and memory operands have different widths.
This can cause the amount of the memory written to be changed which would be bad.

llvm-svn: 334480
2018-06-12 07:32:18 +00:00
Craig Topper 5799e4df75 [X86] Add NotMemoryFoldable to more instructions.
These include PUSH/POP instructions that don't match the manual table. This also includes CMPXCHG which we never emit in non-locked form.

llvm-svn: 334479
2018-06-12 07:32:17 +00:00
Craig Topper 51805de092 [X86] Update folding table generator to properly detect RMW arithmetic instructions.
The RMW instructions are detected by reading the SchedRW data, but the RMW instructions have had their SchedRW changed in recent months. This broke the expectation.

We probably should fix this to use the mayLoad/mayStore flags if possible.

llvm-svn: 334478
2018-06-12 07:32:15 +00:00
Petr Hosek a9e7908e30 [CMake] Use common variable for all header targets NFC
This simplifies the handling of header targets.

llvm-svn: 334477
2018-06-12 06:58:06 +00:00
Wei Mi d9be2c7e64 [NFC] Change sample profile format enum name SPF_Raw_Binary to SPF_Binary.
Some out-of-tree targets depend on the enum name SPF_Binary. Keep the name
can avoid unnecessary churn to those targets.

llvm-svn: 334476
2018-06-12 05:53:49 +00:00
Wei Mi 432db3b43b Fix a typo in rL334447.
llvm-svn: 334475
2018-06-12 04:43:09 +00:00
Craig Topper 66572df76e [X86] Add NotMemoryFoldable to a bunch of instructions to suppress them from the autogenerated load folding table.
Most of these are system instructions or other instructions we don't use in CodeGen. No point wasting space for them in the table. Removing them from the autogenerated table makes it easier to review the manual table.

A few are real opcode collisions where the memory and register forms are completely different instructions.

llvm-svn: 334474
2018-06-12 04:34:59 +00:00
Craig Topper 869c54e72e [X86] Enforce agreement of AdSize field when autogenerating load folding table entries.
llvm-svn: 334473
2018-06-12 04:34:58 +00:00
Dean Michael Berris aea8ece102 [XRay][profiler] Part 5: Profiler File Writing
Summary:
This is part of the larger XRay Profiling Mode effort.

This patch implements the profile writing mechanism, to allow profiles
collected through the profiler mode to be persisted to files.

Follow-on patches would allow us to load these profiles and start
converting/analysing them through the `llvm-xray` tool.

Depends on D44620.

Reviewers: echristo, kpw, pelikan

Reviewed By: kpw

Subscribers: llvm-commits

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

llvm-svn: 334472
2018-06-12 04:06:25 +00:00
Raphael Isemann f2e0e03b67 Fix that AlignedAllocation.h doesn't compile because of VersionTuple
Summary:
 rL334399 put VersionTuple in the llvm namespace, but this header still assumes it's in the clang namespace.
This leads to compilation failures with enabled modules when building Clang.

Subscribers: cfe-commits

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

llvm-svn: 334471
2018-06-12 03:43:21 +00:00
Petr Hosek 0aa70faf9b [CMake] Add a missing target dependency on C++ ABI headers
This resolves the breakage introduced in r334468 which results in
build error when using CMake Makefile generator.

llvm-svn: 334470
2018-06-12 03:31:03 +00:00
Dean Michael Berris cfd7eec3d8 [XRay][profiler] Part 4: Profiler Mode Wiring
Summary:
This is part of the larger XRay Profiling Mode effort.

This patch implements the wiring required to enable us to actually
select the `xray-profiling` mode, and install the handlers to start
measuring the time and frequency of the function calls in call stacks.
The current way to get the profile information is by working with the
XRay API to `__xray_process_buffers(...)`.

In subsequent changes we'll implement profile saving to files, similar
to how the FDR and basic modes operate, as well as means for converting
this format into those that can be loaded/visualised as flame graphs. We
will also be extending the accounting tool in LLVM to support
stack-based function call accounting.

We also continue with the implementation to support building small
histograms of latencies for the `FunctionCallTrie::Node` type, to allow
us to actually approximate the distribution of latencies per function.

Depends on D45758 and D46998.

Reviewers: eizan, kpw, pelikan

Reviewed By: kpw

Subscribers: llvm-commits, mgorny

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

llvm-svn: 334469
2018-06-12 03:29:39 +00:00
Petr Hosek c20c182df3 Reland "Use custom command and target to install libc++ headers"
Using file(COPY FILE...) has several downsides. Since the file command
is only executed at configuration time, any changes to headers made
after the initial CMake execution are ignored. This can lead to subtle
errors since the just built Clang will be using stale libc++ headers.
Furthermore, since the headers are copied prior to executing the build
system, this may hide missing dependencies on libc++ from other LLVM
components.

This changes replaces the use of file(COPY FILE...) command with a
custom command and target which addresses all aforementioned issues and
matches the implementation already used by other LLVM components that
also install headers like Clang builtin headers.

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

llvm-svn: 334468
2018-06-12 03:10:02 +00:00
Marshall Clow e044d1e504 Update the to-do list with motions from Rapperswil.
llvm-svn: 334467
2018-06-12 02:45:30 +00:00
Brian Gesiak b9f7f4b87c [Darwin] Use errorHandler from liblldCommon
Summary:
Error handling in liblldCore and the Darwin toolchain prints to an
output stream. A TODO in the project explained that a diagnostics
interface resembling Clang's should be added.

For now, the simple diagnostics interface defined in liblldCommon seems
like an improvement. It prints colors when they're available, uses locks
for thread-safety, and abstracts away the `"error: "` and newline
literal strings that litter the Darwin toolchain code.

To use the liblldCommon error handler, a link dependency is added to
the liblldDriver library.

Test Plan:
1. check-lld
2. Invoke `ld64.lld -r` in a terminal that supports color output.
   Confirm that "ld64.lld: error: -arch not specified and could not be inferred"
   is output, and that the "error:" is colored red!

Reviewers: ruiu, smeenai

Reviewed By: ruiu

Subscribers: mgorny, llvm-commits

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

llvm-svn: 334466
2018-06-12 02:34:04 +00:00
Sean Fertile e6b2e06f28 [PPC64] Support R_PPC64_DTPREL relocations.
Patch adds support for most of the dynamic thread pointer based relocations
for local-dynamic tls. The HIGH and HIGHA versions are missing becuase they
are not supported by the llvm integrated assembler yet.

llvm-svn: 334465
2018-06-12 01:47:02 +00:00
Ryan Prichard 1e216a59f6 [builtins] Delay emutls deallocation for one round
Summary:
With Android/Bionic, delay deallocation to round 2 of 4. It must run after
C++ thread_local destructors have been called, but before the final 2
rounds, because emutls calls free, and jemalloc then needs another 2
rounds to free its thread-specific data.

Fixes https://github.com/android-ndk/ndk/issues/687

Reviewers: cmtice, srhines, jyknight, chh, echristo

Reviewed By: srhines, chh, echristo

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

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

llvm-svn: 334463
2018-06-12 01:32:26 +00:00
Ryan Prichard 31e4a550a3 [builtins] emutls cleanup: determine header size using sizeof
Summary: Also add a few post-#else/#endif comments

Reviewers: echristo, srhines

Reviewed By: echristo

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

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

llvm-svn: 334462
2018-06-12 01:32:25 +00:00
Michael Berg 95f3a430a8 NFC, some additional tests added and some renaming for planned fma support changes
llvm-svn: 334461
2018-06-12 00:52:43 +00:00
Craig Topper 957b738432 [X86] Add isel patterns for folding loads when creating ROUND instructions from ffloor/fnearbyint/fceil/frint/ftrunc.
We were missing packed isel folding patterns for all of sse41, avx, and avx512.

For some reason avx512 had scalar load folding patterns under optsize(due to partial/undef reg update), but we didn't have the equivalent sse41 and avx patterns.

Sometimes we would get load folding due to peephole pass anyway, but we're also missing avx512 instructions from the load folding table. I'll try to fix that in another patch.

Some of this was spotted in the review for D47993.

This patch adds all the folds to isel, adds a few spot tests, and disables the peephole pass on a few tests to ensure we're testing some of these patterns.

llvm-svn: 334460
2018-06-12 00:48:57 +00:00
Mark Searles 987f292c56 [AMDGPU] prevent hitting Assertion `isReg() && "Wrong MachineOperand accessor"'
The use iterator, used within findMaskOperands(), can return anything which is
not a def. isUse() requires a register, so check isReg() before calling isUse().

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

llvm-svn: 334459
2018-06-12 00:41:26 +00:00
Matt Morehouse a4374ab222 [CMake] Remove -Wno-maybe-uninitialized from passthrough vars.
Fixes http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux/
buildbot.

llvm-svn: 334458
2018-06-12 00:37:06 +00:00
Yaxun Liu 6c10a66ec7 [CUDA][HIP] Set kernel calling convention before arrange function
Currently clang set kernel calling convention for CUDA/HIP after
arranging function, which causes incorrect kernel function type since
it depends on calling convention.

This patch moves setting kernel convention before arranging
function.

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

llvm-svn: 334457
2018-06-12 00:16:33 +00:00
Jonas Devlieghere 9deaf68ed1 Exempt some compilers from new static variable test.
Apparently some compilers generate incomplete debug information which
caused the updated test to fail. Therefore I've extracted the new check
into a separate test case with the necessary decorators.

llvm-svn: 334456
2018-06-12 00:15:59 +00:00
Wei Mi 864ae8be95 Fix a buildbot error reported by sanitizer-x86_64-linux-fast:
Function::getGUID may complain if its input is an empty StringRef.

llvm-svn: 334455
2018-06-11 23:39:02 +00:00
Jonas Devlieghere 48f0c26902 [Test] Update static variable test.
Before Pavel's change in r334181, we were printing too many global
variables. This patch updates the test suite to ensure we don't regress
again in the future.

rdar://problem/29180927

llvm-svn: 334454
2018-06-11 23:26:15 +00:00
Wei Mi c6b96c8db2 Fix a warning issued by clang.
llvm-svn: 334453
2018-06-11 23:09:04 +00:00
Justin Bogner 0af77dae16 [CMake] Fix dropped dependency in install-llvm-headers
This dependency was accidentally dropped in r319480, causing
install-distribution and install-llvm-headers to install an incomplete
set of headers (the generated Intrinsics and Attributes would be
missing).

llvm-svn: 334452
2018-06-11 23:05:28 +00:00
George Burgess IV c72204d5b5 Simplify; NFC
Not shown in the diff: AQ is a `vector<SUnit *>`, and SU is a `SUnit *`

llvm-svn: 334451
2018-06-11 22:58:32 +00:00
Peter Wu 1c05c95739 [sanitizer] Add fgets, fputs and puts into sanitizer_common
Summary:
Add fgets, fputs and puts to sanitizer_common. This adds ASAN coverage
for these functions, extends MSAN support from fgets to fputs/puts and
extends TSAN support from puts to fputs.

Fixes: https://github.com/google/sanitizers/issues/952

Reviewed By: vitalybuka

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

llvm-svn: 334450
2018-06-11 22:58:04 +00:00
Wei Mi 61db138bfe Fix a warning reported by clang but not by gcc.
llvm-svn: 334449
2018-06-11 22:51:28 +00:00
Yan Zhang 72cecf9a63 - Add "AV" as new default acronym. - Add support for "I" and "A" in lowerCamelCase pattern
Summary: Now we can support property names like "hasADog" correctly.

Reviewers: benhamilton, hokein

Reviewed By: benhamilton

Subscribers: cfe-commits

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

llvm-svn: 334448
2018-06-11 22:44:06 +00:00
Wei Mi a0c0857e7a [SampleFDO] Add a new compact binary format for sample profile.
Name table occupies a big chunk of size in current binary format sample profile.
In order to reduce its size, the patch changes the sample writer/reader to
save/restore MD5Hash of names in the name table. Sample annotation phase will
also use MD5Hash of name to query samples accordingly.

Experiment shows compact binary format can reduce the size of sample profile by
2/3 compared with binary format generally.

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

llvm-svn: 334447
2018-06-11 22:40:43 +00:00
David Blaikie 19b22d406d TableGen: Change some pointer parameters to references since they're never null anyway
llvm-svn: 334446
2018-06-11 22:14:43 +00:00
Petr Hosek 5e1f49e89b [CMake] Use libc++ and compiler-rt for bootstrap Fuchsia Clang
We want to build the second stage compiler with libc++ and compiler-rt,
also include builtins and runtimes into extra bootstrap components to
ensure these get built.

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

llvm-svn: 334445
2018-06-11 22:06:44 +00:00
Konstantin Zhuravlyov d70c367267 AMDGPU/LLD: Handle R_AMDGPU_REL64 relocation
Requires r334443 from llvm

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

llvm-svn: 334444
2018-06-11 21:42:53 +00:00
Konstantin Zhuravlyov 3e5d66ac66 AMDGPU: Add 64-bit relative variant kind
Differential Revision: https://reviews.llvm.org/D47601

llvm-svn: 334443
2018-06-11 21:37:57 +00:00
Jason Molenda 808490138b Document how lldb uses the DBGSourcePathRemapping
source path remapping src/dest path pairs with
respect to the DBGVersion number in the plist.

llvm-svn: 334442
2018-06-11 21:36:40 +00:00
Jason Molenda c710f5d40a Add DebugNamesDWARFIndex.cpp.
llvm-svn: 334441
2018-06-11 21:35:36 +00:00
Matt Arsenault 5615fa0a87 DAG: Fix extract_subvector combine for a single element
This would fail before because 1x vectors aren't legal,
so instead just use the scalar type.

Avoids regressions in a future AMDGPU commit to add
v4i16/v4f16 as legal types.

Test update is just the one test that this triggers
on in tree now. It wasn't checking anything before.
The result is completely  changed since the selects
are eliminated. Not sure if it's considered better
or not.

llvm-svn: 334440
2018-06-11 21:27:41 +00:00
Leonard Mosescu e1bb51789d Add a new SBTarget::LoadCore() overload which surfaces errors if the load fails
There was no way to find out what's wrong if SBProcess SBTarget::LoadCore(const char *core_file) failed. 
Additionally, the implementation was unconditionally setting sb_process, so it wasn't even possible to check if the return SBProcess is valid.

This change adds a new overload which surfaces the errors and also returns a valid SBProcess only if the core load succeeds:

SBProcess SBTarget::LoadCore(const char *core_file, SBError &error);

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

llvm-svn: 334439
2018-06-11 21:19:26 +00:00
Alex Shlyapnikov ed32baa84b [Sanitizers] %tool_options -> %env_tool_opts in allocator_returns_null.cc
Use proper substitution in the common allocator_returns_null.cc test.

llvm-svn: 334438
2018-06-11 21:04:24 +00:00
Petr Hosek 534a104317 [CMake] Allow specifying extra dependencies of bootstrap stage
This allows adding additional bootstrap dependencies to the bootstrap
compiler that may be needed by later stages.

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

llvm-svn: 334437
2018-06-11 20:59:31 +00:00