OSDN Git Service

android-x86/external-llvm-project.git
4 years agoFix bot failure from 59733525d37cf9ad88b5021b33ecdbaf2e18911c
Teresa Johnson [Fri, 24 Jan 2020 00:33:35 +0000 (16:33 -0800)]
Fix bot failure from 59733525d37cf9ad88b5021b33ecdbaf2e18911c

Fix bot failure by loosening up the register matching on new test:
http://lab.llvm.org:8011/builders/clang-x86_64-debian-new-pass-manager-fast/builds/2423

4 years ago[clang-tidy] Add clang-tidy headers to clang distribution
Dmitry Polukhin [Thu, 23 Jan 2020 23:57:45 +0000 (15:57 -0800)]
[clang-tidy] Add clang-tidy headers to clang distribution

Summary:
Clang releases include static libraries for clang-tidy but corresponding
headers are missing in the tarball so these libraries are almost useless.
Clang-tidy libraries can be useful for build custom clang-tidy with
custom checks outside of llvm repo.

List of clang-tidy libraries included in clang 9.0.1 release:
    lib/libclangTidyMPIModule.a
    lib/libclangTidyPlugin.a
    lib/libclangTidyBoostModule.a
    lib/libclangTidyCERTModule.a
    lib/libclangTidyAndroidModule.a
    lib/libclangTidyPortabilityModule.a
    lib/libclangTidyPerformanceModule.a
    lib/libclangTidyOpenMPModule.a
    lib/libclangTidyBugproneModule.a
    lib/libclangTidyZirconModule.a
    lib/libclangTidyCppCoreGuidelinesModule.a
    lib/libclangTidyGoogleModule.a
    lib/libclangTidyUtils.a
    lib/libclangTidyHICPPModule.a
    lib/libclangTidyModernizeModule.a
    lib/libclangTidyLLVMModule.a
    lib/libclangTidyAbseilModule.a
    lib/libclangTidyReadabilityModule.a
    lib/libclangTidyFuchsiaModule.a
    lib/libclangTidyMiscModule.a
    lib/libclangTidy.a
    lib/libclangTidyObjCModule.a

Reviewers: smeenai, jdoerfert, alexfh, hokein, aaron.ballman

Subscribers: mgehre, mgorny, xazax.hun, cfe-commits

Tags: #clang-tools-extra, #clang

Differential Revision: https://reviews.llvm.org/D73236

4 years ago[LoopStrengthReduce] Reuse utility method to clean dead instructions. [NFCI]
Alina Sbirlea [Thu, 23 Jan 2020 23:45:37 +0000 (15:45 -0800)]
[LoopStrengthReduce] Reuse utility method to clean dead instructions. [NFCI]

Create a utility wrapper for the RecursivelyDeleteTriviallyDeadInstructions utility
method, which sets to nullptr the instructions that are not trivially
dead. Use the new method in LoopStrengthReduce.
Alternative: add a bool to the same method; this option adds a marginal
amount of overhead to the other callers, and the method needs to be
updated to return a bool status when it removes/doesn't remove
instructions.

4 years ago[Concepts] Make constraint expressions unevaluated until satisfaction checking
Saar Raz [Fri, 24 Jan 2020 00:22:17 +0000 (02:22 +0200)]
[Concepts] Make constraint expressions unevaluated until satisfaction checking

As per P1980R0, constraint expressions are unevaluated operands, and their constituent atomic
constraints only become constant evaluated during satisfaction checking.

Change the evaluation context during parsing and instantiation of constraints to unevaluated.

4 years ago[Attributor][FIX][Alignment] Do not report a change if there was none
Johannes Doerfert [Sun, 12 Jan 2020 06:25:45 +0000 (00:25 -0600)]
[Attributor][FIX][Alignment] Do not report a change if there was none

If alignment was manifested but it is actually only as good as the
data-layout provided one we should not report it as a change.

For testing purposes we still manifest the information.

4 years ago[Attributor][NFC] Add an assertion
Johannes Doerfert [Sun, 12 Jan 2020 06:13:03 +0000 (00:13 -0600)]
[Attributor][NFC] Add an assertion

4 years ago[Attributor][NFC] Fix spelling
Johannes Doerfert [Sun, 12 Jan 2020 06:00:33 +0000 (00:00 -0600)]
[Attributor][NFC] Fix spelling

4 years ago[Attributor] `byval` arguments are always `noalias`
Johannes Doerfert [Sun, 12 Jan 2020 06:18:07 +0000 (00:18 -0600)]
[Attributor] `byval` arguments are always `noalias`

`byval` introduces a local copy of the argument. That copy cannot alias
anything.

4 years ago[Attributor][FIX] Store alignment only holds for the pointer value
Johannes Doerfert [Fri, 10 Jan 2020 18:13:10 +0000 (12:13 -0600)]
[Attributor][FIX] Store alignment only holds for the pointer value

We accidentally used the store alignment for the value operand as well,
which is incorrect and crashed the SPASS application in the test suite.

4 years ago[LTO/WPD] Enable aggressive WPD under LTO option
Teresa Johnson [Thu, 26 Dec 2019 19:40:18 +0000 (11:40 -0800)]
[LTO/WPD] Enable aggressive WPD under LTO option

Summary:
Third part in series to support Safe Whole Program Devirtualization
Enablement, see RFC here:
http://lists.llvm.org/pipermail/llvm-dev/2019-December/137543.html

This patch adds type test metadata under -fwhole-program-vtables,
even for classes without hidden visibility. It then changes WPD to skip
devirtualization for a virtual function call when any of the compatible
vtables has public vcall visibility.

Additionally, internal LLVM options as well as lld and gold-plugin
options are added which enable upgrading all public vcall visibility
to linkage unit (hidden) visibility during LTO. This enables the more
aggressive WPD to kick in based on LTO time knowledge of the visibility
guarantees.

Support was added to all flavors of LTO WPD (regular, hybrid and
index-only), and to both the new and old LTO APIs.

Unfortunately it was not simple to split the first and second parts of
this part of the change (the unconditional emission of type tests and
the upgrading of the vcall visiblity) as I needed a way to upgrade the
public visibility on legacy WPD llvm assembly tests that don't include
linkage unit vcall visibility specifiers, to avoid a lot of test churn.

I also added a mechanism to LowerTypeTests that allows dropping type
test assume sequences we now aggressively insert when we invoke
distributed ThinLTO backends with null indexes, which is used in testing
mode, and which doesn't invoke the normal ThinLTO backend pipeline.

Depends on D71907 and D71911.

Reviewers: pcc, evgeny777, steven_wu, espindola

Subscribers: emaste, Prazek, inglorion, arichardson, hiraditya, MaskRay, dexonsmith, dang, davidxl, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D71913

4 years ago[Utils] Use WeakTrackingVH in vector used as scratch storage.
Alina Sbirlea [Thu, 23 Jan 2020 22:21:08 +0000 (14:21 -0800)]
[Utils] Use WeakTrackingVH in vector used as scratch storage.

The utility method RecursivelyDeleteTriviallyDeadInstructions receives
as input a vector of Instructions, where all inputs are valid
instructions. This same vector is used as a scratch storage (per the
header comment) to recursively delete instructions. If an instruction is
added as an operand of multiple other instructions, it may be added twice,
then deleted once, then the second reference in the vector is invalid.
Switch to using a Vector<WeakTrackingVH>.
This change facilitates a clean-up in LoopStrengthReduction.

