platform/upstream/llvm.git
4 years agoRevert "[lldb] Fix+re-enable Assert StackFrame Recognizer on Linux"
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

4 years agoRevert "[clang-doc] Improving Markdown Output"
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.

4 years ago[clang-doc] Improving Markdown Output
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

4 years ago[WebAssembly] Add debug info to insts in Emscripten SjLj
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

4 years agoPR12350: Handle remaining cases permitted by CWG DR 244.
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.

4 years ago[lldb/Plugin] Use LLDB_PLUGIN_DECLARE to forward declare plugin initializers
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.

4 years agoAdd a test for adding and removing Listeners from a BroadcasterManager.
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.

4 years agoLinker/module-max-warn.ll: Fix test to be compatible with Windows file separators
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

4 years ago[lldb-vscode] remove deprecated trace option
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

4 years ago[lldb-vscode] disable completions
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

4 years ago[lldb/Plugin] Don't define initializers inside lldb_private
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.

4 years ago[ObjC][ARC] Delete ARC runtime calls that take inert phi values
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

4 years agoIR Linking: Support merging Warning+Max module metadata flags
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

4 years ago[GlobalISel][CallLowering] Look through bitcasts from constant function pointers.
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

4 years ago[lldb/Plugins] Use external functions to (de)initialize plugins
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

4 years ago[X86] Correct the implementation of the avx512 masked fmsubadd autoupgrade code to...
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.

4 years ago[X86] Add more avx512 masked fmaddsub/fmsubadd autoupgrade tests with rounding contro...
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.

4 years ago[lldb][test][NFC] Create a separate LLDB_TEST_SRC var to allow moving tests.
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

4 years ago[CMake] Fix accidentally inverted condition
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.

4 years agoReplace CHECK-NEXT with CHECK-DAG. The order isn't relevant we just
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.

4 years ago[clang] Add support for __builtin_memcpy_inline
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

4 years ago[IRGen] Emit lifetime intrinsics around temporary aggregate argument allocas
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

4 years agoRevert "[TestConvienceVariable] Clean the directory before running the test."
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.

4 years agoChange first test to be CHECK: to make the test run.
Jason Molenda [Fri, 7 Feb 2020 22:31:35 +0000 (14:31 -0800)]
Change first test to be CHECK: to make the test run.

4 years agoReland "[AMDGPU] Fix data race on RegisterBank initialization."
Huihui Zhang [Fri, 7 Feb 2020 22:05:52 +0000 (14:05 -0800)]
Reland "[AMDGPU] Fix data race on RegisterBank initialization."

4 years ago[mlir][Pass] Enable printing pass options as part of `-help`.
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

4 years agoReland "[ARM] Fix data race on RegisterBank initialization."
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.

4 years ago[TestConvienceVariable] Clean the directory before running the test.
Davide Italiano [Fri, 7 Feb 2020 21:51:58 +0000 (13:51 -0800)]
[TestConvienceVariable] Clean the directory before running the test.

4 years ago[CMake] Use LLVM tools external project build where possible
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

4 years ago[mlir][spirv] Adding sin op in the GLSL extension
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

4 years ago[lldb] Fix+re-enable Assert StackFrame Recognizer on Linux
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

4 years agoReland "[AArch64] Fix data race on RegisterBank initialization."
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.

4 years ago[mlir][VectorOps] Introduce a `vector.fma` op that works on n-D vectors and lowers...
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

4 years ago[PowerPC] Fix spilling of vector registers in PEI of EH aware functions
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

4 years ago[mlir][VectorOps] Expose and use llvm.intrin.fma*
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

4 years ago[OPENMP50]Add codegen for acq_rel clause in atomic|flush directives.
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.

4 years ago[DebugInfo]: Fix the debuginfo-tests/llgdb-tests/apple-accel.cpp test
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.

4 years ago[cxx_status] Fix status of P1766R to not bleed into adjacent cells.
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.

4 years agoRevert "Support -fstack-clash-protection for x86"
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

4 years agoImplement P1766R1: diagnose giving non-C-compatible classes a typedef name for linkag...
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

4 years agoAMDGPU: Enhancement on FDIV lowering in AMDGPUCodeGenPrepare
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

4 years ago[dsymutil] Delete unneeded parameter Triple from DWARFLinker
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

4 years agoRevert "[CMake] Filter libc++abi and libunwind from runtimes build in MSVC"
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

4 years ago[scudo][standalone] 32-bit improvement
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

