Commit Graph

338009 Commits

Author SHA1 Message Date
Alexey Bataev 0860db966a [OPENMP50]Codegen for nontemporal clause.
Summary:
Basic codegen for the declarations marked as nontemporal. Also, if the
base declaration in the member expression is marked as nontemporal,
lvalue for member decl access inherits nonteporal flag from the base
lvalue.

Reviewers: rjmccall, hfinkel, jdoerfert

Subscribers: guansong, arphaman, caomhin, kkwli0, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D71708
2019-12-23 10:04:46 -05:00
Pavel Labath e40ac74dac [lldb] Remove DWARFUnit::AppendDIEsWithTag
This function is not very useful, as it's forcing a materialization of
the returned DIEs, and calling it is not substantially simpler than just
iterating over the DIEs manually. Delete it, and rewrite the single
caller.
2019-12-23 15:50:30 +01:00
LLVM GN Syncbot d105ea26e8 [gn build] Port eca40066eb 2019-12-23 13:55:08 +00:00
Pavel Labath 46f02fc922 [lldb/DWARF] Fix hostname-stripping logic
This bit of code is trying to strip everything up to the first colon
from all debug info paths, as dwarf2 recommends this syntax for storing
the compilation host name. However, this code was too eager, and it
ended up stripping the entire compilation directory, if it did not
contain a forward slash (or a "x:\").

Normally this does not matter, as all absolute paths will contain one of
these patterns, but this does not have to be the case in case the debug
info is produced by "clang -fdebug-compilation-dir", which can end up
producing a relative compilation directory with no slashes (this is one
of the techniques for producing "relocatable" debug info).
2019-12-23 14:54:22 +01:00
Florian Hahn 8d6f59b78a [Matrix] Use fmuladd for matrix.multiply if allowed.
If the matrix.multiply calls have the contract fast math flag, we can
use fmuladd. This als adds a command line option to force fmuladd
generation. We can retire this option once there is a clang-level
option.

Reviewers: anemet, Gerolf, hfinkel, andrew.w.kaylor

Reviewed By: anemet

Differential Revision: https://reviews.llvm.org/D70951
2019-12-23 14:49:14 +01:00
Yaxun (Sam) Liu eca40066eb [NFC] Move OptionUtils from Basic to Driver
Differential Revision: https://reviews.llvm.org/D71802
2019-12-23 08:11:23 -05:00
Florian Hahn 109e4e3851 [Matrix] Add forward shape propagation and first shape aware lowerings.
This patch adds infrastructure for forward shape propagation to
LowerMatrixIntrinsics. It also updates the pass to make use of
the shape information to break up larger vector operations and to
eliminate unnecessary conversion operations between columnwise matrixes
and flattened vectors: if shape information is available for an
instruction, lower the operation to a set of instructions operating on
columns. For example, a store of a matrix is broken down into separate
stores for each column. For users that do not have shape
information (e.g. because they do not yet support shape information
aware lowering), we pack the result columns into a flat vector and
update those users.

It also adds shape aware lowering for the first non-intrinsic
instruction: vector stores.

Example:

For
  %c  = call <4 x double> @llvm.matrix.transpose(<4 x double> %a, i32 2, i32 2)
  store <4 x double> %c, <4 x double>* %Ptr

We generate the code below without shape propagation. Note %9 which
combines the columns of the transposed matrix into a flat vector.

  %split = shufflevector <4 x double> %a, <4 x double> undef, <2 x i32> <i32 0, i32 1>
  %split1 = shufflevector <4 x double> %a, <4 x double> undef, <2 x i32> <i32 2, i32 3>
  %1 = extractelement <2 x double> %split, i64 0
  %2 = insertelement <2 x double> undef, double %1, i64 0
  %3 = extractelement <2 x double> %split1, i64 0
  %4 = insertelement <2 x double> %2, double %3, i64 1
  %5 = extractelement <2 x double> %split, i64 1
  %6 = insertelement <2 x double> undef, double %5, i64 0
  %7 = extractelement <2 x double> %split1, i64 1
  %8 = insertelement <2 x double> %6, double %7, i64 1
  %9 = shufflevector <2 x double> %4, <2 x double> %8, <4 x i32> <i32 0, i32 1, i32 2, i32 3>
  store <4 x double> %9, <4 x double>* %Ptr

With this patch, we propagate the 2x2 shape information from the
transpose to the store and we generate the code below. Note that we
store the columns directly and do not need an extra shuffle.

  %9 = bitcast <4 x double>* %Ptr to double*
  %10 = bitcast double* %9 to <2 x double>*
  store <2 x double> %4, <2 x double>* %10, align 8
  %11 = getelementptr double, double* %9, i32 2
  %12 = bitcast double* %11 to <2 x double>*
  store <2 x double> %8, <2 x double>* %12, align 8

Reviewers: anemet, Gerolf, reames, hfinkel, andrew.w.kaylor

Reviewed By: anemet

Differential Revision: https://reviews.llvm.org/D70897
2019-12-23 13:51:56 +01:00
Raphael Isemann 982a9e3d46 [lldb][NFC] Remove unused callback functionality from ClangASTContext 2019-12-23 13:50:01 +01:00
Sven van Haastregt b714583fd0 [OpenCL] Add atomic builtin functions
Add atomic builtin functions from the OpenCL C specification.

Patch by Pierre Gondois and Sven van Haastregt.
2019-12-23 12:29:01 +00:00
Raphael Isemann 40bd809b6d [lldb][NFC] Simplify ClangExternalASTSourceCallbacks
This class is only used by the ClangASTContext so we might as well
simplify this whole logic by just passing a ClangASTContext instead
of a list of callbacks and a void* pointer. If we ever need this
to support other classes then we can define some interface that
ClangASTContext implements but for now this isn't needed.

I also removed any code for m_callback_find_by_name as this was
always a nullptr in LLDB and removed all overriden implementations
that just redefined the default no-op implementation that the
ExternalASTSource provides.

Also removed the assert.h workarounds.
2019-12-23 13:22:29 +01:00
Kristof Beyls 5bd9eee53d [find_interesting_reviews.py] Add git blame output cache
The majority of the running time of this script tends to be spent in
running git blame on source files touched by patches under review.

By introducing a git blame output cache, some of the git blame commands
don't have to re-run, and the blame information can be retrieved from a
cache.

I've observed that in a typical run matching patches available for
review with potential reviewers, this speeds up the script's running
time by a factor of about 2.5x.
2019-12-23 12:08:16 +00:00
Raphael Isemann b6c29d9de0 [lldb][NFC] Remove unused 'type' parameter in ClangExpressionDeclMap::FindGlobalVariable
We never pass something else than a nullptr as the 'type' so the related code in this function is never reached.
2019-12-23 12:43:47 +01:00
Raphael Isemann a175c6a6f6 [lldb][NFC] Remove wrong and unused ClangASTContext::CopyDecl method 2019-12-23 12:11:26 +01:00
Raphael Isemann 76d294cb87 [lldb][NFC] Delete all 'else return ...' in CompilerDeclContext.cpp 2019-12-23 11:49:35 +01:00
Raphael Isemann 73951a11c6 [lldb] Add sanity check to CreateDeclContext and fixed illformed CompilerContext in ClangExpressionDeclMap.
This adds a check that the ClangASTContext actually fits to the
DeclContext that we want to create a CompilerDeclContext for. If
the ClangASTContext (and its associated ASTContext) does not fit
to the DeclContext (that is, the DeclContext wasn't created by the
ASTContext), all computations using this malformed CompilerDeclContext
will yield unpredictable results.

Also fixes the only place that actually hits this assert which is the
construction of a CompilerDeclContext in ClangExpressionDeclMap
where we pass an unrelated ASTContext instead of the ASTContext
of the current expression.

I had to revert my previous change to DWARFASTParserClangTests.cpp
back to using the unsafe direct construction of CompilerDeclContext
as this assert won't work if the DeclContext we pass isn't a valid
DeclContext in the first place.
2019-12-23 11:48:02 +01:00
Georgii Rymar f027e1a68d [yaml2obj] - Allow using an arbitrary value for OSABI.
There was no way to set an unsupported or unknown OS ABI.
With this patch it is possible to use any numeric value.

Differential revision: https://reviews.llvm.org/D71765
2019-12-23 13:29:52 +03:00
Georgii Rymar 1f98577556 [yaml2obj] - Add support for ELFOSABI_LINUX.
ELFOSABI_LINUX is an alias for ELFOSABI_GNU.
It is not that obvious probably.

Differential revision: https://reviews.llvm.org/D71764
2019-12-23 13:25:58 +03:00
Pavel Labath 3cfb6677b2 [lldb] Don't process symlinks deep inside DWARFUnit
Summary:
This code is handling debug info paths starting with /proc/self/cwd,
which is one of the mechanisms people use to obtain "relocatable" debug
info (the idea being that one starts the debugger with an appropriate
cwd and things "just work").

Instead of resolving the symlinks inside DWARFUnit, we can do the same
thing more elegantly by hooking into the existing Module path remapping
code. Since llvm::DWARFUnit does not support any similar functionality,
doing things this way is also a step towards unifying llvm and lldb
dwarf parsers.

Reviewers: JDevlieghere, aprantl, clayborg, jdoerfert

Subscribers: lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D71770
2019-12-23 11:24:04 +01:00
Georgii Rymar 2cebc1a717 [yaml2obj] - Add testing for OSABI field.
We have no such testing. This makes impossible
to add support for new ELFOSABI_* tags.

Differential revision: https://reviews.llvm.org/D71763
2019-12-23 13:18:18 +03:00
Martin Storsjö 5a751e747d [AArch64] [Windows] Use COFF stubs for calls to extern_weak functions
As the extern_weak target might be missing, resolving to the absolute
address zero, we can't use the normal direct PC-relative branch
instructions (as that would result in relocations out of range).

Improve the classifyGlobalFunctionReference method to set
MO_DLLIMPORT/MO_COFFSTUB, and simplify the existing code in
AArch64TargetLowering::LowerCall to use the return value from
classifyGlobalFunctionReference for these cases.

Add code in both AArch64FastISel and GlobalISel/IRTranslator to
bail out for function calls to extern weak functions on windows,
to let SelectionDAG handle them.

This matches what was done for X86 in 6bf108d77a.

Differential Revision: https://reviews.llvm.org/D71721
2019-12-23 12:13:49 +02:00
Martin Storsjö b774aa1011 [ARM] [Windows] Use COFF stubs for calls to extern_weak functions
As the extern_weak target might be missing, resolving to the absolute
address zero, we can't use the normal direct PC-relative branch
instructions (as that would result in relocations out of range).

Instead check the shouldAssumeDSOLocal method and load the address
from a COFF stub.

This matches what was done for X86 in 6bf108d77a.

Differential Revision: https://reviews.llvm.org/D71720
2019-12-23 12:13:49 +02:00
Martin Storsjö 86c9831bb4 [ItaniumCXXABI] Don't mark an extern_weak init function as dso_local on windows
Since 6bf108d77a, we try to not mark extern_weak symbols as
dso_local, to allow using COFF stubs for references to those symbols
(as the symbol may be missing, resolving to an absolute address zero,
outside of the current DSO).

Differential Revision: https://reviews.llvm.org/D71716
2019-12-23 12:13:48 +02:00
Georgii Rymar cc522bc4e3 [llvm-readobj][test] - Stop using Inputs/trivial.obj.elf-x86-64.
This rewrites a few tests to stop using the
trivial.obj.elf-x86-64 precompiled object
and removes it.

Differential revision: https://reviews.llvm.org/D71662
2019-12-23 13:10:26 +03:00
Pavel Labath fbccef6b25 [lldb] Fix a -Wreturn-type gcc warning in ScriptInterpreter.cpp 2019-12-23 11:07:35 +01:00
Pavel Labath 12a3d97cf6 [lldb/lua] Fix bindings.test for lua-5.1
string.format("%s", true) only works since lua-5.2. Make the print
statement more portable.
2019-12-23 11:07:35 +01:00
Raphael Isemann fecb122cca [lldb][NFC] Simplify ClangASTContext::GetTranslationUnitDecl
These two functions are just calling their equivalent function
in ASTContext and implicitly convert the result to a
DeclContext* (a parent class of TranslationUnitDecl). This leads
to the absurd situation that we had to cast the result of
GetTranslationUnitDecl to a TranslationUnitDecl*. The only reason
we did this implicit conversion to the parent class
was that the void* conversion for the CompilerDeclContext constructor
was sound (which otherwise would receive a Decl* pointer when
called with a TranslationUnitDecl*).

Now that the CompilerDeclContext constructor is type safe we can
properly implement these functions by actually returning the
right type. Also deletes the static inconvenience method that was
not used anywhere.
2019-12-23 11:02:21 +01:00
Raphael Isemann 5dca0596a9 [lldb] Add a SubsystemRAII that takes care of calling Initialize and Terminate in the unit tests
Summary:
Many of our tests need to initialize certain subsystems/plugins of LLDB such as
`FileSystem` or `HostInfo` by calling their static `Initialize` functions before the
test starts and then calling `::Terminate` after the test is done (in reverse order).
This adds a lot of error-prone boilerplate code to our testing code.

This patch adds a RAII called SubsystemRAII that ensures that we always call
::Initialize and then call ::Terminate after the test is done (and that the Terminate
calls are always in the reverse order of the ::Initialize calls). It also gets rid of
all of the boilerplate that we had for these calls.

Per-fixture initialization is still not very nice with this approach as it would
require some kind of static unique_ptr that gets manually assigned/reseted
from the gtest SetUpTestCase/TearDownTestCase functions. Because of that
I changed all per-fixture setup to now do per-test setup which can be done
by just having the SubsystemRAII as a member of the test fixture. This change doesn't
influence our normal test runtime as LIT anyway runs each test case separately
(and the Initialize/Terminate calls are anyway not very expensive). It will however
make running all tests in a single executable slightly slower.

Reviewers: labath, JDevlieghere, martong, espindola, shafik

Reviewed By: labath

Subscribers: mgorny, rnkovacs, emaste, MaskRay, abidh, lldb-commits

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D71630
2019-12-23 10:38:25 +01:00
Shengchen Kan 70fa4c4f88 [NFC] Style cleanups
1. Remove duplicate function for class name at the beginning of the
comment.
2. Use auto where the type is already obvious from the context.
2019-12-23 17:02:36 +08:00
Raphael Isemann 6df6edfd0a [lldb][NFC] Document CompilerDeclContext constructors 2019-12-23 09:59:58 +01:00
Raphael Isemann 42ec584a8b [lldb][NFC] Make CompilerDeclContext construction type safe
The CompilerDeclContext constructor takes a void* pointer which
means that all callers of this constructor need to first explicitly
convert all pointers to clang::DeclContext*. This causes that we
for example can't just pass a TranslationUnitDecl* to the constructor without
first casting it to its parent class (as it inherits from both
Decl and DeclContext so the void* pointer is actually a Decl*).

This patch introduces a utility function in the ClangASTContext
which gets rid of the requirement to cast all pointers to
clang::DeclContext. Also moves all constructor calls to use this
function instead which is NFC (beside the change in
DWARFASTParserClangTests.cpp).
2019-12-23 09:56:54 +01:00
QingShan Zhang 6d5e35e89d [Power9] Remove the PPCISD::XXREVERSE as it has completely the same semantics of ISD::BSWAP
The custom node PPCISD::XXREVERSE has completely the same semantics of generic node ISD::BSWAP.
We need to clean up it as we have the combine rules for bswap in the base class, while nothing for xxreverse.

Differential Revision: https://reviews.llvm.org/D70657
2019-12-23 07:44:33 +00:00
Simon Pilgrim 3654ed21ee Fix case style warnings in DIBuilder. NFC. 2019-12-23 07:27:18 +00:00
Dinar Temirbulatov a755ccefe6 [SLP] Replace NeedToGather variable with enum. 2019-12-23 08:21:53 +01:00
QingShan Zhang 9d1071eac4 [NFC][Test][PowerPC] Add more tests for 'and mask' 2019-12-23 06:59:14 +00:00
Saar Raz df061c3e2b [Concepts] Constrained partial specializations and function overloads.
Added support for constraint satisfaction checking and partial ordering of constraints in constrained partial specialization and function template overloads.
Re-commit after fixing another crash (added regression test).

Differential Revision: https://reviews.llvm.org/D41910
2019-12-23 08:37:35 +02:00
River Riddle 35807bc4c5 NFC: Introduce new ValuePtr/ValueRef typedefs to simplify the transition to Value being value-typed.
This is an initial step to refactoring the representation of OpResult as proposed in: https://groups.google.com/a/tensorflow.org/g/mlir/c/XXzzKhqqF_0/m/v6bKb08WCgAJ

This change will make it much simpler to incrementally transition all of the existing code to use value-typed semantics.

PiperOrigin-RevId: 286844725
2019-12-22 22:00:23 -08:00
Jonas Devlieghere 1562511275 [lldb/ScriptInterpreter] Remove can_reload which is always true (NFC)
The `-r` option for `command script import` is there for legacy
compatibility, however the can_reload flag is always set to true. This
patch removes the flag and any code that relies on it being false.
2019-12-22 21:36:03 -08:00
Saleem Abdulrasool b449d19e55 build: use `find_package(Python3)` rather than `PYTHON_HOME`
The behaviour of `PYTHON_HOME` can be emulated by setting
`Python3_EXECUTABLE` to the absolute path instead of the custom variable
now that we can find the python interpreter.
2019-12-22 20:47:25 -08:00
Jim Lin da0fe5db99 [AVR] Fix codegen for rotate instructions
Summary:
    This patch introduces the ROLBRd and RORBRd pseudo-instructions,
    which implemenent the "traditional" rotate operations; instead of
    the AVR rotate instructions that use the carry bit.

    The code is not optimized at all. Especially when dealing with
    loops of rotate instructions, this codegen should be improved some
    day.

Related bug: 41358 <https://bugs.llvm.org/show_bug.cgi?id=41358>

//Note//: This is my first submitted patch.

Reviewers: dylanmckay, Jim

Reviewed By: dylanmckay

Subscribers: hiraditya, llvm-commits, dylanmckay, dsprenkels

Tags: #llvm

Patched by dsprenkels (Daan Sprenkels)

Differential Revision: https://reviews.llvm.org/D60365
2019-12-23 11:41:28 +08:00
Kai Luo 9681dc9627 [PowerPC] Exploit `vrl(b|h|w|d)` to perform vector rotation
Summary:
Currently, we set legalization action of `ISD::ROTL` vectors as
`Expand` in `PPCISelLowering`. However, we can exploit `vrl(b|h|w|d)`
to lower `ISD::ROTL` directly.

Differential Revision: https://reviews.llvm.org/D71324
2019-12-23 03:04:43 +00:00
Reid Kleckner 5128026467 [AST] Add missing MultiplexConsumer::CompleteExternalDeclaration 2019-12-22 19:00:48 -08:00
Yonghong Song e3d8ee35e4 reland "[DebugInfo] Support to emit debugInfo for extern variables"
Commit d77ae1552f
("[DebugInfo] Support to emit debugInfo for extern variables")
added deebugInfo for extern variables for BPF target.
The commit is reverted by 891e25b02d
as the committed tests using %clang instead of %clang_cc1 causing
test failed in certain scenarios as reported by Reid Kleckner.

This patch fixed the tests by using %clang_cc1.

Differential Revision: https://reviews.llvm.org/D71818
2019-12-22 18:28:50 -08:00
Shengchen Kan fb53396c49 [NFC] Remove unnecessary blank and rename align-branch-64-5b.s to align-branch-64-6a.s 2019-12-23 10:22:02 +08:00
czhengsz 7259f04dde [SCEV] add testcase for get accurate range for addrecexpr with nuw flag 2019-12-22 20:58:19 -05:00
Fangrui Song 2539cd22e9 [ELF] Delete a redundant R_HINT check from isStaticLinkTimeConstant(). NFC
scanReloc() returns when it sees an R_HINT.
2019-12-22 16:58:22 -08:00
Jonas Devlieghere bd5c8d167b [lldb/ScriptInterpreter] Unify error message for command script import
Rather than checking for Python explicitly, let the script interpreter
handle things and print an error if the functionality is not supported.
2019-12-22 16:47:28 -08:00
Carl Ritson 2791667d2e [DAGCombiner] Check term use before applying aggressive FSUB optimisations
Summary:
Without this check unnecessary FMA instructions are generated when the FSUB terms are reused.
This also has the side-effect that the same value is computed to different levels of precision, which can create undesirable effects if the results are used together in subsequent computation.

Reviewers: arsenm, nhaehnle, foad, tpr, dstuttard, spatel

Reviewed By: arsenm

Subscribers: jvesely, wdng, hiraditya, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D71656
2019-12-23 09:37:58 +09:00
Saleem Abdulrasool 2046d72e91 build: improve python checks for Windows
Require a newer CMake on Windows to use the Python3 support that is
packaged in CMake. This version is able to check both 32-bit and 64-bit
versions and will setup everything properly without the user needing to
specify PYTHON_HOME. This enables building lldb's python bindings on
Windows under Azure's CI again.
2019-12-22 13:57:46 -08:00
Reid Kleckner 891e25b02d Revert "[DebugInfo] Support to emit debugInfo for extern variables"
This reverts commit d77ae1552f.

The tests committed along with this change do not pass, and should be
changed to use %clang_cc1.
2019-12-22 12:54:06 -08:00
Reid Kleckner 79cc9e9b30 Revert "[Concepts] Constrained partial specializations and function overloads."
This reverts commit d3f5769d5e.

Causes crashes on Chromium. Have reproducer, will reduce and send along.
2019-12-22 11:40:07 -08:00