Commit Graph

311389 Commits

Author SHA1 Message Date
Michal Gorny 2508fcff60 [lldb] [lit] Attempt to fix regex in toolchain-clang.test
llvm-svn: 355510
2019-03-06 14:49:48 +00:00
Pavel Labath b8093314ef Move RangeMap.h into Utility
Summary:
This file implements some general purpose data structures, and so it
belongs to the Utility module.

Reviewers: zturner, jingham, JDevlieghere, clayborg, espindola

Subscribers: emaste, mgorny, javed.absar, arichardson, MaskRay, lldb-commits

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

llvm-svn: 355509
2019-03-06 14:41:43 +00:00
Sanjay Patel 89e534746f [TargetLowering] simplify code for uaddsat/usubsat expansion; NFC
llvm-svn: 355508
2019-03-06 14:34:59 +00:00
Francis Visoiu Mistrih 9052f50cb4 [Remarks] Refactor remark diagnostic emission in a RemarkStreamer
This allows us to store more info about where we're emitting the remarks
without cluttering LLVMContext. This is needed for future support for
the remark section.

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

llvm-svn: 355507
2019-03-06 14:32:08 +00:00
Simon Pilgrim 1bdc2d1874 [DAGCombiner] Add SADDO/SSUBO combine support
Basic constant handling folds, for both scalars and vectors

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

llvm-svn: 355506
2019-03-06 14:22:21 +00:00
George Rimar 281a5beefa [llvm-objcopy] - Remove dead code. NFCI.
DecompressedSection can only be created if --decompress-debug-sections is specified.
https://github.com/llvm-mirror/llvm/blob/master/tools/llvm-objcopy/ELF/ELFObjcopy.cpp#L492

If it is specified when !zlib::isAvailable(), we error out early when parsing the options:
https://github.com/llvm-mirror/llvm/blob/master/tools/llvm-objcopy/CopyConfig.cpp#L657

What means the code I am removing in this patch is dead.

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

llvm-svn: 355505
2019-03-06 14:12:18 +00:00
Pavel Labath 89eb7bb3f6 Expose template parameters of endian specific types as class members
Summary:
This allows generic code to query these parameters, and is a common
practice in a lot of other template classes.

Reviewers: zturner, Bigcheese

Subscribers: kristina, llvm-commits

Tags: #llvm

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

llvm-svn: 355504
2019-03-06 14:09:02 +00:00
George Rimar 5f0b7d2f46 [llvm-objcopy] - Remove an excessive zlib::isAvailable() check and dead code.
There are 2 places where llvm-objcopy creates CompressedSection:

For --compress-debug-sections. It might create the compressed section from
regular here:
https://github.com/llvm-mirror/llvm/blob/master/tools/llvm-objcopy/ELF/ELFObjcopy.cpp#L486

All initially compressed sections are created as CompressedSection during reading the sections
from an object:
https://github.com/llvm-mirror/llvm/blob/master/tools/llvm-objcopy/ELF/Object.cpp#L1118
Those have DebugCompressionType::None type and a different constructor.

Case 1 has the following code in its constructor:

