Commit Graph

249237 Commits

Author SHA1 Message Date
Vitaly Buka 6eead19ce4 [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
2016-12-08 19:13:13 +00:00
Rui Ueyama 7fed58cd9f Start using make() in COFF (with a smaller change.)
llvm-svn: 289089
2016-12-08 19:10:28 +00:00
Kostya Kortchinsky 2defe4d9a1 [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
2016-12-08 19:05:46 +00:00
Peter Collingbourne 235c275b20 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
2016-12-08 19:01:00 +00:00
Rui Ueyama aa4f4450af Revert r289084: Start using make() in COFF.
This reverts commit r289084 to appease buildbots.

llvm-svn: 289086
2016-12-08 18:49:04 +00:00
Rui Ueyama 843233b920 Start using make() in COFF.
We don't want ELF and COFF to diverge too much.

llvm-svn: 289085
2016-12-08 18:31:18 +00:00
Rui Ueyama 520d9169e6 Move Memory.{h,cpp} to lld/Support so that we can use them from COFF.
llvm-svn: 289084
2016-12-08 18:31:13 +00:00
Ekaterina Romanova a8fde7ce8b [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
2016-12-08 17:57:23 +00:00
Rafael Espindola d0ebd84c42 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
2016-12-08 17:54:26 +00:00
Rui Ueyama 6f6d46d497 Use `make` to simplify. NFC.
llvm-svn: 289081
2016-12-08 17:48:52 +00:00
Chris Bieneman fbf7dfe1ba [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
2016-12-08 17:46:57 +00:00
Rui Ueyama 6dbf7ff747 Use make to instantiate Target and LinkerScript. NFC.
llvm-svn: 289079
2016-12-08 17:44:39 +00:00
Rui Ueyama e4eadb6a24 Split LinkerDriver::link. NFC.
llvm-svn: 289078
2016-12-08 17:44:37 +00:00
Rui Ueyama 34bf8677a4 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
2016-12-08 17:32:58 +00:00
Alexander Timofeev 18009560c5 [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
2016-12-08 17:28:47 +00:00
Douglas Yung eebed6229a Fixing test to work when the compiler defaults to a different C++ standard version.
Differential Revision: https://reviews.llvm.org/D27488

llvm-svn: 289075
2016-12-08 17:27:20 +00:00
Rafael Espindola 7e71415cb3 Add support for 'extern "C"'.
It is used by Qt.

llvm-svn: 289074
2016-12-08 17:26:53 +00:00
Keno Fischer dc09119776 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
2016-12-08 17:22:35 +00:00
Rui Ueyama 8cb6283e74 Make function names shorter. NFC.
llvm-svn: 289072
2016-12-08 17:18:09 +00:00
Rui Ueyama 248e4a344c 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
2016-12-08 17:04:18 +00:00
Greg Clayton b90328356a 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
2016-12-08 16:57:04 +00:00
Rafael Espindola 4737f94132 Make this test more strict. NFC.
llvm-svn: 289069
2016-12-08 16:51:56 +00:00
Alex Lorenz 71ecb07ed1 [CodeCompletion][ObjC] Use a parameterized NSSet return type for
keyPathsForValuesAffecting* KVO completion results

rdar://23791701

llvm-svn: 289068
2016-12-08 16:49:05 +00:00
Rafael Espindola 191390a851 Inline function called only once.
llvm-svn: 289067
2016-12-08 16:26:20 +00:00
Rafael Espindola 361da4cef7 Handle C++ names in anon scripts.
llvm-svn: 289066
2016-12-08 16:20:29 +00:00
Rafael Espindola defdfa86c1 Inline two functions called only once. NFC.
llvm-svn: 289065
2016-12-08 16:02:48 +00:00
Rafael Espindola c65aee64ec Add two helper functions. NFC.
llvm-svn: 289064
2016-12-08 15:56:33 +00:00
Etienne Bergeron 58ee3b786d [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
2016-12-08 15:53:33 +00:00
Rafael Espindola 39c16dfbce Simplify. NFC.
llvm-svn: 289062
2016-12-08 15:36:58 +00:00
Simon Atanasyan 872764f6fe [ELF] Correct addAbsolute function argument name
Follow-up to r289025.

llvm-svn: 289061
2016-12-08 15:29:17 +00:00
NAKAMURA Takumi 689493bb12 Prune unused libdeps.
llvm-svn: 289060
2016-12-08 15:28:02 +00:00
Alex Lorenz feafdf6be4 [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
2016-12-08 15:09:40 +00:00
NAKAMURA Takumi 66c8fa94a6 Prune unused \param(s) in r289050. [-Wdocumentation]
llvm-svn: 289057
2016-12-08 15:00:12 +00:00
NAKAMURA Takumi a495f882be DIE::addAttribute(): Prune a redundant \param. [-Wdocumentation]
llvm-svn: 289056
2016-12-08 15:00:07 +00:00
Alex Lorenz 660195f024 [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
2016-12-08 14:46:05 +00:00
NAKAMURA Takumi 9ccd966612 LanaiInstPrinter: Prune unused libdeps.
llvm-svn: 289054
2016-12-08 14:26:30 +00:00
NAKAMURA Takumi b0f7b03711 DebugInfoDWARFTests: Prune unused libdeps.
llvm-svn: 289053
2016-12-08 14:26:23 +00:00
NAKAMURA Takumi fdf3edeb0c DebugInfoDWARFTests: Add missing deps, AsmPrinter and Object.
llvm-svn: 289052
2016-12-08 14:11:02 +00:00
NAKAMURA Takumi bf177380ab DebugInfoDWARFTests: Reorder LLVM_LINK_COMPONENTS.
llvm-svn: 289051
2016-12-08 14:10:57 +00:00
Nicolai Haehnle f08dc90253 [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
2016-12-08 14:08:14 +00:00
Nicolai Haehnle 3c67a08d1b 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
2016-12-08 14:08:08 +00:00
Nicolai Haehnle 2857dc3893 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
2016-12-08 14:08:02 +00:00
Artem Dergachev a4e2541a70 [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
2016-12-08 14:05:48 +00:00
George Rimar c49fd8c477 [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
2016-12-08 13:50:28 +00:00
Peter Smith baffdb8bc2 [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
2016-12-08 12:58:55 +00:00
Daniel Jasper 0f77869d58 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
2016-12-08 12:45:29 +00:00
Alexey Bataev 4f0d469d45 [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
2016-12-08 11:57:51 +00:00
Malcolm Parsons 77f039bf58 [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
2016-12-08 11:46:22 +00:00
Pavel Labath 82b95acfbe 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
2016-12-08 11:45:38 +00:00
Pavel Labath fefefeb7f6 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
2016-12-08 11:31:19 +00:00