4 years ago[MS] Overhaul how clang passes overaligned args on x86_32
Reid Kleckner [Tue, 31 Dec 2019 00:15:54 +0000 (16:15 -0800)]
[MS] Overhaul how clang passes overaligned args on x86_32

MSVC 2013 would refuse to pass highly aligned things (typically vectors
and aggregates) by value. Users would receive this error:
  t.cpp(11) : error C2719: 'w': formal parameter with __declspec(align('32')) won't be aligned
  t.cpp(11) : error C2719: 'q': formal parameter with __declspec(align('32')) won't be aligned

However, in MSVC 2015, this behavior was changed, and highly aligned
things are now passed indirectly. To avoid breaking backwards
incompatibility, objects that do not have a *required* high alignment
(i.e. double) are still passed directly, even though they are not
naturally aligned. This change implements the new behavior of passing
things indirectly.

The new behavior is:
- up to three vector parameters can be passed in [XYZ]MM0-2
- remaining arguments with required alignment greater than 4 bytes are
  passed indirectly

Previously, MSVC never passed things truly indirectly, meaning clang
would always apply the byval attribute to indirect arguments. We had to
go to the trouble of adding inalloca so that non-trivially copyable C++
types could be passed in place without copying the object
representation. When inalloca was added, we asserted that all arguments
passed indirectly must use byval. With this change, that assert no
longer holds, and I had to update inalloca to handle that case. The
implicit sret pointer parameter was already handled this way, and this
change generalizes some of that logic to arguments.

There are two cases that this change leaves unfixed:
1. objects that are non-trivially copyable *and* overaligned
2. vectorcall + inalloca + vectors

For case 1, I need to touch C++ ABI code in MicrosoftCXXABI.cpp, so I
want to do it in a follow-up.

For case 2, my fix is one line, but it will require updating IR tests to
use lots of inreg, so I wanted to separate it out.

Related to D71915 and D72110

Fixes most of PR44395

Reviewed By: rjmccall, craig.topper, erichkeane

Differential Revision: https://reviews.llvm.org/D72114

4 years ago[AArch64][GlobalISel] Remove duplicate attribute lookup code that was supposed to...
Amara Emerson [Thu, 23 Jan 2020 22:46:15 +0000 (14:46 -0800)]
[AArch64][GlobalISel] Remove duplicate attribute lookup code that was supposed to be cached. NFC.

When I cached this a long time ago it seems I forgot to remove the locally
declared variable of the same name in select(), so the caching wasn't having
any compile time benefit. Doh.

4 years ago[mlir] [VectorOps] fixed minor typos in vector ops doc
aartbik [Thu, 23 Jan 2020 21:40:58 +0000 (13:40 -0800)]
[mlir] [VectorOps] fixed minor typos in vector ops doc

Summary:
Rationale:
Some examples were using "offsets : [0, 2]" syntax which
should use a "=" instead. The same examples were referring
to the integer attribute array as k-dimensional, which is
a bit confusing (it is 1-dimensional, with k elements).
Changed to "k-sized".

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/D73293

4 years ago[NFC][ScopBuilder] Move RecordedAssumptions vector to ScopBuilder
Dominik Adamski [Sun, 19 Jan 2020 22:50:01 +0000 (23:50 +0100)]
[NFC][ScopBuilder] Move RecordedAssumptions vector to ScopBuilder

Scope of changes:

1) Moved RecordedAssumptions vector to ScopBuilder. RecordedAssumptions are used only for Scop constructions.
2) Moved definition of RecordedAssumptionsTy to ScopHelper. It is required both by ScopBuilder and SCEVAffinator.
3) Add new function recordAssumption to ScopHelper. One of its argument is a reference to RecordedAssumption vector. This function is used by ScopBuilder and SCEVAffinator.
4) All RecordedAssumptions are created by ScopBuilder. isl::pw_aff
objects for corresponding SCEVs are created inside ScopBuilder. Scop
functions do not record any assumptions. Scop can use isl::pw_aff
objects which were created by ScopBuilder.
5) Removed functions for handling RecordedAssumptions from Scop class.
6) Removed constness from getScopArrayInfo functions.
7) Replaced SCEVVisitor struct from SCEVAffinator with taylored version, which allow to pass pointer to RecordedAssumptions as function argument.

Differential Revision: https://reviews.llvm.org/D68056

4 years ago[tests] Use host-based XFAIL for test/MC/AMDGPU/hsa-gfx10-v3.s
Hubert Tong [Thu, 23 Jan 2020 22:55:32 +0000 (17:55 -0500)]
[tests] Use host-based XFAIL for test/MC/AMDGPU/hsa-gfx10-v3.s

Summary:
This patch applies D60551 to an additional file. In particular, the test
is currently marked XFAIL for a number of big-endian targets; however,
the failure is actually dependent on the host endianness instead. The
test actually specifies a specific target triple.

Reviewers: rampitec, xingxue, daltenty

Reviewed By: rampitec

Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, fedor.sergeev, kerbowa, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D73192

4 years ago[Concepts] Deprecate -fconcepts-ts, enable Concepts under -std=c++2a
Saar Raz [Thu, 23 Jan 2020 22:43:22 +0000 (00:43 +0200)]
[Concepts] Deprecate -fconcepts-ts, enable Concepts under -std=c++2a

Now with concepts support merged and mostly complete, we do not need -fconcepts-ts
(which was also misleading as we were not implementing the TS) and can enable
concepts features under C++2a. A warning will be generated if users still attempt
to use -fconcepts-ts.

4 years ago[LLDB] Fix the handling of unnamed bit-fields when parsing DWARF
shafik [Thu, 23 Jan 2020 22:42:12 +0000 (14:42 -0800)]
[LLDB] Fix the handling of unnamed bit-fields when parsing DWARF

We ran into an assert when debugging clang and performing an expression on a class derived from DeclContext. The assert was indicating we were getting the offsets wrong for RecordDeclBitfields. We were getting both the size and offset of unnamed bit-field members wrong. We could fix this case with a quick change but as I extended the test suite to include more combinations we kept finding more cases that were being handled incorrectly. A fix that handled all the new cases as well as the cases already covered required a refactor of the existing technique.

Differential Revision: https://reviews.llvm.org/D72953

4 years ago[AArch64][GlobalISel] Fallback if the +strict-align target feature is given.
Amara Emerson [Thu, 23 Jan 2020 22:43:19 +0000 (14:43 -0800)]
[AArch64][GlobalISel] Fallback if the +strict-align target feature is given.

Works around PR44246.

4 years ago[lldb/Test] Disallow using substituted binaries in shell test.
Jonas Devlieghere [Thu, 23 Jan 2020 22:23:01 +0000 (14:23 -0800)]
[lldb/Test] Disallow using substituted binaries in shell test.

Explicitly disallow using lldb instead of %lldb in the shell tests. This
is a clever trick that is used by Swift to achieve the same results.

Differential revision: https://reviews.llvm.org/D73289

4 years ago[Clang][IFS][Test] Work around in-process cc1 ASAN issues #2.
Mitch Phillips [Thu, 23 Jan 2020 22:23:38 +0000 (14:23 -0800)]
[Clang][IFS][Test] Work around in-process cc1 ASAN issues #2.

