platform/upstream/llvm.git
4 years agoUpdate comment to be more clear.
Eric Christopher [Sat, 20 Jun 2020 21:44:41 +0000 (14:44 -0700)]
Update comment to be more clear.

4 years agoRename function to more accurately reflect what it does.
Eric Christopher [Sat, 20 Jun 2020 21:37:29 +0000 (14:37 -0700)]
Rename function to more accurately reflect what it does.

4 years agoTemporarily Revert "[lldb][NFC] Add more test for builtin formats"
Eric Christopher [Sat, 20 Jun 2020 21:20:51 +0000 (14:20 -0700)]
Temporarily Revert "[lldb][NFC] Add more test for builtin formats"
as it's failing on the debian buildbots:

http://lab.llvm.org:8011/builders/lldb-x86_64-debian/builds/12531

This reverts commit 90c1af106a20785ffd01c0d6a41db8bc0160fd11.

4 years ago[flang] Add BoxValue.h
Eric Schweitz [Fri, 19 Jun 2020 18:42:23 +0000 (11:42 -0700)]
[flang] Add BoxValue.h

The bridge uses internal boxes of related ssa-values to track all the
information associated with a Fortran variable. Variables may have a
location and a value, but may also carry other properties such as rank,
shape, LEN parameters, etc. in Fortran.

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

4 years agoTypos around a -> an.
Eric Christopher [Sat, 20 Jun 2020 21:04:48 +0000 (14:04 -0700)]
Typos around a -> an.

4 years ago[VectorCombine] fix assert for type of compare operand
Sanjay Patel [Sat, 20 Jun 2020 19:18:27 +0000 (15:18 -0400)]
[VectorCombine] fix assert for type of compare operand

As shown in the post-commit comment for D81661 - we need to
loosen the type assertion to allow scalarization of a compare
for vectors of pointers.

4 years ago[lldb][NFC] Add more test for builtin formats
Raphael Isemann [Sat, 20 Jun 2020 17:30:20 +0000 (19:30 +0200)]
[lldb][NFC] Add more test for builtin formats

The previous tests apparently missed a few code branches in DumpDataExtractor
code. Also renames the 'test_instruction' which had the same name as another
test (and Python therefore ignored the test entirely).

4 years agoAdd --hot-func-list to llvm-profdata show for sample profiles
weihe [Sat, 20 Jun 2020 17:13:02 +0000 (10:13 -0700)]
Add --hot-func-list to llvm-profdata show for sample profiles

Summary: Add the --hot-func-list feature to llvm-profdata show for sample profiles. This feature prints a list of hot functions whose max sample count are above the 99% threshold, with their numbers of total samples, total samples percentage, max samples, entry samples, and their function names.

Reviewers: wmi, hoyFB, wenlei

Reviewed By: wmi

Subscribers: hoyFB, wenlei, llvm-commits, weihe

Tags: #llvm

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

4 years ago[InstCombine] remove unused parameter and add assert; NFC
Sanjay Patel [Sat, 20 Jun 2020 15:47:00 +0000 (11:47 -0400)]
[InstCombine] remove unused parameter and add assert; NFC

4 years ago[InstCombine] add tests for fmul/fdiv with fabs operands; NFC
Sanjay Patel [Sat, 20 Jun 2020 15:07:23 +0000 (11:07 -0400)]
[InstCombine] add tests for fmul/fdiv with fabs operands; NFC

4 years agoProfileSummaryInfo.h - reduce unnecessary Function.h include to forward declaration...
Simon Pilgrim [Sat, 20 Jun 2020 14:57:05 +0000 (15:57 +0100)]
ProfileSummaryInfo.h - reduce unnecessary Function.h include to forward declaration. NFC.

4 years agoRegionPass.h - remove unnecessary Function.h include. NFC.
Simon Pilgrim [Sat, 20 Jun 2020 14:30:11 +0000 (15:30 +0100)]
RegionPass.h - remove unnecessary Function.h include. NFC.

Forward declaration is already used.

4 years ago[InstCombine] fabs(X) / fabs(X) -> X / X
Sanjay Patel [Sat, 20 Jun 2020 14:20:21 +0000 (10:20 -0400)]
[InstCombine] fabs(X) / fabs(X) -> X / X

Also, consolidate related folds so we don't miss/repeat these.

4 years ago[InstCombine] add tests for fabs(x) / fabs (x); NFC
Sanjay Patel [Sat, 20 Jun 2020 13:52:12 +0000 (09:52 -0400)]
[InstCombine] add tests for fabs(x) / fabs (x); NFC

4 years ago[X86] combineSetCCMOVMSK - consistently use CmpBits variable. NFCI.
Simon Pilgrim [Sat, 20 Jun 2020 11:35:24 +0000 (12:35 +0100)]
[X86] combineSetCCMOVMSK - consistently use CmpBits variable. NFCI.

The comparison value should be the same size - I've added an assert to be absolutely certain.

4 years ago[X86][SSE] Fold MOVMSK(PCMPEQ(X,0)) != -1 -> !PTESTZ(X,X) allof patterns
Simon Pilgrim [Fri, 19 Jun 2020 15:05:04 +0000 (16:05 +0100)]
[X86][SSE] Fold MOVMSK(PCMPEQ(X,0)) != -1 -> !PTESTZ(X,X) allof patterns

