platform/upstream/llvm.git
4 years agominidump: Add an "arm64" constant
Pavel Labath [Thu, 31 Oct 2019 10:05:47 +0000 (11:05 +0100)]
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.

4 years ago[Test] Add a unit test exposing lack of SCEV invalidation in LICM during code hoistin...
Serguei Katkov [Thu, 31 Oct 2019 10:05:57 +0000 (17:05 +0700)]
[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

4 years ago[lldb] Fix offset intersection bug between MPX and AVX registers
Guilherme Andrade [Thu, 31 Oct 2019 09:46:58 +0000 (10:46 +0100)]
[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

4 years ago[cfi] Add flag to always generate .debug_frame
David Candler [Thu, 31 Oct 2019 08:55:57 +0000 (08:55 +0000)]
[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

4 years ago[lldb/lit] Introduce %clang_host substitutions
Pavel Labath [Wed, 30 Oct 2019 14:57:16 +0000 (15:57 +0100)]
[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

4 years ago[yaml2obj/obj2yaml] - Add support for SHT_GNU_HASH section.
georgerim [Thu, 24 Oct 2019 12:38:53 +0000 (15:38 +0300)]
[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

4 years ago[LLDB] [Windows] Fix Windows-specific race condition in LLDB for session lifetime
Martin Storsjö [Mon, 28 Oct 2019 08:28:26 +0000 (10:28 +0200)]
[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

4 years ago[LLDB] [PECOFF] Fix error handling for executables that object::createBinary errors...
Martin Storsjö [Wed, 30 Oct 2019 21:57:40 +0000 (23:57 +0200)]
[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

4 years ago[LLDB] [Windows] Remove a TODO which probably won't be implemented
Martin Storsjö [Thu, 31 Oct 2019 07:46:56 +0000 (09:46 +0200)]
[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.)

4 years ago[LLDB] [PECOFF] Don't crash in ReadImageDataByRVA for addresses out of range
Martin Storsjö [Mon, 28 Oct 2019 08:09:52 +0000 (10:09 +0200)]
[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

4 years agoRevert "[SLP] Vectorize jumbled stores."
Haojian Wu [Thu, 31 Oct 2019 09:21:24 +0000 (10:21 +0100)]
Revert "[SLP] Vectorize jumbled stores."

This reverts commit 21d498c9c0f32dcab5bc89ac593aa813b533b43a.

This commit causes some crashes on some targets.

4 years ago[llvm-readelf/llvm-readobj] - Improve dumping of broken versioning sections.
Georgii Rymar [Mon, 28 Oct 2019 10:09:38 +0000 (13:09 +0300)]
[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

4 years ago[Diagnostics] Warn for std::is_constant_evaluated in constexpr mode
Dávid Bolvanský [Tue, 29 Oct 2019 18:06:48 +0000 (19:06 +0100)]
[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

4 years ago[MustExecute] Silence clang warning about unused captured 'this'
Mikael Holmen [Thu, 31 Oct 2019 08:40:29 +0000 (09:40 +0100)]
[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.

4 years ago[clangd] Add parameter renaming to define-inline code action
Kadir Cetinkaya [Mon, 14 Oct 2019 10:02:24 +0000 (12:02 +0200)]
[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

4 years ago[libunwind] [Windows] Add a log message if EnumProcessModules fails
Martin Storsjö [Mon, 28 Oct 2019 08:11:05 +0000 (10:11 +0200)]
[libunwind] [Windows] Add a log message if EnumProcessModules fails

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

4 years ago[Attributor][NFCI] Improve the usage of IntegerStates
Johannes Doerfert [Wed, 30 Oct 2019 04:18:49 +0000 (23:18 -0500)]
[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.

4 years ago[Attributor][FIX] Unbreak buildbot through test correction
Johannes Doerfert [Thu, 31 Oct 2019 06:04:35 +0000 (01:04 -0500)]
[Attributor][FIX] Unbreak buildbot through test correction

4 years ago[Attributor] Make liveness "edge-based"
Johannes Doerfert [Tue, 29 Oct 2019 16:47:47 +0000 (11:47 -0500)]
[Attributor] Make liveness "edge-based"

Summary:
If control is transferred to a successor is the key question when it
comes to liveness. The new implementation puts that question in the
focus and thereby providing a clean way to assume certain CFG edges are
dead or instructions will not transfer control.

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

4 years ago[llvm-objcopy][MachO] Implement --strip-all
Seiya Nuta [Thu, 31 Oct 2019 04:51:11 +0000 (13:51 +0900)]
[llvm-objcopy][MachO] Implement --strip-all

Reviewers: alexshap, rupprecht, jdoerfert, jhenderson

Reviewed By: alexshap

Subscribers: jakehehrlich, abrachet, llvm-commits

Tags: #llvm

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

4 years ago[Attributor] Liveness for values
Johannes Doerfert [Sun, 13 Oct 2019 08:08:18 +0000 (03:08 -0500)]
[Attributor] Liveness for values

Summary:
This patch introduces liveness (AAIsDead) for all positions, thus for
all kinds of values. For now, we say an instruction is dead if it would
be removed assuming all users are dead. A call site return is different
as we just look at the users. If all call site returns have been
eliminated, the return values can return undef instead of their original
value, eliminating uses.

We try to recursively delete dead instructions now and we introduce a
simple check interface for use-traversal.

This is the idea tried out in D68626 but implemented in the right way.

Reviewers: uenoku, sstefan1

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

4 years ago[Attributor][NFC] Do not delete dead blocks but "clear" them
Johannes Doerfert [Wed, 30 Oct 2019 22:34:59 +0000 (17:34 -0500)]
[Attributor][NFC] Do not delete dead blocks but "clear" them

Deleting blocks will require us to deal with dead edges, e.g.,
  `br i1 false, label %live, label %dead`
explicitly. For now we just clear the blocks and move on.
This will be revisited once we actually fold branches.

4 years ago[MustExecute] Forward iterate over conditional branches
Johannes Doerfert [Sun, 13 Oct 2019 01:46:49 +0000 (20:46 -0500)]
[MustExecute] Forward iterate over conditional branches

Summary:
If a conditional branch is encountered we can try to find a join block
where the execution is known to continue. This means finding a suitable
block, e.g., the immediate post dominator of the conditional branch, and
proofing control will always reach that block.

This patch implements different techniques that work with and without
provided analysis.

Reviewers: uenoku, sstefan1, hfinkel

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

4 years agocomment typo fix to cycle bots
Nico Weber [Thu, 31 Oct 2019 02:17:52 +0000 (22:17 -0400)]
comment typo fix to cycle bots

4 years ago[libomptarget] Change nvcc compilation to use a unity build
Jon Chesterfield [Thu, 31 Oct 2019 01:58:29 +0000 (01:58 +0000)]
[libomptarget] Change nvcc compilation to use a unity build

Summary:
[libomptarget] Change nvcc compilation to use a unity build

This allows nvcc to inline functions between what would otherwise be distinct
translation units, which in turn removes any runtime cost from implementing
functions in source files (as opposed to inline in headers).

This will then allow the circular dependencies in deviceRTL to be readily
broken and individual components more easily shared between architectures.

Reviewers: ABataev, jdoerfert, grokos, RaviNarayanaswamy, hfinkel, ronlieb, gregrodgers

Reviewed By: jdoerfert

Subscribers: mgorny, openmp-commits

Tags: #openmp

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

4 years ago[Attributor] Add "free"-based heap2stack deduction
Johannes Doerfert [Mon, 14 Oct 2019 22:29:05 +0000 (17:29 -0500)]
[Attributor] Add "free"-based heap2stack deduction

Summary:
If there is a unique free of the allocated that has to be reached from
the malloc, we can apply the heap-2-stack transformation even if the
pointer escapes.

Reviewers: hfinkel, sstefan1, uenoku

Subscribers: hiraditya, bollu, llvm-commits

Tags: #llvm

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

4 years ago[AArch64][SVE] Add patterns for some integer vector instructions
Ehsan Amiri [Wed, 30 Oct 2019 17:00:52 +0000 (13:00 -0400)]
[AArch64][SVE] Add patterns for some integer vector instructions

Add pattern matching for SVE vector instructions:

-- add, sub, and, or, xor instructions
-- sqadd, uqadd, sqsub, uqsub target-independent intrinsics
-- bic intrinsics
-- predicated add, sub, subr intrinsics

Patch Review: https://reviews.llvm.org/D69128
Patch authored by: dancgr (Danilo Carvalho Grael)

4 years ago[Attributor][NFC] Eagerly mark attributes as fixed.
Johannes Doerfert [Mon, 14 Oct 2019 02:10:31 +0000 (21:10 -0500)]
[Attributor][NFC] Eagerly mark attributes as fixed.

If an attribute did not query any optimistic (=non-fixed) information to
justify its state, we know the attribute state will not change anymore.
Thus, we can indicate an optimistic fixpoint.

4 years ago[Attributor][NFC] Do not record dependences on fixed attributes
Johannes Doerfert [Mon, 14 Oct 2019 01:25:25 +0000 (20:25 -0500)]
[Attributor][NFC] Do not record dependences on fixed attributes

Since fixed values cannot change, we do not need to wait for it to
happen, we will never notify the dependent attribute anyway.

4 years ago[Attributor][NFC] Simplify the IRPosition interface
Johannes Doerfert [Mon, 21 Oct 2019 03:46:48 +0000 (22:46 -0500)]
[Attributor][NFC] Simplify the IRPosition interface

We pretended IRPosition came either as mutable or immutable objects
while they are basically always immutable, with a single (existing)
unfortunate exceptions. This patch cleans up the uses to deal with the
immutable version.

4 years ago[Attributor] Automatically deal with undef values for IRAttributes
Johannes Doerfert [Wed, 30 Oct 2019 22:33:33 +0000 (17:33 -0500)]
[Attributor] Automatically deal with undef values for IRAttributes

For (almost) all IRAttribute we can derive whatever we want for undef
values so it makes sense to provide this functionality in the base
class. At the same time, we probably do not want to annotate them.

4 years ago[Utils] Allow update_test_checks to check function information
Johannes Doerfert [Thu, 10 Oct 2019 17:08:21 +0000 (12:08 -0500)]
[Utils] Allow update_test_checks to check function information

Summary:
This adds a switch to the update_test_checks that triggers arguments and
other function annotations, e.g., personality, to be present in the
check line. If not set, the behavior should be the same as before.
If arguments are recorded, their names are scrubbed from the IR to allow
merging.

This patch includes D68153.

Reviewers: lebedev.ri, greened, spatel, xbolva00, RKSimon, mehdi_amini

Subscribers: bollu, llvm-commits

Tags: #llvm

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

4 years ago[GISel][CombinerHelper] Combine shuffle_vector scalar to build_vector
Quentin Colombet [Thu, 31 Oct 2019 00:16:55 +0000 (17:16 -0700)]
[GISel][CombinerHelper] Combine shuffle_vector scalar to build_vector

Teach the combiner helper how to replace shuffle_vector of scalars
into build_vector.
I am not particularly happy about having to add this combine, but we
currently get those from <1 x iN> from the IR.

Bonus: This fixes an assert in the shuffle_vector combines since before
this patch, we were expecting vector types.

4 years ago[clang-tidy] Regenerate clang-tidy check list 📋
Stephane Moore [Tue, 29 Oct 2019 02:53:58 +0000 (19:53 -0700)]
[clang-tidy] Regenerate clang-tidy check list 📋

Summary:
These changes were generated by invoking
clang-tools-extra/clang-tidy/add_new_check.py and then reverting the
check that was added.

Reviewers: aaron.ballman

Reviewed By: aaron.ballman

Subscribers: xazax.hun, cfe-commits

Tags: #clang

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

4 years agoRun clang-format on lib/CodeGen/CGCall.h and fix indentation
Akira Hatanaka [Thu, 31 Oct 2019 00:51:45 +0000 (17:51 -0700)]
Run clang-format on lib/CodeGen/CGCall.h and fix indentation

4 years agoOnly ask once if we have no commands. NFC.
Jim Ingham [Thu, 31 Oct 2019 01:02:50 +0000 (18:02 -0700)]
Only ask once if we have no commands.  NFC.

4 years ago[ThinLTO/WPD] Fix index-based WPD for available_externally vtables
Teresa Johnson [Fri, 25 Oct 2019 21:56:12 +0000 (14:56 -0700)]
[ThinLTO/WPD] Fix index-based WPD for available_externally vtables

Summary:
Clang does not add type metadata to available_externally vtables. When
choosing a summary to look at for virtual function definitions, make
sure we skip summaries for any available externally vtables as they will
not describe any virtual function functions, which are only summarized
in the presence of type metadata on the vtable def. Simply look for the
corresponding strong def's summary.

Also add handling for same-named local vtables with the same GUID
because of same-named files without enough distinguishing path.
In that case we return a conservative result with no devirtualization.

Reviewers: pcc, davidxl, evgeny777

Subscribers: mehdi_amini, inglorion, hiraditya, steven_wu, dexonsmith, arphaman, llvm-commits

Tags: #llvm

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

4 years ago[JITLink] Move block ownership from LinkGraph to Section.
Lang Hames [Wed, 30 Oct 2019 21:54:54 +0000 (14:54 -0700)]
[JITLink] Move block ownership from LinkGraph to Section.

This enables easy iteration over blocks in a specific section.

4 years agoRevert "[CodeView] Add option to disable inline line tables."
Amy Huang [Thu, 31 Oct 2019 00:31:12 +0000 (17:31 -0700)]
Revert "[CodeView] Add option to disable inline line tables."
because it breaks compiler-rt tests.

This reverts commit 6d03890384517919a3ba7fe4c35535425f278f89.

4 years ago[CodeView] Add option to disable inline line tables.
Amy Huang [Mon, 16 Sep 2019 22:46:49 +0000 (15:46 -0700)]
[CodeView] Add option to disable inline line tables.

Summary:
This adds a clang option to disable inline line tables. When it is used,
the inliner uses the call site as the location of the inlined function instead of
marking it as an inline location with the function location.

See https://bugs.llvm.org/show_bug.cgi?id=42344

Reviewers: rnk

Subscribers: hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

4 years ago[lit] Add missing import
Reid Kleckner [Wed, 30 Oct 2019 23:32:26 +0000 (16:32 -0700)]
[lit] Add missing import

Apparently llvm-lit.py does not execute this path

4 years agoRevert "[Builtins] Downgrade duplicate source file warning from a fatal error to...
Dan Liew [Wed, 30 Oct 2019 23:21:46 +0000 (16:21 -0700)]
Revert "[Builtins] Downgrade duplicate source file warning from a fatal error to a warning."

This reverts commit dc748816e2aec8941d63f8ad07fb82aff6be8af7.

Now that 8ea148dc0cbff33ac3c80cf4273991465479a01e has landed it should
be safe to turning the warning back into a fatal error.

4 years ago[Builtins] Fix bug where powerpc builtins specializations didn't remove generic imple...
Dan Liew [Fri, 18 Oct 2019 18:09:19 +0000 (11:09 -0700)]
[Builtins] Fix bug where powerpc builtins specializations didn't remove generic implementations.

Summary:
Previously the CMake code looked for filepaths of the form
`<arch>/<filename>` as an indication that `<arch>/<filename>` provided a
specialization of a top-level file `<filename>`. For powerpc there was a
bug because the powerpc specialized implementations lived in `ppc/` but
the architectures were `powerpc64` and `powerpc64le` which meant that
CMake was looking for files at `powerpc64/<filename>` and
`powerpc64le/<filename>`.

The result of this is that for powerpc the builtins library contained a
duplicate symbol for `divtc3` because it had the generic implementation
and the specialized version in the built static library.

Although we could just add similar code to what there is for arm (i.e.
compute `${_arch}`) to fix this, this is extremely error prone (until
r375150 no error was raised). Instead this patch takes a different
approach that removes looking for the architecture name entirely.
Instead this patch uses the convention that a source file in a
sub-directory might be a specialization of a generic implementation and
if a source file of the same name (ignoring extension) exists at the
top-level then it is the corresponding generic implementation. This
approach is much simpler because it doesn't require keeping track of
different architecture names.

This convention already existed in repository but previously it was
implicit.  This change makes it explicit.

This patch is motivated by wanting to revert r375162 which worked around
the powerpc bug found when r375150 landed.

Once it lands we should revert r375162.

Reviewers: phosek, beanz, compnerd, shiva0217, amyk, rupprecht, kongyi, mstorsjo, t.p.northover, weimingz, jroelofs, joerg, sidneym

Subscribers: nemanjai, mgorny, kristof.beyls, jsji, shchenz, steven.zhang, #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

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

4 years ago[InstCombine] keep assumption before sinking calls
tyker [Wed, 30 Oct 2019 23:11:18 +0000 (00:11 +0100)]
[InstCombine] keep assumption before sinking calls

Summary:
in the following C code the branch is not removed by clang in O3.
```
int f1(char* p) {
    int i1 = __builtin_strlen(p);
    if (!p)
        return -1;
    return i1;
}
```
The issue is that the call to strlen is sunk to the following block by instcombine. In its new place the call to strlen doesn't dominate the use in the icmp anymore so value tracking can't see that p cannot be null.
This patch resolves the issue by inserting an assumption at the place of the call before sinking a call when that call can be used to prove an argument to be nonnull.
This resolves this issue at O3.

Reviewers: majnemer, xbolva00, fhahn, jdoerfert, spatel, efriedma

Reviewed By: jdoerfert

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[lit] Silence warning about importing the resource module on Windows
Reid Kleckner [Wed, 30 Oct 2019 23:10:24 +0000 (16:10 -0700)]
[lit] Silence warning about importing the resource module on Windows

lit was printing this warning on every test run on Windows, and that is
not necessary.

4 years agoRun clang-format on lldb/source/Commands (NFC)
Adrian Prantl [Wed, 30 Oct 2019 22:26:19 +0000 (15:26 -0700)]
Run clang-format on lldb/source/Commands (NFC)

These files had a lot of whitespace errors in them which was a
constant source of merge conflicts downstream.

4 years ago[clang][ScanDeps] Fix shadowing warning.
Michael Spencer [Wed, 30 Oct 2019 22:53:25 +0000 (15:53 -0700)]
[clang][ScanDeps] Fix shadowing warning.

4 years ago[libc++] Add test and remove workaround for PR13592
Louis Dionne [Wed, 30 Oct 2019 22:49:04 +0000 (15:49 -0700)]
[libc++] Add test and remove workaround for PR13592

PR13592 was caused by a problem in how to compiler implemented the
__is_convertible_to intrinsic. That problem, reported as PR13591,
was fixed back in 2012. We don't support such old versions of Clang
anyway, so we don't need the library workaround that had been added
to solve PR13592 (while waiting for the compiler fix).

4 years agoDisable new clang-scan-deps test on Windows due to backslash path matching problems
Reid Kleckner [Wed, 30 Oct 2019 22:51:34 +0000 (15:51 -0700)]
Disable new clang-scan-deps test on Windows due to backslash path matching problems

4 years agogn build: Merge 33a745e6fe7
LLVM GN Syncbot [Wed, 30 Oct 2019 22:28:00 +0000 (22:28 +0000)]
gn build: Merge 33a745e6fe7

4 years ago[clang][clang-scan-deps] Add support for extracting full module dependencies.
Michael Spencer [Wed, 16 Oct 2019 19:28:35 +0000 (12:28 -0700)]
[clang][clang-scan-deps] Add support for extracting full module dependencies.

This is a recommit of d8a4ef0e685c with the nondeterminism fixed.

This adds experimental support for extracting a Clang module dependency graph
from a compilation database. The output format is experimental and will change.
It is currently a concatenation of JSON outputs for each compilation. Future
patches will change this to deduplicate modules between compilations.

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

4 years agoFix -Wsign-compare warning with clang-cl
Reid Kleckner [Wed, 30 Oct 2019 22:18:21 +0000 (15:18 -0700)]
Fix -Wsign-compare warning with clang-cl

off_t apparently is just "long" on Win64, which is 32-bits, and
therefore not long enough to compare with UINT32_MAX. Use auto to follow
the surrounding code. uint64_t would also be fine.

4 years agoRevert "[clang][clang-scan-deps] Add support for extracting full module dependencies."
Michael Spencer [Wed, 30 Oct 2019 22:15:39 +0000 (15:15 -0700)]
Revert "[clang][clang-scan-deps] Add support for extracting full module dependencies."

This reverts commit d8a4ef0e685cec1fc73d4953b48220b649d05b40.

This commit broke some of the bots. I believe it's due to nondeterminism. Will fix and recommit.

4 years ago[lit] Change progress bar color to red on first failure
Julian Lettner [Mon, 25 Feb 2019 06:38:44 +0000 (22:38 -0800)]
[lit] Change progress bar color to red on first failure

4 years ago[lit] Add helper for `test.result.code.isFailure`
Julian Lettner [Mon, 25 Feb 2019 05:59:55 +0000 (21:59 -0800)]
[lit] Add helper for `test.result.code.isFailure`

4 years ago[lit] Extract `_install_win32_signal_handler` function
Julian Lettner [Sat, 23 Feb 2019 06:33:48 +0000 (22:33 -0800)]
[lit] Extract `_install_win32_signal_handler` function

4 years ago[X86] Model MXCSR for all SSE instructions
Craig Topper [Wed, 30 Oct 2019 21:56:19 +0000 (14:56 -0700)]
[X86] Model MXCSR for all SSE instructions

This patch adds MXCSR as a reserved physical register and models its use
by X86 SSE instructions. It also adds flag "mayRaiseFPException" for the
instructions that possibly can raise FP exception according to the
architecture definition.

Following what SystemZ and other targets does, only the current rounding
modes and the IEEE exception masks are modeled. *Changes* of the MXCSR
due to exceptions are not modeled.

Patch by Pengfei Wang

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

4 years ago[MS] Don't reference deleted copy ctors from catchable types
Reid Kleckner [Wed, 30 Oct 2019 21:38:11 +0000 (14:38 -0700)]
[MS] Don't reference deleted copy ctors from catchable types

When throwing objects with deleted copy constructors, the copy ctor
field of the catchable type should remain null and the mangle name
changes. This already worked in simple cases, but in cases involving
non-trivial subobjects, sometimes LookupCopyingConstructor could return
a non-null but deleted constructor decl. Skip those and don't reference
them.

Fixes PR43680

4 years agoAMDGPU: Disallow spill folding with m0 copies
Matt Arsenault [Wed, 30 Oct 2019 19:56:24 +0000 (12:56 -0700)]
AMDGPU: Disallow spill folding with m0 copies

readlane and writelane instructions are not allowed to use m0 as the
data operand, so spilling them is tricky and would require an
intermediate SGPR to spill it. Constrain the virtual register class in
this caes to disallow the inline spiller from folding the m0 operand
directly into the spill instruction.

I copied this hack from AArch64 which has the same problem for $sp.

4 years ago[globalisel][docs] Add the tutorial to the Porting document
Daniel Sanders [Wed, 30 Oct 2019 21:52:57 +0000 (14:52 -0700)]
[globalisel][docs] Add the tutorial to the Porting document

In lieu of converting that tutorial to text, add a link to the porting
tutorial from the 2017 Dev Meeting to the porting page

4 years ago[clang][clang-scan-deps] Add support for extracting full module dependencies.
Michael Spencer [Wed, 16 Oct 2019 19:28:35 +0000 (12:28 -0700)]
[clang][clang-scan-deps] Add support for extracting full module dependencies.

This adds experimental support for extracting a Clang module dependency graph
from a compilation database. The output format is experimental and will change.
It is currently a concatenation of JSON outputs for each compilation. Future
patches will change this to deduplicate modules between compilations.

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

4 years agoAMDGPU: Don't fold S_NOPs with implicit operands
Matt Arsenault [Wed, 30 Oct 2019 19:39:55 +0000 (12:39 -0700)]
AMDGPU: Don't fold S_NOPs with implicit operands

4 years agoRegAllocFast: Use Register
Matt Arsenault [Wed, 30 Oct 2019 21:01:58 +0000 (14:01 -0700)]
RegAllocFast: Use Register

4 years ago[X86] Rewrite hasReassociableOperands and setSpecialOperandAttr to not hardcode numbe...
Craig Topper [Wed, 30 Oct 2019 19:48:19 +0000 (12:48 -0700)]
[X86] Rewrite hasReassociableOperands and setSpecialOperandAttr to not hardcode number of operands or position of the EFLAGS operand.

This makes the code immune to the MXCSR addition in D68121.

4 years ago[X86] Precommit new tests from D68757. NFC
Craig Topper [Wed, 30 Oct 2019 18:41:44 +0000 (11:41 -0700)]
[X86] Precommit new tests from D68757. NFC

4 years ago[ReleaseNotes] Add item on deleting the BasicBlockPass(Manager).
Alina Sbirlea [Wed, 30 Oct 2019 20:39:11 +0000 (13:39 -0700)]
[ReleaseNotes] Add item on deleting the BasicBlockPass(Manager).

4 years agoAdd a test file that was missed in 4de6b1586807285e20a5db6596519c2336a64568
Vladimir Plyashkun [Wed, 30 Oct 2019 20:54:45 +0000 (16:54 -0400)]
Add a test file that was missed in 4de6b1586807285e20a5db6596519c2336a64568

4 years agoAdd a test file that was missed in e477988309dbde214a6d16ec690a416882714aac
Daniel [Wed, 30 Oct 2019 20:51:31 +0000 (16:51 -0400)]
Add a test file that was missed in e477988309dbde214a6d16ec690a416882714aac

4 years ago[globalisel][docs] Rework the Legalizer page slightly
Daniel Sanders [Wed, 30 Oct 2019 19:23:03 +0000 (12:23 -0700)]
[globalisel][docs] Rework the Legalizer page slightly

The legalizer page was in a fairly good state. I've mostly just inlined
some information as a note and removed a reference to potential future
work that I think is very unlikely to be done (it's very hard to tell if
a pattern or set of patterns fully covers a node due to C++ predicates).

Also added a note that 'selectable' doesn't mean that InstructionSelect
must do it.

4 years agoFix __attribute__((enable_if)) to treat arguments with side-effects as
Richard Smith [Wed, 30 Oct 2019 20:32:52 +0000 (13:32 -0700)]
Fix __attribute__((enable_if)) to treat arguments with side-effects as
non-constant.

We previously failed the entire condition evaluation if an unmodeled
side-effect was encountered in an argument, even if that argument was
unused in the attribute's condition.

4 years agogn build: Merge cd24a00bd32
LLVM GN Syncbot [Wed, 30 Oct 2019 20:20:22 +0000 (20:20 +0000)]
gn build: Merge cd24a00bd32

4 years ago[JITLink] Remove relocation unit tests.
Lang Hames [Wed, 30 Oct 2019 20:16:37 +0000 (13:16 -0700)]
[JITLink] Remove relocation unit tests.

These tests were written before llvm-jitlink supported regression testing of
relocation support. They are now redundant.

4 years ago[JITLink] Add missing include, explicitly qualify STLExtras functions.
Lang Hames [Wed, 30 Oct 2019 20:04:32 +0000 (13:04 -0700)]
[JITLink] Add missing include, explicitly qualify STLExtras functions.

This should fix the failures on some bots due to commit
b9d8e23b806ca605c368f924cca75bdd090834c6.

4 years ago[clang][llvm] Obsolete Exynos M1 and M2
Evandro Menezes [Wed, 2 Oct 2019 21:26:40 +0000 (16:26 -0500)]
[clang][llvm] Obsolete Exynos M1 and M2

4 years agogn build: Merge b9d8e23b806
LLVM GN Syncbot [Wed, 30 Oct 2019 19:36:47 +0000 (19:36 +0000)]
gn build: Merge b9d8e23b806

4 years ago[JITLink] Add a utility for splitting blocks at a given index.
Lang Hames [Wed, 30 Oct 2019 19:26:15 +0000 (12:26 -0700)]
[JITLink] Add a utility for splitting blocks at a given index.

LinkGraph::splitBlock will split a block at a given index, returning a new
block covering the range [ 0, index ) and modifying the original block to
cover the range [ index, original-block-size ). Block addresses, content,
edges and symbols will be updated as necessary. This utility will be used
in upcoming improvements to JITLink's eh-frame support.

4 years agoDebugServer: be more lenient about the target triple
Saleem Abdulrasool [Wed, 30 Oct 2019 19:07:07 +0000 (12:07 -0700)]
DebugServer: be more lenient about the target triple

When building standalone, `LLVM_DEFAULT_TARGET_TRIPLE` may be undefined.
Matching against an empty string does not work as desired in CMake, so,
fallback to the old behaviour, defaulting `LLDB_DEBUGSERVER_ARCH` to
`CMAKE_OSX_ARCHITECTURES`.

4 years ago[globalisel][docs] Add a pass index
Daniel Sanders [Wed, 30 Oct 2019 19:04:08 +0000 (12:04 -0700)]
[globalisel][docs] Add a pass index

4 years ago[X86][SSE] Regenerate vector-rem tests
Simon Pilgrim [Wed, 30 Oct 2019 18:58:19 +0000 (18:58 +0000)]
[X86][SSE] Regenerate vector-rem tests

4 years ago[X86] Regenerate memmove vector width tests
Simon Pilgrim [Wed, 30 Oct 2019 18:57:16 +0000 (18:57 +0000)]
[X86] Regenerate memmove vector width tests

4 years ago[AArch64] Remove overlapping scheduling definitions (NFC)
Evandro Menezes [Thu, 24 Oct 2019 16:37:01 +0000 (11:37 -0500)]
[AArch64] Remove overlapping scheduling definitions (NFC)

The scheduling definitions for ASIMD transpose and zipping overlapped with
others a few lines below.  Somehow, they didn't raise errors before.

There seem to be other overlapping definitions.  Somehow, they still don't
raise errors.

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

4 years agoRevert "[NFC] Rename LLVM_NO_DEAD_STRIP"
David Tenty [Wed, 30 Oct 2019 18:56:20 +0000 (14:56 -0400)]
Revert "[NFC] Rename LLVM_NO_DEAD_STRIP"

This reverts commit 11c2a85db8849db1a5907e80d9966592248ef825.

4 years ago[globalisel][docs] Fix a label that was renamed
Daniel Sanders [Wed, 30 Oct 2019 18:47:12 +0000 (11:47 -0700)]
[globalisel][docs] Fix a label that was renamed

4 years ago[PowerPC][AIX] Adds support for writing the data section in object files
jasonliu [Wed, 30 Oct 2019 18:31:31 +0000 (18:31 +0000)]
[PowerPC][AIX] Adds support for writing the data section in object files

Adds support for generating the XCOFF data section in object files for global variables with initialization.

Merged aix-xcoff-common.ll into aix-xcoff-data.ll.

Changed variable name charr to chrarray in the test case to test if readobj works with 8-character names.

Authored by: xingxue

Reviewers: hubert.reinterptrtcast, sfertile, jasonliu, daltenty, Xiangling_L.

Reviewed by: hubert.reinterpretcast, sfertile, daltenty.

Subscribers: DiggerLin, Wuzish, nemanjai, hiraditya, MaskRay, jsji, shchenz, llvm-commits

Tags: #llvm

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

4 years ago[DebugInfo][DAG] Distinguish different kinds of location indirection
Jeremy Morse [Wed, 30 Oct 2019 18:34:44 +0000 (18:34 +0000)]
[DebugInfo][DAG] Distinguish different kinds of location indirection

From SelectionDAGs point of view, debug variable locations specified with
dbg.declare and dbg.addr are indirect -- they specify the address of
something. But calling conventions might mean that a Value is placed on
the stack somewhere, and this too is indirection. Previously this was
mixed up in the "IsIndirect" field of DBG_VALUE insts; this patch
separates them by encoding the indirection in a DIExpression.

If we have a dbg.declare or dbg.addr, then the expression produces an
address that then becomes a DWARF memory location. We can represent
this by putting a DW_OP_deref on the _end_ of the expression. If a Value
has been placed on the stack, then we need to put a DW_OP_deref on the
_start_ of the expression, to load the Value from the stack and have
the rest of the expression operate on it.

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

4 years ago[LegacyPassManager] Delete BasicBlockPass/Manager.
Alina Sbirlea [Wed, 30 Oct 2019 18:19:06 +0000 (11:19 -0700)]
[LegacyPassManager] Delete BasicBlockPass/Manager.

Summary:
Delete the BasicBlockPass and BasicBlockManager, all its dependencies and update documentation.
The BasicBlockManager was improperly tested and found to be potentially broken, and was deprecated as of rL373254.

In light of the switch to the new pass manager coming before the next release, this patch is a first cleanup of the LegacyPassManager.

Reviewers: chandlerc, echristo

Subscribers: mehdi_amini, sanjoy.google, llvm-commits

Tags: #llvm

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

4 years ago[X86] Add FIXME comment to merge more of computeZeroableShuffleElements and getTarget...
Simon Pilgrim [Wed, 30 Oct 2019 18:26:30 +0000 (18:26 +0000)]
[X86] Add FIXME comment to merge more of computeZeroableShuffleElements and getTargetShuffleAndZeroables

4 years ago[X86][SSE] combineX86ShuffleChain - use resolveZeroablesFromTargetShuffle helper...
Simon Pilgrim [Wed, 30 Oct 2019 18:25:32 +0000 (18:25 +0000)]
[X86][SSE] combineX86ShuffleChain - use resolveZeroablesFromTargetShuffle helper. NFCI.

4 years ago[sanitizer_common] Create max_allocation_size_mb flag.
Matt Morehouse [Wed, 30 Oct 2019 18:17:56 +0000 (11:17 -0700)]
[sanitizer_common] Create max_allocation_size_mb flag.

Summary:
The flag allows the user to specify a maximum allocation size that the
sanitizers will honor.  Any larger allocations will return nullptr or
crash depending on allocator_may_return_null.

Reviewers: kcc, eugenis

Reviewed By: kcc, eugenis

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

4 years agoFix readability-identifier-naming to prevent variables becoming keywords.
Daniel [Wed, 30 Oct 2019 18:15:47 +0000 (14:15 -0400)]
Fix readability-identifier-naming to prevent variables becoming keywords.

Do not provide a fix-it when clang-tidy encounters a name that would become
a keyword.

4 years ago[MSP430] fix typo in test name; NFC
Sanjay Patel [Wed, 30 Oct 2019 18:15:25 +0000 (14:15 -0400)]
[MSP430] fix typo in test name; NFC

4 years ago[MSP430] adjust tests for Shift Amount Threshold; NFC
Sanjay Patel [Wed, 30 Oct 2019 18:11:55 +0000 (14:11 -0400)]
[MSP430] adjust tests for Shift Amount Threshold; NFC

Baseline results for D69120.

Patch by: @joanlluch (Joan LLuch)

4 years agoAdd an option to hicpp-signed-bitwise for positive integer literals.
Vladimir Plyashkun [Wed, 30 Oct 2019 18:07:49 +0000 (14:07 -0400)]
Add an option to hicpp-signed-bitwise for positive integer literals.

This gives developers a way to deviate from the coding standard to reduce the
chattiness of the check.

4 years agoMove this release note to its appropriate location; NFC.
Aaron Ballman [Wed, 30 Oct 2019 17:48:26 +0000 (13:48 -0400)]
Move this release note to its appropriate location; NFC.

4 years agoFix modernize-use-nodiscard for classes marked [[nodiscard]]
Aaron Ballman [Wed, 30 Oct 2019 17:44:18 +0000 (13:44 -0400)]
Fix modernize-use-nodiscard for classes marked [[nodiscard]]

Current implementation suggests to add [[nodiscard]] to methods even if the
return type is marked already as [[nodiscard]].

Patch by Eugene Sedykh.

4 years agogn build: Merge 29dc0b17de6
LLVM GN Syncbot [Wed, 30 Oct 2019 17:40:59 +0000 (17:40 +0000)]
gn build: Merge 29dc0b17de6

4 years agoFix a false positive in misc-redundant-expression check
Aaron Ballman [Wed, 30 Oct 2019 17:35:20 +0000 (13:35 -0400)]
Fix a false positive in misc-redundant-expression check

Do not warn for redundant conditional expressions when the true and false
branches are expanded from different macros even when they are defined by
one another.

Patch by Daniel Krupp.

4 years ago[SLP] Vectorize jumbled stores.
Alexey Bataev [Tue, 15 Oct 2019 14:32:17 +0000 (10:32 -0400)]
[SLP] Vectorize jumbled stores.

Summary:
Patch adds support for vectorization of the jumbled stores. The value
operands are vectorized and then shuffled in the right order before
store.

Reviewers: RKSimon, spatel, hfinkel, mkuper

Subscribers: llvm-commits

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

4 years ago[NFC] Move this set of STRICT_* cases to be next to the non-strict cases.
Kevin P. Neal [Wed, 30 Oct 2019 17:29:07 +0000 (13:29 -0400)]
[NFC] Move this set of STRICT_* cases to be next to the non-strict cases.

Requested by Cameron McInally in D69275.

4 years agoAdd the readability-redundant-access-specifiers check.
Aaron Ballman [Wed, 30 Oct 2019 17:26:41 +0000 (13:26 -0400)]
Add the readability-redundant-access-specifiers check.

This finds redundant access specifier declarations inside classes, structs, and unions.

Patch by Mateusz Mackowski.