platform/upstream/llvm.git
4 years ago[MC] Generate .debug_line in the 64-bit DWARF format [2/7]
Igor Kudrin [Wed, 3 Jun 2020 09:48:37 +0000 (16:48 +0700)]
[MC] Generate .debug_line in the 64-bit DWARF format [2/7]

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

4 years ago[MC] Add --dwarf64 to generate DWARF64 debug info [1/7]
Igor Kudrin [Wed, 3 Jun 2020 06:15:51 +0000 (13:15 +0700)]
[MC] Add --dwarf64 to generate DWARF64 debug info [1/7]

The patch adds an option `--dwarf64` to instruct a tool to generate
debug information in the 64-bit DWARF format. There is no real
implementation yet, only a few compatibility checks.

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

4 years ago[X86][SSE] MatchVectorAllZeroTest - handle OR vector reductions
Simon Pilgrim [Tue, 16 Jun 2020 08:42:11 +0000 (09:42 +0100)]
[X86][SSE] MatchVectorAllZeroTest - handle OR vector reductions

This patch extends MatchVectorAllZeroTest to handle OR vector reduction patterns where the result is compared against zero.

Fixes PR45378

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

4 years ago[X86][SSE] combineVectorSizedSetCCEquality - move single Subtarget.hasAVX() use into...
Simon Pilgrim [Mon, 15 Jun 2020 20:47:39 +0000 (21:47 +0100)]
[X86][SSE] combineVectorSizedSetCCEquality - move single Subtarget.hasAVX() use into condition. NFC.

We already have Subtarget.hasSSE2() and Subtarget.useAVX512Regs() in the condition - seems to be a legacy from when we had multiple uses.

4 years ago[MLIR] Fix memref region compute for 0-d memref accesses
Uday Bondhugula [Sat, 13 Jun 2020 19:20:26 +0000 (00:50 +0530)]
[MLIR] Fix memref region compute for 0-d memref accesses

Fix memref region compute for 0-d memref accesses in certain cases (when
there are loops surrounding such 0-d accesses).

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

4 years agoNFC: cleanup the "(void)" case trick since the assertion is wrapped in NDEBUG.
Haojian Wu [Tue, 16 Jun 2020 07:44:02 +0000 (09:44 +0200)]
NFC: cleanup the "(void)" case trick since the assertion is wrapped in NDEBUG.

4 years ago[CostModel] Unify getCFInstrCost
Sam Parker [Tue, 16 Jun 2020 07:33:28 +0000 (08:33 +0100)]
[CostModel] Unify getCFInstrCost

Have TTI::getInstructionThroughput call getUserCost for Br, Ret and
PHI. This now means that eveything in getInstructionThroughput is
handled by getUserCost.

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

4 years agoNFC: Inline unused variable
Kirill Bobyrev [Tue, 16 Jun 2020 06:29:52 +0000 (08:29 +0200)]
NFC: Inline unused variable

The variable was not used anywhere except assert and causes build
warnings in the optimized builds.

Clanup after 913bc312b5516f0c7113fe14ea90097587ac5ca5

4 years ago[lib][NFC] Split the floating point util functions into multiple files.
Siva Chandra Reddy [Tue, 16 Jun 2020 04:06:24 +0000 (21:06 -0700)]
[lib][NFC] Split the floating point util functions into multiple files.

The grouping now reflects the grouping on cppreference.com.

4 years ago[mlir][StandardDialect] Add some folding for operations in standard dialect.
MaheshRavishankar [Tue, 16 Jun 2020 05:28:43 +0000 (22:28 -0700)]
[mlir][StandardDialect] Add some folding for operations in standard dialect.

Add the following canonicalization
- and(x, 1) -> x
- subi(x, 0) -> x

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

4 years ago[MLIR] Modify HasParent trait to allow one of several op's as a parent
Rahul Joshi [Tue, 16 Jun 2020 04:50:48 +0000 (04:50 +0000)]
[MLIR] Modify HasParent trait to allow one of several op's as a parent

- Modify HasParent trait to allow one of several op's as a parent -
- Expose this trait in the ODS framework using the ParentOneOf<> trait.

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

4 years ago[lldb] Remove redundant access specifiers (NFC)
Jonas Devlieghere [Tue, 16 Jun 2020 04:34:12 +0000 (21:34 -0700)]
[lldb] Remove redundant access specifiers (NFC)

4 years ago[lldb/Lua] Fix override/virtual in ScriptInterpreterLua (NFC)
Jonas Devlieghere [Tue, 16 Jun 2020 04:15:35 +0000 (21:15 -0700)]
[lldb/Lua] Fix override/virtual in ScriptInterpreterLua (NFC)

4 years ago[lldb/Python] Various cleanups in ScriptInterpreterPython (NFC)
Jonas Devlieghere [Tue, 16 Jun 2020 04:06:13 +0000 (21:06 -0700)]
[lldb/Python] Various cleanups in ScriptInterpreterPython (NFC)

4 years ago[AArch64] Print the immediate operand for SPACE pseudo instruction
Fangrui Song [Tue, 16 Jun 2020 03:55:53 +0000 (20:55 -0700)]
[AArch64] Print the immediate operand for SPACE pseudo instruction

Reviewed By: dmgreen

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

4 years ago[AArch64][GlobalISel] Emit constant pool loads for 64 bit fp immediates.
Amara Emerson [Mon, 15 Jun 2020 23:14:47 +0000 (16:14 -0700)]
[AArch64][GlobalISel] Emit constant pool loads for 64 bit fp immediates.

