Commit Graph

125979 Commits

Author SHA1 Message Date
Amaury Sechet
9812f7b852 Improve load/store to memcpy for aggregate
Summary: It turns out that if we don't try to do it at the store location, we can do it before any operation that alias the load, as long as no operation alias the store.

Reviewers: craig.topper, spatel, dexonsmith, Prazek, chandlerc, joker.eph

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256923 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-06 09:30:39 +00:00
Simon Pilgrim
2d3ec5706a [X86][SSE] There is no zmm addsubpd/addsubps instruction.
Replace the assert in combineShuffleToAddSub with an early out.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256922 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-06 09:08:49 +00:00
Simon Pilgrim
fd8d45a8f8 [X86][SSE] An empty target shuffle mask is always a failure.
As discussed on D15378, move the mask.empty() tests to after the switch statement and consider any shuffle decode where the extracted target shuffle mask is empty as a failure.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256921 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-06 08:59:32 +00:00
Craig Topper
5205089191 [X86] Use PS instead of TB for instructions that have PD/XS/XD variations. Use OpSize32 on an instruction that has an OpSize16 variant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256918 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-06 06:18:41 +00:00
Craig Topper
eb67bfafbe [X86] Fix an incorrect usage of In32BitMode that should have been Not64BitMode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256917 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-06 06:18:37 +00:00
Philip Reames
d1a0b9f13e Fix a warning [NFC]
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256916 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-06 05:53:09 +00:00
Jordan Rose
71a6baa31c Add != to YAMLParser's basic_collection_iterator.
...and mark it as merely an input_iterator rather than a forward_iterator,
since it is destructive. And then rewrite == to take advantage of that.

Patch by Alex Denisov!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256913 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-06 05:17:12 +00:00
David Majnemer
4cb9f9dcb1 [SimplifyLibCalls] Teach SimplifyLibCalls about operand bundles
If we replace one call-site with another, be sure to move over any
operand bundles that lingered on the old call-site.

This fixes PR26036.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256912 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-06 05:01:34 +00:00
Philip Reames
ef80e8aad9 [BasicAA] Remove special casing of memset_pattern16 in favor of generic attribute inference
Most of the properties of memset_pattern16 can be now covered by the generic attributes and inferred by InferFunctionAttrs.  The only exceptions are:
- We don't yet have a writeonly attribute for the first argument.
- We don't have an attribute for modeling the access size facts encoded in MemoryLocation.cpp.  

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256911 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-06 04:53:16 +00:00
Philip Reames
719759b2fa [BasicAA] Delete dead code related to memset/memcpy/memmove intrinsics [NFCI]
We only need to describe the writeonly property of one of the arguments. All of the rest of the semantics are nicely described by existing attributes in Intrinsics.td.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256910 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-06 04:43:03 +00:00
Philip Reames
f5d467572c Extract helper function to merge MemoryOperand lists [NFC]
In the discussion on http://reviews.llvm.org/D15730, Andy pointed out we had a utility function for merging MMO lists. Since it turned we actually had two copies and there's another review in progress (http://reviews.llvm.org/D15230) which needs the same, extract it into a utility function and clean up the interfaces to make it easier to use with a MachineInstBuilder.

I introduced a pair here to track size and allocation together. I think we should probably move in the direction of the MachineOperandsRef helper class, but I'm leaving that for further work. I want to get the poison state introduced before I make major changes to the interface.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256909 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-06 04:39:03 +00:00
Junmo Park
da5ee8d8cf Delete trailing whitespace; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256908 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-06 03:53:36 +00:00
Junmo Park
05e99849bf Delete trailing whitespace; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256906 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-06 03:41:30 +00:00
Yunzhong Gao
bf6a00569e Do not define NOGDI. Mingw defines LOGFONTW type in wingdi.h and the mingw
version of shlobj.h includes shobjidl.h and the latter uses the LOGFONTW type.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256904 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-06 03:01:10 +00:00
Yunzhong Gao
bcbe1c3e29 Another attempt at fixing the i686-mingw32-RA-on-linux buildbot. I am getting
confused with what version of mingw is actually installed on the buildbot, and
for now I will just assume this is an unknown version which does not ship with
VersionHelpers.h.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256902 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-06 02:48:42 +00:00
Yunzhong Gao
6dfd12cc3c Another attempt at fixing the i686-mingw32-RA-on-linux buildbot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256901 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-06 02:32:31 +00:00
Kostya Serebryany
92ec084eaf [libFuzzer] extend the dictionary mutator to optionally overwrite data with the dict entry
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256900 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-06 02:13:04 +00:00
Yunzhong Gao
f776cd591c Hopefully fix a mingw32 buildbot (i686-mingw32-RA-on-linux) which does not have
the VersionHelpers.h header.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256896 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-06 01:36:45 +00:00
Xinliang David Li
42115a720d More fix to coverage documentation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256895 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-06 01:23:41 +00:00
Yunzhong Gao
46ee2eb7c7 Fixing PR25717: fatal IO error writing large outputs to console on Windows.
This patch is similar to the Python issue#11395. We need to cap the output
size to 32767 on Windows to work around the size limit of WriteConsole().
Reference: https://bugs.python.org/issue11395

