platform/upstream/llvm.git
5 years ago[X86][NFC] Autogenerate check lines in cmovcmov.ll test
Roman Lebedev [Wed, 6 Mar 2019 11:47:43 +0000 (11:47 +0000)]
[X86][NFC] Autogenerate check lines in cmovcmov.ll test

Investigating 8-bit cmov promotion, this test comes up.

llvm-svn: 355496

5 years ago[DAGCombiner] Enable SMULO/UMULO vector combine support (PR40442)
Simon Pilgrim [Wed, 6 Mar 2019 11:04:21 +0000 (11:04 +0000)]
[DAGCombiner] Enable SMULO/UMULO vector combine support (PR40442)

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

llvm-svn: 355495

5 years ago[X86][SSE] VSELECT(XOR(Cond,-1), LHS, RHS) --> VSELECT(Cond, RHS, LHS)
Simon Pilgrim [Wed, 6 Mar 2019 10:54:43 +0000 (10:54 +0000)]
[X86][SSE] VSELECT(XOR(Cond,-1), LHS, RHS) --> VSELECT(Cond, RHS, LHS)

As noticed on D58965

DAGCombiner::visitSELECT has something similar, so we should be able to move this to DAGCombiner and support VSELECT as well at some point.

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

llvm-svn: 355494

5 years ago[clangd] Add Source to clangd::Diagnostic.
Haojian Wu [Wed, 6 Mar 2019 10:51:38 +0000 (10:51 +0000)]
[clangd] Add Source to clangd::Diagnostic.

Summary:
clangd embedder can distinguish diagnostics from clang or clang-tidy.

Reviewers: ilya-biryukov

Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

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

llvm-svn: 355493

5 years agoInline asm constraints: allow ICE-like pointers for the "n" constraint (PR40890)
Hans Wennborg [Wed, 6 Mar 2019 10:26:19 +0000 (10:26 +0000)]
Inline asm constraints: allow ICE-like pointers for the "n" constraint (PR40890)

Apparently GCC allows this, and there's code relying on it (see bug).

The idea is to allow expression that would have been allowed if they
were cast to int. So I based the code on how such a cast would be done
(the CK_PointerToIntegral case in IntExprEvaluator::VisitCastExpr()).

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

llvm-svn: 355491

5 years ago[CodeGen] Omit range checks from jump tables when lowering switches with unreachable...
Ayonam Ray [Wed, 6 Mar 2019 10:01:02 +0000 (10:01 +0000)]
[CodeGen] Omit range checks from jump tables when lowering switches with unreachable default

During the lowering of a switch that would result in the generation of a
jump table, a range check is performed before indexing into the jump
table, for the switch value being outside the jump table range and a
conditional branch is inserted to jump to the default block. In case the
default block is unreachable, this conditional jump can be omitted. This
patch implements omitting this conditional branch for unreachable
defaults.

Differential Revision: https://reviews.llvm.org/D52002
Reviewers: Hans Wennborg, Eli Freidman, Roman Lebedev

llvm-svn: 355490

5 years agoclang-cl: Parse /Qspectre and a few other missing options (PR40964)
Hans Wennborg [Wed, 6 Mar 2019 09:38:04 +0000 (09:38 +0000)]
clang-cl: Parse /Qspectre and a few other missing options (PR40964)

llvm-svn: 355489

5 years agoAlways compare C++ typeinfo (based on libstdc++ implementation).
Martin Liska [Wed, 6 Mar 2019 08:36:50 +0000 (08:36 +0000)]
Always compare C++ typeinfo (based on libstdc++ implementation).

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

llvm-svn: 355488

5 years agoReversing the commit of revision 355483 since it is giving a regression on a newly...
Ayonam Ray [Wed, 6 Mar 2019 07:51:28 +0000 (07:51 +0000)]
Reversing the commit of revision 355483 since it is giving a regression on a newly added test.

llvm-svn: 355487

5 years ago[clang][OpenMP] Revert "OMPFlushClause is synthetic, no such clause exists"
Roman Lebedev [Wed, 6 Mar 2019 07:45:10 +0000 (07:45 +0000)]
[clang][OpenMP] Revert "OMPFlushClause is synthetic, no such clause exists"

Summary:
This reverts rL352390 / D57280.

As discussed in https://reviews.llvm.org/D57112#inline-506781,
'flush' clause does not exist in the OpenMP spec, it can not be
specified, and `OMPFlushClause` class is just a helper class.

Now, here's the caveat. I have read @ABataev's
> Well, I think it would be good to filter out OMPC_flush somehow
> because there is no such clause actually, it is a pseudo clause
> for better handling of the flush directive.
as if that clause is pseudo clause that only exists for the sole
purpose of simplifying the parser. As in, it never reaches AST.

I did not however try to verify that. Too bad, i was wrong.
It absolutely *does* reach AST. Therefore my understanding/justification
for the change was flawed, which makes the patch a regression which **must** be reverted.

@gribozavr has brought that up again in https://reviews.llvm.org/D57112#inline-521238

> > ...
> Sorry to be late for this discussion, but I don't think this conclusion
> follows. ASTMatchers are supposed to match the AST as it is.
> Even if OMPC_flush is synthetic, it exists in the AST, and users might
> want to match it. I think users would find anything else (trying to filter
> out AST nodes that are not in the source code) to be surprising. For example,
> there's a matcher materializeTemporaryExpr even though this AST node is a
> Clang invention and is not a part of the C++ spec.
>
> Matching only constructs that appear in the source code is not feasible with
> ASTMatchers, because they are based on Clang's AST that exposes tons of semantic
> information, and its design is dictated by the structure of the semantic information.
> See "RFC: Tree-based refactorings with Clang" in cfe-dev for a library that will
> focus on representing source code as faithfully as possible.
>
> Not to even mention that this code is in ASTTypeTraits, a general library for
> handling AST nodes, not specifically for AST Matchers...

Reviewers: gribozavr, ABataev, rjmccall, aaron.ballman

Reviewed By: gribozavr, ABataev

Subscribers: dylanmckay, guansong, arphaman, jdoerfert, cfe-commits, gribozavr, ABataev

Tags: #clang, #openmp

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

llvm-svn: 355486

5 years ago[X86] Enable the add with 128 -> sub with -128 encoding trick with X86ISD::ADD when...
Craig Topper [Wed, 6 Mar 2019 07:36:38 +0000 (07:36 +0000)]
[X86] Enable the add with 128 -> sub with -128 encoding trick with X86ISD::ADD when the carry flag isn't used.

