Commit Graph

138617 Commits

Author SHA1 Message Date
Vedant Kumar
daacf3c8ba [llvm-cov] Filter away source files that aren't in the coverage mapping
... so that they don't show up in the index. This came up because polly
contains a .git directory and some other unmapped input in its source
dir.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282282 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 18:57:35 +00:00
Vedant Kumar
fd066351a5 [llvm-cov] Get rid of all invalid filename references
We used to append filenames into a vector of std::string, and then
append a reference to each string into a separate vector. This made it
easier to work with the getUniqueSourceFiles API. But it's buggy.

std::string has a small-string optimization, so you can't expect to
capture a reference to one if you're copying it into a growing vector.
Add a test that triggers this invalid reference to std::string scenario,
and kill the issue with fire by just using ArrayRef<std::string>
everywhere.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282281 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 18:57:32 +00:00
Vedant Kumar
c36f315edc [llvm-cov] Minor cleanup. NFC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282280 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 18:57:27 +00:00
Sanjay Patel
c5ddf50801 [TLI] isdigit / isascii / toascii param type should match return type (PR30484)
We crash in LibCallSimplifier if we don't check the validity of the function signature properly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282278 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 18:44:09 +00:00
Quentin Colombet
f8e3a5168e [ResetMachineFunction] Populate the comments in the header of the file.
NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282276 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 18:38:15 +00:00
Quentin Colombet
76cc1a9a56 [ResetMachineFunction] Add statistic on the number of reset functions.
As the development of GlobalISel move forward, this statistic should
strictly decrease until it reaches zero. At this point, it would mean
GlobalISel can replace SDISel (at least on the tested inputs :P).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282275 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 18:38:13 +00:00
Quentin Colombet
c81278e2a4 [RegisterBankInfo] Add statistics for dynamic partial mappings.
Collect statistics about the number of partial mappings dynamically
allocated and accessed. Ultimately, when the whole TableGen
infrastructure is set, those numbers should be zero.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282274 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 18:38:06 +00:00
Matthias Braun
abd02b3ad6 ScheduleDAG: Match enum names when printing sdep kinds
It is less confusing to have the same names in the debug print as the
enum members.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282273 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 18:28:31 +00:00
Peter Collingbourne
5c7b0b134a BitcodeReader: Deduplicate code. NFC.
Differential Revision: https://reviews.llvm.org/D24852

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282272 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 18:27:42 +00:00
Quentin Colombet
4151a976fe [RegBankSelect] Use DEBUG_TYPE instead of repeating the name of the pass
NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282267 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 17:50:06 +00:00
Quentin Colombet
f8d0897068 [RegisterBank] Mark the dump method with LLVM_DUMP_METHOD.
NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282266 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 17:50:03 +00:00
Jun Bum Lim
32ed609373 Enhance calcColdCallHeuristics for InvokeInst
Summary: When identifying cold blocks, consider only the edge to the normal destination if the terminator is InvokeInst and let calcInvokeHeuristics() decide edge weights for the InvokeInst.

Reviewers: mcrosier, hfinkel, davidxl

Subscribers: mcrosier, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282262 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 17:26:14 +00:00
James Molloy
3b62127542 Revert "[ARM] Promote small global constants to constant pools"
This reverts commit r282241. It caused http://lab.llvm.org:8011/builders/clang-native-arm-lnt/builds/19882.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282249 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 13:35:43 +00:00
Nemanja Ivanovic
a04f9019ef [Power9] Exploit move and splat instructions for build_vector improvement
This patch corresponds to review:
https://reviews.llvm.org/D21135

This patch exploits the following instructions:
mtvsrws
lxvwsx
mtvsrdd
mfvsrld

In order to improve some build_vector and extractelement patterns.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282246 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 13:25:31 +00:00
James Molloy
e2c1cbe138 [ARM] Promote small global constants to constant pools
If a constant is unamed_addr and is only used within one function, we can save
on the code size and runtime cost of an indirection by changing the global's storage
to inside the constant pool. For example, instead of:

      ldr r0, .CPI0
      bl printf
      bx lr
    .CPI0: &format_string
    format_string: .asciz "hello, world!\n"

We can emit:

      adr r0, .CPI0
      bl printf
      bx lr
    .CPI0: .asciz "hello, world!\n"

