summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [SelectionDAGBuilder] Restrict vector reduction check to types with a power ↵Craig Topper2018-07-221-0/+4
| | | | | | | | of 2 number of elements. The check for the shuffles usages probably isn't correct for non power of 2 vectors. llvm-svn: 337651
* [X86] Add more MADD recurrence test cases with larger and narrower vector ↵Craig Topper2018-07-221-259/+1173
| | | | | | widths. llvm-svn: 337650
* Implement a better copy_file.Eric Fiselier2018-07-226-324/+666
| | | | | | | | | | | | | | | | | | | | This patch improves both the performance, and the safety of the copy_file implementation. The performance improvements are achieved by using sendfile on Linux and copyfile on OS X when available. The TOCTOU hardening is achieved by opening the source and destination files and then using fstat to check their attributes to see if we can copy them. Unfortunately for the destination file, there is no way to open it without accidentally creating it, so we first have to use stat to determine if it exists, and if we should copy to it. Then, once we're sure we should try to copy, we open the dest file and ensure it names the same entity we previously stat'ed. llvm-svn: 337649
* [llvm-mca][docs] Add documentation for the statistic outputs from mca. NFCMatt Davis2018-07-211-3/+125
| | | | | | | | | | | | | | Summary: The original text was lifted from the MCA README. I re-ran the dot-product example and updated the output seen in the docs. I also added a few paragraphs discussing the instruction issued and retired histograms, as well as discussing the register file stats. Reviewers: andreadb, RKSimon, courbet, gbedwell, filcab Reviewed By: andreadb Subscribers: tschuett Differential Revision: https://reviews.llvm.org/D49614 llvm-svn: 337648
* [mips] Factor out register class selection for global base register. NFCSimon Atanasyan2018-07-211-18/+20
| | | | | | | Factor out register class selection for global base register into a separate function to escape long chain of ternary operators. llvm-svn: 337647
* [mips] Move out the WrapperPat declaration from the NotInMicroMips predicateSimon Atanasyan2018-07-213-5/+92
| | | | | | | | | | | | | | | This is a follow-up to the rL335185. Those commit adds some WrapperPat patterns for microMIPS target. But declaration of the WrapperPat class is under the NotInMicroMips predicate and microMIPS patterns cannot be selected because predicate (Subtarget->inMicroMipsMode()) && (!Subtarget->inMicroMipsMode()) is always false. This change move out the WrapperPat class declaration from the NotInMicroMips predicate and enables microMIPS WrapperPat patterns. Differential revision: https://reviews.llvm.org/D49533 llvm-svn: 337646
* [llvm-undname] Flush output before demangling.Zachary Turner2018-07-211-1/+4
| | | | | | | | | If an error occurs and we write it to stderr, it could appear before we wrote the mangled name which we're undecorating. By flushing stdout first, we ensure that the messages are always sequenced in the correct order. llvm-svn: 337645
* Fix the MSVC Visualizers for SmallVector classes.Zachary Turner2018-07-211-21/+21
| | | | | | | Recent changes to the internal structure of SmallVector<> broke all of the MSVC visualizers. This fixes them. llvm-svn: 337644
* Early exit with cheaper checksAditya Kumar2018-07-211-13/+12
| | | | | | | Reviewers: sebpop,davide,fhahn,trentxintong Differential Revision: https://reviews.llvm.org/D49617 llvm-svn: 337643
* [InstrSimplify] fold sdiv if two operands are negated and non-overflowChen Zheng2018-07-214-34/+28
| | | | | | Differential Revision: https://reviews.llvm.org/D49382 llvm-svn: 337642
* [DebugInfo] Add a new DI flag to record if a C++ record is a trivial typeAaron Smith2018-07-212-1/+5
| | | | | | | | | | | | | | | | | | | | | | Summary: This flag is used when emitting debug info and is needed to initialize subprogram and member function attributes (function options) for Codeview. These function options are used to create an accurate compiler type for UDT symbols (class/struct/union) from PDBs. It is not easy to determine if a C++ record is trivial or not based on the current DICompositeType flags and other accessible debug information from Codeview. For example, without this flag the metadata for a non-trivial C++ record with user-defined ctor and a trivial one with a defaulted ctor are the same. struct S { S(); } struct S { S() = default; } This change introduces a new DI flag and corresponding clang::CXXRecordDecl::isTrivial method to set the flag in the frontend. Reviewers: rnk, zturner, llvm-commits, dblaikie, aleksandr.urakov, deadalnix Reviewed By: rnk Subscribers: asmith, probinson, aprantl, JDevlieghere Differential Revision: https://reviews.llvm.org/D45122 llvm-svn: 337641
* ELF: Read address significance tables with --icf=all.Peter Collingbourne2018-07-213-45/+92
| | | | | | | | | | | | | | | | Under --icf=all we now only apply KeepUnique to non-executable address-significant sections. This has the effect of making --icf=all mean unsafe ICF for executable sections and safe ICF for non-executable sections. With this change the meaning of the KeepUnique bit changes to "does the current ICF mode (together with the --keep-unique and --ignore-data-address-equality flags) require this section to be kept unique". Differential Revision: https://reviews.llvm.org/D49626 llvm-svn: 337640
* [HIP] Support -fcuda-flush-denormals-to-zero for amdgcnYaxun Liu2018-07-215-7/+20
| | | | | | Differential Revision: https://reviews.llvm.org/D48287 llvm-svn: 337639
* ELF: Make sections with KeepUnique bit eligible for ICF.Peter Collingbourne2018-07-212-5/+27
| | | | | | | | | | The only restriction is that we cannot merge more than one KeepUnique section together. This matches gold's behaviour and reduces code size when using --icf=safe. Differential Revision: https://reviews.llvm.org/D49622 llvm-svn: 337638
* [ORC] Re-apply r336760 with fixes.Lang Hames2018-07-215-12/+91
| | | | llvm-svn: 337637
* [NFC] CodeGen: rename memset to bzeroJF Bastien2018-07-201-30/+27
| | | | | | The optimization looks for opportunities to emit bzero, not memset. Rename the functions accordingly (and clang-format the diff) because I want to add a fallback optimization which actually tries to generate memset. bzero is still better and it would confuse the code to merge both. llvm-svn: 337636
* [Driver] Sanitizer support based on runtime library presenceGeorge Karpenkov2018-07-2022-42/+106
| | | | | | | | | | | | | | | The runtime libraries of sanitizers are built in compiler-rt, and Clang can be built without compiler-rt, or compiler-rt can be configured to only build certain sanitizers. The driver should provide reasonable diagnostics and not a link-time error when a runtime library is missing. This patch changes the driver for OS X to only support sanitizers of which we can find the runtime libraries. The discussion for this patch explains the rationale Differential Revision: https://reviews.llvm.org/D15225 llvm-svn: 337635
* Omit path to lld binary from lld's error, warning, and log output.Nico Weber2018-07-204-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lld currently prepends the absolute path to itself to every diagnostic it emits. This path can be longer than the diagnostic, and makes the actual error message hard to read. There isn't a good reason for printing this path: if you want to know which lld you're running, pass -v to clang – chances are that if you're unsure of this, you're not only unsure when it errors out. Some people want an indication that the diagnostic is from the linker though, so instead print just the basename of the linker's path. Before: ``` $ out/bin/clang -target x86_64-unknown-linux -x c++ /dev/null -fuse-ld=lld /Users/thakis/src/llvm-mono/out/bin/ld.lld: error: cannot open crt1.o: No such file or directory /Users/thakis/src/llvm-mono/out/bin/ld.lld: error: cannot open crti.o: No such file or directory /Users/thakis/src/llvm-mono/out/bin/ld.lld: error: cannot open crtbegin.o: No such file or directory /Users/thakis/src/llvm-mono/out/bin/ld.lld: error: unable to find library -lgcc /Users/thakis/src/llvm-mono/out/bin/ld.lld: error: unable to find library -lgcc_s /Users/thakis/src/llvm-mono/out/bin/ld.lld: error: unable to find library -lc /Users/thakis/src/llvm-mono/out/bin/ld.lld: error: unable to find library -lgcc /Users/thakis/src/llvm-mono/out/bin/ld.lld: error: unable to find library -lgcc_s /Users/thakis/src/llvm-mono/out/bin/ld.lld: error: cannot open crtend.o: No such file or directory /Users/thakis/src/llvm-mono/out/bin/ld.lld: error: cannot open crtn.o: No such file or directory clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` After: ``` $ out/bin/clang -target x86_64-unknown-linux -x c++ /dev/null -fuse-ld=lld ld.lld: error: cannot open crt1.o: No such file or directory ld.lld: error: cannot open crti.o: No such file or directory ld.lld: error: cannot open crtbegin.o: No such file or directory ld.lld: error: unable to find library -lgcc ld.lld: error: unable to find library -lgcc_s ld.lld: error: unable to find library -lc ld.lld: error: unable to find library -lgcc ld.lld: error: unable to find library -lgcc_s ld.lld: error: cannot open crtend.o: No such file or directory ld.lld: error: cannot open crtn.o: No such file or directory clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` https://reviews.llvm.org/D49189 llvm-svn: 337634
* Simplify; no behavior change.Nico Weber2018-07-201-4/+2
| | | | | | Reviewed as part of https://reviews.llvm.org/D49189 llvm-svn: 337633
* [clang-doc] Create a script to generate testsJulie Hockett2018-07-2024-1389/+1834
| | | | | | | | | Upstreaming the script I use to generate clang-doc tests (and updating the existing tests to use it) Differential Revision: https://reviews.llvm.org/D49268 llvm-svn: 337632
* [HIP] Register/unregister device fat binary only onceYaxun Liu2018-07-202-21/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | HIP generates one fat binary for all devices after linking. However, for each compilation unit a ctor function is emitted which register the same fat binary. Measures need to be taken to make sure the fat binary is only registered once. Currently each ctor function calls __hipRegisterFatBinary and stores the returned value to __hip_gpubin_handle. This patch changes the linkage of __hip_gpubin_handle to be linkonce so that they are shared between LLVM modules. Then this patch adds check of value of __hip_gpubin_handle to make sure __hipRegisterFatBinary is only called once. The code is equivalent to void *_gpubin_handle; void ctor() { if (__hip_gpubin_handle == 0) { __hip_gpubin_handle = __hipRegisterFatBinary(...); } // register kernels and variables. } The patch also does similar change to dtors so that __hipUnregisterFatBinary is called once. Differential Revision: https://reviews.llvm.org/D49083 llvm-svn: 337631
* [CMake] Install C++ ABI headers into the right locationPetr Hosek2018-07-201-10/+2
| | | | | | | | | | | This is a follow-up to r335809 and r337118. While libc++ headers are now installed into the right location in both standard as well as multiarch runtimes layout, turned out C++ ABI headers are still installed into the old location in the latter case. This change addresses that. Differential Revision: https://reviews.llvm.org/D49584 llvm-svn: 337630
* Disable clang crash-report-modules.m test on Windows againReid Kleckner2018-07-201-0/+4
| | | | | | | | | | | It still appears to be failing: http://lab.llvm.org:8011/builders/clang-x86-windows-msvc2015/builds/12825 $ "rm" "-rf" "C:\b\slave\clang-x86-windows-msvc2015\clang-x86-windows-msvc2015\stage1\tools\clang\test\Driver\Output/crmdir" Error: 'rm' command failed, [Error 3] The system cannot find the path specified: 'C:\\b\\slave\\clang-x86-windows-msvc2015\\clang-x86-windows-msvc2015\\stage1\\tools\\clang\\test\\Driver\\Output/crmdir\\crash-report-modules-300567.cache\\vfs\\b\\slave\\clang-x86-windows-msvc2015\\clang-x86-windows-msvc2015\\llvm\\tools\\clang\\test\\Driver\\Inputs\\module\\module.modulemap' error: command failed with exit status: 1 llvm-svn: 337629
* [PDB] Write the command line after response file expansionReid Kleckner2018-07-203-11/+16
| | | | | | | | | | | | Summary: Fixes PR38085 Reviewers: ruiu, zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D49566 llvm-svn: 337628
* Fold dangling-field warning into general initialization lifetime checks.Richard Smith2018-07-205-152/+191
| | | | llvm-svn: 337627
* Re-apply r337595 with fix for LLVM_ENABLE_THREADS=Off.Lang Hames2018-07-209-512/+749
| | | | llvm-svn: 337626
* [ADT] Only run death tests in !NDEBUGBenjamin Kramer2018-07-201-5/+7
| | | | | | These invoke undefined behavior. llvm-svn: 337625
* [Hexagon] Disable packets in test to avoid ordering issues in checksKrzysztof Parzyszek2018-07-201-2/+2
| | | | llvm-svn: 337624
* Change the cap on the amount of padding for each vtable to 32-byte ↵Peter Collingbourne2018-07-202-7/+9
| | | | | | | | | | | | | (previously it was 128-byte) We tested different cap values with a recent commit of Chromium. Our results show that the 32-byte cap yields the smallest binary and all the caps yield similar performance. Based on the results, we propose to change the cap value to 32-byte. Patch by Zhaomo Yang! Differential Revision: https://reviews.llvm.org/D49405 llvm-svn: 337622
* AMDGPU: Use existing function to check for VGPRsMatt Arsenault2018-07-201-16/+7
| | | | llvm-svn: 337621
* fix typoNico Weber2018-07-201-1/+1
| | | | llvm-svn: 337620
* [ms] Add __shiftleft128 / __shiftright128 intrinsicsNico Weber2018-07-202-0/+16
| | | | | | | | | | | | Carefully match the pattern matched by ISel so that this produces shld / shrd (unless Subtarget->isSHLDSlow() is true). Thanks to Craig Topper for providing the LLVM IR pattern that gets successfully matched. Fixes PR37755. llvm-svn: 337619
* Revert "[X86][AVX] Convert X86ISD::VBROADCAST demanded elts combine to use ↵Benjamin Kramer2018-07-202-48/+17
| | | | | | | | SimplifyDemandedVectorElts" This reverts commit r337547. It triggers an infinite loop. llvm-svn: 337617
* [codeview] Don't emit variable templates as class membersReid Kleckner2018-07-202-5/+45
| | | | | | | | | | | | | MSVC doesn't, so neither should we. Fixes PR38004, which is a crash that happens when we try to emit debug info for a still-dependent partial variable template specialization. As a follow-up, we should review what we're doing for function and class member templates. It looks like we don't filter those out, but I can't seem to get clang to emit any. llvm-svn: 337616
* [llvm-undname] Remove a superfluous semicolon. NFC.Martin Storsjo2018-07-201-2/+2
| | | | llvm-svn: 337615
* [COFF] Use symbolic constants instead of hardcoded numbers. NFCI.Martin Storsjo2018-07-201-1/+6
| | | | | | Patch by Martell Malone. llvm-svn: 337614
* [COFF] Adjust how we flag weak externalsMartin Storsjo2018-07-206-11/+71
| | | | | | | | | | This fixes PR36096. Originally based on a patch by Martell Malone. Differential Revision: https://reviews.llvm.org/D44357 llvm-svn: 337613
* AMDGPU: Switch default dwarf version to 2Konstantin Zhuravlyov2018-07-202-2/+2
| | | | | | | | | There were some problems unearthed with version 5, which I am going to look at. Differential Revision: https://reviews.llvm.org/D49613 llvm-svn: 337612
* [CStringSyntaxChecker] Fix build bot builds != x86 archsDavid Carlier2018-07-202-8/+13
| | | | | | | | | | Reviewers: NoQ,george.karpenkov Reviewed By: NoQ Differential Revision: https://reviews.llvm.org/D49588 llvm-svn: 337611
* [ELF] Check eh_frame_hdr overflow with PC offsets instead of PC absolute ↵Fangrui Song2018-07-205-49/+81
| | | | | | | | | | | | addresses Reviewers: grimar, ruiu, espindola Subscribers: emaste, arichardson, llvm-commits Differential Revision: https://reviews.llvm.org/D49607 llvm-svn: 337610
* [FileCheck] Provide an option for FileCheck to dump original input to stderr ↵George Karpenkov2018-07-204-2/+35
| | | | | | | | | | | | | | | | on failure The option can be either set using environment variable (e.g. env FILECHECK_DUMP_INPUT_ON_FAILURE=1 ninja check-fuzzer) or with a FileCheck flag. This can be extremely useful for debugging, cf. https://groups.google.com/forum/#!topic/llvm-dev/kLrzg8OM_h8 for discussion. Differential Revision: https://reviews.llvm.org/D49328 llvm-svn: 337609
* Revert r337595 "[ORC] Add new symbol lookup methods to ExecutionSessionBase ↵Reid Kleckner2018-07-209-749/+512
| | | | | | | | in preparation for" Breaks the build with LLVM_ENABLE_THREADS=OFF. llvm-svn: 337608
* [AST] Various micro-optimizations in CXXInheritanceBenjamin Kramer2018-07-202-28/+33
| | | | | | | | | | | | | | | | | 1. Pack std::pair<bool, unsigned> in CXXBasePaths::ClassSubobjects. 2. Use a SmallPtrSet instead of a SmallDenseSet for CXXBasePaths::VisitedDependentRecords. 3. Reorder some members of CXXBasePaths to save 8 bytes. 4. Use a SmallSetVector instead of a SetVector in CXXBasePaths::ComputeDeclsFound to avoid some allocations. This speeds up an -fsyntax-only on all of Boost by approx 0.15%, mainly by speeding up CXXBasePaths::lookupInBases by approx 10%. No functional changes. Patch by Bruno Ricci! Differential Revision: https://reviews.llvm.org/D49302 llvm-svn: 337607
* Reapply "[LSV] Refactoring + supporting bitcasts to a type of different size"Roman Tereshin2018-07-203-50/+132
| | | | | | | | This reapplies commit r337489 reverted by r337541 Additionally, this commit contains a speculative fix to the issue reported in r337541 (the report does not contain an actionable reproducer, just a stack trace) llvm-svn: 337606
* [FileCheck] Fix search ranges for DAG-NOT-DAGJoel E. Denny2018-07-203-47/+124
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A DAG-NOT-DAG is a CHECK-DAG group, X, followed by a CHECK-NOT group, N, followed by a CHECK-DAG group, Y. Let y be the initial directive of Y. This patch makes the following changes to the behavior: 1. Directives in N can no longer match within part of Y's match range just because y happens not to be the earliest match from Y. Specifically, this patch withdraws N's search range end from y's match range start to Y's match range start. 2. y can no longer match within X's match range, where a y match produced a reordering complaint, which is thus no longer possible. Specifically, this patch withdraws y's search range start from X's permitted range start to X's match range end, which was already the search range start for other members of Y. Both of these changes can only increase the number of test passes: #1 constrains the ability of CHECK-NOTs to match, and #2 expands the ability of CHECK-DAGs to match without complaints. These changes are based on discussions at: <http://lists.llvm.org/pipermail/llvm-dev/2018-May/123550.html> <https://reviews.llvm.org/D47106> which conclude that: 1. These changes simplify the FileCheck conceptual model. First, it makes search ranges for DAG-NOT-DAG more consistent with other cases. Second, it was confusing that y was treated differently from the rest of Y. 2. These changes add theoretical use cases for DAG-NOT-DAG that had no obvious means to be expressed otherwise. We can justify the first half of this assertion with the observation that these changes can only increase the number of test passes. 3. Reordering detection for DAG-NOT-DAG had no obvious real benefit. We don't have evidence from real uses cases to help us debate conclusions #2 and #3, but #1 at least seems intuitive. Reviewed By: probinson Differential Revision: https://reviews.llvm.org/D48986 llvm-svn: 337605
* [llvm-objcopy] Add basic support for --rename-sectionJordan Rupprecht2018-07-204-0/+91
| | | | | | | | | | | | | | | Summary: Add basic support for --rename-section=old=new to llvm-objcopy. A full replacement for GNU objcopy requires also modifying flags (i.e. --rename-section=old=new,flag1,flag2); I'd like to keep that in a separate change to keep this simple. Reviewers: jakehehrlich, alexshap Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D49576 llvm-svn: 337604
* Mark REAL(swapcontext) with indirect_return attribute on x86H.J. Lu2018-07-202-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When shadow stack from Intel CET is enabled, the first instruction of all indirect branch targets must be a special instruction, ENDBR. lib/asan/asan_interceptors.cc has ... int res = REAL(swapcontext)(oucp, ucp); ... REAL(swapcontext) is a function pointer to swapcontext in libc. Since swapcontext may return via indirect branch on x86 when shadow stack is enabled, as in this case, int res = REAL(swapcontext)(oucp, ucp); ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ This function may be returned via an indirect branch. Here compiler must insert ENDBR after call, like call *bar(%rip) endbr64 I opened an LLVM bug: https://bugs.llvm.org/show_bug.cgi?id=38207 to add the indirect_return attribute so that it can be used to inform compiler to insert ENDBR after REAL(swapcontext) call. We mark REAL(swapcontext) with the indirect_return attribute if it is available. This fixed: https://bugs.llvm.org/show_bug.cgi?id=38249 Reviewed By: eugenis Differential Revision: https://reviews.llvm.org/D49608 llvm-svn: 337603
* [clang-doc] Adding PublicOnly flagJulie Hockett2018-07-2012-32/+528
| | | | | | | | | | | Submitted on behalf of Annie Cherkaev (@anniecherk) Added a flag which, when enabled, documents only those methods and fields which have a Public attribute. Differential Revision: https://reviews.llvm.org/D48395 llvm-svn: 337602
* [clangd] Fix racy use-after-scope in unittestBenjamin Kramer2018-07-201-2/+1
| | | | | | This only shows up with asan when the stars align in a bad way. llvm-svn: 337601
* And add a lit substitution for llvm-undname, as the comment says toReid Kleckner2018-07-201-1/+1
| | | | llvm-svn: 337600
OpenPOWER on IntegriCloud