This allows us to use an 8-bit sign extended immediate instead of a 16 or 32 bit immediate.

Also do similar for 0x80000000 with 64-bit adds to avoid having to use a movabsq.

llvm-svn: 355485

5 years ago[X86] Suppress load folding for add/sub with 128 immediate.
Craig Topper [Wed, 6 Mar 2019 07:36:36 +0000 (07:36 +0000)]
[X86] Suppress load folding for add/sub with 128 immediate.

128 won't fit in a sign extended 8-bit immediate, but we can negate it to -128 and use the other operation. This results in a shorter encoding since the move would have used 16 or 32 bits for the immediate.

llvm-svn: 355484

5 years ago[CodeGen] Omit range checks from jump tables when lowering switches with unreachable...
Ayonam Ray [Wed, 6 Mar 2019 07:27:45 +0000 (07:27 +0000)]
[CodeGen] Omit range checks from jump tables when lowering switches with unreachable default

During the lowering of a switch that would result in the generation of a
jump table, a range check is performed before indexing into the jump
table, for the switch value being outside the jump table range and a
conditional branch is inserted to jump to the default block. In case the
default block is unreachable, this conditional jump can be omitted. This
patch implements omitting this conditional branch for unreachable
defaults.

Differential Revision: https://reviews.llvm.org/D52002
Reviewers: Hans Wennborg, Eli Freidman, Roman Lebedev

llvm-svn: 355483

5 years agoFix slashes in path references in -Rmodule-import test from r355477
Duncan P. N. Exon Smith [Wed, 6 Mar 2019 05:42:56 +0000 (05:42 +0000)]
Fix slashes in path references in -Rmodule-import test from r355477

Fixup for r355477 to fix the Windows bot:
  http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/16217

llvm-svn: 355482

5 years agoEradicate all the ptrdiff_ts in span left over from applying P1227. A couple of other...
Marshall Clow [Wed, 6 Mar 2019 03:59:44 +0000 (03:59 +0000)]
Eradicate all the ptrdiff_ts in span left over from applying P1227. A couple of other minor cleanups. NFC

llvm-svn: 355481

5 years agogn build: Merge r355439.
Peter Collingbourne [Wed, 6 Mar 2019 03:08:06 +0000 (03:08 +0000)]
gn build: Merge r355439.

llvm-svn: 355480

5 years agoELF: De-template OutputSection::finalize() and MipsGotSection::build(). NFCI.
Peter Collingbourne [Wed, 6 Mar 2019 03:07:57 +0000 (03:07 +0000)]
ELF: De-template OutputSection::finalize() and MipsGotSection::build(). NFCI.

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

llvm-svn: 355479

5 years agoELF: Extract a non-ELFT base class for VersionNeedSection.
Peter Collingbourne [Wed, 6 Mar 2019 03:07:48 +0000 (03:07 +0000)]
ELF: Extract a non-ELFT base class for VersionNeedSection.

We're going to need a separate VersionNeedSection for each partition, and
the partition data structure won't be templated.

With this the VersionTableSection class no longer needs ELFT, so detemplate it.

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

llvm-svn: 355478

5 years agoModules: Add -Rmodule-import
Duncan P. N. Exon Smith [Wed, 6 Mar 2019 02:50:46 +0000 (02:50 +0000)]
Modules: Add -Rmodule-import

Add a remark for importing modules.  Depending on whether this is a
direct import (into the TU being built by this compiler instance) or
transitive import (into an already-imported module), the diagnostic has
two forms:

    importing module 'Foo' from 'path/to/Foo.pcm'
    importing module 'Foo' into 'Bar' from 'path/to/Foo.pcm'

Also drop a redundant FileCheck invocation in Rmodule-build.m that was
using -Reverything, since the notes from -Rmodule-import were confusing
it.

https://reviews.llvm.org/D58891

llvm-svn: 355477

5 years agoChange the scanning algorithm in DynamicLoaderDarwinKernel::SearchForKernelNearPC.
Jason Molenda [Wed, 6 Mar 2019 02:45:27 +0000 (02:45 +0000)]
Change the scanning algorithm in DynamicLoaderDarwinKernel::SearchForKernelNearPC.
Currently when lldb might be doing a kernel debug session, it scans through
memory by taking the current pc value and looking for a kernel at megabyte
boundaries, up to 32MB behind $pc.  This adjusts the algorithm to
scan back at every 16k page boundary and to stop scanning as soon
as we hit a memory read error.  The addition of stopping at a memory read
error saves us from tons of unnecessary packet traffic on generic
targets where lldb might look for a kernel binary.

I've been trying to think of how to construct a test for this; it's a bit
tricky.  A gdb-remote protocol test with the contents of a fake tiny kernel
mach-o binary would satisify part of it, but this kernel path also directly
calls over to dsymForUUID or DebugSymbols framework lookups to find the
kernel binary as well.  I'll keep thinking about this one, but it's so
intertangled with these two external systems that it may be hard to do.

<rdar://problem/48578197>

llvm-svn: 355476

5 years ago[NFC] Declare the member data of class PostGenericScheduler as "protected" instead...
QingShan Zhang [Wed, 6 Mar 2019 02:39:18 +0000 (02:39 +0000)]
[NFC] Declare the member data of class PostGenericScheduler as "protected" instead of "private"

Some target might try to subclass the PostGenericScheduler to custom the scheduling strategy.
We need to declare the member data of PostGenericScheduler as "protected", which acts the same as "GenericScheduler".

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

llvm-svn: 355475

5 years ago[X86] Remove periods from the end of SubtargetFeature descriptions since the help...
Craig Topper [Wed, 6 Mar 2019 02:36:48 +0000 (02:36 +0000)]
[X86] Remove periods from the end of SubtargetFeature descriptions since the help printer adds a period.

Most features don't have periods already, but some did. When there is a period it causes llc -mattr=+help to print 2 periods.

llvm-svn: 355474

5 years agoRe-commit logging for SBCompileUnit::GetNumLineEntries.
Jason Molenda [Wed, 6 Mar 2019 02:32:45 +0000 (02:32 +0000)]
Re-commit logging for SBCompileUnit::GetNumLineEntries.

llvm-svn: 355473

5 years ago[WebAssembly] Remove trailing whitespaces in tests (NFC)
Heejin Ahn [Wed, 6 Mar 2019 02:00:22 +0000 (02:00 +0000)]
[WebAssembly] Remove trailing whitespaces in tests (NFC)

Reviewers: sbc100

Subscribers: dschuff, jgravelle-google, sunfish, llvm-commits

Tags: #llvm

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

llvm-svn: 355472

