platform/upstream/llvm.git
4 years ago[X86] Go back to considering v64i1 as a legal type under min-legal-vector-width=256...
Craig Topper [Tue, 10 Dec 2019 22:44:38 +0000 (14:44 -0800)]
[X86] Go back to considering v64i1 as a legal type under min-legal-vector-width=256. Scalarize v64i1 arguments and shuffles under min-legal-vector-width=256.

This reverts 3e1aee2ba717529b651a79ed4fc7e7147358043f in favor
of a different approach.

Scalarizing isn't great codegen, but making the type illegal was
interfering with k constraint in inline assembly.

4 years agoRevert "Temporarily revert [lldb] e81268d - [lldb/Reproducers] Support multiple GDB...
Eric Christopher [Tue, 10 Dec 2019 23:04:02 +0000 (15:04 -0800)]
Revert "Temporarily revert [lldb] e81268d - [lldb/Reproducers] Support multiple GDB remotes"

On multiple retry this issue won't duplicate - will revisit with author if
duplication works again.

This reverts commit c9e0b354e2749ce7ab553974692cb35c8651a869.

4 years agoRemove debugging printf and reformat code.
Eric Christopher [Tue, 10 Dec 2019 23:02:29 +0000 (15:02 -0800)]
Remove debugging printf and reformat code.

4 years ago[TypeCategory] IsApplicable gets a LanguageType, not a ValueObject.
Davide Italiano [Tue, 10 Dec 2019 22:44:51 +0000 (14:44 -0800)]
[TypeCategory] IsApplicable gets a LanguageType, not a ValueObject.

Reviewers: aprantl, teemperor

Subscribers: lldb-commits

Tags: #lldb

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

4 years agoSkip TestMultilineCompletion.py on ios testsuite runs.
Jason Molenda [Tue, 10 Dec 2019 22:54:42 +0000 (14:54 -0800)]
Skip TestMultilineCompletion.py on ios testsuite runs.

4 years ago[IR] allow undefined elements when checking for splat constants
Sanjay Patel [Tue, 10 Dec 2019 20:41:19 +0000 (15:41 -0500)]
[IR] allow undefined elements when checking for splat constants

This mimics the related call in SDAG. The caller is responsible
for ensuring that undef values are propagated safely.

4 years ago[InstSimplify] add tests for insert constant + splat; NFC
Sanjay Patel [Tue, 10 Dec 2019 16:16:47 +0000 (11:16 -0500)]
[InstSimplify] add tests for insert constant + splat; NFC

4 years agoDebugInfo: Clarify some more reasons v4 loc.dwo can't share much implementation with...
David Blaikie [Tue, 10 Dec 2019 22:10:15 +0000 (14:10 -0800)]
DebugInfo: Clarify some more reasons v4 loc.dwo can't share much implementation with loclists.dwo

4 years ago[DWARF] Allow cross-CU references of subprogram definitions
Vedant Kumar [Fri, 15 Nov 2019 23:37:29 +0000 (15:37 -0800)]
[DWARF] Allow cross-CU references of subprogram definitions

This allows a call site tag in CU A to reference a callee DIE in CU B
without resorting to creating an incomplete duplicate DIE for the callee
inside of CU A.

We already allow cross-CU references of subprogram declarations, so it
doesn't seem like definitions ought to be special.

This improves entry value evaluation and tail call frame synthesis in
the LTO setting. During LTO, it's common for cross-module inlining to
produce a call in some CU A where the callee resides in a different CU,
and there is no declaration subprogram for the callee anywhere. In this
case llvm would (unnecessarily, I think) emit an empty DW_TAG_subprogram
in order to fill in the call site tag. That empty 'definition' defeats
entry value evaluation etc., because the debugger can't figure out what
it means.

As a follow-up, maybe we could add a DWARF verifier check that a
DW_TAG_subprogram at least has a DW_AT_name attribute.

rdar://46577651

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

4 years ago[FormatManager] Add a unittest for GetCandidateLanguages()
Davide Italiano [Tue, 10 Dec 2019 21:39:04 +0000 (13:39 -0800)]
[FormatManager] Add a unittest for GetCandidateLanguages()

Reviewers: teemperor, JDevlieghere, aprantl, jingham

Subscribers: mgorny, lldb-commits

Tags: #lldb

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

4 years agoDebug Info: Strengthen the synthesized-property-cleanup.mm test, NFC
Vedant Kumar [Tue, 10 Dec 2019 21:35:50 +0000 (13:35 -0800)]
Debug Info: Strengthen the synthesized-property-cleanup.mm test, NFC

After https://reviews.llvm.org/D71084, the line locations assigned when
emitting cleanups inside of property accessors changed. Update this test
to actually check that those locations are correct.

rdar://57796656

4 years ago[libcxx] [test] Query the target platform, not the host one
Louis Dionne [Tue, 10 Dec 2019 21:34:30 +0000 (16:34 -0500)]
[libcxx] [test] Query the target platform, not the host one

target_info is inferred to WindowsLocalTI on Windows hosts unless
specified otherwise. In the latter case, it doesn't make sense to use
Windows-specific settings if the target is not Windows.

This change should not break anything, because target_info is inferred
based on what platform.system() returns. self.is_windows was set based
on the same platform.system() call.

Thanks to Sergej Jaskiewicz for the patch.

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

4 years ago[OPENMP50]Do not mark the function as used if referenced only in declare
Alexey Bataev [Tue, 10 Dec 2019 21:12:53 +0000 (16:12 -0500)]
[OPENMP50]Do not mark the function as used if referenced only in declare
variant directive.

If the function is used only in declare variant directive as a variant
function, it should not be marked as used to prevent emission of the
target-specific functions. Build the reference in the unevaluated
context.

4 years ago[Remarks][Docs] Enhance documentation for opt-remarks driver options
Francis Visoiu Mistrih [Wed, 4 Dec 2019 18:19:41 +0000 (10:19 -0800)]
[Remarks][Docs] Enhance documentation for opt-remarks driver options

Add better documentation about the naming scheme, add a few more
explicit descriptions and make the sphinx look better.

4 years ago[c++20] Return type deduction for defaulted three-way comparisons.
Richard Smith [Tue, 10 Dec 2019 19:33:27 +0000 (11:33 -0800)]
[c++20] Return type deduction for defaulted three-way comparisons.

4 years ago[cxx_status] Fix table layout.
Richard Smith [Tue, 10 Dec 2019 19:57:28 +0000 (11:57 -0800)]
[cxx_status] Fix table layout.

4 years ago[DebugInfo] Refactored macro related generation, added a test case for macinfo.dwo...
Sourabh Singh Tomar [Wed, 4 Dec 2019 13:02:39 +0000 (18:32 +0530)]
[DebugInfo] Refactored macro related generation, added a test case for macinfo.dwo emission.

Reviewers: dblaikie, aprantl, jini.susan.george

Tags: #debug-info #llvm

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

