summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Added Control Flow Protection FlagOren Ben Simhon2018-01-0912-2/+105
| | | | | | | | | | Cf-protection is a target independent flag that instructs the back-end to instrument control flow mechanisms like: Branch, Return, etc. For example in X86 this flag will be used to instrument Indirect Branch Tracking instructions. Differential Revision: https://reviews.llvm.org/D40478 Change-Id: I5126e766c0e6b84118cae0ee8a20fe78cc373dea llvm-svn: 322063
* Instrument Control Flow For Indirect Branch TrackingOren Ben Simhon2018-01-098-2/+386
| | | | | | | | | | | | | CET (Control-Flow Enforcement Technology) introduces a new mechanism called IBT (Indirect Branch Tracking). According to IBT, each Indirect branch should land on dedicated ENDBR instruction (End Branch). The new pass adds ENDBR instructions for every indirect jmp/call (including jumps using jump tables / switches). For more information, please see the following: https://software.intel.com/sites/default/files/managed/4d/2a/control-flow-enforcement-technology-preview.pdf Differential Revision: https://reviews.llvm.org/D40482 Change-Id: Icb754489faf483a95248f96982a4e8b1009eb709 llvm-svn: 322062
* [cmake] Use symlinks for Windows-hosted toolchains built on UnixShoaib Meenai2018-01-092-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When cross-compiling for Windows on Unix, the built toolchain will need to be transferred to Windows to actually run. My opinion is that the Unix build should use symlinks, and the transfer to Windows should take care of making those symlinks usable. E.g., I envision tarballs to be a common form of transfer from Unix to Windows, in which case the tarball can be created using --dereference to follow the symlinks. The motivation here is that, when cross-compiling for Windows on Unix, the installation will *already* create symlinks. The reason is that the installation script will be invoked without knowing the host system, so the `if(UNIX)` check in the installation symlink creation script will reflect the build system rather than the host system. We could either make the build and install trees both contain copies or both contain symlinks, and using symlinks is a significant space saving without (in my opinion) having any detrimental effect on the usage of the cross- compiled toolchain on Windows. A secondary motivation is that Windows 10 version 1703 and later finally lift the administrator rights requirement for creating symbolic links (if the system is in Developer Mode), which makes symlinks a lot more practical even on Windows. Of course Unix and Windows symlinks aren't interoperable, but symlinks for Windows toolchains is a reasonable future direction to be going in anyway. Differential Revision: https://reviews.llvm.org/D41314 llvm-svn: 322061
* [X86] Allow more cmpps/pd immediate encodings to be commuted during isel.Craig Topper2018-01-092-34/+18
| | | | | | The code that checks the immediate wasn't masking to the lower 3-bits like the code in X86InstrInfo.cpp that's used by the peephole pass does. llvm-svn: 322060
* [SCEV] Do not cache S -> V if S is not equivalent of VSerguei Katkov2018-01-093-3/+124
| | | | | | | | | | | | | | | | SCEV tracks the correspondence of created SCEV to original instruction. However during creation of SCEV it is possible that nuw/nsw/exact flags are lost. As a result during expansion of the SCEV the instruction with nuw/nsw/exact will be used where it was expected and we produce poison incorreclty. Reviewers: sanjoy, mkazantsev, sebpop, jbhateja Reviewed By: sanjoy Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D41578 llvm-svn: 322058
* [ELF] Explicit template instantiations for addFileEaswaran Raman2018-01-091-0/+5
| | | | | | | | | | | | | | | Summary: All other templated methods have explicit instantiations but this one is missing. Discovered while building with a clang with inliner modifications. Reviewers: espindola Subscribers: emaste, llvm-commits, davidxl Differential Revision: https://reviews.llvm.org/D41847 llvm-svn: 322057
* [CGP] Fix Complex addressing mode for offsetSerguei Katkov2018-01-092-1/+25
| | | | | | | | | | | | | | If the offset is differ in two addressing mode we can continue only if ScaleReg is not set due to we will use it as merge of different offsets. It should fix PR35799 and PR35805. Reviewers: john.brawn, reames Reviewed By: reames Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D41227 llvm-svn: 322056
* [PowerPC] Can not assume an intrinsic argument is a simple type.Sean Fertile2018-01-092-6/+67
| | | | | | | | | | | | | The CTRLoop pass performs checks on the argument of certain libcalls/intrinsics, and assumes the arguments must be of a simple type. This isn't always the case though. For example if we unroll and vectorize a loop we may end up with vectors larger then the largest legal type, along with intrinsics that operate on those wider types. This happened in the ffmpeg build, where we unrolled a loop and ended up with a sqrt intrinsic that operated on V16f64, triggering an assertion. Differential Revision: https://reviews.llvm.org/D41758 llvm-svn: 322055
* Cut and paste error - I wasn't actually running both tests...Jim Ingham2018-01-091-1/+1
| | | | llvm-svn: 322054
* Remove unused function HvxSelector::zerous.Eric Christopher2018-01-091-20/+0
| | | | llvm-svn: 322053
* 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
OpenPOWER on IntegriCloud