platform/upstream/llvm.git
4 years ago[ARM][LowOverheadLoops] Update liveness info
Sam Parker [Thu, 16 Jan 2020 15:42:41 +0000 (15:42 +0000)]
[ARM][LowOverheadLoops] Update liveness info

Recommitting e93e0d413f3a after reverting due to test failures, which
will hopefully now be fixed. Original commit message:

After expanding the pseudo instructions, update the liveness info.
We do this in a post-order traversal of the loop, including its
exit blocks and preheader(s).

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

4 years ago[GlobalISel] Use more MachineIRBuilder helper methods
Jay Foad [Thu, 16 Jan 2020 12:09:48 +0000 (12:09 +0000)]
[GlobalISel] Use more MachineIRBuilder helper methods

Reviewers: arsenm, nhaehnle

Subscribers: wdng, rovka, hiraditya, volkan, Petar.Avramovic, llvm-commits

Tags: #llvm

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

4 years ago[lldb/DWARF/test] Freshen up debug_names tests
Pavel Labath [Wed, 15 Jan 2020 11:17:35 +0000 (12:17 +0100)]
[lldb/DWARF/test] Freshen up debug_names tests

These tests used "clang -mllvm -accel-tables=Dwarf" as a way to
guarantee that clang will emit the debug_names table. Unfortunately,
a change it clang made that insufficient (-gpubnames is required now
too), which rendered these tests ineffective. Since lldb automatically
falls back to the manual index, the tests didn't fail and this change
went largely unnoticed.

This patch updates the tests to really use debug_names (-gdwarf-5
-gpubnames) is the combination that works now, and it adds additional
checks to ensure the section is actually emitted.

Fortunately, no regressions crept in while these tests were disabled.

4 years ago[ARM][MVE] Enable extending gathers
Anna Welker [Thu, 16 Jan 2020 13:48:18 +0000 (13:48 +0000)]
[ARM][MVE] Enable extending gathers

Enables the masked gather pass to
create extending masked gathers.

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

4 years ago[mlir][Linalg] Fix Linalg EDSC builders
Nicolas Vasilache [Thu, 16 Jan 2020 14:30:17 +0000 (09:30 -0500)]
[mlir][Linalg] Fix Linalg EDSC builders

Summary:
This diff fixes the fact that the method `mlir::edsc::makeGenericLinalgOp`
incorrectly adds 2 blocks to Linalg ops.

Tests are updated accordingly.

Reviewers: ftynse, hanchung, herhut, pifon2a, asaadaldien

Reviewed By: asaadaldien

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

Tags: #llvm

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

4 years agotry to unbreak build after 4b6d9ac392613
Nico Weber [Thu, 16 Jan 2020 15:12:06 +0000 (10:12 -0500)]
try to unbreak build after 4b6d9ac392613

4 years ago[VectorUtils] Rework the Vector Function Database (VFDatabase).
Francesco Petrogalli [Fri, 13 Dec 2019 19:43:26 +0000 (19:43 +0000)]
[VectorUtils] Rework the Vector Function Database (VFDatabase).

Summary:
This commits is a rework of the patch in
https://reviews.llvm.org/D67572.

The rework was requested to prevent out-of-tree performance regression
when vectorizing out-of-tree IR intrinsics. The vectorization of such
intrinsics is enquired via the static function `isTLIScalarize`. For
detail see the discussion in https://reviews.llvm.org/D67572.

Reviewers: uabelho, fhahn, sdesmalen

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years agoRemoved an unused include from TypeLocVisitor.h
Dmitri Gribenko [Thu, 16 Jan 2020 14:57:28 +0000 (15:57 +0100)]
Removed an unused include from TypeLocVisitor.h

4 years agoMake lld cmake not compute commit revision twice
Nico Weber [Thu, 16 Jan 2020 14:55:36 +0000 (09:55 -0500)]
Make lld cmake not compute commit revision twice

r354605 moved LLD to the unified revision handling introduced in
rL353268 / r352729 and removed uses of LLD_REPOSITORY_STRING and
LLD_REVISION_STRING.

After this change, we no longer compute the (now-unused) values
of these two variables.

