132977 Commits

Author SHA1 Message Date
Geoff Berry
a6b49a045b [PowerPC] Run reg2mem on tests to simplify them.
Summary:
Also convert test/CodeGen/PowerPC/vsx-ldst-builtin-le.ll to use
FileCheck instead of two grep and count runs.

This change is needed to avoid spurious diffs in these tests when
EarlyCSE is improved to use MemorySSA and can do more load elimination.

Reviewers: hfinkel

Subscribers: mcrosier, llvm-commits

Differential Revision: http://reviews.llvm.org/D20238

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271553 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 18:02:50 +00:00
Simon Pilgrim
848232c1e9 [X86][SSE] Added SSE41/AVX2 non-temporal tests
Useful for when we add MOVNTDQA support

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271552 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 18:01:21 +00:00
Reid Kleckner
0a3fd008de [codeview] Fix crash when handling qualified void types
The DIType* for void is the null pointer. A null DIType can never be a
qualified type, so we can just exit the loop at this point and go to
getTypeIndex(BaseTy).

Fixes PR27984

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271550 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 17:40:51 +00:00
David Majnemer
2dffc15239 Rename IMAGE_DEBUG_TYPE_NO_TIMESTAMP to IMAGE_DEBUG_TYPE_REPRO
This matches the COFF spec

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271549 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 17:32:11 +00:00
Dimitry Andric
f9f8cdc1e4 Only attempt to detect AVG if SSE2 is available
Summary:
In PR29973 Sanjay Patel reported an assertion failure when a certain
loop was optimized, for a target without SSE2 support.  It turned out
this was because of the AVG pattern detection introduced in rL253952.

Prevent the assertion failure by bailing out early in
`detectAVGPattern()`, if the target does not support SSE2.

Also add a minimized test case.

Reviewers: congh, eli.friedman, spatel

Subscribers: emaste, llvm-commits

Differential Revision: http://reviews.llvm.org/D20905


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271548 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 17:30:49 +00:00
Qin Zhao
56829141f8 [esan|cfrag] Create the cfrag struct array for the runtime
Summary:
Fills the cfrag struct variable with an array of struct information
variables.

Reviewers: aizatsky, bruening

Subscribers: bruening, kcc, vitalybuka, eugenis, llvm-commits, zhaoqin

Differential Revision: http://reviews.llvm.org/D20661

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271547 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 17:30:47 +00:00
Ahmed Bougacha
408a761951 [ADT] Pass ArrayRef::slice size_t instead of unsigned.
Also fix slice wrappers drop_front and drop_back.
The unittests are pretty awkward, but do the job; alternatives
welcome!

..and yes, I do have ArrayRefs with more than 4 billion elements.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271546 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 17:26:03 +00:00
Nirav Dave
396d48087d Ignore Lexing errors in macro body definitions
Do not issue lexing errors found during the parsing of macro body
definitions and parseIdentifier function in AsmParser. This changes the
Parser to not issue a lexing error when we reach an error, but rather
when it is consumed allowing us time to examine and recover from an
error.

As a result, of this, we stop issuing a both lexing error and a parsing
error in floating-literals test. Minor tweak to parseDirectiveRealValue
to favor more meaningful lexing error over less helpful parse error.

Reviewers: rnk, majnemer

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D20535

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271542 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 17:15:05 +00:00
David Majnemer
fda0a6921b [CodeView] Implement function-type indices
We still need to do something about member functions and calling
conventions.

Differential Revision: http://reviews.llvm.org/D20900

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271541 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 17:13:53 +00:00
Chandler Carruth
06da926274 Remove all of the legacy home-grown atomic operations LLVM provided
except for CompareAndSwap. That is the only one still being used
anywhere now that statistics have been moved onto std::atomic.

Also, add a warning to the header that we shouldn't introduce more uses
of these old style atomics and instead should be using C++11's
std::atomic facilities.

Really hoping that we can hammer out the last couple of users here and
replace them with something more localized and/or principled, but
figured this was a pretty good start. =]

