Commit Graph

63153 Commits

Author SHA1 Message Date
Michael Zuckerman 1af947a7b3 [Clang][AVX512][BuiltIn] Adding avx512 ( punpck{h|l}{dq|qdq}{128|256|512},rndscale{ss|sd}, {scalef{ss|sd|pd512|ps512} ) builtin to clang
Differential Revision: http://reviews.llvm.org/D18929

llvm-svn: 265935
2016-04-11 12:32:31 +00:00
Benjamin Kramer 5ffc24e202 [clang-format] Walk backwards from end() instead of forwards from rend().
This should've been forwards from rbegin(), reverse iterators are just
too confusing to be used by mere mortals. Fixes out-of-bounds walks over
the list.

llvm-svn: 265934
2016-04-11 12:19:19 +00:00
Michael Zuckerman 07525091e6 [Clang][AVX512][BuiltIn] Adding avx512 ( ptest{n}m{b|w}{128|256|512} ) builtin to clang
Differential Revision: http://reviews.llvm.org/D18924

llvm-svn: 265928
2016-04-11 10:22:07 +00:00
Benjamin Kramer b8b2f3f6c8 Don't clutter the test directory with temporary IR files.
-emit-llvm emits a file, -emit-llvm-only doesn't.

llvm-svn: 265926
2016-04-11 10:16:37 +00:00
Martin Probst 716a533a7f clang-format: [JS] Test for parameter annotations.
Summary: Just to ensure no regressions, this already works fine.

Reviewers: djasper

Subscribers: cfe-commits, klimek

Differential Revision: http://reviews.llvm.org/D18950

llvm-svn: 265922
2016-04-11 09:17:57 +00:00
Benjamin Kramer 5ff6747e04 Remove redundant conditions of the form (A || (!A && B)) -> (A || B)
Found by cppcheck! PR27286 PR27287 PR27288 PR27289

llvm-svn: 265918
2016-04-11 08:26:13 +00:00
Dmitry Polukhin 85eda12d09 [GCC] Attribute ifunc support in clang
This patch add support for GCC attribute((ifunc("resolver"))) for
targets that use ELF as object file format. In general ifunc is a
special kind of function alias with type @gnu_indirect_function. LLVM
patch http://reviews.llvm.org/D15525

Differential Revision: http://reviews.llvm.org/D15524

llvm-svn: 265917
2016-04-11 07:48:59 +00:00
Martin Probst bbffeac569 clang-format: [JS] do not insert semicolons after wrapped annotations.
Reviewers: djasper

Subscribers: klimek

Differential Revision: http://reviews.llvm.org/D18943

llvm-svn: 265916
2016-04-11 07:35:57 +00:00
Michael Zuckerman d8d2f62107 [Clang][AVX512][BuiltIn] Adding avx512 ( vperm{i|t}2var, vpermil{var}{ps|pd}{256|512} ) builtin to clang.
Differential Revision: http://reviews.llvm.org/D18933

llvm-svn: 265915
2016-04-11 07:15:34 +00:00
Michael Zuckerman 8d16199b7b [Clang][AVX512][BuiltIn] Adding avx512 ( vcvt ) builtin to clang
Differential Revision: http://reviews.llvm.org/D18932

llvm-svn: 265904
2016-04-10 17:24:03 +00:00
Saleem Abdulrasool 2a0932fb45 Correct pg instrumentation for AArch64
It seems that there was a miscommunication between Renato and I, and the
original behaviour of AArch64 was to be preserved and not to mirror the new
behaviour.  Restore the original behaviour for AArch64.  Addresses post-commit
review comments from Renato Golin.

llvm-svn: 265899
2016-04-10 14:29:55 +00:00
Michael Zuckerman cdd54c83d8 Adding avx512 (unpck{h|l}{pd|ps}, rcp14{pd|ps}{128|256},vplzcnt{d|q} ) builtin to clang
Differential Revision: http://reviews.llvm.org/D18931

llvm-svn: 265896
2016-04-10 12:54:23 +00:00
Michael Zuckerman fa7ccc5bcf [Clang][AVX512][BuiltIn] Adding avx512 ( store ) builtin to clang
Differential Revision: http://reviews.llvm.org/D18925

llvm-svn: 265895
2016-04-10 10:51:04 +00:00
Saleem Abdulrasool cb12255442 test: add additional tests for SVN r265888
Add test cases for AArch64 as well as that was changed as part of that change.

llvm-svn: 265889
2016-04-10 03:31:09 +00:00
Saleem Abdulrasool 9b5ba547f1 Add support for __gnu_mcount_nc as the pg interface
This adds support to optionally support using `__gnu_mcount_nc` as the mcount
interface rather than `mcount` for Linux and EABI.  The other targets do not
provide an implementation for `__gnu_mcount_nc`.  This can be activated via the
`-meabi gnu` flag.

Resolves PR23969.

llvm-svn: 265888
2016-04-10 03:19:47 +00:00
Saleem Abdulrasool e86dd022c6 Basic: thread TargetOptions into TargetInfo
This threads TargetOptions into the TargetInfo hierarchy.  This is a rework of
the original attempt to thread additional information into the TargetInfo to
make decisions based on additional ABI related options.

llvm-svn: 265878
2016-04-09 19:09:25 +00:00
Manman Ren 71224530c1 ObjC kindof: check the context when inserting methods to global pool.
To make kindof lookup work, we need to insert methods with different
context into the global pool, even though they have the same siganture.

Since diagnosis of availability is performed on the best candidate,
which is often the first candidate from the global pool, we prioritize
the methods that are unavaible or deprecated to the head of the list.

Since we now have more methods in the global pool, we need to watch
out for performance impact.

rdar://25635831

llvm-svn: 265877
2016-04-09 18:59:48 +00:00
Nathan Wilson 8383912f87 [Concepts] Implement subsection [dcl.spec.concept]p7 of the Concepts TS
Summary: A program shall not declare an explicit instantiation (14.8.2), an explicit specialization (14.8.3), or a partial specialization of a concept definition.

Reviewers: rsmith, hubert.reinterpretcast, faisalv, aaron.ballman

Subscribers: cfe-commits

Differential Revision: http://reviews.llvm.org/D18221

llvm-svn: 265868
2016-04-09 02:55:27 +00:00
Chris Bieneman 834a40b463 [Perf-Training] Reworked workflow improvements for order-file generation
This is re-landing r260742. I've reworked the conditionals so that it only hits when targeting Apple platforms with ld64.

Original Summary:
With this change generating clang order files using dtrace uses the following workflow:

cmake <whatever options you want>

ninja generate-order-file

ninja clang

This patch works by setting a default path to the order file (which can be overridden by the user). If the order file doesn't exist during configuration CMake will create an empty one.

CMake then ties up the dependencies between the clang link job and the order file, and generate-order-file overwrites CLANG_ORDER_FILE with the new order file.

llvm-svn: 265864
2016-04-08 22:48:18 +00:00
Adrian Prantl 826824ea3d Use NoDebug compile units to mark debug metadata used only for sample-based
profiling and optimization remarks and indicate that no debug info shall
be emitted for these compile units.

http://reviews.llvm.org/D18808
<rdar://problem/25427165>

llvm-svn: 265862
2016-04-08 22:43:06 +00:00
Richard Smith f144b54a91 Remove unused functions from ASTWriter interface.
llvm-svn: 265857
2016-04-08 21:54:32 +00:00
Richard Smith 1e8e91b379 PR25501: Delay loading visible updates for a declaration until after we've
processed update records. If an update record adds a definition, we need to
merge that with any pre-existing definition to determine which the canonical
definition is before we apply the visible update, otherwise we wouldn't know
where to apply it.

Thanks to Vassil Vassilev for help reducing this and tracking down the problem.

llvm-svn: 265848
2016-04-08 20:53:26 +00:00
Ekaterina Romanova f2ed62027d Add doxygen comments to emmintrin.h's intrinsics. Only around 25% of the intrinsics in this file are documented now. The patches for the rest of the intrisics in this file will be send out later.
The doxygen comments are automatically generated based on Sony's intrinsics document.

I got an OK from Eric Christopher to commit doxygen comments without prior code review upstream. This patch was internally reviewed by Paul Robinson.

llvm-svn: 265844
2016-04-08 20:45:48 +00:00
Devin Coughlin ebaa56bb26 [analyzer] Teach trackNullOrUndefValue about calls to property accessors.
Teach trackNullOrUndefValue() how to look through PseudoObjectExprs to find
the underlying method call for property getters. This makes over-suppression
of 'return nil' in getters consistent with the similar over-suppression for
method and function calls.

rdar://problem/24437252

llvm-svn: 265839
2016-04-08 19:59:16 +00:00
Richard Smith fe1bc708b5 [modules] Handle merged fields in designated initializers.
llvm-svn: 265838
2016-04-08 19:57:40 +00:00
Wei Mi 811ff92e1e Always have clang pass -pie-level and -pic-level values to the code generator.
Patch by tmsriram!

Differential Revision: http://reviews.llvm.org/D18843

llvm-svn: 265816
2016-04-08 17:42:32 +00:00
Saleem Abdulrasool f7b3d6c55b Move EABIVersion from CodeGenOptions to TargetOptions
It is possible to argue that the EABIVersion field is similar in spirit to the
ABI field in TargetOptions.  It represents the embedded ABI that the target
follows.  This will allow us to thread this information into the target
information construction.

llvm-svn: 265807
2016-04-08 16:52:05 +00:00
Saleem Abdulrasool 10a4972a8d revert SVN r265702, r265640
Revert the two changes to thread CodeGenOptions into the TargetInfo allocation
and to fix the layering violation by moving CodeGenOptions into Basic.
Code Generation is arguably not particularly "basic".  This addresses Richard's
post-commit review comments.  This change purely does the mechanical revert and
will be followed up with an alternate approach to thread the desired information
into TargetInfo.

llvm-svn: 265806
2016-04-08 16:52:00 +00:00
Alexey Bader 954ba21f85 [OpenCL] Complete image types support.
I. Current implementation of images is not conformant to spec in the following points:
  1. It makes no distinction with respect to access qualifiers and therefore allows to use images with different access type interchangeably. The following code would compile just fine:

        void write_image(write_only image2d_t img);
        kernel void foo(read_only image2d_t img) { write_image(img); } // Accepted code

     which is disallowed according to s6.13.14.

  2. It discards access qualifier on generated code, which leads to generated code for the above example:

        call void @write_image(%opencl.image2d_t* %img);

     In OpenCL2.0 however we can have different calls into write_image with read_only and wite_only images.
     Also generally following compiler steps have no easy way to take different path depending on the image access: linking to the right implementation of image types, performing IR opts and backend codegen differently.

  3. Image types are language keywords and can't be redeclared s6.1.9, which can happen currently as they are just typedef names.
  4. Default access qualifier read_only is to be added if not provided explicitly.

II. This patch corrects the above points as follows:
  1. All images are encapsulated into a separate .def file that is inserted in different points where image handling is required. This avoid a lot of code repetition as all images are handled the same way in the code with no distinction of their exact type.
  2. The Cartesian product of image types and image access qualifiers is added to the builtin types. This simplifies a lot handling of access type mismatch as no operations are allowed by default on distinct Builtin types. Also spec intended access qualifier as special type qualifier that are combined with an image type to form a distinct type (see statement above - images can't be created w/o access qualifiers).
  3. Improves testing of images in Clang.

Author: Anastasia Stulova
Reviewers: bader, mgrang.
Subscribers: pxli168, pekka.jaaskelainen, yaxunl.
Differential Revision: http://reviews.llvm.org/D17821

llvm-svn: 265783
2016-04-08 13:40:33 +00:00
Aaron Ballman 829b5d42af Silencing a 32-bit shift implicit conversion warning from MSVC; NFC.
llvm-svn: 265782
2016-04-08 12:21:58 +00:00
Sanjoy Das f60a0d7452 Adapt to LLVM API change
Replace mayBeOverridden with isInterposable

llvm-svn: 265767
2016-04-08 01:31:02 +00:00
Richard Smith 6a6747d9dd [modules] Add a comment to explain why -E leaves some #includes in the preprocessed output.
llvm-svn: 265766
2016-04-08 01:23:59 +00:00
Richard Smith 466a15ef7f [modules] Don't write @import in -E output if the current language mode doesn't
support @import; use the form as written instead.

llvm-svn: 265756
2016-04-08 00:09:53 +00:00
Justin Lebar 25c36fd61b [CUDA] Tweak math forward declares so we're compatible with libstdc++4.9.
Summary:
See comments in patch; we were assuming that some stdlib math functions
would be defined in namespace std, when in fact the spec says they
should be defined in the global namespace.  libstdc++4.9 became more
conforming and broke us.

This new implementation seems to cover the known knowns.

Reviewers: rsmith

Subscribers: cfe-commits, tra

Differential Revision: http://reviews.llvm.org/D18882

llvm-svn: 265751
2016-04-07 23:55:53 +00:00
Richard Smith 351241c83e Replace Sema-level implementation of -fassume-sane-operator-new with a
CodeGen-level implementation. Instead of adding an attribute to clang's
FunctionDecl, add the IR attribute directly. This means a module built with
this flag is now compatible with code built without it and vice versa.

This change also results in the 'noalias' attribute no longer being added to
calls to operator new in the IR; it's now only added to the declaration. It
also fixes a bug where we failed to add the attribute to the 'nothrow' versions
(because we didn't implicitly declare them, there was no good time to inject a
fake attribute).

llvm-svn: 265728
2016-04-07 21:46:12 +00:00
Richard Smith a1ddf5e744 [modules] Allow differences in flags that only affect preprocessor predefines
(and __has_feature checks) between explicitly-specified module files and the
current compilation.

llvm-svn: 265718
2016-04-07 20:47:37 +00:00
Manman Ren 7ed4f988c1 [ObjC kindof] Use type bound to filter out the candidate methods.
rdar://21306753

llvm-svn: 265712
2016-04-07 19:32:24 +00:00
Manman Ren d2a3cd7261 NFC: simplify code in BuildInstanceMessage.
Instead of searching the global pool multiple times: in
LookupFactoryMethodInGlobalPool, LookupInstanceMethodInGlobalPool,
CollectMultipleMethodsInGlobalPool, and AreMultipleMethodsInGlobalPool,
we now collect the method candidates in CollectMultipleMethodsInGlobalPool
only, and other functions will use the collected method set.

This commit adds parameter "Methods" to AreMultipleMethodsInGlobalPool,
and SelectBestMethod. It also changes the implementation of
CollectMultipleMethodsInGlobalPool to collect the desired kind first, if none is
found, to collect the other kind. This avoids the need to call both
LookupFactoryMethodInGlobalPool and LookupInstanceMethodInGlobalPool.

llvm-svn: 265711
2016-04-07 19:30:20 +00:00
Saleem Abdulrasool 94cfc603d1 Basic: move CodeGenOptions from Frontend
This is a mechanical move of CodeGenOptions from libFrontend to libBasic.  This
fixes the layering violation introduced earlier by threading CodeGenOptions into
TargetInfo.  It should also fix the modules based self-hosting builds.  NFC.

llvm-svn: 265702
2016-04-07 17:49:44 +00:00
Simon Pilgrim 112776dc66 Minor Wdocumentation fix. NFCI.
llvm-svn: 265700
2016-04-07 17:38:24 +00:00
Michael Zuckerman 5ae71243c2 Fixing duplicate declaration "_mm256 _mm_set_epi32" in revision 262177
Differential Revision: http://reviews.llvm.org/D17685

llvm-svn: 265677
2016-04-07 14:44:08 +00:00
Sanjay Patel ae7a9df7bf make __builtin_isfinite more efficient (PR27145)
isinf (is infinite) and isfinite should be implemented with the same function
except we change the comparison operator.

See PR27145 for more details:
https://llvm.org/bugs/show_bug.cgi?id=27145

Ref: forked off of the discussion in D18513.

Differential Revision: http://reviews.llvm.org/D18648

llvm-svn: 265675
2016-04-07 14:29:05 +00:00
Alexey Bataev 2af33e3d3f [OPENMP 4.0] Parsing/sema analysis for 'simdlen' clause in 'declare simd'
construct.

OpenMP 4.0 defines '#pragma omp declare simd' construct that may have
associated 'simdlen' clause with constant positive expression as an
argument:
simdlen(<const_expr>)
Patch adds parsin and semantic analysis for simdlen clause.

llvm-svn: 265668
2016-04-07 12:45:37 +00:00
Benjamin Kramer 5d28c7f9a2 Move class into an anonymous namespace. NFC.
llvm-svn: 265654
2016-04-07 10:14:54 +00:00
Saleem Abdulrasool 724275ba5f Basic: thread CodeGenOptions into TargetInfo
This threads CodeGenOptions into the TargetInfo hierarchy.  This is motivated by
ARM which can change some target information based on the EABI selected
(-meabi).  Similar options exist for other platforms (e.g. MIPS) and thus is
generally useful.  NFC.

llvm-svn: 265640
2016-04-07 05:41:11 +00:00
Sean Silva 72af472523 Don't use PATH_MAX.
This is a SmallVector anyway, and so the exact size doesn't matter.

clang\lib\Frontend\ModuleDependencyCollector.cpp(83) : error C2065: 'PATH_MAX' : undeclared identifier
clang\lib\Frontend\ModuleDependencyCollector.cpp(83) : error C2975: 'InternalLen' : invalid template argument for 'llvm::SmallString', expected compile-time constant expression
        llvm\include\llvm/ADT/SmallString.h(24) : see declaration of 'InternalLen'

llvm-svn: 265634
2016-04-07 01:58:14 +00:00
Bruno Cardoso Lopes 4775fcfa4e [CrashReproducer] Use toUppercase from include/clang/Basic/CharInfo.h
Use toUppercase instead of ::toupper()

llvm-svn: 265632
2016-04-07 01:12:18 +00:00
Bruno Cardoso Lopes 49acebea07 [CrashReproducer] Change std::toupper to ::toupper
Attempt to fix windows bots

llvm-svn: 265630
2016-04-07 01:04:09 +00:00
Bruno Cardoso Lopes 4c20bef1ef [CrashReproducer] Setup 'case-sensitive' in YAML files.
The crash reproducer was not setting up case sensitivity in the
VFS yaml files, which defaults to true. Make the crash reproducer
explicitly set that flag based on the case sensitivity of the .cache
path where vfs and modules are dumped.

llvm-svn: 265622
2016-04-07 00:00:57 +00:00
Bruno Cardoso Lopes 7caebc182a [CrashReproducer] Move ModuleDependencyCollector method around. NFC
llvm-svn: 265621
2016-04-07 00:00:42 +00:00