Since this removes the only use of llvm/utils/GetRepositoryPath,
remove that too (it's redundant with the system added in r354605).

While here, also remove LLD_VERSION_MAJOR and LLD_VERSION_MINOR.
Their uses were removed in r285163.

Also remove LLD_VERSION from Version.inc which as far as I can
tell has been unused since the file was added in r219277.

No behavior change.

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

4 years agoRevert "[PHIEliminate] Move dbg values after phi and label"
Jeremy Morse [Thu, 16 Jan 2020 14:01:27 +0000 (14:01 +0000)]
Revert "[PHIEliminate] Move dbg values after phi and label"

Testing compiler-rt, a new assertion failure occurs when building
the GwpAsanTestObjects object. I'm uploading a reproducer to D70597.

This reverts commit 75188b01e9af3a89639d84be912f84610d6885ba.

4 years ago[ELF] Optimization to LinkerScript::computeInputSections NFC
Andrew Ng [Wed, 15 Jan 2020 11:48:37 +0000 (11:48 +0000)]
[ELF] Optimization to LinkerScript::computeInputSections NFC

Moved the section name check ahead of any filename matching or
exclusion. Firstly, this reduces the need to retrieve the filename and
secondly, reduces the amount of potentially expensive filename pattern
matching if such rules are present in the linker script.

The impact of this change is particularly significant when linking
objects built with -ffunction-sections and -fstack-size-section, using a
linker script that includes non-trivial filename patterns. In a number
of such cases, the link time is halved.

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

4 years ago[clangd] Make output order of allTargetDecls deterministic
Kadir Cetinkaya [Thu, 16 Jan 2020 10:37:58 +0000 (11:37 +0100)]
[clangd] Make output order of allTargetDecls deterministic

Summary:
Makes use of insertion order to stabilize output for multiple decls.

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

Reviewers: sammccall

Subscribers: ilya-biryukov, MaskRay, jkorous, mgrang, arphaman, usaxena95, cfe-commits, aemerson

Tags: #clang

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

4 years agoFix unused variable warning. NFCI.
Simon Pilgrim [Thu, 16 Jan 2020 11:26:56 +0000 (11:26 +0000)]
Fix unused variable warning. NFCI.

4 years agoFix "pointer is null" static analyzer warnings. NFCI.
Simon Pilgrim [Wed, 15 Jan 2020 16:40:20 +0000 (16:40 +0000)]
Fix "pointer is null" static analyzer warnings. NFCI.

Use castAs<> instead of getAs<> since the pointer is dereferenced immediately in all cases and castAs will perform the null assertion for us.

4 years ago[lldb][NFC] Migrate several tests to expect_expr
Raphael Isemann [Wed, 15 Jan 2020 12:30:04 +0000 (13:30 +0100)]
[lldb][NFC] Migrate several tests to expect_expr

expect_expr is the stricter and safer way of testing these expressions.

4 years agoRemove release note about in-process-cc1
Hans Wennborg [Thu, 16 Jan 2020 12:24:21 +0000 (13:24 +0100)]
Remove release note about in-process-cc1

This feature landed before the 10.x branch, so it will be covered in the
clang 10 release notes instead.

4 years ago[PHIEliminate] Move dbg values after phi and label
Chris Ye [Thu, 16 Jan 2020 11:40:44 +0000 (11:40 +0000)]
[PHIEliminate] Move dbg values after phi and label

If there are DBG_VALUEs between phi and label (after phi and before label),
DBG_VALUE will block PHI lowering after the LABEL. Moving all DBG_VALUEs
after Labels in the function ScheduleDAGSDNodes::EmitSchedule to avoid
impacting PHI lowering.

  before:
     PHI
     DBG_VALUE
     LABEL
  after: (move DBG_VALUE after label)
     PHI
     LABEL
     DBG_VALUE
  then: (phi lowering after label)
     LABEL
     COPY
     DBG_VALUE

Fixes the issue: https://bugs.llvm.org/show_bug.cgi?id=43859

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

4 years ago[Concepts] Fix ConceptSpecializationExpr profiling crash
Saar Raz [Thu, 16 Jan 2020 11:35:20 +0000 (13:35 +0200)]
[Concepts] Fix ConceptSpecializationExpr profiling crash

ConceptSpecializationExprs (CSEs) were being created with nullptr
TemplateArgsAsWritten during TemplateTemplateParmDecl canonicalization, and
we were relying on them during profiling which caused sporadic crashes
in test/CXX/.../temp.arg.template/p3-2a.cpp introduced in D44352.

Change profiling of CSEs to instead rely on the actual converted template
arguments and concept named.

4 years ago[clangd] Dont display `<unknown>` kinds in hover board
Kadir Cetinkaya [Wed, 15 Jan 2020 17:09:51 +0000 (18:09 +0100)]
[clangd] Dont display `<unknown>` kinds in hover board

Summary:
Currently when hovering over an `auto` or `decltype` that resolve to a
builtin-type, clangd would display `<unknown>` as the kind of the symbol.

Drop that to make rendering nicer.

Reviewers: usaxena95

Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, cfe-commits

Tags: #clang

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

4 years ago[IR] Mark memset.* intrinsics as IntrWriteMem.
Florian Hahn [Thu, 16 Jan 2020 10:25:29 +0000 (10:25 +0000)]
[IR] Mark memset.* intrinsics as IntrWriteMem.

llvm.memset intrinsics do only write memory, but are missing
IntrWriteMem, so they doesNotReadMemory() returns false for them.

The test change is due to the test checking the fn attribute ids at the
call sites, which got bumped up due to a new combination with writeonly
appearing in the test file.

Reviewers: jdoerfert, reames, efriedma, nlopes, lebedev.ri

Reviewed By: jdoerfert

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

4 years agoclang-format: [JS] tests for async wrapping.
Martin Probst [Mon, 18 Nov 2019 09:07:32 +0000 (10:07 +0100)]
clang-format: [JS] tests for async wrapping.

Summary:
Adds tests to ensure that `async method() ...` does not wrap between async and
the method name, which would cause automatic semicolon insertion.

Reviewers: krasimir

Subscribers: cfe-commits

Tags: #clang

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

4 years ago[LV] Allow assume calls in predicated blocks.
Florian Hahn [Thu, 16 Jan 2020 10:06:09 +0000 (10:06 +0000)]
[LV] Allow assume calls in predicated blocks.

The assume intrinsic is intentionally marked as may reading/writing
memory, to avoid passes moving them around. When flattening the CFG
for predicated blocks, we have to drop the assume calls, as they
are control-flow dependent.

There are some cases where we can do better (when control flow is
preserved), but that is follow-up work.

Fixes PR43620.

Reviewers: hsaito, rengolin, dcaballe, Ayal

Reviewed By: Ayal

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

4 years ago[LV] Make X86/assume.ll X86 independent (NFC).
Florian Hahn [Thu, 16 Jan 2020 09:57:12 +0000 (09:57 +0000)]
[LV] Make X86/assume.ll X86 independent (NFC).

The test does not check anything X86 specific. This is a preparation for
the D68814.

4 years ago[gn build] Port ed181efa175
LLVM GN Syncbot [Thu, 16 Jan 2020 09:55:55 +0000 (09:55 +0000)]
[gn build] Port ed181efa175

4 years ago[HIP][AMDGPU] expand printf when compiling HIP to AMDGPU
Sameer Sahasrabuddhe [Thu, 22 Aug 2019 10:04:35 +0000 (15:34 +0530)]
[HIP][AMDGPU] expand printf when compiling HIP to AMDGPU

Summary:
This change implements the expansion in two parts:
- Add a utility function emitAMDGPUPrintfCall() in LLVM.
- Invoke the above function from Clang CodeGen, when processing a HIP
  program for the AMDGPU target.

The printf expansion has undefined behaviour if the format string is
not a compile-time constant. As a sufficient condition, the HIP
ToolChain now emits -Werror=format-nonliteral.

Reviewed By: arsenm

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

4 years ago[VE] i64 arguments, return values and constants
Kazushi (Jam) Marukawa [Thu, 16 Jan 2020 08:24:41 +0000 (09:24 +0100)]
[VE] i64 arguments, return values and constants

Summary: Support for i64 arguments (in register), return values and constants along with tests.

Reviewed By: arsenm

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

4 years ago[lldb] Fix asan failures in data-formatter-objc tests
Raphael Isemann [Thu, 16 Jan 2020 08:57:13 +0000 (09:57 +0100)]
[lldb] Fix asan failures in data-formatter-objc tests

The test is currently failing on some systems with ASAN enabled due to:
```
==22898==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x603000003da4 at pc 0x00010951c33d bp 0x7ffee6709e00 sp 0x7ffee67095c0
READ of size 5 at 0x603000003da4 thread T0
    #0 0x10951c33c in wrap_memmove+0x16c (libclang_rt.asan_osx_dynamic.dylib:x86_64+0x1833c)
    #1 0x7fff4a327f57 in CFDataReplaceBytes+0x1ba (CoreFoundation:x86_64+0x13f57)
    #2 0x7fff4a415a44 in __CFDataInit+0x2db (CoreFoundation:x86_64+0x101a44)
    #3 0x1094f8490 in main main.m:424
    #4 0x7fff77482084 in start+0x0 (libdyld.dylib:x86_64+0x17084)
0x603000003da4 is located 0 bytes to the right of 20-byte region [0x603000003d90,0x603000003da4)
allocated by thread T0 here:
    #0 0x109547c02 in wrap_calloc+0xa2 (libclang_rt.asan_osx_dynamic.dylib:x86_64+0x43c02)
    #1 0x7fff763ad3ef in class_createInstance+0x52 (libobjc.A.dylib:x86_64+0x73ef)
    #2 0x7fff4c6b2d73 in NSAllocateObject+0x12 (Foundation:x86_64+0x1d73)
    #3 0x7fff4c6b5e5f in -[_NSPlaceholderData initWithBytes:length:copy:deallocator:]+0x40 (Foundation:x86_64+0x4e5f)
    #4 0x7fff4c6d4cf1 in -[NSData(NSData) initWithBytes:length:]+0x24 (Foundation:x86_64+0x23cf1)
    #5 0x1094f8245 in main main.m:404
    #6 0x7fff77482084 in start+0x0 (libdyld.dylib:x86_64+0x17084)
```

The reason is that we create a string "HELLO" but get the size wrong (it's 5 bytes instead
of 4). Later on we read the buffer and pretend it is 5 bytes long, causing an OOB read
which ASAN detects.

In general this test probably needs some cleanup as it produces on macOS 10.15 around
100 compiler warnings which isn't great, but let's first get the bot green.

4 years ago[DebugInfo] Simplify the constructor of DWARFDebugAranges::Range. NFC.
Igor Kudrin [Wed, 15 Jan 2020 11:17:07 +0000 (18:17 +0700)]
[DebugInfo] Simplify the constructor of DWARFDebugAranges::Range. NFC.

This removes the default values of the arguments. The only caller,
DWARFDebugAranges::construct(), provides all three parameters.

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

4 years ago[LegalizeDAG][TargetLowering] Move vXi64/i64->vXf32/f32 uint_to_fp legalizing code...
Craig Topper [Thu, 16 Jan 2020 06:01:14 +0000 (22:01 -0800)]
[LegalizeDAG][TargetLowering] Move vXi64/i64->vXf32/f32 uint_to_fp legalizing code from TargetLowering::expandUINT_TO_FP back to LegalizeDAG.

This was moved in October 2018, but we don't appear to be using
this for vectors on any in tree target.

Moving it back simplifies D72794 so we can share the code for i32->f32.

4 years ago[mlir] fix broken links to Glossary
Hiroshi Inoue [Thu, 16 Jan 2020 05:15:34 +0000 (14:15 +0900)]
[mlir] fix broken links to Glossary

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

4 years ago[lldb/Reproducers] Print more info for reproducer status
Jonas Devlieghere [Thu, 16 Jan 2020 04:22:20 +0000 (20:22 -0800)]
[lldb/Reproducers] Print more info for reproducer status

Reproducer status now prints the capture/replay path. It will also print
the status of auto generation when enabled.

4 years ago[gn build] Port 8fdafb7dced
LLVM GN Syncbot [Thu, 16 Jan 2020 04:13:31 +0000 (04:13 +0000)]
[gn build] Port 8fdafb7dced

4 years agoInsert wait instruction after X87 instructions which could raise
Liu, Chen3 [Thu, 16 Jan 2020 02:49:59 +0000 (10:49 +0800)]
Insert wait instruction after X87 instructions which could raise
float-point exception.

This patch also modify some mayRaiseFPException flag which set in D68854.

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

4 years ago[lldb/Reproducers] Add a flag to always generating a reproducer
Jonas Devlieghere [Thu, 16 Jan 2020 03:44:46 +0000 (19:44 -0800)]
[lldb/Reproducers] Add a flag to always generating a reproducer

Add a flag which always generates a reproducer when normally it would be
discarded. This is meant for testing purposes to capture a debugger
session without modification the session itself.

4 years agoSet some fast math attributes in setFunctionAttributes
Matt Arsenault [Thu, 5 Dec 2019 09:37:27 +0000 (15:07 +0530)]
Set some fast math attributes in setFunctionAttributes

This will provide a more consistent view to codegen for these
attributes. The current system is somewhat awkward, and the fields in
TargetOptions are reset based on the command line flag if the
attribute isn't set. By forcing these attributes with the flag, there
can never be an inconsistency in the behavior if code directly
inspects the attribute on the function without considering the command
line flags.

4 years ago[lldb/Reproducers] Extract function for reading environment override (NFC)
Jonas Devlieghere [Thu, 16 Jan 2020 03:12:50 +0000 (19:12 -0800)]
[lldb/Reproducers] Extract function for reading environment override (NFC)

Create a helper function for reading reproducer overrides from
environment variables.

4 years agoPR42694 Support explicit(bool) in older language modes as an extension.
Richard Smith [Thu, 16 Jan 2020 02:37:32 +0000 (18:37 -0800)]
PR42694 Support explicit(bool) in older language modes as an extension.

This needs somewhat careful disambiguation, as C++2a explicit(bool) is a
breaking change. We only enable it in cases where the source construct
could not possibly be anything else.

4 years ago[SampleFDO] Fix invalid branch profile generated by indirect call promotion.
Wei Mi [Thu, 16 Jan 2020 02:23:36 +0000 (18:23 -0800)]
[SampleFDO] Fix invalid branch profile generated by indirect call promotion.

Suppose an inline instance has hot total sample count but 0 entry count, and
it is an indirect call target. If the indirect call has no other call target
and inline instance associated with it and it is promoted, currently the
conditional branch generated by indirect call promotion will have invalid
branch profile which is !{!"branch_weights", i32 0, i32 0} -- because the
entry count of the promoted target is 0 and the total entry count of all
targets is also 0. This caused a SEGV in Control Height Reduction and may
cause problem in other passes.

Function entry count of an inline instance is computed by a heuristic --
using either the sample of the starting line or starting inner inline
instance. The patch changes the heuristic a little bit so that when total
sample count is larger than 0, the computed entry count will be at least 1.
Then the new branch profile will be !{!"branch_weights", i32 1, i32 0}.

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

4 years ago[X86] When handling i64->f32 sint_to_fp on 32-bit targets only bitcast to f64 if...
Craig Topper [Thu, 16 Jan 2020 02:07:15 +0000 (18:07 -0800)]
[X86] When handling i64->f32 sint_to_fp on 32-bit targets only bitcast to f64 if sse2 is enabled.

The code is trying to copy the i64 value to an xmm register to
use a 64-bit store so that the 64-bit fild can benefit from
store forwarding.

But this trick only works if f64 is going to be stored in an
XMM register. If we only have SSE1 then only float is in xmm
register. So this trick just causes 2 stores i32 stores, an f64
load into the x87, an f64 from x87, and a 64-bit fild. So we end
up with an extra stack temporary and still didn't get store forwarding.

We might be able to use v2f32 here instead, but I didn't check. I
just wanted the code to make sense.

Found by inspection as I continue to stare too hard at our
int_to_fp conversions.

4 years ago[X86] Add 32-bit mode sse1 command line to scalar-int-to-fp.ll. NFC
Craig Topper [Thu, 16 Jan 2020 02:04:46 +0000 (18:04 -0800)]
[X86] Add 32-bit mode sse1 command line to scalar-int-to-fp.ll. NFC

4 years agoFix the macos build after D71575.
Jim Ingham [Thu, 16 Jan 2020 02:10:31 +0000 (18:10 -0800)]
Fix the macos build after D71575.

size_t and uint64_t are spelled slightly differently on macOS, which was
causing the compiler to error out calling std::min - since the two types have
to be the same.

I fixed this by casting the uint64_t computation to a size_t.  That's probably
not the cleanest solution, but it gets us back to building.

4 years agollc: Don't overwrite frame-pointer attribute
Matt Arsenault [Mon, 9 Dec 2019 13:09:58 +0000 (18:39 +0530)]
llc: Don't overwrite frame-pointer attribute

Continue making command line flags with matching attribute behavior
consistent.

4 years agoRevert "[Support] make report_fatal_error `abort` instead of `exit`"
Yuanfang Chen [Thu, 16 Jan 2020 01:46:18 +0000 (17:46 -0800)]
Revert "[Support] make report_fatal_error `abort` instead of `exit`"

This reverts commit 647c3f4e47de8a850ffcaa897db68702d8d2459a.

Got bots failure from sanitizer-windows and maybe others.

4 years agodebugserver: Cut dependency on intrinsics_gen
Vedant Kumar [Thu, 16 Jan 2020 00:57:45 +0000 (16:57 -0800)]
debugserver: Cut dependency on intrinsics_gen

debugserver does not depend on intrinsics_gen or on llvm.

4 years ago[Support] make report_fatal_error `abort` instead of `exit`
Yuanfang Chen [Wed, 15 Jan 2020 06:43:51 +0000 (22:43 -0800)]
[Support] make report_fatal_error `abort` instead of `exit`

Summary:
This patch could be treated as a rebase of D33960. It also fixes PR35547.
A fix for `llvm/test/Other/close-stderr.ll` is proposed in D68164. Seems
the consensus is that the test is passing by chance and I'm not
sure how important it is for us. So it is removed like in D33960 for now.
The rest of the test fixes are just adding `--crash` flag to `not` tool.

** The reason it fixes PR35547 is

`exit` does cleanup including calling class destructor whereas `abort`
does not do any cleanup. In multithreading environment such as ThinLTO or JIT,
threads may share states which mostly are ManagedStatic<>. If faulting thread
tearing down a class when another thread is using it, there are chances of
memory corruption. This is bad 1. It will stop error reporting like pretty
stack printer; 2. The memory corruption is distracting and nondeterministic in
terms of error message, and corruption type (depending one the timing, it
could be double free, heap free after use, etc.).

Reviewers: rnk, chandlerc, zturner, sepavloff, MaskRay, espindola

Reviewed By: rnk, MaskRay

Subscribers: wuzish, jholewinski, qcolombet, dschuff, jyknight, emaste, sdardis, nemanjai, jvesely, nhaehnle, sbc100, arichardson, jgravelle-google, aheejin, kbarton, fedor.sergeev, asb, rbar, johnrusso, simoncook, apazos, sabuasal, niosHD, jrtc27, zzheng, edward-jones, atanasyan, rogfer01, MartinMosbeck, brucehoult, the_o, PkmX, jocewei, jsji, lenary, s.egerton, pzheng, cfe-commits, MaskRay, filcab, davide, MatzeB, mehdi_amini, hiraditya, steven_wu, dexonsmith, rupprecht, seiya, llvm-commits

Tags: #llvm, #clang

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

4 years ago[lldb/Tools] Remove lldb-mi.exports
Jonas Devlieghere [Thu, 16 Jan 2020 00:49:33 +0000 (16:49 -0800)]
[lldb/Tools] Remove lldb-mi.exports

lldb-mi was removed from the repo a while ago.

4 years agollc: Change behavior of -mattr with existing attribute
Matt Arsenault [Mon, 9 Dec 2019 12:33:25 +0000 (18:03 +0530)]
llc: Change behavior of -mattr with existing attribute

Append this to the existing target-features attribute on the function.

Some flags ignore existing attributes, and some overwrite them. Move
towards consistently respecting existing attributes if present. Since
target features act as a state machine on their own, append to the
function attribute. The backend default added feature list, function
attributes, and -mattr will all be appended together, and the later
features can individually toggle the earlier settings.

4 years ago[LLDB] Add ObjectFileWasm plugin for WebAssembly debugging
Paolo Severini [Wed, 15 Jan 2020 23:29:24 +0000 (15:29 -0800)]
[LLDB] Add ObjectFileWasm plugin for WebAssembly debugging

Summary:
This is the first in a series of patches to enable LLDB debugging of
WebAssembly targets.

Current versions of Clang emit (partial) DWARF debug information in WebAssembly
modules and we can leverage this debug information to give LLDB the ability to
do source-level debugging of Wasm code that runs in a WebAssembly engine.

A way to do this could be to use the remote debugging functionalities provided
by LLDB via the GDB-remote protocol. Remote debugging can indeed be useful not
only to connect a debugger to a process running on a remote machine, but also to
connect the debugger to a managed VM or script engine that runs locally,
provided that the engine implements a GDB-remote stub that offers the ability to
access the engine runtime internal state.

To make this work, the GDB-remote protocol would need to be extended with a few
Wasm-specific custom query commands, used to access aspects of the Wasm engine
state (like the Wasm memory, Wasm local and global variables, and so on).
Furthermore, the DWARF format would need to be enriched with a few Wasm-specific
extensions, here detailed: https://yurydelendik.github.io/webassembly-dwarf.

This CL introduce classes **ObjectFileWasm**, a file plugin to represent a Wasm
module loaded in a debuggee process. It knows how to parse Wasm modules and
store the Code section and the DWARF-specific sections.

Reviewers: jasonmolenda, clayborg, labath

Tags: #lldb

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

4 years agoFix pack deduction to only deduce the arity of packs that are actually
Richard Smith [Wed, 15 Jan 2020 21:14:13 +0000 (13:14 -0800)]
Fix pack deduction to only deduce the arity of packs that are actually
expanded by the deduced pack.

We recently started also deducing the arity of separately-expanded packs
that are merely mentioned within the pack in question, which is
incorrect.

4 years ago[lldb/Utils] Patch all variables used by lit (3/3)
Jonas Devlieghere [Thu, 16 Jan 2020 00:01:00 +0000 (16:01 -0800)]
[lldb/Utils] Patch all variables used by lit (3/3)

Instead of passing all the arguments for dotest.py as a single CMake
variable, lit now uses separate variables for the different test
binaries. Before this change they'd all get patched as part of the
LLDB_DOTEST_ARGS. We need to patch the new variables as well.

4 years ago[lldb/Utils] Patch all variables used by lldb-dotest (2/2)
Jonas Devlieghere [Wed, 15 Jan 2020 23:55:51 +0000 (15:55 -0800)]
[lldb/Utils] Patch all variables used by lldb-dotest (2/2)

Instead of passing all the arguments for dotest.py as a single CMake
variable, lldb-dotest now uses separate variables for the different test
binaries. Before this change they'd all get patched as part of the
LLDB_DOTEST_ARGS. We need to patch the new variables as well.

4 years agoProcess BUNDLE in tail duplication
Stanislav Mekhanoshin [Wed, 15 Jan 2020 17:38:08 +0000 (09:38 -0800)]
Process BUNDLE in tail duplication

When tail duplication estimates a size of tail it uses instruction
count. Account for a number of instrictions in a bundle too.

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

4 years agoRevert "Further implement CWG 2292"
Amy Huang [Wed, 15 Jan 2020 23:27:58 +0000 (15:27 -0800)]
Revert "Further implement CWG 2292"

This reverts commit ee0f1f1edc3ec0d4e698d50cc3180217448802b7 because it
causes an error on valid code.
See https://reviews.llvm.org/rGee0f1f1edc3ec0d4e698d50cc3180217448802b7.

4 years ago[OPENMP]Use regular processing of vtable used when TU is a prefix.
Alexey Bataev [Wed, 15 Jan 2020 22:37:12 +0000 (17:37 -0500)]
[OPENMP]Use regular processing of vtable used when TU is a prefix.

If current kind of the translation unit is TU_Prefix and it is not
complete, cannot decide what to do with virtual members/table at that
time, need to delay it to later stages.

4 years ago[CodeExtractor] Transfer debug info to extracted function
Vedant Kumar [Wed, 15 Jan 2020 19:26:34 +0000 (11:26 -0800)]
[CodeExtractor] Transfer debug info to extracted function

After extracting, fix up debug info in both the old and new functions by

1) Pointing line locations and debug intrinsics to the new subprogram
   scope, and

