Commit Graph

330765 Commits

Author SHA1 Message Date
JonChesterfield 764c8420e4 [nfc][libomptarget] Reorganise support header
Summary:
[nfc][libomptarget] Reorganise support header

All functions defined in support implementation are now declared in support.h
Reordered functions in support implementation to match the sequence in support.h
Added include guards to support.h
Added #include interface to support.h to provide kmp_Ident declaration
Move supporti.h to support.cu and s/INLINE/EXTERN/g
Add remaining includes to support.cu

A minor side effect is to change the name mangling of the support functions to
extern "C". If this matters another macro along the lines of INLINE/EXTERN
can be added - perhaps DEVICE as that's the obvious implementation.

Reviewers: jdoerfert, ABataev, grokos

Reviewed By: jdoerfert

Subscribers: mgorny, jfb, openmp-commits

Tags: #openmp

Differential Revision: https://reviews.llvm.org/D69652
2019-10-31 17:15:02 +00:00
Sanjay Patel a2240f57e7 [InstCombine] simplify fcmp+select canonicalization; NFCI
We had 2 blocks of code that are nearly identical. Existing
regression tests should cover both of the patterns.
2019-10-31 13:13:32 -04:00
Jeremy Morse 984fad243d Reapply "Import Dexter to debuginfo-tests""
This reverts commit cb935f3456.

Discussion in D68708 advises that green dragon is being briskly
refurbished, and it's good to have this patch up testing it.
2019-10-31 16:51:53 +00:00
Michał Górny 34f3c0fc44 [lldb] [test/API] Fix testcases symlink 2019-10-31 17:43:18 +01:00
Adrian Prantl aafe01fed4 Upstream diff from swift-lldb.
This is very likely untested, but it looks like an obviously correct change.
2019-10-31 09:25:36 -07:00
Jeremy Morse cb935f3456 Revert "Import Dexter to debuginfo-tests"
This reverts commit f78c236efd.

Green dragon breakage was observed; I'll take a look at why.
2019-10-31 16:22:10 +00:00
Sanne Wouda f2cb9c0eab Fix missing memcpy, memmove and memset tail calls
Summary:
If a wrapper around one of the mem* stdlib functions bitcasts the returned
pointer value before returning it (e.g. to a wchar_t*), LLVM does not emit a
tail call.

Add a check for this scenario so that we emit a tail call.

Reviewers: wmi, mkuper, ramred01, dmgreen

Reviewed By: wmi, dmgreen

Subscribers: hiraditya, sanwou01, javed.absar, lebedev.ri, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D59078
2019-10-31 16:13:29 +00:00
Fangrui Song 27cb352fd2 [llvm-objcopy] --add-symbol: address post-commit reviews of D69093
* Improve comments.
* Reorder the assignment to Obj.SectionNames before the symbol table
  creation code. Add a test.

Reviewed By: grimar

Differential Revision: https://reviews.llvm.org/D69526
2019-10-31 09:12:06 -07:00
Sanjay Patel 136918676e [InstCombine] regenerate test checks; NFC 2019-10-31 11:33:24 -04:00
Mitchell Balan 8d7bd57526 [clang-format] Fix SpacesInSquareBrackets for Lambdas with Initial "&ref" Parameter
Summary:
This fixes an edge case in the `SpacesInSquareBrackets` option where an initial `&ref` lambda parameter is not padded with an initial space.

`int foo = [&bar ]() {}` is fixed to give `int foo = [ &bar ]() {}`

Reviewers: MyDeveloperDay, klimek, sammccall

Reviewed by: MyDeveloperDay

Subscribers: cfe-commits

Tags: #clang, #clang-format

