summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* [X86] Remove mask from avx512ifma builtins. Use a select instruction instead.Craig Topper2018-05-262-80/+52
| | | | | | This reduces from 12 builtins to 6 since we no longer need a mask and maskz version. llvm-svn: 333348
* [X86] Rewrite the max and min reduction intrinsics to make better use of ↵Craig Topper2018-05-261-221/+118
| | | | | | | | | | | | | | | | | | | other functions and to reduce width to 256 and 128 bits were possible. Summary: We only need to use 512 bit vectors all the way through v8i64 reductions since those max instructions are new to avx512f and only available in 512 bits until SKX. For v16i32 and floating point we have legacy 128/256 bit instructions we can use. I've tried to use other intrinsics to reduce the verbosity of the code and avoid having to mention all the shuffles. I've also removed all the -1 shuffle indices so the output sequence is fully specified and not left to backend optimization. Reviewers: RKSimon, spatel, GBuella Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D47401 llvm-svn: 333347
* Test commit; please ignore.George Burgess IV2018-05-261-1/+1
| | | | llvm-svn: 333333
* [analyzer] Add security checks for bcmp(), bcopy(), bzero().Artem Dergachev2018-05-261-0/+141
| | | | | | | | | | | These functions are obsolete. The analyzer would advice to replace them with memcmp(), memcpy() or memmove(), or memset(). Patch by Tom Rix! Differential Revision: https://reviews.llvm.org/D41881 llvm-svn: 333326
* Revert "[DebugInfo] Don't bother with MD5 checksums of preprocessed files."Paul Robinson2018-05-252-13/+4
| | | | | | | This reverts commit d734f2aa3f76fbf355ecd2bbe081d0c1f49867ab. Also known as r333311. A very small but nonzero number of bots fail. llvm-svn: 333319
* Support Swift calling convention for PPC64 targetsBob Wilson2018-05-252-2/+20
| | | | | | | This adds basic support for the Swift calling convention with PPC64 targets. Patch provided by Atul Sowani in bug report #37223 llvm-svn: 333316
* [DebugInfo] Don't bother with MD5 checksums of preprocessed files.Paul Robinson2018-05-252-4/+13
| | | | | | | | | | The checksum will not reflect the real source, so there's no clear reason to include them in the debug info. Also this was causing a crash on the DWARF side. Differential Revision: https://reviews.llvm.org/D47260 llvm-svn: 333311
* [Support] Avoid normalization in sys::getDefaultTargetTriplePetr Hosek2018-05-251-1/+2
| | | | | | | | | | | | | | | | | | | | | | The return value of sys::getDefaultTargetTriple, which is derived from -DLLVM_DEFAULT_TRIPLE, is used to construct tool names, default target, and in the future also to control the search path directly; as such it should be used textually, without interpretation by LLVM. Normalization of this value may lead to unexpected results, for example if we configure LLVM with -DLLVM_DEFAULT_TARGET_TRIPLE=x86_64-linux-gnu, normalization will transform that value to x86_64--linux-gnu. Driver will use that value to search for tools prefixed with x86_64--linux-gnu- which may be confusing. This is also inconsistent with the behavior of the --target flag which is taken as-is without any normalization and overrides the value of LLVM_DEFAULT_TARGET_TRIPLE. Users of sys::getDefaultTargetTriple already perform their own normalization as needed, so this change shouldn't impact existing logic. Differential Revision: https://reviews.llvm.org/D47153 llvm-svn: 333307
* [OPENMP, NVPTX] Fixed codegen for orphaned parallel region.Alexey Bataev2018-05-251-25/+19
| | | | | | | | | | | | | | If orphaned parallel region is found, the next code must be emitted: ``` if(__kmpc_is_spmd_exec_mode() || __kmpc_parallel_level(loc, gtid)) Serialized execution. else if (IsMasterThread()) Prepare and signal worker. else Outined function call. ``` llvm-svn: 333301
* Follow-up fix for nonnull atomic non-member functionsJF Bastien2018-05-251-2/+2
| | | | | | | | Handling of the third parameter was only checking for *_n and not for the C11 variant, which means that cmpxchg of a 'desired' 0 value was erroneously warning. Handle C11 properly, and add extgensive tests for this as well as NULL pointers in a bunch of places. Fixes r333246 from D47229. llvm-svn: 333290
* [analyzer] Added template argument lists to the Pathdiagnostic outputKristof Umann2018-05-251-2/+50
| | | | | | | | | | | Because template parameter lists were not displayed in the plist output, it was difficult to decide in some cases whether a given checker found a true or a false positive. This patch aims to correct this. Differential Revision: https://reviews.llvm.org/D46933 llvm-svn: 333275
* Optionally add code completion results for arrow instead of dotIvan Donchevskii2018-05-255-87/+162
| | | | | | | | | | | | | Currently getting such completions requires source correction, reparsing and calling completion again. And if it shows no results and rollback is required then it costs one more reparse. With this change it's possible to get all results which can be later filtered to split changes which require correction. Differential Revision: https://reviews.llvm.org/D41537 llvm-svn: 333272
* [ASTImporter] Fix ClassTemplateSpecialization in wrong DCGabor Marton2018-05-251-2/+6
| | | | | | | | | | | | | | Summary: ClassTemplateSpecialization is put in the wrong DeclContex if implicitly instantiated. This patch fixes it. Reviewers: a.sidorin, r.stahl, xazax.hun Subscribers: rnkovacs, dkrupp, cfe-commits Differential Revision: https://reviews.llvm.org/D47058 llvm-svn: 333269
* [x86] invpcid intrinsicGabor Buella2018-05-257-0/+52
| | | | | | | | | | | | An intrinsic for an old instruction, as described in the Intel SDM. Reviewers: craig.topper, rnk Reviewed By: craig.topper, rnk Differential Revision: https://reviews.llvm.org/D47142 llvm-svn: 333256
* Make atomic non-member functions as nonnullJF Bastien2018-05-251-15/+31
| | | | | | | | | | | | | | | | | Summary: As a companion to libc++ patch https://reviews.llvm.org/D47225, mark builtin atomic non-member functions which accept pointers as nonnull. The atomic non-member functions accept pointers to std::atomic / std::atomic_flag as well as to the non-atomic value. These are all dereferenced unconditionally when lowered, and therefore will fault if null. It's a tiny gotcha for new users, especially when they pass in NULL as expected value (instead of passing a pointer to a NULL value). <rdar://problem/18473124> Reviewers: arphaman Subscribers: aheejin, cfe-commits Differential Revision: https://reviews.llvm.org/D47229 llvm-svn: 333246
* Improve diagonstic for braced-init-list as operand to ?: expression.Richard Smith2018-05-241-6/+22
| | | | llvm-svn: 333234
* Switch a couple of users of LangOpts::GNUMode to the more appropriate ↵Richard Smith2018-05-242-3/+3
| | | | | | LangOpts::GNUKeywords. llvm-svn: 333233
* Improve diagnostics for config mismatches with -fmodule-file.Richard Smith2018-05-241-3/+10
| | | | | | | | Unless the user uses -Wno-module-file-config-mismatch (or -Wno-error=...), allow the AST reader to produce errors describing the nature of the config mismatch. llvm-svn: 333220
* [X86] Fix a bad cast in _mm512_mask_abs_epi32 and _mm512_maskz_abs_epi32.Craig Topper2018-05-241-2/+2
| | | | llvm-svn: 333211
* [analyzer] Move RangeSet related declarations into the ↵Mikhail R. Gadelha2018-05-242-236/+256
| | | | | | | | | | | | | | | | | | RangedConstraintManager header. Summary: I could also move `RangedConstraintManager.h` under `include/` if you agree as it seems slightly out of place under `lib/`. Patch by Réka Kovács Reviewers: NoQ, george.karpenkov, dcoughlin, rnkovacs Reviewed By: NoQ Subscribers: mikhail.ramalho, whisperity, xazax.hun, baloghadamsoftware, szepet, a.sidorin, dkrupp, cfe-commits Differential Revision: https://reviews.llvm.org/D45920 llvm-svn: 333179
* [VFS] Implement getRealPath in InMemoryFileSystem.Eric Liu2018-05-241-0/+13
| | | | | | | | | | Reviewers: bkramer Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D47262 llvm-svn: 333172
* [clang-format] Fix putting ObjC message arguments in one line for multiline ↵Jacek Olesiak2018-05-241-0/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | receiver Summary: Reapply reverted changes from D46879. Currently BreakBeforeParameter is set to true everytime message receiver spans multiple lines, e.g.: ``` [[object block:^{ return 42; }] aa:42 bb:42]; ``` will be formatted: ``` [[object block:^{ return 42; }] aa:42 bb:42]; ``` even though arguments could fit into one line. This change fixes this behavior. Test Plan: make -j12 FormatTests && tools/clang/unittests/Format/FormatTests Reviewers: benhamilton, krasimir Reviewed By: benhamilton, krasimir Subscribers: djasper, klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D47195 llvm-svn: 333171
* [Sparc] Use the leon arch for Leon3's when using an external assemblerDaniel Cederman2018-05-241-4/+19
| | | | | | | | | | | | | | Summary: This allows the use of the casa instruction available in most Leon3's. Reviewers: jyknight Reviewed By: jyknight Subscribers: joerg, fedor.sergeev, jrtc27, cfe-commits Differential Revision: https://reviews.llvm.org/D47138 llvm-svn: 333157
* [Sema][ObjC] Do not DiagnoseUseOfDecl in LookupMemberExprSteven Wu2018-05-241-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Remove the call to DiagnoseUseOfDecl in LookupMemberExpr because: 1. LookupMemberExpr eagerly lookup both getter and setter, reguardless if they are used or not. It causes wrong diagnostics if you are only using getter. 2. LookupMemberExpr only diagnoses getter, but not setter. 3. ObjCPropertyOpBuilder already DiagnoseUseOfDecl when building getter and setter. Doing it again in LookupMemberExpr causes duplicated diagnostics. rdar://problem/38479756 Reviewers: erik.pilkington, arphaman, doug.gregor Reviewed By: arphaman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D47280 llvm-svn: 333148
* Use zeroinitializer for (trailing zero portion of) large array initializersRichard Smith2018-05-232-79/+94
| | | | | | | | more reliably. This re-commits r333044 with a fix for PR37560. llvm-svn: 333141
* Rework __builtin_classify_type support to better match GCC and to not assert onRichard Smith2018-05-231-80/+96
| | | | | | | | | | | | | | | | | | | | | | unusual types. Following the observed behavior of GCC, we now return -1 for vector types (along with all of our extensions that GCC doesn't support), and for atomic types we classify the underlying type. GCC appears to have changed its classification for function and array arguments between version 5 and version 6. Previously it would classify them as pointers in C and as functions or arrays in C++, but from version 6 onwards, it classifies them as pointers. We now follow the more recent GCC behavior rather than emulating what I can only assume to be a historical bug in their C++ support for this builtin. Finally, no version of GCC that I can find has ever used the "method" classification for C++ pointers to member functions. Instead, GCC classifies them as record types, presumably reflecting an internal implementation detail, but whatever the reason we now produce compatible results. llvm-svn: 333126
* [X86] Move the include of clzerointrin.h from immintrin.h back to x86intrin.h.Craig Topper2018-05-232-4/+5
| | | | | | This is an AMD intrinsic not an Intel intrinsic so it shouldn't be in immintrin.h llvm-svn: 333124
* [modules] Mark __wmmintrin_pclmul.h/__wmmintrin_aes.h as textualRaphael Isemann2018-05-231-8/+3
| | | | | | | | | | | | | | | | | | | | | | | Summary: Since clang r332929 these two headers throw errors when included from somewhere else than their wrapper header. It seems marking them as textual is the best way to fix the builds. Fixes this new module build error: While building module '_Builtin_intrinsics' imported from ...: In file included from <module-includes>:2: In file included from lib/clang/7.0.0/include/immintrin.h:54: In file included from lib/clang/7.0.0/include/wmmintrin.h:29: lib/clang/7.0.0/include/__wmmintrin_aes.h:25:2: error: "Never use <__wmmintrin_aes.h> directly; include <wmmintrin.h> instead." #error "Never use <__wmmintrin_aes.h> directly; include <wmmintrin.h> instead." Reviewers: rsmith, v.g.vassilev, craig.topper Reviewed By: craig.topper Subscribers: craig.topper, cfe-commits Differential Revision: https://reviews.llvm.org/D47277 llvm-svn: 333123
* [X86] Move all Intel defined intrinsic includes into immintrin.hCraig Topper2018-05-2311-66/+50
| | | | | | | | | | This matches the Intel documentation which shows them available by importing immintrin.h. x86intrin.h also includes immintrin.h so anyone including x86intrin.h will still get them. This is different than gcc, but I don't think we were a perfect match there already. I'm unclear what gcc's policy is about how they choose which to add things to. Differential Revision: https://reviews.llvm.org/D47182 llvm-svn: 333110
* [CUDA] Fixed the list of GPUs supported by CUDA-9.Artem Belevich2018-05-231-2/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D47268 llvm-svn: 333098
* [ASTImporter] Fix missing implict CXXRecordDecl in ↵Gabor Marton2018-05-231-2/+8
| | | | | | | | | | | | | | | | ClassTemplateSpecializationDecl Summary: Currently we do not import the implicit CXXRecordDecl of a ClassTemplateSpecializationDecl. This patch fixes it. Reviewers: a.sidorin, xazax.hun, r.stahl Subscribers: rnkovacs, dkrupp, cfe-commits Differential Revision: https://reviews.llvm.org/D47057 llvm-svn: 333086
* [clang-format] Break template declarations followed by commentsKrasimir Georgiev2018-05-231-2/+3
| | | | | | | | | | | | | | | | | Summary: This patch fixes two bugs in clang-format where the template wrapper doesn't skip over comments causing a long template declaration to not be split into multiple lines. These were latent and exposed by r332436. Reviewers: sammccall Reviewed By: sammccall Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D47257 llvm-svn: 333085
* Fix duplicate class template definitions problemGabor Marton2018-05-231-15/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: We fail to import a `ClassTemplateDecl` if the "To" context already contains a definition and then a forward decl. This is because `localUncachedLookup` does not find the definition. This is not a lookup error, the parser behaves differently than assumed in the importer code. A `DeclContext` contains one DenseMap (`LookupPtr`) which maps names to lists. The list is a special list `StoredDeclsList` which is optimized to have one element. During building the initial AST, the parser first adds the definition to the `DeclContext`. Then during parsing the second declaration (the forward decl) the parser again calls `DeclContext::addDecl` but that will not add a new element to the `StoredDeclsList` rarther it simply overwrites the old element with the most recent one. This patch fixes the error by finding the definition in the redecl chain. Added tests for the same issue with `CXXRecordDecl` and with `ClassTemplateSpecializationDecl`. These tests pass and they pass because in `VisitRecordDecl` and in `VisitClassTemplateSpecializationDecl` we already use `D->getDefinition()` after the lookup. Reviewers: a.sidorin, xazax.hun, szepet Subscribers: rnkovacs, dkrupp, cfe-commits Differential Revision: https://reviews.llvm.org/D46950 llvm-svn: 333082
* Fix unaligned memory access when reading INPUT_FILE_OFFSETS dataRaphael Isemann2018-05-231-1/+2
| | | | | | | | | | | | | | Summary: The blob data is unaligned, so we also should read it as such. Should fix the random failures with the sanitizer builds. Reviewers: rsmith, v.g.vassilev Reviewed By: v.g.vassilev Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D47247 llvm-svn: 333069
* Revert r333044 "Use zeroinitializer for (trailing zero portion of) large ↵Hans Wennborg2018-05-232-81/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | array initializers" It caused asserts, see PR37560. > Use zeroinitializer for (trailing zero portion of) large array initializers > more reliably. > > Clang has two different ways it emits array constants (from InitListExprs and > from APValues), and both had some ability to emit zeroinitializer, but neither > was able to catch all cases where we could use zeroinitializer reliably. In > particular, emitting from an APValue would fail to notice if all the explicit > array elements happened to be zero. In addition, for large arrays where only an > initial portion has an explicit initializer, we would emit the complete > initializer (which could be huge) rather than emitting only the non-zero > portion. With this change, when the element would have a suffix of more than 8 > zero elements, we emit the array constant as a packed struct of its initial > portion followed by a zeroinitializer constant for the trailing zero portion. > > In passing, I found a bug where SemaInit would sometimes walk the entire array > when checking an initializer that only covers the first few elements; that's > fixed here to unblock testing of the rest. > > Differential Revision: https://reviews.llvm.org/D47166 llvm-svn: 333067
* [DOXYGEN] Formatting changes for better intrinsics documentation renderingEkaterina Romanova2018-05-235-31/+43
| | | | | | | | (1) I added some \see cross-references to a few select intrinsics that are related (and have the same or similar semantics). (2) pmmintrin.h, smmintrin.h, xmmintrin.h have very few minor formatting changes. They make rendering of our intrinsics documentation better. llvm-svn: 333065
* [X86] Undef the vector reduction helper macros when we're done with them.Craig Topper2018-05-231-0/+8
| | | | | | These are implementation helper macros we shouldn't expose them to user code if we don't need to. llvm-svn: 333064
* [X86] In the floating point max reduction intrinsics, negate infinity before ↵Craig Topper2018-05-231-2/+2
| | | | | | | | feeding it to set1. Previously we negated the whole vector after splatting infinity. But its better to negate the infinity before splatting. This generates IR with the negate already folded with the infinity constant. llvm-svn: 333062
* [X86] Remove mask argument from more builtins that are handled completely in ↵Craig Topper2018-05-234-442/+266
| | | | | | CGBuiltin.cpp. Just wrap a select builtin around them in the header file instead. llvm-svn: 333061
* [analyzer] CStringChecker fix for strlcpy when no bytes are copied to the ↵David Carlier2018-05-231-1/+5
| | | | | | | | | | | | | | dest buffer Again, strlc* does not return a pointer so the zero size case doest not fit. Reviewers: NoQ, george.karpenkov Reviewed by: NoQ Differential Revision: https://reviews.llvm.org/D47007 llvm-svn: 333060
* [AST][ObjC] Print implicit property expression that only has a setter ↵Alex Lorenz2018-05-232-3/+13
| | | | | | | | without crashing rdar://40447209 llvm-svn: 333046
* Use zeroinitializer for (trailing zero portion of) large array initializersRichard Smith2018-05-232-71/+81
| | | | | | | | | | | | | | | | | | | | | | | more reliably. Clang has two different ways it emits array constants (from InitListExprs and from APValues), and both had some ability to emit zeroinitializer, but neither was able to catch all cases where we could use zeroinitializer reliably. In particular, emitting from an APValue would fail to notice if all the explicit array elements happened to be zero. In addition, for large arrays where only an initial portion has an explicit initializer, we would emit the complete initializer (which could be huge) rather than emitting only the non-zero portion. With this change, when the element would have a suffix of more than 8 zero elements, we emit the array constant as a packed struct of its initial portion followed by a zeroinitializer constant for the trailing zero portion. In passing, I found a bug where SemaInit would sometimes walk the entire array when checking an initializer that only covers the first few elements; that's fixed here to unblock testing of the rest. Differential Revision: https://reviews.llvm.org/D47166 llvm-svn: 333044
* [CodeGen] use nsw negation for builtin absSanjay Patel2018-05-221-1/+2
| | | | | | | | | | | | | The clang builtins have the same semantics as the stdlib functions. The stdlib functions are defined in section 7.20.6.1 of the C standard with: "If the result cannot be represented, the behavior is undefined." That lets us mark the negation with 'nsw' because "sub i32 0, INT_MIN" would be UB/poison. Differential Revision: https://reviews.llvm.org/D47202 llvm-svn: 333038
* [X86] As mentioned in post-commit feedback in D47174, move the 128 bit f16c ↵Craig Topper2018-05-225-135/+90
| | | | | | | | | | intrinsics into f16cintrin.h and remove __emmintrin_f16c.h These were included in emmintrin.h to match Intel Intrinsics Guide documentation. But this is because icc is capable of emulating them on targets that don't support F16C using library calls. Clang/LLVM doesn't have this emulation support. So it makes more sense to include them in immintrin.h instead. I've left a comment behind to hopefully deter someone from trying to move them again in the future. llvm-svn: 333033
* [X86] Remove mask argument from some builtins that are handled completely in ↵Craig Topper2018-05-225-94/+62
| | | | | | CGBuiltin.cpp. Just wrap a select builtin around them in the header file instead. llvm-svn: 333027
* [X86] Another attempt at fixing the intrinsic module map for rr333014.Craig Topper2018-05-221-1/+1
| | | | llvm-svn: 333026
* [X86] Add two missing #endif directives to immintrin.h that should have been ↵Craig Topper2018-05-221-0/+2
| | | | | | in r333014. llvm-svn: 333023
* [X86] Add __emmintrin_f16c.h to module map and CMakeLists.Craig Topper2018-05-222-0/+6
| | | | | | I missed this in r333014 llvm-svn: 333020
* [X86] Move 128-bit f16c intrinsics to __emmintrin_f16c.h include from ↵Craig Topper2018-05-224-110/+149
| | | | | | | | | | | | emmintrin.h. Move 256-bit f16c intrinsics back to f16cintrin.h Intel documents the 128-bit versions as being in emmintrin.h and the 256-bit version as being in immintrin.h. This patch makes a new __emmtrin_f16c.h to hold the 128-bit versions to be included from emmintrin.h. And makes the existing f16cintrin.h contain the 256-bit versions and include it from immintrin.h with an error if its included directly. Differential Revision: https://reviews.llvm.org/D47174 llvm-svn: 333014
* Reland r332885, "CodeGen, Driver: Start using direct split dwarf emission in ↵Peter Collingbourne2018-05-222-40/+55
| | | | | | | | | clang." As well as two follow-on commits r332906, r332911 with a fix for test clang/test/CodeGen/split-debug-filename.c. llvm-svn: 333013
OpenPOWER on IntegriCloud