4 years ago[AArch64][GlobalISel] Reland SLT/SGT TBNZ optimization
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

4 years agoAMDGPU: Limit the search in finding the instruction pattern for v_swap generation.
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

4 years agoSupport -fstack-clash-protection for x86
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

4 years ago[mlir][Linalg] Implement fusion of linalg.generic operation on tensors.
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

4 years ago[PowerPC] Create a FixedStack object for CR save in linkage area.
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

4 years ago[X86] Handle SETB_C32r/SETB_C64r in flag copy lowering the same way we handle SBB
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

4 years ago[AMDGPU] Use @LINE for error checking in gfx10 assembler tests
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

4 years ago[clang] Fix linkage of nested lambdas.
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

4 years agoAMDGPU/GlobalISel: Fix missing test for select of s64 scalar G_CTPOP
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

4 years ago[MachineInstr] Add isCandidateForCallSiteEntry predicate
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

4 years ago[lldb] Group ABI plugins
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

4 years ago[lldb/test] Skip the AssertFrameRecognizer test for Linux
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>
4 years ago[ELF][ARM][test] Keep arm-thumb-interwork-shared.s
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.

4 years ago[GlobalISel] Add buildMerge with SrcOp initializer list
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

4 years ago[yaml2obj][test] Simplify some e_machine EI_CLASS EI_DATA tests
Fangrui Song [Sat, 1 Feb 2020 06:25:16 +0000 (22:25 -0800)]
[yaml2obj][test] Simplify some e_machine EI_CLASS EI_DATA tests

When both little-endian and big-endian are tested, or both 32-bit and 64-bit are tested, use a template like the following with `-D BITS=32 -D ENCODE=LSB`

```
--- !ELF
FileHeader:
 Class:   ELFCLASS[[BITS]]
 Data:    ELFDATA2[[ENCODE]]
 Type:    ET_DYN
 Machine: EM_X86_64
```

Reviewed By: grimar, jhenderson

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

4 years ago[yaml2obj] Add -D k=v to preprocess the input YAML
Fangrui Song [Mon, 3 Feb 2020 19:12:04 +0000 (11:12 -0800)]
[yaml2obj] Add -D k=v to preprocess the input YAML

Examples:

```
yaml2obj -D MACHINE=EM_386 a.yaml -o a.o
yaml2obj -D MACHINE=0x1234 a.yaml -o a.o
```

where a.yaml contains:

```
--- !ELF
FileHeader:
  Class:   ELFCLASS64
  Data:    ELFDATA2MSB
  Type:    ET_REL
  Machine: [[MACHINE]]
```

Reviewed By: grimar, jhenderson

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

4 years ago[mlir][VectorOps] Generalized vector.print to i32/i64
aartbik [Fri, 7 Feb 2020 17:09:05 +0000 (09:09 -0800)]
[mlir][VectorOps] Generalized vector.print to i32/i64

Summary:
Lowering to LLVM IR was restricted to float/double.
This CL also adds the integral values.

Reviewers: andydavis1, nicolasvasilache, ftynse

Reviewed By: nicolasvasilache, ftynse

Subscribers: mehdi_amini, rriddle, jpienaar, burmako, shauheen, antiagainst, nicolasvasilache, arpith-jacob, mgester, lucyrfox, liufengdb, Joonsoo, llvm-commits

Tags: #llvm

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

4 years ago[lldb] Delete ValueObjectRegisterContext class
Pavel Labath [Thu, 6 Feb 2020 22:47:56 +0000 (14:47 -0800)]
[lldb] Delete ValueObjectRegisterContext class

It is unused.

4 years ago[x86] don't create an unused constant vector
Sanjay Patel [Fri, 7 Feb 2020 16:49:36 +0000 (11:49 -0500)]
[x86] don't create an unused constant vector

Noticed while scanning through debug spew. Creating unused
nodes is inefficient and makes following the debug output harder.

4 years ago[X86] isNegatibleForFree - allow pre-legalized FMA negation
Simon Pilgrim [Fri, 7 Feb 2020 16:38:24 +0000 (16:38 +0000)]
[X86] isNegatibleForFree - allow pre-legalized FMA negation

As long as the FMA operation is legal (which we can proxy for the FMA3/FMA4 variants as well), we don't have to wait for the LegalOperations stage.