2) Deleting intrinsics which point to values outside of the new
   function.

Depends on https://reviews.llvm.org/D72795.

Testing: check-llvm, check-clang, a build of LNT in the `-Os -g` config
with "-mllvm -hot-cold-split=1" set, and end-to-end debugging of a toy
program which undergoes splitting to verify that lldb can find
variables, single step, etc. in extracted code.

rdar://45507940

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

4 years agoAMDGPU/GlobalISel: Select exp with patterns
Matt Arsenault [Sun, 5 Jan 2020 15:51:54 +0000 (10:51 -0500)]
AMDGPU/GlobalISel: Select exp with patterns

This does produce slightly different code. Now a unique IMPLICIT_DEF
is emitted for each of the implicit_def operands, rather than reusing
the same one.

4 years agoAMDGPU: Remove custom node for exports
Matt Arsenault [Sun, 5 Jan 2020 00:49:17 +0000 (19:49 -0500)]
AMDGPU: Remove custom node for exports

I'm mildly worried about potentially reordering exp/exp_done with
IntrWriteMem on the intrinsic.

Requires hacking out the illegal type on SI, so manually select that
case during lowering.

4 years agoGlobalISel: Handle more cases of G_SEXT narrowing
Matt Arsenault [Fri, 10 Jan 2020 15:07:24 +0000 (10:07 -0500)]
GlobalISel: Handle more cases of G_SEXT narrowing