5 years ago[ExpressionParser] Fix ComputeClangResourceDirectory for windows
Alex Langford [Wed, 6 Mar 2019 01:57:04 +0000 (01:57 +0000)]
[ExpressionParser] Fix ComputeClangResourceDirectory for windows

The function signature of ComputeClangResourceDirectory for windows
wasn't updated when the others changed, causing the windows build to
fail. This should fix that.

llvm-svn: 355471

5 years ago[Reproducers] Enable replay from SBRepro.
Jonas Devlieghere [Wed, 6 Mar 2019 01:49:57 +0000 (01:49 +0000)]
[Reproducers] Enable replay from SBRepro.

Now that the LLDB instrumentation macros are in place, we should use
that to test reproducer replay.

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

llvm-svn: 355470

5 years ago[Reproducers] Don't intercept SBDebugger::SetInputFileHandle
Jonas Devlieghere [Wed, 6 Mar 2019 01:49:54 +0000 (01:49 +0000)]
[Reproducers] Don't intercept SBDebugger::SetInputFileHandle

With the reproducer logic in place for the command interpreter we no
longer need to make SBDebugger::SetInputFileHandle a no-op.

llvm-svn: 355469

5 years ago[BinaryFormat] Add DT_USED tag into dynamic section.
Xing GUO [Wed, 6 Mar 2019 01:28:40 +0000 (01:28 +0000)]
[BinaryFormat] Add DT_USED tag into dynamic section.

Summary:
This tag is documented in https://docs.oracle.com/cd/E19253-01/817-1984/chapter6-42444/index.html
Though I could not find some docs that describe it in detail, I found some code snippets.

1.
```
/*
 * Look up the string in the string table and get its offset. If
 * this succeeds, then it is possible that there is a DT_NEEDED
 * dynamic entry that references it.
 */
have_string = elfedit_sec_findstr(argstate->str.sec,
    strpad_elt.dn_dyn.d_un.d_val, arg, &str_offset) != 0;
if (have_string) {
dyn = argstate->dynamic.data;
for (ndx = 0; ndx < numdyn; dyn++, ndx++) {
if (((dyn->d_tag == DT_NEEDED) ||
    (dyn->d_tag == DT_USED)) &&
    (dyn->d_un.d_val == str_offset))
goto done;
}
}
```
https://github.com/kofemann/opensolaris/blob/80192cd83bf665e708269dae856f9145f7190f74/usr/src/cmd/sgs/elfedit/modules/common/syminfo.c#L512

2.
```
    case DT_USED:
    case DT_INIT_ARRAY:
    case DT_FINI_ARRAY:
      if (do_dynamic)
        {
          if (entry->d_tag == DT_USED
          && VALID_DYNAMIC_NAME (entry->d_un.d_val))
        {
          char *name = GET_DYNAMIC_NAME (entry->d_un.d_val);

          if (*name)
            {
              printf (_("Not needed object: [%s]\n"), name);
              break;
            }
        }

          print_vma (entry->d_un.d_val, PREFIX_HEX);
          putchar ('\n');
        }
      break;
```
http://web.mit.edu/freebsd/head/contrib/binutils/binutils/readelf.c

3.
```
#define DT_USED     0x7ffffffe  /* ignored - same as needed */
```
https://github.com/switchbrew/switch-tools/blob/master/src/elf_common.h

Reviewers: jhenderson, grimar

Reviewed By: jhenderson, grimar

Subscribers: emaste, krytarowski, fedor.sergeev, llvm-commits

Tags: #llvm

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

llvm-svn: 355468

5 years agogn build: Add 32-bit Linux support.
Peter Collingbourne [Wed, 6 Mar 2019 01:28:32 +0000 (01:28 +0000)]
gn build: Add 32-bit Linux support.

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

llvm-svn: 355467

5 years agoReplace debug-only assert with a plain old assert.
Adrian Prantl [Wed, 6 Mar 2019 01:07:45 +0000 (01:07 +0000)]
Replace debug-only assert with a plain old assert.

llvm-svn: 355466

5 years ago[Reproducers] Undef LLDB_REPRO_INSTR_TRACE
Jonas Devlieghere [Wed, 6 Mar 2019 01:00:36 +0000 (01:00 +0000)]
[Reproducers] Undef LLDB_REPRO_INSTR_TRACE

Forgot to undef this before landing.

llvm-svn: 355465

5 years ago[Reproducers] Fix warnings without asserts
Jonas Devlieghere [Wed, 6 Mar 2019 00:52:48 +0000 (00:52 +0000)]
[Reproducers] Fix warnings without asserts

Make sure the variable is used when asserts are compiled out.

llvm-svn: 355464

5 years ago[ExpressionParser] Test GetClangResourceDir
Alex Langford [Wed, 6 Mar 2019 00:45:16 +0000 (00:45 +0000)]
[ExpressionParser] Test GetClangResourceDir

Summary:
I'm doing this because I plan on implementing `ComputeClangResourceDirectory`
on windows so that `GetClangResourceDir` will work.  Additionally, I made
test_paths make sure that the directory member of the returned FileSpec is not
none. This will fail on windows since `ComputeClangResourceDirectory` isn't
implemented yet.

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

llvm-svn: 355463

5 years ago[Fixed Point Arithmetic] Fixed Point and Integer Conversions
Leonard Chan [Wed, 6 Mar 2019 00:28:43 +0000 (00:28 +0000)]
[Fixed Point Arithmetic] Fixed Point and Integer Conversions

This patch includes the necessary code for converting between a fixed point type and integer.
This also includes constant expression evaluation for conversions with these types.

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

llvm-svn: 355462

5 years agoRevert "[AtomicExpand] Allow libcall expansion for non-zero address spaces" for build...
Mitch Phillips [Wed, 6 Mar 2019 00:25:40 +0000 (00:25 +0000)]
Revert "[AtomicExpand] Allow libcall expansion for non-zero address spaces" for buildbot failures.

llvm-svn: 355461

5 years ago[ARM] Sink zext/sext operands for add and sub to enable vsubl generation.
Florian Hahn [Wed, 6 Mar 2019 00:10:03 +0000 (00:10 +0000)]
[ARM] Sink zext/sext operands for add and sub to enable vsubl generation.

This uses the infrastructure added in rL353152 to sink zext and sexts to
sub/add users, to enable vsubl/vaddl generation when NEON is available.

See https://bugs.llvm.org/show_bug.cgi?id=40025.

Reviewers: SjoerdMeijer, t.p.northover, samparker, efriedma

Reviewed By: samparker

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

