Commit Graph

261054 Commits

Author SHA1 Message Date
Rui Ueyama 85a5e69ced Simplify by using getString instead of getLastArg. NFC.
llvm-svn: 301758
2017-04-29 22:56:38 +00:00
Rui Ueyama 543161a10c Report an error if --compress-debug-sections is given while zlib is not availble.
llvm-svn: 301757
2017-04-29 22:56:24 +00:00
Daniel Sanders 887a141d4d [globalisel][tablegen] Fix the test after silencing the unused variable warning in r301755.
llvm-svn: 301756
2017-04-29 19:46:27 +00:00
Daniel Sanders ce9443df23 [globalisel][tablegen] Silence unused variable warning.
llvm-svn: 301755
2017-04-29 19:10:19 +00:00
Rui Ueyama 3969acf8a4 Port recent changes to ELF/MapFile.cpp to COFF.
llvm-svn: 301754
2017-04-29 18:50:39 +00:00
Craig Topper 8c5c6fe48e [ConstantRange] Use APInt::getOneBitSet to shorten some code. NFC
llvm-svn: 301753
2017-04-29 17:59:41 +00:00
Craig Topper 335597f31b [ConstantRange] Replace getMaxValue+zext with getLowBitsSet. Replace zero-init+setBit with getOneBitSet. NFC
llvm-svn: 301752
2017-04-29 17:46:13 +00:00
Craig Topper 685327dd99 [ConstantRange] Use APInt::operator-= to remove temporary APInts.
llvm-svn: 301751
2017-04-29 17:46:11 +00:00
Daniel Sanders e9fdba39e0 [globalisel][tablegen] Compute available feature bits correctly.
Summary:
Predicate<> now has a field to indicate how often it must be recomputed.
Currently, there are two frequencies, per-module (RecomputePerFunction==0)
and per-function (RecomputePerFunction==1). Per-function predicates are
currently recomputed more frequently than necessary since the only predicate
in this category is cheap to test. Per-module predicates are now computed in
getSubtargetImpl() while per-function predicates are computed in selectImpl().

Tablegen now manages the PredicateBitset internally. It should only be
necessary to add the required includes.

Also fixed a problem revealed by the test case where
constrainSelectedInstRegOperands() would attempt to tie operands that
BuildMI had already tied.

Reviewers: ab, qcolombet, t.p.northover, rovka, aditya_nandakumar

Reviewed By: rovka

Subscribers: kristof.beyls, igorb, llvm-commits

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

llvm-svn: 301750
2017-04-29 17:30:09 +00:00
Simon Pilgrim 96d02f5503 [X86][AVX] Added support for _mm256_zext* helper intrinsics (PR32839)
llvm-svn: 301749
2017-04-29 17:17:06 +00:00
Simon Pilgrim 694cb2c838 [X86][AVX] Added codegen tests for _mm256_zext* helper intrinsics (PR32839)
Not great codegen, especially as VEX moves support implicit zeroing of upper bits....

llvm-svn: 301748
2017-04-29 17:15:12 +00:00
Craig Topper ca48af3c87 [KnownBits] Add methods for determining if the known bits represent a negative/nonnegative number and add methods for changing the negative/nonnegative state
Summary: This patch adds isNegative, isNonNegative for querying whether the sign bit is known. It also adds makeNegative and makeNonNegative for controlling the sign bit.

Reviewers: RKSimon, spatel, davide

Reviewed By: RKSimon

Subscribers: llvm-commits

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

llvm-svn: 301747
2017-04-29 16:43:11 +00:00
Simon Dardis 9d580e8528 [mips][FastISel] Fix a nullptr deference.
r301392 introduced a potential nullptr deference causing compilation
failures.

llvm-svn: 301746
2017-04-29 16:31:40 +00:00
Rafael Espindola de8d9897d9 Bring back r301678.
This version uses a set to speed up the synchronize method.