4 years ago[CVP] Add another non null test (NFC)
Nikita Popov [Sat, 20 Jun 2020 11:01:54 +0000 (13:01 +0200)]
[CVP] Add another non null test (NFC)

4 years ago[JumpThreading] Make test more robust (NFC)
Nikita Popov [Sat, 20 Jun 2020 10:52:53 +0000 (12:52 +0200)]
[JumpThreading] Make test more robust (NFC)

Optimizing away this comparison is not the point of this test,
so make sure it cannot be optimized away.

4 years ago[LVI] Extract addValueHandle() method (NFC)
Nikita Popov [Sat, 20 Jun 2020 10:49:08 +0000 (12:49 +0200)]
[LVI] Extract addValueHandle() method (NFC)

There will be more places registering value handles.

4 years ago[LVI] Use find_as() where possible (NFC)
Nikita Popov [Sat, 13 Jun 2020 13:15:39 +0000 (15:15 +0200)]
[LVI] Use find_as() where possible (NFC)

This prevents us from creating temporary PoisoningVHs and
AssertingVHs while performing hashmap lookups. As such, it only
matters in assertion-enabled builds.

4 years ago[clang] SequenceChecker: C++17 sequencing rule for overloaded operators.
Bruno Ricci [Sat, 20 Jun 2020 09:51:46 +0000 (10:51 +0100)]
[clang] SequenceChecker: C++17 sequencing rule for overloaded operators.

In C++17 the operand(s) of an overloaded operator are sequenced as for
the corresponding built-in operator when the overloaded operator is
called with the operator notation ([over.match.oper]p2).

Reported in PR35340.

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

Reviewed By: rsmith

4 years ago[lldb] Skip TestBuiltinFormats.py on arm for now
Raphael Isemann [Sat, 20 Jun 2020 09:22:44 +0000 (11:22 +0200)]
[lldb] Skip TestBuiltinFormats.py on arm for now

4 years agoRevert "[BasicAA] Use known lower bounds for index values for size based check."
Florian Hahn [Sat, 20 Jun 2020 08:54:45 +0000 (09:54 +0100)]
Revert "[BasicAA] Use known lower bounds for index values for size based check."

This potentially related to https://bugs.llvm.org/show_bug.cgi?id=46335
and causes a slight compile-time regression. Revert while investigating.

This reverts commit d99a1848c4f8ca164c0c0768e10eafc850b2a68a.

4 years ago[CMake] Fix runtimes build for host Windows (default target)
Kristina Bessonova [Mon, 15 Jun 2020 10:05:13 +0000 (12:05 +0200)]
[CMake] Fix runtimes build for host Windows (default target)

When building runtimes, the compiler name (e.g. clang, clang-cl) is set based on
`CMAKE_SYSTEM_NAME` passed to `llvm_ExternalProject_Add()` through `CMAKE_ARGS` argument.
This mechanism doesn't work well if the target is Windows host.
`runtime_default_target()`/`builtin_default_target()` doesn't provide a way
to specify `CMAKE_SYSTEM_NAME` and doesn't set it either.

This patch appends variables specified in `RUNTIMES_CMAKE_ARGS`/`BUILTINS_CMAKE_ARGS`
to `CMAKE_ARGS` argument of `llvm_ExternalProject_Add()` in the case of called
from `runtime_default_target()`/`builtin_default_target()` thus in particular
it allows passing CMAKE_SYSTEM_NAME whenever it is required.

Reviewed By: phosek, compnerd, plotfi

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

4 years agoTemporarily Revert "[flang][OpenMP] Enhance parser support for flush construct to...
Eric Christopher [Sat, 20 Jun 2020 08:18:53 +0000 (01:18 -0700)]
Temporarily Revert "[flang][OpenMP] Enhance parser support for flush construct to OpenMP 5.0"
as it's failing Semantics/omp-clause-validity01.f90.

This reverts commit b32401464f4c9c9d43a3ddcb351cb6c7c713fdb4.

4 years ago[AST/Lex/Parse/Sema] As part of using inclusive language within
Eric Christopher [Sat, 20 Jun 2020 08:14:57 +0000 (01:14 -0700)]
[AST/Lex/Parse/Sema] As part of using inclusive language within
the llvm project, migrate away from the use of blacklist and whitelist.

4 years ago[flang][OpenMP] Enhance parser support for flush construct to OpenMP 5.0
Kiran Kumar T P [Sat, 20 Jun 2020 08:02:15 +0000 (13:32 +0530)]
[flang][OpenMP] Enhance parser support for flush construct to OpenMP 5.0

Summary:
This patch enhances parser support for flush construct to OpenMP 5.0 by including memory-order-clause.

2.18.8 flush Construct
!$omp flush [memory-order-clause] [(list)]
where memory-order-clause is
acq_rel
release
acquire

The patch includes code changes and testcase modifications.

Reviewed By: klausler, kiranchandramohan

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

4 years ago[cpplint] As part of using inclusive language within the llvm project,
Eric Christopher [Sat, 20 Jun 2020 07:58:04 +0000 (00:58 -0700)]
[cpplint] As part of using inclusive language within the llvm project,
migrate away from the use of blacklist and whitelist.