llvm-svn: 355460

5 years ago[Reproducers] Add SBReproducer macros
Jonas Devlieghere [Wed, 6 Mar 2019 00:06:00 +0000 (00:06 +0000)]
[Reproducers] Add SBReproducer macros

This patch adds the SBReproducer macros needed to capture and reply the
corresponding calls. This patch was generated by running the lldb-instr
tool on the API source files.

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

llvm-svn: 355459

5 years ago[SBAPI] Don't check IsValid in constructor
Jonas Devlieghere [Wed, 6 Mar 2019 00:05:55 +0000 (00:05 +0000)]
[SBAPI] Don't check IsValid in constructor

When running the test suite with the instrumentation macros, I noticed
two lldb-mi tests regressed. The issue was the copy constructor of
SBLineEntry. Without the macros the returned value would be elided, but
with the macros the copy constructor was called. The latter using ::IsValid
to determine whether the underlying opaque pointer should be set. This
is likely a remnant of when ::IsValid would only check the validity of the
smart pointer. In SBLineEntry however, it actually forwards to
LineEntry::IsValid().

So what happened here was that because of the macros the copy
constructor was called. The opaque pointer was valid but the LineEntry
didn't consider itself valid. So the copied-to object ended up default
initialized.

This patch replaces all checks for IsValid in copy (assignment)
constructors with checks for the opaque pointer itself.

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

llvm-svn: 355458

5 years agoRemove tautological #ifdefs (NFC)
Adrian Prantl [Tue, 5 Mar 2019 23:51:25 +0000 (23:51 +0000)]
Remove tautological #ifdefs (NFC)

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

llvm-svn: 355457

5 years ago[DWARFFormValue] Don't consider DW_FORM_data4/8 to be section offsets.
Jonas Devlieghere [Tue, 5 Mar 2019 23:47:22 +0000 (23:47 +0000)]
[DWARFFormValue] Don't consider DW_FORM_data4/8 to be section offsets.

When dumping ToT clan's debug info with dwarfdump, we were seeing an
error saying that that the location list overflows the debug_loc
section. After reducing the testcase we figured out that we were
interpreting the DW_FORM_data4 as a section offset.

In DWARF3 DW_FORM_data4 and DW_FORM_data8 served also as a section
offset. Until now we didn't check check for the DWARF version, because
some producers (read old versions of clang) were still emitting this.
The relevant code/comment was added in 2013, and I believe it's now
reasonable to start checking the version.

The FormValue class is a little bit of a mess because it cashes the
DWARF unit and context when it extracted the value itself. Several
methods of the class rely on it being present, or return an Optional for
the code path that needs it. At the same time the FormValue class also
used in places where there's no DWARF unit.

For this patch I went with the least invasive change: checking the
version from the CU when it's available. If it's not (because the form
value was created from a value directly) we default to the old behavior.

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

llvm-svn: 355456

5 years ago[opt] Report if the provided architecture is invalid.
Florian Hahn [Tue, 5 Mar 2019 23:10:28 +0000 (23:10 +0000)]
[opt] Report if the provided architecture is invalid.

Partly addresses PR15026.

There are a few tests that passed in invalid architectures, which are fixed in: rL355349 and D58931

Reviewers: echristo, efriedma, rengolin, atrick

Reviewed By: efriedma

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

llvm-svn: 355455

5 years agoRevert r355432 for buildbot failures in ppc64be-linux and s390x-linux
Rong Xu [Tue, 5 Mar 2019 23:02:06 +0000 (23:02 +0000)]
Revert r355432 for buildbot failures in ppc64be-linux and s390x-linux

llvm-svn: 355454

5 years ago[AtomicExpand] Allow libcall expansion for non-zero address spaces
Philip Reames [Tue, 5 Mar 2019 23:00:14 +0000 (23:00 +0000)]
[AtomicExpand] Allow libcall expansion for non-zero address spaces

Be consistent about how we treat atomics in non-zero address spaces.  If we get to the backend, we tend to lower them as if in address space 0.  Do the same if we need to insert a libcall instead.

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

llvm-svn: 355453

5 years ago[X86][NFC] Add proper test for promotion of i8 cmov's of trunc's
Roman Lebedev [Tue, 5 Mar 2019 22:43:53 +0000 (22:43 +0000)]
[X86][NFC] Add proper test for promotion of i8 cmov's of trunc's

There was no proper test for that code in X86TargetLowering::LowerSELECT().
Noticed accidentally while trying to modify the last branch in that function.

llvm-svn: 355452

5 years ago[libc++] Only add dylib-related features when using the system's libc++
Louis Dionne [Tue, 5 Mar 2019 22:42:45 +0000 (22:42 +0000)]
[libc++] Only add dylib-related features when using the system's libc++

Otherwise, when testing trunk libc++ on an older system, lit will think
that the dylib features are disabled. Ideally, we'd have a notion of
running the tests with/without a deployment target (or, equivalently,
a deployment target representing trunk where everything is as recent
as can be). Since we always have a deployment target right now (which
defaults to the current system), we only enable those features when
we're going to also be testing with the system libc++.

We also need to disable the availability markup when we are not running
a system library flavor, because availability markup does not make sense
when building against the trunk libc++ (which has everything regardless
of what the current system is).

This is a re-application of r353319, which had been reverted due to
CI breakage. This time around, I made sure it didn't break our internal
CI before submitting.

This is also a partial undoing of r348296, in spirit at least. However,
with this patch, availability markup is enabled based on whether we're
using a system library or not, whereas previously one could enable
it or disable it arbitrarily. This was confusing as it led to testing
configurations that don't make sense (such as testing a system library
without availability markup, or trunk testing with availability markup).

llvm-svn: 355451

5 years ago[clang-format] broken after lambda with return type template with boolean literal
Paul Hoad [Tue, 5 Mar 2019 22:20:25 +0000 (22:20 +0000)]
[clang-format] broken after lambda with return type template with boolean literal

Summary:
A Lamdba with a return type template with a boolean literal (true,false) behaves differently to an integer literal

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

Reviewers: klimek, djasper, JonasToth, alexfh, krasimir, jkorous

Reviewed By: jkorous

Subscribers: jkorous, cfe-commits

Tags: #clang-tools-extra

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

llvm-svn: 355450

5 years agoRevert logging addition to SBCompileUnit::GetNumLineEntries,
Jason Molenda [Tue, 5 Mar 2019 22:17:47 +0000 (22:17 +0000)]
Revert logging addition to SBCompileUnit::GetNumLineEntries,
causing lldb-mi testsuite failures?