4 years agoDeprecate the hasDefaultArgument matcher
Stephen Kelly [Sat, 7 Dec 2019 18:23:15 +0000 (18:23 +0000)]
Deprecate the hasDefaultArgument matcher

Summary:
It doesn't provide a way to match on the contents of the default
argumment.  Rather than give it that capability, make it deprecated and
recomment the use of hasInitializer instead.

Reviewers: aaron.ballman

Subscribers: cfe-commits

Tags: #clang

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

4 years ago[lldb] Add #include to appease the modules build
Vedant Kumar [Tue, 10 Dec 2019 20:36:40 +0000 (12:36 -0800)]
[lldb] Add #include to appease the modules build

This #include appears to be completely unnecessary, but it does fix the
following build failure:

http://green.lab.llvm.org/green/job/lldb-cmake/4565/consoleText

FAILED: tools/lldb/source/Host/CMakeFiles/lldbHost.dir/common/MainLoop.cpp.o
/Users/buildslave/jenkins/workspace/lldb-cmake/host-compiler/bin/clang++  -DGTEST_HAS_RTTI=0 -DHAVE_ROUND -DLIBXML2_DEFINED -DLLDB_CONFIGURATION_RELEASE -DLLDB_USE_OS_LOG -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Itools/lldb/source/Host -I/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/source/Host -Itools/lldb/source -I/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/include -Itools/lldb/include -Iinclude -I/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/include -I/usr/local/Frameworks/Python.framework/Versions/3.7/include/python3.7m -I/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/llvm/../clang/include -Itools/lldb/../clang/include -I/usr/local/include -I/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/source/. -isystem /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include/libxml2 -Wdocumentation -fPIC -fvisibility-inlines-hidden -Werror=date-time -Werror=unguarded-availability-new -fmodules -fmodules-cache-path=/Users/buildslave/jenkins/workspace/lldb-cmake/lldb-build/module.cache -fcxx-modules -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -fdiagnostics-color -Wno-deprecated-declarations -Wno-unknown-pragmas -Wno-strict-aliasing -Wno-deprecated-register -Wno-vla-extension -O3  -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk   -UNDEBUG  -fno-exceptions -fno-rtti -std=c++14 -MD -MT tools/lldb/source/Host/CMakeFiles/lldbHost.dir/common/MainLoop.cpp.o -MF tools/lldb/source/Host/CMakeFiles/lldbHost.dir/common/MainLoop.cpp.o.d -o tools/lldb/source/Host/CMakeFiles/lldbHost.dir/common/MainLoop.cpp.o -c /Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/source/Host/common/MainLoop.cpp
/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/source/Host/common/MainLoop.cpp:211:7: error: use of undeclared identifier 'ppoll'
  if (ppoll(read_fds.data(), read_fds.size(), nullptr, &sigmask) == -1 &&
      ^
/Users/buildslave/jenkins/workspace/lldb-cmake/llvm-project/lldb/source/Host/common/MainLoop.cpp:336:25: error: use of undeclared identifier 'HAVE_SYS_EVENT_H'
  ret = pthread_sigmask(HAVE_SYS_EVENT_H ? SIG_UNBLOCK : SIG_BLOCK,
                        ^
2 errors generated.

4 years ago[OPENMP50]Add if clause in target simd directive.
Alexey Bataev [Tue, 10 Dec 2019 17:44:45 +0000 (12:44 -0500)]
[OPENMP50]Add if clause in target simd directive.

According to OpenMP 5.0, if clause can be used in for simd directive. If
condition in the if clause if false, the non-vectorized version of the
loop must be executed.

4 years agoTemporarily revert [lldb] e81268d - [lldb/Reproducers] Support multiple GDB remotes
Eric Christopher [Tue, 10 Dec 2019 20:19:30 +0000 (12:19 -0800)]
Temporarily revert [lldb] e81268d - [lldb/Reproducers] Support multiple GDB remotes

This was causing a crash in opt+assert builds on linux and a follow-up
message was posted.

This reverts commit e81268d03e73aef4f9c7bd8ece8ad02f5b017dcf

4 years ago[clangd] Fix an incorrect expectedResult usage in rename test.
Haojian Wu [Tue, 10 Dec 2019 20:13:36 +0000 (21:13 +0100)]
[clangd] Fix an incorrect expectedResult usage in rename test.

expectedResult(Code, expectedResult(T, "abc")) => should be expectedResult(T, "abc")

The test was passed by coincidence.

4 years ago[Wdocumentation] Use C2x/C++14 deprecated attribute
Mark de Wever [Tue, 10 Dec 2019 17:32:30 +0000 (18:32 +0100)]
[Wdocumentation] Use C2x/C++14 deprecated attribute

This replaces the non-standard __attribute__((deprecated)) with the
standard [[deprecated]] when compiling in C2x/C++14 mode.

Discovered while looking at https://bugs.llvm.org/show_bug.cgi?id=43753

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

4 years ago[Wdocumentation] Properly place deprecated attribute
Mark de Wever [Tue, 10 Dec 2019 17:32:29 +0000 (18:32 +0100)]
[Wdocumentation] Properly place deprecated attribute

It is now placed before the function:
- allows to replace __attribute__((deprecated)) with [[deprecated]].
- required for trailing returns.

Fixes bug: https://bugs.llvm.org/show_bug.cgi?id=43753

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

4 years ago[Wdocumentation] Use the command marker.
Mark de Wever [Tue, 10 Dec 2019 17:32:28 +0000 (18:32 +0100)]
[Wdocumentation] Use the command marker.

Use the proper marker for -Wdocumentation-deprecated-sync instead of
hard-coded the backslash.

Discovered while looking at https://bugs.llvm.org/show_bug.cgi?id=43753

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

4 years agoscudo: Tweak how we align UserPtr. NFCI.
Peter Collingbourne [Thu, 5 Dec 2019 01:28:45 +0000 (17:28 -0800)]
scudo: Tweak how we align UserPtr. NFCI.

Instead of testing whether the pointer is aligned, just align it
unconditionally and compare it to the original pointer.

This moves the computation of UserPtr up to before we start preparing the
header, so that the memory tagging code will be able to read the original
header containing the bounds of the previous allocation before it gets
potentially clobbered by the pointer realignment code.

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

4 years agoscudo: Move getChunkFromBlock() allocated check into caller. NFCI.
Peter Collingbourne [Mon, 9 Dec 2019 21:02:24 +0000 (13:02 -0800)]
scudo: Move getChunkFromBlock() allocated check into caller. NFCI.

With tag-on-free we will need to get the chunk of a deallocated block. Change
getChunkFromBlock() so that it doesn't check that the chunk is allocated,
and move the check into the caller, so that it can be reused for this purpose.

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

4 years agoRecommit "[DWARF5] Start emitting DW_AT_dwo_name when -gdwarf-5 is specified."
Sourabh Singh Tomar [Fri, 29 Nov 2019 05:56:00 +0000 (11:26 +0530)]
Recommit "[DWARF5] Start emitting DW_AT_dwo_name when -gdwarf-5 is specified."

Reviewers: dblaikie, aprantl, probinson

Tags: #debug-info #llvm

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

4 years agoRevert "[DWARF5] Start emitting DW_AT_dwo_name when -gdwarf-5 is specified."
Sourabh Singh Tomar [Tue, 10 Dec 2019 19:49:43 +0000 (01:19 +0530)]
Revert "[DWARF5] Start emitting DW_AT_dwo_name when -gdwarf-5 is specified."

This reverts commit 6ef01588f4d75ef43da4ed2a37ba7a8b8daab259.
Missing Differetial revision.

4 years agoAdd missed #include in llvmorg-10-init-11532-g848934c67d4.
Richard Smith [Tue, 10 Dec 2019 19:34:49 +0000 (11:34 -0800)]
Add missed #include in llvmorg-10-init-11532-g848934c67d4.

4 years ago[cxx_status] Add missed Belfast paper affecting three-way comparisons.
Richard Smith [Tue, 10 Dec 2019 02:01:47 +0000 (18:01 -0800)]
[cxx_status] Add missed Belfast paper affecting three-way comparisons.

4 years ago[DWARF5] Start emitting DW_AT_dwo_name when -gdwarf-5 is specified.
Sourabh Singh Tomar [Fri, 29 Nov 2019 05:56:00 +0000 (11:26 +0530)]
[DWARF5] Start emitting DW_AT_dwo_name when -gdwarf-5 is specified.

4 years ago[BPF] put not-section-attribute externs into BTF ".extern" data section
Yonghong Song [Tue, 10 Dec 2019 19:05:22 +0000 (11:05 -0800)]
[BPF] put not-section-attribute externs into BTF ".extern" data section

Currently for extern variables with section attribute, those
BTF_KIND_VARs will not be placed in any DataSec. This is
inconvenient as any other generated BTF_KIND_VAR belongs to
one DataSec. This patch put these extern variables into
".extern" section so bpf loader can have a consistent
processing mechanism for all data sections and variables.

4 years agoAssert launch success in run_to_breakpoint_do_run
Vedant Kumar [Tue, 10 Dec 2019 19:18:45 +0000 (11:18 -0800)]
Assert launch success in run_to_breakpoint_do_run

4 years agoFix -Wincomplete-umbrella warning in the modules build
Vedant Kumar [Tue, 10 Dec 2019 19:17:47 +0000 (11:17 -0800)]
Fix -Wincomplete-umbrella warning in the modules build

[281/3666] Building CXX object lib/IR/CMakeFiles/LLVMCore.dir/IntrinsicInst.cpp.o
/Users/vsk/src/llvm-project-master/llvm/lib/IR/IntrinsicInst.cpp:155:2: warning: missing submodule 'LLVM_IR.ConstrainedOps' [-Wincomplete-umbrella]

4 years agoFix a -Wsign-compare error around wchar_t vs unsigned int.
Eric Christopher [Tue, 10 Dec 2019 19:17:40 +0000 (11:17 -0800)]
Fix a -Wsign-compare error around wchar_t vs unsigned int.

4 years ago[lldb/Host] Use Host/Config.h entries instead of a global define.
Jonas Devlieghere [Tue, 10 Dec 2019 16:54:30 +0000 (08:54 -0800)]
[lldb/Host] Use Host/Config.h entries instead of a global define.

As suggested by Pavel in a code review:

> Can we replace this (and maybe python too, while at it) with a
> Host/Config.h entry? A global definition means that one has to
> recompile everything when these change in any way, whereas in
> practice only a handful of files need this..

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

4 years ago[lldb/Reproducers] Support multiple GDB remotes
Jonas Devlieghere [Sat, 7 Dec 2019 23:28:30 +0000 (15:28 -0800)]
[lldb/Reproducers] Support multiple GDB remotes

When running the test suite with always capture on, a handful of tests
are failing because they have multiple targets and therefore multiple
GDB remote connections. The current reproducer infrastructure is capable
of dealing with that.

This patch reworks the GDB remote provider to support multiple GDB
remote connections, similar to how the reproducers support shadowing
multiple command interpreter inputs. The provider now keeps a list of
packet recorders which deal with a single GDB remote connection. During
replay we rely on the order of creation to match the number of packets
to the GDB remote connection.

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

4 years agoFix bug 44190 - wrong code with #pragma pack(1)
Yaxun (Sam) Liu [Tue, 10 Dec 2019 16:55:33 +0000 (11:55 -0500)]
Fix bug 44190 - wrong code with #pragma pack(1)

https://github.com/llvm/llvm-project/commit/5b330e8d6122c336d81dfd11c864e6c6240a381e caused
a regression on s390:

https://bugs.llvm.org/show_bug.cgi?id=44190

we need to copy if if either the argument is non-byval or the argument is underaligned.

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

4 years agoReplace redundant code in FormatManager and FormatCache with templates (NFC)
Adrian Prantl [Tue, 10 Dec 2019 00:22:26 +0000 (16:22 -0800)]
Replace redundant code in FormatManager and FormatCache with templates (NFC)

This is a preparatory patch for an upcoming bugfix.

FormatManager and friends have four identical implementations of many
accessor functions to deal with the four types of shared pointers in
the FormatCache. This patch replaces these implementations with
templates. While this patch drastically reduces the amount of source
code and its maintainablity, it doesn't actually improve code
size. I'd argue, this is still an improvement.

rdar://problem/57756763

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

4 years agoRevert 30e8f80fd5a4 "[DebugInfo] Don't create multiple DBG_VALUEs when sinking"
Hans Wennborg [Tue, 10 Dec 2019 18:09:24 +0000 (19:09 +0100)]
Revert 30e8f80fd5a4 "[DebugInfo] Don't create multiple DBG_VALUEs when sinking"

This caused non-determinism in the compiler, see command on the Phabricator
code review.

> This patch addresses a performance problem reported in PR43855, and
> present in the reapplication in in 001574938e5. It turns out that
> MachineSink will (often) move instructions to the first block that
> post-dominates the current block, and then try to sink further. This
> means if we have a lot of conditionals, we can needlessly create large
> numbers of DBG_VALUEs, one in each block the sunk instruction passes
> through.
>
> To fix this, rather than immediately sinking DBG_VALUEs, record them in
> a pass structure. When sinking is complete and instructions won't be
> sunk any further, new DBG_VALUEs are added, avoiding lots of
> intermediate DBG_VALUE $noregs being created.
>
> Differential revision: https://reviews.llvm.org/D70676

4 years ago[FPEnv] clang support for constrained FP builtins
Kevin P. Neal [Mon, 11 Nov 2019 19:21:03 +0000 (14:21 -0500)]
[FPEnv] clang support for constrained FP builtins

Change the IRBuilder and clang so that constrained FP intrinsics will be
emitted for builtins when appropriate. Only non-target-specific builtins
are affected in this patch.

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

4 years ago[OPENMP]Remove extra space from error message.
Alexey Bataev [Tue, 10 Dec 2019 17:53:51 +0000 (12:53 -0500)]
[OPENMP]Remove extra space from error message.

Fixed emission of 2 consecutive whitespaces in the error message.

4 years ago[profile] Add explanatory comments to instrprof-darwin-exports.c, NFC
Vedant Kumar [Tue, 10 Dec 2019 17:45:04 +0000 (09:45 -0800)]
[profile] Add explanatory comments to instrprof-darwin-exports.c, NFC

4 years ago[VectorUtils] Fix -Wunused-private-field after D67572
Fangrui Song [Tue, 10 Dec 2019 17:34:23 +0000 (09:34 -0800)]
[VectorUtils] Fix -Wunused-private-field after D67572

4 years ago[OPENMP50]Add if clause in target parallel for simd directive.
Alexey Bataev [Tue, 10 Dec 2019 16:37:03 +0000 (11:37 -0500)]
[OPENMP50]Add if clause in target parallel for simd directive.

According to OpenMP 5.0, if clause can be used in for simd directive. If
condition in the if clause is false, the non-vectorized version of the
loop must be executed.

4 years ago[ELF] --icf: do not fold preemptible symbols
Fangrui Song [Sat, 30 Nov 2019 05:58:36 +0000 (21:58 -0800)]
[ELF] --icf: do not fold preemptible symbols

Fixes PR44124.

A preemptible symbol may refer to a different definition at runtime.
When comparing a pair of relocations, if they refer to different
symbols, and either symbol is preemptible, the two containing sections
should be considered different.

gold has a similar rule https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=ce97fa81e0c46d216b80b143ad8c02fff6906fef

Reviewed By: grimar

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

4 years ago[ELF] Refine section group --gc-sections rules to not discard .debug_types
Fangrui Song [Sat, 7 Dec 2019 00:26:55 +0000 (16:26 -0800)]
[ELF] Refine section group --gc-sections rules to not discard .debug_types

clang/gcc -fdebug-type-sections places .debug_types and
.rela.debug_types in a section group, with a signature symbol which
represents the type signature. The section group is for deduplication
purposes.

After D70146, we will discard such section groups. Refine the rule so
that we will retain the group if no member has the SHF_ALLOC flag.

GNU ld has a similar rule to retain the group if all members have the
SEC_DEBUGGING flag. We try to be more general for future-proof purposes:
if other non-SHF_ALLOC sections have deduplication needs, they may be
placed in a section group. Don't discard them.

Reviewed By: grimar

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

4 years ago[analyzer] Keep track of escaped locals
Gabor Horvath [Sat, 7 Dec 2019 01:11:37 +0000 (17:11 -0800)]
[analyzer] Keep track of escaped locals

We want to escape all symbols that are stored into escaped regions.
The problem is, we did not know which local regions were escaped. Until now.
This should fix some false positives like the one in the tests.

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

4 years ago[RISCV] Improve assembler missing feature warnings
Simon Cook [Tue, 10 Dec 2019 16:44:48 +0000 (16:44 +0000)]
[RISCV] Improve assembler missing feature warnings

This adds support for printing improved missing feature error messages
from the assembler, which now indicates which feature caused the parse
to fail.

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

4 years ago[VectorUtils] Introduce the Vector Function Database (VFDatabase).
Francesco Petrogalli [Wed, 30 Oct 2019 19:08:21 +0000 (19:08 +0000)]
[VectorUtils] Introduce the Vector Function Database (VFDatabase).

This patch introduced the VFDatabase, the framework proposed in
http://lists.llvm.org/pipermail/llvm-dev/2019-June/133484.html. [*]

In this patch the VFDatabase is used to bridge the TargetLibraryInfo
(TLI) calls that were previously used to query for the availability of
vector counterparts of scalar functions.

The VFISAKind field `ISA` of VFShape have been moved into into VFInfo,
under the assumption that different vector ISAs may provide the same
vector signature. At the moment, the vectorizer accepts any of the
available ISAs as long as the signature provided by the VFDatabase
matches the one expected in the vectorization process. For example,
when targeting AVX or AVX2, which both have 256-bit registers, the IR
signature of the two vector functions associated to the two ISAs is
the same. The `getVectorizedFunction` method at the moment returns the
first available match. We will need to add more heuristics to the
search system to decide which of the available version (TLI, AVX,
AVX2, ...)  the system should prefer, when multiple versions with the
same VFShape are present.

Some of the code in this patch is based on the work done by Sumedh
Arani in https://reviews.llvm.org/D66025.

[*] Notice that in the proposal the VFDatabase was called SVFS. The
name VFDatabase is more in line with LLVM recommendations for
naming classes and variables.

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

4 years ago[ARM][MVE] Refactor complex vector intrinsics [NFCI]
Mikhail Maltsev [Tue, 10 Dec 2019 16:21:52 +0000 (16:21 +0000)]
[ARM][MVE] Refactor complex vector intrinsics [NFCI]

Summary:
This patch refactors instruction selection of the complex vector
addition, multiplication and multiply-add intrinsics, so that it is
now based on TableGen patterns rather than C++ code.

It also changes the first parameter (halving vs non-halving) of the
arm_mve_vcaddq IR intrinsic to match the corresponding instruction
encoding, hence it requires some changes in the tests.

The patch addresses David's comment in https://reviews.llvm.org/D71190

Reviewers: dmgreen, ostannard, simon_tatham, MarkMurrayARM

Reviewed By: dmgreen

Subscribers: merge_guards_bot, kristof.beyls, hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

4 years ago[BUG-FIX][XCOFF] fixed a bug of XCOFFObjectFile.cpp when there is padding at the...
diggerlin [Tue, 10 Dec 2019 16:14:49 +0000 (11:14 -0500)]
[BUG-FIX][XCOFF] fixed a bug of XCOFFObjectFile.cpp when there is padding at the last csect of a sections

SUMMARY:
  Fixed a bug of XCOFFObjectFile.cpp when there is padding at the last csect of a sections.
when there is a tail padding of a section, but the value of CurrentAddressLocation do not be increased by the padding size. it will hit assert assert(CurrentAddressLocation == Section->Address && "We should have no padding between sections.");

Reviewers: daltenty,hubert.reinterpretcast,

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

4 years ago[DebugInfo] Support to emit debugInfo for extern variables
Yonghong Song [Fri, 22 Nov 2019 16:45:37 +0000 (08:45 -0800)]
[DebugInfo] Support to emit debugInfo for extern variables

Extern variable usage in BPF is different from traditional
pure user space application. Recent discussion in linux bpf
mailing list has two use cases where debug info types are
required to use extern variables:
  - extern types are required to have a suitable interface
    in libbpf (bpf loader) to provide kernel config parameters
    to bpf programs.
    https://lore.kernel.org/bpf/CAEf4BzYCNo5GeVGMhp3fhysQ=_axAf=23PtwaZs-yAyafmXC9g@mail.gmail.com/T/#t
  - extern types are required so kernel bpf verifier can
    verify program which uses external functions more precisely.
    This will make later link with actual external function no
    need to reverify.
    https://lore.kernel.org/bpf/87eez4odqp.fsf@toke.dk/T/#m8d5c3e87ffe7f2764e02d722cb0d8cbc136880ed

This patch added clang support to emit debuginfo for extern variables
with a TargetInfo hook to enable it. The debuginfo for the
extern variable is emitted only if that extern variable is
referenced in the current compilation unit.

Currently, only BPF target enables to generate debug info for
extern variables. The emission of such debuginfo is disabled for C++
 at this moment since BPF only supports a subset of C language.
Emission with C++ can be enabled later if an appropriate use case
is identified.

-fstandalone-debug permits us to see more debuginfo with the cost
of bloated binary size. This patch did not add emission of extern
variable debug info with -fstandalone-debug. This can be
re-evaluated if there is a real need.

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

4 years ago[test][llvm-cxxfilt] Improve comment for clarity
James Henderson [Tue, 10 Dec 2019 16:06:36 +0000 (16:06 +0000)]
[test][llvm-cxxfilt] Improve comment for clarity

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

4 years ago[scudo][standalone] Define hasHardwareCRC32 for other archs
Kostya Kortchinsky [Mon, 9 Dec 2019 21:06:34 +0000 (13:06 -0800)]
[scudo][standalone] Define hasHardwareCRC32 for other archs

Summary:
The function was only defined for x86 and arm families, which ends
up being an issue for PPC in g3.

Define the function, simply returning `false` for "other"
architectures.

Reviewers: hctim, pcc, cferris, eugenis, vitalybuka

Subscribers: kristof.beyls, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

4 years ago[InstCombine] replace shuffle's insertelement operand if inserted scalar is not demanded
Sanjay Patel [Tue, 10 Dec 2019 15:10:05 +0000 (10:10 -0500)]
[InstCombine] replace shuffle's insertelement operand if inserted scalar is not demanded

This pattern is noted as a regression from:
D70246
...where we removed an over-aggressive shuffle simplification.

SimplifyDemandedVectorElts fails to catch this case when the insert has multiple uses,
so I'm proposing to pattern match the minimal sequence directly. This fold does not
conflict with any of our current shuffle undef/poison semantics.

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

4 years ago[Docs] Improve SLP code snippet
Sanjay Patel [Mon, 9 Dec 2019 22:07:30 +0000 (17:07 -0500)]
[Docs] Improve SLP code snippet

New C code snippet is more viable for SLP vectorization in most architectures.

Patch by: @lsandov1 (Leonardo Sandoval)

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

4 years ago[Alignment][NFC] CreateMemSet use MaybeAlign
Guillaume Chatelet [Mon, 9 Dec 2019 16:36:50 +0000 (17:36 +0100)]
[Alignment][NFC] CreateMemSet use MaybeAlign

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

Subscribers: arsenm, jvesely, nhaehnle, hiraditya, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

4 years ago[DWARF][RISCV] Test resolving of RISC-V relocations
Luís Marques [Tue, 10 Dec 2019 13:59:04 +0000 (13:59 +0000)]
[DWARF][RISCV] Test resolving of RISC-V relocations

Summary: This patch adds an object file (in yaml format) with a synthetic
.debug_info section which we use to test that the supported RISC-V relocations
are properly resolved.

Reviewers: asb, lenary, MaskRay
Reviewed By: MaskRay
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D70541

4 years agoReapply: [DebugInfo] Recover debug intrinsics when killing duplicated/empty...
stozer [Thu, 5 Dec 2019 10:01:47 +0000 (10:01 +0000)]
Reapply: [DebugInfo] Recover debug intrinsics when killing duplicated/empty...

basic blocks

Originally applied in 72ce759928e6dfee6a9efa310b966c19722352ba.

Fixed a build failure caused by incorrect use of cast instead of
dyn_cast.

This reverts commit 8b0780f795eb58fca0a2456e308adaaa1a0b5013.

4 years ago[lldb] Actually enable wchar support in Editline when it is defined in the host config
Raphael Isemann [Tue, 10 Dec 2019 13:17:38 +0000 (14:17 +0100)]
[lldb] Actually enable wchar support in Editline when it is defined in the host config

Summary:
Our Editline implementation in LLDB supports using the wchar interface of Editline which
should improve handling of unicode input when using Editline. At the moment we essentially
just ignore unicode input and echo the escaped unicode code point (`\U1234`) to the command line
(which we then also incorrectly treat as multiple characters, so console navigation is also broken afterwards).

This patch just adds the include to the host config file which already contains the LLDB_EDITLINE_USE_WCHAR
define to enable the Editline support (we just never included it in the file before). With this we now actually
echo back unicode characters on macOS and we no longer ignore unicode input. On Linux this doesn't
seem to improve the echoing back of characters but at least it fixes that we ignore unicode input.

Reviewers: labath

Reviewed By: labath

Subscribers: JDevlieghere, lldb-commits

Tags: #lldb

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

4 years agoadd test for previous commit
Sam Parker [Tue, 10 Dec 2019 13:24:01 +0000 (13:24 +0000)]
add test for previous commit

4 years ago[TypePromotion] Query target register width
Sam Parker [Tue, 10 Dec 2019 13:21:12 +0000 (13:21 +0000)]
[TypePromotion] Query target register width

TargetLoweringInfo may report that an integer should be promoted, but
it maybe provide a size that isn't natively supported by the target
register file... So check this before trying to perform a promotion.

This is to fix some chromium issues:
https://bugs.chromium.org/p/chromium/issues/detail?id=1031978
https://bugs.chromium.org/p/chromium/issues/detail?id=1031979

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

4 years ago[lldb] Centralize type "desugaring" logic in ClangASTContext
Pavel Labath [Mon, 9 Dec 2019 15:44:26 +0000 (16:44 +0100)]
[lldb] Centralize type "desugaring" logic in ClangASTContext

Summary:
A *lot* of ClangASTContext functions contained repetitive code for
"desugaring" certain kinds of clang types. This patch creates a utility
function for performing this task.

Right now it handles four types (auto, elaborated, paren and typedef),
as these are the types that were handled everywhere. There are probably
other kinds of types that could/should be added here too (TypeOf,
decltype, ...), but I'm leaving that for a separate patch as doing that
would not be NFC (though I'm pretty sure that adding them will not hurt,
and it may in fact fix some bugs).

In another patch I'd like to add "atomic" type to this list to properly
display atomic structs.

Since sometimes one may want to handle a certain kind of type specially
(right now we have code which does that with typedefs), the Desugar
function takes a "mask" argument, which can supress desugaring of
certain kinds of types.

Reviewers: teemperor, shafik

Subscribers: jfb, lldb-commits

Tags: #lldb

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

4 years ago[lldb][NFC] Make g_TotalSizeOfMetadata in ClangExternalASTSourceCommon.cpp static
Raphael Isemann [Tue, 10 Dec 2019 12:14:46 +0000 (13:14 +0100)]
[lldb][NFC] Make g_TotalSizeOfMetadata in ClangExternalASTSourceCommon.cpp static

Clang was warning that this global should be static (which makes sense).

4 years ago[LLDB] [PECOFF] Make sure to set the address byte size in m_data after parsing headers
Martin Storsjö [Fri, 6 Dec 2019 11:25:38 +0000 (13:25 +0200)]
[LLDB] [PECOFF] Make sure to set the address byte size in m_data after parsing headers

If not set, the address byte size was implied to be the one of the
host process.

This allows reverting the functional change from 31087b2ae9154, since
now PECOFF does the same as ELF and MachO wrt setting both byte order
and address size on m_data within ParseHeader.

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

4 years ago[AArch64] Fix issues with large arrays on stack
Kiran Chandramohan [Wed, 20 Nov 2019 12:45:26 +0000 (12:45 +0000)]
[AArch64] Fix issues with large arrays on stack

Summary:
This patch fixes a few issues when large arrays are allocated on the
stack. Currently, clang has inconsistent behaviour, for debug builds
there is an assertion failure when the array size on stack is around 2GB
but there is no assertion when the stack is around 8GB. For release
builds there is no assertion, the compilation succeeds but generates
incorrect code. The incorrect code generated is due to using
int/unsigned int instead of their 64-bit counterparts. This patch,
1) Removes the assertion in frame legality check.
2) Converts int/unsigned int in some places to the 64-bit variants. This
helps in generating correct code and removes the inconsistent behaviour.
3) Adds a test which runs without optimisations.