Using the same strategy as c38e42527b21.

D69825 revealed (introduced?) a problem when building with ASan, and
some memory leaks somewhere. More details are available in the original
patch.

Looks like we missed one failing tests, this patch adds the workaround
to this test as well.

4 years ago[lldb/Test] Disable command-breakpoint-col.test on Windows
Jonas Devlieghere [Thu, 23 Jan 2020 22:17:48 +0000 (14:17 -0800)]
[lldb/Test] Disable command-breakpoint-col.test on Windows

I guess PDB doesn't have column information?

4 years ago[mlir] [VectorOps] Implement vector tuple get folding
aartbik [Thu, 23 Jan 2020 22:11:36 +0000 (14:11 -0800)]
[mlir] [VectorOps] Implement vector tuple get folding

Summary: Rewrites get-i tup<a1,...,an> into ai

Reviewers: nicolasvasilache, rriddle, andydavis1

Reviewed By: nicolasvasilache, rriddle, andydavis1

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/D73213

4 years ago[IPSCCP] Use ParamState for arguments at call sites.
Florian Hahn [Thu, 23 Jan 2020 19:17:47 +0000 (11:17 -0800)]
[IPSCCP] Use ParamState for arguments at call sites.

We currently use integer ranges to merge concrete function arguments.
We use the ParamState range for those, but we only look up concrete
values in the regular state. For concrete function arguments that are
themselves arguments of the containing function, we can use the param
state directly and improve the precision in some cases.

Besides improving the results in some cases, this is also a small step towards
switching to ValueLatticeElement, by allowing D60582 to be a NFC.

Reviewers: efriedma, davide

Reviewed By: efriedma

Differential Revision: https://reviews.llvm.org/D71836

4 years ago[Concepts] Implement P1616R1 - Using unconstrained template template parameters with...
Saar Raz [Wed, 22 Jan 2020 02:21:09 +0000 (04:21 +0200)]
[Concepts] Implement P1616R1 - Using unconstrained template template parameters with constrained templates

Summary: Allow unconstrained template template parameters to accept constrainted templates as arguments.

Reviewers: rsmith

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D73155

4 years agoGlobalISel: Add MIPatternMatch for G_ICMP/G_FCMP
Matt Arsenault [Thu, 23 Jan 2020 13:45:40 +0000 (08:45 -0500)]
GlobalISel: Add MIPatternMatch for G_ICMP/G_FCMP

4 years agoAMDGPU/GlobalISel: Fix RegBanKSelect for llvm.amdgcn.exp.compr
Matt Arsenault [Thu, 23 Jan 2020 20:52:21 +0000 (15:52 -0500)]
AMDGPU/GlobalISel: Fix RegBanKSelect for llvm.amdgcn.exp.compr

This wasn't updated for the immarg handling change. We really need a
verifier for this.

4 years ago[Concepts] Add ExpressionEvaluationContexts to instantiation of constraints
Saar Raz [Thu, 23 Jan 2020 21:24:56 +0000 (23:24 +0200)]
[Concepts] Add ExpressionEvaluationContexts to instantiation of constraints

Proper ExpressionEvaluationContext were not being entered when instantiating constraint
expressions, which caused assertion failures in certain cases, including bug #44614.

4 years ago[ThinLTO] Summarize vcall_visibility metadata
Teresa Johnson [Thu, 26 Dec 2019 17:31:43 +0000 (09:31 -0800)]
[ThinLTO] Summarize vcall_visibility metadata

Summary:
Second patch in series to support Safe Whole Program Devirtualization
Enablement, see RFC here:
http://lists.llvm.org/pipermail/llvm-dev/2019-December/137543.html

Summarize vcall_visibility metadata in ThinLTO global variable summary.

Depends on D71907.

Reviewers: pcc, evgeny777, steven_wu

Subscribers: mehdi_amini, Prazek, inglorion, hiraditya, dexonsmith, arphaman, ostannard, llvm-commits, cfe-commits, davidxl

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D71911

4 years ago[CUDA] Fix order of memcpy arguments in __shfl_*(<64-bit type>).
Artem Belevich [Wed, 22 Jan 2020 23:12:49 +0000 (15:12 -0800)]
[CUDA] Fix order of memcpy arguments in __shfl_*(<64-bit type>).

Wrong argument order resulted in broken shfl ops for 64-bit types.

4 years agoChange internal_start_thread arguments to match pthread_create.
Evgenii Stepanov [Thu, 23 Jan 2020 21:01:08 +0000 (13:01 -0800)]
Change internal_start_thread arguments to match pthread_create.

This avoids a CFI-unfriendly function pointer type cast in
internal_start_thread.

4 years ago[CMake] Refactor iOS simulator/device test configuration generation code for LibFuzzer.
Dan Liew [Thu, 23 Jan 2020 00:26:45 +0000 (16:26 -0800)]
[CMake] Refactor iOS simulator/device test configuration generation code for LibFuzzer.

Summary:
In order to do this `FUZZER_SUPPORTED_OS` had to be pulled out of
`lib/fuzzer/CMakeLists.txt` and into the main config so we can use it
from the `test/fuzzer/CMakeList.txt`. `FUZZER_SUPPORTED_OS` currently
has the same value of `SANITIZER_COMMON_SUPPORTED_OS` which preserves
the existing behaviour but this allows us in the future to adjust the
supported platforms independent of `SANITIZER_COMMON_SUPPORTED_OS`. This
mirrors the other sanitizers.

For non-Apple platforms `FUZZER_SUPPORTED_OS` is not defined and
surprisingly this was the behaviour before this patch because
`SANITIZER_COMMON_SUPPORTED_OS` was actually empty. This appears to
not matter right now because the functions that take an `OS` as an
argument seem to ignore it on non-Apple platforms.

While this change tries to be NFC it is technically not because we
now generate an iossim config whereas previously we didn't. This seems
like the right thing to do because the build system was configured to
compile LibFuzzer for iossim but previously we weren't generating a lit
test config for it. The device/simulator testing configs don't run by
default anyway so this shouldn't break testing.

This change relies on the get_capitalized_apple_platform() function
added in a previous commit.

rdar://problem/58798733

Reviewers: kubamracek, yln

Subscribers: mgorny, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

Differential Revision: https://reviews.llvm.org/D73243

4 years ago[CMake][NFC] Refactor iOS simulator/device test configuration generation code for...
Dan Liew [Wed, 22 Jan 2020 23:15:21 +0000 (15:15 -0800)]
[CMake][NFC] Refactor iOS simulator/device test configuration generation code for TSan.

Summary:
The previous code hard-coded platform names but compiler-rt's CMake
build system actually already knows which Apple platforms TSan supports.

This change uses this information to enumerate the different Apple
platforms.

This change relies on the `get_capitalized_apple_platform()` function
added in a previous commit.

rdar://problem/58798733

Reviewers: kubamracek, yln

Subscribers: mgorny, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

Differential Revision: https://reviews.llvm.org/D73238

4 years ago[CMake][NFC] Refactor iOS simulator/device test configuration generation code for...
Dan Liew [Wed, 22 Jan 2020 22:11:17 +0000 (14:11 -0800)]
[CMake][NFC] Refactor iOS simulator/device test configuration generation code for ASan.

Summary:
The previous code hard-coded platform names but compiler-rt's CMake
build system actually already knows which Apple platforms ASan supports.

