David Blaikie [Wed, 4 Dec 2019 15:48:30 +0000 (07:48 -0800)]
Add some missing includes to MicrosoftDemangle.cpp (PR44217)
gbreynoo [Wed, 4 Dec 2019 16:17:42 +0000 (16:17 +0000)]
[llvm-ar][test] Add to thin archive test coverage
This diff adds test coverage for thin archives including additions to
existing tests. In some cases I have updated the formats of these tests
to better match other tests in the archive.
Differential Revision: https://reviews.llvm.org/D70969
Pavel Labath [Wed, 4 Dec 2019 14:54:59 +0000 (15:54 +0100)]
[lldb] Simplify debug_{rnglists,ranges}.s tests
Remove things irrelevant to the test.
stozer [Wed, 4 Dec 2019 09:44:02 +0000 (09:44 +0000)]
[DebugInfo] Recover debug intrinsics when killing duplicated/empty basic blocks
When basic blocks are killed, either due to being empty or to being an if.then
or if.else block whose complement contains identical instructions, some of the
debug intrinsics in that block are lost. This patch sinks those intrinsics
into the single successor block, setting them Undef if necessary to
prevent debug info from falling out-of-date.
Differential Revision: https://reviews.llvm.org/D70318
Kadir Cetinkaya [Wed, 4 Dec 2019 15:34:56 +0000 (16:34 +0100)]
Reapply "[llvm][Support] Take in CurrentDirectory as a parameter in ExpandResponseFiles"
Attemps to fix windows buildbots.
Peter Smith [Fri, 29 Nov 2019 19:12:49 +0000 (19:12 +0000)]
[ELF] Support for PT_GNU_PROPERTY in header and tools
The PT_GNU_PROPERTY is generated by a linker to describe the
.note.gnu.property section. The Linux kernel uses this program header to
locate the .note.gnu.property section.
It is described in "The Linux gABI extension"
Include support for llvm-readelf, llvm-readobj and the yaml reader and
writers.
Differential Revision: https://reviews.llvm.org/D70959
Amaury Séchet [Wed, 4 Dec 2019 15:05:30 +0000 (16:05 +0100)]
Automaticaly generate copysign-constant-magnitude.ll . NFC
Kadir Cetinkaya [Wed, 4 Dec 2019 14:50:27 +0000 (15:50 +0100)]
Revert "[llvm][Support] Take in CurrentDirectory as a parameter in ExpandResponseFiles"
This reverts commit
75656005dbc8866e1888932a68a830b0df403560.
Joseph Tremoulet [Fri, 22 Nov 2019 17:59:46 +0000 (12:59 -0500)]
Change Target::FindBreakpointsByName to return Expected<vector>
Summary:
Using a BreakpointList corrupts the breakpoints' IDs because
BreakpointList::Add sets the ID, so use a vector instead, and
update the signature to return the vector wrapped in an
llvm::Expected which can propagate any error from the inner
call to StringIsBreakpointName.
Note that, despite the similar name, SBTarget::FindBreakpointsByName
doesn't suffer the same problem, because it uses a SBBreakpointList,
which is more like a BreakpointIDList than a BreakpointList under the
covers.
Add a check to TestBreakpointNames that, without this fix, notices the
ID getting mutated and fails.
Reviewers: jingham, JDevlieghere
Reviewed By: JDevlieghere
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D70907
Kadir Cetinkaya [Wed, 4 Dec 2019 14:48:21 +0000 (15:48 +0100)]
[clang-change-namespace] Change file pattern to be an anchored regex
Michael Liao [Mon, 2 Dec 2019 18:13:52 +0000 (13:13 -0500)]
[opencl] Fix address space deduction on array variables.
Summary:
- The deduced address space needs applying to its element type as well.
Reviewers: Anastasia
Subscribers: yaxunl, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D70981
Mark Murray [Mon, 2 Dec 2019 15:22:24 +0000 (15:22 +0000)]
[ARM][MVE][Intrinsics] Add VMULH/VRMULH intrinsics.
Summary: Add MVE VMULH/VRMULH intrinsics and unit tests.
Reviewers: simon_tatham, ostannard, dmgreen
Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D70948
LLVM GN Syncbot [Wed, 4 Dec 2019 14:21:10 +0000 (14:21 +0000)]
gn build: Merge
45ef055d4ff
Kadir Cetinkaya [Fri, 29 Nov 2019 14:37:14 +0000 (15:37 +0100)]
[llvm][Support] Take in CurrentDirectory as a parameter in ExpandResponseFiles
Summary:
This is a follow-up to D70769 and D70222, which allows propagation of
current directory down to ExpandResponseFiles for handling of relative paths.
Previously clients had to mutate FS to achieve that, which is not thread-safe
and can even be thread-hostile in the case of real file system.
Reviewers: sammccall
Subscribers: hiraditya, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D70857
Kadir Cetinkaya [Fri, 29 Nov 2019 11:14:25 +0000 (12:14 +0100)]
[clang][Tooling] Add support for .rsp files in compile_commands.json
Summary:
Add support for .rsp files.
Fixes https://github.com/clangd/clangd/issues/81
Patch By: liu hui(@lh123)
Reviewers: sammccall, ilya-biryukov, hokein, kadircet
Reviewed By: kadircet
Subscribers: merge_guards_bot, mgorny, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang-tools-extra, #clang
Differential Revision: https://reviews.llvm.org/D70222
Kadir Cetinkaya [Fri, 29 Nov 2019 11:14:24 +0000 (12:14 +0100)]
[Support] add vfs support for ExpandResponseFiles
Summary: add vfs support for `ExpandResponseFiles`.
Patch By: liu hui(@lh123)
Reviewers: kadircet, espindola, alexshap, rupprecht, jhenderson
Reviewed By: kadircet
Subscribers: mgorny, sammccall, merge_guards_bot, emaste, sbc100, arichardson, hiraditya, aheejin, jakehehrlich, MaskRay, rupprecht, seiya, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D70769
ptaylor [Wed, 4 Dec 2019 13:58:23 +0000 (14:58 +0100)]
[clangd] register cuda language activation event and activate for .cuh files
Patch by Paul Taylor!
Reviewers: hokein
Reviewed By: hokein
Subscribers: jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D70041
Raphael Isemann [Wed, 4 Dec 2019 13:36:14 +0000 (14:36 +0100)]
[lldb] Fix macOS build by replacing nullptr with FileSpec()
Before we had a implicit conversion from nullptr to FileSpec
which was thankfully removed.
Roman Lebedev [Wed, 4 Dec 2019 12:48:19 +0000 (15:48 +0300)]
[NFC][InstCombine] Update sub-of-negatible.ll test
Anastasia Stulova [Tue, 3 Dec 2019 17:24:33 +0000 (17:24 +0000)]
[OpenCL] Allow addr space qualifiers on lambda call expressions
The addr space qualifier can be added optionally for lambdas after
the attributes. They will alter the default addr space of lambda
call operator that is in generic address space by default for OpenCL.
Syntax:
[ captures ] ( params ) specifiers exception attr opencl_addrspace
-> ret { body }
Example:
[&] (int i) mutable __global { ... };
On the call into lambda a compatibility check will be performed to
determine whether address space of lambda object and its call operator
are compatible. This will follow regular addr space conversion rules
and there will be no difference to how addr spaces work in method
qualifiers.
Tags: #clang
Differential Revision: https://reviews.llvm.org/D70242
Hans Wennborg [Mon, 2 Dec 2019 15:25:23 +0000 (16:25 +0100)]
Actually delay processing DelayedDllExportClasses until the outermost class is finished (PR40006)
This was already the intention of DelayedDllExportClasses, but code such as
this would break it:
template<typename> struct Tmpl {};
struct Outer {
struct Inner {
__declspec(dllexport) Inner() = default;
unsigned int x = 0;
};
Tmpl<Inner> y;
};
ActOnFinishCXXNonNestedClass() would get called when the instantiation of
Templ<Inner> is finished, even though the compiler is still not finished with
Outer, causing the compile fail.
This hooks into Sema::{Push,Pop}ParsingClass() to avoid calling
ActOnFinishCXXNonNestedClass() for template instantiations while a class is
being parsed.
Differential revision: https://reviews.llvm.org/D70905
Cullen Rhodes [Wed, 4 Dec 2019 11:36:30 +0000 (11:36 +0000)]
[AArch64][SVE] Implement reversal intrinsics
Summary:
Adds intrinsics for the following:
* rbit
* revb
* revh
* revw
Patterns are also defined to map the 'llvm.bswap.*' intrinsic to the SVE
revb instruction.
Reviewers: sdesmalen, huntergr, dancgr, rengolin, efriedma, rovka
Reviewed By: sdesmalen
Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70960
Jay Foad [Wed, 4 Dec 2019 11:40:09 +0000 (11:40 +0000)]
[AMDGPU][MC] Remove duplicate code introduced in r359316.
Haojian Wu [Wed, 4 Dec 2019 11:29:53 +0000 (12:29 +0100)]
[clangd] Remove the hanging lit exit-signal.test.
The test was introduced in
https://github.com/llvm/llvm-project/commit/
19ac0eaf07e60173baa7ee77fa11568c30b87455.
The test keeps hanging after running "check-clangd", remove it now
and will add it back later after investigations.
Florian Hahn [Wed, 4 Dec 2019 11:24:10 +0000 (11:24 +0000)]
[SimpleLoopUnswitch] Invalidate the topmost loop with ExitBB as exiting.
SCEV caches the exiting blocks when computing exit counts. In
SimpleLoopUnswitch, we split the exit block of the loop to unswitch.
Currently we only invalidate the loop containing that exit block, but if
that block is the exiting block for a parent loop, we have stale cache
entries. We have to invalidate the top-most loop that contains the exit
block as exiting block. We might also be able to skip invalidating the
loop containing the exit block, if the exit block is not an exiting
block of that loop.
There are also 2 more places in SimpleLoopUnswitch, that use a similar
problematic approach to get the loop to invalidate. If the patch makes
sense, I will also update those places to a similar approach (they deal
with multiple exit blocks, so we cannot directly re-use
getTopMostExitingLoop).
Fixes PR43972.
Reviewers: skatkov, reames, asbirlea, chandlerc
Reviewed By: asbirlea
Differential Revision: https://reviews.llvm.org/D70786
Alex Richardson [Wed, 4 Dec 2019 10:06:24 +0000 (10:06 +0000)]
Allow negative offsets in MipsMCInstLower::LowerOperand
Summary:
We rely on this in our CHERI backend to address the GOT by generating a
$pc-relative addresses. For this we emit the following code sequence:
lui $1, %pcrel_hi(_CHERI_CAPABILITY_TABLE_-8)
daddiu $1, $1, %pcrel_lo(_CHERI_CAPABILITY_TABLE_-4)
cgetpccincoffset $c1, $1
However, without this change the addend is implicitly converted to
UINT32_MAX and an invalid pointer value is generated.
Reviewers: atanasyan
Reviewed By: atanasyan
Subscribers: merge_guards_bot, sdardis, hiraditya, jrtc27, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70953
Alex Richardson [Wed, 4 Dec 2019 10:06:12 +0000 (10:06 +0000)]
Handle BUNDLE instructions in MipsAsmPrinter
Summary:
In our CHERI fork we use BUNDLE instructions to ensure that a
three-instruction sequence to generate a program-counter-relative value is
emitted without reordering or insertions (since that would break the 32-bit
offset computation).
Currently MipsAsmPrinter asserts when it encounters a pseudo instruction.
To handle BUNDLE we can simply skip the instruction which will then make
EmitInstruction() process the contents of the bundle in order.
Reviewers: atanasyan
Reviewed By: atanasyan
Subscribers: merge_guards_bot, sdardis, hiraditya, jrtc27, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70945
Alex Richardson [Wed, 4 Dec 2019 10:06:02 +0000 (10:06 +0000)]
MipsDelaySlotFiller: Don't move BUNDLE instructions into the delay slot
Summary:
In our CHERI fork we use BUNDLE instructions to ensure that a
three-instruction sequence to generate a program-counter-relative value is
emitted without reordering or insertions (since that would break the 32-bit
offset computation). This sequence is created in MipsExpandPseudo and we use
finalizeBundle() to create the BUNDLE instruction.
However, the delay slot filler currently breaks this pattern since the BUNDLE
will be removed and so all instructions are moved into the delay slot.
Since the delay slot only executes the first instruction, this results in
incorrect computations (and run-time crashes) if the branch is taken.
The original test cases uses CHERI instructions, so for the test case here
I simple filled a BUNDLE with a no-op DADDiu $sp_64, -16 and DADDiu $sp_64, 16.
Reviewers: atanasyan
Reviewed By: atanasyan
Subscribers: merge_guards_bot, sdardis, hiraditya, jrtc27, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70944
Alex Richardson [Wed, 4 Dec 2019 10:05:02 +0000 (10:05 +0000)]
Add debug output to MipsDelaySlotFiller pass
Summary:
I was tracking down a code-generation bug in this pass and found that the
added output was useful. It is also helpful to find out why a delay slot
could not be filled even though there is clearly a valid instruction (which
appears to mostly be caused by CFI instructions).
Reviewers: atanasyan
Reviewed By: atanasyan
Subscribers: merge_guards_bot, sdardis, hiraditya, jrtc27, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70940
Kadir Cetinkaya [Wed, 4 Dec 2019 11:19:08 +0000 (12:19 +0100)]
[clangd] Add no delayed templates to outline tests
Florian Hahn [Wed, 4 Dec 2019 10:49:24 +0000 (10:49 +0000)]
[AArch64TTI] Compute imm materialization cost for AArch64 intrinsics
Currently, getIntImmCost returns TCC_Free for almost all intrinsics.
For most AArch64 specific intrinsics however, it looks like integer
constants cannot be folded into most of them (at least the ones I checked).
Unless we know that we can fold integer operands with the intrinsic, we
handle more cases correctly by returning the cost to materialize the
immediate than return TCC_Free.
Reviewers: SjoerdMeijer, dmgreen, t.p.northover, ributzka
Reviewed By: SjoerdMeijer
Differential Revision: https://reviews.llvm.org/D70669
Cullen Rhodes [Wed, 4 Dec 2019 09:55:26 +0000 (09:55 +0000)]
[NFC] Use default case in EVT::getEVTString
Summary:
The default case handles the majority of MVTs so most of the individual
cases can be removed. Also added a case for floating point types.
Reviewed By: sdesmalen
Differential Revision: https://reviews.llvm.org/D70955
David Stuttard [Mon, 2 Dec 2019 13:01:26 +0000 (13:01 +0000)]
AMDGPU: Avoid folding 2 constant operands into an SALU operation
Summary:
Catch the (admittedly unusual) case where SIFoldOperands attempts to fold 2
constant operands into the same SALU operation, with neither operand able to be
encoded as an inline constant.
Change-Id: Ibc48d662c9ffd8bbacd154976b0b1c257ace0927
Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, tpr, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70896
Georgii Rymar [Tue, 3 Dec 2019 12:48:29 +0000 (15:48 +0300)]
[yaml2obj] - Make DynamicSymbols to be Optional<> too.
We already have Symbols property to list regular symbols and
it is currently Optional<>. This patch makes DynamicSymbols to be optional
too. With this there is no need to define a dummy symbol anymore to trigger
creation of the .dynsym and it is now possible to define an empty .dynsym using
just the following line:
DynamicSymbols: []
(it is important to have when you do not want to have dynamic symbols,
but want to have a .dynsym)
Now the code is consistent and it helped to fix a bug: previously we
did not report an error when both Content/Size and an empty
Symbols/DynamicSymbols list were specified.
Differential revision: https://reviews.llvm.org/D70956
Pavel Labath [Tue, 26 Nov 2019 13:45:15 +0000 (14:45 +0100)]
[lldb] Remove some (almost) unused Stream::operator<<'s
llvm::raw_ostream provides equivalent functionality.
Ehud Katz [Wed, 4 Dec 2019 09:57:38 +0000 (11:57 +0200)]
[APFloat] Prevent construction of APFloat with Semantics and FP value
Constructor invocations such as `APFloat(APFloat::IEEEdouble(), 0.0)`
may seem like they accept a FP (floating point) value, but the overload
they reach is actually the `integerPart` one, not a `float` or `double`
overload (which only exists when `fltSemantics` isn't passed).
This may lead to possible loss of data, by the conversion from `float`
or `double` to `integerPart`.
To prevent future mistakes, a new constructor overload, which accepts
any FP value and marked with `delete`, to prevent its usage.
Fixes PR34095.
Differential Revision: https://reviews.llvm.org/D70425
Pavel Labath [Thu, 28 Nov 2019 08:14:44 +0000 (09:14 +0100)]
[lldb] s/assertTrue/assertEqual in TestStepTarget.py
this improves error messages.
Pavel Labath [Thu, 28 Nov 2019 16:02:07 +0000 (17:02 +0100)]
[lldb] Remove FileSpec(FileSpec*) constructor
This constructor was the cause of some pretty weird behavior. Remove it,
and update all code to properly dereference the argument instead.
Raphael Isemann [Wed, 4 Dec 2019 09:27:18 +0000 (10:27 +0100)]
[lldb] Add test for Stream::Address and Stream::AddressRange
I'm refactoring those functions, so we should have some tests for
them before doing that.
Pavel Labath [Wed, 4 Dec 2019 09:44:12 +0000 (10:44 +0100)]
[lldb/Editline] Fix a -Wreturn-type warning with gcc
Pavel Labath [Fri, 29 Nov 2019 10:31:00 +0000 (11:31 +0100)]
[lldb] s/FileSpec::Equal/FileSpec::Match
Summary:
The FileSpec class is often used as a sort of a pattern -- one specifies
a bare file name to search, and we check if in matches the full file
name of an existing module (for example).
These comparisons used FileSpec::Equal, which had some support for it
(via the full=false argument), but it was not a good fit for this job.
For one, it did a symmetric comparison, which makes sense for a function
called "equal", but not for typical searches (when searching for
"/foo/bar.so", we don't want to find a module whose name is just
"bar.so"). This resulted in patterns like:
if (FileSpec::Equal(pattern, file, pattern.GetDirectory()))
which would request a "full" match only if the pattern really contained
a directory. This worked, but the intended behavior was very unobvious.
On top of that, a lot of the code wanted to handle the case of an
"empty" pattern, and treat it as matching everything. This resulted in
conditions like:
if (pattern && !FileSpec::Equal(pattern, file, pattern.GetDirectory())
which are nearly impossible to decipher.
This patch introduces a FileSpec::Match function, which does exactly
what most of FileSpec::Equal callers want, an asymmetric match between a
"pattern" FileSpec and a an actual FileSpec. Empty paterns match
everything, filename-only patterns match only the filename component.
I've tried to update all callers of FileSpec::Equal to use a simpler
interface. Those that hardcoded full=true have been changed to use
operator==. Those passing full=pattern.GetDirectory() have been changed
to use FileSpec::Match.
There was also a handful of places which hardcoded full=false. I've
changed these to use FileSpec::Match too. This is a slight change in
semantics, but it does not look like that was ever intended, and it was
more likely a result of a misunderstanding of the "proper" way to use
FileSpec::Equal.
[In an ideal world a "FileSpec" and a "FileSpec pattern" would be two
different types, but given how widespread FileSpec is, it is unlikely
we'll get there in one go. This at least provides a good starting point
by centralizing all matching behavior.]
Reviewers: teemperor, JDevlieghere, jdoerfert
Subscribers: emaste, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D70851
Pavel Labath [Fri, 22 Nov 2019 09:53:09 +0000 (10:53 +0100)]
[DWARFDebugLoclists] Add support for other DW_LLE encodings
Summary:
lldb's loclists parser has support for DW_LLE_start_end(x) encodings. To
avoid regressing when switching the implementation to llvm's, I add
parsing support for all previously unsupported location list encodings.
Reviewers: dblaikie, JDevlieghere, aprantl, SouraVX
Subscribers: hiraditya, probinson, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70949
Pavel Labath [Tue, 26 Nov 2019 09:40:30 +0000 (10:40 +0100)]
[DWARFDebugRnglists] Add a callback-based version of the getAbsoluteRanges function
Summary:
The dump() function already accepts a callback. This makes
getAbsoluteRanges do the same. The existing DWARFUnit overload is
implemented on top of the new function.
This enables usage of the debug_rnglists parser from within lldb (which
has it's own dwarf parser).
Reviewers: dblaikie, JDevlieghere, aprantl
Subscribers: hiraditya, probinson, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70952
Ulrich Weigand [Wed, 4 Dec 2019 09:27:02 +0000 (10:27 +0100)]
[SelectionDAG] Expand nnan FMINNUM/FMAXNUM to select sequence
InstCombine may synthesize FMINNUM/FMAXNUM nodes from fcmp+select
sequences (where the fcmp is marked nnan). Currently, if the
target does not otherwise handle these nodes, they'll get expanded
to libcalls to fmin/fmax. However, these functions may reside in
libm, which may introduce a library dependency that was not originally
present in the source code, potentially resulting in link failures.
To fix this problem, add code to TargetLowering::expandFMINNUM_FMAXNUM
to expand FMINNUM/FMAXNUM to a compare+select sequence instead of the
libcall. This is done only if the node is marked as "nnan"; in this case,
the expansion to compare+select is always correct. This also suffices to
catch all cases where FMINNUM/FMAXNUM was synthesized as above.
Differential Revision: https://reviews.llvm.org/D70965
Raphael Isemann [Wed, 4 Dec 2019 08:38:49 +0000 (09:38 +0100)]
[lldb][NFC] Extract single member parsing out of DWARFASTParserClang::ParseChildMembers
ParseChildMembers does a few things, only one part is actually parsing a single
member. This extracts the member parsing logic into its own function.
This commit just moves the code as-is into its own function and forwards the parameters/
local variables to it, which means it should be NFC.
The only actual changes to the code are replacing 'break's (and one very curious 'continue'
that behaves like a 'break') with 'return's.
Georgii Rymar [Tue, 3 Dec 2019 13:11:10 +0000 (16:11 +0300)]
[yaml2obj][test] - Remove excessive symtab-shinfo.yaml.
The same testing is performed in `implicit-sections-info.yaml`:
https://github.com/llvm-mirror/llvm/blob/master/test/tools/yaml2obj/implicit-sections-info.yaml
Differential revision: https://reviews.llvm.org/D70957
Raphael Isemann [Wed, 4 Dec 2019 08:20:42 +0000 (09:20 +0100)]
[lldb][NFC] Migrate to raw_ostream in Module::GetDescription
Akira Hatanaka [Fri, 29 Nov 2019 17:56:02 +0000 (09:56 -0800)]
[CodeGen][ObjC] Emit a primitive store to store a __strong field in
ExpandTypeFromArgs
This fixes a bug in IRGen where a call to `llvm.objc.storeStrong` was
being emitted to initialize a __strong field of an uninitialized
temporary struct, which caused crashes at runtime.
rdar://problem/
51807365
LLVM GN Syncbot [Wed, 4 Dec 2019 07:32:05 +0000 (07:32 +0000)]
gn build: Merge
9f251eece46
Martin Storsjö [Wed, 4 Dec 2019 07:22:08 +0000 (09:22 +0200)]
Revert "Enable `-funwind-tables` flag when building libunwind"
This reverts commit
b3fdf33ba6aa7ef80621696f74aaf2f6f8e1d1de.
This change broke building libunwind for Windows/MinGW, and broke
on aspect of the CMake tests in libunwind in general.
After set(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY), CMake
skips the linking step in tests, but cmake/config-ix.cmake also
does a few checks for functions in libraries (looking for whether
-lc provides fopen and whether -ldl provides dladdr).
As CMake only tests building a static library, these tests
incorrectly succeed and CMake concludes "Looking for fopen in c -
found" and "Looking for dladdr in dl - found", while building
then fails at the end with errors about unable to find -lc and -ldl.
Raphael Isemann [Wed, 4 Dec 2019 07:27:43 +0000 (08:27 +0100)]
[lldb][NFC] Migrate to raw_ostream in ArchSpec::DumpTriple
Reviewers: labath, davide
Reviewed By: davide
Subscribers: clayborg, JDevlieghere, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D70979
Kadir Cetinkaya [Fri, 22 Nov 2019 12:56:02 +0000 (13:56 +0100)]
[clangd] Define out-of-line qualify function name
Summary:
When moving function definitions to a different context, the function
name might need a different spelling, for example in the header it might be:
```
namespace a {
void foo() {}
}
```
And we might want to move it into a context which doesn't have `namespace a` as
a parent, then we must re-spell the function name, i.e:
```
void a::foo() {}
```
This patch implements a version of this which ignores using namespace
declarations in the source file.
Reviewers: hokein
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D70656
Kadir Cetinkaya [Tue, 22 Oct 2019 15:02:29 +0000 (17:02 +0200)]
[clangd] Define out-of-line qualify return value
Summary:
Return type might need qualification if insertion context doesn't have
the same decls visible as the source context.
This patch adds qualification for return value to cover such cases.
Reviewers: hokein
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D70535
Kadir Cetinkaya [Mon, 21 Oct 2019 16:16:40 +0000 (18:16 +0200)]
[clangd] Define out-of-line initial apply logic
Summary:
Initial implementation for apply logic, replaces function body with a
semicolon in source location and copies the full function definition into target
location.
Will handle qualification of return type and function name in following patches
to keep the changes small.
Reviewers: hokein
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D69298
Kadir Cetinkaya [Mon, 21 Oct 2019 16:03:38 +0000 (18:03 +0200)]
[clangd] Define out-of-line availability checks
Summary:
Initial availability checks for performing define out-of-line code
action, which is a refactoring that will help users move function/method
definitions from headers to implementation files.
Proposed implementation only checks whether we have an interesting selection,
namely function name or full function definition/body.
Reviewers: hokein
Subscribers: mgorny, ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D69266
Fangrui Song [Wed, 4 Dec 2019 03:54:11 +0000 (19:54 -0800)]
[llvm-strip][MachO] Test llvm-strip --strip-debug
Reviewed By: smeenai
Differential Revision: https://reviews.llvm.org/D70995
QingShan Zhang [Wed, 4 Dec 2019 04:58:34 +0000 (04:58 +0000)]
[MacroFusion] Limit the max fused number as 2 to reduce the dependency
This is the example:
int foo(int a, int b, int c, int d) {
return a + b + c + d;
}
And this is the Dependency Graph:
+------+ +------+ +------+ +------+
| A | | B | | C | | D |
+--+--++ +---+--+ +--+---+ +--+---+
^ ^ ^ ^ ^ ^
| | | | | |
| | | |New1 +--------------+
| | | | |
| | | | +--+---+
| |New2 | +-------+ ADD1 |
| | | +--+---+
| | | Fuse ^
| | +-------------+
| +------------+
| |
| Fuse +--+---+
+----------->+ ADD2 |
| +------+
+--+---+
| ADD3 |
+------+
We need also create an artificial edge from ADD1 to A if
https://reviews.llvm.org/D69998 is landed. That will force the Node A scheduled
before the ADD1 and ADD2. But in fact, it is ok to schedule the Node A
in-between ADD3 and ADD2, as ADD3 and ADD2 are NOT a fusion pair because
ADD2 has been matched to ADD1. We are creating these unnecessary dependency
edges that override the heuristics.
Differential Revision: https://reviews.llvm.org/D70066
czhengsz [Wed, 4 Dec 2019 02:48:12 +0000 (21:48 -0500)]
[PowerPC] folding rlwinm + rlwinm to rlwinm
For example:
x3 = rlwinm x3, 27, 5, 31
x3 = rlwinm x3, 19, 0, 12
can be combined to
x3 = rlwinm x3, 14, 0, 12
Reviewed by: steven.zhang, lkail
Differential Revision: https://reviews.llvm.org/D70374
Petr Hosek [Sat, 7 Sep 2019 01:59:43 +0000 (18:59 -0700)]
[Clang] Define Fuchsia C++ABI
Currently, it is a modified version of the Itanium ABI, with the only
change being that constructors and destructors return 'this'.
Differential Revision: https://reviews.llvm.org/D70575
Michael Liao [Wed, 4 Dec 2019 02:15:17 +0000 (21:15 -0500)]
Fix warning on unused variable. NFC.
Jonas Devlieghere [Wed, 4 Dec 2019 01:06:05 +0000 (17:06 -0800)]
[dsymutil] Support --out (NFC)
Seems like this got lost during the libOption conversion.
Davide Italiano [Wed, 4 Dec 2019 00:54:04 +0000 (16:54 -0800)]
[Process] GetLanguageRuntimes() takes an argument that's always constant.
And arguably `retry_if_null` isn't really descriptive of what
the flag did anyway.
Fangrui Song [Wed, 4 Dec 2019 00:39:48 +0000 (16:39 -0800)]
[Diagnostic][test] Remove an unneeded change to pragma_diagnostic_sections.cpp after D70638
Nico Weber [Wed, 4 Dec 2019 00:22:40 +0000 (19:22 -0500)]
gn build: (manually) merge
ad871e42958
Davide Italiano [Wed, 4 Dec 2019 00:31:44 +0000 (16:31 -0800)]
[ClangASTContext] Remove a very old hack.
This was fixed in clang a while ago, and the rdar associated
is now closed.
Wang, Pengfei [Tue, 3 Dec 2019 03:10:22 +0000 (11:10 +0800)]
[X86] Model DAZ and FTZ
Summary: This is a follow-up of D70881. It models DAZ and FTZ for releated instructions.
Reviewers: craig.topper, RKSimon, andrew.w.kaylor
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70938
Wang, Pengfei [Wed, 27 Nov 2019 13:13:35 +0000 (21:13 +0800)]
[X86] Model MXCSR for all AVX512 instructions
Summary: Model MXCSR for all AVX512 instructions
Reviewers: craig.topper, RKSimon, andrew.w.kaylor
Subscribers: hiraditya, llvm-commits, LuoYuanke, LiuChen3
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70881
Kit Barton [Fri, 29 Nov 2019 17:05:43 +0000 (12:05 -0500)]
Add discussion of git-format-patch to Phabricator.html
Summary: There is a discussion of git-format-patch in GettingStarted guide, but no mention of it in the Phabricator.html page.
Reviewers: jyknight, delcypher
Reviewed By: delcypher
Subscribers: llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D69323
Davide Italiano [Tue, 3 Dec 2019 23:06:04 +0000 (15:06 -0800)]
[TypeCategory] HasLanguage() is now unused.
Daniel Sanders [Tue, 3 Dec 2019 23:22:30 +0000 (15:22 -0800)]
Fix `sed -e s@FOO@%/S@` and similar when there's @'s in the working directory
Jenkins sometimes starts a new working directory by appending @2 (or
incrementing the number if the @n suffix is already there). This causes
several clang tests to fail as:
s@INPUT_DIR@%/S/Inputs@g
gets expanded to the invalid:
s@INPUT_DIR@/path/to/workdir@2/Inputs@g
~~~~~~~~~~
where the part marked with ~'s is interpreted as the flags. These are
invalid and the test fails.
Previous fixes simply exchanged the @ character for another like | but
that's just moving the problem. Address it by adding an expansion that
escapes the @ character we're using as a delimiter as well as other magic
characters in the replacement of sed's s@@@.
There's still room for expansions to cause trouble though. One I ran into
while testing this was that having a directory called foo@bar causes lots
of `CHECK-NOT: foo` directives to match. There's also things like
directories containing `\1`
Elizabeth Andrews [Tue, 3 Dec 2019 22:20:52 +0000 (14:20 -0800)]
Reapply "Fix crash on switch conditions of non-integer types in templates"
This patch reapplies commit
759948467ea. Patch was reverted due to a
clang-tidy test fail on Windows. The test has been modified. There
are no additional code changes.
Patch was tested with ninja check-all on Windows and Linux.
Summary of code changes:
Clang currently crashes for switch statements inside a template when the
condition is a non-integer field member because contextual implicit
conversion is skipped when parsing the condition. This conversion is
however later checked in an assert when the case statement is handled.
The conversion is skipped when parsing the condition because
the field member is set as type-dependent based on its containing class.
This patch sets the type dependency based on the field's type instead.
This patch fixes Bug 40982.
Akira Hatanaka [Tue, 3 Dec 2019 23:17:01 +0000 (15:17 -0800)]
[NFC] Pass a reference to CodeGenFunction to methods of LValue and
AggValueSlot
This reapplies
8a5b7c35709d9ce1f44a99f0c5b084bf2696ea17 after a null
dereference bug in CGOpenMPRuntime::emitUserDefinedMapper.
Original commit message:
This is needed for the pointer authentication work we plan to do in the
near future.
https://github.com/apple/llvm-project/blob/
a63a81bd9911f87a0b5dcd5bdd7ccdda7124af87/clang/docs/PointerAuthentication.rst
Davide Italiano [Tue, 3 Dec 2019 23:02:54 +0000 (15:02 -0800)]
[FormatManager] Provide only one variant of EnableCategory.
All the callers pass a single language anyway.
Davide Italiano [Tue, 3 Dec 2019 22:54:59 +0000 (14:54 -0800)]
[DataVisualization] Simplify. NFCI.
Reid Kleckner [Mon, 2 Dec 2019 23:22:44 +0000 (15:22 -0800)]
[MS] Emit exported complete/vbase destructors
Summary:
Fixes PR44205
I checked, and deleting destructors are not affected.
Reviewers: hans
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D70931
Alex Lorenz [Tue, 3 Dec 2019 22:34:02 +0000 (14:34 -0800)]
[compiler-rt] Disable fuzzer large.test when LLVM_ENABLE_EXPENSIVE_CHECKS=ON
This test is timing out on Green Dragon http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-expensive/
and looks like it's not executed on other bots with expensive checks
enabled
http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-ubuntu
http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win
The test times out at the C++ source file takes too long to build (2+ hours on my machine), as
clang spends a lot of time in IR/MIR verifiers.
Differential Revision: https://reviews.llvm.org/D70024
Craig Topper [Tue, 3 Dec 2019 22:05:04 +0000 (14:05 -0800)]
[FPEnv] [PowerPC] Lowering ppc_fp128 StrictFP Nodes to libcalls
This is an alternative to D64662 that shares more code between
strict and non-strict nodes. It's modeled after the implementation
that I did for softening.
Differential Revision: https://reviews.llvm.org/D70867
James Clarke [Tue, 3 Dec 2019 22:04:24 +0000 (22:04 +0000)]
[RISCV] Don't force Local Exec TLS for non-PIC
Summary:
Forcing Local Exec TLS requires the use of copy relocations. Copy
relocations need special handling in the runtime linker when being used
against TLS symbols, which is present in glibc, but not in FreeBSD nor
musl, and so cannot be relied upon. Moreover, copy relocations are a
hack that embed the size of an object in the ABI when it otherwise
wouldn't be, and break protected symbols (which are expected to be DSO
local), whilst also wasting space, thus they should be avoided whenever
possible. As discussed in D70398, RISC-V should move away from forcing
Local Exec, and instead use Initial Exec like other targets, with
possible linker relaxation to follow. The RISC-V GCC maintainers also
intend to adopt this more-conventional behaviour (see
https://github.com/riscv/riscv-elf-psabi-doc/issues/122).
Reviewers: asb, MaskRay
Reviewed By: MaskRay
Subscribers: emaste, krytarowski, hiraditya, rbar, johnrusso, simoncook, sabuasal, niosHD, kito-cheng, shiva0217, zzheng, edward-jones, rogfer01, MartinMosbeck, brucehoult, the_o, rkruppe, PkmX, jocewei, psnobl, benna, Jim, lenary, s.egerton, pzheng, sameer.abuasal, apazos, llvm-commits, bsdjhb
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70649
Craig Topper [Tue, 3 Dec 2019 21:48:39 +0000 (13:48 -0800)]
[InstCombine] Revert
aafde063aaf09285c701c80cd4b543c2beb523e8 and
6749dc3446671df05235d0a218c426a314ac33cd related to bitcast handling of x86_mmx
This reverts these two commits
[InstCombine] Turn (extractelement <1 x i64/double> (bitcast (x86_mmx))) into a single bitcast from x86_mmx to i64/double.
[InstCombine] Don't transform bitcasts between x86_mmx and v1i64 into insertelement/extractelement
We're seeing at least one internal test failure related to a
bitcast that was previously before an inline assembly block
containing emms being placed after it. This leads to the mmx
state ending up not empty after the emms. IR has no way to
make any specific guarantees about this. Reverting these patches
to get back to previous behavior which at least worked for this
test.
Davide Italiano [Tue, 3 Dec 2019 21:36:50 +0000 (13:36 -0800)]
[TypeCategory] Nothing passes down a list of languages.
Summary: This should allow further simplifications, but it's a first step.
Reviewers: teemperor, jingham, friss
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D70983
Sergej Jaskiewicz [Tue, 5 Nov 2019 11:47:24 +0000 (14:47 +0300)]
Enable `-funwind-tables` flag when building libunwind
Summary:
Or, rather, don't accidentally forget to pass it.
This is aimed to solve the problem discussed in [this thread](http://lists.llvm.org/pipermail/llvm-dev/2019-November/136890.html), and to fix [a year-old bug](https://bugs.llvm.org/show_bug.cgi?id=38468).
TL;DR: when building libunwind for ARM Linux, we **need** libunwind to be built with the `-funwind-tables` flag, because, well ARM EHABI needs unwind info produced by this flag. Without the flag all the procedures in libunwind are marked `.cantunwind`, which causes all sorts of bad things. From `_Unwind_Backtrace` not working, to C++ exceptions not being caught (which is the aforementioned bug is about).
Previously, this flag was not added because the CMake check `add_compile_flags_if_supported(-funwind-tables)` produced a false negative. Why? With this flag, the compiler generates calls to the `__aeabi_unwind_cpp_pr0` symbol, which is defined in libunwind itself and obviously is not available at configure time, before libunwind is built. This led to failure at link time during the CMake check. We handle this by disabling the linker for CMake checks in linbunwind.
Also, this patch introduces a lit feature `libunwind-arm-ehabi`, which is used to mark the `signal_frame.pass.cpp` test as unsupported (as was advised by @miyuki in D70397).
Reviewers: peter.smith, phosek, EricWF, compnerd, jroelofs, saugustine, miyuki, jfb
Subscribers: mgorny, kristof.beyls, christof, libcxx-commits, miyuki
Tags: #libc
Differential Revision: https://reviews.llvm.org/D70815
Fangrui Song [Tue, 26 Nov 2019 18:40:52 +0000 (10:40 -0800)]
[UpdateTestChecks] Change shebang from python to python3
'python' means Python 2 on some platforms while Python 3 on others.
'python3' is Python 3 only. Python 2.7 End of Life is set to January 1,
2020. Getting rid of Python 2 support reduces maintenance burden.
Reviewed By: lebedev.ri
Differential Revision: https://reviews.llvm.org/D70730
Sam McCall [Tue, 3 Dec 2019 21:13:45 +0000 (22:13 +0100)]
Akira Hatanaka [Tue, 3 Dec 2019 21:07:22 +0000 (13:07 -0800)]
Revert "[NFC] Pass a reference to CodeGenFunction to methods of LValue and"
This reverts commit
8a5b7c35709d9ce1f44a99f0c5b084bf2696ea17. This seems
to have broken UBSan because of a null dereference.
Michael Liao [Tue, 3 Dec 2019 21:02:55 +0000 (16:02 -0500)]
Fix warning on extra ';'. NFC.
Vedant Kumar [Thu, 21 Nov 2019 22:17:04 +0000 (14:17 -0800)]
[Coverage] Emit a gap region to cover switch bodies
Emit a gap region beginning where the switch body begins. This sets line
execution counts in the areas between non-overlapping cases to 0.
This also removes some special handling of the first case in a switch:
these are now treated like any other case.
This does not resolve an outstanding issue with case statement regions
that do not end when a region is terminated. But it should address
llvm.org/PR44011.
Differential Revision: https://reviews.llvm.org/D70571
Aaron Ballman [Tue, 3 Dec 2019 20:31:46 +0000 (15:31 -0500)]
Switch to opening the temp file in binary mode
This corrects an issue where the script would write the file with the
incorrect line endings on Windows.
Tyker [Tue, 3 Dec 2019 19:05:29 +0000 (20:05 +0100)]
[Diagnostic] add a warning which warns about misleading indentation
Summary: Add a warning for misleading indentation similar to GCC's -Wmisleading-indentation
Reviewers: aaron.ballman, xbolva00
Reviewed By: aaron.ballman, xbolva00
Subscribers: tstellar, cfe-commits, arphaman, Ka-Ka, thakis
Tags: #clang
Differential Revision: https://reviews.llvm.org/D70638
Tyker [Tue, 3 Dec 2019 19:05:28 +0000 (20:05 +0100)]
[NFCI] update formating for misleading indentation warning
Reviewers: xbolva00
Reviewed By: xbolva00
Differential Revision: https://reviews.llvm.org/D70861
Michael Liao [Tue, 3 Dec 2019 20:14:41 +0000 (15:14 -0500)]
Remove unused variable. NFC.
David Blaikie [Tue, 3 Dec 2019 19:36:12 +0000 (11:36 -0800)]
Fix signed mismatch warnings in MetadataTests.cpp
Alexander Kornienko [Tue, 3 Dec 2019 15:27:57 +0000 (16:27 +0100)]
Revert "Fix llvm-namespace-comment for macro expansions"
This reverts commit
4736d63f752f8d13f4c6a9afd558565c32119718.
This commit introduces a ton of false positives and incorrect fixes. See https://reviews.llvm.org/D69855#1767089 for details.
Akira Hatanaka [Tue, 3 Dec 2019 19:24:46 +0000 (11:24 -0800)]
[NFC] Pass a reference to CodeGenFunction to methods of LValue and
AggValueSlot
This is needed for the pointer authentication work we plan to do in the
near future.
https://github.com/apple/llvm-project/blob/
a63a81bd9911f87a0b5dcd5bdd7ccdda7124af87/clang/docs/PointerAuthentication.rst
Joel E. Denny [Tue, 3 Dec 2019 15:13:00 +0000 (10:13 -0500)]
[FileCheck] Given multiple -dump-input, prefer most verbose
Problem: `FILECHECK_OPTS` was implemented so that a test runner, such
as a bot, can specify FileCheck debugging options, such as
`-dump-input=fail`. However, some existing test suites have FileCheck
calls that already specify `-dump-input=fail` or `-dump-input=always`.
Without this patch, such tests fail under such a test runner because
FileCheck doesn't accept multiple occurrences of `-dump-input`.
Solution: This patch permits multiple occurrences of `-dump-input` by
assigning precedence to its values in the following descending order:
`help`, `always`, `fail`, and `never`. That is, any occurrence of
`help` always obtains help, and otherwise the behavior is similar to
`-v` vs. `-vv` in that the option specifying the greatest verbosity
has precedence.
Rationale: My justification for the new behavior is as follows. I
have not experienced use cases where, either as a test runner or as a
test author, I want to **limit** the permitted debugging verbosity
(except as a test author in FileCheck's or lit's test suites where the
FileCheck debugging output itself is under test, but the solution
there is `env FILECHECK_OPTS=`, and I imagine we should use the same
solution anywhere else this need might occur). Of course, as either a
test runner or test author, it is useful to **increase** debugging
verbosity.
Reviewed By: probinson
Differential Revision: https://reviews.llvm.org/D70784
Aditya Nandakumar [Tue, 3 Dec 2019 18:40:03 +0000 (10:40 -0800)]
[GlobalISel]: Allow targets to override how to widen constants during legalization
https://reviews.llvm.org/D70922
This adds a hook to allow targets to define exactly what extension
operation should be performed for widening constants. This handles cases
like widening i1 true which would end up becoming -1 which affects code
quality during combines.
Additionally, in order to stay consistent with how DAG is promoting
constants, we now signextend for byte sized types and zero extend
otherwise (by default). Targets can of course override this if
necessary.
Roman Lebedev [Tue, 3 Dec 2019 18:17:51 +0000 (21:17 +0300)]
[APInt][PatternMatch] Add 'is non-positive' predicate
It will be useful for implementing the fold mentioned in
https://bugs.llvm.org/show_bug.cgi?id=44100#c4
Aaron Ballman [Tue, 3 Dec 2019 18:21:35 +0000 (13:21 -0500)]
Correcting the offsets within the test to fix the bots.
Aaron Ballman [Tue, 3 Dec 2019 18:04:45 +0000 (13:04 -0500)]
Differentiate between the presumed and actual file when dumping the AST to JSON
Currently, when dumping the AST to JSON, the presumed file is what is included
when dumping a source location. This patch changes the behavior to instead dump
the actual file, and only dump a presumed file name when it differs from the
actual file.
This also corrects an issue with the test script generator that would prevent
it from working on Windows due to file permissions issues.
Ayal Zaks [Tue, 26 Nov 2019 22:08:29 +0000 (00:08 +0200)]
[LV] Scalar with predication must not be uniform
Fix PR40816: avoid considering scalar-with-predication instructions as also
uniform-after-vectorization.
Instructions identified as "scalar with predication" will be "vectorized" using
a replicating region. If such instructions are also optimized as "uniform after
vectorization", namely when only the first of VF lanes is used, such a
replicating region becomes erroneous - only the first instance of the region can
and should be formed. Fix such cases by not considering such instructions as
"uniform after vectorization".
Differential Revision: https://reviews.llvm.org/D70298
Dan Liew [Tue, 3 Dec 2019 17:48:07 +0000 (09:48 -0800)]
Rename `tsan/race_range_pc.cc` to `test/tsan/race_range_pc.cpp`.
The old suffix was preventing it from being executed by default.