summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [clang-tidy] Add enum misuse check.Gabor Horvath2016-12-278-0/+526
| | | | | | | | | | | The checker detects various cases when an enum is probably misused (as a bitmask). Patch by: Peter Szecsi! Differential Revision: https://reviews.llvm.org/D22507 llvm-svn: 290600
* [AMDGPU] Assembler: support SDWA and DPP for VOP2b instructionsSam Kolton2016-12-275-7/+85
| | | | | | | | | | Reviewers: nhaustov, artem.tamazov, vpykhtin, tstellarAMD Subscribers: arsenm, kzhuravl, wdng, nhaehnle, yaxunl, tony-tye Differential Revision: https://reviews.llvm.org/D28051 llvm-svn: 290599
* RuntimeDyldELF: add R_AARCH64_ADD_ABS_LO12_NC relocEugene Leviant2016-12-272-0/+16
| | | | | | Differential revision: https://reviews.llvm.org/D28115 llvm-svn: 290598
* Allow setting multiple debug typesEugene Leviant2016-12-274-2/+46
| | | | | | Differential revision: https://reviews.llvm.org/D28109 llvm-svn: 290597
* Change a std::vector to SmallVector in NewGVNDaniel Berlin2016-12-271-1/+1
| | | | llvm-svn: 290596
* [PM] Teach the AAManager and AAResults layer (the worst offender forChandler Carruth2016-12-274-15/+93
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | inter-analysis dependencies) to use the new invalidation infrastructure. This teaches it to invalidate itself when any of the peer function AA results that it uses become invalid. We do this by just tracking the originating IDs. I've kept it in a somewhat clunky API since some users of AAResults are outside the new PM right now. We can clean this API up if/when those users go away. Secondly, it uses the registration on the outer analysis manager proxy to trigger deferred invalidation when a module analysis result becomes invalid. I've included test cases that specifically try to trigger use-after-free in both of these cases and they would crash or hang pretty horribly for me even without ASan. Now they work nicely. The `InvalidateAnalysis` utility pass required some tweaking to be useful in this context and it still is pretty garbage. I'd like to switch it back to the previous implementation and teach the explicit invalidate method on the AnalysisManager to take care of correctly triggering indirect invalidation, but I wanted to go ahead and send this out so folks could see how all of this stuff works together in practice. And, you know, that it does actually work. =] Differential Revision: https://reviews.llvm.org/D27205 llvm-svn: 290595
* [PM] Introduce the facilities for registering cross-IR-unit dependenciesChandler Carruth2016-12-279-125/+944
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that require deferred invalidation. This handles the other real-world invalidation scenario that we have cases of: a function analysis which caches references to a module analysis. We currently do this in the AA aggregation layer and might well do this in other places as well. Since this is relative rare, the technique is somewhat more cumbersome. Analyses need to register themselves when accessing the outer analysis manager's proxy. This proxy is already necessarily present to allow access to the outer IR unit's analyses. By registering here we can track and trigger invalidation when that outer analysis goes away. To make this work we need to enhance the PreservedAnalyses infrastructure to support a (slightly) more explicit model for "sets" of analyses, and allow abandoning a single specific analyses even when a set covering that analysis is preserved. That allows us to describe the scenario of preserving all Function analyses *except* for the one where deferred invalidation has triggered. We also need to teach the invalidator API to support direct ID calls instead of always going through a template to dispatch so that we can just record the ID mapping. I've introduced testing of all of this both for simple module<->function cases as well as for more complex cases involving a CGSCC layer. Much like the previous patch I've not tried to fully update the loop pass management layer because that layer is due to be heavily reworked to use similar techniques to the CGSCC to handle updates. As that happens, we'll have a better testing basis for adding support like this. Many thanks to both Justin and Sean for the extensive reviews on this to help bring the API design and documentation into a better state. Differential Revision: https://reviews.llvm.org/D27198 llvm-svn: 290594
* DR1495: A partial specialization is ill-formed if it is not (strictly) moreRichard Smith2016-12-2711-32/+257
| | | | | | | | specialized than the primary template. (Put another way, if we imagine there were a partial specialization matching the primary template, we should never select it if some other partial specialization also matches.) llvm-svn: 290593
* [PM] Turn on the new PM's inliner in addition to the current one forChandler Carruth2016-12-2760-5/+63
| | | | | | | | | | | | | | | most of the inliner test cases. The inliner involves a bunch of interesting code and tends to be where most of the issues I've seen experimenting with the new PM lie. All of these test cases pass, but I'd like to keep some more thorough coverage here so doing a fairly blanket enabling. There are a handful of interesting tests I've not enabled yet because they're focused on the always inliner, or on functionality that doesn't (yet) exist in the inliner. llvm-svn: 290592
* [AVX-512] Add all forms of VPALIGNR, VALIGND, and VALIGNQ to the load ↵Craig Topper2016-12-273-2/+196
| | | | | | folding tables. llvm-svn: 290591
* [PM] Add one of the features left out of the initial inliner patch:Chandler Carruth2016-12-272-7/+24
| | | | | | | | | | | | | | | | | skipping indirectly recursive inline chains. To do this, we implicitly build an inline stack for each callsite and check prior to inlining that doing so would not form a cycle. This uses the exact same technique and even shares some code with the legacy PM inliner. This solution remains deeply unsatisfying to me because it means we cannot actually iterate the inliner externally. Doing so would not be able to easily detect and avoid such cycles. Some day I would very much like to have a solution that works without this internal state to detect cycles, but this is not that day. llvm-svn: 290590
* [PM] Wire up another test to the new pass manager.Chandler Carruth2016-12-271-6/+8
| | | | | | | | Nothing really interesting here, but I had to improve the test to use variables rather than hard coding value names as we happen to end up with different value names in the new PM. llvm-svn: 290589
* [Analysis] Ignore `nobuiltin` on `allocsize` function calls.George Burgess IV2016-12-272-10/+28
| | | | | | | | | We currently ignore the `allocsize` attribute on functions calls with the `nobuiltin` attribute when trying to lower `@llvm.objectsize`. We shouldn't care about `nobuiltin` here: `allocsize` is explicitly added by the user, not inferred based on a function's symbol. llvm-svn: 290588
* Add reference/non-reference mismatch test.Richard Smith2016-12-271-1/+6
| | | | llvm-svn: 290587
* Work around a standard defect: template argument deduction for non-typeRichard Smith2016-12-274-8/+50
| | | | | | | | | template parameters of reference type basically doesn't work, because we're always deducing from an argument expression of non-reference type, so the type of the deduced expression never matches. Instead, compare the type of an expression naming the parameter to the type of the argument. llvm-svn: 290586
* [Analysis] Refactor as promised in r290397.George Burgess IV2016-12-271-16/+22
| | | | | | | | This also makes us no longer check for `allocsize` on intrinsic calls. This shouldn't matter, since intrinsics should provide the information we get from `allocsize` on their own. llvm-svn: 290585
* Emit CCEDiags when evaluating a const variable.George Burgess IV2016-12-273-10/+16
| | | | | | This addresses post-review feedback from r290577. llvm-svn: 290584
* [AVX-512] Remove masked pmuldq and pmuludq intrinsics and autoupgrade them ↵Craig Topper2016-12-275-244/+239
| | | | | | to unmasked intrinsics plus a select. llvm-svn: 290583
* [InstCombine][X86] Add DemandedElts support for 512-bit PMULDQ/PMULUDQ ↵Craig Topper2016-12-273-2/+35
| | | | | | | | | | instructions PMULDQ/PMULUDQ vXi64 instructions only use the even numbered v2Xi32 input elements which SimplifyDemandedVectorElts should try and use. This builds on r290554 which added supported for 128 and 256-bit. llvm-svn: 290582
* [LCG] Teach the LazyCallGraph to handle visiting the blockaddressChandler Carruth2016-12-272-0/+41
| | | | | | | | | constant expression and to correctly form function reference edges through them without crashing because one of the operands (the `BasicBlock` isn't actually a constant despite being an operand of a constant). llvm-svn: 290581
* [AVX-512] Replace masked 512-bit pmuldq and pmuludq builtins with the newly ↵Craig Topper2016-12-273-36/+40
| | | | | | added unmasked versions and selects. llvm-svn: 290580
* Revert r290574 "foo"Craig Topper2016-12-272-20/+32
| | | | | | This was supposed to be merged with another commit with a real commit message. Sorry. llvm-svn: 290579
* Revert r290575 "[AVX-512] Replace masked 512-bit pmuldq and pmuludq builtins ↵Craig Topper2016-12-272-24/+8
| | | | | | | | with the newly added unmasked versions and selects." I failed to merge this with r290574. llvm-svn: 290578
* Add a test for `const` folding introduced by r290297. NFC.George Burgess IV2016-12-271-0/+17
| | | | | | | AFAICT, we didn't add a test targeted at the new "const can sometimes act as constexpr" behavior introduced by r290297. llvm-svn: 290577
* Factor out repeated code for deducing a non-type template parameter as a givenRichard Smith2016-12-271-81/+38
| | | | | | argument value. No functionality change intended. llvm-svn: 290576
* [AVX-512] Replace masked 512-bit pmuldq and pmuludq builtins with the newly ↵Craig Topper2016-12-272-8/+24
| | | | | | added unmasked versions and selects. llvm-svn: 290575
* fooCraig Topper2016-12-272-32/+20
| | | | llvm-svn: 290574
* [AVX-512] Add 512-bit unmasked intrinsics for pmuldq and pmuludq so we can ↵Craig Topper2016-12-273-0/+244
| | | | | | | | add them to InstCombine with the 128 and 256 bit versions. The 128 and 256 bit masked intrinsics are currently unused by clang. The sse and avx2 unmasked intrinsics are used instead. The new 512-bit intrinsic will be used to do the same. Then all masked versions will removed and autoupgraded. llvm-svn: 290573
* [PM] Teach the inliner in the new PM to merge attributes after inlining.Chandler Carruth2016-12-272-1/+5
| | | | | | | Also enable the new PM in the attributes test case which caught this issue. llvm-svn: 290572
* test: filter out -fPIE/-pie on WindowsSaleem Abdulrasool2016-12-273-2/+11
| | | | | | | | | Use some new substitutions to avoid duplicating the tests for just dropped flags. -fPIC/-fPIE/-fpic/-fpie do not make sense on Windows as they can cause ELF-style PIC. Substitute away the flag on Windows. This should repair the windows buildbots. llvm-svn: 290571
* [Inliner] Modernize all of the inliner tests that were using grep.Chandler Carruth2016-12-2714-213/+320
| | | | | | | | | | | This mostly involved converting from grep to FileCheck and tidying up the IR used. In one case (invoke_test-3.ll) the test had become completely pointless as we use 'resume' rather than 'unwind' now, and even then it did not occur at the end of the line. llvm-svn: 290570
* Driver: switch Windows to static RelocModelSaleem Abdulrasool2016-12-274-33/+7
| | | | | | | | | | | | Windows uses PE/COFF which is inherently position independent. The use of the PIC model is unnecessary. In fact, we would generate invalid code using the ELF PIC model when PIC was enabled previously. Now that we no longer accept -fPIC and -fpoc, this switches the internal representation to the static model to permit us to make PIC modules invalid when targeting Windows. This should not change the code generation, only the internal state management. llvm-svn: 290569
* [tsan] Fix string to bool conversion warnings in tsan testsVitaly Buka2016-12-271-3/+3
| | | | llvm-svn: 290568
* Check and build conversion sequences for non-type template arguments inRichard Smith2016-12-274-12/+19
| | | | | | | dependent contexts when processing the template in C++11 and C++14, just like we do in C++98 and C++1z. This allows us to diagnose invalid templates earlier. llvm-svn: 290567
* [AVX-512][InstCombine] Teach InstCombine to turn masked scalar ↵Craig Topper2016-12-272-53/+114
| | | | | | | | add/sub/mul/div with rounding intrinsics into normal IR operations if the rounding mode is CUR_DIRECTION. An earlier commit added support for unmasked scalar operations. At that time isel wouldn't generate an optimal sequence for masked operations, but that has now been fixed. llvm-svn: 290566
* [InstCombine][AVX-512] Add masked scalar add/sub/mul/div intrinsic test ↵Craig Topper2016-12-271-0/+88
| | | | | | | | cases that don't have a CUR_DIRECTION rounding mode. The CUR_DIRECTION case will be optimized in a future commit so this provides coverage for the other cases. llvm-svn: 290565
* [AVX-512] Add isel patterns to turn native masked scalar add/sub/mul/div ↵Craig Topper2016-12-272-4/+26
| | | | | | into masked instructions. llvm-svn: 290564
* [AVX-512] Add tests to show missed opportunities for combining masking with ↵Craig Topper2016-12-271-0/+110
| | | | | | | | scalar arithmetic operations. These particular sequences will be generated after a future change to teach InstCombine to turn masked scalar arithmetic intrinsics into native IR. llvm-svn: 290563
* [PM] Move the collection of call sites to a more appropriate placeChandler Carruth2016-12-272-9/+16
| | | | | | | | | | | | | | | | | | | | | inside of `InlineFunction`. Prior to this, call instructions are specifically being rewritten and replaced within the inlined region, invalidating some of the call sites. Several of these regions are using the same technique to walk the inlined region so this seems clearly safe up to this point. I've also added a short circuit to the scan for call sites based on what other code is doing. With this, the most common crash I've found in the new inliner code is fixed. I've turned it on for another test case that covers this scenario. I'll make my way through most of the other inliner test cases just to get some easy coverage next. llvm-svn: 290562
* [DOXYGEN] Improved doxygen comments for x86 intrinsics.Ekaterina Romanova2016-12-278-203/+217
| | | | | | | | | | Improved doxygen comments for the following intrinsics headers: __wmmintrin_pclmul.h, bmiintrin.h, emmintrin.h, f16cintrin.h, immintrin.h, mmintrin.h, pmmintrin.h, tmmintrin.h Added \n commands to insert a line breaks where necessary, since one long line of documentation is nearly unreadable. Formatted comments to fit into 80 chars. In some cases added \a command in front of the parameter names to display them in italics. llvm-svn: 290561
* [PM] The new pass manager requires a registered target for these, andChandler Carruth2016-12-271-0/+2
| | | | | | | given that they hard code specific triples that seems reasonable so add the REQUIRES. llvm-svn: 290560
* [AVX-512][InstCombine] Teach InstCombine to turn packed add/sub/mul/div with ↵Craig Topper2016-12-272-0/+364
| | | | | | rounding intrinsics into normal IR operations if the rounding mode is CUR_DIRECTION. llvm-svn: 290559
* [PH] Teach the new PM code path to support -disable-llvm-passes.Chandler Carruth2016-12-272-10/+17
| | | | | | | | | | | This is kind of funny because I specifically did work to make this easy and then it didn't actually get implemented. I've also ported a set of tests that rely on this functionality to run with the new PM as well as the old PM so that we don't mess this up in the future. llvm-svn: 290558
* [PM] Teach the always inliner in the new pass manager to supportChandler Carruth2016-12-265-38/+137
| | | | | | | | | | | | | | | | removing fully-dead comdats without removing dead entries in comdats with live members. This factors the core logic out of the current inliner's internals to a reusable utility and leverages that in both places. The factored out code should also be (minorly) more efficient in cases where we have very few dead functions or dead comdats to consider. I've added a test case to cover this behavior of the always inliner. This is the last significant bug in the new PM's always inliner I've found (so far). llvm-svn: 290557
* [doc] Add mention of the difference in optimization level between Release ↵Mehdi Amini2016-12-261-0/+2
| | | | | | | | and RelWithDebInfo in Cmake.rst This is surprising to many people. llvm-svn: 290556
* [ADT] Add an llvm::erase_if utility to make the standard erase+remove_ifChandler Carruth2016-12-262-0/+23
| | | | | | | | pattern easier to write. Differential Revision: https://reviews.llvm.org/D28120 llvm-svn: 290555
* [InstCombine][X86] Add DemandedElts support for PMULDQ/PMULUDQ instructionsSimon Pilgrim2016-12-263-18/+56
| | | | | | | | PMULDQ/PMULUDQ vXi64 instructions only use the even numbered v2Xi32 input elements which SimplifyDemandedVectorElts should try and use. Differential Revision: https://reviews.llvm.org/D28119 llvm-svn: 290554
* [ADT] Add a boring std::partition wrapper similar to our std::remove_ifChandler Carruth2016-12-262-0/+28
| | | | | | wrapper. llvm-svn: 290553
* Update comment to match dr1770.Richard Smith2016-12-261-8/+7
| | | | llvm-svn: 290552
* clang-format NewGVN filesDaniel Berlin2016-12-262-85/+71
| | | | llvm-svn: 290551
OpenPOWER on IntegriCloud