Commit Graph

139726 Commits

Author SHA1 Message Date
Renato Golin
e4c66df4b4 [docs] Reduce the number of places 'minimum requirements' is mentioned to one
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284380 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-17 12:29:00 +00:00
Oliver Stannard
7b3797ef4f [SimplifyCFG] Don't lower complex ConstantExprs to lookup tables
Not all ConstantExprs can be represented by a global variable, for example most
pointer arithmetic other than addition of a constant, so we can't convert these
values from switch statements to lookup tables.

Differential Revision: https://reviews.llvm.org/D25550



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284379 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-17 12:00:24 +00:00
Tobias Grosser
a00e39fd38 [SCEV] Consider delinearization pattern with extension with identity factor
Summary: The delinearization algorithm did not consider terms which had an extension without a multiply factor, i.e. a identify factor. We lose cases where size is char type where there will no multiply factor.

Reviewers: sanjoy, grosser

Subscribers: mzolotukhin, Eugene.Zelenko, llvm-commits, mssimpso, sanjoy, grosser

Differential Revision: https://reviews.llvm.org/D16492

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284378 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-17 11:56:26 +00:00
Andrea Di Biagio
fe42b012cd [CodeGenPrepare] When moving a zext near to its associated load, do not retain the original debug location.
CodeGenPrepare knows how to move a zext of a load into the same basic block
where the load lives. The goal is to help ISel match a zero-extending load
instead of two separated instructions.

CGP attempts to move a zext computation even if it lives in a basic block that
does not post-dominate the load's basic block. That means, the hoisted zext may
be speculated. Preserving the zext location would hurt the debugging experience
and the quality of sample pgo.
With this patch, when moving a zext near to its associated load, CGP no longer
propagates the zext's debug location. Instead, CGP conservatively reuses the
same debug location for the load and the zext.

An alternative approach would be to assign an artificial line-0 location to the
zext. However we don't want to over-use the 'line-0' for this particular case
because it would have a size cost in the line-table section for no additional
benefit.

Differential Revision: https://reviews.llvm.org/D25611


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284377 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-17 11:32:26 +00:00
George Rimar
2c7c85dbd2 Recommit r284371 "[Object/ELF] - Check that e_shnum is null when e_shoff is."
With fix: hex edited the precompiled inputs from another testcases to pass new checks.

Original commit message:

[Object/ELF] - Check that e_shnum is null when e_shoff is.

