Commit Graph

323433 Commits

Author SHA1 Message Date
Nico Weber 139fb5d478 gn build: Merge r367917
llvm-svn: 367970
2019-08-06 02:17:05 +00:00
Austin Kerbow a05c384132 Re-commit: [AMDGPU] Use S_DENORM_MODE for gfx10
Summary: During fdiv32 lowering use S_DENORM_MODE to select denorm mode in gfx10.

Reviewers: arsenm, rampitec

Reviewed By: arsenm, rampitec

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

Tags: #llvm

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

llvm-svn: 367969
2019-08-06 02:16:11 +00:00
Puyan Lotfi fa086d701a [NFC][DirectoryWatchedTests] Unlocks mutexes before signaling condition variable
This should not affect actual behavior, but should pessimize the threading less
by avoiding the situation where:

  * mutex is still locked
  * T1 notifies on condition variable
  * T2 wakes to check mutex
  * T2 sees mutex is still locked
  * T2 waits
  * T1 unlocks mutex
  * T2 tries again, acquires mutex.

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

llvm-svn: 367968
2019-08-06 01:26:46 +00:00
Daniel Sanders de4060816f Fix another MSVC issue after 367965
Repeated the fix for MCRegister in Register

This reverts r367932 (git commit eac86ec25f)

llvm-svn: 367967
2019-08-06 01:16:29 +00:00
Johannes Doerfert 21fe0a314e [Attributor][NFC] Outline common pattern into helper method
This helper will also allow to also place logic to determine if an
abstract attribute is necessary in the first place.

llvm-svn: 367966
2019-08-06 00:55:11 +00:00
Daniel Sanders 269191eaf9 Re-commit Register/MCRegister: Add conversion operators to avoid use of implicit convert to unsigned. NFC
Added two more conversions to satisfy MSVC and moved the declaration of
MCPhysReg to MCRegister.h to enable that

This reverts r367932 (git commit eac86ec25f)

llvm-svn: 367965
2019-08-06 00:53:47 +00:00
Johannes Doerfert af61516352 [Attributor][Fix] Add const qualifier
I forgot to add this as part of the last commit.

llvm-svn: 367964
2019-08-06 00:46:02 +00:00
Davide Italiano 78f05d3599 Revert "[CompilerType] Simplify the interface a bit more.."
There's actually a test downstream that fails with this.
I think we can still get rid of it, but I need to do some work
there first.

llvm-svn: 367963
2019-08-06 00:42:11 +00:00
Puyan Lotfi c9d90d5002 [compiler-rt] Appending COMPILER_RT_LIBCXX_PATH -isystem include for xray (3)
Third landing attempt: Added "if (HAVE_LIBCXX)" to keep Green Dragon green.

Haven't found a better way to pass the libcxx include path for building
compiler-rt with libcxx; this seems to be missing only for xray.

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

llvm-svn: 367962
2019-08-06 00:34:34 +00:00
Johannes Doerfert d0f6400978 [Attributor] Provide a generic interface to check live instructions
Summary:
Similar to `Attributor::checkForAllCallSites`, we now provide such
functionality for instructions of a certain opcode through
`Attributor::checkForAllInstructions` and the convenient wrapper
`Attributor::checkForAllCallLikeInstructions`. This cleans up code,
avoids duplication, and simplifies the usage of liveness information.

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

llvm-svn: 367961
2019-08-06 00:32:43 +00:00
Shiva Chen b12056bd33 [RISCV] Custom legalize i32 operations for RV64 to reduce signed extensions
Differential Revision: https://reviews.llvm.org/D65434

llvm-svn: 367960
2019-08-06 00:24:00 +00:00
Peter Collingbourne f0380bac5f Silence ubsan after r367926.
Fixes e.g.
http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-bootstrap-ubsan/builds/14273

We can't left shift here because left shifting of a negative number is UB.
The same doesn't apply to unsigned arithmetic, but switching to unsigned
doesn't appear to stop ubsan from complaining, so we need to mask out the
high bits.