Original message:

    Remove LinkerScript::flush.

    This patch replaces flush with a last ditch attempt at synchronizing
    the section list with the linker script "AST".

    The synchronization is a bit of a hack and should in time be avoided
    by creating the AST earlier so that modifications can be made directly
    to it instead of modifying the section list and synchronizing it back.

    This is the main step for fixing
    https://bugs.llvm.org/show_bug.cgi?id=32816. With this in place I
    think the only missing thing would be to have processCommands assign
    section indexes as dummy offsets so that the sort in
    OutputSection::finalize works.

    With this LinkerScript::assignAddresses becomes much simpler, which
    should help with the thunk work.

llvm-svn: 301745
2017-04-29 15:44:03 +00:00
Simon Pilgrim ac7f3e24d3 [X86][SSE] Add initial <2 x half> tests for PR31088
As discussed on D32391, test X86/X64 SSE2 and X64 F16C.

llvm-svn: 301744
2017-04-29 14:29:06 +00:00
Alexander Kornienko 4e001b5bd7 [clang-tidy] Expand AllowConditional*Casts to binary logical operators
llvm-svn: 301743
2017-04-29 12:06:45 +00:00
Nick Lewycky e7d6fbdfb7 Remove Sema::CheckForIntOverflow, and instead check all full-expressions.
CheckForIntOverflow used to implement a whitelist of top-level expressions to
send to the constant expression evaluator, which handled many more expressions
than the CheckForIntOverflow whitelist did.

llvm-svn: 301742
2017-04-29 09:33:46 +00:00
Craig Topper 8fb5a14cad [ConstantRange] Use ternary operator instead of 'if' to avoid copying an APInt and then possibly copying over it.
llvm-svn: 301741
2017-04-29 07:24:13 +00:00
Craig Topper b792025bed [ConstantRange] Add std::move to a bunch of places that pass local APInts to ConstantRange constructor.
The ConstantRange constructor takes APInt by value so without these moves we are making copies.

llvm-svn: 301740
2017-04-29 06:40:47 +00:00
Zachary Turner df1d97614b Remove unused private field.
llvm-svn: 301738
2017-04-29 05:30:19 +00:00
Craig Topper 6fe50f84c4 [ConstantRange] Remove a temporary APInt I meant to delete in r300621. NFC
llvm-svn: 301737
2017-04-29 05:24:34 +00:00
Craig Topper ee4f22dc2d [ConstantRange] Improve the efficiency of one of the ConstantRange constructors.
We were default constructing the Lower/Upper APInts. Then creating min or max value, then doing a move assignment to Lower and copy assignment to upper. The copy assignment operator in particular has an out of line function call that has to examine whether or not a previous allocation exists that can be reused which of course it can't in this case.

The new code creates the min/max value first, move constructs Lower from it then copy constructs Upper from Lower.

This also seems to have convinced a self host build that this constructor can be inlined more readily into other methods in ConstantRange.

llvm-svn: 301736
2017-04-29 05:08:52 +00:00
Faisal Vali 1f961df10c Fix PR32831: 'this capture while instantiating generic lambda call operator specialization
When computing the appropriate cv-qualifiers for the 'this' capture, we have to examine each enclosing lambda - but when using the FunctionScopeInfo stack we have to ensure that the lambda below (outer) is the decl-context of the closure-class of the current lambda.

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

llvm-svn: 301735
2017-04-29 03:49:17 +00:00
Hongbin Zheng e9a9932712 [Polly] Make PollyCore depends on intrinsics_gen
llvm-svn: 301734
2017-04-29 03:12:17 +00:00
Richard Smith f893cc6bd3 Remove some apparently-unnecessary 'REQUIRES: system-darwin' from tests.
Let's see if any buildbots actually have trouble with these. (They at least pass on Linux.)

