summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Fixed the lld test using ld-lld command to use ld.lld instead.Rumeet Dhindsa2019-03-281-2/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D59962 llvm-svn: 357216
* [BPF] add proper multi-dimensional array supportYonghong Song2019-03-289-111/+118
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For multi-dimensional array like below int a[2][3]; the previous implementation generates BTF_KIND_ARRAY type like below: . element_type: int . index_type: unsigned int . number of elements: 6 This is not the best way to represent arrays, esp., when converting BTF back to headers and users will see int a[6]; instead. This patch generates proper support for multi-dimensional arrays. For "int a[2][3]", the two BTF_KIND_ARRAY types will be generated: Type #n: . element_type: int . index_type: unsigned int . number of elements: 3 Type #(n+1): . element_type: #n . index_type: unsigned int . number of elements: 2 The linux kernel already supports such a multi-dimensional array representation properly. Signed-off-by: Yonghong Song <yhs@fb.com> Differential Revision: https://reviews.llvm.org/D59943 llvm-svn: 357215
* [MC] Fix floating-point literal lexing.Eli Friedman2019-03-284-45/+87
| | | | | | | | | | | | | | | | | | | | | This patch has three related fixes to improve float literal lexing: 1. Make AsmLexer::LexDigit handle floats without a decimal point more consistently. 2. Make AsmLexer::LexFloatLiteral print an error for floats which are apparently missing an "e". 3. Make APFloat::convertFromString use binutils-compatible exponent parsing. Together, this fixes some cases where a float would be incorrectly rejected, fixes some cases where the compiler would crash, and improves diagnostics in some cases. Patch by Brandon Jones. Differential Revision: https://reviews.llvm.org/D57321 llvm-svn: 357214
* [SelectionDAGBuilder] Fix 80 column violation. NFCCraig Topper2019-03-281-1/+2
| | | | llvm-svn: 357213
* [InterleavedAccessPass] Don't increase the number of bytes loaded.Eli Friedman2019-03-282-9/+28
| | | | | | | | | | | | | | | | | Even if the interleaving transform would otherwise be legal, we shouldn't introduce an interleaved load that is wider than the original load: it might have undefined behavior. It might be possible to perform some sort of mask-narrowing transform in some cases (using a narrower interleaved load, then extending the results using shufflevectors). But I haven't tried to implement that, at least for now. Fixes https://bugs.llvm.org/show_bug.cgi?id=41245 . Differential Revision: https://reviews.llvm.org/D59954 llvm-svn: 357212
* Revert [DSE] Preserve basic block ordering using OrderedBasicBlock.Florian Hahn2019-03-283-61/+39
| | | | | | | | | | | | This reverts r357208 (git commit c0bfd37d385c93711ef3a349599dba20e6b101ef) This causes a buildbot failure: http://lab.llvm.org:8011/builders/clang-with-thin-lto-ubuntu/builds/16124 FAILED: lib/IR/CMakeFiles/LLVMCore.dir/IRBuilder.cpp.o /home/buildslave/ps4-buildslave1/clang-with-thin-lto-ubuntu/install/stage2/bin/clang++ -DGTEST_HAS_RTTI=0 -D_DEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -Ilib/IR -I/home/buildslave/ps4-buildslave1/clang-with-thin-lto-ubuntu/llvm.src/lib/IR -Iinclude -I/home/buildslave/ps4-buildslave1/clang-with-thin-lto-ubuntu/llvm.src/include -fPIC -fvisibility-inlines-hidden -Werror -Werror=date-time -Werror=unguarded-availability-new -std=c++11 -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wmissing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wcovered-switch-default -Wno-noexcept-type -Wnon-virtual-dtor -Wdelete-non-virtual-dtor -Wstring-conversion -fdiagnostics-color -ffunction-sections -fdata-sections -flto=thin -O3 -UNDEBUG -fno-exceptions -fno-rtti -MD -MT lib/IR/CMakeFiles/LLVMCore.dir/IRBuilder.cpp.o -MF lib/IR/CMakeFiles/LLVMCore.dir/IRBuilder.cpp.o.d -o lib/IR/CMakeFiles/LLVMCore.dir/IRBuilder.cpp.o -c /home/buildslave/ps4-buildslave1/clang-with-thin-lto-ubuntu/llvm.src/lib/IR/IRBuilder.cpp clang-9: /home/buildslave/ps4-buildslave1/clang-with-thin-lto-ubuntu/llvm.src/lib/Analysis/OrderedBasicBlock.cpp:38: bool llvm::OrderedBasicBlock::comesBefore(const llvm::Instruction *, const llvm::Instruction *): Assertion `!(LastInstFound == BB->end() && NextInstPos != 0) && "Instruction supposed to be in NumberedInsts"' failed. llvm-svn: 357211
* Fix for regression test, since we rely on the formatter for std::vector in ↵Shafik Yaghmour2019-03-281-0/+1
| | | | | | | | the test we need a libc++ category. See differential https://reviews.llvm.org/D59847 for initial change that this fixes llvm-svn: 357210
* Apply include-what-you-use #include removal suggestions. NFC.Michael Kruse2019-03-2866-491/+45
| | | | | | | | | | | | This removes unused includes (and forward declarations) as suggested by include-what-you-use. If a transitive include of a removed include is required to compile a file, I added the required header (or forward declaration if suggested by include-what-you-use). This should reduce compilation time and reduce the number of iterative recompilations when a header was changed. llvm-svn: 357209
* [DSE] Preserve basic block ordering using OrderedBasicBlock.Florian Hahn2019-03-283-39/+61
| | | | | | | | | | | | | | | | By extending OrderedBB to allow removing and replacing cached instructions, we can preserve OrderedBBs in DSE easily. This eliminates one source of quadratic compile time in DSE. Fixes PR38829. Reviewers: rnk, efriedma, hfinkel Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D59789 llvm-svn: 357208
* Fix the swig typemap for "uint32_t *versions, uint32_t num_versions".Jim Ingham2019-03-283-10/+272
| | | | | | | | | It was making a list of a certain size but not always filling in that many elements, which would lead to a crash iterating over the list. Differential Revision: https://reviews.llvm.org/D59913 llvm-svn: 357207
* [MemDepAnalysis] Allow caller to pass in an OrderedBasicBlock.Florian Hahn2019-03-282-23/+29
| | | | | | | | | | | | | If the caller can preserve the OBB, we can avoid recomputing the order for each getDependency call. Reviewers: efriedma, rnk, hfinkel Reviewed By: rnk Differential Revision: https://reviews.llvm.org/D59788 llvm-svn: 357206
* [OPENMP]Add check for undefined behavior with thread allocators onAlexey Bataev2019-03-2858-115/+655
| | | | | | | | | | | | target and task-based directives. According to OpenMP 5.0, 2.11.4 allocate Clause, Restrictions, For task, taskloop or target directives, allocation requests to memory allocators with the trait access set to thread result in unspecified behavior. Patch introduces a check for omp_thread_mem_alloc predefined allocator on target- and trask-based directives. llvm-svn: 357205
* [SLP][X86] Add tests showing failure to commute icmp/fcmp by swapping predicateSimon Pilgrim2019-03-281-0/+196
| | | | | | By swapping icmp/fcmp predicates we can commute their operands to improve vectorization llvm-svn: 357204
* [pstl] Uglify internal names of the libraryLouis Dionne2019-03-2823-2471/+2627
| | | | llvm-svn: 357203
* [SLP][X86] Add tests showing failure to commute icmp/fcmp operandsSimon Pilgrim2019-03-281-0/+199
| | | | | | Some predicates are fully commutative - we should be able to easily commute their operands to improve vectorization llvm-svn: 357202
* Temporarily revert "SafepointIRVerifier port to new Pass Manager"Adrian Prantl2019-03-284-25/+0
| | | | | | | | | | | to unbreak the modular bots and its follow-up commit. This reverts commit https://reviews.llvm.org/D59825 because it introduced a fatal error: cyclic dependency in module 'LLVM_intrinsic_gen': LLVM_intrinsic_gen -> LLVM_IR -> LLVM_intrinsic_gen llvm-svn: 357201
* [COFF] Optimize range extension thunk insertion memory usageReid Kleckner2019-03-285-53/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This avoids allocating O(#relocs) of intermediate data for each section when range extension thunks aren't needed for that section. This also removes a std::vector from SectionChunk, which further reduces its size. Instead, this change adds the range extension thunk symbols to the object files that contain sections that need extension thunks. By adding them to the symbol table of the parent object, that means they now have a symbol table index. Then we can then modify the original relocation, after copying it to read-write memory, to use the new symbol table index. This makes linking browser_tests.exe with no PDB 10.46% faster, moving it from 11.364s to 10.288s averaged over five runs. Reviewers: mstorsjo, ruiu Subscribers: aganea, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59902 llvm-svn: 357200
* [llvm-objcopy][NFC] Move ELF-specific logic into /ELF/ directoryJordan Rupprecht2019-03-283-39/+47
| | | | llvm-svn: 357199
* [NFC] find_first_of/find_last_of -> find/rfind for single char.Jonas Devlieghere2019-03-284-6/+5
| | | | | | | | | For a single char argument, find_first_of is equal to find and find_last_of is equal to rfind. While playing around with the plugin stuff this caused an export failure because it always got inlined except once, which resulted in an undefined symbol. llvm-svn: 357198
* [Driver] Default Android toolchains to noexecstack.Dan Albert2019-03-289-3/+41
| | | | | | | | | | | | | | Android does not support executable stacks. Reviewers: srhines, pirama Reviewed By: pirama Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D53343 llvm-svn: 357197
* [X86] Teach the isel optimization for (x << C1) op C2 to (x op (C2>>C1)) << ↵Craig Topper2019-03-282-30/+36
| | | | | | | | | | | | C1 to consider cases where C2>>C1 can fit an unsigned 32-bit immediate For 64-bit operations we should consider if the immediate can be made to fit in an unsigned 32-bits immedate. For OR/XOR this allows us to load the immediate with MOV32ri instead of movabsq. For AND this allows us to fold the immediate. Differential Revision: https://reviews.llvm.org/D59867 llvm-svn: 357196
* [WebAssembly] Reland of rL356953 (4dcf3acce6)Sam Clegg2019-03-284-9/+31
| | | | | | | | | The previous patch was missing GetProgramPath() in the return value of getLinkerPath(). See https://reviews.llvm.org/D59743 llvm-svn: 357195
* Create an instance of Target after reading all input files. NFC.Rui Ueyama2019-03-285-19/+26
| | | | | | | | This change itself doesn't mean anything, but it helps D59780 because in patch, we don't know whether we need to create a CET-aware PLT or not until we read all input files. llvm-svn: 357194
* Make a member function a non-member function.Rui Ueyama2019-03-281-6/+2
| | | | | | | Since this member function doesn't use anything in the class, it doesn't have to be a member of the class. llvm-svn: 357193
* Delay initialization of three static global maps, NFCReid Kleckner2019-03-282-79/+79
| | | | | | | This avoids allocating a few KB of heap memory on startup, and instead allocates these maps lazily. I noticed this while profiling LLD. llvm-svn: 357192
* De-template X86_64TargetInfo. NFC.Rui Ueyama2019-03-283-90/+54
| | | | llvm-svn: 357191
* Fix PR#35967: '<regex> syntax_option_type is not a proper bitmask' Sadly, ↵Marshall Clow2019-03-284-13/+51
| | | | | | this is an ABI break, so it's only available if you define either '_LIBCPP_ABI_VERSION > 2' or '_LIBCPP_ABI_UNSTABLE' or '_LIBCPP_ABI_REGEX_CONSTANTS_NONZERO' and rebuild your dylib. llvm-svn: 357190
* [pstl] Introduce forward declarationsLouis Dionne2019-03-2810-8/+1372
| | | | | | | | | | | | | | | | | Necessary when pstl is included from with <algorithm> and <numeric> to prevent a partially declared standard library when pstl itself uses algorithms from <algorithm> and <numeric>. Also, this patch makes sure that configuration comes via standard headers. Directly including pstl_config.h in implementation files is incompatible with inclusion of pstl into a standard library implementation which provides it's own library wide configuration and may configure the library differently to the pstl_config.h used by the standalone implementation. Differential Revision: https://reviews.llvm.org/D59122 llvm-svn: 357189
* Regression test to ensure that we handling importing of std::vector of enums ↵Shafik Yaghmour2019-03-283-0/+47
| | | | | | | | | | | correctly Summary: https://reviews.llvm.org/D59845 added a fix for the IsStructuralMatch(...) specialization for EnumDecl this test should pass once this fix is committed. Differential Revision: https://reviews.llvm.org/D59847 llvm-svn: 357188
* Make helper functions static. NFC.Benjamin Kramer2019-03-285-12/+15
| | | | llvm-svn: 357187
* Disable warnings when indexing as a standalone action.Sam McCall2019-03-282-0/+29
| | | | | | | | | | | | | | | | | | | Summary: - we don't record the warnings at all - we don't want to stop indexing if we hit error-limit due to warnings - this allows some analyses to be skipped which can save some CPU https://github.com/clangd/clangd/issues/24 Reviewers: hokein Subscribers: ilya-biryukov, ioeric, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59935 llvm-svn: 357186
* Make TargetInfo const. NFC.Rui Ueyama2019-03-282-4/+4
| | | | | | | We do not mutate a TargetInfo instance after creating it. This change makes it explicit. llvm-svn: 357185
* [CodeGen] Add additional mangling for struct members of non trivial structsShoaib Meenai2019-03-283-18/+63
| | | | | | | | | | | | | In https://bugs.llvm.org/show_bug.cgi?id=41206 we observe bad codegen when embedding a non-trivial C struct within a C struct. This is due to the fact that name mangling for non-trivial structs marks the two structs as identical. This diff contains a fix for this issue. Patch by Dan Zimmerman <daniel.zimmerman@me.com>. Differential Revision: https://reviews.llvm.org/D59873 llvm-svn: 357184
* [MIPS GlobalISel] Select float constantsPetar Avramovic2019-03-287-4/+275
| | | | | | | | Select 32 and 64 bit float constants for MIPS32. Differential Revision: https://reviews.llvm.org/D59933 llvm-svn: 357183
* gn build: Add some build files for clangdNico Weber2019-03-287-2/+181
| | | | | | | | | | | | | | Enough to build the clangd binaries, but this is still missing build files for: - fuzzer - indexer - index/dex/dexp - benchmarks - xpc Differential Revision: https://reviews.llvm.org/D59899 llvm-svn: 357182
* [libc++] Remove unnecessary <iostream> #includes in testsLouis Dionne2019-03-2825-46/+4
| | | | | | | Some tests #include <iostream> but they don't use anything from the header. Those are probably artifacts of when the tests were developped. llvm-svn: 357181
* Add "git llvm revert" and "git llvm svn-lookup" subcommandsJordan Rupprecht2019-03-281-3/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The current git-svnrevert script only works with git-svn repos (e.g. using "git svn find-rev" to find the commit to revert). This adds a similar implementation that works with the llvm git command handler. Usage: ``` // Revert by svn id $ git llvm revert r123456 // See what commands would be run instead of actually reverting $ git llvm revert -n r123456 <full git revert + git commit commands> // Git commit hash also fine $ git llvm revert abc123456 // For convenience, the git->svn method can be used directly: $ git llvm svn-lookup abc123456 r123456 // Push revert upstream (drop the -n when ready) $ git llvm push -n ``` Regardless of how the command is invoked (with a svn revision or git hash), the message is: ``` Revert [LibFoo] Change Foo implementation This reverts r123456 (git commit abc123) ``` Reviewers: jyknight, mehdi_amini, jlebar Reviewed By: jlebar Subscribers: llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59837 llvm-svn: 357180
* [DAG] Fix Lifetime Node ID hashing.Nirav Dave2019-03-282-2/+10
| | | | llvm-svn: 357179
* [DAGCombiner] fold sext into negationSanjay Patel2019-03-284-49/+49
| | | | | | | | | | | | | | As noted in D59818: %z = zext i8 %x to i32 %neg = sub i32 0, %z %r = sext i32 %neg to i64 => %z2 = zext i8 %x to i64 %r = sub i64 0, %z2 https://rise4fun.com/Alive/KzSR llvm-svn: 357178
* [x86] add vector test for sext of negate; NFCSanjay Patel2019-03-281-0/+86
| | | | llvm-svn: 357177
* [AMDGPU] Clarify Code Object V2/V3 differences in AMDGPUUsageScott Linder2019-03-281-25/+128
| | | | | | | | | | | | Ensure Code Object V2 documentation is complete, but always contains a warning and a link to the equivalent Code Object V3 documentation. Explicitly indicate that any note records present in a code object that are not documented must be considered deprecated and ignored. Differential Revision: https://reviews.llvm.org/D59782 llvm-svn: 357176
* [clangd] Update error message to fix tests after r357173Sam McCall2019-03-281-3/+3
| | | | llvm-svn: 357175
* [Documentation] Proposal to change variable namesMichael Platings2019-03-282-0/+403
| | | | | | Differential Revision: https://reviews.llvm.org/D59251 llvm-svn: 357174
* [clangd] Support UTF-32 (i.e. codepoint) offsets.Sam McCall2019-03-284-54/+171
| | | | | | | | | | | | | | | | Summary: (Changes to UTF-8/UTF-16 here are NFC, moving things around to make the cases more symmetrical) Reviewers: ilya-biryukov Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D59927 llvm-svn: 357173
* [x86] avoid cmov in movmsk reductionSanjay Patel2019-03-283-338/+272
| | | | | | | | | | | | | | | | | | | | | | This is probably the least important of our movmsk problems, but I'm starting at the bottom to reduce distractions. We were creating a select_cc which bypasses the select and bitmask codegen optimizations that we have now. If we produce a compare+negate instead, we allow things like neg/sbb carry bit hacks, and in all cases we avoid a cmov. There's no partial register update danger in these sequences because we always produce the zero-register xor ahead of the 'set' if needed. There seems to be a missing fold for sext of a bool bit here: negl %ecx movslq %ecx, %rax ...but that's an independent transform. Differential Revision: https://reviews.llvm.org/D59818 llvm-svn: 357172
* [X86MacroFusion] Handle branch fusion (AMD CPUs).Clement Courbet2019-03-287-81/+161
| | | | | | | | | | | | | | | | | | Summary: This adds a BranchFusion feature to replace the usage of the MacroFusion for AMD CPUs. See D59688 for context. Reviewers: andreadb, lebedev.ri Subscribers: hiraditya, jdoerfert, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D59872 llvm-svn: 357171
* AMDGPU: Make exec mask optimzations more resistant to block splitsMatt Arsenault2019-03-284-31/+200
| | | | | | | Also improve the check for SALU instructions to also ignore implicit_def and other fake instructions. llvm-svn: 357170
* [X86] AMD Piledriver (BdVer2): fine-tune some latenciesRoman Lebedev2019-03-2813-225/+247
| | | | | | | | | | | | | | Based on llvm-exegesis measurements. Now that llvm-exegesis is ~2 magnitudes faster, and is a bit smarter, it is now possible to continue cleanup of the scheduler model. With this, there are no more latency inconsistencies for the opcodes that produce stable measurements, and only a few inconsistencies for unstable measurements (MMX_* opcodes, opcodes that llvm-exegesis measures by chaining - CMP, TEST, BT, SETcc, CVT, MOV, etc.) llvm-svn: 357169
* [NFC] Format InlineFeatureIgnoreList.Clement Courbet2019-03-281-51/+52
| | | | | | To avoid more spurious clang-format changes when adding features (D59872). llvm-svn: 357168
* [Analyzer] Constraint Manager - Calculate Effective Range for DifferencesAdam Balogh2019-03-283-6/+44
| | | | | | | | | | | | | | | | | | | | | Since rL335814, if the constraint manager cannot find a range set for `A - B` (where `A` and `B` are symbols) it looks for a range for `B - A` and returns it negated if it exists. However, if a range set for both `A - B` and `B - A` is stored then it only returns the first one. If we both use `A - B` and `B - A`, these expressions behave as two totally unrelated symbols. This way we miss some useful deductions which may lead to false negatives or false positives. This tiny patch changes this behavior: if the symbolic expression the constraint manager is looking for is a difference `A - B`, it tries to retrieve the range for both `A - B` and `B - A` and if both exists it returns the intersection of range `A - B` and the negated range of `B - A`. This way every time a checker applies new constraints to the symbolic difference or to its negated it always affects both the original difference and its negated. Differential Revision: https://reviews.llvm.org/D55007 llvm-svn: 357167
OpenPOWER on IntegriCloud