summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* [docs] Fix a small typoVedant Kumar2017-10-261-2/+2
| | | | llvm-svn: 316682
* [X86] Add a target attribute test for no-sse4.Craig Topper2017-10-261-6/+9
| | | | llvm-svn: 316681
* AMDGPU: Commit missing fence-barrier testKonstantin Zhuravlyov2017-10-261-0/+197
| | | | | | This should have been committed with memory model implementation llvm-svn: 316680
* Clear LastMappingSymbols and LastEMS(Info) when resetting the ↵Yichao Yu2017-10-262-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | ARM(AArch64)ELFStreamer Summary: This causes a segfault on ARM when (I think) the pass manager is used multiple times. Reset set the (last) current section to NULL without saving the corresponding LastEMSInfo back into the map. The next use of the streamer then save the LastEMSInfo for the NULL section leaving the LastEMSInfo mapping for the last current section (the one that was there before the reset) NULL which cause the LastEMSInfo to be set to NULL when the section is being used again. The reuse of the section (pointer) might mean that the map was holding dangling pointers previously which is why I went for clearing the map and resetting the info, making it as similar to the state right after the constructor run as possible. The AArch64 one doesn't have segfault (since LastEMS isn't a pointer) but it seems to have the same issue. The segfault is likely caused by https://reviews.llvm.org/D30724 which turns LastEMSInfo into a pointer. As mentioned above, it seems that the actual issue was older though. No test is included since the test is believed to be too complicated for such an obvious fix and not worth doing. Reviewers: llvm-commits, shankare, t.p.northover, peter.smith, rengolin Reviewed By: rengolin Subscribers: mgorny, aemerson, rengolin, javed.absar, kristof.beyls Differential Revision: https://reviews.llvm.org/D38588 llvm-svn: 316679
* [dsymutil] Check AttrInfo.Name validity before using itKeno Fischer2017-10-261-1/+2
| | | | | | | | | | | | | | | | | | Summary: This upstreams a patch from the osxcross [1] toolchain. It appears that llvm-dsymutil crashes at this place during GCC bootstrap. Adding the check here seems reasonable, since it operates on arbitrary input DWARF, not necessarily generated by the LLVM toolchain, and it seems the un-mangled name need not necessarily exist. Patch by Thomas Pöchtrager [1] https://github.com/tpoechtrager/osxcross Reviewed By: aprantl Differential Revision: https://reviews.llvm.org/D39336 llvm-svn: 316678
* Move MS inline asm parser methods out of line to reduce indentation, NFCReid Kleckner2017-10-261-98/+118
| | | | llvm-svn: 316674
* Allow SysV-i386 ABI on everything other than Apple targetsStephane Sezer2017-10-261-5/+6
| | | | | | | | | | | | | | Summary: This matches other SysV ABIs that are different on Apple and non-Apple targets, like `ABISysV_arm.cpp` for instance. Reviewers: clayborg, emaste Subscribers: aemerson, kristof.beyls, lldb-commits Differential Revision: https://reviews.llvm.org/D39335 llvm-svn: 316673
* [DynamicLibrary] Fix build on musl libcKeno Fischer2017-10-261-1/+1
| | | | | | | | | | | | | | | | | | | | | Summary: On musl libc, stdin/out/err are defined as `FILE* const` globals, and their address is not implicitly convertible to void *, or at least gcc 6 doesn't allow it, giving errors like: ``` error: cannot initialize return object of type 'void *' with an rvalue of type 'FILE *const *' (aka '_IO_FILE *const *') EXPLICIT_SYMBOL(stderr); ^~~~~~~~~~~~~~~~~~~~~~~ ``` Add an explicit cast to fix that problem. Reviewers: marsupial, krytarowski, dim Reviewed By: dim Differential Revision: https://reviews.llvm.org/D39297 llvm-svn: 316672
* [MachineModuleInfoImpls] Replace qsort with array_pod_sortMandeep Singh Grang2017-10-261-10/+4
| | | | | | | | | | | | | | | | Summary: This seems to be the only place in llvm we directly call qsort. We can replace this with a call to array_pod_sort. Also minor cleanup of the sorting function. Reviewers: bkramer, Eugene.Zelenko, rafael Reviewed By: bkramer Subscribers: efriedma, llvm-commits Differential Revision: https://reviews.llvm.org/D39214 llvm-svn: 316671
* Add objcCategoryImplDecl matcherDave Lee2017-10-264-1/+28
| | | | | | | | | | | | | | | | | Summary: Add `objcCategoryImplDecl` which matches ObjC category definitions (`@implementation`). This matcher complements `objcCategoryDecl` (`@interface`) which was added in D30854. Reviewers: aaron.ballman, malcolm.parsons, alexshap Reviewed By: aaron.ballman Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D39293 llvm-svn: 316670
* Reapply r316582 [Local] Fix a bug in the domtree update logic for ↵Balaram Makam2017-10-262-3/+52
| | | | | | | | | | | | MergeBasicBlockIntoOnlyPred. Summary: This reverts r316612 to reapply r316582. The buildbot failure was unrelated to this commit. Reviewers: Subscribers: llvm-svn: 316669
* Represent runtime preemption in the IR.Sean Fertile2017-10-2620-49/+1262
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently we do not represent runtime preemption in the IR, which has several drawbacks: 1) The semantics of GlobalValues differ depending on the object file format you are targeting (as well as the relocation-model and -fPIE value). 2) We have no way of disabling inlining of run time interposable functions, since in the IR we only know if a function is link-time interposable. Because of this llvm cannot support elf-interposition semantics. 3) In LTO builds of executables we will have extra knowledge that a symbol resolved to a local definition and can't be preemptable, but have no way to propagate that knowledge through the compiler. This patch adds preemptability specifiers to the IR with the following meaning: dso_local --> means the compiler may assume the symbol will resolve to a definition within the current linkage unit and the symbol may be accessed directly even if the definition is not within this compilation unit. dso_preemptable --> means that the compiler must assume the GlobalValue may be replaced with a definition from outside the current linkage unit at runtime. To ease transitioning dso_preemptable is treated as a 'default' in that low-level codegen will still do the same checks it did previously to see if a symbol should be accessed indirectly. Eventually when IR producers emit the specifiers on all Globalvalues we can change dso_preemptable to mean 'always access indirectly', and remove the current logic. Differential Revision: https://reviews.llvm.org/D20217 llvm-svn: 316668
* AMDGPU: Handle s_buffer_load_dword hazard on SIMarek Olsak2017-10-262-0/+44
| | | | | | | | | | Reviewers: arsenm, nhaehnle Subscribers: kzhuravl, wdng, yaxunl, dstuttard, tpr, llvm-commits, t-tye Differential Revision: https://reviews.llvm.org/D39171 llvm-svn: 316666
* [LSV] Avoid adding vectors of pointers as candidatesBjorn Pettersson2017-10-262-3/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: We no longer add vectors of pointers as candidates for load/store vectorization. It does not seem to work anyway, but without this patch we can end up in asserts when trying to create casts between an integer type and the pointer of vectors type. The test case I've added used to assert like this when trying to cast between i64 and <2 x i16*>: opt: ../lib/IR/Instructions.cpp:2565: Assertion `castIsValid(op, S, Ty) && "Invalid cast!"' failed. #0 PrintStackTraceSignalHandler(void*) #1 SignalHandler(int) #2 __restore_rt #3 __GI_raise #4 __GI_abort #5 __GI___assert_fail #6 llvm::CastInst::Create(llvm::Instruction::CastOps, llvm::Value*, llvm::Type*, llvm::Twine const&, llvm::Instruction*) #7 llvm::IRBuilder<llvm::ConstantFolder, llvm::IRBuilderDefaultInserter>::CreateBitOrPointerCast(llvm::Value*, llvm::Type*, llvm::Twine const&) #8 Vectorizer::vectorizeStoreChain(llvm::ArrayRef<llvm::Instruction*>, llvm::SmallPtrSet<llvm::Instruction*, 16u>*) Reviewers: arsenm Reviewed By: arsenm Subscribers: nhaehnle, llvm-commits Differential Revision: https://reviews.llvm.org/D39296 llvm-svn: 316665
* [LSV] Skip all non-byte sizes, not only less than eight bitsBjorn Pettersson2017-10-262-2/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The code comments indicate that no effort has been spent on handling load/stores when the size isn't a multiple of the byte size correctly. However, the code only avoided types smaller than 8 bits. So for example a load of an i28 could still be considered as a candidate for vectorization. This patch adjusts the code to behave according to the code comment. The test case used to hit the following assert when trying to use "cast" an i32 to i28 using CreateBitOrPointerCast: opt: ../lib/IR/Instructions.cpp:2565: Assertion `castIsValid(op, S, Ty) && "Invalid cast!"' failed. #0 PrintStackTraceSignalHandler(void*) #1 SignalHandler(int) #2 __restore_rt #3 __GI_raise #4 __GI_abort #5 __GI___assert_fail #6 llvm::CastInst::Create(llvm::Instruction::CastOps, llvm::Value*, llvm::Type*, llvm::Twine const&, llvm::Instruction*) #7 llvm::IRBuilder<llvm::ConstantFolder, llvm::IRBuilderDefaultInserter>::CreateBitOrPointerCast(llvm::Value*, llvm::Type*, llvm::Twine const&) #8 (anonymous namespace)::Vectorizer::vectorizeLoadChain(llvm::ArrayRef<llvm::Instruction*>, llvm::SmallPtrSet<llvm::Instruction*, 16u>*) Reviewers: arsenm Reviewed By: arsenm Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D39295 llvm-svn: 316663
* [Sema] -Wzero-as-null-pointer-constant: don't warn for system macros other ↵Roman Lebedev2017-10-264-5/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | than NULL. Summary: The warning was initially introduced in D32914 by @thakis, and the concerns were raised there, and later in rL302247 and PR33771. I do believe that it makes sense to relax the diagnostic e.g. in this case, when the expression originates from the system header, which can not be modified. This prevents adoption for the diagnostic for codebases which use pthreads (`PTHREAD_MUTEX_INITIALIZER`), gtest, etc. As @malcolm.parsons suggests, it *may* make sense to also not warn for the template types, but it is not obvious to me how to do that in here. Though, it still makes sense to complain about `NULL` macro. While there, add more tests. Reviewers: dblaikie, thakis, rsmith, rjmccall, aaron.ballman Reviewed By: thakis Subscribers: Rakete1111, hans, cfe-commits, thakis, malcolm.parsons Tags: #clang Differential Revision: https://reviews.llvm.org/D38954 llvm-svn: 316662
* Try to fix warnings and windows test failures caused by r316653Eric Liu2017-10-262-10/+10
| | | | llvm-svn: 316661
* [Simplify] Mark (and sweep) based on latest access relation.Michael Kruse2017-10-267-2/+334
| | | | | | | | | Previously we marked scalars based on the original access function. However, when a scalar read access is redirected, the original definition (or incoming values of a PHI) is not used anymore, and can be deleted (unless referenced by use that has not been redirected). llvm-svn: 316660
* [clangd] Report an error on findDefinitions/signatureHelp on an unopened ↵Benjamin Kramer2017-10-266-29/+45
| | | | | | | | file instead of crashing. Found by clangd-fuzzer. llvm-svn: 316659
* Add a new attribute definition spelling, Clang<"attr">, that expands to two ↵Aaron Ballman2017-10-262-73/+53
| | | | | | | | | | attribute spellings: GNU<"attr"> and CXX11<"clang", "attr">. This is similar to how the GCC spelling works and is intended to be used for attributes introduced for Clang. Changes all existing attributes that currently use GNU<"attr"> and CXX11<"clang", "attr> spellings to instead use the Clang<"attr"> spelling. No additional tests are necessary because the existing tests already use both spellings for the attributes converted to the new spelling. No functional changes are expected. llvm-svn: 316658
* [libunwind] Always use unwind tables in testsPeter Smith2017-10-261-3/+4
| | | | | | | | | | | | | | | For many targets setting -fno-exceptions will prevent unwinding tables from being generated for the test programs. As libunwind depends on the tables to unwind the stack several tests will fail. This change always adds -funwind-tables so that even when -fno-exceptions is set unwind tables are generated. fixes PR33858 Differential Revision: https://reviews.llvm.org/D37484 llvm-svn: 316657
* [mips] Fix (dis)assembly of abs.fmt for micromipsSimon Dardis2017-10-265-7/+24
| | | | | | | | | | | These instructions were previously marked as codegen only preventing them from being assembled as microMIPS or disassembled. Reviewers: atanasyan, abeserminji Differential Revision: https://reviews.llvm.org/D39123 llvm-svn: 316656
* It's a test to demonstrate wrong disassembler with 0x67 prefixAndrew V. Tischenko2017-10-261-0/+8
| | | | llvm-svn: 316655
* [mips] Fix PR35071Simon Dardis2017-10-262-13/+85
| | | | | | | | | | | | | | | | | | | | PR35071 exposed the fact that MipsInstrInfo::removeBranch did not walk past debug instructions when removing branches for the control flow optimizer, which lead to duplicated conditional branches. If the target of the branch was a removable block, only the conditional branch in the terminating position would have it's MBB operands updated, leaving the first branch with a dangling MBB operand. The MIPS long branch pass would then trigger an assertion when attempting to examine the instruction with dangling MBB operand. This resolves PR35071. Thanks to Alex Richardson for reporting the issue! Reviewers: atanasyan Differential Revision: https://reviews.llvm.org/D39288 llvm-svn: 316654
* [Tooling] A new framework for executing clang frontend actions.Eric Liu2017-10-2613-10/+720
| | | | | | | | | | | | | | | | | | | | | | | Summary: This defines a `clang::tooling::ToolExecutor` interface that can be extended to support different execution plans including standalone execution on a given set of TUs or parallel execution on all TUs in a codebase. In order to enable multiprocessing execution, tool actions are expected to output result into a `ToolResults` interface provided by executors. The `ToolResults` interface abstracts how results are stored e.g. in-memory for standalone executions or on-disk for large-scale execution. New executors can be registered as `ToolExecutorPlugin`s via the `ToolExecutorPluginRegistry`. CLI tools can use `createExecutorFromCommandLineArgs` to create a specific registered executor according to the command-line arguments. This patch also implements `StandaloneToolExecutor` which has the same behavior as the current `ClangTool` interface, i.e. execute frontend actions on a given set of TUs. At this point, it's simply a wrapper around `ClangTool` at this point. This is still experimental but expected to replace the existing `ClangTool` interface so that specific tools would not need to worry about execution. Reviewers: klimek, arphaman, hokein, sammccall Reviewed By: klimek Subscribers: cfe-commits, djasper, mgorny, omtcyfz Differential Revision: https://reviews.llvm.org/D34272 llvm-svn: 316653
* [clangd] Don't crash on empty textDocument/didChange.Benjamin Kramer2017-10-262-0/+6
| | | | | | Found by clangd-fuzzer. llvm-svn: 316652
* Update my email addresses, NFC.Simon Dardis2017-10-262-2/+2
| | | | llvm-svn: 316651
* [clangd] Don't use /// for non-doxygen comments.Benjamin Kramer2017-10-262-8/+4
| | | | llvm-svn: 316650
* [clangd] Add a simple fuzzer. It crashes a lot :)Benjamin Kramer2017-10-263-0/+60
| | | | llvm-svn: 316649
* [ELF] - Dedupliсate FDEs when sections are ICFed.George Rimar2017-10-263-9/+107
| | | | | | | | | | | | | | When LLD do ICF for 2 identical sections it leaves 2 duplicate entries in .eh_frame pointing to the same address. After that it fixes .eh_frame_header's header, so that it says it contains single FDE, though section itself contains 2 (it contains garbage data at tail). As a result excessive entries in .eh_frame and excessive dummy data in .eh_frame_header emited to output. Patch fixes that. This is PR34518. Differential revision: https://reviews.llvm.org/D38998 llvm-svn: 316648
* [PowerPC] Use record-form instruction for Less-or-Equal -1 and ↵Hiroshi Inoue2017-10-262-30/+75
| | | | | | | | | | | Greater-or-Equal 1 Currently a record-form instruction is used for comparison of "greater than -1" and "less than 1" by modifying the predicate (e.g. LT 1 into LE 0) in addition to the naive case of comparison against 0. This patch also enables emitting a record-form instruction for "less than or equal to -1" (i.e. "less than 0") and "greater than or equal to 1" (i.e. "greater than 0") to increase the optimization opportunities. Differential Revision: https://reviews.llvm.org/D38941 llvm-svn: 316647
* Fix overloaded static functions in SemaCodeCompleteBenjamin Kramer2017-10-264-10/+86
| | | | | | | | | | | | | | | | | | | | | https://bugs.llvm.org/show_bug.cgi?id=33904 Happens when static function is accessed via the class variable. That leads to incorrect overloads number because the variable is considered as the first argument. struct Bar { static void foo(); static void foo(int); }; int main() { Bar b; b.foo(/*complete here*/); // did not work before Bar::foo(/*complete here*/); // worked fine } Patch by Ivan Donchevskii! Differential Revision: https://reviews.llvm.org/D36390 llvm-svn: 316646
* [clang-tidy ObjC] [2/3] Support non-C++ files in ClangTidyTestHaojian Wu2017-10-261-7/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is part 2 of 3 of a series of changes to improve Objective-C linting in clang-tidy. Currently, `clang::tidy::test::runCheckOnCode()` assumes all files are C++ and unconditionally adds `-std=c++11` to the list of `clang-tidy` options. This updates the logic to check the extension of the source file and only add `-std=c++11` if the extension indicates C++ or Objective-C++. Depends On D39188 Test Plan: ninja ClangTidyTests && \ ./tools/clang/tools/extra/unittests/clang-tidy/ClangTidyTests Patch by Ben Hamilton! Reviewers: hokein, alexfh Reviewed By: hokein Subscribers: Wizard Differential Revision: https://reviews.llvm.org/D39189 llvm-svn: 316645
* Tidy up CountingFunctionInserter a little. NFC.Hans Wennborg2017-10-261-8/+4
| | | | | | | Use StringRef for CountingFunctionName, remove erroneous comment copied from InstructionNamer, and drop some trailing whitespace. llvm-svn: 316644
* [clang-tidy ObjC] [1/3] New module `objc` for Objective-C checksHaojian Wu2017-10-2611-0/+97
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is part 1 of 3 of a series of changes to improve Objective-C linting in clang-tidy. This introduces a new clang-tidy module, `objc`, specifically for Objective-C / Objective-C++ checks. The module is currently empty; D39142 adds the first check. Test Plan: `ninja check-clang-tools` Patch by Ben Hamilton! Reviewers: hokein, alexfh Reviewed By: hokein Subscribers: Wizard, mgorny Differential Revision: https://reviews.llvm.org/D39188 llvm-svn: 316643
* [DeLICM] Add more tests for loop layouts. NFC.Michael Kruse2017-10-269-0/+1033
| | | | llvm-svn: 316642
* [AsmParser][TableGen] Add VariantID argument to the generated mnemonic spell ↵Craig Topper2017-10-264-8/+21
| | | | | | | | check function so it can use the correct table based on variant. I'm considering implementing the mnemonic spell checker for x86, and that would require the separate intel and att variants. llvm-svn: 316641
* [AsmParser][TableGen] Make the generated mnemonic spell checker function a ↵Craig Topper2017-10-264-6/+15
| | | | | | | | file local static function. Also only emit in targets that specificially request it. This is required so we don't get an unused static function error. llvm-svn: 316640
* [X86] Use correct type for return value of ComputeAvailableFeatures in the ↵Craig Topper2017-10-261-1/+1
| | | | | | | | AsmParser. NFC There aren't enough used bits to make this a functional change, but we should fix it for consistency. llvm-svn: 316639
* [sanitizer] Fix internal symbolized build on Debian 9Vitaly Buka2017-10-261-2/+2
| | | | llvm-svn: 316637
* [LSan] Enable -fsanitize=leak for PPC64 Linux.Alex Shlyapnikov2017-10-262-1/+4
| | | | | | | | | | | | Summary: . Reviewers: eugenis Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D39312 llvm-svn: 316636
* [lit] Respect LLVM_LIT_TOOLS_DIR when looking for 'tar' on Windows.Igor Kudrin2017-10-261-5/+7
| | | | | | | | | | Changes in D38977 expect 'tar' to be found in one of PATH directories. On Windows, one might opt to use LLVM_LIT_TOOLS_DIR rather than add MSYS tools directory to the PATH. In that case, tests for lld failed on run. Differential Revision: https://reviews.llvm.org/D39278 llvm-svn: 316635
* [Transforms] Revert r316630 changes in Scalar/MergeICmps.cpp to fix broken ↵Eugene Zelenko2017-10-261-62/+31
| | | | | | build bots (NFC). llvm-svn: 316634
* [LSan] Adjust LSan allocator limits for PPC64.Alex Shlyapnikov2017-10-261-2/+9
| | | | | | | | | | | | Summary: Now the limits are the same as for ASan allocator. Reviewers: cryptoad Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D39309 llvm-svn: 316633
* [Analyzer] [Tests] Consistently use exit codes. Use code=42 to signify ↵George Karpenkov2017-10-262-10/+13
| | | | | | different results llvm-svn: 316632
* Allow StmtPrinter to supress implicit 'this' and 'self' base expressionsAlex Lorenz2017-10-263-18/+105
| | | | | | | | This will be useful for certain refactoring actions. rdar://34202062 llvm-svn: 316631
* [Transforms] Fix some Clang-tidy modernize and Include What You Use ↵Eugene Zelenko2017-10-2614-178/+364
| | | | | | warnings; other minor fixes (NFC). llvm-svn: 316630
* Makefile.rules: move CFLAGS_EXTRAS to the end of compile linePavel Labath2017-10-251-5/+5
| | | | | | | | | This makes sure that any options specified there override generic compiler options. This fixes TestBreakpointIt.py llvm-svn: 316629
* [libFuzzer] trying to make a test more stable on MacKostya Serebryany2017-10-251-1/+1
| | | | llvm-svn: 316627
* Fix SizeOfImage in the PE header.Rui Ueyama2017-10-252-2/+2
| | | | | | | | | | | | | IIUC, SizeOfImage is the distance from the end of the last section to the image base, rounded up to the page size. So the previous code is wrong. Should fix https://bugs.llvm.org/show_bug.cgi?id=34949 (It is nice to know that lld is already being used to create Putty distribution binaries.) llvm-svn: 316626
OpenPOWER on IntegriCloud