This change uses this information to enumerate the different Apple
platforms.

rdar://problem/58798733

Reviewers: kubamracek, yln

Subscribers: mgorny, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

Differential Revision: https://reviews.llvm.org/D73232

4 years agoClang added a new feature to the ObjC compiler that will translate method
Jim Ingham [Thu, 23 Jan 2020 20:35:25 +0000 (12:35 -0800)]
Clang added a new feature to the ObjC compiler that will translate method
calls to commonly un-overridden methods into a function that checks whether
the method is overridden anywhere and if not directly dispatches to the
NSObject implementation.

That means if you do override any of these methods, "step-in" will not step
into your code, since we hit the wrapper function, which has no debug info,
and immediately step out again.

Add code to recognize these functions as "trampolines" and a thread plan that
will get us from the function to the user code, if overridden.

<rdar://problem/54404114>

Differential Revision: https://reviews.llvm.org/D73225

4 years ago[lldb/Commands] Fix, rename and document column number arg to breakpoint set.
Jonas Devlieghere [Thu, 23 Jan 2020 19:25:16 +0000 (11:25 -0800)]
[lldb/Commands] Fix, rename and document column number arg to breakpoint set.

We were incorrectly parsing the -C argument to breakpoint set as the
column breakpoint, even though according to the help this should be the
breakpoint command. This fixes that by renaming the option to -u, adding
it to help, and adding a test case.

Differential revision: https://reviews.llvm.org/D73284

4 years agoPartially revert "[IR] Attribute/AttrBuilder: use Value::MaximumAlignment magic constant"
Roman Lebedev [Thu, 23 Jan 2020 20:30:09 +0000 (23:30 +0300)]
Partially revert "[IR] Attribute/AttrBuilder: use Value::MaximumAlignment magic constant"

Apparently makes bots angry.

This reverts commit d096f8d306b2b16a25f65ffb70849ca7963a0dac.

4 years agoRe-add documentation for -flax-vector-conversions= removed in
Richard Smith [Thu, 23 Jan 2020 20:28:03 +0000 (12:28 -0800)]
Re-add documentation for -flax-vector-conversions= removed in
edd4398f4cd33a305afbca76ac4e6590e9337f4d.

The documentation remains correct despite the revert of the patch.

4 years ago[ELF] --no-dynamic-linker: don't emit undefined weak symbols to .dynsym
Fangrui Song [Thu, 23 Jan 2020 19:52:03 +0000 (11:52 -0800)]
[ELF] --no-dynamic-linker: don't emit undefined weak symbols to .dynsym

I felt really sad to push this commit for my selfish purpose to make
glibc -static-pie build with lld. Some code constructs in glibc require
R_X86_64_GOTPCREL/R_X86_64_REX_GOTPCRELX referencing undefined weak to
be resolved to a GOT entry not relocated by R_X86_64_GLOB_DAT (GNU ld
behavior), e.g.

csu/libc-start.c
  if (__pthread_initialize_minimal != NULL)
    __pthread_initialize_minimal ();