Note: don't do this for integer 64 bit materialization to match SDAG.

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

4 years ago[lldb/Interpreter] Use std::make_shared<StreamString> (NFC)
Jonas Devlieghere [Tue, 16 Jun 2020 03:48:35 +0000 (20:48 -0700)]
[lldb/Interpreter] Use std::make_shared<StreamString> (NFC)

4 years ago[LLParser] Delete temp CallInst when error occurs
Qiu Chaofan [Tue, 16 Jun 2020 03:41:25 +0000 (11:41 +0800)]
[LLParser] Delete temp CallInst when error occurs

Only functions with floating-point return type accepts fast-math flags.
When adding such flags to function returning integer, we'll see a crash,
because there's still an undeleted value referencing the argument. This
patch manually removes the temporary instruction when error occurs.

Reviewed By: arsenm

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

4 years ago[llvm][TextAPI/MachO] clean up auto usages in tests, NFC
Cyndy Ishida [Tue, 16 Jun 2020 02:59:42 +0000 (19:59 -0700)]
[llvm][TextAPI/MachO] clean up auto usages in tests, NFC

4 years ago[ObjectYAML][DWARF] Implement the .debug_addr section.
Xing GUO [Tue, 16 Jun 2020 02:50:49 +0000 (10:50 +0800)]
[ObjectYAML][DWARF] Implement the .debug_addr section.

This patch implements the .debug_addr section.

Reviewed By: jhenderson, grimar

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

4 years ago[llvm][NFC] Fix license on InlineFeaturesAnalysis.{h|cpp}
Mircea Trofin [Mon, 15 Jun 2020 23:46:21 +0000 (16:46 -0700)]
[llvm][NFC] Fix license on InlineFeaturesAnalysis.{h|cpp}

Summary: Also fixed the InlineAdvisor.cpp license.

Reviewers: rriddle

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[X86] Add support for inline assembly 'x' constraint for i128.
Craig Topper [Tue, 16 Jun 2020 02:34:02 +0000 (19:34 -0700)]
[X86] Add support for inline assembly 'x' constraint for i128.

Limiting to x86-64 since that's when __int128 is legal in clang.

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

4 years ago[llvm-objcopy][MachO] Add support for LC_CODE_SIGNATURE
Alexander Shaposhnikov [Tue, 16 Jun 2020 01:55:59 +0000 (18:55 -0700)]
[llvm-objcopy][MachO] Add support for LC_CODE_SIGNATURE

This diff adds support for copying binaries
containing a LC_CODE_SIGNATURE load command.

Test plan: make check-all

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

4 years ago[lldb/Docs] Reword paragraph and omit 'build slave'
Jonas Devlieghere [Tue, 16 Jun 2020 01:25:57 +0000 (18:25 -0700)]
[lldb/Docs] Reword paragraph and omit 'build slave'

4 years ago[lldb/debugserver] Rename Master/Slave to Primary/Secondary (NFC)
Jonas Devlieghere [Tue, 16 Jun 2020 01:22:10 +0000 (18:22 -0700)]
[lldb/debugserver] Rename Master/Slave to Primary/Secondary (NFC)

4 years ago[HIP] Do not use llvm-link/opt/llc for -fgpu-rdc
Yaxun (Sam) Liu [Sun, 14 Jun 2020 13:07:31 +0000 (09:07 -0400)]
[HIP] Do not use llvm-link/opt/llc for -fgpu-rdc

This patch is a follow up on https://reviews.llvm.org/D81627.

In addition to default -fno-gpu-rdc case, this patches let
HIP toolchain not use llvm-link/opt/llc to link device code
for -fgpu-rdc case. Instead, uses standard lto.

This will eliminate some redundant optimizations and speed
up the compilation/linking.

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

4 years ago[MSAN] Pass Origin by parameter to __msan_warning functions
Gui Andrade [Mon, 15 Jun 2020 22:17:00 +0000 (15:17 -0700)]
[MSAN] Pass Origin by parameter to __msan_warning functions

Summary:
Normally, the Origin is passed over TLS, which seems like it introduces unnecessary overhead. It's in the (extremely) cold path though, so the only overhead is in code size.

But with eager-checks, calls to __msan_warning functions are extremely common, so this becomes a useful optimization.

This can save ~5% code size.

Reviewers: eugenis, vitalybuka

Reviewed By: eugenis, vitalybuka

Subscribers: hiraditya, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

4 years ago[AMDGPU] make ubsan happy with unsigned left shift
Stanislav Mekhanoshin [Mon, 15 Jun 2020 23:57:33 +0000 (16:57 -0700)]
[AMDGPU] make ubsan happy with unsigned left shift

Fixes UBSAN error after rG9ee272f13d88f090817235ef4f91e56bb2a153d6
A trivial signed/unsigned shift.

4 years ago[NativeSession] Implement findLineNumbersByAddress in NativeSession,
Amy Huang [Mon, 16 Mar 2020 16:53:49 +0000 (09:53 -0700)]
[NativeSession] Implement findLineNumbersByAddress in NativeSession,
which takes an address and a length and returns all lines within that
address range.

4 years ago[lit] Allow for tests to have non-parsed requirements
Casey Carter [Sat, 13 Jun 2020 01:45:49 +0000 (18:45 -0700)]
[lit] Allow for tests to have non-parsed requirements

MSVC uses lit for STL testing to run both the libcxx tests and our "native" suite of tests which has feature requirements that are not parsed from the test content. For consistency, the change treats the `unsupported` and `xfails` `Test` properties similarly to `requires`.

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

