summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* [GlobalISel][AArch64] Select G_FEXPJessica Paquette2019-01-307-3/+269
| | | | | | | | | | | | | | | This teaches the legalizer to handle G_FEXP in AArch64. As a result, it also allows us to select G_FEXP. It... - Updates the legalizer-info tests - Adds a test for legalizing exp - Updates the existing fp tests to show that we can now select G_FEXP https://reviews.llvm.org/D57483 llvm-svn: 352692
* [GlobalISel][LegalizerHelper] Add some missing MI change observer calls.Amara Emerson2019-01-301-0/+2
| | | | | | No test as it's a preventative fix. llvm-svn: 352691
* [Sanitizers] UBSan unreachable incompatible with ASan in the presence of ↵Julian Lettner2019-01-304-21/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `noreturn` calls Summary: UBSan wants to detect when unreachable code is actually reached, so it adds instrumentation before every unreachable instruction. However, the optimizer will remove code after calls to functions marked with noreturn. To avoid this UBSan removes noreturn from both the call instruction as well as from the function itself. Unfortunately, ASan relies on this annotation to unpoison the stack by inserting calls to _asan_handle_no_return before noreturn functions. This is important for functions that do not return but access the the stack memory, e.g., unwinder functions *like* longjmp (longjmp itself is actually "double-proofed" via its interceptor). The result is that when ASan and UBSan are combined, the noreturn attributes are missing and ASan cannot unpoison the stack, so it has false positives when stack unwinding is used. Changes: Clang-CodeGen now directly insert calls to `__asan_handle_no_return` when a call to a noreturn function is encountered and both UBsan-unreachable and ASan are enabled. This allows UBSan to continue removing the noreturn attribute from functions without any changes to the ASan pass. Previously generated code: ``` call void @longjmp call void @__asan_handle_no_return call void @__ubsan_handle_builtin_unreachable ``` Generated code (for now): ``` call void @__asan_handle_no_return call void @longjmp call void @__asan_handle_no_return call void @__ubsan_handle_builtin_unreachable ``` rdar://problem/40723397 Reviewers: delcypher, eugenis, vsk Differential Revision: https://reviews.llvm.org/D57278 llvm-svn: 352690
* [PowerPC] delete no more needed workaround for readsRegister() in PowerPCChen Zheng2019-01-302-14/+18
| | | | | | Differential Revision: https://reviews.llvm.org/D57439 llvm-svn: 352689
* [CMake] Use correct visibility for linked libraries in CMakePetr Hosek2019-01-304-6/+12
| | | | | | | | | | | When linking library dependencies, we shouldn't need to export linked libraries to dependents. We should be explicit about this in target_link_libraries, otherwise other targets that depend on these such as sanitizers get repeated (and possibly even conflicting) dependencies. Differential Revision: https://reviews.llvm.org/D57456 llvm-svn: 352688
* [CodeGenObjC] Handle exceptions when calling objc_alloc or objc_allocWithZoneErik Pilkington2019-01-302-19/+39
| | | | | | | | | | | | objc_alloc and objc_allocWithZone may throw exceptions if the underlying method does. If we're in a @try block, then make sure we emit an invoke instead of a call. rdar://47610407 Differential revision: https://reviews.llvm.org/D57476 llvm-svn: 352687
* MIR: Reject non-power-of-4 alignments in MMO parsingMatt Arsenault2019-01-3022-151/+167
| | | | llvm-svn: 352686
* [GlobalISel][AArch64] Select G_FABSJessica Paquette2019-01-307-2/+175
| | | | | | | | | This adds instruction selection support for G_FABS in AArch64. It also updates the existing basic FP tests, adds a selection test for G_FABS. https://reviews.llvm.org/D57418 llvm-svn: 352684
* [WebAssembly] MC: Use WritePatchableLEB helper function. NFC.Sam Clegg2019-01-301-33/+30
| | | | | | | | Subscribers: dschuff, jgravelle-google, aheejin, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D57477 llvm-svn: 352683
* [WebAssembly] Restore stack pointer right after catch instructionHeejin Ahn2019-01-306-99/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: After the staack is unwound due to a thrown exxception, `__stack_pointer` global can point to an invalid address. So a `global.set` to restore `__stack_pointer` should be inserted right after `catch` instruction. But after r352598 the `global.set` instruction is inserted not right after `catch` but after `block` - `br-on-exn` - `end_block` - `extract_exception` sequence. This CL fixes it. While doing that, we can actually move ReplacePhysRegs pass after LateEHPrepare and merge EHRestoreStackPointer pass into LateEHPrepare, and now placing `global.set` to `__stack_pointer` right after `catch` is much easier. Otherwise it is hard to guarantee that `global.set` is still right after `catch` and not touched with other transformations, in which case we have to do something to hoist it. Reviewers: dschuff Subscribers: mgorny, sbc100, jgravelle-google, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D57421 llvm-svn: 352681
* [DAGCombiner] sub X, 0/1 --> add X, 0/-1Sanjay Patel2019-01-304-23/+30
| | | | | | | | | | This extends the existing transform for: add X, 0/1 --> sub X, 0/-1 ...to allow the sibling subtraction fold. This pattern could regress with the proposed change in D57401. llvm-svn: 352680
* [AArch64][x86] add tests for add/sub signbits fold; NFCSanjay Patel2019-01-302-0/+65
| | | | | | | As discussed/shown in D57401, we are missing a fold for subtract of 0/1 --> add 0/-1. llvm-svn: 352678
* Fix handling of CreateTemplateParameterList when there is an empty packShafik Yaghmour2019-01-304-10/+46
| | | | | | | | | Summary: When we are creating a ClassTemplateSpecializationDecl in ParseTypeFromDWARF(...) we are not handling the case where variadic pack is empty in the specialization. This patch handles that case and adds a test to prevent future regressions. Differential Revision: https://reviews.llvm.org/D57363 llvm-svn: 352677
* [ASTDump] Inline traverse methods into classStephen Kelly2019-01-301-543/+388
| | | | | | | This API will be extracted into a new template class. This change will make the follow-up commit easier to review. llvm-svn: 352676
* [GlobalISel][AArch64] Add instruction selection support for @llvm.log2Jessica Paquette2019-01-307-3/+270
| | | | | | | | | | | | | This teaches GlobalISel to emit a RTLib call for @llvm.log2 when it encounters it. It updates the existing floating point tests to show that we don't fall back on the intrinsic, and select the correct instructions. It also adds a legalizer test for G_FLOG2. https://reviews.llvm.org/D57357 llvm-svn: 352673
* Don't define __has_feature(objc_fixed_enum) in non-objc modeErik Pilkington2019-01-302-1/+3
| | | | | | | This is only a formal language feature in ObjC, otherwise its just an extension. Making this change was also an ABI break. llvm-svn: 352672
* [GlobalISel][AArch64] Add instruction selection support for @llvm.sqrtJessica Paquette2019-01-307-1/+254
| | | | | | | | | | This teaches the legalizer about G_FSQRT in AArch64. Also adds a legalizer test for G_FSQRT, a selection test for it, and updates existing floating point tests. https://reviews.llvm.org/D57361 llvm-svn: 352671
* [GlobalISel] Add IRTranslator support for @llvm.sqrt -> G_FSQRTJessica Paquette2019-01-302-0/+13
| | | | | | | | | | | Follow-up commit to https://reviews.llvm.org/D57359. (r352668) This adds IRTranslator support for recognising a @llvm.sqrt intrinsic and translating it into a G_FSQRT. https://reviews.llvm.org/D57360 llvm-svn: 352670
* [OPENMP]Fix PR40536: Do not emit __kmpc_push_target_tripcount if notAlexey Bataev2019-01-304-4/+8
| | | | | | | | | | required. Function __kmpc_push_target_tripcount should be emitted only if the offloading entry is going to be emitted (for use in tgt_target... functions). Otherwise, it should not be emitted. llvm-svn: 352669
* [GlobalISel] Introduce a G_FSQRT generic instructionJessica Paquette2019-01-304-0/+17
| | | | | | | | | This introduces a generic instruction for computing the floating point square root of a value. Right now, we can't select @llvm.sqrt, so this is working towards fixing that. llvm-svn: 352668
* [LTO] Set CGOptLevel in LTO config.Sam Clegg2019-01-305-0/+20
| | | | | | | | | Previously we were never setting this which means it was always being set to Default (-O2/-Os). Differential Revision: https://reviews.llvm.org/D57422 llvm-svn: 352667
* Reverting r352642 - Handle restore instructions in LiveDebugValues - as it's ↵Wolfgang Pieb2019-01-305-417/+94
| | | | | | | | causing assertions on some buildbots. llvm-svn: 352666
* Add a new builtin: __builtin_dynamic_object_sizeErik Pilkington2019-01-3012-274/+332
| | | | | | | | | | | | | | | | | | | | | | | | | This builtin has the same UI as __builtin_object_size, but has the potential to be evaluated dynamically. It is meant to be used as a drop-in replacement for libraries that use __builtin_object_size when a dynamic checking mode is enabled. For instance, __builtin_object_size fails to provide any extra checking in the following function: void f(size_t alloc) { char* p = malloc(alloc); strcpy(p, "foobar"); // expands to __builtin___strcpy_chk(p, "foobar", __builtin_object_size(p, 0)) } This is an overflow if alloc < 7, but because LLVM can't fold the object size intrinsic statically, it folds __builtin_object_size to -1. With __builtin_dynamic_object_size, alloc is passed through to __builtin___strcpy_chk. rdar://32212419 Differential revision: https://reviews.llvm.org/D56760 llvm-svn: 352665
* Add a 'dynamic' parameter to the objectsize intrinsicErik Pilkington2019-01-3029-196/+302
| | | | | | | | | | | | | | This is meant to be used with clang's __builtin_dynamic_object_size. When 'true' is passed to this parameter, the intrinsic has the potential to be folded into instructions that will be evaluated at run time. When 'false', the objectsize intrinsic behaviour is unchanged. rdar://32212419 Differential revision: https://reviews.llvm.org/D56761 llvm-svn: 352664
* [ASTDump] Make method definition order matches declaration orderStephen Kelly2019-01-301-21/+22
| | | | | | This will make follow-up changes easier to review. llvm-svn: 352663
* [Tests] Add tests for propagation of undef elements in vector GEPsPhilip Reames2019-01-301-0/+25
| | | | llvm-svn: 352662
* [ASTDump] Re-arrange method declarations to group Visit togetherStephen Kelly2019-01-301-120/+112
| | | | | | This will make follow-up commits easier to review. llvm-svn: 352661
* [X86] Mark EMMS and FEMMS as clobbering MM0-7 and ST0-7.Craig Topper2019-01-303-88/+48
| | | | | | | | | | This fixes the test case in PR35982 by preventing MMX instructions that read MM0-7 from being moved below EMMS/FEMMS by the post RA scheduler. Though as discussed in bugzilla, this is not a complete fix. There is still the possibility of reordering in IR or by the pre-RA scheduler. Differential Revision: https://reviews.llvm.org/D57298 llvm-svn: 352660
* gn build: Set executable bit on get.pyNico Weber2019-01-301-0/+0
| | | | llvm-svn: 352659
* Revert "[CMake] Use correct visibility for linked libraries in CMake"Petr Hosek2019-01-303-6/+6
| | | | | | This reverts commit r352654: this broke libcxx and sanitizer bots. llvm-svn: 352658
* [ASTDump] Rename methods which are conceptually VisitsStephen Kelly2019-01-302-132/+128
| | | | | | | This is consistent with the TextNodeDumper, and is the appropriate name for the traverser class which will be extracted. llvm-svn: 352657
* [ASTDump] NFC: Inline vestigial methodsStephen Kelly2019-01-301-23/+15
| | | | | | This was a porting aid. llvm-svn: 352656
* [ASTDump] Move Decl node dumping to TextNodeDumperStephen Kelly2019-01-303-626/+761
| | | | | | | | | | Reviewers: aaron.ballman Subscribers: jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D57419 llvm-svn: 352655
* [CMake] Use correct visibility for linked libraries in CMakePetr Hosek2019-01-303-6/+6
| | | | | | | | | | | When linking library dependencies, we shouldn't need to export linked libraries to dependents. We should be explicit about this in target_link_libraries, otherwise other targets that depend on these such as sanitizers get repeated (and possibly even conflicting) dependencies. Differential Revision: https://reviews.llvm.org/D57456 llvm-svn: 352654
* SimplifyDemandedVectorElts for all intrinsicsPhilip Reames2019-01-302-40/+23
| | | | | | | | | | The point is that this simplifies integration of new intrinsics into SimplifiedDemandedVectorElts, and ensures we don't miss any existing ones. This is intended to be NFC-ish, but as seen from the diffs, can produce slightly different output. This is due to order of transforms w/in instcombine resulting in two slightly different fixed points. That's something we should fix, but isn't a problem w/this patch per se. Differential Revision: https://reviews.llvm.org/D57398 llvm-svn: 352653
* The test comitted with r348896 needed -march=x86=64 on the llc command line.Wolfgang Pieb2019-01-301-1/+1
| | | | llvm-svn: 352651
* Revert "gn build: Add BPF target."Yonghong Song2019-01-307-241/+0
| | | | | | | | | This reverts commit r352638. The change in this patch is not trivial and it is merged without component owner approval. llvm-svn: 352649
* [libc++] Explicitly initialize std::nothrowThomas Anderson2019-01-301-1/+1
| | | | | | | | | | | | | When building on Windows without libc++abi, this change fixes a build error of the form: src/new.cpp(38,17): error: chosen constructor is explicit in copy-initialization const nothrow_t nothrow = {}; include/vcruntime_new.h(53,22): note: explicit constructor declared here explicit nothrow_t() = default; Differential Revision: https://reviews.llvm.org/D57351 llvm-svn: 352648
* [libc++] Don't define operator new/delete when using vcruntimeThomas Anderson2019-01-301-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes build errors on Windows without libc++abi of the form: new(173,36): error: redeclaration of 'operator delete' cannot add 'dllexport' attribute _LIBCPP_OVERRIDABLE_FUNC_VIS void operator delete(void* __p) _NOEXCEPT; vcruntime_new.h(87,16): note: previous declaration is here void __CRTDECL operator delete( new(205,70): error: redefinition of 'operator new' _LIBCPP_NODISCARD_AFTER_CXX17 inline _LIBCPP_INLINE_VISIBILITY void* operator new (std::size_t, void* __p) _NOEXCEPT {return __p;} vcruntime_new.h(184,28): note: previous definition is here inline void* __CRTDECL operator new(size_t _Size, _Writable_bytes_(_Size) void* _Where) noexcept new(206,70): error: redefinition of 'operator new[]' _LIBCPP_NODISCARD_AFTER_CXX17 inline _LIBCPP_INLINE_VISIBILITY void* operator new[](std::size_t, void* __p) _NOEXCEPT {return __p;} vcruntime_new.h(199,28): note: previous definition is here inline void* __CRTDECL operator new[](size_t _Size, new(207,40): error: redefinition of 'operator delete' inline _LIBCPP_INLINE_VISIBILITY void operator delete (void*, void*) _NOEXCEPT {} vcruntime_new.h(190,27): note: previous definition is here inline void __CRTDECL operator delete(void*, void*) noexcept new(208,40): error: redefinition of 'operator delete[]' inline _LIBCPP_INLINE_VISIBILITY void operator delete[](void*, void*) _NOEXCEPT {} vcruntime_new.h(206,27): note: previous definition is here inline void __CRTDECL operator delete[](void*, void*) noexcept Differential Revision: https://reviews.llvm.org/D57362 llvm-svn: 352647
* [libc++] Don't define exception destructors when using vcruntimeThomas Anderson2019-01-301-15/+8
| | | | | | | | | | | | | Exception destructors are provided by vcruntime. Fixes link errors like: lld-link: error: duplicate symbol: "public: virtual __cdecl std::invalid_argument::~invalid_argument(void)" (??1invalid_argument@std@@UEAA@XZ) in stdexcept.obj and in libcpmt.lib(xthrow.obj) lld-link: error: duplicate symbol: "public: virtual __cdecl std::length_error::~length_error(void)" (??1length_error@std@@UEAA@XZ) in stdexcept.obj and in libcpmt.lib(xthrow.obj) lld-link: error: duplicate symbol: "public: virtual __cdecl std::out_of_range::~out_of_range(void)" (??1out_of_range@std@@UEAA@XZ) in stdexcept.obj and in libcpmt.lib(xthrow.obj) lld-link: error: duplicate symbol: "public: virtual __cdecl std::overflow_error::~overflow_error(void)" (??1overflow_error@std@@UEAA@XZ) in stdexcept.obj and in libcpmt.lib(xthrow.obj) Differential Revision: https://reviews.llvm.org/D57425 llvm-svn: 352646
* [WebAssembly] Fix crash with LTO + relocatable + undefined symbolsSam Clegg2019-01-306-161/+199
| | | | | | | | | | | | Change the way we create the symbol table to be closer to how its done on ELF. Now the output symbol table matches the internal symtab order and includes local and undefined symbols. Fixes PR40204 Differential Revision: https://reviews.llvm.org/D56947 llvm-svn: 352645
* Add LLDB website and documentation in reStructuredText for SphinxJonas Devlieghere2019-01-3024-1/+7657
| | | | | | | | | | | | | | | | | | | | | | | | | The current LLDB website is written in HTML which is hard to maintain. We have quite a bit of HTML code checked in which can make it hard to differentiate between documentation written by us and documentation generated by a tool. In line with the other LLVM projects, I propose generating the documentation with Sphix. I think text/rst files provide a lower barrier for new or casual contributors to fix or update. This patch adds a copy of the LLDB website and documentation in reStructuredText. It also adds a new ninja target `docs-lldb-html` when -DLLVM_ENABLE_SPHINX:BOOL is enabled. This is the first step in having the website and documentation being generated from the repository, rather than having the output checked-in under the www folder. During the hopefully short transition period, please also update the reStructuredText files when modifying the website. Differential revision: https://reviews.llvm.org/D55376 llvm-svn: 352644
* [Scalar] Remove partially wrong and unused functions.Davide Italiano2019-01-302-54/+0
| | | | | | | I originally thought about fixing them, but hey, nobody is using them anyway. llvm-svn: 352643
* [DEBUGINFO] Handle restore instructions in LiveDebugValuesWolfgang Pieb2019-01-305-94/+417
| | | | | | | | | | | | | The LiveDebugValues pass recognizes spills but not restores, which can cause large gaps in location information for some variables, depending on control flow. This patch make LiveDebugValues recognize restores and generate appropriate DBG_VALUE instructions. Reviewers: aprantl, NicolaPrica Differential Revision: https://reviews.llvm.org/D57271 llvm-svn: 352642
* [Scalar] Hoist a duplicated (and sometimes wrong) comment.Davide Italiano2019-01-301-9/+3
| | | | | | Pointed out by Zachary and Adrian. llvm-svn: 352641
* [llvm-objcopy][NFC] More error propagation (linkToBuildIdDir)Jordan Rupprecht2019-01-301-13/+21
| | | | llvm-svn: 352640
* [Scalar] Implement support for 512-bit values.Davide Italiano2019-01-304-1/+242
| | | | | | | | (useful, e.g. when reading 512-bits registers, a-la AVX-512). <rdar://problem/46886288> llvm-svn: 352639
* gn build: Add BPF target.Peter Collingbourne2019-01-307-0/+241
| | | | | | Differential Revision: https://reviews.llvm.org/D57436 llvm-svn: 352638
* GlobalISel: Add simpler way of always specifying custom loweringMatt Arsenault2019-01-301-0/+5
| | | | llvm-svn: 352637
* GlobalISel: Add assert that legalize mutation makes senseMatt Arsenault2019-01-301-1/+64
| | | | | | | | | I've repeatedly encountered bugs resulting from custom legalize mutations returning nonsense legalize results, such as increasing the number of elements for FewerElements. Add an assert function to make sure the type to mutate to is consistent with the legalize action. llvm-svn: 352636
OpenPOWER on IntegriCloud