llvm-svn: 355449

5 years ago[lit, windows] Disable stop-hook-threads on Windows
Stella Stamenova [Tue, 5 Mar 2019 21:43:04 +0000 (21:43 +0000)]
[lit, windows] Disable stop-hook-threads on Windows

This test is also no longer reliably failing or passing on Windows and it is hanging every few runs.

llvm-svn: 355448

5 years ago[docs] Add some architectures into the list of supported ThreadSanitizer platforms
Vitaly Buka [Tue, 5 Mar 2019 21:10:42 +0000 (21:10 +0000)]
[docs] Add some architectures into the list of supported ThreadSanitizer platforms

Some platforms for which TSAN has build rules are omitted for the lack of
known build bots.

llvm-svn: 355445

5 years ago[WebAssembly] Simplify iterator navigations (NFC)
Heejin Ahn [Tue, 5 Mar 2019 21:05:09 +0000 (21:05 +0000)]
[WebAssembly] Simplify iterator navigations (NFC)

Summary:
- Replaces some uses of `MachineFunction::iterator(MBB)` with
  `MBB->getIterator()` and `MachineBasicBlock::iterator(MI)` with
  `MI->getIterator()`, which are simpler.
- Replaces some uses of `std::prev` of `std::next` that takes a
  MachineFunction or MachineBasicBlock iterator with `getPrevNode` and
  `getNextNode`, which are also simpler.

Reviewers: sbc100

Subscribers: dschuff, sunfish, jgravelle-google, llvm-commits

Tags: #llvm

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

llvm-svn: 355444

5 years ago[lldbsuite, windows] Skip the TestEvents tests on Windows
Stella Stamenova [Tue, 5 Mar 2019 21:03:36 +0000 (21:03 +0000)]
[lldbsuite, windows] Skip the TestEvents tests on Windows

These tests are flakey on Windows and recently they have started failing AND also hanging the whole suite when they fail.

llvm-svn: 355443

5 years ago[docs] Update the list of ThreadSanitizer supported OSes
Vitaly Buka [Tue, 5 Mar 2019 20:53:34 +0000 (20:53 +0000)]
[docs] Update the list of ThreadSanitizer supported OSes

llvm-svn: 355442

5 years ago[Remarks][NFC] Rename RemarkParser to YAMLRemarkParser
Francis Visoiu Mistrih [Tue, 5 Mar 2019 20:50:35 +0000 (20:50 +0000)]
[Remarks][NFC] Rename RemarkParser to YAMLRemarkParser

Rename it to reflect that it's parsing YAML remarks.

llvm-svn: 355441

5 years ago[cmake] Add libRemarks to LLVM_DISTRIBUTION_COMPONENTS
Francis Visoiu Mistrih [Tue, 5 Mar 2019 20:47:34 +0000 (20:47 +0000)]
[cmake] Add libRemarks to LLVM_DISTRIBUTION_COMPONENTS

Add this in the Apple-stage2.cmake to ship the remark tooling library
with the compiler.

llvm-svn: 355440

5 years ago[OptRemarks] Make OptRemarks more generic: rename OptRemarks to Remarks
Francis Visoiu Mistrih [Tue, 5 Mar 2019 20:45:17 +0000 (20:45 +0000)]
[OptRemarks] Make OptRemarks more generic: rename OptRemarks to Remarks

Getting rid of the name "optimization remarks" for anything that
involves handling remarks on the client side.

It's safer to do this now, before we get stuck with that name in all the
APIs and public interfaces we decide to export to users in the future.

This renames llvm/tools/opt-remarks to llvm/tools/remarks-shlib, and now
generates `libRemarks.dylib` instead of `libOptRemarks.dylib`.

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

llvm-svn: 355439

5 years ago[WebAssembly] Test change after disabling MachineBlockPlacement
Heejin Ahn [Tue, 5 Mar 2019 20:36:20 +0000 (20:36 +0000)]
[WebAssembly] Test change after disabling MachineBlockPlacement

Summary:
We disabled MachineBlockPlacement pass in D58953, and this test result
changes as the result of it.

Reviewers: kripken

Subscribers: dschuff, sbc100, jgravelle-google, sunfish, llvm-commits

Tags: #llvm

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

llvm-svn: 355438

5 years ago[WebAssembly] Disable MachineBlockPlacement pass
Heejin Ahn [Tue, 5 Mar 2019 20:35:34 +0000 (20:35 +0000)]
[WebAssembly] Disable MachineBlockPlacement pass

Summary:
This pass hurts code size for wasm and sometimes generates irreducible
control flow.
Context: https://github.com/emscripten-core/emscripten/pull/8233

Reviewers: kripken, dschuff

Subscribers: sunfish, sbc100, jgravelle-google, llvm-commits

Tags: #llvm

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

llvm-svn: 355437

5 years ago[NFC][CodeGen][X86][AArch64] Add tests for C++ std::midpoint() pattern (PR40965)
Roman Lebedev [Tue, 5 Mar 2019 20:18:47 +0000 (20:18 +0000)]
[NFC][CodeGen][X86][AArch64] Add tests for C++ std::midpoint() pattern (PR40965)

Tests only for integers, not floating point or pointers.

The scalar 8-bit case uses branch instead of CMOV,
because there is no no 8-bit CMOV.

Vector tests are for consistency, since it can be vectorized.

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

llvm-svn: 355436

5 years agoAdd logging to SBCompileUnit::GetNumLineEntries.
Jason Molenda [Tue, 5 Mar 2019 19:43:56 +0000 (19:43 +0000)]
Add logging to SBCompileUnit::GetNumLineEntries.

llvm-svn: 355435

5 years ago[clang-format] Fix lambdas returning template specialization that contains operator...
Jan Korous [Tue, 5 Mar 2019 19:27:24 +0000 (19:27 +0000)]
[clang-format] Fix lambdas returning template specialization that contains operator in parameter

A template specialization of a template foo<int N> can contain integer constants and a whole bunch of operators - e. g.  foo< 1 ? !0 : (3+1)%4 >

Inspired by https://reviews.llvm.org/D58922

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

llvm-svn: 355434

5 years agoRevert r355224 "[TableGen][SelectionDAG][X86] Add specific isel matchers for immAllZe...
Craig Topper [Tue, 5 Mar 2019 19:18:16 +0000 (19:18 +0000)]
Revert r355224 "[TableGen][SelectionDAG][X86] Add specific isel matchers for immAllZerosV/immAllOnesV. Remove bitcasts from X86 patterns that are no longer necessary."

