summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* [NFC] Modify comment to make it more preciseMax Kazantsev2018-08-141-1/+1
| | | | llvm-svn: 339644
* [NFC] Add comprehensive test of AliasSetTracker with guardsMax Kazantsev2018-08-141-0/+1550
| | | | llvm-svn: 339643
* [cmake] Add MINGW_LIBRARIES to the linker flagsMartin Storsjo2018-08-141-0/+3
| | | | | | | | | | | | | | | | | This is essential when building with -nodefaultlibs. In some CMake versions (noticed in 3.5.1), the same libraries are picked up from CMAKE_REQUIRED_LIBRARIES in some exceptional situations (if CXX probing failed, due to libc++ not being built yet, the libraries from CMAKE_REQUIRED_LIBRARIES are used for linking the target library), but not at all in other newer CMake versions (3.10). This is similar to what already is done in libcxxabi in SVN r302760 and libcxx in SVN r312498. Differential Revision: https://reviews.llvm.org/D50663 llvm-svn: 339642
* [CStringSyntaxChecker] Check strlcat sizeof checkDavid Carlier2018-08-142-4/+67
| | | | | | | | | | | | | - Assuming strlcat is used with strlcpy we check as we can if the last argument does not equal os not larger than the buffer. - Advising the proper usual pattern. Reviewers: NoQ, george.karpenkov Reviewed By: george.karpenkov Differential Revision: https://reviews.llvm.org/D49722 llvm-svn: 339641
* [ThinLTO] Fix printing of WPD remarksTeresa Johnson2018-08-142-6/+10
| | | | | | | | | | | | | | | | | Summary: When WPD is performed in a ThinLTO backend, the function may be created if it isn't already in that module. Module::getOrInsertFunction may add a bitcast, in which case the returned Constant is not a Function and doesn't have a name. Invoke stripPointerCasts() on the returned value where we access its name. Reviewers: pcc Subscribers: mehdi_amini, inglorion, eraman, steven_wu, dexonsmith, llvm-commits Differential Revision: https://reviews.llvm.org/D49959 llvm-svn: 339640
* [CMake] Split -gx strip flag into -g -xPetr Hosek2018-08-141-1/+1
| | | | | | | | | llvm-strip doesn't handle -gx spelling, so we need to split these as two separate flags. Differential Revision: https://reviews.llvm.org/D50684 llvm-svn: 339639
* Revert r339623 "Model type attributes as regular Attrs."Reid Kleckner2018-08-1425-581/+736
| | | | | | | | This breaks compiling atlwin.h in Chromium. I'm sure the code is invalid in some way, but we put a lot of work into accepting it, and I'm sure rejecting it was not an intended consequence of this refactoring. :) llvm-svn: 339638
* [ThinLTO] Handle optional args in assembly format for ConstVCallsTeresa Johnson2018-08-144-12/+20
| | | | | | | | | | | | | | | | Summary: The AsmWriter was only writing the Args for a ConstVCall if it was non-empty, however, the LLParser was always expecting it. To aid in making it optional, surround the ConstVCall VFuncId and Args in parentheses when writing, then make the Args optional when reading. Reviewers: pcc Subscribers: mehdi_amini, inglorion, eraman, steven_wu, dexonsmith, llvm-commits Differential Revision: https://reviews.llvm.org/D49960 llvm-svn: 339637
* [BasicAA] Don't assume tail calls with byval don't alias allocasReid Kleckner2018-08-143-6/+45
| | | | | | | | | | | | | | | | | | | | Summary: Calls marked 'tail' cannot read or write allocas from the current frame because the current frame might be destroyed by the time they run. However, a tail call may use an alloca with byval. Calling with byval copies the contents of the alloca into argument registers or stack slots, so there is no lifetime issue. Tail calls never modify allocas, so we can return just ModRefInfo::Ref. Fixes PR38466, a longstanding bug. Reviewers: hfinkel, nlewycky, gbiv, george.burgess.iv Subscribers: hiraditya, llvm-commits Differential Revision: https://reviews.llvm.org/D50679 llvm-svn: 339636
* Revert r339490 to match revert of llvm r339474 in r339630.Richard Smith2018-08-142-4/+4
| | | | llvm-svn: 339635
* Move test inputs into Inputs directory.Richard Smith2018-08-1461-28/+28
| | | | | | | We don't need a new ExpectedOutputs/ convention. Expected outputs are just another form of test input. llvm-svn: 339634
* [CodeGen] Before returning a copy/dispose helper function, bitcast it toAkira Hatanaka2018-08-143-16/+17
| | | | | | | | a void pointer type. This fixes a bug introduced in r339438. llvm-svn: 339633
* Fix check strings in test/CodeGenObjC/arc-blocks.m in preperation forAkira Hatanaka2018-08-141-14/+14
| | | | | | | | fixing a bug introduced in r339438. Check the descriptor global variables in the IR at both -O0 and -O2. llvm-svn: 339632
* [analyzer] Fix UninitializedObjectChecker to not crash on uninitialized "id" ↵George Karpenkov2018-08-133-2/+12
| | | | | | | | fields Differential Revision: https://reviews.llvm.org/D50673 llvm-svn: 339631
* Revert "[WebAssembly] Added default stack-only instruction mode for MC."Wouter van Oortmerssen2018-08-1392-852/+426
| | | | | | This reverts commit 917a99b71ce21c975be7bfbf66f4040f965d9f3c. llvm-svn: 339630
* [analyzer] [NFC] Introduce separate targets for testing the analyzer: ↵George Karpenkov2018-08-134-2/+34
| | | | | | | | | | | | | | | | | | | | | | | | check-clang-analyzer and check-clang-analyzer-z3 Current testing setup for analyzer tests with Z3 is rather inconvenient: There's no way to run the analyzer tests separately (I use LIT_FILTER=Analysis ninja check-clang, but a direct target is nicer). When Clang is built with Z3 support, there's no way to *not* run tests with Z3 solver, and this is often desired, as tests with Z3 solver take a very long time. This patch introduces two extra targets: - check-clang-analyzer - check-clang-analyzer-z3 which solve those problems. Differential Revision: https://reviews.llvm.org/D50594 llvm-svn: 339629
* [Support] NFC: Allow modifying access/modification times independently in ↵Jordan Rupprecht2018-08-135-10/+25
| | | | | | | | | | | | | | | | | sys::fs::setLastModificationAndAccessTime. Summary: Add an overload to sys::fs::setLastModificationAndAccessTime that allows setting last access and modification times separately. This will allow tools to use this API when they want to preserve both the access and modification times from an input file, which may be different. Also note that both the POSIX (futimens/futimes) and Windows (SetFileTime) APIs take the two timestamps in the order of (1) access (2) modification time, so this renames the method to "setLastAccessAndModificationTime" to make it clear which timestamp is which. For existing callers, the 1-arg overload just sets both timestamps to the same thing. Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D50521 llvm-svn: 339628
* [AST] Minor formatting cleanup [NFC]Philip Reames2018-08-131-8/+4
| | | | llvm-svn: 339627
* Support shared objects for split stack.Sterling Augustine2018-08-132-9/+44
| | | | llvm-svn: 339626
* [AST] Cleanup code by using MemoryLocation utility [NFC]Philip Reames2018-08-132-43/+15
| | | | | | Differential Revision: https://reviews.llvm.org/D50588 llvm-svn: 339625
* Fix Clang warnings and bad #include filenames in r339595 and r339599.Richard Smith2018-08-133-5/+7
| | | | llvm-svn: 339624
* Model type attributes as regular Attrs.Richard Smith2018-08-1325-736/+581
| | | | | | | | | | Specifically, AttributedType now tracks a regular attr::Kind rather than having its own parallel Kind enumeration, and AttributedTypeLoc now holds an Attr* instead of holding an ad-hoc collection of Attr fields. Differential Revision: https://reviews.llvm.org/D50526 llvm-svn: 339623
* [X86] Don't ignore 0x66 prefix on relative jumps in 64-bit mode. Fix opcode ↵Craig Topper2018-08-133-77/+62
| | | | | | | | | | | | | | | | selection of relative jumps in 16-bit mode. Treat jno/jo like other jcc instructions. The behavior in 64-bit mode is different between Intel and AMD CPUs. Intel ignores the 0x66 prefix. AMD does not. objump doesn't ignore the 0x66 prefix. Since LLVM aims to match objdump behavior, we should do the same. While I was trying to fix this I had change brtarget16/32 to use ENCODING_IW/ID instead of ENCODING_Iv to get the 0x66+REX.W case to act sort of sanely. It's still wrong, but that's a problem for another day. The change in encoding exposed the fact that 16-bit mode disassembly of relative jumps was creating JMP_4 with a 2 byte immediate. It should have been JMP_2. From just printing you can't tell the difference, but if you dumped the encoding it wouldn't have matched what we started with. While fixing that, it exposed that jo/jno opcodes were missing from the switch that this patch deleted and there were no test cases for them. Fixes PR38537. llvm-svn: 339622
* [InstCombine] Re-land: Optimize redundant 'signed truncation check pattern'.Roman Lebedev2018-08-132-57/+152
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This comes with `Implicit Conversion Sanitizer - integer sign change` (D50250): ``` signed char test(unsigned int x) { return x; } ``` `clang++ -fsanitize=implicit-conversion -S -emit-llvm -o - /tmp/test.cpp -O3` * Old: {F6904292} * With this patch: {F6904294} General pattern: X & Y Where `Y` is checking that all the high bits (covered by a mask `4294967168`) are uniform, i.e. `%arg & 4294967168` can be either `4294967168` or `0` Pattern can be one of: %t = add i32 %arg, 128 %r = icmp ult i32 %t, 256 Or %t0 = shl i32 %arg, 24 %t1 = ashr i32 %t0, 24 %r = icmp eq i32 %t1, %arg Or %t0 = trunc i32 %arg to i8 %t1 = sext i8 %t0 to i32 %r = icmp eq i32 %t1, %arg This pattern is a signed truncation check. And `X` is checking that some bit in that same mask is zero. I.e. can be one of: %r = icmp sgt i32 %arg, -1 Or %t = and i32 %arg, 2147483648 %r = icmp eq i32 %t, 0 Since we are checking that all the bits in that mask are the same, and a particular bit is zero, what we are really checking is that all the masked bits are zero. So this should be transformed to: %r = icmp ult i32 %arg, 128 The transform itself ended up being rather horrible, even though i omitted some cases. Surely there is some infrastructure that can help clean this up that i missed? https://rise4fun.com/Alive/3Ou The initial commit (rL339610) was reverted, since the first assert was being triggered. The @positive_with_extra_and test now has coverage for that case. Reviewers: spatel, craig.topper Reviewed By: spatel Subscribers: RKSimon, erichkeane, vsk, llvm-commits Differential Revision: https://reviews.llvm.org/D50465 llvm-svn: 339621
* Revert "[clang-doc] Updating BitcodeReader to use llvm::Error"Julie Hockett2018-08-132-257/+208
| | | | | | This reverts commit r339617 for breaking bots. llvm-svn: 339620
* [NFC][InstCombine] Add a test for D50465 that used to assertRoman Lebedev2018-08-131-0/+19
| | | | | | | This is valid to fold, too. https://rise4fun.com/Alive/0lz llvm-svn: 339619
* [SimplifyLibCalls] don't drop fast-math-flags on trig reflection folds ↵Sanjay Patel2018-08-132-2/+18
| | | | | | | | | | (retry r339608) Even though this code is below a function called optimizeFloatingPointLibCall(), we apparently can't guarantee that we're dealing with FPMathOperators, so bail out immediately if that's not true. llvm-svn: 339618
* [clang-doc] Updating BitcodeReader to use llvm::ErrorJulie Hockett2018-08-132-208/+257
| | | | llvm-svn: 339617
* [llvm-objcopy] NFC: Fix minor formatting issuesJordan Rupprecht2018-08-132-32/+32
| | | | llvm-svn: 339616
* Update TestTargetXMLArch.py test for llvm triple change with unspecifiedJason Molenda2018-08-131-1/+1
| | | | | | components in r339294. llvm-svn: 339615
* [hwasan] Provide __sanitizer_* aliases to allocator functions.Evgeniy Stepanov2018-08-137-8/+70
| | | | | | | | | | | | | | | | Summary: Export __sanitizer_malloc, etc as aliases to malloc, etc. This way users can wrap sanitizer malloc, even in fully static binaries. Both jemalloc and tcmalloc provide similar aliases (je_* and tc_*). Reviewers: vitalybuka, kcc Subscribers: llvm-commits, kubamracek Differential Revision: https://reviews.llvm.org/D50570 llvm-svn: 339614
* Convert if/else to a switch. NFC.Akira Hatanaka2018-08-131-42/+50
| | | | llvm-svn: 339613
* Revert "[InstCombine] Optimize redundant 'signed truncation check pattern'."Roman Lebedev2018-08-132-150/+51
| | | | | | | | | At least one buildbot was able to actually trigger that assert on the top of the function. Will investigate. This reverts commit r339610. llvm-svn: 339612
* Added test for Core/Range class.Raphael Isemann2018-08-132-0/+331
| | | | | | | | | | | | | | | | | | | | Summary: We can optimize and refactor some of the classes in RangeMap.h, but first we should have some tests for all the data structures in there. This adds a first batch of tests for the Range class itself. There are some unexpected results happening when mixing invalid and valid ranges, so I added some FIXME's for that in the tests. Reviewers: vsk Reviewed By: vsk Subscribers: mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D50620 llvm-svn: 339611
* [InstCombine] Optimize redundant 'signed truncation check pattern'.Roman Lebedev2018-08-132-51/+150
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This comes with `Implicit Conversion Sanitizer - integer sign change` (D50250): ``` signed char test(unsigned int x) { return x; } ``` `clang++ -fsanitize=implicit-conversion -S -emit-llvm -o - /tmp/test.cpp -O3` * Old: {F6904292} * With this patch: {F6904294} General pattern: X & Y Where `Y` is checking that all the high bits (covered by a mask `4294967168`) are uniform, i.e. `%arg & 4294967168` can be either `4294967168` or `0` Pattern can be one of: %t = add i32 %arg, 128 %r = icmp ult i32 %t, 256 Or %t0 = shl i32 %arg, 24 %t1 = ashr i32 %t0, 24 %r = icmp eq i32 %t1, %arg Or %t0 = trunc i32 %arg to i8 %t1 = sext i8 %t0 to i32 %r = icmp eq i32 %t1, %arg This pattern is a signed truncation check. And `X` is checking that some bit in that same mask is zero. I.e. can be one of: %r = icmp sgt i32 %arg, -1 Or %t = and i32 %arg, 2147483648 %r = icmp eq i32 %t, 0 Since we are checking that all the bits in that mask are the same, and a particular bit is zero, what we are really checking is that all the masked bits are zero. So this should be transformed to: %r = icmp ult i32 %arg, 128 https://rise4fun.com/Alive/3Ou Reviewers: spatel, craig.topper Reviewed By: spatel Subscribers: RKSimon, erichkeane, vsk, llvm-commits Differential Revision: https://reviews.llvm.org/D50465 llvm-svn: 339610
* revert r339608 - [SimplifyLibCalls] don't drop fast-math-flags on trig ↵Sanjay Patel2018-08-132-15/+2
| | | | | | | | | reflection folds Can't set the builder flags without knowing this is an FPMathOperator. I'll add a test for that and try again. llvm-svn: 339609
* [SimplifyLibCalls] don't drop fast-math-flags on trig reflection foldsSanjay Patel2018-08-132-2/+15
| | | | llvm-svn: 339608
* [hwasan] Handle missing /proc/self/maps.Evgeniy Stepanov2018-08-131-7/+20
| | | | | | | | | | | | | | Summary: Don't crash when /proc/self/maps is inaccessible from main thread. It's not a big deal, really. Reviewers: vitalybuka, kcc Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D50574 llvm-svn: 339607
* [hwasan] Allow optional early shadow setup.Evgeniy Stepanov2018-08-135-13/+42
| | | | | | | | | | | | | | | | Summary: Provide __hwasan_shadow_init that can be used to initialize shadow w/o touching libc. It can be used to bootstrap an unusual case of fully-static executable with hwasan-instrumented libc, which needs to run hwasan code before it is ready to serve user calls like madvise(). Reviewers: vitalybuka, kcc Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D50581 llvm-svn: 339606
* NFC: Add a test to LV showing that reduction is not possible when reduction ↵Anna Thomas2018-08-131-0/+39
| | | | | | | | | | | | var is reset in the loop Added a test case to reduction showing where it's illegal to identify vectorize a loop. Resetting the reduction var during loop iterations disallows us from widening the dependency cycle to VF, thereby making it illegal to vectorize the loop. llvm-svn: 339605
* [SimplifyLibCalls] add reflection fold for -sin(-x) (PR38458)Sanjay Patel2018-08-133-26/+35
| | | | | | | | | | This is a very partial fix for the reported problem. I suspect we do not get this fold in most motivating cases because most of the time, the libcall would have been replaced by an intrinsic, and that optimization is handled elsewhere...but maybe it should be handled here? llvm-svn: 339604
* [OPENMP] Fix emission of the loop doacross constructs.Alexey Bataev2018-08-1311-218/+571
| | | | | | | The number of loops associated with the OpenMP loop constructs should not be considered as the number loops to collapse. llvm-svn: 339603
* [InstCombine][NFC] Tests for 'signed truncation check' optimizationRoman Lebedev2018-08-131-0/+634
| | | | | | | | See D50465 for the actual opt itself. Differential Revision: https://reviews.llvm.org/D50464 llvm-svn: 339602
* [analyzer][UninitializedObjectChecker] Refactoring p5.: Handle pedantic mode ↵Kristof Umann2018-08-132-14/+19
| | | | | | | | in the checker class only Differential Revision: https://reviews.llvm.org/D50508 llvm-svn: 339601
* [CodeGen] Fix assert in SelectionDAG::computeKnownBitsScott Linder2018-08-132-2/+32
| | | | | | | | | | Fix SelectionDAG::computeKnownBits asserting when handling EXTRACT_SUBVECTOR when zero extending the demanded elements mask if it is already as long as the source vector. Differential Revision: https://reviews.llvm.org/D49574 llvm-svn: 339600
* [analyzer][UninitializedObjectChecker] Refactoring p4.: Wrap FieldRegions ↵Kristof Umann2018-08-135-118/+206
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and reduce weight on FieldChainInfo Before this patch, FieldChainInfo used a spaghetti: it took care of way too many cases, even though it was always meant as a lightweight wrapper around ImmutableList<const FieldRegion *>. This problem is solved by introducing a lightweight polymorphic wrapper around const FieldRegion *, FieldNode. It is an interface that abstracts away special cases like pointers/references, objects that need to be casted to another type for a proper note messages. Changes to FieldChainInfo: * Now wraps ImmutableList<const FieldNode &>. * Any pointer/reference related fields and methods were removed * Got a new add method. This replaces it's former constructors as a way to create a new FieldChainInfo objects with a new element. Changes to FindUninitializedField: * In order not to deal with dynamic memory management, when an uninitialized field is found, the note message for it is constructed and is stored instead of a FieldChainInfo object. (see doc around addFieldToUninits). Some of the test files are changed too, from now on uninitialized pointees of references always print "uninitialized pointee" instead of "uninitialized field" (which should've really been like this from the beginning). I also updated every comment according to these changes. Differential Revision: https://reviews.llvm.org/D50506 llvm-svn: 339599
* [InstCombine] add more tests for trig reflections; NFC (PR38458)Sanjay Patel2018-08-131-8/+92
| | | | llvm-svn: 339598
* Enforce instantiation of template multiversion functionsErich Keane2018-08-134-8/+26
| | | | | | | | | Multiversioned member functions inside of a template type were not properly being emitted. The solution to this is to simply ensure that their bodies are correctly evaluated/assigned during template instantiation. llvm-svn: 339597
* [analyzer][UninitializedObjectChecker] Refactoring p3.: printTail moved out ↵Kristof Umann2018-08-133-16/+17
| | | | | | | | | | from FieldChainInfo This is a standalone part of the effort to reduce FieldChainInfos inteerface. Differential Revision: https://reviews.llvm.org/D50505 llvm-svn: 339596
* [analyzer][UninitializedObjectChecker] Refactoring p2.: Moving pointer ↵Kristof Umann2018-08-134-297/+376
| | | | | | | | | | | | | | | | | | | | chasing to a separate file In this patch, the following classes and functions have been moved to a header file: FieldChainInfo FindUninitializedFields isPrimitiveType This also meant that they moved from anonymous namespace to clang::ento. Code related to pointer chasing now relies in its own file. There's absolutely no functional change in this patch -- its literally just copy pasting. Differential Revision: https://reviews.llvm.org/D50504 llvm-svn: 339595
OpenPOWER on IntegriCloud