llvm-svn: 301732
2017-04-29 01:38:29 +00:00
Richard Smith d3935ae1f2 Fix "REQUIRES: system-darwin" failing tests after r301725.
Also remove the apparently-unneeded REQUIRES (the tests also pass on at least
Linux, and don't appear to have anything Darwin-specific in them).

llvm-svn: 301731
2017-04-29 01:29:44 +00:00
Matt Arsenault 2a80369ae4 AMDGPU: Fix copies from physical registers in SIFixSGPRCopies
This would assert when there were multiple defs of
a physical register.

We just need to move all of the users of it.

llvm-svn: 301730
2017-04-29 01:26:34 +00:00
Davide Italiano d765638ad1 [ELF] When a rel points to a SHF_MERGE section, don't merge the sec.
Fixes PR32785. Thanks to Piotr Padlewski for the report and
Rafael for the fix.

llvm-svn: 301729
2017-04-29 01:24:34 +00:00
Zachary Turner 5b6e4e0aed [llvm-pdbdump] Abstract some of the YAML/Raw printing code.
There is a lot of duplicate code for printing line info between
YAML and the raw output printer.  This introduces a base class
that can be shared between the two, and makes some minor
cleanups in the process.

llvm-svn: 301728
2017-04-29 01:13:21 +00:00
Richard Smith c7cacdc332 PR26771: don't forget the " 2" (returning from #included file) linemarker after including an empty file with -frewrite-includes.
llvm-svn: 301727
2017-04-29 00:54:03 +00:00
Richard Smith ced8d3aaa9 Remove unused, empty test directories.
llvm-svn: 301726
2017-04-29 00:46:27 +00:00
Richard Smith c51c38b4ec Add pragma to perform module import and use it in -E output.
Many of our supported configurations support modules but do not have any
first-class syntax to perform a module import. This leaves us with a problem:
there is no way to represent the expansion of a #include that imports a module
in the -E output for such languages. (We don't want to just leave it as a
#include because that requires the consumer of the preprocessed source to have
the same file system layout and include paths as the creator.)

This patch adds a new pragma:

  #pragma clang module import MODULE.NAME.HERE

that imports a module, and changes -E and -frewrite-includes to use it when
rewriting a #include that maps to a module import. We don't make any attempt
to use a native language syntax import if one exists, to get more consistent
output. (If in the future, @import and #include have different semantics in
some way, the pragma will track the #include semantics.)

llvm-svn: 301725
2017-04-29 00:34:47 +00:00
Akira Hatanaka 6fdcb3c2ce [ObjCARC] Do not move a release between a call and a
retainAutoreleasedReturnValue that retains the returned value.

This commit fixes a bug in ARC optimizer where it moves a release
between a call and a retainAutoreleasedReturnValue, causing the returned
object to be released before the retainAutoreleasedReturnValue can
retain it.

This commit accomplishes that by doing a lookahead and checking whether
the call prevents the release from moving upwards. In the long term, we
should treat the region between the retainAutoreleasedReturnValue and
the call as a critical section and disallow moving anything there
(possibly using operand bundles).

rdar://problem/20449878

llvm-svn: 301724
2017-04-29 00:23:11 +00:00
Davide Italiano 0aaa96a07b [LoopUnswitch] Make DEBUG output more readable (part 2).
I fixed my miscompile in r301722 and I hope I don't have to take
a look at this code again now that Chandler has a new LoopUnswitch
pass, but maybe this could be of use for somebody else in the
meanwhile.

llvm-svn: 301723
2017-04-29 00:18:26 +00:00
Davide Italiano 534e314356 [LoopUnswitch] Don't remove instructions with side effects.
This fixes PR32818.

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

llvm-svn: 301722
2017-04-29 00:12:18 +00:00
Nick Lewycky 19ae6dc853 ObjCBoxedExpr can't be evaluated by the constant expression evaluator.
A boxed expression evaluates its subexpr and then calls an objc method to transform it into another value with pointer type. The objc method can never be constexpr and therefore this expression can never be evaluated. Fixes a miscompile boxing expressions with side-effects.

Also make ObjCBoxedExpr handling a normal part of the expression evaluator instead of being the only case besides full-expression where we check for integer overflow.

llvm-svn: 301721
2017-04-29 00:07:27 +00:00
Zachary Turner 4346ae1a05 [llvm-readobj] Fix incorrect printing of CV column info.
llvm-svn: 301720
2017-04-29 00:03:32 +00:00
Duncan P. N. Exon Smith 05531ca19b Fuzzer: Mark test/cxxstring.test UNSUPPORTED: windows
This has been mysteriously failing since r301593, which cleaned up the
types of things like size_t and SIZE_MAX for freestanding targets.  Reid
and Kostya suggested marking it as UNSUPPORTED on windows, given that no
one has been able to reproduce locally.

llvm-svn: 301719
2017-04-28 23:59:53 +00:00
Zachary Turner 05bd9f3713 [llvm-readobj] Use LLVMDebugInfoCodeView to parse line tables.
The llvm-readobj parsing code currently exists in our CodeView
library, so we use that to parse instead of re-writing the logic
in the tool.

llvm-svn: 301718
2017-04-28 23:41:36 +00:00
Zachary Turner 6cbc5638cb [Support] Provide unsafe random access for VarStreamArray.
llvm-svn: 301716
2017-04-28 23:29:33 +00:00
Rui Ueyama 3151958cbd Replace PrettyPrinter class in MapFile.cpp with a few non-member functions.
Since the output format has been simplified, the class to print
out a map file doesn't seem to be needed anymore. We can replace
it with a few non-member functions.

llvm-svn: 301715
2017-04-28 23:29:15 +00:00
Sanjay Patel c8ab6bb27d [InstCombine] add tests to show potentially bogus application of DeMorgan (NFC)
llvm-svn: 301714
2017-04-28 23:14:33 +00:00
Hans Wennborg 513dc805eb Remove set but unused variable in BitcodeReader.cpp. NFC.
llvm-svn: 301713
2017-04-28 23:11:16 +00:00
Hans Wennborg 0f88d863b4 Revert r301697 "[IR] Make add/remove Attributes use AttrBuilder instead of AttributeList"
This broke the Clang build. (Clang-side patch missing?)

Original commit message:

> [IR] Make add/remove Attributes use AttrBuilder instead of
> AttributeList
>
> This change cleans up call sites and avoids creating temporary
> AttributeList objects.
>
> NFC

llvm-svn: 301712
2017-04-28 23:01:32 +00:00
Matt Arsenault e0f9e984fd InferAddressSpaces: Search constant expressions for addrspacecasts
These are pretty common when using local memory, and the 64-bit generic
addressing is much more expensive to compute.

llvm-svn: 301711
2017-04-28 22:52:41 +00:00
Rui Ueyama e2f11690fe Eliminate .debug_gnu_pub{names,types} if -gdb-index is given.
This patch is to ignore .debug_gnu_pub{names,types} sections if the
-gdb-index option was given.

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

llvm-svn: 301710
2017-04-28 22:46:55 +00:00
Rui Ueyama 216aa11cc5 Revert r301678: Remove LinkerScript::flush.
This reverts commit r301678 since that change significantly slowed
down the linker. Before this patch, LLD could link clang in 8 seconds,
but with this patch it took 40 seconds.

llvm-svn: 301709
2017-04-28 22:40:58 +00:00
Adrian Prantl 6ee72d743b Adapt to LLVM API change (DINamespace no longer takes line/file info).
rdar://problem/17484998
https://reviews.llvm.org/D32648

llvm-svn: 301707
2017-04-28 22:25:53 +00:00
Adrian Prantl fed4f399d3 Remove line and file from DINamespace.
Fixes the issue highlighted in
http://lists.llvm.org/pipermail/cfe-dev/2014-June/037500.html.

The DW_AT_decl_file and DW_AT_decl_line attributes on namespaces can
prevent LLVM from uniquing types that are in the same namespace. They
also don't carry any meaningful information.

rdar://problem/17484998
Differential Revision: https://reviews.llvm.org/D32648

llvm-svn: 301706
2017-04-28 22:25:46 +00:00
Matt Arsenault c20ccd2c02 InferAddressSpaces: Avoid looking up deleted values
While looking at pure addressing expressions, it's possible
for the value to appear later in Postorder.

I haven't been able to come up with a testcase where this
exhibits an actual issue, but if you insert a dump before
the value map lookup, a few testcases crash.

llvm-svn: 301705
2017-04-28 22:18:19 +00:00