Daniel Kiss [Wed, 1 Jul 2020 09:15:52 +0000 (11:15 +0200)]
[Driver][ARM] parse version of arm/thumb architecture correctly
Summary:
If you execute the following commandline multiple times, the behavior was not always the same:
clang++ --target=thumbv7em-none-windows-eabi-coff -march=armv7-m -mcpu=cortex-m7 -o temp.obj -c -x c++ empty.cpp
Most of the time the compilation succeeded, but sometimes clang reported this error:
clang++: error: the target architecture 'thumbv7em' is not supported by the target 'thumbv7em-none-windows-eabi'
The cause of the inconsistent behavior was the uninitialized variable Version.
With these commandline arguments, the variable Version was not set by getAsInteger(),
because it cannot parse a number from the substring "7em" (of "thumbv7em").
To get a consistent behaviour, it's enough to initialize the variable Version to zero.
Zero is smaller than 7, so the comparison will be true.
Then the command always fails with the error message seen above.
By using consumeInteger() instead of getAsInteger() we get 7 from the substring "7em"
and the command does not fail.
Reviewers: compnerd, danielkiss
Reviewed By: danielkiss
Subscribers: danielkiss, kristof.beyls, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D75453
Vitaly Buka [Wed, 1 Jul 2020 07:38:43 +0000 (00:38 -0700)]
[StackSafety,NFC] Remove expensive assert
Differential Revision: https://reviews.llvm.org/D80908
Vitaly Buka [Wed, 1 Jul 2020 07:32:36 +0000 (00:32 -0700)]
[StackSafety,NFC] Remove unneded constexpr
Differential Revision: https://reviews.llvm.org/D80908
Petar Avramovic [Wed, 1 Jul 2020 09:50:59 +0000 (11:50 +0200)]
AMDGPU/GlobalISel: Select init_exec intrinsic
Change imm with timm in pattern for SI_INIT_EXEC_LO and
remove regbank mappings for non register operands.
Differential Revision: https://reviews.llvm.org/D82885
Kerry McLaughlin [Wed, 1 Jul 2020 09:00:35 +0000 (10:00 +0100)]
[AArch64][SVE] Add reg+imm addressing mode for unpredicated loads
Reviewers: efriedma, sdesmalen, david-arm
Reviewed By: efriedma
Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, danielkiss, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82893
Sam McCall [Wed, 1 Jul 2020 09:28:15 +0000 (11:28 +0200)]
[clangd] Fix name conflict again, unbreak GCC. NFC
Georgii Rymar [Tue, 30 Jun 2020 14:14:45 +0000 (17:14 +0300)]
[llvm-readobj] - Don't crash when checking the number of dynamic symbols.
When we deriving the number of symbols from the DT_HASH table, we can crash when
calculate the number of symbols in the symbol table when SHT_DYNSYM
has sh_entsize == 0.
The patch fixes the issue.
Differential revision: https://reviews.llvm.org/D82877
Georgii Rymar [Tue, 30 Jun 2020 12:47:05 +0000 (15:47 +0300)]
[llvm-readobj] - Simplify and refine hash table tests
Now we are able to have default values for macros in YAML descriptions.
I've applied it for hash table tests and also fixed few copy-paste issues
in their comments.
Differential revision: https://reviews.llvm.org/D82870
David Stenberg [Wed, 1 Jul 2020 07:45:56 +0000 (09:45 +0200)]
[DebugInfo] Do not emit entry values for composite locations
Summary:
This is a fix for PR45009.
When working on D67492 I made DwarfExpression emit a single
DW_OP_entry_value operation covering the whole composite location
description that is produced if a register does not have a valid DWARF
number, and is instead composed of multiple register pieces. Looking
closer at the standard, this appears to not be valid DWARF. A
DW_OP_entry_value operation's block can only be a DWARF expression or a
register location description, so it appears to not be valid for it to
hold a composite location description like that.
See DWARFv5 sec. 2.5.1.7:
"The DW_OP_entry_value operation pushes the value that the described
location held upon entering the current subprogram. It has two
operands: an unsigned LEB128 length, followed by a block containing a
DWARF expression or a register location description (see Section
2.6.1.1.3 on page 39)."
Here is a dwarf-discuss mail thread regarding this:
http://lists.dwarfstd.org/pipermail/dwarf-discuss-dwarfstd.org/2020-March/004610.html
There was not a strong consensus reached there, but people seem to lean
towards that operations specified under 2.6 (e.g. DW_OP_piece) may not
be part of a DWARF expression, and thus the DW_OP_entry_value operation
can't contain those.
Perhaps we instead want to emit a entry value operation per each
DW_OP_reg* operation, e.g.:
- DW_OP_entry_value(DW_OP_regx sub_reg0),
DW_OP_stack_value,
DW_OP_piece 8,
- DW_OP_entry_value(DW_OP_regx sub_reg1),
DW_OP_stack_value,
DW_OP_piece 8,
[...]
The question then becomes how the call site should look; should a
composite location description be emitted there, and we then leave it up
to the debugger to match those two composite location descriptions?
Another alternative could be to emit a call site parameter entry for
each sub-register, but firstly I'm unsure if that is even valid DWARF,
and secondly it seems like that would complicate the collection of call
site values quite a bit. As far as I can tell GCC does not emit any
entry values / call sites in these cases, so we do not have something to
compare with, but the former seems like the more reasonable approach.
Currently when trying to emit a call site entry for a parameter composed
of multiple DWARF registers a (DwarfRegs.size() == 1) assert is
triggered in addMachineRegExpression(). Until the call site
representation is figured out, and until there is use for these entry
values in practice, this commit simply stops the invalid DWARF from
being emitted.
Reviewers: djtodoro, vsk, aprantl
Reviewed By: djtodoro, vsk
Subscribers: jyknight, hiraditya, fedor.sergeev, jrtc27, llvm-commits
Tags: #debug-info, #llvm
Differential Revision: https://reviews.llvm.org/D75270
Guillaume Chatelet [Wed, 1 Jul 2020 08:49:28 +0000 (08:49 +0000)]
[Alignment][NFC] Migrate MachineFrameInfo::CreateSpillStackObject to Align
iThis patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790
Differential Revision: https://reviews.llvm.org/D82934
Pavel Labath [Wed, 1 Jul 2020 08:18:02 +0000 (10:18 +0200)]
[lldb] Scalar re-fix UB in float->int conversions
The refactor in
48ca15592f1 reintroduced UB when converting out-of-bounds
floating point numbers to integers -- the behavior for ULongLong() was
originally fixed in r341685, but did not survive my refactor because I
based my template code on one of the methods which did not have this
fix.
This time, I apply the fix to all float->int conversions, instead of
just the "double->unsigned long long" case. I also use a slightly
simpler version of the code, with fewer round-trips
(APFloat->APSInt->native_int vs
APFloat->native_float->APInt->native_int).
I also add some unit tests for the conversions.
Sam Parker [Wed, 1 Jul 2020 08:20:25 +0000 (09:20 +0100)]
[NFC][ARM] Add test.
Tony [Wed, 1 Jul 2020 08:17:28 +0000 (08:17 +0000)]
[AMDGPU] Correct AMDGPUUsage.rst DW_AT_LLVM_lane_pc example
- Correct typo of DW_OP_xaddr to DW_OP_addrx in AMDGPUUsage.rst for
DW_AT_LLVM_lane_pc example.
Change-Id: I1b0ee2b24362a0240388e4c2f044c1d4883509b9
Paul Walker [Wed, 1 Jul 2020 08:12:46 +0000 (08:12 +0000)]
[SVE] Relax merge requirement for IR based divides.
We currently lower SDIV to SDIV_MERGE_OP1. This forces the value
for inactive lanes in a way that can hamper register allocation,
however, the lowering has no requirement for inactive lanes.
Instead this patch replaces SDIV_MERGE_OP1 with SDIV_PRED thus
freeing the register allocator. Once done the only user of
SDIV_MERGE_OP1 is intrinsic lowering so I've removed the node
and perform ISel on the intrinsic directly. This also allows
us to implement MOVPRFX based zeroing in the same manner as SUB.
This patch also renames UDIV_MERGE_OP1 and [F]ADD_MERGE_OP1 for
the same reason but in the ADD cases the ISel code is already
as required.
Differential Revision: https://reviews.llvm.org/D82783
LLVM GN Syncbot [Wed, 1 Jul 2020 08:09:43 +0000 (08:09 +0000)]
[gn build] Port
f12cd99c440
Endre Fülöp [Thu, 25 Jun 2020 15:10:56 +0000 (17:10 +0200)]
[analyzer][CrossTU] Lower CTUImportThreshold default value
Summary:
The default value of 100 makes the analysis slow. Projects of considerable
size can take more time to finish than it is practical. The new default
setting of 8 is based on the analysis of LLVM itself. With the old default
value of 100 the analysis time was over a magnitude slower. Thresholding the
load of ASTUnits is to be extended in the future with a more fine-tuneable
solution that accomodates to the specifics of the project analyzed.
Reviewers: martong, balazske, Szelethus
Subscribers: whisperity, xazax.hun, baloghadamsoftware, szepet, rnkovacs, a.sidorin, mikhail.ramalho, Szelethus, donat.nagy, dkrupp, Charusso, steakhal, ASDenysPetrov, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D82561
Sam McCall [Thu, 25 Jun 2020 23:49:53 +0000 (01:49 +0200)]
[clangd] Config: compile Fragment -> CompiledFragment -> Config
Subscribers: mgorny, ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D82612
Hans Wennborg [Tue, 30 Jun 2020 10:48:10 +0000 (12:48 +0200)]
[ThinLTO] Always parse module level inline asm with At&t dialect (PR46503)
clang-cl passes -x86-asm-syntax=intel to the cc1 invocation so that
assembly listings produced by the /FA flag are printed in Intel dialect.
That flag however should not affect the *parsing* of inline assembly in
the program. (See r322652)
When compiling normally, AsmPrinter::emitInlineAsm is used for
assembling and defaults to At&t dialect. However, when compiling for
ThinLTO, the code which parses module level inline asm to find symbols
for the symbol table was failing to set the dialect. This patch fixes
that. (See the bug for more details.)
Differential revision: https://reviews.llvm.org/D82862
Saiyedul Islam [Wed, 1 Jul 2020 07:28:47 +0000 (07:28 +0000)]
[AMDGPU] Spill more than wavesize CSR SGPRs
In case of more than wavesize CSR SGPR spills, lanes of reserved VGPR were getting
overwritten due to wrap around.
Reserve a VGPR (when NumVGPRSpillLanes = 0, WaveSize, 2*WaveSize, ..) and when one
of the two conditions is true:
1. One reserved VGPR being tracked by VGPRReservedForSGPRSpill is not yet reserved.
2. All spill lanes of reserved VGPR(s) are full and another spill lane is required.
Reviewed By: arsenm, kerbowa
Differential Revision: https://reviews.llvm.org/D82463
Sam Parker [Wed, 1 Jul 2020 07:27:12 +0000 (08:27 +0100)]
[ARM][LowOverheadLoops] Handle reductions
While validating live-out values, record instructions that look like
a reduction. This will comprise of a vector op (for now only vadd),
a vorr (vmov) which store the previous value of vadd and then a vpsel
in the exit block which is predicated upon a vctp. This vctp will
combine the last two iterations using the vmov and vadd into a vector
which can then be consumed by a vaddv.
Once we have determined that it's safe to perform tail-predication,
we need to change this sequence of instructions so that the
predication doesn't produce incorrect code. This involves changing
the register allocation of the vadd so it updates itself and the
predication on the final iteration will not update the falsely
predicated lanes. This mimics what the vmov, vctp and vpsel do and
so we then don't need any of those instructions.
Differential Revision: https://reviews.llvm.org/D75533
serge-sans-paille [Mon, 29 Jun 2020 08:58:08 +0000 (10:58 +0200)]
Correctly track GCOVProfiling IR update
Differential Revision: https://reviews.llvm.org/D82742
Guillaume Chatelet [Wed, 1 Jul 2020 07:28:11 +0000 (07:28 +0000)]
[Alignment][NFC] Migrate MachineFrameInfo::CreateStackObject to Align
This patch is part of a series to introduce an Alignment type.
See this thread for context: http://lists.llvm.org/pipermail/llvm-dev/2019-July/133851.html
See this patch for the introduction of the type: https://reviews.llvm.org/D64790
Differential Revision: https://reviews.llvm.org/D82894
Balázs Kéri [Tue, 30 Jun 2020 07:41:48 +0000 (09:41 +0200)]
[clang][CrossTU] Invalidate parent map after get cross TU definition.
Summary:
Parent map of ASTContext is built once. If this happens and later
the TU is modified by getCrossTUDefinition the parent map does not
contain the newly imported objects and has to be re-created.
Invalidation of the parent map is added to the CrossTranslationUnitContext.
It could be added to ASTImporter as well but for now this task remains the
responsibility of the user of ASTImporter. Reason for this is mostly that
ASTImporter calls itself recursively.
Reviewers: gamesh411, martong
Reviewed By: gamesh411
Subscribers: rnkovacs, dkrupp, Szelethus, gamesh411, martong, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D82568
LLVM GN Syncbot [Wed, 1 Jul 2020 07:02:27 +0000 (07:02 +0000)]
[gn build] Port
4da65c2920b
Adam Balogh [Tue, 16 Jun 2020 18:00:47 +0000 (20:00 +0200)]
[Analyzer] Handle pointer implemented as iterators in iterator checkers
Iterators are an abstraction of pointers and in some data structures
iterators may be implemented by pointers. This patch adds support for
iterators implemented as pointers in all the iterator checkers
(including iterator modeling).
Differential Revision: https://reviews.llvm.org/D82185
Adam Balogh [Tue, 23 Jun 2020 12:09:48 +0000 (14:09 +0200)]
[Analyzer] Fix errors in iterator modeling
There is major a bug found in iterator modeling: upon adding a value
to or subtracting a value from an iterator the position of the original
iterator is also changed beside the result. This patch fixes this bug.
To catch such bugs in the future we also changed the tests to look for
regular expressions including an end-of-line symbol (`$`) so we can
prevent false matches where only the tested prefix matches.
Another minor bug is that when printing the state, all the iterator
positions are printed in a single line. This patch also fixes this.
Differential Revision: https://reviews.llvm.org/D82385
Adam Balogh [Mon, 8 Jun 2020 10:41:36 +0000 (12:41 +0200)]
[clang-tidy] New util `Aliasing` factored out from `bugprone-infinite-loop`
Function `hasPtrOrReferenceInfFunc()` of `bugprone-infinite-loop` is a
generic function which could be reused in another checks. This patch
moves this function into a newly created utility module.
Differential Revision: https://reviews.llvm.org/D81396
Adam Balogh [Thu, 25 Jun 2020 14:41:23 +0000 (16:41 +0200)]
[Sema][NFC] Remove Redundant Condition
Condition `TypeQuals` is checked both in an outer and in an inner `if`
statement in static function `ConvertDeclSpecToType()` in file
`SemaType.cpp`. This patch removes the redundant inner check.
The issue was found using `clang-tidy` check under review
`misc-redundant-condition`. See https://reviews.llvm.org/D81272.
Differential Revision: https://reviews.llvm.org/D82563
Adam Balogh [Thu, 25 Jun 2020 14:20:29 +0000 (16:20 +0200)]
[LLDB][Clang Integration][NFC] Remove redundant condition
Condition `omit_empty_base_classes` is checked both in an outer and
in an inner `if` statement in `TypeSystemClang::GetNumBaseClasses()`.
This patch removes the redundant inner check.
The issue was found using `clang-tidy` check under review
`misc-redundant-condition`. See https://reviews.llvm.org/D81272.
Differential Revision: https://reviews.llvm.org/D82559
Adam Balogh [Thu, 25 Jun 2020 14:23:35 +0000 (16:23 +0200)]
[LLDB][NFC] Remove redundant condition
Condition `auto_advance_pc` is checked both in an outer and in an
inner `if` statement in `EmulateInstructionARM::EvaluateInstruction()`,
`EmulateInstructionARM64::EvaluateInstruction()` and
`EmulateInstructionPPC64::EvaluateInstruction()`. This patch removes the
redundant inner check.
The issue was found using `clang-tidy` check under review
`misc-redundant-condition`. See https://reviews.llvm.org/D81272.
Differential Revision: https://reviews.llvm.org/D82558
Adam Balogh [Thu, 25 Jun 2020 13:48:10 +0000 (15:48 +0200)]
[Hexagon][NFC] Remove redundant condition
Condition `secondReg` is checked both in an outer and in an inner `if`
statement in static function `canCompareBeNewValueJump()` in file
`HexagonNewValueJump.cpp`. This patch removes the redundant inner check.
The issue was found using `clang-tidy` check under review
`misc-redundant-condition`. See https://reviews.llvm.org/D81272.
Differential Revision: https://reviews.llvm.org/D82556
Adam Balogh [Thu, 25 Jun 2020 13:41:36 +0000 (15:41 +0200)]
[AMDGPU][NFC] Remove redundant condition
Condition `LiteralCount` is checked both in an outer and in an inner
`if` statement in `SIInstrInfo::verifyInstruction()`. This patch removes
the redundant inner check.
The issue was found using `clang-tidy` check under review
`misc-redundant-condition`. See https://reviews.llvm.org/D81272.
Differential Revision: https://reviews.llvm.org/D82555
Yonghong Song [Tue, 30 Jun 2020 22:27:24 +0000 (15:27 -0700)]
[BPF] Fix a bug for __builtin_preserve_field_info() processing
Andrii discovered a problem where a simple case similar to below
will generate wrong relocation kind:
enum { FIELD_EXISTENCE = 2, };
struct s1 { int a1; };
int test() {
struct s1 *v = 0;
return __builtin_preserve_field_info(v[0], FIELD_EXISTENCE);
}
The expected relocation kind should be FIELD_EXISTENCE, but
recorded reloc kind in the final object file is FIELD_BYTE_OFFSET,
which is incorrect.
This exposed a bug in generating access strings from intrinsics.
The current access string generation has two steps:
step 1: find the base struct/union type,
step 2: traverse members in the base type.
The current implementation relies on at lease one member access
in step 2 to get the correct relocation kind, which is true
in typical cases. But if there is no member accesses, the current
implementation falls to the default info kind FIELD_BYTE_OFFSET.
This is incorrect, we should still record the reloc kind
based on the user input. This patch fixed this issue by properly
recording the reloc kind in such cases.
Differential Revision: https://reviews.llvm.org/D82932
Fangrui Song [Wed, 1 Jul 2020 05:05:01 +0000 (22:05 -0700)]
[ELF][test] Fix ppc32-gnu-ifunc.s and remove XFAIL: *
River Riddle [Wed, 1 Jul 2020 04:50:17 +0000 (21:50 -0700)]
[mlir] Remove the default template parameters from AttrBase and TypeBase.
MSVC 2017 doesn't support the case where a trailing variadic template list comes after template types with default parameters. Until we upgrade to VS 2019, we can't use the simplified definitions.
lh123 [Thu, 25 Jun 2020 12:04:18 +0000 (20:04 +0800)]
[CodeComplete] Add code completion after function equals
Summary:
Provide `default` and `delete` completion after the function equals.
Reviewers: kadircet, sammccall
Tags: #clang
Differential Revision: https://reviews.llvm.org/D82548
JF Bastien [Wed, 1 Jul 2020 04:49:01 +0000 (21:49 -0700)]
[NFC] fix diagnostic
It's pretty silly to diagnose on a scalar copy but the build does that:
loop variable 'SibReg' of type 'const llvm::Register' creates a copy from type 'const llvm::Register' [-Wrange-loop-analysis]
Sam Clegg [Tue, 30 Jun 2020 15:38:38 +0000 (08:38 -0700)]
[lld][WebAssembly] Give better error message on bad archive member
Include the archive name as well as the member name when an error
is encountered parsing bitcode archives.
Differential Revision: https://reviews.llvm.org/D82884
JF Bastien [Wed, 1 Jul 2020 04:32:05 +0000 (21:32 -0700)]
Fix diagnostic for missing virtual dtor
Introduced in D82673.
Arthur Eubanks [Wed, 1 Jul 2020 01:38:59 +0000 (18:38 -0700)]
[NewPM] Add explicit init value to -enable-new-pm
So it's easier to test with it on by default.
Reviewed By: ychen
Differential Revision: https://reviews.llvm.org/D82922
Xing GUO [Wed, 1 Jul 2020 01:36:18 +0000 (09:36 +0800)]
[DWARFYAML][test] Make the checker stricter. NFC.
Currently, DWARFYAML doesn't emit the 0 byte for terminating the abbrev
table for the given compilation unit. Before addressing this issue, we
have to make the test stricter.
Richard Smith [Tue, 30 Jun 2020 22:53:08 +0000 (15:53 -0700)]
[c++20] consteval functions don't get vtable slots.
For the Itanium C++ ABI, this implements the rule added in
https://github.com/itanium-cxx-abi/cxx-abi/pull/83
For the MS C++ ABI, this implements the direction that seemed most
plausible based on personal correspondence with MSVC developers, but is
subject to change as they decide their ABI rule.
Douglas Yung [Wed, 1 Jul 2020 01:10:09 +0000 (18:10 -0700)]
Fixup BDVER1 and ZNVER1 definitions that were accidentally changed in recent refactor.
- BDVER1
- Duplicate FeatureLZCNT removed
- ZNVER1
- Duplicate FeatureLZCNT removed
- Removed unsupported FeatureLWP
- Swapped FeatureMMX and FeatureMOVBE to be in alphabetical order
Shoaib Meenai [Wed, 1 Jul 2020 00:20:00 +0000 (17:20 -0700)]
[llvm-install-name-tool] Tighten some path checks
Just having --implicit-check-not=/usr breaks when the LLVM checkout path
contains '/usr', since llvm-objdump prints out the path to the input
file in the first line. Tighten the checks by adding the 'name' prefix
that's used when printing load command payloads. An alternative would be
to redirect the input file into llvm-objdump, in which case it prints
out 'a.out' as the file name, but I'm not sure how reliable that
behavior is.
Arthur Eubanks [Tue, 30 Jun 2020 22:57:45 +0000 (15:57 -0700)]
[Docs][BasicAA] Rename some more basicaa -> basic-aa
Follow up to https://reviews.llvm.org/D82607.
Gui Andrade [Tue, 30 Jun 2020 23:29:10 +0000 (23:29 +0000)]
[Sanitizers] Implement interceptors for msgsnd, msgrcv
Differential Revision: https://reviews.llvm.org/D82897
Nico Weber [Tue, 30 Jun 2020 23:29:47 +0000 (19:29 -0400)]
[gn build] (semi-manually) port
ce6153a5282
Matt Arsenault [Sun, 28 Jun 2020 14:06:58 +0000 (10:06 -0400)]
GlobalISel: Disallow undef generic virtual register uses
With an undef operand, it's possible for getVRegDef to fail and return
null. This is an edge case very little code bothered to
consider. Proper gMIR should use G_IMPLICIT_DEF instead.
I initially tried to apply this restriction to all SSA MIR, so then
getVRegDef would never fail anywhere. However, ProcessImplicitDefs
does technically run while the function is in SSA. ProcessImplicitDefs
and DetectDeadLanes would need to either move, or a new pseudo-SSA
type of function property would need to be introduced.
Matt Arsenault [Sun, 28 Jun 2020 22:41:38 +0000 (18:41 -0400)]
AMDGPU/GlobalISel: Remove some selection tests which should be invalid
These use undef generic virtual register operands, which should be
rejected by the verifier.
Richard Smith [Tue, 30 Jun 2020 22:53:08 +0000 (15:53 -0700)]
A constexpr virtual function is implicitly inline so should never be a
key function.
Arthur Eubanks [Tue, 30 Jun 2020 23:01:41 +0000 (16:01 -0700)]
Fix wrong title underline length
Reid Kleckner [Tue, 30 Jun 2020 23:00:04 +0000 (16:00 -0700)]
[gn build] Update build for new OpenMP tablegen logic
Ports
1a70077b5a64189d9c04d1a2d7ea6ff0e49744d6 to gn from cmake.
Hendrik Greving [Fri, 26 Jun 2020 18:45:18 +0000 (11:45 -0700)]
[ModuloSchedule] Make PeelingModuloScheduleExpander inheritable.
Basically a NFC, but allows subclasses access to the entire PeelingModuloScheduleExpander
class. We are doing this to allow backends, particularly one that are not necessarily
upstreamed, to inherit from PeelingModuloScheduleExpander and access its basic structures.
Renames Info into LoopInfo for consistency in PeelingModuloScheduleExpander.
Differential Revision: https://reviews.llvm.org/D82673
Arthur Eubanks [Tue, 30 Jun 2020 22:53:03 +0000 (15:53 -0700)]
[Docs][BasicAA] Rename -basicaa to -basic-aa in docs
Follow up to https://reviews.llvm.org/D82607.
River Riddle [Tue, 30 Jun 2020 22:43:03 +0000 (15:43 -0700)]
[mlir] Remove locking for dialect/operation registration.
Moving forward dialects should only be registered in a thread safe context. This matches the existing usage we have today, but it allows for removing quite a bit of expensive locking from the context.
This led to ~.5 a second compile time improvement when running one conversion pass on a very large .mlir file(hundreds of thousands of operations).
Differential Revision: https://reviews.llvm.org/D82595
River Riddle [Tue, 30 Jun 2020 22:42:52 +0000 (15:42 -0700)]
[mlir] Refactor InterfaceGen to support generating interfaces for Attributes and Types.
This revision adds support to ODS for generating interfaces for attributes and types, in addition to operations. These interfaces can be specified using `AttrInterface` and `TypeInterface` in place of `OpInterface`. All of the features of `OpInterface` are supported except for the `verify` method, which does not have a matching representation in the Attribute/Type world. Generating these interface can be done using `gen-(attr|type)-interface-(defs|decls|docs)`.
Differential Revision: https://reviews.llvm.org/D81884
River Riddle [Tue, 30 Jun 2020 22:42:39 +0000 (15:42 -0700)]
[mlir] Add support for defining Traits and Interfaces on Attributes/Types.
This revisions add mechanisms to Attribute/Type for attaching traits and interfaces. The mechanisms are modeled 1-1 after those for operations to keep the system consistent. AttrBase and TypeBase now accepts a trailing list of `Trait` types that will be attached to the object. These traits should inherit from AttributeTrait::TraitBase and TypeTrait::TraitBase respectively as necessary. A followup commit will refactor the interface gen mechanisms in ODS to support Attribute/Type interface generation and add tests for the mechanisms.
Differential Revision: https://reviews.llvm.org/D81883
Sam McCall [Fri, 26 Jun 2020 10:57:29 +0000 (12:57 +0200)]
[clangd] Run formatting operations asynchronously.
Summary:
They don't need ASTs or anything, so they should still run immediately.
These were sync for historical reasons (they predate clangd having a pervasive
threading model). This worked ok as they were "cheap".
Aside for consistency, there are a couple of reasons to make them async:
- they do IO (finding .clang-format) so aren't trivially cheap
- having TUScheduler involved in running these tasks means we can use it as
an injection point for configuration.
(TUScheduler::run will need to learn about which file is being operated on,
but that's an easy change).
- adding the config system adds more potential IO, too
Reviewers: kbobyrev
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D82642
Arthur Eubanks [Tue, 30 Jun 2020 22:40:24 +0000 (15:40 -0700)]
[BasicAA] Replace -basicaa with -basic-aa in polly
Follow up to https://reviews.llvm.org/D82607.
Kit Barton [Tue, 30 Jun 2020 17:38:31 +0000 (12:38 -0500)]
[PPC][NFC] Replace TM with Subtarget->getTargetMachine() in preparation for GlobalISel.
There are two uses of TM (instance of TargetMachine) when checking options.
These will not work once we enable GlobalISel. This patch replaces those uses of
TM with Subtarget->getTargetMachine().
Alex Lorenz [Tue, 30 Jun 2020 21:49:01 +0000 (14:49 -0700)]
split darwin-version-min-load-command.s into Arm64 subtest to avoid failures
Some buildbot configurations don't build the arm64 backend, so the test-cases
that need arm64 should go into the aarch64 subdirectory.
Craig Topper [Tue, 30 Jun 2020 21:35:07 +0000 (14:35 -0700)]
[X86] Use some preprocessor macros to reduce the very similar repeated code in getVPTESTMOpc. NFCI
This function picks X86 opcode name based on type, masking,
and whether not a load or broadcast has been folded using multiple
switch statements. The contents of the switches mostly just vary in
a few characters in the instruction name. So use some macros to
build the instruction names to reduce the repetiveness.
Amy Kwan [Tue, 30 Jun 2020 20:12:58 +0000 (15:12 -0500)]
[PowerPC][Power10] Add Vector Splat Imm/Permute/Blend/Shift Double Bit Imm Definitions and MC Tests
This patch adds the td definitions and asm/disasm tests for the
following instructions:
XXSPLTIW
XXSPLTIDP
XXSPLTI32DX
XXPERMX
XXBLENDVB
XXBLENDVH
XXBLENDVW
XXBLENDVD
VSLDBI
VSRDBI
Differential Revision: https://reviews.llvm.org/D82896
Zixu Wang [Tue, 30 Jun 2020 16:28:06 +0000 (09:28 -0700)]
[clang][diagnostics] Add '-Wundef-prefix' warning option
Summary:
Add an `-Wundef-prefix=<arg1>,<arg2>...` option, which is similar to `-Wundef`, but only give warnings for undefined macros with the given prefixes.
Reviewers: ributzka, steven_wu, cishida, bruno, arphaman, rsmith
Reviewed By: ributzka, arphaman
Subscribers: riccibruno, dexonsmith, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D80751
This patch was authored by Zixu Wang <zixu_wang@apple.com>
Vince Bridgers [Tue, 30 Jun 2020 15:08:35 +0000 (10:08 -0500)]
[ASTImporter] Fix AST import crash for a friend decl
Summary:
Running CTU testing, we found that VisitFriendDecl in
ASTImporterLookup.cpp was not handling a particular non-dependent case,
so we reached the llvm_unreachable case.
The FriendDecl and QualType not handled were:
(gdb) p D->dump()
FriendDecl 0x7ffff5cf1958
< <<srcfile>>, 'nlohmann::basic_json<std::map, std::vector,
std::basic_string<char>, bool, long long, unsigned long long, double,
std::allocator, adl_serializer, std::vector<unsigned char,
std::allocator<unsigned char>>>':'nlohmann::basic_json<std::map,
std::vector, std::basic_string<char>, bool, long long, unsigned long
long, double, std::allocator, adl_serializer, std::vector<unsigned char,
std::allocator<unsigned char>>>'
(gdb) p Ty->dump()
SubstTemplateTypeParmType 0x7ffff5cf0df0 'class
nlohmann::basic_json<std::map, std::vector, class
std::basic_string<char>, _Bool, long long, unsigned long long, double,
std::allocator, adl_serializer, class std::vector<unsigned char, class
std::allocator<unsigned char> > >' sugar
|-TemplateTypeParmType 0x7ffff643ea40 'BasicJsonType' dependent depth 0
index 0
| `-TemplateTypeParm 0x7ffff643e9e8 'BasicJsonType'
`-RecordType 0x1012ad20 'class nlohmann::basic_json<std::map,
std::vector, class std::basic_string<char>, _Bool, long long, unsigned
long long, double, std::allocator, adl_serializer, class
std::vector<unsigned char, class std::allocator<unsigned char> > >'
`-ClassTemplateSpecialization 0x1012ab68 'basic_json'
Reviewers: martong, a.sidorin
Reviewed By: martong
Subscribers: kristof.beyls, rnkovacs, teemperor, cfe-commits, dkrupp
Tags: #clang
Differential Revision: https://reviews.llvm.org/D82882
Eli Friedman [Wed, 24 Jun 2020 03:01:07 +0000 (20:01 -0700)]
[SVE] Reject vector struct indexes for scalable vectors.
It's messy to pattern-match, and completely unnecessary: scalar indexes
work equally well.
See also discussion on D81620 and D82061.
Differential Revision: https://reviews.llvm.org/D82430
Louis Dionne [Tue, 30 Jun 2020 18:26:10 +0000 (14:26 -0400)]
[libc++] Translate the std Lit parameter to the DSL
Julian Lettner [Tue, 30 Jun 2020 20:19:25 +0000 (13:19 -0700)]
[Sanitizer] Remove obsolete assert for OS version checking on Darwin
macOS versions do not necessarily start with 10 anymore. Remove an
obsolete assert.
Eli Friedman [Wed, 20 May 2020 22:08:36 +0000 (15:08 -0700)]
[BitcodeReader] Fix DelayedShuffle handling for ConstantExpr shuffles.
The indexing was messed up, so the result was completely broken.
Shuffle constant exprs are rare in practice; without vscale types,
constant folding generally elminates them. So sort of hard to trip over.
Fixes regression from D72467.
(Recommitting after fix for memory leak.)
Differential Revision: https://reviews.llvm.org/D80330
Matt Arsenault [Tue, 30 Jun 2020 20:14:23 +0000 (16:14 -0400)]
Sparc: Use Register
Matt Arsenault [Tue, 30 Jun 2020 19:41:03 +0000 (15:41 -0400)]
RISCV: Don't store function in RISCVMachineFunctionInfo
Targets should not depend on the MachineFunction state during the
MachineFunctionInfo construction.
Matt Arsenault [Tue, 30 Jun 2020 19:36:19 +0000 (15:36 -0400)]
PPC: Don't store function in PPCFunctionInfo
Continue migrating targets from depending on the MachineFunction
during the initial construction.
Matt Arsenault [Thu, 18 Jun 2020 14:19:07 +0000 (10:19 -0400)]
Mips: Don't store MachineFunction in MipsFunctionInfo
It will soon be disallowed to depend on MachineFunction state on
construction.
Davide Italiano [Tue, 30 Jun 2020 19:53:20 +0000 (12:53 -0700)]
Skip arm-(fp|gp)-read.test on Darwin.
Our assembler doesn't seem to grok floating point literals.
<rdar://problem/
64951608>
Davide Italiano [Tue, 30 Jun 2020 19:47:56 +0000 (12:47 -0700)]
[TestReturnValue] Skip based on architecutre, not platform.
Jonas Devlieghere [Tue, 30 Jun 2020 19:40:25 +0000 (12:40 -0700)]
[lldb/Scalar] Fix undefined behavior
Fix UBSan error detected in TestDataFormatterObjCCF.py and
TestDataFormatterObjCNSDate.py:
Scalar.cpp:698:27: runtime error: -4.96303e+08 is outside the range of
representable values of type 'unsigned long long'.
Eli Friedman [Wed, 24 Jun 2020 22:54:21 +0000 (15:54 -0700)]
[IR] Delete llvm::Constants using the correct type.
In most cases, this doesn't have much impact: the destructors just call
the base class destructor anyway. A few subclasses of ConstantExpr
actually store non-trivial data, though. Make sure we clean up
appropriately.
This is sort of ugly, but I don't see a good alternative given the
constraints.
Issue found by asan buildbots running the testcase for D80330.
Differential Revision: https://reviews.llvm.org/D82509
Florian Hahn [Tue, 30 Jun 2020 09:39:23 +0000 (10:39 +0100)]
[AArch64] Add getCFInstrCost, treat branches as free for throughput.
D79164/
2596da31740f changed getCFInstrCost to return 1 per default.
AArch64 did not have its own implementation, hence the throughput cost
of CFI instructions is overestimated. On most cores, most branches should
be predicated and essentially free throughput wise.
This restores a 9% performance regression on a SPEC2006 benchmark on
AArch64 with -O3 LTO & PGO.
This patch effectively restores pre
2596da31740f behavior for AArch64
and undoes the AArch64 test changes of the patch.
Reviewers: samparker, dmgreen, anemet
Reviewed By: samparker
Differential Revision: https://reviews.llvm.org/D82755
Alex Zinenko [Tue, 30 Jun 2020 19:18:15 +0000 (21:18 +0200)]
[mlir] minor tweaks in standard-to-llvm lowering
Fix a typo in the documentation and simplify the condition to drop
braces. Addresses post-commit review of https://reviews.llvm.org/D82647.
Craig Topper [Tue, 30 Jun 2020 18:59:03 +0000 (11:59 -0700)]
[X86] Move frontend CPU feature initialization to a look up table based implementation. NFCI
This replaces the switch statement implementation in the clang's
X86.cpp with a lookup table in X86TargetParser.cpp.
I've used constexpr and copy of the FeatureBitset from
SubtargetFeature.h to store the features in a lookup table.
After the lookup the bitset is translated into strings for use
by the rest of the frontend code.
I had to modify the implementation of the FeatureBitset to avoid
bugs in gcc 5.5 constexpr handling. It seems to not like the
same array entry to be used on the left side and right hand side
of an assignment or &= or |=. I've also used uint32_t instead of
uint64_t and sized based on the X86::CPU_FEATURE_MAX.
I've initialized the features for different CPUs outside of the
table so that we can express inheritance in an adhoc way. This
was one of the big limitations of the switch and we had resorted
to labels and gotos.
Differential Revision: https://reviews.llvm.org/D82731
Craig Topper [Tue, 30 Jun 2020 16:58:48 +0000 (09:58 -0700)]
[X86] Some CHECK-NOTs for FMA4/TBM/XOP for znver1/znver2 in predefined-arch-macros.c
These features exist in earlier CPUs, but were deprecated on
znver1/znver2. While working on D82731 I accidentally copied
them from the earlier CPU. And nothing caught my mistake. Having
these additional checks would have helped.
David Green [Tue, 30 Jun 2020 17:40:04 +0000 (18:40 +0100)]
[InstCombine] fma x, y, 0 -> fmul x, y
If the addend of the fma is zero, common sense would suggest that we can
convert fma x, y, 0.0 to fmul x, y. This comes up with some user code
that was expecting the first fma in an unrolled loop to simplify to a
fmul.
Floating point often does not follow naive common sense though. Alive
suggests that this should be guarded by nsz (as fadd -0.0, 0.0 = 0.0).
fma x, y, -0.0 is always valid.
Differential Revision: https://reviews.llvm.org/D82778
Louis Dionne [Tue, 30 Jun 2020 18:52:31 +0000 (14:52 -0400)]
[libc++] Fix the Lit DSL test in case a substitution is empty
Valentin Clement [Tue, 30 Jun 2020 18:36:37 +0000 (14:36 -0400)]
[openmp] Move Directive and Clause helper function to tablegen
Summary:
Follow up to D81736. Move getOpenMPDirectiveKind, getOpenMPClauseKind, getOpenMPDirectiveName and
getOpenMPClauseName to the new tablegen code generation. The code is generated in a new file named OMP.cpp.inc
Reviewers: jdoerfert, jdenny, thakis
Reviewed By: jdoerfert, jdenny
Subscribers: mgorny, yaxunl, hiraditya, guansong, sstefan1, llvm-commits, thakis
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82405
Marius Brehler [Tue, 30 Jun 2020 18:47:17 +0000 (20:47 +0200)]
[mlir] Fix case in MLIRGPUtoGPURuntimeTransforms
Summary:
This changes the casing of MLIRGPUtoGPURuntimeTransforms to be consistent
with other transform libraries.
Differential Revision: https://reviews.llvm.org/D82841
Alex Lorenz [Tue, 30 Jun 2020 04:04:25 +0000 (21:04 -0700)]
[macho] emit LC_BUILD_VERSION load command for supported OSes and platforms
This change lets LLVM use the LC_BUILD_VERSION command when building for macOS 10.14, iOS 12, tvOS 12, and watchOS 5.
Additionally, this change ensures that new platforms like Apple Silicon macOS / Mac Catalyst,
and simulators running on Apple Silicon alway use LC_BUILD_VERSION with the OS version set to the
minimum supported OS version if the deployment target version is older.
Differential Revision: https://reviews.llvm.org/D82836
Marius Brehler [Tue, 30 Jun 2020 18:44:04 +0000 (20:44 +0200)]
[mlir] Fix case in MLIRGPUtoNVVMTransforms
Summary:
This changes the casing of MLIRGPUtoNVVMTransforms to be consistent
with other transform libraries.
Reviewers: stephenneuendorffer, herhut
Reviewed By: herhut
Subscribers: jholewinski, mgorny, mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, nicolasvasilache, csigg, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, Joonsoo, grosul1, Kayjukh, jurahul, msifontes
Tags: #mlir
Differential Revision: https://reviews.llvm.org/D82842
Marius Brehler [Tue, 30 Jun 2020 18:39:41 +0000 (20:39 +0200)]
[mlir] Fix case in MLIRGPUtoROCDLTransforms
Summary:
This changes the casing of MLIRGPUtoROCDLTransforms to be consistent
with other transform libraries.
Differential Revision: https://reviews.llvm.org/D82843
Jonas Devlieghere [Tue, 30 Jun 2020 18:37:44 +0000 (11:37 -0700)]
[lldb/Test] Skip TestIOHandlerResizeNoEditline with reproducers
Nathan James [Tue, 30 Jun 2020 18:34:44 +0000 (19:34 +0100)]
[clang-tidy] Added option to readability-else-after-return
Added a 'RefactorConditionVariables' option to control how the check handles condition variables
Reviewed By: aaron.ballman
Differential Revision: https://reviews.llvm.org/D82824
Francesco Petrogalli [Thu, 25 Jun 2020 21:49:00 +0000 (21:49 +0000)]
[sve][acle] Enable feature macros for SVE ACLE extensions.
Summary:
The following feature macros have been added:
__ARM_FEATURE_SVE_BF16
__ARM_FEATURE_SVE_MATMUL_INT8
__ARM_FEATURE_SVE_MATMUL_FP32
__ARM_FEATURE_SVE_MATMUL_FP64
The driver has been updated to enable them accordingly to the value of
the target feature passed at command line.
The SVE ACLE tests using the macros have been modified to work with
the target feature instead of passing the macro at command line.
Reviewers: sdesmalen, efriedma, c-rhodes, kmclaughlin, SjoerdMeijer, rengolin
Subscribers: tschuett, kristof.beyls, rkruppe, psnobl, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D82623
Sameer Arora [Tue, 30 Jun 2020 18:01:51 +0000 (11:01 -0700)]
[llvm-install-name-tool] Add -change option
Implement `-change` option for install-name-tool. The behavior exactly
matches that of cctools. Depends on D82410.
Reviewed By: jhenderson, smeenai
Differential Revision: https://reviews.llvm.org/D82613
Sameer Arora [Tue, 30 Jun 2020 18:01:45 +0000 (11:01 -0700)]
[llvm-install-name-tool] Add -id option
Implement `-id` option for install-name-tool. Differences from cctool's
behavior:
- Does **NOT** throw an error if multiple -id options are specified.
Instead, picks the last one.
- Throws an error in case empty id is specified.
Reviewed By: jhenderson, smeenai
Differential Revision: https://reviews.llvm.org/D82410
Reid Kleckner [Fri, 5 Jun 2020 01:57:24 +0000 (18:57 -0700)]
[PDB] Defer public serialization until PDB writing
This reduces peak memory on my test case from 1960.14MB to 1700.63MB
(-260MB, -13.2%) with no measurable impact on CPU time. I'm currently
working with a publics stream that is about 277MB. Before this change,
we would allocate 277MB of heap memory, serialize publics into them,
hold onto that heap memory, open the PDB, and commit into it. After
this change, we defer the serialization until commit time.
In the last change I made to public writing, I re-sorted the list of
publics multiple times in place to avoid allocating new temporary data
structures. Deferring serialization until later requires that we don't
reorder the publics. Instead of sorting the publics, I partially
construct the hash table data structures, store a publics index in them,
and then sort the hash table data structures. Later, I replace the index
with the symbol record offset.
This change also addresses a FIXME and moves the list of global and
public records from GSIHashStreamBuilder to GSIStreamBuilder. Now that
publics aren't being serialized, it makes even less sense to store them
as a list of CVSymbol records. The hash table used to deduplicate
globals is moved as well, since that is specific to globals, and not
publics.
Reviewed By: aganea, hans
Differential Revision: https://reviews.llvm.org/D81296
Sanjay Patel [Tue, 30 Jun 2020 18:20:46 +0000 (14:20 -0400)]
[PhaseOrdering][NewPM] update test that silently showed bug with SpeculativeExecutionPass; NFC
See D82735 / rG1a6cebb4d12c744699e23624f8afda5cbe216fe6
Adrian Prantl [Tue, 30 Jun 2020 17:26:25 +0000 (10:26 -0700)]
Improve the detection of iOS/tvOS/watchOS simulator binaries in
debugserver and lldb
This patch improves the heuristics for correctly identifying simulator binaries on Darwin and adds support for simulators running on Apple Silicon.
rdar://problem/
64046344
Differential Revision: https://reviews.llvm.org/D82616
Christopher Tetreault [Tue, 30 Jun 2020 18:07:24 +0000 (11:07 -0700)]
[SVE] Remove calls to VectorType::getNumElements from AArch64
Reviewers: efriedma, paquette, david-arm, kmclaughlin
Reviewed By: david-arm
Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, danielkiss, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82214
Louis Dionne [Tue, 30 Jun 2020 18:16:00 +0000 (14:16 -0400)]
[libc++] Add missing include in test
Christopher Tetreault [Tue, 30 Jun 2020 17:56:36 +0000 (10:56 -0700)]
[SVE] Remove calls to VectorType::getNumElements from ExecutionEngine
Reviewers: efriedma, lhames, sdesmalen, fpetrogalli
Reviewed By: lhames, sdesmalen
Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82211
Eric Christopher [Tue, 30 Jun 2020 17:52:10 +0000 (10:52 -0700)]
Update the phabricator docs to reflect the monorepo change.
Patch by Nathan Froyd!
Differential Revision: https://reviews.llvm.org/D82389