Differential Revision: https://reviews.llvm.org/D69649
2019-10-31 11:08:05 -04:00
Matt Arsenault 1725f28841 DAG: Add new control for ISD::FMAD formation
For AMDGPU this depends on whether denormals are enabled in the
default FP mode for the function. Currently this is treated as a
subtarget feature, so FMAD is selectively legal based on that. I want
to move this out of the subtarget features so this can be controlled
with a denormal mode attribute. Additionally, this will allow folding
based on a future ftz fast math flag.
2019-10-31 07:51:38 -07:00
Matt Arsenault bc56166281 AMDGPU: Simplify getAddressSpace calls
These can be directly taken from the GlobalValue instead of going
through the type.
2019-10-31 07:51:38 -07:00
Djordje Todorovic 57ee0435bd [TII] Use optional destination and source pair as a return value; NFC
Refactor usage of isCopyInstrImpl, isCopyInstr and isAddImmediate methods
to return optional machine operand pair of destination and source
registers.

Patch by Nikola Prica

Differential Revision: https://reviews.llvm.org/D69622
2019-10-31 15:34:49 +01:00
David Tellenbach 55314d3237 [MachineOutliner][NFC] Fix FileCheck regex in two of test-cases 2019-10-31 14:19:15 +00:00
Jeremy Morse f78c236efd Import Dexter to debuginfo-tests
Dexter (Debug Experience Tester) is a test-driver for our debug info
integration tests, reading a set of debug experience expectations and
comparing them with the actual behaviour of a program under a debugger.
More about Dexter can be found in the RFC:

  http://lists.llvm.org/pipermail/llvm-dev/2019-October/135773.html

and the phab review in D68708. Not all the debuginfo tests have been
transformed into Dexter tests, and we look forwards to doing that
incrementally.

This commit mostly aims to flush out buildbots that are running
debuginfo-tests but don't have python 3 installed, possibly
green-dragon and some windows bots.
2019-10-31 13:49:47 +00:00
Djordje Todorovic efacf2ce55 [test][DebugInfo] Add the test for ARM call site parameters
This is addition to D67556.

Patch by Nikola Prica
2019-10-31 14:45:50 +01:00
Nico Weber e491e82639 gn build: (manually) merge cd24a00 more 2019-10-31 09:12:53 -04:00
David Green a5f7bc0de7 [InstCombine] Canonicalize uadd.with.overflow to uadd.sat
This adds some patterns to transform uadd.with.overflow to uadd.sat
(with usub.with.overflow to usub.sat too). The patterns selects from
UINTMAX (or 0 for subs) depending on whether the operation overflowed.

Signed patterns are a little more involved (they can wrap in two
directions), but can be added here in a followup patch too.

Differential Revision: https://reviews.llvm.org/D69245
2019-10-31 12:45:38 +00:00
Jeremy Morse a8db456b53 Revert "[DebugInfo] MachineSink: Insert undef DBG_VALUEs when sinking instructions"
This reverts commit ee50590e16.

PR43855 reports a performance regression from this commit, which I'll
look into.
2019-10-31 12:39:06 +00:00
Jeremy Morse d382a8a768 Revert "[DebugInfo] MachineSink: find more DBG_VALUEs to sink"
This reverts commit f5e1b718a6.

PR43855 reports a performance regression with commit ee50590e. This commit
depends on the faulty one, so has to come out too.
2019-10-31 12:39:06 +00:00
Ilya Biryukov 733777a816 [clangd] Fix namespace aliases in findExplicitReferences
Reviewers: kadircet

Reviewed By: kadircet

Subscribers: merge_guards_bot, MaskRay, jkorous, arphaman, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D69624
2019-10-31 13:35:25 +01:00
Kadir Cetinkaya 1c66d09b73
[clangd] Add fno-delayed-parsing to new define inline tests
To unbreak windows buildbots.
2019-10-31 13:22:52 +01:00
David Green 6cfbefbc4a [PatternMatch] Add m_WithOverflowInst and m_ExtractValue matchers
Used in D69245, these add pattern matchers for the WithOverflowInst
(capturing the result) and the ExtractValue instructions taking a
template parameter specifying the element being extracted.
2019-10-31 12:19:29 +00:00
James Henderson fb4a55010e [llvm-objcopy] Preserve .ARM.attributes section when stripping files
This works around a bug in Debian's patchset for glibc. The bug is
described in detail in the upstream debian bug:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=943798, but the short
version of it is that glibc on any Debian based distro don't load
libraries unless it has a .ARM.attribute section.