4 years agoUpstream two performance monitor collectors to MachTask
Jason Molenda [Mon, 15 Jun 2020 23:37:56 +0000 (16:37 -0700)]
Upstream two performance monitor collectors to MachTask

Add two more perf monitors to MachTask::GetProfileData.

<rdar://problem/63984105>

4 years ago[GlobalISel] Look through extends etc in CombinerHelper::matchConstantOp
Jessica Paquette [Mon, 15 Jun 2020 19:16:33 +0000 (12:16 -0700)]
[GlobalISel] Look through extends etc in CombinerHelper::matchConstantOp

It's possible to end up with a zext or something in the way of a G_CONSTANT,
even pre-legalization. This can happen with memsets.

e.g.

https://godbolt.org/z/Bjc8cw

To make sure we can catch these cases, use `getConstantVRegValWithLookThrough`
instead of `mi_match`.

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

4 years ago[libc++] Automatically create the %T directory inside config tests
Louis Dionne [Mon, 15 Jun 2020 23:15:14 +0000 (19:15 -0400)]
[libc++] Automatically create the %T directory inside config tests

4 years ago[libc++] Replace the FakeLitConfig by an actual LitConfig object
Louis Dionne [Mon, 15 Jun 2020 23:13:58 +0000 (19:13 -0400)]
[libc++] Replace the FakeLitConfig by an actual LitConfig object

4 years ago[Docs] Add missing space, requested on c08ea07
Erich Keane [Mon, 15 Jun 2020 23:20:32 +0000 (16:20 -0700)]
[Docs] Add missing space, requested on c08ea07

4 years agoFollow up for "[lit] Include unexecuted tests in xUnit report"
Julian Lettner [Mon, 15 Jun 2020 23:15:28 +0000 (16:15 -0700)]
Follow up for "[lit] Include unexecuted tests in xUnit report"

The extended test fails on bots that still run lit tests with Python 2.

https://reviews.llvm.org/D81316

4 years ago[AMDGPU] Add gfx1030 target
Stanislav Mekhanoshin [Mon, 15 Jun 2020 21:10:39 +0000 (14:10 -0700)]
[AMDGPU] Add gfx1030 target

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

4 years agoFix SourceMgrDiagnosticHandler::convertLocToSMLoc for unknown line/column scenerio.
Jing Pu [Mon, 15 Jun 2020 22:59:20 +0000 (15:59 -0700)]
Fix SourceMgrDiagnosticHandler::convertLocToSMLoc for unknown line/column scenerio.

Summary: FileLineColLoc allows the column and line to be zero to represent unknown column and/or unknown line/column information. However, SourceMgr::FindLocForLineAndColumn treats line 0 and col 0 valid and pointing to the first line and col, respectively. To adapt this mismatch in semantics, we explicitly check line/col being zeros in SourceMgrDiagnosticHandler::convertLocToSMLoc

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

4 years ago[CodeGen][NFC] Add a helper function that returns the addresses of
Akira Hatanaka [Sun, 14 Jun 2020 05:44:17 +0000 (22:44 -0700)]
[CodeGen][NFC] Add a helper function that returns the addresses of
parameters of non-trivial C struct special functions

This removes the need to pass std::array of Addresses to getFunction,
which were overwritten in the function.

4 years ago[mlir][DialectConversion] Add overload of addDynamicallyLegalDialect to support lambdas
River Riddle [Mon, 15 Jun 2020 22:30:21 +0000 (15:30 -0700)]
[mlir][DialectConversion] Add overload of addDynamicallyLegalDialect to support lambdas

This allows for passing a lambda to addDynamicallyLegalDialect without needing to explicit wrap with Optional<DynamicLegalityCallbackFn>.

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

4 years ago[mlir][DialectConversion] Cache type conversions and add a few useful helpers
River Riddle [Mon, 15 Jun 2020 22:30:13 +0000 (15:30 -0700)]
[mlir][DialectConversion] Cache type conversions and add a few useful helpers

It is quite common for the same type to be converted many types throughout the conversion process, and there isn't any good reason why we aren't caching that result. Especially given that we currently use identity conversion to signify legality. This revision also adds a few additional helpers to TypeConverter.

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

4 years agoFix MLIR test after 1d33c09f220e: matrix intrinsics have "nocapture" on some argument...
Mehdi Amini [Mon, 15 Jun 2020 22:55:52 +0000 (22:55 +0000)]
Fix MLIR test after 1d33c09f220e: matrix intrinsics have "nocapture" on some arguments (NFC)

4 years ago[HIP] Do not call opt/llc for -fno-gpu-rdc
Yaxun (Sam) Liu [Tue, 9 Jun 2020 19:02:53 +0000 (15:02 -0400)]
[HIP] Do not call opt/llc for -fno-gpu-rdc

Currently HIP toolchain calls clang to emit bitcode then calls opt/llc for device compilation for the default -fno-gpu-rdc
case, which is unnecessary since clang is able to compile a single source file to ISA.

This patch fixes the HIP action builder and toolchain so that the default -fno-gpu-rdc can be done like a canonical
toolchain, i.e. one clang -cc1 invocation to compile source code to ISA.

This can avoid unnecessary processes to speed up the compilation, and avoid redundant LLVM passes which are
performed in clang -cc1 and opt.

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

4 years ago[lldb] Rename Master/Slave to Primary/Secondary (NFC)
Jonas Devlieghere [Mon, 15 Jun 2020 22:36:14 +0000 (15:36 -0700)]
[lldb] Rename Master/Slave to Primary/Secondary (NFC)

