summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* [Object/COFF.h] - Stop returning std::error_code in a few methods. NFCI.George Rimar2019-08-197-74/+24
| | | | | | | | | | There are 4 methods that return std::error_code now, though they do not have to because they are always succeed. I refactored them. This allows to simplify the code in tools a bit. llvm-svn: 369263
* [ELF] Move (copy relocation/canonical PLT) before error checkingFangrui Song2019-08-197-85/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | In processRelocAux(), we handle errors before copy relocation/canonical PLT. This makes error checking a bit complex because we have to check for conditions that will be allowed by copy relocation/canonical PLT. Instead, move copy relocation/canonical PLT before error checking. This simplifies the previous clumsy error checking code `config->shared || (config->pie && expr == R_ABS && type != target->symbolicRel)` to the simple `config->isPic`. Some diagnostics can be reported in different ways. The code motion changes diagnostics for some contrived test cases: * copy-rel-pie-error.s -> copy-rel-pie2.s: It was rejected before but accepted now. ld.bfd also accepts the case. * copy-errors.s: "cannot preempt symbol" changes to "symbol 'bar' has no type" * got32{,x}-i386.s: the suggestion changes from "-fPIC or -Wl,-z,notext" to "-fPIE" * x86-64-dyn-rel-error5.s: one diagnostic changes for -pie case Reviewed By: peter.smith Differential Revision: https://reviews.llvm.org/D66007 llvm-svn: 369262
* [PeepholeOptimizer] Don't assume bitcast def always has inputJinsong Ji2019-08-193-3/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: If we have a MI marked with bitcast bits, but without input operands, PeepholeOptimizer might crash with assert. eg: If we apply the changes in PPCInstrVSX.td as in this patch: [(set v4i32:$XT, (bitconvert (v16i8 immAllOnesV)))]>; We will get assert in PeepholeOptimizer. ``` llvm-lit llvm-project/llvm/test/CodeGen/PowerPC/build-vector-tests.ll -v llvm-project/llvm/include/llvm/CodeGen/MachineInstr.h:417: const llvm::MachineOperand &llvm::MachineInstr::getOperand(unsigned int) const: Assertion `i < getNumOperands() && "getOperand() out of range!"' failed. ``` The fix is to abort if we found out of bound access. Reviewers: qcolombet, MatzeB, hfinkel, arsenm Reviewed By: qcolombet Subscribers: wdng, arsenm, steven.zhang, wuzish, nemanjai, hiraditya, kbarton, MaskRay, llvm-commits Tags: #llvm Differential Revision: https://reviews.llvm.org/D65542 llvm-svn: 369261
* [ELF][Hexagon] Improve error message for unknown relocationsFangrui Song2019-08-191-3/+18
| | | | | | | | | | | | | | | | | | | | Like rLLD354040 Previously, for unknown relocation types, in -no-pie/-pie mode, we got something like: foo.o: unrecognized relocation ... In -shared mode: error: can't create dynamic relocation ... against symbol: yyy in readonly segment Delete the default case from Hexagon::getRelExpr and add the error there. We will get consistent error message like `error: unknown relocation (1024) against symbol foo` Reviewed By: sidneym Differential Revision: https://reviews.llvm.org/D66275 llvm-svn: 369260
* Don't keep stale pointers to LoopInfos.Aaron Ballman2019-08-193-7/+24
| | | | | | | | CGLoopInfo was keeping pointers to parent loop LoopInfos, but when the loop info vector grew, it reallocated the storage and invalidated all of the parent pointers, causing use-after-free. Manage the lifetimes of the LoopInfos separately so that the pointers aren't stale. Patch by Bevin Hansson. llvm-svn: 369259
* [lld][Hexagon] Add GOTREL relocations.Sid Manning2019-08-192-0/+38
| | | | | | | | Add GOTREL relocation support. (S + A - GOT) Differential Revision: https://reviews.llvm.org/D66260 llvm-svn: 369258
* [RISCV] Don't force absolute FK_Data_X fixups to relocsAlex Bradbury2019-08-193-3/+28
| | | | | | | | | | | | The current behavior of shouldForceRelocation forces relocations for the majority of fixups when relaxation is enabled. This makes sense for fixups which incorporate symbols but is unnecessary for simple data fixups where the fixup target is already resolved to an absolute value. Differential Revision: https://reviews.llvm.org/D63404 Patch by Edward Jones. llvm-svn: 369257
* [DebugInfo] Allow bundled calls in the MIR's call site infoDavid Stenberg2019-08-193-4/+52
| | | | | | | | | | | | | | | | | | Summary: Extend the MIR parser and writer so that the call site information can refer to calls that are bundled. Reviewers: aprantl, asowda, NikolaPrica, djtodoro, ivanbaev, vsk Reviewed By: aprantl Subscribers: arsenm, hiraditya, llvm-commits Tags: #debug-info, #llvm Differential Revision: https://reviews.llvm.org/D66145 llvm-svn: 369256
* [SLP] add test that requires shuffle of scalars; NFCSanjay Patel2019-08-191-0/+26
| | | | llvm-svn: 369255
* [llvm-readobj] unwrapOrError: remove unnecessary llvm_unreachable after r369194Fangrui Song2019-08-191-1/+0
| | | | llvm-svn: 369254
* [OpenCL] Add generic type handling for builtin functionsSven van Haastregt2019-08-194-257/+613
| | | | | | | | | | | | | | | | | | Generic types are an abstraction of type sets. It mimics the way functions are defined in the OpenCL specification. For example, floatN can abstract all the vector sizes of the float type. This allows to * stick more closely to the specification, which uses generic types; * factorize definitions of functions with numerous prototypes in the tablegen file; and * reduce the memory impact of functions with many overloads. Patch by Pierre Gondois and Sven van Haastregt. Differential Revision: https://reviews.llvm.org/D65456 llvm-svn: 369253
* [lldb][NFC] Use CompletionRequest in Variable::AutoCompleteRaphael Isemann2019-08-191-43/+32
| | | | llvm-svn: 369252
* [OpenCL] Fix addr space deduction for pointers/references to arrays.Anastasia Stulova2019-08-192-2/+38
| | | | | | | | | | | Rewrite the logic for detecting if we are deducing addr space of a pointee type to take into account special logic for arrays. For pointers/references to arrays we can have any number of parentheses expressions as well as nested pointers. Differential Revision: https://reviews.llvm.org/D66137 llvm-svn: 369251
* [SLP] reduce duplicated code; NFCSanjay Patel2019-08-191-2/+4
| | | | llvm-svn: 369250
* [lldb][NFC] Add a few more completion tests to increase test coverageRaphael Isemann2019-08-191-0/+23
| | | | | | | These tests are mostly trying to reach the different completion functions in CommandCompletions.cpp (::ArchitectureNames, ::DiskFiles, ::Modules). llvm-svn: 369249
* [MC] Simplify ELFObjectWriter::recordRelocation. NFCFangrui Song2019-08-191-22/+16
| | | | llvm-svn: 369248
* [DebugInfo] Make postra sinking of DBG_VALUEs subregister-safeJeremy Morse2019-08-192-9/+132
| | | | | | | | | | | | | | | | | | | | | | | | Currently the machine instruction sinker identifies DBG_VALUE insts that also need to sink by comparing register numbers. Unfortunately this isn't safe, because (after register allocation) a DBG_VALUE may read a register that aliases what's being sunk. To fix this, identify the DBG_VALUEs that need to sink by recording & examining their register units. Register units gives us the following guarantee: "Two registers overlap if and only if they have a common register unit" [MCRegisterInfo.h] Thus we can always identify aliasing DBG_VALUEs if the set of register units read by the DBG_VALUE, and the register units of the instruction being sunk, intersect. (MachineSink already uses classes like "LiveRegUnits" for determining sinking validity anyway). The test added checks for super and subregister DBG_VALUE reads of a sunk copy being sunk as well. Differential Revision: https://reviews.llvm.org/D58191 llvm-svn: 369247
* [ELF][ARM] Add a test that maxes out the thunk convergence limitPeter Smith2019-08-191-0/+111
| | | | | | | | | | | Add a test that takes the maximum amount of passes permitted to converge. This will make sure that any symbol defined in a linker script gets the correct value and that any other convergence limit involving symbol address doesn't restrict Thunk convergence. Differential Revision: https://reviews.llvm.org/D66346 llvm-svn: 369246
* [ARM] Add support for MVE vaddvSam Tebbs2019-08-196-0/+80
| | | | | | | | | This patch adds vecreduce_add and the relevant instruction selection for vaddv. Differential revision: https://reviews.llvm.org/D66085 llvm-svn: 369245
* [ARM] MVE sext costsDavid Green2019-08-192-16/+77
| | | | | | | | | This adds some sext costs for MVE, taken from the length of assembly sequences that we currently generate. Differential Revision: https://reviews.llvm.org/D66010 llvm-svn: 369244
* [DebugInfo] Test for variable range un-coalescingJeremy Morse2019-08-191-0/+138
| | | | | | | | | | | | | | | | LiveDebugVariables can coalesce ranges of variable locations across multiple basic blocks. However when it recreates DBG_VALUE instructions, it has to recreate one DBG_VALUE per block, otherwise it doesn't represent the pre-regalloc layout and variable assignments can go missing. This feature works -- however while mucking around with LiveDebugVariables, I commented the relevant code it out and no tests failed. Thus, here's a test that checks LiveDebugVariables preserves DBG_VALUEs across block boundaries. Differential Revision: https://reviews.llvm.org/D66347 llvm-svn: 369243
* [lldb][NFC] Remove StringList::AutoCompleteRaphael Isemann2019-08-193-37/+12
| | | | | | | We don't need this very specific function in StringList that we only call once in LLDB. llvm-svn: 369242
* Revert [Attributor] Fix: Make sure we set the changed flagDavid L. Jones2019-08-191-4/+4
| | | | | | | | This reverts r369159 (git commit cbaf1fdea2de891bdbc49cdec89ae2077e6b9ed0) r369160 caused a test to fail under UBSAN. See thread on llvm-commits. llvm-svn: 369241
* [lldb][NFC] Use GetMaxStringLength in CommandObjectApropos::DoExecuteRaphael Isemann2019-08-191-5/+1
| | | | llvm-svn: 369240
* [MC] Delete unnecessary diagnostic: "No relocation available to represent ↵Fangrui Song2019-08-195-20/+6
| | | | | | | | | | | | | | | | | | | | this relative expression" Replace - error: No relocation available to represent this relative expression with + error: symbol 'undef' can not be undefined in a subtraction expression or + error: Cannot represent a difference across sections Keep !IsPcRel as an assertion after the two diagnostic checks are done. llvm-svn: 369239
* [clangd] Added special HighlightingKind for function parameters.Johan Vikstrom2019-08-194-15/+31
| | | | | | | | | | | | | | Summary: This means that function parameters are no longer highlighted as variable.other.cpp but instead as variable.parameter.cpp which is the more "correct" TextMate scope for them. Reviewers: hokein, ilya-biryukov Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits Tags: #clang Differential Revision: https://reviews.llvm.org/D66335 llvm-svn: 369238
* [lldb][NFC] Address review comments to StringList for-loop supportRaphael Isemann2019-08-194-8/+8
| | | | llvm-svn: 369237
* Revert [Attributor] Fix: Do not partially resolve returned calls.David L. Jones2019-08-191-28/+11
| | | | | | | | This reverts r369160 (git commit f72d9b1c97b41fff48ad1eecbba59a29c171bff4) r369160 caused some tests to fail under UBSAN. See thread on llvm-commits. llvm-svn: 369236
* [lldb] Remove unused inheritance in RegularExpressionJan Kratochvil2019-08-191-1/+1
| | | | | | | | D66174 left inherited llvm::Regex which is now a member variable there. Approved as a part of: https://reviews.llvm.org/D66392#1634575 llvm-svn: 369235
* Revert r369230 and r369231Seiya Nuta2019-08-1910-877/+210
| | | | | | | | | | Looks these commits break CI builds: - http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-gn/builds/4159 This commit reverts r369230 and r369231 (git coommit: 4a198a7 and dee9546). llvm-svn: 369234
* [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
OpenPOWER on IntegriCloud