Eric Fiselier [Wed, 15 Jan 2020 22:02:17 +0000 (17:02 -0500)]
[libc++] Explicitly mark basic_string<...>::npos with default
visibility.
This ensures that the version compiled into the library isn't
accidentally hidden.
Eric Fiselier [Wed, 15 Jan 2020 21:57:08 +0000 (16:57 -0500)]
[libc++] Make SFINAE'd member functions in string mutually exclusive.
This patch is needed in order to work around a GCC bug that fails to
explicitly instantiate a non-template function of a class template when
there is another overload that's a function template.
(See https://godbolt.org/z/4bUQ_b)
This patch SFINAE's away the function templates when the argument is
a basic_string.
Vedant Kumar [Wed, 15 Jan 2020 21:59:12 +0000 (13:59 -0800)]
lldb: Run TestCrossDSOTailCalls.py and TestCrossObjectTailCalls.py on Darwin only
See https://bugs.llvm.org/show_bug.cgi?id=44561, these tests are failing
on an aarch64/Linux bot:
http://lab.llvm.org:8011/builders/lldb-aarch64-ubuntu/builds/655
For some reason the backtrace the tests are expecting to find is
incomplete.
Jinsong Ji [Wed, 15 Jan 2020 21:19:34 +0000 (21:19 +0000)]
[MachineScheduler][NFC] Don't swap when we can't cluster
https://reviews.llvm.org/D72706 tried to reduce reordering due to mem op
clustering. This patch avoid doing the swap when we can't cluster.
Reviewed By: rampitec
Differential Revision: https://reviews.llvm.org/D72800
Mircea Trofin [Wed, 15 Jan 2020 21:33:58 +0000 (13:33 -0800)]
[NFC] Refactor InlineResult for readability
Summary:
InlineResult is used both in APIs assessing whether a call site is
inlinable (e.g. llvm::isInlineViable) as well as in the function
inlining utility (llvm::InlineFunction). It means slightly different
things (can/should inlining happen, vs did it happen), and the
implicit casting may introduce ambiguity (casting from 'false' in
InlineFunction will default a message about hight costs,
which is incorrect here).
The change renames the type to a more generic name, and disables
implicit constructors.
Reviewers: eraman, davidxl
Reviewed By: davidxl
Subscribers: kerbowa, arsenm, jvesely, nhaehnle, eraman, hiraditya, haicheng, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72744
Jacques Pienaar [Thu, 9 Jan 2020 02:48:38 +0000 (18:48 -0800)]
[mlir] Add shaped container component type interface
Summary:
* Add shaped container type interface which allows infering the shape, element
type and attribute of shaped container type separately. Show usage by way of
tensor type inference trait which combines the shape & element type in
infering a tensor type;
- All components need not be specified;
- Attribute is added to allow for layout attribute that was previously
discussed;
* Expand the test driver to make it easier to test new creation instances
(adding new operands or ops with attributes or regions would trigger build
functions/type inference methods);
- The verification part will be moved out of the test and to verify method
instead of ops implementing the type inference interface in a follow up;
* Add MLIRContext as arg to possible to create type for ops without arguments,
region or location;
* Also move out the section in OpDefinitions doc to separate ShapeInference doc
where the shape function requirements can be captured;
- Part of this would move to the shape dialect and/or shape dialect ops be
included as subsection of this doc;
* Update ODS's variable usage to match camelBack format for builder,
state and arg variables;
- I could have split this out, but I had to make some changes around
these and the inconsistency bugged me :)
Differential Revision: https://reviews.llvm.org/D72432
Zhongduo Lin [Wed, 15 Jan 2020 21:22:47 +0000 (16:22 -0500)]
[NFC][IndVarSimplify] remove duplicate code in widenWithVariantLoadUseCodegen.
Summary: Duplicate code in widenWithVariantLoadUseCodegen is removed and also use assert to check unknown extension type as it should be filtered out by the pre condition check before calling this function.
Reviewers: az, sanjoy, sebpop, efriedma, javed.absar, sanjoy.google
Reviewed By: efriedma
Subscribers: hiraditya, llvm-commits, amehsan
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72652
Richard Smith [Thu, 9 May 2019 06:30:37 +0000 (23:30 -0700)]
PR17164: Change clang's default behavior from -flax-vector-conversions=all to -flax-vector-conversions=integer.
Summary:
See proposal on cfe-dev:
http://lists.llvm.org/pipermail/cfe-dev/2019-April/062030.html
Reviewers: SjoerdMeijer, eli.friedman
Subscribers: kristof.beyls, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D67678
Richard Smith [Tue, 17 Sep 2019 03:36:55 +0000 (20:36 -0700)]
Work around PR43337: don't try to use the vec_sel overloads for vector long long, since clang's <altivec.h> doesn't provide it yet!
Vedant Kumar [Wed, 15 Jan 2020 19:22:06 +0000 (11:22 -0800)]
DebugInfo: Factor out logic to update locations in MD_loop metadata, NFC
Factor out the logic needed to update debug locations contained within
MD_loop metadata.
This refactor is preparation for a future change that also needs to
rewrite MD_loop metadata.
rdar://
45507940
Vedant Kumar [Fri, 10 Jan 2020 02:00:33 +0000 (18:00 -0800)]
[DWARF] Emit DW_AT_call_return_pc as an address
This reverts D53469, which changed llvm's DWARF emission to emit
DW_AT_call_return_pc as a function-local offset. Such an encoding is not
compatible with post-link block re-ordering tools and isn't standards-
compliant.
In addition to reverting back to the original DW_AT_call_return_pc
encoding, teach lldb how to fix up DW_AT_call_return_pc when the address
comes from an object file pointed-to by a debug map. While doing this I
noticed that lldb's support for tail calls that cross a DSO/object file
boundary wasn't covered, so I added tests for that. This latter case
exercises the newly added return PC fixup.
The dsymutil changes in this patch were originally included in D49887:
the associated test should be sufficient to test DW_AT_call_return_pc
encoding purely on the llvm side.
Differential Revision: https://reviews.llvm.org/D72489
Lang Hames [Wed, 15 Jan 2020 19:30:04 +0000 (11:30 -0800)]
[docs][ORC] Update the laziness section of the ORCv2 design doc.
This updates the discussion of lazy reexports, fixes a TBD for a usage example,
and adds a reference to the fully worked lazy reexports example that was added
in
e9e26c01cd865da678b1af6ba5f417c713956a66.
Nico Weber [Wed, 15 Jan 2020 18:35:58 +0000 (13:35 -0500)]
[gn build] re-run "gn format" with trunk gn
Nico Weber [Wed, 15 Jan 2020 18:30:57 +0000 (13:30 -0500)]
[gn build] add multi-line forcing comments in more places
Nico Weber [Wed, 15 Jan 2020 18:24:28 +0000 (13:24 -0500)]
[gn build] make "gn format" comment slightly more concise
Craig Topper [Wed, 15 Jan 2020 02:19:54 +0000 (18:19 -0800)]
[Mips] Add FileCheck to a test that just tested for a crash.
I believe the generated code here can suffer from double rounding.
So I wanted to capture the existing codegen so we can make
decisions about how to fix it.
Lang Hames [Wed, 15 Jan 2020 18:20:10 +0000 (10:20 -0800)]
[ORC] Set setCloneToNewContextOnEmit on LLJIT's transform layer when needed.
Based on Don Hinton's patch in https://reviews.llvm.org/D72406. This feature
was accidentally left out of
e9e26c01cd865da678b1af6ba5f417c713956a66, and
would have pessimized concurrent compilation in the default case.
Thanks for spotting this Don!
Amara Emerson [Wed, 15 Jan 2020 16:49:22 +0000 (08:49 -0800)]
Revert "Revert rG6078f2fedcac5797ac39ee5ef3fd7a35ef1202d5 - "[AArch64][GlobalISel]: Support @llvm.{return,frame}address selection.""
The original change wasn't constraining the operand regclasses which broke EXPENSIVE_CHECKS.
Nico Weber [Wed, 15 Jan 2020 17:59:45 +0000 (12:59 -0500)]
[gn build] Reformat all build files
Ran `git ls-files '*.gn' '*.gni' | xargs llvm/utils/gn/gn.py format`.
The motivation is to reformat them with trunk gn again right after.
Trunk gn changed formatting of some single-element lists.
Nico Weber [Wed, 15 Jan 2020 15:45:02 +0000 (10:45 -0500)]
Replace CLANG_SPAWN_CC1 env var with a driver mode flag
Flags are clang's default UI is flags.
We can have an env var in addition to that, but in D69825 nobody has yet
mentioned why this needs an env var, so omit it for now. If someone
needs to set the flag via env var, the existing CCC_OVERRIDE_OPTIONS
mechanism works for it (set CCC_OVERRIDE_OPTIONS=+-fno-integrated-cc1
for example).
Also mention the cc1-in-process change in the release notes.
Also spruce up the test a bit so it actually tests something :)
Differential Revision: https://reviews.llvm.org/D72769
Mark Murray [Mon, 13 Jan 2020 13:21:30 +0000 (13:21 +0000)]
[ARM][MVE][Intrinsics] Add VMINAQ, VMINNMAQ, VMAXAQ, VMAXNMAQ intrinsics.
Summary: Add VMINAQ, VMINNMAQ, VMAXAQ, VMAXNMAQ intrinsics and unit tests.
Reviewers: simon_tatham, miyuki, dmgreen
Subscribers: kristof.beyls, hiraditya, cfe-commits, llvm-commits
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D72761
Kadir Cetinkaya [Wed, 15 Jan 2020 16:59:02 +0000 (17:59 +0100)]
[clangd] Extract string literals in macro arguments to unbreak gcc buildbots
Benjamin Kramer [Wed, 15 Jan 2020 16:51:51 +0000 (17:51 +0100)]
Revert "[mlir] Create a gpu.module operation for the GPU Dialect."
This reverts commit
4624a1e8ac8a3f69cc887403b976f538f587744a. Causing
problems downstream.
Teresa Johnson [Wed, 15 Jan 2020 16:35:12 +0000 (08:35 -0800)]
Fix bot by adjusting wildcard matching
I noticed one bot failure due to
24a00ef2404104e9ca6fbd7eb523a8a340be9d99 because the wildcard matching
was not working as intended, fixed it to act similar to other checks of
CGSCCToFunctionPassAdaptor.
evgeny [Wed, 15 Jan 2020 16:29:01 +0000 (19:29 +0300)]
[ThinLTO] Always import constants
This patch imports constant variables even when they can't be internalized
(which results in promotion). This offers some extra constant folding
opportunities.
Differential revision: https://reviews.llvm.org/D70404
Arkady Shlykov [Wed, 15 Jan 2020 14:12:34 +0000 (06:12 -0800)]
[Loop Peeling] Add possibility to enable peeling on loop nests.
Summary:
Current peeling implementation bails out in case of loop nests.
The patch introduces a field in TargetTransformInfo structure that
certain targets can use to relax the constraints if it's
profitable (disabled by default).
Also additional option is added to enable peeling manually for
experimenting and testing purposes.
Reviewers: fhahn, lebedev.ri, xbolva00
Reviewed By: xbolva00
Subscribers: xbolva00, hiraditya, zzheng, llvm-commits
Differential Revision: https://reviews.llvm.org/D70304
Sanjay Patel [Wed, 15 Jan 2020 13:23:46 +0000 (08:23 -0500)]
[InstCombine] reassociate fsub+fsub into fsub+fadd
As discussed in the motivating PR44509:
https://bugs.llvm.org/show_bug.cgi?id=44509
...we can end up with worse code using fast-math than without.
This is because the reassociate pass greedily transforms fsub
into fneg/fadd and apparently (based on the regression tests
seen here) expects instcombine to clean that up if it wasn't
profitable. But we were missing this fold:
(X - Y) - Z --> X - (Y + Z)
There's another, more specific case that I think we should
handle as shown in the "fake" fneg test (but missed with a real
fneg), but that's another patch. That may be tricky to get
right without conflicting with existing transforms for fneg.
Differential Revision: https://reviews.llvm.org/D72521
Nicolas Vasilache [Wed, 15 Jan 2020 16:12:53 +0000 (11:12 -0500)]
[mlir][Linalg] NFC - Hotfix for gcc-5 build
Nicolas Vasilache [Wed, 15 Jan 2020 14:48:49 +0000 (09:48 -0500)]
[mlir][Linalg] NFC - Cleanup Linalg Pass locations and namespacing
Summary:
This diff moves the conversion pass declaration closer to its definition
and makes the namespacing of passes consistent with the rest of the
infrastructure (i.e. `mlir::linalg::createXXXPass` -> `mlir::createXXXPass`).
Reviewers: ftynse, jpienaar, mehdi_amini
Subscribers: rriddle, burmako, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72766
Lang Hames [Wed, 15 Jan 2020 02:14:00 +0000 (18:14 -0800)]
[ORC] Simplify use of lazyReexports with LLJIT.
This patch makes the target triple available via the LLJIT interface, and moves
the IRTransformLayer from LLLazyJIT down into LLJIT. Together these changes make
it easier to use the lazyReexports utility with LLJIT, and to apply IR
transforms to code as it is compiled in LLJIT (rather than requiring transforms
to be applied manually before code is added). An code example is added in
llvm/examples/LLJITExamples/LLJITWithLazyReexports
Lang Hames [Wed, 15 Jan 2020 01:09:02 +0000 (17:09 -0800)]
[ORC] Update lazyReexports to support aliases with different symbol names.
A bug in the existing implementation meant that lazyReexports would not work if
the aliased name differed from the alias's name, i.e. all lazy reexports had to
be of the form (lib1, name) -> (lib2, name). This patch fixes the issue by
capturing the alias's name in the NotifyResolved callback. To simplify this
capture, and the LazyCallThroughManager code in general, the NotifyResolved
callback is updated to use llvm::unique_function rather than a custom class.
No test case yet: This can only be tested at runtime, and the only in-tree
client (lli) always uses aliases with matching names. I will add a new LLJIT
example shortly that will directly test the lazyReexports API and the
non-trivial alias use case.
Hubert Tong [Wed, 15 Jan 2020 15:42:27 +0000 (10:42 -0500)]
DWARFDebugLine.cpp: Format unknown line number standard opcodes
Summary:
This patch implements `formatv()` formatting for `dwarf::LineNumberOps`
and makes use of it for the `llvm-dwarfdump --debug-line` dump.
Previously, unknown line number standard opcodes would lead to undefined
behaviour. The code would attempt to format the data pointer of an empty
`StringRef` (a null pointer) using `%s`. According to the description
for `format()`, use of that interface carries the "risk of `printf`".
Passing a null pointer in place of an array to a C library function
results in undefined behaviour.
Reviewers: jhenderson, daltenty, stevewan
Reviewed By: jhenderson
Subscribers: aprantl, hiraditya, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72369
Hubert Tong [Wed, 15 Jan 2020 15:42:12 +0000 (10:42 -0500)]
[CMake] Enable -qfuncsect when building with IBM XL
Summary:
The IBM XL compiler uses `-qfuncsect` for `-ffunction-sections`.
The comment about sanitizers and `-f[no-]function-sections` is corrected
also, as it is pertinent to this patch.
The sanitizer-related use of `-fno-function-sections` is associated with
powerpc64le, a target for which there is an IBM XL compiler, so that use
is updated in this patch to apply `-qnofuncsect` in case a build using
the XL compiler is viable on that platform.
This patch has been verified with the XL compiler on AIX only.
Reviewers: daltenty, stevewan
Reviewed By: daltenty
Subscribers: mgorny, steven.zhang, #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D72335
Nicolas Vasilache [Wed, 15 Jan 2020 15:36:25 +0000 (10:36 -0500)]
[mlir][Linalg] NFC - Hotfix for gcc-5 build
Georgii Rymar [Wed, 15 Jan 2020 13:17:09 +0000 (16:17 +0300)]
[llvm-readobj][test] - Cleanup SHT_RELR sections testing.
After recent changes (D71872) in yaml2obj, it is possible so cleanup
testing of the SHT_RELR sections.
Differential revision: https://reviews.llvm.org/D71874
Teresa Johnson [Mon, 13 Jan 2020 19:09:13 +0000 (11:09 -0800)]
Restore "[ThinLTO] Add additional ThinLTO pipeline testing with new PM"
This restores
2af97be8027a0823b88d4b6a07fc5eedb440bc1f (reverted at
6288f86e870c7bb7fe47cc138320b9eb34c93941), with all the fixes I had
applied at the time, along with a new fix for non-determinism in the
ordering of a couple of passes due to being accessed as parameters on
the same call.
I've also added --dump-input=fail to the new tests so I can more
thoroughly fix any additional failures.
Kadir Cetinkaya [Wed, 15 Jan 2020 15:22:24 +0000 (16:22 +0100)]
[clangd] Fix windows buildbots
Nico Weber [Wed, 15 Jan 2020 15:05:25 +0000 (10:05 -0500)]
[gn build] find mistakes like the one fixed in
72b5989e0d1 at build time
Simon Tatham [Wed, 15 Jan 2020 14:07:04 +0000 (14:07 +0000)]
[clang] New __attribute__((__clang_arm_mve_strict_polymorphism)).
This is applied to the vector types defined in <arm_mve.h> for use
with the intrinsics for the ARM MVE vector architecture.
Its purpose is to inhibit lax vector conversions, but only in the
context of overload resolution of the MVE polymorphic intrinsic
functions. This solves an ambiguity problem with polymorphic MVE
intrinsics that take a vector and a scalar argument: the scalar
argument can often have the wrong integer type due to default integer
promotions or unsuffixed literals, and therefore, the type of the
vector argument should be considered trustworthy when resolving MVE
polymorphism.
As part of the same change, I've added the new attribute to the
declarations generated by the MveEmitter Tablegen backend (and
corrected a namespace issue with the other attribute while I was
there).
Reviewers: aaron.ballman, dmgreen
Reviewed By: aaron.ballman
Subscribers: kristof.beyls, JDevlieghere, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D72518
Kadir Cetinkaya [Mon, 13 Jan 2020 16:21:31 +0000 (17:21 +0100)]
[clangd] Rearrange type, returntype and parameters in hover card
Summary:
Moves type/returntype into its own line as it is more readable in cases
where the type is long.
Also gives parameter lists a heading, `Parameters:` to make them stand out.
Leaves the `right arrow` instead of `Returns: ` before Return Type to make
output more symmetric.
```
function foo
Returns: ret_type
Parameters:
- int x
```
vs
```
function foo
🡺 ret_type
Parameters:
- int x
```
Reviewers: sammccall, ilya-biryukov
Subscribers: MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D72623
Kadir Cetinkaya [Mon, 13 Jan 2020 16:14:24 +0000 (17:14 +0100)]
[clangd] Add a ruler after header in hover
Reviewers: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D72622
Nico Weber [Wed, 15 Jan 2020 14:49:32 +0000 (09:49 -0500)]
[gn build] (manually) port
b4a99a061f51 better
Nicolas Vasilache [Wed, 15 Jan 2020 14:28:12 +0000 (09:28 -0500)]
[mlir][EDSC] Refactor dependencies involving EDSCs.
Summary: This diff removes the dependency of LinalgOps and VectorOps on EDSCs.
Reviewers: jpienaar, ftynse
Reviewed By: ftynse
Subscribers: merge_guards_bot, mgorny, mehdi_amini, rriddle, burmako, shauheen, antiagainst, csigg, arpith-jacob, mgester, lucyrfox, herhut, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72481
Alex Richardson [Wed, 15 Jan 2020 14:32:14 +0000 (14:32 +0000)]
[ELF] Avoid false-positive assert in getErrPlace()
This assertion was added as part of D70659 but did not account for .bss
input sections. I noticed that this assert was incorrectly triggering
while building FreeBSD for MIPS64. Fixed by relaxing the assert to also
account for SHT_NOBITS input sections and adjust the test
mips-jalr-non-function.s to link a file with a .bss section first.
Reviewed By: MaskRay, grimar
Differential Revision: https://reviews.llvm.org/D72567
Kadir Cetinkaya [Fri, 10 Jan 2020 12:11:09 +0000 (13:11 +0100)]
[clangd] Show hower info for expressions
Summary:
This currently populates only the Name with the expression's type and
Value if expression is evaluatable.
Fixes https://github.com/clangd/clangd/issues/56
Reviewers: sammccall
Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, usaxena95, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D72500
Ulrich Weigand [Wed, 15 Jan 2020 14:08:35 +0000 (15:08 +0100)]
[FPEnv] Address post-commit review comment for D71467
Remove a bit of code duplication between CreateFCmp and CreateFCmpS
by creating a shared helper function.
Alex Zinenko [Wed, 15 Jan 2020 13:56:25 +0000 (14:56 +0100)]
[mlir] LLVM import: handle function-typed constants
The current implementation of the LLVM-to-MLIR translation could not handle
functions used as constant values in instructions. The handling is added
trivially as `llvm.mlir.constant` can define constants of function type using
SymbolRef attributes, which works even for functions that have not been
declared yet.
Matt Arsenault [Fri, 10 Jan 2020 02:53:28 +0000 (21:53 -0500)]
GlobalISel: Implement lower for G_BITCAST
Bitcast only really applies between scalars and vectors. Implement as
an unmerge and remerge. The test needs to tolerate failure since one
of the unmerges currently fails to legalize.
Matt Arsenault [Tue, 31 Dec 2019 20:28:41 +0000 (15:28 -0500)]
AMDGPU: Partially directly select llvm.amdgcn.interp.p1.f16
The 16 bank LDS case is complicated due to using multiple
instructions. If I attempt to write a pattern for it, the generated
selector incorrectly places the copy to m0 after the first
instruction, so that needs to be separately addressed.
Also fix not gluing the copy to m0 to the second operation in the
second half of the 16 bank lowering.
Matt Arsenault [Fri, 10 Jan 2020 14:47:17 +0000 (09:47 -0500)]
GlobalISel: Fix narrowScalar for G_ANYEXT results
This is nearly the same as G_ZEXT.
Matt Arsenault [Tue, 14 Jan 2020 18:01:46 +0000 (13:01 -0500)]
TableGen: Delete some copy constuctors
Some register related machinery relies on uniqued, static pointers for
register classes and subregisters, so try to make sure these are never
copied.
Matt Arsenault [Tue, 14 Jan 2020 19:09:06 +0000 (14:09 -0500)]
TableGen/GlobalISel: Don't take reference to temporary values
These return temporary Optional<> values which are immediately
destroyed. I'm not sure why no sanitizers seem to have caught this,
but I encountered crashes on these in a future patch.
Matt Arsenault [Tue, 14 Jan 2020 18:48:34 +0000 (13:48 -0500)]
TableGen/GlobalISel: Don't reconstruct CodeGenRegBank
The maps for dealing with the relationships between different register
classes and subregister indexes rely on unique pointers for every
class/index. By constructing a second copy of CodeGenRegBank, two
different pointer values existed for a given subregister depending on
where you were querying.
Use the existing CodeGenRegBank owned by the CodeGenTarget instead of
constructing a second copy. This avoids incorrectly failing map
lookups in a future change.
Luís Marques [Wed, 15 Jan 2020 13:47:23 +0000 (13:47 +0000)]
[RISCV] Fix test for inline asm z constraint modifier
Summary: Use an `i` constraint in the test, to correctly trigger the code for
handling the `z` constraint modifier.
Reviewers: asb, lenary, jrtc27
Reviewed By: lenary, jrtc27
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72134
Soumi Manna [Wed, 15 Jan 2020 13:47:22 +0000 (08:47 -0500)]
Further implement CWG 2292
The core issue is that simple-template-id is ambiguous between class-name
and type-name. This fixes PR43966.
Djordje Todorovic [Wed, 15 Jan 2020 12:00:14 +0000 (13:00 +0100)]
[llvm-locstats] Add the --compare option
Draw a plot showing the difference in debug loc coverage on two
files provided.
Differential Revision: https://reviews.llvm.org/D71870
Nemanja Ivanovic [Wed, 15 Jan 2020 13:00:22 +0000 (07:00 -0600)]
[PowerPC] Legalize saturating vector add/sub
These intrinsics and the corresponding ISD nodes were recently added. PPC has
instructions that do this for vectors. Legalize them and add patterns to emit
the satuarting instructions.
Differential revision: https://reviews.llvm.org/D71940
Hans Wennborg [Wed, 15 Jan 2020 09:02:56 +0000 (10:02 +0100)]
Bump the trunk major version to 11
and clear the release notes.
Simon Pilgrim [Wed, 15 Jan 2020 12:36:11 +0000 (12:36 +0000)]
Revert rG6078f2fedcac5797ac39ee5ef3fd7a35ef1202d5 - "[AArch64][GlobalISel]: Support @llvm.{return,frame}address selection."
These intrinsics expand to a variable number of instructions so just like in
ISelLowering.cpp we use custom code to deal with them.
Committing Tim's original patch.
Differential Revision: https://reviews.llvm.org/D65656
----
Breaks EXPENSIVE_CHECKS builds.
Zakk Chen [Fri, 29 Nov 2019 02:00:54 +0000 (18:00 -0800)]
[RISCV] Support ABI checking with per function target-features
if users don't specific -mattr, the default target-feature come
from IR attribute.
Reviewers: lenary, asb
Reviewed By: lenary, asb
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70837
Zakk Chen [Wed, 15 Jan 2020 12:32:57 +0000 (04:32 -0800)]
Revert "[RISCV] Support ABI checking with per function target-features"
This reverts commit
109e4d12edda07bdec139de36d9fdb6f73399f92.
Simon Pilgrim [Wed, 15 Jan 2020 12:05:30 +0000 (12:05 +0000)]
Fix Wdocumentation warning. NFC.
Simon Pilgrim [Wed, 15 Jan 2020 11:51:55 +0000 (11:51 +0000)]
RegisterClassInfo::computePSetLimit - assert that we actually find a register.
Fixes "pointer is null" clang static analyzer warning.
Simon Pilgrim [Wed, 15 Jan 2020 11:49:21 +0000 (11:49 +0000)]
Fix "pointer is null" static analyzer warning. NFCI.
Use cast<> instead of dyn_cast<> since the pointer is always dereferenced and cast<> will perform the null assertion for us.
Georgii Rymar [Wed, 15 Jan 2020 11:29:29 +0000 (14:29 +0300)]
[yaml2obj/obj2yaml] - Add support for SHT_RELR sections.
Note: this is a reland with a trivial 2 lines fix in ELFState<ELFT>::writeSectionContent.
It adds a check similar to ones we already have for other sections to fix the case revealed
by bots, like http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/60744.
The encoded sequence of Elf*_Relr entries in a SHT_RELR section looks
like [
AAAAAAAA BBBBBBB1 BBBBBBB1 ...
AAAAAAAA BBBBBB1 ... ]
i.e. start with an address, followed by any number of bitmaps. The address
entry encodes 1 relocation. The subsequent bitmap entries encode up to 63(31)
relocations each, at subsequent offsets following the last address entry.
More information is here:
https://github.com/llvm-mirror/llvm/blob/master/lib/Object/ELF.cpp#L272
This patch adds a support for these sections.
Differential revision: https://reviews.llvm.org/D71872
Raphael Isemann [Wed, 15 Jan 2020 12:03:25 +0000 (13:03 +0100)]
[lldb] Add expect_expr function for testing expression evaluation in dotests.
Summary:
This patch adds a new function to lldbtest: `expect_expr`. This function is supposed to replace the current approach
of calling `expect`/`runCmd` with `expr`, `p` etc.
`expect_expr` allows evaluating expressions and matching their value/summary/type/error message without
having to do any string matching that might allow unintended passes (e.g., `self.expect("expr 3+4", substrs=["7"])`
can unexpectedly pass for results like `(Class7) $0 = 7`, `(int) $7 = 22`, `(int) $0 = 77` and so on).
This only uses the function in a few places to test and demonstrate it. I'll migrate the tests in follow up commits.
Reviewers: JDevlieghere, shafik, labath
Reviewed By: labath
Subscribers: christof, abidh, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D70314
Benjamin Kramer [Wed, 15 Jan 2020 11:50:27 +0000 (12:50 +0100)]
[AArch64][SVE] Fold variable into assert to silence unused variable warnings in Release builds
Arkady Shlykov [Tue, 14 Jan 2020 15:46:46 +0000 (07:46 -0800)]
[NFC] Adjust test cases numbering, test commit.
Summary:
Test case test14 is missing, adjust the numbering to have a consecutive range.
Also a test commit to verify commit access.
Djordje Todorovic [Wed, 15 Jan 2020 11:31:09 +0000 (12:31 +0100)]
[llvm-locstats] Fix the docs
Add the missing picture for the documentation.
Scott Egerton [Wed, 15 Jan 2020 11:28:55 +0000 (11:28 +0000)]
[Lexer] Allow UCN for dollar symbol '\u0024' in identifiers when using -fdollars-in-identifiers flag.
Summary:
Previously, the -fdollars-in-identifiers flag allows the '$' symbol to be used
in an identifier but the universal character name equivalent '\u0024' is not
allowed.
This patch changes this, so that \u0024 is valid in identifiers.
Reviewers: rsmith, jordan_rose
Reviewed By: rsmith
Subscribers: dexonsmith, simoncook, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D71758
Georgii Rymar [Wed, 15 Jan 2020 11:16:03 +0000 (14:16 +0300)]
Revert "[yaml2obj/obj2yaml] - Add support for SHT_RELR sections."
This reverts commit
46d11e30ee807accefd14e0b7f306647963a39b5.
It broke bots. E.g. http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast/builds/60744
Russell Gallop [Wed, 8 Jan 2020 14:48:21 +0000 (14:48 +0000)]
[Support] Replace Windows __declspec(thread) with thread_local for LLVM_THREAD_LOCAL
Windows minimum host tools version is now VS2017, which supports C++11
thread_local so use this for LLVM_THREAD_LOCAL instead of
declspec(thread). According to [1], thread_local is implemented with
declspec(thread) so this should be NFC.
[1] https://docs.microsoft.com/en-us/cpp/cpp/thread?view=vs-2017
Differential Revision: https://reviews.llvm.org/D72399
Cullen Rhodes [Wed, 8 Jan 2020 14:25:20 +0000 (14:25 +0000)]
[AArch64][SVE] Add ptest intrinsics
Summary:
Implements the following intrinsics:
* @llvm.aarch64.sve.ptest.any
* @llvm.aarch64.sve.ptest.first
* @llvm.aarch64.sve.ptest.last
Reviewers: sdesmalen, efriedma, dancgr, mgudim, cameron.mcinally, rengolin
Reviewed By: efriedma
Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D72398
Djordje Todorovic [Wed, 15 Jan 2020 10:50:59 +0000 (11:50 +0100)]
[llvm-locstats] Add the --draw-plot option
When using the option, draw the histogram representing the debug
location buckets. The resulting histogram will be saved in a png
file.
Differential Revision: https://reviews.llvm.org/D71869
Georgii Rymar [Tue, 24 Dec 2019 09:45:53 +0000 (12:45 +0300)]
[yaml2obj/obj2yaml] - Add support for SHT_RELR sections.
The encoded sequence of Elf*_Relr entries in a SHT_RELR section looks
like [
AAAAAAAA BBBBBBB1 BBBBBBB1 ...
AAAAAAAA BBBBBB1 ... ]
i.e. start with an address, followed by any number of bitmaps. The address
entry encodes 1 relocation. The subsequent bitmap entries encode up to 63(31)
relocations each, at subsequent offsets following the last address entry.
More information is here:
https://github.com/llvm-mirror/llvm/blob/master/lib/Object/ELF.cpp#L272
This patch adds a support for these sections.
Differential revision: https://reviews.llvm.org/D71872
Scott Egerton [Wed, 15 Jan 2020 10:43:42 +0000 (10:43 +0000)]
Revert "[RISCV] Add Clang frontend support for Bitmanip extension"
This reverts commit
57cf6ee9c84434161088c39a6f8dd2aae14eb12d.
Djordje Todorovic [Mon, 13 Jan 2020 11:31:28 +0000 (12:31 +0100)]
[llvm-locstats][NFC] Support OOP concept
Making these changes, the code becomes more robust and easier for
adding the new features.
-Introduce the LocationStats class representing the statistics
-Add the pretty_print() method in the LocationStats class
-Add additional '-' for the program options
-Add the verify_program_inputs() function
-Add the parse_locstats() function
-Rename 'results' => 'opts'
-Add more comments
Differential Revision: https://reviews.llvm.org/D71868
Zakk Chen [Fri, 29 Nov 2019 02:00:54 +0000 (18:00 -0800)]
[RISCV] Support ABI checking with per function target-features
if users don't specific -mattr, the default target-feature come
from IR attribute.
Igor Kudrin [Mon, 23 Dec 2019 11:00:55 +0000 (18:00 +0700)]
[DWARF] Fix DWARFDebugAranges to support 64-bit CU offsets.
DWARFContext, the only user of this class, can already handle such offsets.
Differential Revision: https://reviews.llvm.org/D71834
LLVM GN Syncbot [Wed, 15 Jan 2020 09:58:27 +0000 (09:58 +0000)]
[gn build] Port
0dc6c249bff
Igor Kudrin [Tue, 14 Jan 2020 13:05:27 +0000 (20:05 +0700)]
[MachO] Add a test for detecting reserved unit length.
This is a follow-up for D71546 to add a corresponding unit test.
Differential Revision: https://reviews.llvm.org/D72695
cdevadas [Fri, 10 Jan 2020 16:53:27 +0000 (22:23 +0530)]
[AMDGPU] Invert the handling of skip insertion.
The current implementation of skip insertion (SIInsertSkip) makes it a
mandatory pass required for correctness. Initially, the idea was to
have an optional pass. This patch inserts the s_cbranch_execz upfront
during SILowerControlFlow to skip over the sections of code when no
lanes are active. Later, SIRemoveShortExecBranches removes the skips
for short branches, unless there is a sideeffect and the skip branch is
really necessary.
This new pass will replace the handling of skip insertion in the
existing SIInsertSkip Pass.
Differential revision: https://reviews.llvm.org/D68092
Kazushi (Jam) Marukawa [Tue, 14 Jan 2020 08:58:39 +0000 (09:58 +0100)]
[VE] Minimal codegen for empty functions
Summary:
This patch implements minimal VE code generation for empty function bodies (no args, no value return).
Contents
* empty function code generation test.
* Minimal function prologue & epilogue emission
* Instruction formats and instruction definitions as far as required for the empty function prologue & epilogue.
* I64 register class definitions.
Reviewed By: arsenm
Differential Revision: https://reviews.llvm.org/D72598
Craig Topper [Wed, 15 Jan 2020 06:40:56 +0000 (22:40 -0800)]
[X86] Don't call LowerUINT_TO_FP_i32 for i32->f80 on 32-bit targets with sse2.
We were performing an emulated i32->f64 in the SSE registers, then
storing that value to memory and doing a extload into the X87
domain.
After this patch we'll now just store the i32 to memory along
with an i32 0. Then do a 64-bit FILD to f80 completely in the X87
unit. This matches what we do without SSE.
David Green [Wed, 15 Jan 2020 07:50:14 +0000 (07:50 +0000)]
[ARM] Reegenerate MVE tests. NFC
The mve-phireg.ll test no longer really tests what it was added for,
but the original case was fairly complex. I've left the test in as a
general codegen test.
Hideto Ueno [Wed, 15 Jan 2020 06:25:52 +0000 (15:25 +0900)]
[Attributor] AAValueConstantRange: Value range analysis using constant range
Summary:
This patch introduces `AAValueConstantRange`, which answers a possible range for integer value in a specific program point.
One of the motivations is propagating existing `range` metadata. (I think we need to change the situation that `range` metadata cannot be put to Argument).
The state is a tuple of `ConstantRange` and it is initialized to (known, assumed) = ([-∞, +∞], empty).
Currently, AAValueConstantRange is created in `getAssumedConstant` method when `AAValueSimplify` returns `nullptr`(worst state).
Supported
- BinaryOperator(add, sub, ...)
- CmpInst(icmp eq, ...)
- !range metadata
`AAValueConstantRange` is not intended to extend to polyhedral range value analysis.
Reviewers: jdoerfert, sstefan1
Reviewed By: jdoerfert
Subscribers: phosek, davezarzycki, baziotis, hiraditya, javed.absar, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D71620
David Green [Tue, 14 Jan 2020 17:00:32 +0000 (17:00 +0000)]
[Scheduler] Adjust interface of CreateTargetMIHazardRecognizer to use ScheduleDAGMI. NFC
All the callers of this function will be ScheduleDAGMI from the
MachineScheduler. This allows us to use the extra info available in
ScheduleDAGMI without resorting to awkward casts.
Jonas Devlieghere [Wed, 15 Jan 2020 07:05:55 +0000 (23:05 -0800)]
[lldb/test] Add test for CMTime data formatter
Add a test for the CMTime data formatter. The coverage report showed
that this code path was untested.
Jonas Devlieghere [Wed, 15 Jan 2020 06:27:00 +0000 (22:27 -0800)]
[lldb/CommandInterpreter] Remove flag that's always true (NFC)
The 'asynchronously' argument to both GetLLDBCommandsFromIOHandler and
GetPythonCommandsFromIOHandler is true for all call sites. This commit
simplifies the API by dropping it and giving the baton a default
argument.
Reid Kleckner [Wed, 15 Jan 2020 06:19:30 +0000 (22:19 -0800)]
Fix up ms-pch-macro.c test to pass on non-Windows
Fangrui Song [Thu, 9 Jan 2020 08:41:48 +0000 (00:41 -0800)]
[Driver][X86] Add -malign-branch* and -mbranches-within-32B-boundaries
These driver options perform some checking and delegate to MC options -x86-align-branch* and -x86-branches-within-32B-boundaries.
Reviewed By: skan
Differential Revision: https://reviews.llvm.org/D72463
Weverything [Wed, 15 Jan 2020 05:12:15 +0000 (21:12 -0800)]
[ODRHash] Fix wrong error message with bitfields and mutable.
Add a check to bitfield mismatches that may have caused Clang to
give an error about the bitfield instead of being mutable.
Justin Hibbits [Tue, 14 Jan 2020 02:06:29 +0000 (20:06 -0600)]
[PowerPC] Fix powerpcspe subtarget enablement in llvm backend
Summary:
As currently written, -target powerpcspe will enable SPE regardless of
disabling the feature later on in the command line. Instead, change
this to just set a default CPU to 'e500' instead of a generic CPU.
As part of this, add FeatureSPE to the e500 definition.
Reviewed By: MaskRay
Differential Revision: https://reviews.llvm.org/D72673
Pierre Habouzit [Wed, 15 Jan 2020 02:56:26 +0000 (18:56 -0800)]
Relax the rules around objc_alloc and objc_alloc_init optimizations.
Today the optimization is limited to:
- `[ClassName alloc]`
- `[self alloc]` when within a class method
However it means that when code is written this way:
```
@interface MyObject
- (id)copyWithZone:(NSZone *)zone
{
return [[self.class alloc] _initWith...];
}
@end
```
... then the optimization doesn't kick in and `+[NSObject alloc]` ends
up in IMP caches where it could have been avoided. It turns out that
`+alloc` -> `+[NSObject alloc]` is the most cached SEL/IMP pair in the
entire platform which is rather silly).
There's two theoretical risks allowing this optimization:
1. if the receiver is nil (which it can't be today), but it turns out
that `objc_alloc()`/`objc_alloc_init()` cope with a nil receiver,
2. if the `Clas` type for the receiver is a lie. However, for such a
code to work today (and not fail witn an unrecognized selector
anyway) you'd have to have implemented the `-alloc` **instance
method**.
Fortunately, `objc_alloc()` doesn't assume that the receiver is a
Class, it basically starts with a test that is similar to
`if (receiver->isa->bits & hasDefaultAWZ) { /* fastpath */ }`.
This bit is only set on metaclasses by the runtime, so if an instance
is passed to this function by accident, its isa will fail this test,
and `objc_alloc()` will gracefully fallback to `objc_msgSend()`.
The one thing `objc_alloc()` doesn't support is tagged pointer
instances. None of the tagged pointer classes implement an instance
method called `'alloc'` (actually there's a single class in the
entire Apple codebase that has such a method).
Differential Revision: https://reviews.llvm.org/D71682
Radar-Id: rdar://problem/
58058316
Reviewed-By: Akira Hatanaka
Signed-off-by: Pierre Habouzit <phabouzit@apple.com>
Tom Stellard [Wed, 15 Jan 2020 03:15:07 +0000 (19:15 -0800)]
CMake: Make most target symbols hidden by default
Summary:
For builds with LLVM_BUILD_LLVM_DYLIB=ON and BUILD_SHARED_LIBS=OFF
this change makes all symbols in the target specific libraries hidden
by default.
A new macro called LLVM_EXTERNAL_VISIBILITY has been added to mark symbols in these
libraries public, which is mainly needed for the definitions of the
LLVMInitialize* functions.
This patch reduces the number of public symbols in libLLVM.so by about
25%. This should improve load times for the dynamic library and also
make abi checker tools, like abidiff require less memory when analyzing
libLLVM.so
One side-effect of this change is that for builds with
LLVM_BUILD_LLVM_DYLIB=ON and LLVM_LINK_LLVM_DYLIB=ON some unittests that
access symbols that are no longer public will need to be statically linked.
Before and after public symbol counts (using gcc 8.2.1, ld.bfd 2.31.1):
nm before/libLLVM-9svn.so | grep ' [A-Zuvw] ' | wc -l
36221
nm after/libLLVM-9svn.so | grep ' [A-Zuvw] ' | wc -l
26278
Reviewers: chandlerc, beanz, mgorny, rnk, hans
Reviewed By: rnk, hans
Subscribers: merge_guards_bot, luismarques, smeenai, ldionne, lenary, s.egerton, pzheng, sameer.abuasal, MaskRay, wuzish, echristo, Jim, hiraditya, michaelplatings, chapuni, jholewinski, arsenm, dschuff, jyknight, dylanmckay, sdardis, nemanjai, jvesely, javed.absar, sbc100, jgravelle-google, aheejin, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, zzheng, edward-jones, mgrang, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, kristina, jsji, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D54439
Richard Smith [Wed, 15 Jan 2020 03:29:50 +0000 (19:29 -0800)]
PR44540: Prefer an inherited default constructor over an initializer
list constructor when initializing from {}.
We would previously pick between calling an initializer list constructor
and calling a default constructor unstably in this situation, depending
on whether the inherited default constructor had already been used
elsewhere in the program.
Douglas Yung [Wed, 15 Jan 2020 02:58:18 +0000 (18:58 -0800)]
Modify test to use -S instead of -c so that it works when an external assembler is used that is not present.
Hubert Tong [Wed, 15 Jan 2020 02:23:39 +0000 (21:23 -0500)]
DWARFDebugLine.cpp: Restore LF line endings
rG7e02406f6cf180a8c89ce64665660e7cc9dbc23e switched the file to CRLF
line endings.
Philip Reames [Wed, 15 Jan 2020 02:16:02 +0000 (18:16 -0800)]
[BranchAlign] Add master --x86-branches-within-32B-boundaries flag
This flag was originally part of D70157, but was removed as we carved away pieces of the review. Since we have the nop support checked in, and it appears mature(*), I think it's time to add the master flag. For now, it will default to nop padding, but once the prefix padding support lands, we'll update the defaults.
(*) I can now confirm that downstream testing of the changes which have landed to date - nop padding and compiler support for suppressions - is passing all of the functional testing we've thrown at it. There might still be something lurking, but we've gotten enough coverage to be confident of the basic approach.
Note that the new flag can be used either when assembling an .s file, or when using the integrated assembler directly from the compiler. The later will use all of the suppression mechanism and should always generate correct code. We don't yet have assembly syntax for the suppressions, so passing this directly to the assembler w/a raw .s file may result in broken code. Use at your own risk.
Also note that this isn't the wiring for the clang option. I think the most recent review for that is D72227, but I've lost track, so that might be off.
Differential Revision: https://reviews.llvm.org/D72738
Saar Raz [Wed, 15 Jan 2020 00:48:42 +0000 (02:48 +0200)]
[Concepts] Type Constraints
Add support for type-constraints in template type parameters.
Also add support for template type parameters as pack expansions (where the type constraint can now contain an unexpanded parameter pack).
Differential Revision: https://reviews.llvm.org/D44352