Kostya Serebryany [Wed, 14 Sep 2016 01:39:35 +0000 (01:39 +0000)]
[sanitizer-coverage] add yet another flavour of coverage instrumentation: trace-pc-guard. The intent is to eventually replace all of {bool coverage, 8bit-counters, trace-pc} with just this one. LLVM part
llvm-svn: 281431
Nico Weber [Wed, 14 Sep 2016 01:16:54 +0000 (01:16 +0000)]
Follow-up to r281367: Compare uuids case-insensitively.
llvm-svn: 281430
Richard Smith [Wed, 14 Sep 2016 01:05:35 +0000 (01:05 +0000)]
[modules] When merging one definition into another, propagate the list of
re-exporting modules from the discarded definition to the retained definition.
llvm-svn: 281429
Sean Callanan [Wed, 14 Sep 2016 00:48:19 +0000 (00:48 +0000)]
Cleaned up the code that handles function return addresses in "frame diagnose."
llvm-svn: 281428
Richard Smith [Wed, 14 Sep 2016 00:35:56 +0000 (00:35 +0000)]
Color warnings purple rather than orange, to match actual Clang output.
llvm-svn: 281427
Rui Ueyama [Wed, 14 Sep 2016 00:09:50 +0000 (00:09 +0000)]
Turn a no-op assignment into an assertion.
r279456 guarantees that this condition is always satisfied.
llvm-svn: 281426
Rui Ueyama [Wed, 14 Sep 2016 00:05:51 +0000 (00:05 +0000)]
Simplify InputFile ownership management.
Previously, all input files were owned by the symbol table.
Files were created at various places, such as the Driver, the lazy
symbols, or the bitcode compiler, and the ownership of new files
was transferred to the symbol table using std::unique_ptr.
All input files were then free'd when the symbol table is freed
which is on program exit.
I think we don't have to transfer ownership just to free all
instance at once on exit.
In this patch, all instances are automatically collected to a
vector and freed on exit. In this way, we no longer have to
use std::unique_ptr.
Differential Revision: https://reviews.llvm.org/D24493
llvm-svn: 281425
Jason Henline [Tue, 13 Sep 2016 23:59:10 +0000 (23:59 +0000)]
[SE] Pack global dev handle addresses
Summary:
We were packing global device memory handles in
`PackedKernelArgumentArray`, but as I was implementing the CUDA
platform, I realized that CUDA wants the address of the handle, not the
handle itself. So this patch switches to packing the address of the
handle.
Reviewers: jlebar
Subscribers: jprice, jlebar, parallel_libs-commits
Differential Revision: https://reviews.llvm.org/D24528
llvm-svn: 281424
Jason Henline [Tue, 13 Sep 2016 23:56:47 +0000 (23:56 +0000)]
Device doc says device is small
llvm-svn: 281423
Jason Henline [Tue, 13 Sep 2016 23:56:46 +0000 (23:56 +0000)]
[SE] Platforms return Device values
Summary:
Platforms were returning Device pointers, but a Device is now basically
just a pointer to an underlying PlatformDevice, so we will now just pass
it around as a value.
Reviewers: jlebar
Subscribers: jprice, jlebar, parallel_libs-commits
Differential Revision: https://reviews.llvm.org/D24537
llvm-svn: 281422
Akira Hatanaka [Tue, 13 Sep 2016 23:53:43 +0000 (23:53 +0000)]
Address Pete's review comment and define OrigArg on its own line.
This is a follow-up to r281419.
llvm-svn: 281421
Zachary Turner [Tue, 13 Sep 2016 23:45:11 +0000 (23:45 +0000)]
Force c++14 when running tests on Windows.
VS 2015 and higher begin making use of c++14 in their standard
library headers. As such, -std=c++11 makes it so you can't compile
trivial programs. Bump this to -std=c++14 when this situation is
detected.
llvm-svn: 281420
Akira Hatanaka [Tue, 13 Sep 2016 23:43:11 +0000 (23:43 +0000)]
[ObjCARC] Traverse chain downwards to replace uses of argument passed to
ObjC library call with call return.
ARC contraction tries to replace uses of an argument passed to an
objective-c library call with the call return value. For example, in the
following IR, it replaces uses of argument %9 and uses of the values
discovered traversing the chain upwards (%7 and %8) with the call return
%10, if they are dominated by the call to @objc_autoreleaseReturnValue.
This transformation enables code-gen to tail-call the call to
@objc_autoreleaseReturnValue, which is necessary to enable auto release
return value optimization.
%7 = tail call i8* @objc_loadWeakRetained(i8** %6)
%8 = bitcast i8* %7 to %0*
%9 = bitcast %0* %8 to i8*
%10 = tail call i8* @objc_autoreleaseReturnValue(i8* %9)
ret %0* %8
Since r276727, llvm started removing redundant bitcasts and as a result
started feeding the following IR to ARC contraction:
%7 = tail call i8* @objc_loadWeakRetained(i8** %6)
%8 = bitcast i8* %7 to %0*
%9 = tail call i8* @objc_autoreleaseReturnValue(i8* %7)
ret %0* %8
ARC contraction no longer does the optimization described above since it
only traverses the chain upwards and fails to recognize that the
function return can be replaced by the call return. This commit changes
ARC contraction to traverse the chain downwards too and replace uses of
bitcasts with the call return.
rdar://problem/
28011339
Differential Revision: https://reviews.llvm.org/D24523
llvm-svn: 281419
Jason Molenda [Tue, 13 Sep 2016 23:29:46 +0000 (23:29 +0000)]
TestQueues could error out because the one second sleep main.c was
using to enqueue all the jobs wasn't enough time on a slow/overloaded
system. Instead use a global to indicate when all the work has
been enqueued, let's see if this makes the CIs work more reliably.
llvm-svn: 281418
Jason Henline [Tue, 13 Sep 2016 23:29:25 +0000 (23:29 +0000)]
[SE] KernelSpec return best PTX
Summary:
Before, the kernel spec would only return PTX for exactly the requested
compute capability. With this patch it will now return the PTX with the
largest compute capability that does not exceed that requested compute
capability.
Reviewers: jlebar
Subscribers: jprice, jlebar, parallel_libs-commits
Differential Revision: https://reviews.llvm.org/D24531
llvm-svn: 281417
Richard Smith [Tue, 13 Sep 2016 23:03:41 +0000 (23:03 +0000)]
Missed update from r281412.
llvm-svn: 281415
Vedant Kumar [Tue, 13 Sep 2016 23:00:13 +0000 (23:00 +0000)]
[llvm-cov] Just emit the version number in the index file
Having the version information in every view is distracting, especially
if there are several sub-views.
llvm-svn: 281414
Hans Wennborg [Tue, 13 Sep 2016 22:51:42 +0000 (22:51 +0000)]
Also don't inline dllimport functions referring to non-dllimport constructors.
The AST walker wasn't visiting CXXConstructExprs before.
This is a follow-up to r281395.
llvm-svn: 281413
Richard Smith [Tue, 13 Sep 2016 22:51:09 +0000 (22:51 +0000)]
Warning flag updates:
-Wdiv-by-zero may as well be an alias for -Wdivision-by-zero rather than a GCC-compatibility no-op.
-Wno-shadow should disable -Wshadow-ivar.
-Weffc++ may as well enable -Wnon-virtual-dtor like it does in GCC.
llvm-svn: 281412
George Rimar [Tue, 13 Sep 2016 22:26:12 +0000 (22:26 +0000)]
revert: [ELF] - Versionscript: support mangled symbols with the same name.
Something broked BBots:
281318 failed on step 9:
http://lab.llvm.org:8011/builders/clang-with-lto-ubuntu/builds/413
r281317 built step 9 green:
http://lab.llvm.org:8011/builders/clang-with-lto-ubuntu/builds/415
Initial revision commits were:
This is PR30312. Info from bug page:
Both of these symbols demangle to abc::abc():
_ZN3abcC1Ev
_ZN3abcC2Ev
(These would be abc's complete object constructor and base object constructor, respectively.)
however with "abc::abc()" in the version script only one of the two receives the symbol version.
Patch fixes that.
It uses testcase created by Ed Maste (D24306).
Differential revision: https://reviews.llvm.org/D24336
llvm-svn: 281411
Evgeniy Stepanov [Tue, 13 Sep 2016 22:25:44 +0000 (22:25 +0000)]
[asan] alloc_dealloc_mismatch=0 by default on Android.
All known (to me) Android deployments are disabling this flag anyway.
The in-tree script (asan_device_setup) does that, too.
llvm-svn: 281410
Evgeniy Stepanov [Tue, 13 Sep 2016 22:25:41 +0000 (22:25 +0000)]
[asan] Remove lit -j5 flag for android tests.
It makes the tests extremely slow due to high latency of the test launcher.
The main reason for -j5 was high memory usage with handle_abort=1, which
is now disabled in the test runner.
llvm-svn: 281409
Reid Kleckner [Tue, 13 Sep 2016 22:22:56 +0000 (22:22 +0000)]
Fix a FIXME about MSVC 2013 in the diagnostic doc generation code
Ultimately it boiled down to adding a move constructor.
llvm-svn: 281408
Ahmed Bougacha [Tue, 13 Sep 2016 22:16:40 +0000 (22:16 +0000)]
[AArch64] Simplify patchpoint/stackmap size test (r281301). NFC.
llvm-svn: 281407
Artem Belevich [Tue, 13 Sep 2016 22:16:30 +0000 (22:16 +0000)]
[CUDA] Do not merge CUDA target attributes.
CUDA target attributes are used for function overloading and must not be merged.
This fixes a bug where attributes were inherited during function template
specialization in CUDA and made it impossible for specialized function
to provide its own target attributes.
Differential Revision: https://reviews.llvm.org/D24522
llvm-svn: 281406
Akira Hatanaka [Tue, 13 Sep 2016 22:13:02 +0000 (22:13 +0000)]
[CodeGen] Fix an assert in EmitNullConstant.
r235815 changed CGRecordLowering::accumulateBases to ignore non-virtual
bases of size 0, which prevented adding those non-virtual bases to
CGRecordLayout's NonVirtualBases. This caused clang to assert when
CGRecordLayout::getNonVirtualBaseLLVMFieldNo was called in
EmitNullConstant. This commit fixes the bug by ignoring zero-sized
non-virtual bases in EmitNullConstant.
rdar://problem/
28100139
Differential Revision: https://reviews.llvm.org/D24312
llvm-svn: 281405
Manman Ren [Tue, 13 Sep 2016 21:57:28 +0000 (21:57 +0000)]
ObjectiveC Generics: follow-up commit to r281355.
Correct getExtraLocalDataSize for ObjCTypeParamTypeLoc.
rdar://
24619481
rdar://
25060179
llvm-svn: 281404
Pawel Bylica [Tue, 13 Sep 2016 21:55:41 +0000 (21:55 +0000)]
[CodeGen] Fix invalid shift in mul expansion
Summary: When expanding mul in type legalization make sure the type for shift amount can actually fit the value. This fixes PR30354 https://llvm.org/bugs/show_bug.cgi?id=30354.
Reviewers: hfinkel, majnemer, RKSimon
Subscribers: RKSimon, llvm-commits
Differential Revision: https://reviews.llvm.org/D24478
llvm-svn: 281403
Michael Kuperstein [Tue, 13 Sep 2016 21:53:32 +0000 (21:53 +0000)]
[DAG] Allow build-to-shuffle combine to combine builds from two wide vectors.
This allows us to, in some cases, create a vector_shuffle out of a build_vector, when
the inputs to the build are extract_elements from two different vectors, at least one
of which is wider than the output. (E.g. a <8 x i16> being constructed out of
elements from a <16 x i16> and a <8 x i16>).
Differential Revision: https://reviews.llvm.org/D24491
llvm-svn: 281402
Albert Gutowski [Tue, 13 Sep 2016 21:51:37 +0000 (21:51 +0000)]
Temporary fix for MS _Interlocked intrinsics
llvm-svn: 281401
Kevin Enderby [Tue, 13 Sep 2016 21:42:28 +0000 (21:42 +0000)]
Next set of additional error checks for invalid Mach-O files for bad load commands
that use the Mach::dyld_info_command type for the load commands that are
currently use in the MachOObjectFile constructor.
This contains the missing checks for LC_DYLD_INFO and
LC_DYLD_INFO_ONLY load commands and the fields for the
Mach::dyld_info_command type.
llvm-svn: 281400
Albert Gutowski [Tue, 13 Sep 2016 21:24:51 +0000 (21:24 +0000)]
Reverse commit 281375 (breaks building Chromium)
llvm-svn: 281399
Sean Callanan [Tue, 13 Sep 2016 21:18:27 +0000 (21:18 +0000)]
Cleaned up some of the "frame diagnose" code to use Operands as currency.
Also added some utility functions around Operands to make code easier and more
compact to write.
llvm-svn: 281398
Krzysztof Parzyszek [Tue, 13 Sep 2016 21:16:07 +0000 (21:16 +0000)]
[Hexagon] Better handling of HVX vector lowering
- Expand SELECT_CC and BR_CC for vector types.
- Implement TLI::isShuffleMaskLegal.
llvm-svn: 281397
Tobias Grosser [Tue, 13 Sep 2016 21:09:35 +0000 (21:09 +0000)]
cmake: PollyPPCG depends on PollyISL
This line makes BUILD_SHARED_LIBS=ON work for Polly-ACC. Without it, ld
complains about missing isl symbols when constructing the shared library.
llvm-svn: 281396
Hans Wennborg [Tue, 13 Sep 2016 21:08:20 +0000 (21:08 +0000)]
Try harder to not inline dllimport functions referencing non-dllimport functions
In r246338, code was added to check for this, but it failed to take into
account implicit destructor invocations because those are not reflected
in the AST. This adds a separate check for them.
llvm-svn: 281395
Rui Ueyama [Tue, 13 Sep 2016 20:51:32 +0000 (20:51 +0000)]
[ELF] Set EF_ARM_EABI_VER5 for ARM
Without this flag set, an AArch64 Linux kernel won't try to load the executable
(even if a 32 bit arm kernel will run the binary just fine).
Patch by Martin Storsjö!
Differential revision: https://reviews.llvm.org/D24471
llvm-svn: 281394
Rui Ueyama [Tue, 13 Sep 2016 20:51:30 +0000 (20:51 +0000)]
Split scanVersionScript. NFC.
llvm-svn: 281393
Filipe Cabecinhas [Tue, 13 Sep 2016 20:47:42 +0000 (20:47 +0000)]
[asan] Reify ErrorSanitizerGetAllocatedSizeNotOwned
Summary: Continuing implementation mentioned in this thread: http://lists.llvm.org/pipermail/llvm-dev/2016-July/101933.html
Reviewers: kcc, eugenis, vitalybuka
Subscribers: llvm-commits, kubabrecka
Differential Revision: https://reviews.llvm.org/D24392
llvm-svn: 281392
Filipe Cabecinhas [Tue, 13 Sep 2016 20:47:37 +0000 (20:47 +0000)]
[asan] Reify ErrorMallocUsableSizeNotOwned
Summary: Continuing implementation mentioned in this thread: http://lists.llvm.org/pipermail/llvm-dev/2016-July/101933.html
Reviewers: kcc, eugenis, vitalybuka
Subscribers: llvm-commits, kubabrecka
Differential Revision: https://reviews.llvm.org/D24391
llvm-svn: 281391
Filipe Cabecinhas [Tue, 13 Sep 2016 20:47:33 +0000 (20:47 +0000)]
[asan] Reify ErrorAllocTypeMismatch
Summary: Continuing implementation mentioned in this thread: http://lists.llvm.org/pipermail/llvm-dev/2016-July/101933.html
Reviewers: kcc, eugenis, vitalybuka
Subscribers: llvm-commits, kubabrecka
Differential Revision: https://reviews.llvm.org/D24390
llvm-svn: 281390
Filipe Cabecinhas [Tue, 13 Sep 2016 20:47:29 +0000 (20:47 +0000)]
[asan] Reify ErrorFreeNotMalloced
Summary: Continuing implementation mentioned in this thread: http://lists.llvm.org/pipermail/llvm-dev/2016-July/101933.html
Reviewers: kcc, eugenis, vitalybuka
Subscribers: llvm-commits, kubabrecka
Differential Revision: https://reviews.llvm.org/D24389
llvm-svn: 281389
Rui Ueyama [Tue, 13 Sep 2016 20:41:06 +0000 (20:41 +0000)]
Add comments.
llvm-svn: 281388
Zachary Turner [Tue, 13 Sep 2016 20:40:26 +0000 (20:40 +0000)]
Add some unit tests for ArchSpec.
I'm was trying to do some cleanup and code modernization and in
doing so I needed to change ParseMachCPUDashSubtypeTriple to take
a StringRef. To ensure I don't break anything, I'm adding some
unit tests for this function. As a side benefit, this also expands
test coverage of this function to all platforms, since in general
this code would rarely be exercised on non Mac platforms, and never
in the test suite.
llvm-svn: 281387
Sanjay Patel [Tue, 13 Sep 2016 20:36:13 +0000 (20:36 +0000)]
add tests for PR28672
I'm not sure if we actually want to transform all of these in InstCombine yet,
so I'm not labeling these with FIXME.
llvm-svn: 281386
Alexander Shaposhnikov [Tue, 13 Sep 2016 20:17:57 +0000 (20:17 +0000)]
Remove excessive padding from PTHWriter
The class PTHWriter is in lib/Frontend/CacheTokens.cpp
inside the anonymous namespace.
This diff changes the order of fields an removes excessive padding.
Test plan: make -j8 check-clang
Differential revision: https://reviews.llvm.org/D23902
llvm-svn: 281385
Jason Henline [Tue, 13 Sep 2016 20:14:44 +0000 (20:14 +0000)]
[SE] Use real HostPlatformDevice for testing
Summary:
Replace uses of SimpleHostPlatformDevice in tests with
HostPlatformDevice.
Reviewers: jlebar
Subscribers: jlebar, jprice, parallel_libs-commits
Differential Revision: https://reviews.llvm.org/D24519
llvm-svn: 281384
Bruno Cardoso Lopes [Tue, 13 Sep 2016 20:04:35 +0000 (20:04 +0000)]
[SemaObjC] Be more strict while parsing type arguments and protocols
Fix a crash-on-invalid.
When parsing type arguments and protocols,
parseObjCTypeArgsOrProtocolQualifiers() calls ParseTypeName(), which tries to
find matching tokens for '[', '(', etc whenever they appear among potential
type names. If unmatched, ParseTypeName() yields a tok::eof token stream. This
leads to crashes since the parsing at this point is not expected to go beyond
the param list closing '>'.
Fix that by properly handling tok::eof in
parseObjCTypeArgsOrProtocolQualifiers() callers.
Differential Revision: https://reviews.llvm.org/D23852
rdar://problem/
25063557
llvm-svn: 281383
Richard Smith [Tue, 13 Sep 2016 20:00:02 +0000 (20:00 +0000)]
Work around MSVC 2013's inability to default move special members.
llvm-svn: 281382
Rui Ueyama [Tue, 13 Sep 2016 19:56:27 +0000 (19:56 +0000)]
Inline small funciton.
llvm-svn: 281381
Rui Ueyama [Tue, 13 Sep 2016 19:56:25 +0000 (19:56 +0000)]
Fix comments.
llvm-svn: 281380
Matt Arsenault [Tue, 13 Sep 2016 19:43:57 +0000 (19:43 +0000)]
Reapply "InstCombine: Reduce trunc (shl x, K) width."
This reapplies r272987 with a fix for infinitely looping
when the truncated value is another shift of a constant.
llvm-svn: 281379
Albert Gutowski [Tue, 13 Sep 2016 19:43:33 +0000 (19:43 +0000)]
Add bunch of _Interlocked builtins
Reviewers: compnerd, thakis, Prazek, majnemer, rnk
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D24153
llvm-svn: 281378
Jason Henline [Tue, 13 Sep 2016 19:28:02 +0000 (19:28 +0000)]
[SE] Host platform implementation
Summary:
This implementation does not currently support multiple concurrent streams, and
it won't allow kernels to be launched with grids larger than one block or
blocks larger than one thread. These limitations could be removed in the future
by launching new threads on the host, but that is not done in this
implementation.
Reviewers: jlebar
Subscribers: beanz, mgorny, jprice, parallel_libs-commits
Differential Revision: https://reviews.llvm.org/D24473
llvm-svn: 281377
Matthias Braun [Tue, 13 Sep 2016 19:27:38 +0000 (19:27 +0000)]
AArch64: Cleanup tailcall CC check, enable swiftcc.
Cleanup/change the code that checks for possible tailcall conventions to
look the same as the one in the X86 target. This makes the distinction
between calling conventions that can guarnatee tailcalls and the ones
that may tailcall more obvious.
- Add Swift to the mayTailCall list
- PreserveMost seemed to be incorrectly part of the guarnteed tail call
list, move it to the mayTailCall list.
llvm-svn: 281376
Albert Gutowski [Tue, 13 Sep 2016 19:26:42 +0000 (19:26 +0000)]
Add some MS aliases for existing intrinsics
Reviewers: thakis, compnerd, majnemer, rsmith, rnk
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D24330
llvm-svn: 281375
Jason Henline [Tue, 13 Sep 2016 19:25:43 +0000 (19:25 +0000)]
[SE] Add .clang-format
Summary:
The .clang-tidy file is copied from the top-level LLVM source directory.
Also fix warnings generated by clang-format:
* Moved SimpleHostPlatformDevice.h so its header include guard could
have the right format.
* Changed signatures of methods taking llvm::Twine by value to take it
by const ref instead.
* Add "noexcept" to some move constructors and assignment operators.
* Removed a bunch of places where single-statement loops and
conditionals were surrounded with braces. (This was not found by the
current clang-tidy, but with a local patch that I hope to upstream
soon.)
Reviewers: jlebar, jprice
Subscribers: parallel_libs-commits
Differential Revision: https://reviews.llvm.org/D24468
llvm-svn: 281374
Alexander Shaposhnikov [Tue, 13 Sep 2016 19:17:20 +0000 (19:17 +0000)]
[analyzer] Fix ExprEngine::VisitMemberExpr
AST may contain intermediate ParenExpr nodes
between MemberExpr and ArrayToPointerDecay.
This diff adjusts the check in ExprEngine::VisitMemberExpr accordingly.
Test plan: make -j8 check-clang-analysis
Differential revision: https://reviews.llvm.org/D24484
llvm-svn: 281373
Matt Arsenault [Tue, 13 Sep 2016 19:15:25 +0000 (19:15 +0000)]
AMDGPU: Remove code I think is dead
As far as I can tell, resolveFrameIndex is supposed to be
called with a legal offset, so inserting an add shouldn't be
necessary.
llvm-svn: 281372
Evgeniy Stepanov [Tue, 13 Sep 2016 19:05:33 +0000 (19:05 +0000)]
Switch to 64-bit allocator on android/aarch64.
This uses the "very compact" size class mapping that fits in the
39-bit address space.
llvm-svn: 281371
Mike Aizatsky [Tue, 13 Sep 2016 19:04:26 +0000 (19:04 +0000)]
.clang-tidy: correct style name is 'camelBack' not 'lowerCase'.
Summary: clang-tidy doesn't like to complain.
Differential Revision: https://reviews.llvm.org/D24413
llvm-svn: 281370
Matt Arsenault [Tue, 13 Sep 2016 19:03:12 +0000 (19:03 +0000)]
AMDGPU: Support commuting a FrameIndex operand
llvm-svn: 281369
Matthew Simpson [Tue, 13 Sep 2016 19:01:45 +0000 (19:01 +0000)]
[LV] Clean up uniform induction variable analysis (NFC)
llvm-svn: 281368
Nico Weber [Tue, 13 Sep 2016 18:55:26 +0000 (18:55 +0000)]
[clang-cl] Diagnose duplicate uuids.
This mostly behaves cl.exe's behavior, even though clang-cl is stricter in some
corner cases and more lenient in others (see the included test).
To make the uuid declared previously here diagnostic work correctly, tweak
stripTypeAttributesOffDeclSpec() to keep attributes in the right order.
https://reviews.llvm.org/D24469
llvm-svn: 281367
Davide Italiano [Tue, 13 Sep 2016 18:45:13 +0000 (18:45 +0000)]
[LTO] Don't pass SF_Undefined symbols to the IRmover.
This should fix PR 30363.
llvm-svn: 281366
Reid Kleckner [Tue, 13 Sep 2016 18:40:04 +0000 (18:40 +0000)]
Fix MSVC 2013 build by using our <thread> wrapper header
llvm-svn: 281365
Evgeniy Stepanov [Tue, 13 Sep 2016 18:38:40 +0000 (18:38 +0000)]
[asan] Re-poison all redzones on activation.
When running with start_deactivated=1 in ASAN_OPTIONS, heap redzones
are not poisoned until the first instrumented module is loaded. This
can cause false negatives even on memory allocated after activation,
because redzones are normally poisoned only once when a new allocator
region is mapped.
This change attempts to fix it by iterating over all existing
allocator chunks and poisoning their redzones.
llvm-svn: 281364
Richard Smith [Tue, 13 Sep 2016 18:35:34 +0000 (18:35 +0000)]
Work around a GCC 4.7-specific issue: due to implementing older rules for
implicit declarations of move operations, GCC 4.7 would find that SelectPiece
has neither a move constructor nor a copy constructor. The copy constructor was
(correctly) deleted because the class has a member of move-only type, and the
move constructor was (incorrectly, per current C++ rules) not provided because
the class has a copy-only base class (in turn because it explicitly declares a
destructor).
llvm-svn: 281363
Simon Pilgrim [Tue, 13 Sep 2016 18:33:29 +0000 (18:33 +0000)]
[DAGCombiner] Use APInt directly in (shl (zext (srl x, C)), C) combine range test
To avoid assertion, we must ensure that the inner shift constant is within range before calling ConstantSDNode::getZExtValue(). We already know that the outer shift constant is in range.
Followup to D23007
llvm-svn: 281362
Nico Weber [Tue, 13 Sep 2016 18:17:00 +0000 (18:17 +0000)]
Revert r281336 (and r281337), it caused PR30372.
llvm-svn: 281361
Zachary Turner [Tue, 13 Sep 2016 17:53:38 +0000 (17:53 +0000)]
Some more pointer safety in Breakpoint.
Plumb unique_ptrs<> all the way through the baton interface.
NFC, this is a minor improvement to remove the possibility of an
accidental pointer ownership issue.
Reviewed By: jingham
Differential Revision: https://reviews.llvm.org/D24495
llvm-svn: 281360
Douglas Katzman [Tue, 13 Sep 2016 17:51:41 +0000 (17:51 +0000)]
[Myriad]: set LeonCASA processor feature
llvm-svn: 281359
Manman Ren [Tue, 13 Sep 2016 17:41:05 +0000 (17:41 +0000)]
ObjectiveC Generics: Start using ObjCTypeParamType.
For ObjC type parameter, we used to have TypedefType that is canonicalized to
id or the bound type. We can't represent "T <protocol>" and thus will lose
the type information in the following example:
@interface MyMutableDictionary<KeyType, ObjectType> : NSObject
- (void)setObject:(ObjectType)obj forKeyedSubscript:(KeyType <NSCopying>)key;
@end
MyMutableDictionary<NSString *, NSString *> *stringsByString;
NSNumber *n1, *n2;
stringsByString[n1] = n2;
--> no warning on type mismatch of the key.
To fix the problem, we introduce a new type ObjCTypeParamType that supports
a list of protocol qualifiers.
We create ObjCTypeParamType for ObjCTypeParamDecl when we create
ObjCTypeParamDecl. We also substitute ObjCTypeParamType instead of TypedefType
on an ObjCTypeParamDecl.
rdar://
24619481
rdar://
25060179
Differential Revision: http://reviews.llvm.org/D23080
llvm-svn: 281358
Yaxun Liu [Tue, 13 Sep 2016 17:37:09 +0000 (17:37 +0000)]
AMDGPU: Fix target options fp32/64-denormals
Fix target options for fp32/64-denormals so that
+fp64-denormals is set if fp64 is supported
-fp32-denormals if fp32 denormals is not supported, or -cl-denorms-are-zero is set
+fp32-denormals if fp32 denormals is supported and -cl-denorms-are-zero is not set
If target feature fp32/64-denormals is explicitly set, they will override default options and options deduced from -cl-denorms-are-zero.
Differential Revision: https://reviews.llvm.org/D24512
llvm-svn: 281357
Simon Pilgrim [Tue, 13 Sep 2016 17:34:56 +0000 (17:34 +0000)]
[X86][SSE] Added AVX512F and additional vector truncate test cases
trunc16i16_16i8 is currently commented out due to PR25684
llvm-svn: 281356
Manman Ren [Tue, 13 Sep 2016 17:25:08 +0000 (17:25 +0000)]
ObjectiveC generics: Add ObjCTypeParamType in the type system.
We also need to add ObjCTypeParamTypeLoc. ObjCTypeParamType supports the
representation of "T <protocol>" where T is a type parameter. Before this,
we use TypedefType to represent the type parameter for ObjC.
ObjCTypeParamType has "ObjCTypeParamDecl *OTPDecl" and it extends from
ObjCProtocolQualifiers. It is a non-canonical type and is canonicalized
to the underlying type with the protocol qualifiers.
rdar://
24619481
rdar://
25060179
Differential Revision: http://reviews.llvm.org/D23079
llvm-svn: 281355
Simon Pilgrim [Tue, 13 Sep 2016 17:15:28 +0000 (17:15 +0000)]
[DAGCombiner] Use APInt directly in (shl (ext (shl x, c1)), c2) combine
Fix failure to detect out of range shift constants leading to assert in ConstantSDNode::getZExtValue()
Followup to D23007
llvm-svn: 281354
Manman Ren [Tue, 13 Sep 2016 17:03:12 +0000 (17:03 +0000)]
ObjectiveC: Refactor applyObjCProtocolQualifiers.
To construct the canonical type of ObjCTypeParamType, we need to apply
qualifiers on ObjCObjectPointerType. The updated applyObjCProtocolQualifiers
handles this case by merging the protocol lists, constructing a new
ObjCObjectType, then a new ObjCObjectPointerType.
rdar://
24619481
rdar://
25060179
Differential Revision: http://reviews.llvm.org/D24059
llvm-svn: 281353
Todd Fiala [Tue, 13 Sep 2016 16:53:07 +0000 (16:53 +0000)]
fixup Xcode build for removal of MIUtilParse.*
llvm-svn: 281352
Manman Ren [Tue, 13 Sep 2016 16:45:29 +0000 (16:45 +0000)]
Add a class ObjCProtocolQualifiers to wrap APIs for ObjC protocol list.
Now ObjCObjectType extends from ObjCProtocolQualifiers. We save number of
protocols in ObjCProtocolQualifiers.
This is in preparation of adding a new type class ObjCTypeParamType that
can take protocol qualifiers.
rdar://
24619481
rdar://
25060179
Differential Revision: http://reviews.llvm.org/D23078
llvm-svn: 281351
Matt Arsenault [Tue, 13 Sep 2016 16:39:43 +0000 (16:39 +0000)]
Fix misleading comment for getOrEnforceKnownAlignment
It does not return 0 to indicate failure, and returns the known
alignment.
llvm-svn: 281350
Dimitar Vlahovski [Tue, 13 Sep 2016 16:22:15 +0000 (16:22 +0000)]
Fix a merge mishap in rL281348
llvm-svn: 281349
Dimitar Vlahovski [Tue, 13 Sep 2016 15:54:38 +0000 (15:54 +0000)]
MinidumpParsing: pid, modules, exceptions, strings
Summary:
Added parsing of the MiscInfo data stream.
The main member of it that we care about is the process_id
On Linux generated Minidump (from breakpad) we don't have
the MiscInfo, we have the /proc/$pid/status from where we can get the
pid.
Also parsing the module list - the list of all of the loaded
modules/shared libraries.
Parsing the exception stream.
Parsing MinidumpStrings.
I have unit tests for all of that.
Also added some tests using a Minidump generated from Windows tools (not
from breakpad)
Reviewers: labath, zturner
Subscribers: beanz, lldb-commits
Differential Revision: https://reviews.llvm.org/D24385
llvm-svn: 281348
Jason Henline [Tue, 13 Sep 2016 15:44:18 +0000 (15:44 +0000)]
[SE] Stop using llvm-config --cxxflags
Summary:
Build configuration was adding $(llvm-config --cxxflags) to the
StreamExecutor CXXFLAGS, but this was causing "-O3" to be passed even
for debug builds, and was making debugging difficult.
The llvm-config call was originally introduced to handle the -fno-rtti
flag because an RTTI StreamExecutor could not link with a no-RTTI LLVM.
This patch converts to using LLVM_ENABLE_RTTI and only adding the
`-fno-rtti` flag if needed, not all the rest of the LLVM CXXFLAGS.
I have tested this with clang-4.0 and gcc-4.8 on Ubuntu. Some work will
probably have to be done to support MSVC.
Reviewers: jlebar
Subscribers: beanz, jprice, parallel_libs-commits, mgorny
Differential Revision: https://reviews.llvm.org/D24474
llvm-svn: 281347
Nico Weber [Tue, 13 Sep 2016 15:05:04 +0000 (15:05 +0000)]
Traversing template paramter lists of DeclaratorDecls and/or TagDecls.
The unit tests in this patch demonstrate the need to traverse template
parameter lists of DeclaratorDecls (e.g. VarDecls, CXXMethodDecls) and
TagDecls (e.g. EnumDecls, RecordDecls).
Fixes PR29042.
https://reviews.llvm.org/D24268
Patch from Lukasz
Łukasz Anforowicz <lukasza@chromium.org>!
llvm-svn: 281345
Eric Liu [Tue, 13 Sep 2016 15:02:43 +0000 (15:02 +0000)]
Remove redundant comma around parenthesis in parameter list.
Reviewers: djasper
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D24501
llvm-svn: 281344
Andrea Di Biagio [Tue, 13 Sep 2016 14:50:47 +0000 (14:50 +0000)]
[ConstantFold] Improve the bitcast folding logic for constant vectors.
The constant folder didn't know how to always fold bitcasts of constant integer
vectors. In particular, it was unable to handle the case where a constant vector
had some undef elements, and the resulting (i.e. bitcasted) vector type had more
elements than the original vector type.
Example:
%cast = bitcast <2 x i64><i64 undef, i64 2> to <4 x i32>
On a little endian target, %cast could have been folded to:
<4 x i32><i32 undef, i32 undef, i32 2, i32 0>
This patch improves the folding logic by teaching how to correctly propagate
undef elements in the folded vector.
Differential Revision: https://reviews.llvm.org/D24301
llvm-svn: 281343
Jonas Hahnfeld [Tue, 13 Sep 2016 14:42:40 +0000 (14:42 +0000)]
[asan] Add missing include for rand()
llvm-svn: 281342
Simon Pilgrim [Tue, 13 Sep 2016 14:41:39 +0000 (14:41 +0000)]
[X86] Regenerated shift combine tests.
Added x86_64 tests
llvm-svn: 281341
Vassil Vassilev [Tue, 13 Sep 2016 14:41:35 +0000 (14:41 +0000)]
[modules] Re-enable some previously excluded files.
Our modules support seems to be able to handle them nowadays.
Patch by Cristina Cristescu!
llvm-svn: 281340
Krzysztof Parzyszek [Tue, 13 Sep 2016 14:36:55 +0000 (14:36 +0000)]
[Hexagon] Clear the flow queue after visiting a single instruction
llvm-svn: 281339
Rafael Espindola [Tue, 13 Sep 2016 14:23:14 +0000 (14:23 +0000)]
Enable merging of SHF_MERGE sections with linker scripts.
This also fixes the related problem of non SHF_MERGE sections with
different flags not being merged.
Fixes pr30355.
llvm-svn: 281338
Nirav Dave [Tue, 13 Sep 2016 13:57:16 +0000 (13:57 +0000)]
Apply Clang-format to MCAsmParser.cpp NFC.
llvm-svn: 281337
Nirav Dave [Tue, 13 Sep 2016 13:55:06 +0000 (13:55 +0000)]
Defer asm errors to post-statement failure
Recommitting after fixing AsmParser Initialization.
Allow errors to be deferred and emitted as part of clean up to simplify
and shorten Assembly parser code. This will allow error messages to be
emitted in helper functions and be modified by the caller which has
better context.
As part of this many minor cleanups to the Parser:
* Unify parser cleanup on error
* Add Workaround for incorrect return values in ParseDirective instances
* Tighten checks on error-signifying return values for parser functions
and fix in-tree TargetParsers to be more consistent with the changes.
* Fix AArch64 test cases checking for spurious error messages that are
now fixed.
These changes should be backwards compatible with current Target Parsers
so long as the error status are correctly returned in appropriate
functions.
Reviewers: rnk, majnemer
Subscribers: aemerson, jyknight, llvm-commits
Differential Revision: https://reviews.llvm.org/D24047
llvm-svn: 281336
Chad Rosier [Tue, 13 Sep 2016 13:30:30 +0000 (13:30 +0000)]
[LoopInterchange] Minor refactor. NFC.
llvm-svn: 281334
Tobias Grosser [Tue, 13 Sep 2016 13:22:27 +0000 (13:22 +0000)]
GPGPU: Use const_cast to avoid compiler warning [NFC]
llvm-svn: 281333
Andrea Di Biagio [Tue, 13 Sep 2016 13:17:42 +0000 (13:17 +0000)]
[InstSimplify] Add tests to show missed bitcast folding opportunities.
InstSimplify doesn't always know how to fold a bitcast of a constant vector.
In particular, the logic in InstSimplify doesn't know how to handle the case
where the constant vector in input contains some undef elements, and the
number of elements is smaller than the number of elements of the bitcast
vector type.
llvm-svn: 281332
Chad Rosier [Tue, 13 Sep 2016 13:08:53 +0000 (13:08 +0000)]
Don't use else if after return. Tidy comments. NFC.
llvm-svn: 281331
Chad Rosier [Tue, 13 Sep 2016 13:00:29 +0000 (13:00 +0000)]
Typo. NFC.
llvm-svn: 281330
Rafael Espindola [Tue, 13 Sep 2016 13:00:06 +0000 (13:00 +0000)]
Refactor duplicated code. NFC.
llvm-svn: 281329