summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix use-after-free found by address-san on -r322028.Erich Keane2018-01-091-1/+5
| | | | | | | | | | | r322028 attempted to remove something from the "Manglings" list when it was no longer valid, and did so with 'erase'. However, StringRefs to these were stored, so these became dangling references. This patch changes to using 'remove' instead of 'erase' to keep the strings valid. llvm-svn: 322052
* Revert "[PowerPC] Manually schedule the prologue and epilogue"Stefan Pintilie2018-01-096-117/+56
| | | | | | | | [PowerPC] This reverts commit r322036. Failing build bots. Revert the commit now. llvm-svn: 322051
* [X86] Remove llvm.x86.avx512.cvt*2mask.* intrinsics and autoupgrade to (icmp ↵Craig Topper2018-01-0913-252/+217
| | | | | | | | slt X, 0) I had to drop fast-isel-abort from a test because we can't fast isel some of the mask stuff. When we used intrinsics we implicitly fell back to SelectionDAG for the intrinsic call without triggering the abort error. But with native IR that doesn't happen the same way. llvm-svn: 322050
* [X86] Remove unnecessary isel pattern that is a combination of two other ↵Craig Topper2018-01-091-2/+0
| | | | | | | | | | | | | | | patterns. The pattern was this def : Pat<(i32 (zext (i8 (bitconvert (v8i1 VK8:$src))))), (MOVZX32rr8 (EXTRACT_SUBREG (i32 (COPY_TO_REGCLASS VK8:$src, GR32)), sub_8bit))>, Requires<[NoDQI]>; but if you just let (i32 (zext X)) match byte itself you'll get MOVZX32rr8. And if you let (i8 (bitconvert (v8i1 VK8:$src))) match by itself you'll get (EXTRACT_SUBREG (i32 (COPY_TO_REGCLASS VK8:$src, GR32)), sub_8bit). So we can just let isel do the two patterns naturally. llvm-svn: 322049
* [MachineOutliner] AArch64: Handle instrs that use SP and will never need fixupsJessica Paquette2018-01-097-22/+132
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit does two things. Firstly, it adds a collection of flags which can be passed along to the target to encode information about the MBB that an instruction lives in to the outliner. Second, it adds some of those flags to the AArch64 outliner in order to add more stack instructions to the list of legal instructions that are handled by the outliner. The two flags added check if - There are calls in the MachineBasicBlock containing the instruction - The link register is available in the entire block If the link register is available and there are no calls, then a stack instruction can always be outlined without fixups, regardless of what it is, since in this case, the outliner will never modify the stack to create a call or outlined frame. The motivation for doing this was checking which instructions are most often missed by the outliner. Instructions like, say %sp<def> = ADDXri %sp, 32, 0; flags: FrameDestroy are very common, but cannot be outlined in the case that the outliner might modify the stack. This commit allows us to outline instructions like this. llvm-svn: 322048
* Rewrite our relocation processing.Rafael Espindola2018-01-097-192/+159
| | | | | | | | | | | | | | | | | | | | | | | | | | This splits relocation processing in two steps. First, analyze what needs to be done at the relocation spot. This can be a constant (non preemptible symbol, relative got reference, etc) or require a dynamic relocation. At this step we also consider creating copy relocations. Once that is done we decide if we need a got or a plt entry. The code is simpler IMHO. For example: - There is a single call to isPicRel since the logic is not split among adjustExpr and the caller. - R_MIPS_GOTREL is simple to handle now. - The tracking of what is preemptible or not is much simpler now. This also fixes a regression with symbols being both in a got and copy relocated. They had regressed in r268668 and r268149. The other test changes are because of error messages changes or the order of two relocations in the output. llvm-svn: 322047
* [CMake] Support for cross-compilation when build runtimesPetr Hosek2018-01-083-2/+17
| | | | | | | | | | | When cross-compiling, we cannot use the just built toolchain, instead we need to use the host toolchain which we assume has a support for targeting the selected target platform. We also need to pass the path to the native version of llvm-config to external projects. Differential Revision: https://reviews.llvm.org/D41678 llvm-svn: 322046
* [WebAssembly] Write out undefined symbol addresses as zeroSam Clegg2018-01-087-35/+26
| | | | | | | | | | | | | The addresses of undefined symbols that make it into the final executable (i.e. weak references to non-existent symbols) should resolve to zero. Also, make sure to not include function in the indirect function table if they are not included in the output. Differential Revision: https://reviews.llvm.org/D41839 llvm-svn: 322045
* [libcxx] Support the use of compiler-rt in lit testsPetr Hosek2018-01-083-1/+5
| | | | | | | | Don't link tests against libgcc when compiler-rt is being used. Differential Revision: https://reviews.llvm.org/D40513 llvm-svn: 322044
* Document attribute target multiversioning.Erich Keane2018-01-082-0/+24
| | | | | | | | | | Add attribute target multiversioning to the release notes. Additionally adds multiversioning support to the attribute documentation for 'target'. Differential Revision: https://reviews.llvm.org/D41837 llvm-svn: 322043
* [ELF] Small grammar fix. NFCShoaib Meenai2018-01-081-1/+1
| | | | | | The whole consists of the parts, not the other way around. llvm-svn: 322042
* Do not use parallelForEach to call maybeCompress().Rui Ueyama2018-01-081-2/+2
| | | | | | | | | | | | Currently LLVM's paralellForEach has a problem with reentracy. That caused https://bugs.llvm.org/show_bug.cgi?id=35788 (lld somtimes hangs while linking Ruby 2.4) because maybeCompress calls writeTo which uses paralellForEach. This patch is to avoid using paralellForEach to call maybeCompress to workaround the issue. llvm-svn: 322041
* Fix newly failing tests.Zachary Turner2018-01-084-24/+0
| | | | | | | | | | | These tests started failing because we now properly convert DefRange records to and from Yaml, but there were some old yaml files that had incorrect record definitions generated by the old buggy obj2yaml. Rather than try to re-generate the yaml files, it's easier to just remove the records, and they weren't necessary for the proper execution of the test anyway. llvm-svn: 322040
* Revert "Make rehash(0) work with ubsan's unsigned-integer-overflow."Dan Albert2018-01-081-1/+1
| | | | | | | | | Seems to have broken some tests since I first wrote this a while back. Will reland after checking what went wrong with the tests. This reverts commit 7023194c8d11a081fd01ed25308b3d60193c6a06. llvm-svn: 322039
* [X86] Replace cvt*2mask intrinsics with native IR using 'icmp slt X, ↵Craig Topper2018-01-085-16/+54
| | | | | | zeroinitializer. llvm-svn: 322038
* [X86] Remove GCCBuiltin from int_x86_avx512_cvtb2mask_128 and similar ↵Craig Topper2018-01-081-12/+12
| | | | | | | | intrinsics. I'm going to convert these to 'icmp slt X, zeroinitializer' in clang's CGBuiltin.cpp, but the GCCBuiltin names need to be removed to do that. llvm-svn: 322037
* [PowerPC] Manually schedule the prologue and epilogueStefan Pintilie2018-01-086-56/+117
| | | | | | | | | | | | | | | | | | This patch makes the following changes to the schedule of instructions in the prologue and epilogue. The stack pointer update is moved down in the prologue so that the callee saves do not have to wait for the update to happen. Saving the lr is moved down in the prologue to hide the latency of the mflr. The stack pointer is moved up in the epilogue so that restoring of the lr can happen sooner. The mtlr is moved up in the epilogue so that it is away form the blr at the end of the epilogue. The latency of the mtlr can now be hidden by the loads of the callee saved registers. Differential Revision: https://reviews.llvm.org/D41737 llvm-svn: 322036
* Move scanReloc to an auxiliary function.Rafael Espindola2018-01-081-146/+155
| | | | | | | | | | The body of the in scanRelocs is fairly big. This moves it to its own function. It is not a big readability win by itself, but should help further refactoring. llvm-svn: 322035
* Apparently 'C++14' is different than 'c++14'Marshall Clow2018-01-081-1/+1
| | | | llvm-svn: 322034
* AlwaysInliner: Alow setting InsertLifetime in the new-style passJustin Bogner2018-01-082-2/+9
| | | | llvm-svn: 322033
* [cmake] Pass CMAKE_MAKE_PROGRAM to native configureShoaib Meenai2018-01-081-0/+1
| | | | | | | | | | | If the make program isn't in the path, the native configure will fail. Pass CMAKE_MAKE_PROGRAM to the native configure explicitly to remedy this, similar to what's already done for external project configuration. Explicitly set CMAKE_MAKE_PROGRAM before the user flags so that they can override it for the native build if they desire (though I can't fathom why that would be useful). llvm-svn: 322032
* Make rehash(0) work with ubsan's unsigned-integer-overflow.Dan Albert2018-01-081-1/+1
| | | | | | | | | | | | Reviewers: mclow.lists, EricWF Reviewed By: mclow.lists Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D40743 llvm-svn: 322031
* PR35862: Suppress -Wmissing-variable-declarations warning on inline variables,Richard Smith2018-01-082-1/+24
| | | | | | variable templates, and instantiations thereof. llvm-svn: 322030
* Fix uninitialized read error reported by MSAN.Zachary Turner2018-01-083-21/+127
| | | | | | | | | | | | | | | The problem was that our Obj -> Yaml dumper had not been taught to handle certain types of records. This meant that when I generated the test input files, the records were still there but none of its fields were filled out. So when it did the Yaml -> Obj conversion as part of the test, it generated records with garbage in them. The patch here fixes the Obj <-> Yaml converter, and additionally updates the test file with fresh Yaml generated by the fixed converter. llvm-svn: 322029
* Implement Attribute Target MultiVersioningErich Keane2018-01-0831-49/+1689
| | | | | | | | | | | | | | | | | | | | | | | | | | | | GCC's attribute 'target', in addition to being an optimization hint, also allows function multiversioning. We currently have the former implemented, this is the latter's implementation. This works by enabling functions with the same name/signature to coexist, so that they can all be emitted. Multiversion state is stored in the FunctionDecl itself, and SemaDecl manages the definitions. Note that it ends up having to permit redefinition of functions so that they can all be emitted. Additionally, all versions of the function must be emitted, so this also manages that. Note that this includes some additional rules that GCC does not, since defining something as a MultiVersion function after a usage has been made illegal. The only 'history rewriting' that happens is if a function is emitted before it has been converted to a multiversion'ed function, at which point its name needs to be changed. Function templates and virtual functions are NOT yet supported (not supported in GCC either). Additionally, constructors/destructors are disallowed, but the former is planned. llvm-svn: 322028
* [DOXYGEN] Fix doxygen and content issues in avxintrin.hDouglas Yung2018-01-081-201/+200
| | | | | | | | | | - Fix incorrect wording in various intrinsic descriptions. Previously the descriptions used "low-order" and "high-order" when the intended meaning was "even-indexed" and "odd-indexed". - Fix a few typos and errors found during review. - Restore new line endings. This patch was made by Craig Flores llvm-svn: 322027
* [COFF] Delete CanExitEarlyShoaib Meenai2018-01-082-2/+0
| | | | | | | | | It was being set but never used, and its value is only ever needed locally in lld::coff::link. Differential Revision: https://reviews.llvm.org/D41814 llvm-svn: 322026
* ArgPromotion: Allow setting MaxElements in the new-style passJustin Bogner2018-01-082-1/+5
| | | | llvm-svn: 322025
* Factor out comparison handling for arithmetic types.Richard Smith2018-01-083-37/+55
| | | | | | | | | | This is not quite NFC: we don't perform the usual arithmetic conversions unless we have an operand of arithmetic or enumeration type any more. This matches the standard rule, but actually has no effect other than to marginally improve our diagnostics for the non-arithmetic, non-enumeration cases (by not performing integral promotions on one operand if the other is a pointer). llvm-svn: 322024
* [Myriad] Remove invalidated -elf flag for MoviAsmWalter Lee2018-01-082-2/+1
| | | | | | | | | | | | | | Summary: The flag has been deprecated, and is becoming invalid in the latest MDK. Reviewers: jyknight Subscribers: cfe-commits Differential Revision: https://reviews.llvm.org/D41713 llvm-svn: 322023
* [OPENMP] Fix debug info for outlined functions in NVPTX + add more tests.Alexey Bataev2018-01-087-72/+114
| | | | | | | Fixed name of emitted outlined functions in NVPTX target + extra tests for the debug info. llvm-svn: 322022
* Change add_ten to add_one to avoid triggering ubsan integer overflow.Billy Robert O'Neal III2018-01-083-67/+67
| | | | llvm-svn: 322021
* Add lit.local.cfg in test/DebugInfo/MIR/Mips/Petar Jovanovic2018-01-081-0/+3
| | | | | | | | Add test/DebugInfo/MIR/Mips/lit.local.cfg so no tests are run if Mips is not a supported target. This should resolve buildbot failures seen after r322015. llvm-svn: 322020
* Add the C++17 extensions to std::search. Include the default searcher, but ↵Marshall Clow2018-01-0814-82/+1414
| | | | | | not the Boyer-Moore or Boyer-Moore-Horspool searcher (yet). BUT put the BM and BMH tests in place, marked to XFAIL. The other searchers will follow soon llvm-svn: 322019
* [OPENMP] Current status of OpenMP support.Alexey Bataev2018-01-082-0/+69
| | | | | | | | | | | | Summary: Some info about supported features of OpenMP 4.5-5.0. Reviewers: hfinkel, rsmith Subscribers: kkwli0, Hahnfeld, cfe-commits Differential Revision: https://reviews.llvm.org/D39457 llvm-svn: 322018
* [index] Return when DC is null in handleReferenceFangrui Song2018-01-081-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: DC may sometimes be NULL and getContainerInfo(DC, Container) will dereference a null pointer. Default template arguments (the following example and many test files in https://github.com/nlohmann/json) may cause null pointer dereference. ```c++ template <typename> struct actor; template <template <typename> class Actor = actor> struct terminal; ``` In tools/libclang/CXIndexDataConsumer.cpp#L203 handleReference(ND, Loc, Cursor, dyn_cast_or_null<NamedDecl>(ASTNode.Parent), ASTNode.ContainerDC, ASTNode.OrigE, Kind); `dyn_cast_or_null<NamedDecl>(ASTNode.Parent)` is somehow a null pointer and in tools/libclang/CXIndexDataConsumer.cpp:935 ContainerInfo Container; getContainerInfo(DC, Container); The null DC is casted `ContInfo.cursor = getCursor(cast<Decl>(DC));` and SIGSEGV. ``` See discussions in https://github.com/jacobdufault/cquery/issues/219 https://github.com/jacobdufault/cquery/issues/192 Reviewers: akyrtzi, sammccall, yvvan Reviewed By: sammccall Subscribers: mehdi_amini, cfe-commits Differential Revision: https://reviews.llvm.org/D41575 llvm-svn: 322017
* [ValueTracking] remove overzealous assertSanjay Patel2018-01-082-1/+22
| | | | | | | | | The test is derived from a failing fuzz test: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=5008 Credit to @rksimon for pointing out the problem. llvm-svn: 322016
* [LiveDebugValues] Change condition for block termination recognitionPetar Jovanovic2018-01-082-1/+189
| | | | | | | | | | | | The last iterator of MBB should be recognized as MBB.end() not as MBB.instr_end() which could return bundled instruction that is not iterable with basic iterator. Patch by Nikola Prica. Differential Revision: https://reviews.llvm.org/D41626 llvm-svn: 322015
* Check test conditions more precisely. NFCSimon Atanasyan2018-01-081-1/+1
| | | | llvm-svn: 322014
* Document upcoming TS feature removalMarshall Clow2018-01-081-0/+138
| | | | llvm-svn: 322011
* [TargetLibraryInfo] fix finite mathlib function availabilitySanjay Patel2018-01-082-60/+83
| | | | | | | | | | | This patch was part of: https://reviews.llvm.org/D41338 ...but we can expose the bug in IR via constant propagation as shown in the test. Unless the triple includes 'linux', we should not fold these because the functions don't exist on other platforms (yet?). llvm-svn: 322010
* Fixed spelling mistake. NFCI.Simon Pilgrim2018-01-081-1/+1
| | | | llvm-svn: 322009
* Revert "Emit Function IDs table for Control Flow Guard"Adrian McCarthy2018-01-0820-351/+2
| | | | | | | | | | The new test fails on the Hexagon bot. Reverting while I investigate. This reverts https://reviews.llvm.org/rL322005 This reverts commit b7e0026b4385180c378edc658ec91a39566f2942. llvm-svn: 322008
* [mips] Remove duplicated R6 EVA instructionsAleksandar Beserminji2018-01-084-208/+0
| | | | | | | | This patch removes duplicated EVA instructions in R6. Differential Revision: https://reviews.llvm.org/D41769 llvm-svn: 322007
* [CVP] Replace incoming values from unreachable blocks with undef.Davide Italiano2018-01-082-4/+89
| | | | | | | | | | | | | | | | | | | | | | This is an attempt of fixing PR35807. Due to the non-standard definition of dominance in LLVM, where uses in unreachable blocks are dominated by anything, you can have, in an unreachable block: %patatino = OP1 %patatino, CONSTANT When `SimplifyInstruction` receives a PHI where an incoming value is of the aforementioned form, in some cases, loops indefinitely. What I propose here instead is keeping track of the incoming values from unreachable blocks, and replacing them with undef. It fixes this case, and it seems to be good regardless (even if we can't prove that the value is constant, as it's coming from an unreachable block, we can ignore it). Differential Revision: https://reviews.llvm.org/D41812 llvm-svn: 322006
* Emit Function IDs table for Control Flow GuardAdrian McCarthy2018-01-0820-2/+351
| | | | | | | | | | Adds option /guard:cf to clang-cl and -cfguard to cc1 to emit function IDs of functions that have their address taken into a section named .gfids$y for compatibility with Microsoft's Control Flow Guard feature. Differential Revision: https://reviews.llvm.org/D40531 llvm-svn: 322005
* [mips] Improve diagnostics for instruction mappingAleksandar Beserminji2018-01-082-1/+46
| | | | | | | | | This patch improves diagnostic for case when mapped instruction does not contain a field listed under RowFields. Differential Revision: https://reviews.llvm.org/D41778 llvm-svn: 322004
* [DAG] Teach BaseIndexOffset to correctly handle with indexed operationsNirav Dave2018-01-084-52/+70
| | | | | | | | | | | | | | BaseIndexOffset address analysis incorrectly ignores offsets folded into indexed memory operations causing potential errors in alias analysis of pre-indexed operations. Reviewers: efriedma, RKSimon, hfinkel, jyknight Subscribers: hiraditya, javed.absar, llvm-commits Differential Revision: https://reviews.llvm.org/D41701 llvm-svn: 322003
* [clang-tidy] Fix DanglingHandleCheck for the correct conversion operation ↵Samuel Benzaquen2018-01-082-3/+11
| | | | | | | | | | | | | | | | between basic_string and basic_string_view. Summary: Fix DanglingHandleCheck to handle the final implementation of std::string and std::string_view. These use a conversion operator instead of a conversion constructor. Reviewers: hokein Subscribers: klimek, xazax.hun, cfe-commits Differential Revision: https://reviews.llvm.org/D41779 llvm-svn: 322002
* Avoid assumption that lit tests are writable. NFCSam McCall2018-01-083-8/+11
| | | | llvm-svn: 322001
OpenPOWER on IntegriCloud