summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [analyzer] MoveChecker: Enable by default as cplusplus.Move.Artem Dergachev2018-12-173-14/+17
| | | | | | | | | | This checker warns you when you re-use an object after moving it. Mostly developed by Peter Szecsi! Differential Revision: https://reviews.llvm.org/D38675 llvm-svn: 349328
* [analyzer] MoveChecker: Add an option to suppress warnings on locals.Artem Dergachev2018-12-172-117/+384
| | | | | | | | | | | | | | | | | Re-using a moved-from local variable is most likely a bug because there's rarely a good motivation for not introducing a separate variable instead. We plan to keep emitting such warnings by default. Introduce a flag that allows disabling warnings on local variables that are not of a known move-unsafe type. If it doesn't work out as we expected, we'll just flip the flag. We still warn on move-unsafe objects and unsafe operations on known move-safe objects. Differential Revision: https://reviews.llvm.org/D55730 llvm-svn: 349327
* Speculatively re-apply "[analyzer] MoveChecker: Add checks for dereferencing..."Artem Dergachev2018-12-172-56/+178
| | | | | | | | | | | | This re-applies commit r349226 that was reverted in r349233 due to failures on clang-x64-windows-msvc. Specify enum type as unsigned for use in bit field. Otherwise overflows may cause UB. Differential Revision: https://reviews.llvm.org/D55388 llvm-svn: 349326
* [Power9][NFC]Make pre-inc-disable case more robustKewen Lin2018-12-171-28/+28
| | | | | | | With some patch adopted for Power9 vabsd* insns, some CHECKs can't get the expected results. But it's false alarm, we should update the case more robust. llvm-svn: 349325
* [gn build] Add build files for opt and its dependency Transforms/CouroutinesNico Weber2018-12-174-1/+61
| | | | | | | | Needed for check-lld. Differential Revision: https://reviews.llvm.org/D55750 llvm-svn: 349324
* [EarlyCSE] If DI can't be salvaged, mark it as unavailable.Davide Italiano2018-12-172-1/+71
| | | | | | Fixes PR39874. llvm-svn: 349323
* [InstCombine] Add cttz/ctlz + select non-bitwidth tests; NFCNikita Popov2018-12-161-0/+56
| | | | llvm-svn: 349322
* [InstCombine] Regenerate test checks; NFCNikita Popov2018-12-161-147/+150
| | | | | | | Also drop unnecessary entry blocks and avoid use of anonymous variables. llvm-svn: 349321
* [analyzer] Fix some expressions staying live too long. Add a debug checker.Artem Dergachev2018-12-167-3/+286
| | | | | | | | | | | | | | | | | | | | | StaticAnalyzer uses the CFG-based RelaxedLiveVariables analysis in order to, in particular, figure out values of which expressions are still needed. When the expression becomes "dead", it is garbage-collected during the dead binding scan. Expressions that constitute branches/bodies of control flow statements, eg. `E1' in `if (C1) E1;' but not `E2' in `if (C2) { E2; }', were kept alive for too long. This caused false positives in MoveChecker because it relies on cleaning up loop-local variables when they go out of scope, but some of those live-for-too-long expressions were keeping a reference to those variables. Fix liveness analysis to correctly mark these expressions as dead. Add a debug checker, debug.DumpLiveStmts, in order to test expressions liveness. Differential Revision: https://reviews.llvm.org/D55566 llvm-svn: 349320
* [X86] Pull out constant splat rotation detection.Simon Pilgrim2018-12-161-21/+28
| | | | | | We had 3 different approaches - consistently use getTargetConstantBitsFromNode and allow undef elts. llvm-svn: 349319
* [InstCombine] Make cttz/ctlz knownbits tests more robust; NFCNikita Popov2018-12-161-20/+12
| | | | | | | Tests checking for the addition of !range metadata should be preserved if cttz/ctlz + icmp is optimized. llvm-svn: 349318
* Regenerate test (merges X86+X64 cases). NFCI. Simon Pilgrim2018-12-161-594/+265
| | | | llvm-svn: 349317
* Add a description of the similar packets defined in theJason Molenda2018-12-161-3/+18
| | | | | | | | | | | gdb-remote serial protocol documentation, call out the incompatability of lldb's vFile:open: packet as it stands today. Need to think about whether to change lldb's enum values (breaking any existing lldb-server's out there) or create a different packet and abandon vFile:open: at least for a while. llvm-svn: 349316
* [X86] Remove truncation handling from EmitTest. Replace it with a DAG combine.Craig Topper2018-12-163-55/+111
| | | | | | | | | | I'd like to try to move a lot of the flag matching out of EmitTest and push it to isel or isel preprocessing. This is a step towards that. The test-shrink-bug.ll changie is an improvement because we are no longer interfering with test shrink handling in isel. The pr34137.ll change is a regression, but the IR came from -O0 and was not reduced by InstCombine. So it contains a lot of redundancies like duplicate loads that made it combine poorly. llvm-svn: 349315
* [X86] Autogenerate complete checks. NFCCraig Topper2018-12-161-7/+36
| | | | llvm-svn: 349314
* Clarify a few minor details.Jason Molenda2018-12-161-7/+8
| | | | llvm-svn: 349313
* Revert "[InstCombine] Regenerate test checks; NFC"Nikita Popov2018-12-161-166/+117
| | | | | | | | This reverts commit r349311. Didn't check this carefully enough... llvm-svn: 349312
* [InstCombine] Regenerate test checks; NFCNikita Popov2018-12-161-117/+166
| | | | llvm-svn: 349311
* [InstCombined] Add more tests for cttz/ctlz + icmp; NFCNikita Popov2018-12-161-11/+144
| | | | | | Test cases other than icmp with the bitwidth. llvm-svn: 349310
* [InstCombine] Add additional saturating add/sub + icmp tests; NFCNikita Popov2018-12-161-12/+133
| | | | | | | These test comparisons with saturating add/sub in non-canonical form. llvm-svn: 349309
* Thread safety analysis: Avoid intermediate copies [NFC]Aaron Puchert2018-12-161-21/+31
| | | | | | | The main reason is to reduce the number of constructor arguments though, especially since many of them had the same type. llvm-svn: 349308
* [InstCombine] regenerate test checks; NFCSanjay Patel2018-12-162-448/+439
| | | | llvm-svn: 349307
* [InstCombine] add tests for vector widening transforms (PR40032); NFCSanjay Patel2018-12-161-0/+32
| | | | llvm-svn: 349306
* [test] [support] Use socket()+bind() to create unix sockets portablyMichal Gorny2018-12-161-2/+8
| | | | | | | | | | | Replace the mknod() call with socket() + bind() for creating unix sockets. The mknod() method is not portable and does not work on NetBSD while binding the socket should work on all systems supporting unix sockets. Differential Revision: https://reviews.llvm.org/D55576 llvm-svn: 349305
* [x86] increment/decrement constant vector with min/max in vsetcc lowering ↵Sanjay Patel2018-12-164-58/+72
| | | | | | | | | | | | | | | | | | | | (PR39859) This is part of fixing PR39859: https://bugs.llvm.org/show_bug.cgi?id=39859 We have a crippled vector ISA, so we have to invert a typical fold and create min/max here. As discussed in the bug report, we can probably do better by using saturating subtract when it's available, but we should have this improvement for the min/max patterns regardless. Alive proofs: https://rise4fun.com/Alive/zsf https://rise4fun.com/Alive/Qrl Differential Revision: https://reviews.llvm.org/D55515 llvm-svn: 349304
* [DAGCombiner] allow hoisting vector bitwise logic ahead of truncatesSanjay Patel2018-12-1612-211/+147
| | | | | | | | | | | | | | | | | | The transform performs a bitwise logic op in a wider type followed by truncate when both inputs are truncated from the same source type: logic_op (truncate x), (truncate y) --> truncate (logic_op x, y) There are a bunch of other checks that should prevent doing this when it might be harmful. We already do this transform for scalars in this spot. The vector limitation was shared with a check for the case when the operands are extended. I'm not sure if that limit is needed either, but that would be a separate patch. Differential Revision: https://reviews.llvm.org/D55448 llvm-svn: 349303
* Update the list of platforms & archsSylvestre Ledru2018-12-161-2/+2
| | | | llvm-svn: 349302
* Use backquotes to avoid a sphinx unexpected error:Sylvestre Ledru2018-12-161-1/+1
| | | | | | Unknown target name: "bootstrap". llvm-svn: 349301
* Thread safety analysis: Allow scoped releasing of capabilitiesAaron Puchert2018-12-162-39/+177
| | | | | | | | | | | | | | | | | | | | | | Summary: The pattern is problematic with C++ exceptions, and not as widespread as scoped locks, but it's still used by some, for example Chromium. We are a bit stricter here at join points, patterns that are allowed for scoped locks aren't allowed here. That could still be changed in the future, but I'd argue we should only relax this if people ask for it. Fixes PR36162. Reviewers: aaron.ballman, delesley, pwnall Reviewed By: delesley, pwnall Subscribers: pwnall, cfe-commits Differential Revision: https://reviews.llvm.org/D52578 llvm-svn: 349300
* Document the usage of BOOTSTRAP_XXX with stage2 buildsSylvestre Ledru2018-12-161-0/+9
| | | | llvm-svn: 349299
* [SelectionDAG] Add FSHL/FSHR support to computeKnownBitsSimon Pilgrim2018-12-163-16/+41
| | | | | | Also exposes an issue in DAGCombiner::visitFunnelShift where we were assuming the shift amount had the result type (after legalization it'll have the targets shift amount type). llvm-svn: 349298
* [X86] Add computeKnownBits tests for funnel shift intrinsicsSimon Pilgrim2018-12-161-0/+43
| | | | llvm-svn: 349297
* Improve the comment in previousKamil Rytarowski2018-12-161-2/+2
| | | | llvm-svn: 349296
* Expand TSan sysroot workaround to NetBSDKamil Rytarowski2018-12-161-5/+6
| | | | | | https://bugs.llvm.org/show_bug.cgi?id=26651 llvm-svn: 349295
* [test] [ctime] Ignore -Wformat-zero-length warningsMichal Gorny2018-12-161-0/+4
| | | | | | | | | | | | Explicitly disable the -Wformat-zero-length diagnostic when running ctime tests, since one of the test cases passes zero-length format string to strftime(). When strftime() is appropriately decorated with __attribute__(format, ...), this caused the test to fail because of this warning (e.g. on NetBSD). Differential Revision: https://reviews.llvm.org/D55661 llvm-svn: 349294
* [regex] Use distinct __regex_word on NetBSDMichal Gorny2018-12-161-0/+4
| | | | | | | | | | NetBSD defines character classes up to 0x2000. Use 0x8000 as a safe __regex_word that hopefully will not collide with other values in the foreseeable future. Differential Revision: https://reviews.llvm.org/D55657 llvm-svn: 349293
* [gn build] Merge r349167Nico Weber2018-12-161-0/+1
| | | | llvm-svn: 349291
* [gn build] Add build files for obj2yaml, yaml2obj, and lib/ObjectYAMLNico Weber2018-12-164-0/+58
| | | | | | | | The two executables are needed by check-lld. Differential Revision: https://reviews.llvm.org/D55687 llvm-svn: 349290
* [gn build] Add build files for llvm-as, llvm-dis, llvm-dwarfdump, llvm-mc, ↵Nico Weber2018-12-168-0/+79
| | | | | | | | | | FileCheck, count, not These executables are needed by check-lld. Differential Revision: https://reviews.llvm.org/D55688 llvm-svn: 349289
* Fix a lit test failure after MallocChecker changesKristof Umann2018-12-161-1/+1
| | | | llvm-svn: 349288
* [X86] Autogenerate complete checks. NFCCraig Topper2018-12-151-29/+39
| | | | llvm-svn: 349287
* [X86] Begin cleaning up combineOr -> SHLD/SHRD. NFCI.Simon Pilgrim2018-12-151-5/+5
| | | | | | In preparation for converting to funnel shifts. llvm-svn: 349286
* [X86] Lower to SHLD/SHRD on slow machines for optsizeSimon Pilgrim2018-12-153-81/+31
| | | | | | Use consistent rules for when to lower to SHLD/SHRD for slow machines - fixes a weird issue where funnel shift gets expanded but then X86ISelLowering's combineOr sees the optsize and combines to SHLD/SHRD, but now with the modulo amount guard...... llvm-svn: 349285
* [X86] Add optsize SHLD/SHRD testsSimon Pilgrim2018-12-152-41/+131
| | | | llvm-svn: 349284
* [analyzer][MallocChecker] Improve warning messages on double-delete errorsKristof Umann2018-12-156-19/+27
| | | | | | Differential Revision: https://reviews.llvm.org/D54834 llvm-svn: 349283
* Update the vFile:open: description to note that the flagsJason Molenda2018-12-152-1/+5
| | | | | | | | | | in the packet are lldb enum values, not the open(2) oflags -- forgot about that wrinkle. Also added a comment to File.h noting that the existing values cannot be modified or we'll have a compatibilty break with any alternative platform implementations, or older versions of lldb-server. llvm-svn: 349282
* [analyzer][MallocChecker][NFC] Document and reorganize some functionsKristof Umann2018-12-153-424/+725
| | | | | | | | | | | | | | | | | | | | | | | | | | | This patch merely reorganizes some things, and features no functional change. In detail: * Provided documentation, or moved existing documentation in more obvious places. * Added dividers. (the //===----------===// thing). * Moved getAllocationFamily, printAllocDeallocName, printExpectedAllocName and printExpectedDeallocName in the global namespace on top of the file where AllocationFamily is declared, as they are very strongly related. * Moved isReleased and MallocUpdateRefState near RefState's definition for the same reason. * Realloc modeling was very poor in terms of variable and structure naming, as well as documentation, so I renamed some of them and added much needed docs. * Moved function IdentifierInfos to a separate struct, and moved isMemFunction, isCMemFunction adn isStandardNewDelete inside it. This makes the patch affect quite a lot of lines, should I extract it to a separate one? * Moved MallocBugVisitor out of MallocChecker. * Preferred switches to long else-if branches in some places. * Neatly organized some RUN: lines. Differential Revision: https://reviews.llvm.org/D54823 llvm-svn: 349281
* [analyzer][NFC] Merge ClangCheckerRegistry to CheckerRegistryKristof Umann2018-12-155-109/+86
| | | | | | | | | | | Now that CheckerRegistry lies in Frontend, we can finally eliminate ClangCheckerRegistry. Fortunately, this also provides us with a DiagnosticsEngine, so I went ahead and removed some parameters from it's methods. Differential Revision: https://reviews.llvm.org/D54437 llvm-svn: 349280
* Link examples/clang-interpreter against clangSerializationKristof Umann2018-12-151-0/+1
| | | | llvm-svn: 349279
* Fix a compilation error in examples/Kristof Umann2018-12-151-1/+1
| | | | llvm-svn: 349278
OpenPOWER on IntegriCloud