Reviewed by: jhenderson, rupprecht, MaskRay, jakehehrlich

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

Patch by Tobias Hieta.
2019-10-31 11:57:19 +00:00
Nico Weber 07255f81fa comment typo fix to cycle bots 2019-10-31 07:54:16 -04:00
Nico Weber 257379855a Build fix after 4b6597f 2019-10-31 07:43:09 -04:00
Balázs Kéri 4980c1333f [clang][analyzer] Using CallDescription in StreamChecker.
Summary:
Recognization of function names is done now with the CallDescription
class instead of using IdentifierInfo. This means function name and
argument count is compared too.
A new check for filtering not global-C-functions was added.
Test was updated.

Reviewers: Szelethus, NoQ, baloghadamsoftware, Charusso

Reviewed By: Szelethus, NoQ, Charusso

Subscribers: rnkovacs, xazax.hun, baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho, donat.nagy, Charusso, dkrupp, Szelethus, gamesh411, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D67706
2019-10-31 12:38:50 +01:00
Nico Weber 7e23f88d7d gn build: (manually) merge b32bae6f76 2019-10-31 07:38:21 -04:00
Nico Weber 4b6597f498 Make flang driver stuff work on macOS
6bf55804 added special-case code for TY_PP_Fortran to
ToolChain::LookupTypeForExtension(), but
Darwin::LookupTypeForExtension() overrode that method without calling
the superclass implementation.

Make it call the superclass implementation to fix things.

Differential Revision: https://reviews.llvm.org/D69636
2019-10-31 07:34:32 -04:00
Simon Pilgrim a780b94cd1 [X86][SSE] Convert computeZeroableShuffleElements to emit KnownUndef and KnownZero 2019-10-31 11:21:39 +00:00
Serguei Katkov 1eb04d289a [LICM] Invalidate SCEV upon instruction hoisting
Since SCEV can cache information about location of an instruction, it should be invalidated when the instruction is moved.
There should be similar bug in code sinking part of LICM, it will be fixed in a follow-up change.

Patch Author: Daniil Suchkov
Reviewers: asbirlea, mkazantsev, reames
Reviewed By: asbirlea
Subscribers: hiraditya, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D69370
2019-10-31 17:37:53 +07:00
Pavel Labath 193a7bfb69 minidump: Create memory regions from the sections of loaded modules
Summary:
Not all minidumps contain information about memory permissions. However,
it is still important to know which regions of memory contain
potentially executable code. This is particularly important for
unwinding on win32, as the default unwind method there relies on
scanning the stack for things which "look like" code pointers.

This patch enables ProcessMinidump to reconstruct the likely permissions
of memory regions using the sections of loaded object files. It only
does this if we don't have a better source (memory info list stream, or
linux /proc/maps) for this information, and only if the information in
the object files does not conflict with the information in the minidump.

Theoretically that last bit could be improved, since the permissions
obtained from the MemoryList streams is also only a very rough guess,
but it did not seem worthwhile to complicate the implementation because
of that because there will generally be no overlap in practice as the
MemoryList will contain the stack contents and not any module data.

The patch adds a test checking that the module section permissions are
entered into the memory region list, and also a test which demonstrate
that now the unwinder is able to correctly find return addresses even in
minidumps without memory info list streams.

There's one TODO left in this patch, which is that the "memory region"
output does not give any indication about the "don't know" values of
memory region permissions (it just prints them as if they permission bit
was set). I address this in a follow up.

Reviewers: amccarth, clayborg

Subscribers: mgrang, lldb-commits

Differential Revision: https://reviews.llvm.org/D69105
2019-10-31 11:24:55 +01:00
Pavel Labath e9430231ac minidump: Add an "arm64" constant
This is the "official" constant for arm64. We also have another constant
for arm64 (called BP_ARM64), which was used by breakpad while there was
no official constant for arm64 available.
2019-10-31 11:20:46 +01:00
Serguei Katkov b32bae6f76 [Test] Add a unit test exposing lack of SCEV invalidation in LICM during code hoisting. NFC.
This unit test exposes a bug in LICM: when it hoists instructions it doesn't invalidate SCEV accordingly.
Similar test exposing lack of SCEV invalidation during code sinking will be submitted as a follow-up change.

