summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* [ValueTracking] add tests for fmin/fmax; NFCSanjay Patel2018-10-311-0/+176
| | | | llvm-svn: 345777
* [DWARF][NFC] Refactor a function to return Optional<> instead of boolWolfgang Pieb2018-10-313-10/+10
| | | | | | | | Minor refactor of DWARFUnit::getStringOffsetSectionItem(). Differential Revision: https://reviews.llvm.org/D53948 llvm-svn: 345776
* [ELF] Refactor per-target TLS layout configuration. NFC.Ryan Prichard2018-10-315-34/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: There are really three different kinds of TLS layouts: * A fixed TLS-to-TP offset. On architectures like PowerPC, MIPS, and RISC-V, the thread pointer points to a fixed offset from the start of the executable's TLS segment. The offset is 0x7000 for PowerPC and MIPS, which allows a signed 16-bit offset to reach 0x1000 of per-thread implementation data and 0xf000 of the application's TLS segment. The size and layout of the TCB isn't relevant to the static linker and might not be known. * A fixed TCB size. This is the format documented as "variant 1" in Ulrich Drepper's TLS spec. The thread pointer points to a 2-word TCB followed by the executable's TLS segment. The first word is always the DTV pointer. Used on ARM. The thread pointer must be aligned to the TLS segment's alignment, possibly creating alignment padding. * Variant 2. This format predates variant 1 and is also documented in Drepper's TLS spec. It allocates the executable's TLS segment before the thread pointer, apparently for backwards-compatibility. It's used on x86 and SPARC. Factor out an lld::elf::getTlsTpOffset() function for use in a follow-up patch for Android. The TcbSize/TlsTpOffset fields are only used in getTlsTpOffset, so replace them with a switch on Config->EMachine. Reviewers: espindola, ruiu, PkmX, jrtc27 Reviewed By: ruiu, PkmX, jrtc27 Subscribers: jyknight, emaste, sdardis, nemanjai, javed.absar, arichardson, kristof.beyls, kbarton, fedor.sergeev, atanasyan, PkmX, jsji, llvm-commits Differential Revision: https://reviews.llvm.org/D53905 llvm-svn: 345775
* Part of PR39508: Emit an @llvm.invariant.start after storing toRichard Smith2018-10-314-14/+29
| | | | | | | | | | | | | | | | | __tls_guard. __tls_guard can only ever transition from 0 to 1, and only once. This permits LLVM to remove repeated checks for TLS initialization and repeated initialization code in cases like: int g(); thread_local int n = g(); int a = n + n; where we could not prove that __tls_guard was still 'true' when checking it for the second reference to 'n' in the initializer of 'a'. llvm-svn: 345774
* Remove unused internal template parameter.Richard Smith2018-10-311-3/+1
| | | | llvm-svn: 345773
* [adt] SparseBitVector::test() should be constDaniel Sanders2018-10-312-10/+33
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Re-worked SparseBitVector's most-recently-used-word caching (CurrElementIter) such that SparseBitVector::test() can be made const. This came up when attempting to test individual bits in a SparseBitVector which was a member of a const object. The cached iterator has no bearing on the externally visible state, it's merely a performance optimization. Therefore it has been made mutable and FindLowerBound() has been split into a const and non-const function (FindLowerBound/FindLowerBoundConst) for the const/non-const interfaces. Reviewers: rtereshin Reviewed By: rtereshin Subscribers: rtereshin, dexonsmith, kristina, llvm-commits Differential Revision: https://reviews.llvm.org/D53447 llvm-svn: 345772
* [InstCombine] add tests for fmin/fmax pattern matching failure; NFCSanjay Patel2018-10-311-2/+44
| | | | llvm-svn: 345771
* [SelectionDAG] Handle constant range [0,1) in lowerRangeToAssertZExtScott Linder2018-10-312-7/+22
| | | | | | | | | lowerRangeToAssertZExt currently relies on something like EarlyCSE having eliminated the constant range [0,1). At -O0 this leads to an assert. Differential Revision: https://reviews.llvm.org/D53888 llvm-svn: 345770
* [globalisel] Add comments indicating the operand orderDaniel Sanders2018-10-311-1/+7
| | | | llvm-svn: 345769
* Makefile.rules: Don't use code signing on macOS; it isn't necessary.Adrian Prantl2018-10-311-2/+3
| | | | llvm-svn: 345768
* [WedAssembly] Add -s and -S alias for --strip-all and --strip-debugSam Clegg2018-10-313-0/+16
| | | | llvm-svn: 345767
* Removing a reliance on system headers from this test; NFC.Aaron Ballman2018-10-311-2/+9
| | | | llvm-svn: 345766
* [compiler-rt][Fuzzer] Use the new C++ ABI namespace CMake supportPetr Hosek2018-10-311-1/+1
| | | | | | | | | libc++ now supports customizing the ABI namespace directly from the CMake build so we no longer need to rely on custom CFLAGS. Differential Revision: https://reviews.llvm.org/D53939 llvm-svn: 345765
* Implement the readability-const-return-type check.Aaron Ballman2018-10-3110-0/+463
| | | | | | | | This check flags function top-level const-qualified return types and suggests removing the mostly-superfluous const qualifier where possible. Patch by Yitzhak Mandelbaum. llvm-svn: 345764
* [AMDGPU] Remove FeatureVGPRSpillingScott Linder2018-10-3115-84/+95
| | | | | | | | | | | This feature is only relevant to shaders, and is no longer used. When disabled, lowering of reserved registers for shaders causes a compiler crash. Remove the feature and add a test for compilation of shaders at OptNone. Differential Revision: https://reviews.llvm.org/D53829 llvm-svn: 345763
* [NFC] Replace C++1y and C++1z by C++14 and C++17, respectivelyLouis Dionne2018-10-312-7/+8
| | | | llvm-svn: 345762
* [SelectionDAGISel] Suppress a -Wunused-but-set-variable warning in release ↵Craig Topper2018-10-311-0/+1
| | | | | | builds. NFC llvm-svn: 345761
* [ASTImporter][Structural Eq] Check for isBeingDefinedGabor Marton2018-10-312-1/+46
| | | | | | | | | | | | | | Summary: If one definition is currently being defined, we do not compare for equality and we assume that the decls are equal. Reviewers: a_sidorin Subscribers: rnkovacs, dkrupp, Szelethus, cfe-commits Differential Revision: https://reviews.llvm.org/D53697 llvm-svn: 345760
* [NFC] Mark "Splicing Maps and Sets" as done in LLVM 8.0Louis Dionne2018-10-311-1/+1
| | | | llvm-svn: 345759
* Fix comment typo. NFCI.Simon Pilgrim2018-10-311-1/+1
| | | | llvm-svn: 345758
* [InstCombine] regenerate test checks; NFCSanjay Patel2018-10-311-32/+32
| | | | llvm-svn: 345757
* [SelectionDAG] SelectionDAGLegalize::ExpandBITREVERSE - ensure we use ShiftTySimon Pilgrim2018-10-311-6/+6
| | | | | | We should be using the getShiftAmountTy value type for shift amounts. llvm-svn: 345756
* [NFC] Fixed -Wsign-compare warningDavid Bolvansky2018-10-311-1/+1
| | | | llvm-svn: 345755
* [globalisel][irtranslator] Fix test from r345743 on non-asserts builds.Daniel Sanders2018-10-311-0/+2
| | | | llvm-svn: 345754
* [clang-format] tweaked another case of lambda formattingKrasimir Georgiev2018-10-315-18/+122
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This is done in order to improve cases where the lambda's body is moved too far to the right. Consider the following snippet with column limit set to 79: ``` void f() { leader::MakeThisCallHere(&leader_service_, cq_.get(), [this, liveness](const leader::ReadRecordReq& req, std::function<void()> done) { logger_->HandleReadRecord( req, resp, std::move(done)); }); leader::MakeAnother(&leader_service_, cq_.get(), [this, liveness](const leader::ReadRecordReq& req, std::function<void()> done) { logger_->HandleReadRecord( req, resp, std::move(done), a); }); } ``` The tool favors extra indentation for the lambda body and so the code incurs extra wrapping and adjacent calls are indented to a different level. I find this behavior annoying and I'd like the tool to favor new lines and, thus, use the extra width. The fix, reduced, brings the following formatting. Before: function(1, [] { DoStuff(); // }, 1); After: function( 1, [] { DoStuff(); // }, 1); Refer to the new tests in FormatTest.cpp Contributed by oleg.smolsky! Reviewers: djasper, klimek, krasimir Subscribers: cfe-commits, owenpan Tags: #clang Differential Revision: https://reviews.llvm.org/D52676 llvm-svn: 345753
* [InstCombine] add tests for fcmp with -0.0; NFCSanjay Patel2018-10-311-0/+57
| | | | | | From IEEE754: "Comparisons shall ignore the sign of zero (so +0 = −0)." llvm-svn: 345752
* [InstCombine] Combine nested min/max intrinsics with constantsVolkan Keles2018-10-315-49/+59
| | | | | | | | | | | | Reviewers: arsenm, spatel Reviewed By: spatel Subscribers: lebedev.ri, wdng, llvm-commits Differential Revision: https://reviews.llvm.org/D53774 llvm-svn: 345751
* [llvm-mca] Remove the verb 'assemble' from a few options in help. NFC.Matt Davis2018-10-311-17/+17
| | | | | | | * MCA does not assemble anything. * Ran clang-format. llvm-svn: 345750
* TableGen: Fix ASAN errorNicolai Haehnle2018-10-311-11/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: As a bonus, this arguably improves the code by making it simpler. gcc 8 on Ubuntu 18.10 reports the following: ==39667==ERROR: AddressSanitizer: stack-use-after-scope on address 0x7fffffff8ae0 at pc 0x555555dbfc68 bp 0x7fffffff8760 sp 0x7fffffff8750 WRITE of size 8 at 0x7fffffff8ae0 thread T0 #0 0x555555dbfc67 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Alloc_hider::_Alloc_hider(char*, std::allocator<char>&&) /usr/include/c++/8/bits/basic_string.h:149 #1 0x555555dbfc67 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::basic_string(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&) /usr/include/c++/8/bits/basic_string.h:542 #2 0x555555dbfc67 in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > std::operator+<char, std::char_traits<char>, std::allocator<char> >(char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&&) /usr/include/c++/8/bits/basic_string.h:6009 #3 0x555555dbfc67 in searchableFieldType /home/nha/amd/build/san/llvm-src/utils/TableGen/SearchableTableEmitter.cpp:168 (...) Address 0x7fffffff8ae0 is located in stack of thread T0 at offset 864 in frame #0 0x555555dbef3f in searchableFieldType /home/nha/amd/build/san/llvm-src/utils/TableGen/SearchableTableEmitter.cpp:148 Reviewers: fhahn, simon_tatham, kparzysz Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D53931 llvm-svn: 345749
* Re-land r345676 "[Win64] Handle passing i128 by value"Reid Kleckner2018-10-312-11/+49
| | | | | | | Fix the unintended switch/case fallthrough to avoid changing long double behavior. llvm-svn: 345748
* [analyzer] Re-add custom OSIterator rule for RetainCountCheckerGeorge Karpenkov2018-10-312-4/+19
| | | | | | | | Turns out the rule is quite ubiquitous. Revert of https://reviews.llvm.org/D53628 llvm-svn: 345747
* [analyzer] RetainCountChecker: for now, do not trust the summaries of ↵George Karpenkov2018-10-313-37/+46
| | | | | | | | | | | | | | | | inlined code Trusting summaries of inlined code would require a more thorough work, as the current approach was causing too many false positives, as the new example in test. The culprit lies in the fact that we currently escape all variables written into a field (but not passed off to unknown functions!), which can result in inconsistent behavior. rdar://45655344 Differential Revision: https://reviews.llvm.org/D53902 llvm-svn: 345746
* [analyzer] Enable retain count checking for OSObject by defaGeorge Karpenkov2018-10-312-2/+2
| | | | | | | | The FP rate seems to be good enough now. Differential Revision: https://reviews.llvm.org/D53849 llvm-svn: 345745
* Second half of C++17's splicing maps and setsErik Pilkington2018-10-3116-68/+1874
| | | | | | | | | | This commit adds a merge member function to all the map and set containers, which splices nodes from the source container. This completes support for P0083r3. Differential revision: https://reviews.llvm.org/D48896 llvm-svn: 345744
* [globalisel][irtranslator] Verify that DILocations aren't lost in translationDaniel Sanders2018-10-312-23/+120
| | | | | | | | | | | | | | | | Summary: Also fix a couple bugs where DILocations are lost. EntryBuilder wasn't passing on debug locations for PHI's, constants, GLOBAL_VALUE, etc. Reviewers: aprantl, vsk, bogner, aditya_nandakumar, volkan, rtereshin, aemerson Reviewed By: aemerson Subscribers: aemerson, rovka, kristof.beyls, javed.absar, llvm-commits Differential Revision: https://reviews.llvm.org/D53740 llvm-svn: 345743
* [clang-tidy] add missing '--' in RUN-line, unbreak buildbotJonas Toth2018-10-311-1/+1
| | | | llvm-svn: 345742
* [Lex] Make MacroDirective::findDirectiveAtLoc take const SourceManagerKristof Umann2018-10-312-2/+4
| | | | | | | | | I'm currently working on including macro expansions in the Static Analyzer's plist output, where I can only access a const SourceManager. Differential Revision: https://reviews.llvm.org/D53940 llvm-svn: 345741
* MachineModuleInfo: Initialize DbgInfoAvailable depending on debug_cus existingMatthias Braun2018-10-314-3/+34
| | | | | | | | | | | | | | | | Before this patch DbgInfoAvailable was set to true in DwarfDebug::beginModule() or CodeViewDebug::CodeViewDebug(). This made MIR testing weird since passes would suddenly stop dealing with debug info just because we stopped the pipeline before the debug printers. This patch changes the logic to initialize DbgInfoAvailable based on the fact that debug_compile_units exist in the llvm Module. The debug printers may then override it with false in case of debug printing being disabled. Differential Revision: https://reviews.llvm.org/D53885 llvm-svn: 345740
* [clang-tidy] add -fexceptions to failing unit-test, unbreak buildbotJonas Toth2018-10-311-1/+1
| | | | llvm-svn: 345738
* [clang] try-fix broken documentation builderJonas Toth2018-10-311-0/+1
| | | | llvm-svn: 345737
* [clang-tools-extra] fix broken link in release notesJonas Toth2018-10-311-1/+1
| | | | llvm-svn: 345736
* [clang-tidy] new check 'readability-isolate-declaration'Jonas Toth2018-10-3113-0/+1139
| | | | | | | | | | | | | | | | | | | | | Summary: This patch introduces a new clang-tidy check that matches on all `declStmt` that declare more then one variable and transform them into one statement per declaration if possible. It currently only focusses on variable declarations but should be extended to cover more kinds of declarations in the future. It is related to https://reviews.llvm.org/D27621 and does use it's extensive test-suite. Thank you to firolino for his work! Reviewers: rsmith, aaron.ballman, alexfh, hokein, kbobyrev Reviewed By: aaron.ballman Subscribers: ZaMaZaN4iK, mgehre, nemanjai, kbarton, lebedev.ri, Eugene.Zelenko, mgorny, xazax.hun, cfe-commits Tags: #clang-tools-extra Differential Revision: https://reviews.llvm.org/D51949 llvm-svn: 345735
* [InstCombine] refactor fabs+fcmp fold; NFCSanjay Patel2018-10-312-199/+105
| | | | | | | Also, remove/replace/minimize/enhance the tests for this fold. The code drops FMF, so it needs more tests and at least 1 fix. llvm-svn: 345734
* [LLDB] - Regroup the switch entries in DWARFFormValue::ExtractValue. NFC.George Rimar2018-10-311-60/+26
| | | | | | | | This is NFC to clean up the `DWARFFormValue::ExtractValue`. It groups similar `DW_FORM_*` and removes an excessive assignment of `ref_addr_size` (it was assigned right after in any case). llvm-svn: 345733
* [Hexagon] Make sure not to use GP-relative addressing with PICKrzysztof Parzyszek2018-10-314-4/+47
| | | | | | | Make sure that -relocation-model=pic prevents use of GP-relative addressing modes. llvm-svn: 345731
* [llvm-mca] Remove namespace prefixes made redundant by r345612. NFCAndrea Di Biagio2018-10-3118-149/+129
| | | | llvm-svn: 345730
* Delete dependency on config.hKadir Cetinkaya2018-10-311-3/+2
| | | | | | | | | | | | | | | | Summary: Since llvm/Config/config.h is not available on standalone builds, use __USE_POSIX instead of HAVE_PTHREAD_H and get rid of the include. Reviewers: sammccall Reviewed By: sammccall Subscribers: lebedev.ri, krytarowski, ilya-biryukov, ioeric, jkorous, arphaman, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D53935 llvm-svn: 345729
* [InstSimplify] fold 'fcmp nnan ult X, 0.0' when X is not negativeSanjay Patel2018-10-312-13/+8
| | | | | | This is the inverted case for the transform added with D53874 / rL345725. llvm-svn: 345728
* [InstCombine] add assertion that InstSimplify has folded a fabs+fcmp; NFCSanjay Patel2018-10-311-2/+5
| | | | | | | | The 'OLT' case was updated at rL266175, so I assume it was just an oversight that 'UGE' was not included because that patch handled both predicates in InstSimplify. llvm-svn: 345727
* Update ioctl(2) operations for NetBSD 8.99.25Kamil Rytarowski2018-10-313-42/+66
| | | | | | | | | | | | Eliminate dropped operations, add new operations. Update included headers for newer need. Add a fallback definition of nvlist_ref_t, becaue this type is internal to libnpf and the kernel, not exported into public headers. llvm-svn: 345726
OpenPOWER on IntegriCloud