This now develops the same problem G_ZEXT/G_ANYEXT have where the
requested type is assumed to be the source type. This will be fixed
separately by creating intermediate merges.

4 years ago[IR] Module's NamedMD table needn't be 'void *'
Brian Gesiak [Wed, 15 Jan 2020 21:39:39 +0000 (16:39 -0500)]
[IR] Module's NamedMD table needn't be 'void *'

Summary:
In July 21 2010 `llvm::NamedMDNode` was refactored such that it would no
longer subclass `llvm::Value`:
https://github.com/llvm/llvm-project/commit/2637cc1a38d7336ea30caf

As part of this change, a map type from metadata names to their named
metadata, `llvm::MDSymbolTable`, was deleted. In its place, the type
of member `llvm::Module::NamedMDSymTab` was changed, from
`llvm::MDSymbolTable` to `void *`. The underlying memory allocations
for this pointer were changed to `new StringMap<NamedMDNode *>()`.

However, as far as I can tell, there's no need for obscuring the
underlying type being pointed to by the `void *`, and no need for
static casts from `void *` to `StringMap`. In fact, I don't think
there's a need for explicit calls to `new` and `delete` at all.

This commit changes `NamedMDSymTab` from a pointer to a reference, which
automatically couples its lifetime with the lifetime of its owning
`llvm::Module` instance, thus removing the explicit calls to `new` and
`delete` in the `llvm::Module` constructor and destructor. It also
changes the type from `void *` to a newly defined `NamedMDSymTabType`,
and removes the static casts.