4 years ago[docs/examples] As part of using inclusive language within the llvm
Eric Christopher [Sat, 20 Jun 2020 07:51:18 +0000 (00:51 -0700)]
[docs/examples] As part of using inclusive language within the llvm
project, migrate away from the use of blacklist and whitelist.

4 years ago[Analysis/Transforms/Sanitizers] As part of using inclusive language
Eric Christopher [Sat, 20 Jun 2020 07:42:26 +0000 (00:42 -0700)]
[Analysis/Transforms/Sanitizers] As part of using inclusive language
within the llvm project, migrate away from the use of blacklist and
whitelist.

4 years agoAs part of using inclusive language within the llvm project,
Eric Christopher [Sat, 20 Jun 2020 07:24:57 +0000 (00:24 -0700)]
As part of using inclusive language within the llvm project,
migrate away from the use of blacklist and whitelist.

4 years ago[Support/Utils] As part of using inclusive language within the
Eric Christopher [Sat, 20 Jun 2020 07:15:50 +0000 (00:15 -0700)]
[Support/Utils] As part of using inclusive language within the
llvm project, migrate away from the use of blacklist and whitelist.

4 years ago[Target] As part of using inclusive language within the llvm project,
Eric Christopher [Sat, 20 Jun 2020 07:05:32 +0000 (00:05 -0700)]
[Target] As part of using inclusive language within the llvm project,
migrate away from the use of blacklist and whitelist.

This change affects an internal llvm command line option.

4 years ago[DWARFYAML][debug_info] Fix array index out of bounds error
Xing GUO [Sat, 20 Jun 2020 06:25:56 +0000 (14:25 +0800)]
[DWARFYAML][debug_info] Fix array index out of bounds error

