summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* [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
* Revert "[clang-format] Fix putting ObjC message arguments in one line for ↵Jacek Olesiak2018-05-221-27/+1
| | | | | | | | | | | | | | | | multiline receiver" Summary: Reverts D46879 Reviewers: benhamilton Reviewed By: benhamilton Subscribers: krasimir, klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D47205 llvm-svn: 332998
* Revert r332982 Call CreateTempMemWithoutCast for ActiveFlagYaxun Liu2018-05-224-55/+36
| | | | | | Due to regression on arm. llvm-svn: 332991
* [CodeGen] produce the LLVM canonical form of absSanjay Patel2018-05-221-8/+4
| | | | | | | | We chose the 'slt' form as canonical in IR with: rL332819 ...so we should generate that form directly for efficiency. llvm-svn: 332989
* Call CreateTempMemWithoutCast for ActiveFlagYaxun Liu2018-05-224-36/+55
| | | | | | | | | | | | | | | | Introduced CreateMemTempWithoutCast and CreateTemporaryAllocaWithoutCast to emit alloca without casting to default addr space. ActiveFlag is a temporary variable emitted for clean up. It is defined as AllocaInst* type and there is a cast to AlllocaInst in SetActiveFlag. An alloca casted to generic pointer causes assertion in SetActiveFlag. Since there is only load/store of ActiveFlag, it is safe to use the original alloca, therefore use CreateMemTempWithoutCast is called. Differential Revision: https://reviews.llvm.org/D47099 llvm-svn: 332982
* [CodeView] Enable debugging of captured variables within C++ lambdasBrock Wyma2018-05-221-19/+43
| | | | | | | | | This change will help Visual Studio resolve forward references to C++ lambda routines used by captured variables. Differential Revision: https://reviews.llvm.org/D45438 llvm-svn: 332975
* Revert "CodeGen, Driver: Start using direct split dwarf emission in clang."Amara Emerson2018-05-222-54/+40
| | | | | | This reverts commit r332885 as it broke several greendragon buildbots. llvm-svn: 332973
* Revert "Fix another make_unique ambiguity."Amara Emerson2018-05-221-2/+1
| | | | | | This reverts commit r332906 as a dependency to revert r332885. llvm-svn: 332972
* clang-format: [JS] do not wrap before any `is`.Martin Probst2018-05-221-1/+1
| | | | | | | | | | | | | | | | | | | | Summary: `is` type annotations can occur at any nesting level. For example: function x() { return function y(): a is B { ... }; } Breaking before the `is` above breaks TypeScript parsing the code. This change prevents the wrap. Reviewers: krasimir Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D47193 llvm-svn: 332968
* [objc-gnustep2] Use unsigned char to avoid potential UB in isalnum.David Chisnall2018-05-221-1/+1
| | | | | | Suggested by Gabor Buella. llvm-svn: 332966
* [objc-gnustep2] Use isalnum instead of a less efficient and nonportable ↵David Chisnall2018-05-221-1/+1
| | | | | | | | equivalent. Patch by Hans Wennborg! llvm-svn: 332964
* Revert "Revert r332955 "GNUstep Objective-C ABI version 2""David Chisnall2018-05-223-352/+1420
| | | | llvm-svn: 332963
* [clang-format] Fix crash in getLengthToMatchingParenKrasimir Georgiev2018-05-221-3/+3
| | | | | | | | | | | | | | Summary: Found by oss-fuzz: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=8212 Reviewers: bkramer Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D47191 llvm-svn: 332961
* Revert r332955 "GNUstep Objective-C ABI version 2"Bjorn Pettersson2018-05-223-1420/+352
| | | | | | | Reverted due to buildbot failures. Seems like isnumber() is some Apple addition to cctype. llvm-svn: 332957
* Add cctype include.David Chisnall2018-05-221-0/+1
| | | | | | | This appears to leak in already on libc++ platforms, but is breaking on some other targets. llvm-svn: 332955
* GNUstep Objective-C ABI version 2David Chisnall2018-05-223-352/+1420
| | | | | | | | | | | | | | | | | | | | | Summary: This includes initial support for the (hopefully final) updated Objective-C ABI, developed here: https://github.com/davidchisnall/clang-gnustep-abi-2 It also includes some cleanups and refactoring from older GNU ABIs. The current version is ELF only, other formats to follow. Reviewers: rjmccall, DHowett-MSFT Reviewed By: rjmccall Subscribers: smeenai, cfe-commits Differential Revision: https://reviews.llvm.org/D46052 llvm-svn: 332950
* [X86] Prevent inclusion of __wmmintrin_aes.h and __wmmintrin_pclmul.h ↵Craig Topper2018-05-222-2/+10
| | | | | | without including wmmintrin.h llvm-svn: 332929
* Fix another make_unique ambiguity.Peter Collingbourne2018-05-211-1/+2
| | | | llvm-svn: 332906
* [X86] Remove masking from pternlog llvm intrinsics and use a select ↵Craig Topper2018-05-211-0/+47
| | | | | | | | | | | | instruction instead. Because the intrinsics in the headers are implemented as macros, we can't just use a select builtin and pternlog builtin. This would require one of the macro arguments to be used twice. Depending on what was passed to the macro we could expand an expression twice leading to weird behavior. We could maybe declare our local variable in the macro, but that would need to worry about name collisions. To avoid that just generate IR directly in CGBuiltin.cpp. Differential Revision: https://reviews.llvm.org/D47125 llvm-svn: 332891
* Revert r332847; it caused us to miscompile certain forms of reference ↵Richard Smith2018-05-212-33/+19
| | | | | | initialization. llvm-svn: 332886
* CodeGen, Driver: Start using direct split dwarf emission in clang.Peter Collingbourne2018-05-212-40/+54
| | | | | | | | Fixes PR37466. Differential Revision: https://reviews.llvm.org/D47093 llvm-svn: 332885
* [X86] Use __builtin_convertvector to implement some of the packed integer to ↵Craig Topper2018-05-216-108/+72
| | | | | | | | | | | | packed float conversion intrinsics. I believe this is safe assuming default default FP environment. The conversion might be inexact, but it can never overflow the FP type so this shouldn't be undefined behavior for the uitofp/sitofp instructions. We already do something similar for scalar conversions. Differential Revision: https://reviews.llvm.org/D46863 llvm-svn: 332882
* CodeGen: Add a dwo output file argument to addPassesToEmitFile and hook it ↵Peter Collingbourne2018-05-211-1/+1
| | | | | | | | | | up to dwo output. Part of PR37466. Differential Revision: https://reviews.llvm.org/D47089 llvm-svn: 332881
* Revert r332028; see PR37545 for details.Richard Smith2018-05-211-63/+58
| | | | llvm-svn: 332879
* [OPENMP-SIMD] Fix PR37536: Fix definition of _OPENMP macro.Alexey Bataev2018-05-213-18/+23
| | | | | | | | if `-fopenmp-simd` is specified alone, `_OPENMP` macro should not be defined. If `-fopenmp-simd` is specified along with the `-fopenmp`, `_OPENMP` macro should be defined with the value `201511`. llvm-svn: 332852
* [AMDGPU] fixes for lds f32 builtinsDaniil Fukalov2018-05-211-0/+43
| | | | | | | | | | | | 1. added restrictions to memory scope, order and volatile parameters 2. added custom processing for these builtins - currently is not used code, needed to switch off GCCBuiltin link to the builtins (ongoing change to llvm tree) 3. builtins renamed as requested Differential Revision: https://reviews.llvm.org/D43281 llvm-svn: 332848
* [CodeGen] Recognize more cases of zero initializationSerge Pavlov2018-05-212-19/+33
| | | | | | | | | | | | | | | | | | | | | If a variable has an initializer, codegen tries to build its value. If the variable is large in size, building its value requires substantial resources. It causes strange behavior from user viewpoint: compilation of huge zero initialized arrays like: char data_1[2147483648u] = { 0 }; consumes enormous amount of time and memory. With this change codegen tries to determine if variable initializer is equivalent to zero initializer. In this case variable value is not constructed. This change fixes PR18978. Differential Revision: https://reviews.llvm.org/D46241 llvm-svn: 332847
* [Sema] Fix incorrect packed aligned structure layoutMomchil Velikov2018-05-211-3/+4
| | | | | | | | | | Handle attributes before checking the record layout (e.g. underalignment check during `alignas` processing), as layout may be cached without taking into account attributes that may affect it. Differential Revision: https://reviews.llvm.org/D46439 llvm-svn: 332843
* [CodeGen] Disable aggressive structor optimizations at -O0, take 2Pavel Labath2018-05-211-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | | The first version of the patch (r332228) was flawed because it was putting structors into C5/D5 comdats very eagerly. This is correct only if we can ensure the comdat contains all required versions of the structor (which wasn't the case). This version uses a more nuanced approach: - for local structor symbols we use an alias because we don't have to worry about comdats or other compilation units. - linkonce symbols are emitted separately, as we cannot guarantee we will have all symbols we need to form a comdat (they are emitted lazily, only when referenced). - available_externally symbols are also emitted separately, as the code seemed to be worried about emitting an alias in this case. - other linkage types are not affected by the optimization level. They either get put into a comdat (weak) or get aliased (external). Reviewers: rjmccall, aprantl Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D46685 llvm-svn: 332839
* [X86] Remove some preprocessor feature checks from intrinsic headersCraig Topper2018-05-212-4/+0
| | | | | | | | | | | | | | | | | | | Summary: These look to be a couple things that weren't removed when we switched to target attribute. The popcnt makes including just smmintrin.h also include popcntintrin.h. The popcnt file itself already contains target attrributes. The prefetch ones are just wrappers around __builtin_prefetch which we have graceful fallbacks for in the backend if the exact instruction isn't available. So there's no reason to hide them. And it makes them available in functions that have the write target attribute but not a -march command line flag. Reviewers: echristo, RKSimon, spatel, DavidKreitzer Reviewed By: echristo Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D47029 llvm-svn: 332830
* [X86] Remove some unused builtins.Craig Topper2018-05-211-8/+0
| | | | | | These were upgraded to native shufflevectors months ago. llvm-svn: 332829
* [X86] Remove mask arguments from permvar builtins/intrinsics. Use a select ↵Craig Topper2018-05-206-152/+92
| | | | | | | | in IR instead. Someday maybe we'll use selects for all the builtins. llvm-svn: 332825
* Revert 332750, clang part (see comment on D46910).Nico Weber2018-05-201-2/+1
| | | | llvm-svn: 332822
* Sema: diagnose invalid catch parameter in ObjCSaleem Abdulrasool2018-05-201-3/+8
| | | | | | | | | Ensure that the type being used has an associated interface when declaring the parameter for `@catch`. Resolves PR37384! llvm-svn: 332821
* Print the qualified name when dumping deserialized decls.Vassil Vassilev2018-05-201-2/+4
| | | | | | | | | This is useful to understand and debug the lazy template specializations used in the pch and modules. Differential Revision: https://reviews.llvm.org/D41785 llvm-svn: 332817
* CodeGen: block capture shouldn't ICEJF Bastien2018-05-191-13/+26
| | | | | | | | | | When a lambda capture captures a __block in the same statement, the compiler asserts out because isCapturedBy assumes that an Expr can only be a BlockExpr, StmtExpr, or if it's a Stmt then all the statement's children are expressions. That's wrong, we need to visit all sub-statements even if they're not expressions to see if they also capture. Fix this issue by pulling out the isCapturedBy logic to use RecursiveASTVisitor. <rdar://problem/39926584> llvm-svn: 332801
* Do not enable RTTI with -fexceptions, for PS4Sunil Srivastava2018-05-183-48/+15
| | | | | | | | | | | | | | | | | | | NFC for targets other than PS4. This patch is a change in behavior for PS4, in that PS4 will no longer enable RTTI when -fexceptions is specified (RTTI and Exceptions are disabled by default on PS4). RTTI will remain disabled except for types being thrown or caught. Also, '-fexceptions -fno-rtti' (previously prohibited on PS4) is now accepted, as it is for other targets. This patch removes some PS4 specific code, making the code cleaner. Also, in the test file rtti-options.cpp, PS4 tests where the behavior is the same as the generic x86_64-linux are removed, making the test cleaner. Differential Revision: https://reviews.llvm.org/D46982 llvm-svn: 332784
* Maintain PS4 ABI compatibility by making the fix made in r331136 not apply ↵Douglas Yung2018-05-181-4/+6
| | | | | | | | | | | | when the target is the PS4. Reviewers: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D47084 llvm-svn: 332773
OpenPOWER on IntegriCloud