summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [LoopSimplifyCFG] Change logic of dead loops removal to avoid hitting assertsMax Kazantsev2019-02-122-8/+56
| | | | | | | | | | | | | | | | | | | | The function `LI.erase` has some invariants that need to be preserved when it tries to remove a loop which is not the top-level loop. In particular, it requires loop's preheader to be strictly in loop's parent. Our current logic of deletion of dead blocks may erase the information about preheader before we handle the loop, and therefore we may hit this assertion. This patch changes the logic of loop deletion: we make them top-level loops before we actually erase them. This allows us to trigger the simple branch of `erase` logic which just detatches blocks from the loop and does not try to do some complex stuff that need this invariant. Thanks to @uabelho for reporting this! Differential Revision: https://reviews.llvm.org/D57221 Reviewed By: fedor.sergeev llvm-svn: 353813
* Extract common PlatformPOSIX/Windows code into a separate classPavel Labath2019-02-127-359/+200
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The two classes contained a lot of duplicated code, but there wasn't a good place to factor it to. It couldn't be the base Platform class, since we also have platforms which are only remote (such as PlatformGDBRemoteServer), and so it did not make sense for those to have an m_remote_platform member. This patch creates a new class, RemoteAwarePlatform, which can serve as a base class for platforms which can both serve as a host, and forward actions to a remote system. It is motivated partly by D56232 (which was about to add a bunch of additional duplicated methods), and partly by my own need to modify a function which happens to be implemented in both places identically. The patch moves the methods which are trivially identical in the two classes into the common base class, there were one or two more methods which could probably be merged into one, but this wasn't completely trivial, so I did not attempt to do that now. Reviewers: jingham, zturner, clayborg, asmith Subscribers: emaste, mgorny, Hui, lldb-commits Differential Revision: https://reviews.llvm.org/D58052 llvm-svn: 353812
* [yaml2obj/obj2yaml] - Move `Info` field out from `Section` class.George Rimar2019-02-126-12/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | ELFYAML.h contains a `Section` class which is a base for a few other sections classes that are used for mapping different section types. `Section` has a `StringRef Info` field used for storing sh_info. At the same time, sh_info has very different meanings for sections and cannot be processed in a similar way generally, for example ELFDumper does not handle it in `dumpCommonSection` but do that in `dumpGroup` and `dumpCommonRelocationSection` respectively. At this moment, we have and handle it as a string, because that was possible for the current use case. But also it can simply be a number: For SHT_GNU_verdef is "The number of version definitions within the section." The patch moves `Info` field out to be able to have it as a number. With that change, each class will be able to decide what type and purpose of the sh_info field it wants to use. I also had to edit 2 test cases. This is because patch fixes a bug. Previously we accepted yaml files with Info fields for all sections (for example, for SHT_DYNSYM too). But we do not handle it and the resulting objects had zero sh_info fields set for such sections. Now it is accepted only for sections that supports it. Differential revision: https://reviews.llvm.org/D58054 llvm-svn: 353810
* LibFuzzer.rst: double backticksHans Wennborg2019-02-121-3/+3
| | | | llvm-svn: 353809
* [NativePDB] Process virtual bases in the correct orderAleksandr Urakov2019-02-124-12/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch makes virtual bases to be added in the correct order to the bases list. It is important because `VTableContext` (`MicrosoftVTableContext` in our case) uses then the order of virtual bases in the list to restore the virtual table indexes. These indexes are used then to resolve the layout of the virtual bases. We haven't enough information about offsets of virtual bases regarding to the object (moreover, in a common case we can't rely on such information, see the example here: https://reviews.llvm.org/D53506#1272306 ), but there should be enough information to restore the layout of the virtual bases from the indexes in runtime. After D53506 this information is used whenever possible, so there should be no problems with virtual bases' fields reading. Reviewers: zturner, rnk, stella.stamenova Subscribers: abidh, teemperor, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D56904 llvm-svn: 353806
* tsan: Introduce in_symbolizer() function for Thread sanitizerDmitry Vyukov2019-02-124-22/+28
| | | | | | | | | This change is preparation for fiber support. Author: yuri (Yuri Per) Reviewed in: https://reviews.llvm.org/D58104 llvm-svn: 353805
* Delete blocks from DTU to avoid dangling pointersMax Kazantsev2019-02-121-1/+1
| | | | llvm-svn: 353804
* [LoopSimplifyCFG] Pay respect to LCSSA when removing dead blocksMax Kazantsev2019-02-122-9/+30
| | | | | | | | | | | Utility function that we use for blocks deletion always unconditionally removes one-input Phis. In LoopSimplifyCFG, it can lead to breach of LCSSA form. This patch alters this function to keep them if needed. Differential Revision: https://reviews.llvm.org/D57231 Reviewed By: fedor.sergeev llvm-svn: 353803
* [X86] Use the new unaligned vector typedefs for the loadu/storeu intrinsics ↵Craig Topper2019-02-122-8/+8
| | | | | | | | pointer arguments. This matches what gcc does and what was suggested by rnk in PR20670. llvm-svn: 353802
* [NFC] Rename DontDeleteUselessPHIs --> KeepOneInputPHIsMax Kazantsev2019-02-129-29/+29
| | | | llvm-svn: 353801
* [Statepoint Lowering] Update misleading comments about chainsPhilip Reames2019-02-121-9/+7
| | | | llvm-svn: 353800
* [NFC] Add parameter for keeping one-input Phis in DeleteDeadBlock(s)Max Kazantsev2019-02-122-11/+19
| | | | llvm-svn: 353799
* [X86] Collapse FP_TO_INT16_IN_MEM/FP_TO_INT32_IN_MEM/FP_TO_INT64_IN_MEM into ↵Craig Topper2019-02-123-21/+19
| | | | | | a single opcode using memory VT to distinquish. NFC llvm-svn: 353798
* [X86] Remove the value type operand from the floating point load/store ↵Craig Topper2019-02-123-58/+84
| | | | | | | | MemIntrinsicSDNodes. Use the MemoryVT instead. NFCI We already have the memory VT, we can just match from that during isel. llvm-svn: 353797
* [CMake] Avoid internal dependencies in the runtimes buildPetr Hosek2019-02-121-1/+1
| | | | | | | When performing runtimes build, dependencies like clang and clang-headers aren't available. This was accidentally omitted in D57992. llvm-svn: 353796
* Remove redundant ::get() for smart pointer. (NFC)Jonas Devlieghere2019-02-1252-191/+187
| | | | | | | | This commit removes redundant calls to smart pointer’s ::get() method. https://clang.llvm.org/extra/clang-tidy/checks/readability-redundant-smartptr-get.html llvm-svn: 353795
* [libFuzzer] make the fork mode less verboseKostya Serebryany2019-02-125-28/+52
| | | | llvm-svn: 353794
* [build] Remove a stray comment. NFCShoaib Meenai2019-02-121-1/+1
| | | | | | | The CMake change associated with this comment was removed but the comment got left behind. Add a newline instead. llvm-svn: 353793
* [libFuzzer] teach the fork mode to ignore OOMs and timeoutsKostya Serebryany2019-02-127-11/+47
| | | | llvm-svn: 353792
* Fix VS2015 build problem introduced by r353370.Douglas Yung2019-02-121-2/+2
| | | | llvm-svn: 353791
* [CMake] Don't override required compiler flags in the runtimes buildPetr Hosek2019-02-121-13/+5
| | | | | | | | | Ensure that HandleLLVMOptions adds all necessary required flags, including -Wno-error when building with LLVM_ENABLE_WERROR enabled. Differential Revision: https://reviews.llvm.org/D58092 llvm-svn: 353790
* [x86] add tests for logic of setcc (PR40611); NFCSanjay Patel2019-02-121-0/+30
| | | | llvm-svn: 353789
* [PowerPC] add tests for logic of setcc (PR40611); NFCSanjay Patel2019-02-121-0/+30
| | | | llvm-svn: 353788
* [sanitizer] Don't compile GetPathAssumingFileIsRelativeToExec on FuchsiaPetr Hosek2019-02-121-9/+20
| | | | | | | | This avoids the unused function warning during compilation. Differential Revision: https://reviews.llvm.org/D58082 llvm-svn: 353787
* [CMake] Avoid passing -rtlib=compiler-rt when using compiler-rtPetr Hosek2019-02-122-8/+0
| | | | | | | | | | | | We build libc++ and libc++abi with -nodefaultlibs, so -rtlib=compiler-rt has no effect and results in an 'argument unused during compilation' warning which breaks the build when using -Werror. We can therefore drop -rtlib=compiler-rt without any functional change; note that the actual compiler-rt linking is handled by HandleCompilerRT. Differential Revision: https://reviews.llvm.org/D58084 llvm-svn: 353786
* Fix r353771 to target linux only (split-dwarf isn't supported on macho)David Blaikie2019-02-121-0/+2
| | | | llvm-svn: 353785
* [CMake][XRay] Silence llvm-config error when checking library supportPetr Hosek2019-02-121-2/+4
| | | | | | | | | | Otherwise this propagates all the way to CMake and results in an error during configuration. We check and handle the result and report warning separately so this is not changing the behavior. Differential Revision: https://reviews.llvm.org/D58086 llvm-svn: 353784
* [Thread] Update the correct variableJonas Devlieghere2019-02-121-4/+2
| | | | | | | The new shared pointer was assigning to the temporary instead of the member (m_curr_frames_sp). llvm-svn: 353783
* [libFuzzer] replace slow std::mt19937 with a much faster std::minstd_rand; ↵Kostya Serebryany2019-02-122-4/+5
| | | | | | second attempt after failed r352732, this time with a fix for cmake llvm-svn: 353782
* [libFuzzer] simplify the code for print_coverage=1 so that it doesn't fail ↵Kostya Serebryany2019-02-121-2/+2
| | | | | | on broken debug info llvm-svn: 353781
* [libFuzzer] Make coverage.test work on ARM64Julian Lettner2019-02-121-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This test instruments the following code with coverage, runs the fuzzer once, and asserts that there are uncovered PCs. The ARM64 backend optimizes this code using the `csel` (Conditional select) instruction, which removes all branching from the resulting machine code. The test then fails because we do not have any uncovered PCs. The easiest solution for now is to turn off optimization for the DSOs used in this test. ``` int DSO1(int a) { if (a < 123456) return 0; return 1; } ``` rdar://47646400 Reviewers: kcc Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D58087 llvm-svn: 353780
* [LoopReroll] Fix reroll root legality checking.Eli Friedman2019-02-122-0/+34
| | | | | | | | | | | The code checked that the first root was an appropriate distance from the base value, but skipped checking the other roots. This could lead to rerolling a loop that can't be legally rerolled (at least, not without rewriting the loop in a non-trivial way). Differential Revision: https://reviews.llvm.org/D56812 llvm-svn: 353779
* Define _ENABLE_EXTENDED_ALIGNED_STORAGE on Windows.Jonas Devlieghere2019-02-122-8/+18
| | | | | | | | | | Apparently there are multiple places where MSVC complains about instantiations with extended aligment. I think it's better to define `_ENABLE_EXTENDED_ALIGNED_STORAGE` as suggested by the error message. I don't have access to a Windows machine so this is all speculative. llvm-svn: 353778
* [libFuzzer] run the -fork=1 tests only on linuxKostya Serebryany2019-02-122-1/+5
| | | | llvm-svn: 353777
* [Test] Use autogenerated checks for more statepoint testsPhilip Reames2019-02-124-125/+303
| | | | llvm-svn: 353776
* [libFuzzer] extend the -fork=1 functionality. Still not fully usable, but ↵Kostya Serebryany2019-02-1212-36/+110
| | | | | | good enough for the first unit test llvm-svn: 353775
* Don't declare fenv.h functions when they're a macro.Eric Fiselier2019-02-121-100/+11
| | | | | | | libc still provides function declarations, and these declarations conflict with libc++'s llvm-svn: 353774
* [Tests] Fill out a few tests around gc relocation uniquingPhilip Reames2019-02-121-3/+36
| | | | llvm-svn: 353773
* Make the sym_diff utilities more useful.Eric Fiselier2019-02-123-17/+40
| | | | | | In particular when working with static libraries and libstdc++. llvm-svn: 353772
* DebugInfo: Split DWARF + gmlt + no-split-dwarf-inlining shouldn't emit ↵David Blaikie2019-02-123-2/+40
| | | | | | | | | | | | | | | anything to the .dwo file This configuration (due to r349207) was intended not to emit any DWO CU, but a degenerate CU was still being emitted - containing a header and a DW_TAG_compile_unit with no attributes. Under that situation, emit nothing to the .dwo file. (since this is a dynamic property of the input the .dwo file is still emitted, just with nothing in it (so a valid, but empty, ELF file) - if some other CU didn't satisfy this criteria, its DWO CU would still go there, etc) llvm-svn: 353771
* [Test] Autogenerate a statepoint test and actual show the reloadPhilip Reames2019-02-111-2/+32
| | | | llvm-svn: 353770
* [ObjectFileMachO] Revert std::make_sharedJonas Devlieghere2019-02-111-14/+8
| | | | | | | This caused a rather interesting error message on MSVC: error C2338 and I'm not sure how to properly fix it. llvm-svn: 353769
* Some cleanup after moving to std::make_sharedJonas Devlieghere2019-02-112-21/+13
| | | | | | Addresses Tatyana Krasnukha's feedback from D57990. llvm-svn: 353768
* Add fenv.h headerEric Fiselier2019-02-117-12/+241
| | | | | | | | | | | | | | | | | Summary: Some implementations of fenv.h use macros to define the functions they provide. This can cause problems when `std::fegetround()` is spelled in source. This patch adds a `fenv.h` header to libc++ for the sole purpose of turning those macros into real functions. Reviewers: rsmith, mclow.lists, ldionne Reviewed By: rsmith Subscribers: mgorny, christof, libcxx-commits Differential Revision: https://reviews.llvm.org/D57729 llvm-svn: 353767
* Be conservative about unordered accesses for the momentPhilip Reames2019-02-112-3/+8
| | | | | | | | | | Background: As described in https://reviews.llvm.org/D57601, I'm working towards separating volatile and atomic in the MMO uses for atomic instructions. In https://reviews.llvm.org/D57593, I fixed a bug where isUnordered was returning the wrong result, but didn't account for the fact I was getting slightly ahead of myself. While both uses of isUnordered are correct (as far as I can tell), we don't have tests to demonstrate this and being aggressive gets in the way of having the removal of volatile truly be non-functional. Once D57601 lands, I will return to these call sites, revert this patch, and add the appropriate tests to show the expected behaviour. Differential Revision: https://reviews.llvm.org/D57802 llvm-svn: 353766
* Add a new attribute, fortify_stdlibErik Pilkington2019-02-1111-1/+434
| | | | | | | | | | | | | | | | | | | | | | This attribute applies to declarations of C stdlib functions (sprintf, memcpy...) that have known fortified variants (__sprintf_chk, __memcpy_chk, ...). When applied, clang will emit calls to the fortified variant functions instead of calls to the defaults. In GCC, this is done by adding gnu_inline-style wrapper functions, but that doesn't work for us for variadic functions because we don't support __builtin_va_arg_pack (and have no intention to). This attribute takes two arguments, the first is 'type' argument passed through to __builtin_object_size, and the second is a flag argument that gets passed through to the variadic checking variants. rdar://47905754 Differential revision: https://reviews.llvm.org/D57918 llvm-svn: 353765
* Use std::make_shared in LLDB (NFC)Jonas Devlieghere2019-02-1198-443/+645
| | | | | | | | | | | Unlike std::make_unique, which is only available since C++14, std::make_shared is available since C++11. Not only is std::make_shared a lot more readable compared to ::reset(new), it also performs a single heap allocation for the object and control block. Differential revision: https://reviews.llvm.org/D57990 llvm-svn: 353764
* [tblgen] Add a timer covering the time spent reading the Instruction defsDaniel Sanders2019-02-113-0/+17
| | | | | | | | | | | | | | | This patch adds a -time-regions option to tablegen that can enable timers (currently only one) that assess the performance of tablegen itself. This can be useful for identifying scaling problems with tablegen backends. This particular timer has allowed me to ignore time that is not attributed the GISel combiner pass. It's useful by itself but it is particularly useful in combination with https://reviews.llvm.org/D52954 which causes this period of time to be annotated within Xcode Instruments which in turn allows profile samples and recorded allocations attributed to reading instructions to be filtered out. llvm-svn: 353763
* [Sema] Mark GNU compound literal array init as an rvalue.Eli Friedman2019-02-113-9/+49
| | | | | | | | | | | | | | | | | | | | | | Basically the same issue as string init, except it didn't really have any visible consequences before I removed the implicit lvalue-to-rvalue conversion from CodeGen. While I'm here, a couple minor drive-by cleanups: IgnoreParens never returns a ConstantExpr, and there was a potential crash with string init involving a ChooseExpr. The analyzer test change maybe indicates we could simplify the analyzer code a little with this fix? Apparently a hack was added to support lvalues in initializers in r315750, but I'm not really familiar with the relevant code. Fixes regression reported in the kernel build at https://bugs.llvm.org/show_bug.cgi?id=40430#c6 . Differential Revision: https://reviews.llvm.org/D58069 llvm-svn: 353762
* [WebAssembly] Make thread-related options consistentHeejin Ahn2019-02-118-14/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: There have been three options related to threads and users had to set all three of them separately to get the correct compilation results. This makes sure the relationship between the options makes sense and sets necessary options for users if only part of the necessary options are specified. This does: - Remove `-matomics`; this option alone does not enable anything, so removed it to not confuse users. - `-mthread-model posix` sets `-target-feature +atomics` - `-pthread` sets both `-target-feature +atomics` and `-mthread-model posix` Also errors out when explicitly given options don't match, such as `-pthread` is given with `-mthread-model single`. Reviewers: dschuff, sbc100, tlively, sunfish Subscribers: jgravelle-google, jfb, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D57874 llvm-svn: 353761
OpenPOWER on IntegriCloud