This can cause significant code size savings when many small strings are used in one
function (4 bytes per string).

This recommit contains fixes for a nasty bug related to fast-isel fallback - because
fast-isel doesn't know about this optimization, if it runs and emits references to
a string that we inline (because fast-isel fell back to SDAG) we will end up
with an inlined string and also an out-of-line string, and we won't emit the
out-of-line string, causing backend failures.

It also contains fixes for emitting .text relocations which made the sanitizer
bots unhappy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282241 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 12:15:58 +00:00
Michal Gorny
91fdd2b663 cmake: Support overriding Sphinx HTML doc install directory
Provide ${PROJECT}_INSTALL_SPHINX_HTML_DIR variables (e.g.
LLVM_INSTALL_SPHINX_HTML_DIR) to override Sphinx HTML doc install
directory.

Bug: https://llvm.org/bugs/show_bug.cgi?id=23780

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282240 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 11:09:33 +00:00
George Rimar
582d1a13f3 Revert r282238 "Revert r282235 "[llvm-dwarfdump] - Teach dwarfdump to dump gdb-index section.""
Build bot issues (http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/15856/steps/ninja%20check%201/logs/FAIL%3A%20LLVM%3A%3Adwarfdump-dump-gdbindex.test)
should be fixed in that version. Issue was that MSVS does not support "%zu". Though it works fine on MSCS 2015,
Bot looks running MSVS 2013 that does not like it. MSDN also says that "z" prefix is not supported: https://msdn.microsoft.com/en-us/library/tcxf1dw6.aspx
I had to use PRId64 instead.

Original commit message:

[llvm-dwarfdump] - Teach dwarfdump to dump gdb-index section.

gold linker's --gdb-index option currently is able to create the .gdb_index section that allows GDB to locate and read the .dwo files as it needs them,
this helps reduce the total size of the object files processed by the linker.

More info about that:
https://gcc.gnu.org/wiki/DebugFission
https://sourceware.org/gdb/onlinedocs/gdb/Index-Section-Format.html

Patch teaches dwarfdump tool to dump this section.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282239 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 11:01:53 +00:00
George Rimar
53a7de61aa Revert r282235 "[llvm-dwarfdump] - Teach dwarfdump to dump gdb-index section."
It broke BB:
http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/15856

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282238 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 10:12:56 +00:00
Alexey Bataev
b9dfeea817 [InstCombine] Fix for PR29124: reduce insertelements to shufflevector
If inserting more than one constant into a vector:

define <4 x float> @foo(<4 x float> %x) {
  %ins1 = insertelement <4 x float> %x, float 1.0, i32 1
  %ins2 = insertelement <4 x float> %ins1, float 2.0, i32 2
  ret <4 x float> %ins2
}

InstCombine could reduce that to a shufflevector:

define <4 x float> @goo(<4 x float> %x) {
 %shuf = shufflevector <4 x float> %x, <4 x float> <float undef, float 1.0, float 2.0, float undef>, <4 x i32><i32 0, i32 5, i32 6, i32 3>
 ret <4 x float> %shuf
}
Also, InstCombine tries to convert shuffle instruction to single insertelement, if one of the vectors is a constant vector and only a single element from this constant should be used in shuffle, i.e.
shufflevector <4 x float> %v, <4 x float> <float undef, float 1.0, float
undef, float undef>, <4 x i32> <i32 0, i32 5, i32 undef, i32 undef> ->
insertelement <4 x float> %v, float 1.0, 1

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282237 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 09:14:08 +00:00
George Rimar
b64f7d8843 [llvm-dwarfdump] - Teach dwarfdump to dump gdb-index section.
gold linker's --gdb-index option currently is able to create the .gdb_index section that allows GDB to locate and read the .dwo files as it needs them,
this helps reduce the total size of the object files processed by the linker.

More info about that:
https://gcc.gnu.org/wiki/DebugFission
https://sourceware.org/gdb/onlinedocs/gdb/Index-Section-Format.html

