Fangrui Song [Sat, 8 Feb 2020 22:10:29 +0000 (14:10 -0800)]
[ELF] Simplify parsing of version dependency. NFC
Simon Pilgrim [Sat, 8 Feb 2020 21:24:01 +0000 (21:24 +0000)]
Fix test name typo
Nikita Popov [Sat, 8 Feb 2020 19:41:10 +0000 (20:41 +0100)]
[InstCombine] Refactor foldICmpAndShift(); NFCI
Separate out handling for shl, lshr and ashr. The combined handling
obscured some overly pessimistic requirements for the transform.
Johannes Doerfert [Sat, 8 Feb 2020 21:22:03 +0000 (15:22 -0600)]
[FIX] Update PM tests after D69930 landed
Simon Pilgrim [Sat, 8 Feb 2020 21:02:04 +0000 (21:02 +0000)]
[X86][SSE] Add test cases from PR44379
Simon Pilgrim [Sat, 8 Feb 2020 20:44:41 +0000 (20:44 +0000)]
[X86] Test showing inability to combine ROTLI/ROTRI rotations into shuffles
One of many things necessary to fix PR44379 (lowering shuffles to rotations)
Johannes Doerfert [Thu, 7 Nov 2019 05:20:06 +0000 (23:20 -0600)]
[OpenMP] Introduce the OpenMPOpt transformation pass
The OpenMPOpt pass is a CGSCC pass in which OpenMP specific
optimizations can reside.
The OpenMPOpt pass uses the OpenMPKinds.def file to identify runtime
calls and their uses. This allows targeted transformations and eases
their implementation.
This initial patch deduplicates `__kmpc_global_thread_num` and
`omp_get_thread_num` calls. We can also identify arguments that are
equivalent to such a call result and use it instead. Later we can
determine "gtid" arguments based on the use in kernel functions etc.
Reviewed By: JonChesterfield
Differential Revision: https://reviews.llvm.org/D69930
Johannes Doerfert [Fri, 29 Nov 2019 19:11:24 +0000 (13:11 -0600)]
Introduce a CallGraph updater helper class
The CallGraphUpdater is a helper that simplifies the process of updating
the call graph, both old and new style, while running an CGSCC pass.
The uses are contained in different commits, e.g. D70767.
More functionality is added as we need it.
Reviewed By: modocache, hfinkel
Differential Revision: https://reviews.llvm.org/D70927
George Burgess IV [Wed, 5 Feb 2020 06:10:39 +0000 (22:10 -0800)]
[SimplifyLibCalls] Add __strlen_chk.
Bionic has had `__strlen_chk` for a while. Optimizing that into a
constant is quite profitable, when possible.
Differential Revision: https://reviews.llvm.org/D74079
Nikita Popov [Sun, 2 Feb 2020 16:40:15 +0000 (17:40 +0100)]
[InstCombine] Fix infinite min/max canonicalization loop (PR44541)
While D72944 also fixes https://bugs.llvm.org/show_bug.cgi?id=44541,
it does so in a more roundabout manner and there might be other
loopholes to trigger the same issue. This is a more direct fix,
that prevents the transform if the min/max is based on a
non-canonical sub X, 0 instruction.
Differential Revision: https://reviews.llvm.org/D73849
River Riddle [Sat, 8 Feb 2020 18:44:15 +0000 (10:44 -0800)]
[mlir] Add a utility method on CallOpInterface for resolving the callable.
Summary: This is the most common operation performed on a CallOpInterface. This just moves the existing functionality from the CallGraph so that other users can access it.
Differential Revision: https://reviews.llvm.org/D74250
Nicolas Vasilache [Sat, 8 Feb 2020 16:16:22 +0000 (11:16 -0500)]
[mlir][EDSC] NFC - Move StructuredIndexed and IteratorType out of Linalg
Summary:
This NFC revision will allow those classes to be reused to allow
building structured vector operations.
Reviewers: aartbik, ftynse
Subscribers: arphaman, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74279
River Riddle [Sat, 8 Feb 2020 18:40:00 +0000 (10:40 -0800)]
[mlir] Add a document detailing the design of the SymbolTable.
Summary: This document provides insight on the rationale and the design of Symbols in MLIR, and why they are necessary.
Differential Revision: https://reviews.llvm.org/D73590
Craig Topper [Sat, 8 Feb 2020 07:23:42 +0000 (23:23 -0800)]
[LegalizeTypes][ARM][AArch64][PowerPC][RISCV][X86] Use BUILD_PAIR to return expanded integer results from ReplaceNodeResults instead of just returning two results.
Remove code from LegalizeTypes that allowed this to work.
We were already using BUILD_PAIR for this in some places so this
standardizes on a single way to do this.
Simon Pilgrim [Sat, 8 Feb 2020 17:01:04 +0000 (17:01 +0000)]
[X86] X86InstComments - add FMA4 comments
These typically match the FMA3 equivalents, although the multiply operands sometimes get flipped due to the FMA3 permute variants.
Simon Pilgrim [Sat, 8 Feb 2020 16:54:46 +0000 (16:54 +0000)]
[X86] Standardize BROADCAST enum names (PR31079)
Tweak EVEX implementation names so it matches the other variants by adding the 'r' prefix. Oddly some of the subvec broadcast ops already matched.
Nikita Popov [Sat, 8 Feb 2020 16:08:42 +0000 (17:08 +0100)]
[InstCombine] Remove unnecessary worklist push; NFCI
This is no longer needed after
d4627b90a0462c90a834c2f7b9c9228b3ec7a45b,
should have dropped it there...
Nikita Popov [Sat, 8 Feb 2020 16:02:10 +0000 (17:02 +0100)]
[InstCombine] Avoid modifying instructions in-place
As discussed on D73919, this replaces a few cases where we were
modifying multiple operands of instructions in-place with the
creation of a new instruction, which we generally prefer nowadays.
This tends to be more readable and less prone to worklist management
bugs.
Test changes are only superficial (instruction naming and order).
Nikita Popov [Sat, 8 Feb 2020 15:57:28 +0000 (16:57 +0100)]
[InstCombine] Use swapValues(); NFC
Less code, and makes it more obvious that these operands do not
need to be added back to the worklist.
Nikita Popov [Sat, 8 Feb 2020 11:04:58 +0000 (12:04 +0100)]
[InstCombine] Fix infinite loop in min/max load/store bitcast combine (PR44835)
Fixes https://bugs.llvm.org/show_bug.cgi?id=44835. Skip the transform
if it wouldn't actually do anything (apart from removing and reinserting
the same instructions).
Note that the test case doesn't loop on current master anymore, only
on the LLVM 10 release branch. The issue is already mitigated on master
due to worklist order fixes, but we should fix the root cause there as well.
As a side note, we should probably assert in combineLoadToNewType()
that it does not combine to the same type. Not doing this here, because
this assertion would also be triggered in another place right now.
Differential Revision: https://reviews.llvm.org/D74278
Simon Pilgrim [Sat, 8 Feb 2020 14:31:06 +0000 (14:31 +0000)]
Regenerate FMA tests
Simon Pilgrim [Sat, 8 Feb 2020 14:01:36 +0000 (14:01 +0000)]
Add missing encoding comments from fma scalar folded intrinsics tests
Benjamin Kramer [Sat, 8 Feb 2020 15:15:09 +0000 (16:15 +0100)]
Put back makeArrayRef to make GCC 5 happy
Simon Pilgrim [Sat, 8 Feb 2020 14:51:10 +0000 (14:51 +0000)]
[X86] Standardize VPSLLDQ/VPSRLDQ enum names (PR31079)
Tweak EVEX implementation names so it matches the other variants
Benjamin Kramer [Sat, 8 Feb 2020 14:45:09 +0000 (15:45 +0100)]
Drop some uses of StringLiteral in favor of StringRef
StringRef can be used in constexpr contexts, so StringLiteral isn't
necessary anymore.
serge-sans-paille [Sat, 8 Feb 2020 13:26:22 +0000 (14:26 +0100)]
Revert "Support -fstack-clash-protection for x86"
This reverts commit
e229017732bcf1911210903ee9811033d5588e0d.
Failures:
http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-debian/builds/2604
http://lab.llvm.org:8011/builders/llvm-clang-win-x-aarch64/builds/4308
Victor Campos [Sat, 8 Feb 2020 11:59:46 +0000 (11:59 +0000)]
Revert "[ARM] Improve codegen of volatile load/store of i64"
This reverts commit
60e0120c913dd1d4bfe33769e1f000a076249a42.
Igor Kudrin [Thu, 6 Feb 2020 10:08:20 +0000 (17:08 +0700)]
[DebugInfo] Allow reading an address table with a mismatched address.
This case does not look as an unrecoverable error.
Differential Revision: https://reviews.llvm.org/D74194
serge_sans_paille [Mon, 9 Sep 2019 14:59:34 +0000 (16:59 +0200)]
Support -fstack-clash-protection for x86
Implement protection against the stack clash attack [0] through inline stack
probing.
Probe stack allocation every PAGE_SIZE during frame lowering or dynamic
allocation to make sure the page guard, if any, is touched when touching the
stack, in a similar manner to GCC[1].
This extends the existing `probe-stack' mechanism with a special value `inline-asm'.
Technically the former uses function call before stack allocation while this
patch provides inlined stack probes and chunk allocation.
Only implemented for x86.
[0] https://www.qualys.com/2017/06/19/stack-clash/stack-clash.txt
[1] https://gcc.gnu.org/ml/gcc-patches/2017-07/msg00556.html
This a recommit of
39f50da2a357a8f685b3540246c5d762734e035f with better option
handling and more portable testing
Differential Revision: https://reviews.llvm.org/D68720
Benjamin Kramer [Sat, 8 Feb 2020 12:27:52 +0000 (13:27 +0100)]
Use heterogenous lookup for std;:map<std::string with a StringRef. NFCI.
Simon Pilgrim [Sat, 8 Feb 2020 11:23:05 +0000 (11:23 +0000)]
Add missing encoding comments from fma4 folded intrinsics tests
Benjamin Kramer [Sat, 8 Feb 2020 11:14:37 +0000 (12:14 +0100)]
ArrayRef'ize spillCalleeSavedRegisters. NFCI.
Simon Pilgrim [Sat, 8 Feb 2020 10:56:27 +0000 (10:56 +0000)]
[X86][SSE] Add X86ISD::FRCP handling to isNegatibleForFree
Peek through X86ISD::FRCP nodes to see if there is a negatible input.
Simon Pilgrim [Sat, 8 Feb 2020 10:40:49 +0000 (10:40 +0000)]
[X86][SSE] Show isNegatibleForFree inability to peek through X86ISD::FRCP
We can safely negate the input of RCP but we can't peek through it.
Simon Pilgrim [Sat, 8 Feb 2020 08:55:51 +0000 (08:55 +0000)]
[TargetLowering] Remove isDesirableToCombineBuildVectorToShuffleTruncate target hook. NFC.
This hasn't been used for years, its original implementation, D35700, had bugs that caused the reversion of most of the code, and since then x86 shuffle lowering/combining has handled most cases and can deal with the rest as well.
Fangrui Song [Sat, 8 Feb 2020 07:30:26 +0000 (23:30 -0800)]
[Driver][test] Create empty file Inputs/basic_cross_linux_tree/usr/x86_64-unknown-linux-gnu/bin/ld.lld
To make lto.c and lto.cu pass for systems that do not have ld.lld
Fangrui Song [Fri, 7 Feb 2020 22:17:36 +0000 (14:17 -0800)]
[Driver] Don't pass -plugin LLVMgold.so when the linker is ld.lld
This is does not cover the case when ld is lld (e.g. /usr/bin/ld on
modern FreeBSD systems).
Fangrui Song [Sat, 8 Feb 2020 05:42:14 +0000 (21:42 -0800)]
[Driver][test] Refactor LLVMgold tests
LLVMgold.so tests are duplicated in several places. Deduplicate them.
Move the tests to lto.c and lto.cu
Specify -fuse-ld=bfd or -fuse-ld=gold.
In a future change, if -fuse-ld=lld or CLANG_DEFAULT_LINKER=lld without -fuse-ld=, we will remove -plugin /path/to/LLVMgold.so
Fangrui Song [Sat, 8 Feb 2020 06:27:22 +0000 (22:27 -0800)]
[Driver][test] Fix Driver/hexagon-toolchain-elf.c for -DCLANG_DEFAULT_LINKER=lld builds after
305bf5b21dbdb2345ef86b5700285e42d992c954
Craig Topper [Sat, 8 Feb 2020 05:33:39 +0000 (21:33 -0800)]
[LegalizeDAG][X86][AMDGPU] Use ANY_EXTEND instead of ZERO_EXTEND when promoting ISD::CTTZ/CTTZ_ZERO_UNDEF.
Summary:
For CTTZ we place a set bit just past where the non-promoted type
stopped so the extended bits won't be used for the count. For
CTTZ_ZERO_UNDEF we don't care what happens if no bits are set in
the original type and we end up counting into the extended bits.
So we can just use ANY_EXTEND for both cases.
This matches what is done in type legalization for these operations.
We make no effort to force the upper bits to zero.
Differential Revision: https://reviews.llvm.org/D74111
Akira Hatanaka [Sat, 8 Feb 2020 04:15:16 +0000 (20:15 -0800)]
[ObjC][ARC] Keep track of phis that have been discovered to avoid an
infinite loop
This fixes a bug introduced in
6770fbb31450db15d8d4a2ac7f0ce70eaf2acc5f.
rdar://problem/
59137105
Sam Clegg [Sat, 8 Feb 2020 02:20:03 +0000 (18:20 -0800)]
[WebAssembly] Fix signature of __powitf2 libcall
Add tests for @llvm.powi.f64/f128.
See: https://llvm.org/docs/LangRef.html#llvm-powi-intrinsic
Differential Revision: https://reviews.llvm.org/D74274
Jan Kratochvil [Sat, 8 Feb 2020 04:08:48 +0000 (05:08 +0100)]
Revert "[lldb] Fix+re-enable Assert StackFrame Recognizer on Linux"
This reverts commit
cf1046c716b33ed449aa8fc26376864917c63c25.
Reverted: https://reviews.llvm.org/D74252
It fixed testsuite but broke real world functionality where is not used:
settings set symbols.enable-external-lookup false
Petr Hosek [Sat, 8 Feb 2020 03:43:47 +0000 (19:43 -0800)]
Revert "[clang-doc] Improving Markdown Output"
This reverts commit
dac21fdd5923730342a4bc9abc0858fb56ff8d52 as this
is failing on Windows.
Petr Hosek [Sat, 8 Feb 2020 02:58:57 +0000 (18:58 -0800)]
[clang-doc] Improving Markdown Output
This change has two components. The moves the generated file
for a namespace to the directory named after the namespace in
a file named 'index.<format>'. This greatly improves the browsing
experience since the index page is shown by default for a directory.
The second improves the markdown output by adding the links to the
referenced pages for children objects and the link back to the source
code.
Patch By: Clayton
Differential Revision: https://reviews.llvm.org/D72954
Heejin Ahn [Fri, 7 Feb 2020 03:29:01 +0000 (19:29 -0800)]
[WebAssembly] Add debug info to insts in Emscripten SjLj
Summary:
This makes sure all newly create instructions in Emscripten SjLj has
appropriate debug info attached. Fixes
https://github.com/emscripten-core/emscripten/issues/9797.
Reviewers: kripken
Subscribers: dschuff, aprantl, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74269
Richard Smith [Sat, 8 Feb 2020 00:34:08 +0000 (16:34 -0800)]
PR12350: Handle remaining cases permitted by CWG DR 244.
Also add extension warnings for the cases that are disallowed by the
current rules for destructor name lookup, refactor and simplify the
lookup code, and improve the diagnostic quality when lookup fails.
The special case we previously supported for converting
p->N::S<int>::~S() from naming a class template into naming a
specialization thereof is subsumed by a more general rule here (which is
also consistent with Clang's historical behavior and that of other
compilers): if we can't find a suitable S in N, also look in N::S<int>.
The extension warnings are off by default, except for a warning when
lookup for p->N::S::~T() looks for T in scope instead of in N (or N::S).
That seems sufficiently heinous to warn on by default, especially since
we can't support it for a dependent nested-name-specifier.
Jonas Devlieghere [Sat, 8 Feb 2020 01:58:30 +0000 (17:58 -0800)]
[lldb/Plugin] Use LLDB_PLUGIN_DECLARE to forward declare plugin initializers
Apparently Linux and Windows have the exact opposite behavior when it
comes to inline declarations of external functions. On Linux they're
considered to be part of the lldb_private namespace, while on Windows
they're considered to be part of the top level namespace. Somehow on
macOS, it doesn't really matter and both are fine...
At this point I don't know what to do, so I'm just adding the
LLDB_PLUGIN_DECLARE macros again as originally proposed in D74245.
Jim Ingham [Sat, 8 Feb 2020 01:48:47 +0000 (17:48 -0800)]
Add a test for adding and removing Listeners from a BroadcasterManager.
Reid found a bug in removing Listeners from a BroadcasterManager:
https://reviews.llvm.org/D74010
The bug didn't affect the case where there was only one Listener
signed up for a BroadcasterManager, which was all the extant test
case tests. The driver also only uses one listener (the debugger)
for everything, so neither the test nor anything you do with lldb
command line would have triggered the bug.
This adds a couple more tests using more listeners, and adding and
removing them in a different way, which triggers a separate code path.
David Blaikie [Sat, 8 Feb 2020 01:13:32 +0000 (17:13 -0800)]
Linker/module-max-warn.ll: Fix test to be compatible with Windows file separators
Walter Erquinigo [Sat, 8 Feb 2020 00:25:09 +0000 (16:25 -0800)]
[lldb-vscode] remove deprecated trace option
Summary: This option is not used anymore and has been replaced by the env var LLDBVSCODE_LOG.
Reviewers: clayborg
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D74266
Walter Erquinigo [Sat, 8 Feb 2020 00:04:39 +0000 (16:04 -0800)]
[lldb-vscode] disable completions
Summary:
Completion requests are causing some problems in the debugger, which is explained in the comment in the code.
I'm disabling it for now until we have time to do a good implementation of it.
Reviewers: clayborg
Subscribers: lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D74264
Jonas Devlieghere [Sat, 8 Feb 2020 00:50:10 +0000 (16:50 -0800)]
[lldb/Plugin] Don't define initializers inside lldb_private
This should fix the Windows build.
Akira Hatanaka [Sat, 8 Feb 2020 00:24:18 +0000 (16:24 -0800)]
[ObjC][ARC] Delete ARC runtime calls that take inert phi values
This improves on the following patch, which removed ARC runtime calls
taking inert global variables:
https://reviews.llvm.org/D62433
rdar://problem/
59137105
David Blaikie [Thu, 6 Feb 2020 22:37:23 +0000 (14:37 -0800)]
IR Linking: Support merging Warning+Max module metadata flags
Summary:
Debug Info Version was changed to use "Max" instead of "Warning" per the
original design intent - but this maxes old/new IR unlinkable, since
mismatched merge styles are a linking failure.
It seems possible/maybe reasonable to actually support the combination
of these two flags: Warn, but then use the maximum value rather than the
first value/earlier module's value.
Reviewers: tejohnson
Differential Revision: https://reviews.llvm.org/D74257
Amara Emerson [Fri, 7 Feb 2020 18:10:43 +0000 (10:10 -0800)]
[GlobalISel][CallLowering] Look through bitcasts from constant function pointers.
Calls to ObjC's objc_msgSend function are done by bitcasting the function global
to the required function type signature. This patch looks through this bitcast
so that we can do a direct call with bl on arm64 instead of using an indirect blr.
Differential Revision: https://reviews.llvm.org/D74241
Jonas Devlieghere [Fri, 7 Feb 2020 22:58:18 +0000 (14:58 -0800)]
[lldb/Plugins] Use external functions to (de)initialize plugins
This is a step towards making the initialize and terminate calls be
generated by CMake, which in turn is towards making it possible to
disable plugins at configuration time.
Differential revision: https://reviews.llvm.org/D74245
Craig Topper [Fri, 7 Feb 2020 23:04:22 +0000 (15:04 -0800)]
[X86] Correct the implementation of the avx512 masked fmsubadd autoupgrade code to not leave the negate unconnected.
This was causing us to generate fmaddsub instead of fmsubadd if
rounding control is not 4.
Craig Topper [Fri, 7 Feb 2020 23:01:18 +0000 (15:01 -0800)]
[X86] Add more avx512 masked fmaddsub/fmsubadd autoupgrade tests with rounding control not set to 4.
The fmsubadd upgrade doesn't insert the negate properly when the
rounding control isn't 4.
Jordan Rupprecht [Fri, 7 Feb 2020 23:13:38 +0000 (15:13 -0800)]
[lldb][test][NFC] Create a separate LLDB_TEST_SRC var to allow moving tests.
Summary:
This creates a separate LLDB_TEST_SRC var to match the existing LLDB_TEST var. LLDB_TEST points to the test framework, LLDB_TEST_SRC points to the tests themselves.
The var points to the same place, but a future patch will move the tree + update var.
Reviewers: labath, JDevlieghere
Reviewed By: labath
Subscribers: merge_guards_bot, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D71150
Jonas Devlieghere [Fri, 7 Feb 2020 23:12:05 +0000 (15:12 -0800)]
[CMake] Fix accidentally inverted condition
I unintentionally inverted the condition for excluding the tests from
check-all.
Adrian Prantl [Fri, 7 Feb 2020 23:09:44 +0000 (15:09 -0800)]
Replace CHECK-NEXT with CHECK-DAG. The order isn't relevant we just
want to make sure that all are present.
Guillaume Chatelet [Tue, 28 Jan 2020 12:01:19 +0000 (13:01 +0100)]
[clang] Add support for __builtin_memcpy_inline
Summary: This is a follow up on D61634 and the last step to implement http://lists.llvm.org/pipermail/llvm-dev/2019-April/131973.html
Reviewers: efriedma, courbet, tejohnson
Subscribers: hiraditya, cfe-commits, llvm-commits, jdoerfert, t.p.northover
Tags: #clang, #llvm
Differential Revision: https://reviews.llvm.org/D73543
Erik Pilkington [Fri, 7 Feb 2020 17:37:15 +0000 (09:37 -0800)]
[IRGen] Emit lifetime intrinsics around temporary aggregate argument allocas
These temporaries are only used in the callee, and their memory can be reused
after the call is complete.
rdar://
58552124
Differential revision: https://reviews.llvm.org/D74094
Davide Italiano [Fri, 7 Feb 2020 22:32:12 +0000 (14:32 -0800)]
Revert "[TestConvienceVariable] Clean the directory before running the test."
This reverts commit
9bce9d2d65e2462140597f71a8247750b837094c, as
it breaks the bots.
Jason Molenda [Fri, 7 Feb 2020 22:31:35 +0000 (14:31 -0800)]
Change first test to be CHECK: to make the test run.
Huihui Zhang [Fri, 7 Feb 2020 22:05:52 +0000 (14:05 -0800)]
Reland "[AMDGPU] Fix data race on RegisterBank initialization."
River Riddle [Fri, 7 Feb 2020 22:11:30 +0000 (14:11 -0800)]
[mlir][Pass] Enable printing pass options as part of `-help`.
Summary:
This revision adds support for printing pass options as part of the normal help description. This also moves registered passes and pipelines into different sections of the help.
Example:
```
Compiler passes to run
--pass-pipeline - ...
Passes:
--affine-data-copy-generate - ...
--convert-gpu-to-spirv - ...
--workgroup-size=<long> - ...
--test-options-pass - ...
--list=<int> - ...
--string=<string> - ...
--string-list=<string> - ...
Pass Pipelines:
--test-options-pass-pipeline - ...
--list=<int> - ...
--string=<string> - ...
--string-list=<string> - ...
```
Differential Revision: https://reviews.llvm.org/D74246
Huihui Zhang [Fri, 7 Feb 2020 22:00:44 +0000 (14:00 -0800)]
Reland "[ARM] Fix data race on RegisterBank initialization."
Update lambda function
static auto InitializeRegisterBankOnce = [this](const auto &TRI) {
with
static auto InitializeRegisterBankOnce = [&]() {
Capture reference instead of passing argument, as there are buildbot
compiling errors related when passing argument.
Davide Italiano [Fri, 7 Feb 2020 21:51:58 +0000 (13:51 -0800)]
[TestConvienceVariable] Clean the directory before running the test.
Petr Hosek [Thu, 6 Feb 2020 03:37:50 +0000 (19:37 -0800)]
[CMake] Use LLVM tools external project build where possible
This reduces the reliance on host tools and makes the build more
hermetic. Some of the runtimes already assume that certain tools are
always available, for example libc++ and libc++abi archive merging
relies on ar to extract files out of the archive, even on Darwin.
Differential Revision: https://reviews.llvm.org/D74107
natashaknk [Fri, 7 Feb 2020 21:35:36 +0000 (16:35 -0500)]
[mlir][spirv] Adding sin op in the GLSL extension
Differential Revision: https://reviews.llvm.org/D74151
Jan Kratochvil [Fri, 7 Feb 2020 21:23:09 +0000 (22:23 +0100)]
[lldb] Fix+re-enable Assert StackFrame Recognizer on Linux
D73303 was failing on Fedora Linux and so it was disabled by Skip the
AssertFrameRecognizer test for Linux.
On Fedora 30 x86_64 I have:
$ readelf -Ws /lib64/libc.so.6 |grep '^Symbol\|.*assert_fail'
Symbol table '.dynsym' contains 2362 entries:
630:
0000000000030520 70 FUNC GLOBAL DEFAULT 14 __assert_fail@@GLIBC_2.2.5
Symbol table '.symtab' contains 22711 entries:
922:
000000000002275a 15 FUNC LOCAL DEFAULT 14 __assert_fail_base.cold
18044:
0000000000030520 70 FUNC LOCAL DEFAULT 14 __GI___assert_fail
20081:
00000000000303a0 370 FUNC LOCAL DEFAULT 14 __assert_fail_base
21766:
0000000000030520 70 FUNC GLOBAL DEFAULT 14 __assert_fail
The patch should never expect __GI___assert_fail:
.symtab can be present or not but that should not change that
__assert_fail always wins - it is always present from .dynsym and it can
never be overriden by __GI___assert_fail as __GI___assert_fail has only
local binding. Global binding is preferred since D63540.
External debug info symbols do not matter since D55859 (and DWARF should
never be embedded in system libc.so.6).
Differential Revision: https://reviews.llvm.org/D74252
Huihui Zhang [Fri, 7 Feb 2020 20:57:24 +0000 (12:57 -0800)]
Reland "[AArch64] Fix data race on RegisterBank initialization."
Update lambda function
static auto InitializeRegisterBankOnce = [this](const auto &TRI) {
with
static auto InitializeRegisterBankOnce = [&]() {
Capture reference instead of passing argument, as there are buildbot
compiling errors related when passing argument.
Nicolas Vasilache [Fri, 7 Feb 2020 20:39:43 +0000 (15:39 -0500)]
[mlir][VectorOps] Introduce a `vector.fma` op that works on n-D vectors and lowers to `llvm.intrin.fmuladd`
Summary:
The `vector.fma` operation is portable enough across targets that we do not want
to keep it wrapped under `vector.outerproduct` and `llvm.intrin.fmuladd`.
This revision lifts the op into the vector dialect and implements the lowering to LLVM by using two patterns:
1. a pattern that lowers from n-D to (n-1)-D by unrolling when n > 2
2. a pattern that converts from 1-D to the proper LLVM representation
Reviewers: ftynse, stellaraccident, aartbik, dcaballe, jsetoain, tetuante
Reviewed By: aartbik
Subscribers: fhahn, dcaballe, merge_guards_bot, mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, Joonsoo, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74075
Nemanja Ivanovic [Fri, 7 Feb 2020 20:26:11 +0000 (14:26 -0600)]
[PowerPC] Fix spilling of vector registers in PEI of EH aware functions
On little endian targets prior to Power9, we spill vector registers using a
swapping store (i.e. stdxvd2x saves the vector with the two doublewords in
big endian order regardless of endianness). This is generally not a problem
since we restore them using the corresponding swapping load (lxvd2x). However
if the restore is done by the unwinder, the vector register contains data in
the incorrect order.
This patch fixes that by using Altivec loads/stores for vector saves and
restores in PEI (which keep the order correct) under those specific conditions:
- EH aware function
- Subtarget requires swaps for VSX memops (Little Endian prior to Power9)
Differential revision: https://reviews.llvm.org/D73692
Nicolas Vasilache [Fri, 7 Feb 2020 20:22:06 +0000 (15:22 -0500)]
[mlir][VectorOps] Expose and use llvm.intrin.fma*
Summary:
This revision exposes the portable `llvm.fma` intrinsic in LLVMOps and uses it
in lieu of `llvm.fmuladd` when lowering the `vector.outerproduct` op to LLVM.
This guarantees proper `fma` instructions will be emitted if the target ISA
supports it.
`llvm.fmuladd` does not have this guarantee in its semantics, despite evidence
that the proper x86 instructions are emitted.
For more details, see https://llvm.org/docs/LangRef.html#llvm-fmuladd-intrinsic.
Reviewers: ftynse, aartbik, dcaballe, fhahn
Reviewed By: aartbik
Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74219
Alexey Bataev [Fri, 7 Feb 2020 17:22:23 +0000 (12:22 -0500)]
[OPENMP50]Add codegen for acq_rel clause in atomic|flush directives.
Added codegen support for atomic|flush directives with acq_rel clause.
Sourabh Singh Tomar [Fri, 7 Feb 2020 19:54:04 +0000 (01:24 +0530)]
[DebugInfo]: Fix the debuginfo-tests/llgdb-tests/apple-accel.cpp test
failure after 84e5760.
Richard Smith [Fri, 7 Feb 2020 19:53:54 +0000 (11:53 -0800)]
[cxx_status] Fix status of P1766R to not bleed into adjacent cells.
Nico Weber [Fri, 7 Feb 2020 19:49:38 +0000 (14:49 -0500)]
Revert "Support -fstack-clash-protection for x86"
This reverts commit
4a1a0690ad6813a4c8cdb8dc20ea6337aa1f61e0.
Breaks tests on mac and win, see https://reviews.llvm.org/D68720
Richard Smith [Thu, 6 Feb 2020 02:52:38 +0000 (18:52 -0800)]
Implement P1766R1: diagnose giving non-C-compatible classes a typedef name for linkage purposes.
Summary:
Due to a recent (but retroactive) C++ rule change, only sufficiently
C-compatible classes are permitted to be given a typedef name for
linkage purposes. Add an enabled-by-default warning for these cases, and
rephrase our existing error for the case where we encounter the typedef
name for linkage after we've already computed and used a wrong linkage
in terms of the new rule.
Reviewers: rjmccall
Subscribers: cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D74103
Changpeng Fang [Fri, 7 Feb 2020 19:46:23 +0000 (11:46 -0800)]
AMDGPU: Enhancement on FDIV lowering in AMDGPUCodeGenPrepare
Summary:
The accuracy limit to use rcp is adjusted to 1.0 ulp from 2.5 ulp.
Also, afn instead of arcp is used to allow inaccurate rcp to be used.
Reviewers:
arsenm
Differential Revision: https://reviews.llvm.org/D73588
Fangrui Song [Thu, 6 Feb 2020 22:48:28 +0000 (14:48 -0800)]
[dsymutil] Delete unneeded parameter Triple from DWARFLinker
Reviewed By: JDevlieghere
Differential Revision: https://reviews.llvm.org/D74173
Vladimir Vereschaka [Fri, 7 Feb 2020 18:48:33 +0000 (10:48 -0800)]
Revert "[CMake] Filter libc++abi and libunwind from runtimes build in MSVC"
This reverts commit
9986b88e64f30f5d958eef113bae4c8a098eea93.
These changes break ARM/Aarch64 cross builders on Windows platform
* http://lab.llvm.org:8011/builders/llvm-clang-win-x-armv7l
* http://lab.llvm.org:8011/builders/llvm-clang-win-x-aarch64
suppressing building libc++abi/libunwind by "just built" toolchain.
Differential Revision: https://reviews.llvm.org/D73812
Kostya Kortchinsky [Thu, 6 Feb 2020 23:46:05 +0000 (15:46 -0800)]
[scudo][standalone] 32-bit improvement
Summary:
This tweaks some behaviors of the allocator wrt 32-bit, notably
tailoring the size-class map.
I had to remove a `printStats` from `__scudo_print_stats` since when
within Bionic they share the same slot so they can't coexist at the
same time. I have to find a solution for that later, but right now we
are not using the Svelte configuration.
Reviewers: rengolin
Subscribers: #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D74178
Jessica Paquette [Fri, 7 Feb 2020 17:07:47 +0000 (09:07 -0800)]
[AArch64][GlobalISel] Reland SLT/SGT TBNZ optimization
The issue in the previous commits was that we swap the LHS and RHS while
looking for the constant. In SLT/SGT, the constant must be on the RHS, or the
optimization is invalid.
Move the swapping logic after the check for the SLT/SGT case and update tests.
Original commits:
d78cefb1601070cb028b61bbc1bd6f25a9c1837c
a3738414072900ace9cbbe209d0195a3443d1d54
Changpeng Fang [Fri, 7 Feb 2020 19:06:33 +0000 (11:06 -0800)]
AMDGPU: Limit the search in finding the instruction pattern for v_swap generation.
Summary:
Current implementation of matchSwap in SIShrinkInstructions searches the entire
use_nodbg_operands set to find the possible pattern to generate v_swap instruction.
This approach will lead to a O(N^3) in compile time for SIShrinkInstructions.
But in reality, the matching pattern only exists within nearby instructions in the
same basic block. This work limits the search to a maximum of 16 instructions, and has
a linear compile time comsumption.
Reviewers:
rampitec, arsenm
Differential Revision: https://reviews.llvm.org/D74180
serge_sans_paille [Mon, 9 Sep 2019 14:59:34 +0000 (16:59 +0200)]
Support -fstack-clash-protection for x86
Implement protection against the stack clash attack [0] through inline stack
probing.
Probe stack allocation every PAGE_SIZE during frame lowering or dynamic
allocation to make sure the page guard, if any, is touched when touching the
stack, in a similar manner to GCC[1].
This extends the existing `probe-stack' mechanism with a special value `inline-asm'.
Technically the former uses function call before stack allocation while this
patch provides inlined stack probes and chunk allocation.
Only implemented for x86.
[0] https://www.qualys.com/2017/06/19/stack-clash/stack-clash.txt
[1] https://gcc.gnu.org/ml/gcc-patches/2017-07/msg00556.html
This a recommit of
39f50da2a357a8f685b3540246c5d762734e035f with correct option
flags set.
Differential Revision: https://reviews.llvm.org/D68720
MaheshRavishankar [Fri, 7 Feb 2020 18:28:20 +0000 (10:28 -0800)]
[mlir][Linalg] Implement fusion of linalg.generic operation on tensors.
The initial implementation of the fusion operation exposes a method to
fuse a consumer with its producer, when
- both the producer and consumer operate on tensors
- the producer has only a single result value
- the producer has only "parallel" iterator types
A new interface method hasTensorSemantics is added to verify that an
operation has all operands and results of type RankedTensorType.
Differential Revision: https://reviews.llvm.org/D74172
Sean Fertile [Mon, 27 Jan 2020 20:21:19 +0000 (15:21 -0500)]
[PowerPC] Create a FixedStack object for CR save in linkage area.
hasReservedSpillSlot returns a dummy frame index of '0' on PPC64 for the
non-volatile condition registers, which leads to the CalleSavedInfo
either referencing an unrelated stack object, or an invalid object if
there are no stack objects. The latter case causes the mir-printer to
crash due to assertions that checks if the frame index referenced by a
CalleeSavedInfo is valid.
To fix the problem create an immutable FixedStack object at the correct offset
in the linkage area of the previous stack frame (ie SP + positive offset).
Differential Revision: https://reviews.llvm.org/D73709
Craig Topper [Fri, 7 Feb 2020 18:18:01 +0000 (10:18 -0800)]
[X86] Handle SETB_C32r/SETB_C64r in flag copy lowering the same way we handle SBB
Previously we took the restored flag in a GPR, extended it 32 or 64 bits. Then used as an input to a sub from 0. This requires creating a zero extend and creating a 0.
This patch changes this to just use an ADD with 255 to restore the carry flag and keep the SETB_C32r/SETB_C64r. Exactly like we handle SBB which is what SETB becomes.
Differential Revision: https://reviews.llvm.org/D74152
Jay Foad [Fri, 7 Feb 2020 17:05:48 +0000 (17:05 +0000)]
[AMDGPU] Use @LINE for error checking in gfx10 assembler tests
Summary:
This is a rework of D72611, using @LINE to check that errors are
reported against the right instruction instead of adding lots of extra
*-ERR-NEXT: check lines.
Reviewers: rampitec, arsenm, nhaehnle
Subscribers: kzhuravl, jvesely, wdng, yaxunl, dstuttard, tpr, t-tye, kerbowa, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D74227
Michael Liao [Fri, 7 Feb 2020 17:58:17 +0000 (12:58 -0500)]
[clang] Fix linkage of nested lambdas.
patch from Philippe Daouadi <blastrock@free.fr>
This is an attempt to fix
[PR#44368](https://bugs.llvm.org/show_bug.cgi?id=44368)
This effectively reverts [D1783](https://reviews.llvm.org/D1783). It
doesn't break the current tests and fixes the test that this commit
adds.
We now decide of a lambda linkage only depending on the visibility of
its parent context.
Differential Revision: https://reviews.llvm.org/D73701
Matt Arsenault [Fri, 7 Feb 2020 15:34:13 +0000 (10:34 -0500)]
AMDGPU/GlobalISel: Fix missing test for select of s64 scalar G_CTPOP
Vedant Kumar [Thu, 6 Feb 2020 21:14:27 +0000 (13:14 -0800)]
[MachineInstr] Add isCandidateForCallSiteEntry predicate
Add the isCandidateForCallSiteEntry predicate to MachineInstr to
determine whether a DWARF call site entry should be created for an
instruction.
For now, it's enough to have any call instruction that doesn't belong to
a blacklisted set of opcodes. For these opcodes, a call site entry isn't
meaningful.
Differential Revision: https://reviews.llvm.org/D74159
Pavel Labath [Sun, 2 Feb 2020 07:48:51 +0000 (08:48 +0100)]
[lldb] Group ABI plugins
Summary:
There's a fair amount of code duplication between the different ABI plugins for
the same architecture (e.g. ABIMacOSX_arm & ABISysV_arm). Deduplicating this
code is not very easy at the moment because there is no good place where to put
the common code.
Instead of creating more plugins, this patch reduces their number by grouping
similar plugins into a single folder/plugin. This makes it easy to extract
common code to a (e.g.) base class, which can then live in the same folder.
The grouping is done based on the underlying llvm target for that architecture,
because the plugins already require this for their operation.
Reviewers: JDevlieghere, jasonmolenda, jfb
Subscribers: sdardis, nemanjai, mgorny, kristof.beyls, fedor.sergeev, kbarton, jrtc27, atanasyan, jsji, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D74138
Med Ismail Bennani [Fri, 7 Feb 2020 17:40:28 +0000 (18:40 +0100)]
[lldb/test] Skip the AssertFrameRecognizer test for Linux
This patch skips the AssertFrameRecognizer test for Linux since it appears to
fail on certain distributions (AFAIK Fedora & ArchLinux).
The failure happen because the thread don't set the current frame to
the most relevant one. So the stopped location doesn't match with what
the test is expecting.
The test will be enabled again after I'll be able to reproduce the failure
on one of those platform and fix the issue.
Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
Fangrui Song [Fri, 7 Feb 2020 17:43:40 +0000 (09:43 -0800)]
[ELF][ARM][test] Keep arm-thumb-interwork-shared.s
The revert of D73542 (
c29003813ab9bd6ea7b6de40ea8f1fe21979f13f) deleted
the newly added tests to arm-thumb-interwork-shared.s . We should keep
them.
Petar Avramovic [Fri, 7 Feb 2020 16:38:01 +0000 (17:38 +0100)]
[GlobalISel] Add buildMerge with SrcOp initializer list
Allows more flexible use of buildMerge in places where
use operands are available as SrcOp since it does not
require explicit conversion to Register.
Simplify code with new buildMerge.
Differential Revision: https://reviews.llvm.org/D74223