Test Plan:
An ASAN-enabled build and run of `check-all` succeeds with this change
(aside from some tests that always fail for me in ASAN for some reason,
such as `check-clang` `SemaTemplate/stack-exhaustion.cpp`).

Reviewers: aprantl, dblaikie, chandlerc, pcc, echristo

Reviewed By: dblaikie

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

4 years ago[lldb/Utils] Patch all variables used by lldb-dotest
Jonas Devlieghere [Wed, 15 Jan 2020 23:15:51 +0000 (15:15 -0800)]
[lldb/Utils] Patch all variables used by lldb-dotest

Instead of passing all the arguments for dotest.py as a single CMake
variable, lldb-dotest now uses separate variables for the different test
binaries. Before this change they'd all get patched as part of the
LLDB_DOTEST_ARGS. We need to patch the new variables as well.

4 years ago[libcxx] Use mtx_plain | mtx_recursive following C11 API
Petr Hosek [Wed, 15 Jan 2020 21:58:29 +0000 (13:58 -0800)]
[libcxx] Use mtx_plain | mtx_recursive following C11 API

The C11 API specifies that to initialize a recursive mutex,
mtx_plain | mtx_recursive should be used with mtx_init.

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

4 years ago[COFF] Warn that LLD does not support /PDBSTRIPPED:
Reid Kleckner [Wed, 15 Jan 2020 23:09:25 +0000 (15:09 -0800)]
[COFF] Warn that LLD does not support /PDBSTRIPPED:

Doesn't really fix PR44491, but it avoids treating it as an input.

4 years agoRevert "Allow system header to provide their own implementation of some builtin"
Amy Huang [Wed, 15 Jan 2020 22:34:19 +0000 (14:34 -0800)]
Revert "Allow system header to provide their own implementation of some builtin"

This reverts commit 921f871ac438175ca8fcfcafdfcfac4d7ddf3905 because it
causes libc++ code to trigger __warn_memset_zero_len.

See https://reviews.llvm.org/D71082.

4 years ago[lldb/Debugger] Rename IO handler methods to be more meaningful (NFC)
Jonas Devlieghere [Wed, 15 Jan 2020 22:56:28 +0000 (14:56 -0800)]
[lldb/Debugger] Rename IO handler methods to be more meaningful (NFC)

Make it clear form the method names whether they are synchronous or
asynchronous.

4 years agoRevert "[OPENMP]Do not use RTTI by default for NVPTX devices."
Alexey Bataev [Wed, 15 Jan 2020 22:41:15 +0000 (17:41 -0500)]
Revert "[OPENMP]Do not use RTTI by default for NVPTX devices."

