summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* convert another test to unix line endingsNico Weber2019-10-141-14/+14
| | | | llvm-svn: 374752
* convert a test to unix line endingsNico Weber2019-10-141-84/+84
| | | | llvm-svn: 374751
* fix typo in 374747Nico Weber2019-10-141-1/+1
| | | | llvm-svn: 374750
* Prefer 'env not' over 'not env' in tests.Nico Weber2019-10-1416-30/+30
| | | | | | | | | That way, lit's builtin 'env' command can be used for the 'env' bit. Also it's clearer that way that the 'not' shouldn't cover 'env' failures. llvm-svn: 374749
* [X86] Autogenerate complete checks. NFCCraig Topper2019-10-142-64/+159
| | | | llvm-svn: 374748
* Make symbols.test pass on Windows.Nico Weber2019-10-142-2/+2
| | | | | | | | See commit message of r374746 for details. Hopefully final bit of PR43592. llvm-svn: 374747
* Make code-action-request.test and request-reply.test pass on Windows.Nico Weber2019-10-142-5/+5
| | | | | | | | | | | | clangd's test:// scheme expands to /clangd-test on non-Win and to C:/clang-test on Win, so it can't be mixed freely with file:///clangd-test since that's wrong on Windows. This makes both tests consistenly use the test:// scheme. (Alternatively, we could use the //INPUT_DIR pattern used in a few other tests.) Part of PR43592. llvm-svn: 374746
* Don't run background-index.test on Windows.Nico Weber2019-10-141-1/+1
| | | | | | | | | The test had a "UNSUPPORTED: win32" line, but the spelling of that changed in r339307 a year ago. Finally update this test too. Part of PR43592. llvm-svn: 374745
* [NewGVN] Use m_Br to simplify code a bit. (NFC)Florian Hahn2019-10-131-5/+5
| | | | llvm-svn: 374744
* Add a pass to lower is.constant and objectsize intrinsicsJoerg Sonnenberger2019-10-1338-457/+399
| | | | | | | | | | | | | | | | | This pass lowers is.constant and objectsize intrinsics not simplified by earlier constant folding, i.e. if the object given is not constant or if not using the optimized pass chain. The result is recursively simplified and constant conditionals are pruned, so that dead blocks are removed even for -O0. This allows inline asm blocks with operand constraints to work all the time. The new pass replaces the existing lowering in the codegen-prepare pass and fallbacks in SDAG/GlobalISEL and FastISel. The latter now assert on the intrinsics. Differential Revision: https://reviews.llvm.org/D65280 llvm-svn: 374743
* Improve __builtin_constant_p loweringJoerg Sonnenberger2019-10-134-95/+75
| | | | | | | | | | | | | | | | __builtin_constant_p used to be short-cut evaluated to false when building with -O0. This is undesirable as it means that constant folding in the front-end can give different results than folding in the back-end. It can also create conditional branches on constant conditions that don't get folded away. With the pending improvements to the llvm.is.constant handling on the LLVM side, the short-cut is no longer useful. Adjust various codegen tests to not depend on the short-cut or the backend optimisations. Differential Revision: https://reviews.llvm.org/D67638 llvm-svn: 374742
* merge-request.sh: Update 9.0 metabug for 9.0.1Simon Atanasyan2019-10-131-1/+1
| | | | llvm-svn: 374741
* [Attributor] Shortcut no-return through will-returnJohannes Doerfert2019-10-137-14/+29
| | | | | | | | No-return and will-return are exclusive, assuming the latter is more prominent we can avoid updates of the former unless will-return is not known for sure. llvm-svn: 374739
* [Attributor][FIX] NullPointerIsDefined needs the pointer AS (AANonNull)Johannes Doerfert2019-10-135-6/+28
| | | | | | Also includes a shortcut via AADereferenceable if possible. llvm-svn: 374737
* [Attributor][MemBehavior] Fallback to the function state for argumentsJohannes Doerfert2019-10-135-19/+36
| | | | | | | | | Even if an argument is captured, we cannot have an effect the function does not have. This is fine except for the special case of `inalloca` as it does not behave by the rules. TODO: Maybe the special rule for `inalloca` is wrong after all. llvm-svn: 374736
* [Attributor][FIX] Use check prefix that is actually testedJohannes Doerfert2019-10-134-24/+39
| | | | | | | | | | | | | | | | Summary: This changes "CHECK" check lines to "ATTRIBUTOR" check lines where necessary and also fixes the now exposed, mostly minor, problems. Reviewers: sstefan1, uenoku Subscribers: hiraditya, bollu, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68929 llvm-svn: 374735
* [NFC][InstCombine] Some preparatory cleanup in ↵Roman Lebedev2019-10-131-23/+21
| | | | | | dropRedundantMaskingOfLeftShiftInput() llvm-svn: 374734
* [Docs] Moves Control Flow Document to User GuidesDeForest Richards2019-10-132-10/+11
| | | | | | Moves Control Flow document from Reference docs page to User guides page. llvm-svn: 374733
* [X86] getTargetShuffleInputs - Control KnownUndef mask element resolution as ↵Simon Pilgrim2019-10-131-11/+11
| | | | | | | | well as KnownZero. We were already controlling whether the KnownZero elements were being written to the target mask, this extends it to the KnownUndef elements as well so we can prevent the target shuffle mask being manipulated at all. llvm-svn: 374732
* [X86] Enable use of avx512 saturating truncate instructions in more cases.Craig Topper2019-10-137-542/+299
| | | | | | | | | | This enables use of the saturating truncate instructions when the result type is less than 128 bits. It also enables the use of saturating truncate instructions on KNL when the input is less than 512 bits. We can do this by widening the input and then extracting the result. llvm-svn: 374731
* Add missing "REQUIRES: shell" to system-include-extractor.testNico Weber2019-10-131-0/+3
| | | | | | Part of PR43592. llvm-svn: 374730
* [ConstantFold] fix inconsistent handling of extractelement with undef index ↵Sanjay Patel2019-10-132-7/+4
| | | | | | | | | (PR42689) Any constant other than zero was already folded to undef if the index is undef. https://bugs.llvm.org/show_bug.cgi?id=42689 llvm-svn: 374729
* [InstCombine] don't assume 'inbounds' for bitcast deref or null pointer in ↵Sanjay Patel2019-10-132-4/+12
| | | | | | | | | | | | | | non-default address space Follow-up to D68244 to account for a corner case discussed in: https://bugs.llvm.org/show_bug.cgi?id=43501 Add one more restriction: if the pointer is deref-or-null and in a non-default (non-zero) address space, we can't assume inbounds. Differential Revision: https://reviews.llvm.org/D68706 llvm-svn: 374728
* Make the last to clangd unit tests pass on Windows.Nico Weber2019-10-131-2/+8
| | | | | | | | | | (Some lit tests still fail.) See FIXME in diff for details. Part of PR43592. llvm-svn: 374727
* [NFC][InstCombine] More test for "sign bit test via shifts" pattern (PR43595)Roman Lebedev2019-10-136-13/+377
| | | | | | | | | | | | | | | | While that pattern is indirectly handled via reassociateShiftAmtsOfTwoSameDirectionShifts(), that incursme one-use restriction on truncation, which is pointless since we know that we'll produce a single instruction. Additionally, *if* we are only looking for sign bit, we don't need shifts to be identical, which isn't the case in general, and is the blocker for me in bug in question: https://bugs.llvm.org/show_bug.cgi?id=43595 llvm-svn: 374726
* [X86] SimplifyMultipleUseDemandedBitsForTargetNode - use ↵Simon Pilgrim2019-10-131-12/+11
| | | | | | getTargetShuffleInputs with KnownUndef/Zero results. llvm-svn: 374725
* [X86] getTargetShuffleInputs - add KnownUndef/Zero output supportSimon Pilgrim2019-10-131-25/+25
| | | | | | Adjust SimplifyDemandedVectorEltsForTargetNode to use the known elts masks instead of recomputing it locally. llvm-svn: 374724
* [libc++][test] std::variant test cleanupCasey Carter2019-10-136-5/+7
| | | | | | | | * Add the conventional `return 0` to `main` in `variant.assign/conv.pass.cpp` and `variant.ctor/conv.pass.cpp` * Fix some MSVC signed-to-unsigned conversion warnings by replacing `int` literarls with `unsigned int` literals llvm-svn: 374723
* [libc++][test] <=> now has a feature-test macroCasey Carter2019-10-131-3/+2
| | | | | | ...which `test/support/test_macros.h` can use to detect compiler support. llvm-svn: 374722
* gn build: (manually) merge r374720Nico Weber2019-10-131-0/+1
| | | | llvm-svn: 374721
* [clang-format] Proposal for clang-format to give compiler style warningsPaul Hoad2019-10-134-61/+188
| | | | | | relanding {D68554} with fixed lit tests, checked on Windows and MacOS llvm-svn: 374720
* [X86][AVX] Add i686 avx splat testsSimon Pilgrim2019-10-131-54/+111
| | | | llvm-svn: 374719
* Make most clangd unittests pass on WindowsNico Weber2019-10-138-7/+57
| | | | | | | | | | | | | | | | | | | | The Windows triple currently turns on delayed template parsing, which confuses several unit tests that use templates. For now, just explicitly disable delayed template parsing. This isn't ideal, but: - the Windows triple will soon no longer use delayed template parsing by default - there's precedent for this in the clangd unit tests already - let's get the clangd tests pass on Windows first before making behavioral changes Part of PR43592. llvm-svn: 374718
* BlockInCriticalSectionChecker - silence static analyzer dyn_cast null ↵Simon Pilgrim2019-10-131-1/+1
| | | | | | | | dereference warning. NFCI. The static analyzer is warning about a potential null dereference, but we should be able to use cast<> directly and if not assert will fire for us. llvm-svn: 374717
* IRTranslator - silence static analyzer null dereference warnings. NFCI.Simon Pilgrim2019-10-131-3/+4
| | | | | | The CmpInst::getType() calls can be replaced by just using User::getType() that it was dyn_cast from, and we then need to assert that any default predicate cases came from the CmpInst. llvm-svn: 374716
* [clang-tidy] bugprone-not-null-terminated-result: checker adjustments 4Csaba Dabis2019-10-131-1/+1
| | | | llvm-svn: 374715
* [clang-tidy] bugprone-not-null-terminated-result: checker adjustments 3Csaba Dabis2019-10-132-0/+10
| | | | | | | On Windows the signed/unsigned int conversions of APInt seems broken, so that two of the test files marked as unsupported on Windows, as a hotfix. llvm-svn: 374713
* [clang-tidy] bugprone-not-null-terminated-result: checker adjustments 2Csaba Dabis2019-10-131-7/+8
| | | | llvm-svn: 374712
* [clang-tidy] bugprone-not-null-terminated-result: checker adjustmentsCsaba Dabis2019-10-131-6/+6
| | | | llvm-svn: 374711
* [clang-tidy] bugprone-not-null-terminated-result: Sphinx adjustments 2Csaba Dabis2019-10-131-17/+21
| | | | llvm-svn: 374710
* [clang-tidy] bugprone-not-null-terminated-result: Sphinx adjustmentsCsaba Dabis2019-10-131-15/+16
| | | | llvm-svn: 374709
* gn build: Merge r374707GN Sync Bot2019-10-131-0/+1
| | | | llvm-svn: 374708
* [clang-tidy] New checker for not null-terminated result caused by strlen(), ↵Csaba Dabis2019-10-1317-0/+2168
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | size() or equal length Summary: New checker called bugprone-not-null-terminated-result. This checker finds function calls where it is possible to cause a not null-terminated result. Usually the proper length of a string is `strlen(src) + 1` or equal length of this expression, because the null terminator needs an extra space. Without the null terminator it can result in undefined behaviour when the string is read. The following and their respective `wchar_t` based functions are checked: `memcpy`, `memcpy_s`, `memchr`, `memmove`, `memmove_s`, `strerror_s`, `strncmp`, `strxfrm` The following is a real-world example where the programmer forgot to increase the passed third argument, which is `size_t length`. That is why the length of the allocated memory is not enough to hold the null terminator. ``` static char *stringCpy(const std::string &str) { char *result = reinterpret_cast<char *>(malloc(str.size())); memcpy(result, str.data(), str.size()); return result; } ``` In addition to issuing warnings, fix-it rewrites all the necessary code. It also tries to adjust the capacity of the destination array: ``` static char *stringCpy(const std::string &str) { char *result = reinterpret_cast<char *>(malloc(str.size() + 1)); strcpy(result, str.data()); return result; } ``` Note: It cannot guarantee to rewrite every of the path-sensitive memory allocations. Reviewed By: JonasToth, aaron.ballman, whisperity, alexfh Tags: #clang-tools-extra, #clang Differential Revision: https://reviews.llvm.org/D45050 llvm-svn: 374707
* [X86] Add a one use check on the setcc to the min/max canonicalization code ↵Craig Topper2019-10-132-341/+265
| | | | | | | | | | | | | | | | | | | in combineSelect. This seems to improve std::midpoint code where we have a min and a max with the same condition. If we split the setcc we can end up with two compares if the one of the operands is a constant. Since we aggressively canonicalize compares with constants. For non-constants it can interfere with our ability to share control flow if we need to expand cmovs into control flow. I'm also not sure I understand this min/max canonicalization code. The motivating case talks about comparing with 0. But we don't check for 0 explicitly. Removes one instruction from the codegen for PR43658. llvm-svn: 374706
* [X86] Enable v4i32->v4i16 and v8i16->v8i8 saturating truncates to use pack ↵Craig Topper2019-10-133-101/+17
| | | | | | instructions with avx512. llvm-svn: 374705
* [X86] Add v2i64->v2i32/v2i16/v2i8 test cases to the trunc packus/ssat/usat ↵Craig Topper2019-10-133-0/+2721
| | | | | | tests. NFC llvm-svn: 374704
* [Attributor][FIX] Avoid splitting blocks if possibleJohannes Doerfert2019-10-134-16/+22
| | | | | | | Before, we eagerly split blocks even if it was not necessary, e.g., they had a single unreachable instruction and only a single predecessor. llvm-svn: 374703
* [Attributor][FIX] Remove leftover, now unused, variableJohannes Doerfert2019-10-131-2/+0
| | | | llvm-svn: 374702
* [Attributor] Remove unused verification flagJohannes Doerfert2019-10-131-24/+0
| | | | | | We use the verify max iteration now which is more reliable. llvm-svn: 374701
* [Attributor][NFC] Expose call site traversal without QueryingAAJohannes Doerfert2019-10-132-9/+26
| | | | llvm-svn: 374700
OpenPOWER on IntegriCloud