- Oct 14, 2019
-
-
Craig Topper authored
llvm-svn: 374748
-
Nico Weber authored
See commit message of r374746 for details. Hopefully final bit of PR43592. llvm-svn: 374747
-
Nico Weber authored
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
-
Nico Weber authored
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
-
Florian Hahn authored
llvm-svn: 374744
-
Joerg Sonnenberger authored
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
-
Joerg Sonnenberger authored
__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
-
Simon Atanasyan authored
llvm-svn: 374741
-
Johannes Doerfert authored
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
-
Johannes Doerfert authored
Also includes a shortcut via AADereferenceable if possible. llvm-svn: 374737
-
Johannes Doerfert authored
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
-
Johannes Doerfert authored
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
-
Roman Lebedev authored
llvm-svn: 374734
-
DeForest Richards authored
Moves Control Flow document from Reference docs page to User guides page. llvm-svn: 374733
-
Simon Pilgrim authored
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
-
Craig Topper authored
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
-
Nico Weber authored
Part of PR43592. llvm-svn: 374730
-
Sanjay Patel authored
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
-
Sanjay Patel authored
[InstCombine] don't assume 'inbounds' for bitcast deref or null pointer in 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
-
Nico Weber authored
(Some lit tests still fail.) See FIXME in diff for details. Part of PR43592. llvm-svn: 374727
-
Roman Lebedev authored
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
-
Simon Pilgrim authored
[X86] SimplifyMultipleUseDemandedBitsForTargetNode - use getTargetShuffleInputs with KnownUndef/Zero results. llvm-svn: 374725
-
Simon Pilgrim authored
Adjust SimplifyDemandedVectorEltsForTargetNode to use the known elts masks instead of recomputing it locally. llvm-svn: 374724
-
Casey Carter authored
* 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
-
Casey Carter authored
...which `test/support/test_macros.h` can use to detect compiler support. llvm-svn: 374722
-
- Oct 13, 2019
-
-
Nico Weber authored
llvm-svn: 374721
-
Paul Hoad authored
relanding {D68554} with fixed lit tests, checked on Windows and MacOS llvm-svn: 374720 -
Simon Pilgrim authored
llvm-svn: 374719
-
Nico Weber authored
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
-
Simon Pilgrim authored
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
-
Simon Pilgrim authored
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
-
Csaba Dabis authored
llvm-svn: 374715
-
Csaba Dabis authored
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
-
Csaba Dabis authored
llvm-svn: 374712
-
Csaba Dabis authored
llvm-svn: 374711
-
Csaba Dabis authored
llvm-svn: 374710
-
Csaba Dabis authored
llvm-svn: 374709
-
GN Sync Bot authored
llvm-svn: 374708
-
Csaba Dabis authored
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 -
Craig Topper authored
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
-