Craig Topper [Mon, 23 Dec 2019 18:38:38 +0000 (10:38 -0800)]
[Sema][X86] Consider target attribute into the checks in validateOutputSize and validateInputSize.
The validateOutputSize and validateInputSize need to check whether
AVX or AVX512 are enabled. But this can be affected by the
target attribute so we need to factor that in.
This patch moves some of the code from CodeGen to create an
appropriate feature map that we can pass to the function.
Differential Revision: https://reviews.llvm.org/D68627
David Blaikie [Mon, 23 Dec 2019 19:08:26 +0000 (11:08 -0800)]
MC: Ensure test only reads from the Inputs directory
Reid Kleckner [Sun, 22 Dec 2019 21:25:24 +0000 (13:25 -0800)]
Fix LLVM tool --version build mode printing for MSVC
LLVM tools such as llc print "DEBUG build" or "Optimized build" when
passed --version. Before this change, this was implemented by checking
for the __OPTIMIZE__ GCC macro. MSVC does not define this macro. For
MSVC, control this behavior with _DEBUG instead. It doesn't have
precisely the same meaning, but in most configurations, it will do the
right thing.
Fixes PR17752
Reviewed by: MaskRay
Differential Revision: https://reviews.llvm.org/D71817
Jonas Devlieghere [Mon, 23 Dec 2019 17:48:37 +0000 (09:48 -0800)]
[lldb/Test] Disable TestSynchronous.test on Windows.
The test was being skipped on the Windwos bot because it requires Python
which was silently disabled because of a configuration issue. Now that
the test runs, this fails as expected.
Sylvestre Ledru [Mon, 23 Dec 2019 17:43:01 +0000 (18:43 +0100)]
Move from a long list of checkers to tables
Summary:
Currently, the list isn't very useful.
This change adds two tables.
* The checkers
* The aliases
For each checkers, we provide extract info:
* the severity. Taken from codechecker - https://github.com/Ericsson/codechecker/blob/master/config/checker_severity_map.json
* if the checker has an autofix or not
I used the cvs format for the table because:
* it is easy
* the data could be reused by other tools (we could move
that into a separated / generated file at some point)
Reviewers: alexfh, jdoerfert, jfb, lebedev.ri, Eugene.Zelenko
Subscribers: dexonsmith, wuzish, nemanjai, kbarton, arphaman, lebedev.ri, whisperity, Eugene.Zelenko, JonasToth, JDevlieghere, xazax.hun, cfe-commits, #clang-tools-extra
Tags: #clang
Differential Revision: https://reviews.llvm.org/D36051
Fangrui Song [Fri, 20 Dec 2019 00:04:45 +0000 (16:04 -0800)]
[ELF] Don't suggest an alternative spelling for a symbol in a discarded section
For undef-not-suggest.test, we currently make redundant alternative
spelling suggestions:
```
ld.lld: error: relocation refers to a discarded section: .text.foo
>>> defined in a.o
>>> section group signature: foo
>>> prevailing definition is in a.o
>>> referenced by a.o:(.rodata+0x0)
>>> did you mean:
>>> defined in: a.o
ld.lld: error: relocation refers to a symbol in a discarded section: foo
>>> defined in a.o
>>> section group signature: foo
>>> prevailing definition is in a.o
>>> referenced by a.o:(.rodata+0x8)
>>> did you mean: for
>>> defined in: a.o
```
Reviewed By: grimar, ruiu
Differential Revision: https://reviews.llvm.org/D71735
Jay Foad [Mon, 23 Dec 2019 13:42:12 +0000 (13:42 +0000)]
[AMDGPU] Don't create MachinePointerInfos with an UndefValue pointer
Summary:
The only useful information the UndefValue conveys is the address space,
which MachinePointerInfo can represent directly without referring to an
IR value.
Reviewers: arsenm, rampitec
Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, hiraditya, Petar.Avramovic, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71838
Luís Marques [Mon, 23 Dec 2019 15:32:52 +0000 (15:32 +0000)]
[RISCV][NFC] Fix use of missing attribute groups in tests
czhengsz [Mon, 23 Dec 2019 15:26:41 +0000 (10:26 -0500)]
[PowerPC] NFC - fix the testcase bug of folding rlwinm
Sanjay Patel [Mon, 23 Dec 2019 14:46:49 +0000 (09:46 -0500)]
[DAGCombine] visitEXTRACT_SUBVECTOR - 'little to big' extract_subvector(bitcast()) support
This moves the X86 specific transform from rL364407
into DAGCombiner to generically handle 'little to big' cases
(for example: extract_subvector(v2i64 bitcast(v16i8))). This
allows us to remove both the x86 implementation and the aarch64
bitcast(extract_subvector(bitcast())) combine.
Earlier patches that dealt with regressions initially exposed
by this patch:
rG5e5e99c041e4
rG0b38af89e2c0
Patch by: @RKSimon (Simon Pilgrim)
Differential Revision: https://reviews.llvm.org/D63815
Alexey Bataev [Thu, 19 Dec 2019 15:01:10 +0000 (10:01 -0500)]
[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
Pavel Labath [Mon, 23 Dec 2019 14:45:26 +0000 (15:45 +0100)]
[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.
LLVM GN Syncbot [Mon, 23 Dec 2019 13:55:08 +0000 (13:55 +0000)]
[gn build] Port
eca40066ebb
Pavel Labath [Mon, 23 Dec 2019 13:33:00 +0000 (14:33 +0100)]
[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).
Florian Hahn [Mon, 23 Dec 2019 13:28:56 +0000 (14:28 +0100)]
[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
Yaxun (Sam) Liu [Sun, 22 Dec 2019 05:34:14 +0000 (00:34 -0500)]
[NFC] Move OptionUtils from Basic to Driver
Differential Revision: https://reviews.llvm.org/D71802
Florian Hahn [Mon, 23 Dec 2019 12:39:36 +0000 (13:39 +0100)]
[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
Raphael Isemann [Mon, 23 Dec 2019 12:29:05 +0000 (13:29 +0100)]
[lldb][NFC] Remove unused callback functionality from ClangASTContext
Sven van Haastregt [Mon, 23 Dec 2019 12:29:01 +0000 (12:29 +0000)]
[OpenCL] Add atomic builtin functions
Add atomic builtin functions from the OpenCL C specification.
Patch by Pierre Gondois and Sven van Haastregt.
Raphael Isemann [Mon, 23 Dec 2019 12:08:22 +0000 (13:08 +0100)]
[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.
Kristof Beyls [Mon, 23 Dec 2019 12:01:47 +0000 (12:01 +0000)]
[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.
Raphael Isemann [Mon, 23 Dec 2019 11:18:49 +0000 (12:18 +0100)]
[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.
Raphael Isemann [Mon, 23 Dec 2019 11:03:43 +0000 (12:03 +0100)]
[lldb][NFC] Remove wrong and unused ClangASTContext::CopyDecl method
Raphael Isemann [Mon, 23 Dec 2019 10:49:25 +0000 (11:49 +0100)]
[lldb][NFC] Delete all 'else return ...' in CompilerDeclContext.cpp
Raphael Isemann [Mon, 23 Dec 2019 09:55:21 +0000 (10:55 +0100)]
[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.
Georgii Rymar [Fri, 20 Dec 2019 14:02:43 +0000 (17:02 +0300)]
[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
Georgii Rymar [Fri, 20 Dec 2019 12:51:10 +0000 (15:51 +0300)]
[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
Pavel Labath [Fri, 20 Dec 2019 15:34:55 +0000 (16:34 +0100)]
[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
Georgii Rymar [Fri, 20 Dec 2019 12:40:22 +0000 (15:40 +0300)]
[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
Martin Storsjö [Thu, 19 Dec 2019 12:00:44 +0000 (14:00 +0200)]
[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
6bf108d77a3c.
Differential Revision: https://reviews.llvm.org/D71721
Martin Storsjö [Thu, 19 Dec 2019 12:00:44 +0000 (14:00 +0200)]
[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
6bf108d77a3c.
Differential Revision: https://reviews.llvm.org/D71720
Martin Storsjö [Thu, 19 Dec 2019 11:57:47 +0000 (13:57 +0200)]
[ItaniumCXXABI] Don't mark an extern_weak init function as dso_local on windows
Since
6bf108d77a3c, 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
Georgii Rymar [Wed, 18 Dec 2019 14:49:37 +0000 (17:49 +0300)]
[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
Pavel Labath [Mon, 23 Dec 2019 10:06:50 +0000 (11:06 +0100)]
[lldb] Fix a -Wreturn-type gcc warning in ScriptInterpreter.cpp
Pavel Labath [Mon, 23 Dec 2019 10:05:32 +0000 (11:05 +0100)]
[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.
Raphael Isemann [Mon, 23 Dec 2019 09:05:42 +0000 (10:05 +0100)]
[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.
Raphael Isemann [Mon, 23 Dec 2019 09:38:12 +0000 (10:38 +0100)]
[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
Shengchen Kan [Mon, 23 Dec 2019 08:29:14 +0000 (16:29 +0800)]
[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.
Raphael Isemann [Mon, 23 Dec 2019 08:59:58 +0000 (09:59 +0100)]
[lldb][NFC] Document CompilerDeclContext constructors
Raphael Isemann [Mon, 23 Dec 2019 08:05:07 +0000 (09:05 +0100)]
[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).
QingShan Zhang [Mon, 23 Dec 2019 07:41:31 +0000 (07:41 +0000)]
[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
Simon Pilgrim [Mon, 23 Dec 2019 07:27:05 +0000 (07:27 +0000)]
Fix case style warnings in DIBuilder. NFC.
Dinar Temirbulatov [Mon, 23 Dec 2019 07:21:18 +0000 (08:21 +0100)]
[SLP] Replace NeedToGather variable with enum.
QingShan Zhang [Mon, 23 Dec 2019 06:59:14 +0000 (06:59 +0000)]
[NFC][Test][PowerPC] Add more tests for 'and mask'
Saar Raz [Mon, 23 Dec 2019 06:37:35 +0000 (08:37 +0200)]
[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
Jonas Devlieghere [Mon, 23 Dec 2019 05:35:05 +0000 (21:35 -0800)]
[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.
Saleem Abdulrasool [Mon, 23 Dec 2019 04:45:46 +0000 (20:45 -0800)]
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.
Jim Lin [Mon, 23 Dec 2019 03:24:20 +0000 (11:24 +0800)]
[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
Kai Luo [Mon, 23 Dec 2019 02:06:40 +0000 (02:06 +0000)]
[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
Reid Kleckner [Mon, 23 Dec 2019 03:00:48 +0000 (19:00 -0800)]
[AST] Add missing MultiplexConsumer::CompleteExternalDeclaration
Yonghong Song [Fri, 22 Nov 2019 16:45:37 +0000 (08:45 -0800)]
reland "[DebugInfo] Support to emit debugInfo for extern variables"
Commit
d77ae1552fc21a9f3877f3ed7e13d631f517c825
("[DebugInfo] Support to emit debugInfo for extern variables")
added deebugInfo for extern variables for BPF target.
The commit is reverted by
891e25b02d760d0de18c7d46947913b3166047e7
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
Shengchen Kan [Mon, 23 Dec 2019 02:22:02 +0000 (10:22 +0800)]
[NFC] Remove unnecessary blank and rename align-branch-64-5b.s to align-branch-64-6a.s
czhengsz [Mon, 23 Dec 2019 01:58:19 +0000 (20:58 -0500)]
[SCEV] add testcase for get accurate range for addrecexpr with nuw flag
Fangrui Song [Mon, 23 Dec 2019 00:55:38 +0000 (16:55 -0800)]
[ELF] Delete a redundant R_HINT check from isStaticLinkTimeConstant(). NFC
scanReloc() returns when it sees an R_HINT.
Jonas Devlieghere [Mon, 23 Dec 2019 00:46:01 +0000 (16:46 -0800)]
[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.
Carl Ritson [Fri, 20 Dec 2019 03:51:50 +0000 (12:51 +0900)]
[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
Saleem Abdulrasool [Sun, 22 Dec 2019 21:57:46 +0000 (13:57 -0800)]
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.
Reid Kleckner [Sun, 22 Dec 2019 20:54:06 +0000 (12:54 -0800)]
Revert "[DebugInfo] Support to emit debugInfo for extern variables"
This reverts commit
d77ae1552fc21a9f3877f3ed7e13d631f517c825.
The tests committed along with this change do not pass, and should be
changed to use %clang_cc1.
Reid Kleckner [Sun, 22 Dec 2019 19:37:54 +0000 (11:37 -0800)]
Revert "[Concepts] Constrained partial specializations and function overloads."
This reverts commit
d3f5769d5e93b30d4a8b4696381d5e4a304992fa.
Causes crashes on Chromium. Have reproducer, will reduce and send along.
Valentin Churavy [Sun, 22 Dec 2019 19:25:50 +0000 (14:25 -0500)]
[SelectionDAG] Copy FP flags when visiting a binary instruction.
Summary:
We noticed in Julia that the sequence below no longer turned into
a sequence of FMA instructions in LLVM 7+, but it did in LLVM 6.
```
%29 = fmul contract <4 x double> %wide.load, %wide.load16
%30 = fmul contract <4 x double> %wide.load13, %wide.load17
%31 = fmul contract <4 x double> %wide.load14, %wide.load18
%32 = fmul contract <4 x double> %wide.load15, %wide.load19
%33 = fadd fast <4 x double> %vec.phi, %29
%34 = fadd fast <4 x double> %vec.phi10, %30
%35 = fadd fast <4 x double> %vec.phi11, %31
%36 = fadd fast <4 x double> %vec.phi12, %32
```
Unlike Clang, Julia doesn't set the `unsafe-fp-math=true` function
attribute, but rather emits more local instruction flags.
This partially undoes https://reviews.llvm.org/D46854 and if required I can try to minimize the test further.
Reviewers: spatel, mcberg2017
Reviewed By: spatel
Subscribers: chriselrod, merge_guards_bot, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71495
Reid Kleckner [Sun, 22 Dec 2019 19:17:23 +0000 (11:17 -0800)]
Revert "[ARM][TypePromotion] Enable by default"
This reverts commit
ee7579409b7d940c4e1314d126e900db30c4edff.
It causes crashes during ThinLTO. I suspect the issue is related to
races on the global TypeSize variable, which is 80 at the time of the
crash.
Craig Topper [Sun, 22 Dec 2019 18:56:15 +0000 (10:56 -0800)]
[X86] Autogenerate complete checks. NFC
Craig Topper [Sun, 22 Dec 2019 18:51:55 +0000 (10:51 -0800)]
[X86] Fix typo of intrinsic name in test cases. NFC
These said test_f32_olt_s for the type of an overloaded intrinsic.
But the parser doesn't use that part of the name and just uses
the types of the arguments.
Mark de Wever [Sun, 22 Dec 2019 18:39:28 +0000 (19:39 +0100)]
[AMDGPU] Fixes -Wrange-loop-analysis warnings
This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall.
Differential Revision: https://reviews.llvm.org/D71815
Mark de Wever [Sun, 22 Dec 2019 18:35:02 +0000 (19:35 +0100)]
[Hexagon] Fixes -Wrange-loop-analysis warnings
This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall.
Differential Revision: https://reviews.llvm.org/D71814
Mark de Wever [Sun, 22 Dec 2019 18:27:44 +0000 (19:27 +0100)]
[NVPTX] Fixes -Wrange-loop-analysis warnings
This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall.
Also removed the top-level const as requested by Aaron Ballman in similar
patches.
Differential Revision: https://reviews.llvm.org/D71812
Mark de Wever [Sun, 22 Dec 2019 18:23:57 +0000 (19:23 +0100)]
[PowerPC] Fixes -Wrange-loop-analysis warnings
This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall.
Differential Revision: https://reviews.llvm.org/D71811
Mark de Wever [Sun, 22 Dec 2019 18:20:17 +0000 (19:20 +0100)]
[Transforms] Fixes -Wrange-loop-analysis warnings
This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall.
Differential Revision: https://reviews.llvm.org/D71810
Mark de Wever [Sun, 22 Dec 2019 18:13:34 +0000 (19:13 +0100)]
[Analyzer] Fixes -Wrange-loop-analysis warnings
This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall.
Differential Revision: https://reviews.llvm.org/D71809
Mark de Wever [Sun, 22 Dec 2019 18:11:17 +0000 (19:11 +0100)]
[Tools] Fixes -Wrange-loop-analysis warnings
This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall.
Differential Revision: https://reviews.llvm.org/D71808
Mark de Wever [Sun, 22 Dec 2019 17:58:32 +0000 (18:58 +0100)]
[TableGen] Fixes -Wrange-loop-analysis warnings
This avoids new warnings due to D68912 adds -Wrange-loop-analysis to -Wall.
Differential Revision: https://reviews.llvm.org/D71807
Philip Reames [Sun, 22 Dec 2019 16:59:35 +0000 (08:59 -0800)]
[Test] Add examples of problematic assembler auto-padding
This is in the context of the automatic padding work for the jcc erratum mitigation. These are example cases we need to *not* pad for correctness. Exact mechanism to suppress is still TBD, but saving the tests which have come up.
Sanjay Patel [Sun, 22 Dec 2019 15:05:28 +0000 (10:05 -0500)]
[InstCombine] enhance fold for copysign with known sign arg
This is another optimization suggested in PRPR44153:
https://bugs.llvm.org/show_bug.cgi?id=44153
Eric Astor [Sun, 22 Dec 2019 05:09:37 +0000 (00:09 -0500)]
[ms] [X86] Use "P" modifier on operands to call instructions in inline X86 assembly.
Summary:
This is documented as the appropriate template modifier for call operands.
Fixes PR44272, and adds a regression test.
Also adds support for operand modifiers in Intel-style inline assembly.
Reviewers: rnk
Reviewed By: rnk
Subscribers: merge_guards_bot, hiraditya, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D71677
Sanjay Patel [Sat, 21 Dec 2019 15:33:58 +0000 (10:33 -0500)]
[AArch64] match splat of bitcasted extract subvector to DUPLANE
This is another potential regression exposed by D63815.
Here we peek through a bitcast to find an extract subvector and
scale the splat offset based on that:
splat (bitcast (extract X, C)), LaneC --> duplane (bitcast X), LaneC'
Differential Revision: https://reviews.llvm.org/D71672
Raphael Isemann [Sun, 22 Dec 2019 13:00:26 +0000 (14:00 +0100)]
[lldb] Remove unused CompilerDeclContext::IsStructUnionOrClass
Bruno Ricci [Sun, 22 Dec 2019 12:41:14 +0000 (12:41 +0000)]
[Sema] SequenceChecker: C++17 sequencing rules for built-in operators <<, >>, .*, ->*, =, op=
Implement the C++17 sequencing rules for the built-in operators <<, >>, .*,
->*, = and op=.
Differential Revision: https://reviews.llvm.org/D58297
Reviewed By: rsmith
Bruno Ricci [Sun, 22 Dec 2019 12:27:31 +0000 (12:27 +0000)]
[Sema] SequenceChecker: Fix handling of operator ||, && and ?:
The current handling of the operators ||, && and ?: has a number of false
positive and false negative. The issues for operator || and && are:
1. We need to add sequencing regions for the LHS and RHS as is done for the
comma operator. Not doing so causes false positives in expressions like
`((a++, false) || (a++, false))` (from PR39779, see PR22197 for another
example).
2. In the current implementation when the evaluation of the LHS fails, the RHS
is added to a worklist to be processed later. This results in false negatives
in expressions like `(a && a++) + a`.
Fix these issues by introducing sequencing regions for the LHS and RHS, and by
not deferring the visitation of the RHS.
The issues with the ternary operator ?: are similar, with the added twist that
we should not warn on expressions like `(x ? y += 1 : y += 2)` since exactly
one of the 2nd and 3rd expression is going to be evaluated, but we should still
warn on expressions like `(x ? y += 1 : y += 2) = y`.
Differential Revision: https://reviews.llvm.org/D57747
Reviewed By: rsmith
Bruno Ricci [Sun, 22 Dec 2019 12:07:26 +0000 (12:07 +0000)]
[Sema] SequenceChecker: Add some comments + related small NFCs
NFCs factored out of the following patches:
- Change all of the `Expr *` to `const Expr *` in SequenceChecker for
const-correctness. SequenceChecker should not modify AST nodes.
- Add some comments.
- clang-format
Differential Revision: https://reviews.llvm.org/D57659
Reviewed By: xbolva00
Saar Raz [Sun, 22 Dec 2019 07:35:53 +0000 (09:35 +0200)]
[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 some crashes and warnings.
Differential Revision: https://reviews.llvm.org/D41910
Martin Storsjö [Sun, 22 Dec 2019 08:01:09 +0000 (10:01 +0200)]
[LLDB] Fix building without SWIG
Previously, SWIG was only a hard dependency if python bindings were
enabled.
Since
bf03e17c570171c7a52117fe63ace89d58f328d5, scripts/CMakeLists.txt
is included unconditionally, while that file adds the hard dependency
on SWIG.
Instead, only include that file if either python or lua bindings are
enabled.
Fangrui Song [Sun, 22 Dec 2019 07:18:24 +0000 (23:18 -0800)]
[Driver] Allow -mnop-mcount for SystemZ and -mfentry for X86 and SystemZ
gcc/config/{i386,s390} support -mnop-mcount. We currently only support
-mnop-mcount for SystemZ. The function attribute "mnop-mcount" is
ignored on other targets.
gcc/config/{i386,s390} support -mfentry. We currently only support
-mfentry for X86 and SystemZ. TargetOpcode::FENTRY_CALL is not handled
on other targets.
% clang -target aarch64 -pg -mfentry a.c -c
fatal error: error in backend: Not supported instr: <MCInst 21>
-mfentry, -mrecord-mcount, and -mnop-mcount were invented for Linux
ftrace. Linux uses $(call cc-option-yn,-mrecord-mcount) to detect if the
specific feature is available. Reject unsupported features so that Linux
build system will not wrongly consider them available and cause
build/runtime failures.
Note, GCC has stricter checks that we do not implement, e.g. -fpic/-fpie
-fnop-mcount is not allowed on x86, -fpic/-fpie -mfentry is not allowed
on x86-32.
David Blaikie [Sun, 22 Dec 2019 07:04:45 +0000 (23:04 -0800)]
DebugInfo: Remove out of date comment
Fangrui Song [Sun, 22 Dec 2019 06:22:59 +0000 (22:22 -0800)]
[Driver] Verify -mrecord-mcount in Driver, instead of CodeGen after D71627
GCC's x86 and s390 ports support -mrecord-mcount. Other ports reject the
option.
aarch64-linux-gnu-gcc: error: unrecognized command line option ‘-mrecord-mcount’
Allowing this option can cause failures when building Linux kernel for
aarch64, powerpc64, etc, which will think the feature is available if
the clang command returns 0.
Jonas Devlieghere [Sun, 22 Dec 2019 06:33:01 +0000 (22:33 -0800)]
[lldb/ScriptInterpreter] Fix stale/bogus error messages
Fix the nonsensical error messages for when breakpoint and watchpoint
callbacks are not supported.
Jonas Devlieghere [Sun, 22 Dec 2019 06:20:03 +0000 (22:20 -0800)]
[lldb/Commands] Honor the scripting language passed (2/2)
This ensures that watchpoint command honors the scripting language
passed with `-s`. Currently the argument ignores the actual language and
only uses it to differentiate between lldb and script commands.
Jonas Devlieghere [Sun, 22 Dec 2019 05:54:44 +0000 (21:54 -0800)]
[lldb/Lua] Add missing boiler plate to ScriptInterpreter.
- Fix enum entry order.
- Fix missing enum case in CommandObjectBreakpointCommand.
- Add Lua entry to swtich in LanguageToString and simplify the code.
LLVM GN Syncbot [Sun, 22 Dec 2019 02:15:02 +0000 (02:15 +0000)]
[gn build] Port
7376d9eb389
Nico Weber [Sun, 22 Dec 2019 02:14:26 +0000 (21:14 -0500)]
[gn build] fixup after
c3d13d9c56
Jonas Devlieghere [Sun, 22 Dec 2019 02:11:40 +0000 (18:11 -0800)]
[lldb/Commands] Use the default scripting langauge for BP functions
When a function is used as a breakpoint command, use to the debugger's
default scripting language, unless a language is explicitly specified.
Nico Weber [Sun, 22 Dec 2019 02:10:00 +0000 (21:10 -0500)]
[gn build] fold Basic:version into Basic
This now defines HAVE_VCS_VERSION_INC for all files in Basic,
but now the BUILD.gn file has only a single "sources" field again,
and the automerger requires that. Having the automerger work for
clang/lib/Basic is a very nice to have, and the downside seems tiny.
Yaxun (Sam) Liu [Fri, 6 Dec 2019 17:29:31 +0000 (12:29 -0500)]
[NFC] Separate getLastArgIntValue to Basic
getLastArgIntValue is a useful utility function to get command line argument as an integer.
Currently it is in Frontend so that it can only be used by clang -cc1. Move it to basic so
that it can also be used by clang driver.
Differential Revision: https://reviews.llvm.org/D71080
Jonas Devlieghere [Sun, 22 Dec 2019 01:28:36 +0000 (17:28 -0800)]
[lldb/Commands] Honor the scripting language passed
This ensures that breakpoint command honors the scripting language
passed with `-s`. Currently the argument ignores the actual language and
only uses it to differentiate between lldb and script commands.
Jonas Devlieghere [Sun, 22 Dec 2019 01:21:30 +0000 (17:21 -0800)]
[lldb/Commands] Fix bogus enum entry and add Lua (NFC)
Fixes a bogus enum value for the scripting language options, adds an
entry for Lua and refactored the code to use an exhaustive switch.
Jonas Devlieghere [Sun, 22 Dec 2019 01:11:12 +0000 (17:11 -0800)]
[lldb/Core] Support asking the debugger for a specific script interpreter
Rather than holding on to one script interpreter, it should be possible
to request a script interpreter for a specific scripting language. The
GetScriptInterpreter method now takes an optional scripting language
argument.
(NFC)
Jonas Devlieghere [Sat, 21 Dec 2019 22:58:50 +0000 (14:58 -0800)]
[Lldb/Lua] Persist Lua state across script interpreter calls.
Don't create a new lua state on every operation. Share a single state
across the lifetime of the script interpreter. Add simple locking to
prevent two threads from modifying the state concurrently.
Raphael Isemann [Sat, 21 Dec 2019 22:27:27 +0000 (23:27 +0100)]
[lldb] Fix windows build after getASTContext() change
Raphael Isemann [Sat, 21 Dec 2019 21:40:52 +0000 (22:40 +0100)]
[lldb][NFC] Return a reference from ClangASTContext::getASTContext and remove dead nullptr checks
ClangASTContext::getASTContext() currently returns a ptr but we have an assert there since a
while that the ASTContext is not a nullptr. This causes that we still have a lot of code
that is doing nullptr checks on the result of getASTContext() which is all unreachable code.
This patch changes the return value to a reference to make it clear this can't be a nullptr
and deletes all the nullptr checks.
Jonas Devlieghere [Sun, 8 Dec 2019 23:32:57 +0000 (15:32 -0800)]
[Lldb/Lua] Generate Lua Bindings
This patch uses SWIG to generate the Lua bindings for the SB API. It
covers most of the API, but some methods require a type map similar to
Python.
Discussion on the mailing list:
http://lists.llvm.org/pipermail/lldb-dev/2019-December/015812.html
Differential revision: https://reviews.llvm.org/D71235
Artem Dergachev [Sat, 21 Dec 2019 18:57:03 +0000 (10:57 -0800)]
[analyzer] exploded-graph-rewriter: Fix string encodings in python3.
Makes sure that the script works fine both in python2 and python3.
Patch by Pavel Samolysov!
Differential Revision: https://reviews.llvm.org/D71746