Reviewers: sdesmalen, efriedma, fhahn, aemerson

Reviewed By: efriedma

Subscribers: eli.friedman, fpetrogalli, kristof.beyls, hiraditya,
llvm-commits

Tags: #llvm

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

4 years agogn build: (manually) merge eb3e81f43
Nico Weber [Tue, 10 Dec 2019 11:39:13 +0000 (06:39 -0500)]
gn build: (manually) merge eb3e81f43

4 years agoOnly Remove implicit conversion for the target that support fp16
Jim Lin [Tue, 10 Dec 2019 11:06:28 +0000 (19:06 +0800)]
Only Remove implicit conversion for the target that support fp16

Remove implicit conversion that promotes half to double
for the target that support fp16. If the target doesn't
support fp16, fp16 will be converted to fp16 intrinsic.

4 years ago[TableGen] Permit dag operators to be unset.
Simon Tatham [Tue, 10 Dec 2019 10:34:40 +0000 (10:34 +0000)]
[TableGen] Permit dag operators to be unset.

This is not a new semantic feature. The syntax `(? 1, 2, 3)` was
disallowed by the parser in a dag //expression//, but there were
already ways to sneak a `?` into the operator field of a dag
//value//, e.g. by initializing it from a class template parameter
which is then set to `?` by the instantiating `def`.