This patch is trying to fix the array index out of bounds error. I observed it in (https://reviews.llvm.org/harbormaster/unit/view/99638/).

Reviewed By: jhenderson, MaskRay

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

4 years ago[X86] Correct the implementation of ud1(a.k.a. ud2b) instruction.
Craig Topper [Sat, 20 Jun 2020 06:47:43 +0000 (23:47 -0700)]
[X86] Correct the implementation of ud1(a.k.a. ud2b) instruction.

We were missing the modrm byte this instruction has according
to current Intel SDM. Experiments with gcc indicate that different
modrm values are chosen based on 2 operands so I've added those
as well.

I think our previous implementation was based on an older behavior of
binutils that has since been changed.

4 years agoUpdate error to read a little better when an error occurs.
Eric Christopher [Sat, 20 Jun 2020 06:33:37 +0000 (23:33 -0700)]
Update error to read a little better when an error occurs.

4 years agoFix warning caused by TableGen verifier predicate (NFC)
Mehdi Amini [Sat, 20 Jun 2020 06:22:04 +0000 (06:22 +0000)]
Fix warning caused by TableGen verifier predicate (NFC)

Avoid using max on unsigned constants, in case the caller is using 0 we
end up with:

  warning: taking the max of unsigned zero and a value is always equal to the other value [-Wmax-unsigned-zero]

Instead we can just use native TableGen to fold the comparison here.

4 years agoUpdate redirected output file.
Eric Christopher [Sat, 20 Jun 2020 06:30:16 +0000 (23:30 -0700)]
Update redirected output file.

4 years agoUpdate test file.
Eric Christopher [Sat, 20 Jun 2020 06:13:28 +0000 (23:13 -0700)]
Update test file.

4 years ago[clang-change-namespace] As part of using inclusive language
Eric Christopher [Sat, 20 Jun 2020 06:01:42 +0000 (23:01 -0700)]
[clang-change-namespace] As part of using inclusive language
within the llvm project, migrate away from the use of blacklist
and whitelist.

4 years ago[lldb/Test] Disable TestBuiltinFormats.py on Windows
Jonas Devlieghere [Sat, 20 Jun 2020 05:40:55 +0000 (22:40 -0700)]
[lldb/Test] Disable TestBuiltinFormats.py on Windows

Disable the test to turn the Windows bot green again until Raphael has
time to investigate.

4 years ago[lldb/Test] Temporarily skip watch simulator in TestSimulatorPlatform.py
Jonas Devlieghere [Sat, 20 Jun 2020 03:21:45 +0000 (20:21 -0700)]
[lldb/Test] Temporarily skip watch simulator in TestSimulatorPlatform.py

The simulator doesn't launch on green-dragon-10.

rdar://problem/64552748

4 years ago[X86] Ignore bits 2:0 of the modrm byte when disassembling lfence, mfence, and sfence.
Craig Topper [Sat, 20 Jun 2020 05:18:53 +0000 (22:18 -0700)]
[X86] Ignore bits 2:0 of the modrm byte when disassembling lfence, mfence, and sfence.

These are documented as using modrm byte of 0xe8, 0xf0, and 0xf8
respectively. But hardware ignore bits 2:0. So 0xe9-0xef is treated
the same as 0xe8. Similar for the other two.

Fixing this required adding 8 new formats to the X86 instructions
to convey this information. Could have gotten away with 3, but
adding all 8 made for a more logical conversion from format to
modrm encoding.

I renumbered the format encodings to keep the register modrm
formats grouped together.

4 years ago[SanitizeCoverage] Rename -fsanitize-coverage-{white,black}list to -fsanitize-coverag...
Fangrui Song [Sat, 20 Jun 2020 05:22:47 +0000 (22:22 -0700)]
[SanitizeCoverage] Rename -fsanitize-coverage-{white,black}list to -fsanitize-coverage-{allow,block}list

Keep deprecated -fsanitize-coverage-{white,black}list as aliases for compatibility for now.

Reviewed By: echristo

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

4 years ago[IR] Convert profile metadata in createCallMatchingInvoke()
Yevgeny Rouban [Sat, 20 Jun 2020 05:06:01 +0000 (12:06 +0700)]
[IR] Convert profile metadata in createCallMatchingInvoke()

When an invoke instruction is converted to a call its
profile metadata is dropped because it has incompatible
format (see commit 16ad6eeb94ff).
This patch adds an attempt to convert profile data to
format of the call instruction. This used to work well
before the commit dcfa78a4ccec.

Reviewers: reames
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D82071

4 years ago[Mips] Error if a non-immediate operand is used while an immediate is expected
Wang Rui [Sat, 20 Jun 2020 05:05:28 +0000 (22:05 -0700)]
[Mips] Error if a non-immediate operand is used while an immediate is expected

The 32-bit type relocation (R_MIPS_32) cannot be used for instructions below:

ori $4, $4, start
ori $4, $4, (start - .)

We should print an error instead.

Reviewed By: atanasyan, MaskRay

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

4 years ago[lld] As part of using inclusive language within the llvm
Eric Christopher [Sat, 20 Jun 2020 04:50:14 +0000 (21:50 -0700)]
[lld] As part of using inclusive language within the llvm
project, migrate away from the use of blacklist and whitelist.

4 years ago[libcxx] As part of using inclusive language within the llvm
Eric Christopher [Sat, 20 Jun 2020 04:37:11 +0000 (21:37 -0700)]
[libcxx] As part of using inclusive language within the llvm
project, migrate away from the use of blacklist and whitelist.

4 years ago[UpdateTestChecks] As part of using inclusive language within the
Eric Christopher [Sat, 20 Jun 2020 04:30:17 +0000 (21:30 -0700)]
[UpdateTestChecks] As part of using inclusive language within the
llvm project, migrate away from the use of blacklist and whitelist.

4 years ago[StackSafety,NFC] Don't rerun on LiveIn change
Vitaly Buka [Thu, 18 Jun 2020 09:30:33 +0000 (02:30 -0700)]
[StackSafety,NFC] Don't rerun on LiveIn change

4 years ago[ObjectYAML][ELF] Add support for emitting the .debug_info section.
Xing GUO [Sat, 20 Jun 2020 04:09:22 +0000 (12:09 +0800)]
[ObjectYAML][ELF] Add support for emitting the .debug_info section.

This patch helps add support for emitting the .debug_info section to yaml2elf.

Reviewed By: jhenderson, grimar, MaskRay

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

4 years ago[AMDGPU] Avoid use of V_READLANE into EXEC in SGPR spills
Carl Ritson [Sat, 20 Jun 2020 01:23:34 +0000 (10:23 +0900)]
[AMDGPU] Avoid use of V_READLANE into EXEC in SGPR spills

Always prefer to clobber input SGPRs and restore them after the
spill.  This applies to both spills to VGPRs and scratch.

Reviewed By: arsenm

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

4 years ago[mlir] Fix gcc build break due to previous commit
Thomas Raoux [Sat, 20 Jun 2020 02:00:14 +0000 (19:00 -0700)]
[mlir] Fix gcc build break due to previous commit

4 years ago[ODRHash] Remove use of 'whitelist'.
Weverything [Sat, 20 Jun 2020 01:35:36 +0000 (18:35 -0700)]
[ODRHash] Remove use of 'whitelist'.

4 years ago[flang] Fix F5.3 formatting of 0.025
peter klausler [Fri, 19 Jun 2020 20:32:26 +0000 (13:32 -0700)]
[flang] Fix F5.3 formatting of 0.025

Fix F output editing in the Fortran runtime so that it
respects the 'd' count of digits after the decimal mark.

Reviewed By: tskeith

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

4 years ago[mlir][spirv] Legalize subviewop when used with vector transfer
Thomas Raoux [Sat, 20 Jun 2020 00:33:15 +0000 (17:33 -0700)]
[mlir][spirv] Legalize subviewop when used with vector transfer

Subview operations are not natively supported downstream in the spirv path.
This change allows removing subview when used by vector transfer the same way
we already do it when they are used by LoadOp/StoreOp

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

4 years ago[mlir] Allow vector.contract to have mixed types operands
Thomas Raoux [Sat, 20 Jun 2020 00:08:57 +0000 (17:08 -0700)]
[mlir] Allow vector.contract to have mixed types operands

Allow lhs and rhs to have different type than accumulator/destination. Some
hardware like GPUs support natively operations like uint8xuint8xuint32.

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

4 years ago[Sema] Comparison of pointers to complete and incomplete types
Benson Chu [Sat, 20 Jun 2020 00:01:03 +0000 (17:01 -0700)]
[Sema] Comparison of pointers to complete and incomplete types

Clang is missing one of the conditions for C99 6.5.9p2, where comparison
between pointers must either both point to incomplete types or both
point to complete types. This patch adds an extra check to the clause
where two pointers are of compatible types.

This only applies to C89/C99; the relevant part of the standard was
rewritten for C11.

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

4 years ago[builtins][Android] Fix 386->686 adjustment
Ryan Prichard [Fri, 19 Jun 2020 06:57:08 +0000 (23:57 -0700)]
[builtins][Android] Fix 386->686 adjustment

At this point in this code:
 - COMPILER_RT_DEFAULT_TARGET_TRIPLE is "i686-linux-android"
 - arch is "i386"

The get_compiler_rt_target function currently turns that into:

   i686-android-linux-android

The ${COMPILER_RT_OS_SUFFIX} is "-android" and redundant, so stop
adding it.

The get_compiler_rt_target() function is used for the
LLVM_ENABLE_PER_TARGET_RUNTIME_DIR mode that isn't normally used with
Android.

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

4 years ago[builtins] Fix typos in comments
Ryan Prichard [Fri, 19 Jun 2020 06:35:40 +0000 (23:35 -0700)]
[builtins] Fix typos in comments

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

4 years agoError related to ThinLTO caching needs to be downgraded to a remark
romanova-ekaterina [Fri, 19 Jun 2020 22:58:51 +0000 (15:58 -0700)]
Error related to ThinLTO caching needs to be downgraded to a remark

This is a fix for PR #46392 (Diagnostic message (error) related to
ThinLTO caching needs to be downgraded to a remark).

