summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* GlobalISel: Fix creating MMOs with align 0Matt Arsenault2019-01-3119-143/+154
| | | | llvm-svn: 352712
* [libFuzzer] Set default sanitizer options in fuzzer testsJulian Lettner2019-01-316-7/+15
| | | | | | | | | | | | | | | | | | | | | Summary: Set default `ASAN_OPTIONS` when running libFuzzer tests. This allows us to remove special casing in code for Darwin where we usually pass `abort_on_error=0` to override platform defaults for tests. A previous commit changed the code to make the tests pass: https://github.com/llvm/llvm-project/commit/7764a04af007eca68eafcf5caaea560ed05e35a9 Adapted a few tests to use `%env_asan_opts=` instead of directly setting the environment variable. rdar://problem/47515276 Reviewers: kcc, george.karpenkov Differential Revision: https://reviews.llvm.org/D57465 llvm-svn: 352711
* [testsuite] Fix TestAppleSimulator so that it works with Python 3.Davide Italiano2019-01-312-3/+3
| | | | llvm-svn: 352710
* [Python] Fix gdb-remote and lldb-server utilities to work with Py3.Davide Italiano2019-01-312-5/+5
| | | | llvm-svn: 352709
* [X86] Add a 32-bit command line to avx512-intrinsics.ll. Move all 64-bit ↵Craig Topper2019-01-312-2265/+4569
| | | | | | | | mode only intrinsics to avx512-intrinsics-x86_64.ll. Most of the other intrinsic tests have a 32-bit command lines. llvm-svn: 352708
* [InstCombine] Simplify check clauses in test (NFC)Evandro Menezes2019-01-311-71/+57
| | | | llvm-svn: 352707
* [Python] Python 2 and Python 3 disagree on `/`.Davide Italiano2019-01-311-1/+1
| | | | | | | | One considers it integer division, the other doesn't. Move to `//` (floor division) so that this test passes independently from the version. llvm-svn: 352706
* Reland "gn build: Add BPF target."Peter Collingbourne2019-01-317-0/+241
| | | | | | Differential Revision: https://reviews.llvm.org/D57436 llvm-svn: 352705
* lit: Let lit.util.which() return a normcase()ed pathNico Weber2019-01-311-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | LLVMConfig.with_environment() uses os.path.normcase(os.path.normpath(x)) to normalize temporary env vars. LLVMConfig.use_clang() uses with_environment() to temporarily set PATH and then look for clang there. This means that on Windows, clang will be run with a path like c:\foo\bin\clang.EXE (with a lower-case "C:"). lit.util.which() used to not do this, which means the executables added in clang/test/lit.cfg.py (e.g. c-index-test) were run with a path like C:\foo\bin\c-index-test.EXE (because both CMake and GN happen to write clang_tools_dir with an upper-case C to lit.site.cfg.py). clang/test/Index/pch-from-libclang.c requires that both c-index-test and clang use _exactly_ the same resource dir path (same case and everything), because a hash of the resource directory is used as module cache path. This patch is necessary but not sufficient to make pch-from-libclang.c pass on Windows. Differential Revision: https://reviews.llvm.org/D57343 llvm-svn: 352704
* Add Sphinx generated html files as output to the build phase.Jonas Devlieghere2019-01-311-1/+23
| | | | | | This will ensure we don't rerun Sphinx when the files exist. llvm-svn: 352703
* [LegalizeVectorTypes] Allow illegal indices when splitting extract_vector_eltThomas Lively2019-01-312-1/+22
| | | | | | | | | | | | | | | | | Summary: Fixes PR40267, in which the removed assertion was triggering on perfectly valid IR. As far as I can tell, constant out of bounds indices should be allowed when splitting extract_vector_elt, since they will simply be propagated as out of bounds indices in the resulting split vector and handled appropriately elsewhere. Reviewers: aheejin Subscribers: dschuff, sbc100, jgravelle-google, hiraditya Differential Revision: https://reviews.llvm.org/D57471 llvm-svn: 352702
* [Python] String(s) and bytes are two different entities in 3.7.Davide Italiano2019-01-311-1/+1
| | | | | | | So, we need an explicit call to decode() here to let it work with both interpreters. Fixes TestXMMRegisters on 3.7. llvm-svn: 352701
* [libFuzzer] experimental performance optimization -lazy_counters, off by ↵Kostya Serebryany2019-01-3112-1/+82
| | | | | | default. Posix-only for now, tested on Linux llvm-svn: 352700
* [LegalizeTypes] Use report_fatal_error instead of llvm_unreachable in the ↵Craig Topper2019-01-311-2/+3
| | | | | | | | | | default case of some type legalization handlers that can be reached with intrinsics with result or operands that aren't legal types. These can be triggered by mistakenly using a 64-bit mode only intrinsics with a -mtriple=i686. Using report_fatal_error gives a better experience for this mistake in release builds instead of probably crashing. We already do this for some of the vector type legalization handles. llvm-svn: 352699
* [X86] Remove handling of ISD::INTRINSIC_WO_CHAIN in ReplaceNodeResults.Craig Topper2019-01-311-6/+0
| | | | | | I believe this was there to handle avx512bw intrinsics that returned i64 type in 32-bit mode. But all those intrinsics have since been changed to v64i1 results or replaced with generic IR. llvm-svn: 352698
* [X86] Add test case for pr40539. NFCCraig Topper2019-01-311-0/+36
| | | | llvm-svn: 352697
* Add lldb-docs target to Xcode projectJonas Devlieghere2019-01-301-0/+96
| | | | | | | This patch adds the lldb-docs target which generates the Sphinx html documentation. llvm-svn: 352696
* [WebAssembly] Remove TODO on wasm.extract.exception intrinsic (NFC)Heejin Ahn2019-01-301-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: We planned to delete this intrinsic and do custom lowering from `wasm.get.exception`, which has a token argument, to `EXTRACT_EXCEPTION`, a wasm pseudo instruction that simulates popping a value from the wasm stack. To do that, we need to introduce a new `WebAssemblyISD` node for this, which itself is not a problem, but also have to introduce the `WebAssemblyISD` namespace in SelectionDAGBuilder.cpp. I don't think any other targets are doing that in the file. And also putting a target-specific intrinsic in the common file is a little weird too. (All other intrinsic functions in this `visitIntrinsicCall` functions are not target-specific ones. Other target-specific intrinsics are usually handled in `lib/Target/[TargetName]/[TargetName]ISelLowering.cpp`. The reason we can't do this is it has a token argument. Anyway, so I think I prefer the current code with one redundant intrinsic more than adding one more `WebAssemblyISD` node and also introducing the `WebAssemblyISD` namespace into SelectionDAGBuilder.cpp. What do you think? Reviewers: dschuff Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D57480 llvm-svn: 352695
* [RuntimeDyld] Don't try to allocate sections with align 0.Zachary Turner2019-01-301-0/+5
| | | | | | | | | | | | | ELF sections allow 0 for the alignment, which is specified to be the same as 1. However many clients do not expect this and will behave poorly in the presence of a 0-aligned section (for example by trying to modulo something by the section alignment). We can be more polite by making sure that we always pass a non-zero value to clients. Differential Revision: https://reviews.llvm.org/D57482 llvm-svn: 352694
* [analyzer] Make NullReturnedFromNonnullChecker depend on NullabilityBaseKristof Umann2019-01-302-0/+4
| | | | | | Accidentally left this dependency out after D54438. llvm-svn: 352693
* [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
OpenPOWER on IntegriCloud