This patch makes `?` in the operator slot syntactically legal, so it's
now easy to construct dags with an unset operator. Also, the semantics
of `!con` are relaxed so that it will allow a combination of set and
unset operator fields in the dag nodes it's concatenating, with the
restriction that all the operators that are //not// unset still have
to agree with each other.

Reviewers: hfinkel, nhaehnle

Reviewed By: hfinkel, nhaehnle

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[AArch64][SVE] Add wide compare immediate patterns
Cullen Rhodes [Mon, 2 Dec 2019 11:20:28 +0000 (11:20 +0000)]
[AArch64][SVE] Add wide compare immediate patterns

Summary:
Recognize wide compares where the wide operand is a splat of a scalar
value in the appropriate range and convert to the immediate variant of
the instruction.

Patch by Graham Hunter

Reviewers: sdesmalen, efriedma, dancgr, rovka, rengolin

Reviewed By: efriedma

Subscribers: tschuett, kristof.beyls, hiraditya, rkruppe, psnobl,
llvm-commits

Tags: #llvm

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

4 years ago[LegalizeTypes] Bugfixes for big-endian targets when handling BITCASTs
Mikael Holmen [Tue, 10 Dec 2019 07:09:09 +0000 (08:09 +0100)]
[LegalizeTypes] Bugfixes for big-endian targets when handling BITCASTs