4 years ago[GlobalISel][IRTranslator] Add special case support for ~memory inline asm clobber.
Amara Emerson [Fri, 7 Feb 2020 09:07:57 +0000 (01:07 -0800)]
[GlobalISel][IRTranslator] Add special case support for ~memory inline asm clobber.

This is a one off special case, since actually implementing full inline asm
support will be much more involved. This lets us compile a lot more code as a
common simple case.

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

4 years ago[lldb] Improve debugging 32-bit programs on NetBSD/amd64
Michał Górny [Sun, 12 Jan 2020 21:49:36 +0000 (22:49 +0100)]
[lldb] Improve debugging 32-bit programs on NetBSD/amd64

Implement detection of ELF binary format, and support for i386 register
context on amd64 when a 32-bit executable is being debugged.  This is
roughly based on the code from Linux.

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

4 years ago[lldb/test] Prevent TestFrameRecognizer.py to fail because of internal recognizers...
Med Ismail Bennani [Fri, 7 Feb 2020 16:28:34 +0000 (17:28 +0100)]
[lldb/test] Prevent TestFrameRecognizer.py to fail because of internal recognizers (NFC)

By clearing the recognizers before starting the test, we ensure that the
recognizers that get initialized when lldb starts won't alter the
expected results of this test (i.e. recognizer index).

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
4 years ago[lldb/Target] Fix `frame recognizer list` crash when registered with nullptr
Med Ismail Bennani [Fri, 7 Feb 2020 15:33:33 +0000 (16:33 +0100)]
[lldb/Target] Fix `frame recognizer list` crash when registered with nullptr

One way to register a recognizer is to use RegularExpressionSP for the
module and symbol.

In order to match a symbol regardless of the module, the recognizer can
be registered with a nullptr for the module. However, this cause the
frame recognizer list command to crash because it calls
RegularExpression::GetText without checking if the shared pointer is valid.

This patch adds checks for the symbol and module RegularExpressionSP.

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

Signed-off-by: Med Ismail Bennani <medismail.bennani@gmail.com>
4 years ago[docs] update mathjax path in doxygen
Nuno Lopes [Fri, 7 Feb 2020 16:26:35 +0000 (16:26 +0000)]
[docs] update mathjax path in doxygen

4 years ago[AsmPrinter] Print FP constant in hexadecimal form instead
Jinsong Ji [Thu, 6 Feb 2020 16:12:10 +0000 (16:12 +0000)]
[AsmPrinter] Print FP constant in hexadecimal form instead

Printing floating point number in decimal is inconvenient for humans.
Verbose asm output will print out floating point values in comments, it
helps.

But in lots of cases, users still need additional work to covert the
decimal back to hex or binary to check the bit patterns,
especially when there are small precision difference.

Hexadecimal form is one of the supported form in LLVM IR, and easier for
debugging.

This patch try to print all FP constant in hex form instead.

Reviewed By: RKSimon

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

4 years ago[llvm-exegesis] Improve error reporting in BenchmarkRunner.cpp
Miloš Stojanović [Fri, 7 Feb 2020 12:45:10 +0000 (13:45 +0100)]
[llvm-exegesis] Improve error reporting in BenchmarkRunner.cpp

Followup to D74085.
Replace the use of `report_fatal_error()` with returning the error to
`llvm-exegesis.cpp` and handling it there.
To facilitate this, a new `Error` type has been added which is only used
to log errors to the yaml output.

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

4 years agoAMDGPU/GlobalISel: Fix move s.buffer.load to VALU
Matt Arsenault [Sat, 1 Feb 2020 03:22:00 +0000 (22:22 -0500)]
AMDGPU/GlobalISel: Fix move s.buffer.load to VALU

We were executing this in a waterfall loop as a placeholder, but this
should really be converted to a MUBUF load. Also execute in a
waterfall loop if the resource isn't an SGPR. This is a case where the
DAG handling was wrong because doing the right thing was too hard.

Currently, this will mishandle 96-bit loads. There's currently no way
to track the original memory size with an MMO, so these loads will be
widened andd the resulting memory size will be 128-bits.

4 years ago[TableGen] Fix spurious type error in bit assignment.
Simon Tatham [Fri, 7 Feb 2020 14:59:00 +0000 (14:59 +0000)]
[TableGen] Fix spurious type error in bit assignment.

Summary:
The following example gives the error message "expected value of type
'bits<32>', got 'bit'" on the assignment.

    class Instruction { bits<32> encoding; }
    def foo: Instruction { let encoding{10} = !eq(0, 1); }

