Matt Arsenault [Tue, 21 Jan 2020 14:02:42 +0000 (09:02 -0500)]
GlobalISel: Reimplement widenScalar for G_UNMERGE_VALUES results
Only use shifts if the requested type exactly matches the source type,
and create sub-unmerges otherwise.
David Green [Mon, 27 Jan 2020 13:59:29 +0000 (13:59 +0000)]
[MVE] Fixup order of gather writeback intrinsic outputs
The MVE_VLDRWU32_qi_pre gather loads, like the other _pre/_post mve
loads returns the writeback as result 0, the value as result 1. The llvm
ir intrinsic seems to have this the other way around though, and so when
lowering from one to the other we need to switch the first two outputs.
I've also fixed up the types of _pre/_post on normal MVE loads. There we
were already getting the values the right way around, just not for the
types. I don't believe this was causing anything to go wrong, but it was
very confusing to read in the debug output.
Differential Revision: https://reviews.llvm.org/D73370
Matt Arsenault [Sat, 25 Jan 2020 03:57:49 +0000 (22:57 -0500)]
GlobalISel: Translate vector GEPs
Russell Gallop [Fri, 3 Jan 2020 16:04:19 +0000 (16:04 +0000)]
Re-land [Support] Extend TimeProfiler to support multiple threads
This makes TimeTraceProfilerInstance thread local. Added
timeTraceProfilerFinishThread() which moves the thread local instance to
a global vector of instances. timeTraceProfilerWrite() then writes
recorded data from all instances.
Threads are identified based on their thread ids. Totals are reported
with artificial thread ids higher than the real ones.
This fixes the previous version to work with __thread as well as
thread_local.
Differential Revision: https://reviews.llvm.org/D71059
Igor Kudrin [Mon, 27 Jan 2020 12:33:34 +0000 (19:33 +0700)]
[LLDB] Fix build failures after removing Version from DWARFExpression.
Igor Kudrin [Thu, 23 Jan 2020 02:24:00 +0000 (09:24 +0700)]
[DWARF] Do not pass Version to DWARFExpression. NFCI.
The Version was used only to determine the size of an operand of
DW_OP_call_ref. The size was 4 for all versions apart from 2, but
the DW_OP_call_ref operation was introduced only in DWARF3. Thus,
the code may be simplified and using of Version may be eliminated.
Differential Revision: https://reviews.llvm.org/D73264
Igor Kudrin [Thu, 23 Jan 2020 11:13:30 +0000 (18:13 +0700)]
[DWARF] Simplify DWARFExpression. NFC.
As DataExtractor already has a method to extract an unsigned value of
a specified size, there is no need to duplicate that.
Differential Revision: https://reviews.llvm.org/D73263
Krasimir Georgiev [Mon, 27 Jan 2020 11:37:15 +0000 (12:37 +0100)]
[clang-format] Handle escaped " in C# string-literals
Reviewers: krasimir
Reviewed By: krasimir
Subscribers: klimek, MyDeveloperDay
Tags: #clang-format
Differential Revision: https://reviews.llvm.org/D73353
David Stenberg [Mon, 27 Jan 2020 10:36:03 +0000 (11:36 +0100)]
Improvements to call site register worklist
Summary:
This fixes PR44118. For cases where we have a chain like this:
R8 = R1 (entry value)
R0 = R8
call @foo R0
the code that emits call site entries using entry values would not
follow that chain, instead emitting a call site entry with R8 as
location rather than R0. Such a case was discovered when originally
adding dbgcall-site-orr-moves.mir. This patch fixes that issue. This is
done by changing the ForwardedRegWorklist set to a map in which the
worklist registers always map to the parameter registers that they
describe.
Another thing this patch fixes is that worklist registers now can
describe more than one parameter register at a time. Such a case
occurred in dbgcall-site-interpretation.mir, resulting in a call site
entry not being emitted for one of the parameters.
Reviewers: djtodoro, NikolaPrica, aprantl, vsk
Reviewed By: vsk
Subscribers: hiraditya, llvm-commits
Tags: #debug-info, #llvm
Differential Revision: https://reviews.llvm.org/D73168
Stephen Kelly [Mon, 27 Jan 2020 11:16:50 +0000 (11:16 +0000)]
[ASTMatchers] Fix parent traversal with InitListExpr
Children of InitListExpr are traversed twice by RAV, so this code
populates a vector to represent the possibly-multiple parents (in
reality in this situation the parent is the same and is therefore
de-duplicated).
Sjoerd Meijer [Mon, 27 Jan 2020 11:05:26 +0000 (11:05 +0000)]
[ARM][MVE] Tail-predication: support constant trip count
We had support for runtime trip count values, but not constants, and this adds
supports for that.
And added a minor optimisation while I was add it: don't invoke Cleanup when
there's nothing to clean up.
Differential Revision: https://reviews.llvm.org/D73198
Sam Parker [Mon, 27 Jan 2020 10:58:46 +0000 (10:58 +0000)]
[ARM][LowOverheadLoops] Dont ignore VCTP
When expanding the LoopStart, we try to remove the iteration count
calculation. However, if part of the calculation was also used to
calculate the number of elements we could end up deleting
instructions that were required to feed DLSTP/WLSTP.
Differential Revision: https://reviews.llvm.org/D73275
David Stenberg [Mon, 27 Jan 2020 10:15:55 +0000 (11:15 +0100)]
Don't separate imp/expl def handling for call site params
Summary:
Since D70431 the describeLoadedValue() hook takes a parameter register,
meaning that it can now be asked to describe any register. This means
that we can drop the difference between explicit and implicit defines
that we previously had in collectCallSiteParameters().
I have not found any case for any upstream targets where a parameter
register is only implicitly defined, and does not overlap with any
explicit defines. I don't know if such a case would even make sense. So
as far as I have tested, this patch should be a non-functional change.
However, this reduces the complexity of the code a bit, and it will
simplify the implementation of an upcoming patch which solves PR44118.
Reviewers: djtodoro, NikolaPrica, aprantl, vsk
Reviewed By: djtodoro, vsk
Subscribers: hiraditya, llvm-commits
Tags: #debug-info, #llvm
Differential Revision: https://reviews.llvm.org/D73167
Georgii Rymar [Wed, 22 Jan 2020 12:20:36 +0000 (15:20 +0300)]
[llvm-readobj] - Refine --needed-libs implementation and add a test.
We have no good test for --needed-libs option.
The one we have as a part of Object/readobj-shared-object.test
is not complete.
In this patch I've did a minor NFC changes to the implementation and
added a test. This allowed to remove this piece from
Object/readobj-shared-object.test
Differential revision: https://reviews.llvm.org/D73174
Guillaume Chatelet [Mon, 27 Jan 2020 09:37:01 +0000 (10:37 +0100)]
[Alignment][NFC] Use Align with CreateAlignedLoad
Summary:
This is 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
Reviewers: courbet, bollu
Subscribers: hiraditya, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D73449
Raphael Isemann [Mon, 27 Jan 2020 09:55:54 +0000 (10:55 +0100)]
[lldb][NFC] Give import-std-module tests a more unique file names
We want that the *.py names for the tests have unique names but
the current ones are sometimes very simple (e.g., "TestUniquePtr.py")
and could collide with unrelated tests. This just gives all these
tests a "FromStdModule" suffix to make these collisions less likely.
Raphael Isemann [Mon, 27 Jan 2020 09:48:22 +0000 (10:48 +0100)]
[lldb][NFC] Improve documentation for CompletionRequest
Georgii Rymar [Wed, 22 Jan 2020 11:08:42 +0000 (14:08 +0300)]
[llvm-readobj] - Add a test for --dyn-symbols when there are no dynamic symbols.
It removes the Object/readobj-absent.test test and creates a one more case in
dyn-symbols.test we have.
Differential revision: https://reviews.llvm.org/D73169
Georgii Rymar [Tue, 21 Jan 2020 14:49:42 +0000 (17:49 +0300)]
[llvm-readobj] - Add a test for --hash-table option.
We had no test for --hash-table in tools/llvm-readobj.
The one we had was in test/Object and checked that
it is possible to dump the hash table even when an object
doesn't have a section header table.
In this patch I created a test, moved and merged the existent one.
During moving I converted it to be YAML based to stop using the
precompiled binary.
Differential revision: https://reviews.llvm.org/D73105
Guillaume Chatelet [Fri, 24 Jan 2020 16:40:17 +0000 (17:40 +0100)]
[Alignment][NFC] Use Align with CreateMaskedScatter/Gather
Summary:
This is 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
This patch shows that CreateMaskedScatter/CreateMaskedGather can only take positive non zero alignment values.
Reviewers: courbet
Subscribers: hiraditya, llvm-commits, delena
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73361
Guillaume Chatelet [Fri, 24 Jan 2020 10:37:18 +0000 (11:37 +0100)]
Fix missing dependency in LibcUnitTest
Summary: LibcUnitTest is missing a dependency on LLVMSupport. This prevents building with shared libraries.
Reviewers: sivachandra
Subscribers: mgorny, MaskRay, libc-commits
Tags: #libc-project
Differential Revision: https://reviews.llvm.org/D73337
Adam Balogh [Thu, 23 Jan 2020 14:13:30 +0000 (15:13 +0100)]
[clan-tidy] Fix false positive in bugprone-infinite-loop
The checker bugprone-infinite-loop does not track changes of
variables in the initialization expression of a variable
declared inside the condition of the while statement. This
leads to false positives, similarly to the one in the bug
report https://bugs.llvm.org/show_bug.cgi?id=44618. This
patch fixes this issue by enabling tracking of the variables
of this expression as well.
Differential Revision: https://reviews.llvm.org/D73270
Petar Avramovic [Mon, 27 Jan 2020 08:59:50 +0000 (09:59 +0100)]
[MIPS GlobalISel] Select population count (popcount)
G_CTPOP is generated from llvm.ctpop.<type> intrinsics, clang generates
these intrinsics from __builtin_popcount and __builtin_popcountll.
Add lower and narrow scalar for G_CTPOP.
Lower G_CTPOP for MIPS32.
Differential Revision: https://reviews.llvm.org/D73216
Petar Avramovic [Mon, 27 Jan 2020 08:51:06 +0000 (09:51 +0100)]
[MIPS GlobalISel] Select count trailing zeros
llvm.cttz.<type> intrinsic has additional i1 argument is_zero_undef,
it tells whether zero as the first argument produces a defined result.
G_CTTZ is generated from llvm.cttz.<type> (<type> <src>, i1 false)
intrinsics, clang generates these intrinsics from __builtin_ctz and
__builtin_ctzll.
G_CTTZ_ZERO_UNDEF comes from llvm.cttz.<type> (<type> <src>, i1 true).
Clang generates such intrinsics as parts of expansion of builtin_ffs
and builtin_ffsll. It is also traditionally part of and many
algorithms that are now predicated on avoiding zero-value inputs.
Add narrow scalar (algorithm uses G_CTTZ_ZERO_UNDEF) for G_CTTZ.
Lower G_CTTZ and G_CTTZ_ZERO_UNDEF for MIPS32.
Differential Revision: https://reviews.llvm.org/D73215
Petar Avramovic [Mon, 27 Jan 2020 08:43:38 +0000 (09:43 +0100)]
[MIPS GlobalISel] Select count leading zeros
llvm.ctlz.<type> intrinsic has additional i1 argument is_zero_undef,
it tells whether zero as the first argument produces a defined result.
MIPS clz instruction returns 32 for zero input.
G_CTLZ is generated from llvm.ctlz.<type> (<type> <src>, i1 false)
intrinsics, clang generates these intrinsics from __builtin_clz and
__builtin_clzll.
G_CTLZ_ZERO_UNDEF can also be generated from llvm.ctlz with true as
second argument. It is also traditionally part of and many algorithms
that are now predicated on avoiding zero-value inputs.
Add narrow scalar for G_CTLZ (algorithm uses G_CTLZ_ZERO_UNDEF).
Lower G_CTLZ_ZERO_UNDEF and select G_CTLZ for MIPS32.
Differential Revision: https://reviews.llvm.org/D73214
Fangrui Song [Sun, 26 Jan 2020 23:47:32 +0000 (15:47 -0800)]
[MachineVerifier] Simplify and delete LLVM_VERIFY_MACHINEINSTRS from a comment. NFC
The environment variable has been unused since r228079.
Martin Storsjö [Sun, 26 Jan 2020 20:14:41 +0000 (22:14 +0200)]
[libunwind] Treat assembly files as C on mingw
When targeting mingw, current CMake (3.16) fails to get the right
flags for assembly source files for windows gnu/clang targets
(see https://gitlab.kitware.com/cmake/cmake/merge_requests/4287
for a fix), causing builds to fail due to `-fPIC` being unsupported
in clang for mingw targets
In the meantime, restore the behaviour from before
c48974ffd7d1676
selectively on mingw targets, treating the assembly files as C.
Differential Revision: https://reviews.llvm.org/D73436
Qiu Chaofan [Mon, 27 Jan 2020 03:37:43 +0000 (11:37 +0800)]
[NFC] Fix typo in Clang docs
Wang, Pengfei [Fri, 17 Jan 2020 02:32:30 +0000 (10:32 +0800)]
[FPEnv] Divide macro INSTRUCTION into INSTRUCTION and DAG_INSTRUCTION,
and macro FUNCTION likewise. NFCI.
Some functions like fmuladd don't really have a node, we should divide
the declaration form those have node to avoid introducing fake nodes.
Differential Revision: https://reviews.llvm.org/D72871
Saar Raz [Sun, 26 Jan 2020 22:57:31 +0000 (00:57 +0200)]
[Concepts] Fix incorrect TemplateArgs for introduction of local parameters
The wrong set of TemplateArgs was being provided to addInstantiatedParametersToScope.
Caused bug #44658.
Lei Zhang [Sun, 26 Jan 2020 15:55:17 +0000 (10:55 -0500)]
[mlir] Expose getNearestSymbolTable as SymbolTable class method
This is a generally useful utility function for interacting with
symbol tables.
Differential Revision: https://reviews.llvm.org/D73433
Saar Raz [Sun, 26 Jan 2020 22:14:43 +0000 (00:14 +0200)]
[Concepts] Add missing null check to transformConstructor
Caused bug 44671 when transforming a constructor with a type-constraint with no explicit template args.
Martin Storsjö [Sun, 26 Jan 2020 20:11:28 +0000 (22:11 +0200)]
[libunwind] Fix building standalone after
c48974ffd7d1676
After this change, we need to explicitly list the languages the
project uses, otherwise the assembly source files won't get built
at all.
Previously (before that commit), the assembly source files were
simply treated as C.
The toplevel llvm CMakeLists.txt adds these three languages, so
when building libunwind integrated as part of that, it works fine.
Roman Lebedev [Sun, 26 Jan 2020 17:33:29 +0000 (20:33 +0300)]
[X86][BdVer2] Polish LEA instruction scheduling info
Based on exhaustive llvm-exegesis measurements.
There may still be some imperfections for LEA16r/LEA32r.
Much like was observed in D68646, i'm also measuring some outliers
with some specific registers.
Roman Lebedev [Sun, 26 Jan 2020 19:01:33 +0000 (22:01 +0300)]
[NFC][MCA] Re-autogenerate all check lines in all X86 MCA tests
Some whitespace issues have crept in,
and some znver2 check lines were missing..
Simon Pilgrim [Sun, 26 Jan 2020 17:27:53 +0000 (17:27 +0000)]
[InstCombine] Add extra shift(c1,add(c2,y)) tests for PR15141
Simon Pilgrim [Sun, 26 Jan 2020 14:59:53 +0000 (14:59 +0000)]
[X86][AVX] Extend combineCommutableSHUFP to handle v8f32 and v16f32 commutable shufps patterns
Saar Raz [Sun, 26 Jan 2020 18:39:44 +0000 (20:39 +0200)]
[Concepts] Fix parsing of scope specifier in compound-requirements, add more tests for scope specifiers in type-constraints
The code for parsing of type-constraints in compound-requirements was not adapted for the new TryAnnotateTypeConstraint which
caused compound-requirements with scope specifiers to ignore them.
Also add regression tests for scope specifiers in type-constraints in more contexts.
Stephen Kelly [Fri, 24 Jan 2020 23:46:54 +0000 (23:46 +0000)]
NFC: Implement AST node skipping in ParentMapContext
Summary:
This allows ASTContext to store only one parent map, rather than storing
an entire parent map for each traversal mode used.
This is therefore a partial revert of commit
0a717d5b (Make it possible
control matcher traversal kind with ASTContext, 2019-12-06).
Reviewers: aaron.ballman, rsmith, rnk
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D73388
Guillaume Chatelet [Wed, 22 Jan 2020 13:27:05 +0000 (14:27 +0100)]
[IR] masked gather/scatter alignment should be set
Summary: masked_load and masked_store instructions require the alignment to be specified and a power of two. It seems to me that this requirement applies to masked_gather and masked_scatter as well.
Subscribers: hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73179
Lei Zhang [Sat, 25 Jan 2020 15:09:46 +0000 (10:09 -0500)]
[mlir][spirv] Create builtin variable in nearest symbol table
This commit changes the logic of `getBuiltinVariableValue` to get
or create the builtin variable in the nearest symbol table. This
will allow us to use this function in other partial conversion
cases where we haven't created the spv.module yet.
Differential Revision: https://reviews.llvm.org/D73416
Lei Zhang [Sat, 25 Jan 2020 15:58:18 +0000 (10:58 -0500)]
[mlir][spirv] NFC: simplify load/store builder call sites
This commit introduces default values for load/store builders to
simplify builder call sites.
Differential Revision: https://reviews.llvm.org/D73419
Lei Zhang [Sat, 25 Jan 2020 22:01:26 +0000 (17:01 -0500)]
[mlir][spirv] NFC: expose builtin func op conversion pattern
This commit exposes the func op conversion pattern via a new
`populateBuiltinFuncToSPIRVPatterns` function from the standard
to SPIR-V conversion passs. This is structurally better given
that func op belongs to the builtin dialect. More importantly,
this makes the pattern reusable to other dialect to SPIR-V
dialect conversion as other dialect can well adopt builtin
func op instead of having its own. Besides, it's very common
to use func ops as test wrappers in lit tests, so test passes
will need to handle func ops too.
Differential Revision: https://reviews.llvm.org/D73421
Lei Zhang [Sat, 25 Jan 2020 14:16:29 +0000 (09:16 -0500)]
[mlir][spirv] Relax verification to allow flexible placement
Thus far certain SPIR-V ops have been required to be in spv.module.
While this provides strong verification to catch unexpected errors,
it's quite rigid and makes progressive lowering difficult. Sometimes
we would like to partially lower ops from other dialects, which may
involve creating ops like global variables that should be placed in
other module-like ops. So this commit relaxes the requirement of
such SPIR-V ops' scope to module-like ops. Similarly for function-
like ops.
Differential Revision: https://reviews.llvm.org/D73415
Lei Zhang [Sun, 26 Jan 2020 15:19:24 +0000 (10:19 -0500)]
[mlir][spirv] Add spv.GroupNonUniformElect and spv.GroupNonUniformIAdd
Differential Revision: https://reviews.llvm.org/D73349
Simon Pilgrim [Sun, 26 Jan 2020 14:35:56 +0000 (14:35 +0000)]
[X86][AVX] Add tests showing combineCommutableSHUFP failure to handle v8f32 and v16f32 commutable shufps patterns
Simon Pilgrim [Sun, 26 Jan 2020 14:31:26 +0000 (14:31 +0000)]
[X86][SSE] combineCommutableSHUFP - permilps(shufps(load(),x)) --> permilps(shufps(x,load()))
Pull out combineTargetShuffle code added in rG3fd5d1c6e7db into a helper function and extend it to handle shufps(shufps(load(),x),y) and shufps(y,shufps(load(),x)) cases as well.
Serge Pavlov [Wed, 7 Aug 2019 16:31:26 +0000 (23:31 +0700)]
[FPEnv] Extended FPOptions with new attributes
This change added two new attributes, rounding mode and exception
behavior to the structure FPOptions. These attributes allow more
flexible treatment of specific floating point environment than it is
provided by #pragma STDC FENV_ACCESS.
Differential Revision: https://reviews.llvm.org/D65994
Simon Pilgrim [Sun, 26 Jan 2020 10:01:21 +0000 (10:01 +0000)]
[TargetLowering] Respect recursive depth in SimplifyDemandedBits call to ComputeNumSignBits
Maheaha Shivamallappa [Sun, 26 Jan 2020 08:01:53 +0000 (13:31 +0530)]
AMDGPU/GlobalISel: Clean-up code around ISel for Intrinsics.
Summary:
A minor code clean-up around ISel for intrinsic llvm.amdgcn.end.cf()
Reviewers: arsenm, mshivama
Reviewed By: arsenm
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73358
Fangrui Song [Sun, 26 Jan 2020 02:58:54 +0000 (18:58 -0800)]
[ELF][PPC32] Support range extension thunks with addends
* Generalize the code added in D70637 and D70937. We should eventually remove the EM_MIPS special case.
* Handle R_PPC_LOCAL24PC the same way as R_PPC_REL24.
Reviewed By: Bdragon28
Differential Revision: https://reviews.llvm.org/D73424
George Burgess IV [Sun, 26 Jan 2020 05:44:59 +0000 (21:44 -0800)]
[Support] `const`ify a method; NFC
Pointed out by Stepan on llvm-dev:
http://lists.llvm.org/pipermail/llvm-dev/2020-January/138617.html
Mehdi Amini [Sun, 26 Jan 2020 03:58:30 +0000 (03:58 +0000)]
Mass update the MLIR license header to mention "Part of the LLVM project"
This is an artifact from merging MLIR into LLVM, the file headers are
now aligned with the rest of the project.
Craig Topper [Sun, 26 Jan 2020 02:25:45 +0000 (18:25 -0800)]
[X86] Use a macro to convert X86ISD names to strings in getTargetNodeName.
Every case in the switch had a string version of themselves. Two
of them had a typo that used : instead of ::
By using a macro we can automate the string creation and avoid
the possibility of typos like this.
This is similar to what is done on the AMDGPU target.
Fangrui Song [Sat, 25 Jan 2020 01:49:59 +0000 (17:49 -0800)]
[ELF][PPC32] Support canonical PLT
-fno-pie produces a pair of non-GOT-non-PLT relocations R_PPC_ADDR16_{HA,LO} (R_ABS) referencing external
functions.
```
lis 3, func@ha
la 3, func@l(3)
```
In a -no-pie/-pie link, if func is not defined in the executable, a canonical PLT entry (st_value>0, st_shndx=0) will be needed.
References to func in shared objects will be resolved to this address.
-fno-pie -pie should fail with "can't create dynamic relocation ... against ...", so we just need to think about -no-pie.
On x86, the PLT entry passes the JMP_SLOT offset to the rtld PLT resolver.
On x86-64: the PLT entry passes the JUMP_SLOT index to the rtld PLT resolver.
On ARM/AArch64: the PLT entry passes &.got.plt[n]. The PLT header passes &.got.plt[fixed-index]. The rtld PLT resolver can compute the JUMP_SLOT index from the two addresses.
For these targets, the canonical PLT entry can just reuse the regular PLT entry (in PltSection).
On PPC32: PltSection (.glink) consists of `b PLTresolve` instructions and `PLTresolve`. The rtld PLT resolver depends on r11 having been set up to the .plt (GotPltSection) entry.
On PPC64 ELFv2: PltSection (.glink) consists of `__glink_PLTresolve` and `bl __glink_PLTresolve`. The rtld PLT resolver depends on r12 having been set up to the .plt (GotPltSection) entry.
We cannot reuse a `b PLTresolve`/`bl __glink_PLTresolve` in PltSection as a canonical PLT entry. PPC64 ELFv2 avoids the problem by using TOC for any external reference, even in non-pic code, so the canonical PLT entry scenario should not happen in the first place.
For PPC32, we have to create a PLT call stub as the canonical PLT entry. The code sequence sets up r11.
Reviewed By: Bdragon28
Differential Revision: https://reviews.llvm.org/D73399
Saar Raz [Sat, 25 Jan 2020 20:54:27 +0000 (22:54 +0200)]
[Concepts] Transform constraints of non-template functions to ConstantEvaluated
We would previously try to evaluate atomic constraints of non-template functions as-is,
and since they are now unevaluated at first, this would cause incorrect evaluation (bugs #44657, #44656).
Substitute into atomic constraints of non-template functions as we would atomic constraints
of template functions, in order to rebuild the expressions in a constant-evaluated context.
Simon Pilgrim [Sat, 25 Jan 2020 20:20:37 +0000 (20:20 +0000)]
[SelectionDAG] ComputeNumSignBits - add DemandedElts support for MIN/MAX ops
Fangrui Song [Thu, 23 Jan 2020 05:39:16 +0000 (21:39 -0800)]
[ELF] Rename relocateOne() to relocate() and pass `Relocation` to it
Symbol information can be used to improve out-of-range/misalignment diagnostics.
It also helps R_ARM_CALL/R_ARM_THM_CALL which has different behaviors with different symbol types.
There are many (67) relocateOne() call sites used in thunks, {Arm,AArch64}errata, PLT, etc.
Rename them to `relocateNoSym()` to be clearer that there is no symbol information.
Reviewed By: grimar, peter.smith
Differential Revision: https://reviews.llvm.org/D73254
Simon Pilgrim [Sat, 25 Jan 2020 19:28:57 +0000 (19:28 +0000)]
[X86] Add tests showing ComputeNumSignBits's failure to use DemandedElts for MIN/MAX opcodes
Simon Pilgrim [Sat, 25 Jan 2020 19:15:05 +0000 (19:15 +0000)]
[SelectionDAG] ComputeNumSignBits - add support for rotate non-uniform vector amounts
Simon Pilgrim [Sat, 25 Jan 2020 18:55:47 +0000 (18:55 +0000)]
[SelectionDAG] ComputeNumSignBits - add support for rotate uniform vector amounts
Simon Pilgrim [Sat, 25 Jan 2020 18:24:15 +0000 (18:24 +0000)]
[X86] Add tests showing ComputeNumSignBits's failure to see through rotate vector amounts
Jacques Pienaar [Sat, 25 Jan 2020 17:52:46 +0000 (09:52 -0800)]
[mlir] Revert MSVC specific part of whole_archive_link
Revert the MSVC specific parts in whole_archive_link to previous form to
potentially address https://bugs.llvm.org/show_bug.cgi?id=44660.
Simon Pilgrim [Sat, 25 Jan 2020 17:36:21 +0000 (17:36 +0000)]
[TargetLowering] SimplifyDemandedBits - Remove ashr if all our demandedbits already match the sign bit
Differential Revision: https://reviews.llvm.org/D73412
Jacques Pienaar [Sat, 25 Jan 2020 17:17:31 +0000 (09:17 -0800)]
[mlir] Bootstrap doxygen config
Add basic doxygen config following clang and llvm example with minimal
changes.
Francis Visoiu Mistrih [Sat, 25 Jan 2020 17:14:24 +0000 (09:14 -0800)]
[perf-training] Update ' (in-process)' prefix handling
A recent change added a new line after the prefix, so it's now part of
the prefix list.
serge-sans-paille [Thu, 12 Dec 2019 17:38:31 +0000 (18:38 +0100)]
Improve static checks for sprintf and __builtin___sprintf_chk
Implement a pessimistic evaluator of the minimal required size for a buffer
based on the format string, and couple that with the fortified version to emit a
warning when the buffer size is lower than the lower bound computed from the
format string.
Differential Revision: https://reviews.llvm.org/D71566
Sam McCall [Sat, 25 Jan 2020 14:31:55 +0000 (15:31 +0100)]
[clangd] Make Notification a little safer.
I just fixed a test involving a similar Notification class:
18e6a65bae93a
The pattern (notify() on one thread, wait() and then destroy the Notification
on the other) seems innocuous enough. I'm not sure we actually use it in clangd,
but better safe than sorry.
Sam McCall [Sat, 25 Jan 2020 14:22:12 +0000 (15:22 +0100)]
[Support] Fix race in threading test, found by TSan
Tom Stellard [Sat, 25 Jan 2020 05:52:05 +0000 (21:52 -0800)]
AMDGPU/SILoadStoreOptimizer: Fix uninitialized variable error
This was introduced by
86c944d790728891801778b8d98c2c65a83f36a5 and
caught by the sanitizer-x86_64-linux-fast bot.
Jonas Devlieghere [Sat, 25 Jan 2020 04:54:02 +0000 (20:54 -0800)]
[lldb/Test] Disable hardware check on arm/aarch64
BreakpointSites know they're backed by hardware based on whether the
"hardware index" is set. This does not appear the to be done for
arm/aarch64.
https://llvm.org/PR44659
Jonas Devlieghere [Sat, 25 Jan 2020 04:46:51 +0000 (20:46 -0800)]
[lldb/Test] Update minidebuginfo-set-and-hit-breakpoint.test
Update test to account for the new 'hardware' field between 'resolved'
and 'hit count'.
Matt Arsenault [Sat, 25 Jan 2020 02:59:48 +0000 (21:59 -0500)]
AMDGPU: Generate test checks
Tom Stellard [Fri, 24 Jan 2020 21:07:08 +0000 (13:07 -0800)]
AMDGPU/SILoadStoreOptimizer: Improve merging of out of order offsets
Summary:
This improves merging of sequences like:
store a, ptr + 4
store b, ptr + 8
store c, ptr + 12
store d, ptr + 16
store e, ptr + 20
store f, ptr
Prior to this patch the basic block was scanned in order to find instructions
to merge and the above sequence would be transformed to:
store4 <a, b, c, d>, ptr + 4
store e, ptr + 20
store r, ptr
With this change, we now sort all the candidate merge instructions by their offset,
so instructions are visited in offset order rather than in the order they appear
in the basic block. We now transform this sequnce into:
store4 <f, a, b, c>, ptr
store2 <d, e>, ptr + 16
Another benefit of this change is that since we have sorted the mergeable lists
by offset, we can easily check if an instruction is mergeable by checking the
offset of the instruction that becomes before or after it in the sorted list.
Once we determine an instruction is not mergeable we can remove it from the list
and avoid having to do the more expensive mergeablilty checks.
Reviewers: arsenm, pendingchaos, rampitec, nhaehnle, vpykhtin
Reviewed By: arsenm, nhaehnle
Subscribers: kerbowa, merge_guards_bot, kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D65966
Jonas Devlieghere [Sat, 25 Jan 2020 01:16:02 +0000 (17:16 -0800)]
[lldb/Breakpoint] Include whether or not a breakpoint is a HW BP
Include whether or not a breakpoint is a hardware breakpoint in the
breakpoint location. This will show up in things like the breakpoint
list.
Differential revision: https://reviews.llvm.org/D73389
Jonas Devlieghere [Sat, 25 Jan 2020 02:49:44 +0000 (18:49 -0800)]
[lldb/Breakpoint] Recogize hardware breakpoints as such
Recognize hardware breakpoints as breakpoints instead of just mach
exceptions. The mach exception is the same for watch and breakpoints, so
we have to try each to figure out which is which.
Differential revision: https://reviews.llvm.org/D73401
James Nagurne [Sat, 25 Jan 2020 03:15:32 +0000 (19:15 -0800)]
[libunwind] Set LIBUNWIND_ASM_SOURCES to the ASM source language from C
I believe this is an oversight from the import of libunwind into its own
library from libc++abi.
In libc++abi, these files had the .s suffix, which indicates that the file
is a preprocessed assembly source file. This caused problems because the
files rely upon preprocessors to guard target-specific blocks.
To fix this, the CMakeLists file marked these files as C so that the
preprocessor would be run over them, but then the compiler would correctly
identify the files as assembly and compile them as such.
When imported to libunwind, these files were (correctly) renamed with .S
suffixes, which are non-preprocessed assembly. Thus, we no longer need the
C language property.
The benefit here is that the files can now benefit from CMAKE_ASM_FLAGS
rather than CMAKE_C_FLAGS.
Patch By: JamesNagurne
Differential Revision: https://reviews.llvm.org/D72952
Richard Smith [Fri, 24 Jan 2020 23:14:25 +0000 (15:14 -0800)]
DR1753: Don't permit x.NS::~T() as a pseudo-destructor name.
When used as qualified names, pseudo-destructors are always named as if
they were members of the type, never as members of the namespace
enclosing the type.
LLVM GN Syncbot [Sat, 25 Jan 2020 02:40:48 +0000 (02:40 +0000)]
[gn build] Port
dd8e0a0a23b
Nico Weber [Sat, 25 Jan 2020 02:40:26 +0000 (21:40 -0500)]
[gn build] (manually) merge
81b700e302b1
Weverything [Sat, 25 Jan 2020 02:32:54 +0000 (18:32 -0800)]
Vedant Kumar [Sat, 25 Jan 2020 02:07:34 +0000 (18:07 -0800)]
Revert "Reland: [DWARF] Allow cross-CU references of subprogram definitions"
... as well as:
Revert "[DWARF] Defer creating declaration DIEs until we prepare call site info"
This reverts commit
fa4701e1979553c2df61698ac1ac212627630442.
This reverts commit
79daafc90308787b52a5d3a7586e82acd5e374b3.
There have been reports of this assert getting hit:
CalleeDIE && "Could not find DIE for call site entry origin
Reid Kleckner [Sat, 25 Jan 2020 01:48:36 +0000 (17:48 -0800)]
[Sema] Remove unneeded TreeTransform.h includes, NFC
SemaDecl.cpp and SemaType.cpp don't have any TreeTransforms.
Reid Kleckner [Sat, 25 Jan 2020 01:43:38 +0000 (17:43 -0800)]
[Support] Fix up header comments after splitting Allocator.h, NFC
Reid Kleckner [Fri, 24 Jan 2020 23:16:22 +0000 (15:16 -0800)]
[Sema] Split availability processing into SemaAvailability.cpp
Reduces compile time of SemaDeclAttr.cpp down to 28s from 50s. The new
TU does a few RecursiveASTVisitor instantiations, so it takes 30s.
Reviewed By: rsmith
Differential Revision: https://reviews.llvm.org/D73385
Reid Kleckner [Fri, 24 Jan 2020 23:47:33 +0000 (15:47 -0800)]
[Support] Split MallocAllocator out of Allocator.h
StringMap.h is very popular (4K uses), and it doesn't need to see
BumpPtrAllocator, which is relatively expensive according to
ClangBuildAnalyzer. StringMap only needs MallocAllocator, so split that
into AllocatorBase.h and use it instead.
Here is the change in header uses:
$ diff -u thedeps-before.txt thedeps-after.txt | \
grep '^[-+] ' | sort | uniq -c | sort -nr
3993 + ../llvm/include/llvm/Support/AllocatorBase.h
758 - ../llvm/include/llvm/Support/Allocator.h
270 - ../llvm/include/llvm/Support/Alignment.h
13 - ../llvm/include/llvm/Support/Host.h
6 - ../llvm/include/llvm/ADT/StringMap.h
4 - ../llvm/include/llvm/Support/SwapByteOrder.h
4 - ../llvm/include/llvm/Support/MathExtras.h
4 - ../llvm/include/llvm/Support/AlignOf.h
4 - ../llvm/include/llvm/ADT/SmallVector.h
1 - ../llvm/include/llvm/Support/PointerLikeTypeTraits.h
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D73392
Reid Kleckner [Sat, 25 Jan 2020 01:24:10 +0000 (17:24 -0800)]
[IR] Move CallBase::getOperandBundlesAsDefs out of line, NFC
Copying operand bundles doesn't need to be inlined, and this template
instantiation shows up in ClangBuildAnalyzer.
Roland McGrath [Sat, 25 Jan 2020 00:55:11 +0000 (16:55 -0800)]
[lsan] Factor pthread-specific assumptions out of thread tracking code
This is a small refactoring to prepare for porting LSan to Fuchsia.
Factor out parts of lsan_thread.{cpp,h} that don't apply to Fuchsia.
Since existing supported systems are POSIX-based, the affected code
is moved to lsan_posix.{cpp.h}.
Patch By: mcgrathr
Differential Revision: https://reviews.llvm.org/D73309
Roland McGrath [Sat, 25 Jan 2020 00:52:12 +0000 (16:52 -0800)]
[lsan] Expose Frontier object to OS-specific LockStuffAndStopTheWorld callback
This is a small refactoring to prepare for porting LSan to Fuchsia.
On Fuchsia, the system supplies a unified API for suspending threads and
enumerating roots from OS-specific places like thread state and global data
ranges. So its LockStuffAndStopTheWorld implementation will make specific
callbacks for all the OS-specific root collection work before making the
common callback that includes the actual leak-checking logic.
Patch By: mcgrathr
Differential Revision: https://reviews.llvm.org/D72988
Quentin Colombet [Sat, 25 Jan 2020 00:15:43 +0000 (16:15 -0800)]
[GISelKnownBits] Add support for PHIs
Teach the GISelKnowBits analysis how to deal with PHI operations.
PHIs are essentially COPYs happening on edges, so we can just reuse
the code for COPY.
This is NFC COPY-wise has we leave Depth untouched when calling
computeKnownBitsImpl for COPYs, like it was before this patch.
Increasing Depth is however required for PHIs as they may loop back to
themselves and we would end up in an infinite loop if we were not
increasing Depth.
Differential Revision: https://reviews.llvm.org/D73317
Roland McGrath [Sat, 25 Jan 2020 00:33:49 +0000 (16:33 -0800)]
[sanitizer_common] Implement MemoryMappingLayout for Fuchsia
This is needed to port lsan to Fuchsia.
Patch By: mcgrathr
Differential Revision: https://reviews.llvm.org/D72886
aartbik [Sat, 25 Jan 2020 00:23:54 +0000 (16:23 -0800)]
[mlir] [VectorOps] Rewriting of vector.extract/insert_slices to other vector ops
Summary:
Rewrites the extract/insert_slices operation in terms of
strided_slice/insert_strided_slice ops with intermediate
tuple uses (that should get optimimized away with typical
usage). This is done in a separate "pass" to enable testing
this particular rewriting in isolation.
Reviewers: nicolasvasilache, andydavis1, ftynse
Reviewed By: nicolasvasilache
Subscribers: merge_guards_bot, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, liufengdb, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D73295
Jonas Devlieghere [Sat, 25 Jan 2020 00:11:18 +0000 (16:11 -0800)]
[lldb/Lit] Change the lldbtest format to behave more like shell test.
The current lldbtest format has a number of shortcomings, all related to
how we omit information based on why the test fails. For example, a
successful test would print nothing, even when `-a` is passed to lit.
It's not up to the test format to decide whether to print something or
not, that's handled by lit itself. For other test results we would
sometimes print stdout & stderr, but not always, such as when a timeout
was reached or we couldn't parse the dotest output.
This patch changes the lldbtest format and makes it behave more like
lit. We now always print the dotest invocation, the exit code, the
output to stdout & stderr. If you're used to dealing with ShTests in
lit, this will feel all very familiar.
Differential revision: https://reviews.llvm.org/D73384
Reid Kleckner [Sat, 25 Jan 2020 00:03:41 +0000 (16:03 -0800)]
[codeview] Prune SimpleTypeSerializer.h headers, NFC
These are left over from when the class was more complicated. Add a
header comment banner to the .cpp file, which was missing.
Diogo Sampaio [Fri, 24 Jan 2020 23:56:12 +0000 (23:56 +0000)]
Detect source location overflow due includes
Summary:
As discussed in http://lists.llvm.org/pipermail/cfe-dev/2019-October/063459.html
the overflow of the souce locations (limited to 2^31 chars) can generate all sorts of
weird things (bogus warnings, hangs, crashes, miscompilation and correct compilation).
In debug mode this assert would fail. So it might be a good start, as in PR42301,
to detect the failure and exit with a proper error message.
Reviewers: rsmith, thakis, miyuki
Reviewed By: miyuki
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D70183
Siva Chandra Reddy [Tue, 7 Jan 2020 21:46:12 +0000 (13:46 -0800)]
[libc] Move the implementation of mmap and munmap into a linux specific area.
This allows us to get rid of the PAGE_SIZE macro and use EXEC_PAGESIZE
from linux/param.h.
Few other points about this change:
1. The linux syscall functions have been moved into a linux specific area
instead of src/unistd/syscall.h. The Linux syscall function from unistd.h
is a public vararg function. What we have currently are linux speciif internal
overloaded C++ functions. So, moving them to a Linux only area is more
meaningful.
2. The implementations of mmap and munmap are now in a 'linux' directory
within src/sys/mman. The idea here is that platform specific
implementations will live in a platform specific subdirectories like these.
Infrastructure common to a platform will live in the platform's config
directory. For example, the linux syscall implementations live in
config/linux.
Reviewers: abrachet
Tags: #libc-project
Differential Revision: https://reviews.llvm.org/D73302
Jonas Devlieghere [Fri, 24 Jan 2020 23:06:00 +0000 (15:06 -0800)]
[lldb/debugserver] Implement hardware breakpoints for x86_64 and i386
This implements hardware breakpoints for x86_64 and i386 in debugserver.
It's based on Pedro's patch sent to lldb-commits [1] although most of it
is the same as the existing hardware watchpoint implementation.
[1] http://lists.llvm.org/pipermail/lldb-commits/Week-of-Mon-
20200113/060327.html
Differential revision: https://reviews.llvm.org/D72985
Jonas Devlieghere [Fri, 24 Jan 2020 23:03:56 +0000 (15:03 -0800)]
[lldb/debugserver] Unify the breakpoint/watchpoint interface (NFCI)
Unify the interface for enabling and disabling breakpoints with their
watchpoint counterpart. This allows both to go through
DoHardwareBreakpointAction.
Differential revision: https://reviews.llvm.org/D72981
Mitch Phillips [Fri, 24 Jan 2020 23:01:47 +0000 (15:01 -0800)]
[GWP-ASan] Add names to anonymous mappings.
Summary:
Adds names to anonymous GWP-ASan mappings. This helps Android with debugging
via. /proc/maps, as GWP-ASan-allocated mappings are now easily identifyable.
Reviewers: eugenis, cferris
Reviewed By: eugenis
Subscribers: merge_guards_bot, #sanitizers, llvm-commits, cryptoad, pcc
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D73373
@justice_adams (Justice Adams) [Fri, 24 Jan 2020 22:57:43 +0000 (17:57 -0500)]
[SelectionDag] Updated FoldConstantArithmetic method signature in preparation for merge with FoldConstantVectorArithmetic
Updated FoldConstantArithmetic method signature to match that of
FoldConstantVectorArithmetic in preparation for merging the two
functions together
https://bugs.llvm.org/show_bug.cgi?id=36544
This is the first step in combining the various
FoldConstantVectorArithmetic and FoldConstantVectorArithmetic
functions into one FoldConstantArithmetic function.
Differential Revision: https://reviews.llvm.org/D72870