There are diagnostic messages related to ThinLTO caching that contain
the word "error", but they are really just notices/remarks for users,
and they don't cause a build failure. The word "error" appearing can be
confusing to users, and may even cause deeper problems.

User's build system might be designed to interpret any error messages
(even a benign error message as the one above) reported by the compiler
as a build failure, thus causing the build to fail "needlessly". In
short, the term "error" in this diagnostic is misleading at best, and
may be causing build systems to fail at worst.

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

4 years agoAs part of using inclusive language within the llvm project,
Eric Christopher [Fri, 19 Jun 2020 22:43:51 +0000 (15:43 -0700)]
As part of using inclusive language within the llvm project,
migrate away from the use of blacklist and whitelist.

4 years agoAs part of using inclusive language within the llvm project,
Eric Christopher [Fri, 19 Jun 2020 22:41:06 +0000 (15:41 -0700)]
As part of using inclusive language within the llvm project,
migrate away from the use of blacklist and whitelist.

4 years agoAs part of using inclusive language within the llvm project,
Eric Christopher [Fri, 19 Jun 2020 22:05:26 +0000 (15:05 -0700)]
As part of using inclusive language within the llvm project,
migrate away from the use of blacklist and whitelist.

4 years agoAs part of using inclusive language within the llvm project,
Eric Christopher [Fri, 19 Jun 2020 21:54:50 +0000 (14:54 -0700)]
As part of using inclusive language within the llvm project,
migrate away from the use of blacklist and whitelist.

4 years ago[WebAssembly] Remove TEEs when dests are unstackified
Heejin Ahn [Mon, 15 Jun 2020 16:31:19 +0000 (09:31 -0700)]
[WebAssembly] Remove TEEs when dests are unstackified

When created in RegStackify pass, `TEE` has two destinations, where
op0 is stackified and op1 is not. But it is possible that
op0 becomes unstackified in `fixUnwindMismatches` function in
CFGStackify pass when a nested try-catch-end is introduced, violating
the invariant of `TEE`s destinations.

In this case we convert the `TEE` into two `COPY`s, which will
eventually be resolved in ExplicitLocals.

Reviewed By: dschuff

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

4 years agoAs part of using inclusive language within the llvm project,
Eric Christopher [Fri, 19 Jun 2020 21:52:01 +0000 (14:52 -0700)]
As part of using inclusive language within the llvm project,
migrate away from the use of blacklist and whitelist.

4 years agoAs part of using inclusive language within the llvm project,
Eric Christopher [Fri, 19 Jun 2020 21:51:04 +0000 (14:51 -0700)]
As part of using inclusive language within the llvm project,
migrate away from the use of blacklist and whitelist.

4 years agoAs part of using inclusive language with the llvm project,
Eric Christopher [Fri, 19 Jun 2020 21:33:36 +0000 (14:33 -0700)]
As part of using inclusive language with the llvm project,
migrate away from the use of blacklist and whitelist.

4 years ago[Support] Fix building for mingw on a case sensitive file system
Martin Storsjö [Fri, 19 Jun 2020 21:39:22 +0000 (00:39 +0300)]
[Support] Fix building for mingw on a case sensitive file system

This fixes cross building on a case sensitive file system after
2e613d2ded2c465bd06bd3cac30ffb4576bf72cc. (The official Windows
SDKs don't have self-consistent casing and can't be used as such on
case sentisive file systems without case fixups, while mingw headers
consistently use lower case.)

4 years ago[MLIR][NFC] Eliminate .getBlocks() when not needed
Rahul Joshi [Fri, 19 Jun 2020 19:33:21 +0000 (12:33 -0700)]
[MLIR][NFC] Eliminate .getBlocks() when not needed

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