Note that this patch will need to be reverted if r271504 needs to be
reverted as that removes the last user of these. However, the biggest
risk for that patch was MSVC 2013 and at least one bot has already
passed where it would have failed there. I've tested MSVC 2015 using
their web interfaces and other platforms seem fine, so I'm optimistic.

Differential Revision: http://reviews.llvm.org/D20901

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271540 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 17:11:11 +00:00
Reid Kleckner
fb1a91169a [COFF] Expose the PE debug data directory and dump it
This directory is used to find if there is a PDB associated with an
executable. I plan to use this functionality to teach llvm-symbolizer
whether it should use DIA or DWARF to symbolize a given DLL.

Reviewers: majnemer

Differential Revision: http://reviews.llvm.org/D20885

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271539 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 17:10:43 +00:00
Vedant Kumar
706cb9d996 [llvm-cov] Use string getters (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271537 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 17:00:50 +00:00
Xinliang David Li
6e7129c27d [profile] value profiling bug fix -- missing icall targets in profile-use
Inline virtual functions has linkeonceodr linkage (emitted in comdat on 
supporting targets). If the vtable for the class is not emitted in the
defining module, function won't be address taken thus its address is not
recorded. At the mercy of the linker, if the per-func prf_data from this
module (in comdat) is picked at link time, we will lose mapping from
function address to its hash val. This leads to missing icall promotion.
The second test case (currently disabled) in compiler_rt (r271528): 
instrprof-icall-prom.test demostrates the bug. The first profile-use
subtest is fine due to linker order difference.

With this change, no missing icall targets is found in instrumented clang's
raw profile.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271532 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 16:33:41 +00:00
Pavel Labath
df57369269 [cmake] Fix builds with LLVM_ENABLE_PIC=0
Summary:
When this flag is specified, the target llvm-lto is not built, but is still
used as a dependency of the test targets. cmake 2.8 silently ignored this
situation, but with cmake_minimum_required(3.4) it becomes an error. Fix this
by avoiding the inclusion of the target as a dependency.

Reviewers: beanz

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D20882

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271530 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 16:29:07 +00:00
Zachary Turner
f9c106c07b Fix uninitialized members in VarStreamArrayIterator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271529 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 16:28:52 +00:00
Geoff Berry
c22d8b1ed9 [PEI, AArch64] Use empty spaces in stack area for local stack slot allocation.
Summary:
If the target requests it, use emptry spaces in the fixed and
callee-save stack area to allocate local stack objects.

AArch64: Change last callee-save reg stack object alignment instead of
size to leave a gap to take advantage of above change.

Reviewers: t.p.northover, qcolombet, MatzeB

Subscribers: rengolin, mcrosier, llvm-commits, aemerson

Differential Revision: http://reviews.llvm.org/D20220

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271527 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 16:22:07 +00:00
Sanjay Patel
ec6796196a [DAG] use getBitcast() to reduce code
Although this was intended to be NFC, the test case wiggle shows a change in
code scheduling/RA caused by a difference in the SDLoc() generation.

Depending on how you look at it, this is the (dis)advantage of exact checking
in regression tests.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271526 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 16:01:15 +00:00
Krzysztof Parzyszek
4a35a33e2e [Hexagon] Expand COPY pseudo-instruction
Handle it locally instead of having the target-independent pass deal
with it. The generic pass does not preserve implicit uses, which may
be necessary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271520 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 14:33:08 +00:00
Krzysztof Parzyszek
9e424c51df [RDF] Ignore implicit defs when resetting <kill> flags
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271519 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 14:30:09 +00:00
Simon Pilgrim
c83e4f9067 [X86][SSE] Added non-temporal load tests for vector types
These currently lower to regular loads instead of MOVNTDQA

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271516 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 13:51:50 +00:00
Dylan McKay
1694d6c67b Add assertions to MathExtras max/min functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271515 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 12:00:34 +00:00
Simon Pilgrim
22d789345f [X86][SSE] Replace (V)CVTTPS2DQ and VCVTTPD2DQ truncating (round to zero) f32/f64 to i32 with generic IR (llvm)
This patch removes the llvm intrinsics (V)CVTTPS2DQ and VCVTTPD2DQ truncation (round to zero) conversions and auto-upgrades to FP_TO_SINT calls instead.

Note: I looked at updating CVTTPD2DQ as well but this still requires a lot more work to correctly lower.

Differential Revision: http://reviews.llvm.org/D20860

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271510 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 10:55:21 +00:00
Sjoerd Meijer
feb0d0e38e This adds support for Cortex-A73 as an available target.
Differential Revision: http://reviews.llvm.org/D20865


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271508 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 10:48:52 +00:00
Dylan McKay
e4d291c532 Add tests to Support/MathExtras
In r271380, I added several functions to get the minimum/maximum values
of n-width integers.

This just adds tests for them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271505 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 09:00:53 +00:00
Chandler Carruth
703f12b6ba Switch statistics to use relaxed updates to a std::atomic.
This removes usage of the hacky, incorrect, and TSan-unfriendly
home-grown atomics. It should actually be more efficient in some cases.

Based on our existing usage of <atomic>, all of this is portably
available AFAICT. One small challenge is initializing the stastic, but
I've tried a comparable sample out on MSVC (the most likely to complain
here) and it seems to work. Will have to watch the build bots of course.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271504 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 08:44:05 +00:00
Chandler Carruth
26ce540126 [ADT] Remove unused multiply and divide operator overloads on
statistics.

