summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [test][Driver] Fix Clang :: Driver/cl-response-file.cRainer Orth2019-06-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clang :: Driver/cl-response-file.c currently FAILs on Solaris: Command Output (stderr): -- /vol/llvm/src/clang/dist/test/Driver/cl-response-file.c:10:11: error: CHECK: expected string not found in input // CHECK: "-I" "{{.*}}\\Inputs\\cl-response-file\\" "-D" "FOO=2" ^ Looking at the generated response file reveals that this is no surprise: /I/vol/llvm/src/clang/dist/test/Driver\Inputs with no newline at the end. The echo command used to create it boils down to echo 'a\cb' However, one cannot expect \c to be emitted literally: e.g. bash's builtin echo has \c suppress further output I've tried various combinations of builtin echo, /usr/bin/echo, GNU echo if different, the same for printf, and the backslash unescaped and quoted (a\cb and a\\cb). The only combination that worked reliably on Solaris, Linux, and macOS was printf 'a\\cb' so this is what this patch uses. Tested on amd64-pc-solaris2.11 and x86_64-pc-linux-gnu. Differential Revision: https://reviews.llvm.org/D63600 llvm-svn: 363985
* [profile] Solaris ld supports __start___llvm_prof_data etc. labelsRainer Orth2019-06-202-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, many profiling tests on Solaris FAIL like Command Output (stderr): -- Undefined first referenced symbol in file __llvm_profile_register_names_function /tmp/lit_tmp_Nqu4eh/infinite_loop-9dc638.o __llvm_profile_register_function /tmp/lit_tmp_Nqu4eh/infinite_loop-9dc638.o Solaris 11.4 ld supports the non-standard GNU ld extension of adding __start_SECNAME and __stop_SECNAME labels to sections whose names are valid as C identifiers. Given that we already use Solaris 11.4-only features like ld -z gnu-version-script-compat and fully working .preinit_array support in compiler-rt, we don't need to worry about older versions of Solaris ld. The patch documents that support (although the comment in lib/Transforms/Instrumentation/InstrProfiling.cpp (needsRuntimeRegistrationOfSectionRange) is quite cryptic what it's actually about), and adapts the affected testcase not to expect the alternativeq __llvm_profile_register_functions and __llvm_profile_init. It fixes all affected tests. Tested on amd64-pc-solaris2.11. Differential Revision: https://reviews.llvm.org/D41111 llvm-svn: 363984
* AMDGPU: Add intrinsics for DS GWS semaphore instructionsMatt Arsenault2019-06-2011-26/+241
| | | | llvm-svn: 363983
* [LICM & MSSA] Limit unsafe sinking and hoisting.Alina Sbirlea2019-06-204-12/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The getClobberingMemoryAccess API checks for clobbering accesses in a loop by walking the backedge. This may check if a memory access is being clobbered by the loop in a previous iteration, depending how smart AA got over the course of the updates in MemorySSA (it does not occur when built from scratch). If no clobbering access is found inside the loop, it will optimize to an access outside the loop. This however does not mean that access is safe to sink. Given: ``` for i load a[i] store a[i] ``` The access corresponding to the load can be optimized to outside the loop, and the load can be hoisted. But it is incorrect to sink it. In order to sink the load, we'd need to check no Def clobbers the Use in the same iteration. With this patch we currently restrict sinking to either Defs not existing in the loop, or Defs preceding the load in the same block. An easy extension is to ensure the load (Use) post-dominates all Defs. Caught by PR42294. This issue also shed light on the converse problem: hoisting stores in this same scenario would be illegal. With this patch we restrict hoisting of stores to the case when their corresponding Defs are dominating all Uses in the loop. Reviewers: george.burgess.iv Subscribers: jlebar, Prazek, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63582 llvm-svn: 363982
* [InstSimplify] add tests for known-not-a-power-of-2; NFCSanjay Patel2019-06-201-0/+28
| | | | | | | | | | | | | | I added a canonicalization to create this general pattern in: rL363956 But as noted in PR42314: https://bugs.llvm.org/show_bug.cgi?id=42314#c11 ...we have a (potentially expensive) simplification for the version of the code that we just canonicalized away from, so we should add/adjust that code to match. llvm-svn: 363981
* Rename CodeGenFunction::overlapFor* to getOverlapFor*.Richard Smith2019-06-206-15/+15
| | | | llvm-svn: 363980
* AMDGPU: Insert mem_viol check loop around GWS pre-GFX9Matt Arsenault2019-06-207-116/+253
| | | | | | | It is necessary to emit this loop around GWS operations in case the wave is preempted pre-GFX9. llvm-svn: 363979
* [NFC][SLP] Pre-commit unary FNeg test to X86/propagate_ir_flags.llCameron McInally2019-06-201-0/+78
| | | | llvm-svn: 363978
* Update LLVM test to not check for the EliminateAvailableExternallyPassLeonard Chan2019-06-201-3/+4
| | | | | | for lto-pre-link O2 pipeline runs. llvm-svn: 363977
* P0840R2: support for [[no_unique_address]] attributeRichard Smith2019-06-2021-98/+704
| | | | | | | | | | | | | | | | | Summary: Add support for the C++2a [[no_unique_address]] attribute for targets using the Itanium C++ ABI. This depends on D63371. Reviewers: rjmccall, aaron.ballman Subscribers: dschuff, aheejin, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63451 llvm-svn: 363976
* [clang-tidy] Fail gracefully upon empty database fieldsSerge Guelton2019-06-204-3/+12
| | | | | | | | Fix bz#42281 Differential Revision: https://reviews.llvm.org/D63613 llvm-svn: 363975
* [InstCombine] fix typo in comment; NFCSanjay Patel2019-06-201-1/+1
| | | | llvm-svn: 363974
* Fix passing structs and AVX vectors through sysv_abiReid Kleckner2019-06-202-8/+67
| | | | | | | | Do this the same way we did it for ms_abi in r324594. Fixes PR36806. llvm-svn: 363973
* Fix crash and rejects-valid when a later template parameter or defaultRichard Smith2019-06-205-12/+70
| | | | | | | | | | | | | | | | | | | | template argument contains a backreference to a dependently-typed earlier parameter. In a case like: template<typename T, T A, decltype(A) = A> struct X {}; template<typename U> auto Y = X<U, 0>(); we previously treated both references to `A` in the third parameter as being of type `int` when checking the template-id in `Y`. That`s wrong; the type of `A` in these contexts is the dependent type `U`. When we encounter a non-type template argument that we can't convert to the parameter type because of type-dependence, we now insert a dependent conversion node so that the SubstNonTypeTemplateParmExpr for the template argument will have the parameter's type rather than whatever type the argument had. llvm-svn: 363972
* [clang][NewPM] Do not eliminate available_externally durng `-O2 -flto` runsLeonard Chan2019-06-203-5/+33
| | | | | | | | | | | | This fixes CodeGen/available-externally-suppress.c when the new pass manager is turned on by default. available_externally was not emitted during -O2 -flto runs when it should still be retained for link time inlining purposes. This can be fixed by checking that we aren't LTOPrelinking when adding the EliminateAvailableExternallyPass. Differential Revision: https://reviews.llvm.org/D63580 llvm-svn: 363971
* [NFC] Add more tests for D46262David Bolvansky2019-06-201-21/+326
| | | | llvm-svn: 363970
* [clang][NewPM] Move EntryExitInstrumenterPass to the start of the pipelineLeonard Chan2019-06-202-2/+11
| | | | | | | | | | This fixes CodeGen/x86_64-instrument-functions.c when running under the new pass manager. The pass should go before any other pass to prevent `__cyg_profile_func_enter/exit()` from not being emitted by inlined functions. Differential Revision: https://reviews.llvm.org/D63577 llvm-svn: 363969
* [libc++] Take 2: Implement CTAD for map and multimapLouis Dionne2019-06-208-4/+775
| | | | | | | | | | | This is a re-application of r362986 (which was reverted in r363688) with fixes for the issue that caused it to be reverted. Thanks to Arthur O'Dwyer for the patch. Differential Revision: https://reviews.llvm.org/D58587 llvm-svn: 363968
* [NFC] Updated tests for D63546David Bolvansky2019-06-201-46/+123
| | | | llvm-svn: 363967
* Print additional information about @encode expressions when dumping the AST ↵Aaron Ballman2019-06-203-0/+148
| | | | | | to JSON. llvm-svn: 363966
* Print additional information on dependent scopes when dumping the AST to JSON.Aaron Ballman2019-06-203-366/+658
| | | | llvm-svn: 363965
* [LFTR] Fix a (latent?) bug related to nested loopsPhilip Reames2019-06-201-0/+6
| | | | | | | | I can't actually come up with a test case this triggers on without an out of tree change, but in theory, it's a bug in the recently added multiple exit LFTR support. The root issue is that an exiting block common to two loops can (in theory) have computable exit counts for both loops. Rewriting the exit of an inner loop in terms of the outer loops IV would cause the inner loop to either a) run forever, or b) terminate on the first iteration. In practice, we appear to get lucky and not have the exit count computable for the outer loop, except when it's trivially zero. Given we bail on zero exit counts, we don't appear to ever trigger this. But I can't come up with a reason we *can't* compute an exit count for the outer loop on the common exiting block, so this may very well be triggering in some cases. llvm-svn: 363964
* [NFC] Fix for InterfaceStubs tests (adding REQUIRES: x86-registered-target).Puyan Lotfi2019-06-2012-0/+12
| | | | | | | | | | clang-hexagon-elf bot was failing with: 'No available targets are compatible with triple "x86_64-unknown-linux-gnu"' Adding a "// REQUIRES: x86-registered-target" to these tests to quiet the bot. llvm-svn: 363963
* lld/elf: Deduplicate undefined symbol diagnosticsNico Weber2019-06-205-32/+164
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before: ``` ld.lld: error: undefined symbol: f() >>> referenced by test.cc:3 >>> /var/folders/c5/8d7sdn1x2mg92mj0rndghhdr0000gn/T/test-9c0808.o:(g()) ld.lld: error: undefined symbol: f() >>> referenced by test.cc:4 >>> /var/folders/c5/8d7sdn1x2mg92mj0rndghhdr0000gn/T/test-9c0808.o:(h()) ld.lld: error: undefined symbol: f() >>> referenced by test.cc:5 >>> /var/folders/c5/8d7sdn1x2mg92mj0rndghhdr0000gn/T/test-9c0808.o:(j()) ld.lld: error: undefined symbol: k() >>> referenced by test.cc:5 >>> /var/folders/c5/8d7sdn1x2mg92mj0rndghhdr0000gn/T/test-9c0808.o:(j()) ld.lld: error: undefined symbol: f() >>> referenced by test2.cc:2 >>> /var/folders/c5/8d7sdn1x2mg92mj0rndghhdr0000gn/T/test2-07b391.o:(asdf()) clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` Now: ``` ld.lld: error: undefined symbol: f() >>> referenced by test.cc:3 >>> /var/folders/c5/8d7sdn1x2mg92mj0rndghhdr0000gn/T/test-0e07ba.o:(g()) >>> referenced by test.cc:4 >>> /var/folders/c5/8d7sdn1x2mg92mj0rndghhdr0000gn/T/test-0e07ba.o:(h()) >>> referenced by test.cc:5 >>> /var/folders/c5/8d7sdn1x2mg92mj0rndghhdr0000gn/T/test-0e07ba.o:(j()) >>> referenced by test2.cc:2 >>> /var/folders/c5/8d7sdn1x2mg92mj0rndghhdr0000gn/T/test2-6bdb24.o:(asdf()) ld.lld: error: undefined symbol: k() >>> referenced by test.cc:5 >>> /var/folders/c5/8d7sdn1x2mg92mj0rndghhdr0000gn/T/test-0e07ba.o:(j()) clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` If there are more than 10 references to an undefined symbol, only the first 10 are printed. Fixes PR42260. Differential Revision: https://reviews.llvm.org/D63344 llvm-svn: 363962
* [X86] Make _mm_mask_cvtps_ph, _mm_maskz_cvtps_ph, _mm256_mask_cvtps_ph, and ↵Craig Topper2019-06-203-48/+12
| | | | | | | | | | | | | | _mm256_maskz_cvtps_ph aliases for their corresponding cvt_roundps_ph intrinsic. These intrinsics should always take an immediate for the rounding mode. The base instruction comes from before EVEX embdedded rounding. The user should always provide the immediate rather than us assuming CUR_DIRECTION. Make the 512-bit versions also explicit aliases instead of copy pasting the code. llvm-svn: 363961
* gn build: Merge r363948Nico Weber2019-06-201-0/+1
| | | | llvm-svn: 363960
* [OpenMP] Add support for handling declare target to clause when unified ↵Gheorghe-Teodor Bercea2019-06-208-76/+142
| | | | | | | | | | | | | | | | | | | | | memory is required Summary: This patch adds support for the handling of the variables under the declare target to clause. The variables in this case are handled like link variables are. A pointer is created on the host and then mapped to the device. The runtime will then copy the address of the host variable in the device pointer. Reviewers: ABataev, AlexEichenberger, caomhin Reviewed By: ABataev Subscribers: guansong, jdoerfert, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63108 llvm-svn: 363959
* [pstl] Default to the serial backend when unspecifiedLouis Dionne2019-06-201-1/+3
| | | | | | | | | This is a stopgap measure to make it easier to integrate the PSTL into libc++. In the future, we should have a system similar to what libc++ does, where we specify settings at configuration time and generate a __config_site header that is part of the PSTL. llvm-svn: 363958
* [X86] Add BLSI to isUseDefConvertible.Craig Topper2019-06-202-4/+6
| | | | | | | | | | | | | | | | | | | | | Summary: BLSI sets the C flag is the input is not zero. So if its followed by a TEST of the input where only the Z flag is consumed, we can replace it with the opposite check of the C flag. We should be able to do the same for BLSMSK and BLSR, but the naive test case for those is being optimized to a subo by CodeGenPrepare. Reviewers: spatel, RKSimon Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63589 llvm-svn: 363957
* [InstCombine] canonicalize check for power-of-2Sanjay Patel2019-06-202-21/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The form that compares against 0 is better because: 1. It removes a use of the input value. 2. It's the more standard form for this pattern: https://graphics.stanford.edu/~seander/bithacks.html#DetermineIfPowerOf2 3. It results in equal or better codegen (tested with x86, AArch64, ARM, PowerPC, MIPS). This is a root cause for PR42314, but probably doesn't completely answer the codegen request: https://bugs.llvm.org/show_bug.cgi?id=42314 Alive proof: https://rise4fun.com/Alive/9kG Name: is power-of-2 %neg = sub i32 0, %x %a = and i32 %neg, %x %r = icmp eq i32 %a, %x => %dec = add i32 %x, -1 %a2 = and i32 %dec, %x %r = icmp eq i32 %a2, 0 Name: is not power-of-2 %neg = sub i32 0, %x %a = and i32 %neg, %x %r = icmp ne i32 %a, %x => %dec = add i32 %x, -1 %a2 = and i32 %dec, %x %r = icmp ne i32 %a2, 0 llvm-svn: 363956
* [DAGCombiner] Use getAPIntValue() instead of getZExtValue() where possible.Simon Pilgrim2019-06-201-21/+20
| | | | | | Better handling of out-of-i64-range values due to large integer types or from fuzz tests. llvm-svn: 363955
* [DAGCombiner][NFC] Remove unused varJordan Rupprecht2019-06-201-1/+0
| | | | llvm-svn: 363954
* [Tests] Add a tricky LFTR case for documentation purposesPhilip Reames2019-06-201-0/+64
| | | | | | Thought of this case while working on something else. We appear to get it right in all of the variations I tried, but that's by accident. So, add a test which would catch the potential bug. llvm-svn: 363953
* Store a pointer to the return value in a static alloca and let the debugger ↵Amy Huang2019-06-2014-23/+306
| | | | | | | | | | | | | | use that as the variable address for NRVO variables. Subscribers: hiraditya, cfe-commits, llvm-commits Tags: #clang, #llvm Differential Revision: https://reviews.llvm.org/D63361 llvm-svn: 363952
* [InstCombine] cttz(-x) -> cttz(x)David Bolvansky2019-06-202-16/+32
| | | | | | | | | | | | | | | | Summary: Signedness does not change number of trailing zeros. Reviewers: spatel, lebedev.ri, nikic Reviewed By: spatel Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63534 llvm-svn: 363951
* AMDGPU: Eliminate test usage of legacy FP elim attributesMatt Arsenault2019-06-202-3/+3
| | | | llvm-svn: 363950
* AMDGPU: Fix ignoring DisableFramePointerElim in leaf functionsMatt Arsenault2019-06-202-15/+48
| | | | | | | | The attribute can specify elimination for leaf or non-leaf, so it should always be considered. I copied this bug from AArch64, which probably should also be fixed. llvm-svn: 363949
* [clang-ifs] Clang Interface Stubs, first version (second landing attempt).Puyan Lotfi2019-06-2023-0/+956
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change reverts r363649; effectively re-landing r363626. At this point clang::Index::CodegenNameGeneratorImpl has been refactored into clang::AST::ASTNameGenerator. This makes it so that the previous circular link dependency no longer exists, fixing the previous share lib (-DBUILD_SHARED_LIBS=ON) build issue which was the reason for r363649. Clang interface stubs (previously referred to as clang-ifsos) is a new frontend action in clang that allows the generation of stub files that contain mangled name info that can be used to produce a stub library. These stub libraries can be useful for breaking up build dependencies and controlling access to a library's internal symbols. Generation of these stubs can be invoked by: clang -fvisibility=<visibility> -emit-interface-stubs \ -interface-stub-version=<interface format> Notice that -fvisibility (along with use of visibility attributes) can be used to control what symbols get generated. Currently the interface format is experimental but there are a wide range of possibilities here. Currently clang-ifs produces .ifs files that can be thought of as analogous to object (.o) files, but just for the mangled symbol info. In a subsequent patch I intend to add support for merging the .ifs files into one .ifs/.ifso file that can be the input to something like llvm-elfabi to produce something like a .so file or .dll (but without any of the code, just symbols). Differential Revision: https://reviews.llvm.org/D60974 llvm-svn: 363948
* [CodeGen] Fix formatting and comments (NFC)Evandro Menezes2019-06-205-93/+95
| | | | llvm-svn: 363947
* [AMDGPU] gfx10 tests. NFC.Stanislav Mekhanoshin2019-06-2021-191/+235367
| | | | llvm-svn: 363946
* [InstCombine] add commuted variants for power-of-2 checks; NFCSanjay Patel2019-06-201-0/+47
| | | | llvm-svn: 363945
* [Sema] Diagnose addr space mismatch while constructing objectsAnastasia Stulova2019-06-208-4/+92
| | | | | | | | | | | | | | If we construct an object in some arbitrary non-default addr space it should fail unless either: - There is an implicit conversion from the address space to default /generic address space. - There is a matching ctor qualified with an address space that is either exactly matching or convertible to the address space of an object. Differential Revision: https://reviews.llvm.org/D62156 llvm-svn: 363944
* Dump more information about expressions involving temporaries when dumping ↵Aaron Ballman2019-06-205-2/+516
| | | | | | the AST to JSON. llvm-svn: 363943
* [pstl] Mark pstl tests as unsupported before C++17Louis Dionne2019-06-2059-2/+118
| | | | | | This is required to run the tests in lit with libc++'s tests. llvm-svn: 363942
* AMDGPU: Treat undef as an inline immediateMatt Arsenault2019-06-203-9/+21
| | | | | | | This should only matter in vectors with an undef component, since a full undef vector would have been folded out. llvm-svn: 363941
* AMDGPU: Make test functions hiddenMatt Arsenault2019-06-201-23/+23
| | | | | | Reduces amount of code in the function from eliminating the GOT load. llvm-svn: 363940
* AIX system headers need stdint.h and inttypes.h to be re-enterableXing Xue2019-06-205-0/+288
| | | | | | | | | | | | | | | | | Summary: AIX system headers need stdint.h and inttypes.h to be re-enterable when macro _STD_TYPES_T is defined so that limit macro definitions such as UINT32_MAX can be found. This patch attempts to allow that on AIX. Reviewers: hubert.reinterpretcast, jasonliu, mclow.lists, EricWF Reviewed by: hubert.reinterpretcast, mclow.lists Subscribers: jfb, jsji, christof, cfe-commits, libcxx-commits, llvm-commits Tags: #LLVM, #clang, #libc++ Differential Revision: https://reviews.llvm.org/D59253 llvm-svn: 363939
* [InstCombine] add tests for checking power-of-2; NFCSanjay Patel2019-06-201-0/+138
| | | | llvm-svn: 363938
* [NFC][SLP] Pre-commit unary FNeg test to X86/phi3.llCameron McInally2019-06-201-0/+41
| | | | llvm-svn: 363937
* [ARM] Add a batch of MVE integer instructions.Simon Tatham2019-06-205-1/+1127
| | | | | | | | | | | | | | | | This includes integer arithmetic of various kinds (add/sub/multiply, saturating and not), and the immediate forms of VMOV and VMVN that load an immediate into all lanes of a vector. Reviewers: dmgreen, samparker, SjoerdMeijer, t.p.northover Subscribers: javed.absar, kristof.beyls, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62674 llvm-svn: 363936
OpenPOWER on IntegriCloud