4 years ago[mlir][Linalg] Retire C++ MatmulOp in favor of a linalg-ods-gen'd op.
Nicolas Vasilache [Mon, 15 Jun 2020 19:13:23 +0000 (15:13 -0400)]
[mlir][Linalg] Retire C++ MatmulOp in favor of a linalg-ods-gen'd op.

This revision replaces MatmulOp, now that DRR rules have been dropped.
This revision also fixes minor parsing bugs and a plugs a few holes to get e2e paths working (e.g. library call emission).

During the replacement the i32 version had to be dropped because only the EDSC operators +, *, etc support type inference.

Deciding on a type-polymorphic behavior, and implementing it, is left for future work.

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

4 years ago[mlir][NFC] Fix file comments.
Hanhan Wang [Mon, 15 Jun 2020 21:43:28 +0000 (14:43 -0700)]
[mlir][NFC] Fix file comments.

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

4 years ago[GlobalISel] Don't emit multiply by magic constant for zero memset values.
Amara Emerson [Mon, 15 Jun 2020 21:37:55 +0000 (14:37 -0700)]
[GlobalISel] Don't emit multiply by magic constant for zero memset values.

4 years ago[libc++] Re-apply parts of 3ea9450bda90 "Migrate Lit platform detection to the DSL"
Louis Dionne [Mon, 15 Jun 2020 18:50:56 +0000 (14:50 -0400)]
[libc++] Re-apply parts of 3ea9450bda90 "Migrate Lit platform detection to the DSL"

The commit was reverted in 43c4afb56ff0 because it broke the Windows to
Linux cross-compilation build bots. The issue turned out to be that the
bots were setting the LIBCXX_EXECUTOR incorrectly. This has been fixed
now and verified with the bot owners.

Note that this is only a partial re-application of the commit, since
non-problematic parts of the commits have already been re-applied earlier.

4 years ago[llvm][NFC] Move content of ML subdirectory into Analysis
Mircea Trofin [Mon, 15 Jun 2020 20:18:13 +0000 (13:18 -0700)]
[llvm][NFC] Move content of ML subdirectory into Analysis

The initial intent was to organize ML stuff in its own directory, but
it turns out that conflicts with llvm component layering policies: it
is not a component, because subsequent changes want to rely on other
analyses, which would create a cycle; and we don't have a reliable,
cross-platform mechanism to compile files in a subdirectory, and fit in
the existing LLVM build structure.

This change moves the files into Analysis, and subsequent changes will
leverage conditional compilation for those that have optional
dependencies.

4 years ago[mlir] [integration_test] Make integration tests default OFF
aartbik [Mon, 15 Jun 2020 20:54:18 +0000 (13:54 -0700)]
[mlir] [integration_test] Make integration tests default OFF

Summary:
Previous submit of new tests accidentally made this ON.
The tests should be opt-in.

To build with MLIR integration tests enabled, pass the following

cmake .... \
-DMLIR_INCLUDE_INTEGRATION_TESTS=ON \
....

Reviewers: mehdi_amini

Subscribers: mgorny, mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, stephenneuendorffer, Joonsoo, grosul1, frgossen, Kayjukh, jurahul, msifontes

Tags: #mlir

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

4 years ago[PPCAsmPrinter] support 'L' output template for memory operands
Nick Desaulniers [Mon, 15 Jun 2020 21:21:55 +0000 (14:21 -0700)]
[PPCAsmPrinter] support 'L' output template for memory operands

Summary:
L is meant to support the second word used by 32b calling conventions for 64b arguments.

This is required for build 32b PowerPC Linux kernels after upstream
commit 334710b1496a ("powerpc/uaccess: Implement unsafe_put_user() using 'asm goto'")

Thanks for the report from @nathanchance, and reference to GCC's
implementation from @segher.

Fixes: pr/46186
Fixes: https://github.com/ClangBuiltLinux/linux/issues/1044

Reviewers: echristo, hfinkel, MaskRay

Reviewed By: MaskRay

Subscribers: MaskRay, wuzish, nemanjai, hiraditya, kbarton, steven.zhang, llvm-commits, segher, nathanchance, srhines

Tags: #llvm

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

4 years ago[CodeGenPrepare] Reset the debug location when promoting trunc(s)
Davide Italiano [Mon, 15 Jun 2020 21:25:30 +0000 (14:25 -0700)]
[CodeGenPrepare] Reset the debug location when promoting trunc(s)

The promotion machinery in CGP moves instructions retaining
debug locations. When the transformation is local, this is mostly
correct, but when instructions are moved cross-BBs, this is not
always true and causes jumpiness in line tables. This is the first
of a series of commits. sext(s) and zext(s) need to be treated
similarly.

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

4 years ago[Analyzer][NFC] Remove prefix from WebKitNoUncountedMemberChecker name
Jan Korous [Mon, 15 Jun 2020 20:58:34 +0000 (13:58 -0700)]
[Analyzer][NFC] Remove prefix from WebKitNoUncountedMemberChecker name

4 years ago[IR] Add nocapture & nosync to matrix intrinsics.
Florian Hahn [Mon, 15 Jun 2020 20:54:01 +0000 (21:54 +0100)]
[IR] Add nocapture & nosync to matrix intrinsics.

As suggested in D81472, the load/store intrinsics' pointer arguments can
be marked as nocapture and all matrix intrinsics as nosync.

