summaryrefslogtreecommitdiffstats
path: root/clang
Commit message (Collapse)AuthorAgeFilesLines
...
* [CUDA] Removed unused __nvvm_* builtins with non-generic pointers.Artem Belevich2018-06-201-74/+0
| | | | | | | | | | | | They were hot even hooked into CGBuiltin's machinery. Even if they were, CUDA does not support AS-specific pointers, so there would be no legal way no way to call these builtins. This came up in D47154. Differential Revision: https://reviews.llvm.org/D47845 llvm-svn: 335168
* Fixed test in prior build where FileCheck tried to match againstLeonard Chan2018-06-201-1/+1
| | | | | | | `common` when declaring a global variable when we primarily care about the value assigned in the test. llvm-svn: 335159
* Fixed test that failed when checking what variable a value was storedLeonard Chan2018-06-201-12/+12
| | | | | | in for fixed point types. llvm-svn: 335155
* [Fixed Point Arithmetic] Fixed Point Precision Bits and Fixed Point LiteralsLeonard Chan2018-06-2040-50/+1175
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This diff includes the logic for setting the precision bits for each primary fixed point type in the target info and logic for initializing a fixed point literal. Fixed point literals are declared using the suffixes ``` hr: short _Fract uhr: unsigned short _Fract r: _Fract ur: unsigned _Fract lr: long _Fract ulr: unsigned long _Fract hk: short _Accum uhk: unsigned short _Accum k: _Accum uk: unsigned _Accum ``` Errors are also thrown for illegal literal values ``` unsigned short _Accum u_short_accum = 256.0uhk; // expected-error{{the integral part of this literal is too large for this unsigned _Accum type}} ``` Differential Revision: https://reviews.llvm.org/D46915 llvm-svn: 335148
* Simplify. No behavior change.Nico Weber2018-06-201-7/+1
| | | | llvm-svn: 335139
* [analyzer] Optimize constraint generation when the range is a concrete valueMikhail R. Gadelha2018-06-201-52/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: If a constraint is something like: ``` $0 = [1,1] ``` it'll now be created as: ``` assert($0 == 1) ``` instead of: ``` assert($0 >= 1 && $0 <= 1) ``` In general, ~3% speedup when solving per query in my machine. Biggest improvement was when verifying sqlite3, total time went down from 3000s to 2200s. I couldn't create a test for this as there is no way to dump the formula yet. D48221 adds a method to dump the formula but there is no way to do it from the command line. Also, a test that prints the formula will most likely fail in the future, as different solvers print the formula in different formats. Reviewers: NoQ, george.karpenkov, ddcc Reviewed By: george.karpenkov Subscribers: xazax.hun, szepet, a.sidorin Differential Revision: https://reviews.llvm.org/D48227 llvm-svn: 335116
* [SPIR] Prevent SPIR targets from using half conversion intrinsicsSjoerd Meijer2018-06-202-0/+151
| | | | | | | | | | | | | | | | | | | | | The SPIR target currently allows for half precision floating point types to be emitted using the LLVM intrinsic functions which convert half types to floats and doubles. However, this is illegal in SPIR as the only intrinsic allowed by SPIR is memcpy, as per section 3 of the SPIR specification. Currently this is leading to an assert being hit in the Clang CodeGen when attempting to emit a constant or literal _Float16 type in a comparison operation on a SPIR or SPIR64 target. This assert stems from the CodeGen attempting to emit a constant half value as an integer because the backend has specified that it is using these half conversion intrinsics (which represents half as i16). This patch prevents SPIR targets from using these intrinsics by overloading the responsible target info method, marks SPIR targets as having a legal half type and provides additional regression testing for the _Float16 type on SPIR targets. Patch by: Stephen McGroarty Differential Revision: https://reviews.llvm.org/D48188 llvm-svn: 335111
* [Sema] Allow creating types with multiple of the same addrspace.Alexey Bader2018-06-204-17/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The comment with the OpenCL clause about this clearly says: "No type shall be qualified by qualifiers for two or more different address spaces." This must mean that two or more qualifiers for the _same_ address space is allowed. However, it is likely unintended by the programmer, so emit a warning. For dependent address space types, reject them like before since we cannot know what the address space will be. Patch by Bevin Hansson (ebevhan). Reviewers: Anastasia Reviewed By: Anastasia Subscribers: bader, cfe-commits Differential Revision: https://reviews.llvm.org/D47630 llvm-svn: 335103
* Add a test to verify the x86 intrinsic headers compile cleanly with no ↵Douglas Yung2018-06-201-0/+14
| | | | | | warnings or errors. llvm-svn: 335088
* [X86] Undefine _mm512_mask_reduce_operator macro in avx512fintrin.h before ↵Craig Topper2018-06-201-0/+1
| | | | | | redefining it. llvm-svn: 335086
* Append new attributes to the end of an AttributeList.Michael Kruse2018-06-1936-188/+146
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... instead of prepending it at the beginning (the original behavior since implemented in r122535 2010-12-23). This builds up an AttributeList in the the order in which the attributes appear in the source. The reverse order caused nodes for attributes in the AST (e.g. LoopHint) to be in the reverse, and therefore printed in the wrong order by -ast-dump. Some TODO comments mention this. The order was explicitly reversed for enable_if attribute overload resolution and name mangling, which is not necessary anymore with this patch. The change unfortunately has some secondary effects, especially for diagnostic output. In the simplest cases, the CHECK lines or expected diagnostic were changed to the the new output. If the kind of error/warning changed, the attribute's order was changed instead. It also causes some 'previous occurrence here' hints to be textually after the main marker. This typically happens when attributes are merged, but are incompatible. Interchanging the role of the the main and note SourceLocation will also cause the case where two different declaration's attributes (in contrast to multiple attributes of the same declaration) are merged to be reversed. There is no easy fix because sometimes previous attributes are merged into a new declaration's attribute list, sometimes new attributes are added to a previous declaration's attribute list. Since 'previous occurrence here' pointing to locations after the main marker is not rare, I left the markers as-is; it is only relevant when the attributes are declared in the same declaration anyway, which often is on the same line. Differential Revision: https://reviews.llvm.org/D48100 llvm-svn: 335084
* clang-cl: Emit narrowing diag for initializer lists if -fmsc-version is at ↵Nico Weber2018-06-192-19/+40
| | | | | | | | | | | | | | | | | | least 1900 (i.e. MSVC2015). Diagnostics for narrowing conversions in initializer lists are currently DefaultIgnored in Microsoft mode. But MSVC 2015 did add warnings about narrowing conversions (C2397), so clang-cl can remove its special case code if MSCompatibilityVersion is new enough. (In MSVC, C2397 is just a warning and in clang it's default-mapped to an error, but it can be remapped, and disabled with -Wno-c++11-narrowing, so that should be fine.) Fixes PR37314. https://reviews.llvm.org/D48296 llvm-svn: 335082
* Recommit r335063: [Darwin] Add a warning for missing include path for libstdc++Alex Lorenz2018-06-196-38/+63
| | | | | | | | | | | | | | | | The recommit ensures that the tests that failed on bots don't trigger the warning. Xcode 10 removes support for libstdc++, but the users just get a confusing include not file warning when including an STL header (when building for iOS6 which uses libstdc++ by default for example). This patch adds a new warning that lets the user know that the libstdc++ include path was not found to ensure that the user is more aware of why the error occurs. rdar://40830462 Differential Revision: https://reviews.llvm.org/D48297 llvm-svn: 335081
* Recommit r335070 "[X86] Rewrite the max and min reduction intrinsics to make ↵Craig Topper2018-06-192-2512/+2525
| | | | | | | | better use of other functions and to reduce width to 256 and 128 bits were possible."" Test has been updated to reflect the IRGen. llvm-svn: 335075
* Revert r335063 as it causes bot failuresAlex Lorenz2018-06-194-60/+35
| | | | llvm-svn: 335073
* Revert r335070 "[X86] Rewrite the max and min reduction intrinsics to make ↵Craig Topper2018-06-192-2716/+2510
| | | | | | | | better use of other functions and to reduce width to 256 and 128 bits were possible." The test changes are failing the buildbot and its going to take me some time to fix it. llvm-svn: 335072
* [X86] Rewrite the max and min reduction intrinsics to make better use of ↵Craig Topper2018-06-192-2510/+2716
| | | | | | | | | | | | | | other functions and to reduce width to 256 and 128 bits were possible. 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. Differential Revision: https://reviews.llvm.org/D47401 llvm-svn: 335070
* [Darwin] Add a warning for missing include path for libstdc++Alex Lorenz2018-06-194-35/+60
| | | | | | | | | | | | | | Xcode 10 removes support for libstdc++, but the users just get a confusing include not file warning when including an STL header (when building for iOS6 which uses libstdc++ by default for example). This patch adds a new warning that lets the user know that the libstdc++ include path was not found to ensure that the user is more aware of why the error occurs. rdar://40830462 Differential Revision: https://reviews.llvm.org/D48297 llvm-svn: 335063
* Implement semantic checking for __builtin_signbit.Aaron Ballman2018-06-192-4/+34
| | | | | | r242675 changed the signature for the signbit builtin but did not introduce proper semantic checking to ensure the arguments are as-expected. This patch groups the signbit builtin along with the other fp classification builtins. Fixes PR28172. llvm-svn: 335050
* Reverting due to line ending changes; will reapply after addressing that.Aaron Ballman2018-06-192-1039/+1009
| | | | llvm-svn: 335049
* Implement semantic checking for __builtin_signbit.Aaron Ballman2018-06-192-1009/+1039
| | | | | | r242675 changed the signature for the signbit builtin but did not introduce proper semantic checking to ensure the arguments are as-expected. This patch groups the signbit builtin along with the other fp classification builtins. Fixes PR28172. llvm-svn: 335048
* [analyzer] Made a buildbot happy.Kristof Umann2018-06-191-7/+9
| | | | | | | Since `isPrimitiveType` was only used in an assert, a builbot with `-Werror` and no asserts enabled failed to build it as it was unused. llvm-svn: 335030
* Revert r335019 "Update NRVO logic to support early return (Attempt 2)"Taiju Tsuiki2018-06-1912-307/+84
| | | | llvm-svn: 335022
* [Sema] Produce diagnostics for attribute 'trivial_abi' that appearsAkira Hatanaka2018-06-193-10/+9
| | | | | | | | | | | | after the closing brace of a class declaration. Merge the two call sites of checkIllFormedTrivialABIStruct and sink it into CheckCompletedCXXClass so that it is called after the attribute has been attached to the CXXRecordDecl. rdar://problem/40873297 llvm-svn: 335021
* Update NRVO logic to support early return (Attempt 2)Taiju Tsuiki2018-06-1912-84/+307
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is the second attempt of r333500 (Update NRVO logic to support early return). The previous one was reverted for a miscompilation for an incorrect NRVO set up on templates such as: ``` struct Foo {}; template <typename T> T bar() { T t; if (false) return T(); return t; } ``` Where, `t` is marked as non-NRVO variable before its instantiation. However, while its instantiation, it's left an NRVO candidate, turned into an NRVO variable later. Reviewers: rsmith Reviewed By: rsmith Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D47586 llvm-svn: 335019
* IRgen: Mark aliases of ctors and dtors as unnamed_addr.Peter Collingbourne2018-06-1811-33/+29
| | | | | | | | | This is not only semantically correct but ensures that they will not be marked as address-significant once D48155 lands. Differential Revision: https://reviews.llvm.org/D48206 llvm-svn: 334982
* Don't let test/Driver/no-canonical-prefixes.c form a symlink cycle the ↵Nico Weber2018-06-181-0/+5
| | | | | | | | | | | | | | | | | second time it runs. The test makes %t.fake a symlink to %t.real by running `ln -sf %t.real %t.fake`. If %t.fake already is a symlink to %t.real when this runs (e.g. if the test has run before), then this effectively becomes `ln -sf %t.real %t.real`, symlinking the directory to itself. At least on my mac, this leads to the directory containing itself. As fix, just remove %t.fake before creating the symlink. To clean up build dirs on bots, also remove %t.real for a while. https://reviews.llvm.org/D48224 llvm-svn: 334972
* [analyzer] Remove accidentally committed lines.George Karpenkov2018-06-181-4/+1
| | | | llvm-svn: 334965
* Fix a bug introduced by rL334850Tomasz Krupa2018-06-181-2/+2
| | | | | | | | | | | | | | | Summary: All *_sqrt_round_s[s|d] intrinsics should execute a square root on zeroth element from B (Ops[1]) and insert in to A (Ops[0]), not the other way around. Reviewers: itaraban, craig.topper Reviewed By: craig.topper Subscribers: craig.topper, cfe-commits Differential Revision: https://reviews.llvm.org/D48288 llvm-svn: 334964
* [OPENMP, NVPTX] Emit simple reduction if requested.Alexey Bataev2018-06-182-3/+8
| | | | | | | If simple reduction is requested, use the simple reduction instead of the runtime functions calls. llvm-svn: 334962
* Update copyright year to 2018.Paul Robinson2018-06-182-2/+2
| | | | llvm-svn: 334936
* [analyzer] Checker for uninitialized C++ objectsKristof Umann2018-06-187-0/+3224
| | | | | | | | | | | | | | | | | | This checker analyzes C++ constructor calls, and reports uninitialized fields. Due to the nature of this problem (uninitialized fields after an object construction), this checker doesn't search for bugs, but rather is a tool to enforce a specific programming model where every field needs to be initialized. This checker lands in alpha for now, and a number of followup patches will be made to reduce false negatives and to make it easier for the user to understand what rules the checker relies on, eg. whether a derived class' constructor is responsible for initializing inherited data members or whether it should be handled in the base class' constructor. Differential Revision: https://reviews.llvm.org/D45532 llvm-svn: 334935
* [ASTMatchers] Add support for matching the type of a friend decl.David L. Jones2018-06-183-8/+30
| | | | | | | | | | | | | | | | | This allows matchers like: friendDecl(hasType(cxxRecordDecl(...))) friendDecl(hasType(asString(...))) It seems that hasType is probably the most reasonable narrowing matcher to overload, since it is already used to narrow to other declaration kinds. Differential Revision: https://reviews.llvm.org/D48242 Reviewers: klimek, aaron.ballman Subscribers: cfe-commits llvm-svn: 334930
* [ASTMatchers] Don't assert-fail in specifiesTypeLoc().David L. Jones2018-06-182-1/+6
| | | | | | | | The specifiesTypeLoc() matcher narrows a nestedNameSpecifier matcher based on a typeloc within the NNS. However, the matcher does not guard against NNS which are a namespace, and cause getTypeLoc to assert-fail. llvm-svn: 334929
* [analyzer] Add method to the generic SMT API to dump the SMT formulaMikhail R. Gadelha2018-06-162-0/+9
| | | | | | | | | | | | | | | | | | | Summary: New method dump the SMT formula and the Z3 implementation. There is no test because I only used it for debugging. However, if requested, I can add an option to the static analyzer to dump the formula (whole program? per path?), maybe something like the trimmed graph but for SMT formulas. Reviewers: NoQ, george.karpenkov, ddcc Reviewed By: george.karpenkov Subscribers: xazax.hun, szepet, a.sidorin Differential Revision: https://reviews.llvm.org/D48221 llvm-svn: 334891
* Add RUN line for amdgcn to lit test conditional-temporaries.cppYaxun Liu2018-06-161-0/+2
| | | | | | This is partial re-commit of r332982. llvm-svn: 334886
* Call CreateTempAllocaWithoutCast for ActiveFlagYaxun Liu2018-06-161-2/+2
| | | | | | This is partial re-commit of r332982. llvm-svn: 334879
* [docs] -fsanitize=cfi only allowed with -fvisibility=Fangrui Song2018-06-151-1/+1
| | | | llvm-svn: 334870
* [Modules] Improve .Private fix-its to handle 'explicit' and 'framework'Bruno Cardoso Lopes2018-06-154-12/+49
| | | | | | | | | | When in the context of suggestion the fix-it from .Private to _Private for private modules, trim off the 'explicit' and add 'framework' when appropriate. rdar://problem/41030554 llvm-svn: 334859
* [X86] Lowering sqrt intrinsics to native IRTomasz Krupa2018-06-156-41/+170
| | | | | | | | | | | | Reviewers: craig.topper, spatel, RKSimon, igorb, uriel.k Reviewed By: craig.topper Subscribers: tkrupa, cfe-commits Differential Revision: https://reviews.llvm.org/D41168 llvm-svn: 334850
* [X86] __builtin_ia32_prord512_mask, __builtin_ia32_prorq512_mask, ↵Craig Topper2018-06-152-3/+5
| | | | | | | | __builtin_ia32_shufpd should only accept an ICE constant. The rotates also need to check for the immediate to fit in 8-bits. Shufpd already checks its immediate range. llvm-svn: 334847
* [X86] The immediate argument to getmantpd*_mask should be an ICE and it ↵Craig Topper2018-06-152-6/+12
| | | | | | | | should only be 4 bits wide. We already checked this for the scalar version, but missed the vector version somehow. llvm-svn: 334846
* bpf: recognize target specific option -mattr=dwarfris in clangYonghong Song2018-06-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | | The following is the usage example with clang: bash-4.2$ clang -target bpf -O2 -g -c -Xclang -target-feature -Xclang +dwarfris t.c bash-4.2$ llvm-objdump -S -d t.o t.o: file format ELF64-BPF Disassembly of section .text: test: ; int test(void) { 0: b7 00 00 00 00 00 00 00 r0 = 0 ; return 0; 1: 95 00 00 00 00 00 00 00 exit bash-4.2$ cat t.c int test(void) { return 0; } bash-4.2$ Signed-off-by: Yonghong Song <yhs@fb.com> llvm-svn: 334839
* [NFC] Add CreateMemTempWithoutCast and CreateTempAllocaWithoutCastYaxun Liu2018-06-153-34/+53
| | | | | | This is partial re-commit of r332982 llvm-svn: 334837
* [AArch64] Reverted rC334696 with Clang VCVTA test fixLuke Geeson2018-06-153-0/+17
| | | | llvm-svn: 334820
* [ASTImporter] Corrected diagnostic client handling in tests.Adam Balogh2018-06-153-1/+24
| | | | | | | | | | | | ASTImporter tests may produce source file related warnings, the diagnostic client should be in correct state to handle it. Added 'beginSourceFile' to set the client state. Patch by: Balázs Kéri Differential Revision: https://reviews.llvm.org/D47445 llvm-svn: 334804
* [Format] Do not use a global static value for EOF within ScopedMacroState.David L. Jones2018-06-151-12/+4
| | | | | | | | | | | | | | | | | ScopedMacroState injects its own EOF token under certain conditions, and the returned token may be modified in several different locations. If multiple reformat operations are started in different threads, then they will both see the same fake EOF token, and may both try to modify it. This is a data race. This bug was caught with tsan. Reviewers: klimek Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D47759 llvm-svn: 334801
* [cmake] Add linker detection for Apple platformsShoaib Meenai2018-06-141-2/+2
| | | | | | | | | | | | | | | | LLVM currently assumes that Apple platforms will always use ld64. In the future, LLD Mach-O might also be supported, so add the beginnings of linker detection support. ld64 is currently the only detected linker, since `ld64.lld -v` doesn't yield any useful version output, but we can add that detection later, and in the meantime it's still useful to have the ld64 identification. Switch clang's order file check to use this new detection rather than just checking for the presence of an ld64 executable. Differential Revision: https://reviews.llvm.org/D48201 llvm-svn: 334780
* Modules: Fix implicit output file for .cppm to .pcm instead of stdoutDavid Blaikie2018-06-142-2/+3
| | | | | | | | | | | | | | | This code was introduced back in r178148, a change to introduce -module-file-info - which still exists & seems like it's still tested (& this change didn't cause any of those tests to fail). It doesn't look like this change was necessary there - since it's about pcm output, whereas -module-file-info looks like it's for pcm /input/. So I'm not really sure what the original motivation was. I'm open to ideas though, if it turns out the original change was necessary/useful. llvm-svn: 334778
* [X86] Rename __builtin_ia32_pslldqi128 to ↵Craig Topper2018-06-146-34/+30
| | | | | | | | | | | | __builtin_ia32_pslldqi128_byteshift and similar for other sizes. Remove the multiply by 8 from the header files. The previous names took the shift amount in bits to match gcc and required a multiply by 8 in the header. This creates a misleading error message when we check the range of the immediate to the builtin since the allowed range also got multiplied by 8. This commit changes the builtins to use a byte shift amount to match the underlying instruction and the Intel intrinsic. Fixes the remaining issue from PR37795. llvm-svn: 334773
OpenPOWER on IntegriCloud