summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* [MC] Don't emit .symver redirected symbols to the symbol tableFangrui Song2019-08-198-170/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GNU as keeps the original symbol in the symbol table for defined @ and @@, but suppresses it in other cases (@@@ or undefined). The original symbol is usually undesired: In a shared object, the original symbol can be localized with a version script, but it is hard to remove/localize in an archive: 1) a post-processing step removes the undesired original symbol 2) consumers (executable) of the archive are built with the version script Moreover, it can cause linker issues like binutils PR/18703 if the original symbol name and the base name of the versioned symbol is the same (both ld.bfd and gold have some code to work around defined @ and @@). In lld, if it sees f and f@v1: --version-script =(printf 'v1 {};') => f and f@v1 --version-script =(printf 'v1 { f; };') => f@v1 and f@@v1 It can be argued that @@@ added on 2000-11-13 corrected the @ and @@ mistake. This patch catches some more multiple version errors (defined @ and @@), and consistently suppress the original symbol. This addresses all the problems listed above. If the user wants other aliases to the versioned symbol, they can copy the original symbol to other symbol names with .set directive, e.g. .symver f, f@v1 # emit f@v1 but not f into .symtab .set f_impl, f # emit f_impl into .symtab llvm-svn: 369233
* [X86] Teach lower1BitShuffle to match right shifts with upper zero elements ↵Craig Topper2019-08-192-34/+28
| | | | | | | | | | on types that don't natively support KSHIFT. We can support these by widening to a supported type, then shifting all the way to the left and then back to the right to ensure that we shift in zeroes. llvm-svn: 369232
* [llvm-objcopy][MachO] Implement a layout algorithm for executablesSeiya Nuta2019-08-192-20/+337
| | | | | | | | | | | | | | | | Summary: The layout algorithm for relocatable objects and for executable are somewhat different. This patch implements the latter one based on the algorithm in LLD (MachOFileLayout). Reviewers: alexshap, rupprecht, jhenderson Reviewed By: alexshap Subscribers: jakehehrlich, abrachet, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D65539 llvm-svn: 369231
* [llvm-objcopy][MachO] Support load commands used in executables/shared librariesSeiya Nuta2019-08-199-210/+560
| | | | | | | | | | | | | | | | | | | Summary: This patch implements copying some load commands that appear in executables/shared libraries such as the indirect symbol table. I don't add tests intentionally because this patch is incomplete: we need a layout algorithm for executables/shared libraries. I'll submit it as a separate patch with tests. Reviewers: alexshap, rupprecht, jhenderson, compnerd Reviewed By: alexshap Subscribers: abrachet, mgorny, mgrang, MaskRay, mtrent, jakehehrlich, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D63395 llvm-svn: 369230
* [clangd] Update features table in the docs with links to LSP extension proposalsNathan Ridge2019-08-191-51/+55
| | | | | | | | | | | | | | | Also update the semantic coloring entry to reflect it being supported in clangd now. Reviewers: sammccall Subscribers: ilya-biryukov, MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D65373 llvm-svn: 369229
* [X86] Fix the lower1BitShuffle code added in r369215 to correctly pass the ↵Craig Topper2019-08-191-1/+1
| | | | | | | | | | widened vector to the KSHIFT node. Not sure how to test this as we have tests that exercise this code, but nothing failed for the types not matching. Since all the k-registers use equivalent register classes everything just ends up working. llvm-svn: 369228
* [X86] Teach lower1BitShuffle to match KSHIFTR that doesn't use Zeroable and ↵Craig Topper2019-08-192-6/+51
| | | | | | | | | | | only relies on undef. This allows us to widen the type when the KSHIFTR instruction doesn't exist for the type. If we need to shift in zeroes into the upper elements we would need more work to guarantee zeroes when widening. llvm-svn: 369227
* [X86] Teach lower1BitShuffle to recognize padding a subvector with zeros ↵Craig Topper2019-08-192-11/+16
| | | | | | | | | with V2 as the source and V1 as the zero vector. Shuffle canonicalization can swap the sources so the zero vector might be V1 and the subvector that's being padded can be V2. llvm-svn: 369226
* [X86] Add test case for missed opportunity to recognize a vXi1 shuffle as an ↵Craig Topper2019-08-191-0/+18
| | | | | | | | | | insert into a zero vector. We are currently missing this because shuffle canonicalization puts the zero vector as V1 and the subvector as V2. Our current code doesn't recognize this case. llvm-svn: 369225
* [X86] Add a special case to LowerCONCAT_VECTORSvXi1 to handle concatenating ↵Craig Topper2019-08-182-20/+33
| | | | | | | | | | zero vectors followed by one non-zero vector followed by undef vectors. For such a case we should only need a KSHIFTL, but we were previously generating a KSHIFTL followed by a KSHIFTR because we mistakenly believed we need to zero the undef elements. llvm-svn: 369224
* [X86] Add test cases for suboptimal insertion of a vXi1 vector into a larger ↵Craig Topper2019-08-181-0/+39
| | | | | | | | | vector with zeros in the lower elements and undef upper elements. Currently we generate kshifts to clear both the upper and lower elements, but we only need one kshift. llvm-svn: 369223
* [X86] Replace uses of getZeroVector for vXi1 vectors with DAG.getConstant.Craig Topper2019-08-181-4/+4
| | | | | | vXi1 vectors don't need special handling. llvm-svn: 369222
* [cmake] Move blocks out of redundant else( MSVC ); NFCHubert Tong2019-08-181-61/+60
| | | | | | | | Address post-commit comment on D66256 regarding the `else( MSVC )` block containing only blocks guarded with `LLVM_COMPILER_IS_GCC_COMPATIBLE`, which would imply `NOT MSVC`. llvm-svn: 369221
* [CMake] Update CMAKE_OSX_DEPLOYMENT_TARGET to 10.12.Jonas Devlieghere2019-08-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | After LLVM moved to C++14, the RWMutex implementation was removed in favor of std::shared_timed_mutex, which is only available on macOS 10.12 and later. As a workaround for older deployment targets, I added the original RWMutexImpl again, guarded by the deployment target. When doing a standalone build of LLDB using the Xcode generator, the CMake cache specifies a minimum deployment target. However, LLVM and Clang might have been built with a different minimum deployment target. This is exactly what happened for the Xcode build. LLVM was built with a minimum deployment target newer than 10.12, using std::shared_timed_mutex. LLDB on the other hand was built with a minimum deployment target of 10.11, using the old RWMutexImpl, resulting in undefined symbols at link-time. This patch changes the minimum deployment target for the Xcode build to 10.12 to work around this problem. A better solution would involve synchronizing the minimum deployment or even not setting one at all. llvm-svn: 369220
* [ORC] Make sure we linker-mangle symbol names in the SpeculationLayer.Lang Hames2019-08-182-7/+8
| | | | | | If mangling is not performed then speculative lookups will fail. llvm-svn: 369219
* [ORC] Remove some dead code.Lang Hames2019-08-181-9/+0
| | | | llvm-svn: 369218
* [Diagnostics] Diagnose misused xor as powDavid Bolvansky2019-08-184-1/+220
| | | | | | | | | | | | | | | | | | | | Summary: Motivation: https://twitter.com/jfbastien/status/1139298419988549632 https://twitter.com/mikemx7f/status/1139335901790625793 https://codesearch.isocpp.org/cgi-bin/cgi_ppsearch?q=10+%5E&search=Search Reviewers: jfb, rsmith, regehr, aaron.ballman Reviewed By: aaron.ballman Subscribers: lebedev.ri, Quuxplusone, erik.pilkington, riccibruno, dexonsmith, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D63423 llvm-svn: 369217
* [Docs] Test commitDeForest Richards2019-08-181-1/+1
| | | | | | Fixes typo - Removes extra space between last word of sentence and period. llvm-svn: 369216
* [X86] Improve lower1BitShuffle handling for KSHIFTL on narrow vectors.Craig Topper2019-08-182-43/+39
| | | | | | | We can insert the value into a larger legal type and shift that by the desired amount. llvm-svn: 369215
* [clang-format] Fix a bug that joins template closer and =Owen Pan2019-08-184-6/+13
| | | | | | | | | | Also fixes the documentation for SpaceBeforeAssignmentOperators. See discussions at https://reviews.llvm.org/D66332 Differential Revision: https://reviews.llvm.org/D66384 llvm-svn: 369214
* Fix signed/unsigned comparison warning. NFCI.Simon Pilgrim2019-08-181-2/+2
| | | | llvm-svn: 369213
* [X86] isTargetShuffleEquivalent - add BUILD_VECTOR matchingSimon Pilgrim2019-08-182-15/+32
| | | | | | | | | | Add similar functionality to isShuffleEquivalent - if the mask elements don't match, try matching the BUILD_VECTOR scalars instead. As target shuffles need to handle SM_Sentinel values, this can get a bit tricky, so commit just adds actual mask element index handling - full SM_SentinelZero support will be added when the need arises. Also, enables support in matchVectorShuffleWithPACK llvm-svn: 369212
* [X86] isTargetShuffleEquivalent - early out on illegal shuffle masks. NFCI.Simon Pilgrim2019-08-181-8/+10
| | | | | | Simplifies shuffle mask comparisons by just bailing out if the shuffle mask has any out of range values - will make an upcoming patch much simpler. llvm-svn: 369211
* [X86][SSE] Improve PACKSS shuffle tests to better match codegen from D61129Simon Pilgrim2019-08-181-22/+86
| | | | | | D61129 creates 'concat + trunc' style patterns (at the 128-bit subvector level) llvm-svn: 369209
* [MC] MCFixup - Fix cppcheck + MSVC analyzer uninitialized member variable ↵Simon Pilgrim2019-08-181-3/+3
| | | | | | warnings. NFCI. llvm-svn: 369208
* [InstCombine] Cherry-pick NFC cleanups of ↵Roman Lebedev2019-08-181-5/+8
| | | | | | foldShiftIntoShiftInAnotherHandOfAndInICmp() from D66383 llvm-svn: 369207
* [Diagnostics] Improve -Wsizeof-pointer-divDavid Bolvansky2019-08-183-10/+26
| | | | | | | Emit diag note with a location of pointer declaration. Revisited/added tests. llvm-svn: 369206
* [TargetLowering] Teach computeRegisterProperties to only widen v3i16/v3f16 ↵Craig Topper2019-08-185-66/+195
| | | | | | | | | | | | | | | | | | | | | vectors to the next power of 2 type if that's legal. These were recently made simple types. This restores their behavior back to something like their EVT legalization. We might be able to fix the code in type legalization where the assert was failing, but I didn't investigate too much as I had already looked at the computeRegisterProperties code during the review for v3i16/v3f16. Most of the test changes restore the X86 codegen back to what it looked like before the recent change. The test case in vec_setcc.ll and is a reduced version of the reproducer from the fuzzer. Fixes https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=16490 llvm-svn: 369205
* [SelectionDAG] Add a node creation debug message to getMachineNode.Craig Topper2019-08-181-0/+1
| | | | llvm-svn: 369204
* AMDGPU: Fix iterator error when lowering SI_END_CFMatt Arsenault2019-08-182-5/+72
| | | | | | | If the instruction is the last in the block, there is no next instruction but the iteration still needs to look at the new block. llvm-svn: 369203
* AMDGPU: Disambiguate v3f16 format in load/store tablesMatt Arsenault2019-08-185-104/+119
| | | | | | | | | Currently the searchable tables report the number of dwords. These round to the same number for 3 and 4 component d16 instructions. Change this to report the number of elements so this isn't ambiguous. llvm-svn: 369202
* TableGen: Revert changes from r369038Matt Arsenault2019-08-181-3/+1
| | | | | | | These aren't needed for a specific use yet, and I meant to not commit these. llvm-svn: 369201
* [X86] Add a one use check to the combineStore code that handles ↵Craig Topper2019-08-172-1/+21
| | | | | | | | | v16i16->v16i8 truncate+store by extending to v16i32 and then emitting a v16i32->v16i8 truncstore. This prevent us from emitting a separate truncate and a truncating store instruction. llvm-svn: 369200
* [BPF] Fix bpf llvm-objdump issues.Yonghong Song2019-08-172-2/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit https://reviews.llvm.org/D57939 ("[DWARF] Refactor RelocVisitor and fix computation of SHT_RELA-typed relocation entries) made a change for relocation resolution when operating on an object file. The change unfortunately broke BPF as given SymbolValue (S) and Addent (A), previously relocation is resolved to S + A and after the change, it is resolved to S This patch fixed the issue by resolving relocation correctly. It looks not all relocation resolution reaches here and I did not trace down exactly when. But I do find if the object file includes codes in two different ELF sections than default ".text", the above bug will be triggered. This patch included a trivial two function source code to demonstrate this issue. The relocation for .debug_loc is resolved incorrectly due to this and llvm-objdump cannot display source annotated assembly. Differential Revision: https://reviews.llvm.org/D66372 llvm-svn: 369199
* [lldb][NFC] Remove unused MaterializeInitializer and MaterializeInternalVariableRaphael Isemann2019-08-172-86/+0
| | | | llvm-svn: 369198
* [NFC][InstCombine] Some tests for 'shift amount reassoc in bit test - ↵Roman Lebedev2019-08-171-0/+546
| | | | | | | | | | | | | | trunc-of-lshr' (PR42399) Finally, the fold i was looking forward to :) The legality check is muddy, i doubt i've groked the full generalization, but it handles all the cases i care about, and can come up with: https://rise4fun.com/Alive/26j https://bugs.llvm.org/show_bug.cgi?id=42399 llvm-svn: 369197
* [SemaDeclCXX] Allow inheriting constructor declaration to specify a ↵Tan S. B.2019-08-172-1/+3
| | | | | | | | cv-qualified type Differential Revision: https://reviews.llvm.org/D47419 llvm-svn: 369196
* [analyzer] Turn an assert into an if conditionKristof Umann2019-08-172-5/+15
| | | | | | | Shocker, turns out that terminator conditions that are binary operators aren't always logical operators. llvm-svn: 369195
* Recommit r369190 "[llvm-readobj/llvm-readelf] - Improve/cleanup the error ↵George Rimar2019-08-1717-225/+295
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | reporting API." Fix: Add a `consumeError` call removed by mistake to 'printStackSize', this should fix the "Expected<T> must be checked before access or destruction." reported by following bot: http://lab.llvm.org:8011/builders/clang-x64-windows-msvc/builds/9743/steps/stage%201%20check/logs/stdio Original commit message: Currently we have the following functions for error reporting: LLVM_ATTRIBUTE_NORETURN void reportError(Twine Msg); void reportError(Error Err, StringRef Input); void reportWarning(Twine Msg); void reportWarning(StringRef Input, Error Err); void warn(llvm::Error Err); void error(std::error_code EC); Problems are: naming is inconsistent, arguments order is inconsistent, some of the functions looks excessive. After applying this patch we have: void reportError(Error Err, StringRef Input); void reportError(std::error_code EC, StringRef Input); void reportWarning(Error Err, StringRef Input); I'd be happy to remove reportError(std::error_code EC, StringRef Input) too, but it is used by COFF heavily. Test cases were updated, they show an improvement introduced. Differential revision: https://reviews.llvm.org/D66286 llvm-svn: 369194
* Revert r369190, r369192 ([llvm-readobj/llvm-readelf] - Improve/cleanup the ↵George Rimar2019-08-1717-294/+225
| | | | | | | | | | | error reporting API.) It caused multiple BB failtures: http://lab.llvm.org:8011/builders/clang-x64-windows-msvc/builds/9743/steps/stage%201%20check/logs/stdio http://lab.llvm.org:8011/builders/clang-cmake-x86_64-sde-avx512-linux/builds/26042/steps/ninja%20check%201/logs/FAIL%3A%20LLVM%3A%3Astack-sizes.test llvm-svn: 369193
* [llvm-readobj] - An attemp to fix BB after r369191.George Rimar2019-08-171-3/+3
| | | | | | | | | | | | | | | | | | | | | Few BB failed with the following error: Command Output (stderr): -- /home/buildbots/ppc64be-clang-lnt-test/clang-ppc64be-lnt/llvm/test/tools/llvm-readobj/stack-sizes.test:263:19: error: BADSECTION-OUT: expected string not found in input # BADSECTION-OUT: 8 ? ^ <stdin>:4:1: note: scanning from here ^ It doesn't reproduce on ubuntu/windows I have. Also, seems many of the bots are happy too. This slightly reorders the code to make fouts().flush() call earlier, like it was before the r369191. llvm-svn: 369192
* [CodeGen] Do the Simple Early Return in block-placement pass to optimize the ↵Kang Zhang2019-08-172-8/+44
| | | | | | | | | | | | | | | | | | blocks Summary: Fix a bug of preducessors. In `block-placement` pass, it will create some patterns for unconditional we can do the simple early retrun. But the `early-ret` pass is before `block-placement`, we don't want to run it again. This patch is to do the simple early return to optimize the blocks at the last of `block-placement`. Reviewed By: efriedma Differential Revision: https://reviews.llvm.org/D63972 llvm-svn: 369191
* [llvm-readobj/llvm-readelf] - Improve/cleanup the error reporting API.George Rimar2019-08-1717-226/+295
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | urrently we have the following functions for error reporting: -- LLVM_ATTRIBUTE_NORETURN void reportError(Twine Msg); void reportError(Error Err, StringRef Input); void reportWarning(Twine Msg); void reportWarning(StringRef Input, Error Err); void warn(llvm::Error Err); void error(std::error_code EC); --- Problems are: naming is inconsistent, arguments order is inconsistent, some of the functions looks excessive. After applying this patch we have: --- LLVM_ATTRIBUTE_NORETURN void reportError(Error Err, StringRef Input); LLVM_ATTRIBUTE_NORETURN void reportError(std::error_code EC, StringRef Input); void reportWarning(Error Err, StringRef Input); --- I'd be happy to remove reportError(std::error_code EC, StringRef Input) too, but it is used by COFF heavily. Test cases were updated, they show an improvement introduced. Differential revision: https://reviews.llvm.org/D66286 llvm-svn: 369190
* [test] - Remove precomiled openbsd-phdrs.elf-x86-64 objects.George Rimar2019-08-175-207/+186
| | | | | | | | | | | There are 2 similar openbsd-phdrs.elf-x86-64 objects committed and used in test/Object and test/tools/llvm-objdump test cases. There is no reason to have them, we can use YAML instead. Patch does that. Differential revision: https://reviews.llvm.org/D66342 llvm-svn: 369189
* [circular_raw_ostream] Delegate is_displayed to contained streamTroy A. Johnson2019-08-171-0/+4
| | | | | | | | | | | | raw_ostream has an is_displayed() member function that determines if the stream is connected to a console for display or is connected to a file/pipe. By default, is_displayed() returns false, and derived classes like raw_fd_ostream override it. Because circular_raw_ostream wraps another stream, its result for is_displayed() should be the same as that stream. Differential Revision: https://reviews.llvm.org/D66026 llvm-svn: 369188
* [ELF] Replace local variable hasExportDynamic with config->exportDynamic. NFCFangrui Song2019-08-171-5/+2
| | | | llvm-svn: 369187
* Revert Revert [AArch64InstrInfo] Stop getInstSizeInBytes returning non-zero ↵Paul Walker2019-08-172-6/+84
| | | | | | | | for meta instructions. This reverts r369132 (git commit 19301d75f086caae1a495d267f5d0264b225942d) llvm-svn: 369186
* Revert [AArch64InstrInfo] Stop getInstSizeInBytes returning non-zero for ↵Paul Walker2019-08-172-84/+6
| | | | | | | | meta instructions. This reverts r369133 (git commit 2632c677f85cba1ac2aef5d68aaf8af0f5b3c944) llvm-svn: 369185
* [ELF][PPC] Fix getRelExpr for R_PPC64_REL16_HIFangrui Song2019-08-173-72/+68
| | | | | | | | | | | | Fixes https://github.com/ClangBuiltLinux/linux/issues/640 R_PPC64_REL16_HI was incorrectly computed as an R_ABS relocation. rLLD368964 made it a linker failure. Change it to use R_PC to fix the failures. Add ppc64-reloc-rel.s for these R_PPC64_REL* tests. llvm-svn: 369184
* [X86] Support -mlong-double-80Troy A. Johnson2019-08-173-7/+17
| | | | | | | | | | | | | Add an option group for all of the -mlong-double-* options and make -mlong-double-80 restore the default long double behavior for X86. The motivations are that GNU accepts the -mlong-double-80 option and that complex Makefiles often need a way of undoing earlier options. Prior to this commit, if one chooses 64-bit or 128-bit long double for X86, there is no way to undo that choice and restore the 80-bit behavior. Differential Revision: https://reviews.llvm.org/D66055 llvm-svn: 369183
OpenPOWER on IntegriCloud