Gabor Horvath [Wed, 4 May 2016 11:59:39 +0000 (11:59 +0000)]
[ASTMatchers] New matcher forFunction
Summary: Matcher proposed in the review of checker misc-assign-operator (name pending). Its goal is to find the direct enclosing function declaration of a statement and run the inner matcher on it. Two version is attached in this patch (thus it will not compile), to be decided which approach to take. The second one always chooses one single parent while the first one does a depth-first search upwards (thus a height-first search) and returns the first positive match of the inner matcher (thus it always returns zero or one matches, not more). Further questions: is it enough to implement it in-place, or ASTMatchersInternals or maybe ASTMatchFinder should be involved?
Reviewers: sbenza
Subscribers: aaron.ballman, klimek, o.gyorgy, xazax.hun, cfe-commits
Differential Revision: http://reviews.llvm.org/D19357
llvm-svn: 268490
Andrey Turetskiy [Wed, 4 May 2016 11:28:22 +0000 (11:28 +0000)]
[X86] Add -m[no-]x87 and -m[no-]80387 options to control FeatureX87.
Add -m[no-]x87 and -m[no-]80387 options to control FeatureX87.
-m[no-]80387 options is added for compatibility with GCC.
Differential Revision: http://reviews.llvm.org/D19658
llvm-svn: 268489
Andrey Turetskiy [Wed, 4 May 2016 11:19:41 +0000 (11:19 +0000)]
Add missing -mno-cx16 driver option.
Differential Revision: http://reviews.llvm.org/D19658
llvm-svn: 268488
Andrey Turetskiy [Wed, 4 May 2016 11:10:29 +0000 (11:10 +0000)]
Add a test for driver options from m_x86_Features_Group.
Differential Revision: http://reviews.llvm.org/D19658
llvm-svn: 268487
Simon Atanasyan [Wed, 4 May 2016 10:15:12 +0000 (10:15 +0000)]
[ELF][MIPS] Fix typo in the comment. NFC.
llvm-svn: 268486
Simon Atanasyan [Wed, 4 May 2016 10:07:38 +0000 (10:07 +0000)]
[ELF][MIPS] Read/write .MIPS.options section
MIPS N64 ABI introduces .MIPS.options section which specifies miscellaneous
options to be applied to an object/shared/executable file. LLVM as well as
modern versions of GNU tools read and write the only type of the options -
ODK_REGINFO. It is exact copy of .reginfo section used by O32 ABI.
llvm-svn: 268485
Manuel Klimek [Wed, 4 May 2016 09:45:44 +0000 (09:45 +0000)]
When renaming a class, ename pointers to that class as well.
Patch by Miklos Vajna.
llvm-svn: 268484
Chris Dewhurst [Wed, 4 May 2016 09:33:30 +0000 (09:33 +0000)]
[Sparc] Implement __builtin_setjmp, __builtin_longjmp back-end.
This code implements builtin_setjmp and builtin_longjmp exception handling intrinsics for 32-bit Sparc back-ends.
The code started as a mash-up of the PowerPC and X86 versions, although there are sufficient differences to both that had to be made for Sparc handling.
Note: I have manual tests running. I'll work on a unit test and add that to the rest of this diff in the next day.
Also, this implementation is only for 32-bit Sparc. I haven't focussed on a 64-bit version, although I have left the code in a prepared state for implementing this, including detecting pointer size and comments indicating where I suspect there may be differences.
Differential Revision: http://reviews.llvm.org/D19798
llvm-svn: 268483
Daniel Sanders [Wed, 4 May 2016 09:08:35 +0000 (09:08 +0000)]
[mips] Remove -mattr=+n64 and fix indentation in tailcall.ll RUN lines. NFC.
-mattr=+n64 isn't the correct way to specify the ABI and N64 is already the
default for the RUN line concerned.
llvm-svn: 268482
Michael Zuckerman [Wed, 4 May 2016 08:55:11 +0000 (08:55 +0000)]
[Clang][Builtin][AVX512] Adding intrinsics fot cvt{u}si2s{d|s} cvt{sd|ss}2{ss|sd} instruction set
Differential Revision: http://reviews.llvm.org/D19765
llvm-svn: 268481
Eric Liu [Wed, 4 May 2016 08:22:35 +0000 (08:22 +0000)]
Added XrefsDBManager into include-fixer and made XrefsDB return SymbolInfo.
Summary: Added XrefsDBManager into include-fixer and made XrefsDB return SymbolInfo.
Reviewers: hokein, djasper, klimek
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D19869
llvm-svn: 268480
David Majnemer [Wed, 4 May 2016 06:13:33 +0000 (06:13 +0000)]
[ConstantFolding, ValueTracking] Fold constants involving bitcasts of ConstantVector
We assumed that ConstantVectors would be rather uninteresting from the
perspective of analysis. However, this is not the case due to a quirk
of how LLVM handles vectors of i1. Vectors of i1 are not
ConstantDataVectors like vectors of i8, i16, i32 or i64 because i1's
SizeInBits differs from it's StoreSizeInBytes. This leads to it being
categorized as a ConstantVector instead of a ConstantDataVector.
Instead, treat ConstantVector more uniformly.
This fixes PR27591.
llvm-svn: 268479
Simon Atanasyan [Wed, 4 May 2016 05:58:57 +0000 (05:58 +0000)]
[llvm-readobj] Print MIPS .MIPS.options section content
.MIPS.options section specifies miscellaneous options to be applied
to an object file. LLVM as well as modern versions of GNU tools emit
the only type of the options - ODK_REGINFO. The patch teaches llvm-readobj
to print details of the ODK_REGINFO and skip contents of other options.
llvm-svn: 268478
Saleem Abdulrasool [Wed, 4 May 2016 04:22:29 +0000 (04:22 +0000)]
libc++abi: fix visibility of personalities
The personality routines need to be exposed to the users as the functions
reference the personality routine to handle exceptions.
llvm-svn: 268477
Davide Italiano [Wed, 4 May 2016 03:21:20 +0000 (03:21 +0000)]
[IPO/ConstantMerge] Convert to static function, to facilitate transition to the new PM.
llvm-svn: 268476
Jason Molenda [Wed, 4 May 2016 03:09:40 +0000 (03:09 +0000)]
Add a way for an ObjectFile to indicate that assembly emulation
should not be used for this module -- for use when an ObjectFile
knows that it does not have meaningful or accurate function start
addresses.
More commonly, it is not clear that function start addresses are
missing in a module. There are certain cases on Mac OS X where we
can tell that a Mach-O binary has been stripped of this essential
information, and the unwinder can end up emulating many megabytes
of instructions for a single "function" in the binary.
When a Mach-O binary is missing both an LC_FUNCTION_STARTS load
command (very unusual) and an eh_frame section, then we will assume
it has also been stripped of symbols and that instruction emulation
will not be useful on this module.
<rdar://problem/
25988067>
llvm-svn: 268475
Reid Kleckner [Wed, 4 May 2016 02:58:24 +0000 (02:58 +0000)]
[X86] Add -malign-double support
The -malign-double flag causes i64 and f64 types to have alignment 8
instead of 4. On x86-64, the behavior of -malign-double is enabled by default.
Rebases and cleans phosek's work here: http://reviews.llvm.org/D12860
Patch by Sean Klein
Reviewers: rnk
Subscribers: rnk, jfb, dschuff, phosek
Differential Revision: http://reviews.llvm.org/D19734
llvm-svn: 268473
Zachary Turner [Wed, 4 May 2016 01:46:59 +0000 (01:46 +0000)]
Make ListScope and DictScope re-use the same code.
llvm-svn: 268472
Ben Langmuir [Wed, 4 May 2016 00:53:13 +0000 (00:53 +0000)]
Fix CodeCompletion & TypoCorrection when combining a PCH with Modules
This commit fixes the IdentifierIterator to actually include identifiers
from a PCH or precompiled preamble when there is also a global module
index. This was causing code-completion (outside of C++) and
typo-correction to be missing global identifiers defined in the
PCH/preamble. Typo-correction has been broken since we first started
using the module index, whereas code-completion only started relying on
identifier iterator in r232793.
rdar://problem/
25642879
llvm-svn: 268471
David Majnemer [Wed, 4 May 2016 00:22:23 +0000 (00:22 +0000)]
[X86] Lower zext i1 arguments
i1 is now a legal type for X86 with AVX512.
There were some paths in X86FastISel which were not quite ready to see
an i1 value: they were not quite sure how to deal with sign/zero extends
for call arguments.
DTRT by extending to i8 for zeroext and bailing out of FastISel for
signext.
This fixes PR27591.
llvm-svn: 268470
Richard Smith [Wed, 4 May 2016 00:21:33 +0000 (00:21 +0000)]
Remove (unused) "using namespace llvm;" in Support header. This caused the modules build to break.
llvm-svn: 268469
David Majnemer [Wed, 4 May 2016 00:20:48 +0000 (00:20 +0000)]
[GlobalDCE, Misc] Don't remove functions referenced by ifuncs
We forgot to consider the target of ifuncs when considering if a
function was alive or dead.
N.B. Also update a few auxiliary tools like bugpoint and
verify-uselistorder.
This fixes PR27593.
llvm-svn: 268468
Jim Ingham [Wed, 4 May 2016 00:06:23 +0000 (00:06 +0000)]
You have to call setHasLoadedFieldsFromExternalStorage AFTER calling
the field_begin that starts the copy or it won't do anything.
This causes failures, but only in complex apps, I haven't found
a reduced test case for this yet.
<rdar://problem/
21951798>
llvm-svn: 268467
Mike Aizatsky [Tue, 3 May 2016 23:43:45 +0000 (23:43 +0000)]
[sanitizer] Move stat/__xstat to the common interceptors
Summary:
Adds stat/__xstat to the common interceptors.
Removes the now-duplicate stat/__xstat interceptor from msan/tsan/esan.
This adds stat/__xstat to asan, which previously did not intercept it.
Resubmit of http://reviews.llvm.org/D19875 with win build fixes.
Reviewers: aizatsky, eugenis
Subscribers: tberghammer, llvm-commits, danalbert, vitalybuka, bruening, srhines, kubabrecka, kcc
Differential Revision: http://reviews.llvm.org/D19890
llvm-svn: 268466
Vedant Kumar [Tue, 3 May 2016 23:32:31 +0000 (23:32 +0000)]
[Support] Add a free toString function for Error
toString() consumes an Error and returns a string representation of its
contents. This commit also adds a message() method to ErrorInfoBase for
convenience.
Differential Revision: http://reviews.llvm.org/D19883
llvm-svn: 268465
NAKAMURA Takumi [Tue, 3 May 2016 23:25:47 +0000 (23:25 +0000)]
llvm-pdbdump: Update libdeps.
llvm-svn: 268464
Kevin Enderby [Tue, 3 May 2016 23:13:50 +0000 (23:13 +0000)]
Produce another specific error message for a malformed Mach-O file when a load
command has a size less than 8 bytes.
I think the existing test case in test/Object/macho-invalid.test for
macho64-invalid-too-small-load-command was trying to test for this but that
test case triggered a different error given how it was constructed. So I
constructed a new test case that would trigger this specific error.
I also changed the error message to be consistent with the other malformed Mach-O
file error messages. I also removed object_error::macho_small_load_command from
Object/Error.h as it is not needed and can just use object_error::parse_failed
and let the error message string distinguish the error.
llvm-svn: 268463
Paul Osmialowski [Tue, 3 May 2016 23:10:20 +0000 (23:10 +0000)]
NFC remove unneded spaces (test commit)
llvm-svn: 268462
Felix Berger [Tue, 3 May 2016 23:07:44 +0000 (23:07 +0000)]
[clang-tidy] MoveConstructorInitCheck - Add parameter name to check message.
Reviewers: alexfh
Subscribers: aaron.ballman, cfe-commits
Differential Revision: http://reviews.llvm.org/D19849
llvm-svn: 268461
David Blaikie [Tue, 3 May 2016 23:06:40 +0000 (23:06 +0000)]
[modules][debuginfo] Only include imported modules when targeting LLDB
These constructs are only applicable to a debugger capable of loading a
Clang AST, so omit them for brevity when not doing so.
We could potentially propagate more of CodeGenOptions through the
ObjectFilePCGContainerOperations for consistency (so the next person who
adds some CodeGenOpts feature that tweaks debug info output doesn't get
caught by this), so I'm open to objections/alternatives there, but went
with this for now.
Tested just a couple of basic cases (one direct, one indirect (through
the ObjectFilePCHContainerOperations) & fixed up other cases to pass the
-debugger-tuning flag as appropriate.
llvm-svn: 268460
Eric Fiselier [Tue, 3 May 2016 22:50:33 +0000 (22:50 +0000)]
Update version numbers in docs
llvm-svn: 268459
Zachary Turner [Tue, 3 May 2016 22:37:12 +0000 (22:37 +0000)]
Fix template type deduction error on some compilers.
llvm-svn: 268458
Andrew Kaylor [Tue, 3 May 2016 22:32:30 +0000 (22:32 +0000)]
Add opt-bisect support to additional passes that can be skipped
Differential Revision: http://reviews.llvm.org/D19882
llvm-svn: 268457
Eric Fiselier [Tue, 3 May 2016 22:32:08 +0000 (22:32 +0000)]
Add documentation for new experimental library
llvm-svn: 268456
Zachary Turner [Tue, 3 May 2016 22:26:46 +0000 (22:26 +0000)]
Remove unused variable.
llvm-svn: 268455
Zachary Turner [Tue, 3 May 2016 22:18:17 +0000 (22:18 +0000)]
Move CodeViewTypeStream to DebugInfo/CodeView
Ability to parse codeview type streams is also needed by
DebugInfoPDB for parsing PDBs, so moving this into a library
gives us this option. Since DebugInfoPDB had already hand
rolled some code to do this, that code is now convereted over
to using this common abstraction.
Differential Revision: http://reviews.llvm.org/D19887
Reviewed By: dblaikie, amccarth
llvm-svn: 268454
David Blaikie [Tue, 3 May 2016 22:14:14 +0000 (22:14 +0000)]
[scan-build] fix dead store warnings emitted on clang code base
This fixes dead store warnings of the type "dead assignment" reported
by CLang Static Analyzer on the following file:
- tools/c-index-test/c-index-test.c.
Patch by Apelete Seketeli <apelete@seketeli.net>!
Differential Revision: http://reviews.llvm.org/D19831
llvm-svn: 268453
Justin Bogner [Tue, 3 May 2016 22:02:31 +0000 (22:02 +0000)]
PM: Port LoopRotation to the new loop pass manager
llvm-svn: 268452
Eric Fiselier [Tue, 3 May 2016 21:58:07 +0000 (21:58 +0000)]
Make check-libcxx dependant on libc++experimental if present.
llvm-svn: 268451
Simon Pilgrim [Tue, 3 May 2016 21:55:37 +0000 (21:55 +0000)]
[X86][XOP] Add placeholder VPERMIL2 combining tests
llvm-svn: 268450
Mike Aizatsky [Tue, 3 May 2016 21:49:56 +0000 (21:49 +0000)]
Revert "[sanitizer] Move stat/__xstat to the common interceptors"
This reverts commit 268440 because it breaks the windows bot.
http://lab.llvm.org:8011/builders/sanitizer-windows/builds/21425/steps/build%20compiler-rt/logs/stdio
llvm-svn: 268448
Justin Bogner [Tue, 3 May 2016 21:47:32 +0000 (21:47 +0000)]
PM: Port LoopSimplifyCFG to the new pass manager
llvm-svn: 268446
Simon Pilgrim [Tue, 3 May 2016 21:44:45 +0000 (21:44 +0000)]
[X86] Tidied up SDValue's SDNode referencing. NFCI.
llvm-svn: 268445
Justin Bogner [Tue, 3 May 2016 21:35:08 +0000 (21:35 +0000)]
PM: Check that loop passes preserve a basic set of analyses
A loop pass that didn't preserve this entire set of passes wouldn't
play well with other loop passes, since these are generally a basic
requirement to do any interesting transformations to a loop.
Adds a helper to get the set of analyses a loop pass should preserve,
and checks that any loop pass we run satisfies the requirement.
llvm-svn: 268444
Eric Fiselier [Tue, 3 May 2016 21:30:18 +0000 (21:30 +0000)]
Create new library 'libc++experimental.a' for packaging TS symbols.
Summary:
Out-of-line symbols for <experimental/...> headers are not ABI or API stable and cannot live in the 'libc++.dylib'. Currently they have nowhere to live. I would like to add a new library target `libc++experimental.a` to fix this.
Previously I had suggested different libraries for different TS's (`libc++filesystem.a`, 'libc++LFTS.a`, ect). I no longer think this is the right approach.
Instead `c++experimental` will hold *all* TS implementations as a single monolithic library. I see two main benefits to this:
1. Users only have to know about and manually link one library.
2. It makes it easy to implement TS's with one or two out-of-line symbols. (Ex. PMRs)
`c++experimental` provides NO ABI compatibility. Symbols can freely be added/removed/changed without concern for ABI stability.
I will add documentation for this after landing this patch (but before adding anything to it).
`c++experimental` only builds as a static library. By default CMake will build/test this library but will *NOT* install it.
This patch adds the CMake and LIT logic needed to build/test the new library. Once this lands I plan on using it to implement parts of `<experimental/memory_resource>`.
Reviewers: mclow.lists
Subscribers: cfe-commits, theraven, krememek, dexonsmith, bcraig, beanz, danalbert
Differential Revision: http://reviews.llvm.org/D19856
llvm-svn: 268443
Davide Italiano [Tue, 3 May 2016 21:30:10 +0000 (21:30 +0000)]
[IPO/ConstantMerge] Garbage collect dead code. NFC.
llvm-svn: 268442
Chris Bieneman [Tue, 3 May 2016 21:22:14 +0000 (21:22 +0000)]
Disable LLVM_ENABLE_TIMESTAMPS by default
This change is based on the discussion from http://lists.llvm.org/pipermail/llvm-dev/2016-May/098990.html.
The goal is to make the default LLVM configuration build deterministically.
llvm-svn: 268441
Mike Aizatsky [Tue, 3 May 2016 21:22:06 +0000 (21:22 +0000)]
[sanitizer] Move stat/__xstat to the common interceptors
Summary:
Adds stat/__xstat to the common interceptors.
Removes the now-duplicate stat/__xstat interceptor from msan/tsan/esan.
This adds stat/__xstat to asan, which previously did not intercept it.
Reviewers: aizatsky, eugenis
Subscribers: tberghammer, danalbert, srhines, kubabrecka, llvm-commits, vitalybuka, eugenis, kcc, bruening
Differential Revision: http://reviews.llvm.org/D19875
llvm-svn: 268440
Vedant Kumar [Tue, 3 May 2016 21:04:42 +0000 (21:04 +0000)]
[Support] Drop template line in favor of 'inline'
Reviewed-by: lhames
llvm-svn: 268438
Tim Northover [Tue, 3 May 2016 21:03:41 +0000 (21:03 +0000)]
X86-Darwin: start emitting data-region directives for jump-tables.
The surrounding tools can cope these days, and they were invented for a reason.
llvm-svn: 268437
Sanjoy Das [Tue, 3 May 2016 20:58:10 +0000 (20:58 +0000)]
[RS4GC] Add a test case around calling conventions; NFC
llvm-svn: 268436
Rafael Espindola [Tue, 3 May 2016 20:55:47 +0000 (20:55 +0000)]
Implement --build-id=none.
Both bfd and gold have this. It allows disabling build-id when it is the
default with by adding -Wl,--build-id=none no the clang command line.
llvm-svn: 268435
Reid Kleckner [Tue, 3 May 2016 20:53:20 +0000 (20:53 +0000)]
[ADT] Add drop_front method to ArrayRef
We have it for StringRef but not ArrayRef, and ArrayRef has drop_back,
so I see no reason it shouldn't have drop_front. Splitting this out of a
change that I have that will use this funcitonality.
llvm-svn: 268434
Sean Callanan [Tue, 3 May 2016 20:36:06 +0000 (20:36 +0000)]
Added a testcase for the ptr_refs tool so we catch if it stops working.
llvm-svn: 268433
David L Kreitzer [Tue, 3 May 2016 20:20:59 +0000 (20:20 +0000)]
Add address space 258 (X86 SS segment) to clang documentation.
The change reflects llvm r268431.
Patch by Michael Lemay (michael.lemay@intel.com)
Differential Revision: http://reviews.llvm.org/D19458
llvm-svn: 268432
David L Kreitzer [Tue, 3 May 2016 20:16:08 +0000 (20:16 +0000)]
Add an address space for the X86 SS segment.
Patch by Michael LeMay (michael.lemay@intel.com)
Differential Revision: http://reviews.llvm.org/D17093
llvm-svn: 268431
Samuel Benzaquen [Tue, 3 May 2016 20:11:09 +0000 (20:11 +0000)]
[clang-tidy] Speedup misc-static-assert.
Summary:
Speedup the misc-static-assert check by not use `stmt()` as the toplevel matcher.
The framework runs a filter on the matchers before trying them on each node and
uses the toplevel type for this.
Using `stmt()` as the toplevel causes the matcher to be run on every `Stmt` node,
even if the node doesn't match the desired types.
This change speeds up clang-tidy by ~5% in a benchmark.
Reviewers: alexfh
Subscribers: cfe-commits
Differential Revision: http://reviews.llvm.org/D19877
llvm-svn: 268430
Davide Italiano [Tue, 3 May 2016 20:08:24 +0000 (20:08 +0000)]
[IPO/IPCP] Convert to use static functions. NFC.
In preparation for porting this pass to the new PM.
llvm-svn: 268429
Vedant Kumar [Tue, 3 May 2016 20:01:01 +0000 (20:01 +0000)]
[ProfileData] Propagate an error from InstrProfSymtab
CovMapFuncReader::get should propagate up errors from InstrProfSymtab.
This is part of a series of patches to transition ProfileData over to
the stricter Error/Expected interface.
llvm-svn: 268428
Chris Bieneman [Tue, 3 May 2016 19:48:11 +0000 (19:48 +0000)]
[CMake] NFC. Add support for testing the compiler without testing the linker
Summary:
One of the big limitations we have in the compiler-rt build system today is that we cannot bootstrap building the builtins because you need a fully functional toolchain to pass CMake's tests.
This change adds support for compile only tests.
It is NFC because nothing is using the compile-only tests yet.
I believe this is the last separable part of D16653.
Reviewers: samsonov
Subscribers: llvm-commits
Differential Revision: http://reviews.llvm.org/D19692
llvm-svn: 268427
Derek Bruening [Tue, 3 May 2016 19:44:32 +0000 (19:44 +0000)]
[esan] Use do-while rather than braces for empty interceptors
Summary:
Replaces {} with a do..while sequence in esan's empty interceptors to allow
natural use with a trailing semicolon. The sequence uses each argument to
avoid warnings.
Reviewers: filcab
Subscribers: kubabrecka, llvm-commits, zhaoqin
Differential Revision: http://reviews.llvm.org/D19832
llvm-svn: 268426
Davide Italiano [Tue, 3 May 2016 19:39:15 +0000 (19:39 +0000)]
[IPO/GlobalDCE] Port to the new pass manager.
Differential Revision: http://reviews.llvm.org/D19782
llvm-svn: 268425
Jack Liu [Tue, 3 May 2016 19:30:48 +0000 (19:30 +0000)]
[SROA] Function canConvertValue needs to check whether both NewTy and OldTy pointers are
pointing to the same addr space. This can prevent SROA from creating a bitcast
between pointers with different addr spaces.
Differential Revision: http://reviews.llvm.org/D19697
llvm-svn: 268424
Tim Northover [Tue, 3 May 2016 19:24:47 +0000 (19:24 +0000)]
AArch64: fixup comment after change
llvm-svn: 268423
Tim Northover [Tue, 3 May 2016 19:22:41 +0000 (19:22 +0000)]
AArch64: simplify illegal vector check. NFC.
Use a utility function to check whether the number of elements is a power of 2
and drop the redundant upper limit (a 128-bit vector with more than 16 elements
would have each element < 8 bits, not possible).
llvm-svn: 268422
Jack Liu [Tue, 3 May 2016 19:15:02 +0000 (19:15 +0000)]
Revert 268409 due to missing comment.
llvm-svn: 268421
Vedant Kumar [Tue, 3 May 2016 18:49:41 +0000 (18:49 +0000)]
[ProfileData] Assert NoError in CoverageMappingTest
Check for success values in the CoverageMappingTest unit test file.
This is part of a series of patches to transition ProfileData over to
the stricter Error/Expected interface.
llvm-svn: 268420
Reid Kleckner [Tue, 3 May 2016 18:48:50 +0000 (18:48 +0000)]
Fix use of LLVM IR names in lit test
llvm-svn: 268419
Reid Kleckner [Tue, 3 May 2016 18:44:29 +0000 (18:44 +0000)]
[MS] Pass CalleeDecl to adjustThisArgumentForVirtualFunctionCall
If we are devirtualizing, then we want to compute the 'this' adjustment
of the devirtualized target, not the adjustment of the base's method
definition, which is usually zero.
Fixes PR27621
llvm-svn: 268418
Davide Italiano [Tue, 3 May 2016 18:34:51 +0000 (18:34 +0000)]
[Reassociate] Remove unneeded constructor.
llvm-svn: 268417
Pete Cooper [Tue, 3 May 2016 18:32:01 +0000 (18:32 +0000)]
Change test to use regex instead of explicit value numbers. NFC.
We were seeing an internal failure when running this test. I can't
see a good reason for the difference, but the simple fix is to use
%{{.*}} instead of %1.
llvm-svn: 268416
Lang Hames [Tue, 3 May 2016 18:19:35 +0000 (18:19 +0000)]
[ExecutionEngine] Add comment explainging that ExecutionEngine::addGlobalMapping
can only be used on named values.
https://llvm.org/bugs/PR23497
llvm-svn: 268415
Quentin Colombet [Tue, 3 May 2016 18:09:06 +0000 (18:09 +0000)]
[ImplicitNullChecks] Account for implicit-defs as well when updating the liveness.
The replaced load may have implicit-defs and those defs may be used
in the block of the original load. Make sure to update the liveness
accordingly.
This is a generalization of r267817.
llvm-svn: 268412
Peter Collingbourne [Tue, 3 May 2016 18:03:47 +0000 (18:03 +0000)]
ELF: Fix regression in TLS attribute mismatch logic.
Introduce a special symbol type to indicate that we have not yet seen a type
for the symbol, so we should not report TLS mismatches for that symbol.
Differential Revision: http://reviews.llvm.org/D19836
llvm-svn: 268411
Peter Collingbourne [Tue, 3 May 2016 18:03:45 +0000 (18:03 +0000)]
Check return value of addOptionalSynthetic before calling a member function on it.
Found with UBSan.
llvm-svn: 268410
Jack Liu [Tue, 3 May 2016 18:01:43 +0000 (18:01 +0000)]
(no commit message)
llvm-svn: 268409
Sanjoy Das [Tue, 3 May 2016 17:50:11 +0000 (17:50 +0000)]
[LICM] Kill SCEV loop dispositions if needed
SCEV caches whether SCEV expressions are loop invariant, variant or
computable. LICM breaks this cache, almost by definition; so clear the
SCEV disposition cache if LICM changed anything.
llvm-svn: 268408
Sanjoy Das [Tue, 3 May 2016 17:50:06 +0000 (17:50 +0000)]
Use all_of instead of a raw loop; NFC
Added some tests despite being NFC, since it looks like nothing was
exercising the "all incoming values to exit PHIs are same" logic.
llvm-svn: 268407
Sanjoy Das [Tue, 3 May 2016 17:50:02 +0000 (17:50 +0000)]
[LoopDeletion] Clear SCEV loop dispositions
`Loop::makeLoopInvariant` can hoist instructions out of loops, so loop
dispositions for the loop it operated on may need to be cleared. We can
be smarter here (especially around how `forgetLoopDispositions` is
implemented), but let's be correct first.
Fixes PR27570.
llvm-svn: 268406
Sanjoy Das [Tue, 3 May 2016 17:49:57 +0000 (17:49 +0000)]
[SCEV] Tweak the output format and content of -analyze
In the "LoopDispositions:" section:
- Instead of printing out a list, print out a "dictionary" to make it
obvious by inspection which disposition is for which loop. This is
just a cosmetic change.
- Print dispositions for parent _and_ sibling loops. I will use this
to write a test case.
llvm-svn: 268405
Rafael Espindola [Tue, 3 May 2016 17:30:44 +0000 (17:30 +0000)]
Produce cpio files for --reproduce.
We want --reproduce to
* not rewrite scripts and thin archives
* work with absolute paths
Given that, it pretty much has to create a full directory tree. On windows that
is problematic because of the very short maximum path limit. On most cases
users can still work around it with "--repro c:\r", but that is annoying and
not viable for automated testing.
We then need to produce some form of archive with the files. The first option
that comes to mind is .a files since we already have code for writing them.
There are a few problems with them
The format has a dedicated string table, so we cannot start writing it until
all members are known.
Regular implementations don't support creating directories. We could make
llvm-ar support that, but that is probably not a good idea.
The next natural option would be tar. The problem is that to support long path
names (which is how this started) it needs a "pax extended header" making this
an annoying format to write.
The next option I looked at seems a natural fit: cpio files.
They are available on pretty much every unix, support directories and long path
names and are really easy to write. The only slightly annoying part is a
terminator, but at least gnu cpio only prints a warning if it is missing, which
is handy for crashes. This patch still makes an effort to always create it.
llvm-svn: 268404
Kevin Enderby [Tue, 3 May 2016 17:16:08 +0000 (17:16 +0000)]
Produce another specific error message for a malformed Mach-O file when a load
command other than the first one is past the end of the load commands.
This is like the test case in test/Object/macho-invalid.test for
macho64-invalid-incomplete-load-command but it is the second load command
that is past the end of all the load commands instead of the first.
The code in the constructor for MachOObjectFile that loops over the load
commands used getNextLoadCommandInfo() which was not producing
a good error message. So that was fixed and a test case was added.
llvm-svn: 268403
Vedant Kumar [Tue, 3 May 2016 17:07:06 +0000 (17:07 +0000)]
[ProfileData] Assert NoError in InstrProfTest
Check for success values in the InstrProfTest unit test file.
This is part of a series of patches to transition ProfileData over to
the stricter Error/Expected interface.
llvm-svn: 268402
Chris Bieneman [Tue, 3 May 2016 16:54:20 +0000 (16:54 +0000)]
[CMake] Fix a copy-paste error
Based on post commit feedback from Eric Fiselier.
llvm-svn: 268401
Vedant Kumar [Tue, 3 May 2016 16:53:17 +0000 (16:53 +0000)]
[ProfileData] Add error codes for compression failures
Be more specific in describing compression failures. Also, check for
this kind of error in emitNameData().
This is part of a series of patches to transition ProfileData over to
the stricter Error/Expected interface.
llvm-svn: 268400
Hans Wennborg [Tue, 3 May 2016 16:43:40 +0000 (16:43 +0000)]
Win packaging script: include the OpenMP run-time
llvm-svn: 268398
Francis Ricci [Tue, 3 May 2016 16:31:36 +0000 (16:31 +0000)]
Split out console and file writing cases in TestCommandScriptImmediateOutput
Summary:
As these are really testing separate issues, they should be run as separate
tests.
Reviewers: zturner, granata.enrico, clayborg
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D19690
llvm-svn: 268397
Tom Stellard [Tue, 3 May 2016 16:30:56 +0000 (16:30 +0000)]
AMDGPU/SI: Use range loops to simplify some code in the SI Scheduler
Reviewers: arsenm, axeldavy
Subscribers: MatzeB, arsenm, llvm-commits
Differential Revision: http://reviews.llvm.org/D19822
llvm-svn: 268396
Mehdi Amini [Tue, 3 May 2016 15:46:00 +0000 (15:46 +0000)]
Move "Eliminate Available Externally" immediately after the inliner
This pass is supposed to reduce the size of the IR for compile time
purpose. We should run it ASAP, except when we prepare for LTO or
ThinLTO, and we want to keep them available for link-time inline.
Differential Revision: http://reviews.llvm.org/D19813
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 268394
Mehdi Amini [Tue, 3 May 2016 15:17:50 +0000 (15:17 +0000)]
Provide some default values for the ThinLTO Cache pruning
This control how the cache is pruned. The cache still has to
be explicitely enabled/disabled by providing a path.
From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 268393
Aaron Ballman [Tue, 3 May 2016 15:17:25 +0000 (15:17 +0000)]
Silence unused variable warning; NFC.
llvm-svn: 268392
Simon Pilgrim [Tue, 3 May 2016 15:05:13 +0000 (15:05 +0000)]
[X86][SSE] Added target shuffle combine to MOVQ
llvm-svn: 268391
Anna Thomas [Tue, 3 May 2016 14:58:21 +0000 (14:58 +0000)]
Fold compares irrespective of whether allocation can be elided
Summary
When a non-escaping pointer is compared to a global value, the
comparison can be folded even if the corresponding malloc/allocation
call cannot be elided.
We need to make sure the global value is not null, since comparisons to
null cannot be folded.
In future, we should also handle cases when the the comparison
instruction dominates the pointer escape.
Reviewers: sanjoy
Subscribers s.egerton, llvm-commits
Differential Revision: http://reviews.llvm.org/D19549
llvm-svn: 268390
James Y Knight [Tue, 3 May 2016 14:57:18 +0000 (14:57 +0000)]
[Sparc] Constification of TargetMachine arguments
This patch changes the TargetMachine arguments to be const. This is
required for {D19265}, and was requested to be done in a separate patch.
Patch by Jacob Hansen!
Differential Revision: http://reviews.llvm.org/D19797
llvm-svn: 268389
Rafael Espindola [Tue, 3 May 2016 14:29:42 +0000 (14:29 +0000)]
Don't depend on checking the response file when lld fails.
llvm-svn: 268388
Michael Zuckerman [Tue, 3 May 2016 14:26:52 +0000 (14:26 +0000)]
[clang][AVX512][BuiltIn] Adding intrinsics for cast{pd|ps|si}128_{pd|ps|si}512 and castsi256_si512 instruction set
Differential Revision: http://reviews.llvm.org/D19858
llvm-svn: 268387
Daniel Sanders [Tue, 3 May 2016 14:19:26 +0000 (14:19 +0000)]
[mips][fastisel] ADJCALLSTACKUP has a second immediate operand.
Summary:
It's always zero for SelectionDAG and is never read by the MIPS backend so
do the same for FastISel.
Reviewers: sdardis
Subscribers: dsanders, llvm-commits, sdardis
Differential Revision: http://reviews.llvm.org/D19863
llvm-svn: 268386
Michael Zuckerman [Tue, 3 May 2016 14:12:23 +0000 (14:12 +0000)]
[Clang][avx512][Builtin] Adding intrinsics for cvtw2mask{128|256|512} instruction set
Differential Revision: http://reviews.llvm.org/D19766
llvm-svn: 268385
Pavel Labath [Tue, 3 May 2016 14:07:41 +0000 (14:07 +0000)]
Revert "Add a read_full_buffer argument to ConnectionFileDescriptor::Read"
This reverts commit r268380 as it breaks windows build (I forgot to make neccesary adjustments to
ConnectionGenericFileWindows).
llvm-svn: 268384
Daniel Sanders [Tue, 3 May 2016 14:00:37 +0000 (14:00 +0000)]
[mips] Fix unused variable warning for release builds introduced by r268379.
llvm-svn: 268383