Scaling statistics atomically doesn't make any sense anyways, and none
were using these. If you find yourself wanting to do this, you should
probably keep a local count that you scale and then apply that after
scaling to the shared statistic object.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271503 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 08:37:14 +00:00
David Majnemer
83f42796fe [CodeView] Use the right type index for long long
We used T_INT8 instead of T_QUAD.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271497 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 07:02:32 +00:00
David Majnemer
81d9dfc70d [CodeView] Take the StreamRef::readBytes offset into account when validating
We only considered the length of the operation and the length of the
StreamRef without considered what it meant for the offset to be at a
non-zero position.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271496 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 06:21:44 +00:00
David Majnemer
f117b3a80f [CodeView] Remove superfluous bitmath
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271495 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 06:21:42 +00:00
David Majnemer
f69a113fe5 [codeview] Return type indices for typedefs
Use the type index of the underlying type unless we have a typedef from
long to HRESULT; HRESULT typedefs are translated to T_HRESULT.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271494 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 06:21:37 +00:00
Kostya Serebryany
4e0bd0b554 [libFuzzer] fix docs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271493 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 06:06:34 +00:00
Dan Liew
e8edd31970 [LibFuzzer] Disable compiling and running the LibFuzzer dataflow sanitizer tests on Apple platforms.
This fixes a broken part of the build on OSX as the dataflow sanitizer is not supported
on OSX yet.

