143544 Commits

Author SHA1 Message Date
Eugene Zelenko
13bc67e541 [Target, Transforms] Fix some Clang-tidy modernize and Include What You Use warnings; other minor fixes (NFC).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292320 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-18 00:57:48 +00:00
Kostya Serebryany
4fc16710d9 [libFuzzer] exit(1) on failed merge
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292319 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-18 00:55:29 +00:00
Kostya Serebryany
26071eb844 [libFuzzer] better link for trophies
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292318 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-18 00:45:02 +00:00
Justin Lebar
dc30ded6fb [NVPTX] Support global variables of integer type larger than i64.
Reviewers: tra, majnemer

Subscribers: llvm-commits, jholewinski

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292316 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-18 00:29:53 +00:00
Xin Tong
9d29b66e65 2 returns next to each other =). NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292315 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-18 00:26:17 +00:00
Xin Tong
9256b5bcb4 Skip loop header while we can when computing loop safety info
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292310 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-18 00:15:11 +00:00
Eric Fiselier
38777f9b26 [LIT] Make util.executeCommand python3 friendly
Summary: The parameter `input` to `subprocess.Popen.communicate(...)` must be an object of type `bytes` . This is strictly enforced in python3. This patch (1) allows `to_bytes` to be safely called redundantly. (2) Explicitly convert `input` within `executeCommand`. This allows for usages like `executeCommand(['clang++', '-'], input='int main() {}\n')`.

Reviewers: ddunbar, BinaryKhaos, modocache, dim, EricWF

Reviewed By: EricWF

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292308 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-18 00:12:41 +00:00
Justin Lebar
fb0c1c5701 [NVPTX] Standardize asm printer on "foo \tbar".
Some instructions were printed as "foo\tbar", but most are printed as
"foo \bar".  Standardize on the latter form.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292306 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-18 00:09:36 +00:00
Justin Lebar
0e8415fe03 [NVPTX] Clean up nested !strconcat calls.
!strconcat is a variadic function; it will concatenate an arbitrary
number of strings.  There's no need to nest it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292305 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-18 00:09:19 +00:00
Justin Lebar
db8ecafe57 [NVPTX] Implement min/max in tablegen, rather than with custom DAGComine logic.
Summary:
This change also lets us use max.{s,u}16.  There's a vague warning in a
test about this maybe being less efficient, but I could not come up with
a case where the resulting SASS (sm_35 or sm_60) was different with or
without max.{s,u}16.  It's true that nvcc seems to emit only
max.{s,u}32, but even ptxas 7.0 seems to have no problem generating
efficient SASS from max.{s,u}16 (the casts up to i32 and back down to
i16 seem to be implicit and nops, happening via register aliasing).

In the absence of evidence, better to have fewer special cases, emit
more straightforward code, etc.  In particular, if a new GPU has 16-bit
min/max instructions, we want to be able to use them.

Reviewers: tra

Subscribers: jholewinski, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292304 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-18 00:09:01 +00:00
Justin Lebar
f78819e87f [NVPTX] Lower integer absolute value idiom to abs instruction.
Summary: Previously we lowered it literally, to shifts and xors.

Reviewers: tra

Subscribers: jholewinski, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292303 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-18 00:08:44 +00:00
Justin Lebar
38c1089801 [NVPTX] Improve lowering of llvm.ctpop.
Summary:
Avoid an unnecessary conversion operation when using the result of
ctpop.i32 or ctpop.i16 as an i32, as in both cases the ptx instruction
we run returns an i32.

(Previously if we used the value as an i32, we'd do an unnecessary
zext+trunc.)

Reviewers: tra

Subscribers: jholewinski, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292302 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-18 00:08:27 +00:00
Justin Lebar
7470b2cf62 [NVPTX] Add lowering for llvm.bitreverse.
Reviewers: tra

Subscribers: llvm-commits, jholewinski

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292301 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-18 00:08:10 +00:00
Justin Lebar
9ff5ce49a6 [NVPTX] Fix function names in ctlz.ll test. Test-only change.
Looks like a copy/paste mistake, all the functions in ctlz.ll were named
"ctpop".

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292300 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-18 00:07:52 +00:00
Justin Lebar
fd46a6b819 [NVPTX] Improve lowering of llvm.ctlz.
Summary:
* Disable "ctlz speculation", which inserts a branch on every ctlz(x) which
  has defined behavior on x == 0 to check whether x is, in fact zero.

* Add DAG patterns that avoid re-truncating or re-expanding the result
  of the 16- and 64-bit ctz instructions.

Reviewers: tra

