Commit Graph

133376 Commits

Author SHA1 Message Date
Jan Vesely
406c47ff89 SelectionDAG: Implement expansion of {S,U}MIN/MAX in integer legalization
Fixes {u,}long_{min,max,clamp} opencl piglit regressions on EG.

Reviewers: arsenm
Differential Revision: http://reviews.llvm.org/D17898

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272272 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-09 16:04:00 +00:00
Hans Wennborg
5fe52b9fdf PDB/Raw/Hash.h: try to fix VS2013 build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272269 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-09 15:33:06 +00:00
Haicheng Wu
c4f2258852 Reapply "[MBP] Reduce code size by running tail merging in MBP.""
This reapplies commit r271930, r271915, r271923.  They hit a bug in
Thumb which is fixed in r272258 now.

The original message:

The code layout that TailMerging (inside BranchFolding) works on is not the
final layout optimized based on the branch probability. Generally, after
BlockPlacement, many new merging opportunities emerge.

This patch calls Tail Merging after MBP and calls MBP again if Tail Merging
merges anything.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272267 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-09 15:24:29 +00:00
Ulrich Weigand
09f4ea27b7 [SystemZ] Enable long displacement constraints for inline ASM operands
This enables use of the 'S' constraint for inline ASM operands on
SystemZ, which allows for a memory reference with a signed 20-bit
immediate displacement. This patch includes corresponding documentation
and test case updates.

I've changed the 'T' constraint to match the new behavior for 'S', as
'T' also uses a long displacement (though index constraints are still
not implemented). I also changed 'm' to match the behavior for 'S' as
this will allow for a wider range of displacements for 'm', though
correct me if that's not the right decision.

Author: colpell
Differential Revision: http://reviews.llvm.org/D21097



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272266 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-09 15:19:16 +00:00
Davide Italiano
cbf7512550 Move stackguard test to X86/ directory as it's not generic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272264 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-09 15:16:58 +00:00
Davide Italiano
cb6cf5b6ec [CodeGen] Change getSDagStackGuard to get an internal sym.
Fixes a crash in the backend during an LTO build of rtld(1) in
FreeBSD.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272262 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-09 14:23:38 +00:00
Hrvoje Varga
221d208604 [mips][microMIPS] Implement BOVC, BNVC, EXT, INS and JALRC instructions
Differential Revision: http://reviews.llvm.org/D11798


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272259 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-09 12:57:23 +00:00
James Molloy
fe8f3cffbd [Thumb] A branch is not part of an IT block
ReplaceTailWithBranchTo assumed that if an instruction is predicated, it must be part of an IT block. This is not correct for conditional branches.

No testcase as this was triggered by the reverted patch r272017 - test coverage will occur when that patch is re-reverted and there is no known way to trigger this in the meantime.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272258 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-09 11:51:29 +00:00
Igor Breger
de21197e48 [AVX512] Remove masked_move/blendm intrinsic from back-end.
This is complement patch to D21060.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272257 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-09 11:46:55 +00:00
Zlatko Buljan
2edd549258 [mips][microMIPS] Add CodeGen support for SEL.*, SELEQZ, SELNEZ, SELEQZ.*, SELNEZ.* and CMP.condn.fmt instructions
Differential Revision: http://reviews.llvm.org/D20862


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272256 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-09 11:15:53 +00:00
Sam Kolton
eb66787999 [AMDGPU] Disassembler: Support for sdwa instructions
Reviewers: vpykhtin, tstellarAMD

Subscribers: arsenm, kzhuravl

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272255 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-09 11:04:45 +00:00
Diana Picus
1063f931d5 [llc] Remove exit-on-error flag from MIR tests (PR27770)
This is made possible by removing an assert in llc that assumed
MIRParser::parseLLVMModule would exit on error. MIRParser's documentation states
that it returns null if a parsing error occurs, so there's no reason to assert.
We can instead just fall through to where the check for a module is performed
and exit if it is null.

This commit is part of the clean-up after r269655.

Fixes PR27770

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272254 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-09 10:31:05 +00:00
Craig Topper
b867bf3ea9 [AVX512] Fix shuffle decode printing for several instructions with write masks. There are still more bugs here with UNPCK and PALIGN for sure. But these were the easiest ones to fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272252 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-09 07:49:08 +00:00
James Molloy
95709cad3b [Thumb] Select a BIC instead of AND if the immediate can be encoded more optimally negated
If an immediate is only used in an AND node, it is possible that the immediate can be more optimally materialized when negated. If this is the case, we can negate the immediate and use a BIC instead;

  int i(int a) {
    return a & 0xfffffeec;
  }

Used to produce:
    ldr r1, [CONSTPOOL]
    ands r0, r1
  CONSTPOOL: 0xfffffeec

And now produces:
    movs    r1, #255
    adds    r1, #20  ; Less costly immediate generation
    bics    r0, r1

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272251 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-09 07:39:08 +00:00
Craig Topper
cadff981d8 [X86] Fix a test I failed to re-generate in r272249.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272250 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-09 07:10:34 +00:00
Craig Topper
1b683873d6 [X86] Bring consistent naming to the SSE/AVX and AVX512 PALIGNR instructions. Then add shuffle decode printing for the EVEX forms which is made easier by having the naming structure more similar to other instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272249 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-09 07:06:38 +00:00
Craig Topper
d7bd8be924 [X86] Fix bad comment in assert. NFC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272248 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-09 07:06:33 +00:00
Xinliang David Li
035a5a9202 Revert r272194 No need for it if loop Analysis Manager is used
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272243 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-09 03:22:39 +00:00
Saleem Abdulrasool
ecb6658e47 test: fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272242 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-09 03:14:32 +00:00
Saleem Abdulrasool
d389f8dd86 AArch64: support the .arch directive in the IAS
Add support to the AArch64 IAS for the `.arch` directive.  This allows the
assembly input to use architectural functionality in part of a file.  This is
used in existing code like BoringSSL.

Resolves PR26016!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272241 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-09 02:56:40 +00:00
Kostya Serebryany
41a5827cd3 [libFuzzer] add one more OOM test, which we currently don't handle very well
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@272240 91177308-0d34-0410-b5e6-96231b3b80d8
2016-06-09 01:20:35 +00:00
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