Differential Revision: http://reviews.llvm.org/D20894

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271492 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 05:48:09 +00:00
Dan Liew
8bb56ccbc0 [LibFuzzer] Reimplement how the optional user functions are called.
The motivation for this change is to fix linking issues on OSX.
However this only partially fixes linking issues (the uninstrumented
tests and a few others  won't succesfully link yet).

This change introduces a struct of function pointers
(``fuzzer::ExternalFuntions``) which when initialised will point to the
optional functions if they are available.  Currently these
``LLVMFuzzerInitialize`` and ``LLVMFuzzerCustomMutator`` functions.

Two implementations of ``fuzzer::ExternalFunctions`` constructor are
provided one for Linux and one for OSX.

The OSX implementation uses ``dlsym()`` because the prior implementation
using weak symbols does not work unless the additional flags are passed
to the linker.

The Linux implementation continues to use weak symbols because the
``dlsym()`` approach does not work unless additional flags are passed
to the linker.

Differential Revision: http://reviews.llvm.org/D20741

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271491 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 05:48:02 +00:00
Kostya Serebryany
7f9dfc29fc [libFuzzer] docs: add contact, mention more trophies
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271490 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 05:45:42 +00:00
Zachary Turner
8839a0f88f [pdb] Parse and dump section map and section contribs
Differential Revision: http://reviews.llvm.org/D20876
Reviewed By: rnk, ruiu

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271488 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 05:07:49 +00:00
Craig Topper
d2ed3fa129 [AVX512] Add 512-bit load/stores to fast isel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271486 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 04:51:37 +00:00
Craig Topper
47a82be3a5 [X86] No need to use 256-bit VMOVNTPS for integer types when only AVX1 is supported. VMOVNTDQ is available with AVX1.
We were getting this right for v4i64 but not the other integer types.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271482 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 04:19:48 +00:00
Craig Topper
f543143a73 [X86] Add AVX 256-bit load and stores to fast isel.
I'm not sure why this was missing for so long.

This also exposed that we were picking floating point 256-bit VMOVNTPS for some integer types in normal isel for AVX1 even though VMOVNTDQ is available. In practice it doesn't matter due to the execution dependency fix pass, but it required extra isel patterns. Fixing that in a follow up commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271481 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 04:19:45 +00:00
Craig Topper
581e354beb [X86] Use uint16_t for a couple arrays of instruction opcodes. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271480 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 04:19:42 +00:00
Craig Topper
679f5c4582 [AVX512] Remove LOADA/LOADU/STOREA/STOREU intrinsic types now that they are unused.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271479 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 04:19:40 +00:00
Craig Topper
11a12c2c07 [AVX512] Remove masked load intrinsics. Clang now emits generic masked load intrinsics instead.
The intrinsics will be autoupgraded to the same generic masked loads.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271478 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 04:19:36 +00:00
Eric Fiselier
960b5867c5 Add "REQUIRES-ANY" feature test
Summary:
This patch adds a "REQUIRES-ANY" feature test that is disjunctive. This marks a test as `UNSUPPORTED` if none of the specified features are available.

Libc++ has the need to write feature test such as `// REQUIRES-ANY: c++98, c++03`  when testing of behavior that is specific to older dialects but has since changed.


Reviewers: rnk, ddunbar

Subscribers: ddunbar, probinson, llvm-commits, cfe-commits

Differential Revision: http://reviews.llvm.org/D20757

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271468 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 01:59:57 +00:00
Xinliang David Li
a87e199c33 make icall pass name consistent /NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271467 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 01:52:05 +00:00
Kostya Serebryany
08b019eaf8 [libFuzzer] use __sanitizer_print_memory_profile to print the memory profile on OOM
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271465 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 01:33:11 +00:00
Sanjoy Das
cfd3677995 Inline isDereferenceableFromAttribute; NFC
Now that `Value::getPointerDereferenceableBytes` looks beyond just
attributes, the name `isDereferenceableFromAttribute` is misleading.
Just inline the function, since it is small and only used once.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271456 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 00:52:53 +00:00
Sanjoy Das
ca4fdcc423 Remove Value::isPointerDereferenceable; NFCI
... and merge into `Value::getPointerDereferenceableBytes`. This was
suggested by Artur Pilipenko in D20764 -- since we no longer allow loads
of unsized types, there is no need anymore to have this special logic.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271455 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 00:52:48 +00:00
Tamas Berghammer
e1b60c4f60 Try to fix docs build after rL271440
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271452 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 00:26:18 +00:00
Vitaly Buka
f9bee53f83 [asan] Rename *UAR* into *UseAfterReturn*
Summary:
To improve readability.

PR27453

Reviewers: kcc, eugenis, aizatsky

Subscribers: llvm-commits

Differential Revision: http://reviews.llvm.org/D20761

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271447 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 00:06:42 +00:00
Matt Arsenault
25641e07d0 AMDGPU: Fix incorrectly setting kill flag when copying register tuples
This fixes some verifier errors when trackLivenessAfterRegAlloc is
enabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271446 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 00:04:30 +00:00
Matt Arsenault
48de2a917d Make MachineCopyPropagation preserve CFG
This doesn't touch it as far as I can tell.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271445 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-02 00:04:26 +00:00