133405 Commits

Author SHA1 Message Date
Teresa Johnson
875352d9b1 [ThinLTO/gold] Enable summary-based internalization
Summary: Enable existing summary-based importing support in the gold-plugin.

Reviewers: mehdi_amini

Subscribers: llvm-commits, mehdi_amini

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272239 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-09 01:14:13 +00:00
Sanjoy Das
0c3d257062 Minor clean up in loopHasNoAbnormalExits; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272238 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-09 01:14:03 +00:00
Sanjoy Das
05c5b3fd8e Be wary of abnormal exits from loop when exploiting UB
We can safely rely on a NoWrap add recurrence causing UB down the road
only if we know the loop does not have a exit expressed in a way that is
opaque to ScalarEvolution (e.g. by a function call that conditionally
calls exit(0)).

I believe with this change PR28012 is fixed.

Note: I had to change some llvm-lit tests in LoopReroll, since it looks
like they were depending on this incorrect behavior.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272237 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-09 01:13:59 +00:00
Sanjoy Das
ec34b02b63 Factor out a loopHasNoAbnormalExits; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272236 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-09 01:13:54 +00:00
Richard Smith
0eeb3d4004 Search for llvm-symbolizer binary in the same directory as argv[0], before
looking for it along $PATH. This allows installs of LLVM tools outside of
$PATH to find the symbolizer and produce pretty backtraces if they crash.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272232 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-09 00:53:21 +00:00
Reid Kleckner
14f9bce989 [codeview] Skip DIGlobalVariables with no variable
They have probably been discarded during optimization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272231 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-09 00:29:00 +00:00
Zachary Turner
22ca3e86a7 [pdbdump-fuzzer] Try to fix build errors in fuzzer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272230 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-09 00:21:37 +00:00
Rui Ueyama
6ec1d4e8bf [pdbdump] Verify part of TPI hash streams.
TPI hash table contains a parallel array for the type records.
For each type record R, a hash value is calculated by `H(R) % NumBuckets`
where H is a hash function, and the result is stored to a bucket element.
H is TPI1::hashPrec function in microsoft-pdb repository.

Our hash function does not support all type record types yet.
Currently it supports only records for line number.
I'll extend it in a follow up patch.

The aim of verify the hash table is not only detect corrupted files.
It ensures that our understanding of how the hash values are calculated
is correct.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272229 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-09 00:10:19 +00:00
Alina Sbirlea
1ad4b76720 [cpu-detection] Add missing break statements in outer switches
Summary:
Break on all switch cases for outer and inner switches.
No functionality changed.

Reviewers: llvm-commits, sanjoy

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272228 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-09 00:08:15 +00:00
Quentin Colombet
c4f21c06ed [MIR] Check that generic virtual registers get a size.
Without that check it was possible to write test cases where the size
was not specified and we ended up with weird asserts down the road,
because the default value (1) would not make sense.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272226 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 23:27:46 +00:00
Rui Ueyama
45d1685851 Function names should start with lowercase letters.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272225 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 23:15:09 +00:00
Michael Zolotukhin
92be720123 [LoopSimplify] Preserve LCSSA when merging exit blocks.
Summary:
This fixes PR26682. Also add LCSSA as a preserved pass to LoopSimplify,
that looks correct to me and allows to write a test for the issue.

