Sam Parker [Thu, 27 Oct 2016 10:43:02 +0000 (10:43 +0000)]
[ARM] Add newline char to test.
Missed a newline in the previous commit.
Differential Revision: https://reviews.llvm.org/D26027
llvm-svn: 285280
Peter Smith [Thu, 27 Oct 2016 10:28:53 +0000 (10:28 +0000)]
[ELF] Synthetic symbol definitions for ARM static linking
When static linking in ARM (like Mips) __tls_get_addr is defined by
the library so we should not define it as a synthetic.
We also need to add __exidx_start and __exidx_end for the .ARM.exidx
section as the static libc library startup code is expecting them to
be defined by the default linker script for static linking on ARM.
Differential revision: https://reviews.llvm.org/D25978
llvm-svn: 285279
Sam Parker [Thu, 27 Oct 2016 09:47:10 +0000 (09:47 +0000)]
[ARM] Predicate UMAAL selection on hasDSP.
UMAAL is a DSP instruction and it is not available on thumbv7m
(Cortex-M3) and thumbv6m (Cortex-M0+1) targets. Also fix wrong
CHECK prefix in longMAC.ll test.
Patch by Vadzim Dambrouski.
Differential Revision: https://reviews.llvm.org/D25890
llvm-svn: 285278
Vassil Vassilev [Thu, 27 Oct 2016 09:12:20 +0000 (09:12 +0000)]
Empty the CtorLists/DtorLists once emitted.
This is essential when clang is running in incremental processing mode because
we don't want to reemit the 'tors over and over again.
Patch by Axel Naumann!
Reviewed by Richard Smith and me. (https://reviews.llvm.org/D25605)
llvm-svn: 285277
Benjamin Kramer [Thu, 27 Oct 2016 08:49:18 +0000 (08:49 +0000)]
[Xray] Don't generate output for xray tests
Patch by Sam McCall!
Differential Revision: http://reviews.llvm.org/D26024
llvm-svn: 285276
Erik Verbruggen [Thu, 27 Oct 2016 08:37:14 +0000 (08:37 +0000)]
Mark invalid RecordDecls as completed.
Sema::ActOnTag creates TagDecls for records. However, if those record
declarations are invalid, and the parser is in C++ mode, it would
silently drop the TagDecl (and leave it as "beingDefined"). The problem
is that other code (e.g. the ASTWriter) will serialize all types, and
expects them to be complete. So, leaving them open would result in
failing asserts.
Fixes PR20320
Differential Revision: http://reviews.llvm.org/D21176
llvm-svn: 285275
Dylan McKay [Thu, 27 Oct 2016 08:20:47 +0000 (08:20 +0000)]
[AVR] Generate all of the TableGen files we need
This enables generation of all of the TableGen files that are used
downstream.
llvm-svn: 285274
Nicolai Haehnle [Thu, 27 Oct 2016 08:15:07 +0000 (08:15 +0000)]
AMDGPU: Fix SILoadStoreOptimizer when writes cannot be merged due register dependencies
Summary:
When finding a match for a merge and collecting the instructions that must
be moved, keep in mind that the instruction we merge might actually use one
of the defs that are being moved.
Fixes piglit spec/arb_enhanced_layouts/execution/component-layout/vs-tcs-load-output[-indirect].
The fact that the ds_read in the test case is not eliminated suggests that
there might be another problem related to alias analysis, but that's a
separate problem: this pass should still work correctly even when earlier
optimization passes missed something or were disabled.
Reviewers: tstellarAMD, arsenm
Subscribers: kzhuravl, wdng, yaxunl, llvm-commits, tony-tye
Differential Revision: https://reviews.llvm.org/D25829
llvm-svn: 285273
Dylan McKay [Thu, 27 Oct 2016 08:09:15 +0000 (08:09 +0000)]
[AVR] Compile the disassembler
This also updates references of 'TheAVRTarget' to the new
'getTheAVRTarget()' method.
llvm-svn: 285272
Eric Fiselier [Thu, 27 Oct 2016 07:30:31 +0000 (07:30 +0000)]
[coroutines] Build fallthrough and set_exception statements.
Summary:
This patch adds semantic checking and building of the fall-through `co_return;` statement as well as the `p.set_exception(std::current_exception())` call for handling uncaught exceptions.
The fall-through statement is built and checked according to:
> [dcl.fct.def.coroutine]/4
> The unqualified-ids return_void and return_value are looked up in the scope of class P. If
> both are found, the program is ill-formed. If the unqualified-id return_void is found, flowing
> off the end of a coroutine is equivalent to a co_return with no operand. Otherwise, flowing off
> the end of a coroutine results in undefined behavior.
Similarly the `set_exception` call is only built when that unqualified-id is found in the scope of class P.
Additionally this patch adds fall-through warnings for non-void returning coroutines. Since it's surprising undefined behavior I thought it would be important to add the warning right away.
Reviewers: majnemer, GorNishanov, rsmith
Subscribers: mehdi_amini, cfe-commits
Differential Revision: https://reviews.llvm.org/D25349
llvm-svn: 285271
Dylan McKay [Thu, 27 Oct 2016 07:03:47 +0000 (07:03 +0000)]
[AVR] Add AVRISelDAGToDAG.cpp
Summary: This pulls the AVR instruction selector in-tree.
Reviewers: arsenm, kparzysz
Subscribers: llvm-commits, wdng, beanz, japaric, mgorny
Differential Revision: https://reviews.llvm.org/D25278
llvm-svn: 285270
Dylan McKay [Thu, 27 Oct 2016 06:56:46 +0000 (06:56 +0000)]
[AVR] Add the machine code emitter
Reviewers: arsenm, kparzysz
Subscribers: wdng, beanz, japaric, llvm-commits, mgorny
Differential Revision: https://reviews.llvm.org/D25388
llvm-svn: 285269
Nemanja Ivanovic [Thu, 27 Oct 2016 06:23:57 +0000 (06:23 +0000)]
[PPC] add vector byte reverse functions to altivec.h
This patch corresponds to review https://reviews.llvm.org/D25915.
Committing on behalf of Sean Fertile.
llvm-svn: 285268
Nemanja Ivanovic [Thu, 27 Oct 2016 05:17:58 +0000 (05:17 +0000)]
[PowerPC] - No SExt/ZExt needed for count trailing zeros
This patch corresponds to review:
https://reviews.llvm.org/D25896
It just eliminates the redundant ZExt after a count trailing zeros instruction.
llvm-svn: 285267
Dean Michael Berris [Thu, 27 Oct 2016 04:56:14 +0000 (04:56 +0000)]
[XRay] Check in Clang whether XRay supports the target when -fxray-instrument is passed
Summary:
Added the code which explicitly emits an error in Clang in case
`-fxray-instrument` is passed, but XRay is not supported for the
selected target.
Reviewers: rsmith, aaron.ballman, rnk, dberris
Differential Revision: https://reviews.llvm.org/D24799
llvm-svn: 285266
Richard Smith [Thu, 27 Oct 2016 01:46:24 +0000 (01:46 +0000)]
Atomics library: provide operations for __int128 when it is available.
llvm-svn: 285265
Samuel Antao [Thu, 27 Oct 2016 01:08:58 +0000 (01:08 +0000)]
Remove check for -o option in offloading actions builder.
This check is also present when jobs are built, so the offloading builder check is not needed anymore.
llvm-svn: 285264
Samuel Antao [Thu, 27 Oct 2016 00:53:34 +0000 (00:53 +0000)]
Fix bug when compiling CUDA code with -emit-llvm and -o.
In this case the device code is not injected into an host action and therefore the
user should get an error as -o can't be used when generating two outputs.
llvm-svn: 285263
Kostya Serebryany [Thu, 27 Oct 2016 00:36:38 +0000 (00:36 +0000)]
[libFuzzer] speculatively trying to fix the Mac build; second attempt
llvm-svn: 285262
NAKAMURA Takumi [Thu, 27 Oct 2016 00:34:24 +0000 (00:34 +0000)]
xray-extract.cc: Quick fix for mingw, to avoid errc::protocol_error.
errc::protocol_error is winsock-oriented and mingw doesn't include it. (MS does, though)
llvm-svn: 285261
Kostya Serebryany [Thu, 27 Oct 2016 00:24:34 +0000 (00:24 +0000)]
[libFuzzer] revert 285259 -- hit commit too soon
llvm-svn: 285260
Kostya Serebryany [Thu, 27 Oct 2016 00:22:39 +0000 (00:22 +0000)]
[libFuzzer] speculatively trying to fix the Mac build
llvm-svn: 285259
John McCall [Wed, 26 Oct 2016 23:46:34 +0000 (23:46 +0000)]
Refactor call emission to package the function pointer together with
abstract information about the callee. NFC.
The goal here is to make it easier to recognize indirect calls and
trigger additional logic in certain cases. That logic will come in
a later patch; in the meantime, I felt that this was a significant
improvement to the code.
llvm-svn: 285258
Davide Italiano [Wed, 26 Oct 2016 23:46:16 +0000 (23:46 +0000)]
[IR] Retire unused getGEPReturnType overload. NFCI.
llvm-svn: 285257
Tim Shen [Wed, 26 Oct 2016 23:31:41 +0000 (23:31 +0000)]
[APFloat] Fix APFloat::getExactInverse when the input is nullptr. This is a regression introduced by r285105.
Reviewers: kbarton, echristo, iteratee, eugenis
Subscribers: llvm-commits, mehdi_amini
Differential Revision: https://reviews.llvm.org/D26017
llvm-svn: 285256
Anna Zaks [Wed, 26 Oct 2016 23:23:38 +0000 (23:23 +0000)]
[sanitizers] Set Darwin specific linker and compiler flags for all tests
Looks like we are missing these flags only in tsan and sanitizer-common.
This results in linker warnings in some settings as it can cause the Unit
tests to be built with a different SDK version than that was used to build
the runtime. For example, we are not setting the minimal deployment target
on the tests but are setting the minimal deployment target for the sanitizer
library, which leads to the following warning on some bots: ld: warning:
object file (sanitizer_posix_test.cc.i386.o) was built for newer OSX version
(10.12) than being linked (10.11).
Differential Revision: https://reviews.llvm.org/D25860 https://reviews.llvm.org/D25352
llvm-svn: 285255
Mehdi Amini [Wed, 26 Oct 2016 23:23:08 +0000 (23:23 +0000)]
Unconditionally pass `-lto_library` to the linker on Darwin
We're only doing it with -flto currently, however it never "hurt"
to pass it, and users that are linking without -flto can get in
trouble if one of the dependency (a static library for instance)
contains bitcode.
Differential Revision: https://reviews.llvm.org/D25932
llvm-svn: 285254
Anna Zaks [Wed, 26 Oct 2016 22:51:47 +0000 (22:51 +0000)]
[analyzer] Report CFNumberGetValue API misuse
This patch contains 2 improvements to the CFNumber checker:
- Checking of CFNumberGetValue misuse.
- Treating all CFNumber API misuse errors as non-fatal. (Previously we treated errors that could cause uninitialized memory as syncs and the truncation errors as non-fatal.)
This implements a subset of functionality from https://reviews.llvm.org/D17954.
Differential Revision: https://reviews.llvm.org/D25876
llvm-svn: 285253
Justin Bogner [Wed, 26 Oct 2016 22:37:52 +0000 (22:37 +0000)]
llvm-objdump: Make some error messages more consistent
Most of the version of report_error were quoting the filename and
printing a colon between the file name and the error message, but this
one wasn't doing either of those. Fix the output to be more
consistent.
llvm-svn: 285252
Justin Lebar [Wed, 26 Oct 2016 22:13:26 +0000 (22:13 +0000)]
[CUDA] Move device placement new definitions into a wrapper header.
Previously, these were always included -- after this change, you have to
#include <new>, which is consistent with how things ought to work.
llvm-svn: 285251
Justin Lebar [Wed, 26 Oct 2016 22:13:20 +0000 (22:13 +0000)]
[CUDA] Switch cuda_wrappers/complex to use a proper include guard instead of #pragma once.
This is consistent with the rest of our internal headers.
llvm-svn: 285250
Vedant Kumar [Wed, 26 Oct 2016 22:07:39 +0000 (22:07 +0000)]
[utils] Add a '--unified-report' option to the code coverage prep script
In --unified-report mode, a single coverage report is prepared for all
specified binaries and written to *report_dir*. This mode is compatible
with all existing script options, including the --restrict mode which is
used to limit coverage reporting to certain files or directories.
This should not break any existing users of the script.
llvm-svn: 285249
Vedant Kumar [Wed, 26 Oct 2016 22:07:37 +0000 (22:07 +0000)]
[utils] Use print_function in the code coverage prep script, NFC.
llvm-svn: 285248
Vedant Kumar [Wed, 26 Oct 2016 22:07:35 +0000 (22:07 +0000)]
[utils] Add an '--only-merge' option to the code coverage prep script
In --only-merge mode, the script terminates after the profile merging
step. This makes the script less stateful: it's more natural to split
the merge out into a separate step instead of relying on the first
invocation of the script to do it.
This should not break any existing users of the script.
llvm-svn: 285247
Evandro Menezes [Wed, 26 Oct 2016 22:06:20 +0000 (22:06 +0000)]
[AArch64] Create feature set for Samsung Exynos-M2
Since Exynos-M2 improved the FP square root unit a bit over the one in
Exynos-M1, it does not benefit from using the Newton series for such
operations.
llvm-svn: 285246
Jonathan Peyton [Wed, 26 Oct 2016 21:46:43 +0000 (21:46 +0000)]
Fixing typos in __kmp_release_deps trace outputs
Patch by Victor Campos
Differential Revision: https://reviews.llvm.org/D25972
llvm-svn: 285244
Jonathan Peyton [Wed, 26 Oct 2016 21:42:48 +0000 (21:42 +0000)]
Use getpagesize() instead of PAGE_SIZE macro when KMP_OS_LINUX is true
Patch by Victor Campos
Differential Revision: https://reviews.llvm.org/D26001
llvm-svn: 285243
Victor Leschuk [Wed, 26 Oct 2016 21:32:29 +0000 (21:32 +0000)]
DebugInfo: fix incorrect alignment type (NFC)
Change type of some missed DebugInfo-related alignment variables,
that are still uint64_t, to uint32_t.
Original change introduced in r284482.
llvm-svn: 285242
Rafael Espindola [Wed, 26 Oct 2016 20:57:14 +0000 (20:57 +0000)]
Have on addRegular forward to another. NFC.
Another step in making it easier to create symbols without an ELf_Sym.
llvm-svn: 285241
Rui Ueyama [Wed, 26 Oct 2016 20:44:32 +0000 (20:44 +0000)]
Remove a constructor to simplify.
llvm-svn: 285240
Malcolm Parsons [Wed, 26 Oct 2016 20:39:54 +0000 (20:39 +0000)]
[RecursiveASTVisitor] Visit the implicit expression of a CXXDefaultArgExpr
Summary:
The matcher
varDecl(hasDescendant(
callExpr(hasDeclaration(functionDecl(unless(isNoThrow()))))))
didn't match calls from default arguments because the expression
for a CXXDefaultArgExpr was not visited.
Reviewers: klimek, jdennett, alexfh, aaron.ballman
Subscribers: aaron.ballman, cfe-commits
Differential Revision: https://reviews.llvm.org/D25992
llvm-svn: 285239
Rafael Espindola [Wed, 26 Oct 2016 20:34:59 +0000 (20:34 +0000)]
Make the DefinedRegular constructors more regular. NFC.
All the global ones now just forward to the same constructor. This
makes it easier to construct them without creating a Elf_Sym.
llvm-svn: 285238
Reid Kleckner [Wed, 26 Oct 2016 20:29:27 +0000 (20:29 +0000)]
[lit] Work around Windows MSys command line tokenization bug
Summary:
This will allow us to revert LLD r284768, which added spaces to get MSys
echo to print what we want.
Reviewers: ruiu, inglorion, rafael
Subscribers: modocache, llvm-commits
Differential Revision: https://reviews.llvm.org/D26009
llvm-svn: 285237
Rui Ueyama [Wed, 26 Oct 2016 20:27:38 +0000 (20:27 +0000)]
Fix build breakage.
llvm-svn: 285236
Rui Ueyama [Wed, 26 Oct 2016 20:26:29 +0000 (20:26 +0000)]
Add comments.
llvm-svn: 285235
Casey Carter [Wed, 26 Oct 2016 20:18:13 +0000 (20:18 +0000)]
Cleanup nonportable behavior in tests for std::any
Fixes MS issues 63, 64, and 65.
test/std/utilities/any/any.class/any.cons/move.pass.cpp:
* "Moves are always destructive" is not a portable assumption; check with LIBCPP_ASSERT.
test/std/utilities/any/any.class/any.cons/value.pass.cpp:
* The standard does not forbid initializing std::any from any pointer-to-function type. Remove the non-conforming "DecayTag" test.
test/std/utilities/any/any.class/any.modifiers/swap.pass.cpp:
* Self-swap is not specified to perform no moves; check with LIBCPP_ASSERT.
Differential Revision: https://reviews.llvm.org/D26007
llvm-svn: 285234
Ehsan Amiri [Wed, 26 Oct 2016 20:16:59 +0000 (20:16 +0000)]
[PPC] Remove testcase from incorrect directory
During my last commit this testcase was put in an incorrect directory. Removing
it. Will put it in the right directory when I can verify everything is correct.
llvm-svn: 285233
Tim Northover [Wed, 26 Oct 2016 20:01:00 +0000 (20:01 +0000)]
ARM: don't rely on push/pop reglists being in order when folding SP adjust.
It would be a very nice invariant to rely on, but unfortunately it doesn't
necessarily hold (and the causes of mis-sorted reglists appear to be quite
varied) so to be robust the frame lowering code can't assume that the first
register in the list is also the first one that actually gets pushed.
Should fix an issue where we were turning something like:
push {r8, r4, r7, lr}
sub sp, #24
into nonsense like:
push {r2, r3, r4, r5, r6, r7, r8, r4, r7, lr}
llvm-svn: 285232
Nemanja Ivanovic [Wed, 26 Oct 2016 19:51:35 +0000 (19:51 +0000)]
Do not assume that FP vector operands are never legalized by expanding
This patch ensures that if a floating point vector operand is legalized by
expanding, it is legalized through the stack rather than by calling
DAGTypeLegalizer::IntegerToVector which will cause a failure since the operand
is a non-integer type.
This fixes PR 30715.
llvm-svn: 285231
Nemanja Ivanovic [Wed, 26 Oct 2016 19:27:11 +0000 (19:27 +0000)]
[PowerPC] Implement vector_insert_exp builtins - clang portion
This patch corresponds to review https://reviews.llvm.org/D25956.
Committing on behalf of Zaara Syeda.
llvm-svn: 285229
Sanjoy Das [Wed, 26 Oct 2016 19:18:43 +0000 (19:18 +0000)]
Simplify `x >=u x >> y` and `x >=u x udiv y`
Summary:
Extends InstSimplify to handle both `x >=u x >> y` and `x >=u x udiv y`.
This is a folloup of rL258422 and
https://github.com/rust-lang/rust/pull/30917 where llvm failed to
optimize away the bounds checking in a binary search.
Patch by Arthur Silva!
Reviewers: sanjoy
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D25941
llvm-svn: 285228
Chad Rosier [Wed, 26 Oct 2016 19:18:19 +0000 (19:18 +0000)]
Revert "[AliasSetTracker] Make AST smarter about intrinsics that don't actually affect memory."
This reverts commit r285191.
LICM appears to rely on the Alias Set Tracker hitting lifetime markers to prevent
code from being moved outside of the original scope.
llvm-svn: 285227
Enrico Granata [Wed, 26 Oct 2016 19:17:49 +0000 (19:17 +0000)]
Fix an issue where frame variable -s <varname> would not show the scope even though the user asked for it
Part of rdar://
28434047
llvm-svn: 285226
Nemanja Ivanovic [Wed, 26 Oct 2016 19:03:40 +0000 (19:03 +0000)]
[PowerPC] Implement vec_insert_exp builtins - llvm portion
This revision corresponds to review: https://reviews.llvm.org/D25957.
Committing on behalf of Zaara Syeda.
llvm-svn: 285225
Rafael Espindola [Wed, 26 Oct 2016 18:59:00 +0000 (18:59 +0000)]
Call _exit.
As the state of lld gets more complicated, shutting down gets more
expensive.
In a normal lld run we can just call _exit immediately after renaming
the temporary output file. We still want the ability to run a full
shutdown since that is useful for detecting memory leaks.
This patch adds a --full-shutdown flag and changes lit to use it.
llvm-svn: 285224
Kostya Serebryany [Wed, 26 Oct 2016 18:52:04 +0000 (18:52 +0000)]
[libFuzzer] simplify TracePC::HandleTrace even further. Also, when dealing with -exit_on_src_pos, symbolize every PC only once
llvm-svn: 285223
Chad Rosier [Wed, 26 Oct 2016 18:49:16 +0000 (18:49 +0000)]
Fix test from r285217.
llvm-svn: 285222
Rafael Espindola [Wed, 26 Oct 2016 18:44:57 +0000 (18:44 +0000)]
Pass a InputSectionData to classoff.
This allows a non template class to hold input sections.
llvm-svn: 285221
Rui Ueyama [Wed, 26 Oct 2016 18:28:08 +0000 (18:28 +0000)]
Move a helper function that doesn't depend on a class out of the class.
llvm-svn: 285220
Rui Ueyama [Wed, 26 Oct 2016 18:28:06 +0000 (18:28 +0000)]
Define a helper function to demangle symbols.
llvm-svn: 285219
Nemanja Ivanovic [Wed, 26 Oct 2016 18:25:45 +0000 (18:25 +0000)]
[PPC] Implement vector reverse elements builtins (vec_reve)
This patch corresponds to review https://reviews.llvm.org/D25906.
Committing on behalf of Tony Jiang.
llvm-svn: 285218
Chad Rosier [Wed, 26 Oct 2016 18:15:32 +0000 (18:15 +0000)]
[AArch64] Avoid materializing constant 1 when generating cneg instructions.
Instead of
cmp w0, #1
orr w8, wzr, #0x1
cneg w0, w8, ne
we now generate
cmp w0, #1
csinv w0, w0, wzr, eq
PR28965
llvm-svn: 285217
Enrico Granata [Wed, 26 Oct 2016 18:12:52 +0000 (18:12 +0000)]
Actually use = delete to mark constructors and operators we want to not exist. Just declaring them as private works, but it can confuse certain tools as it doesn't actually declare intent, and the C++11 way is more expressive anyway, so this is pure win
rdar://
28960209
llvm-svn: 285216
Dan Gohman [Wed, 26 Oct 2016 17:44:09 +0000 (17:44 +0000)]
[WebAssembly] Update the README.txt.
Update the README.txt with newer information, add a link to the Emscripten
page explaining the current easiest way to use the LLVM wasm backend, and
mention that other ways of using the LLVM wasm backend are in development.
llvm-svn: 285215
Nirav Dave [Wed, 26 Oct 2016 17:28:58 +0000 (17:28 +0000)]
[MC] Fix comma typo in .loc parsing
llvm-svn: 285214
Casey Carter [Wed, 26 Oct 2016 17:22:25 +0000 (17:22 +0000)]
Silence unused parameter warnings in archetypes.hpp
Reviewed at: https://reviews.llvm.org/D25958
llvm-svn: 285213
Robert Lougher [Wed, 26 Oct 2016 17:01:47 +0000 (17:01 +0000)]
Reapply: "Remove debug location from common tail when tail-merging"
This reapplies revision 285093. Original commit message:
The branch folding pass tail merges blocks into a common-tail. However, the
tail retains the debug information from one of the original inputs to the
merge (chosen randomly). This is a problem for sampled-based PGO, as hits
on the common-tail will be attributed to whichever block was chosen,
irrespective of which path was actually taken to the common-tail.
This patch fixes the issue by nulling the debug location for the common-tail.
Differential Revision: https://reviews.llvm.org/D25742
llvm-svn: 285212
Yaxun Liu [Wed, 26 Oct 2016 16:40:21 +0000 (16:40 +0000)]
AMDGPU: Add missing ISA versions gfx7.x.x and 8.x.x.
Patch by Laurent Morichetti.
Differential Revision: https://reviews.llvm.org/D25920
llvm-svn: 285211
Yaxun Liu [Wed, 26 Oct 2016 16:37:56 +0000 (16:37 +0000)]
AMDGPU: Refactor processor definition to use ISA version features
Add missing ISA versions 7.0.2/8.0.4/8.1.0. to backend.
Refactor processor definition to use ISA version features.
Fixed ISA version for stoney.
Based on Laurent Morichetti's patch.
Differential Revision: https://reviews.llvm.org/D25919
llvm-svn: 285210
Kostya Kortchinsky [Wed, 26 Oct 2016 16:16:58 +0000 (16:16 +0000)]
[scudo] Lay the foundation for 32-bit support
Summary:
In order to support 32-bit platforms, we have to make some adjustments in
multiple locations, one of them being the Scudo chunk header. For it to fit on
64 bits (as a reminder, on x64 it's 128 bits), I had to crunch the space taken
by some of the fields. In order to keep the offset field small, the secondary
allocator was changed to accomodate aligned allocations for larger alignments,
hence making the offset constant for chunks serviced by it.
The resulting header candidate has been added, and further modifications to
allow 32-bit support will follow.
Another notable change is the addition of MaybeStartBackgroudThread() to allow
release of the memory to the OS.
Reviewers: kcc
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D25688
llvm-svn: 285209
Robert Lougher [Wed, 26 Oct 2016 16:02:36 +0000 (16:02 +0000)]
[ubsan] Fix vptr.cpp test to be more resilient. NFC.
The test contains a switch statement in which two of the cases are
tail-merged, with the call to __ubsan_handle_dynamic_type_cache_miss_abort
in the common tail. When tail-merging occurs, the debug location of the
tail is randomly taken from one of the merge inputs. Luckily for the test,
the expected line number in the check is the one which is chosen by the
tail-merge. However, if the switch cases are re-ordered the test will
fail.
This patch disables tail-merge, making the test resilient to changes
in tail-merge, and unblocking review D25742. It does not change the
semantics of the test.
llvm-svn: 285208
Dehao Chen [Wed, 26 Oct 2016 15:48:45 +0000 (15:48 +0000)]
Introduce updateDiscriminator interface to DILocation to make it cleaner assigning discriminators.
Summary: This patch introduces updateDiscriminator to DILocation so that it can be directly called by AddDiscriminator. It also makes it easier to update the discriminator later.
Reviewers: dnovillo, dblaikie, aprantl, echristo
Subscribers: mehdi_amini, llvm-commits
Differential Revision: https://reviews.llvm.org/D25959
llvm-svn: 285207
Chris Bieneman [Wed, 26 Oct 2016 15:41:38 +0000 (15:41 +0000)]
[CMake] Adding example distribution CMake cache files
These cache file are provided as an example of how to set up simple multi-stage CMake builds. I have a batch of documentation updates for LLVM.org which reference these files.
llvm-svn: 285206
Rafael Espindola [Wed, 26 Oct 2016 15:34:24 +0000 (15:34 +0000)]
Reduce the number of allocators.
We used to have one allocator per file, which reduces the advantage of
using an allocator in the first place.
This is a small speed up is most cases. The largest speedup was in
1.014X in chromium no-gc. The largest slowdown was scylla at 1.003X.
llvm-svn: 285205
Renato Golin [Wed, 26 Oct 2016 15:20:33 +0000 (15:20 +0000)]
[ARM RT] Fix broken clear_cache debug build on ARM
clear_cache is using R7 for the SVC call and that's the frame pointer in
GCC, which is only disabled on -O2/3, so Release builds finish, Debug don't.
Fixes PR30797.
llvm-svn: 285204
Matt Arsenault [Wed, 26 Oct 2016 15:08:16 +0000 (15:08 +0000)]
Reapply "AMDGPU: Don't use offen if it is 0"
This reverts r283003
llvm-svn: 285203
Matt Arsenault [Wed, 26 Oct 2016 14:53:54 +0000 (14:53 +0000)]
AMDGPU: Fix counting si_mask_branch as 4 bytes
llvm-svn: 285202
Matt Arsenault [Wed, 26 Oct 2016 14:53:50 +0000 (14:53 +0000)]
Fix nondeterministic output in local stack slot alloc pass
This finds all of the references to a frame index in a function, and
sorts by the offset. If multiple instructions use the same offset,
nothing was breaking the tie for sorting.
This avoids the test failures the reverted r282999 introduced.
llvm-svn: 285201
Sanjay Patel [Wed, 26 Oct 2016 14:52:35 +0000 (14:52 +0000)]
[InstCombine] clean up commonCastTransforms; NFC
1. Use 'auto' with dyn_cast.
2. Variables start with a capital letter.
3. Use proper punctuation in comments.
llvm-svn: 285200
Tom Stellard [Wed, 26 Oct 2016 14:52:25 +0000 (14:52 +0000)]
LegalizeDAG: Support promoting [US]DIV and [US]REM operations
Summary:
AMDGPU will need this one i16 is added as a legal type. This is tested by:
test/CodeGen/AMDGPU/sdiv.ll
test/CodeGen/AMDGPU/sdivrem24.ll
test/CodeGen/AMDGPU/udiv.ll
test/CodeGen/AMDGPU/udivrem24.ll
Reviewers: bogner, efriedma
Subscribers: efriedma, wdng, llvm-commits
Differential Revision: https://reviews.llvm.org/D25699
llvm-svn: 285199
Tom Stellard [Wed, 26 Oct 2016 14:38:47 +0000 (14:38 +0000)]
AMDGPU/SI: Don't emit multi-dword flat memory ops when they might access scratch
Summary:
A single flat memory operations that might access the scratch buffer
can only access MaxPrivateElementSize bytes.
Reviewers: arsenm
Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, tony-tye, llvm-commits
Differential Revision: https://reviews.llvm.org/D25788
llvm-svn: 285198
Tom Stellard [Wed, 26 Oct 2016 14:21:09 +0000 (14:21 +0000)]
AMDGPU/SI: Remove unnecessary run lines from test
Summary:
This test had run lines disabling/enabling the promote alloca pass, but
enabling/disabling promote alloca had no impact on the output.
Reviewers: arsenm
Subscribers: mgrang, kzhuravl, wdng, nhaehnle, yaxunl, llvm-commits, tony-tye
Differential Revision: https://reviews.llvm.org/D25787
llvm-svn: 285197
Zvi Rackover [Wed, 26 Oct 2016 14:12:46 +0000 (14:12 +0000)]
[X86] AVX512 fallback for floating-point scalar selects
Summary:
In the case where of 'select i1 , f32, f32' or select i1, f64, f64 prefer lowering to masked-moves over branches.
Fixes pr30561
Reviewers: igorb, aymanmus, delena
Differential Revision: https://reviews.llvm.org/D25310
llvm-svn: 285196
Sanjay Patel [Wed, 26 Oct 2016 14:08:49 +0000 (14:08 +0000)]
[InstCombine] consolidate zext tests and auto-generate checks; NFC
llvm-svn: 285195
Sanjay Patel [Wed, 26 Oct 2016 13:58:22 +0000 (13:58 +0000)]
[InstCombine] auto-generate better checks; NFC
llvm-svn: 285194
Erik Verbruggen [Wed, 26 Oct 2016 13:06:13 +0000 (13:06 +0000)]
[PP] Replace some index based for loops with range based ones
While in the area, also change some unsigned variables to size_t, and
introduce an LLVM_FALLTHROUGH instead of a comment stating that.
Differential Revision: http://reviews.llvm.org/D25982
llvm-svn: 285193
Benjamin Kramer [Wed, 26 Oct 2016 12:51:45 +0000 (12:51 +0000)]
Fix use-after-scope in ASTContext.
Extend lifetime of ExceptionTypeStorage, as it is referenced by
CanonicalEPI and used outside the block (ExceptionSpec.Exceptions is an
ArrayRef)
Patch by Sam McCall!
Differential Revision: https://reviews.llvm.org/D25983
llvm-svn: 285192
Chad Rosier [Wed, 26 Oct 2016 12:42:11 +0000 (12:42 +0000)]
[AliasSetTracker] Make AST smarter about intrinsics that don't actually affect memory.
Differential Revision: https://reviews.llvm.org/D25969
llvm-svn: 285191
Rafael Espindola [Wed, 26 Oct 2016 12:36:56 +0000 (12:36 +0000)]
Delete trivial getters. NFC.
llvm-svn: 285190
Victor Leschuk [Wed, 26 Oct 2016 11:59:03 +0000 (11:59 +0000)]
DebugInfo: support for DWARFv5 DW_AT_alignment attribute
* Assume that clang passes non-zero alignment value to DIBuilder
only in case when it was forced by C++11 'alignas', C11 '_Alignas'
or compiler attribute '__attribute__((aligned (N)))'.
* Emit DW_AT_alignment if alignment is specified for type/object.
Differential Revision: https://reviews.llvm.org/D24425
llvm-svn: 285189
Erik Verbruggen [Wed, 26 Oct 2016 11:46:10 +0000 (11:46 +0000)]
[PP] Remove another unused parameter
Differential Revision: http://reviews.llvm.org/D25981
llvm-svn: 285188
Pavel Labath [Wed, 26 Oct 2016 11:13:56 +0000 (11:13 +0000)]
Don't set a software stepping breakpoint at 0 on arm or mips.
Summary:
Check whether the setting the breakpoint failed during instruction emulation. If
it did, the next pc is likely in unmapped memory, and the inferior will crash
anyway after the next instruction. Do not return an error in this case, but just
continue stepping.
Reenabled the crash during step test for android/linux.
Reviewers: labath
Subscribers: aemerson, rengolin, tberghammer, danalbert, srhines, lldb-commits
Differential Revision: https://reviews.llvm.org/D25926
Author: Jason Majors <jmajors@google.com>
llvm-svn: 285187
Eugene Leviant [Wed, 26 Oct 2016 11:07:09 +0000 (11:07 +0000)]
[ELF] Better error reporting for undefined symbols
This patch make lld show following details for undefined symbol errors:
- file (line)
- file (function name)
- file (section name + offset)
Differential revision: https://reviews.llvm.org/D25826
llvm-svn: 285186
Andrea Di Biagio [Wed, 26 Oct 2016 10:28:32 +0000 (10:28 +0000)]
[IndVarSimplify][DebugLoc] When widening the exit loop condition, correctly reuse the debug location of the original comparison.
When the loop exit condition is canonicalized as a != compaison, reuse the
debug location of the original (non canonical) comparison.
Before this patch, the debug location of the new icmp was obtained from the
loop latch terminator. This patch fixes the issue by correctly setting the
IRBuilder's "current debug location" to the location of the original compare.
Differential Revision: https://reviews.llvm.org/D25953
llvm-svn: 285185
Vassil Vassilev [Wed, 26 Oct 2016 10:24:29 +0000 (10:24 +0000)]
[modules] PR28812: Modules can return duplicate field decls.
If two modules contain duplicate class definitions the lookup result can contain
more than 2 elements. Sift the lookup results until we find a field decl.
It is not necessary to do ODR checks in place as they done elsewhere.
This should fix issues when compiling with libstdc++ 5.2 and 6.2.
Patch developed in collaboration with Richard Smith!
llvm-svn: 285184
Vassil Vassilev [Wed, 26 Oct 2016 10:13:47 +0000 (10:13 +0000)]
Revert r285181 "DebugInfo: support for DWARFv5 DW_AT_alignment attribute".
The commit broke the builds.
llvm-svn: 285183
Erik Verbruggen [Wed, 26 Oct 2016 09:58:31 +0000 (09:58 +0000)]
[PP] Replace some uses of unsigned with size_t
All values are returned by a method as size_t, and subsequently passed
to functions taking a size_t, or used where a size_t is also valid.
Better still, two loops (which had an unsigned), can be replaced by
a range-based for loop.
Differential Revision: http://reviews.llvm.org/D25939
llvm-svn: 285182
Victor Leschuk [Wed, 26 Oct 2016 08:55:27 +0000 (08:55 +0000)]
DebugInfo: support for DWARFv5 DW_AT_alignment attribute
* Assume that clang passes non-zero alignment value to DIBuilder
only in case when it was forced by C++11 'alignas', C11 '_Alignas'
or compiler attribute '__attribute__((aligned (N)))'.
* Emit DW_AT_alignment if alignment is specified for type/object.
Differential Revision: https://reviews.llvm.org/D24425
llvm-svn: 285181
Erik Verbruggen [Wed, 26 Oct 2016 08:52:41 +0000 (08:52 +0000)]
PP: Remove unused parameters from methods
NFC
Differential Revision: http://reviews.llvm.org/D25938
llvm-svn: 285180
Victor Leschuk [Wed, 26 Oct 2016 08:34:19 +0000 (08:34 +0000)]
DebugInfo: add bitcode upgrade test for alignment
Bitcode format was changed in D25073, this adds bitcode upgrade test.
llvm-svn: 285179