summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [clangd] Unlink VFS working dir from OS working dir.Sam McCall2019-01-141-2/+3
| | | | | | | | | | | | A lot of our previous FS manipulation was thread-unsafe in practice with the RealFS implementation. This switches to a different RealFS mode where path-manipulation is used to simulate multiple working dirs. r351050 both added this mode and removed the cache. If we want to move back to the old implementation we need to put the cache back. llvm-svn: 351051
* [VFS] Allow multiple RealFileSystem instances with independent CWDs.Sam McCall2019-01-143-30/+161
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Previously only one RealFileSystem instance was available, and its working directory is shared with the process. This doesn't work well for multithreaded programs that want to work with relative paths - the vfs::FileSystem is assumed to provide the working directory, but a thread cannot control this exclusively. The new vfs::createPhysicalFileSystem() factory copies the process's working directory initially, and then allows it to be independently modified. This implementation records the working directory path, and glues it to relative paths to provide the correct absolute path to the sys::fs:: functions. This will give different results in unusual situations (e.g. the CWD is moved). The main alternative is the use of openat(), fstatat(), etc to ask the OS to resolve paths relative to a directory handle which can be kept open. This is more robust. There are two reasons not to do this initially: 1. these functions are not available on all supported Unixes, and are somewhere between difficult and unavailable on Windows. So we need a path-based fallback anyway. 2. this would mean also adding support at the llvm::sys::fs level, which is a larger project. My clearest idea is an OS-specific `BaseDirectory` object that can be optionally passed to functions there. Eventually this could be backed by either paths or a fd where openat() is supported. This is a large project, and demonstrating here that a path-based fallback works is a useful prerequisite. There is some subtlety to the path-manipulation mechanism: - when setting the working directory, both Specified=makeAbsolute(path) and Resolved=realpath(path) are recorded. These may differ in the presence of symlinks. - getCurrentWorkingDirectory() and makeAbsolute() use Specified - this is similar to the behavior of $PWD and sys::path::current_path - IO operations like openFileForRead use Resolved. This is similar to the behavior of an openat() based implementation, that doesn't see changes in symlinks. There may still be combinations of operations and FS states that yield unhelpful behavior. This is hard to avoid with symlinks and FS abstractions :( The caching behavior of the current working directory is removed in this patch. getRealFileSystem() is now specified to link to the process CWD, so the caching is incorrect. The user who needed this so far is clangd, which will immediately switch to createPhysicalFileSystem(). Reviewers: ilya-biryukov, bkramer, labath Subscribers: ioeric, kadircet, kristina, llvm-commits Differential Revision: https://reviews.llvm.org/D56545 llvm-svn: 351050
* Replace "no-frame-pointer-*" function attributes with "frame-pointer"Francis Visoiu Mistrih2019-01-14154-300/+331
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Part of the effort to refactoring frame pointer code generation. We used to use two function attributes "no-frame-pointer-elim" and "no-frame-pointer-elim-non-leaf" to represent three kinds of frame pointer usage: (all) frames use frame pointer, (non-leaf) frames use frame pointer, (none) frame use frame pointer. This CL makes the idea explicit by using only one enum function attribute "frame-pointer" Option "-frame-pointer=" replaces "-disable-fp-elim" for tools such as llc. "no-frame-pointer-elim" and "no-frame-pointer-elim-non-leaf" are still supported for easy migration to "frame-pointer". tests are mostly updated with // replace command line args ‘-disable-fp-elim=false’ with ‘-frame-pointer=none’ grep -iIrnl '\-disable-fp-elim=false' * | xargs sed -i '' -e "s/-disable-fp-elim=false/-frame-pointer=none/g" // replace command line args ‘-disable-fp-elim’ with ‘-frame-pointer=all’ grep -iIrnl '\-disable-fp-elim' * | xargs sed -i '' -e "s/-disable-fp-elim/-frame-pointer=all/g" Patch by Yuanfang Chen (tabloid.adroit)! Differential Revision: https://reviews.llvm.org/D56351 llvm-svn: 351049
* [clang-tidy] update FunctionSizeCheck for D56444Sam McCall2019-01-141-1/+6
| | | | | | | | | | Reviewers: JonasToth, aaron.ballman Subscribers: xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D56552 llvm-svn: 351048
* [AST] RecursiveASTVisitor visits lambda classes when implicit visitation is on.Sam McCall2019-01-145-46/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This fixes ASTContext's parent map for nodes in such classes (e.g. operator()). https://bugs.llvm.org/show_bug.cgi?id=39949 This also changes the observed shape of the AST for implicit RAVs. - this includes AST MatchFinder: cxxRecordDecl() now matches lambda classes, functionDecl() matches the call operator, and the parent chain is body -> call operator -> lambda class -> lambdaexpr rather than body -> lambdaexpr. - this appears not to matter for the ASTImporterLookupTable builder - this doesn't matter for the other RAVs in-tree. In order to do this, we remove the TraverseLambdaBody hook. The problem is it's hard/weird to ensure this hook is called when traversing via the implicit class. There were just two users of this hook in-tree, who use it to skip bodies. I replaced these with explicitly traversing the captures only. Another approach would be recording the bodies when the lambda is visited, and then recognizing them later. I'd be open to suggestion on how to preserve this hook, instead. Reviewers: aaron.ballman, JonasToth Subscribers: cfe-commits, rsmith, jdennett Differential Revision: https://reviews.llvm.org/D56444 llvm-svn: 351047
* [MIPS GlobalISel] Add pre legalizer combiner passPetar Avramovic2019-01-145-0/+138
| | | | | | | | | | Introduce GlobalISel pre legalizer pass for MIPS. It will be used to cope with instructions that require combining before legalization. Differential Revision: https://reviews.llvm.org/D56269 llvm-svn: 351046
* [BasicBlockUtils] Generalize DeleteDeadBlock to deal with multiple dead blocksMax Kazantsev2019-01-142-36/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Utility function `DeleteDeadBlock` expects that all predecessors of a block being deleted are already deleted, with the exception of single-block loop. It makes it hard to use for deletion of a set of blocks that may contain cyclic dependencies. The is no correct order of invocations of this function that does not produce dangling pointers on already deleted blocks. This patch introduces a generalized version of this function `DeleteDeadBlocks` that allows us to remove multiple blocks at once, even if there are cycles among them. The only requirement is that no block being deleted should have a predecessor that is not being deleted. The logic of `DeleteDeadBlocks` is following: for each block create relevant DT updates; remove all instructions (replace with undef if needed); replace terminator with unreacheable; apply DT updates; for each block delete block; Therefore, `DeleteDeadBlock` becomes a particular case of the general algorithm called for a single block. Differential Revision: https://reviews.llvm.org/D56120 Reviewed By: skatkov llvm-svn: 351045
* [Sparc] Add Sparc V8 supportDaniel Cederman2019-01-1410-17/+376
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Adds the register class implementation for Sparc. Adds support for DW_CFA_GNU_window_save. Adds save and restore context functionality. Adds getArch() function to each Registers_ class to be able to separate between DW_CFA_AARCH64_negate_ra_state and DW_CFA_GNU_window_save which are both represented by the same constant. On Sparc the return address is the address of the call instruction, so an offset needs to be added when returning to skip the call instruction and its delay slot. If the function returns a struct it is also necessary to skip one extra instruction on Sparc V8. Reviewers: jyknight, mclow.lists, mstorsjo, compnerd Reviewed By: jyknight, compnerd Subscribers: jgorbe, mgorny, christof, llvm-commits, fedor.sergeev, JDevlieghere, ldionne, libcxx-commits Differential Revision: https://reviews.llvm.org/D55763 llvm-svn: 351044
* [llvm-symbolizer] Add -addresses, -a as aliases for -print-addressDmitry Venikov2019-01-143-3/+13
| | | | | | | | | | | | | | Summary: Provides -addresses, -a as aliases for -print-address. Motivation: https://bugs.llvm.org/show_bug.cgi?id=40067. Reviewers: jhenderson, ruiu, rnk, fjricci Reviewed By: jhenderson Subscribers: rupprecht, llvm-commits Differential Revision: https://reviews.llvm.org/D56635 llvm-svn: 351043
* Fix defines.txtThomas Preud'homme2019-01-141-1/+1
| | | | | | | Support arbitrary suffix when matching FileCheck executable name in defines.txt to successfully match FileCheck.EXE on Microsoft Windows. llvm-svn: 351042
* [clangd] Index main-file symbols (bug 39761)Sam McCall2019-01-146-54/+122
| | | | | | | | Patch by Nathan Ridge! Differential Revision: https://reviews.llvm.org/D55185 llvm-svn: 351041
* [asan] Add fallback for Thumb after r350139Diana Picus2019-01-143-2/+13
| | | | | | | | | | | | | | This reverts r350806 which marked some tests as UNSUPPORTED on ARM and instead reintroduces the old code path only for Thumb, since that seems to be the only target that broke. It would still be nice to find the root cause of the breakage, but with the branch point for LLVM 8.0 scheduled for next week it's better to put things in a stable state while we investigate. Differential Revision: https://reviews.llvm.org/D56594 llvm-svn: 351040
* Detect incorrect FileCheck variable CLI definitionThomas Preud'homme2019-01-142-9/+43
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: While the backend code of FileCheck relies on definition of variable from the command-line to have an equal sign '=' and a variable name before that, the frontend does not actually enforce it. This leads to FileCheck crashing when invoked with invalid syntax for the -D option. This patch adds the missing validation in the frontend. It also makes the -D option an AlwaysPrefix option to be able to detect -D=FOO as being a define without variable and -D as missing its value. Copyright: - Linaro (changes in version 2 of revision D55940) - GraphCore (changes in later versions) Reviewers: jdenny Subscribers: JonChesterfield, hiraditya, kristina, probinson, llvm-commits Differential Revision: https://reviews.llvm.org/D55940 llvm-svn: 351039
* Add support for prefix-only CLI optionsThomas Preud'homme2019-01-143-8/+95
| | | | | | | | | | | | | | | | | | | | | | Summary: Add support for options that always prefix their value, giving an error if the value is in the next argument or if the option is given a value assignment (ie. opt=val). This is the desired behavior for the -D option of FileCheck for instance. Copyright: - Linaro (changes in version 2 of revision D55940) - GraphCore (changes in later versions and introduced when creating D56549) Reviewers: jdenny Subscribers: llvm-commits, probinson, kristina, hiraditya, JonChesterfield Differential Revision: https://reviews.llvm.org/D56549 llvm-svn: 351038
* [CMake] LLVM exports utility targets since r350959, so we can use them ↵Stefan Granitz2019-01-141-8/+3
| | | | | | without standalone-checks now llvm-svn: 351037
* [X86] Remove mask parameter from avx512 pmultishiftqb intrinsics. Use select ↵Craig Topper2019-01-146-63/+73
| | | | | | | | in IR instead. Fixes PR40259 llvm-svn: 351036
* [X86] Remove mask parameter from avx512 pmultishiftqb intrinsics. Use select ↵Craig Topper2019-01-149-52/+338
| | | | | | | | in IR instead. Fixes PR40259 llvm-svn: 351035
* [X86] Add new test file that was supposed to go with r351028.Craig Topper2019-01-141-0/+44
| | | | llvm-svn: 351034
* [X86] Update type profile for DBPSADBW to indicate the immediate is an i8 ↵Craig Topper2019-01-141-1/+1
| | | | | | | | not just any int. Removes some type checks from X86GenDAGISel.inc llvm-svn: 351033
* [X86] Remove unused intrinsic handlers. NFCCraig Topper2019-01-142-39/+2
| | | | llvm-svn: 351032
* [X86] Remove FPCLASS intrinsic handler. Use INTR_TYPE_2OP instead. NFCCraig Topper2019-01-142-14/+7
| | | | llvm-svn: 351031
* lld/include/lld/Core/TODO.txtNico Weber2019-01-145-36/+18
| | | | | | | | | | | - fix minor grammar stuff (I'm not a native speaker either, but it's hopefully a net improvement) - mention that lld/coff is used in production - update AArch64, ARM to production quality - remove lld/include/lld/Core/TODO.txt which looks outdated Differential Revision: https://reviews.llvm.org/D56600 llvm-svn: 351030
* [X86] Remove mask parameter from vpshufbitqmb intrinsics. Change result to a ↵Craig Topper2019-01-143-6/+34
| | | | | | | | | | vXi1 vector. We'll do the scalar<->vXi1 conversions with bitcasts in IR. Fixes PR40258 llvm-svn: 351029
* [X86] Remove mask parameter from vpshufbitqmb intrinsics. Change result to a ↵Craig Topper2019-01-145-75/+53
| | | | | | | | | | vXi1 vector. The input mask can be represented with an AND in IR. Fixes PR40258 llvm-svn: 351028
* [libcxx] Mark do_open, do_get and do_close parameters unused when catopen is ↵Petr Hosek2019-01-132-0/+8
| | | | | | | | | | | | missing When catopen is missing, do_open, do_get and do_close end up being no-op, and as such their parameters will be unused which triggers a warning/error when building with -Wunused-parameter. Differential Revision: https://reviews.llvm.org/D56023 llvm-svn: 351027
* [DAGCombiner] If add_sat(x,y) can't overflow -> add(x,y)Simon Pilgrim2019-01-132-5/+9
| | | | | NOTE: We need more powerful signed overflow detection in computeOverflowKind llvm-svn: 351026
* Fix unused variable warning. NFCI.Simon Pilgrim2019-01-131-1/+0
| | | | llvm-svn: 351025
* [DAGCombiner] Some very basic add/sub saturation combines.Simon Pilgrim2019-01-135-66/+82
| | | | | | Handle combines with zero and constant canonicalization for adds. llvm-svn: 351024
* [X86] Add some basic add/sub saturation combine tests.Simon Pilgrim2019-01-134-0/+300
| | | | | | The actual combines will be added in a future commit. llvm-svn: 351023
* [LegalizeDAG] Remove 'NeedInvert' code from expansion of BR_CC. Replace with ↵Craig Topper2019-01-131-4/+1
| | | | | | | | | | | | an assert. I accidentally triggered this code while doing some experiments and it doesn't look lke it could possibly work. It calls 'getNOT' on a node that should be a CondCode. I think to do this right we would need to swap the branch target and the fallthrough target. But that's not easy to do. Or we could create an explicit SetCC and feed that into a new BR_CC? llvm-svn: 351022
* [X86] Rename overly verbose method; NFCNikita Popov2019-01-134-10/+6
| | | | | | As suggested on D56636. llvm-svn: 351021
* Remove TypeBuilder.h, and fix the few locations using it.James Y Knight2019-01-1317-831/+123
| | | | | | | | | | | | | | This shortcut mechanism for creating types was added 10 years ago, but has seen almost no uptake since then, neither internally nor in external projects. The very small number of characters saved by using it does not seem worth the mental overhead of an additional type-creation API, so, delete it. Differential Revision: https://reviews.llvm.org/D56573 llvm-svn: 351020
* [OpenMP] Fix LIBOMP_USE_DEBUGGER=ON build (PR38612)Roman Lebedev2019-01-133-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Two things: 1. Those two variables had the wrong sigdness, which was resulting in "sign mismatch in comparison" warning. 2. The whole `kmp_debugger.cpp` wasn't being built, or rather, it was being built as-if `USE_DEBUGGER` was off, thus, nothing provided the definition of `__kmp_omp_debug_struct_info`, `__kmp_debugging`. Makes sense, because `USE_DEBUGGER` is set in `kmp_config.h`, which is not included explicitly. It is included by `kmp.h`, but that one is only included inside of the `#if USE_DEBUGGER` block.. I *think* this is the only source file with this issue, everything else seem to `#include` either `kmp.h` or `kmp_config.h`. The alternative solution would be to add `add_compile_options(-include kmp_config.h)` in CMake. I did verify that `__kmp_omp_debug_struct_info` becomes available with this patch. Fixes [[ https://bugs.llvm.org/show_bug.cgi?id=38612 | PR38612 ]]. Reviewers: AndreyChurbanov, jlpeyton, Hahnfeld Reviewed By: jlpeyton Subscribers: guansong, jfb, openmp-commits Tags: #openmp Differential Revision: https://reviews.llvm.org/D55783 llvm-svn: 351019
* [X86] Add more ISD nodes to handle masked versions of ↵Craig Topper2019-01-135-12/+152
| | | | | | | | | | VCVT(T)PD2DQZ128/VCVT(T)PD2UDQZ128 which only produce 2 result elements and zeroes the upper elements. We can't represent this properly with vselect like we normally do. We also have to update the instruction definition to use a VK2WM mask instead of VK4WM to represent this. Fixes another case from PR34877 llvm-svn: 351018
* [X86] Add X86ISD::VMFPROUND to handle the masked case of VCVTPD2PSZ128 which ↵Craig Topper2019-01-135-18/+89
| | | | | | | | | | only produces 2 result elements and zeroes the upper elements. We can't represent this properly with vselect like we normally do. We also have to update the instruction definition to use a VK2WM mask instead of VK4WM to represent this. Fixes another case from PR34877. llvm-svn: 351017
* Give helper classes/functions local linkage. NFC.Benjamin Kramer2019-01-128-4/+14
| | | | llvm-svn: 351016
* NFC: Make utility privateStephen Kelly2019-01-121-1/+3
| | | | | | No callers are external to the class anymore. llvm-svn: 351015
* [ASTDump] NFC: Move dump of individual Stmts to TextNodeDumperStephen Kelly2019-01-123-490/+522
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D55340 llvm-svn: 351014
* [X86] More aggressive shuffle mask widening in combineExtractWithShuffleSimon Pilgrim2019-01-122-2/+10
| | | | | | Use demanded extract index to set most of the shuffle mask to undef, making it easier to widen and peek through. llvm-svn: 351013
* Implement TemplateArgument dumping in terms of VisitorStephen Kelly2019-01-124-45/+183
| | | | | | | | | | | | Summary: Split the output streaming from the traversal to other AST nodes. Reviewers: aaron.ballman Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D55491 llvm-svn: 351012
* [ASTDump] Change parameter to StringRefStephen Kelly2019-01-122-3/+3
| | | | llvm-svn: 351011
* [LoopVectorizer] give more advice in remark about failure to vectorize callSanjay Patel2019-01-122-3/+75
| | | | | | | | | | Something like this is requested by: https://bugs.llvm.org/show_bug.cgi?id=40265 ...and it seems like a common enough case that we should acknowledge it. Differential Revision: https://reviews.llvm.org/D56551 llvm-svn: 351010
* [Algorithm] Add make_const_ref corresponding to make_const_ptrStephen Kelly2019-01-121-0/+6
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: dexonsmith, kristina, llvm-commits Differential Revision: https://reviews.llvm.org/D56622 llvm-svn: 351009
* [DAGCombiner] fold insert_subvector of insert_subvectorSanjay Patel2019-01-123-100/+108
| | | | | | | | | | | | | | | | | | | This pattern: t33: v8i32 = insert_subvector undef:v8i32, t35, Constant:i64<0> t21: v16i32 = insert_subvector undef:v16i32, t33, Constant:i64<0> ...shows up in PR33758: https://bugs.llvm.org/show_bug.cgi?id=33758 ...although this patch doesn't make any difference to the final result on that yet. In the affected tests here, it looks like it just makes RA wiggle. But we might as well squash this to prevent it interfering with other pattern-matching. Differential Revision: https://reviews.llvm.org/D56604 llvm-svn: 351008
* [analyzer] Fix unused variable warnings in Release buildsBenjamin Kramer2019-01-121-5/+2
| | | | | | This was just an inlined version of isa<CXXConstructExpr>. NFC. llvm-svn: 351007
* [llvm-objdump] - Change the output for --all-headers.George Rimar2019-01-122-5/+25
| | | | | | | | | | | This is for https://bugs.llvm.org/show_bug.cgi?id=40008, it starts printing the file headers when --all-headers is given and do a minor cosmetic change. Differential revision: https://reviews.llvm.org/D56588 llvm-svn: 351006
* Use getShiftAmountTy for shift amounts.Simon Pilgrim2019-01-121-1/+2
| | | | llvm-svn: 351005
* gn build: Unbreak Windows buildNico Weber2019-01-122-3/+3
| | | | | | | | | | | | I didn't break all that much during upstreaming, just needs two small fixes: - fix spelling of MCJITTests.def file - make libLTO a shared_library to put it in bin/ on Windows where it is in the CMake build too Differential Revision: https://reviews.llvm.org/D56630 llvm-svn: 351004
* [X86] Add more usub.sat vector tests; NFCNikita Popov2019-01-121-143/+1560
| | | | | | Add additional vXi32 and vXi64 tests. llvm-svn: 351003
* [NetBSD] Enable additional sanitizer typesMichal Gorny2019-01-122-8/+51
| | | | | | Differential Revision: https://reviews.llvm.org/D56607 llvm-svn: 351002
OpenPOWER on IntegriCloud