Reviewers: chandlerc, bogner, sanjoy

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272224 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 23:13:21 +00:00
Rui Ueyama
dc32f35c68 [PDB] Move PDB functions to a separate file.
We are going to use the hash functions from TPI streams.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272223 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 23:11:14 +00:00
Michael Zolotukhin
1ead23957a [LoopUnroll] Check that DT is available before trying to verify it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272221 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 22:49:59 +00:00
Chris Bieneman
c923d84c1f [CMake] Cleanup version check for 2.8.11
We are always greater than CMake 2.8.11, so we don't need this check.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272220 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 22:48:12 +00:00
Chris Bieneman
091ea8a7a1 [CMake] Cleanup version check for 2.8.12
Since we're always greater than 2.8.12, we don't need this check anymore.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272219 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 22:48:01 +00:00
Chris Bieneman
b6da4b89f3 [CMake] Cleanup version checks for CMake 3.0
This just removes some redundant checks and updates warning text.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272218 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 22:38:30 +00:00
Justin Bogner
578e573655 cmake: Simplify add_lit_testsuites
cmake 3.4 introduced LIST_DIRECTORIES to glob recurse, which can be
used to simplify this code greatly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272217 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 22:36:37 +00:00
Chris Bieneman
0fd0a998e1 [CMake] Cleanup uses of USES_TERMINAL
Now that we are on CMake 3.4.3 we no longer need a version check around this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272211 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 22:19:25 +00:00
Quentin Colombet
dd92905160 [RegBankSelect] Print out the actual mapping of the operands.
This improves the debuggability of the pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272210 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 21:55:30 +00:00
Quentin Colombet
1d9903f754 [RegBankSelect] Remove a debug print of a potentially dead instruction.
For complex rewrittings, which do not occur currently, the related
machine instruction may have been deleted in the process. Therefore, do
not try to print it after the mapping is applied.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272209 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 21:55:29 +00:00
Quentin Colombet
dd694f3ed6 [RegisterBankInfo] Avoid code duplication in OperandsMapper for the computation of the end of range.
Refactor the code so that we do not compute in two different places the
end iterator for the range of new virtual registers for a given operand.
Although this refactoring was intended as NFC, this is not the case
because it actually fixes a bug where we were returning a range off by 1
(too long). Right now, this could not result in an actual bug because we
were accessing this range via the BreakDown size of the related operand.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272208 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 21:55:26 +00:00
Quentin Colombet
d36db423b8 [RegisterBankInfo] Add dump/print methods for OperandsMapper.
Improve debuggability of the OperandsMapper helper class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272207 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 21:55:23 +00:00
Michael Zolotukhin
f716842ee3 [SLPVectorizer] Handle GEP with differing constant index types
Summary:
This fixes PR27617.

Bug description: The SLPVectorizer asserts on encountering GEPs with different index types, such as i8 and i64.

The patch includes a simple relaxation of the assert to allow constants being of different types, along with a regression test that will provoke the unrelaxed assert.

Reviewers: nadav, mzolotukhin

Subscribers: JesperAntonsson, llvm-commits, mzolotukhin

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

Patch by Jesper Antonsson!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272206 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 21:55:16 +00:00
Davide Italiano
5b20b56122 [PM] Add missing caching of GlobalsAA to EarlyCSE.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272204 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 21:31:55 +00:00
Dehao Chen
8153f63460 Revive http://reviews.llvm.org/D12778 to handle forward-hot-prob and backward-hot-prob consistently.
Summary:
Consider the following diamond CFG:

 A
/ \
B C
 \/
 D

Suppose A->B and A->C have probabilities 81% and 19%. In block-placement, A->B is called a hot edge and the final placement should be ABDC. However, the current implementation outputs ABCD. This is because when choosing the next block of B, it checks if Freq(C->D) > Freq(B->D) * 20%, which is true (if Freq(A) = 100, then Freq(B->D) = 81, Freq(C->D) = 19, and 19 > 81*20%=16.2). Actually, we should use 25% instead of 20% as the probability here, so that we have 19 < 81*25%=20.25, and the desired ABDC layout will be generated.

Reviewers: djasper, davidxl

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272203 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 21:30:12 +00:00
Chris Bieneman
e06e7e3e9f [CMake] Fixing a typo
This was called out on the list a long time ago and just got pointed out to me again. Need to fix it before I forget.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272201 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 21:22:03 +00:00
Chris Bieneman
eb5b5d9f14 [CMake] Support overriding binary install directory
This patch adds a new option LLVM_TOOLS_INSTALL_DIR which allows customizing the location executables and symlinks get installed to. This adds the functionality provided by autoconf's --bindir flag.

This patch is based on patches from and collaboration with Tony Kelman, and replaces http://reviews.llvm.org/D20934.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272200 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 21:19:26 +00:00
Sanjay Patel
5d0ca71de5 [InstCombine] move fold of select of add/sub to helper function; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272199 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 21:10:01 +00:00
Reid Kleckner
3d3aca2d97 [DebugInfo] Add calling convention support for DWARF and CodeView
Summary:
Now DISubroutineType has a 'cc' field which should be a DW_CC_ enum.  If
it is present and non-zero, the backend will emit it as a
DW_AT_calling_convention attribute. On the CodeView side, we translate
it to the appropriate enum for the LF_PROCEDURE record.

I added a new LLVM vendor specific enum to the list of DWARF calling
conventions. DWARF does not appear to attempt to standardize these, so I
assume it's OK to do this until we coordinate with GCC on how to emit
vectorcall convention functions.

Reviewers: dexonsmith, majnemer, aaboud, amccarth

Subscribers: mehdi_amini, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272197 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 20:34:29 +00:00
Sanjay Patel
2ae3d2cd86 [InstCombine] fix outdated comment, simplify logic; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272196 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 20:31:52 +00:00
Evgeny Stupachenko
3cb6afa22a The patch set unroll disable pragma when unroll
with user specified count has been applied.

