Tim Shen [Fri, 28 Oct 2016 20:13:06 +0000 (20:13 +0000)]
[APFloat] Use std::move() in move assignment operator
llvm-svn: 285442
Adrian Prantl [Fri, 28 Oct 2016 20:11:27 +0000 (20:11 +0000)]
Rename DWARF 5 constants to adapt to change in LLVM
llvm-svn: 285441
Krzysztof Parzyszek [Fri, 28 Oct 2016 20:06:37 +0000 (20:06 +0000)]
Handle non-~0 lane masks on live-in registers in LivePhysRegs
When LivePhysRegs adds live-in registers, it recognizes ~0 as a special
lane mask indicating the entire register. If the lane mask is not ~0,
it will only add the subregisters that overlap the specified lane mask.
The problem is that if a live-in register does not have subregisters,
and the lane mask is not ~0, it will not be added to the live set.
(The given lane mask may simply be the lane mask of its register class.)
If a register does not have subregisters, add it to the live set if
the lane mask is non-zero.
Differential Revision: https://reviews.llvm.org/D26094
llvm-svn: 285440
Nemanja Ivanovic [Fri, 28 Oct 2016 20:04:53 +0000 (20:04 +0000)]
[PPC] add float and double overloads for vec_orc and vec_nand in altivec.h
This patch corresponds to review https://reviews.llvm.org/D25950.
Committing on behalf of Sean Fertile.
llvm-svn: 285439
Matt Arsenault [Fri, 28 Oct 2016 20:00:33 +0000 (20:00 +0000)]
SpeculativeExecution: Allow speculating more inst types
Partial step towards removing the whitelist and only
using TTI's cost.
llvm-svn: 285438
Richard Smith [Fri, 28 Oct 2016 19:54:43 +0000 (19:54 +0000)]
PR30831: Teach template type diffing to cope with TemplateSpecializationTypes
that desugar to non-TSTs (such as injected-class-names).
llvm-svn: 285437
Nemanja Ivanovic [Fri, 28 Oct 2016 19:49:03 +0000 (19:49 +0000)]
Implement vector count leading/trailing bytes with zero lsb and vector parity
builtins - clang portion
This patch corresponds to review: https://reviews.llvm.org/D26002
Committing on behalf of Zaara Syeda.
llvm-svn: 285436
Matt Arsenault [Fri, 28 Oct 2016 19:43:31 +0000 (19:43 +0000)]
AMDGPU: Fix using incorrect private resource with no allocation
It's possible to have a use of the private resource descriptor or
scratch wave offset registers even though there are no allocated
stack objects. This would result in continuing to use the maximum
number reserved registers. This could go over the number of SGPRs
available on VI, or violate the SGPR limit requested by
the function attributes.
llvm-svn: 285435
Nemanja Ivanovic [Fri, 28 Oct 2016 19:38:24 +0000 (19:38 +0000)]
Implement vector count leading/trailing bytes with zero lsb and vector parity
builtins - llvm portion
This patch corresponds to review https://reviews.llvm.org/D26003.
Committing on behalf of Zaara Syeda.
llvm-svn: 285434
Teresa Johnson [Fri, 28 Oct 2016 19:36:00 +0000 (19:36 +0000)]
[ThinLTO] Use flags from summary when writing variable summary (NFC)
We already read the flags out of the summary when writing the summary
records for functions and aliases, do the same for variables.
This is an NFC change for now since the flags computed on the fly from
the GlobalValue currently will always match those in the summary
already, but once I send a follow-on patch to set the NoRename flag for
locals in the llvm.used set this becomes a necessary change.
llvm-svn: 285433
George Burgess IV [Fri, 28 Oct 2016 19:22:46 +0000 (19:22 +0000)]
[MemorySSA] Add const to getClobberingMemoryAccess.
Thanks to bryant for the patch!
Differential Revision: https://reviews.llvm.org/D26086
llvm-svn: 285432
Arnold Schwaighofer [Fri, 28 Oct 2016 19:18:09 +0000 (19:18 +0000)]
Make swift calling convention test specific to armv7
llvm-svn: 285431
Richard Smith [Fri, 28 Oct 2016 19:11:18 +0000 (19:11 +0000)]
Fix implementation of the likely resolution of core issue 253 to support class
based arrays. Patch by Ian Tessier!
Differential Review: https://reviews.llvm.org/D25974
llvm-svn: 285430
Sanjay Patel [Fri, 28 Oct 2016 19:08:20 +0000 (19:08 +0000)]
[x86] add tests for missed umin/umax
This is actually a deficiency in ValueTracking's matchSelectPattern(),
but a codegen test is the simplest way to expose the bug.
llvm-svn: 285429
Bob Wilson [Fri, 28 Oct 2016 18:55:50 +0000 (18:55 +0000)]
Add missing newline at EOF to avoid -Wnewline-eof warnings.
llvm-svn: 285428
Eric Fiselier [Fri, 28 Oct 2016 18:26:06 +0000 (18:26 +0000)]
Try 2 to add extern C++ to __libcpp_library_version
llvm-svn: 285427
Lang Hames [Fri, 28 Oct 2016 18:24:15 +0000 (18:24 +0000)]
[Error] Unify +Asserts/-Asserts behavior for checked flags in Error/Expected<T>.
(1) Switches to raw pointer and bitmasking operations for Error payload.
(2) Always includes the 'unchecked' bitfield in Expected<T>, even in -Asserts.
(3) Always propagates checked bit status in move-ops for both classes, even in
-Asserts.
This should allow debug programs to link against release libraries without
encountering spurious 'unchecked error' terminations.
Error checks still aren't verified in release mode so this doesn't introduce
any new control flow, but it does require new bit-masking ops in release mode
to preserve the flag values during move ops. I expect the overhead to be
minimal, but if we discover any corner cases where it matters we could fix
this by making flag propagation conditional on a new build option.
llvm-svn: 285426
Adrian Prantl [Fri, 28 Oct 2016 18:21:39 +0000 (18:21 +0000)]
Move the DWARF attribute constants into Dwarf.def and delete 300 lines of silly code.
llvm-svn: 285425
Adrian Prantl [Fri, 28 Oct 2016 18:14:43 +0000 (18:14 +0000)]
Rename DWARF 5 constants to adapt to change in LLVM
llvm-svn: 285424
Matthias Braun [Fri, 28 Oct 2016 18:05:09 +0000 (18:05 +0000)]
MachineRegisterInfo: Remove unused arg from isConstantPhysReg(); NFC
llvm-svn: 285423
Matthias Braun [Fri, 28 Oct 2016 18:05:05 +0000 (18:05 +0000)]
TargetPassConfig: Move addPass of IPRA RegUsageInfoProp down.
TargetPassConfig::addMachinePasses() does some housekeeping first:
Handling the -print-machineinstrs flag and doing an initial printing
"After Instruction Selection". There is no reason for RegUsageInfoProp
to run before those two steps.
llvm-svn: 285422
Adrian Prantl [Fri, 28 Oct 2016 17:59:50 +0000 (17:59 +0000)]
Import/update constants from the DWARF 5 public review draft document.
https://reviews.llvm.org/D26051
llvm-svn: 285421
Dmitry Vyukov [Fri, 28 Oct 2016 17:25:27 +0000 (17:25 +0000)]
tsan: fix windows meta mapping
Currently windows fails on startup with:
CHECK failed: gotsan.cc:3077 "(((m - prev_m) / kMetaShadowSize)) == (((p - prev) / kMetaShadowCell))" (0x3ffffffeffffff7e, 0x6ffffff7e)
Make MemToMeta do the same MemToShadow does on windows: add offset instead of or'ing it.
llvm-svn: 285420
Michael Zuckerman [Fri, 28 Oct 2016 17:25:26 +0000 (17:25 +0000)]
Fixing small problem with avx512-reduceIntrin.c test on some OS.
llvm-svn: 285419
Dmitry Vyukov [Fri, 28 Oct 2016 17:23:08 +0000 (17:23 +0000)]
tsan: fix code formatting
llvm-svn: 285418
Arnold Schwaighofer [Fri, 28 Oct 2016 17:21:05 +0000 (17:21 +0000)]
More swift calling convention tests
llvm-svn: 285417
Bruno Cardoso Lopes [Fri, 28 Oct 2016 17:02:10 +0000 (17:02 +0000)]
Revert "[Preprocessor] Support for '-dI' flag"
This reverts r285411. Tests failing on
http://lab.llvm.org:8011/builders/clang-x86-windows-msvc2015/builds/141
llvm-svn: 285416
Kostya Serebryany [Fri, 28 Oct 2016 16:55:29 +0000 (16:55 +0000)]
[libFuzzer] a bit more docs
llvm-svn: 285415
Sanjay Patel [Fri, 28 Oct 2016 16:54:03 +0000 (16:54 +0000)]
[InstCombine] move/add tests for smin/smax folds
llvm-svn: 285414
Lang Hames [Fri, 28 Oct 2016 16:52:34 +0000 (16:52 +0000)]
[lli] Pass command line arguments in to the orc-lazy JIT.
This brings the LLI orc-lazy JIT's behavior more closely in-line with LLI's
mcjit bahavior.
llvm-svn: 285413
Justin Lebar [Fri, 28 Oct 2016 16:46:39 +0000 (16:46 +0000)]
Relax assertion in FunctionDecl::doesDeclarationForceExternallyVisibleDefinition.
Previously we were asserting that this declaration doesn't have a body
*and* won't have a body after we continue parsing. This is too strong
and breaks the go-bindings test during codegen.
llvm-svn: 285412
Bruno Cardoso Lopes [Fri, 28 Oct 2016 16:32:10 +0000 (16:32 +0000)]
[Preprocessor] Support for '-dI' flag
Implement the -dI as supported by GCC: Output ‘#include’ directives in addition
to the result of preprocessing.
This change aims to add this option, pass it through to the preprocessor via
the options class, and when inclusions occur we output some information (+ test
cases).
Patch by Steve O'Brien!
Differential Revision: https://reviews.llvm.org/D25153
llvm-svn: 285411
Justin Lebar [Fri, 28 Oct 2016 16:26:26 +0000 (16:26 +0000)]
[CUDA] [AST] Allow isInlineDefinitionExternallyVisible to be called on functions without bodies.
Summary:
In CUDA compilation, we call isInlineDefinitionExternallyVisible (via
getGVALinkageForFunction) on functions while parsing their definitions.
At the point in time when we call getGVALinkageForFunction, we haven't
yet added the body to the function, so we trip this assert. But as far
as I can tell, this is harmless.
To work around this, we add a new flag to FunctionDecl, "WillHaveBody".
There was other code that was working around the existing assert with a
really awful hack -- this change lets us get rid of that hack.
Reviewers: rsmith, tra
Subscribers: aemerson, cfe-commits
Differential Revision: https://reviews.llvm.org/D25640
llvm-svn: 285410
Krzysztof Parzyszek [Fri, 28 Oct 2016 15:50:22 +0000 (15:50 +0000)]
[Hexagon] Maintain kill flags through splitting in expand-condsets
Do not use LiveIntervals to recalculate kills, because that cannot be
done accurately without implicit uses on predicated instructions.
llvm-svn: 285409
Samuel Antao [Fri, 28 Oct 2016 15:42:38 +0000 (15:42 +0000)]
Define extra variable in OpenMP offloading driver tests.
llvm-svn: 285408
Tom Stellard [Fri, 28 Oct 2016 15:32:28 +0000 (15:32 +0000)]
[Loads] Fix crash in is isDereferenceableAndAlignedPointer()
Summary:
We were trying to add APInt values with different bit sizes after
visiting an addrspacecast instruction which changed the bit width
of the pointer.
Reviewers: majnemer, hfinkel
Subscribers: hfinkel, wdng, llvm-commits
Differential Revision: https://reviews.llvm.org/D24774
llvm-svn: 285407
Teresa Johnson [Fri, 28 Oct 2016 15:30:27 +0000 (15:30 +0000)]
[cmake] Temporarily revert enforcement of minimum GCC version increase
Summary:
This is temporary, until bot that builds public facing LLVM
documentation is upgraded. It reverts only the cmake change in r284497,
but leaves the doc changes in place to preserve intent.
Reviewers: aaron.ballman
Subscribers: mgorny, llvm-commits
Differential Revision: https://reviews.llvm.org/D26078
llvm-svn: 285406
Michael Zuckerman [Fri, 28 Oct 2016 15:16:03 +0000 (15:16 +0000)]
1. Fixing small types issue (PD|PS) (reduce) .
2. Cosmetic changes
llvm-svn: 285405
Samuel Antao [Fri, 28 Oct 2016 15:11:50 +0000 (15:11 +0000)]
Change OpenMP offload driver tests so that it doesn't use the full file path during tests.
This was causing failures on windows bots.
llvm-svn: 285404
Eric Fiselier [Fri, 28 Oct 2016 15:02:30 +0000 (15:02 +0000)]
Explicitly specify extern "C++" on __libcpp_library_version
llvm-svn: 285403
Matthew Simpson [Fri, 28 Oct 2016 14:27:45 +0000 (14:27 +0000)]
[LV] Correct misleading comments in test (NFC)
llvm-svn: 285402
Dmitry Vyukov [Fri, 28 Oct 2016 14:25:51 +0000 (14:25 +0000)]
sanitizer_common: fix description of disable_coredump flag
s/disable_core/disable_coredump/
Add missing space in text.
llvm-svn: 285401
Dmitry Vyukov [Fri, 28 Oct 2016 14:16:13 +0000 (14:16 +0000)]
tsan: fix windows build
Currently fails with:
C:\workdir\compiler-rt\lib\tsan\go>gcc -c -o race_windows_amd64.syso gotsan.cc -I..\rtl -I..\.. -I..\..\sanitizer_common -I..\..\..\include -m64 -Wall -fno-exceptions -fno-rtti -DSANITIZER_GO -Wno-error=at
tributes -Wno-attributes -Wno-format -Wno-maybe-uninitialized -DSANITIZER_DEBUG=0 -O3 -fomit-frame-pointer -std=c++11
gotsan.cc:9229:0: warning: ignoring #pragma comment [-Wunknown-pragmas]
#pragma comment(linker, "/alternatename:__sanitizer_print_memory_profile=__sanitizer_default_print_memory_profile") // NOLINT
^
gotsan.cc: In function 'void __sanitizer_print_memory_profile(int)':
gotsan.cc:9226:17: error: redefinition of 'void __sanitizer_print_memory_profile(int)'
extern "C" void __sanitizer_print_memory_profile(int top_percent) {}
^
gotsan.cc:6898:6: note: 'void __sanitizer_print_memory_profile(int)' previously defined here
void __sanitizer_print_memory_profile(int top_percent) {
Remove __sanitizer_print_memory_profile from Go build, it is not needed.
llvm-svn: 285400
Simon Pilgrim [Fri, 28 Oct 2016 14:07:44 +0000 (14:07 +0000)]
[SelectionDAG] computeKnownBits - early-out if any BUILD_VECTOR element has no known bits
No need to check the remaining elements - no common known bits are available.
llvm-svn: 285399
Simon Pilgrim [Fri, 28 Oct 2016 13:42:23 +0000 (13:42 +0000)]
[SelectionDAG] Tidyup UDIV computeKnownBits implementation
No need to clear KnownOne2/KnownZero2 bits as the next call to computeKnownBits will overwrite them anyway
llvm-svn: 285398
Simon Pilgrim [Fri, 28 Oct 2016 13:13:16 +0000 (13:13 +0000)]
[SelectionDAG] Increment computeKnownBits recursion depth for SMIN/SMAX/UMIN/UMAX like all other ops
llvm-svn: 285397
Benjamin Kramer [Fri, 28 Oct 2016 13:00:49 +0000 (13:00 +0000)]
[include-fixer] Make error message sound less like clang crashed.
We suppress all Clang diagnostics (because they would be wrong,
include-fixer does custom recovery) but still want to give some feedback
in case there was a compiler error we couldn't recover from. The most
common case for this is a #include in the file that couldn't be found.
llvm-svn: 285396
Anastasia Stulova [Fri, 28 Oct 2016 12:59:39 +0000 (12:59 +0000)]
[OpenCL] Diagnose variadic arguments
OpenCL disallows using variadic arguments (s6.9.e and s6.12.5 OpenCL v2.0)
apart from some exceptions:
- printf
- enqueue_kernel
This change adds error diagnostic for variadic functions but accepts printf
and any compiler internal function (which should cover __enqueue_kernel_XXX cases).
It also unifies diagnostic with block prototype and adds missing uncaught cases for blocks.
llvm-svn: 285395
Igor Laevsky [Fri, 28 Oct 2016 12:57:20 +0000 (12:57 +0000)]
[LCSSA] Perform LCSSA verification only for the current loop nest.
Now LPPassManager will run LCSSA verification only for the top-level loop
which was processed on the current iteration.
Differential Revision: https://reviews.llvm.org/D25873
llvm-svn: 285394
Pavel Labath [Fri, 28 Oct 2016 11:28:01 +0000 (11:28 +0000)]
Add a couple of fun unit tests for FileSpec::Equal
Most of them fail right now and are commented out. The main problem is handling
of backslashes on windows, but also the posix path code has a couple of issues.
llvm-svn: 285393
Eric Fiselier [Fri, 28 Oct 2016 11:01:12 +0000 (11:01 +0000)]
Fix test when using an installed libc++
llvm-svn: 285392
Alex Lorenz [Fri, 28 Oct 2016 10:25:10 +0000 (10:25 +0000)]
[Objective-C] Add objc_subclassing_restricted attribute
This patch adds an objc_subclassing_restricted attribute into clang. This
attribute acts similarly to 'final' - Objective-C classes with this attribute
can't be subclassed. However, @interface declarations that have
objc_subclassing_restricted but don't have @implementation are allowed to
inherit other @interface declarations with objc_subclassing_restricted. This is
needed to describe the Swift class hierarchy in clang while making sure that
the Objective-C classes cannot subclass the Swift classes.
This attribute is already implemented in a fork of clang that's used for Swift
(https://github.com/apple/swift-clang) and this patch moves that code to the
upstream clang repository.
rdar://
28937548
Differential Revision: https://reviews.llvm.org/D25993
llvm-svn: 285391
Simon Pilgrim [Fri, 28 Oct 2016 10:09:35 +0000 (10:09 +0000)]
Fix MSVC "not all control paths return a value" warning
Add unreachable after enum switch statement
llvm-svn: 285390
Maxim Ostapenko [Fri, 28 Oct 2016 09:49:34 +0000 (09:49 +0000)]
[asan] Run pthread_create_from_constructor test on x86 targets.
llvm-svn: 285389
Benjamin Kramer [Fri, 28 Oct 2016 09:20:02 +0000 (09:20 +0000)]
[openmp] Remove test assumption that canonical binary name contains "clang"
Patch by Sam McCall!
Differential Revision: https://reviews.llvm.org/D26067
llvm-svn: 285388
Maxim Ostapenko [Fri, 28 Oct 2016 08:45:23 +0000 (08:45 +0000)]
[asan] Disable pthread_create_from_constructor test on PowerPC64.
llvm-svn: 285387
Erik Verbruggen [Fri, 28 Oct 2016 08:28:42 +0000 (08:28 +0000)]
Sema: do not warn about unused const vars if main file is a header
If we pass a header to libclang, e.g. because it's open in an editor in
an IDE, warnings about unused const vars are not useful: other files
that include the header might use those constants. So when -x *-header
is passed as command-line option, suppress this warning.
llvm-svn: 285386
Maxim Ostapenko [Fri, 28 Oct 2016 06:49:53 +0000 (06:49 +0000)]
[asan/lsan] Avoid possible deadlock in dynamic ASan runtime thread initialization.
There is possible deadlock in dynamic ASan runtime when we dlopen() shared lib
which creates a thread at the global initialization stage. The scenario:
1) dlopen grabs a GI_pthread_mutex_lock in main thread.
2) main thread calls pthread_create, ASan intercepts it, calls real pthread_create
and waits for the second thread to be "fully initialized".
3) Newly created thread tries to access a thread local disable_counter in LSan
(to complete its "full initialization") and hangs in tls_get_addr_tail, because
it also tries to acquire GI_pthread_mutex_lock.
The issue is reproducible on relative recent Glibc versions e.g. 2.23.
Differential Revision: https://reviews.llvm.org/D26028
llvm-svn: 285385
Eric Fiselier [Fri, 28 Oct 2016 06:40:29 +0000 (06:40 +0000)]
Add more tests for optional<const T>
llvm-svn: 285384
Eric Fiselier [Fri, 28 Oct 2016 06:09:44 +0000 (06:09 +0000)]
Update mac ABI list
llvm-svn: 285383
Eric Fiselier [Fri, 28 Oct 2016 06:06:50 +0000 (06:06 +0000)]
Add __libcpp_version file and __libcpp_library_version function.
This patch does two seperate things. First it adds a file called
"__libcpp_version" which only contains the current libc++ version
(currently 4000). This file is not intended for use as a header. This file
is used by Clang in order to easily determine the installed libc++ version.
This allows Clang to enable/disable certain language features only when the
library supports them.
The second change is the addition of _LIBCPP_LIBRARY_VERSION macro, which
returns the version of the installed dylib since it may be different than
the headers.
llvm-svn: 285382
Juergen Ributzka [Fri, 28 Oct 2016 04:01:12 +0000 (04:01 +0000)]
Revert "[DAGCombiner] Add vector demanded elements support to computeKnownBits"
This seems to have increased LTO compile time bejond 2x of previous builds.
See http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto/10676/
llvm-svn: 285381
Davide Italiano [Fri, 28 Oct 2016 02:47:09 +0000 (02:47 +0000)]
[Reassociate] Removing instructions mutates the IR.
Fixes PR 30784. Discussed with Justin, who pointed out that
in the new PassManager infrastructure we can have more fine-grained
control on which analyses we want to preserve, but this is the
best we can do with the current infrastructure.
llvm-svn: 285380
Teresa Johnson [Fri, 28 Oct 2016 02:39:38 +0000 (02:39 +0000)]
[ThinLTO] Create AliasSummary when building index
Summary:
Previously we were creating the alias summary on the fly while writing
the summary to bitcode. This moves the creation of these summaries to
the module summary index builder where we build the rest of the summary
index.
This is going to be necessary for setting the NoRename flag for values
possibly used in inline asm or module level asm.
Reviewers: mehdi_amini
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D26049
llvm-svn: 285379
Bruno Cardoso Lopes [Fri, 28 Oct 2016 02:37:04 +0000 (02:37 +0000)]
[Modules] Make test from r285377 darwin specific
Appease buildbots:
http://bb.pgr.jp/builders/cmake-clang-x86_64-linux/builds/55876
llvm-svn: 285378
Bruno Cardoso Lopes [Fri, 28 Oct 2016 02:30:45 +0000 (02:30 +0000)]
[Modules] Add testcase for builtins used in umbrella headers
This used to work before r284797 + r285152, which exposed something
interesting; some users include builtins from umbrella headers.
Clang should emit a warning to warn users this is not a good practice
and umbrella headers shouldn't get the
implicitly-add-the-builtin-version behavior for builtin header names.
While we're not there, add the testcase to represent the way it
currently works.
llvm-svn: 285377
Teresa Johnson [Fri, 28 Oct 2016 02:24:59 +0000 (02:24 +0000)]
[ThinLTO] Rename HasSection to NoRename (NFC)
Summary:
This is in preparation for a change to utilize this flag for symbols
referenced/defined in either inline or module level assembly.
Reviewers: mehdi_amini
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D26048
llvm-svn: 285376
Davide Italiano [Fri, 28 Oct 2016 01:41:56 +0000 (01:41 +0000)]
[IR] Clang-format my previous commit. NFCI.
llvm-svn: 285375
Jason Henline [Fri, 28 Oct 2016 00:54:02 +0000 (00:54 +0000)]
[Acxxel] Remove setActiveDeviceForThread
Summary:
After experimenting with CUDA, I realized that we really only need to
set the active context right before creating an object such as a stream
or a device memory allocation. When we go on to use these objects later,
it is fine if the context that created them is no longer active,
operations with those objects will succeed anyway.
Since it turns out that we don't have to check the active context for
every operation, it makes sense to hide this active context from users
(by removing the "ActiveDeviceForThread" setter and getter) and to
change the Acxxel API to explicitly pass in the device ID to create
objects.
This change improves the Acxxel API and greatly simplifies the CUDA and
OpenCL implementations because they no longer require thread_local data.
Reviewers: jlebar, jprice
Subscribers: mgorny, parallel_libs-commits
Differential Revision: https://reviews.llvm.org/D26050
llvm-svn: 285372
Davide Italiano [Fri, 28 Oct 2016 00:53:16 +0000 (00:53 +0000)]
[ConstantFold] Get the correct vector type when folding a getelementptr.
Differential Revision: https://reviews.llvm.org/D26014
llvm-svn: 285371
Richard Trieu [Fri, 28 Oct 2016 00:15:24 +0000 (00:15 +0000)]
Fix a crash on invalid code.
The diagnostic was attempting to access the QualType of a TypeDecl by calling
TypeDecl::getTypeForDecl. However, the Type pointer stored there is lazily
loaded by functions in ASTContext. In most cases, the pointer is loaded and
this does not cause a problem. However, when more that 50 or so unknown types
are seen beforehand, this causes the Type to not be loaded, passing a null
Type to the diagnostics, leading to the crash. Using
ASTContext::getTypeDeclType will give a proper QualType for all cases.
llvm-svn: 285370
Jason Molenda [Thu, 27 Oct 2016 23:52:46 +0000 (23:52 +0000)]
Check that we got back an object from MakeFunctionCaller
before we call through it.
<rdar://problem/
28979705>
llvm-svn: 285369
Tom Stellard [Thu, 27 Oct 2016 23:50:21 +0000 (23:50 +0000)]
AMDGPU/SI: Handle hazard with s_rfe_b64
Reviewers: arsenm
Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, llvm-commits, tony-tye
Differential Revision: https://reviews.llvm.org/D25638
llvm-svn: 285368
Tom Stellard [Thu, 27 Oct 2016 23:42:29 +0000 (23:42 +0000)]
AMDGPU/SI: Handle hazard with sgpr lane selects for v_{read,write}lane
Reviewers: arsenm
Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, tony-tye, llvm-commits
Differential Revision: https://reviews.llvm.org/D25637
llvm-svn: 285367
Davide Italiano [Thu, 27 Oct 2016 23:40:19 +0000 (23:40 +0000)]
Remove accidentally commited test.
llvm-svn: 285366
Davide Italiano [Thu, 27 Oct 2016 23:38:51 +0000 (23:38 +0000)]
[IR] Reintroduce getGEPReturnType(), it will be used in a later patch.
llvm-svn: 285365
Tom Stellard [Thu, 27 Oct 2016 23:28:03 +0000 (23:28 +0000)]
AMDGPU/SI: Fix unused variable warning on non-debug builds
llvm-svn: 285363
Ekaterina Romanova [Thu, 27 Oct 2016 23:20:19 +0000 (23:20 +0000)]
Reverting back r285355: "Update .debug_line section version information to match DWARF version", while I'm investigating a test failure.
llvm-svn: 285362
Chris Bieneman [Thu, 27 Oct 2016 23:18:52 +0000 (23:18 +0000)]
Revert "[Test Suite] Pull generateSource into lldbtest"
This reverts commit r285357.
I committed this patch accidentally out of order. Will recommit when the change this depends on is landed.
llvm-svn: 285361
Vedant Kumar [Thu, 27 Oct 2016 23:17:51 +0000 (23:17 +0000)]
[Coverage] Darwin: Move __llvm_covmap from __DATA to __LLVM_COV
Programs with very large __llvm_covmap sections may fail to link on
Darwin because because of out-of-range 32-bit RIP relative references.
It isn't possible to work around this by using the large code model
because it isn't supported on Darwin. One solution is to move the
__llvm_covmap section past the end of the __DATA segment.
=== Testing ===
In addition to check-{llvm,clang,profile}, I performed a link test on a
simple object after injecting ~4GB of padding into __llvm_covmap:
@__llvm_coverage_padding = internal constant [
4000000000 x i8] zeroinitializer, section "__LLVM_COV,__llvm_covmap", align 8
(This test is too expensive to check-in.)
=== Backwards Compatibility ===
This patch should not pose any backwards-compatibility concerns. LLVM
is expected to scan all of the sections in a binary for __llvm_covmap,
so changing its segment shouldn't affect anything. I double-checked this
by loading coverage produced by an unpatched compiler with a patched
llvm-cov.
Suggested by Nick Kledzik.
llvm-svn: 285360
Tom Stellard [Thu, 27 Oct 2016 23:05:31 +0000 (23:05 +0000)]
AMDGPU/SI: Handle hazard with > 8 byte VMEM stores
Reviewers: arsenm
Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, tony-tye, llvm-commits
Differential Revision: https://reviews.llvm.org/D25577
llvm-svn: 285359
Tim Shen [Thu, 27 Oct 2016 22:52:40 +0000 (22:52 +0000)]
Reapply r285351 "[APFloat] Add DoubleAPFloat mode to APFloat. NFC." with
a workaround for old clang.
llvm-svn: 285358
Chris Bieneman [Thu, 27 Oct 2016 22:52:32 +0000 (22:52 +0000)]
[Test Suite] Pull generateSource into lldbtest
Summary:
Convert tests using LLDB headers to use generateSource to put the right include paths in place regardless of whether or not you're building a framework.
This also abstracted generateSource out of TestPublicAPIHeaders.py into lldbtest.py.
Reviewers: tfiala, zturner
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D25887
llvm-svn: 285357
Chris Bieneman [Thu, 27 Oct 2016 22:51:41 +0000 (22:51 +0000)]
[CMake] Rename lldb-launcher to darwin-debug
Summary: This tool is only built on Darwin, and the name darwin-debug matches the Xcode project. We should have this in sync unless there is a good reason not to.
Reviewers: zturner, tfiala, labath
Subscribers: labath, mgorny, lldb-commits
Differential Revision: https://reviews.llvm.org/D25745
llvm-svn: 285356
Ekaterina Romanova [Thu, 27 Oct 2016 22:37:25 +0000 (22:37 +0000)]
Update .debug_line section version information to match DWARF version.
In the past the compiler always emitted .debug_line version 2, though some opcodes from DWARF 3 (e.g. DW_LNS_set_prologue_end, DW_LNS_set_epilogue_begin or DW_LNS_set_isa) and from DWARF 4 could be emitted by the compiler.
This patch changes version information of .debug_line to exactly match the DWARF version. For .debug_line version 4, a new field maximum_operations_per_instruction is emitted.
Differential Revision: https://reviews.llvm.org/D16697
llvm-svn: 285355
Tim Shen [Thu, 27 Oct 2016 21:54:29 +0000 (21:54 +0000)]
Revert "[APFloat] Add DoubleAPFloat mode to APFloat. NFC."
This reverts r285351, since it breaks the build.
llvm-svn: 285354
Kostya Serebryany [Thu, 27 Oct 2016 21:44:37 +0000 (21:44 +0000)]
[libFuzzer] enable use_cmp by default
llvm-svn: 285353
Tim Shen [Thu, 27 Oct 2016 21:40:34 +0000 (21:40 +0000)]
[libcxx] Make regex_match backtrack when search fails
Summary:
Fixes PR19851.
alg.re.match/ecma.pass.cpp still XFAILS on linux, but after commenting out
locale-related tests, it passes. I don't have a freebsd machine to produce a
full pass.
Reviewers: mclow.lists
Subscribers: cfe-commits, emaste
Differential Revision: https://reviews.llvm.org/D26026
llvm-svn: 285352
Tim Shen [Thu, 27 Oct 2016 21:39:51 +0000 (21:39 +0000)]
[APFloat] Add DoubleAPFloat mode to APFloat. NFC.
Summary:
This patch adds DoubleAPFloat mode to APFloat.
Now, an APFloat with semantics PPCDoubleDouble will have DoubleAPFloat layout
(APFloat.U.Double), which contains two underlying APFloats as
PPCDoubleDoubleImpl and IEEEdouble semantics. Currently the IEEEdouble APFloat
is not used, and the first APFloat behaves exactly the same before this change.
This patch consists of three kinds of logics:
1) Construction and destruction of APFloat. Now the ctors, dtor, assign
opertors and factory functions construct different underlying layout
based on the semantics passed in.
2) s/IEEE/getIEEE()/ for normal, lifetime-unrelated computation functions.
These functions only access Floats[0] in DoubleAPFloat, which is the
same as today's semantic.
3) A "Double dispatch" function, APFloat::convert. Converting between two
different layouts requires appropriate logic.
Neither of these change the external behavior.
Reviewers: hfinkel, kbarton, echristo, iteratee
Subscribers: mehdi_amini, llvm-commits
Differential Revision: https://reviews.llvm.org/D25977
llvm-svn: 285351
Peter Collingbourne [Thu, 27 Oct 2016 21:39:28 +0000 (21:39 +0000)]
BitcodeReader: Require clients to read the block info block at most once.
This change makes it the client's responsibility to call ReadBlockInfoBlock()
at most once. This is in preparation for a future change that will allow
there to be multiple block info blocks.
See also: http://lists.llvm.org/pipermail/llvm-dev/2016-October/106512.html
Differential Revision: https://reviews.llvm.org/D26016
llvm-svn: 285350
Anna Zaks [Thu, 27 Oct 2016 21:38:44 +0000 (21:38 +0000)]
[docs] Update the TSan and MSan docs to refer to the new no_sanitize attribute
TSan and MSan were the only remaining sanitizers referring to the deprecated
attribute for issue suppression. Update the docs to recommend
__attribute__((no_sanitize("..."))) instead.
Differential Revision: https://reviews.llvm.org/D25885
llvm-svn: 285349
Kyle Butt [Thu, 27 Oct 2016 21:37:20 +0000 (21:37 +0000)]
CodeGen: Handle missed case of block removal during BlockPlacement.
There is a use after free bug in the existing code. Loop layout selects
a preferred exit block, and then lays out the loop. If this block is
removed during layout, it needs to be invalidated to prevent a use after
free.
llvm-svn: 285348
Rui Ueyama [Thu, 27 Oct 2016 21:26:57 +0000 (21:26 +0000)]
Define ~DIHelper::DIHelper() in .cpp.
llvm-svn: 285347
Stephan T. Lavavej [Thu, 27 Oct 2016 21:25:12 +0000 (21:25 +0000)]
[PATCH] D25483: [libcxx] [test] Fix non-Standard assumptions about how many elements are allocated
llvm-svn: 285346
Sanjay Patel [Thu, 27 Oct 2016 21:19:40 +0000 (21:19 +0000)]
[InstCombine] fix foldSPFofSPF() to handle vector splats
llvm-svn: 285345
Kostya Serebryany [Thu, 27 Oct 2016 21:03:48 +0000 (21:03 +0000)]
[libFuzzer] docs: update the examples
llvm-svn: 285344
Vitaly Buka [Thu, 27 Oct 2016 21:02:32 +0000 (21:02 +0000)]
[asan] Test jumps which bypass variables declaration
Summary:
Clang should not generate lifetime intrinsics for such variables. D24693
PR28267
Reviewers: eugenis
Subscribers: llvm-commits, kubabrecka
Differential Revision: https://reviews.llvm.org/D24696
llvm-svn: 285343
Kevin Enderby [Thu, 27 Oct 2016 20:59:10 +0000 (20:59 +0000)]
Another additional error check for invalid Mach-O files for the
obsolete load commands.
Again the philosophy of the error checking in libObject for
Mach-O files, the idea behind the checking is that we never
will return a Mach-O file out of libObject that contains unknown
things the library code can’t operate on. So known obsolete
load commands will cause a hard error.
Also to make things clear I have added comments to the
values and structures in Support/Mach-O.h and
Support/MachO.def as to what is obsolete.
As noted in a TODO in the code, there may need to be a
non-default mode to allow some unknown values for well
structured Mach-O files with things like unknown load
load commands. So things like using an old lldb on a newer
Mach-O file could still provide some limited functionality.
llvm-svn: 285342
Richard Smith [Thu, 27 Oct 2016 20:55:56 +0000 (20:55 +0000)]
Add documentation describing the components of a complete toolchain including Clang.
llvm-svn: 285341
Sanjay Patel [Thu, 27 Oct 2016 20:51:03 +0000 (20:51 +0000)]
[InstCombine] add vector tests for foldSPFofSPF to show missing folds
llvm-svn: 285340