Subscribers: llvm-commits, jholewinski

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292299 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-18 00:07:35 +00:00
Justin Lebar
be4d3e02f9 [IR] Grammar police: "intact" is one word. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292298 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-18 00:07:18 +00:00
Sanjay Patel
bf51c92663 [InstCombine] add tests to show missed shrinkage; NFC
A patch to partially solve this:
https://reviews.llvm.org/D28625


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292296 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-18 00:03:23 +00:00
Kostya Serebryany
0f463958d8 [libFuzzer] add ATTRIBUTE_NO_SANITIZE_MEMORY to sanitizer hooks
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292295 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 23:50:21 +00:00
Dehao Chen
f519872cb6 Introduce -unroll-partial-threshold to separate PartialThreshold from Threshold in loop unorller.
Summary: Partial unrolling should have separate threshold with full unrolling.

Reviewers: efriedma, mzolotukhin

Reviewed By: efriedma, mzolotukhin

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292293 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 23:39:33 +00:00
Wei Mi
caab16e99a [RegisterCoalescing] Remove partial redundent copy.
The patch is to solve the performance problem described in PR27827.
Register coalescing sometimes cannot remove a copy because of interference.
But if we can find a reverse copy in one of the predecessor block of the copy,
the copy is partially redundent and we may remove the copy partially by moving
it to the predecessor block without the reverse copy.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292292 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 23:39:07 +00:00
Mehdi Amini
84b54a1994 Fix GettingStarted doc so that the example build command for cmake LLVM_ENABLE_PROJECTS works on linux
I tested the previous one on macOS, however building libc++ on Linux
requires libcxxabi as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292290 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 23:23:08 +00:00
Mike Aizatsky
56992074d3 [libfuzzer] fixing collected pc addresses for coverage
Summary: The causes google/ossfuzz#84

Reviewers: kcc

Subscribers: mgorny

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292289 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 23:11:32 +00:00
Zachary Turner
974466a9b8 [ADT] Add SparseBitVector::find_last().
Differential Revision: https://reviews.llvm.org/D28817

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292288 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 23:09:21 +00:00
Kostya Serebryany
db5325aae3 [libFuzzer] use table of recent compares for memcmp/strcmp (to unify the code between cmp and memcmp handling)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292287 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 23:09:05 +00:00
Kostya Serebryany
d4ebdc15e5 [libFuzzer] copy the options inside MutationDispatcher to avoid use-after-scope in mutator tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292286 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 23:05:07 +00:00
Tim Northover
f4d04d46f8 GlobalISel: fix comparison order for G_FCMP
As with G_ICMP we'd written the CSET instructions backwards.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292285 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 23:04:01 +00:00
Tim Northover
dfa332f927 GlobalISel: add callseq instructions to record stack usage
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292284 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 22:43:34 +00:00
Tim Northover
244264d050 GlobalISel: correctly handle varargs
Some platforms (notably iOS) use a different calling convention for unnamed vs
named parameters in varargs functions, so we need to keep track of this
information when translating calls.

Since not many platforms are involved, the guts of the special handling is in
the ValueHandler class (with a generic implementation that should work for most
targets).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292283 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 22:30:10 +00:00
Chandler Carruth
1d3f42922c [LoopDeletion] (cleanup, NFC) Use the dedicated helper to get a single
unique exit block if available rather than rolling it ourselves.

This is a little disappointing because that helper doesn't do anything
clever to short-circuit the (surprisingly expensive) computation of all
exit blocks. What's worse is that the way we compute this is hopelessly,
hilariously inefficient. We're literally computing the same information
two different ways and multiple times each way:
- hasDedicatedExits computes the exit block set and then looks at the
  predecessors of each
- getExitingBlocks computes the set of loop blocks which have exiting
  successors
- getUniqueExitBlock(s) computes the set of non-loop blocks reached from
  loop blocks (sound familiar?)

Anyways, at some point we should clean all of this up in the LoopInfo
API, but for now just simplifying the user I'm about to touch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292282 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 22:28:52 +00:00
Matthew Simpson
1b2cd634db [LV] Add requires asserts to test case
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292280 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 22:21:33 +00:00
Chandler Carruth
57a16bcd94 [LoopDeletion] (cleanup, NFC) Fix another variable name to match LLVM
conventions, missed this one in a previous cleanup patch (sorry).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292279 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 22:19:56 +00:00
Tim Northover
df7385e86c [GlobalISel] track predecessor mapping during switch lowering.
Correctly populating Machine PHIs relies on knowing exactly how the IR level
CFG was lowered to MachineIR. This needs to be tracked by any translation
phases that meddle (currently only SwitchInst handling).

This reapplies r291973 which was reverted because of testing failures. Fixes:

 + Don't return an ArrayRef to a local temporary.
 + Incorporate Kristof's suggested comment improvements.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292278 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 22:13:50 +00:00
Simon Pilgrim
d3e09ec899 [X86][SSE] Split UMIN and UMAX known bits tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292277 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 22:12:25 +00:00
Chandler Carruth
ebd934178e [LoopDeletion] (cleanup, NFC) Remove a pointless comment.
I hope that for any code, it is changed only with good reason and only
when the author knows what they are doing...