This reverts commit 23058f9dd4d7e18239fd63b6da52549514b45fda. It breaks
builds of cuda code somehow in some cases.

4 years ago[libc++] Fix parsing <string> in C++03.
Eric Fiselier [Wed, 15 Jan 2020 22:29:55 +0000 (17:29 -0500)]
[libc++] Fix parsing <string> in C++03.

Specifically, add a space between >> when closing templates.

4 years ago[libc++] Optimize basic_string::operator=(const basic_string&) for SSO assignments
Eric Fiselier [Wed, 15 Jan 2020 22:27:10 +0000 (17:27 -0500)]
[libc++] Optimize basic_string::operator=(const basic_string&) for SSO assignments

This change optimizes the operator=() assignment for short strings by direcly
copying the raw data from the source into the current instance. This creates an
optimized / inlined mempcy up to over 2X faster for short string assignments.
With inlining enabled for operator=, performance is up to 6X faster.

Benchmarks 'as is':
name                                    old time/op   new time/op    delta
BM_StringAssignStr_Empty_Opaque         6.05ns ± 2%   3.59ns ± 0%  -40.67%
BM_StringAssignStr_Empty_Transparent    5.15ns ± 0%   3.08ns ± 0%  -40.12%
BM_StringAssignStr_Small_Opaque         7.71ns ± 0%   3.59ns ± 0%  -53.45%
BM_StringAssignStr_Small_Transparent    7.66ns ± 0%   3.09ns ± 0%  -59.66%
BM_StringAssignStr_Large_Opaque         24.1ns ± 0%   24.9ns ± 0%   +3.22%
BM_StringAssignStr_Large_Transparent    22.2ns ± 0%   22.8ns ± 0%   +2.77%
BM_StringAssignStr_Huge_Opaque           315ns ± 6%    320ns ± 5%     ~
BM_StringAssignStr_Huge_Transparent      318ns ± 5%    321ns ± 4%     ~

Benchmarks with partial inlining operator=():
name                                    old time/op   new time/op    delta
BM_StringAssignStr_Empty_Opaque         5.94ns ± 2%   1.95ns ± 0%  -67.21%
BM_StringAssignStr_Empty_Transparent    5.14ns ± 0%   1.04ns ± 1%  -79.73%
BM_StringAssignStr_Small_Opaque         7.69ns ± 0%   1.96ns ± 0%  -74.48%
BM_StringAssignStr_Small_Transparent    7.65ns ± 0%   1.04ns ± 0%  -86.40%
BM_StringAssignStr_Large_Opaque         24.1ns ± 0%   24.5ns ± 0%   +1.61%
BM_StringAssignStr_Large_Transparent    22.2ns ± 0%   21.1ns ± 0%   -4.70%
BM_StringAssignStr_Huge_Opaque           317ns ± 5%    323ns ± 4%     ~
BM_StringAssignStr_Huge_Transparent      318ns ± 5%    320ns ± 5%     ~

Patch by Martijn Vels (mvels@google.com)
Reviewed as https://reviews.llvm.org/D72704

4 years ago[test] Move call-site-entry-linking.test into test/tools/dsymutil/X86
Vedant Kumar [Wed, 15 Jan 2020 22:19:53 +0000 (14:19 -0800)]
[test] Move call-site-entry-linking.test into test/tools/dsymutil/X86

This should fix a failure on the clang-cmake-armv7-quick bot.

4 years agoDWARF: Simplify the way the return PC is attached to call site tags, NFC
Vedant Kumar [Wed, 15 Jan 2020 22:15:45 +0000 (14:15 -0800)]
DWARF: Simplify the way the return PC is attached to call site tags, NFC

This cleanup was suggested by Djordje in D72489.

4 years ago[BasicBlock] add helper getPostdominatingDeoptimizeCall
Fedor Sergeev [Wed, 15 Jan 2020 21:57:34 +0000 (00:57 +0300)]
[BasicBlock] add helper getPostdominatingDeoptimizeCall

It appears to be rather useful when analyzing Loops with multiple
deoptimizing exits, perhaps merged ones.
For now it is used in LoopPredication, will be adding more uses
in other loop passes.

Reviewers: asbirlea, fhahn, skatkov, spatel, reames
Reviewed By: reames

Tags: #llvm

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

4 years ago[libc++] Explicitly enumerate std::string external instantiations - Attempt 2
Eric Fiselier [Wed, 15 Jan 2020 22:12:09 +0000 (17:12 -0500)]
[libc++] Explicitly enumerate std::string external instantiations - Attempt 2

  The GCC build failures have been addressed, and the LLDB failures were
  fixed by LLDB.

   I have also verified that the apple-clang 9.0 segfault no longer
   occurs.

Original Message:

 The external instantiation of std::string is a problem for libc++.
    Additions and removals of inline functions in string can cause ABI
    breakages, including introducing new symbols.

    This patch aims to:
      (1) Make clear which functions are explicitly instatiated.
      (2) Prevent new functions from being accidentally instantiated.
      (3) Allow a migration path for adding or removing functions from the
      explicit instantiation over time.

    Although this new formulation is uglier, it is preferable from a
    maintainability and readability standpoint because it explicitly
    enumerates the functions we've chosen to expose in our ABI. Changing
    this list is non-trivial and requires thought and planning.

    (3) is achieved by making it possible to control the extern template declaration
    separately from it's definition. Meaning we could add a new definition to
    the dylib, wait for it to roll out, then add the extern template
    declaration to the header. Similarly, we could remove existing extern
    template declarations while still keeping the definition to prevent ABI
    breakages.

4 years ago[libc++] Explicitly mark basic_string<...>::npos with default
Eric Fiselier [Wed, 15 Jan 2020 22:02:17 +0000 (17:02 -0500)]
[libc++] Explicitly mark basic_string<...>::npos with default
visibility.

This ensures that the version compiled into the library isn't
accidentally hidden.

4 years ago[libc++] Make SFINAE'd member functions in string mutually exclusive.
Eric Fiselier [Wed, 15 Jan 2020 21:57:08 +0000 (16:57 -0500)]
[libc++] Make SFINAE'd member functions in string mutually exclusive.