This also re-flows the intrinsic definitions, to make them a little more
concise.

4 years ago[gn build] Port a7eb3692e76
LLVM GN Syncbot [Mon, 15 Jun 2020 21:03:25 +0000 (21:03 +0000)]
[gn build] Port a7eb3692e76

4 years ago[cmake] Invoke ssh.py using Python interpreter, not as executable in CrossWinToARMLin...
Sergej Jaskiewicz [Mon, 15 Jun 2020 20:59:06 +0000 (23:59 +0300)]
[cmake] Invoke ssh.py using Python interpreter, not as executable in CrossWinToARMLinux.cmake

The issue is that Windows doesn't support shebangs. This caused issues
with libc++ tests.

4 years ago[Analyzer][WebKit] UncountedCallArgsChecker
Jan Korous [Mon, 15 Jun 2020 20:29:08 +0000 (13:29 -0700)]
[Analyzer][WebKit] UncountedCallArgsChecker

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

4 years ago[SVE] Bail from cstfp_pred_ty before walking scalable vector
Christopher Tetreault [Mon, 15 Jun 2020 20:05:37 +0000 (13:05 -0700)]
[SVE] Bail from cstfp_pred_ty before walking scalable vector

Summary:
Bail out in cstfp_pred_ty before calling getNumElements and walking the
vector if the vector is scalable.

Reviewers: efriedma, lebedev.ri, fhahn, sdesmalen, fpetrogalli

Reviewed By: sdesmalen

Subscribers: tschuett, rkruppe, psnobl, llvm-commits

Tags: #llvm

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

4 years agoMake OpOperand constructor private (NFC)
Mehdi Amini [Mon, 15 Jun 2020 00:51:48 +0000 (00:51 +0000)]
Make OpOperand constructor private (NFC)

