David Gross [Thu, 8 Dec 2016 21:15:17 +0000 (21:15 +0000)]
[DebugInfo] Relax test case for long double constants.
Summary:
D27549 (partial fix for PR26619) emits a constant value in the debug
metadata for a floating-point static const that does not exceed 64
bits in size. The regression test accompanying that fix assumes that
a long double exceeds 64 bits in size and hence does not get a
constant value in the debug metadata. However, for some targets --
such as "--target=hexagon-unknown-elf" -- a long double does not
exceed 64 bits in size, and hence the test fails.
As a temporary fix, modify the regression test to no longer inspect
the debug metadata for a long double.
Reviewers: cfe-commits, probinson
Differential Revision: https://reviews.llvm.org/D27589
llvm-svn: 289103
Rui Ueyama [Thu, 8 Dec 2016 20:50:47 +0000 (20:50 +0000)]
Remove unnecessary `llvm::`.
llvm-svn: 289102
Reid Kleckner [Thu, 8 Dec 2016 20:38:46 +0000 (20:38 +0000)]
Don't emit .seh_handler directives for any cleanup funclets
We were falsely claiming that we had an LSDA for the relevant EH
personality before this change, which could lead to the EH machinery
interpreting random adjacent data as an LSDA.
Fixes PR31317
This change is safe because cleanups can't contain exception handlers
today. We do these things to maintain that invariant:
- C++ destructors are naturally out-of-line
- __finally blocks are outlined in clang
- LLVM's inliner will not inline EH constructs into cleanups
llvm-svn: 289101
Greg Clayton [Thu, 8 Dec 2016 20:38:19 +0000 (20:38 +0000)]
Fixed a crasher that has been borking out heap for a long time.
ThreadList had an assignment operator that didn't lock the "rhs" thread list object. This means a thread list can be mutated while it is being copied.
The copy constructor calls the assignment operator as well. So this fixes the unsafe threaded access to ThreadList which we believe is responsible for a lot of crashes.
<rdar://problem/
28075793>
llvm-svn: 289100
Krzysztof Parzyszek [Thu, 8 Dec 2016 20:33:45 +0000 (20:33 +0000)]
[RDF] Fix incorrect lane mask calculation
This was exposed by some code that used more than one level of sub-
registers. There is no testcase, because there is no such code in the
Hexagon backend.
llvm-svn: 289099
Sanjay Patel [Thu, 8 Dec 2016 20:23:56 +0000 (20:23 +0000)]
[InstSimplify] add fdiv x/1.0 test and update checks; NFC
llvm-svn: 289098
Rui Ueyama [Thu, 8 Dec 2016 20:20:22 +0000 (20:20 +0000)]
COFF: Use make() to create a new file object in createFile.
llvm-svn: 289097
Matt Arsenault [Thu, 8 Dec 2016 20:14:46 +0000 (20:14 +0000)]
AMDGPU: Make f16 ConstantFP legal
Not having this legal led to combine failures, resulting
in dumb things like bitcasts of constants not being folded
away.
The only reason I'm leaving the v_mov_b32 hack that f32
already uses is to avoid madak formation test regressions.
PeepholeOptimizer has an ordering issue where the immediate
fold attempt is into the sgpr->vgpr copy instead of the actual
use. Running it twice avoids that problem.
llvm-svn: 289096
Stanislav Mekhanoshin [Thu, 8 Dec 2016 20:07:23 +0000 (20:07 +0000)]
[AMDGPU] Fix number of reserved SGPRs on CI to reflect flat scratch use
Differential Revision: https://reviews.llvm.org/D27225
llvm-svn: 289095
David Gross [Thu, 8 Dec 2016 20:02:46 +0000 (20:02 +0000)]
[DebugInfo] Add support for __fp16, float, and double constants.
Summary:
Partial fix for PR26619.
Prior to this change, a DIGlobalVariable corresponding to a static
const was marked with an expression corresponding to its constant
value only if it is of integral type. With this change, we now do the
same if it is of __fp16, float, or double type (that is,
floating-point types that do not exceed 64 bits in size, and hence are
supported easily by the existing LLVM machinery for creating constant
expressions in debug info).
Reviewers: llvm-commits
Differential Revision: https://reviews.llvm.org/D27549
llvm-svn: 289094
Matt Arsenault [Thu, 8 Dec 2016 19:52:38 +0000 (19:52 +0000)]
AMDGPU: Fix commuting v_sub_u16
The correct commutable opcode was set to itself, so this
was simply swapping the operands to commute instead of also
changing the opcode to v_subrev_u16.
llvm-svn: 289093
Stanislav Mekhanoshin [Thu, 8 Dec 2016 19:46:04 +0000 (19:46 +0000)]
[AMDGPU] Add amdgpu-unify-metadata pass
Multiple metadata values for records such as opencl.ocl.version, llvm.ident
and similar are created after linking several modules. For some of them, notably
opencl.ocl.version, this creates semantic problem because we cannot tell which
version of OpenCL the composite module conforms.
Moreover, such repetitions of identical values often create a huge list of
unneeded metadata, which grows bitcode size both in memory and stored on disk.
It can go up to several Mb when linked against our OpenCL library. Lastly, such
long lists obscure reading of dumped IR.
The pass unifies metadata after linking.
Differential Revision: https://reviews.llvm.org/D25381
llvm-svn: 289092
Artem Belevich [Thu, 8 Dec 2016 19:38:13 +0000 (19:38 +0000)]
[CUDA] Ignore implicit target attributes during function template instantiation.
Some functions and templates are treated as __host__ __device__ even
when they don't have explicitly specified target attributes.
What's worse, this treatment may change depending on command line
options (-fno-cuda-host-device-constexpr) or
#pragma clang force_cuda_host_device.
Combined with strict checking for matching function target that comes
with D25809(r288962), it makes it hard to write code which would
explicitly instantiate or specialize some functions regardless of
pragmas or command line options in effect.
This patch changes the way we match target attributes of base template
vs attributes used in explicit instantiation or specialization so that
only explicitly specified attributes are considered. This makes base
template selection behave consistently regardless of pragma of command
line options that may affect CUDA target.
Differential Revision: https://reviews.llvm.org/D25845
llvm-svn: 289091
Vitaly Buka [Thu, 8 Dec 2016 19:13:13 +0000 (19:13 +0000)]
[asan] Add test which detects bugs undetectable before r288563
Reviewers: kcc, eugenis
Subscribers: llvm-commits, kubabrecka
Differential Revision: https://reviews.llvm.org/D27583
llvm-svn: 289090
Rui Ueyama [Thu, 8 Dec 2016 19:10:28 +0000 (19:10 +0000)]
Start using make() in COFF (with a smaller change.)
llvm-svn: 289089
Kostya Kortchinsky [Thu, 8 Dec 2016 19:05:46 +0000 (19:05 +0000)]
[sanitizer] Do not use the alignment-rounded-up size when using the secondary
Summary:
The combined allocator rounds up the requested size with regard to the
alignment, which makes sense when being serviced by the primary as it comes
with alignment guarantees, but not with the secondary. For the rare case of
large alignments, it wastes memory, and entices unnecessarily large fields for
the Scudo header. With this patch, we pass the non-alignement-rounded-up size
to the secondary, and adapt the Scudo code for this change.
Reviewers: alekseyshl, kcc
Subscribers: llvm-commits, kubabrecka
Differential Revision: https://reviews.llvm.org/D27428
llvm-svn: 289088
Peter Collingbourne [Thu, 8 Dec 2016 19:01:00 +0000 (19:01 +0000)]
IR, X86: Understand !absolute_symbol metadata on global variables.
Summary:
Attaching !absolute_symbol to a global variable does two things:
1) Marks it as an absolute symbol reference.
2) Specifies the value range of that symbol's address.
Teach the X86 backend to allow absolute symbols to appear in place of
immediates by extending the relocImm and mov64imm32 matchers. Start using
relocImm in more places where it is legal.
As previously proposed on llvm-dev:
http://lists.llvm.org/pipermail/llvm-dev/2016-October/105800.html
Differential Revision: https://reviews.llvm.org/D25878
llvm-svn: 289087
Rui Ueyama [Thu, 8 Dec 2016 18:49:04 +0000 (18:49 +0000)]
Revert r289084: Start using make() in COFF.
This reverts commit r289084 to appease buildbots.
llvm-svn: 289086
Rui Ueyama [Thu, 8 Dec 2016 18:31:18 +0000 (18:31 +0000)]
Start using make() in COFF.
We don't want ELF and COFF to diverge too much.
llvm-svn: 289085
Rui Ueyama [Thu, 8 Dec 2016 18:31:13 +0000 (18:31 +0000)]
Move Memory.{h,cpp} to lld/Support so that we can use them from COFF.
llvm-svn: 289084
Ekaterina Romanova [Thu, 8 Dec 2016 17:57:23 +0000 (17:57 +0000)]
[DOXYGEN] Improved doxygen comments.
Improved doxygen comments for __wmmintrin_pclmul.h and ammintrin.h intrinsics by taagging parameter names with \a doxygen command to display parameters in italics.
Formatted comments to fit into 80 chars.
llvm-svn: 289083
Rafael Espindola [Thu, 8 Dec 2016 17:54:26 +0000 (17:54 +0000)]
Change the implementation of --dynamic-list to use linker script parsing.
The feature is documented as
-----------------------------
The format of the dynamic list is the same as the version node
without scope and node name. See *note VERSION:: for more
information.
--------------------------------
And indeed qt uses a dynamic list with an 'extern "C++"' in it. With
this patch we support that
The change to gc-sections-shared makes us match bfd. Just because we
kept bar doesn't mean it has to be in the dynamic symbol table.
The changes to invalid-dynamic-list.test and reproduce.s are because
of the new parser.
The changes to version-script.s are the only case where we change
behavior with regards to bfd, but I would like to see a mix of
--version-script and --dynamic-list used in the wild before
complicating the code.
llvm-svn: 289082
Rui Ueyama [Thu, 8 Dec 2016 17:48:52 +0000 (17:48 +0000)]
Use `make` to simplify. NFC.
llvm-svn: 289081
Chris Bieneman [Thu, 8 Dec 2016 17:46:57 +0000 (17:46 +0000)]
[ObjectYAML] Remove DWARF from class names
Since all the DWARF classes are in a DWARFYAML namespace having every class start with DWARF seems like a bit of overkill.
llvm-svn: 289080
Rui Ueyama [Thu, 8 Dec 2016 17:44:39 +0000 (17:44 +0000)]
Use make to instantiate Target and LinkerScript. NFC.
llvm-svn: 289079
Rui Ueyama [Thu, 8 Dec 2016 17:44:37 +0000 (17:44 +0000)]
Split LinkerDriver::link. NFC.
llvm-svn: 289078
Rui Ueyama [Thu, 8 Dec 2016 17:32:58 +0000 (17:32 +0000)]
Remove a special handling of AMDGPU entry points.
This is the last peculiar semantics left in the linker. If you want to
always set an entry point to 0, you can pass `-e 0` to the linker.
Differential Revision: https://reviews.llvm.org/D27532
llvm-svn: 289077
Alexander Timofeev [Thu, 8 Dec 2016 17:28:47 +0000 (17:28 +0000)]
[AMDGPU] Scalarization of global uniform loads.
Summary:
LC can currently select scalar load for uniform memory access
basing on readonly memory address space only. This restriction
originated from the fact that in HW prior to VI vector and scalar caches
are not coherent. With MemoryDependenceAnalysis we can check that the
memory location corresponding to the memory operand of the LOAD is not
clobbered along the all paths from the function entry.
Reviewers: rampitec, tstellarAMD, arsenm
Subscribers: wdng, arsenm, nhaehnle
Differential Revision: https://reviews.llvm.org/D26917
llvm-svn: 289076
Douglas Yung [Thu, 8 Dec 2016 17:27:20 +0000 (17:27 +0000)]
Fixing test to work when the compiler defaults to a different C++ standard version.
Differential Revision: https://reviews.llvm.org/D27488
llvm-svn: 289075
Rafael Espindola [Thu, 8 Dec 2016 17:26:53 +0000 (17:26 +0000)]
Add support for 'extern "C"'.
It is used by Qt.
llvm-svn: 289074
Keno Fischer [Thu, 8 Dec 2016 17:22:35 +0000 (17:22 +0000)]
ConstantFolding: Don't crash when encountering vector GEP
ConstantFolding tried to cast one of the scalar indices to a vector
type. Instead, use the vector type only for the first index (which
is the only one allowed to be a vector) and use its scalar type
otherwise.
Fixes PR31250.
Reviewers: majnemer
Differential Revision: https://reviews.llvm.org/D27389
llvm-svn: 289073
Rui Ueyama [Thu, 8 Dec 2016 17:18:09 +0000 (17:18 +0000)]
Make function names shorter. NFC.
llvm-svn: 289072
Rui Ueyama [Thu, 8 Dec 2016 17:04:18 +0000 (17:04 +0000)]
Do not use template where template is not needed.
Compilers can inline and optimize this code in the same way as template.
llvm-svn: 289071
Greg Clayton [Thu, 8 Dec 2016 16:57:04 +0000 (16:57 +0000)]
Fix ASAN buildbots by fixing a double free crash.
The dwarfgen::Generator::StringPool was in a unique_ptr but it was owned by the Allocator member variable so it was being free twice.
llvm-svn: 289070
Rafael Espindola [Thu, 8 Dec 2016 16:51:56 +0000 (16:51 +0000)]
Make this test more strict. NFC.
llvm-svn: 289069
Alex Lorenz [Thu, 8 Dec 2016 16:49:05 +0000 (16:49 +0000)]
[CodeCompletion][ObjC] Use a parameterized NSSet return type for
keyPathsForValuesAffecting* KVO completion results
rdar://
23791701
llvm-svn: 289068
Rafael Espindola [Thu, 8 Dec 2016 16:26:20 +0000 (16:26 +0000)]
Inline function called only once.
llvm-svn: 289067
Rafael Espindola [Thu, 8 Dec 2016 16:20:29 +0000 (16:20 +0000)]
Handle C++ names in anon scripts.
llvm-svn: 289066
Rafael Espindola [Thu, 8 Dec 2016 16:02:48 +0000 (16:02 +0000)]
Inline two functions called only once. NFC.
llvm-svn: 289065
Rafael Espindola [Thu, 8 Dec 2016 15:56:33 +0000 (15:56 +0000)]
Add two helper functions. NFC.
llvm-svn: 289064
Etienne Bergeron [Thu, 8 Dec 2016 15:53:33 +0000 (15:53 +0000)]
[compiler-rt][asan] Fix overlaping parameters for memmove/memcpy on windows.
Summary:
On windows, memmove and memcpy may be the same functions (on 64-bits).
```
-- f:\dd\vctools\crt\vcruntime\src\string\amd64\memcpy.asm --------------------
OPTION PROLOGUE:NONE, EPILOGUE:NONE
memmove = memcpy
mov r11, rcx ; save destination address
```
This is causing ASAN to report overlaping parameters when instrumenting chromium.
```
D:\src\chromium\src>out\asan64\chrome.exe --no-sandbox
[8956:6208:1121/162511:ERROR:entry.cc(167)] Entry::Deserialize: dictionary has no interface_provider_specs key
[8956:11560:1121/162511:ERROR:external_registry_loader_win.cc(130)] Missing value path for key Software\Google\Chrome\Ex
tensions\doeiiacdhfmpdeckdaifnjaemmkkdlkf.
=================================================================
==5132==ERROR: AddressSanitizer: memcpy-param-overlap: memory ranges [0x000000237ee8,0x000000237eea) and [0x000000237ee9
, 0x000000237eeb) overlap
```
The error triggered on chromium:
```
Child-SP RetAddr Call Site
00000000`
00166520 00000001`
400a4886 chrome!__asan::ReportStringFunctionMemoryRangesOverlap+0x23 [d:\src\llvm\llvm\projects\compiler-rt\lib\asan\asan_report.cc @ 305]
*** WARNING: Unable to verify checksum for D:\src\chromium\src\out\asan64dynamic\libglesv2.dll
00000000`
001672a0 000007fe`
e1859607 chrome!__asan_wrap_memcpy+0xf6 [d:\src\llvm\llvm\projects\compiler-rt\lib\asan\asan_interceptors.cc @ 458]
00000000`
00167b30 000007fe`
e184bcbc libglesv2!__acrt_fp_strflt_to_string+0xb7 [d:\th\minkernel\crts\ucrt\src\appcrt\convert\_fptostr.cpp @ 86]
(Inline Function) --------`-------- libglesv2!fp_format_f+0x57 [d:\th\minkernel\crts\ucrt\src\appcrt\convert\cvt.cpp @ 578]
00000000`
00167b60 000007fe`
e182e2a2 libglesv2!__acrt_fp_format+0x180 [d:\th\minkernel\crts\ucrt\src\appcrt\convert\cvt.cpp @ 722]
00000000`
00167bf0 000007fe`
e182ce80 libglesv2!__crt_stdio_output::output_processor<char,__crt_stdio_output::stream_output_adapter<char>,__crt_stdio_output::format_validation_
```
This bug is similar to: https://llvm.org/bugs/show_bug.cgi?id=16362
Reviewers: rnk, zaks.anna, filcab
Subscribers: filcab, kubabrecka, chrisha, llvm-commits, dberris
Differential Revision: https://reviews.llvm.org/D27052
llvm-svn: 289063
Rafael Espindola [Thu, 8 Dec 2016 15:36:58 +0000 (15:36 +0000)]
Simplify. NFC.
llvm-svn: 289062
Simon Atanasyan [Thu, 8 Dec 2016 15:29:17 +0000 (15:29 +0000)]
[ELF] Correct addAbsolute function argument name
Follow-up to r289025.
llvm-svn: 289061
NAKAMURA Takumi [Thu, 8 Dec 2016 15:28:02 +0000 (15:28 +0000)]
Prune unused libdeps.
llvm-svn: 289060
Alex Lorenz [Thu, 8 Dec 2016 15:09:40 +0000 (15:09 +0000)]
[CodeCompletion] Provide Objective-C class property completion results
This commit provides class property code completion results. It supports
explicit and implicit class properties, but the special block completion is done
only for explicit properties right now.
rdar://
25636195
Differential Revision: https://reviews.llvm.org/D27053
llvm-svn: 289058
NAKAMURA Takumi [Thu, 8 Dec 2016 15:00:12 +0000 (15:00 +0000)]
Prune unused \param(s) in r289050. [-Wdocumentation]
llvm-svn: 289057
NAKAMURA Takumi [Thu, 8 Dec 2016 15:00:07 +0000 (15:00 +0000)]
DIE::addAttribute(): Prune a redundant \param. [-Wdocumentation]
llvm-svn: 289056
Alex Lorenz [Thu, 8 Dec 2016 14:46:05 +0000 (14:46 +0000)]
[Sema] Avoid "case value not in enumerated type" warning for C++11 opaque enums
This commit ensures that the switch warning "case value not in enumerated type"
isn't shown for opaque enums. We don't know the actual list of values in opaque
enums, so that warning is incorrect.
rdar://
29230764
Differential Revision: https://reviews.llvm.org/D27299
llvm-svn: 289055
NAKAMURA Takumi [Thu, 8 Dec 2016 14:26:30 +0000 (14:26 +0000)]
LanaiInstPrinter: Prune unused libdeps.
llvm-svn: 289054
NAKAMURA Takumi [Thu, 8 Dec 2016 14:26:23 +0000 (14:26 +0000)]
DebugInfoDWARFTests: Prune unused libdeps.
llvm-svn: 289053
NAKAMURA Takumi [Thu, 8 Dec 2016 14:11:02 +0000 (14:11 +0000)]
DebugInfoDWARFTests: Add missing deps, AsmPrinter and Object.
llvm-svn: 289052
NAKAMURA Takumi [Thu, 8 Dec 2016 14:10:57 +0000 (14:10 +0000)]
DebugInfoDWARFTests: Reorder LLVM_LINK_COMPONENTS.
llvm-svn: 289051
Nicolai Haehnle [Thu, 8 Dec 2016 14:08:14 +0000 (14:08 +0000)]
[SelectionDAG] Add expansion and promotion of [US]MUL_LOHI
Summary:
Most targets set the action for these nodes to Expand even though there
isn't actually any code for them in ExpandNode. Instead, targets simply
relied on the fact that no code generates these nodes as long as the
nodes aren't legal or custom.
However, generating these nodes can be useful e.g. for divide-by-constant
in wider integer types.
Expand of [US]MUL_LOHI will use MULH[US] when legal or custom, and
a sequence of half-width multiplications otherwise. Promote uses a wider
multiply.
This patch intends to not change the generated code, but indirect effects
are possible since expansions/promotions that were previously done in
DAGCombine may now be done in LegalizeDAG.
See D24822 for a change that actually uses the new expansion.
Reviewers: spatel, bkramer, venkatra, efriedma, hfinkel, ast, nadav, tstellarAMD
Subscribers: arsenm, jyknight, nemanjai, wdng, nhaehnle, llvm-commits
Differential Revision: https://reviews.llvm.org/D24956
llvm-svn: 289050
Nicolai Haehnle [Thu, 8 Dec 2016 14:08:08 +0000 (14:08 +0000)]
X86: Add checks for fma_patterns[_wide].ll with -enable-no-infs-fp-math
This re-adds checks for the patterns that were disabled with r288506.
Reviewers: spatel, delena, craig.topper
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D27346
llvm-svn: 289049
Nicolai Haehnle [Thu, 8 Dec 2016 14:08:02 +0000 (14:08 +0000)]
AMDGPU: Properly implement SIRegisterInfo::isFrameOffsetLegal and needsFrameBaseReg
Summary:
Without the fix to isFrameOffsetLegal to consider the instruction's
immediate offset, the new test case hits the corresponding assertion in
resolveFrameIndex, because the LocalStackSlotAllocation pass re-uses a
different base register.
With only the fix to isFrameOffsetLegal, code quality reduces in a bunch of
places because frame base registers are added where they're not needed.
This is addressed by properly implementing needsFrameBaseReg, which also
helps to avoid unnecessary zero frame indices in a bunch of other places.
Fixes piglit glsl-1.50/execution/variable-indexing/gs-output-array-vec4-index-wr.shader_test
Reviewers: arsenm, tstellarAMD
Subscribers: qcolombet, kzhuravl, wdng, yaxunl, tony-tye, llvm-commits
Differential Revision: https://reviews.llvm.org/D27344
llvm-svn: 289048
Artem Dergachev [Thu, 8 Dec 2016 14:05:48 +0000 (14:05 +0000)]
[analyzer] Add dispatch_data_create as a special case in RetainCountChecker.
This function receives a callback block. The analyzer suspects that this block
may be used to take care of releasing the libdispatch object returned from
the function. In fact, it doesn't - it only releases the raw data buffer.
Inform the analyzer about that. Fixes the resulting false negatives.
rdar://problem/
22280098
Differential Revision: https://reviews.llvm.org/D27409
llvm-svn: 289047
George Rimar [Thu, 8 Dec 2016 13:50:28 +0000 (13:50 +0000)]
[ELF] - Read 16 bits for R_386_16/R_386_PC16 relocations instead of 32.
Looks it was theoretically incorrect if the section is at the very end of the file as
reading 32 bits would pass the end of file
llvm-svn: 289046
Peter Smith [Thu, 8 Dec 2016 12:58:55 +0000 (12:58 +0000)]
[ELF] ifunc implementation using synthetic sections
This change introduces new synthetic sections IpltSection, IgotPltSection
that represent the ifunc entries that would previously have been put in
the PltSection and the GotPltSection. The separation makes sure that
the R_*_IRELATIVE relocations are placed after the non R_*_IRELATIVE
relocations, which permits ifunc resolvers to know that the .got.plt
slots will be initialized prior to the resolver being called.
A secondary benefit is that for ARM we can move the IgotPltSection and its
dynamic relocations to the .got and .rel.dyn as the ARM glibc expects all
the R_*_IRELATIVE relocations to be in the .rel.dyn
Differential revision: https://reviews.llvm.org/D27406
llvm-svn: 289045
Daniel Jasper [Thu, 8 Dec 2016 12:45:29 +0000 (12:45 +0000)]
Move DwarfGenerator.cpp to unittests
So far it creates a test helper and so it should be moved there. It also
create a layering cycle between CodeGen and CodeGen/AsmPrinter, which
should be avoided.
Review: https://reviews.llvm.org/D27570
llvm-svn: 289044
Alexey Bataev [Thu, 8 Dec 2016 11:57:51 +0000 (11:57 +0000)]
[SLP] Fix for PR6246: vectorization for scalar ops on vector elements.
When trying to vectorize trees that start at insertelement instructions
function tryToVectorizeList() uses vectorization factor calculated as
MinVecRegSize/ScalarTypeSize. But sometimes it does not work as tree
cost for this fixed vectorization factor is too high.
Patch tries to improve the situation. It tries different vectorization
factors from max(PowerOf2Floor(NumberOfVectorizedValues),
MinVecRegSize/ScalarTypeSize) to MinVecRegSize/ScalarTypeSize and tries
to choose the best one.
Differential Revision: https://reviews.llvm.org/D27215
llvm-svn: 289043
Malcolm Parsons [Thu, 8 Dec 2016 11:46:22 +0000 (11:46 +0000)]
[ASTMatcher] Add hasReplacementType matcher for SubstTemplateTypeParmType
Summary: Needed for https://reviews.llvm.org/D27166
Reviewers: sbenza, bkramer, klimek
Subscribers: aemerson, cfe-commits
Differential Revision: https://reviews.llvm.org/D27447
llvm-svn: 289042
Pavel Labath [Thu, 8 Dec 2016 11:45:38 +0000 (11:45 +0000)]
Fix MSCV compilation broken by r289040
I wanted to use the "not" keyword to make sure it does not get lost in between
other checks. MSVC does not like that.
llvm-svn: 289041
Pavel Labath [Thu, 8 Dec 2016 11:31:19 +0000 (11:31 +0000)]
Improve format member detection in llvm::formatv
Summary:
The existing detection of a format member function has a couple of deficiencies:
- the member function does not get detected if one calls formatv with an lvalue,
because the template parameter gets deduced as T&, which fails the is_class
check.
- it also did not work if the function was called with a const variable because
the template parameter would get deduced as const T&, again failing the
is_class check.
This fixes the problem by stripping the references in the uses_format_member
template, to make sure the type is correctly detected as class. It also provides
specializations of the has_FormatMember template for const and non-const members
of the types in order to enable declaring the format member as a "const"
function. I have added tests that verify that formatv can be now called in these
scenarios. As some scenarios could not be verified at runtime (e.g. making sure
that calling a non-const format member on a const object does *not* compile), I
have also added some static_asserts which test the behaviour of the template
classes used internally by formatv().
Reviewers: zturner
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D27525
llvm-svn: 289040
Dylan McKay [Thu, 8 Dec 2016 10:52:13 +0000 (10:52 +0000)]
[AVR] Add MIR tests for pseudo instruction expansions
This adds tests for 13 pseudo instruction expansions.
llvm-svn: 289039
Simon Pilgrim [Thu, 8 Dec 2016 10:41:41 +0000 (10:41 +0000)]
Wdocumentation fix
llvm-svn: 289038
Simon Pilgrim [Thu, 8 Dec 2016 10:31:32 +0000 (10:31 +0000)]
Wdocumentation fix
llvm-svn: 289037
Oliver Stannard [Thu, 8 Dec 2016 10:31:21 +0000 (10:31 +0000)]
Add a comment consumer mechanism to MCAsmLexer
This allows clients to register an AsmCommentConsumer with the MCAsmLexer,
which receives a callback each time a comment is parsed.
Differential Revision: https://reviews.llvm.org/D27511
llvm-svn: 289036
Simon Pilgrim [Thu, 8 Dec 2016 10:17:25 +0000 (10:17 +0000)]
[X86][SSE] Add vector test for (shl (or x, c1), c2) -> (or (shl x, c2), c1 << c2) detailed in D19325
llvm-svn: 289035
Eric Fiselier [Thu, 8 Dec 2016 10:02:04 +0000 (10:02 +0000)]
Add more test cases to packaged_task copyability test
llvm-svn: 289034
Eric Fiselier [Thu, 8 Dec 2016 09:57:00 +0000 (09:57 +0000)]
Avoid C++17 guaranteed copy elision when testing for non-copyability
llvm-svn: 289033
Sylvestre Ledru [Thu, 8 Dec 2016 09:22:24 +0000 (09:22 +0000)]
Support of mips & mips64 for openmprtl
Summary:
Implemented by Dejan Latinovic
See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=790735 for more more information
Reviewers: AndreyChurbanov, jlpeyton
Subscribers: openmp-commits, mgorny
Differential Revision: https://reviews.llvm.org/D26576
llvm-svn: 289032
Dylan McKay [Thu, 8 Dec 2016 08:54:41 +0000 (08:54 +0000)]
[AVR] Add MIR tests for a few pseudo instructions
llvm-svn: 289031
Dylan McKay [Thu, 8 Dec 2016 08:34:13 +0000 (08:34 +0000)]
[AVR] Add an assertion to ensure we don't emit LPM when it's unsupported
llvm-svn: 289030
Eric Fiselier [Thu, 8 Dec 2016 07:30:01 +0000 (07:30 +0000)]
Fix PR30323: numeric_limits<T>::max_digits10 when using 16 bit ints.
Summary: Also see https://llvm.org/bugs/show_bug.cgi?id=30323
Reviewers: mclow.lists
Subscribers: cfe-commits
Differential Revision: https://reviews.llvm.org/D27566
llvm-svn: 289029
Eric Fiselier [Thu, 8 Dec 2016 06:37:41 +0000 (06:37 +0000)]
Fix _LIBCPP_VERSION tests with modules on Darwin
llvm-svn: 289028
Sagar Thakur [Thu, 8 Dec 2016 06:30:58 +0000 (06:30 +0000)]
[MSAN][MIPS] Fix fork.cc test on MIPS
Summary: For platforms which support slow unwinder only, we restrict the store context size to 1, basically only storing the current pc. We do this because the slow unwinder which is based on libunwind is not async signal safe and causes random freezes in forking applications as well as in signal handlers.
Reviewed by eugenis.
Differential: D23107
llvm-svn: 289027
Jason Molenda [Thu, 8 Dec 2016 06:27:29 +0000 (06:27 +0000)]
When we interrupt a process, it was possible or the thread names
to not be set by Process::WillPublicStop() so the driver won't get
access to them. The fix is straightforward, moving the call to
WillPublicStop above the early return for the interrupt case. (the
interrupt case does an early return because the rest of the function
is concerned with running stop hooks etc and those are not applicable
when we've interrupted the process).
Also added a test case for it. The test case is a little complicated
because I needed to drive lldb asynchronously to give the program
a chance to get up and running before I interrupt it. Running to
a breakpoint was not sufficient to catch this bug.
<rdar://problem/
22693778>
llvm-svn: 289026
Simon Atanasyan [Thu, 8 Dec 2016 06:19:47 +0000 (06:19 +0000)]
[ELF][MIPS] Make _gp, _gp_disp, __gnu_local_gp global symbols
These MIPS specific symbols should be global because in general they can
have an arbitrary value. By default this value is a fixed offset from .got
section.
This patch adds more checks to the mips-gp-local.s test case but marks
it as XFAIL because LLD does not allow redefinition of absolute symbols
value by a linker script. This should be fixed by D27276.
Differential revision: https://reviews.llvm.org/D27524
llvm-svn: 289025
Peter Collingbourne [Thu, 8 Dec 2016 05:28:30 +0000 (05:28 +0000)]
LTO: Hash the parts of the LTO configuration that affect code generation.
Most importantly, we need to hash the relocation model, otherwise we can
end up trying to link non-PIC object files into PIEs or DSOs.
Differential Revision: https://reviews.llvm.org/D27556
llvm-svn: 289024
Jason Molenda [Thu, 8 Dec 2016 05:12:45 +0000 (05:12 +0000)]
Increase timeout for Frontboard app launch request from 9 to 20 seconds
to match other timeouts.
llvm-svn: 289023
Ekaterina Romanova [Thu, 8 Dec 2016 04:09:17 +0000 (04:09 +0000)]
[DOXYGEN] Improved doxygen comments for avxintrin.h intrinsics.
Tagged parameter names with \a doxygen command to display them in italics.
Formatted comments to fit into 80 chars.
llvm-svn: 289022
Richard Smith [Thu, 8 Dec 2016 03:24:55 +0000 (03:24 +0000)]
[c++1z] P0490R0, NB comment GB 20: if std::tuple_size<T> is complete, use the
tuple-like interpretation of decomposition declaration even if there is no
::value member. We already did this, anticipating this resolution, just update
comments and tweak a testcase.
llvm-svn: 289021
Rafael Espindola [Thu, 8 Dec 2016 03:17:05 +0000 (03:17 +0000)]
Delete dead code.
Thanks to George Rimar for pointing it out.
llvm-svn: 289020
Richard Smith [Thu, 8 Dec 2016 02:49:07 +0000 (02:49 +0000)]
[c++1z] P0003R5: Removing dynamic exception specifications.
We continue to support dynamic exception specifications in C++1z as an
extension, but produce an error-by-default warning when we encounter one. This
allows users to opt back into the feature with a warning flag, and implicitly
opts system headers back into the feature should they happen to use it.
There is one semantic change implied by P0003R5 but not implemented here:
violating a throw() exception specification should now call std::terminate
directly instead of calling std::unexpected(), but since P0003R5 also removes
std::unexpected() and std::set_unexpected, and the default unexpected handler
calls std::terminate(), a conforming C++1z program cannot tell that we are
still calling it. The upside of this strategy is perfect backwards
compatibility; the downside is that we don't get the more efficient 'noexcept'
codegen for 'throw()'.
llvm-svn: 289019
Bruno Cardoso Lopes [Thu, 8 Dec 2016 02:13:56 +0000 (02:13 +0000)]
[Headers] Enable #include_next<float.h> on Darwin
Allows darwin targets to provide additional definitions and
implementation specifc values for float.h
rdar://problem/
21961491
llvm-svn: 289018
Greg Clayton [Thu, 8 Dec 2016 02:11:03 +0000 (02:11 +0000)]
Unbreak buildbots where the debug info test was crashing due to unchecked error.
llvm-svn: 289017
Jason Molenda [Thu, 8 Dec 2016 02:02:45 +0000 (02:02 +0000)]
Set the address size based on the target's arch instead
of using the address of the all_image_infos struct.
<rdar://problem/
29547847>
llvm-svn: 289016
Zachary Turner [Thu, 8 Dec 2016 02:02:09 +0000 (02:02 +0000)]
Convert CommandObjectFrame to entry-based Args access.
In the process, discovered a bug related to the use of an
uninitialized-pointer, and fixed as suggested by Enrico
in an lldb-dev mailing list thread.
llvm-svn: 289015
Keno Fischer [Thu, 8 Dec 2016 01:56:23 +0000 (01:56 +0000)]
Revert "[CodeGen] Fix invalid DWARF info on Win64"
Appears to break on build bots. Reverting pending investigation.
llvm-svn: 289014
Keno Fischer [Thu, 8 Dec 2016 01:40:21 +0000 (01:40 +0000)]
[CodeGen] Fix invalid DWARF info on Win64
The relocations for `DIEEntry::EmitValue` were wrong for Win64
(emitting FK_Data_4 instead of FK_SecRel_4). This corrects that
oversight so that the DWARF data is correct in Win64 COFF files.
Fixes PR15393.
Patch by Jameson Nash <jameson@juliacomputing.com> based on a patch
by David Majnemer.
Differential Revision: https://reviews.llvm.org/D21731
llvm-svn: 289013
Zachary Turner [Thu, 8 Dec 2016 01:31:04 +0000 (01:31 +0000)]
Convert CommandObjectCommands to entry-based Args access.
llvm-svn: 289012
David L. Jones [Thu, 8 Dec 2016 01:11:41 +0000 (01:11 +0000)]
Loosen checks for _MSC_FULL_VER under -fms-extensions.
Summary:
On actual Windows hosts :-) , this could report something other than the
fallback, with a non-zero minor/build number.
Reviewers: rnk, llvm-commits
Differential Revision: https://reviews.llvm.org/D27554
llvm-svn: 289011
Greg Clayton [Thu, 8 Dec 2016 01:03:48 +0000 (01:03 +0000)]
Make a DWARF generator so we can unit test DWARF APIs with gtest.
The only tests we have for the DWARF parser are the tests that use llvm-dwarfdump and expect output from textual dumps.
More DWARF parser modification are coming in the next few weeks and I wanted to add tests that can verify that we can encode and decode all form types, as well as test some other basic DWARF APIs where we ask DIE objects for their children and siblings.
DwarfGenerator.cpp was added in the lib/CodeGen directory. This file contains the code necessary to easily create DWARF for tests:
dwarfgen::Generator DG;
Triple Triple("x86_64--");
bool success = DG.init(Triple, Version);
if (!success)
return;
dwarfgen::CompileUnit &CU = DG.addCompileUnit();
dwarfgen::DIE CUDie = CU.getUnitDIE();
CUDie.addAttribute(DW_AT_name, DW_FORM_strp, "/tmp/main.c");
CUDie.addAttribute(DW_AT_language, DW_FORM_data2, DW_LANG_C);
dwarfgen::DIE SubprogramDie = CUDie.addChild(DW_TAG_subprogram);
SubprogramDie.addAttribute(DW_AT_name, DW_FORM_strp, "main");
SubprogramDie.addAttribute(DW_AT_low_pc, DW_FORM_addr, 0x1000U);
SubprogramDie.addAttribute(DW_AT_high_pc, DW_FORM_addr, 0x2000U);
dwarfgen::DIE IntDie = CUDie.addChild(DW_TAG_base_type);
IntDie.addAttribute(DW_AT_name, DW_FORM_strp, "int");
IntDie.addAttribute(DW_AT_encoding, DW_FORM_data1, DW_ATE_signed);
IntDie.addAttribute(DW_AT_byte_size, DW_FORM_data1, 4);
dwarfgen::DIE ArgcDie = SubprogramDie.addChild(DW_TAG_formal_parameter);
ArgcDie.addAttribute(DW_AT_name, DW_FORM_strp, "argc");
// ArgcDie.addAttribute(DW_AT_type, DW_FORM_ref4, IntDie);
ArgcDie.addAttribute(DW_AT_type, DW_FORM_ref_addr, IntDie);
StringRef FileBytes = DG.generate();
MemoryBufferRef FileBuffer(FileBytes, "dwarf");
auto Obj = object::ObjectFile::createObjectFile(FileBuffer);
EXPECT_TRUE((bool)Obj);
DWARFContextInMemory DwarfContext(*Obj.get());
This code is backed by the AsmPrinter code that emits DWARF for the actual compiler.
While adding unit tests it was discovered that DIEValue that used DIEEntry as their values had bugs where DW_FORM_ref1, DW_FORM_ref2, DW_FORM_ref8, and DW_FORM_ref_udata forms were not supported. These are all now supported. Added support for DW_FORM_string so we can emit inlined C strings.
Centralized the code to unique abbreviations into a new DIEAbbrevSet class and made both the dwarfgen::Generator and the llvm::DwarfFile classes use the new class.
Fixed comments in the llvm::DIE class so that the Offset is known to be the compile/type unit offset.
DIEInteger now supports more DW_FORM values.
There are also unit tests that cover:
Encoding and decoding all form types and values
Encoding and decoding all reference types (DW_FORM_ref1, DW_FORM_ref2, DW_FORM_ref4, DW_FORM_ref8, DW_FORM_ref_udata, DW_FORM_ref_addr) including cross compile unit references with that go forward one compile unit and backward on compile unit.
Differential Revision: https://reviews.llvm.org/D27326
llvm-svn: 289010
Zachary Turner [Thu, 8 Dec 2016 00:54:24 +0000 (00:54 +0000)]
Work around a bogus warning on MSVC.
llvm-svn: 289009
Evgeniy Stepanov [Thu, 8 Dec 2016 00:32:26 +0000 (00:32 +0000)]
CFI-icall on Thumb
Replace @progbits in the section directive with %progbits, because "@" starts a comment on arm/thumb.
Use b.w branch instruction.
Use .thumb_function and .thumb_set for proper arm/thumb interwork. This way jumptable entry addresses on thumb have bit 0 set (correctly). This does not affect CFI check math, because the address of the jumptable start also has that bit set.
This does not work on thumbv5, because it does not support b.w, and the linker would not insert a veneer (trampoline?) to extend the range of b.n. We may need to do full-range plt-style jumptables on thumbv54, which are 12 bytes per entry. Another option is "push lr; bl; pop pc" (4 bytes) but that needs unwinding instructions, etc.
Differential Revision: https://reviews.llvm.org/D27499
llvm-svn: 289008
Peter Collingbourne [Thu, 8 Dec 2016 00:27:37 +0000 (00:27 +0000)]
LTO: Remove the unused Config::Features field.
We are currently initializing Features via MAttrs.
llvm-svn: 289007
Greg Clayton [Thu, 8 Dec 2016 00:22:45 +0000 (00:22 +0000)]
Improve crashlog.py so it can handle more iOS crashlog files.
<rdar://problem/
29191857>
llvm-svn: 289006
Bruno Cardoso Lopes [Thu, 8 Dec 2016 00:22:06 +0000 (00:22 +0000)]
[Driver][Darwin] Disable default stack protector levels in freestanding mode.
Currently -fstack-protector is on by default when using -ffreestanding.
Change the default behavior to have it off when using -ffreestanding.
rdar://problem/
14089363
llvm-svn: 289005
Matthias Braun [Thu, 8 Dec 2016 00:16:42 +0000 (00:16 +0000)]
The few days mentioned in r267095 are over
llvm-svn: 289004
Matthias Braun [Thu, 8 Dec 2016 00:16:08 +0000 (00:16 +0000)]
TargetPassConfig: Rename DisablePostRA -> DisablePostRASched; NFC
llvm-svn: 289003