summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* [InstSimplify] generalize FP folds with undef/NaN; NFCSanjay Patel2019-09-271-12/+14
| | | | | | We can reuse this logic for things like fma. llvm-svn: 373119
* [Clang][OpenMP Offload] Create start/end symbols for the offloading entry ↵Sergey Dmitriev2019-09-2739-317/+297
| | | | | | | | | | | | table with a help of a linker Linker automatically provides __start_<section name> and __stop_<section name> symbols to satisfy unresolved references if <section name> is representable as a C identifier (see https://sourceware.org/binutils/docs/ld/Input-Section-Example.html for details). These symbols indicate the start address and end address of the output section respectively. Therefore, renaming OpenMP offload entries section name from ".omp.offloading_entries" to "omp_offloading_entries" to use this feature. This is the first part of the patch for eliminating OpenMP linker script (please see https://reviews.llvm.org/D64943). Differential Revision: https://reviews.llvm.org/D68070 llvm-svn: 373118
* Revert [Dominators][CodeGen] Clean up MachineDominatorsJakub Kuderski2019-09-272-32/+47
| | | | | | This reverts r373101 (git commit 72c57ec3e6b320c31274dadb888dc16772b8e7b6) llvm-svn: 373117
* Revert XFAIL a codegen test AArch64/tailmerging_in_mbp.llJakub Kuderski2019-09-271-1/+0
| | | | | | This reverts r373103 (git commit a524e630a793e18e7d5fabc2262781f310eb0279) llvm-svn: 373116
* [NFC][PhaseOrdering] Add end-to-end tests for the 'two shifts by sext' problemRoman Lebedev2019-09-271-0/+125
| | | | | | | | We start with two separate sext's, but EarlyCSE runs before InstCombine, so when we get them, they are a single sext, and we just ignore that. Likewise, if we had a single sext, we don't do anything there. llvm-svn: 373115
* [Reproducer] Update the unit tests to specify the path style.Jonas Devlieghere2019-09-271-17/+33
| | | | | | | The unit tests started failing on Windows after my recent patch that ensured we always deal with absolute paths. This should fix that. llvm-svn: 373114
* [Docs] Adds new section to User Guides pageDeForest Richards2019-09-271-15/+36
| | | | | | Adds a section to the User Guides page for articles related to building, packaging, and distributing LLVM. Includes sub-sections for CMake, Clang, and Docker. llvm-svn: 373113
* [CMake] Depend on clang-tablegen-targetsJonas Devlieghere2019-09-271-1/+1
| | | | | | | | The ClangDriverOptions target is not available for standalone builds. Thanks Alex for pointing this out! llvm-svn: 373112
* Revert: [lldb] [testsuite] Remove redundant MAKE_DSYM := NOJan Kratochvil2019-09-2717-0/+22
| | | | | | | | | | Revert: llvm-svn: 373061 It broke OSX testsuite: https://reviews.llvm.org/D67589#1686150 lldb/packages/Python/lldbsuite/test/macosx/function-starts/TestFunctionStarts.py llvm-svn: 373110
* [InstSimplify] add tests for fma/fmuladd with undef operand; NFCSanjay Patel2019-09-271-0/+54
| | | | llvm-svn: 373109
* [X86] Call SimplifyDemandedBits in combineGatherScatter any time the mask ↵Craig Topper2019-09-272-5/+3
| | | | | | | | | element is wider than i1, not just when AVX512 is disabled. The AVX2 intrinsics can still be used when AVX512 is enabled and those go through this path. So we should simplify them. llvm-svn: 373108
* [X86] Add test case to show failure to perform SimplifyDemandedBits on mask ↵Craig Topper2019-09-271-0/+34
| | | | | | of avx2 gather intrinsics when avx512 is enabled. llvm-svn: 373107
* [InstCombine] Simplify shift-by-sext to shift-by-zextRoman Lebedev2019-09-273-13/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is valid for any `sext` bitwidth pair: ``` Processing /tmp/opt.ll.. ---------------------------------------- %signed = sext %y %r = shl %x, %signed ret %r => %unsigned = zext %y %r = shl %x, %unsigned ret %r %signed = sext %y Done: 2016 Optimization is correct! ``` (This isn't so for funnel shifts, there it's illegal for e.g. i6->i7.) Main motivation is the C++ semantics: ``` int shl(int a, char b) { return a << b; } ``` ends as ``` %3 = sext i8 %1 to i32 %4 = shl i32 %0, %3 ``` https://godbolt.org/z/0jgqUq which is, as this shows, too pessimistic. There is another problem here - we can only do the fold if sext is one-use. But we can trivially have cases where several shifts have the same sext shift amount. This should be resolved, later. Reviewers: spatel, nikic, RKSimon Reviewed By: spatel Subscribers: efriedma, hiraditya, nlopes, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68103 llvm-svn: 373106
* [CMake] Make Core depend on ClangDriverOptions (NFC)Jonas Devlieghere2019-09-271-0/+3
| | | | | | | | ModuleList.cpp includes clang/Driver/Driver.h which depends on clang/Driver/Options.inc. This patch adds the corresponding TableGen target to Core. llvm-svn: 373105
* [clangd] Fix template type aliases in findExplicitReferenceIlya Biryukov2019-09-272-21/+28
| | | | | | | | | | | | | | Reviewers: kadircet Reviewed By: kadircet Subscribers: MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68124 llvm-svn: 373104
* XFAIL a codegen test AArch64/tailmerging_in_mbp.llJakub Kuderski2019-09-271-0/+1
| | | | | | | This test fails when machine dominator tree verifier is run. Needs more investigation, as this is not a new failure. llvm-svn: 373103
* [Reproducer] Always use absolute paths for capture & replay.Jonas Devlieghere2019-09-273-4/+21
| | | | | | | | | | | The VFS requires files to be have absolute paths. The file collector makes paths relative to the reproducer root. If the root is a relative path, this would trigger an assert in the VFS. This patch ensures that we always make the given path absolute. Thank you Ted Woodward for pointing this out! llvm-svn: 373102
* [Dominators][CodeGen] Clean up MachineDominatorsJakub Kuderski2019-09-272-47/+32
| | | | | | | | | | | | | | | | Summary: This is a cleanup patch for MachineDominatorTree. It would be an NFC, except for replacing custom DomTree verification with the generic one. Reviewers: tstellar, tpr, nhaehnle, arsenm, NutshellySima, grosser, hliao Reviewed By: arsenm Subscribers: wdng, hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67976 llvm-svn: 373101
* Fix MSVC "not all control paths return a value" warning. NFCI.Simon Pilgrim2019-09-271-0/+1
| | | | llvm-svn: 373100
* ModuleUtils - silence static analyzer dyn_cast<> null dereference warning. NFCI.Simon Pilgrim2019-09-271-1/+1
| | | | | | 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: 373099
* Change -march=systemz to triple and fix testKai Nacke2019-09-272-6/+4
| | | | | | | | | | | | | These two test cases use -march=systemz instead of a triple. In particular, the used file format is then based on the default host triple. This leads to different behaviour on different platforms. The SystemZ implementation uses the integrated assembler for a long time now. The mature-mc-support test can be fully enabled. Differential Revision: https://reviews.llvm.org/D68129 llvm-svn: 373098
* FunctionImportGlobalProcessing::processGlobalForThinLTO - silence static ↵Simon Pilgrim2019-09-271-1/+1
| | | | | | | | analyzer dyn_cast<FunctionSummary> null dereference warning. NFCI. The static analyzer is warning about a potential null dereference, but we should be able to use cast<FunctionSummary> directly and if not assert will fire for us. llvm-svn: 373097
* [RISCV] Rename FPRs and use Register arithmeticLuis Marques2019-09-276-199/+136
| | | | | | | | | | | | | | | | | The new names for FPRs ensure that the Register values within the same class are enumerated consecutively (the order is determined by the `LessRecordRegister` function object). Where there were tables mapping between 32- and 64-bit FPRs (and vice versa) this patch replaces them with Register arithmetic. The enumeration order between different register classes is expected to continue to be arbitrary, although it does impact the conversion from the (overloaded) asm FPR names to Register values, and therefore might require updates to the target if the sorting algorithm is changed. Static asserts were added to ensure that changes to the ordering that would impact the current implementation are detected. Differential Revision: https://reviews.llvm.org/D67423 llvm-svn: 373096
* SCCP - silence static analyzer dyn_cast<StructType> null dereference ↵Simon Pilgrim2019-09-271-1/+1
| | | | | | | | warning. NFCI. The static analyzer is warning about a potential null dereference, but we should be able to use cast<StructType> directly and if not assert will fire for us. llvm-svn: 373095
* [AMDGPU][MC] Corrected parsing of registersDmitry Preobrazhensky2019-09-272-144/+217
| | | | | | | | | | | | | Summary of changes: refactored code for better readability and future improvements; fixed bug 41281: https://bugs.llvm.org/show_bug.cgi?id=41281 Reviewers: artem.tamazov, arsenm Differential Revision: https://reviews.llvm.org/D65224 llvm-svn: 373094
* [libTooling] Transformer: refine `SourceLocation` specified as anchor of ↵Yitzhak Mandelbaum2019-09-273-12/+78
| | | | | | | | | | | | | | | | | | | | | | | changes. Summary: Every change triggered by a rewrite rule is anchored at a particular location in the source code. This patch refines how that location is chosen and defines it as an explicit function so it can be shared by other Transformer implementations. This patch was inspired by a bug found by a clang tidy, wherein two changes were anchored at the same location (the expansion loc of the macro) resulting in the discarding of the second change. Reviewers: gribozavr Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66652 llvm-svn: 373093
* [libc++] Take 2: Implement LWG 3158Louis Dionne2019-09-275-17/+65
| | | | | | | | | | | | | | | | | | | | | Summary: LWG 3158 marks the allocator_arg_t constructor of std::tuple as conditionnally explicit based on whether the default constructors of the tuple's members are explicitly default constructible. This was previously committed as r372778 and reverted in r372832 due to the commit breaking LLVM's build in C++14 mode. This issue has now been addressed. Reviewers: mclow.lists Subscribers: christof, jkorous, dexonsmith, libcxx-commits Tags: #libc Differential Revision: https://reviews.llvm.org/D65232 llvm-svn: 373092
* remove File::SetStream(), make new files instead.Lawrence D'Anna2019-09-2728-255/+210
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch removes File::SetStream() and File::SetDescriptor(), and replaces most direct uses of File with pointers to File. Instead of calling SetStream() on a file, we make a new file and replace it. My ultimate goal here is to introduce a new API class SBFile, which has full support for python io.IOStream file objects. These can redirect read() and write() to python code, so lldb::Files will need a way to dispatch those methods. Additionally it will need some form of sharing and assigning files, as a SBFile will be passed in and assigned to the main IO streams of the debugger. In my prototype patch queue, I make File itself copyable and add a secondary class FileOps to manage the sharing and dispatch. In that case SBFile was a unique_ptr<File>. (here: https://github.com/smoofra/llvm-project/tree/files) However in review, Pavel Labath suggested that it be shared_ptr instead. (here: https://reviews.llvm.org/D67793) In order for SBFile to use shared_ptr<File>, everything else should as well. If this patch is accepted, I will make SBFile use a shared_ptr I will remove FileOps from future patches and use subclasses of File instead. Reviewers: JDevlieghere, jasonmolenda, zturner, jingham, labath Reviewed By: labath Subscribers: lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D67891 llvm-svn: 373090
* [DebugInfo] Exclude memory location values as parameter entry valuesDjordje Todorovic2019-09-273-18/+7
| | | | | | | | | | | | | | | Abandon describing of loaded values due to safety concerns. Loaded values are described as derefed memory location at caller point. At callee we can unintentionally change that memory location which would lead to different entry being printed value before and after the memory location clobbering. This problem is described in llvm.org/PR43343. Patch by Nikola Prica Differential Revision: https://reviews.llvm.org/D67717 llvm-svn: 373089
* [OpenCL] Pass LangOptions as const refSven van Haastregt2019-09-271-3/+3
| | | | llvm-svn: 373088
* [llvm-exegesis] Fix r373083: Module -> Mod.Clement Courbet2019-09-271-6/+6
| | | | | | | SnippetRepetitorTest.cpp:66:27: error: declaration of ‘std::unique_ptr<llvm::Module> llvm::exegesis::{anonymous}::X86SnippetRepetitorTest::Module’ [-fpermissive] std::unique_ptr<Module> Module; llvm-svn: 373087
* gn build: (manually) merge r373082Nico Weber2019-09-274-71/+33
| | | | llvm-svn: 373086
* gn build: Merge r373083GN Sync Bot2019-09-272-0/+2
| | | | llvm-svn: 373085
* [CodeGenPrepare] Mend "avoid crashing from replacing a phi twice" fix.Jesper Antonsson2019-09-272-1/+69
| | | | | | | | | | | | | | | | | | | Summary: An erroneously negated if-statement by an earlier (March 2019) bugfix left phi replacement/simplification under optimizeMemoryInst() in CodeGenPrepare largely inactivated. The error was found when csmith found that the same assert as in the original bug report could still be triggered in a different way. This patch fixes the bugfix. The original bug was: https://bugs.llvm.org/show_bug.cgi?id=41052 ... and the previous fix was D59358. Reviewers: aprantl, skatkov Reviewed By: skatkov Subscribers: hiraditya, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D67838 llvm-svn: 373084
* [llvm-exegesis] Add loop mode for repeating the snippet.Clement Courbet2019-09-2730-102/+523
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Before this change the Executable function was made by duplicating the snippet. This change adds a --repetion-mode={loop|duplicate} flag that allows choosing between this behaviour and wrapping the snippet instructions in a loop. The new mode can help measurements when the snippet fits in the DSB by short-cirtcuiting decoding. The loop adds a dec + jmp to the measurements, but since these are not part of the critical path, they execute in parallel with the measured code and do not impact measurements in practice. Overview of the change: - New SnippetRepetitor abstraction that handles repeating the snippet. The assembler delegates repeating the instructions to this class. - ExegesisTarget learns how to decrement loop counter and jump. - Some refactoring of the assembler into FunctionFiller/BasicBlockFiller. Reviewers: gchatelet Subscribers: mgorny, tschuett, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D68125 llvm-svn: 373083
* clang-tidy: Don't repeat list of all checks in three places.Nico Weber2019-09-276-102/+43
| | | | | | | | | | | | Instead, put all checks in a cmake variable and reference this. Also, make clangd use the the ClangTidyForceLinker.h header instead of duplicating the list of modules -- the duplicate copy was missing the new "darwin" checker added in r373065. Differential Revision: https://reviews.llvm.org/D68132 llvm-svn: 373082
* [Alignment][NFC] Remove unneeded llvm:: scoping on Align typesGuillaume Chatelet2019-09-2794-453/+434
| | | | llvm-svn: 373081
* [clangd] Remove an unrelated comment, NFC.Haojian Wu2019-09-271-1/+0
| | | | llvm-svn: 373079
* [clang] [AST] Treat "inline gnu_inline" the same way as "extern inline ↵Martin Storsjo2019-09-278-9/+31
| | | | | | | | | | | | | | | | | gnu_inline" in C++ mode This matches how GCC handles it, see e.g. https://gcc.godbolt.org/z/HPplnl. GCC documents the gnu_inline attribute with "In C++, this attribute does not depend on extern in any way, but it still requires the inline keyword to enable its special behavior." The previous behaviour of gnu_inline in C++, without the extern keyword, can be traced back to the original commit that added support for gnu_inline, SVN r69045. Differential Revision: https://reviews.llvm.org/D67414 llvm-svn: 373078
* [LLD] Simplify the demangleItanium function. NFC.Martin Storsjo2019-09-275-17/+9
| | | | | | | | | Instead of returning an optional, just return the input string if demangling fails, as that's what all callers use anyway. Differential Revision: https://reviews.llvm.org/D68015 llvm-svn: 373077
* [LLD] Convert demangleItanium to use the higher level llvm::demangle ↵Martin Storsjo2019-09-272-6/+9
| | | | | | | | | | | | | function. NFC. This avoids a few lines of boilerplate of dealing with C string allocations. Add a testcase for a case where demangling shouldn't happen. Differential Revision: https://reviews.llvm.org/D68014 llvm-svn: 373076
* [LLD] [COFF] Use the unified llvm demangle frontend function. NFC.Martin Storsjo2019-09-276-33/+26
| | | | | | | | Add test cases for some cases where we don't want demangling to happen. Differential Revision: https://reviews.llvm.org/D67301 llvm-svn: 373075
* [lldb] Disable testing entry values as memory locationDjordje Todorovic2019-09-271-0/+3
| | | | | | The D67717 excludes such locations for now. llvm-svn: 373074
* [lldb/cmake] add lldbCore -> clangDriver dependencyPavel Labath2019-09-271-0/+1
| | | | | | | | ModuleList.cpp includes clang/Driver/Driver.h. Reflect that in the build system. Not having this can cause build failures if ModuleList.cpp is built before Driver.inc is generated. llvm-svn: 373073
* Unwind: Add a stack scanning mechanism to support win32 unwindingPavel Labath2019-09-2710-12/+176
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Windows unwinding is weird. The unwind rules do not (always) describe the precise layout of the stack, but rather expect the debugger to scan the stack for something which looks like a plausible return address, and the unwind based on that. The reason this works somewhat reliably is because the the unwinder also has access to the frame sizes of the functions on the stack. This allows it (in most cases) to skip function pointers in local variables or function arguments, which could otherwise be mistaken for return addresses. Implementing this kind of unwind mechanism in lldb was a bit challenging because we expect to be able to statically describe (in the UnwindPlan) structure, the layout of the stack for any given instruction. Giving a precise desription of this is not possible, because it requires correlating information from two functions -- the pushed arguments to a function are considered a part of the callers stack frame, and their size needs to be considered when unwinding the caller, but they are only present in the unwind entry of the callee. The callee may end up being in a completely different module, or it may not even be possible to determine it statically (indirect calls). This patch implements this functionality by introducing a couple of new APIs: SymbolFile::GetParameterStackSize - return the amount of stack space taken up by parameters of this function. SymbolFile::GetOwnFrameSize - the size of this function's frame. This excludes the parameters, but includes stuff like local variables and spilled registers. These functions are then used by the unwinder to compute the estimated location of the return address. This address is not always exact, because the stack may contain some additional values -- for instance, if we're getting ready to call a function then the stack will also contain partially set up arguments, but we will not know their size because we haven't called the function yet. For this reason the unwinder will crawl up the stack from the return address position, and look for something that looks like a possible return address. Currently, we assume that something is a valid return address if it ends up pointing to an executable section. All of this logic kicks in when the UnwindPlan sets the value of CFA as "isHeuristicallyDetected", which is also the final new API here. Right now, only SymbolFileBreakpad implements these APIs, but in the future SymbolFilePDB will use them too. Differential Revision: https://reviews.llvm.org/D66638 llvm-svn: 373072
* Disable the empty string check in TestDataFormatterStdStringPavel Labath2019-09-271-1/+2
| | | | | | | This check was failing since it was added in r372837. It should be possible to re-enable it once D68010 lands. llvm-svn: 373071
* Reland "gn build: (manually) merge r373028"Nico Weber2019-09-274-0/+21
| | | | | | This relands r373029, reverted in 373033, because r373028 relanded in r373066. llvm-svn: 373070
* Fix some swig warningsPavel Labath2019-09-275-21/+3
| | | | | | | | | Previously, these were unseen because the wrapper script would swallow them. This fixes the following types of warnings: - methods being declared more than once - swig complained about ignoring operator=, so I just removed it llvm-svn: 373069
* Fixed indentation in a ClangTidy testDmitri Gribenko2019-09-271-1/+1
| | | | llvm-svn: 373068
* [clangd] Handle type template parameters in findExplicitReferencesIlya Biryukov2019-09-272-0/+25
| | | | | | | | | | | | | | Reviewers: kadircet Reviewed By: kadircet Subscribers: MaskRay, jkorous, arphaman, usaxena95, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D68120 llvm-svn: 373067
OpenPOWER on IntegriCloud