4 years ago[NFC] Remove unused pass name parser classes
Arthur Eubanks [Fri, 19 Jun 2020 19:42:00 +0000 (12:42 -0700)]
[NFC] Remove unused pass name parser classes

Summary: Looks like these were for the most part touched over a decade ago.

Subscribers: mgorny, cfe-commits, llvm-commits

Tags: #clang, #llvm

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

4 years ago[lldb][NFC] Add test for builtin formats
Raphael Isemann [Fri, 19 Jun 2020 20:05:46 +0000 (22:05 +0200)]
[lldb][NFC] Add test for builtin formats

4 years ago[flang] DATA stmt processing (part 4/4): Check & convert DATA
peter klausler [Fri, 19 Jun 2020 16:16:21 +0000 (09:16 -0700)]
[flang] DATA stmt processing (part 4/4): Check & convert DATA

Implement rest of DATA statement semantics and conversion of
DATA statement initializations into static initializers of
objects in their symbol table entries.

Reviewed By: tskeith, PeteSteinfeld

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

4 years ago[AArch64][GlobalISel] Make G_SEXT_INREG legal and add selection support.
Amara Emerson [Wed, 17 Jun 2020 05:11:41 +0000 (22:11 -0700)]
[AArch64][GlobalISel] Make G_SEXT_INREG legal and add selection support.

We were defaulting to the lower action for this, resulting in SHL+ASHR
sequences. On AArch64 we can do this in one instruction for an arbitrary
extension using SBFM as we do for G_SEXT.

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

4 years ago[libc] This adds the strcmp (string compare) implementation.
cgyurgyik [Fri, 19 Jun 2020 20:05:26 +0000 (16:05 -0400)]
[libc] This adds the strcmp (string compare) implementation.
Reviewed-by: sivachandra
Differential Revision: https://reviews.llvm.org/D82134

4 years ago[clang-tidy] remove duplicate fixes of alias checkers
Daniel [Fri, 19 Jun 2020 19:40:03 +0000 (20:40 +0100)]
[clang-tidy] remove duplicate fixes of alias checkers

when both a check and its alias are enabled, we should only take the fixes of one of them and not both.
This patch fixes bug 45577
https://bugs.llvm.org/show_bug.cgi?id=45577

Reviewed By: aaron.ballman, njames93

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

4 years ago[VectorCombine] refactor extract-extract logic; NFCI
Sanjay Patel [Fri, 19 Jun 2020 18:51:50 +0000 (14:51 -0400)]
[VectorCombine] refactor extract-extract logic; NFCI

4 years ago[libTooling] Change Transformer's `cat` to handle some cases of text in macros.
Yitzhak Mandelbaum [Thu, 18 Jun 2020 20:53:03 +0000 (20:53 +0000)]
[libTooling] Change Transformer's `cat` to handle some cases of text in macros.

Summary:
Currently, `cat` validates range selections before extracting the corresponding
source text. However, this means that any range inside a macro is rejected as an
error. This patch changes the implementation to first try to map the range to
something reasonable. This makes the behavior consistent with handling of ranges
used for selecting portions of the source to edit.

Also updates a clang-tidy lit-test for one of the checks which was affected by
this change.

Reviewers: gribozavr2, tdl-g

Subscribers: cfe-commits

Tags: #clang

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

4 years ago[flang] Add SymbolMap
Eric Schweitz [Fri, 19 Jun 2020 03:02:28 +0000 (20:02 -0700)]
[flang] Add SymbolMap

The symbol map is a data structure for tracking variables in a subprogram during the lowering of that subprogram to FIR/MLIR. These data structures will be used by the bridge, which has not been upstreamed yet.

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

4 years ago[lldb] Replace calls to new with std::make_shared<> (NFC)
Jonas Devlieghere [Fri, 19 Jun 2020 18:17:00 +0000 (11:17 -0700)]
[lldb] Replace calls to new with std::make_shared<> (NFC)

4 years agoReland [FileCheck, unittest] Improve readability of ExpressionFormat
Thomas Preud'homme [Thu, 18 Jun 2020 18:48:55 +0000 (19:48 +0100)]
Reland [FileCheck, unittest] Improve readability of ExpressionFormat

This was originally cd2553de77f and reverted in a3adfb400ef.
The ADT itostr bug this triggered was fixed in f3e8f961736.

4 years ago[mlir] [VectorOps] Improve vector.constant_mask lowering
aartbik [Fri, 19 Jun 2020 17:40:03 +0000 (10:40 -0700)]
[mlir] [VectorOps] Improve vector.constant_mask lowering

Use direct vector constants for the 1-D case. This approach
scales much better than generating elaborate insertion operations
that are eventually folded into a constant. We could of course
generalize the 1-D case to higher ranks, but this simplification
already helps in scaling some microbenchmarks that would formerly
crash on the intermediate IR length.

Reviewed By: reidtatge

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

4 years ago[ADT] Fix itostr handling of min int64_t value
Thomas Preud'homme [Fri, 19 Jun 2020 15:08:34 +0000 (16:08 +0100)]
[ADT] Fix itostr handling of min int64_t value

