Alexey Bader [Fri, 23 Sep 2016 14:20:00 +0000 (14:20 +0000)]
[OpenCL] Augment pipe built-ins with pipe packet size and alignment.
Reviewers: Anastasia, vpykhtin
Subscribers: dmitry, cfe-commits
Differential Revision: https://reviews.llvm.org/D23992
llvm-svn: 282252
Etienne Bergeron [Fri, 23 Sep 2016 14:07:47 +0000 (14:07 +0000)]
[asan] Fix incorrect SEH symbol mangling on win64.
Summary:
The ASAN unittests are failing (check-asan-dynamic) due to an incorrect symbol name:
```
LINK : error LNK2001: unresolved external symbol ___asan_seh_interceptor
```
On win64, the linker is not adding an extra underscore. This was correctly fixed in the same file for other uses.
After that patch, most of the unittests are passing, but some related to SEH needs to be fixed.
```
Failing Tests (4):
AddressSanitizer-x86_64-windows-dynamic :: TestCases/Windows/dll_intercept_memchr.cc
AddressSanitizer-x86_64-windows-dynamic :: TestCases/Windows/dll_intercept_memcpy_indirect.cc
AddressSanitizer-x86_64-windows-dynamic :: TestCases/Windows/dll_seh.cc
AddressSanitizer-x86_64-windows-dynamic :: TestCases/Windows/seh.cc
Expected Passes : 339
Passes With Retry : 3
Expected Failures : 16
Unsupported Tests : 152
Unexpected Failures: 4
```
Reviewers: rnk, kcc, majnemer
Subscribers: majnemer, chrisha, cfe-commits
Differential Revision: https://reviews.llvm.org/D24841
llvm-svn: 282251
Peter Smith [Fri, 23 Sep 2016 13:54:48 +0000 (13:54 +0000)]
[ARM] ARM TLS shouldn't use relaxations
The ARM TLS relocations are placed on literal data and not the
code-sequence, it is therefore not possible to implement the relaxTls*
functions. This change updates handleMipsTlsRelocation() to
handleNoRelaxTlsRelocation() and incorporates ARM as well as Mips.
The ARM support in handleNoRelaxTlsRelocation() currently needs to ouput
the module index dynamic relocation in all cases as it is relying on the
dynamic linker to set the module index in the got.
Should address PR30218
Differential Revision: https://reviews.llvm.org/D24827
llvm-svn: 282250
James Molloy [Fri, 23 Sep 2016 13:35:43 +0000 (13:35 +0000)]
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.
llvm-svn: 282249
George Rimar [Fri, 23 Sep 2016 13:29:20 +0000 (13:29 +0000)]
[ELF] - Linkerscript: accept space between '=' and expression in section filler.
Previously we failed to parse next scripts because disallowed
a space between filler value and '=':
.text : {
...
} :text = 0x9090
Differential revision: https://reviews.llvm.org/D24831
llvm-svn: 282248
Haojian Wu [Fri, 23 Sep 2016 13:28:38 +0000 (13:28 +0000)]
[clang-move] The new.cc file should include new_header.h instead of old_header.h
Summary:
Previously, all #includes (includeing old_header.h) in old.cc will be copied to new.cc,
however, the new.cc should include new_header.h instead of the old_header.h
Before applying the patch, the new.cc looks like:
```
#include "old_header.h"
...
```
The new.cc looks like with this patch:
```
#include "new_header"
...
```
Reviewers: ioeric
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D24828
llvm-svn: 282247
Nemanja Ivanovic [Fri, 23 Sep 2016 13:25:31 +0000 (13:25 +0000)]
[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.
llvm-svn: 282246
George Rimar [Fri, 23 Sep 2016 13:17:23 +0000 (13:17 +0000)]
[ELF] - Linkerscript: implement DEFINED() command.
DEFINED(symbol)
Return 1 if symbol is in the linker global symbol table and is defined before
the statement using DEFINED in the script, otherwise return 0.
Can be used to define default values for symbols. Found it in the wild.
Differential revision: https://reviews.llvm.org/D24858
llvm-svn: 282245
Eugene Leviant [Fri, 23 Sep 2016 13:17:16 +0000 (13:17 +0000)]
Linker script: fix crash when discarding section
If section contains local symbols ldd crashes, because local
symbols are added to symbol table before section is discarded
by linker script processor. This patch calls copyLocalSymbols()
after createSections, so discarded section symbols are not copied
llvm-svn: 282244
George Rimar [Fri, 23 Sep 2016 13:13:55 +0000 (13:13 +0000)]
[ELF] - Linkerscript: Implemented >> and <<
Found this operators used in the wild scripts, for example:
__got2_entries = (_FIXUP_TABLE_ - _GOT2_TABLE_) >>2;
__fixup_entries = (. - _FIXUP_TABLE_)>>2;
Differential revision: https://reviews.llvm.org/D24860
llvm-svn: 282243
Daniel Marjamaki [Fri, 23 Sep 2016 12:23:44 +0000 (12:23 +0000)]
Minor tweak. Avoid hardcoding.
llvm-svn: 282242
James Molloy [Fri, 23 Sep 2016 12:15:58 +0000 (12:15 +0000)]
[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.
llvm-svn: 282241
Michal Gorny [Fri, 23 Sep 2016 11:09:33 +0000 (11:09 +0000)]
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
llvm-svn: 282240
George Rimar [Fri, 23 Sep 2016 11:01:53 +0000 (11:01 +0000)]
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
llvm-svn: 282239
George Rimar [Fri, 23 Sep 2016 10:12:56 +0000 (10:12 +0000)]
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
llvm-svn: 282238
Alexey Bataev [Fri, 23 Sep 2016 09:14:08 +0000 (09:14 +0000)]
[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
llvm-svn: 282237
Pavel Labath [Fri, 23 Sep 2016 09:11:49 +0000 (09:11 +0000)]
[gdb-remote] Remove the const char * version of SendPacketAndWaitForResponse
Switch all callers to use the StringRef version.
llvm-svn: 282236
George Rimar [Fri, 23 Sep 2016 09:09:26 +0000 (09:09 +0000)]
[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
llvm-svn: 282235
Valery Pykhtin [Fri, 23 Sep 2016 09:08:07 +0000 (09:08 +0000)]
[AMDGPU] Refactor VOP1 and VOP2 instruction TD definitions
Differential revision: https://reviews.llvm.org/D24738
llvm-svn: 282234
Daniel Marjamaki [Fri, 23 Sep 2016 08:27:24 +0000 (08:27 +0000)]
Fix indentation
llvm-svn: 282233
Maxim Ostapenko [Fri, 23 Sep 2016 07:40:55 +0000 (07:40 +0000)]
[msan] Prevent initialization failure with newer (2.23+) glibc in use.
This patch is pretty the same as http://reviews.llvm.org/D20235 that we used
for ASan. Using the same hack for MSan fixes its initialization with newer
Glibc in use.
Differential Revision: https://reviews.llvm.org/D24736
llvm-svn: 282232
Craig Topper [Fri, 23 Sep 2016 06:24:43 +0000 (06:24 +0000)]
[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.
llvm-svn: 282231
Craig Topper [Fri, 23 Sep 2016 06:24:39 +0000 (06:24 +0000)]
[AVX-512] Add separate ISD opcodes for each form of CVT instructions. Don't reuse non-X86 ISD opcodes with extra X86 specific arguments.
llvm-svn: 282230
Craig Topper [Fri, 23 Sep 2016 06:24:35 +0000 (06:24 +0000)]
[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.
llvm-svn: 282229
Craig Topper [Fri, 23 Sep 2016 04:48:31 +0000 (04:48 +0000)]
[AVX-512] Add initial support for checking rounding mode arguments of builtins.
The backend can't encode all possible values of the argument and will fail isel. Checking in the frontend presents a friendlier experience to the user.
I started with builtins that can only take _MM_CUR_DIRECTION or _MM_NO_EXC. More builtins coming in the future.
llvm-svn: 282228
Craig Topper [Fri, 23 Sep 2016 04:48:27 +0000 (04:48 +0000)]
[X86] Split up the single switch statement in Sema::CheckX86BuiltinFunctionCall into different switches or ifs for each type of check.
This in preparation for a new check that will check some of the builtins that already had the immediate range check.
llvm-svn: 282227
Zachary Turner [Fri, 23 Sep 2016 02:54:26 +0000 (02:54 +0000)]
Fix windows build caused by mixing enum and enum class.
llvm-svn: 282226
Kostya Serebryany [Fri, 23 Sep 2016 02:18:59 +0000 (02:18 +0000)]
[libFuzzer] be more precise about what we reset in TracePC
llvm-svn: 282225
Kostya Serebryany [Fri, 23 Sep 2016 01:58:51 +0000 (01:58 +0000)]
[libFuzzer] fix merging with trace-pc-guard
llvm-svn: 282224
Tom Stellard [Fri, 23 Sep 2016 01:33:26 +0000 (01:33 +0000)]
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
llvm-svn: 282223
Kostya Serebryany [Fri, 23 Sep 2016 01:20:07 +0000 (01:20 +0000)]
[libFuzzer] simplify the TracePC logic
llvm-svn: 282222
Quentin Colombet [Fri, 23 Sep 2016 00:59:12 +0000 (00:59 +0000)]
[RegisterBankInfo] Mark the dump methods with LLVM_DUMP_METHOD.
NFC
llvm-svn: 282221
Quentin Colombet [Fri, 23 Sep 2016 00:59:07 +0000 (00:59 +0000)]
[AArch64][RegisterBankInfo] Sanity check TableGen'ed like inputs.
Make sure the entries written to mimic the behavior of TableGen are
sane.
llvm-svn: 282220
Kostya Serebryany [Fri, 23 Sep 2016 00:46:18 +0000 (00:46 +0000)]
[libFuzzer] move value profiling logic into TracePC
llvm-svn: 282219
Tom Stellard [Fri, 23 Sep 2016 00:42:56 +0000 (00:42 +0000)]
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
llvm-svn: 282218
Petr Hosek [Fri, 23 Sep 2016 00:41:06 +0000 (00:41 +0000)]
[MC] Support skip and count for .incbin directive
These optional arguments are supported by GNU assembler.
Differential Revision: https://reviews.llvm.org/D24714
llvm-svn: 282217
Kostya Serebryany [Fri, 23 Sep 2016 00:22:46 +0000 (00:22 +0000)]
[libFuzzer] change ValueBitMap to remember the number of bits in it
llvm-svn: 282216
Quentin Colombet [Fri, 23 Sep 2016 00:14:36 +0000 (00:14 +0000)]
[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.
llvm-svn: 282215
Quentin Colombet [Fri, 23 Sep 2016 00:14:34 +0000 (00:14 +0000)]
[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.
llvm-svn: 282214
Quentin Colombet [Fri, 23 Sep 2016 00:14:30 +0000 (00:14 +0000)]
[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.
llvm-svn: 282213
Jim Ingham [Thu, 22 Sep 2016 23:42:42 +0000 (23:42 +0000)]
Add the ability to append breakpoints to the save file.
llvm-svn: 282212
Kostya Serebryany [Thu, 22 Sep 2016 23:16:36 +0000 (23:16 +0000)]
[libFuzzer] simplify the crash minimizer; split MaxLen into two: MaxInputLen and MaxMutationLen, allow MaxMutationLen to be less than MaxInputLen
llvm-svn: 282211
Sanjay Patel [Thu, 22 Sep 2016 22:36:26 +0000 (22:36 +0000)]
[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
llvm-svn: 282209
Jim Ingham [Thu, 22 Sep 2016 22:20:28 +0000 (22:20 +0000)]
Add the ability to deserialize only breakpoints matching a given name.
Also tests for this and the ThreadSpec serialization.
llvm-svn: 282207
Davide Italiano [Thu, 22 Sep 2016 22:02:59 +0000 (22:02 +0000)]
[AsmParser] Remove unused partial template specialization.
llvm-svn: 282206
Jim Ingham [Thu, 22 Sep 2016 22:00:59 +0000 (22:00 +0000)]
Serilize the thread options within the breakpoint options.
llvm-svn: 282205
Vedant Kumar [Thu, 22 Sep 2016 21:49:49 +0000 (21:49 +0000)]
[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.
llvm-svn: 282204
Vedant Kumar [Thu, 22 Sep 2016 21:49:47 +0000 (21:49 +0000)]
[llvm-cov] Document some fields in a class (NFC)
llvm-svn: 282203
Vedant Kumar [Thu, 22 Sep 2016 21:49:43 +0000 (21:49 +0000)]
[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.
llvm-svn: 282202
Matthias Braun [Thu, 22 Sep 2016 21:39:56 +0000 (21:39 +0000)]
MachineScheduler: Slightly simplify release node
llvm-svn: 282201
Matthias Braun [Thu, 22 Sep 2016 21:39:52 +0000 (21:39 +0000)]
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.
llvm-svn: 282200
Hans Wennborg [Thu, 22 Sep 2016 21:20:53 +0000 (21:20 +0000)]
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).
llvm-svn: 282199
Xinliang David Li [Thu, 22 Sep 2016 21:12:40 +0000 (21:12 +0000)]
[Profile] Remove unused variable
llvm-svn: 282198
Davide Italiano [Thu, 22 Sep 2016 21:08:51 +0000 (21:08 +0000)]
[ELF/GC] Don't crash while processing Discarded sections.
The ELF spec doesn't allow relocations to point directly to
a deduplicated COMDAT section but this unfortunately happens in
practice. Bail out early instead of crashing.
Differential Revision: https://reviews.llvm.org/D24750
llvm-svn: 282197
Chris Bieneman [Thu, 22 Sep 2016 21:08:27 +0000 (21:08 +0000)]
[CMake] Fixing a small hack in add_lldb_library
This code was adding an explicit dependency on libclang because lldb needs clang headers, changing this to instead depend on the clang tablegen targets means we don't have to depend on building the clang bits in libclang that lldb doesn't need.
Note this is still a bit of a hack because we're adding the dependency to all lldb libraries, instead of just the ones that need it.
llvm-svn: 282196
Zachary Turner [Thu, 22 Sep 2016 21:06:13 +0000 (21:06 +0000)]
Try to fix build errors on Android.
It doesn't like the implicit conversion from T[] to ArrayRef<T>
so I'm using `llvm::makeArrayRef()`. Hopefully I got everything.
llvm-svn: 282195
Krzysztof Parzyszek [Thu, 22 Sep 2016 21:01:24 +0000 (21:01 +0000)]
[RDF] Add initial support for lane masks in the DFG
Use lane masks for calculating covering and aliasing of register
references.
llvm-svn: 282194
Xinliang David Li [Thu, 22 Sep 2016 21:00:29 +0000 (21:00 +0000)]
[Profile] suppress verbose rt message by default
llvm-svn: 282193
Krzysztof Parzyszek [Thu, 22 Sep 2016 20:59:41 +0000 (20:59 +0000)]
[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.
llvm-svn: 282192
Krzysztof Parzyszek [Thu, 22 Sep 2016 20:58:19 +0000 (20:58 +0000)]
[RDF] Print the function name for calls in dumps
llvm-svn: 282191
Krzysztof Parzyszek [Thu, 22 Sep 2016 20:56:39 +0000 (20:56 +0000)]
[RDF] Use uint32_t for register numbers instead of unsigned
llvm-svn: 282190
Peter Collingbourne [Thu, 22 Sep 2016 20:51:48 +0000 (20:51 +0000)]
cfi: Fixes for check-cfi when configured as an external project.
Differential Revision: https://reviews.llvm.org/D24817
llvm-svn: 282189
Zachary Turner [Thu, 22 Sep 2016 20:22:55 +0000 (20:22 +0000)]
Convert option tables to ArrayRefs.
This change is very mechanical. All it does is change the
signature of `Options::GetDefinitions()` and `OptionGroup::
GetDefinitions()` to return an `ArrayRef<OptionDefinition>`
instead of a `const OptionDefinition *`. In the case of the
former, it deletes the sentinel entry from every table, and
in the case of the latter, it removes the `GetNumDefinitions()`
method from the interface. These are no longer necessary as
`ArrayRef` carries its own length.
In the former case, iteration was done by using a sentinel
entry, so there was no knowledge of length. Because of this
the individual option tables were allowed to be defined below
the corresponding class (after all, only a pointer was needed).
Now, however, the length must be known at compile time to
construct the `ArrayRef`, and as a result it is necessary to
move every option table before its corresponding class. This
results in this CL looking very big, but in terms of substance
there is not much here.
Differential revision: https://reviews.llvm.org/D24834
llvm-svn: 282188
Vedant Kumar [Thu, 22 Sep 2016 20:12:23 +0000 (20:12 +0000)]
[lld] Add llvm-pdbdump as a test dependency
Reviewed-by: rafael
llvm-svn: 282187
Arnold Schwaighofer [Thu, 22 Sep 2016 20:06:25 +0000 (20:06 +0000)]
i386 does not support optimized swifterror handling
rdar://
28432565
llvm-svn: 282186
Hans Wennborg [Thu, 22 Sep 2016 19:50:05 +0000 (19:50 +0000)]
Win64: Don't emit unwind info for "leaf" functions (PR30337)
According to MSDN (see the PR), functions which don't touch any callee-saved
registers (including %rsp) don't need any unwind info.
This patch makes LLVM not emit unwind info for such functions, to save
binary size.
Differential Revision: https://reviews.llvm.org/D24748
llvm-svn: 282185
Renato Golin [Thu, 22 Sep 2016 19:28:20 +0000 (19:28 +0000)]
[OpenBSD] Add type sign information for OpenBSD
Like NetBSD, OpenBSD prefers having a consistent set of typedefs
across the architectures it supports over strictly following the ARM
ABIs. The diff below makes sure that clang's view of those types
matches OpenBSD's system header files. It also adds a test that
checks the relevant types on all OpenBSD platforms that clang works
on. Hopefully we can add mips64 and powerpc to that list in the
future.
Patch by Mark Kettenis <mark.kettenis@xs4all.nl>
llvm-svn: 282184
Zachary Turner [Thu, 22 Sep 2016 19:21:32 +0000 (19:21 +0000)]
Fix build breakage due to typo in cast.
llvm-svn: 282183
Nemanja Ivanovic [Thu, 22 Sep 2016 19:06:38 +0000 (19:06 +0000)]
[PowerPC] Sign extend sub-word values for atomic comparisons
Atomic comparison instructions use the sub-word load instruction on
Power8 and up but the value is not sign extended prior to the signed word
compare instruction. This patch adds that sign extension.
llvm-svn: 282182
Rafael Espindola [Thu, 22 Sep 2016 18:36:46 +0000 (18:36 +0000)]
Remove extra \
Should fix the windows bots.
llvm-svn: 282181
Rafael Espindola [Thu, 22 Sep 2016 18:05:49 +0000 (18:05 +0000)]
Don't move orphan sections past assignments.
This fixes a case where we would produce an unaligned PT_LOAD.
llvm-svn: 282180
Enrico Granata [Thu, 22 Sep 2016 17:59:58 +0000 (17:59 +0000)]
Actually, do it this way because I will want to know if I am in a host build elsewhere too
llvm-svn: 282179
Enrico Granata [Thu, 22 Sep 2016 17:47:33 +0000 (17:47 +0000)]
The host version of lldb always builds for macosx
llvm-svn: 282178
Nirav Dave [Thu, 22 Sep 2016 17:28:43 +0000 (17:28 +0000)]
[DAG] Fix incorrect alignment of ext load.
Correctly use alignment size from loaded size not output value size.
Reviewers: jyknight, tstellarAMD, arsenm
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D23356
llvm-svn: 282177
Rafael Espindola [Thu, 22 Sep 2016 17:23:53 +0000 (17:23 +0000)]
Simplify. NFC.
With the recent changes there should always be a 1:1 correspondence in
the correct order between OutputSections and OutputSectionCommands.
llvm-svn: 282176
Sebastian Pop [Thu, 22 Sep 2016 17:22:58 +0000 (17:22 +0000)]
GVN-hoist: do not dereference null pointers
there may be basic blocks without memory accesses, in which case the
list of accesses is a null pointer.
llvm-svn: 282175
Krzysztof Parzyszek [Thu, 22 Sep 2016 17:22:43 +0000 (17:22 +0000)]
[PPC] Set SP after loading data from stack frame, if no red zone is present
Follow-up to r280705: Make sure that the SP is only restored after all data
is loaded from the stack frame, if there is no red zone.
This completes the fix for https://llvm.org/bugs/show_bug.cgi?id=26519.
Differential Revision: https://reviews.llvm.org/D24466
llvm-svn: 282174
Rafael Espindola [Thu, 22 Sep 2016 16:47:21 +0000 (16:47 +0000)]
Avoid duplicated code.
This also fixes the linker script accounting for the ELF header in
some places but not in others.
llvm-svn: 282173
Todd Fiala [Thu, 22 Sep 2016 16:29:48 +0000 (16:29 +0000)]
fix DarwinLog no-info/no-debug case
This started failing recently:
TestDarwinLogSourceDebug.py
It looks like the behavior of specifying the OS_ACTIVITY_MODE
env var with no value used to work for no-info/no-debug content.
That doesn't appear to be the case now. Switch to specifying
the proper value ('default') when no info-level and no debug-level
content is expected.
llvm-svn: 282172
Todd Fiala [Thu, 22 Sep 2016 16:00:01 +0000 (16:00 +0000)]
added environment variable-related Args gtests
Also fixed up a couple misbehaving functions. It is perfectly
legal to have env vars with no values (i.e. the '=' and following
need not be present).
llvm-svn: 282171
Zachary Turner [Thu, 22 Sep 2016 15:55:05 +0000 (15:55 +0000)]
Speculative fix for build failures due to consumeInteger.
A recent patch added support for consumeInteger() and made
getAsInteger delegate to this function. A few buildbots are
failing as a result with an assertion failure. On a hunch,
I tested what happens if I call getAsInteger() on an empty
string, and sure enough it crashes the same way that the
buildbots are crashing.
I confirmed that getAsInteger() on an empty string did not
crash before my patch, so I suspect this to be the cause.
I also added a unit test for the empty string.
llvm-svn: 282170
Vedant Kumar [Thu, 22 Sep 2016 15:34:33 +0000 (15:34 +0000)]
[docs] Touch up the coverage docs some more
llvm-svn: 282169
Sebastian Pop [Thu, 22 Sep 2016 15:33:51 +0000 (15:33 +0000)]
GVN-hoist: fix store past load dependence analysis (PR30216)
To hoist stores past loads, we used to search for potential
conflicting loads on the hoisting path by following a MemorySSA
def-def link from the store to be hoisted to the previous
defining memory access, and from there we followed the def-use
chains to all the uses that occur on the hoisting path. The
problem is that the def-def link may point to a store that does
not alias with the store to be hoisted, and so the loads that are
walked may not alias with the store to be hoisted, and even as in
the testcase of PR30216, the loads that may alias with the store
to be hoisted are not visited.
The current patch visits all loads on the path from the store to
be hoisted to the hoisting position and uses the alias analysis
to ask whether the store may alias the load. I was not able to
use the MemorySSA functionality to ask for whether load and
store are clobbered: I'm not sure which function to call, so I
used a call to AA->isNoAlias().
Store past store is still working as before using a MemorySSA
query: I added an extra test to pr30216.ll to make sure store
past store does not regress.
Differential Revision: https://reviews.llvm.org/D24517
llvm-svn: 282168
Pavel Labath [Thu, 22 Sep 2016 15:26:43 +0000 (15:26 +0000)]
Fix TestBreakpointSerialization on windows
The test exposed a bug in the StructuredData Serialization code, which did not
escape the backslash properly. This manifested itself as windows breakpoint
serialization roundtrip test not succeeding (as windows paths included
backslashes).
llvm-svn: 282167
Rafael Espindola [Thu, 22 Sep 2016 15:25:21 +0000 (15:25 +0000)]
Simplify. NFC.
It doesn't matter which direction we rotate and we haven't really
started optimizing the linker script code, so keep this simple.
llvm-svn: 282166
Sebastian Pop [Thu, 22 Sep 2016 15:08:09 +0000 (15:08 +0000)]
GVN-hoist: fix typo
llvm-svn: 282165
Zachary Turner [Thu, 22 Sep 2016 15:05:19 +0000 (15:05 +0000)]
[Support] Add StringRef::consumeInteger.
StringRef::getInteger() exists and treats the entire string as
an integer of the specified radix, failing if any invalid characters
are encountered or the number overflows.
Sometimes you might have something like "123456foo" and you want
to get the number 123456 and leave the string "foo" remaining.
This is similar to what would be possible by using the standard
runtime library functions strtoul et al and specifying an end
pointer.
This patch adds consumeInteger(), which does exactly that. It
consumes as much as possible until an invalid character is found,
and modifies the StringRef in place so that upon return only
the portion of the StringRef after the number remains.
Differential Revision: https://reviews.llvm.org/D24778
llvm-svn: 282164
Etienne Bergeron [Thu, 22 Sep 2016 14:57:24 +0000 (14:57 +0000)]
[compiler-rt] fix typo in option description [NFC]
llvm-svn: 282163
Sebastian Pop [Thu, 22 Sep 2016 14:45:46 +0000 (14:45 +0000)]
GVN-hoist: move hoist testcase to GVNHoist dir
llvm-svn: 282161
Sebastian Pop [Thu, 22 Sep 2016 14:45:40 +0000 (14:45 +0000)]
GVN-hoist: only hoist relevant scalar instructions
Without this patch, GVN-hoist would think that a branch instruction is a scalar instruction
and would try to value number it. The patch filters out all such kind of irrelevant instructions.
A bit frustrating is that there is no easy way to discard all those very infrequent instructions,
a bit like isa<TerminatorInst> that stands for a large family of instructions. I'm thinking that
checking for those very infrequent other instructions would cost us more in compilation time
than just letting those instructions getting numbered, so I'm still thinking that a simpler check:
if (isa<TerminatorInst>(I))
return false;
is better than listing all the other less frequent instructions.
Differential Revision: https://reviews.llvm.org/D23929
llvm-svn: 282160
Rafael Espindola [Thu, 22 Sep 2016 14:40:50 +0000 (14:40 +0000)]
Handle empty sections with symbol assignments.
Before the symbols were becoming undefined.
llvm-svn: 282159
Haojian Wu [Thu, 22 Sep 2016 14:36:43 +0000 (14:36 +0000)]
[clang-tidy] Add doc for `explain-config` option.
llvm-svn: 282158
Dmitry Vyukov [Thu, 22 Sep 2016 14:33:43 +0000 (14:33 +0000)]
tsan: fix bug introduced in 282152
In ShadowToMem we call MemToShadow potentially for incorrect addresses.
So DCHECK(IsAppMem(p)) can fire in debug mode.
Fix this by swapping range and MemToShadow checks.
llvm-svn: 282157
Daniel Marjamaki [Thu, 22 Sep 2016 14:13:46 +0000 (14:13 +0000)]
Fix Wbitfield-constant-conversion false positives
Summary:
The diagnostic did not handle ~ well. An expression such as ~0 is often used when 'all ones' is needed.
Differential Revision: https://reviews.llvm.org/D24232
llvm-svn: 282156
Keith Walker [Thu, 22 Sep 2016 14:13:25 +0000 (14:13 +0000)]
Reapplying r281895 (and follow-up r281964) after fixing pr30468.
The additional fix is:
When adding debug information to a lowered phi node in mem2reg
check that we have a valid insertion point after the phi for adding
the debug information.
This change addresses the issue in pr30468 where a lowered phi was
added before a catchswitch and no debug information should be added
after the phi in this case.
Differential Revision: https://reviews.llvm.org/D24797
llvm-svn: 282155
Teresa Johnson [Thu, 22 Sep 2016 13:58:33 +0000 (13:58 +0000)]
Third attempt to fix Sphinx bot
Bot now complaining about -flto=thin reference, used similar workaround
for that failure.
llvm-svn: 282154
Tim Northover [Thu, 22 Sep 2016 13:49:25 +0000 (13:49 +0000)]
GlobalISel: handle stack-based parameters on AArch64.
llvm-svn: 282153
Dmitry Vyukov [Thu, 22 Sep 2016 13:42:02 +0000 (13:42 +0000)]
tsan: support pie binaries on newer kernels
4.1+ Linux kernels map pie binaries at 0x55:
https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/?id=
d1fd836dcf00d2028c700c7e44d2c23404062c90
Currently tsan does not support app memory at 0x55 (https://github.com/google/sanitizers/issues/503).
Older kernels also map pie binaries at 0x55 when ASLR is disables (most notably under gdb).
This change extends tsan mapping for linux/x86_64 to cover 0x554-0x568 app range and fixes both 4.1+ kernels and gdb.
This required to slightly shrink low and high app ranges and move heap. The mapping become even more non-linear, since now we xor lower bits. Now even a continuous app range maps to split, intermixed shadow ranges. This breaks ShadowToMemImpl as it assumes linear mapping at least within a continuous app range (however it turned out to be already broken at least on arm64/42-bit vma as uncovered by r281970). So also change ShadowToMemImpl to hopefully a more robust implementation that does not assume a linear mapping.
llvm-svn: 282152
Teresa Johnson [Thu, 22 Sep 2016 13:41:10 +0000 (13:41 +0000)]
Second attempt to fix Sphinx bot
The fix in r282148 was not enough to fix the following error:
/home/llvmbb/llvm-build-dir/clang-sphinx-docs/llvm/src/tools/clang/docs/CommandGuide/clang.rst:338:
WARNING: unknown option: -flto=full
on the sphinx bot:
http://lab.llvm.org:8011/builders/clang-sphinx-docs/builds/16313
(not reproducible locally).
This time, simply remove the option reference.
llvm-svn: 282151
Anna Thomas [Thu, 22 Sep 2016 13:13:06 +0000 (13:13 +0000)]
[RS4GC] Remat in presence of phi and use live value
Summary:
Reviewers:
Subscribers:
llvm-svn: 282150