Patch teaches dwarfdump tool to dump this section.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282235 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 09:09:26 +00:00
Valery Pykhtin
5d11fd54b0 [AMDGPU] Refactor VOP1 and VOP2 instruction TD definitions
Differential revision: https://reviews.llvm.org/D24738

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282234 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 09:08:07 +00:00
Craig Topper
c2a5d16d1e [AVX-512] Split X86ISD::VFPROUND and X86ISD::VFPEXT into separate opcodes for each type constraint.
This revealed that scalar intrinsics could create nodes with a rounding mode of FROUND_CUR_DIRECTION, but the patterns didn't check for it. It just worked because isel doesn't check operand count and we had a pattern without the rounding mode argument at all.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282231 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 06:24:43 +00:00
Craig Topper
27e9902850 [AVX-512] Add separate ISD opcodes for each form of CVT instructions. Don't reuse non-X86 ISD opcodes with extra X86 specific arguments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282230 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 06:24:39 +00:00
Craig Topper
cfb1f68fd0 [AVX-512] Use different ISD opcodes for some of the scalar intrinsic lowering. Isel is not very robust against using the same ISD opcode with different number of operands so its better to separate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282229 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 06:24:35 +00:00
Kostya Serebryany
fd1fd77cb1 [libFuzzer] be more precise about what we reset in TracePC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282225 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 02:18:59 +00:00
Kostya Serebryany
07016d4bd5 [libFuzzer] fix merging with trace-pc-guard
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282224 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 01:58:51 +00:00
Tom Stellard
bf101a6e08 AMDGPU/SI: Include implicit arguments in kernarg_segment_byte_size
Reviewers: arsenm

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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282223 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 01:33:26 +00:00
Kostya Serebryany
73508a3cb1 [libFuzzer] simplify the TracePC logic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282222 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 01:20:07 +00:00
Quentin Colombet
a750e553b1 [RegisterBankInfo] Mark the dump methods with LLVM_DUMP_METHOD.
NFC

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282221 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 00:59:12 +00:00
Quentin Colombet
7bb963ee9d [AArch64][RegisterBankInfo] Sanity check TableGen'ed like inputs.
Make sure the entries written to mimic the behavior of TableGen are
sane.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282220 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 00:59:07 +00:00
Kostya Serebryany
5a965a68f3 [libFuzzer] move value profiling logic into TracePC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282219 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 00:46:18 +00:00
Tom Stellard
67446361c2 Triple: Add opencl environment type
Summary:
For AMDGPU, we have been using the operating system component of the triple
for specifying the low-level runtime that is being used.  The rationale for
this is that the host operating system (e.g. Linux) is irrelevant for GPU code,
since its execution enviroment will be mostly controled by the low-level runtime
being used to execute the code.

In most cases, higher level languages have their own runtime which is
implemented on top of the low-level runtime.  The kernel ABIs of each
language mostly depend on the low-level runtime, but there may be some
slight differences between languages.  OpenCL for example, may append
additional arguments to the kernel in order to pass values like global
offsets or buffers for printf.  OpenMP, HCC, or other languages may want
to add their own values which differ from OpenCL.

The reason for adding a new opencl environment type is to make it possible for the backend
to distinguish between the ABIs of the higher-level languages and handle them correctly.
It seems cleaner to use the enviroment component for this rather than creating a new
OS type for every combination of low-level runtime / high-level language.

Reviewers: Anastasia, chandlerc

Subscribers: whchung, pekka.jaaskelainen, wdng, yaxunl, llvm-commits

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282218 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 00:42:56 +00:00
Petr Hosek
bdbe64e031 [MC] Support skip and count for .incbin directive
These optional arguments are supported by GNU assembler.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282217 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 00:41:06 +00:00
Kostya Serebryany
28f017d845 [libFuzzer] change ValueBitMap to remember the number of bits in it
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282216 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 00:22:46 +00:00
Quentin Colombet
5255015bf5 [AArch64][RegisterBankInfo] Switch to TableGen'ed like PartialMapping.
Statically instanciate the most common PartialMappings. This should
be closer to what the code would look like when TableGen support is
added for GlobalISel. As a side effect, this should improve compile
time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282215 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 00:14:36 +00:00
Quentin Colombet
04905d75e7 [RegisterBankInfo] Check that the mapping covers the interesting bits.
In the verify method of the ValueMapping class we used to check that the
mapping exactly matches the bits of the input value. This is problematic
for statically allocated mappings because we would need a different
mapping for each different size of the value that maps on one
instruction. For instance, with such scheme, we would need a different
mapping for a value of size 1, 5, 23 whereas they all end up on a 32-bit
wide instruction.