Summary:
UBSan buildbot caught an undefined behavior in itostr with INT64_MIN.
The negation cannot be represented in the promoted operand (long long).
Negation is well defined on unsigned value though so this commit does
the negation after the static cast.

Reviewers: jhenderson, chandlerc, lattner

Reviewed By: lattner

Subscribers: dexonsmith, llvm-commits

Tags: #llvm

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

4 years ago[lldb] Replace std::isprint/isspace with llvm's locale-independent version
Raphael Isemann [Fri, 19 Jun 2020 17:17:24 +0000 (19:17 +0200)]
[lldb] Replace std::isprint/isspace with llvm's locale-independent version

Summary:
LLVM is using its own isPrint/isSpace implementation that doesn't change depending on the current locale. LLDB should do the same
to prevent that internal logic changes depending on the set locale.

Reviewers: JDevlieghere, labath, mib, totally_not_teemperor

Reviewed By: JDevlieghere

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

4 years ago[lldb] Reactivate Objective-C++ plugin
Raphael Isemann [Fri, 19 Jun 2020 17:16:27 +0000 (19:16 +0200)]
[lldb] Reactivate Objective-C++ plugin

Summary:
Since commit 7b3ef05a37fef2f805d31f498d30198ddeeb1a0c the Objective-C++ plugin is dead code.
That commit added Objective-C++ to the list of languages for which `Language::LanguageIsCPlusPlus`
returns true. As the C++ language plugin also uses that method to figure out if it is responsible for a
given language, the C++ plugin since then also became the plugin that we found when looking for
a language plugin for Objective-C++. The only real fallout from that is that the source highlighting
for Objective-C++ files never worked as we always found the C++ plugin which refuses to highlight
files with Objective-C++ extensions.

This patch just adds a special exception for Objective-C++ to the list of languages that are governed
by the C++ plugin. Also adds a test that makes sure that we find the right plugin for all C language
types and that the highlighting for `.mm` (Objective-C++) and `.m` (Objective-C) files works.

I didn't revert 7b3ef05a37fef2f805d31f498d30198ddeeb1a0c as it does make sense to return
true for Objective-C++ from `Language::LanguageIsCPlusPlus` (e.g., we currently check if we care about
ODR violations by doing `if (Language::LanguageIsCPlusPlus(...))` and this should also work for
Objective-C++).

Fixes rdar://64420183

Reviewers: aprantl

Reviewed By: aprantl

Subscribers: mgorny, abidh, JDevlieghere

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

4 years ago[lldb] Fix that SIGWINCH crashes IOHandlerEditline when we are not using the editline...
Raphael Isemann [Fri, 19 Jun 2020 17:13:43 +0000 (19:13 +0200)]
[lldb] Fix that SIGWINCH crashes IOHandlerEditline when we are not using the editline backend

Summary:
TerminalSizeChanged is called from our SIGWINCH signal handler but the
IOHandlerEditline currently doesn't check if we are actually using the real
editline backend. If we're not using the real editline backend, `m_editline_up`
won't be set and `IOHandlerEditline::TerminalSizeChanged` will access
the empty unique_ptr. In a real use case we don't use the editline backend
when we for example read input from a file. We also create some temporary
IOHandlerEditline's during LLDB startup it seems that are also treated
as non-interactive (apparently to read startup commands).

This patch just adds a nullptr check for`m_editline_up` as we do in the rest of
IOHandlerEditline.

Fixes rdar://problem/63921950

Reviewers: labath, friss

Reviewed By: friss

Subscribers: abidh, JDevlieghere

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

4 years ago[JITLink] Allow zero-length symbols at the end of blocks.
Lang Hames [Fri, 19 Jun 2020 17:01:12 +0000 (10:01 -0700)]
[JITLink] Allow zero-length symbols at the end of blocks.

This relaxes an assertion that required symbols to start before the end
of a block. Instead, symbols are now required to end on or before the
end of a block. This fixes two important corner cases: Symbols at the
start of empty blocks/sections, and block/section end symbols.

4 years ago[JITLink] Display host -> target address mapping in debugging output.
Lang Hames [Fri, 19 Jun 2020 16:59:23 +0000 (09:59 -0700)]
[JITLink] Display host -> target address mapping in debugging output.

This can be helpful for sanity checking JITLink memory manager behavior.

4 years agoRepair support for launching ios/tv/watch simulator binaries through platform
Adrian Prantl [Tue, 16 Jun 2020 23:25:09 +0000 (16:25 -0700)]
Repair support for launching ios/tv/watch simulator binaries through platform

and delete a bunch (but not all) redundant code. If you compare the remaining implementations of Platform*Simulator.cpp, there is still an obvious leftover cleanup task.

Specifically, this patch

- removes SDK initialization from dotest (there is equivalent but more
  complete code in Makefile.rules)

- make Platform*Simulator inherit the generic implementation of
  PlatformAppleSimulator (more can be done here)

- simplify the platform logic in Makefile.rules

- replace the custom SDK finding logic in Platform*Simulator with XcodeSDK

- adds a test for each supported simulator

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

4 years ago[lldb] Disable complex tests on Windows
Raphael Isemann [Fri, 19 Jun 2020 16:40:06 +0000 (18:40 +0200)]
[lldb] Disable complex tests on Windows

