summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Silence warning about unused private variable.Zachary Turner2018-02-151-1/+3
| | | | llvm-svn: 325275
* Call FlushFileBuffers on output files.Zachary Turner2018-02-152-1/+17
| | | | | | | | | | | | There is a latent Windows kernel bug, the exact trigger conditions are not well understood, which can cause a file to be correctly written, but unable to be correctly read. The workaround appears to be simply calling FlushFileBuffers. Differential Revision: https://reviews.llvm.org/D42925 llvm-svn: 325274
* [WebAssembly] Restore "*-wasm" tests.Dan Gohman2018-02-151-0/+5
| | | | | | | Even though "...-wasm" is now the default for wasm, it's still desirable to test this form. llvm-svn: 325273
* [clang-tidy] Add `readability-simd-intrinsics` check.Fangrui Song2018-02-159-0/+283
| | | | | | | | | | | | | | | | | | | | | Summary: Many architectures provide SIMD operations (e.g. x86 SSE/AVX, Power AltiVec/VSX, ARM NEON). It is common that SIMD code implementing the same algorithm, is written in multiple target-dispatching pieces to optimize for different architectures or micro-architectures. The C++ standard proposal P0214 and its extensions cover many common SIMD operations. By migrating from target-dependent intrinsics to P0214 operations, the SIMD code can be simplified and pieces for different targets can be unified. Refer to http://wg21.link/p0214 for introduction and motivation for the data-parallel standard library. Subscribers: klimek, aemerson, mgorny, xazax.hun, kristof.beyls, hintonda, cfe-commits Differential Revision: https://reviews.llvm.org/D42983 llvm-svn: 325272
* [Test] Remove mangled name from test.Matt Davis2018-02-151-1/+0
| | | | | | | This line is not needed in the test, and breaks Windows testing. Fixes the test added in r325175. llvm-svn: 325271
* [X86][SSE] Add saturated truncation tests for storing illegal v8i8 typesSimon Pilgrim2018-02-153-0/+1605
| | | | | | Tests showing missing opportunities to use PACK instructions in cases where we need to truncate to illegal types for stores llvm-svn: 325270
* Recommit [Hexagon] Make the vararg handling a bit more robustKrzysztof Parzyszek2018-02-151-19/+11
| | | | | | | Use the FunctionType of the callee when it's available. It may not be available for synthetic calls to functions specified by external symbols. llvm-svn: 325269
* [SLP] Fix the test for the reversed stores, NFC.Alexey Bataev2018-02-151-18/+11
| | | | llvm-svn: 325268
* bpf: fix a bug in dag2dag optimization for loads from readonly sectionYonghong Song2018-02-152-4/+57
| | | | | | | | | | | | | | | | | | | | | The reference '&' is missing in the function parameter. If there are back-to-back optimizations in terms of dag node list like below: t29: i64,ch = load<LD4[bitcast (%struct.test_t* @test.t to i8*)+12](dereferenceable), zext from i32> t3, t43, undef:i64 t34: i64,ch = load<LD4[bitcast (%struct.test_t* @test.t to i8*)](dereferenceable), zext from i32> t3, t41, undef:i64 The bug will trigger a segfault for the added test case remove_truncate_5.ll: LLVMSymbolizer: error reading file: No such file or directory #0 0x000000000241c4d9 (llc+0x241c4d9) #1 0x000000000241c56a (llc+0x241c56a) #2 0x000000000241aa50 (llc+0x241aa50) ... #22 0x0000000000fd5edf (llc+0xfd5edf) #23 0x00007f0fe03bec05 __libc_start_main (/lib64/libc.so.6+0x21c05) #24 0x0000000000fd3e69 (llc+0xfd3e69) ... Segmentation fault Signed-off-by: Yonghong Song <yhs@fb.com> llvm-svn: 325267
* Revert "[Hexagon] Make the vararg handling a bit more robust"Krzysztof Parzyszek2018-02-151-8/+19
| | | | | | This is breaking lit tests. llvm-svn: 325266
* [SLP] Added test for reversed stores, NFC.Alexey Bataev2018-02-151-1/+64
| | | | llvm-svn: 325265
* [OpenCL] Fix __enqueue_block for block with capturesYaxun Liu2018-02-156-39/+89
| | | | | | | | | | | | | | | | | | | | | | | | | The following test case causes issue with codegen of __enqueue_block void (^block)(void) = ^{ callee(id, out); }; enqueue_kernel(queue, 0, ndrange, block); Clang first does codegen for block expression in the first line and deletes its block info. Clang then tries to do codegen for the same block expression again for the second line, and fails because the block info is gone. The fix is to do normal codegen for both lines. Introduce an API to OpenCL runtime to record llvm block invoke function and llvm block literal emitted for each AST block expression, and use the recorded information for generating the wrapper kernel. The EmitBlockLiteral APIs are cleaned up to minimize changes to the normal codegen of blocks. Another minor issue is that some clean up AST expression is generated for block with captures, which can be stripped by IgnoreImplicit. Differential Revision: https://reviews.llvm.org/D43240 llvm-svn: 325264
* [InstCombine] use m_OneUse to reduce code; NFCSanjay Patel2018-02-151-2/+2
| | | | llvm-svn: 325263
* [InstCombine] test fdiv folds better; NFCSanjay Patel2018-02-152-33/+43
| | | | | | | We had redundant tests, but no tests for extra uses or vectors. 'fast' is an overly conservative requirement for these folds. llvm-svn: 325262
* Amend r325256. This change was not properly merged locally before the commit ↵Aaron Ballman2018-02-151-1/+1
| | | | | | happened. llvm-svn: 325261
* [clangd] Create trace::Span when running ASTCallbackIlya Biryukov2018-02-151-1/+3
| | | | llvm-svn: 325260
* [Hexagon] Make the vararg handling a bit more robustKrzysztof Parzyszek2018-02-151-19/+8
| | | | | | | The FunctionType of the callee is always available, even if the Function of the callee is not. Use that to get the number of fixed parameters. llvm-svn: 325259
* [CodeGen] Separate MBB metadata from instructions in -debug printingFrancis Visoiu Mistrih2018-02-151-1/+9
| | | | | | | Add an empty line after 'liveins:', 'successors:', or '; predecessors:', the one that ends up to be the last one. llvm-svn: 325258
* [clangd] Use explicit env in test to make lit+windows happy. NFCSam McCall2018-02-151-1/+1
| | | | llvm-svn: 325257
* NFC; clean up this file based on our coding standards. The impetus was ↵Aaron Ballman2018-02-151-1500/+1467
| | | | | | | | | | considerable use of a type name as an identifier for an object. Changed identifier names (especially function parameters) to not clash with type names and to follow the proper naming conventions. Use of explicit type names changed to use auto where appropriate. Removed unused parameters that should have never been added in the first place. Minor formatting cleanups. The changes were mostly mechanical and should have no functional impact. llvm-svn: 325256
* [Hexagon] Fix lowering of formal arguments after r324737Krzysztof Parzyszek2018-02-152-18/+28
| | | | | | Lowering of formal arguments needs to be aware of vararg functions. llvm-svn: 325255
* [clangd] Fixed compilation with MVSC.Ilya Biryukov2018-02-151-6/+11
| | | | llvm-svn: 325254
* [SelectionDAG] Pull out repeated Op.getOpcode(). NFCI.Simon Pilgrim2018-02-151-6/+7
| | | | llvm-svn: 325253
* [clang-format] Support repeated field lists in protosKrasimir Georgiev2018-02-153-11/+100
| | | | | | | | | | | | | | | | | | Summary: This patch adds support for list initialization of proto repeated fields: ``` keys: [1, 2, 3] ``` Reviewers: djasper Reviewed By: djasper Subscribers: klimek, cfe-commits Differential Revision: https://reviews.llvm.org/D43298 llvm-svn: 325252
* [CodeGen] Print irreducible loop header weight as a MIR commentFrancis Visoiu Mistrih2018-02-151-3/+2
| | | | | | Prefix it with '; ' to make it more MIR-compatible. llvm-svn: 325251
* @skipIfRemote TestTargetXMLArchPavel Labath2018-02-151-0/+1
| | | | | | The test does not actually connect to any remote targets. llvm-svn: 325250
* Try to unbreak Darwin after XRay/FreeBSD commitKamil Rytarowski2018-02-151-1/+4
| | | | | | Add a fallback definition of getTSCFrequency(). llvm-svn: 325249
* Implement a large part of NetBSD syscalls of netbsd_syscall_hooks.hKamil Rytarowski2018-02-153-4/+10958
| | | | | | | | | | This is a follow up of: r325206 - Add NetBSD syscall hooks skeleton in sanitizers Sponsored by <The NetBSD Foundation> llvm-svn: 325248
* [InstCombine] allow sin/cos transforms with 'reassoc'Sanjay Patel2018-02-153-85/+84
| | | | | | | | | | | | | | | | The variable name 'AllowReassociate' is a lie at this point because it's set to 'isFast()' which is more than the 'reassoc' FMF after rL317488. In D41286, we showed that this transform may be valid even with strict math by brute force checking every 32-bit float result. There's a potential problem here because we're replacing with a tan() libcall rather than a hypothetical LLVM tan intrinsic. So we might set errno when we should be guaranteed not to do that. But that's independent of this change. llvm-svn: 325247
* Enable test/asan for NetBSDKamil Rytarowski2018-02-151-1/+1
| | | | | | Sponsored by <The NetBSD Foundation> llvm-svn: 325246
* Enable syscall-specific functions in TSan/NetBSDKamil Rytarowski2018-02-151-1/+1
| | | | | | | | | | | | | NetBSD ships now with netbsd_syscall_hooks.h and requires support for TSan specific features to be enabled. This is follow up of: D42048: Add NetBSD syscall hooks skeleton in sanitizers Sponsored by <The NetBSD Foundation> llvm-svn: 325245
* [ARM] Allow 64- and 128-bit types with 't' inline asm constraintPablo Barrio2018-02-154-4/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: In LLVM, 't' selects a floating-point/SIMD register and only supports 32-bit values. This is appropriately documented in the LLVM Language Reference Manual. However, this behaviour diverges from that of GCC, where 't' selects the s0-s31 registers and its qX and dX variants depending on additional operand modifiers (q/P). For example, the following C code: #include <arm_neon.h> float32x4_t a, b, x; asm("vadd.f32 %0, %1, %2" : "=t" (x) : "t" (a), "t" (b)) results in the following assembly if compiled with GCC: vadd.f32 s0, s0, s1 whereas LLVM will show "error: couldn't allocate output register for constraint 't'", since a, b, x are 128-bit variables, not 32-bit. This patch extends the use of 't' to mean that of GCC, thus allowing selection of the lower Q vector regs and their D/S variants. For example, the earlier code will now compile as: vadd.f32 q0, q0, q1 This behaviour still differs from that of GCC but I think it is actually more correct, since LLVM picks up the right register type based on the datatype of x, while GCC would need an extra operand modifier to achieve the same result, as follows: asm("vadd.f32 %q0, %q1, %q2" : "=t" (x) : "t" (a), "t" (b)) Since this is only an extension of functionality, existing code should not be affected by this change. Note that operand modifiers q/P are already supported by LLVM, so this patch should suffice to support inline assembly with constraint 't' originally built for GCC. Reviewers: grosbach, rengolin Reviewed By: rengolin Subscribers: rogfer01, efriedma, olista01, aemerson, javed.absar, eraman, kristof.beyls, llvm-commits Differential Revision: https://reviews.llvm.org/D42962 llvm-svn: 325244
* [X86][SSE] combineTruncateWithSat - use truncateVectorWithPACK to chain ↵Simon Pilgrim2018-02-152-152/+30
| | | | | | | | PACKUS vXi32-vXi8 saturated truncation We can use PACKSS/PACKUS to saturate each stage of the chain: PACKSSDW down to [-32768,32767] and then PACKUSWB to [0,255]. llvm-svn: 325243
* [clangd] Enable snippet completion based on client capabilities.Ilya Biryukov2018-02-155-14/+133
| | | | | | | | | | | | | | Summary: And remove -enable-snippets flag. Reviewers: hokein, ioeric, sammccall Reviewed By: ioeric Subscribers: klimek, jkorous-apple, cfe-commits Differential Revision: https://reviews.llvm.org/D43229 llvm-svn: 325242
* Adding msan support for FreeBSDKamil Rytarowski2018-02-151-0/+2
| | | | | | | | | | | | | | | | Summary: Enabling memory sanitiser for X86_64 arch only. To match the sanitiser counterpart. Patch by: David CARLIER Reviewers: krytarowski Reviewed By: krytarowski Subscribers: dim, emaste, cfe-commits Differential Revision: https://reviews.llvm.org/D43148 llvm-svn: 325241
* Add Xray instrumentation support to FreeBSDKamil Rytarowski2018-02-1510-22/+59
| | | | | | | | | | | | | | | | | | | Summary: - Enabling the build. - Using assembly for the cpuid parts. - Using thr_self FreeBSD call to get the thread id Patch by: David CARLIER Reviewers: dberris, rnk, krytarowski Reviewed By: dberris, krytarowski Subscribers: emaste, stevecheckoway, nglevin, srhines, kubamracek, dberris, mgorny, krytarowski, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D43278 llvm-svn: 325240
* [clangd] Fix make_unique ambiguity, NFCSam McCall2018-02-151-2/+2
| | | | llvm-svn: 325239
* Add Xray instrumentation compile-time/link-time support to FreeBSDKamil Rytarowski2018-02-151-0/+27
| | | | | | | | | | | | | | | | Summary: Similarly to the GNU driver version, adding proper compile and linker flags. Patch by: David CARLIER Reviewers: vitalybuka, krytarowski, dberris Reviewed By: krytarowski, dberris Subscribers: emaste, dberris, cfe-commits Differential Revision: https://reviews.llvm.org/D43279 llvm-svn: 325238
* [InstCombine] allow X / C -> X * (1.0/C) for vector splat FP constantsSanjay Patel2018-02-154-14/+39
| | | | llvm-svn: 325237
* Add -no-canonical-prefixes to allow different build modes.Martin Bohme2018-02-151-5/+5
| | | | llvm-svn: 325236
* [X86][SSE] combineTruncateWithSat - use truncateVectorWithPACK to chain ↵Simon Pilgrim2018-02-152-170/+26
| | | | | | | | | | PACKSS vXi32-vXi8 saturated truncation We can use PACKSS to saturate each stage of the chain: PACKSSDW down to [-32768,32767] and then PACKSSWB to [-128,127]. PACKUS is a little trickier and will be handled in a separate patch. llvm-svn: 325235
* [DebugInfo] Accept enumeration types without underlying integer type present inMomchil Velikov2018-02-152-6/+21
| | | | | | | | | | debug info metadata ... when generating DWARF. Differential Revision: https://reviews.llvm.org/D43304 llvm-svn: 325234
* [clangd] Make functions of ClangdServer callback-basedIlya Biryukov2018-02-158-143/+197
| | | | | | | | | | | | | | | | | | Summary: As a consequence, all LSP operations are now handled asynchronously, i.e. they never block the main processing thread. However, if -run-synchronously flag is specified, clangd still runs everything on the main thread. Reviewers: sammccall, ioeric, hokein Reviewed By: sammccall, ioeric Subscribers: klimek, jkorous-apple, cfe-commits Differential Revision: https://reviews.llvm.org/D43227 llvm-svn: 325233
* [SelectionDAG] Add initial implementation of ↵Simon Pilgrim2018-02-1513-403/+482
| | | | | | | | | | | | TargetLowering::SimplifyDemandedVectorElts This is mainly a move of simplifyShuffleOperands from DAGCombiner::visitVECTOR_SHUFFLE to create a more general purpose TargetLowering::SimplifyDemandedVectorElts implementation. Further features can be moved/added in future patches. Differential Revision: https://reviews.llvm.org/D42896 llvm-svn: 325232
* [ARM] f16 vcmp fixesSjoerd Meijer2018-02-152-28/+54
| | | | | | | | This adds f16 VCMP match rules and fixes the test cases. Differential Revision: https://reviews.llvm.org/D43291 llvm-svn: 325228
* Revert r325224 "Report fatal error in the case of out of memory"Serge Pavlov2018-02-1521-101/+30
| | | | | | It caused fails on some buildbots. llvm-svn: 325227
* Specify namespace for reallocSerge Pavlov2018-02-151-1/+1
| | | | llvm-svn: 325226
* [clang-tidy] Make a test pass on platforms where exceptions disabled by default.Gabor Horvath2018-02-151-1/+1
| | | | llvm-svn: 325225
* Report fatal error in the case of out of memorySerge Pavlov2018-02-1521-30/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Analysis of fails in the case of out of memory errors can be tricky on Windows. Such error emerges at the point where memory allocation function fails, but manifests itself when null pointer is used. These two points may be distant from each other. Besides, next runs may not exhibit allocation error. Usual programming practice does not require checking result of 'operator new' because it throws 'std::bad_alloc' in the case of allocation error. However, LLVM is usually built with exceptions turned off, so 'new' can return null pointer. This change installs custom new handler, which causes fatal error in the case of out of memory. The handler is installed automatically prior to call to 'main' during construction of a static object defined in 'lib/Support/ErrorHandling.cpp'. If the application does not use this file, the handler may be installed manually by a call to 'llvm::install_out_of_memory_new_handler', declared in 'include/llvm/Support/ErrorHandling.h". There are calls to C allocation functions, malloc, calloc and realloc. They are used for interoperability with C code, when allocated object has variable size and when it is necessary to avoid call of constructors. In many calls the result is not checked against null pointer. To simplify checks, new functions are defined in the namespace 'llvm' with the same names as these C function. These functions produce fatal error if allocation fails. User should use 'llvm::malloc' instead of 'std::malloc' in order to use the safe variant. This change replaces 'std::malloc' in the cases when the result of allocation function is not checked against null pointer. Finally, there are plain C code, that uses malloc and similar functions. If the result is not checked, assert statements are added. Differential Revision: https://reviews.llvm.org/D43010 llvm-svn: 325224
* [clang-tidy] Minor documentation fixGabor Horvath2018-02-151-0/+1
| | | | llvm-svn: 325223
OpenPOWER on IntegriCloud