llvm-svn: 367959
2019-08-06 00:21:30 +00:00
Diego Astiazaran 15e468e0d5 [clang-doc] Fix link generation
Before making a link to a reference it is required to check that the
reference has a path (eg. primitives won't have paths).
This was done by checking if the path was empty; that worked because
when generating paths the outdirectory was included, so if the path was
assigned it had that outdirectory at least.
The path generation was changed, it's now only the composite of the
namespaces without the outdirectory. So if the info is in the global
namespace the path would be empty and the old check wouldn't work as expected.
A new attribute has been added to the Reference struct that indicates if
the info's parent is the global namespace.
Paths generation now fails if the path is empty and if the info
is not in the global namespace.

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

llvm-svn: 367958
2019-08-06 00:11:34 +00:00
Davide Italiano b31f60b9c2 [CompilerType] Simplify the interface a bit more..
Summary:
.. removing IsMeaninglessWithoutTypeResolution(). I'm fairly
confident this was introduced to support swift, where
static types [without dynamic counterpart] don't carry a lot
of value. Since then, the formatters and dynamic type resolution
has been rewritten, and we employ different solutions. This function
is unused here too, so let's get read of it.

<rdar://problem/36377967>

Reviewers: shafik, JDevlieghere, alex, compnerd, teemperor

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 367957
2019-08-06 00:01:52 +00:00
Jonas Devlieghere 9bb525adb2 [CMake] Remove check for the readline target.
This was introduced when we were building a custom readline Python
module on Linux [1]. Now that the readline  target doesn't exist
anymore, it's safe to remove this dependency.

This fixes https://llvm.org/PR25136

[1] https://reviews.llvm.org/D13268

llvm-svn: 367956
2019-08-05 23:54:13 +00:00
JF Bastien 25a255f5ed [NFC] Remove useless static
The function is already inline in the header, static isn't what we want.

llvm-svn: 367955
2019-08-05 23:52:38 +00:00
Puyan Lotfi 37fe40c330 Reverting D65760/r367944 due to buildbot failure.
http://lab.llvm.org:8011/builders/clang-x86_64-debian-fast/builds/15952/steps/build/logs/stdio

JITTargetMachineBuilder.cpp fails to build.

llvm-svn: 367954
2019-08-05 23:47:07 +00:00
Johannes Doerfert eccdf08577 [Attributor] Introduce the IRAttribute helper struct
Summary:
Certain properties, e.g., an AttrKind, are not shared among all abstract
attributes. This patch extracts the functionality into a helper struct.

Reviewers: uenoku, sstefan1

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

llvm-svn: 367953
2019-08-05 23:35:12 +00:00
Johannes Doerfert fb69f7688a [Attributor] Make abstract attributes stateless
To remove boilerplate, mostly passing through values to the
AbstractAttriubute base class, we extract the state into an IRPosition
helper. There is no function change intended but the IRPosition struct
will provide more functionality down the line.

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, jfb, llvm-commits

Tags: #llvm

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

llvm-svn: 367952
2019-08-05 23:32:31 +00:00
Johannes Doerfert 2402062557 [Attributor] Use proper ID for attribute lookup
Summary:
The new scheme is similar to the pass manager and dyn_cast scheme where
we identify classes by the address of a static member. This is better
than the old scheme in which we had to "invent" new Attributor enums if
there was no corresponding one.

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

llvm-svn: 367951
2019-08-05 23:30:01 +00:00
Johannes Doerfert 007153e9d4 [Attributor][NFCI] Avoid duplication of the InformationCache reference
Summary:
Instead of storing the reference to the InformationCache we now pass it
whenever it might be needed.

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

llvm-svn: 367950
2019-08-05 23:26:06 +00:00
Jonathan Peyton 73d5abd809 [OpenMP] Add support for GOMP_*_nonmonotonic_* functions
Patch by Isuru Fernando

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

llvm-svn: 367949
2019-08-05 23:23:52 +00:00
Johannes Doerfert e83f303938 [Attributor] Deduce the "no-return" attribute for functions
A function is "no-return" if we never reach a return instruction, either
because there are none or the ones that exist are dead.

Test have been adjusted:
  - either noreturn was added, or
  - noreturn was avoided by modifying the code.

The new noreturn_{sync,async} test make sure we do handle invoke
instructions with a noreturn (and potentially nowunwind) callee
correctly, even in the presence of potential asynchronous exceptions.

llvm-svn: 367948
2019-08-05 23:22:05 +00:00
George Burgess IV a5c25c5d46 [Sema] attempt to appease buildbots after r367940
A buildbot got angry about this new test, with error messages like:

warn-nullchar-nullptr.c Line 16: use of undeclared identifier 'u'

It looks like this `u'c'` syntax was introduced in C11; I'm guessing
some bots may default to something before that. Let's see if explicitly
specifying the standard version makes it happy...

llvm-svn: 367947
2019-08-05 23:19:15 +00:00
Davide Italiano d32d5db4da [CompilerType] Remove an unused function.
Summary:
This simplifies the interface, as I'm trying to understand how
we can upstream swift support.

<rdar://problem/36377967>

Reviewers: teemperor, JDevlieghere, xiaobai, compnerd, friss

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 367946
2019-08-05 23:18:00 +00:00
Amara Emerson bc1172df14 [GlobalISel][CallLowering] Rename isArgumentHandler() -> isIncomingArgumentHandler()
Previous name and comment incorrectly implied it was just for formal arg handlers,
which is not true.

llvm-svn: 367945
2019-08-05 23:05:28 +00:00
Diego Caballero 1647758882 [ORC] Add CPU name and sub-target features to detectHost
This commit adds host CPU name and sub-target features to the
`JITTargetMachineBuilder` created by `JITTargetMachineBuilder::detectHost()`.

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

llvm-svn: 367944
2019-08-05 23:02:12 +00:00
Yi Kong 295d4b7727 Build libfuzzer libcxx-static with PIC
r356153 changed default build option of static libcxx to no PIC. We now
need to explicitly specify CMAKE_POSITION_INDEPENDENT_CODE to get PIC
libcxx.

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

llvm-svn: 367943
2019-08-05 22:55:17 +00:00
Wolfgang Pieb c71c629926 [llvm-readelf] Support dumping of stack sizes sections with readelf --stack-sizes
Reviewers: jhenderson, grimar, rupprecht

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

llvm-svn: 367942
2019-08-05 22:47:07 +00:00
Philip Reames e39e79358f Add a note to the release not about a potentially breaking optimization
This has come up twice already (once in pr42763 and once in the commit thread), so give warning of a new way in which UB can result in unexpected program behavior.

llvm-svn: 367941
2019-08-05 22:34:59 +00:00
George Burgess IV f708f0a243 [Sema] Add -Wpointer-compare
This patch adds a warning that diagnoses comparisons of pointers to
'\0'. This is often indicative of a bug (e.g. the user might've
forgotten to dereference the pointer).

Patch by Elaina Guan!

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

llvm-svn: 367940
2019-08-05 22:15:40 +00:00
Hansang Bae dcdbe6515b [OpenMP] Fix broken build due to new OMPT tests
New OMPT tests with teams construct should be disabled for GCC as it
emits code with a GOMP entry not supported in the LLVM runtime.

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

llvm-svn: 367939
2019-08-05 21:46:13 +00:00
Peter Collingbourne e757cadb07 hwasan: Untag global variable addresses in tests.
Once we start instrumenting globals, all addresses including those of string literals
that we pass to the operating system will start being tagged. Since we can't rely
on the operating system to be able to cope with these addresses, we need to untag
them before passing them to the operating system. This change introduces a macro
that does so and uses it everywhere it is needed.

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

llvm-svn: 367938
2019-08-05 21:46:10 +00:00
Peter Collingbourne 38f985eb1c Add "REQUIRES: x86-registered-target" to test.
llvm-svn: 367937
2019-08-05 21:44:45 +00:00
Raphael Isemann 9de7169053 [lldb][NFC] Document and refactor ClangPersistentVariables::RemovePersistentVariable
llvm-svn: 367936
2019-08-05 21:43:53 +00:00
Keno Fischer 5c3cdef84b [WebAssembly] Fix conflict between ret legalization and sjlj
Summary:
When the WebAssembly backend encounters a return type that doesn't
fit within i32, SelectionDAG performs sret demotion, adding an
additional argument to the start of the function that contains
a pointer to an sret buffer to use instead. However, this conflicts
with the emscripten sjlj lowering pass. There we translate calls like:

```
	call {i32, i32} @foo()
```

into (in pseudo-llvm)
```
	%addr = @foo
	call {i32, i32} @__invoke_{i32,i32}(%addr)
```

i.e. we perform an indirect call through an extra function.
However, the sret transform now transforms this into
the equivalent of
```
        %addr = @foo
        %sret = alloca {i32, i32}
        call {i32, i32} @__invoke_{i32,i32}(%sret, %addr)
```
(while simultaneously translation the implementation of @foo as well).
Unfortunately, this doesn't work out. The __invoke_ ABI expected
the function address to be the first argument, causing crashes.

There is several possible ways to fix this:
1. Implementing the sret rewrite at the IR level as well and performing
   it as part of lowering to __invoke
2. Fixing the wasm backend to recognize that __invoke has a special ABI
3. A change to the binaryen/emscripten ABI to recognize this situation

This revision implements the middle option, teaching the backend to
treat __invoke_ functions specially in sret lowering. This is achieved
by
1) Introducing a new CallingConv ID for invoke functions
2) When this CallingConv ID is seen in the backend and the first argument
   is marked as sret (a function pointer would never be marked as sret),
   swapping the first two arguments.