Summary:
This fixes PR44135.

The special case when we promote a bitcast from a vector to an int
needs special handling when we are on a big-endian target.

Prior to this fix, for the added vec_to_int we see the following in the
SelectionDAG printouts

Type-legalized selection DAG: %bb.1 'foo:bb.1'
SelectionDAG has 9 nodes:
  t0: ch = EntryToken
        t2: v8i16,ch = CopyFromReg t0, Register:v8i16 %0
      t17: v4i32 = bitcast t2
    t23: i32 = extract_vector_elt t17, Constant:i32<3>
  t8: ch,glue = CopyToReg t0, Register:i32 $r0, t23
  t9: ch = ARMISD::RET_FLAG t8, Register:i32 $r0, t8:1

and I think here the extract_vector_elt is wrong and extracts the value
from the wrong index.

The program program should return the 32 bits made up of the elements at
index 4 and 5 in the vec6 array, but with

    t23: i32 = extract_vector_elt t17, Constant:i32<3>

as far as I can tell, we will extract values that originally didn't even
exist in the vec6 vectore.

If we would instead extract the element at index 2 we would get the wanted
values.

With this fix we insert a right shift after the bitcast in
DAGTypeLegalizer::PromoteIntRes_BITCAST which then gives us

Type-legalized selection DAG: %bb.1 'vec_to_int:bb.1'
SelectionDAG has 9 nodes:
  t0: ch = EntryToken
        t2: v8i16,ch = CopyFromReg t0, Register:v8i16 %0
      t23: v4i32 = bitcast t2
    t27: i32 = extract_vector_elt t23, Constant:i32<2>
  t8: ch,glue = CopyToReg t0, Register:i32 $r0, t27
  t9: ch = ARMISD::RET_FLAG t8, Register:i32 $r0, t8:1