This caused the first matcher in the isel table for many targets to Opc_Scope instead of Opc_SwitchOpcode. This leads to a significant increase in isel match failures.

llvm-svn: 355433

5 years ago[PGO] Clang part of change for context-sensitive PGO (part2)
Rong Xu [Tue, 5 Mar 2019 19:09:56 +0000 (19:09 +0000)]
[PGO] Clang part of change for context-sensitive PGO (part2)

Part 2 of CSPGO change in Clang: Add test cases.

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

llvm-svn: 355432

5 years ago[Subtarget] Merge ProcSched and ProcDesc arrays in MCSubtargetInfo into a single...
Craig Topper [Tue, 5 Mar 2019 18:54:38 +0000 (18:54 +0000)]
[Subtarget] Merge ProcSched and ProcDesc arrays in MCSubtargetInfo into a single array.

These arrays are both keyed by CPU name and go into the same tablegenerated file. Merge them so we only need to store keys once.

This also removes a weird space saving quirk where we used the ProcDesc.size() to create to build an ArrayRef for ProcSched.

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

llvm-svn: 355431

5 years ago[X86] In X86DomainReassignment.cpp add enclosed registers to EnclosedEdges
Guozhi Wei [Tue, 5 Mar 2019 18:54:34 +0000 (18:54 +0000)]
[X86] In X86DomainReassignment.cpp add enclosed registers to EnclosedEdges

The variable X86DomainReassignment::EnclosedEdges is used to store registers that have been enclosed in some closure, so those registers will be ignored when create new closures. But there is no registers has ever been put into this set, so a single register can be enclosed in multiple closures, it significantly increase compile time.

This patch adds a register into EnclosedEdges when it is enclosed into a closure.

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

llvm-svn: 355430

5 years ago[Subtarget] Create a separate SubtargetSubtargetKV struct for ProcDesc to remove...
Craig Topper [Tue, 5 Mar 2019 18:54:34 +0000 (18:54 +0000)]
[Subtarget] Create a separate SubtargetSubtargetKV struct for ProcDesc to remove fields from the stack tables that aren't needed for CPUs

The description for CPUs was just the CPU name wrapped with "Select the " and " processor". We can just do that directly in the help printer instead of making a separate version in the binary for each CPU.

Also remove the Value field that isn't needed and was always 0.

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

llvm-svn: 355429

5 years ago[Subtarget] Move SubtargetFeatureKV/SubtargetInfoKV from SubtargetFeature.h to MCSubt...
Craig Topper [Tue, 5 Mar 2019 18:54:30 +0000 (18:54 +0000)]
[Subtarget] Move SubtargetFeatureKV/SubtargetInfoKV from SubtargetFeature.h to MCSubtargetInfo.h. Move all code that operates on ProcFeatures and ProcDesc arrays to MCSubtargetInfo.

The SubtargetFeature class managed a list of features as strings. And it also had functions for setting bits in a FeatureBitset.

The methods that operated on the Feature list as strings are used in other parts of the backend. But the parts that operate on FeatureBitset are very tightly coupled to MCSubtargetInfo and requires passing in the arrays that MCSubtargetInfo owns. And the same struct type is used for ProcFeatures and ProcDesc.

This has led to MCSubtargetInfo having 2 arrays keyed by CPU name. One containing a mapping from a CPU name to its features. And one containing a mapping from CPU name to its scheduler model.

I would like to make a single CPU array containing all CPU information and remove some unneeded fields the ProcDesc array currently has. But I don't want to make SubtargetFeatures.h have to know about the scheduler model type and have to forward declare or pull in the header file.

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

llvm-svn: 355428

5 years agoReinstate libc++ patches now that the lldb formatter has been updated.
Davide Italiano [Tue, 5 Mar 2019 18:40:49 +0000 (18:40 +0000)]
Reinstate libc++ patches now that the lldb formatter has been updated.

"[libc++] Fix <atomic> failures on GCC"
"[libc++] Change memory_order to an enum class"
"[libc++] decoupling Freestanding atomic<T> from libatomic.a"

llvm-svn: 355427

5 years agoAMDGPU: Preserve undef flag when expanding SI_IF
Matt Arsenault [Tue, 5 Mar 2019 18:38:00 +0000 (18:38 +0000)]
AMDGPU: Preserve undef flag when expanding SI_IF

Fixes undefined value verifier error.

llvm-svn: 355426

5 years ago[X86] Enable 8-bit SHL to convert to LEA
Craig Topper [Tue, 5 Mar 2019 18:37:41 +0000 (18:37 +0000)]
[X86] Enable 8-bit SHL to convert to LEA

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

llvm-svn: 355425

5 years ago[X86] Allow 8-bit INC/DEC to be converted to LEA.
Craig Topper [Tue, 5 Mar 2019 18:37:37 +0000 (18:37 +0000)]
[X86] Allow 8-bit INC/DEC to be converted to LEA.

We already do this for 16/32/64 as well as 8-bit add with register/immediate. Might as well do it for 8-bit INC/DEC too.

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

llvm-svn: 355424

5 years ago[X86] Enable 8-bit OR with disjoint bits to convert to LEA
Craig Topper [Tue, 5 Mar 2019 18:37:33 +0000 (18:37 +0000)]
[X86] Enable 8-bit OR with disjoint bits to convert to LEA

We already support 8-bits adds in convertToThreeAddress. But we can also support 8-bit OR if the bits are disjoint. We already do this for 16/32/64.

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

llvm-svn: 355423

5 years ago[DataFormatters] Fix regression in libc++ std::atomic formatter caused by https:...
Shafik Yaghmour [Tue, 5 Mar 2019 18:34:35 +0000 (18:34 +0000)]
[DataFormatters] Fix regression in libc++ std::atomic formatter caused by https://reviews.llvm.org/D56913

rdar://problem/48568543

llvm-svn: 355422

5 years ago[CUDA][HIP][Sema] Fix template kernel with function as template parameter
Yaxun Liu [Tue, 5 Mar 2019 18:19:35 +0000 (18:19 +0000)]
[CUDA][HIP][Sema] Fix template kernel with function as template parameter

If a kernel template has a function as its template parameter, a device function should be
allowed as template argument since a kernel can call a device function. However,
currently if the kernel template is instantiated in a host function, clang will emit an error
message saying the device function is an invalid candidate for the template parameter.

This happens because clang checks the reference to the device function during parsing
the template arguments. At this point, the template is not instantiated yet. Clang incorrectly
assumes the device function is called by the host function and emits the error message.

