Matt Arsenault [Wed, 10 Aug 2016 19:11:36 +0000 (19:11 +0000)]
AMDGPU: Use CreateStackObject instead of CreateSpillStackObject
I'm not sure what the difference is, but no other target
uses this for emergency spill slots.
llvm-svn: 278272
Reid Kleckner [Wed, 10 Aug 2016 19:03:18 +0000 (19:03 +0000)]
[sancov] Run more sancov tests on non-x86-Linux machines
Add the $arch-registered-target features that clang uses to disable
tests that require a registered backend, so that we can run the sancov
tests on Windows. LLVM's lit suite did not appear to have a per-test way
to do this, and I would rather not split up the sancov tests into
architecture directories.
Split out of https://reviews.llvm.org/D23321
llvm-svn: 278271
Sanjay Patel [Wed, 10 Aug 2016 19:00:11 +0000 (19:00 +0000)]
[x86, AVX] allow FP vector select folding to bitwise logic ops (PR28895)
This handles the case in:
https://llvm.org/bugs/show_bug.cgi?id=28895
...but we are not getting all of the possibilities yet.
Eg, we use 'X86::FANDN' for scalar FP select combines.
That enhancement is filed as:
https://llvm.org/bugs/show_bug.cgi?id=28925
Differential Revision: https://reviews.llvm.org/D23337
llvm-svn: 278270
Andrew Kaylor [Wed, 10 Aug 2016 18:56:35 +0000 (18:56 +0000)]
[IndVarSimplify] Eliminate zext of a signed IV when the IV is known to be non-negative
Patch by Li Huang
Differential Revision: https://reviews.llvm.org/D18867
llvm-svn: 278269
Nicolai Haehnle [Wed, 10 Aug 2016 18:51:14 +0000 (18:51 +0000)]
LiveIntervalAnalysis: fix a crash in repairOldRegInRange
Summary:
See the new test case for one that was (non-deterministically) crashing
on trunk and deterministically hit the assertion that I added in D23302.
Basically, the machine function contains a sequence
DS_WRITE_B32 %vreg4, %vreg14:sub0, ...
DS_WRITE_B32 %vreg4, %vreg14:sub0, ...
%vreg14:sub1<def> = COPY %vreg14:sub0
and SILoadStoreOptimizer::mergeWrite2Pair merges the two DS_WRITE_B32
instructions into one before calling repairIntervalsInRange.
Now repairIntervalsInRange wants to repair %vreg14, in particular, and
ends up trying to repair %vreg14:sub1 as well, but that only becomes
active _after_ the range that is to be repaired, hence the crash due
to LR.find(...) == LR.begin() at the start of repairOldRegInRange.
I believe that just skipping those subrange is fine, but again, not too
familiar with that code.
Reviewers: MatzeB, kparzysz, tstellarAMD
Subscribers: llvm-commits, MatzeB
Differential Revision: https://reviews.llvm.org/D23303
llvm-svn: 278268
Andrew Kaylor [Wed, 10 Aug 2016 18:47:19 +0000 (18:47 +0000)]
[ValueTracking] An improvement to IR ValueTracking on Non-negative Integers
Patch by Li Huang
Differential Revision: https://reviews.llvm.org/D18777
llvm-svn: 278267
Krzysztof Parzyszek [Wed, 10 Aug 2016 18:40:36 +0000 (18:40 +0000)]
[Hexagon] Remove unused variants of LO/HI instructions
llvm-svn: 278266
Kyle Butt [Wed, 10 Aug 2016 18:36:18 +0000 (18:36 +0000)]
Codegen: Tail Merge: Be less aggressive with special cases.
This change makes it possible for tail-duplication and tail-merging to
be disjoint. By being less aggressive when merging during layout, there are no
overlapping cases between tail-duplication and tail-merging, provided the
thresholds are disjoint.
There is a remaining TODO to benchmark the succ_size() test for non-layout tail
merging.
llvm-svn: 278265
Bruno Cardoso Lopes [Wed, 10 Aug 2016 18:34:47 +0000 (18:34 +0000)]
Reapply [Sema] Add sizeof diagnostics for bzero
Reapply r277787. For memset (and others) we can get diagnostics like:
struct stat { int x; };
void foo(struct stat *stamps) {
bzero(stamps, sizeof(stamps));
memset(stamps, 0, sizeof(stamps));
}
t.c:7:28: warning: 'memset' call operates on objects of type 'struct stat' while the size is based on a different type 'struct stat *' [-Wsizeof-pointer-memaccess]
memset(stamps, 0, sizeof(stamps));
~~~~~~ ^~~~~~
t.c:7:28: note: did you mean to dereference the argument to 'sizeof' (and multiply it by the number of elements)?
memset(stamps, 0, sizeof(stamps));
^~~~~~
This patch implements the same class of warnings for bzero.
Differential Revision: https://reviews.llvm.org/D22525
rdar://problem/
18963514
llvm-svn: 278264
Eugene Zelenko [Wed, 10 Aug 2016 18:30:14 +0000 (18:30 +0000)]
[Documentation] Highlighting consistency and spelling mistake fix in Clang-tidy readability-else-after-return description.
llvm-svn: 278263
Eugene Zelenko [Wed, 10 Aug 2016 18:15:51 +0000 (18:15 +0000)]
[Release Notes] Consistency in Clang-tidy entries' style.
llvm-svn: 278262
Eugene Leviant [Wed, 10 Aug 2016 18:10:41 +0000 (18:10 +0000)]
[ELF] Support LLVM-style casting for OutputSectionBase<ELFT> derived classes
llvm-svn: 278261
Simon Pilgrim [Wed, 10 Aug 2016 18:10:29 +0000 (18:10 +0000)]
[X86][SSE] Dropped blend(insertps(x,y),zero) combine - this is now handled by target shuffle chain combining
llvm-svn: 278260
Tim Shen [Wed, 10 Aug 2016 18:08:38 +0000 (18:08 +0000)]
[ADT] Removed synthesized constructor introduced in r278251, since MSVC doesn't support them
llvm-svn: 278259
Matthias Braun [Wed, 10 Aug 2016 18:05:50 +0000 (18:05 +0000)]
TargetOpcodes: Rewrite the documentation for SUBREG_TO_REG
Differential Revision: https://reviews.llvm.org/D22708
llvm-svn: 278258
Kirill Bobyrev [Wed, 10 Aug 2016 18:05:47 +0000 (18:05 +0000)]
[clang-tidy] enhance readability-else-after-return
`readability-else-after-return` only warns about `return` calls, but LLVM Coding
Standars stat that `throw`, `continue`, `goto`, etc after `return` calls are
bad, too.
Reviwers: alexfh, aaron.ballman
Differential Revision: https://reviews.llvm.org/D23265
llvm-svn: 278257
Krzysztof Parzyszek [Wed, 10 Aug 2016 18:05:47 +0000 (18:05 +0000)]
[Hexagon] Simplify the SplitConst32/64 pass
llvm-svn: 278256
Eugene Zelenko [Wed, 10 Aug 2016 18:02:15 +0000 (18:02 +0000)]
[Documentation] Fix grammar mistakes in docs/clang-tidy/index.rst spotted by Alexander Kornienko.
llvm-svn: 278255
Kirill Bobyrev [Wed, 10 Aug 2016 18:01:45 +0000 (18:01 +0000)]
[clang-tidy] minor improvements in modernise-deprecated-headers check
This patch introduces a minor list of changes as proposed by Richard Smith in
the mailing list.
See original comments with an impact on the future check state below:
[comments.begin
> + {"complex.h", "ccomplex"},
It'd be better to convert this one to <complex>, or leave it alone.
<ccomplex> is an unnecessary wart.
(The contents of C++11's <complex.h> / <ccomplex> / <complex> (all of
which are identical) aren't comparable to C99's <complex.h>, so if
this was C++98 code using the C99 header, the code will be broken with
or without this transformation.)
> + {"iso646.h", "ciso646"},
Just delete #includes of this one. <ciso646> does nothing.
> + {"stdalign.h", "cstdalign"},
> + {"stdbool.h", "cstdbool"},
We should just delete these two includes. These headers do nothing in C++.
comments.end]
Reviewers: alexfh, aaron.ballman
Differential Revision: https://reviews.llvm.org/D17990
llvm-svn: 278254
Zachary Turner [Wed, 10 Aug 2016 17:59:03 +0000 (17:59 +0000)]
Remove a circular include dependency.
lldb-private-interfaces.h included lldb-private.h, and
lldb-private.h included lldb-private-interfaces.h.
llvm-svn: 278253
Krzysztof Parzyszek [Wed, 10 Aug 2016 17:56:24 +0000 (17:56 +0000)]
[Hexagon] Add extra patterns for single-precision min/max instructions
llvm-svn: 278252
Tim Shen [Wed, 10 Aug 2016 17:52:09 +0000 (17:52 +0000)]
[ADT] Add make_scope_exit().
Summary: make_scope_exit() is described in C++ proposal p0052r2, which uses RAII to do cleanup works at scope exit.
Reviewers: chandlerc
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D22796
llvm-svn: 278251
Rong Xu [Wed, 10 Aug 2016 17:49:11 +0000 (17:49 +0000)]
Fix LCSSA increased compile time
We are seeing r276077 drastically increasing compiler time for our larger
benchmarks in PGO profile generation build (both clang based and IR based
mode) -- it can be 20x slower than without the patch (like from 30 secs to
780 secs)
The increased time are all in pass LCSSA. The problematic code is about
PostProcessPHIs after use-rewrite. Note that the InsertedPhis from ssa_updater
is accumulating (never been cleared). Since the inserted PHIs are added to the
candidate for each rewrite, The earlier ones will be repeatedly added. Later
when adding the new PHIs to the work-list, we don't check the duplication
either. This can result in extremely long work-list that containing tons of
duplicated PHIs.
This patch fixes the issue by hoisting the code out of the loop.
Differential Revision: http://reviews.llvm.org/D23344
llvm-svn: 278250
Rui Ueyama [Wed, 10 Aug 2016 17:42:26 +0000 (17:42 +0000)]
Check for availability of `cpio` command.
cpio may not be available on Windows, so it is better to check
for availability before running the command in a test.
llvm-svn: 278249
Krzysztof Parzyszek [Wed, 10 Aug 2016 17:22:24 +0000 (17:22 +0000)]
[Hexagon] Fix table-gen decode conflict warnings for CONST32/64
llvm-svn: 278247
Tim Northover [Wed, 10 Aug 2016 16:51:18 +0000 (16:51 +0000)]
GlobalISel: fixup copy/paste comment error
llvm-svn: 278246
Tim Northover [Wed, 10 Aug 2016 16:51:14 +0000 (16:51 +0000)]
GlobalISel: avoid inserting redundant COPYs for bitcasts.
If the value produced by the bitcast hasn't been referenced yet, we can simply
reuse the input register avoiding an unnecessary COPY instruction.
llvm-svn: 278245
Krzysztof Parzyszek [Wed, 10 Aug 2016 16:46:36 +0000 (16:46 +0000)]
[Hexagon] Use integer instructions for floating point immediates
Floating point instructions use general purpose registers, so the few
instructions that can put floating point immediates into registers are,
in fact, integer instruction. Use them explicitly instead of having
pseudo-instructions specifically for dealing with floating point values.
Simplify the constant loading instructions (from sdata) to have only two:
one for 32-bit values and one for 64-bit values: CONST32 and CONST64.
llvm-svn: 278244
Gor Nishanov [Wed, 10 Aug 2016 16:40:39 +0000 (16:40 +0000)]
[Coroutines] Part 6: Elide dynamic allocation of a coroutine frame when possible
Summary:
A particular coroutine usage pattern, where a coroutine is created, manipulated and
destroyed by the same calling function, is common for coroutines implementing
RAII idiom and is suitable for allocation elision optimization which avoid
dynamic allocation by storing the coroutine frame as a static `alloca` in its
caller.
coro.free and coro.alloc intrinsics are used to indicate which code needs to be suppressed
when dynamic allocation elision happens:
```
entry:
%elide = call i8* @llvm.coro.alloc()
%need.dyn.alloc = icmp ne i8* %elide, null
br i1 %need.dyn.alloc, label %coro.begin, label %dyn.alloc
dyn.alloc:
%alloc = call i8* @CustomAlloc(i32 4)
br label %coro.begin
coro.begin:
%phi = phi i8* [ %elide, %entry ], [ %alloc, %dyn.alloc ]
%hdl = call i8* @llvm.coro.begin(i8* %phi, i32 0, i8* null,
i8* bitcast ([2 x void (%f.frame*)*]* @f.resumers to i8*))
```
and
```
%mem = call i8* @llvm.coro.free(i8* %hdl)
%need.dyn.free = icmp ne i8* %mem, null
br i1 %need.dyn.free, label %dyn.free, label %if.end
dyn.free:
call void @CustomFree(i8* %mem)
br label %if.end
if.end:
...
```
If heap allocation elision is performed, we replace coro.alloc with a static alloca on the caller frame and coro.free with null constant.
Also, we need to make sure that if there are any tail calls referencing the coroutine frame, we need to remote tail call attribute, since now coroutine frame lives on the stack.
Documentation and overview is here: http://llvm.org/docs/Coroutines.html.
Upstreaming sequence (rough plan)
1.Add documentation. (https://reviews.llvm.org/D22603)
2.Add coroutine intrinsics. (https://reviews.llvm.org/D22659)
3.Add empty coroutine passes. (https://reviews.llvm.org/D22847)
4.Add coroutine devirtualization + tests.
ab) Lower coro.resume and coro.destroy (https://reviews.llvm.org/D22998)
c) Do devirtualization (https://reviews.llvm.org/D23229)
5.Add CGSCC restart trigger + tests. (https://reviews.llvm.org/D23234)
6.Add coroutine heap elision + tests. <= we are here
7.Add the rest of the logic (split into more patches)
Reviewers: mehdi_amini, majnemer
Subscribers: mehdi_amini, llvm-commits
Differential Revision: https://reviews.llvm.org/D23245
llvm-svn: 278242
Roger Ferrer Ibanez [Wed, 10 Aug 2016 16:39:58 +0000 (16:39 +0000)]
Fix build break of VS 2013 debug builds
In debug mode extra macros are enabled for several C++ algorithms. Some of them
may cause unfortunate build failures.
This commit adds a redundant operator() to work around one of those troublesome
macros which was hit accidentally by change r278012.
llvm-svn: 278241
Artem Dergachev [Wed, 10 Aug 2016 16:25:16 +0000 (16:25 +0000)]
[analyzer] Fix a crash in CloneDetector when calling functions by pointers.
CallExpr may have a null direct callee when the callee function is not
known in compile-time. Do not try to take callee name in this case.
Patch by Raphael Isemann!
Differential Revision: https://reviews.llvm.org/D23320
llvm-svn: 278238
Krzysztof Parzyszek [Wed, 10 Aug 2016 16:23:53 +0000 (16:23 +0000)]
[Hexagon] Delete HexagonSelectCCInfo.td
This file is not used. The location assignment of call arguments and
return values is implemented directly in HexagonISelLowering.
llvm-svn: 278237
Krzysztof Parzyszek [Wed, 10 Aug 2016 16:20:33 +0000 (16:20 +0000)]
[Hexagon] Remove unneeded/unused ISD opcodes ARGEXTEND and FCONST32
llvm-svn: 278236
Joey Gouly [Wed, 10 Aug 2016 16:04:14 +0000 (16:04 +0000)]
[OpenCL] Fix typo in test that I accidentally introduced in my previous commit.
llvm-svn: 278235
Joey Gouly [Wed, 10 Aug 2016 15:57:02 +0000 (15:57 +0000)]
[OpenCL] Change block descriptor address space to constant.
The block descriptor is a GlobalVariable in the LLVM IR, so it shouldn't be
in the private address space.
llvm-svn: 278234
Simon Pilgrim [Wed, 10 Aug 2016 15:15:56 +0000 (15:15 +0000)]
[X86][XOP] Tweak vpermil2pd test to stop it being combined away
The target shuffle combined to a BLENDPD pattern which we will shortly add support for.
llvm-svn: 278233
Simon Pilgrim [Wed, 10 Aug 2016 15:13:49 +0000 (15:13 +0000)]
[X86][SSE] Regenerate vector shift lowering tests
llvm-svn: 278232
Artur Pilipenko [Wed, 10 Aug 2016 15:13:15 +0000 (15:13 +0000)]
[LVI] Handle conditions in the form of (cond1 && cond2)
Teach LVI how to gather information from conditions in the form of (cond1 && cond2). Our out-of-tree front-end emits range checks in this form.
Reviewed By: sanjoy
Differential Revision: http://reviews.llvm.org/D23200
llvm-svn: 278231
Simon Atanasyan [Wed, 10 Aug 2016 15:06:45 +0000 (15:06 +0000)]
[ELF][MIPS] Take into account combination of EF_MIPS_ARCH and EF_MIPS_MACH flags while checking ISA compatibility
MIPS ISA encoded using two ELF flags: general architecture flag like
EF_MIPS_ARCH_32, EF_MIPS_ARCH_64R6 etc and optional machine variant flag
like EF_MIPS_MACH_4111, EF_MIPS_MACH_OCTEON3 etc. When we check
compatibility between two input files and deduce ELF flags for generated
output we need to take into account both of these flags.
llvm-svn: 278230
Sanjay Patel [Wed, 10 Aug 2016 15:06:11 +0000 (15:06 +0000)]
use different comparison predicates for better test coverage
llvm-svn: 278229
Simon Pilgrim [Wed, 10 Aug 2016 14:15:41 +0000 (14:15 +0000)]
[X86][SSE] Add support for combining target shuffles to MOVSS/MOVSD
Only do this on pre-SSE41 targets where we should be lowering to BLENDPS/BLENDPD instead
llvm-svn: 278228
George Rimar [Wed, 10 Aug 2016 14:02:35 +0000 (14:02 +0000)]
[ELF] - Fixed section name pattern in two more testcases.
llvm-svn: 278227
Artur Pilipenko [Wed, 10 Aug 2016 13:51:01 +0000 (13:51 +0000)]
Add a test case for r278217 "[LVI] Relax the assertion about LVILatticeVal type in getConstantRange"
llvm-svn: 278226
Kirill Bobyrev [Wed, 10 Aug 2016 13:46:36 +0000 (13:46 +0000)]
[clang-rename] fix test introduced in r278221
llvm-svn: 278225
Artur Pilipenko [Wed, 10 Aug 2016 13:38:07 +0000 (13:38 +0000)]
[LVI] NFC. Make getValueFromCondition return LVILatticeValue instead of changing reference argument
Instead of returning bool and setting LVILatticeValue reference argument return LVILattice value. Use overdefined value to denote the case when we didn't gather any information from the condition.
This change was separated from the review "[LVI] Handle conditions in the form of (cond1 && cond2)" (https://reviews.llvm.org/D23200#inline-199531). Once getValueFromCondition returns LVILatticeValue we can cache the result in Visited map.
llvm-svn: 278224
Kirill Bobyrev [Wed, 10 Aug 2016 13:32:37 +0000 (13:32 +0000)]
[clang-rename] remove bunch of deprecated tests
llvm-svn: 278223
Pavel Labath [Wed, 10 Aug 2016 13:30:20 +0000 (13:30 +0000)]
Make sure files include what they use (part 1/N)
preparation for the big clang-format.
llvm-svn: 278222
Kirill Bobyrev [Wed, 10 Aug 2016 13:28:30 +0000 (13:28 +0000)]
[clang-rename] merge tests when possible
The only difference between some tests is -offset passed to clang-rename. It
makes sense to merge them into a single file and add multiple tool invocations.
Reviewers: alexfh
Differential Revision: https://reviews.llvm.org/D23158
llvm-svn: 278221
Artur Pilipenko [Wed, 10 Aug 2016 13:08:34 +0000 (13:08 +0000)]
Teach CorrelatedValuePropagation to mark adds as no wrap
This is a resubmission of previously reverted r277592. It was hitting overly strong assertion in getConstantRange which was relaxed in r278217.
Use LVI to prove that adds do not wrap. The change is motivated by https://llvm.org/bugs/show_bug.cgi?id=28620 bug and it's the first step to fix that problem.
Reviewed By: sanjoy
Differential Revision: http://reviews.llvm.org/D23059
llvm-svn: 278220
George Rimar [Wed, 10 Aug 2016 13:06:18 +0000 (13:06 +0000)]
[ELF] - Fixed section name pattern in testcase.
llvm-svn: 278219
Simon Pilgrim [Wed, 10 Aug 2016 12:55:25 +0000 (12:55 +0000)]
[X86][SSE] Only treat SM_SentinelUndef as UNDEF in shuffle mask predicates
isUndefOrEqual and isUndefOrInRange treated all -ve shuffle mask values as UNDEF, now it has to be SM_SentinelUndef (-1)
We already have asserts to check that lowered SHUFFLE_VECTOR indices are in the range -1 <= index < 2*masksize (or masksize for unary shuffles)
llvm-svn: 278218
Artur Pilipenko [Wed, 10 Aug 2016 12:54:54 +0000 (12:54 +0000)]
[LVI] Relax the assertion about LVILatticeVal type in getConstantRange
The problem was triggered by my recent change in CVP (D23059). Current code expected that integer constants are represented by constantrange LVILatticeVal and never represented as LVILatticeVal with constant tag. That is true for ConstantInt constants, although ConstantExpr integer type constants are legally represented as constant LVILatticeVal.
This code fails with CVP change in:
@b = global i32 0, align 4
define void @test6(i32 %a) {
bb:
%add = add i32 %a, ptrtoint (i32* @b to i32)
ret void
}
Currently getConstantRange code is not executed by any of the upstream passes. I'm going to add a test case to test/Transforms/CorrelatedValuePropagation/add.ll once I resubmit the CVP change.
Reviewed By: sanjoy
Differential Revision: http://reviews.llvm.org/D23194
llvm-svn: 278217
Simon Pilgrim [Wed, 10 Aug 2016 12:34:23 +0000 (12:34 +0000)]
[X86][SSE] Reorder shuffle mask undef helper predicates. NFCI
To make it easier for a more complex helper to use a simpler one
llvm-svn: 278216
Simon Pilgrim [Wed, 10 Aug 2016 12:26:40 +0000 (12:26 +0000)]
[X86][SSE] Regenerate SSE1 tests
Properly demonstrate the nasty codegen we get for vselect without integer vectors
llvm-svn: 278215
Simon Pilgrim [Wed, 10 Aug 2016 12:24:19 +0000 (12:24 +0000)]
Regenerate test
llvm-svn: 278214
Martin Bohme [Wed, 10 Aug 2016 11:22:57 +0000 (11:22 +0000)]
[ASTMatchers] Extend documentation for match()
Summary:
Adds an explanation of how to use findAll() to find all matches in a subtree.
llvm-svn: 278213
Tobias Grosser [Wed, 10 Aug 2016 10:58:19 +0000 (10:58 +0000)]
[GPGPU] Ensure arrays where only parts are modified are copied to GPU
To do so we change the way array exents are computed. Instead of the precise
set of memory locations accessed, we now compute the extent as the range between
minimal and maximal address in the first dimension and the full extent defined
by the sizes of the inner array dimensions.
We also move the computation of the may_persist region after the construction
of the arrays, as it relies on array information. Without arrays being
constructed no useful information is computed at all.
llvm-svn: 278212
Simon Pilgrim [Wed, 10 Aug 2016 10:50:53 +0000 (10:50 +0000)]
[DAGCombine] Avoid INSERT_SUBVECTOR reinsertions (PR28678)
If the input vector to INSERT_SUBVECTOR is another INSERT_SUBVECTOR, and this inserted subvector replaces the last insertion, then insert into the common source vector.
i.e.
INSERT_SUBVECTOR( INSERT_SUBVECTOR( Vec, SubOld, Idx ), SubNew, Idx ) --> INSERT_SUBVECTOR( Vec, SubNew, Idx )
Differential Revision: https://reviews.llvm.org/D23330
llvm-svn: 278211
Ying Yi [Wed, 10 Aug 2016 10:48:02 +0000 (10:48 +0000)]
test commit.
llvm-svn: 278210
Lama Saba [Wed, 10 Aug 2016 10:34:45 +0000 (10:34 +0000)]
[X86][AVX512] lower __mm512_andnot_ps/__mm512_andnot_pd to IR
Differential revision: https://reviews.llvm.org/D23262
llvm-svn: 278209
Simon Pilgrim [Wed, 10 Aug 2016 09:59:49 +0000 (09:59 +0000)]
[X86][AVX] Ensure we only match against 1-byte alignment
llvm-svn: 278208
Sam Parker [Wed, 10 Aug 2016 09:34:34 +0000 (09:34 +0000)]
[ARM] Improve sxta{b|h} and uxta{b|h} tests
Created a Thumb2 predicated pattern matcher that uses Thumb2 and
HasT2ExtractPack and used it to redefine the patterns for sxta{b|h}
and uxta{b|h}. Also used the similar patterns to fill in isel pattern
gaps for the corresponding instructions in the ARM backend.
The patch is mainly changes to tests since most of this functionality
appears not to have been tested.
Differential Revision: https://reviews.llvm.org/D23273
llvm-svn: 278207
Eric Liu [Wed, 10 Aug 2016 09:32:23 +0000 (09:32 +0000)]
Make clang-format remove duplicate headers when sorting #includes.
Summary: When sorting #includes, #include directives that have the same text will be deduplicated when sorting #includes, and only the first #include in the duplicate #includes remains. If the `Cursor` is provided and put on a deleted #include, it will be put on the remaining #include in the duplicate #includes.
Reviewers: djasper
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D23274
llvm-svn: 278206
Eugene Leviant [Wed, 10 Aug 2016 08:19:35 +0000 (08:19 +0000)]
[ELF] Add aarch64elf emulation mode
llvm-svn: 278205
George Rimar [Wed, 10 Aug 2016 07:59:34 +0000 (07:59 +0000)]
[ELF] - Linkerscript: implement SIZEOF_HEADERS.
SIZEOF_HEADERS - Return the size in bytes of the output file’s headers.
It is is a feature used in FreeBsd script, for example.
There is a discussion on PR28688 page about it.
Differential revision: https://reviews.llvm.org/D23165
llvm-svn: 278204
Chandler Carruth [Wed, 10 Aug 2016 07:41:26 +0000 (07:41 +0000)]
[x86] Fix a bug in the auto-upgrade from r276416 where we failed to give
a sufficiently low alignment for the IR load created.
There is no test case because we don't have any test cases for the *IR*
produced by the autoupgrade, only the x86 assembly, and it happens that
the x86 assembly for this intrinsic as it is tested in the autoupgrade
path just happens to not produce a separate load instruction where we
might have observed the alignment.
I'm going to follow up on the original commit to suggest getting
IR-level testing in addition to the asm level testing here so that we
can see and test these kinds of issues. We might never get an x86
instruction out with an alignment constraint, but we could stil
miscompile code by folding against the alignment marked on (or inferred
for in this case) the load.
llvm-svn: 278203
Chandler Carruth [Wed, 10 Aug 2016 07:32:47 +0000 (07:32 +0000)]
[x86] Fix a really nasty bug introduced in r276417 where alignment
constraints were added to _mm256_broadcast_{pd,ps} intel intrinsics.
The spec for these intrinics is ... pretty much silent on alignment.
This is especially frustrating considering the amount of discussion of
alignment in the load and store instrinsics. So I was forced to rely on
the specification for the VBROADCASTF128 instruction.
That instruction's spec is *also* completely silent on alignment.
Fortunately, when it comes to the instruction's spec, silence is enough.
There is no #GP fault option for an underaligned address so this
instruction, and by inference the intrinsic, can read any alignment.
As it happens, the old code worked exactly this way and in fact we have
plenty of code that hands pointers with less than 16-byte alignment to
these intrinsics. This code broke pretty spectacularly with this commit.
Fortunately, the fix is super simple! Change a 16 to a 1, and ta da!
Anyways, a lot of debugging for a really boring fix. =]
llvm-svn: 278202
Miklos Vajna [Wed, 10 Aug 2016 07:13:29 +0000 (07:13 +0000)]
clang-rename YAML reader: address post-commit comments
llvm-svn: 278201
Davide Italiano [Wed, 10 Aug 2016 06:33:32 +0000 (06:33 +0000)]
[SimplifyLibCalls] Restore the old behaviour, emit a libcall.
Hal pointed out that the semantic of our intrinsic and the libc
call are slightly different. Add a comment while I'm here to
explain why we can't emit an intrinsic. Thanks Hal!
llvm-svn: 278200
Saleem Abdulrasool [Wed, 10 Aug 2016 04:37:56 +0000 (04:37 +0000)]
COFF: reorder the table construction
Reorder the table setup to mirror the indices corresponding to them. This means
that the table values are filled out as per the enumeration ordering. Doing so
makes it easier to identify a particular table. NFC.
llvm-svn: 278199
Eugene Zelenko [Wed, 10 Aug 2016 01:55:51 +0000 (01:55 +0000)]
[Documentation] Fix spelling mistakes in docs/clang-tidy/index.rst.
llvm-svn: 278198
Todd Fiala [Wed, 10 Aug 2016 01:37:27 +0000 (01:37 +0000)]
Undid LLVM macro usage in test suite test subject files.
llvm-svn: 278197
Justin Lebar [Wed, 10 Aug 2016 01:09:21 +0000 (01:09 +0000)]
[CUDA] Reject calls to __device__ functions from host variable global initializers.
Reviewers: tra
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D23335
llvm-svn: 278196
Justin Lebar [Wed, 10 Aug 2016 01:09:18 +0000 (01:09 +0000)]
[CUDA] Print a "previous-decl" note when calling an illegal member fn.
Summary:
When we emit err_ref_bad_target, we should emit a "'method' declared
here" note. We already do so in most places, just not in
BuildCallToMemberFunction.
Reviewers: tra
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D23240
llvm-svn: 278195
Justin Lebar [Wed, 10 Aug 2016 01:09:14 +0000 (01:09 +0000)]
[CUDA] Add __device__ overloads for placement new and delete.
Summary:
Previously these sort of worked because they didn't end up resulting in
calls at the ptx layer. But I'm adding stricter checks that break
placement new without these changes.
Reviewers: tra
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D23239
llvm-svn: 278194
Justin Lebar [Wed, 10 Aug 2016 01:09:11 +0000 (01:09 +0000)]
[CUDA] Rename CheckCUDATarget to IsAllowedCUDACall. NFC
Summary:
I want to reuse "CheckCUDAFoo" in a later patch. Also, I think
IsAllowedCUDACall gets the point across more clearly.
Reviewers: tra
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D23238
llvm-svn: 278193
Justin Lebar [Wed, 10 Aug 2016 01:09:07 +0000 (01:09 +0000)]
[Diag] Fix idiom in comment: "on the lam", not "on the lamb".
llvm-svn: 278192
Matthias Braun [Wed, 10 Aug 2016 01:02:28 +0000 (01:02 +0000)]
test/hard_link_count(): Fix test on darwin
The hard link count that stat reports are different between normal hfs and the
case sensitive variant. Accept both.
llvm-svn: 278191
Todd Fiala [Wed, 10 Aug 2016 00:53:21 +0000 (00:53 +0000)]
Undo usage of LLVM macros in debugserver
We don't take a dependency on LLVM in debugserver.
This was failing to compile before.
llvm-svn: 278190
Easwaran Raman [Wed, 10 Aug 2016 00:48:04 +0000 (00:48 +0000)]
Do not directly use inline threshold cl options in cost analysis.
This adds an InlineParams struct which is populated from the command line options by getInlineParams and passed to getInlineCost for the call analyzer to use.
Differential revision: https://reviews.llvm.org/D22120
llvm-svn: 278189
Jim Ingham [Wed, 10 Aug 2016 00:45:58 +0000 (00:45 +0000)]
Add a newline to the end of the file to remove the clang warnings.
llvm-svn: 278188
Francis Ricci [Wed, 10 Aug 2016 00:45:30 +0000 (00:45 +0000)]
[compiler-rt] Allow nm program to be over-ridden for global symbol detection
Summary:
While cross-compiling, a custom nm program may be required. This will also allow for the
use of llvm-nm if desired.
Reviewers: samsonov, beanz, compnerd, eugenis
Subscribers: kubabrecka, dberris, llvm-commits
Differential Revision: https://reviews.llvm.org/D23278
llvm-svn: 278187
Adam Nemet [Wed, 10 Aug 2016 00:44:56 +0000 (00:44 +0000)]
[OptDiag] Add class Doxygen comment
This was requested in D22694.
llvm-svn: 278186
Adam Nemet [Wed, 10 Aug 2016 00:44:44 +0000 (00:44 +0000)]
[Inliner,OptDiag] Add hotness attribute to opt diagnostics
Summary:
The inliner not being a function pass requires the work-around of
generating the OptimizationRemarkEmitter and in turn BFI on demand.
This will go away after the new PM is ready.
BFI is only computed inside ORE if the user has requested hotness
information for optimization diagnostitics (-pass-remark-with-hotness at
the 'opt' level). Thus there is no additional overhead without the
flag.
Reviewers: hfinkel, davidxl, eraman
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D22694
llvm-svn: 278185
Justin Lebar [Wed, 10 Aug 2016 00:40:46 +0000 (00:40 +0000)]
[CUDA] Fix out-of-date comment.
LangOpts.CUDADisableTargetCallChecks no longer exists (it's effectively
always true now).
llvm-svn: 278184
Justin Lebar [Wed, 10 Aug 2016 00:40:43 +0000 (00:40 +0000)]
[CUDA] Minor comment nits.
llvm-svn: 278183
Zachary Turner [Wed, 10 Aug 2016 00:02:58 +0000 (00:02 +0000)]
Fix build on android and Linux.
gettimeofday() isn't defined without a special header. Rather
than rely on C apis, let's just use modern C++11 to do this
portably on all platforms using std::chrono.
llvm-svn: 278182
Davide Italiano [Wed, 10 Aug 2016 00:01:13 +0000 (00:01 +0000)]
[Core] tentativeDefinition() is now unused.
llvm-svn: 278181
Kostya Serebryany [Tue, 9 Aug 2016 23:57:04 +0000 (23:57 +0000)]
[scudo] Documentation update for Scudo, from https://reviews.llvm.org/D23332
llvm-svn: 278180
Kostya Serebryany [Tue, 9 Aug 2016 23:30:22 +0000 (23:30 +0000)]
[sanitizer] use 32-bit offset instead of 64-bit pointers in the 64-bit allocator's transfer batches. This saves 2x memory for the transfer batches (up to ~1.5% overall in some cases)
llvm-svn: 278179
Vedant Kumar [Tue, 9 Aug 2016 23:14:37 +0000 (23:14 +0000)]
[IR] Remove some unused #includes (NFC)
I needed a reader-writer lock for a downstream project and noticed that
llvm has one. Function.cpp is the only file in-tree that refers to it.
To anyone reading this: are you using RWMutex in out-of-tree code? Maybe
it's not worth keeping around any more...
Since we're not actually using RWMutex *here*, remove the #include (and
a few other stale headers while we're at it).
llvm-svn: 278178
Zachary Turner [Tue, 9 Aug 2016 23:06:08 +0000 (23:06 +0000)]
Delete Host/windows/win32.h
It's always hard to remember when to include this file, and
when you do include it it's hard to remember what preprocessor
check it needs to be behind, and then you further have to remember
whether it's windows.h or win32.h which you need to include.
This patch changes the name to PosixApi.h, which is more appropriately
named, and makes it independent of any preprocessor setting.
There's still the issue of people not knowing when to include this,
because there's not a well-defined set of things it exposes other
than "whatever is missing on Windows", but at least this should
make it less painful to fix when problems arise.
This patch depends on LLVM revision r278170.
llvm-svn: 278177
Zachary Turner [Tue, 9 Aug 2016 23:03:55 +0000 (23:03 +0000)]
Make LLVM_PRETTY_FUNCTION support __func__.
In case there are compilers that support neither __FUNCSIG__ or
__PRETTY_FUNCTION__, we fall back to __func__ as a last resort,
which should be guaranteed by C++11 and C99.
llvm-svn: 278176
Tim Northover [Tue, 9 Aug 2016 23:01:30 +0000 (23:01 +0000)]
GlobalISel: support 'undef' constant.
llvm-svn: 278174
Michael Zolotukhin [Tue, 9 Aug 2016 22:44:56 +0000 (22:44 +0000)]
[LoopSimplify] Rebuild LCSSA for the inner loop after separating nested loops.
Summary:
This hopefully fixes PR28825. The problem now was that a value from the
original loop was used in a subloop, which became a sibling after separation.
While a subloop doesn't need an lcssa phi node, a sibling does, and that's
where we broke LCSSA. The most natural way to fix this now is to simply call
formLCSSA on the original loop: it'll do what we've been doing before plus
it'll cover situations described above.
I think we don't need to run formLCSSARecursively here, and we have an assert
to verify this (I've tried testing it on LLVM testsuite + SPECs). I'd be happy
to be corrected here though.
I also changed a run line in the test from '-lcssa -loop-unroll' to
'-lcssa -loop-simplify -indvars', because it exercises LCSSA
preservation to the same extent, but also makes less unrelated
transformation on the CFG, which makes it easier to verify.
Reviewers: chandlerc, sanjoy, silvas
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D23288
llvm-svn: 278173
Andrew Kaylor [Tue, 9 Aug 2016 22:41:35 +0000 (22:41 +0000)]
[ValueTracking] Improve ValueTracking on left shift with nsw flag
Patch by Li Huang
Differential Revison: https://reviews.llvm.org/D23296
llvm-svn: 278172
Derek Schuff [Tue, 9 Aug 2016 22:37:00 +0000 (22:37 +0000)]
[WebAssembly] Add -emscripten-cxx-exceptions-whitelist option
This patch adds -emscripten-cxx-exceptions-whitelist option to
WebAssemblyLowerEmscriptenExceptions pass. This options is the list of
function names in which Emscripten-style exception handling is enabled.
This is to support emscripten's EXCEPTION_CATCHING_WHITELIST which
exists because of the performance impact of emscripten's non-zero-cost
EH method.
Patch by Heejin Ahn
Differential Revision: https://reviews.llvm.org/D23292
llvm-svn: 278171
Zachary Turner [Tue, 9 Aug 2016 22:03:45 +0000 (22:03 +0000)]
Add a platform independent version of __PRETTY_FUNCTION__.
MSVC doesn't have this, it only has __FUNCSIG__. So this adds
a new macro called LLVM_PRETTY_FUNCTION which evaluates to the
right thing on any platform.
llvm-svn: 278170
Petr Hosek [Tue, 9 Aug 2016 21:28:52 +0000 (21:28 +0000)]
Depend directly on unwind when not building standalone
When using libunwind and not building as standalone project, we
can directly depend on the unwind library target.
Differential Revision: https://reviews.llvm.org/D23289
llvm-svn: 278169
Tim Northover [Tue, 9 Aug 2016 21:28:04 +0000 (21:28 +0000)]
GlobalISel: first translation support for Constants.
For now put them all in the entry block. This should be correct but may give
poor runtime performance. Hopefully MachineSinking combined with
isReMaterializable can solve those issues, but if not the interface is sound
enough to support alternatives.
llvm-svn: 278168