This patch is needed in order to work around a GCC bug that fails to
explicitly instantiate a non-template function of a class template when
there is another overload that's a function template.
(See https://godbolt.org/z/4bUQ_b)

This patch SFINAE's away the function templates when the argument is
a basic_string.

4 years agolldb: Run TestCrossDSOTailCalls.py and TestCrossObjectTailCalls.py on Darwin only
Vedant Kumar [Wed, 15 Jan 2020 21:59:12 +0000 (13:59 -0800)]
lldb: Run TestCrossDSOTailCalls.py and TestCrossObjectTailCalls.py on Darwin only

See https://bugs.llvm.org/show_bug.cgi?id=44561, these tests are failing
on an aarch64/Linux bot:

http://lab.llvm.org:8011/builders/lldb-aarch64-ubuntu/builds/655

For some reason the backtrace the tests are expecting to find is
incomplete.

4 years ago[MachineScheduler][NFC] Don't swap when we can't cluster
Jinsong Ji [Wed, 15 Jan 2020 21:19:34 +0000 (21:19 +0000)]
[MachineScheduler][NFC] Don't swap when we can't cluster

https://reviews.llvm.org/D72706 tried to reduce reordering due to mem op
clustering. This patch avoid doing the swap when we can't cluster.

Reviewed By: rampitec

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

4 years ago[NFC] Refactor InlineResult for readability
Mircea Trofin [Wed, 15 Jan 2020 21:33:58 +0000 (13:33 -0800)]
[NFC] Refactor InlineResult for readability

Summary:
InlineResult is used both in APIs assessing whether a call site is
inlinable (e.g. llvm::isInlineViable) as well as in the function
inlining utility (llvm::InlineFunction). It means slightly different
things (can/should inlining happen, vs did it happen), and the
implicit casting may introduce ambiguity (casting from 'false' in
InlineFunction will default a message about hight costs,
which is incorrect here).

The change renames the type to a more generic name, and disables
implicit constructors.

Reviewers: eraman, davidxl

Reviewed By: davidxl

Subscribers: kerbowa, arsenm, jvesely, nhaehnle, eraman, hiraditya, haicheng, llvm-commits

Tags: #llvm

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

4 years ago[mlir] Add shaped container component type interface
Jacques Pienaar [Thu, 9 Jan 2020 02:48:38 +0000 (18:48 -0800)]
[mlir] Add shaped container component type interface

Summary:
* Add shaped container type interface which allows infering the shape, element
  type and attribute of shaped container type separately. Show usage by way of
  tensor type inference trait which combines the shape & element type in
  infering a tensor type;
  - All components need not be specified;
  - Attribute is added to allow for layout attribute that was previously
    discussed;
* Expand the test driver to make it easier to test new creation instances
  (adding new operands or ops with attributes or regions would trigger build
  functions/type inference methods);
  - The verification part will be moved out of the test and to verify method
    instead of ops implementing the type inference interface in a follow up;
* Add MLIRContext as arg to possible to create type for ops without arguments,
  region or location;
* Also move out the section in OpDefinitions doc to separate ShapeInference doc
  where the shape function requirements can be captured;
  - Part of this would move to the shape dialect and/or shape dialect ops be
    included as subsection of this doc;
* Update ODS's variable usage to match camelBack format for builder,
  state and arg variables;
  - I could have split this out, but I had to make some changes around
    these and the inconsistency bugged me :)

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

4 years ago[NFC][IndVarSimplify] remove duplicate code in widenWithVariantLoadUseCodegen.
Zhongduo Lin [Wed, 15 Jan 2020 21:22:47 +0000 (16:22 -0500)]
[NFC][IndVarSimplify] remove duplicate code in widenWithVariantLoadUseCodegen.

Summary: Duplicate code in widenWithVariantLoadUseCodegen is removed and also use assert to check unknown extension type as it should be filtered out by the pre condition check before calling this function.

Reviewers: az, sanjoy, sebpop, efriedma, javed.absar, sanjoy.google

Reviewed By: efriedma

Subscribers: hiraditya, llvm-commits, amehsan

Tags: #llvm

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

4 years agoPR17164: Change clang's default behavior from -flax-vector-conversions=all to -flax...
Richard Smith [Thu, 9 May 2019 06:30:37 +0000 (23:30 -0700)]
PR17164: Change clang's default behavior from -flax-vector-conversions=all to -flax-vector-conversions=integer.

Summary:
See proposal on cfe-dev:
http://lists.llvm.org/pipermail/cfe-dev/2019-April/062030.html

Reviewers: SjoerdMeijer, eli.friedman

Subscribers: kristof.beyls, cfe-commits

Tags: #clang

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

4 years agoWork around PR43337: don't try to use the vec_sel overloads for vector long long...
Richard Smith [Tue, 17 Sep 2019 03:36:55 +0000 (20:36 -0700)]
Work around PR43337: don't try to use the vec_sel overloads for vector long long, since clang's <altivec.h> doesn't provide it yet!

4 years agoDebugInfo: Factor out logic to update locations in MD_loop metadata, NFC
Vedant Kumar [Wed, 15 Jan 2020 19:22:06 +0000 (11:22 -0800)]
DebugInfo: Factor out logic to update locations in MD_loop metadata, NFC

Factor out the logic needed to update debug locations contained within
MD_loop metadata.

This refactor is preparation for a future change that also needs to
rewrite MD_loop metadata.

rdar://45507940

4 years ago[DWARF] Emit DW_AT_call_return_pc as an address
Vedant Kumar [Fri, 10 Jan 2020 02:00:33 +0000 (18:00 -0800)]
[DWARF] Emit DW_AT_call_return_pc as an address

This reverts D53469, which changed llvm's DWARF emission to emit
DW_AT_call_return_pc as a function-local offset. Such an encoding is not
compatible with post-link block re-ordering tools and isn't standards-
compliant.

In addition to reverting back to the original DW_AT_call_return_pc
encoding, teach lldb how to fix up DW_AT_call_return_pc when the address
comes from an object file pointed-to by a debug map. While doing this I
noticed that lldb's support for tail calls that cross a DSO/object file
boundary wasn't covered, so I added tests for that. This latter case
exercises the newly added return PC fixup.

The dsymutil changes in this patch were originally included in D49887:
the associated test should be sufficient to test DW_AT_call_return_pc
encoding purely on the llvm side.

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

4 years ago[docs][ORC] Update the laziness section of the ORCv2 design doc.
Lang Hames [Wed, 15 Jan 2020 19:30:04 +0000 (11:30 -0800)]
[docs][ORC] Update the laziness section of the ORCv2 design doc.

This updates the discussion of lazy reexports, fixes a TBD for a usage example,
and adds a reference to the fully worked lazy reexports example that was added
in e9e26c01cd865da678b1af6ba5f417c713956a66.

4 years ago[gn build] re-run "gn format" with trunk gn
Nico Weber [Wed, 15 Jan 2020 18:35:58 +0000 (13:35 -0500)]
[gn build] re-run "gn format" with trunk gn

4 years ago[gn build] add multi-line forcing comments in more places
Nico Weber [Wed, 15 Jan 2020 18:30:57 +0000 (13:30 -0500)]
[gn build] add multi-line forcing comments in more places

4 years ago[gn build] make "gn format" comment slightly more concise
Nico Weber [Wed, 15 Jan 2020 18:24:28 +0000 (13:24 -0500)]
[gn build] make "gn format" comment slightly more concise

4 years ago[Mips] Add FileCheck to a test that just tested for a crash.
Craig Topper [Wed, 15 Jan 2020 02:19:54 +0000 (18:19 -0800)]
[Mips] Add FileCheck to a test that just tested for a crash.

