George Rimar [Tue, 26 Jul 2016 18:46:13 +0000 (18:46 +0000)]
[ELF] - replace error() with llvm_unreachable.
llvm-svn: 276790
George Rimar [Tue, 26 Jul 2016 18:41:06 +0000 (18:41 +0000)]
Attemp to fix build bot:
http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/25329/steps/build_Lld
llvm-svn: 276789
Krzysztof Parzyszek [Tue, 26 Jul 2016 18:40:25 +0000 (18:40 +0000)]
Add link to the Hexagon documentation
llvm-svn: 276788
Krzysztof Parzyszek [Tue, 26 Jul 2016 18:30:11 +0000 (18:30 +0000)]
[Hexagon] Bitwise operations for insert/extract word not simplified
Change the bit simplifier to generate REG_SEQUENCE instructions in
addition to COPY, which will handle cases of word insert/extract.
llvm-svn: 276787
Justin Lebar [Tue, 26 Jul 2016 18:28:33 +0000 (18:28 +0000)]
Fix NVPTX/call-with-alloca-buffer.ll after r276777.
r276777 makes InstSimplify stronger, letting it see through some
unnecessary addrspace casts.
llvm-svn: 276786
Matthias Braun [Tue, 26 Jul 2016 18:20:00 +0000 (18:20 +0000)]
MIRParser: Use shorter cfi identifiers
In an instruction like:
CFI_INSTRUCTION .cfi_def_cfa ...
we can drop the '.cfi_' prefix since that should be obvious by the
context:
CFI_INSTRUCTION def_cfa ...
While being a terser and cleaner syntax this also prepares to dropping
support for identifiers starting with a dot character so we can use it
for expressions.
Differential Revision: http://reviews.llvm.org/D22388
llvm-svn: 276785
George Rimar [Tue, 26 Jul 2016 18:18:58 +0000 (18:18 +0000)]
[ELF] Linkerscript: symbol assignments with indentifiers on the right side of expression.
In symbol assignments symbol may appear on the right-hand side of the expression:
(https://svnweb.freebsd.org/base/head/sys/conf/ldscript.amd64?revision=284870&view=markup#l8)
kernphys = CONSTANT (MAXPAGESIZE);
. = kernbase + kernphys + SIZEOF_HEADERS;
Patch implements that.
Differential revision: https://reviews.llvm.org/D22759
llvm-svn: 276784
Davide Italiano [Tue, 26 Jul 2016 18:16:33 +0000 (18:16 +0000)]
[MC] Don't crash when trying to emit a relocation against .bss.
Turn that into an error instead.
llvm-svn: 276783
Artem Dergachev [Tue, 26 Jul 2016 18:13:12 +0000 (18:13 +0000)]
[analyzer] Add basic capabilities to detect source code clones.
This patch adds the CloneDetector class which allows searching source code
for clones.
For every statement or group of statements within a compound statement,
CloneDetector computes a hash value, and finds clones by detecting
identical hash values.
This initial patch only provides a simple hashing mechanism
that hashes the kind of each sub-statement.
This patch also adds CloneChecker - a simple static analyzer checker
that uses CloneDetector to report copy-pasted code.
Patch by Raphael Isemann!
Differential Revision: https://reviews.llvm.org/D20795
llvm-svn: 276782
Bruno Cardoso Lopes [Tue, 26 Jul 2016 18:09:23 +0000 (18:09 +0000)]
[CMAKE] Find ld64 using xcrun
Given similar reasons from r276710, ld64 scrubs DYLD_* environment if
called from the shim executable /usr/bin/ld.
Add support for finding ld64 via xcrun.
This is needed in order to get LIT to have the full path to the ld4
executable.
Differential Revision: https://reviews.llvm.org/D22791
rdar://problem/
24300926
llvm-svn: 276781
George Rimar [Tue, 26 Jul 2016 18:06:29 +0000 (18:06 +0000)]
[ELF] - Linkerscript: implemented ALIGN modificatior of output sections.
Output section description can contain ALIGN modificator:
https://sourceware.org/binutils/docs/ld/Output-Section-Description.html#Output-Section-Description
Patch implements it.
Differential revision: https://reviews.llvm.org/D22674
llvm-svn: 276780
Reid Kleckner [Tue, 26 Jul 2016 17:59:09 +0000 (17:59 +0000)]
[sanitizer] Try to fix LargeMmapAllocator test on Windows
This test attempts to allocate 100 512MB aligned pages of memory. This
is implemented in the usual way by allocating size + alignment bytes and
aligning the result. As a result, this test allocates 51.2GB of memory.
Windows allocates swap for all memory allocated, and our bots do not
have this much swap available.
Avoid the failure by using a more reasonable alignment, like 16MB, as we
do on 32-bit.
llvm-svn: 276779
George Rimar [Tue, 26 Jul 2016 17:58:44 +0000 (17:58 +0000)]
[ELF] Linkerscript: implement DATA_SEGMENT_RELRO_END.
In compare with what GNU linkers do (https://sourceware.org/binutils/docs/ld/Builtin-Functions.html),
this implementation simple:
Do not touch DATA_SEGMENT_ALIGN, it do what it do now - just aligns to the page boundary.
Parameters of DATA_SEGMENT_RELRO_END is ignored. That should be correct as it is usually just a 24 bytes
shift that allows to protect first 3 entries of got.plt with relro.
(https://svnweb.freebsd.org/base/head/sys/conf/ldscript.amd64?revision=284870&view=markup#l146).
DATA_SEGMENT_RELRO_END just aligns to the page boundary.
That is what expected because all sections that are not affected by relro should be on another memory page.
So at fact the difference with documented behavior is that we do not pad DATA_SEGMENT_ALIGN.
3 entries of got.plt are uncovered by relro, but functionality is simple and equal to lld behavior
for case when script is not given.
Differential revision: https://reviews.llvm.org/D22813
llvm-svn: 276778
David Majnemer [Tue, 26 Jul 2016 17:58:05 +0000 (17:58 +0000)]
[InstSimplify] Cast folding can be made more generic
Use isEliminableCastPair to determine if a pair of casts are foldable.
llvm-svn: 276777
Adam Nemet [Tue, 26 Jul 2016 17:52:02 +0000 (17:52 +0000)]
[LoopUtils] Sort headers
llvm-svn: 276776
Tim Northover [Tue, 26 Jul 2016 17:42:40 +0000 (17:42 +0000)]
GlobalISel: add correct operand type to G_FRAME_INDEX instrs.
Frame indices should use "addFrameIndex", not "addImm".
llvm-svn: 276775
Rui Ueyama [Tue, 26 Jul 2016 17:35:42 +0000 (17:35 +0000)]
Add `static` to a function that is used only in one file.
llvm-svn: 276774
Krzysztof Parzyszek [Tue, 26 Jul 2016 17:31:02 +0000 (17:31 +0000)]
[Hexagon] Add support for proper handling of H and L constraints
H -> High part of reg pair.
L -> Low part of reg pair.
Patch by Sundeep Kushwaha.
llvm-svn: 276773
Tim Northover [Tue, 26 Jul 2016 17:28:01 +0000 (17:28 +0000)]
GlobalISel: omit braces on MachineInstr types when there's only one.
Tidies up the representation a bit in the common case.
llvm-svn: 276772
Andrew Kaylor [Tue, 26 Jul 2016 17:23:13 +0000 (17:23 +0000)]
Re-committing r275284: add support to inline __builtin_mempcpy
Patch by Sunita Marathe
Differential Revision: http://reviews.llvm.org/D21920
llvm-svn: 276771
Lang Hames [Tue, 26 Jul 2016 17:17:17 +0000 (17:17 +0000)]
[lld][MachO] Add support for S_ATTR_DEBUG to the MachO YAML reader/writer.
This enables proper recognition of debug sections by attribute, which will be
used in the near future by test-cases for MachO debugging support.
llvm-svn: 276770
Manman Ren [Tue, 26 Jul 2016 17:12:17 +0000 (17:12 +0000)]
Modules: add command line option fmodules-disable-diagnostic-validation
With PCH+Module, sometimes compiler gives a hard error:
Module file ‘<some-file path>.pcm' is out of date and needs to be rebuilt
This happens when we have a pch importing a module and the module gets
overwritten by another compiler instance after we build the pch (one example is
that both compiler instances hash to the same pcm file but use different
diagnostic options). When we try to load the pch later on, the compiler notices
that the imported module is out of date (modification date, size do not match)
but it can't handle this out of date pcm (i.e it does not know how to rebuild
the pch).
This commit introduces a new command line option so for PCH + module, we can
turn on this option and if two compiler instances only differ in diagnostic
options, the latter instance will not invalidate the original pcm.
rdar://
26675801
Differential Revision: http://reviews.llvm.org/D22773
llvm-svn: 276769
George Rimar [Tue, 26 Jul 2016 17:01:18 +0000 (17:01 +0000)]
[ELF] - Merged 2 lines. NFC.
llvm-svn: 276768
Matt Arsenault [Tue, 26 Jul 2016 16:45:58 +0000 (16:45 +0000)]
AMDGPU: Make AMDGPUMachineFunction fields private
ABIArgOffset is a problem because properly fsetting the
KernArgSize requires that the reserved area before the
real kernel arguments be correctly aligned, which requires
fixing clover.
llvm-svn: 276766
Matt Arsenault [Tue, 26 Jul 2016 16:45:50 +0000 (16:45 +0000)]
AMDGPU: Add missing tests for xnack option for HSA
llvm-svn: 276765
Matt Arsenault [Tue, 26 Jul 2016 16:45:45 +0000 (16:45 +0000)]
AMDGPU: Add fp legacy instruction intrinsics
This could use some additional optimization work
to use mad/mac legacy.
llvm-svn: 276764
Tim Northover [Tue, 26 Jul 2016 16:45:30 +0000 (16:45 +0000)]
GlobalISel: add specialized buildCopy function to MachineInstrBuilder.
NFC.
llvm-svn: 276763
Tim Northover [Tue, 26 Jul 2016 16:45:26 +0000 (16:45 +0000)]
GlobalISel: give MachineInstrBuilder a uniform interface. NFC.
Instead of an ad-hoc collection of "buildInstr" functions with varying numbers
of registers, this uses variadic templates to provide for as many regs as
needed!
Also make IRtranslator use new "buildBr" function instead of some weird generic
one that no-one else would really use.
llvm-svn: 276762
Haojian Wu [Tue, 26 Jul 2016 16:32:42 +0000 (16:32 +0000)]
[include-fixer] Don't add qualifiers in missing complete type cases.
Summary: In missing complete type cases, we don't know where to add the qualifiers.
Reviewers: bkramer
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D22812
llvm-svn: 276761
Todd Fiala [Tue, 26 Jul 2016 16:08:26 +0000 (16:08 +0000)]
reduce Green Dragon macOS build session filename length
The Green Dragon builder for macOS started failing yesterday with
session filenames that were too long. This change modifies the
Xcode target that runs the test suite and specifies a shorter
session filename format.
rdar://
27539818
llvm-svn: 276760
Martin Bohme [Tue, 26 Jul 2016 16:01:55 +0000 (16:01 +0000)]
Revert "Make RecursiveASTVisitor visit lambda capture initialization expressions"
This reverts commit r276755.
(Broke clang-tidy check modernize-loop-convert.)
llvm-svn: 276759
David Majnemer [Tue, 26 Jul 2016 15:21:18 +0000 (15:21 +0000)]
Update for LLVM changes
InstSimplify has gained the ability to remove needless bitcasts which
perturbed some clang codegen tests.
llvm-svn: 276756
Martin Bohme [Tue, 26 Jul 2016 15:19:10 +0000 (15:19 +0000)]
Make RecursiveASTVisitor visit lambda capture initialization expressions
Summary:
Lambda capture initializations are part of the explicit source code and therefore should be visited by default but, so far, RecursiveASTVisitor does not visit them.
This appears to be an oversight. Because the lambda body needs custom handling (calling TraverseLambdaBody()), the DEF_TRAVERSE_STMT for LambdaExpr sets ShouldVisitChildren to false but then neglects to visit the lambda capture initializations. This patch adds code to visit the expressions associated with lambda capture initializations.
Reviewers: klimek
Subscribers: klimek, cfe-commits
Differential Revision: https://reviews.llvm.org/D22566
llvm-svn: 276755
Eric Liu [Tue, 26 Jul 2016 14:53:05 +0000 (14:53 +0000)]
[Tooling] skip anonymous namespaces when checking if typeLoc references a type decl from a different canonical namespace.
Summary:
[Tooling] skip anonymous namespaces when checking if typeLoc
references a type decl from a different canonical namespace.
Reviewers: bkramer
Subscribers: cfe-commits, klimek
Differential Revision: https://reviews.llvm.org/D22808
llvm-svn: 276754
Daniel Sanders [Tue, 26 Jul 2016 14:46:11 +0000 (14:46 +0000)]
[mips] Fix typos in spelling of lowerRETURNADDR.
The first letter was mistakenly capitalized.
llvm-svn: 276753
Martin Bohme [Tue, 26 Jul 2016 14:37:39 +0000 (14:37 +0000)]
Revert test commit
This reverts rL276746.
llvm-svn: 276752
Marshall Clow [Tue, 26 Jul 2016 14:29:45 +0000 (14:29 +0000)]
Implement LCM and GCD for C++17. Same code as for Library Fundamentals TS.
llvm-svn: 276751
Marshall Clow [Tue, 26 Jul 2016 14:28:34 +0000 (14:28 +0000)]
Implement LCM and GCD for Library Fundamentals. Reviewed as https://reviews.llvm.org/D21343.
llvm-svn: 276750
Krzysztof Parzyszek [Tue, 26 Jul 2016 14:24:46 +0000 (14:24 +0000)]
[Hexagon] Update store offset when not packetizing it with allocframe
When the packetizer wants to put a store to a stack slot in the same
packet with an allocframe, it updates the store offset to reflect the
value of SP before it is updated by allocframe. If the store cannot
be packetized with the allocframe after all, the offset needs to be
updated back to the previous value.
llvm-svn: 276749
Oliver Stannard [Tue, 26 Jul 2016 14:24:43 +0000 (14:24 +0000)]
[ARM] Improve error messages for .arch_extension directive
- More informative message when extension name is not an identifier token.
- Stop parsing directive if extension is unknown (avoid duplicate error
messages).
- Report unsupported extensions with a source location, rather than
report_fatal_error.
Differential Revision: https://reviews.llvm.org/D22806
llvm-svn: 276748
Oliver Stannard [Tue, 26 Jul 2016 14:19:47 +0000 (14:19 +0000)]
[ARM] Implement -mimplicit-it assembler option
This option, compatible with gas's -mimplicit-it, controls the
generation/checking of implicit IT blocks in ARM/Thumb assembly.
This option allows two behaviours that were not possible before:
- When in ARM mode, emit a warning when assembling a conditional
instruction that is not in an IT block. This is enabled with
-mimplicit-it=never and -mimplicit-it=thumb.
- When in Thumb mode, automatically generate IT instructions when an
instruction with a condition code appears outside of an IT block. This
is enabled with -mimplicit-it=thumb and -mimplicit-it=always.
The default option is -mimplicit-it=arm, which matches the existing
behaviour (allow conditional ARM instructions outside IT blocks without
warning, and error if a conditional Thumb instruction is outside an IT
block).
The general strategy for generating IT blocks in Thumb mode is to keep a
small list of instructions which should be in the IT block, and only
emit them when we encounter something in the input which means we cannot
continue the block. This could be caused by:
- A non-predicable instruction
- An instruction with a condition not compatible with the IT block
- The IT block already contains 4 instructions
- A branch-like instruction (including ALU instructions with the PC as
the destination), which cannot appear in the middle of an IT block
- A label (branching into an IT block is not legal)
- A change of section, architecture, ISA, etc
- The end of the assembly file.
Some of these, such as change of section and end of file, are parsed
outside of the ARM asm parser, so I've added a new virtual function to
AsmParser to ensure any previously-parsed instructions have been
emitted. The ARM implementation of this flushes the currently pending IT
block.
We now have to try instruction matching up to 3 times, because we cannot
know if the current IT block is valid before matching, and instruction
matching changes depending on the IT block state (due to the 16-bit ALU
instructions, which set the flags iff not in an IT block). In the common
case of not having an open implicit IT block and the instruction being
matched not needing one, we still only have to run the matcher once.
I've removed the ITState.FirstCond variable, because it does not store
any information that isn't already represented by CurPosition. I've also
updated the comment on CurPosition to accurately describe it's meaning
(which this patch doesn't change).
Differential Revision: https://reviews.llvm.org/D22760
llvm-svn: 276747
Martin Bohme [Tue, 26 Jul 2016 14:01:48 +0000 (14:01 +0000)]
Test commit -- adding a newline
llvm-svn: 276746
George Rimar [Tue, 26 Jul 2016 14:00:10 +0000 (14:00 +0000)]
[ELF] Linkerscript: simplify DATA_SEGMENT_ALIGN evaluation
We can simplify the evaluation of DATA_SEGMENT_ALIGN
just to simple align(). That way it will work exactly like we have in non-script case.
Change was suggested by Rafael Ávila de Espíndola
Differential revision: https://reviews.llvm.org/D22807
llvm-svn: 276745
Daniel Sanders [Tue, 26 Jul 2016 13:23:27 +0000 (13:23 +0000)]
[lit] Document the 'available_features' member of the config object.
llvm-svn: 276744
Simon Pilgrim [Tue, 26 Jul 2016 12:44:50 +0000 (12:44 +0000)]
[X86][SSE] Added extra memory folding tests for cvtsd2ss intrinsic
SSE only fold partial reg update instructions when optsize is enabled
llvm-svn: 276743
Rafael Espindola [Tue, 26 Jul 2016 12:38:18 +0000 (12:38 +0000)]
Disable test on windows.
llvm-svn: 276742
George Rimar [Tue, 26 Jul 2016 10:47:09 +0000 (10:47 +0000)]
[ELF] - Fixed possible iterator overflow.
We can have Opt.Commands size greater then Sections.size().
For example if we have next script:
SECTIONS {
.aaa : { *(.aaa) }
.bbb : { *(.bbb) }
.ccc : { *(.ccc) }
}
and next code:
.global _start
_start:
nop
.section .aaa,"a"
.quad 0
Then amount of sections is less than amound of Opt.Commands
and if we for example have all commands NoConstraint,
that overflowed the iterator used.
llvm-svn: 276741
Simon Pilgrim [Tue, 26 Jul 2016 10:41:28 +0000 (10:41 +0000)]
[X86][SSE] Fixed issue with memory folding of (v)cvtsd2ss intrinsics
Fixed typo in the intrinsic definitions of (v)cvtsd2ss with memory folding.
This was only unearthed when rL276102 started using the intrinsic again.....
llvm-svn: 276740
Simon Dardis [Tue, 26 Jul 2016 10:25:07 +0000 (10:25 +0000)]
[mips] MIPS64R6 compact branch support
MIPS64R6 compact branch support. As the MIPS LLVM backend uses distinct
MachineInstrs for certain 32 and 64 bit instructions (e.g. BEQ & BEQ64) that
map to the same instruction, extend compact branch support for the
corresponding 64bit branches.
Reviewers: dsanders
Differential Revision: https://reviews.llvm.org/D20164
llvm-svn: 276739
Simon Pilgrim [Tue, 26 Jul 2016 09:55:31 +0000 (09:55 +0000)]
Fixed spelling in comment
llvm-svn: 276738
Benjamin Kramer [Tue, 26 Jul 2016 09:27:51 +0000 (09:27 +0000)]
[tblgen] Compare const char * with strcmp instead of creating StringRef.
Avoids a call to strlen on both strings which always reads the entire
string. strcmp can use early exit.
llvm-svn: 276737
Simon Dardis [Tue, 26 Jul 2016 09:13:46 +0000 (09:13 +0000)]
[mips] sgtu, s[rl]l, sra, dnegu, neg instruction aliases
Add the instruction alias sgtu (register form only), two operand forms of
s[rl]l and sra, and missing single/two operand forms of dnegu/neg.
Reviewers: dsanders
Differential Revision: https://reviews.llvm.org/D22752
llvm-svn: 276736
Pavel Labath [Tue, 26 Jul 2016 08:16:19 +0000 (08:16 +0000)]
Fix incorrect form test in SymbolFileDWARF
Summary:
We were checking whether an attribute is in block form by getting the block data pointer, which
was not correct as the pointer be null even if the attribute is in block form. Other places in
the file already use the correct test.
To make this work, I've needed to add DW_FORM_exprlock to the list of "block" forms, which seems
correct as that is how we are parsing it.
Reviewers: clayborg
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D22756
llvm-svn: 276735
Pavel Labath [Tue, 26 Jul 2016 08:11:57 +0000 (08:11 +0000)]
Fix DataExtractor::PeekData for zero length peeks
Summary:
The function was returning the null pointer for peeks of size zero, which seems like a sensible
thing to do, but is actually pretty easy to get bitten by that if you are extracting a variable
length field which happens to be of zero length and then doing pointer arithmetic on that (which
SymbolFileDWARF does, and ended up crashing in case of empty DW_AT_location).
This changes the function to return a null pointer only when it gets queried for data which is
outside of the range of the extractor, which is more c++-y, as one can still do reasonable things
with pointers to data of size zero (think, end() iterators).
I also add a test and fix some signedness warnings in the existing data extractor tests.
Reviewers: clayborg
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D22755
llvm-svn: 276734
Craig Topper [Tue, 26 Jul 2016 08:06:18 +0000 (08:06 +0000)]
[X86] Remove isCommutable=1 from instructions that also load. Commuting such instruction isn't useful as it would unfold the load. The exception being FMA3 instructions.
llvm-svn: 276733
Craig Topper [Tue, 26 Jul 2016 08:06:14 +0000 (08:06 +0000)]
[AVX512] Don't mark ADDSSZr_Int or MULSSZr_Int as commutable. The intrinsics have one of their arguments indicated as passing through the high bits and we can't commute that.
llvm-svn: 276732
Eugene Leviant [Tue, 26 Jul 2016 07:20:40 +0000 (07:20 +0000)]
[ELF/Linkerscript] Remove special handling of TLS/NOTE/RELRO sections (patch from ruiu)
llvm-svn: 276731
Dimitry Andric [Tue, 26 Jul 2016 06:49:14 +0000 (06:49 +0000)]
Remove obsolete XFAIL for a test that used to sometimes miscompile under
FreeBSD with gcc 4.2.1, a long time ago (see r113824). Noticed by Pete
Cooper.
llvm-svn: 276730
Jason Molenda [Tue, 26 Jul 2016 06:33:07 +0000 (06:33 +0000)]
Add support for an additional dictionary in the per-arch plists
that may be embedded in the Contents/Resources subdir of a dSYM
bundle. These allow for the specification of a build-time path
to debug-time path remapping for source files. Files may be built
in /BuildDirectory/sources/project-100 but when the debugger is
run, they're actually found via ~sources/project-100 - this plist
allows for that remapping through the DBGBuildSourcePath and
DBGSourcePath keys.
This patch adds support for a new DBGSourcePathRemapping
dictionary in the plist where the keys are the build-time paths
and the values are the debug-time paths that they should be
remapped to. There are instances were we have multiple possible
build-time paths that need to be included, so the dictionary was
required.
<rdar://problem/
26725174>
llvm-svn: 276729
David Majnemer [Tue, 26 Jul 2016 05:52:37 +0000 (05:52 +0000)]
Update for LLVM changes
InstSimplify has gained the ability to remove needless bitcasts which
perturbed some clang codegen tests.
llvm-svn: 276728
David Majnemer [Tue, 26 Jul 2016 05:52:29 +0000 (05:52 +0000)]
Reapply: [InstSimplify] Add support for bitcasts"
This reverts commit r276700 and reapplies r276698.
The relevant clang tests have been updated.
llvm-svn: 276727
Kelvin Li [Tue, 26 Jul 2016 04:32:50 +0000 (04:32 +0000)]
[OpenMP] diagnose orphaned teams construct
The OpenMP spec mandates that 'a teams construct must be contained within a
target construct'. Currently, this scenario is not diagnosed. This patch is
to add check for orphaned teams construct and issue an error message.
Differential Revision: https://reviews.llvm.org/D22785
llvm-svn: 276726
Amaury Sechet [Tue, 26 Jul 2016 04:20:30 +0000 (04:20 +0000)]
Propery format doccomment in lto.h . NFC
llvm-svn: 276725
Matthias Braun [Tue, 26 Jul 2016 03:57:45 +0000 (03:57 +0000)]
LiveIntervalAnalysis: Fix handleMoveDown() problem
If we move a last-use register read to a later position we may skip
intermediate segments. This may require us to not only extend the
segment before the NewIdx, but also extend the segment live-in to
OldIdx.
This switches LiveIntervalTest to use AMDGPU so we can test subregister
liveness.
llvm-svn: 276724
Tim Northover [Tue, 26 Jul 2016 03:29:18 +0000 (03:29 +0000)]
GlobalISel: remove redundant ';'s. NFC
llvm-svn: 276723
Jason Molenda [Tue, 26 Jul 2016 03:10:15 +0000 (03:10 +0000)]
DynamicLoaderDarwinKernel will look in four addresses for the kernel
load address on 64-bit devices; it only needs to look in three.
<rdar://problem/
27061405>
llvm-svn: 276721
Peter Collingbourne [Tue, 26 Jul 2016 02:10:56 +0000 (02:10 +0000)]
Add qualification to fix MSVC build.
llvm-svn: 276720
Peter Collingbourne [Tue, 26 Jul 2016 02:00:42 +0000 (02:00 +0000)]
COFF: Implement /linkrepro flag.
This flag is implemented similarly to --reproduce in the ELF linker.
This patch implements /linkrepro by moving the cpio writer and associated
utility functions to lldCore, and using that implementation in both linkers.
One COFF-specific detail is that we store the object file from which the
resource files were created in our reproducer, rather than the resource
files themselves. This allows the reproducer to be used on non-Windows
systems for example.
Differential Revision: https://reviews.llvm.org/D22418
llvm-svn: 276719
Chris Bieneman [Tue, 26 Jul 2016 00:47:52 +0000 (00:47 +0000)]
[CMake] Updating Xcode Toolchain creation to support Xcode 7
Recent changes to Xcode have changed the structure of Xcode toolchains. This patch makes the xcode-toolchain goop construct a new-format Xcode toolchain that is compatible with Xcode 7.
The new format has a compatibility version key, so when a new format comes out we can support multiple formats in parallel.
llvm-svn: 276718
Rui Ueyama [Tue, 26 Jul 2016 00:27:36 +0000 (00:27 +0000)]
Split getPhdrsIndices. NFC.
llvm-svn: 276717
Vedant Kumar [Tue, 26 Jul 2016 00:24:59 +0000 (00:24 +0000)]
[Coverage] Do not write out coverage mappings with zero entries
After r275121, we stopped mapping regions from system headers. Lambdas
declared in regions belonging to system headers started producing empty
coverage mappings, since the files corresponding to their spelling locs
were being ignored.
The coverage reader doesn't know what to do with these empty mappings.
This commit makes sure that we don't produce them and adds a test. I'll
make the reader stricter in a follow-up commit.
llvm-svn: 276716
Rui Ueyama [Tue, 26 Jul 2016 00:21:15 +0000 (00:21 +0000)]
Replace std::find_if with plain for loop. NFC.
llvm-svn: 276715
Sebastian Pop [Tue, 26 Jul 2016 00:15:10 +0000 (00:15 +0000)]
GVN-hoist: use a DFS numbering of instructions (PR28670)
Instead of DFS numbering basic blocks we now DFS number instructions that avoids
the costly operation of which instruction comes first in a basic block.
Patch mostly written by Daniel Berlin.
Differential Revision: https://reviews.llvm.org/D22777
llvm-svn: 276714
Sebastian Pop [Tue, 26 Jul 2016 00:15:08 +0000 (00:15 +0000)]
GVN-hoist: limit hoisting depth (PR28670)
This patch adds an option to specify the maximum depth in a BB at which to
consider hoisting instructions. Hoisting instructions from a deeper level is
not profitable as it increases register pressure and compilation time.
Differential Revision: https://reviews.llvm.org/D22772
llvm-svn: 276713
Evgeniy Stepanov [Tue, 26 Jul 2016 00:05:14 +0000 (00:05 +0000)]
[safestack] Fix stack guard live range.
Stack guard slot is live throughout the function.
llvm-svn: 276712
Chris Bieneman [Mon, 25 Jul 2016 23:48:14 +0000 (23:48 +0000)]
[CMake] Pass DYLD_LIBRARY_PATH as CMake variable instead of as envar
On OS X 10.11 System Integrity Protection prevents the DYLD environment variables from being set on system binaries. To work around this r276710 accepts DYLD_LIBRARY_PATH as a CMake variable and sets it directly on the archiver commands.
To make this work with bootstrapping we need to set DYLD_LIBRARY_PATH to the current stage's library directory and pass that into the next stage's configuration.
llvm-svn: 276711
Chris Bieneman [Mon, 25 Jul 2016 23:46:08 +0000 (23:46 +0000)]
[CMake] Support feeding DYLD_LIBRARY_PATH into archiver calls
OS X 10.11 has a feature named System Integrity Protection. The goal of the feature is to make system binaries immutable (even as root). One part of this is that protected binaries do not receive DYLD_* environment variables because the kernel scrubs them before process launch.
This causes problems for LTO bootstrap builds on Darwin that try to use the just-built libLTO with the host ar, ranlib, or libtool.
This patch addresses two problems.
(1) The tools themselves aren't protected binaries but the shim tools installed at / are, so we need to call xcrun -find to find libtool instead of using the one CMake finds.
(2) Some build tools (ninja and make) use /bin/sh to invoke their subprocesses. Since /bin/sh is a system binary, the kernel scrubs the DYLD envars from their environment. To work around this we need to set the environment variables as part of the archiver commands, so the envars are set by the shell process instead of on the shell process.
llvm-svn: 276710
Enrico Granata [Mon, 25 Jul 2016 23:26:24 +0000 (23:26 +0000)]
Print a warning if the directory passed to --test-subdir doesn't end up existing
llvm-svn: 276709
Xinliang David Li [Mon, 25 Jul 2016 23:12:53 +0000 (23:12 +0000)]
Define compatibility flag if not defined with -std=c++
llvm-svn: 276708
Adam Nemet [Mon, 25 Jul 2016 23:09:10 +0000 (23:09 +0000)]
[lit] Don't match tool names within new PM's <> markers
For example, stop expanding 'opt' in -passes='require<opt-remark-emit>'.
llvm-svn: 276707
Rui Ueyama [Mon, 25 Jul 2016 22:51:07 +0000 (22:51 +0000)]
Split LinkerScript::createSections into small functions.
createSections function is getting longer, so it is time to split it
into small functions. The reason why the function is long is because
it has deeply nested for-loops. This patch constructs temporary data
to reduce nesting level.
Differential Revision: https://reviews.llvm.org/D22786
llvm-svn: 276706
Rui Ueyama [Mon, 25 Jul 2016 22:41:42 +0000 (22:41 +0000)]
Fix parameter names.
match() returns true of the first argument, a target string, matches
one of the second argument, a list of glob patterns. Calling the
target string, which is not a glob pattern, "Pattern" was very confusing.
llvm-svn: 276705
Jan Vesely [Mon, 25 Jul 2016 22:36:22 +0000 (22:36 +0000)]
Make min follow the OCL 1.0 specs
OpenCL 1.0: "Returns y if y < x, otherwise it returns x. If x *and* y
are infinite or NaN, the return values are undefined."
OpenCL 1.1+: "Returns y if y < x, otherwise it returns x. If x *or* y
are infinite or NaN, the return values are undefined."
The 1.0 version is stricter so use that one.
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 276704
Michael Kuperstein [Mon, 25 Jul 2016 22:29:04 +0000 (22:29 +0000)]
Attempt to pacify windows bots, again.
llvm-svn: 276703
Rui Ueyama [Mon, 25 Jul 2016 22:26:28 +0000 (22:26 +0000)]
Do not pass InputFile to reportDiscarded().
Because the file from which an input section is created can be
obtained using getFile().
llvm-svn: 276702
Renato Golin [Mon, 25 Jul 2016 22:25:25 +0000 (22:25 +0000)]
[ARM] Saturation instructions are DSP-only
The saturation instructions appeared in v6T2, with DSP extensions, but they
were being accepted / generated on any, with the new introduction of the
saturation detection in the back-end. This commit restricts the usage to
DSP-enable only cores.
Fixes PR28607.
llvm-svn: 276701
David Majnemer [Mon, 25 Jul 2016 22:24:59 +0000 (22:24 +0000)]
Revert "[InstSimplify] Add support for bitcasts"
This reverts commit r276698. Clang has tests which rely on the
optimizer :(
llvm-svn: 276700
David Majnemer [Mon, 25 Jul 2016 22:04:58 +0000 (22:04 +0000)]
[InstSimplify] Add support for bitcasts
BitCasts of BitCasts can be folded away as can BitCasts which don't
change the type of the operand.
llvm-svn: 276698
Rui Ueyama [Mon, 25 Jul 2016 22:00:10 +0000 (22:00 +0000)]
Make ConstraintKind an enum class.
llvm-svn: 276697
Akira Hatanaka [Mon, 25 Jul 2016 21:58:19 +0000 (21:58 +0000)]
[Sema][ObjC] Compute the nullability of a conditional expression based
on the nullabilities of its operands.
This commit is a follow-up to r276076 and enables
computeConditionalNullability to compute the merged nullability when
the operands are objective-c pointers.
rdar://problem/
22074116
llvm-svn: 276696
Davide Italiano [Mon, 25 Jul 2016 21:47:13 +0000 (21:47 +0000)]
[LinkerScript] Refactor KEEP handling in a separate function
This will grow because I have a patch to support more complex
constructs, e.g.:
KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
Let's make this a separate function.
llvm-svn: 276695
David Blaikie [Mon, 25 Jul 2016 21:41:42 +0000 (21:41 +0000)]
[WebAssembly] Update for Target API (TargetRegistry::RegisterMCAsmBackend) change
llvm-svn: 276694
Rui Ueyama [Mon, 25 Jul 2016 21:30:00 +0000 (21:30 +0000)]
Re-commit "Split LinkerScript::createSections".
Re-commit r276543 with a fix for buildbots.
llvm-svn: 276693
Simon Pilgrim [Mon, 25 Jul 2016 21:14:22 +0000 (21:14 +0000)]
[X86] Regenerate v2i256 shift legalization tests
llvm-svn: 276692
Simon Pilgrim [Mon, 25 Jul 2016 21:11:45 +0000 (21:11 +0000)]
[X86] Regenerate i64 shift legalization tests
llvm-svn: 276691
Tim Northover [Mon, 25 Jul 2016 21:01:29 +0000 (21:01 +0000)]
GlobalISel: add generic casts to IRTranslator
This adds LLVM's 3 main cast instructions (inttoptr, ptrtoint, bitcast) to the
IRTranslator. The first two are direct translations (with 2 MachineInstr types
each). Since LLT discards information, a bitcast might become trivial and we
emit a COPY in those cases instead.
llvm-svn: 276690
Tim Northover [Mon, 25 Jul 2016 21:01:17 +0000 (21:01 +0000)]
GlobalISel[AArch64]: support pointer types in argument lowering.
They're basically i64 for AArch64, but we'll leave them intact for stranger
targets. Also add some tests for the (very few) other cases we can handle right
now.
llvm-svn: 276689
Michael Kuperstein [Mon, 25 Jul 2016 20:52:00 +0000 (20:52 +0000)]
[PM] Port SymbolRewriter to the new PM
Differential Revision: https://reviews.llvm.org/D22703
llvm-svn: 276687
Kevin Enderby [Mon, 25 Jul 2016 20:36:36 +0000 (20:36 +0000)]
Next step along the way to getting good error messages for bad archives.
I consulted with Lang Hames on this work, and the goal was to add a bit
of "where" in the archive the error occurred along with what the error was.
So this step changes ArchiveMemberHeader into a class with a pointer
to the archive header and the parent archive. Which allows the methods
in the ArchiveMemberHeader to determine which member the header is
for to include that information in the error message.
For this first step the "where" is just the offset to the member in the
archive. The next step will be a new method on ArchiveMemberHeader
to get the full name, if possible, to be use in the error message. Which
will now be possible as ArchiveMemberHeader contains a pointer to
the Archive with its string table and its size, etc. so the full name can
be determined from the header if it is valid.
Also this change adds the missing checks the archive header is actually
contained in the buffer and is not truncated, as well as if the terminating
characters are correct in the header.
And changes one error message in Archive::Child::getNext() where the
name or offset to member is now added.
llvm-svn: 276686
Jordan Rose [Mon, 25 Jul 2016 20:34:25 +0000 (20:34 +0000)]
Fix r276671 to not use a defaulted move constructor.
MSVC won't provide the body of this move constructor and assignment
operator, possibly because the copy constructor is banned. Just write
it manually.
llvm-svn: 276685