This is intended to avoid programming mistake where a temporary OpOperand is
created, for example:

        for (OpOperand user : result.getUsers()) {

It can be confusing for the user, in particular since in MLIR most classes are intended to
be copied around by value while they have reference semantics.

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

4 years agoNFC: Remove disabled rule from postlegalizer-combiner-zip.mir test
Jessica Paquette [Mon, 15 Jun 2020 20:11:12 +0000 (13:11 -0700)]
NFC: Remove disabled rule from postlegalizer-combiner-zip.mir test

Apparently an x86 bot doesn't like the disabled rule in this test.

http://lab.llvm.org:8011/builders/fuchsia-x86_64-linux/builds/6569

Remove disabled rule and update the test to try and pacify the bot.

4 years ago[CUDA,HIP] Use VFS for SDK detection.
Artem Belevich [Fri, 12 Jun 2020 22:28:02 +0000 (15:28 -0700)]
[CUDA,HIP] Use VFS for SDK detection.

It's useful for using clang from tools that may need need to provide SDK files
from non-standard locations.

Clang CLI only provides a way to specify VFS for include files, so there's no
good way to test this yet.

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

4 years ago[lld-macho] Specify the complete set of command-line options for ld64
Greg McGary [Mon, 15 Jun 2020 19:36:32 +0000 (12:36 -0700)]
[lld-macho] Specify the complete set of command-line options for ld64

This is a complete Options.td compiled from ld(1) dated 2018-03-07 and
cross checked with ld64 source code version 512.4 dated 2018-03-18.

This is the first in a series of diffs for argument handling. Follow-ups
will include switch cases for all the new instances of `OPT_foo`, and
parsing/validation of arguments attached to options, e.g., more code
akin to `OPT_platform_version` and associated `parsePlatformVersion()`.

Reviewed By: smeenai

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

4 years ago[IR] Add AttributeBitSet wrapper (NFC)
Nikita Popov [Sun, 14 Jun 2020 21:46:18 +0000 (23:46 +0200)]
[IR] Add AttributeBitSet wrapper (NFC)

This wraps the uint8_t[12] type used in two places, because I
plan to introduce a third use of the same pattern.

4 years ago[MachO] Fix typo in comment
Shoaib Meenai [Mon, 15 Jun 2020 18:56:26 +0000 (11:56 -0700)]
[MachO] Fix typo in comment

The case the calculation works for is when r_length = 2.

4 years agoFix ConstantAggregateBuilderBase::getRelativeOffset
Arnold Schwaighofer [Mon, 15 Jun 2020 17:28:06 +0000 (10:28 -0700)]
Fix ConstantAggregateBuilderBase::getRelativeOffset

Summary:
If a record has a mix of relative pointers and other fields they
wouldn't necessarily be the same.

Fallout from D77592.

rdar://64309883

Subscribers: cfe-commits

Tags: #clang

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

4 years ago[AArch64][GlobalISel] Add G_EXT and select ext using it
Jessica Paquette [Mon, 8 Jun 2020 21:02:15 +0000 (14:02 -0700)]
[AArch64][GlobalISel] Add G_EXT and select ext using it

Add selection support for ext via a new opcode, G_EXT and a post-legalizer
combine which matches it.

Add an `applyEXT` function, because the AArch64ext patterns require a register
for the immediate. So, we have to create a G_CONSTANT to get these without
writing new patterns or modifying the existing ones.

Tests are the same as arm64-ext.ll.

Also prevent ext from firing on the zip test. It has higher priority, so we
don't want it potentially getting in the way of mask tests.

Also fix up the shuffle-splat test, because ext is now selected there. The
test was incorrectly regbank selected before, which could cause a verifier
failure when you emit copies.

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

4 years agoRevert "[llvm] Added support for stand-alone cmake object libraries."
Mircea Trofin [Mon, 15 Jun 2020 19:14:51 +0000 (12:14 -0700)]
Revert "[llvm] Added support for stand-alone cmake object libraries."

This reverts commit 695c7d6313d74dc02222f6497d4c4985d67f433f.

Breaks windows (e.g.
http://lab.llvm.org:8011/builders/clang-x64-windows-msvc/builds/16497)

Likely to cause problems with XCode.

4 years ago[Target/PPC] Fold inside an assertion.
Davide Italiano [Mon, 15 Jun 2020 19:08:15 +0000 (12:08 -0700)]
[Target/PPC] Fold inside an assertion.

Pointed out by dblaikie.

4 years ago[llvm] Added support for stand-alone cmake object libraries.
Mircea Trofin [Tue, 9 Jun 2020 03:58:53 +0000 (20:58 -0700)]
[llvm] Added support for stand-alone cmake object libraries.

Summary:
Currently, add_llvm_library would create an OBJECT library alongside
of a STATIC / SHARED library, but losing the link interface (its
elements would become dependencies instead). To support scenarios
where linking an object library also brings in its usage
requirements, this patch adds support for 'stand-alone' OBJECT
libraries - i.e. without an accompanying SHARED/STATIC library, and
maintaining the link interface defined by the user.

The support is via a new option, OBJECT_ONLY, to avoid breaking changes
- since just specifying "OBJECT" would currently imply also STATIC or
SHARED, depending on BUILD_SHARED_LIBS.

This is useful for cases where, for example, we want to build a part
of a component separately. Using a STATIC target would incur the risk
that symbols not referenced in the consumer would be dropped (which may
be undesirable).

The current application is the ML part of Analysis. It should be part
of the Analysis component, so it may reference other analyses; and (in
upcoming changes) it has dependencies on optional libraries.

Reviewers: karies, davidxl

Subscribers: mgorny, hiraditya, llvm-commits

Tags: #llvm

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

4 years agoAMDGPU/GlobalISel: Don't hardcode maximum register size
Matt Arsenault [Sat, 13 Jun 2020 22:32:30 +0000 (18:32 -0400)]
AMDGPU/GlobalISel: Don't hardcode maximum register size

This is a somewhat artifical limit, so avoid repeating it many places
in case it changes.

4 years ago[libc++] Add the ability to run arbitrary programs using the DSL
Louis Dionne [Mon, 15 Jun 2020 18:49:21 +0000 (14:49 -0400)]
[libc++] Add the ability to run arbitrary programs using the DSL

This is useful for checking runtime properties of the target system.
This is a partial re-application of 3ea9450bda90. This part was tested
to work on a Windows host with a SSH executor.

4 years agoAMDGPU/GlobalISel: Extend load/store workaround to i128 vectors
Matt Arsenault [Mon, 15 Jun 2020 17:42:47 +0000 (13:42 -0400)]
AMDGPU/GlobalISel: Extend load/store workaround to i128 vectors

4 years agoRevert "[mlir] Add support for lowering tanh to LLVMIR."
Mehdi Amini [Mon, 15 Jun 2020 18:33:34 +0000 (18:33 +0000)]
Revert "[mlir] Add support for lowering tanh to LLVMIR."

This reverts commit 32c757e4f808c68a7e34eb712fead0a49cdf814a.

Broke the build bot:

******************** TEST 'MLIR :: Examples/standalone/test.toy' FAILED ********************
[...]
/tmp/ci-KIMiRFcVZt/lib/libMLIRLinalgToLLVM.a(LinalgToLLVM.cpp.o): In function `(anonymous namespace)::ConvertLinalgToLLVMPass::runOnOperation()':
LinalgToLLVM.cpp:(.text._ZN12_GLOBAL__N_123ConvertLinalgToLLVMPass14runOnOperationEv+0x100): undefined reference to `mlir::populateExpandTanhPattern(mlir::OwningRewritePatternList&, mlir::MLIRContext*)'

4 years ago[LLVM] Change isa<> to a variadic function template
Rahul Joshi [Mon, 15 Jun 2020 18:25:14 +0000 (18:25 +0000)]
[LLVM] Change isa<> to a variadic function template

Change isa<> to a variadic function template, so that it can be used to test against one of multiple types as follows:
   isa<Type0, Type1, Type2>(Val)

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

4 years ago[lit] Include unexecuted tests in xUnit report
Julian Lettner [Fri, 5 Jun 2020 22:45:43 +0000 (15:45 -0700)]
[lit] Include unexecuted tests in xUnit report

Pass in all discovered tests to report generators.

The XunitReport generator now creates testcase items for unexecuted
tests and documents why they have been skipped.  This makes it easier
to compare test runs with different filters or configurations, or across
platforms.

I don't know who is using the JsonReport generator and what the
expectations there are (it doesn't have tests), so decided to preserve
the old behavior by filtering out the unexecuted tests.

Reviewed By: jdenny

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

4 years ago[RuntimeDyld] Add dependence on Core.
Lang Hames [Mon, 15 Jun 2020 18:07:16 +0000 (11:07 -0700)]
[RuntimeDyld] Add dependence on Core.

Commit 498dd745f55 introduced a dependence on Core. This patch updates
LLVMbuild.txt to reflect this.

4 years agoAMDGPU/GlobalISel: Correct memory size in test
Matt Arsenault [Mon, 15 Jun 2020 18:12:02 +0000 (14:12 -0400)]
AMDGPU/GlobalISel: Correct memory size in test

4 years ago[mlir] [integration-test] [VectorOps] Start an integration test directory for MLIR
aartbik [Mon, 15 Jun 2020 17:39:10 +0000 (10:39 -0700)]
[mlir] [integration-test] [VectorOps] Start an integration test directory for MLIR

Summary:
This CL introduces an integration test directory for MLIR in general, with
vector dialect integration tests in particular as a first working suite. To
run all the integration tests (and currently just the vector suite):

$ cmake --build . --target check-mlir-integration
[0/1] Running the MLIR integration tests
Testing Time: 0.24s
Passed: 22

The general call is to contribute to this integration test directory with more
tests and other suites, running end-to-end examples that may be too heavy for
the regular test directory, but should be tested occasionally to verify the
health of MLIR.

Background discussion at:
https://llvm.discourse.group/t/vectorops-rfc-add-suite-of-integration-tests-for-vector-dialect-operations/1213/

Reviewers: nicolasvasilache, reidtatge, andydavis1, rriddle, ftynse, mehdi_amini, jpienaar, stephenneuendorffer

Reviewed By: nicolasvasilache, stephenneuendorffer

Subscribers: mgorny, mehdi_amini, rriddle, jpienaar, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, stephenneuendorffer, Joonsoo, grosul1, frgossen, Kayjukh, jurahul, msifontes

Tags: #mlir

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

4 years ago[Target/PPC] Silence an unused variable warning. NFC.
Davide Italiano [Mon, 15 Jun 2020 18:04:30 +0000 (11:04 -0700)]
[Target/PPC] Silence an unused variable warning. NFC.

4 years agoRecommit "[X86] Separate imm from relocImm handling."
Craig Topper [Mon, 15 Jun 2020 17:59:43 +0000 (10:59 -0700)]
Recommit "[X86] Separate imm from relocImm handling."

Fix the copy/paste mistake that caused it to fail previously

4 years ago[DSE,MSSA] Port partial store merging.
Florian Hahn [Mon, 15 Jun 2020 14:40:07 +0000 (15:40 +0100)]
[DSE,MSSA] Port partial store merging.

Port partial constant store merging logic to MemorySSA backed DSE. The
heavy lifting is done by the existing helper function. It is used in
context where we already ensured that the later instruction can
eliminate the earlier one, if it is a complete overwrite.

4 years ago[mlir] Add support for lowering tanh to LLVMIR.
Hanhan Wang [Mon, 15 Jun 2020 17:26:32 +0000 (10:26 -0700)]
[mlir] Add support for lowering tanh to LLVMIR.

Summary:
Add a pattern for expanding tanh op into exp form.
A `tanh` is expanded into:
   1) 1-exp^{-2x} / 1+exp^{-2x}, if x => 0
   2) exp^{2x}-1 / exp^{2x}+1  , if x < 0.

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

4 years ago[ORC] Honor linker private global prefix on symbol names.
Lang Hames [Sun, 14 Jun 2020 02:03:21 +0000 (19:03 -0700)]
[ORC] Honor linker private global prefix on symbol names.

If a symbol name begins with the linker private global prefix (as
described by the DataLayout) then it should be treated as non-exported,
regardless of its LLVM IR visibility value.

4 years ago[libc++abi] Ensure custom libc++ header paths are honoured during libc++abi build
Louis Dionne [Mon, 15 Jun 2020 17:20:04 +0000 (13:20 -0400)]
[libc++abi] Ensure custom libc++ header paths are honoured during libc++abi build

This is necessary for standalone builds where the libc++ in use has a
custom configuration set up inside __config_site -- one needs to build
libc++abi against the installed headers of libc++ (which are properly
configured) instead of the ones inside libcxx/include.

See https://reviews.llvm.org/rGe619e9d#927848 for details.

4 years ago[gn build] (manually) merge 3b29376e3fca43
Nico Weber [Mon, 15 Jun 2020 17:21:34 +0000 (13:21 -0400)]
[gn build] (manually) merge 3b29376e3fca43

4 years ago[WebAssembly] Adding 64-bit version of R_WASM_MEMORY_ADDR_* relocs
Wouter van Oortmerssen [Fri, 5 Jun 2020 16:03:12 +0000 (09:03 -0700)]
[WebAssembly] Adding 64-bit version of R_WASM_MEMORY_ADDR_* relocs

This adds 4 new reloc types.

A lot of code that previously assumed any memory or offset values could be contained in a uint32_t (and often truncated results from functions returning 64-bit values) have been upgraded to uint64_t. This is not comprehensive: it is only the values that come in contact with the new relocation values and their dependents.

A new tablegen mapping was added to automatically upgrade loads/stores in the assembler, which otherwise has no way to select for these instructions (since they are indentical other than for the offset immediate). It follows a similar technique to https://reviews.llvm.org/D53307

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

4 years ago[llvm][SveEmitter] SVE ACLE for quadword permute intrinsics.
Francesco Petrogalli [Mon, 15 Jun 2020 16:23:41 +0000 (16:23 +0000)]
[llvm][SveEmitter] SVE ACLE for quadword permute intrinsics.

Summary:
The following intrinsics have been added, guarded by the macro
`__ARM_FEATURE_SVE_MATMUL_FP64`:

* svtrn1q[_*]
* svtrn2q[_*]
* svuzp1q[_*]
* svuzp2q[_*]
* svzip1q[_*]
* svzip2q[_*]

Supported types:

* svint[8|16|32|64]_t
* svuint[8|16|32|64]_t
* svfloat[16|32|64]_t

TODO: add support for svbfloat16_t

Reviewers: efriedma, sdesmalen, kmclaughlin, rengolin

Reviewed By: sdesmalen

Subscribers: tschuett, kristof.beyls, cfe-commits

Tags: #clang

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

4 years ago[OpenMP][Tests] fix data race in an OpenMP runtime test
Joachim Protze [Sun, 14 Jun 2020 14:10:10 +0000 (16:10 +0200)]
[OpenMP][Tests] fix data race in an OpenMP runtime test

Reviewed by: AndreyChurbanov

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

4 years ago[X86] Remove printanymem/printopaquemem from the InstPrinters. Just tell tablegen...
Craig Topper [Mon, 15 Jun 2020 16:45:02 +0000 (09:45 -0700)]
[X86] Remove printanymem/printopaquemem from the InstPrinters. Just tell tablegen to printMemReference directly. NFC

Most of the wrappers exist to print the memory size in Intel syntax
and then call the printMemReference. But printanymem/printopaquemem
don't print anything extra in Intel syntax so just drop them.

4 years ago[DSE] Hoist partial store merging code into function (NFC).
Florian Hahn [Mon, 15 Jun 2020 14:37:33 +0000 (15:37 +0100)]
[DSE] Hoist partial store merging code into function (NFC).

Hoist the general logic into a new function, because it can be re-used
by the MemorySSA backed DSE as well.

4 years ago[GlobalISel] Simplify G_ADD when it has (0-X) on the LHS or RHS
Jessica Paquette [Sat, 4 Apr 2020 00:11:25 +0000 (17:11 -0700)]
[GlobalISel] Simplify G_ADD when it has (0-X) on the LHS or RHS

This implements the following combines:

((0-A) + B) -> B-A
(A + (0-B)) -> A-B

Porting over the basic algebraic combines from the DAGCombiner. There are
several combines which fold adds away into subtracts. This is just the simplest
one.

I noticed that add combines are some of the most commonly hit across CTMark,
(via print statements when they fire), so I'm porting over some of the obvious
ones.

This gives some minor code size improvements on CTMark at -O3 on AArch64.

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

4 years ago[flang] unit test support for out-of-tree and in-tree using google tests framework
sameeran joshi [Tue, 2 Jun 2020 17:15:44 +0000 (22:45 +0530)]
[flang] unit test support for out-of-tree and in-tree using google tests framework

Review comments addressed.

4 years ago[libc] Enable string functions for aarch64.
Siva Chandra [Mon, 15 Jun 2020 16:36:10 +0000 (09:36 -0700)]
[libc] Enable string functions for aarch64.

4 years ago[lldb] Remove indentation before help output.
Jonas Devlieghere [Mon, 15 Jun 2020 16:25:33 +0000 (09:25 -0700)]
[lldb] Remove indentation before help output.

This patch remove the indentation before the command help output.
Supposedly it was meant to be aligned with the different subcommands.

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

4 years ago[libc] Extract an architecture independent copy of memcpy implementation.
Siva Chandra Reddy [Wed, 10 Jun 2020 21:41:06 +0000 (14:41 -0700)]
[libc] Extract an architecture independent copy of memcpy implementation.

Along that way, platform specific options to memcpy, memset and bzero
builds have been enclosed in conditionals. Also, the optimization level
has been set to -O2 for the memory function builds to actually see the
static functions inlined.

Reviewers: gchatelet

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

4 years ago[llvm][SVE] IR intrinsics for quadword permutation instructions.
Francesco Petrogalli [Mon, 15 Jun 2020 16:10:37 +0000 (16:10 +0000)]
[llvm][SVE] IR intrinsics for quadword permutation instructions.

Summary:
Adding intrinsics and codegen patterns for:

* trn1 <Zd>.q, <Zm>.q, <Zn>.q
* trn2 <Zd>.q, <Zm>.q, <Zn>.q
* zip1 <Zd>.q, <Zm>.q, <Zn>.q
* zip2 <Zd>.q, <Zm>.q, <Zn>.q
* uzp1 <Zd>.q, <Zm>.q, <Zn>.q
* uzp2 <Zd>.q, <Zm>.q, <Zn>.q

These instructions are defined in Armv8.6-A.

Reviewers: sdesmalen, efriedma, kmclaughlin

Reviewed By: sdesmalen

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

Tags: #llvm

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

4 years ago[flang] Change DIE("unreachable") cases to use llvm_unreachable
David Truby [Wed, 6 May 2020 17:38:28 +0000 (18:38 +0100)]
[flang] Change DIE("unreachable") cases to use llvm_unreachable

Reviewers: sscalpone

Subscribers: llvm-commits

Tags: #llvm

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

4 years ago[libc++] Raise an exception if a Lit feature resolves to an invalid name
Louis Dionne [Mon, 15 Jun 2020 16:19:32 +0000 (12:19 -0400)]
[libc++] Raise an exception if a Lit feature resolves to an invalid name

This allows reporting issues early when creating feature names.

4 years ago[clangd] Follow-up to fix lit-test bustage in type-hierarchy.test
Nathan Ridge [Mon, 15 Jun 2020 16:17:14 +0000 (12:17 -0400)]
[clangd] Follow-up to fix lit-test bustage in type-hierarchy.test

This is a follow-up to D81845.

4 years ago[mlir][shape] Update test case to new op asm format
Jacques Pienaar [Mon, 15 Jun 2020 16:04:54 +0000 (09:04 -0700)]
[mlir][shape] Update test case to new op asm format