summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [analyzer] pr38668: Do not attempt to cast loaded values of non-scalar types.Artem Dergachev2018-12-193-10/+34
| | | | | | | | | | | | | | | | | | | | | | | | It is expected to have the same object (memory region) treated as if it has different types in different program points. The correct behavior for RegionStore when an object is stored as an object of type T1 but loaded as an object of type T2 is to store the object as if it has type T1 but cast it to T2 during load. Note that the cast here is some sort of a "reinterpret_cast" (even in C). For instance, if you store a float and load an integer, you won't have your float rounded to an integer; instead, you will have garbage. Admit that we cannot perform the cast as long as types we're dealing with are non-trivial (neither integers, nor pointers). Of course, if the cast is not necessary (eg, T1 == T2), we can still load the value just fine. Differential Revision: https://reviews.llvm.org/D55875 rdar://problem/45062567 llvm-svn: 349701
* Simplify code for readability. (NFC)Adrian Prantl2018-12-191-6/+3
| | | | llvm-svn: 349700
* [sanitizer] Support running without fd 0,1,2.Evgeniy Stepanov2018-12-198-10/+76
| | | | | | | | | | | | | | | | | Summary: Support running with no open file descriptors (as may happen to "init" process on linux). * Remove a check that writing to stderr succeeds. * When opening a file (ex. for log_path option), dup the new fd out of [0, 2] range to avoid confusing the program. Reviewers: pcc, vitalybuka Subscribers: kubamracek, llvm-commits Differential Revision: https://reviews.llvm.org/D55801 llvm-svn: 349699
* [analyzer] GenericTaint: Fix formatting to prepare for incoming improvements.Artem Dergachev2018-12-191-107/+107
| | | | | | | | Patch by Gábor Borsik! Differential Revision: https://reviews.llvm.org/D54918 llvm-svn: 349698
* Simplify. NFC.Rui Ueyama2018-12-191-7/+12
| | | | | | Differential Revision: https://reviews.llvm.org/D55903 llvm-svn: 349697
* [analyzer] Improve modeling for returning an object from the top frame with RVO.Artem Dergachev2018-12-192-19/+108
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Static Analyzer processes the program function-by-function, sometimes diving into other functions ("inlining" them). When an object is returned from an inlined function, Return Value Optimization is modeled, and the returned object is constructed at its return location directly. When an object is returned from the function from which the analysis has started (the top stack frame of the analysis), the return location is unknown. Model it with a SymbolicRegion based on a conjured symbol that is specifically tagged for that purpose, because this is generally the correct way to symbolicate unknown locations in Static Analyzer. Fixes leak false positives when an object is returned from top frame in C++17: objects that are put into a SymbolicRegion-based memory region automatically "escape" and no longer get reported as leaks. This only applies to C++17 return values with destructors, because it produces a redundant CXXBindTemporaryExpr in the call site, which confuses our liveness analysis. The actual fix for liveness analysis is still pending, but it is no longer causing problems. Additionally, re-enable temporary destructor tests in C++17. Differential Revision: https://reviews.llvm.org/D55804 rdar://problem/46217550 llvm-svn: 349696
* [X86] Remove TLI variable from ReplaceNodeResults. NFCCraig Topper2018-12-191-3/+2
| | | | | | We're already in X86TargetLowering which is a derived class of TargetLowering. We can just call methods directly. llvm-svn: 349695
* AMDGPU: Add patterns for v4i16/v4f16 -> v4i16/v4f16 bitcastsRhys Perry2018-12-192-0/+37
| | | | | | | | | | | | Reviewers: arsenm, tstellar Reviewed By: arsenm Subscribers: kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, llvm-commits Differential Revision: https://reviews.llvm.org/D55058 llvm-svn: 349694
* [CodeGenPrepare] Fix bad IR created by large offset GEP splitting.Eli Friedman2018-12-192-6/+14
| | | | | | | | | | | | | | Creating the IR builder, then modifying the CFG, leads to an IRBuilder where the BB and insertion point are inconsistent, so new instructions have the wrong parent. Modified an existing test because the test wasn't covering anything useful (the "invoke" was not actually an invoke by the time we hit the code in question). Differential Revision: https://reviews.llvm.org/D55729 llvm-svn: 349693
* Fix line endings.Zachary Turner2018-12-191-2/+2
| | | | llvm-svn: 349692
* Disable -faddsig by default for PS4 target.Douglas Yung2018-12-192-0/+2
| | | | llvm-svn: 349691
* Fix test commitRhys Perry2018-12-191-1/+1
| | | | | | Seems that was actually a eight space tab... llvm-svn: 349690
* Test commitRhys Perry2018-12-191-1/+1
| | | | | | Replace tab with 4 spaces. llvm-svn: 349689
* [llvm-mca] Rename directory for the Cortex tests (NFC)Evandro Menezes2018-12-192-0/+0
| | | | llvm-svn: 349688
* [llvm-mca] Update Exynos test cases (NFC)Evandro Menezes2018-12-192-108/+0
| | | | llvm-svn: 349687
* [AArch64] Improve Exynos predicatesEvandro Menezes2018-12-191-3/+10
| | | | | | | Expand the predicate `ExynosResetPred` to include all forms of immediate moves. llvm-svn: 349686
* [AArch64] Use canonical copy idiomEvandro Menezes2018-12-191-3/+1
| | | | | | | Use only the canonical form of the alias for register transfers in the `IsCopyIdiomPred` predicate. llvm-svn: 349685
* Revert "[BDCE][DemandedBits] Detect dead uses of undead instructions"Nikita Popov2018-12-194-72/+23
| | | | | | | This reverts commit r349674. It causes a failure in test-suite enc-3des.execution_time. llvm-svn: 349684
* [analyzer] CStringChecker: Add the forgotten test file.Artem Dergachev2018-12-191-0/+28
| | | | | | | | Differential Revision: https://reviews.llvm.org/D55873 rdar://problem/45366551 llvm-svn: 349683
* [analyzer] CStringChecker: Fix a crash on C++ overloads of standard functions.Artem Dergachev2018-12-191-34/+56
| | | | | | | | | | | | | | | | | | | | | | It turns out that it's not all that uncommon to have a C++ override of, say, memcpy that receives a structure (or two) by reference (or by value, if it's being copied from) and copies memory from it (or into it, if it's passed by reference). In this case the argument will be of structure type (recall that expressions of reference type do not exist: instead, C++ classifies expressions into prvalues and lvalues and xvalues). In this scenario we crash because we are trying to assume that, say, a memory region is equal to an empty CompoundValue (the non-lazy one; this is what makeZeroVal() return for compound types and it represents prvalue of an object that is initialized with an empty initializer list). Add defensive checks. Differential Revision: https://reviews.llvm.org/D55873 rdar://problem/45366551 llvm-svn: 349682
* [llvm-ar] Simplify string table get-or-insert pattern with .insert, NFCReid Kleckner2018-12-191-6/+4
| | | | llvm-svn: 349681
* [x86] add test to show ddup hole; NFC (PR37502)Sanjay Patel2018-12-191-0/+65
| | | | llvm-svn: 349680
* [gn build] Add build file for clang/lib/Basic and dependencies, 2nd tryNico Weber2018-12-1910-3/+350
| | | | | | | | | | | | | | | Adds a build file for clang-tblgen and an action for running it, and uses that to process all the .td files in include/clang/Basic. Also adds an action to write include/clang/Config/config.h and include/clang/Basic/Version.inc. Differential Revision: https://reviews.llvm.org/D55847 (The previous commit of this contained unrelated changes, so I reverted the whole previous commit and I'm now landing only what I intended to land.) llvm-svn: 349679
* Revert 349677, it contained a whole bunch of stuff I did not mean to commitNico Weber2018-12-1915-424/+19
| | | | llvm-svn: 349678
* [gn build] Add build file for clang/lib/Basic and dependenciesNico Weber2018-12-1915-19/+424
| | | | | | | | | | | | Adds a build file for clang-tblgen and an action for running it, and uses that to process all the .td files in include/clang/Basic. Also adds an action to write include/clang/Config/config.h and include/clang/Basic/Version.inc. Differential Revision: https://reviews.llvm.org/D55847 llvm-svn: 349677
* [libcxx] Use custom allocator's `construct` in C++03 when available.Volodymyr Sapsai2018-12-195-22/+193
| | | | | | | | | | | | | | | | | Makes libc++ behavior consistent between C++03 and C++11. Can use `decltype` in C++03 because `include/__config` defines a macro when `decltype` is not available. Reviewers: mclow.lists, EricWF, erik.pilkington, ldionne Reviewed By: ldionne Subscribers: dexonsmith, cfe-commits, howard.hinnant, ldionne, christof, jkorous, Quuxplusone Differential Revision: https://reviews.llvm.org/D48753 llvm-svn: 349676
* [NativePDB] Enable function-level-linking.test in native mode.Zachary Turner2018-12-191-1/+2
| | | | | | This test passes with the native reader, so run it in both modes. llvm-svn: 349675
* [BDCE][DemandedBits] Detect dead uses of undead instructionsNikita Popov2018-12-194-23/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This (mostly) fixes https://bugs.llvm.org/show_bug.cgi?id=39771. BDCE currently detects instructions that don't have any demanded bits and replaces their uses with zero. However, if an instruction has multiple uses, then some of the uses may be dead (have no demanded bits) even though the instruction itself is still live. This patch extends DemandedBits/BDCE to detect such uses and replace them with zero. While this will not immediately render any instructions dead, it may lead to simplifications (in the motivating case, by converting a rotate into a simple shift), break dependencies, etc. The implementation tries to strike a balance between analysis power and complexity/memory usage. Originally I wanted to track demanded bits on a per-use level, but ultimately we're only really interested in whether a use is entirely dead or not. I'm using an extra set to track which uses are dead. However, as initially all uses are dead, I'm not storing uses those user is also dead. This case is checked separately instead. The test case has a couple of cases that are not simplified yet. In particular, we're only looking at uses of instructions right now. I think it would make sense to also extend this to arguments. Furthermore DemandedBits doesn't yet know some of the tricks that InstCombine does for the demanded bits or bitwise or/and/xor in combination with known bits information. Differential Revision: https://reviews.llvm.org/D55563 llvm-svn: 349674
* [NativePDB] Fix a use after free and enable corresponding native test.Zachary Turner2018-12-192-2/+3
| | | | | | | | | | | We had a use after free where we were assigning the result of a function that returned a string to a StringRef. After fixing this use after free, one of the DIA PDB tests now passes with the native PDB reader, so we enable the test under native mode as well. The goal is to eventually make all the tests pass under both, at which point we can disable them all under DIA mode. llvm-svn: 349673
* Re-land "Fix MSVC dependency issue between Clang-tablegen and LLVM-tablegen"Alexandre Ganea2018-12-191-0/+6
| | | | | | (was reverted by mistake) llvm-svn: 349672
* [X86] Remove a bunch of 'else' after returns in reduceVMULWidth. NFCCraig Topper2018-12-191-76/+75
| | | | | | This reduces indentation and makes it obvious this function always returns something. llvm-svn: 349671
* llvm-dwarfdump: Improve/fix pretty printing of array dimensionsDavid Blaikie2018-12-196-69/+169
| | | | | | | | | | | | | | This is to address post-commit feedback from Paul Robinson on r348954. The original commit misinterprets count and upper bound as the same thing (I thought I saw GCC producing an upper bound the same as Clang's count, but GCC correctly produces an upper bound that's one less than the count (in C, that is, where arrays are zero indexed)). I want to preserve the C-like output for the common case, so in the absence of a lower bound the count (or one greater than the upper bound) is rendered between []. In the trickier cases, where a lower bound is specified, a half-open range is used (eg: lower bound 1, count 2 would be "[1, 3)" and an unknown parts use a '?' (eg: "[1, ?)" or "[?, 7)" or "[?, ? + 3)"). Reviewers: aprantl, probinson, JDevlieghere Differential Revision: https://reviews.llvm.org/D55721 llvm-svn: 349670
* PR40096: Forwards-compatible with C++20 rule regarding aggregates not having ↵David Blaikie2018-12-192-5/+0
| | | | | | | | | | user-declared ctors Looks like these were in place to make these types move-only. That's generally not a feature that the type should prescribe (unless it's an inherent limitation) - instead leaving it up to the users of a type. llvm-svn: 349669
* [lldbsuite] Un-xfail tests on Windows that are now passing (pt.2)Stella Stamenova2018-12-1912-20/+1
| | | | | | This is a set of tests that were all marked as failing becuse of pr21765. The bug is not fixed (as in more of the tests that were marked this way are failing), but this set is passing. It is possible that some of them are false positives, but there's a large number of unexpectedly passing tests on Windows, so I am doing a bulk un-xfail to get the buildbot to green. llvm-svn: 349668
* [ThinLTO] Remove dllimport attribute from locally defined symbolsMatthew Voss2018-12-192-1/+37
| | | | | | | | | | | | | | | | | | | | Summary: The LTO/ThinLTO driver currently creates invalid bitcode by setting symbols marked dllimport as dso_local. The compiler often has access to the definition (often dllexport) and the declaration (often dllimport) of an object at link-time, leading to a conflicting declaration. This patch resolves the inconsistency by removing the dllimport attribute. Reviewers: tejohnson, pcc, rnk, echristo Reviewed By: rnk Subscribers: dmikulin, wristow, mehdi_amini, inglorion, eraman, steven_wu, dexonsmith, dang, llvm-commits Differential Revision: https://reviews.llvm.org/D55627 llvm-svn: 349667
* [sanitizer] Remove spurious semi-colonKostya Kortchinsky2018-12-191-1/+1
| | | | | | | | | | | | | | | | | | | Summary: An extra ';' at the end of a namespace triggers a pedantic warning: ``` .../sanitizer_common/sanitizer_type_traits.h:42:2: warning: extra ‘;’ [-Wpedantic] }; // namespace __sanitizer ``` Reviewers: eugenis, delcypher Reviewed By: eugenis Subscribers: kubamracek, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D55849 llvm-svn: 349666
* [lldbsuite] Un-xfail tests on Windows that are now passingStella Stamenova2018-12-1910-37/+1
| | | | | | This is a set of tests that were all marked as failing becuse of pr24489. The bug is not fixed (as in more of the tests that were marked this way are failing), but this set is passing. It is possible that some of them are false positives, but there's a large number of unexpectedly passing tests on Windows, so I am doing a bulk un-xfail to get the buildbot to green. llvm-svn: 349665
* [GlobalISel][AArch64] Add support for @llvm.ceilJessica Paquette2018-12-199-0/+163
| | | | | | | | | | | | This adds a G_FCEIL generic instruction and uses it in AArch64. This adds selection for floating point ceil where it has a supported, dedicated instruction. Other cases aren't handled here. It updates the relevant gisel tests and adds a select-ceil test. It also adds a check to arm64-vcvt.ll which ensures that we don't fall back when we run into one of the relevant cases. llvm-svn: 349664
* Work around GCC 9.0 regressionEric Fiselier2018-12-191-1/+2
| | | | llvm-svn: 349663
* [llvm-mca] Rename an error variable.Matt Davis2018-12-191-2/+2
| | | | llvm-svn: 349662
* [X86] Don't match TESTrr from (cmp (and X, Y), 0) during isel. Defer to post ↵Craig Topper2018-12-194-45/+42
| | | | | | | | | | | | processing The (cmp (and X, Y) 0) pattern is greedy and ends up forming a TESTrr and consuming the and when it might be better to use one of the BMI/TBM like BLSR or BLSI. This patch moves removes the pattern from isel and adds a post processing check to combine TESTrr+ANDrr into just a TESTrr. With this patch we are able to select the BMI/TBM instructions, but we'll also emit a TESTrr when the result is compared to 0. In many cases the peephole pass will be able to use optimizeCompareInstr to remove the TEST, but its probably not perfect. Differential Revision: https://reviews.llvm.org/D55870 llvm-svn: 349661
* [X86] Fix assert fails in pass X86AvoidSFBPassCraig Topper2018-12-192-13/+108
| | | | | | | | | | | | | | | Fixes https://bugs.llvm.org/show_bug.cgi?id=38743 The function removeRedundantBlockingStores is supposed to remove any blocking stores contained in each other in lockingStoresDispSizeMap. But it currently looks only at the previous one, which will miss some cases that result in assert. This patch refine the function to check all previous layouts until find the uncontained one. So all redundant stores will be removed. Patch by Pengfei Wang Differential Revision: https://reviews.llvm.org/D55642 llvm-svn: 349660
* [llvm-mca] Add an error handler for error from parseCodeRegionsMatt Davis2018-12-191-10/+14
| | | | | | | | | | | | | | | | | | | Summary: It's a bit tricky to add a test for the failing path right now, binary support will have an easier path to exercise the path here. * Ran clang-format. Reviewers: andreadb Reviewed By: andreadb Subscribers: tschuett, gbedwell, llvm-commits Differential Revision: https://reviews.llvm.org/D55803 llvm-svn: 349659
* Show the memory region name if there is one in the output of the "memory ↵Greg Clayton2018-12-193-3/+35
| | | | | | | | | | region" command Prior to this change we would show the name of the section that a memory region belonged to but not its actual region name. Now we show this,. Added a test that reuses the regions-linux-map.dmp minidump file to test this and verify the correct region names for various memory regions. Differential Revision: https://reviews.llvm.org/D55854 llvm-svn: 349658
* [OPENMP]Mark the loop as started when initialized.Alexey Bataev2018-12-192-1/+13
| | | | | | | | | Need to mark the loop as started when the initialization statement is found. It is required to prevent possible incorrect loop iteraton variable detection during template instantiation and fix the compiler crash during the codegen. llvm-svn: 349657
* Revert r349517 "[CMake] Default options for faster executables on MSVC"Alexandre Ganea2018-12-193-21/+0
| | | | llvm-svn: 349656
* [CodeComplete] Properly determine qualifiers of 'this' in a lambdaIlya Biryukov2018-12-192-5/+24
| | | | | | | | | | | | | | | | | Summary: The clang used to pick up the qualifiers of the lamba's call operator (which is always const) and fail to show non-const methods of 'this' in completion results. Reviewers: kadircet Reviewed By: kadircet Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D55885 llvm-svn: 349655
* Revert r349517 "[CMake] Default options for faster executables on MSVC"Alexandre Ganea2018-12-191-6/+0
| | | | llvm-svn: 349654
* Initial PSTL commitJF Bastien2018-12-19101-0/+18755
| | | | | | | | | | | | The initial commit of the Parallel STL upstream (under LLVM umbrella) based on Parallel STL 20181204 open source release, which is available by https://github.com/intel/parallelstl Author: Mikhail Dvorskiy <mikhail.dvorskiy@intel.com> Differential Revision: https://reviews.llvm.org/D55889 llvm-svn: 349653
* [AArch64] Improve the Exynos M3 pipeline modelEvandro Menezes2018-12-192-5/+5
| | | | llvm-svn: 349652
OpenPOWER on IntegriCloud