Summary:
Previously SetLoopAlreadyUnrolled() set the disable pragma only if
there was some loop metadata.
Now it set the pragma in all cases. This helps to prevent multiple
unroll when -unroll-count=N is given.

Reviewers: mzolotukhin

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

From: Evgeny Stupachenko <evstupac@gmail.com>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272195 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 20:21:24 +00:00
Xinliang David Li
8c60b4112d [PM] Refector LoopAccessInfo analysis code
This is the preparation patch to port the analysis to new PM

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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272194 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 20:15:37 +00:00
Sanjay Patel
0406782714 [InstCombine] reduce indent; NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272193 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 20:09:04 +00:00
Tim Shen
c4d0eaa0ba [MemCpyOpt] Do not exchange llvm.lifetime.start and llvm.memcpy
Reviewers: iteratee

Subscribers: llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272192 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 19:42:32 +00:00
Sanjay Patel
0a41b20ac6 [InstCombine] use copyIRFlags() ; NFCI
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272191 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 19:33:52 +00:00
Benjamin Kramer
36538ffe93 Apply most suggestions of clang-tidy's performance-unnecessary-value-param
Avoids unnecessary copies. All changes audited & pass tests with asan.
No functional change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272190 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 19:09:22 +00:00
Adrian McCarthy
fa4edba0da Generate codeview for array type metadata.
Differential Revision: http://reviews.llvm.org/D21107

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272187 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 18:22:59 +00:00
Benjamin Kramer
4fb8b608a6 [CodeView] Remove manual expansion of the default copy ctor.
It provides nothing over the default one but makes the class not
trivially copyable. No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272186 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 18:19:38 +00:00
George Burgess IV
05f452d9a1 Attempt #2 to appease the buildbots.
MSVC calls the copy ctor on StratifiedSets for some reason. So,
undelete it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272184 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 17:56:35 +00:00
Reid Kleckner
d3fa84042c [codeview] Avoid emitting an empty file checksum table
Again, the Microsoft linker does not like empty substreams.

We still emit an empty string table if CodeView is enabled, but that
doesn't cause problems because it always contains at least one null
byte.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272183 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 17:50:29 +00:00
Sanjoy Das
8999baf434 [SCEV] Break out of loop if there is no more work to do
This is NFC as far as externally visible behavior is concerned, but will
keep us from spinning in the worklist traversal algorithm unnecessarily.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272182 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 17:48:46 +00:00
Sanjoy Das
27dabd2db6 [SCEV] Track no-abnormal-exits instead of no-throw calls
Absence of may-unwind calls is not enough to guarantee that a
UB-generating use of an add-rec poison in the loop latch will actually
cause UB.  We also need to guard against calls that terminate the thread
or infinite loop themselves.

This partially addresses PR28012.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272181 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 17:48:42 +00:00
Sanjoy Das
39ede080e2 Teach isGuarantdToTransferExecToSuccessor about debug info intrinsics
Calls to `@llvm.dbg.*` can be assumed to terminate.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272180 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 17:48:36 +00:00
Sanjoy Das
e118351c7e Fix a bug in SCEV's poison value propagation
The worklist algorithm introduced in rL271151 didn't check to see if the
direct users of the post-inc add recurrence propagates poison.  This
change fixes the problem and makes the code structure more obvious.

Note for release managers: correctness wise, this bug wasn't a
regression introduced by rL271151 -- the behavior of SCEV around
post-inc add recurrences was strictly improved (in terms of correctness)
in rL271151.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272179 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 17:48:31 +00:00
Quentin Colombet
76354c5724 [RegBankSelect] Silence an unused variable warning in release mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272177 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 17:39:47 +00:00
Quentin Colombet
4eb9d7cdeb [RegBankSelect] Comment on how we could improve repairing with copies.
When repairing with a copy, instead of accounting for the cost of that
copy and actually inserting it, we may be able to use an alternative
source for the register to repair and just use it.

Make sure this is documented, so that we consider that opportunity at
some point.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272176 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 17:39:43 +00:00
Zachary Turner
47b89fc720 [pdb] Fix build errors in PDB unit tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272174 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 17:32:25 +00:00
George Burgess IV
6f686563fd Try to appease buildbots.
r272064 apparently made them angry. This undoes some changes made in
r272064 (defaulting move ctors) to make them happy again.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272173 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 17:27:14 +00:00
Zachary Turner
99272168e0 [pdb] Handle stream index errors better.
Reviewed By: ruiu
Differential Revision: http://reviews.llvm.org/D21128

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272172 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-08 17:26:39 +00:00