Therefore, change the verifier to check that the meaningful bits are
covered by the mapping instead of matching them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282214 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 00:14:34 +00:00
Quentin Colombet
45c56aeee1 [RegisterBankInfo] Use array instead of SmallVector for BreakDown.
This is another step toward TableGen'ed like structures. The BreakDown of
the mapping of the value will be statically computed by TableGen, thus
we only have to point to the right entry in the table instead of
dynamically allocate the mapping for each instruction.

We still support the dynamic allocation through a factory of
PartialMapping to ease the bring-up of the targets while the TableGen
backend is not available.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282213 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-23 00:14:30 +00:00
Kostya Serebryany
43896df9dd [libFuzzer] simplify the crash minimizer; split MaxLen into two: MaxInputLen and MaxMutationLen, allow MaxMutationLen to be less than MaxInputLen
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282211 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 23:16:36 +00:00
Sanjay Patel
38d30e5d19 [InstCombine] fold X urem C -> X < C ? X : X - C when C is big (PR28672)
We already have the udiv variant of this transform, so I think this is ok for 
InstCombine too even though there is an increase in IR instructions. As the 
tests and TODO comments show, the transform can lead to follow-on combines.

This should fix: https://llvm.org/bugs/show_bug.cgi?id=28672

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282209 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 22:36:26 +00:00
Davide Italiano
f35fea1de5 [AsmParser] Remove unused partial template specialization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282206 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 22:02:59 +00:00
Vedant Kumar
c2ac1a71c3 [utils] Teach the code coverage prep script about --restrict
Add two options to the code coverage artifact prep script:

  * --use-existing-profdata: Use an existing indexed profile instead of
    merging the same profiles again.
  * --restrict: Restrict the coverage reporting to the given list of
    source directories.

With this in place, we can teach the coverage bot how to prepare
separate reports for each of the llvm tools.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282204 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 21:49:49 +00:00
Vedant Kumar
ae0e243fb0 [llvm-cov] Document some fields in a class (NFC)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282203 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 21:49:47 +00:00
Vedant Kumar
ef76be0d1e [llvm-cov] Add the ability to specify directories of input source files
We've supported restricting coverage reports to a set of files for a
long time. Add support for being able to restrict by entire directories.

I suppose this supersedes D20803.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282202 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 21:49:43 +00:00
Matthias Braun
a86d297ba3 MachineScheduler: Slightly simplify release node
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282201 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 21:39:56 +00:00
Matthias Braun
c3e16a5807 MachineScheduler: Remove ineffective heuristic; NFC
Currently all nodes get added to the NextSU list when they are released,
so any candidate must be in that list, making the heuristic ineffective.
Remove it for now, we can add it back later in a working fashion if
necessary.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282200 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 21:39:52 +00:00
Hans Wennborg
579bab4252 Revert r282168 "GVN-hoist: fix store past load dependence analysis (PR30216)"
and also the dependent r282175 "GVN-hoist: do not dereference null pointers"

It's causing compiler crashes building Harfbuzz (PR30499).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282199 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 21:20:53 +00:00
Krzysztof Parzyszek
319d69e0f2 [RDF] Add initial support for lane masks in the DFG
Use lane masks for calculating covering and aliasing of register
references.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282194 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 21:01:24 +00:00
Krzysztof Parzyszek
a9c167e82e [Hexagon] Remove USR_OVF from CtrRegs register class
USR_OVF is a subregister of USR, which is a member of CtrRegs. Having both
a register and its proper subregister in the same register class has bad
consequences for lane mask calculation: based solely on the lane mask info,
USR_OVF would not appear to be a subregister of USR.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282192 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 20:59:41 +00:00
Krzysztof Parzyszek
b505adc10e [RDF] Print the function name for calls in dumps
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282191 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 20:58:19 +00:00
Krzysztof Parzyszek
6baa853c4c [RDF] Use uint32_t for register numbers instead of unsigned
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@282190 91177308-0d34-0410-b5e6-96231b3b80d8
2016-09-22 20:56:39 +00:00