Writing a test for this bug turns out to be harder than I thought. I am
still working on it (see phabricator review D15705).

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256892 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-06 00:50:06 +00:00
Sanjay Patel
f4e4e5eca8 rangify; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256891 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-06 00:45:42 +00:00
Dan Gohman
0fcad92ee3 [SelectionDAGBuilder] Set NoUnsignedWrap for inbounds gep and load/store offsets.
In an inbounds getelementptr, when an index produces a constant non-negative
offset to add to the base, the add can be assumed to not have unsigned overflow.

This relies on the assumption that addresses can't occupy more than half the
address space, which isn't possible in C because it wouldn't be possible to
represent the difference between the start of the object and one-past-the-end
in a ptrdiff_t.

Setting the NoUnsignedWrap flag is theoretically useful in general, and is
specifically useful to the WebAssembly backend, since it permits stronger
constant offset folding.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256890 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-06 00:43:06 +00:00
Sanjay Patel
4001009bac use std::max ; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256889 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-06 00:36:59 +00:00
Sanjay Patel
9fcc06d338 A (B + C) = A B + A C ; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256884 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-06 00:32:15 +00:00
Sanjay Patel
10f1b412d6 fix typo; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256883 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-06 00:23:12 +00:00
Mike Aizatsky
1cea7723fa [libfuzzer] print_new_cov_pcs experimental option.
Differential Revision: http://reviews.llvm.org/D15901

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256882 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-06 00:21:22 +00:00
Sanjay Patel
a66b6e651c fix typos; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256881 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-06 00:18:29 +00:00
Kostya Serebryany
325442be58 [libFuzzer] make trace-based fuzzing not crash in presence of threads
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256876 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-06 00:03:35 +00:00
Manuel Jacob
7b845c18db [Statepoints] Check for the "gc-leaf-function" attribute on call sites as well.
Reviewers: sanjoy, reames

Subscribers: sanjoy, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256875 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-05 23:59:08 +00:00
Sanjay Patel
d79ef021fe [LibCallSimplfier] use instruction-level fast-math-flags for fmin/fmax transforms
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256871 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-05 20:46:19 +00:00
Nicolai Haehnle
cb2ad1e249 AMDGPU/SI: Do not move scratch resource register on Tonga & Iceland
Due to the SGPR init bug, every program claims to use the same number
of SGPRs anyway, so there's no point in trying to shift those registers
down from their initial spot of reservation.

Add a test that uses VGPR spilling and blocks most SGPRs from being used for
the scratch resource register. Previously, this would run into an assertion.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256870 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-05 20:42:49 +00:00
Amaury Sechet
4b49239535 Implement load to store => memcpy in MemCpyOpt for aggregates
Summary:
Most of the tool chain is able to optimize scalar and memcpy like operation effisciently while it isn't that good with aggregates. In order to improve the support of aggregate, we try to change aggregate manipulation into either scalar or memcpy like ones whenever possible without loosing informations.

This is one such opportunity.

Reviewers: craig.topper, spatel, dexonsmith, Prazek, chandlerc

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256868 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-05 20:17:48 +00:00
Oleg Ranevskyy
e597ffa521 [Clang/Support/Windows/Unix] Command lines created by clang may exceed the command length limit set by the OS
Summary:
Hi Rafael,

Would you be able to review this patch, please?

(Clang part of the patch is D15832).

When clang runs an external tool, e.g. a linker, it may create a command line that exceeds the length limit.

Clang uses the llvm::sys::argumentsFitWithinSystemLimits function to check if command line length fits the OS 

limitation. There are two problems in this function that may cause exceeding of the limit:

1. It ignores the length of the program path in its calculations. On the other hand, clang adds the program 

path to the command line when it runs the program.