This patch fixes the issue by disabling checking of device function during parsing template
arguments and deferring the check to the instantion of the template. At that point, the
template decl is already available, therefore the check can be done against the instantiated
function template decl.

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

llvm-svn: 355421

5 years ago[SLP] Fix invalid triple in X86 tests
Florian Hahn [Tue, 5 Mar 2019 17:56:35 +0000 (17:56 +0000)]
[SLP] Fix invalid triple in X86 tests

x86-64 is an invalid architecture in triples. Changing it to the correct
triple (x86_64) changes some tests, because SLP is not deemed profitable
any more.

Reviewers: ABataev, RKSimon, spatel

Reviewed By: RKSimon

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

llvm-svn: 355420

5 years agoAllow bundle size to be 0 in clang-offload-bundler
Yaxun Liu [Tue, 5 Mar 2019 17:52:32 +0000 (17:52 +0000)]
Allow bundle size to be 0 in clang-offload-bundler

HIP uses clang-offload-bundler to create fat binary. The bundle for host is empty.
Currently clang-offload-bundler checks if the bundle size is 0 when unbundling.
If so it will exit without unbundling the remaining bundles. This causes
clang-offload-bundler not being able to unbundle fat binaries generated for HIP.

This patch allows bundles size to be 0 when clang-offload-bundler unbundles
input files.

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

llvm-svn: 355419

5 years ago[OPENMP]Target region: emit const firstprivates as globals with constant
Alexey Bataev [Tue, 5 Mar 2019 17:47:18 +0000 (17:47 +0000)]
[OPENMP]Target region: emit const firstprivates as globals with constant
memory.

If the variable with the constant non-scalar type is firstprivatized in
the target region, the local copy is created with the data copying.
Instead, we allocate the copy in the constant memory and avoid extra
copying in the outlined target regions. This global copy is used in the
target regions without loss of the performance.

llvm-svn: 355418

5 years ago[libcxx] Revert set of atomic patches that broke lldb.
Davide Italiano [Tue, 5 Mar 2019 17:38:33 +0000 (17:38 +0000)]
[libcxx] Revert set of atomic patches that broke lldb.

Revert "[libc++] Fix <atomic> failures on GCC"
Revert "[libc++] Change memory_order to an enum class"
Revert "[libc++] decoupling Freestanding atomic<T> from libatomic.a"

The lldb formatter nededs to be updated. Shafik and Louis will
coordinate to do so.

llvm-svn: 355417

5 years ago[scudo][standalone] Add bytemap classes
Kostya Kortchinsky [Tue, 5 Mar 2019 17:36:11 +0000 (17:36 +0000)]
[scudo][standalone] Add bytemap classes

Summary:
The bytemap classes will be used by the primary32 allocator to associate
classes with memory regions. It's similar to the sanitizer_common one
except for the fact that the base (level1) maps are mapped instead of
being static to reduce the memory footprint of an uninitialized allocator.

Reviewers: vitalybuka, eugenis, morehouse, flowerhack, dmmoore415, mcgrathr

Reviewed By: vitalybuka, morehouse

Subscribers: mgorny, delcypher, jfb, #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

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

llvm-svn: 355416

5 years agoRevert "[lldbtest] Check against the correct name for libcxxabi (macOS)."
Davide Italiano [Tue, 5 Mar 2019 17:21:55 +0000 (17:21 +0000)]
Revert "[lldbtest] Check against the correct name for libcxxabi (macOS)."

This passes locally but breaks on the bots. Maybe an SDK difference.
Reverting while I investigate.

llvm-svn: 355415

5 years agoTableGen: Allow lists to be concatenated through '#'
Javed Absar [Tue, 5 Mar 2019 17:16:07 +0000 (17:16 +0000)]
TableGen:  Allow lists to be concatenated through '#'

