summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [GlobalOpt] recognize dead struct fields and propagate valuesChristian Bruel2019-05-233-6/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Allow struct fields SRA and dead stores. This works by considering fields accesses from getElementPtr to be considered as a possible pointer root that can be cleaned up. We check that the variable can be SRA by recursively checking the sub expressions with the new isSafeSubSROAGEP function. basically this allows the array in following C code to be optimized out struct Expr { int a[2]; int b; }; static struct Expr e; int foo (int i) { e.b = 2; e.a[i] = 1; return e.b; } Reviewers: greened, bkramer, nicholas, jmolloy Reviewed By: jmolloy Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D61911 llvm-svn: 361460
* [Reproducer] Pass FileSpec by const-ref. (NFC)Jonas Devlieghere2019-05-232-3/+3
| | | | | | | Fix two functions where we were passing FileSpecs by value, while we could pass by const reference. llvm-svn: 361459
* [Utility] Modernize C-style catsJonas Devlieghere2019-05-2316-225/+263
| | | | | | | | Replaces the remaining C-style casts with explicit casts in Utility. The motivation is that they are (1) easier to spot and (2) don't have multiple meanings. llvm-svn: 361458
* Remove unnecessary const&s; NFCGeorge Burgess IV2019-05-233-3/+3
| | | | | | | | | It's uncommon to rely on temporary lifetime extension when having a regular, non-`const&` value behaves identically. Since `Twine::str` and `buildFixMsgForStringFlag` both return regular `std::string`s, there's seemingly no point in having `const&` here. llvm-svn: 361457
* [CMake][Fuchsia] Use cannonical triples for runtimesPetr Hosek2019-05-231-49/+49
| | | | | | | | | | This ensures that whether the user uses short or cannonical version of the triple, Clang will still find the runtimes under the cannonical triple name. Differential Revision: https://reviews.llvm.org/D52132 llvm-svn: 361456
* Remove unused const version of CommandInterpreter::GetCommandHistory.Jim Ingham2019-05-231-2/+0
| | | | llvm-svn: 361455
* [WebAssembly] Implement __builtin_return_address for emscriptenThomas Lively2019-05-236-3/+71
| | | | | | | | | | | | | | | | | | | | | Summary: In this patch, `ISD::RETURNADDR` is lowered on the emscripten target to the new Emscripten runtime function `emscripten_return_address`, which implements the functionality. Patch by Guanzhong Chen Reviewers: tlively, aheejin Reviewed By: tlively Subscribers: dschuff, sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62210 llvm-svn: 361454
* [X86] Support -fno-plt __tls_get_addr callsFangrui Song2019-05-232-51/+102
| | | | | | | | | | | | | | | | | In general dynamic/local dynamic TLS models, with -fno-plt, * x86: emit `calll *___tls_get_addr@GOT(%ebx)` instead of `calll ___tls_get_addr@PLT` Note, on x86, if we can get rid of %ebx as the PIC register, it may be better to use a register not preserved across function calls. * x86_64: emit `callq *__tls_get_addr@GOTPCREL(%rip)` instead of `callq __tls_get_addr@PLT` Reorganize the code by separating 32-bit and 64-bit. Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D62106 llvm-svn: 361453
* [libFuzzer] remove the data-flow-trace (DFT) python scripts; their ↵Kostya Serebryany2019-05-234-156/+8
| | | | | | functionality is now part of libFuzzer proper; also write functions.txt to the disk only if this file doesn't exist yet llvm-svn: 361452
* [ARM64][AArch64] Update disassembler attributes to ARMv8.5 ISA with SVE ↵Omair Javaid2019-05-231-3/+3
| | | | | | | | | | extensions This patch updates assembler attributes for AArch64 targets so we can disassemble newer instructions supported in ISA version 8.5 and SVE extensions. Differential Revision: https://reviews.llvm.org/D62235 llvm-svn: 361451
* [llvm-objcopy] Add file names to error messagesSeiya Nuta2019-05-2311-39/+55
| | | | | | | | | | | | | | | | | | | Summary: This patch adds the file names to llvm-objcopy error messages. It makes easy to identify which file causes an error. Bugzilla: https://bugs.llvm.org/show_bug.cgi?id=41798 Reviewers: espindola, alexshap, rupprecht, jhenderson, jakehehrlich Reviewed By: rupprecht, jhenderson, jakehehrlich Subscribers: emaste, arichardson, jakehehrlich, MaskRay, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D61993 llvm-svn: 361450
* gn build: Merge r361418.Peter Collingbourne2019-05-232-0/+2
| | | | llvm-svn: 361449
* [libFuzzer] automatically collect the data flow trace (DFT) in the fork mode ↵Kostya Serebryany2019-05-236-3/+53
| | | | | | if -collect_data_flow= is given llvm-svn: 361448
* Ack, added DWARFTypeUnit to the wrong target...Jim Ingham2019-05-234-12/+10
| | | | | | LLDB -> liblldbcore.a llvm-svn: 361447
* [FileCheck] Introduce substitution subclassesThomas Preud'homme2019-05-236-80/+124
| | | | | | | | | | | | | | | | | | | | Summary: With now a clear distinction between string and numeric substitutions, this patch introduces separate classes to represent them with a parent class implementing the common interface. Diagnostics in printSubstitutions() are also adapted to not require knowing which substitution is being looked at since it does not hinder clarity and makes the implementation simpler. Reviewers: jhenderson, jdenny, probinson, arichardson Subscribers: llvm-commits, probinson, arichardson, hiraditya Tags: #llvm Differential Revision: https://reviews.llvm.org/D62241 llvm-svn: 361446
* FileCheck: Improve FileCheck variable terminologyThomas Preud'homme2019-05-239-189/+196
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Terminology introduced by [[#]] blocks is confusing and does not integrate well with existing terminology. First, variables referred by [[]] blocks are called "pattern variables" while the text a CHECK directive needs to match is called a "CHECK pattern". This is inconsistent with variables in [[#]] blocks since [[#]] blocks are also found in CHECK pattern yet those variables are called "numeric variable". Second, the replacing of both [[]] and [[#]] blocks by the value of the variable or expression they contain is represented by a FileCheckPatternSubstitution class. The naming refers to being a substitution in a CHECK pattern but could be wrongly understood as being a substitution of a pattern variable. Third and lastly, comments use "numeric expression" to refer both to the [[#]] blocks as well as to the numeric expressions these blocks contain which get evaluated at match time. This patch solves these confusions by - calling variables in [[]] and [[#]] blocks as string and numeric variables respectively; - referring to [[]] and [[#]] as substitution *blocks*, with the former being a string substitution block and the latter a numeric substitution block; - calling [[]] and [[#]] blocks to be replaced by the value of a variable or expression they contain a substitution (as opposed to definition when these blocks are used to defined a variable), with the former being a string substitution and the latter a numeric substitution; - renaming the FileCheckPatternSubstitution as a FileCheckSubstitution class with FileCheckStringSubstitution and FileCheckNumericSubstitution subclasses; - restricting the use of "numeric expression" to refer to the expression that is evaluated in a numeric substitution. While numeric substitution blocks only support numeric substitutions of numeric expressions at the moment there are plans to augment numeric substitution blocks to support numeric definitions as well as both a numeric definition and numeric substitution in the same numeric substitution block. Reviewers: jhenderson, jdenny, probinson, arichardson Subscribers: hiraditya, arichardson, probinson, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62146 llvm-svn: 361445
* [lldb] Fix use-of-uninitialized-value in DriverJorge Gorbe Moya2019-05-221-1/+1
| | | | | | | | | | | | The driver passes by reference an uninitialized num_errors variable to RunCommandInterpreter. This should be fine, as it's supposed to be an output argument, but the reproducer instrumentation reads it in order to record the value of all the arguments to the function. This change fixes it by initializing num_errors to 0 before calling RunCommandInterpreter. llvm-svn: 361444
* Expression: correct relocation model for WindowsSaleem Abdulrasool2019-05-221-10/+4
| | | | | | | | | | | The Windows Code Generation model cannot generation code with the PIC relocation model - all code is implicitly position independent due to the DLL load slide that occurs if it is not loaded at the preferred base address. Invert the condition and inline the single use of the variable. This should also aid the WASM target. This significantly improves the state of the (swift) repl on Windows (and should aid in expression evaluation on Windows). llvm-svn: 361443
* [Target] Protect Processes' language runtimes map with a mutexAlex Langford2019-05-222-10/+23
| | | | | | | | | | | | | Summary: From what I understand, it's possible for multiple threads to request a specific language runtime (e.g. CPPLanguageRuntime). This leads to a data race. Reviewers: jingham, JDevlieghere, compnerd, clayborg Differential Revision: https://reviews.llvm.org/D62169 llvm-svn: 361442
* [ORC] Remove a stray decl that accidentally found its way in to r361322.Lang Hames2019-05-221-4/+0
| | | | llvm-svn: 361441
* Actaully lock accesses to OptionValueFileSpecList objectsFrederic Riss2019-05-222-5/+8
| | | | | | | | The patch in r359029 missed a few accessors and mutators. This patch also changes the lock to a recursive one as OptionValueFileSpecList::Clear() can be invoked from some of the other methods. llvm-svn: 361440
* Fix r361428 for Windows buildbots/manglingDavid Blaikie2019-05-221-1/+1
| | | | llvm-svn: 361439
* Fix new enum-codegen.cpp testReid Kleckner2019-05-221-1/+1
| | | | llvm-svn: 361438
* [docs] Make a note of the HowToUseLLJIT example in the ORCv2 design doc.Lang Hames2019-05-221-0/+3
| | | | llvm-svn: 361437
* [Runtimes] If LLVM_INCLUDE_TESTS=On depend on gtestChris Bieneman2019-05-221-0/+2
| | | | | | | | | | | | | | | | Summary: If we are building the tests for the runtimes we should make them depend on gtest so that gtest is built and ready before we run any of the check-* targets. Reviewers: phosek, compnerd Reviewed By: compnerd Subscribers: mgorny, winksaville, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62269 llvm-svn: 361436
* Add a HowToUseLLJIT example project.Lang Hames2019-05-223-0/+85
| | | | | | | A very minimal demo of how to use the LLJIT class, along the lines of the old HowToUseJIT example. llvm-svn: 361435
* TableGen: Handle nontrivial foreach range boundsMatt Arsenault2019-05-229-31/+243
| | | | | | | | | | | | This allows using anything that isn't a literal integer as the bounds for a foreach. Some of the diagnostics aren't perfect, but nobody ever accused tablegen of having good errors. For example, the existing wording suggests a bitrange is valid, but as far as I can tell this has never worked. Fixes bug 41958. llvm-svn: 361434
* Add some notes on immutability and faithfulness to the internals manual.Richard Smith2019-05-221-1/+92
| | | | llvm-svn: 361433
* [runtimes] Move libunwind, libc++abi and libc++ to lib/$target/c++ and ↵Petr Hosek2019-05-2212-32/+53
| | | | | | | | | | | | | | | | | include/c++ This change is a consequence of the discussion in "RFC: Place libs in Clang-dedicated directories", specifically the suggestion that libunwind, libc++abi and libc++ shouldn't be using Clang resource directory. Tools like clangd make this assumption, but this is currently not true for the LLVM_ENABLE_PER_TARGET_RUNTIME_DIR build. This change addresses that by moving the output of these libraries to lib/$target/c++ and include/c++ directories, leaving resource directory only for compiler-rt runtimes and Clang builtin headers. Differential Revision: https://reviews.llvm.org/D59168 llvm-svn: 361432
* [X86] Explcitly disable VEXTRACT instruction matching for an immediate of 0. ↵Craig Topper2019-05-224-145/+10
| | | | | | | | | | | | | | | | | | | | | | Remove a bunch of isel patterns that become unnecessary. We effectively had a second set of isel patterns that tried to use a regular store instruction and an extract_subreg instruction. Or a masked move and an extract_subreg. These patterns were intended to override the matching of VEXTRACT instructions by taking advantage of the priority of the explicit immediate 0 for the index. This patch instaed just disables the immediate 0 matchin the VEXTRACT patterns. This each of the component pieces of the larger patterns will match by themselves. This found a bug of sorts were we didn't use 128-bit store for 512->128 extract on KNL. Its unclear what the right thing here should be. Using the vextract avoids constraining the register allocator to use xmm0-15. But it always results in a longer encoding if the register allocator ends up choosing xmm0-15 anyway. llvm-svn: 361431
* Reverted r361134 because of a failing test left unattended for a long time.Galina Kistanova2019-05-224-10/+14
| | | | | | | | http://lab.llvm.org:8011/builders/llvm-clang-x86_64-expensive-checks-win/builds/17792/steps/test-check-all/logs/stdio Failing Tests (1): LLVM :: CodeGen/AMDGPU/regbank-reassign.mir llvm-svn: 361430
* Add back --sysroot support for darwin header search.James Y Knight2019-05-224-10/+59
| | | | | | | | | | | | | | | | Before e97b5f5cf37e ([clang][Darwin] Refactor header search path logic into the driver), both --sysroot and -isysroot worked to specify where to look for system and C++ headers on Darwin. However, that change caused clang to start ignoring --sysroot. This fixes the regression, and adds tests. (I also note that on all other platforms, clang seems to almost completely ignore -isysroot, but that's another issue...) Differential Revision: https://reviews.llvm.org/D62268 llvm-svn: 361429
* Modules: Code generation of enum constants for merged enum definitionsDavid Blaikie2019-05-222-1/+37
| | | | | | | | | | | | | | | Found in a bootstrap of LLVM with implicit modules, resulting in a deadlock of some Orc unit tests with libstdc++ 8.1. An enum was used as part of the implementation of std::recursive_mutex and this bug resulted in the constant initialization of zero instead of the desired non-zero value. => Badness. Richard Smith tells me neither of these fields are necessarily canonical & so using declaresSamEntity is the right solution here (rather than changing both of these Fields to be canonical by construction/from their source) llvm-svn: 361428
* [asan] Fix debug asan build link errorReid Kleckner2019-05-222-26/+29
| | | | | | | | | | | | Reviewers: dmajor, vitalybuka, waltl Subscribers: kubamracek, #sanitizers, llvm-commits Tags: #sanitizers, #llvm Differential Revision: https://reviews.llvm.org/D61871 llvm-svn: 361427
* Re-land r361206 "[COFF] Store alignment in log2 form, NFC"Reid Kleckner2019-05-228-32/+56
| | | | | | | | | The previous patch lost the call to PowerOf2Ceil, which causes LLD to crash when handling common symbols with a non-power-of-2 size. I tweaked the existing common.test to make the bsspad16 common symbol be 15 bytes to add coverage for this case. llvm-svn: 361426
* [X86][InstCombine] Remove InstCombine code that turns X86 round intrinsics ↵Craig Topper2019-05-227-526/+72
| | | | | | | | | | | | | | | | | | | | | | | into llvm.ceil/floor. Remove some isel patterns that existed because that was happening. We were turning roundss/sd/ps/pd intrinsics with immediates of 1 or 2 into llvm.floor/ceil. The llvm.ceil/floor intrinsics are supposed to correspond to the libm functions. For the libm functions we need to disable the precision exception so the llvm.floor/ceil functions should always map to encodings 0x9 and 0xA. We had a mix of isel patterns where some used 0x9 and 0xA and others used 0x1 and 0x2. We need to be consistent and always use 0x9 and 0xA. Since we have no way in isel of knowing where the llvm.ceil/floor came from, we can't map X86 specific intrinsics with encodings 1 or 2 to it. We could map 0x9 and 0xA to llvm.ceil/floor instead, but I'd really like to see a use case and optimization advantage first. I've left the backend test cases to show the blend we now emit without the extra isel patterns. But I've removed the InstCombine tests completely. llvm-svn: 361425
* Part of P1091R3: permit structured bindings to be declared 'static' andRichard Smith2019-05-227-11/+105
| | | | | | 'thread_local' in C++20. llvm-svn: 361424
* [X86] Add more icelake model numbers to compiler-rt implementation of ↵Craig Topper2019-05-221-0/+8
| | | | | | | | | __builtin_cpu_is. Using model numbers found in Table 2-1 of the May 2019 version of the Intel Software Developer's Manual Volume 4. llvm-svn: 361423
* [X86] Add more icelake model numbers to getHostCPUName.Craig Topper2019-05-221-0/+8
| | | | | | | Using model numbers found in Table 2-1 of the May 2019 version of the Intel Software Developer's Manual Volume 4. llvm-svn: 361422
* [OPENMP][NVPTX]Fix barriers and parallel level counters, NFC.Alexey Bataev2019-05-223-3/+6
| | | | | | | | | | | | | | | | | | | | | Summary: Parallel level counter should be volatile to prevent some dangerous optimiations by the ptxas. Otherwise, ptxas optimizations lead to undefined behaviour in some cases. Also, use __threadfence() for #pragma omp flush and if the barrier should not be used (we have only one thread in the team), still perform flush operation since the standard requires implicit flush when executing barriers. Reviewers: gtbercea, kkwli0, grokos Subscribers: guansong, jfb, jdoerfert, openmp-commits, caomhin Tags: #openmp Differential Revision: https://reviews.llvm.org/D62199 llvm-svn: 361421
* Add DWARFTypeUnit to the Xcode project.Jim Ingham2019-05-221-0/+6
| | | | llvm-svn: 361420
* gn build: Fix check-clangd target after r359825Nico Weber2019-05-221-1/+1
| | | | llvm-svn: 361419
* [clang-tidy] Add support for writing a check as a Transformer rewrite rule.Yitzhak Mandelbaum2019-05-225-0/+184
| | | | | | | | | | | | | | | | | | | | | | | | This revision introduces an adaptor from Transformer's rewrite rules (`clang::tooling::RewriteRule`) to `ClangTidyCheck`. For example, given a RewriteRule `MyCheckAsRewriteRule`, it lets one define a tidy check as follows: ``` class MyTidyCheck : public TransformerClangTidyCheck { public: MyTidyCheck(StringRef Name, ClangTidyContext *Context) : TransformerClangTidyCheck(MyCheckAsRewriteRule, Name, Context) {} }; ``` Reviewers: aaron.ballman Subscribers: mgorny, xazax.hun, cfe-commits, ilya-biryukov Tags: #clang Differential Revision: https://reviews.llvm.org/D61386 llvm-svn: 361418
* [DebugInfo][AArch64] Recognise target specific instruction as mov instrAlexey Lapshin2019-05-223-0/+271
| | | | | | | | | | | | | | This fix is for the problem from https://bugs.llvm.org/show_bug.cgi?id=38714. Specifically, Simple Register Coalescing creates following conversion : undef %0.sub_32:gpr64 = ORRWrs $wzr, %3:gpr32common, 0, debug-location !24; It copies 32-bit value from gpr32 into gpr64. But Live DEBUG_VALUE analysis is not able to create debug location record for that instruction. So the problem is in that debug info for argc variable is incorrect. The fix is to write custom isCopyInstrImpl() which would recognize the ORRWrs instr. llvm-svn: 361417
* [PGO][CHR] Speed up following long use-def chains.Hiroshi Yamauchi2019-05-222-9/+336
| | | | | | | | | | | | | | | | Summary: Avoid visiting an instruction more than once by using a map. Reviewers: davidxl Reviewed By: davidxl Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D62262 llvm-svn: 361416
* [NFC][InstCombine] Add unary fneg tests to maxnum.ll/minnum.llCameron McInally2019-05-222-0/+129
| | | | llvm-svn: 361415
* [libcxx][test] Fix order checking in some more unordered_multimap testsLouis Dionne2019-05-2224-858/+643
| | | | | | | | | | | | | | | | Some tests assume that iteration through an unordered multimap elements will return them in the same order as at the container creation. This assumption is not true since the container is unordered, so that no specific order of elements is ever guaranteed for such container. This patch is a continuation of D54838 and introduces checks verifying that any iteration will return elements exactly from a set of valid values and without repetition, but in no particular order. Thanks to Andrey Maksimov for the patch. Differential Revision: https://reviews.llvm.org/D56498 llvm-svn: 361414
* [LibTooling] Update Stencil to use RangeSelectorYitzhak Mandelbaum2019-05-223-67/+55
| | | | | | | | | | | | | | | | | | | Add support for creating a `StencilPart` from any `RangeSelector`, which broadens the scope of `Stencil`. Correspondingly, deprecate Stencil's specialized combinators `node` and `sNode` in favor of using the new `selection` combinator directly (with the appropriate range selector). Reviewers: sbenza Subscribers: cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D62160 llvm-svn: 361413
* [EditLine] Rewrite GetHistoryFilePathJonas Devlieghere2019-05-221-13/+18
| | | | | | | | | | | | | | | | | | | | Rewrite the GetHistoryFilePath implementation without relying on FileSpec in the spirit of our discussion in D61994. It changes LLDBs behavior in two ways: 1. We now only use the -widehistory suffix when LLDB is built with wchar support, instead of as the fallback from when the ~/.lldb directory isn't writable. 2. When the ~/.lldb directory isn't writable, we don't write any history files at all. Previously we would write them to the user's home directory (with the incorrect wide suffix), polluting ~ with a different file for every IO handler. Differential revision: https://reviews.llvm.org/D62216 llvm-svn: 361412
* Fixed a -Wunused-variable warning when assertions are disabledDmitri Gribenko2019-05-221-0/+1
| | | | llvm-svn: 361411
OpenPOWER on IntegriCloud