Reviewed By: tlively, aheejin
Differential Revision: https://reviews.llvm.org/D65463

llvm-svn: 367935
2019-08-05 21:36:09 +00:00
Johannes Doerfert 3d7bbc6f9c [Attributor][Fix] Do not remove instructions during manifestation
When we remove instructions cached references could still be live. This
patch avoids removing invoke instructions that are replaced by calls and
instead keeps them around but in a dead block.

llvm-svn: 367933
2019-08-05 21:35:02 +00:00
Daniel Sanders eac86ec25f Revert Register/MCRegister: Add conversion operators to avoid use of implicit convert to unsigned. NFC
MSVC finds ambiguity where clang doesn't and it looks like it's not going to be an easy fix
Reverting while I figure out how to fix it

This reverts r367916 (git commit aa15ec3c23)
This reverts r367920 (git commit 5d14efe279)

llvm-svn: 367932
2019-08-05 21:34:45 +00:00
Johannes Doerfert 924d2138fc [Attributor][Fix] Keep invokes if handlers catch asynchronous exceptions
Similar to other places where we transform invokes to calls we need to
be careful if the handler (=personality) can catch asynchronous
exceptions as they are not modeled as part of nounwind.

This is tested with D59978.

llvm-svn: 367931
2019-08-05 21:34:45 +00:00
Louis Dionne d131713307 [libc++] Accept any non-zero return for .fail.cpp tests
llvm-svn: 367930
2019-08-05 21:26:50 +00:00
Eric Christopher 1d73e228db BMI2 support is indicated in bit eight of EBX, not nine.
See Intel SDM, Vol 2A, Table 3-8:
https://www.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-vol-2a-manual.pdf#page=296

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