But there's nothing wrong with this code: 'bit' is a perfectly good
type for the RHS of an assignment to a //single bit// of an
instruction encoding.

The problem is that `ParseBodyItem` is accidentally type-checking the
RHS against the full type of the `encoding` field, without adjusting
it in the case where we're only assigning to a subset of the bits. The
fix is trivial.

Reviewers: nhaehnle, hfinkel

Reviewed By: hfinkel

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years agoGlobalISel: Fix narrowing of G_CTPOP
Matt Arsenault [Fri, 7 Feb 2020 03:29:23 +0000 (22:29 -0500)]
GlobalISel: Fix narrowing of G_CTPOP

The result type is separate from the source type. Tests will be
included in a future AMDGPU patch which uses this from
RegBankSelect/applyMappingImpl.

4 years agoGlobalISel: Fix lowering of G_CTLZ/G_CTTZ
Matt Arsenault [Fri, 7 Feb 2020 02:11:52 +0000 (21:11 -0500)]
GlobalISel: Fix lowering of G_CTLZ/G_CTTZ

The type passed to lower was invalid, so I'm not sure how this was
even working before. The source and destination type also do not have
to match, so make sure to use the right ones.

4 years agoRe-land "[Clang][Driver] Remove -M group options ..." and "[Clang] Avoid crashing...
Alexandre Ganea [Fri, 7 Feb 2020 14:35:51 +0000 (09:35 -0500)]
Re-land "[Clang][Driver] Remove -M group options ..." and "[Clang] Avoid crashing when generating crash diagnostics when '#pragma clang __debug ..."

