summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* [Dominators] Remove misleading double-deletion testJakub Kuderski2018-01-211-30/+0
| | | | | | | | | | | | | | | | | Summary: It's generally not safe to perform multiple DomTree updates without using the incremental API. Although it is supposed to work in this particular case, the testcase is misleading/confusing, and it's better to remove it. Reviewers: dberlin, brzycki, davide, grosser Reviewed By: davide Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D42333 llvm-svn: 323058
* [ORC] Cleanup. NFC.Lang Hames2018-01-211-2/+1
| | | | llvm-svn: 323057
* [DSE] Factor out common code [NFC]Philip Reames2018-01-211-37/+27
| | | | | | We already had the pointer being stored to in the MemLoc, reuse that code. In merging cases, it turned out the interface of the getLocForWrite had become inconsitent with other related utilities. Fix that by making sure the input passes hasAnalyzableWrite as well. llvm-svn: 323056
* [DSE] Minor rename for clarity sake [NFC]Philip Reames2018-01-211-8/+14
| | | | llvm-svn: 323055
* Reland "[Fuzzer] Parametrize add_custom_libcxx"Petr Hosek2018-01-215-25/+38
| | | | | | | | | | | | | add_custom_libcxx uses the just built compiler and installs the built libc++, e.g. for testing, neither of which is desirable in case of Fuzzer where the libc++ should be built using the host compiler and it's only linked into the libFuzzer and should never be installed. This change introduces additional arguments to add_custom_libcxx to allow parametrizing its behavior. Differential Revision: https://reviews.llvm.org/D42330 llvm-svn: 323054
* [cmake] Don't build Native llvm-config when cross compiling if passed by user.Don Hinton2018-01-212-9/+8
| | | | | | | | | | | | Summary: Rename LLVM_CONFIG_EXE to LLVM_CONFIG_PATH, and avoid building it if passed in by user. This is the same way CLANG_TABLEGEN and LLVM_TABLEGEN are handled, e.g., when -DLLVM_OPTIMIZED_TABLEGEN=ON is passed. Differential Revision: https://reviews.llvm.org/D41806 llvm-svn: 323053
* [analyzer] Provide a check name when MallocChecker enables CStringCheckerDevin Coughlin2018-01-203-1/+21
| | | | | | | | | Fix an assertion failure caused by a missing CheckName. The malloc checker enables "basic" support in the CStringChecker, which causes some CString bounds checks to be enabled. In this case, make sure that we have a valid CheckName for the BugType. llvm-svn: 323052
* [cmake] Use CLANG_BINARY_DIR to determine the build directory.Vassil Vassilev2018-01-201-1/+1
| | | | | | | The patch puts the ClangConfig.cmake in the expected location when clang is embedded into a framework. llvm-svn: 323051
* More P0202 constexpr work. This commit adds ↵Marshall Clow2018-01-209-44/+173
| | | | | | fill/fill_n/generate/generate_n/unique/unique_copy. I removed a specialization of fill_n that recognized when we were dealing with raw pointers and 1 byte trivially-assignable types and did a memset, because the compiler will do that optimization for us. llvm-svn: 323050
* [ValueLattice] Use union to shave off ptr size bytes from elements.Florian Hahn2018-01-201-14/+77
| | | | | | | | | | | | | | | | | | | By using a union for Constant* and ConstantRange we can shave off ptr size bytes off lattice elements. On 64 bit systems, it brings down the size to 40 bytes from 48 bytes. Initialization of Range happens on-demand using placement new, if the state changes to constantrange from non-constantrange. Similarly, the Range object is destroyed if the state changes from constantrange to non-constantrange. Reviewers: reames, anna, davide Reviewed By: reames, davide Differential Revision: https://reviews.llvm.org/D41903 llvm-svn: 323049
* [X86] Add an override of targetShrinkDemandedConstant to limit the damage ↵Craig Topper2018-01-207-26/+88
| | | | | | | | | | | | | | | | | | | that shrinkdemandedbits can do to zext_in_reg operations Summary: This patch adds an implementation of targetShrinkDemandedConstant that tries to keep shrinkdemandedbits from removing bits that would otherwise have been recognized as a movzx. We still need a follow patch to stop moving ands across srl if the and could be represented as a movzx before the shift but not after. I think this should help with some of the cases that D42088 ended up removing during isel. Reviewers: spatel, RKSimon Reviewed By: spatel Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D42265 llvm-svn: 323048
* [X86] Add rdpid command line option and intrinsics.Craig Topper2018-01-209-0/+44
| | | | | | | | | | | | | | Summary: This patch adds -mrdpid/-mno-rdpid and the rdpid intrinsic. The corresponding LLVM commit has already been made. Reviewers: RKSimon, spatel, zvi, AndreiGrischenko Reviewed By: RKSimon Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D42272 llvm-svn: 323047
* [X86] Put the code that defines __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 for the ↵Craig Topper2018-01-201-2/+2
| | | | | | preprocessor with the other __GCC_HAVE_SYNC_COMPARE_AND_SWAP_* defines. NFC llvm-svn: 323046
* [X86][SSE] Check for out of bounds PEXTR/PINSR indices during faux shuffle ↵Simon Pilgrim2018-01-201-2/+9
| | | | | | combining. llvm-svn: 323045
* Move new test from Generic to SystemZ.Jonas Paulsson2018-01-201-0/+0
| | | | | | | A few build bots failed with r323042 because they are not configured to build the SystemZ target. llvm-svn: 323044
* [InstCombine] add baseline tests for (X << Y) / X -> 1 << Y; NFCSanjay Patel2018-01-201-15/+131
| | | | | | This fold is proposed in D42032. llvm-svn: 323043
* [SelectionDAG] Fix codegen of vector stores with non byte-sized elements.Jonas Paulsson2018-01-2011-5906/+7267
| | | | | | | | | | | | | | This was completely broken, but hopefully fixed by this patch. In cases where it is needed, a vector with non byte-sized elements is stored by extracting, zero-extending, shift:ing and or:ing the elements into an integer of the same width as the vector, which is then stored. Review: Eli Friedman, Ulrich Weigand https://reviews.llvm.org/D42100#inline-369520 https://bugs.llvm.org/show_bug.cgi?id=35520 llvm-svn: 323042
* Assume the shared library path variable is LD_LIBRARY_PATH on systemsDimitry Andric2018-01-201-4/+3
| | | | | | | | except Darwin and Windows. This prevents inserting an environment variable with an empty name (which is illegal and leads to a Python exception) on any of the BSDs. llvm-svn: 323041
* Assume the shared library path variable is LD_LIBRARY_PATH on systemsDimitry Andric2018-01-201-4/+3
| | | | | | | | except Darwin and Windows. This prevents inserting an environment variable with an empty name (which is illegal and leads to a Python exception) on any of the BSDs. llvm-svn: 323040
* [compiler-rt] Implement __clear_cache() on OpenBSD/mips64Kamil Rytarowski2018-01-201-0/+7
| | | | | | | | | | | | | | | | Summary: Make __clear_cache() invoke the platform's cache flush function on OpenBSD/mips64. Reviewers: krytarowski Reviewed By: krytarowski Subscribers: sdardis, dberris, arichardson, krytarowski, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D42332 llvm-svn: 323039
* [COFF] Keep the underscore on exported decorated stdcall functions in MSVC modeMartin Storsjo2018-01-204-11/+13
| | | | | | | | This fixes PR35733. Differential Revision: https://reviews.llvm.org/D41632 llvm-svn: 323036
* [COFF] Keep the underscore on exported decorated stdcall functions in MSVC modeMartin Storsjo2018-01-203-5/+15
| | | | | | | | | This (together with the corresponding LLD commit, that contains the testcase updates) fixes PR35733. Differential Revision: https://reviews.llvm.org/D41631 llvm-svn: 323035
* [Dominators] Fix some edge cases for PostDomTree updatingDavid Green2018-01-202-14/+109
| | | | | | | | | | These fix some odd cfg cases where batch-updating the post dom tree fails. Usually around infinite loops and roots ending up being different. Differential Revision: https://reviews.llvm.org/D42247 llvm-svn: 323034
* Revert "[Fuzzer] Parametrize add_custom_libcxx"Petr Hosek2018-01-205-42/+17
| | | | | | This reverts commit r323032: failing on the sanitizer-x86_64-linux-autoconf bot. llvm-svn: 323033
* [Fuzzer] Parametrize add_custom_libcxxPetr Hosek2018-01-205-17/+42
| | | | | | | | | | | | | add_custom_libcxx uses the just built compiler and installs the built libc++, e.g. for testing, neither of which is desirable in case of Fuzzer where the libc++ should be built using the host compiler and it's only linked into the libFuzzer and should never be installed. This change introduces additional arguments to add_custom_libcxx to allow parametrizing its behavior. Differential Revision: https://reviews.llvm.org/D42330 llvm-svn: 323032
* [X86] Add some more v32i1 shuffle tests with shuffles between mask creation ↵Craig Topper2018-01-201-0/+244
| | | | | | | | | | | | and mask usage rather than being just shuffling input arguments. The existing tests just tested shuffles of v32i1 inputs, but arguments are promoted to v32i8. So it wasn't a good demonstration of v32i1 shuffle handling. The new test cases use compares and selects to get k-register operations around the shuffle. This is prep work for demonstrating changes from D42031. llvm-svn: 323031
* [X86] Add test cases for failures to use movzx due to various issues with ↵Craig Topper2018-01-201-0/+108
| | | | | | | | demanded bits. D42265 and D42313 should help with some of these. llvm-svn: 323030
* Reland "Fix syntax error introduced in r322991"Petr Hosek2018-01-201-2/+2
| | | | | | | | This triggers compiler error when building sanitizers for Fuchsia. Differential Revision: https://reviews.llvm.org/D42328 llvm-svn: 323029
* Revert "[sanitizer] Fix syntax error introduced in r322991"Petr Hosek2018-01-201-2/+2
| | | | | | This reverts commit r323027: it breaks the SanitizerLintCheck. llvm-svn: 323028
* [sanitizer] Fix syntax error introduced in r322991Petr Hosek2018-01-201-2/+2
| | | | | | | | This triggers compiler error when building sanitizers for Fuchsia. Differential Revision: https://reviews.llvm.org/D42328 llvm-svn: 323027
* Force lit to execute the ASan and TSan tests on iOS devicesDan Liew2018-01-203-4/+18
| | | | | | | | | | | | | | | | | | | | sequentially. The current implementation of commands in `test/sanitizer_common/ios_commands/` for iOS devices cannot be executed in parallel which results in the ASan and TSan tests failing when executed in parallel by lit which was the default behaviour. We now force the ASan and TSan tests to be a new parallelism group named `darwin-ios-device-sanitizer` which allows only one test to be run at a time. We also emit a warning informing the user that tests are being run sequentially. This only applies if the target is an iOS device. Differential Revision: https://reviews.llvm.org/D42156 llvm-svn: 323026
* [WebAssembly] Remove special handling of entry point export.Sam Clegg2018-01-2012-45/+64
| | | | | | | | | | | | Its much easier to export it via setHidden(false), now that that is a thing. As a side effect the start function is not longer always exports first (becuase its being exported just like all the other function). Differential Revision: https://reviews.llvm.org/D42321 llvm-svn: 323025
* [WebAssembly] Remove redundant function: addSyntheticUndefinedFunction. NFC.Sam Clegg2018-01-202-10/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D42327 llvm-svn: 323024
* test: fix ARM tests harderSaleem Abdulrasool2018-01-201-1/+0
| | | | | | | Remove the missed check update for the removal of the x86 specific vector call on ARM. llvm-svn: 323023
* Link sanitized programs on NetBSD with -lkvmKamil Rytarowski2018-01-201-0/+3
| | | | | | | | | | | | | | | | | | | | | | | Summary: kvm - kernel memory interface The kvm(3) functions like kvm_open(), kvm_getargv() or kvm_getenvv() are used in programs that can request information about a kernel and its processes. The LLVM sanitizers will make use of them on NetBSD. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka, dvyukov Reviewed By: vitalybuka Subscribers: llvm-commits, cfe-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D42017 llvm-svn: 323022
* test: move ARM test from x86Saleem Abdulrasool2018-01-202-1/+14
| | | | | | | The ARM backend is not guaranteed to be present on x86, move the test to the ARM tests. llvm-svn: 323021
* [WebAssembly] Remove custom handling for undefined entrySam Clegg2018-01-202-2/+6
| | | | | | | | | | | This code was needed back when we were not able to write out the synthetic symbol for main. Add tests to make sure we can handle this now. Differential Revision: https://reviews.llvm.org/D42322 llvm-svn: 323020
* Support the localtime interceptor for NetBSDKamil Rytarowski2018-01-201-0/+1
| | | | | | | | | | | | | | | | | | | | Summary: The localtime symbol is mangled to __locatime50 on NetBSD. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka Reviewed By: vitalybuka Subscribers: kubamracek, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D42045 llvm-svn: 323019
* Intercept accept4() on NetBSDKamil Rytarowski2018-01-201-1/+1
| | | | | | | | | | | | | | | | | | | Summary: The accept4() function first appeared in NetBSD 8.0. Sponsored by <The NetBSD Foundation> Reviewers: joerg, vitalybuka Reviewed By: vitalybuka Subscribers: llvm-commits, srhines, kubamracek, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D42046 llvm-svn: 323018
* CodeGen: handle llvm.used properly for COFFSaleem Abdulrasool2018-01-207-0/+74
| | | | | | | | | `llvm.used` contains a list of pointers to named values which the compiler, assembler, and linker are required to treat as if there is a reference that they cannot see. Ensure that the symbols are preserved by adding an explicit `-include` reference to the linker command. llvm-svn: 323017
* [X86] Teach X86 codegen to use vector width preference to avoid promoting to ↵Craig Topper2018-01-209-17/+1353
| | | | | | | | | | | | | | | | 512-bit types when VLX is enabled and the preference is for a smaller size. This change applies to places where we would turn 128/256-bit code into 512-bit in order to get a wider element type through sext/zext. Any 512-bit types that already existed in the IR/DAG will be left that way. The width preference has no effect on codegen behavior when the target does not have AVX512 enabled. So AVX/AVX2 codegen cannot be limited via this mechanism yet. If the preference is lower than 256 we may still use a 256 bit type to do the operation. Constraining to 128 bits makes it much more difficult to support some operations. For many of these cases we need to change element width while keeping element count constant which is easiest done by switching between 256 and 128 bit. The preference is only obeyed when AVX512 and VLX are available. This means the preference is not obeyed for KNL, but is obeyed for SKX, Cannonlake, and Icelake. For KNL, the only way to do masked operation is on 512-bit registers so we would have to completely disable masking to obey the preference. We would also lose support for gather, scatter, ctlz, vXi64 multiplies, etc. This may change in the future, but this simplifies the initial implementation. Differential Revision: https://reviews.llvm.org/D41895 llvm-svn: 323016
* [X86] Add support for passing 'prefer-vector-width' function attribute into ↵Craig Topper2018-01-206-8/+131
| | | | | | | | | | | | X86Subtarget and exposing via X86's getRegisterWidth TTI interface. This will cause the vectorizers to do some limiting of the vector widths they create. This is not a strict limit. There are reasons I know of that the loop vectorizer will generate larger vectors for. I've written this in such a way that the interface will only return a properly supported width(0/128/256/512) even if the attribute says something funny like 384 or 10. This has been split from D41895 with the remainder in a follow up commit. llvm-svn: 323015
* Avoid divisions.Rui Ueyama2018-01-201-1/+1
| | | | | | | | Compiler doesn't know the fact that Config->WordSize * 8 is always a power of two, so it had to use the div instruction to divide some number with C. llvm-svn: 323014
* [TSan][MIPS] Expand sanitizer memory space to lower addressesPetar Jovanovic2018-01-201-13/+15
| | | | | | | | | | | | | | | | | | | | MemToShadowImpl() maps lower addresses to a memory space out of sanitizers range. The simplest example is address 0 which is mapped to 0x2000000000 static const uptr kShadowBeg = 0x2400000000ull; but accessing the address during tsan execution will lead to a segmentation fault. This patch expands the range used by the sanitizer and ensures that 1/8 of the maximum valid address in the virtual address spaces is used for shadow memory. Patch by Milos Stojanovic. Differential Revision: https://reviews.llvm.org/D41777 llvm-svn: 323013
* [WebAssembly] Fix MSVC buildDerek Schuff2018-01-201-5/+6
| | | | | | nullptr_t can't be used left of boolean && llvm-svn: 323012
* [clang-tidy] Adding Fuchsia checker for multiple inheritanceJulie Hockett2018-01-198-0/+360
| | | | | | | | | | | | Adds a check to the Fuchsia module to warn when a class inherits from multiple classes that are not pure virtual. See https://fuchsia.googlesource.com/zircon/+/master/docs/cxx.md for reference. Differential Revision: https://reviews.llvm.org/D40580 llvm-svn: 323011
* Make the bloom filter a bit larger.Rui Ueyama2018-01-191-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I created https://reviews.llvm.org/D42202 to see how large the bloom filter should be. With that patch, I tested various bloom filter sizes with the following commands: $ cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DLLVM_ENABLE_LLD=true \ -DLLVM_ENABLE_PROJECTS='clang;lld' -DBUILD_SHARED_LIBS=ON \ -DCMAKE_SHARED_LINKER_FLAGS=-Wl,-bloom-filter-bits=<some integer> \ ../llvm-project/llvm $ rm -f $(find . -name \*.so.7.0.0svn) $ ninja lld $ LD_BIND_NOW=1 perf stat bin/ld.lld Here is the result: -bloom-filter-bits=8 0.220351609 seconds -bloom-filter-bits=10 0.217146597 seconds -bloom-filter-bits=12 0.206870826 seconds -bloom-filter-bits=16 0.209456312 seconds -bloom-filter-bits=32 0.195092075 seconds Currently we allocate 8 bits for a symbol, but according to the above result, that number is not optimal. Even though the numbers follow the diminishing return rule, the point where a marginal improvement becomes too small is not -bloom-filter-bits=8 but 12. So this patch sets it to 12. Differential Revision: https://reviews.llvm.org/D42204 llvm-svn: 323010
* [ObjCARC] Do not turn a call to @objc_autoreleaseReturnValue into a callAkira Hatanaka2018-01-195-1/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | to @objc_autorelease if its operand is a PHI and the PHI has an equivalent value that is used by a return instruction. For example, ARC optimizer shouldn't replace the call in the following example, as doing so breaks the AutoreleaseRV/RetainRV optimization: %v1 = bitcast i32* %v0 to i8* br label %bb3 bb2: %v3 = bitcast i32* %v2 to i8* br label %bb3 bb3: %p = phi i8* [ %v1, %bb1 ], [ %v3, %bb2 ] %retval = phi i32* [ %v0, %bb1 ], [ %v2, %bb2 ] ; equivalent to %p %v4 = tail call i8* @objc_autoreleaseReturnValue(i8* %p) ret i32* %retval Also, make sure ObjCARCContract replaces @objc_autoreleaseReturnValue's operand uses with its value so that the call gets tail-called. rdar://problem/15894705 llvm-svn: 323009
* [Lex] Fix crash on code completion in comment in included file.Volodymyr Sapsai2018-01-194-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes PR32732 by updating CurLexerKind to reflect available lexers. We were hitting null pointer in Preprocessor::Lex because CurLexerKind was CLK_Lexer but CurLexer was null. And we set it to null in Preprocessor::HandleEndOfFile when exiting a file with code completion point. To reproduce the crash it is important for a comment to be inside a class specifier. In this case in Parser::ParseClassSpecifier we improve error recovery by pushing a semicolon token back into the preprocessor and later on try to lex a token because we haven't reached the end of file. Also clang crashes only on code completion in included file, i.e. when IncludeMacroStack is not empty. Though we reset CurLexer even if include stack is empty. The difference is that during pushing back a semicolon token, preprocessor calls EnterCachingLexMode which decides it is already in caching mode because various lexers are null and IncludeMacroStack is not empty. As the result, CurLexerKind remains CLK_Lexer instead of updating to CLK_CachingLexer. rdar://problem/34787685 Reviewers: akyrtzi, doug.gregor, arphaman Reviewed By: arphaman Subscribers: cfe-commits, kfunk, arphaman, nemanjai, kbarton Differential Revision: https://reviews.llvm.org/D41688 llvm-svn: 323008
* Wrap all references to build artifacts in the LLDB testsuite (NFC)Adrian Prantl2018-01-19413-621/+639
| | | | | | | | | in TestBase::getBuildArtifact(). This NFC commit is in preparation for https://reviews.llvm.org/D42281 (compile the LLDB tests out-of-tree). Differential Revision: https://reviews.llvm.org/D42280 llvm-svn: 323007
OpenPOWER on IntegriCloud