Patch Author: Daniil Suchkov
Reviewers: mkazantsev, asbirlea, reames
Reviewed By: asbirlea
Subscribers: mgorny, javed.absar, llvm-commits
Differential Revision: https://reviews.llvm.org/D69369
2019-10-31 17:16:57 +07:00
Guilherme Andrade e46c6644db [lldb] Fix offset intersection bug between MPX and AVX registers
Summary:
This change increases the offset of MPX registers (by 128) so they
do not overlap with the offset associated with AVX registers. That was
causing MPX data in GDBRemoteRegisterContext::m_reg_data to get overwritten.

Reviewers: labath

Reviewed By: labath

Subscribers: JDevlieghere, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D68874
2019-10-31 10:58:17 +01:00
David Candler 92aa0c2dbc [cfi] Add flag to always generate .debug_frame
This adds a flag to LLVM and clang to always generate a .debug_frame
section, even if other debug information is not being generated. In
situations where .eh_frame would normally be emitted, both .debug_frame
and .eh_frame will be used.

Differential Revision: https://reviews.llvm.org/D67216
2019-10-31 09:48:30 +00:00
Pavel Labath 9c73925226 [lldb/lit] Introduce %clang_host substitutions
Summary:
This patch addresses an ambiguity in how our existing tests invoke the
compiler. Roughly two thirds of our current "shell" tests invoke the
compiler to build the executables for the host. However, there is also
a significant number of tests which don't build a host binary (because
they don't need to run it) and instead they hardcode a certain target.

We also have code which adds a bunch of default arguments to the %clang
substitutions. However, most of these arguments only really make sense
for the host compilation. So far, this has worked mostly ok, because the
arguments we were adding were not conflicting with the target-hardcoding
tests (though they did provoke an occasional "argument unused" warning).

However, this started to break down when we wanted to use
target-hardcoding clang-cl tests (D69031) because clang-cl has a
substantially different command line, and it was getting very confused
by some of the arguments we were adding on non-windows hosts.

This patch avoid this problem by creating separate %clang(xx,_cl)_host
substutitions, which are specifically meant to be used for compiling
host binaries. All funny host-specific options are moved there. To
ensure that the regular %clang substitutions are not used for compiling
host binaries (skipping the extra arguments) I employ a little
hac^H^H^Htrick -- I add an invalid --target argument to the %clang
substitution, which means that one has to use an explicit --target in
order for the compilation to succeed.

Reviewers: JDevlieghere, aprantl, mstorsjo, espindola

Subscribers: emaste, arichardson, MaskRay, jfb, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D69619
2019-10-31 10:40:37 +01:00
georgerim a7aee6c47a [yaml2obj/obj2yaml] - Add support for SHT_GNU_HASH section.
This adds parsing and dumping support for GNU hash sections.
They are described nicely here: https://blogs.oracle.com/solaris/gnu-hash-elf-sections-v2

Differential revision: https://reviews.llvm.org/D69399
2019-10-31 12:25:37 +03:00
Martin Storsjö 403cd574b6 [LLDB] [Windows] Fix Windows-specific race condition in LLDB for session lifetime
This can e.g. happen if the debugged executable exits before the initial
stop, e.g. if it fails to load dependent DLLs.

Add a virtual destructor to ProcessDebugger and let it clean up the
session, and make ProcessWindows::OnExitProcess call
ProcessDebugger::OnExitProcess for shared parts.

Fix suggestion by Adrian McCarthy.

Differential Revision: https://reviews.llvm.org/D69503
2019-10-31 11:26:20 +02:00
Martin Storsjö 3db1d138b1 [LLDB] [PECOFF] Fix error handling for executables that object::createBinary errors out on
llvm::object::createBinary returns an Expected<>, which requires
not only checking the object for success, but also requires consuming
the Error, if one was set.

Use LLDB_LOG_ERROR for this case, and change an existing similar log
statement to use it as well, to make sure the Error is consumed even
if the log channel is disabled.