There is of course good reason to comment here about the subtlety of the
process, and I've left that comment in tact.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292275 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 22:09:28 +00:00
Chandler Carruth
70e0d713b2 [LoopDeletion] (cleanup, NFC) Make simple helper functions static
instead of members.

No state was being provided by the object so this seems strictly
simpler.

I've also tried to improve the name and comments for the functions to
more thoroughly document what they are doing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292274 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 22:07:26 +00:00
Chandler Carruth
40d8cc12dd [LoopDeletion] (cleanup, NFC) Stop passing around reference to a vector
that we know has exactly one element when all we are going to do is get
that one element out of it.

Instead, pass around that one element.

There are more simplifications to come in this code...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292273 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 22:00:52 +00:00
Chandler Carruth
067ba90db4 [PM] Clean up variable and parameter names to match modern LLVM naming
conventions more conistently before hacking on this code to integrate
nicely with new PM's loop pass infrastructure. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292272 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 21:51:39 +00:00
Aaron Ballman
e38a9b5204 Silence some Sphinx diagnostics in an attempt to get the documentation builder back to green (http://lab.llvm.org:8011/builders/llvm-sphinx-docs/builds/1895).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292271 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 21:48:31 +00:00
Xin Tong
985d6ae2d4 Add a test case for LICM when promoting locals that may be read after the throw within the loop. NFCI.
Summary: Add a test case for LICM when promoting locals that may be read after the throw within the loop.

Reviewers: eli.friedman, hfinkel, sanjoy

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292261 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 21:26:36 +00:00
Sanjay Patel
eaad74d604 [InstCombine] refactor foldICmpShlConstant(); NFCI
This reduces the size of and increases the symmetry with the planned functional change in:
https://reviews.llvm.org/D28406


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292260 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 21:25:16 +00:00
Alexei Starovoitov
a6fcb69f28 [bpf] fix stack-use-after-scope
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292258 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 21:14:00 +00:00
Vitaly Buka
73275fd4d0 Enabled -fsanitize-address-use-after-scope for -DLLVM_USE_SANITIZER=Address
Subscribers: mgorny, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292256 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 21:04:23 +00:00
Michal Gorny
e3aa75949b [cmake] Update SOVERSION for the new versioning scheme
Update SOVERSION to use just the major version number rather than
major+minor, to match the new versioning scheme where only major is used
to indicate API/ABI version.

Since two-digit SOVERSIONs were introduced post 3.9 branching, this
change does not risk any SOVERSION collisions. In the past,
two-component X.Y SOVERSIONs were shortly used but those will not
interfere with the new ones since the new versions start at 4.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292255 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 21:04:19 +00:00
Matthew Simpson
caab3a817f [LV] Mark non-consecutive-like pointers non-uniform
If a memory instruction will be vectorized, but it's pointer operand is
non-consecutive-like, the instruction is a gather or scatter operation. Its
pointer operand will be non-uniform. This should fix PR31671.

Reference: https://llvm.org/bugs/show_bug.cgi?id=31671
Differential Revision: https://reviews.llvm.org/D28819

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292254 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 20:51:39 +00:00
Dan Gohman
c67238a892 [WebAssembly] Add triple support for the new wasm object format
Differential Revision: https://reviews.llvm.org/D26701


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292252 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 20:34:09 +00:00
Xin Tong
ecf1f1111b Rename scalar_promote.ll to scalar-promote.ll and scalar_promote-unwind.ll to scalar-promote-unwind.ll. NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292251 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 20:28:36 +00:00
Xin Tong
26415f8340 Refactor out LoopInfo computation so that it can be used by
other test cases.

Summary: Refactor out LoopInfo computation so that it can be
used by other test cases.

So i am changing this test proactively for later commit, which will use
this function.

Reviewers: sanjoy, hfinkel

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292250 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 20:24:39 +00:00
Sanjoy Das
90b7e38b05 [EarlyCSE] Don't DSE across readnone functions that may throw
Summary: Depends on D28740

Reviewers: dberlin, chandlerc, hfinkel, majnemer

Subscribers: mcrosier, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292249 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 20:15:47 +00:00
Sanjay Patel
e9d3b46a1d [InstCombine] add tests for shl nsw + icmp sle; NFC
We want to handle these cases similarly to icmp sgt, so add the tests for it.
See: https://reviews.llvm.org/D28406


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292248 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 20:15:26 +00:00
Ahmed Bougacha
bf5fc97eca [TLI] Appease spurious MSVC warning using llvm_unreachable. NFC.
r292188 confused MSVC because of the combined lack of a default
case and return statement.

Move the unreachable outside of the NumLibFuncs case, to make it
obvious that all cases should be handled.

llvm_unreachable is __declspec(noreturn), so I'm assuming this
does appease MSVC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292246 91177308-0d34-0410-b5e6-96231b3b80d8
2017-01-17 19:54:18 +00:00