Currently one can concatenate strings using hash(#),
but not lists, although that would be a natural thing to do.

This patch allows one to write something like:
def : A<!listconcat([1,2], [3,4])>;
simply as :
def : A<[1,2] # [3,4]>;

This was missing feature was highlighted by Nicolai
at FOSDEM talk.

Reviewed by: nhaehnle, hfinkel

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

llvm-svn: 355414

5 years ago[lldb] Disable some of TestJITLoaderGDB.py tests on Windows
Yury Delendik [Tue, 5 Mar 2019 17:09:26 +0000 (17:09 +0000)]
[lldb] Disable some of TestJITLoaderGDB.py tests on Windows

The test expect sample executable code be built, but fails on Windows.

Review comment https://reviews.llvm.org/D57689#1418597

Tags: #lldb

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

llvm-svn: 355413

5 years ago[X86][SSE] Regenerate vector zero tests
Simon Pilgrim [Tue, 5 Mar 2019 16:52:14 +0000 (16:52 +0000)]
[X86][SSE] Regenerate vector zero tests

llvm-svn: 355412

5 years ago[SDAG] move FP constant folding to helper function; NFC
Sanjay Patel [Tue, 5 Mar 2019 16:42:33 +0000 (16:42 +0000)]
[SDAG] move FP constant folding to helper function; NFC

llvm-svn: 355411

5 years ago[HIP] Do not unbundle object files for -fno-gpu-rdc
Yaxun Liu [Tue, 5 Mar 2019 16:07:56 +0000 (16:07 +0000)]
[HIP] Do not unbundle object files for -fno-gpu-rdc

When -fno-gpu-rdc is set, device code is compiled, linked, and assembled into fat binary
and embedded as string in object files. The object files are normal object files which
can be linked by host linker. In the linking stage, the object files should not be unbundled
when -fno-gpu-rdc is set since they are normal object files, not bundles. The object files
only need to be unbundled when -fgpu-rdc is set.

Currently clang always unbundles object files, disregarding -fgpu-rdc option.

This patch fixes that.

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

llvm-svn: 355410

5 years ago[libc++] Fix <atomic> failures on GCC
Louis Dionne [Tue, 5 Mar 2019 15:49:58 +0000 (15:49 +0000)]
[libc++] Fix <atomic> failures on GCC

Summary:
In https://reviews.llvm.org/D58201, we turned memory_order into an enum
class in C++20 mode. However, we were not casting memory_order to its
underlying type correctly for the GCC implementation, which broke the
build bots. I also fixed a test that was failing in C++17 mode on GCC 5.

Reviewers: EricWF, jfb, mclow.lists

Subscribers: zoecarver

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

llvm-svn: 355409

5 years agoRevert "[GlobalISel][AArch64] Add selection support for G_EXTRACT_VECTOR_ELT"
Jessica Paquette [Tue, 5 Mar 2019 15:47:00 +0000 (15:47 +0000)]
Revert "[GlobalISel][AArch64] Add selection support for G_EXTRACT_VECTOR_ELT"

This broke test-suite::aarch64_neon_intrinsics.test

Reverting while I look into it.

Example failure:
http://lab.llvm.org:8011/builders/clang-cmake-aarch64-quick/builds/17740

llvm-svn: 355408

5 years ago[X86] Add SMULO/UMULO combine tests
Simon Pilgrim [Tue, 5 Mar 2019 15:36:45 +0000 (15:36 +0000)]
[X86] Add SMULO/UMULO combine tests

Include scalar and vector test variants covering the folds in DAGCombiner (vector isn't currently supported - PR40442)

llvm-svn: 355407

5 years agoRevert "Fix embedded Python initialization according to changes in version 3.7"
Tatyana Krasnukha [Tue, 5 Mar 2019 15:27:33 +0000 (15:27 +0000)]
Revert "Fix embedded Python initialization according to changes in version 3.7"

Testsuite hangs on Windows likely due to these changes.

llvm-svn: 355406

5 years agoFix typo in constant vector
Simon Pilgrim [Tue, 5 Mar 2019 15:06:01 +0000 (15:06 +0000)]
Fix typo in constant vector

llvm-svn: 355405

5 years ago[X86] Add SADDO/UADDO and SSUBO/USUBO combine tests
Simon Pilgrim [Tue, 5 Mar 2019 14:52:42 +0000 (14:52 +0000)]
[X86] Add SADDO/UADDO and SSUBO/USUBO combine tests

Include scalar and vector test variants covering the folds in DAGCombiner (vector isn't currently supported - PR40442)

llvm-svn: 355404

5 years ago[libc++] Change memory_order to an enum class
Louis Dionne [Tue, 5 Mar 2019 14:50:25 +0000 (14:50 +0000)]
[libc++] Change memory_order to an enum class

This implements P0439R0.

Thanks to Zoe Carver for the patch.
Differential Revision: https://reviews.llvm.org/D58201

llvm-svn: 355403

5 years agoAdds property to force enabling of GDB JIT loader for MacOS
Yury Delendik [Tue, 5 Mar 2019 14:23:53 +0000 (14:23 +0000)]
Adds property to force enabling of GDB JIT loader for MacOS

Summary:
Based on https://gist.github.com/thlorenz/30bf0a3f67b1d97b2945#patching-and-rebuilding

The functionality was disabled at https://github.com/llvm/llvm-project/commit/521c2278abb16f0148cef1bd061cadb01ef43192

Reviewers: jingham

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 355402

5 years ago[clang-tidy] Fix bugprone-string-constructor crash
Alexander Kornienko [Tue, 5 Mar 2019 14:09:57 +0000 (14:09 +0000)]
[clang-tidy] Fix bugprone-string-constructor crash

llvm-svn: 355401

5 years ago[X86] Add test cases for D58874
Simon Pilgrim [Tue, 5 Mar 2019 13:52:09 +0000 (13:52 +0000)]
[X86] Add test cases for D58874

Add scalar and vector test cases for missing (add (add (xor a, -1), b), 1) -> (sub b, a) fold

llvm-svn: 355400

5 years ago[llvm-objcopy] - Simplify `isCompressable` and fix the issue relative.
George Rimar [Tue, 5 Mar 2019 13:07:43 +0000 (13:07 +0000)]
[llvm-objcopy] - Simplify `isCompressable` and fix the issue relative.

When --compress-debug-sections is given, llvm-objcopy do not compress
sections that have "ZLIB" header in data. Normally this signature is used
in zlib-gnu compression format. But if zlib-gnu used then the name of the compressed
section should start from .z* (e.g .zdebug_info). If it does not, then it is not
a zlib-gnu format and section should be treated as a normal uncompressed section.

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

llvm-svn: 355399

5 years agoOne more UserIDResolver fix
Pavel Labath [Tue, 5 Mar 2019 12:51:20 +0000 (12:51 +0000)]
One more UserIDResolver fix

The intention in r355323 has been to implement a no-op resolver in the
HostInfoBase class, which will then be shadowed a an implementation in
the HostInfoPosix class. However, I add the shadowing declaration in
HostInfoPosix.h, and instead had implemented the HostInfoBase function
in HostInfoPosix.cpp. This has lead to undefined symbols on windows, and
a subsequent implementation of a no-op resolver in HostInfoWindows
(r355329).

Since now there is no point on having a no-op resolver in the base
class, I just remove the base declaration altogether, and have
HostInfoPosix implement the (newly-declared) HostInfoPosix version of
that function.

llvm-svn: 355398

5 years ago[sanitizers] Don't use Windows Trace Logging with Clang in MSVC mode either
Martin Storsjo [Tue, 5 Mar 2019 12:50:06 +0000 (12:50 +0000)]
[sanitizers] Don't use Windows Trace Logging with Clang in MSVC mode either

The TraceLoggingProvider.h header does work with clang-cl in general
these days with Win SDK 10.0.17763.0, but when compiled in 32 bit x86
mode, with the -Z7 flag, compilation fails with the following error:

fatal error: error in backend: assembler label '' can not be undefined

With older Win SDKs, there are other build failures (regardless of
architecture or the -Z7 flag).

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

llvm-svn: 355397

5 years ago[analyzer] Fix taint propagation in GenericTaintChecker
Kristof Umann [Tue, 5 Mar 2019 12:42:59 +0000 (12:42 +0000)]
[analyzer] Fix taint propagation in GenericTaintChecker

The gets function has no SrcArgs. Because the default value for isTainted was
false, it didn't mark its DstArgs as tainted.

Patch by Gábor Borsik!

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

llvm-svn: 355396

5 years ago[ASTMatchers] Improved formatting in a documentation comment
Dmitri Gribenko [Tue, 5 Mar 2019 12:38:18 +0000 (12:38 +0000)]
[ASTMatchers] Improved formatting in a documentation comment

llvm-svn: 355395

5 years ago[AMDGPU] Fix DPP operand order in atomic optimizer
Carl Ritson [Tue, 5 Mar 2019 12:21:44 +0000 (12:21 +0000)]
[AMDGPU] Fix DPP operand order in atomic optimizer

Summary:
Ensure order of operands in DPP atomic optimizer final WWM step is appropriate for sub instructions.

Change-Id: I631d050e1c00a3b4bc7c11a90437064403c4cf30

Reviewers: sheredom, tpr

Reviewed By: sheredom

Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, t-tye, jfb, llvm-commits

Tags: #llvm

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

llvm-svn: 355394