2. It assumes no space character is inserted after the last argument, which is not true for Windows. The flattenArgs function adds the trailing space for *each* argument. The result of this is that the terminating NULL character is not counted and may be placed beyond the length limit if the command line is exactly 32768 characters long. The WinAPI's CreateProcess does not find the NULL character and fails.

Reviewers: rafael, ygao, probinson

Subscribers: asl, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256866 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-05 19:56:12 +00:00
Manuel Jacob
407f296e22 Correct my last commit (revision 256860).
I forgot to save a small wording improvement before committing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256862 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-05 19:45:54 +00:00
Manuel Jacob
32704d03f2 [PlaceSafepoints] Add a test.
Calls of functions with the "gc-leaf-function" attribute shouldn't be turned
into a safepoint.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256860 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-05 19:40:58 +00:00
Sanjay Patel
7a3b692c47 [InstCombine] insert a new shuffle before its uses (PR26015)
Although this solves the test case in PR26015:
https://llvm.org/bugs/show_bug.cgi?id=26015

And may solve PR25999:
https://llvm.org/bugs/show_bug.cgi?id=25999

...I suspect this is not the best solution. I think we want to insert the new shuffle
just ahead of the earliest ExtractElementInst that we're replacing, but I don't know 
how that should be implemented.

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256857 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-05 19:09:47 +00:00
Manuel Jacob
db61103ea8 Add function for testing string attributes to InvokeInst and CallSite. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256856 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-05 19:08:33 +00:00
David Majnemer
6ea7b5b53b [X86] Determine if we have an OpaqueSPAdjustment earlier
We queried hasFP before we hit ExpandISelPseudos.  ExpandISelPseudos
manipulated state that hasFP relied on, potentially changing the result
after it has been queried elsewhere.

While I am not aware of any particular bug due to this state of affairs,
it seems best to avoid it entirely by changing the state during DAG
construction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256849 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-05 17:46:36 +00:00
Michael Zuckerman
024ff64164 [AVX512] add PSLLD and PSLLQ Intrinsic
Differential Revision: http://reviews.llvm.org/D15885


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256840 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-05 15:17:39 +00:00
MinSeong Kim
9ec3763313 [MISched] Explanatory error message when machine model is not complete. NFC
When not all instructions have a scheduling class,
the error message now provides a possible solution.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256839 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-05 14:50:15 +00:00
Aaron Ballman
a0048af204 Reverting r256836; it causes a build bot failure: http://lab.llvm.org:8011/builders/lldb-x86-win7-msvc/builds/14050/steps/build/logs/stdio
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256837 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-05 14:35:01 +00:00
Aaron Ballman
2498e944fc Enable more strict standards conformance in MSVC for rvalue casting and string literal type conversion to non-const types. Also enables generation of intrinsics for more functions.
Patch by Alexander Riccio

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256836 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-05 14:24:01 +00:00
MinSeong Kim
eaca36fc81 [AArch64] Add support for Samsung Exynos-M1
Adds core tuning support for new Samsung Exynos-M1 core (ARMv8-A).

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256828 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-05 12:51:59 +00:00
Artyom Skrobov
176a9b2a53 (NFC) Change SubtargetFeatures::ToggleFeature and
SubtargetFeatures::ApplyFeatureFlag to be static, so that
MCSubtargetInfo doesn't need to instantiate SubtargetFeatures
for nothing. Also change the return type to void, as it
wasn't ever used.

This is a partial commit of http://reviews.llvm.org/D15746

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256823 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-05 10:25:56 +00:00
Junmo Park
cf3cd2db04 Remove extra whitespace. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256821 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-05 09:40:03 +00:00
Junmo Park
19e5c2eef3 Remove extra whitespace. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256820 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-05 09:36:47 +00:00
Simon Pilgrim
a413c6e9b6 [X86][SSE] Merge PerformBLENDICombine into PerformShuffleCombine
PBLEND/BLENDPD/BLENDPS are no different to the other target shuffles and this will make future improvements to the target shuffle combines more straightforward.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256819 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-05 09:12:17 +00:00
Craig Topper
59b312cfd5 [X86] Make MOV32ri64 a post-RA pseudo instead of a CodeGenOnly instruction. It was only needed for rematerialization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256818 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-05 07:44:14 +00:00
Craig Topper
db43036e4d [X86] Add OpSize32 to OR32mrLocked instruction to match the normal OR32mr instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256817 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-05 07:44:11 +00:00
Craig Topper
a1fcf259ac [AVX512] Add hasSideEffects=0 to kunpck instructions since they lack a pattern in their instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256816 91177308-0d34-0410-b5e6-96231b3b80d8
2016-01-05 07:44:08 +00:00