I believe the generated code here can suffer from double rounding.
So I wanted to capture the existing codegen so we can make
decisions about how to fix it.

4 years ago[ORC] Set setCloneToNewContextOnEmit on LLJIT's transform layer when needed.
Lang Hames [Wed, 15 Jan 2020 18:20:10 +0000 (10:20 -0800)]
[ORC] Set setCloneToNewContextOnEmit on LLJIT's transform layer when needed.

Based on Don Hinton's patch in https://reviews.llvm.org/D72406. This feature
was accidentally left out of e9e26c01cd865da678b1af6ba5f417c713956a66, and
would have pessimized concurrent compilation in the default case.

Thanks for spotting this Don!

4 years agoRevert "Revert rG6078f2fedcac5797ac39ee5ef3fd7a35ef1202d5 - "[AArch64][GlobalISel...
Amara Emerson [Wed, 15 Jan 2020 16:49:22 +0000 (08:49 -0800)]
Revert "Revert rG6078f2fedcac5797ac39ee5ef3fd7a35ef1202d5 - "[AArch64][GlobalISel]: Support @llvm.{return,frame}address selection.""

The original change wasn't constraining the operand regclasses which broke EXPENSIVE_CHECKS.

4 years ago[gn build] Reformat all build files
Nico Weber [Wed, 15 Jan 2020 17:59:45 +0000 (12:59 -0500)]
[gn build] Reformat all build files

Ran `git ls-files '*.gn' '*.gni' | xargs llvm/utils/gn/gn.py format`.
The motivation is to reformat them with trunk gn again right after.
Trunk gn changed formatting of some single-element lists.

4 years agoReplace CLANG_SPAWN_CC1 env var with a driver mode flag
Nico Weber [Wed, 15 Jan 2020 15:45:02 +0000 (10:45 -0500)]
Replace CLANG_SPAWN_CC1 env var with a driver mode flag

Flags are clang's default UI is flags.

We can have an env var in addition to that, but in D69825 nobody has yet
mentioned why this needs an env var, so omit it for now.  If someone
needs to set the flag via env var, the existing CCC_OVERRIDE_OPTIONS
mechanism works for it (set CCC_OVERRIDE_OPTIONS=+-fno-integrated-cc1
for example).

Also mention the cc1-in-process change in the release notes.

Also spruce up the test a bit so it actually tests something :)

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

4 years ago[ARM][MVE][Intrinsics] Add VMINAQ, VMINNMAQ, VMAXAQ, VMAXNMAQ intrinsics.
Mark Murray [Mon, 13 Jan 2020 13:21:30 +0000 (13:21 +0000)]
[ARM][MVE][Intrinsics] Add VMINAQ, VMINNMAQ, VMAXAQ, VMAXNMAQ intrinsics.

Summary: Add VMINAQ, VMINNMAQ, VMAXAQ, VMAXNMAQ intrinsics and unit tests.

Reviewers: simon_tatham, miyuki, dmgreen

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

Tags: #clang, #llvm

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

4 years ago[clangd] Extract string literals in macro arguments to unbreak gcc buildbots
Kadir Cetinkaya [Wed, 15 Jan 2020 16:59:02 +0000 (17:59 +0100)]
[clangd] Extract string literals in macro arguments to unbreak gcc buildbots

4 years agoRevert "[mlir] Create a gpu.module operation for the GPU Dialect."
Benjamin Kramer [Wed, 15 Jan 2020 16:51:51 +0000 (17:51 +0100)]
Revert "[mlir] Create a gpu.module operation for the GPU Dialect."

This reverts commit 4624a1e8ac8a3f69cc887403b976f538f587744a. Causing
problems downstream.

4 years agoFix bot by adjusting wildcard matching
Teresa Johnson [Wed, 15 Jan 2020 16:35:12 +0000 (08:35 -0800)]
Fix bot by adjusting wildcard matching

I noticed one bot failure due to
24a00ef2404104e9ca6fbd7eb523a8a340be9d99 because the wildcard matching
was not working as intended, fixed it to act similar to other checks of
CGSCCToFunctionPassAdaptor.

4 years ago[ThinLTO] Always import constants
evgeny [Wed, 15 Jan 2020 16:29:01 +0000 (19:29 +0300)]
[ThinLTO] Always import constants

This patch imports constant variables even when they can't be internalized
(which results in promotion). This offers some extra constant folding
opportunities.

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

4 years ago[Loop Peeling] Add possibility to enable peeling on loop nests.
Arkady Shlykov [Wed, 15 Jan 2020 14:12:34 +0000 (06:12 -0800)]
[Loop Peeling] Add possibility to enable peeling on loop nests.

Summary:
Current peeling implementation bails out in case of loop nests.
The patch introduces a field in TargetTransformInfo structure that
certain targets can use to relax the constraints if it's
profitable (disabled by default).
Also additional option is added to enable peeling manually for
experimenting and testing purposes.

Reviewers: fhahn, lebedev.ri, xbolva00

Reviewed By: xbolva00

Subscribers: xbolva00, hiraditya, zzheng, llvm-commits

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

4 years ago[InstCombine] reassociate fsub+fsub into fsub+fadd
Sanjay Patel [Wed, 15 Jan 2020 13:23:46 +0000 (08:23 -0500)]
[InstCombine] reassociate fsub+fsub into fsub+fadd

As discussed in the motivating PR44509:
https://bugs.llvm.org/show_bug.cgi?id=44509

...we can end up with worse code using fast-math than without.
This is because the reassociate pass greedily transforms fsub
into fneg/fadd and apparently (based on the regression tests
seen here) expects instcombine to clean that up if it wasn't
profitable. But we were missing this fold:

(X - Y) - Z --> X - (Y + Z)

There's another, more specific case that I think we should
handle as shown in the "fake" fneg test (but missed with a real
fneg), but that's another patch. That may be tricky to get
right without conflicting with existing transforms for fneg.

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

4 years ago[mlir][Linalg] NFC - Hotfix for gcc-5 build
Nicolas Vasilache [Wed, 15 Jan 2020 16:12:53 +0000 (11:12 -0500)]
[mlir][Linalg] NFC - Hotfix for gcc-5 build

4 years ago[mlir][Linalg] NFC - Cleanup Linalg Pass locations and namespacing
Nicolas Vasilache [Wed, 15 Jan 2020 14:48:49 +0000 (09:48 -0500)]
[mlir][Linalg] NFC - Cleanup Linalg Pass locations and namespacing

Summary:
This diff moves the conversion pass declaration closer to its definition
and makes the namespacing of passes consistent with the rest of the
infrastructure (i.e. `mlir::linalg::createXXXPass` -> `mlir::createXXXPass`).

Reviewers: ftynse, jpienaar, mehdi_amini

Subscribers: rriddle, burmako, shauheen, antiagainst, arpith-jacob, mgester, lucyrfox, aartbik, liufengdb, llvm-commits

Tags: #llvm

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