The tests fail to compile there:
```
complex/main.c:4:16: error: expected ';' at end of declaration
  float complex complex_float = -1.5f + -2.5f * I;
               ^
               ;
```

4 years ago[VectorCombine] fix crash while transforming constants
Sanjay Patel [Fri, 19 Jun 2020 16:28:04 +0000 (12:28 -0400)]
[VectorCombine] fix crash while transforming constants

This is a variation of the proposal in D82049 with an extra test.

4 years ago[ELF] Refine LMA offset propagation rule in D76995
Fangrui Song [Fri, 19 Jun 2020 16:07:48 +0000 (09:07 -0700)]
[ELF] Refine LMA offset propagation rule in D76995

If neither AT(lma) nor AT>lma_region is specified,
D76995 keeps `lmaOffset` (LMA - VMA) if the previous section is in the
default LMA region.

This patch additionally checks that the two sections are in the same
memory region.

Add a test case derived from https://bugs.llvm.org/show_bug.cgi?id=45313

  .mdata : AT(0xfb01000) { *(.data); } > TCM
  // It is odd to make .bss inherit lmaOffset, because the two sections
  // are in different memory regions.
  .bss : { *(.bss) } > DDR

With this patch, section VMA/LMA match GNU ld. Note, GNU ld supports
out-of-order (w.r.t sh_offset) sections and places .text and .bss in the
same PT_LOAD. We don't have that behavior.

Reviewed By: grimar

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

4 years ago[flang] DATA stmt processing (part 3/4): Remaining prep work
peter klausler [Fri, 19 Jun 2020 00:17:04 +0000 (17:17 -0700)]
[flang] DATA stmt processing (part 3/4): Remaining prep work

Rolls up small changes across the frontend to prepare for the large
forthcoming patch (part 4/4) that completes DATA statement processing
via conversion to initializers.

Reviewed By: PeteSteinfeld

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

4 years ago[ELF] Refactor ObjFile<ELFT>::initializeSymbols to enforce the invariant: InputFile...
Fangrui Song [Fri, 19 Jun 2020 16:05:28 +0000 (09:05 -0700)]
[ELF] Refactor ObjFile<ELFT>::initializeSymbols to enforce the invariant: InputFile::symbols has non null entry

Fixes PR46348.

ObjFile<ELFT>::initializeSymbols contains two symbol iteration loops:

```
for each symbol
  if non-inheriting && non-local
    fill in this->symbols[i]

for each symbol
  if local
    fill in this->symbols[i]
  else
    symbol resolution
```

Symbol resolution can trigger a duplicate symbol error which will call
InputSectionBase::getObjMsg to iterate over InputFile::symbols.  If a
non-local symbol appears after the non-local symbol being resolved
(violating ELF spec), its `this->symbols[i]` entry has not been filled
in, InputSectionBase::getObjMsg will crash due to
`dyn_cast<Defined>(nullptr)`.

To fix the bug, reorganize the two loops to ensure this->symbols is
complete before symbol resolution. This enforces the invariant:
InputFile::symbols has none null entry when InputFile::getSymbols() is called.

```
for each symbol
  if non-inheriting
    fill in this->symbols[i]

for each symbol starting from firstGlobal
  if non-local
    symbol resolution
```

Additionally, move the (non-local symbol in local part of .symtab)
diagnostic from Writer<ELFT>::copyLocalSymbols() to initializeSymbols().

Reviewed By: grimar, jhenderson

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

4 years ago[AMDGPU] Some formatting fixes. NFC.
Stanislav Mekhanoshin [Fri, 19 Jun 2020 16:02:59 +0000 (09:02 -0700)]
[AMDGPU] Some formatting fixes. NFC.

4 years ago[lldb] Fix TestComplexInt on ARM
Raphael Isemann [Fri, 19 Jun 2020 15:46:21 +0000 (17:46 +0200)]
[lldb] Fix TestComplexInt on ARM

On the buildbot long and int have the same size but long and long long don't,
so the bug where we find the first type by size will produce a different error.
Make the test dynamic based on int/long/long long size to fix the bot.

4 years ago[MLIR][Shape] Lower `shape.shape_of` to standard dialect
Frederik Gossen [Fri, 19 Jun 2020 15:09:36 +0000 (15:09 +0000)]
[MLIR][Shape] Lower `shape.shape_of` to standard dialect

Lower `shape.shape_of` to standard dialect.
This lowering supports statically and dynamically shaped tensors.
Support for unranked tensors will be added as part of the lowering to `scf`.

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

4 years agoRevert "[FileCheck, unittest] Improve readability of ExpressionFormat"
Thomas Preud'homme [Fri, 19 Jun 2020 14:52:07 +0000 (15:52 +0100)]
Revert "[FileCheck, unittest] Improve readability of ExpressionFormat"

This reverts commit cd2553de77f2c3206deaa261a15cc7520ff2ff56.

4 years ago[libc++] Require concepts support for <numbers>
Raul Tambre [Fri, 19 Jun 2020 14:36:44 +0000 (10:36 -0400)]
[libc++] Require concepts support for <numbers>

Similar to <concepts>, we need to protect the header and test against
inclusion and being run if concepts aren't supported by the compiler.

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