elf/dl-object.c
  void
  _dl_add_to_namespace_list (struct link_map *new, Lmid_t nsid)
  {
    /* We modify the list of loaded objects.  */
    __rtld_lock_lock_recursive (GL(dl_load_write_lock));

Emitting a GLOB_DAT will make the address equal &__ehdr_start (true
value) and cause elf/ldconfig to segfault. glibc really should move away
from weak references, which do not have defined semantics.

Temporarily special case --no-dynamic-linker.

4 years ago[PDB] Simplify API for making section map, NFC
Reid Kleckner [Thu, 23 Jan 2020 20:11:50 +0000 (12:11 -0800)]
[PDB] Simplify API for making section map, NFC

Prevents API misuse described in PR44495

4 years ago[clangd] Add C++20 concepts support to TargetFinder
Nathan Ridge [Tue, 21 Jan 2020 21:55:43 +0000 (16:55 -0500)]
[clangd] Add C++20 concepts support to TargetFinder

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D73140

4 years ago[clangd] Add C++20 concepts support to findExplicitReferences() and semantic highlighting
Nathan Ridge [Tue, 21 Jan 2020 18:21:08 +0000 (13:21 -0500)]
[clangd] Add C++20 concepts support to findExplicitReferences() and semantic highlighting

Summary: Fixes https://github.com/clangd/clangd/issues/259

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, usaxena95, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D73124

4 years agoRevert "[Sema] Sanity-check alignment requested via `__attribute__((assume_aligned...
Roman Lebedev [Thu, 23 Jan 2020 20:10:02 +0000 (23:10 +0300)]
Revert "[Sema] Sanity-check alignment requested via `__attribute__((assume_aligned(imm)))`"

Likely makes bots angry.

This reverts commit a4cfb15d15a8a353fe316f2a9fe1c8c6a6740ef1.

# Conflicts:
# clang/lib/Sema/SemaDeclAttr.cpp

4 years agoRevert "[Sema] Attempt to perform call-size-specific `__attribute__((alloc_align...
Roman Lebedev [Thu, 23 Jan 2020 20:07:58 +0000 (23:07 +0300)]
Revert "[Sema] Attempt to perform call-size-specific `__attribute__((alloc_align(param_idx)))` validation"

Likely makes bots angry.

This reverts commit c2a9061ac5166e48fe85ea2b6dbce9457c964958.

4 years agoAMDGPU: Fix ubsan error
Matt Arsenault [Thu, 23 Jan 2020 19:10:04 +0000 (14:10 -0500)]
AMDGPU: Fix ubsan error

Since register classes go up to 1024, 32 elements, all masks bits are
needed and a 32-bit shift by 32 is illegal. We didn't have any
instructions theoretically using a 32 element VGPR before
d1dbb5e4718a8f845abf0783513a33a55429470b

4 years ago[Sema] Don't disallow placing `__attribute__((alloc_align(param_idx)))` on `std:...
Roman Lebedev [Thu, 23 Jan 2020 19:50:34 +0000 (22:50 +0300)]
[Sema] Don't disallow placing `__attribute__((alloc_align(param_idx)))` on `std::align_val_t`-typed parameters

Summary:
I kind-of understand why it is restricted to integer-typed arguments,
for general enum's the value passed is not nessesairly the alignment implied,
although one might say that user would know best.

But we clearly should whitelist `std::align_val_t`,
which is just a thin wrapper over `std::size_t`,
and is the C++ standard way of specifying alignment.

Reviewers: erichkeane, rsmith, aaron.ballman, jdoerfert

Reviewed By: erichkeane

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D73019

4 years ago[Codegen] If reasonable, materialize clang's `AllocAlignAttr` as llvm's Alignment...
Roman Lebedev [Thu, 23 Jan 2020 19:50:24 +0000 (22:50 +0300)]
[Codegen] If reasonable, materialize clang's `AllocAlignAttr` as llvm's Alignment Attribute on call-site function return value

Summary:
Much like with the previous patch (D73005) with `AssumeAlignedAttr`
handling, results in mildly more readable IR,
and will improve test coverage in upcoming patch.

Note that in `AllocAlignAttr`'s case, there is no requirement
for that alignment parameter to end up being an I-C-E.

Reviewers: erichkeane, jdoerfert, hfinkel, aaron.ballman, rsmith

Reviewed By: erichkeane

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D73006

4 years ago[Codegen] If reasonable, materialize clang's `AssumeAlignedAttr` as llvm's Alignment...
Roman Lebedev [Thu, 23 Jan 2020 19:50:15 +0000 (22:50 +0300)]
[Codegen] If reasonable, materialize clang's `AssumeAlignedAttr` as llvm's Alignment Attribute on call-site function return value

Summary:
This should be mostly NFC - we still lower the same alignment
knowledge to the IR. The main reasoning here is that
this somewhat improves readability of IR like this,
and will improve test coverage in upcoming patch.

Even though the alignment is guaranteed to always be an I-C-E,
we don't always materialize it as llvm's Alignment Attribute because:
1. There may be a non-zero offset
2. We may be sanitizing for alignment

Note that if there already was an IR alignment attribute
on return value, we union them, and thus the alignment
only ever rises.

Also, there is a second relevant clang attribute `AllocAlignAttr`,
so that is why `AbstractAssumeAlignedAttrEmitter` is templated.

Reviewers: erichkeane, jdoerfert, hfinkel, aaron.ballman, rsmith

Reviewed By: erichkeane

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D73005

4 years ago[IR] Attribute/AttrBuilder: use Value::MaximumAlignment magic constant
Roman Lebedev [Thu, 23 Jan 2020 19:50:06 +0000 (22:50 +0300)]
[IR] Attribute/AttrBuilder: use Value::MaximumAlignment magic constant

Summary:
I initially encountered those assertions when trying to create
this IR `alignment` attribute from clang's `__attribute__((assume_aligned(imm)))`,
because until D72994 there is no sanity checking for the value of `imm`.

But even then, we have `llvm::Value::MaximumAlignment` constant (which is `536870912`),
which is enforced for clang attributes, and then there are some other magical constant
(`0x40000000` i.e. `1073741824` i.e. `2 * 536870912`) in
`Attribute::getWithAlignment()`/`AttrBuilder::addAlignmentAttr()`.

I strongly suspect that `0x40000000` is incorrect,
and that also should be `llvm::Value::MaximumAlignment`.

Reviewers: erichkeane, hfinkel, jdoerfert, gchatelet, courbet

Reviewed By: erichkeane

Subscribers: hiraditya, cfe-commits, llvm-commits

Tags: #llvm, #clang

Differential Revision: https://reviews.llvm.org/D72998

4 years ago[Sema] Attempt to perform call-size-specific `__attribute__((alloc_align(param_idx...
Roman Lebedev [Thu, 23 Jan 2020 19:49:50 +0000 (22:49 +0300)]
[Sema] Attempt to perform call-size-specific `__attribute__((alloc_align(param_idx)))` validation

Summary:
`alloc_align` attribute takes parameter number, not the alignment itself,
so given **just** the attribute/function declaration we can't do any
sanity checking for said alignment.

However, at call site, given the actual `Expr` that is passed
into that parameter, we //might// be able to evaluate said `Expr`
as Integer Constant Expression, and perform the sanity checks.
But since there is no requirement for that argument to be an immediate,
we may fail, and that's okay.

However if we did evaluate, we should enforce the same constraints
as with `__builtin_assume_aligned()`/`__attribute__((assume_aligned(imm)))`:
said alignment is a power of two, and is not greater than our magic threshold

Reviewers: erichkeane, aaron.ballman, hfinkel, rsmith, jdoerfert

Reviewed By: erichkeane

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D72996

4 years ago[Sema] Sanity-check alignment requested via `__attribute__((assume_aligned(imm)))`
Roman Lebedev [Thu, 23 Jan 2020 19:48:57 +0000 (22:48 +0300)]
[Sema] Sanity-check alignment requested via `__attribute__((assume_aligned(imm)))`

Summary:
For `__builtin_assume_aligned()`, we do validate that the alignment
is not greater than `536870912` (D68824), but we don't do that for
`__attribute__((assume_aligned(N)))` attribute.
I suspect we should.

Reviewers: erichkeane, aaron.ballman, hfinkel, rsmith, jdoerfert

Reviewed By: erichkeane

Subscribers: cfe-commits, llvm-commits

Tags: #llvm, #clang

Differential Revision: https://reviews.llvm.org/D72994

4 years agoInclude phabricator.uri in .arcconfig
Petr Hosek [Fri, 17 Jan 2020 22:39:14 +0000 (14:39 -0800)]
Include phabricator.uri in .arcconfig

conduit_uri was renamed to phabricator.uri and git-phab fails to load
.arcconfig without this field.

Differential Revision: https://reviews.llvm.org/D72960

4 years ago[WPD/VFE] Always emit vcall_visibility metadata for -fwhole-program-vtables
Teresa Johnson [Thu, 26 Dec 2019 16:32:42 +0000 (08:32 -0800)]
[WPD/VFE] Always emit vcall_visibility metadata for -fwhole-program-vtables

Summary:
First patch to support Safe Whole Program Devirtualization Enablement,
see RFC here: http://lists.llvm.org/pipermail/llvm-dev/2019-December/137543.html

Always emit !vcall_visibility metadata under -fwhole-program-vtables,
and not just for -fvirtual-function-elimination. The vcall visibility
metadata will (in a subsequent patch) be used to communicate to WPD
which vtables are safe to devirtualize, and we will optionally convert
the metadata to hidden visibility at link time. Subsequent follow on
patches will help enable this by adding vcall_visibility metadata to the
ThinLTO summaries, and always emit type test intrinsics under
-fwhole-program-vtables (and not just for vtables with hidden
visibility).

In order to do this safely with VFE, since for VFE all vtable loads must
be type checked loads which will no longer be the case, this patch adds
a new "Virtual Function Elim" module flag to communicate to GlobalDCE
whether to perform VFE using the vcall_visibility metadata.

One additional advantage of using the vcall_visibility metadata to drive
more WPD at LTO link time is that we can use the same mechanism to
enable more aggressive VFE at LTO link time as well. The link time
option proposed in the RFC will convert vcall_visibility metadata to
hidden (aka linkage unit visibility), which combined with
-fvirtual-function-elimination will allow it to be done more
aggressively at LTO link time under the same conditions.

Reviewers: pcc, ostannard, evgeny777, steven_wu

Subscribers: mehdi_amini, Prazek, hiraditya, dexonsmith, davidxl, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D71907

4 years ago[LoopIdiomRecognize] Teach LoopIdiomRecognize to preserve MemorySSA.
Alina Sbirlea [Wed, 22 Jan 2020 21:27:04 +0000 (13:27 -0800)]
[LoopIdiomRecognize] Teach LoopIdiomRecognize to preserve MemorySSA.

4 years ago[mlir] Add option to use custom base class for dialect in LLVMIRIntrinsicGen.
Marcello Maggioni [Wed, 22 Jan 2020 22:22:29 +0000 (14:22 -0800)]
[mlir] Add option to use custom base class for dialect in LLVMIRIntrinsicGen.

Summary:
LLVMIRIntrinsicGen is using LLVM_Op as the base class for intrinsics.
This works for LLVM intrinsics in the LLVM Dialect, but when we are
trying to convert custom intrinsics that originate from a custom
LLVM dialect (like NVVM or ROCDL) these usually have a different
"cppNamespace" that needs to be applied to these dialect.

These dialect specific characteristics (like "cppNamespace")
are typically organized by creating a custom op (like NVVM_Op or
ROCDL_Op) that passes the correct dialect to the LLVM_OpBase class.

It seems natural to allow LLVMIRIntrinsicGen to take that into
consideration when generating the conversion code from one of these
dialect to a set of target specific intrinsics.

Reviewers: rriddle, andydavis1, antiagainst, nicolasvasilache, ftynse

Subscribers: jdoerfert, mehdi_amini, jpienaar, burmako, shauheen, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D73233

4 years ago[lldb] s/lldb/%lldb in another test
Jonas Devlieghere [Thu, 23 Jan 2020 19:16:44 +0000 (11:16 -0800)]
[lldb] s/lldb/%lldb in another test

As explained in Pavel's previous commit message: %lldb is the proper
substitution. Using "lldb" can cause us to execute the system lldb
instead of the one we are testing. This happens at least in standalone
builds.

4 years ago[IndVarSimplify] Fix for MemorySSA preserve.
Alina Sbirlea [Thu, 23 Jan 2020 18:25:50 +0000 (10:25 -0800)]
[IndVarSimplify] Fix for MemorySSA preserve.

4 years ago[AArch64][test] Fix MC/AArch64 tests after D72799
Fangrui Song [Thu, 23 Jan 2020 18:47:50 +0000 (10:47 -0800)]
[AArch64][test] Fix MC/AArch64 tests after D72799

4 years ago[AArch64][test] Fix tests after D72799
Fangrui Song [Thu, 23 Jan 2020 18:45:15 +0000 (10:45 -0800)]
[AArch64][test] Fix tests after D72799

4 years ago[ELF] Pass `Relocation` to relaxGot and relaxTls{GdToIe,GdToLe,LdToLe,IeToLe}
Fangrui Song [Thu, 23 Jan 2020 03:42:54 +0000 (19:42 -0800)]
[ELF] Pass `Relocation` to relaxGot and relaxTls{GdToIe,GdToLe,LdToLe,IeToLe}

These functions call relocateOne(). This patch is a prerequisite for
making relocateOne() aware of `Symbol` (D73254).

Reviewed By: grimar, nickdesaulniers

Differential Revision: https://reviews.llvm.org/D73250

4 years ago[LoopUnroll] Avoid UB when converting from WeakVH to `Value *`
Justin Bogner [Thu, 23 Jan 2020 18:24:10 +0000 (10:24 -0800)]
[LoopUnroll] Avoid UB when converting from WeakVH to `Value *`

Calling `operator*` on a WeakVH with a null value yields a null
reference, which is UB. Avoid this by implicitly converting the WeakVH
to a `Value *` rather than dereferencing and then taking the address
for the type conversion.

Differential Revision: https://reviews.llvm.org/D73280

4 years ago[openmp] Disable archer if LIBOMP_OMPT_SUPPORT is off
Michał Górny [Thu, 23 Jan 2020 05:56:01 +0000 (06:56 +0100)]
[openmp] Disable archer if LIBOMP_OMPT_SUPPORT is off

This fixed build failures due to missing ompt headers.

See https://bugs.gentoo.org/700762.

Differential Revision: https://reviews.llvm.org/D73249

4 years ago[SVE] Add SVE2 patterns for unpredicated multiply instructions
Danilo Carvalho Grael [Wed, 15 Jan 2020 20:01:05 +0000 (15:01 -0500)]
[SVE] Add SVE2 patterns for unpredicated multiply instructions

Summary:
Add patterns for SVE2 unpredicated multiply instructions:
- mul, smulh, umulh, pmul, sqdmulh, sqrdmulh

Reviewers: sdesmalen, huntergr, efriedma, c-rhodes, kmclaughlin, rengolin

Subscribers: tschuett, hiraditya, rkruppe, psnobl, llvm-commits, amehsan

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D72799

4 years ago[mlir] Fix vectorize transform crashing on none-op operand
Ahmed Taei [Thu, 23 Jan 2020 01:52:16 +0000 (17:52 -0800)]
[mlir] Fix vectorize transform crashing on none-op operand

4 years ago[X86] LowerRotate - early out for vector rotates by zero
Simon Pilgrim [Thu, 23 Jan 2020 17:36:48 +0000 (17:36 +0000)]
[X86] LowerRotate - early out for vector rotates by zero

4 years ago[X86] Add test showing failure to remove vector rotate by zero
Simon Pilgrim [Thu, 23 Jan 2020 17:18:42 +0000 (17:18 +0000)]
[X86] Add test showing failure to remove vector rotate by zero

4 years ago[X86] Add AVX512 tests for vector rotations
Simon Pilgrim [Thu, 23 Jan 2020 17:17:24 +0000 (17:17 +0000)]
[X86] Add AVX512 tests for vector rotations

4 years ago[SelectionDAG] ComputeNumSignBits - add ISD::ADD demanded elts support
Simon Pilgrim [Thu, 23 Jan 2020 17:08:24 +0000 (17:08 +0000)]
[SelectionDAG] ComputeNumSignBits - add ISD::ADD demanded elts support

4 years ago[Concepts] Placeholder constraints and abbreviated templates
Saar Raz [Wed, 22 Jan 2020 00:03:05 +0000 (02:03 +0200)]
[Concepts] Placeholder constraints and abbreviated templates

This patch implements P1141R2 "Yet another approach for constrained declarations".

General strategy for this patch was:

- Expand AutoType to include optional type-constraint, reflecting the wording and easing the integration of constraints.
- Replace autos in parameter type specifiers with invented parameters in GetTypeSpecTypeForDeclarator, using the same logic
  previously used for generic lambdas, now unified with abbreviated templates, by:
  - Tracking the template parameter lists in the Declarator object
  - Tracking the template parameter depth before parsing function declarators (at which point we can match template
    parameters against scope specifiers to know if we have an explicit template parameter list to append invented parameters
    to or not).
- When encountering an AutoType in a parameter context we check a stack of InventedTemplateParameterInfo structures that
  contain the info required to create and accumulate invented template parameters (fields that were already present in
  LambdaScopeInfo, which now inherits from this class and is looked up when an auto is encountered in a lambda context).

Resubmit after fixing MSAN failures caused by incomplete initialization of AutoTypeLocs in TypeSpecLocFiller.

Differential Revision: https://reviews.llvm.org/D65042

4 years ago[analyzer] Improve FuchsiaHandleChecker's diagnostic messages
Gabor Horvath [Wed, 22 Jan 2020 22:10:13 +0000 (14:10 -0800)]
[analyzer] Improve FuchsiaHandleChecker's diagnostic messages

Differential Revision: https://reviews.llvm.org/D73229

4 years ago[RDA] Skip debug values
Sam Parker [Thu, 23 Jan 2020 16:44:25 +0000 (16:44 +0000)]
[RDA] Skip debug values

Skip debug instructions when iterating through a block to find uses.

Differential Revision: https://reviews.llvm.org/D73273

4 years agoAMDGPU/GlobalISel: Select V_ADD3_U32/V_XOR3_B32
Matt Arsenault [Wed, 22 Jan 2020 03:46:43 +0000 (22:46 -0500)]
AMDGPU/GlobalISel: Select V_ADD3_U32/V_XOR3_B32

The other 3-op patterns should also be theoretically handled, but
currently there's a bug in the inferred pattern complexity.

I'm not sure what the error handling strategy should be for potential
constant bus violations. I think the correct strategy is to never
produce mixed SGPR and VGPR operands in a typical VOP instruction,
which will trivially avoid them. However, it's possible to still have
hand written MIR (or erroneously transformed code) with these
operands. When these fold, the restriction will be violated. We
currently don't have any verifiers for reg bank legality. For now,
just ignore the restriction.

It might be worth triggering a DAG fallback on verifier error.

4 years agoGlobalISel: Use Register
Matt Arsenault [Thu, 23 Jan 2020 14:20:55 +0000 (09:20 -0500)]
GlobalISel: Use Register

4 years agoclang-cl: Parse /QIntel-jcc-erratum
Hans Wennborg [Thu, 23 Jan 2020 17:00:35 +0000 (18:00 +0100)]
clang-cl: Parse /QIntel-jcc-erratum

It appears to be a new flag, see
https://github.com/MicrosoftDocs/cpp-docs/commit/c7ac1c2635a631c61d3bed9f12b31dee6d6716fe

4 years ago[SelectionDAG] ComputeNumSignBits - add ISD::ADD vector support
Simon Pilgrim [Thu, 23 Jan 2020 16:41:57 +0000 (16:41 +0000)]
[SelectionDAG] ComputeNumSignBits - add ISD::ADD vector support

Add missing handling for (ADD (AND X, 1), -1) uniform vectors

4 years ago[X86][SSE] Add ComputeNumSignBits tests for (ADD (AND X, 1), -1) vectors
Simon Pilgrim [Thu, 23 Jan 2020 16:29:33 +0000 (16:29 +0000)]
[X86][SSE] Add ComputeNumSignBits tests for (ADD (AND X, 1), -1) vectors

4 years ago[Alignment][NFC] Use Align with CreateAlignedStore
Guillaume Chatelet [Thu, 23 Jan 2020 15:18:34 +0000 (16:18 +0100)]
[Alignment][NFC] Use Align with CreateAlignedStore

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: arsenm, jvesely, nhaehnle, hiraditya, kerbowa, cfe-commits, llvm-commits

Tags: #clang, #llvm

Differential Revision: https://reviews.llvm.org/D73274

4 years agoAMDGPU: Check for other uses when looking through casted select
Matt Arsenault [Thu, 23 Jan 2020 16:17:16 +0000 (11:17 -0500)]
AMDGPU: Check for other uses when looking through casted select

Fixes mesa regression on ext_transform_feedback-max-varyings

4 years ago[NFC][ARM] Add test
Sam Parker [Thu, 23 Jan 2020 16:19:57 +0000 (16:19 +0000)]
[NFC][ARM] Add test

4 years ago[SelectionDAG] ComputeNumSignBits - add ISD::SUB demanded elts support
Simon Pilgrim [Thu, 23 Jan 2020 16:12:17 +0000 (16:12 +0000)]
[SelectionDAG] ComputeNumSignBits - add ISD::SUB demanded elts support

4 years ago[X86][AVX] Add AVX1/AVX2 ashr vector tests
Simon Pilgrim [Thu, 23 Jan 2020 15:45:50 +0000 (15:45 +0000)]
[X86][AVX] Add AVX1/AVX2 ashr vector tests

4 years ago[OpenMP] change omp_atk_* and omp_atv_* enumerators to lowercase [NFC]
Kelvin Li [Thu, 23 Jan 2020 14:16:06 +0000 (09:16 -0500)]
[OpenMP] change omp_atk_* and omp_atv_* enumerators to lowercase [NFC]

The OpenMP spec defines the OMP_ATK_* and OMP_ATV_* to be lowercase.

Differential Revision: https://reviews.llvm.org/D73248

4 years ago[OPENMP]Fix use of local allocators in allocate clauses.
Alexey Bataev [Thu, 23 Jan 2020 15:47:16 +0000 (10:47 -0500)]
[OPENMP]Fix use of local allocators in allocate clauses.

If local allocator was declared and used in the allocate clause, it was
not captured in inner region. It leads to a compiler crash, need to
capture the allocator declarator.

4 years ago[hip] Remove `-Werror=format-nonliteral`
Michael Liao [Wed, 22 Jan 2020 21:04:57 +0000 (16:04 -0500)]
[hip] Remove `-Werror=format-nonliteral`

Summary:
- It won't distinguish host and device code and trigger compilation
  failure on irrelevant code.

Reviewers: sameerds, yaxunl

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D73224

4 years agoFix GCC warning/error '-fpermission'. NFC.
Michael Liao [Thu, 23 Jan 2020 15:39:39 +0000 (10:39 -0500)]
Fix GCC warning/error '-fpermission'. NFC.

4 years ago[Hexagon] Remove unused operand definitions: s10_0Imm and s10_6Imm
Krzysztof Parzyszek [Thu, 23 Jan 2020 15:37:17 +0000 (09:37 -0600)]
[Hexagon] Remove unused operand definitions: s10_0Imm and s10_6Imm

4 years agoRevert "[tablegen] Emit string literals instead of char arrays"
Sergej Jaskiewicz [Thu, 23 Jan 2020 14:52:43 +0000 (17:52 +0300)]
Revert "[tablegen] Emit string literals instead of char arrays"

This reverts commit ce23515f5ab01161c98449d833b3ae013b553aa8.

That commit broke some builds on Windows:
http://lab.llvm.org:8011/builders/clang-x64-windows-msvc/builds/13870

4 years ago[Dsymutil][Debuginfo][NFC] #4 Refactor dsymutil to separate DWARF optimizing part.
Alexey Lapshin [Sun, 12 Jan 2020 20:15:57 +0000 (23:15 +0300)]
[Dsymutil][Debuginfo][NFC] #4 Refactor dsymutil to separate DWARF optimizing part.

Summary:
The primary goal of this refactoring is to separate DWARF optimizing part.
So that it could be reused by linker or by any other client.
There was a thread on llvm-dev discussing the necessity of such a refactoring:

http://lists.llvm.org/pipermail/llvm-dev/2019-September/135068.html.

This is a final part from series of patches for dsymutil.
Previous patches : D71068, D71839, D72476. This patch:

1. Creates lib/DWARFLinker interface :

   void addObjectFile(DwarfLinkerObjFile &ObjFile);
   bool link();
   void setOptions;

1. Moves all linking logic from tools/dsymutil/DwarfLinkerForBinary
   into lib/DWARFLinker.
2. Renames RelocationManager into AddressesManager.
3. Remarks creation logic moved from separate parallel execution
   into object file loading routine.

Testing: it passes "check-all" lit testing. MD5 checksum for clang .dSYM bundle
matches for the dsymutil with/without that patch.

Reviewers: JDevlieghere, friss, dblaikie, aprantl, jdoerfert

Reviewed By: JDevlieghere

Subscribers: merge_guards_bot, hiraditya, jfb, llvm-commits, probinson, thegameg

Tags: #llvm, #debug-info

Differential Revision: https://reviews.llvm.org/D72915

4 years ago[VE] add, sub, left/right shift isel patterns
Kazushi (Jam) Marukawa [Thu, 23 Jan 2020 15:00:25 +0000 (16:00 +0100)]
[VE] add, sub, left/right shift isel patterns

Summary: Add, sub, left/right shift isel patterns and tests for i32/i64 and fp32/fp64.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D73207

4 years agoRevert "Resubmit: [JumpThreading] Thread jumps through two basic blocks"
Kazu Hirata [Thu, 23 Jan 2020 14:26:33 +0000 (06:26 -0800)]
Revert "Resubmit: [JumpThreading] Thread jumps through two basic blocks"

This reverts commit 53b68e676faf208b4a8f817e9bd4ddd522cc6006.

Our internal tests are showing breakage with this patch.

4 years ago[clang][CodeComplete] Make completion work after initializer lists
Kadir Cetinkaya [Wed, 22 Jan 2020 13:10:01 +0000 (14:10 +0100)]
[clang][CodeComplete] Make completion work after initializer lists

Summary:
CodeCompletion was not being triggered after successfully parsed
initializer lists, e.g.

```cpp
void foo(int, bool);
void bar() {
  foo({1}^, false);
}
```

CodeCompletion would suggest the function foo as an overload candidate up until
the point marked with `^` but after that point we do not trigger signature help
since parsing succeeds.

This patch handles that case by failing in parsing expression lists whenever we
see a codecompletion token, in addition to getting an invalid subexpression.

Reviewers: sammccall

Subscribers: cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D73177

4 years ago[VE][NFC] re-write RR* isel class using null_frag
Simon Moll [Thu, 23 Jan 2020 14:17:19 +0000 (15:17 +0100)]
[VE][NFC] re-write RR* isel class using null_frag

Summary: Re-write RR* using null_frag to avoid duplication in upcoming patches.

Reviewed By: arsenm

Differential Revision: https://reviews.llvm.org/D73259

4 years ago[ARM,MVE] Make the MVE intrinsics work in C++!
Simon Tatham [Thu, 23 Jan 2020 14:10:24 +0000 (14:10 +0000)]
[ARM,MVE] Make the MVE intrinsics work in C++!

Summary:
Apparently nobody has tried this in months of development. It turns
out that `FunctionDecl::getBuiltinID` will never consider a function
to be a builtin if it is in C++ and not extern "C". So none of the
function declarations in <arm_mve.h> are recognized as builtins when
clang is compiling in C++ mode: it just emits calls to them as
ordinary functions, which then turn out not to exist at link time.

The trivial fix is to wrap most of arm_mve.h in an extern "C".

Added a test in clang/test/CodeGen/arm-mve-intrinsics which checks
basic functioning of the MVE header file in C++ mode. I've filled it
with copies of existing test functions from other files in that
directory, including a few moderately tricky cases of overloading (in
particular one that relies on the strict-polymorphism attribute added
in D72518).

(I considered making //every// test in that directory compile in both
C and C++ mode and check the code generation was identical. But I
think that would increase testing time by more than the value it adds,
and also update_cc_test_checks gets confused when the output function
name varies between RUN lines.)

Reviewers: LukeGeeson, MarkMurrayARM, miyuki, dmgreen

Reviewed By: MarkMurrayARM

Subscribers: kristof.beyls, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D73268

4 years ago[tablegen] Emit string literals instead of char arrays
Luke Drummond [Wed, 15 Jan 2020 14:14:01 +0000 (14:14 +0000)]
[tablegen] Emit string literals instead of char arrays

This changes the generated (Instr|Asm|Reg|Regclass)Name tables from this
form:
    extern const char HexagonInstrNameData[] = {
      /* 0 */ 'G', '_', 'F', 'L', 'O', 'G', '1', '0', 0,
      /* 9 */ 'E', 'N', 'D', 'L', 'O', 'O', 'P', '0', 0,
      /* 18 */ 'V', '6', '_', 'v', 'd', 'd', '0', 0,
      /* 26 */ 'P', 'S', '_', 'v', 'd', 'd', '0', 0,
      [...]
    };

...to this:

    extern const char HexagonInstrNameData[] = {
      /* 0 */ "G_FLOG10\0"
      /* 9 */ "ENDLOOP0\0"
      /* 18 */ "V6_vdd0\0"
      /* 26 */ "PS_vdd0\0"
      [...]
    };

This should make debugging and exploration a lot easier for mortals,
while providing a significant compile-time reduction for common compilers.

To avoid issues with low implementation limits, this is disabled by
default for visual studio or when cross-compiling.

To force output one way or the other, pass
`--long-string-literals=<bool>` to `tablegen`

Reviewers: mstorsjo, rnk

Subscribers: llvm-commit

Differential Revision: https://reviews.llvm.org/D73044

4 years agoRevert "[mlir] Add baseAttr to TypedArrayAttrBase."
Alex Zinenko [Thu, 23 Jan 2020 13:47:11 +0000 (14:47 +0100)]
Revert "[mlir] Add baseAttr to TypedArrayAttrBase."

This reverts commit eec36909c18b8788773abc95d199e6acde6eb42c.

This modeling is incorrect. baseAttr is intended for attribute
decorators that are not backed by C++ attribute classes. It essentially
says DerivedAttr isa BaseAttr, which is wrong for ArrayAttr classes.
If one needs to store the element type, it should be stored as a
separate filed in the tablegen class.

4 years ago[CodeGen] Make use of MachineInstrBuilder::getReg
Jay Foad [Thu, 23 Jan 2020 11:51:35 +0000 (11:51 +0000)]
[CodeGen] Make use of MachineInstrBuilder::getReg

Reviewers: arsenm

Subscribers: wdng, hiraditya, Petar.Avramovic, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D73262

4 years ago[gn build] Port 2f6987ba61c
LLVM GN Syncbot [Thu, 23 Jan 2020 13:34:12 +0000 (13:34 +0000)]
[gn build] Port 2f6987ba61c

4 years ago[NFC][RDA] Make the interface const
Sam Parker [Thu, 23 Jan 2020 13:22:13 +0000 (13:22 +0000)]
[NFC][RDA] Make the interface const

Make all the public query methods const.

4 years ago[SelectionDAG] Compute Known + Sign Bits - merge INSERT_VECTOR_ELT known/unknown...
Simon Pilgrim [Thu, 23 Jan 2020 12:35:29 +0000 (12:35 +0000)]
[SelectionDAG] Compute Known + Sign Bits - merge INSERT_VECTOR_ELT known/unknown index paths

Match the approach in SimplifyDemandedBits where we calculate the demanded elts and then have a common path for the ComputeKnownBits/ComputeNumSignBits call.

4 years ago[LoopRotate] add ability to repeat loop rotation until non-deoptimizing exit is found
Fedor Sergeev [Thu, 23 Jan 2020 12:55:32 +0000 (15:55 +0300)]
[LoopRotate] add ability to repeat loop rotation until non-deoptimizing exit is found

In case of loops with multiple exit where all-but-one exit are deoptimizing
it might happen that the first rotation will end up with latch having a deoptimizing
exit. This makes the loop unsuitable for trip-count analysis (say, getLoopEstimatedTripCount)
as well as for loop transformations that know how to handle multple deoptimizing exits.

It pretty much means that canonical form in multple-deoptimizing-exits case should be
with non-deoptimizing exit at latch.
Teach loop-rotation to reach this canonical form by repeating rotation.

-loop-rotate-multi option introduced to control this behavior, currently disabled by default.

Reviewers: skatkov, asbirlea, reames, fhahn
Reviewed By: skatkov

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D73058