Differential Revision: https://reviews.llvm.org/D69646
2019-10-31 11:26:21 +02:00
Martin Storsjö a42967f63c [LLDB] [Windows] Remove a TODO which probably won't be implemented
Contrary to WoW64 on x86_64, there's no struct similar to WOW64_CONTEXT
defined, for storing and handling the CPU state of an ARM32 process
from an ARM64 process. Thus, making an ARM64 lldb-server able to
control ARM32 processes seems infeasible at the moment.

(The normal CONTEXT struct has a different layout on each architecture.
In addition to this, a WOW64_CONTEXT struct always is defined, that
can store the CPU state of an x86_32 process, to allow handling it from
an x86_64 process. But there's no similar universally available struct
for ARM32.)
2019-10-31 11:26:06 +02:00
Martin Storsjö 7e1a307641 [LLDB] [PECOFF] Don't crash in ReadImageDataByRVA for addresses out of range
This can happen e.g. when unwinding doesn't work perfectly.

Differential Revision: https://reviews.llvm.org/D69502
2019-10-31 11:26:06 +02:00
Haojian Wu e65ddcafee Revert "[SLP] Vectorize jumbled stores."
This reverts commit 21d498c9c0.

This commit causes some crashes on some targets.
2019-10-31 10:21:24 +01:00
Georgii Rymar 9d4bbe8891 [llvm-readelf/llvm-readobj] - Improve dumping of broken versioning sections.
This updates the elf-invalid-versioning.test test case:
makes a cleanup, adds llvm-readobj calls and fixes 2
crash/assert issues I've found (test cases are provided).

Differential revision: https://reviews.llvm.org/D68705
2019-10-31 12:12:17 +03:00
Dávid Bolvanský b06305e449 [Diagnostics] Warn for std::is_constant_evaluated in constexpr mode
Summary:
constexpr int fn1() {
  if constexpr (std::is_constant_evaluated()) // condition is always true!
    return 0;
  else
    return 1;
}

constexpr int fn2() {
  if (std::is_constant_evaluated())
    return 0;
  else
    return 1;
}

Solves PR42977

Reviewers: rsmith, aaron.ballman

Reviewed By: rsmith

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D69518
2019-10-31 10:03:11 +01:00
Mikael Holmen c950495405 [MustExecute] Silence clang warning about unused captured 'this'
New code introduced in fe799c97fa caused clang to complain with

../lib/Analysis/MustExecute.cpp:360:34: error: lambda capture 'this' is not used [-Werror,-Wunused-lambda-capture]
  GetterTy<LoopInfo> LIGetter = [this](const Function &F) {
                                 ^~~~
../lib/Analysis/MustExecute.cpp:365:44: error: lambda capture 'this' is not used [-Werror,-Wunused-lambda-capture]
  GetterTy<PostDominatorTree> PDTGetter = [this](const Function &F) {
                                           ^~~~
2 errors generated.
2019-10-31 09:41:05 +01:00
Kadir Cetinkaya 71aa3f7b7e
[clangd] Add parameter renaming to define-inline code action
Summary:
When moving a function definition to declaration location we also need
to handle renaming of the both function and template parameters.

This patch achives that by making sure every parameter name and dependent type
in destination is renamed to their respective name in the source.

Reviewers: ilya-biryukov

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

Tags: #clang

Differential Revision: https://reviews.llvm.org/D68937
2019-10-31 09:23:09 +01:00
Martin Storsjö 08c7ff99e1 [libunwind] [Windows] Add a log message if EnumProcessModules fails
Differential Revision: https://reviews.llvm.org/D69504
2019-10-31 09:34:39 +02:00
Johannes Doerfert 31784248ee [Attributor][NFCI] Improve the usage of IntegerStates
Setting the upper bound directly in the state can be beneficial and
simplifies the logic. This also exposed more copy&paste type errors.
2019-10-31 01:05:52 -05:00
Johannes Doerfert 48b4ab4835 [Attributor][FIX] Unbreak buildbot through test correction 2019-10-31 01:04:35 -05:00