This re-lands commits f41ec709d9d388dc43469e6ac7f51b6313f7e4af (https://reviews.llvm.org/D74076)
and commit 5fedc2b410853a6aef05e8edf19ebfc4e071e28f (https://reviews.llvm.org/D74070)

The previous build break was caused by '#pragma clang __debug llvm_unreachable' used in a non-assert build. Move it to a separate test in crash-report-with-asserts.c.

4 years ago[OPENMP50]Add parsing/sema for acq_rel clause.
Alexey Bataev [Thu, 6 Feb 2020 21:30:23 +0000 (16:30 -0500)]
[OPENMP50]Add parsing/sema for acq_rel clause.

Added basic support (representation + parsing/sema/(de)serialization)
for acq_rel clause in flush/atomic directives.

4 years ago[NFC][ARM] Update test
Sam Parker [Fri, 7 Feb 2020 14:19:34 +0000 (14:19 +0000)]
[NFC][ARM] Update test

4 years ago[mlir] Add NoSideEffect to Affine min max
OuHangKresnik [Fri, 7 Feb 2020 14:18:55 +0000 (15:18 +0100)]
[mlir] Add NoSideEffect to Affine min max

Add NoSideEffect to Affine min and max operations.

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

4 years agoRevert "[LLD][ELF][ARM] Do not substitute BL/BLX for non STT_FUNC symbols."
Nico Weber [Fri, 7 Feb 2020 13:38:12 +0000 (08:38 -0500)]
Revert "[LLD][ELF][ARM] Do not substitute BL/BLX for non STT_FUNC symbols."

There are still problems after the fix in
"[ELF][ARM] Fix regression of BL->BLX substitution after D73542"
so let's revert to get trunk back to green while we investigate.
See https://reviews.llvm.org/D73542

This reverts commit 5461fa2b1fcfcfcd8e28e3ac3383d2245d5d90bf.
This reverts commit 0b4a047bfbd11fe1f5abda8da0e2391c1918162a.

4 years ago[NFC][ARM] Modified test with update script
Sam Parker [Fri, 7 Feb 2020 13:31:45 +0000 (13:31 +0000)]
[NFC][ARM] Modified test with update script

4 years ago[gn build] Port 446268a2234
LLVM GN Syncbot [Fri, 7 Feb 2020 13:35:48 +0000 (13:35 +0000)]
[gn build] Port 446268a2234

4 years agoRecommit: "[llvm-exegesis] Improve error reporting in Target.cpp"
Miloš Stojanović [Thu, 6 Feb 2020 17:21:01 +0000 (18:21 +0100)]
Recommit: "[llvm-exegesis] Improve error reporting in Target.cpp"

Summary: Commit 141915963b6ab36ee4e577d1b27673fa4d05b409 was reverted in
abe01e17f648a97666d4fbed41f0861686a17972 because it broke builds testing
without libpfm. A preparatory commit <commit_sha1> was added to enable
this recommit.

Original commit message:

Followup to D74085.
Replace the use of `report_fatal_error()` with returning the error to
`llvm-exegesis.cpp` and handling it there.

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

4 years agoRecommit: "[llvm-exegesis] Improve error reporting"
Miloš Stojanović [Thu, 6 Feb 2020 16:18:42 +0000 (17:18 +0100)]
Recommit: "[llvm-exegesis] Improve error reporting"

Summary: Commit b3576f60ebc8f660afad8120a72473be47517573 was reverted in
abe01e17f648a97666d4fbed41f0861686a17972 because it broke builds testing
without libpfm. A preparatory commit <commit_sha1> was added to enable
this recommit.

Original commit message:

Fix inconsistencies in error reporting created by mixing
`report_fatal_error()` and `ExitOnErr()`, and add additional information
to the error message to make it more user friendly. Minimize the use
`report_fatal_error()` because it's meant for use in very rare cases and
it results in low information density of the error messages.

Summary of the new design:

 * For command line argument errors output `llvm-exegesis: <error_message>`,
   which is consistent with the error output format emitted by the backend
   which checks correctness of the command line arguments.
 * For other errors the format `llvm-exegesis error: <error_message>` is used.
 ** If the error occurred during file access `<error_message>` will have
    of two parts: `'<file_name>': <rest_of_the_error_message>`

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

4 years ago[llvm-exegesis] Add a custom error for clustering
Miloš Stojanović [Thu, 6 Feb 2020 16:08:05 +0000 (17:08 +0100)]
[llvm-exegesis] Add a custom error for clustering

All errors of type `Failure` are `StringError`s. In order for exit code
mapping to detect that specifically a clustering error has occurred it
needs to have a different type.

This patch also prepares D74085 where termination `report_fatal_error()`
will be replaced with emitting `StringError`s.

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

4 years ago[AMDGPU][MC][DOC] Updated AMD GPU assembler syntax description.
Dmitry Preobrazhensky [Fri, 7 Feb 2020 13:20:37 +0000 (16:20 +0300)]
[AMDGPU][MC][DOC] Updated AMD GPU assembler syntax description.

Summary of changes:
- updated description of gfx906 and gfx908;
- added description of gfx1011 and gfx1012 subtargets.

4 years agoRename prettyprinters test to llvm-support.
Christian Sigg [Fri, 31 Jan 2020 11:19:36 +0000 (12:19 +0100)]
Rename prettyprinters test to llvm-support.

Summary: Make room for mlir-support pretty printers that I would like to add next.

Reviewers: dblaikie

Reviewed By: dblaikie

Subscribers: merge_guards_bot, mgorny, rriddle, llvm-commits

Tags: #llvm

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

4 years ago[lldb] Improve error message when running static initializers in an expression fails
Raphael Isemann [Fri, 7 Feb 2020 12:24:56 +0000 (13:24 +0100)]
[lldb] Improve error message when running static initializers in an expression fails

4 years ago[AArch64] Predictably disassemble system registers with the same encoding
Momchil Velikov [Fri, 7 Feb 2020 11:38:46 +0000 (11:38 +0000)]
[AArch64] Predictably disassemble system registers with the same encoding

The registers TRCEXTINSELR and TRCEXTINSELR0 are distinct registers,
defined by separate extension specifications (ETM and ETE,
respectively), yet they use the same encoding in MSR/MRS.

When performing a system register lookup by encoding, we would
essentially return a random one, depending on the number, relative
position in the TableGen file, whether the TableGen records for system
registers are named or not, and, if they are named, depending on
record (not register!) name as well.

This patch works around the issue by explictly checking for the
TRCEXTINSELR/TRCEXTINSELR0 encoding and always returning TRCEXTINSELR.

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

4 years ago[OpenCL] Restrict addr space conversions in nested pointers
Anastasia Stulova [Thu, 6 Feb 2020 11:56:21 +0000 (11:56 +0000)]
[OpenCL] Restrict addr space conversions in nested pointers

Address space conversion changes pointer representation.
This commit disallows such conversions when they are not
legal i.e. for the nested pointers even with compatible
address spaces. Because the address space conversion in
the nested levels can't be generated to modify the pointers
correctly. The behavior implemented is as follows:

- Any implicit conversions of nested pointers with different
  address spaces is rejected.
- Any conversion of address spaces in nested pointers in safe
  casts (e.g. const_cast or static_cast) is rejected.
- Conversion in low level C-style or reinterpret_cast is accepted
  but with a warning (this aligns with OpenCL C behavior).

Fixes PR39674

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

4 years agoclang-cl: Parse new MSVC flags /Qspectre-load and /Qspectre-load-cf
Hans Wennborg [Fri, 7 Feb 2020 12:00:22 +0000 (13:00 +0100)]
clang-cl: Parse new MSVC flags /Qspectre-load and /Qspectre-load-cf

See https://github.com/MicrosoftDocs/cpp-docs/commit/2fdf0ba0bf8d3875c754776ca1084654135cb710

4 years ago[llvm-dwarfdump][Stats] Add the license header
Djordje Todorovic [Fri, 7 Feb 2020 11:37:29 +0000 (12:37 +0100)]
[llvm-dwarfdump][Stats] Add the license header

Add the License header into the Statistics.cpp.

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

4 years ago[ValueTracking] usub(a, b) cannot overflow if a >= b.
Florian Hahn [Fri, 7 Feb 2020 10:31:35 +0000 (10:31 +0000)]
[ValueTracking] usub(a, b) cannot overflow if a >= b.

If we know that a >= b (unsigned), usub.with.overflow(a, b) cannot
overflow. Similarly, if b > a, the same expression overflows.

Reviewers: nikic, RKSimon, lebedev.ri, spatel

Reviewed By: nikic, Gerolf

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

4 years agoFix docs and comments for max_tokens_total pragma
Hans Wennborg [Fri, 7 Feb 2020 10:32:24 +0000 (11:32 +0100)]
Fix docs and comments for max_tokens_total pragma

4 years agoRevert "Support -fstack-clash-protection for x86"
serge-sans-paille [Fri, 7 Feb 2020 10:35:14 +0000 (11:35 +0100)]
Revert "Support -fstack-clash-protection for x86"

This reverts commit 39f50da2a357a8f685b3540246c5d762734e035f.

The -fstack-clash-protection is being passed to the linker too, which
is not intended.

Reverting and fixing that in a later commit.

4 years ago[analyzer] Small StreamChecker refactoring (NFC).
Balázs Kéri [Fri, 7 Feb 2020 08:09:45 +0000 (09:09 +0100)]
[analyzer] Small StreamChecker refactoring (NFC).

Reviewers: Szelethus

Reviewed By: Szelethus

Subscribers: xazax.hun, baloghadamsoftware, szepet, a.sidorin, mikhail.ramalho, donat.nagy, Charusso, dkrupp, Szelethus, gamesh411, cfe-commits

Tags: #clang

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

4 years ago[NFC] Introduce an API for MemOp
Guillaume Chatelet [Tue, 4 Feb 2020 14:30:05 +0000 (15:30 +0100)]
[NFC] Introduce an API for MemOp

Summary: This patch introduces an API for MemOp in order to simplify and tighten the client code.

Reviewers: courbet

Subscribers: arsenm, nemanjai, jvesely, nhaehnle, hiraditya, kbarton, jsji, kerbowa, llvm-commits

Tags: #llvm

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

4 years ago[InstCombine] Precommit usub.with.overflow test for D74066.
Florian Hahn [Wed, 5 Feb 2020 16:57:37 +0000 (16:57 +0000)]
[InstCombine] Precommit usub.with.overflow test for D74066.

4 years ago[ValueTracking] Update implied reasoning to accept expanded cmp (NFC).
Florian Hahn [Fri, 7 Feb 2020 10:08:40 +0000 (10:08 +0000)]
[ValueTracking] Update implied reasoning to accept expanded cmp (NFC).

This patch adds versions of isImpliedCondition and
isImpliedByDomCondition that take a predicate, LHS and RHS operands as
instead of a Value representing the condition.

This allows using those functions to check conditions without having a
concrete ICmp instruction.

Reviewers: nikic, RKSimon, lebedev.ri, spatel

Reviewed By: nikic

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

4 years ago[lldb] Remove all 'clean' targets from test Makefiles
Raphael Isemann [Fri, 7 Feb 2020 10:24:38 +0000 (11:24 +0100)]
[lldb] Remove all 'clean' targets from test Makefiles

Summary:
To my knowledge we don't actually use or need these rules. And if we need them then
there is probably a better way to implement this than having all these random regexes.

Reviewers: labath, JDevlieghere

Reviewed By: labath, JDevlieghere

Subscribers: jingham, lldb-commits

Tags: #lldb

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