if (!zlib::isAvailable()) {
  CompressionType = DebugCompressionType::None;
  return;
}
(https://github.com/llvm-mirror/llvm/blob/master/tools/llvm-objcopy/ELF/Object.cpp#L267)

We can never reach that code with because would report an error much earlier:
https://github.com/llvm-mirror/llvm/blob/master/tools/llvm-objcopy/CopyConfig.cpp#L480

So the code I am removing is dead. Landing this will address the issue mentioned in https://bugs.llvm.org/show_bug.cgi?id=40886.

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

llvm-svn: 355503
2019-03-06 14:08:27 +00:00
Michal Gorny a2cc148f9f [lldb] [test] Pass appropriate -L&-Wl,-rpath for libc++ on NetBSD
Pass appropriate -L and -Wl,-rpath flags pointing out to the LLVM
library directory on NetBSD.  This is necessary since clang on NetBSD
requires libc++ but it is not installed as part of the system
by default.  For the purpose of running buildbot, we want LLDB to use
just-built libc++.

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

llvm-svn: 355502
2019-03-06 14:03:18 +00:00
George Rimar f2eb8caa3f [llvm-objcopy] - Fix incorrect CompressedSection creation.
We should create CompressedSection only if the section has SHF_COMPRESSED flag
or it's name starts from '.zdebug'.
Currently, we create it if section's data starts from ZLIB signature.

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

llvm-svn: 355501
2019-03-06 14:01:54 +00:00
George Rimar a033572d67 [LLD][ELF] - Convert common-symbol-alignment.s test to yaml.
This removes 2 precompiled binaries from the inputs.

llvm-svn: 355500
2019-03-06 13:49:41 +00:00
Anastasia Stulova d3ae87ee0d [PR40778] Add addr space conversion when binding reference to a temporary.
This change fixes temporary materialization to happen in the right
(default) address space when binding to it a reference of different type.

It adds address space conversion afterwards to match the addr space
of a reference.

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

llvm-svn: 355499
2019-03-06 13:02:41 +00:00
Simon Pilgrim 3f37538b86 [llvm-mca][X86] Add ADC/SBB with zero test cases
Some targets have fast-path handling for these patterns that we should model.

llvm-svn: 355498
2019-03-06 12:51:16 +00:00
George Rimar d024a9fab3 [LLD][ELF] - Remove unused invalid input object. NFC.
It was introduced by me in 2016: r290335,
but the test did contain the YAML from start,
I think it was committed by mistake.

llvm-svn: 355497
2019-03-06 12:37:46 +00:00
Roman Lebedev 4764310505 [X86][NFC] Autogenerate check lines in cmovcmov.ll test
Investigating 8-bit cmov promotion, this test comes up.

llvm-svn: 355496
2019-03-06 11:47:43 +00:00
Simon Pilgrim 642f53d292 [DAGCombiner] Enable SMULO/UMULO vector combine support (PR40442)
Differential Revision: https://reviews.llvm.org/D58968

llvm-svn: 355495
2019-03-06 11:04:21 +00:00
Simon Pilgrim 468bb2e601 [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
2019-03-06 10:54:43 +00:00
Haojian Wu 24a8f1ccb9 [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
2019-03-06 10:51:38 +00:00
Hans Wennborg dd1ea8abb7 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
2019-03-06 10:26:19 +00:00
Ayonam Ray 2a0f2c5ef3 [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
2019-03-06 10:01:02 +00:00
Hans Wennborg 7219c7e9af clang-cl: Parse /Qspectre and a few other missing options (PR40964)
llvm-svn: 355489
2019-03-06 09:38:04 +00:00
Martin Liska a25a2c7c9a Always compare C++ typeinfo (based on libstdc++ implementation).
Differential Revision: https://reviews.llvm.org/D58028

llvm-svn: 355488
2019-03-06 08:36:50 +00:00
Ayonam Ray af92b7a3b8 Reversing the commit of revision 355483 since it is giving a regression on a newly added test.
llvm-svn: 355487
2019-03-06 07:51:28 +00:00
Roman Lebedev 0457388125 [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
2019-03-06 07:45:10 +00:00
Craig Topper c0e01d29a4 [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
2019-03-06 07:36:38 +00:00
Craig Topper 97a1c4c340 [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
2019-03-06 07:36:36 +00:00
Ayonam Ray 6025fa8e30 [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
2019-03-06 07:27:45 +00:00
Duncan P. N. Exon Smith a75c4df524 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
2019-03-06 05:42:56 +00:00
Marshall Clow 8eda3ad29d Eradicate all the ptrdiff_ts in span left over from applying P1227. A couple of other minor cleanups. NFC
llvm-svn: 355481
2019-03-06 03:59:44 +00:00
Peter Collingbourne c2d6b84d3c gn build: Merge r355439.
llvm-svn: 355480
2019-03-06 03:08:06 +00:00
Peter Collingbourne 5ee9abd4c8 ELF: De-template OutputSection::finalize() and MipsGotSection::build(). NFCI.
Differential Revision: https://reviews.llvm.org/D58810

llvm-svn: 355479
2019-03-06 03:07:57 +00:00
Peter Collingbourne 704dfd6e28 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
2019-03-06 03:07:48 +00:00
Duncan P. N. Exon Smith 9dda8f540c 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
2019-03-06 02:50:46 +00:00
Jason Molenda 4cc9ff1245 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
2019-03-06 02:45:27 +00:00
QingShan Zhang 6a8aa0e898 [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
2019-03-06 02:39:18 +00:00
Craig Topper 112ea336c3 [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
2019-03-06 02:36:48 +00:00
Jason Molenda b459f182e8 Re-commit logging for SBCompileUnit::GetNumLineEntries.
llvm-svn: 355473
2019-03-06 02:32:45 +00:00
Heejin Ahn 3c20b34d24 [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
2019-03-06 02:00:22 +00:00
Alex Langford a4223f9e5f [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
2019-03-06 01:57:04 +00:00
Jonas Devlieghere 2e3e65fb62 [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
2019-03-06 01:49:57 +00:00
Jonas Devlieghere 7e23df4437 [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
2019-03-06 01:49:54 +00:00
Xing GUO dd440675cf [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;
		}
	}
```
80192cd83b/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
2019-03-06 01:28:40 +00:00
Peter Collingbourne dbdfd43b57 gn build: Add 32-bit Linux support.
Differential Revision: https://reviews.llvm.org/D58839

llvm-svn: 355467
2019-03-06 01:28:32 +00:00
Adrian Prantl 61f1b70a78 Replace debug-only assert with a plain old assert.
llvm-svn: 355466
2019-03-06 01:07:45 +00:00
Jonas Devlieghere 3c28c0b2aa [Reproducers] Undef LLDB_REPRO_INSTR_TRACE
Forgot to undef this before landing.

llvm-svn: 355465
2019-03-06 01:00:36 +00:00
Jonas Devlieghere 504be84c9f [Reproducers] Fix warnings without asserts
Make sure the variable is used when asserts are compiled out.

llvm-svn: 355464
2019-03-06 00:52:48 +00:00
Alex Langford 787fe33434 [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
2019-03-06 00:45:16 +00:00
Leonard Chan 8f7caae00a [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
2019-03-06 00:28:43 +00:00
Mitch Phillips f0c21e2ff5 Revert "[AtomicExpand] Allow libcall expansion for non-zero address spaces" for buildbot failures.
llvm-svn: 355461
2019-03-06 00:25:40 +00:00
Florian Hahn 13bbcb3264 [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
2019-03-06 00:10:03 +00:00