llvm-svn: 367929
2019-08-05 21:25:59 +00:00
Louis Dionne 23f073100d [NFC][pstl] Remove stray semi-colon
llvm-svn: 367928
2019-08-05 21:20:42 +00:00
Peter Collingbourne a56d81f4fb llvm-symbolizer: Untag addresses in object files by default.
Any addresses that we pass to llvm-symbolizer are going to be untagged,
while any HWASAN instrumented globals are going to be tagged in the
symbol table. Therefore we need to untag the addresses before using them.

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

llvm-svn: 367926
2019-08-05 20:59:25 +00:00
David Carlier 1d92925a5a [Sanitizer] Linux refactor shadow huge page mode handling
Disabling Transparent huge page mode refactored in one function.

Reviewers: vitalybuka

Reviewed By: vitalybuka

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

llvm-svn: 367925
2019-08-05 20:54:36 +00:00
Raphael Isemann 5eb87cf30f [lldb][NFC] Refactor ClangUserExpression::UpdateLanguageForExpr
The UpdateLanguageForExpr should only update the language, but over
time it started to do also do different things related to the generation
of the expression source code. This patch refactors all the source code
generation part into its own function.

llvm-svn: 367922
2019-08-05 20:31:47 +00:00
Lang Hames 1707735fa4 [ORC] Work around broken GCC/libstdc++ by adding an explicit conversion.
This should fix the bots that have been failing due to r367712.

llvm-svn: 367921
2019-08-05 20:30:35 +00:00
Daniel Sanders 5d14efe279 Fix MSVC error after r367916
It seems that MSVC sees ambiguity between the operator==()'s where clang
doesn't

llvm-svn: 367920
2019-08-05 20:03:43 +00:00
Amara Emerson 85e5e28ab4 [AArch64][GlobalISel] Inline tiny memcpy et al at -O0.
FastISel already does this since the initial arm64 port was upstreamed, so
it seems there are no issues with doing this at -O0 for very small memcpys.

Gives a 0.2% geomean code size improvement on CTMark.

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

llvm-svn: 367919
2019-08-05 20:02:52 +00:00
JF Bastien 6e33c647f3 [docs] don't use :option: for Wall Wextra
The bots are sad that they're not documented.

llvm-svn: 367918
2019-08-05 19:59:07 +00:00
Max Moroz f1b0a93e3a [compiler-rt] Move FDP to include/fuzzer/FuzzedDataProvider.h for easier use.
Summary:
FuzzedDataProvider is a helper class for writing fuzz targets that fuzz
multple inputs simultaneously. The header is supposed to be used for fuzzing
engine agnostic fuzz targets (i.e. the same target can be used with libFuzzer,
AFL, honggfuzz, and other engines). The common thing though is that fuzz targets
are typically compiled with clang, as it provides all sanitizers as well as
different coverage instrumentation modes. Therefore, making this FDP class a
part of the compiler-rt installation package would make it easier to develop
and distribute fuzz targets across different projects, build systems, etc.
Some context also available in https://github.com/google/oss-fuzz/pull/2547.

This CL does not delete the header from `lib/fuzzer/utils` directory in order to
provide the downstream users some time for a smooth migration to the new
header location.

Reviewers: kcc, morehouse

Reviewed By: morehouse

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

Tags: #llvm, #sanitizers

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

llvm-svn: 367917
2019-08-05 19:55:52 +00:00