So now we get

    t27: i32 = extract_vector_elt t23, Constant:i32<2>

which is what we want.

Similarly, the new int_to_vec testcase exposes a bug where we cast the other
direction. Then we instead need to add a left shift before the bitcast on
big-endian targets for the bits in the input integer to end up at the exptected
place in the vector.

Reviewers: bogner, spatel, craig.topper, t.p.northover, dmgreen, efriedma, SjoerdMeijer, samparker

Reviewed By: efriedma

Subscribers: eli.friedman, bjope, kristof.beyls, hiraditya, llvm-commits

Tags: #llvm

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

4 years agoAdd testcases exposing PR44135
Mikael Holmen [Fri, 6 Dec 2019 07:03:13 +0000 (08:03 +0100)]
Add testcases exposing PR44135

4 years ago[llvm-readelf/llvm-readobj] - Improved the error reporting in a few method related...
Georgii Rymar [Thu, 5 Dec 2019 14:59:34 +0000 (17:59 +0300)]
[llvm-readelf/llvm-readobj] - Improved the error reporting in a few method related to versioning.

I was investigating a change previously discussed that eliminates an excessive
empty lines from the output when we report warnings and errors
(https://reviews.llvm.org/D70826#inline-639055) and found
that we need this refactoring or alike to achieve that.

The problem is that some of our functions that finds symbol versions just
fail instead of returning errors or printing warnings. Another problem
is that they might print a warning on the same line with the regular output.
In this patch I've splitted getting of the version information and dumping of it
for GNU printVersionSymbolSection(). I had to change a few methods to return
Error or Expected<> to do that properly.

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

4 years agoAdd more diff -b to roundtrip-compress.test
Hans Wennborg [Tue, 10 Dec 2019 09:21:34 +0000 (10:21 +0100)]
Add more diff -b to roundtrip-compress.test

It was missing on the first test invocation. The flag is necessary to
ignore line-ending differences on Windows.

4 years ago[clangd] Simplify code using findName. NFC
Ilya Biryukov [Tue, 10 Dec 2019 09:08:39 +0000 (10:08 +0100)]
[clangd] Simplify code using findName. NFC

`findName` was always used in conjuction with `spellingLocIfSpelled`.
This patch replaces patterns of the form:
  spellingLocIfSpelled(findName(&ND), SM)

With a new helper function:
  nameLocation(ND, SM)

And removes `spellingLocIfSpelled` and `findName`. Both are never used
anywhere else and the latter is an equivalent of `Decl::getLocation` if
we ever need it again.

4 years ago[llvm-readobj][test] - Move platform specific test cases and their inputs to separate...
Georgii Rymar [Mon, 9 Dec 2019 14:01:29 +0000 (17:01 +0300)]
[llvm-readobj][test] - Move platform specific test cases and their inputs to separate folders.

This creates the next subfolders in the test directory:
"COFF", "ELF", "MachO", "wasm".

I've also removed platform specific prefixes, like "coff-*".
One unused binary was removed as well: `Inputs/relocs.obj.elf-mips`

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

4 years ago[OpenMP][NFCI] Introduce llvm/IR/OpenMPConstants.h
Johannes Doerfert [Tue, 5 Nov 2019 04:00:49 +0000 (22:00 -0600)]
[OpenMP][NFCI] Introduce llvm/IR/OpenMPConstants.h

Summary:
The new OpenMPConstants.h is a location for all OpenMP related constants
(and helpers) to live.

This patch moves the directives there (the enum OpenMPDirectiveKind) and
rewires Clang to use the new location.

Initially part of D69785.

Reviewers: kiranchandramohan, ABataev, RaviNarayanaswamy, gtbercea, grokos, sdmitriev, JonChesterfield, hfinkel, fghanim

Subscribers: jholewinski, ppenzin, penzn, llvm-commits, cfe-commits, jfb, guansong, bollu, hiraditya, mgorny

Tags: #clang, #llvm

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

4 years ago[BPF] Support to emit debugInfo for extern variables
Yonghong Song [Fri, 22 Nov 2019 16:45:37 +0000 (08:45 -0800)]
[BPF] Support to emit debugInfo for extern variables

extern variable usage in BPF is different from traditional
pure user space application. Recent discussion in linux bpf
mailing list has two use cases where debug info types are
required to use extern variables:
  - extern types are required to have a suitable interface
    in libbpf (bpf loader) to provide kernel config parameters
    to bpf programs.
    https://lore.kernel.org/bpf/CAEf4BzYCNo5GeVGMhp3fhysQ=_axAf=23PtwaZs-yAyafmXC9g@mail.gmail.com/T/#t
  - extern types are required so kernel bpf verifier can
    verify program which uses external functions more precisely.
    This will make later link with actual external function no
    need to reverify.
    https://lore.kernel.org/bpf/87eez4odqp.fsf@toke.dk/T/#m8d5c3e87ffe7f2764e02d722cb0d8cbc136880ed

This patch added bpf support to consume such info into BTF,
which can then be used by bpf loader. Function processFuncPrototypes()
only adds extern function definitions into BTF. The functions
with actual definition have been added to BTF in some other places.

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

4 years agoRemove implicit conversion that promotes half to other larger precision types for...
Jim Lin [Tue, 10 Dec 2019 05:24:21 +0000 (13:24 +0800)]
Remove implicit conversion that promotes half to other larger precision types for fp classification builtins

Summary:
It shouldn't promote half to double or any larger precision types for fp classification builtins.
Because fp classification builtins would get incorrect result with promoted argument.
For example, __builtin_isnormal with a subnormal half value should return false, but it is not.
That the subnormal half value is promoted to a normal double value.

Reviewers: aaron.ballman

Reviewed By: aaron.ballman

Subscribers: cfe-commits

Tags: #clang

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

4 years ago[Remarks][Driver] Error on -foptimization-record-file with multiple -arch options
Francis Visoiu Mistrih [Wed, 4 Dec 2019 17:56:12 +0000 (09:56 -0800)]
[Remarks][Driver] Error on -foptimization-record-file with multiple -arch options

This adds a check for the usage of -foptimization-record-file with
multiple -arch options. This is not permitted since it would require us
to rename the file requested by the user to avoid overwriting it for the
second cc1 invocation.

4 years ago[NFCi][llvm][MIRVRegNamerUtils] Making some code cleanup and stylistic changes.
Puyan Lotfi [Mon, 9 Dec 2019 19:54:09 +0000 (14:54 -0500)]
[NFCi][llvm][MIRVRegNamerUtils] Making some code cleanup and stylistic changes.

Making some changes to MIRVRegNamerUtils.cpp to use some more modern c++
features as well as some changes to generally make the code more concise
and more understandable.

I make this an NFCi because in one case I drop the whole
"if (!MO->isDef()) MO->setIsKill(false);" thing that was added in the
original implementation, generally because I don't think this is really
semantically sound. I also changed up the implementation of
VRegRenamer::createVirtualRegisterWithLowerName somewhat because I am
now lower-casing the name unconditionally because I confirmed that that
was in fact aditya_nandakumar@apple.com's intent.

In all other cases, behavior should not be changed.

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

4 years agoRevert "[compiler-rt] Add a critical section when flushing gcov counters"
Akira Hatanaka [Tue, 10 Dec 2019 03:57:26 +0000 (19:57 -0800)]
Revert "[compiler-rt] Add a critical section when flushing gcov counters"

This reverts commit 88f5bf77f92899b19fdafdffc7b060f930c1cb8b as it broke
green dragon bots.

http://lab.llvm.org:8080/green/job/clang-stage1-RA/4401/

4 years ago[MC] Delete MCCodePadder
Fangrui Song [Fri, 6 Dec 2019 02:18:55 +0000 (18:18 -0800)]
[MC] Delete MCCodePadder

D34393 added MCCodePadder as an infrastructure for padding code with
NOP instructions. It lacked tests and was not being worked on since
then.

Intel has now worked on an assembler patch to mitigate performance loss
after applying microcode update for the Jump Conditional Code Erratum.

https://www.intel.com/content/www/us/en/support/articles/000055650/processors.html

This new patch shares similarity with MCCodePadder, but has a concrete
use case in mind and is being actively developed. The infrastructure it
introduces can potentially be used for general performance improvement
via alignment. Delete the unused MCCodePadder so that people can develop
the new feature from a clean state.

Reviewed By: jyknight, skan

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

4 years agoTurn off unused variable checking here since we're explicitly adding
Eric Christopher [Tue, 10 Dec 2019 03:13:31 +0000 (19:13 -0800)]
Turn off unused variable checking here since we're explicitly adding
a command line for clang-tidy.

4 years ago[NFC][MacroFusion] Adding the assertion if someone want to fuse more than 2 instructions
QingShan Zhang [Tue, 10 Dec 2019 03:10:21 +0000 (03:10 +0000)]
[NFC][MacroFusion] Adding the assertion if someone want to fuse more than 2 instructions

As discussed in https://reviews.llvm.org/D69998, we miss to create some dependency edges
if chained more than 2 instructions. Adding an assertion here if someone want to chain
more than 2 instructions.

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

4 years agoRemove unused Unit test directory for xray.
Eric Christopher [Tue, 10 Dec 2019 02:40:05 +0000 (18:40 -0800)]
Remove unused Unit test directory for xray.

4 years ago[c++20] Fix handling of unqualified lookups from a defaulted comparison
Richard Smith [Thu, 5 Dec 2019 21:37:35 +0000 (13:37 -0800)]
[c++20] Fix handling of unqualified lookups from a defaulted comparison
function.

We need to perform unqualified lookups from the context of a defaulted
comparison, but not until we implicitly define the function, at which
point we can't do those lookups any more. So perform the lookup from the
end of the class containing the =default declaration and store the
lookup results on the defaulted function until we synthesize the body.

4 years ago[NFC] Add { } to silence compiler warning [-Wmissing-braces].
Huihui Zhang [Tue, 10 Dec 2019 01:19:34 +0000 (17:19 -0800)]
[NFC] Add { } to silence compiler warning [-Wmissing-braces].

../llvm/lib/Target/PowerPC/PPCISelLowering.cpp:5371:37: warning: suggest braces around initialization of subobject [-Wmissing-braces]
  std::array<EVT, 2> ReturnTypes = {MVT::Other, MVT::Glue};
                                    ^~~~~~~~~~~~~~~~~~~~~
                                    {                    }

4 years ago[llvm/dwarfdump] Use the architecture string to filter.
Jonas Devlieghere [Tue, 10 Dec 2019 01:14:10 +0000 (17:14 -0800)]
[llvm/dwarfdump] Use the architecture string to filter.

Currently dwarfdump uses the ArchType to filter out architectures, which
is problematic for architectures like arm64e and x86_64h that map back
to arm64 and x86_64 respectively. The result is that the filter doesn't
work for these architectures because it matches all the variants. This
is especially bad because usually these architectures are the reason to
use the filter in the first place.

Instead, we should match the architecture based on the string name. This
means the filter works for the values printed by dwarfdump. It has the
unfortunate side effect of not working for aliases, like AArch64, but I
think that's worth the trade-off.

rdar://53653014

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

4 years ago[FormatManager] GetCandidateLanguages shouldn't know about ValueObject.
Davide Italiano [Tue, 10 Dec 2019 01:04:46 +0000 (17:04 -0800)]
[FormatManager] GetCandidateLanguages shouldn't know about ValueObject.

Reviewers: jingham, teemperor, JDevlieghere, aprantl

Subscribers: lldb-commits

Tags: #lldb

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

4 years agoadd support for strict operation fpextend/fpround/fsqrt on X86 backend
Liu, Chen3 [Tue, 10 Dec 2019 01:04:28 +0000 (09:04 +0800)]
add support for strict operation fpextend/fpround/fsqrt on X86 backend

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

4 years agoRevert "[ARM][MVE] Add intrinsics for immediate shifts."
Eric Christopher [Tue, 10 Dec 2019 00:47:38 +0000 (16:47 -0800)]
Revert "[ARM][MVE] Add intrinsics for immediate shifts."
and two follow-on commits: one warning fix and one functionality.

As it's breaking at least the lto bot:

http://lab.llvm.org:8011/builders/clang-with-lto-ubuntu/builds/15132/steps/test-stage1-compiler/logs/stdio

This reverts commits:

 8d70f3c933a5b81a87a5ab1af0e3e98ee2cd7c67
 ff4dceef9201c5ae3924e92f6955977f243ac71d
 d97b3e3e65cd77a81b39732af84a1a4229e95091

4 years agoAvoid Attr.h includes, CodeGen edition
Reid Kleckner [Tue, 10 Dec 2019 00:11:56 +0000 (16:11 -0800)]
Avoid Attr.h includes, CodeGen edition

This saves around 20 includes of Attr.h. Not much.

4 years ago[ConstantFold][SVE] Fix constant folding for shufflevector.
Eli Friedman [Fri, 6 Dec 2019 20:33:46 +0000 (12:33 -0800)]
[ConstantFold][SVE] Fix constant folding for shufflevector.

Don't try to fold away shuffles which can't be folded.  Fix creation of
shufflevector constant expressions.

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

4 years ago[Codegen][X86] Modernize/regenerate old tests. NFCI.
Dávid Bolvanský [Mon, 9 Dec 2019 15:47:47 +0000 (16:47 +0100)]
[Codegen][X86] Modernize/regenerate old tests. NFCI.

Summary:
Switch to FileCheck where possible.
Adjust tests so they can be easily regenerated by update scripts.

Reviewers: craig.topper, spatel, RKSimon

Reviewed By: spatel

Subscribers: MatzeB, qcolombet, arphaman, jfb, llvm-commits

Tags: #llvm

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

4 years ago[AArch64][SVE] Implement SPLAT_VECTOR for i1 vectors.
Eli Friedman [Sat, 7 Dec 2019 02:05:41 +0000 (18:05 -0800)]
[AArch64][SVE] Implement SPLAT_VECTOR for i1 vectors.

The generated sequence with whilelo is unintuitive, but it's the best
I could come up with given the limited number of SVE instructions that
interact with scalar registers. The other sequence I was considering
was something like dup+cmpne, but an extra scalar instruction seems
better than an extra vector instruction.

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

4 years ago[c++20] Defaulted comparison support for array members.
Richard Smith [Fri, 6 Dec 2019 02:51:19 +0000 (18:51 -0800)]
[c++20] Defaulted comparison support for array members.

4 years ago[FormatManager] Provide a single entrypoint for GetCandidateLanguages().
Davide Italiano [Mon, 9 Dec 2019 22:48:36 +0000 (14:48 -0800)]
[FormatManager] Provide a single entrypoint for GetCandidateLanguages().