Spec says (http://www.sco.com/developers/gabi/1998-04-29/ch4.eheader.html) :
e_shnum
This member holds the number of entries in the section header table. Thus the product of e_shentsize and e_shnum gives the section header table's size in bytes. If a file has no section header table, e_shnum holds the value zero.

Revealed using "id_000037,sig_11,src_000015,op_havoc,rep_8" from PR30540

That was the reason of crash in lld on incorrect input file.
Binary reduced using afl-min.

Differential revision: https://reviews.llvm.org/D25090

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284374 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-17 10:58:02 +00:00
George Rimar
50d445a24c Revert r284371 "[Object/ELF] - Check that e_shnum is null when e_shoff is."
It broke build bot:
http://lab.llvm.org:8011/builders/clang-with-lto-ubuntu/builds/908/steps/test-stage1-compiler/logs/stdio

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284373 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-17 10:20:47 +00:00
George Rimar
a43813b85e [Object/ELF] - Check that e_shnum is null when e_shoff is.
Spec says (http://www.sco.com/developers/gabi/1998-04-29/ch4.eheader.html) :
e_shnum
This member holds the number of entries in the section header table. Thus the product of e_shentsize and e_shnum gives the section header table's size in bytes. If a file has no section header table, e_shnum holds the value zero.

Revealed using "id_000037,sig_11,src_000015,op_havoc,rep_8" from PR30540

That was the reason of crash in lld on incorrect input file.
Binary reduced using afl-min.

Differential revision: https://reviews.llvm.org/D25090

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284371 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-17 10:06:44 +00:00
George Rimar
b987363712 [Object/ELF] - Do not crash on invalid section index.
If object has wrong (large) string table index and
also incorrect large value for amount of sections in total,
then section index passes the check:

  if (Index >= getNumSections())
    return object_error::invalid_section_index;

But result pointer then is far after end of file data, what
result in a crash.

Differential revision: https://reviews.llvm.org/D25081

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284369 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-17 09:30:06 +00:00
Justin Bogner
0ebe9c2f81 Support: Drop LLVM_ATTRIBUTE_UNUSED_RESULT
Uses of this have all been updated to use LLVM_NODISCARD, which
matches the C++17 [[nodiscard]] semantics rather than those of GCC's
__attribute__((warn_unused_result)).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284367 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-17 07:37:11 +00:00
Craig Topper
043b10deff [X86] Fix shuffle decoding assertions to print the right number of required operands. Update the checks themselves to be >= to the same number instead of > one less than the required number.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284365 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-17 06:41:18 +00:00
Justin Bogner
4e1daa7c89 ADT: Use LLVM_NODISCARD instead of LLVM_ATTRIBUTE_UNUSED_RESULT for StringRef
Instead of annotating (most of) the StringRef API, we can just
annotate the type directly. This is less code and it will warn in more
cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284364 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-17 06:35:23 +00:00
Craig Topper
d56fafdbd2 [AVX-512] Add shuffle combining support for vpermi2var shuffles derived from existing support for vpermt2var.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284357 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-17 04:26:47 +00:00
Craig Topper
11061fd0cb [AVX-512] Add vpermi2var test cases to shuffle combining test case. Combining will be added in a future commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284356 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-17 04:26:44 +00:00
Craig Topper
4da8984f9e [AVX-512] Add support for turning a 256-bit load that goes to both halfs of an insert_subvector into a subvector broadcast.
Differential Revision: https://reviews.llvm.org/D25650

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284353 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-16 23:29:51 +00:00
Justin Bogner
13579ede05 unittests: Explicitly ignore some return values in crash tests
Ideally these would actually check that the results are reasonable,
but given that we're looping over so many different kinds of path that
isn't really practical.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284350 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-16 22:09:24 +00:00
Justin Bogner
0f82c946ae Support: Return void from Scanner::scan_ns_uri_char, no one uses the result
Simplify this a little bit since the result is never used. It can be
added back easily enough if that changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284348 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-16 22:01:22 +00:00
Justin Bogner
215b6d51e1 MachineModuleInfo: Prefer the LLVM_NODISCARD spelling
Update a function annotated with LLVM_ATTRIBUTE_UNUSED_RESULT to use
LLVM_NODISCARD instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284346 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-16 21:18:26 +00:00
Justin Bogner
e1d1c98dc3 SCEV: Prefer the LLVM_NODISCARD spelling
Update functions annotated with LLVM_ATTRIBUTE_UNUSED_RESULT to use
LLVM_NODISCARD instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284345 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-16 21:17:29 +00:00
Justin Bogner
9febba8e12 Support: Prefer the LLVM_NODISCARD spelling
Update functions annotated with LLVM_ATTRIBUTE_UNUSED_RESULT to use
LLVM_NODISCARD instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284344 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-16 20:56:20 +00:00
Justin Bogner
fcec9152da ADT: Prefer the LLVM_NODISCARD spelling
Update functions annotated with LLVM_ATTRIBUTE_UNUSED_RESULT to use
LLVM_NODISCARD instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284343 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-16 20:42:34 +00:00
Justin Bogner
097967f645 ADT: Use LLVM_NODISCARD instead of LLVM_ATTRIBUTE_UNUSED_RESULT for ArrayRef
Instead of annotating (most of) the ArrayRef API, we can just annotate
the type directly. This is less code and it will warn in more cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284342 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-16 20:30:40 +00:00
Richard Smith
6ae3d4e42d PR30711: Fix incorrect profiling of 'long long' in FoldingSet, then use it to
fix TBAA violation in profiling of pointers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284336 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-16 17:49:09 +00:00
Craig Topper
3a558dd477 [AVX-512] Fix the operand order for vpermi2var_qi intrinsics to match the other vpermi2var intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284329 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-16 04:54:35 +00:00
Craig Topper
bc745ca586 [AVX-512] Correct execution domain for VPERMT2PS and VPERMI2PS.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284328 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-16 04:54:31 +00:00
Craig Topper
91d1efb47d [AVX-512] Move (v4i64 (X86SubVBroadcast (v2i64))) alternate patterns under a HasVLX predicate. Similar for floating point.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284327 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-16 04:54:26 +00:00
Davide Italiano
078218d48a [ArmFastISel] Kill dead code. NFCI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284320 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-16 01:09:39 +00:00
Konstantin Zhuravlyov
a7e2c08af2 [MachineMemOperand] Move synchronization scope and atomic orderings from SDNode to MachineMemOperand, and remove redundant getAtomic* member functions from SelectionDAG.
Differential Revision: https://reviews.llvm.org/D24577


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284312 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-15 22:01:18 +00:00
Davide Italiano
37bd2b7dbf [GVN/PRE] Hoist global values outside of loops.
In theory this could be generalized to move anything where
we prove the operands are available, but that would require
rewriting PRE. As NewGVN will hopefully come soon, and we're
trying to rewrite PRE in terms of NewGVN+MemorySSA, it's probably
not worth spending too much time on it. Fix provided by
Daniel Berlin!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284311 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-15 21:35:23 +00:00
Simon Pilgrim
f379cd301d [X86][SSE] Added some basic examples of knownbits failing for vector types
computeKnownBits only returns the common bits of each vector element instead of only the elements that are actually used

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284308 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-15 19:29:26 +00:00
Li Huang
edc73e8b9c Test commit. (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284307 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-15 19:00:04 +00:00
Simon Pilgrim
fa081aac65 [X86] Regenerate known bits test
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284306 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-15 18:56:38 +00:00
Craig Topper
180beb4eef [AVX-512] Add shuffle comments for vbroadcast instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284305 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-15 16:26:07 +00:00
Craig Topper
b4458f901c [AVX-512] Rename VPBROADCASTI32X2 and VPBROADCASTF32X2 instruction classes to match the mnemonic which does not include a 'P'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284304 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-15 16:26:02 +00:00
Benjamin Kramer
6cceb12d56 [SimplifyCFG] Use the error checking provided by getPrevNode.
BasicBlock::size is O(insts), making this loop O(blocks*insts), which
can be really slow on generated code. getPrevNode already checks if
we're at the beginning of the block and returns nullptr if so, just use
that instead. No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284303 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-15 13:15:05 +00:00
Kostya Serebryany
ce6100541e [libFuzzer] swap bytes in integers when handling CMP traces
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284301 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-15 04:00:07 +00:00
Kostya Serebryany
75281e6436 [libFuzzer] better algorithm for -minimize_crash
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284299 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-15 01:00:24 +00:00
Tom Stellard
6b339ba8ac AMDGPU/SI: Handle s_getreg hazard in GCNHazardRecognizer
Reviewers: arsenm

Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, llvm-commits, tony-tye

Differential Revision: https://reviews.llvm.org/D25526

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284298 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-15 00:58:14 +00:00
Justin Bogner
0746b2bf3d ADT: Use LLVM_NODISCARD instead of LLVM_ATTRIBUTE_UNUSED_RESULT for APInt
Instead of annotating (most of) the APInt API, we can just annotate
the type directly. This is less code and it will warn in more cases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284297 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-15 00:22:06 +00:00
Evgeny Astigeevich
d6dc1be787 [NFC] Loop Versioning for LICM code clean up
- Removed unused class members.
- Made class internal data private.
- Made class scoped data function scoped where it's possible.
- Replace naked new/delete with unique_ptr.
- Made resources guaranteed to be freed.

Differential Revision: https://reviews.llvm.org/D25464


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284290 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 23:00:36 +00:00
Tim Northover
ee325b9e96 GlobalISel: rename legalizer components to match others.
The previous names were both misleading (the MachineLegalizer actually
contained the info tables) and inconsistent with the selector & translator (in
having a "Machine") prefix. This should make everything sensible again.

The only functional change is the name of a couple of command-line options.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284287 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 22:18:18 +00:00
Justin Bogner
6a2dc096c9 Support: Add LLVM_NODISCARD with C++17's [[nodiscard]] semantics
This is essentially a more powerful version of our current
LLVM_ATTRIBUTE_UNUSED_RESULT, in that it can also be applied to types
and generate warnings whenever an object of that type is returned by
value and the value is discarded.

I'll replace uses of LLVM_ATTRIBUTE_UNUSED_RESULT and remove that
macro in follow up commits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284286 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 22:04:17 +00:00
Mehdi Amini
cb11533e7b hardware_physical_concurrency() should return 1 when LLVM is built with LLVM_ENABLE_THREADS=OFF
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284283 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 21:32:35 +00:00
Tim Northover
31164bc2c9 PowerPC: specify full triple to avoid different Darwin asm syntax.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284281 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 21:25:29 +00:00
Sanjay Patel
6262732897 [ARM] add tests for PR30660
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284280 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 20:52:43 +00:00
Sanjay Patel
65a7ee43be [PowerPC] add tests for PR30661
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284279 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 20:51:41 +00:00
Guozhi Wei
8bb12b9f5e [PPC] Shorter sequence to load 64bit constant with same hi/lo words
This is a patch to implement pr30640.

When a 64bit constant has the same hi/lo words, we can use rldimi to copy the low word into high word of the same register.

This optimization caused failure of test case bperm.ll because of not optimal heuristic in function SelectAndParts64. It chooses AND or ROTATE to extract bit groups from a register, and OR them together. This optimization lowers the cost of loading 64bit constant mask used in AND method, and causes different code sequence. But actually ROTATE method is better in this test case. The reason is in ROTATE method the final OR operation can be avoided since rldimi can insert the rotated bits into target register directly. So this patch also enhances SelectAndParts64 to prefer ROTATE method when the two methods have same cost and there are multiple bit groups need to be ORed together.

Differential Revision: https://reviews.llvm.org/D25521



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284276 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 20:41:50 +00:00
Kostya Serebryany
58313a9d67 [libFuzzer] remove subdir fuzzer-test-suite as it is now superseded with https://github.com/google/fuzzer-test-suite
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284275 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 20:26:40 +00:00
Kostya Serebryany
3af68729f8 [libFuzzer] add -trace_cmp=1 (guiding mutations based on the observed CMP instructions). This is a reincarnation of the previously deleted -use_traces, but using a different approach for collecting traces. Still a toy, but at least it scales well. Also fix -merge in trace-pc-guard mode
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284273 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 20:20:33 +00:00
Saleem Abdulrasool
775adebaec vim: add norecurse attribute
Add missing attribute to the keyword set.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284270 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 19:48:34 +00:00
Saleem Abdulrasool
59cf785a62 vim: add comdat keyword
The attribute may be applied to a function.  Highlight it as a keyword.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284269 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-14 19:48:31 +00:00