summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* [SLPVectorizer] Replace sameOpcodeOrAlt with InstructionsState.isOpcodeOrAlt ↵Simon Pilgrim2018-07-011-12/+10
| | | | | | | | helper. NFCI. This is a basic step towards matching more general instructions types than just opcodes. llvm-svn: 336068
* [asan] Fix deadlock issue on FreeBSD, caused by use of .preinit_array in ↵Fangrui Song2018-07-012-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | rL325240 Summary: Without this patch, clang -fsanitize=address -xc =(printf 'int main(){}') -o a; ./a => deadlock in __asan_init>AsanInitInternal>AsanTSDInit>...>__getcontextx_size>_rtld_bind>rlock_acquire(rtld_bind_lock, &lockstate) libexec/rtld-elf/rtld.c wlock_acquire(rtld_bind_lock, &lockstate); if (obj_main->crt_no_init) preinit_main(); // unresolved PLT functions cannot be called here lib/libthr/thread/thr_rtld.c uc_len = __getcontextx_size(); // unresolved PLT function in libthr.so.3 check-xray tests currently rely on .preinit_array so we special case in xray_init.cc Subscribers: srhines, kubamracek, krytarowski, delcypher, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D48806 llvm-svn: 336067
* [X86][Disassembler] Remove TYPE_BNDR from translateImmediate.Craig Topper2018-07-011-2/+0
| | | | | | I've check the disassembler tables and this shouldn't be reachable. Which is good since if it was reachable there should have been a 'return' after the addOperand line. llvm-svn: 336066
* [InstCombine] add abs tests with undef elts; NFCSanjay Patel2018-07-011-0/+30
| | | | llvm-svn: 336065
* [PatternMatch] allow undef elements in vectors with m_NegSanjay Patel2018-07-012-72/+50
| | | | | | This is similar to the m_Not change from D44076. llvm-svn: 336064
* [SLPVectorizer] Use InstructionsState Op/Alt opcodes directly. NFCI.Simon Pilgrim2018-07-011-4/+2
| | | | llvm-svn: 336063
* [UnrollAndJam] New Unroll and Jam passDavid Green2018-07-0123-20/+3849
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a simple implementation of the unroll-and-jam classical loop optimisation. The basic idea is that we take an outer loop of the form: for i.. ForeBlocks(i) for j.. SubLoopBlocks(i, j) AftBlocks(i) Instead of doing normal inner or outer unrolling, we unroll as follows: for i... i+=2 ForeBlocks(i) ForeBlocks(i+1) for j.. SubLoopBlocks(i, j) SubLoopBlocks(i+1, j) AftBlocks(i) AftBlocks(i+1) Remainder Loop So we have unrolled the outer loop, then jammed the two inner loops into one. This can lead to a simpler inner loop if memory accesses can be shared between the now jammed loops. To do this we have to prove that this is all safe, both for the memory accesses (using dependence analysis) and that ForeBlocks(i+1) can move before AftBlocks(i) and SubLoopBlocks(i, j). Differential Revision: https://reviews.llvm.org/D41953 llvm-svn: 336062
* Revert "[llvm-readobj] Fix printing format"Paul Semel2018-07-012-19/+4
| | | | | | | There is a problem with the formatting on windows build. I need to investigate on this. llvm-svn: 336061
* [SLPVectorizer][X86] Add some alternate tests for cast operatorsSimon Pilgrim2018-07-011-0/+169
| | | | | | Alternate opcode handling only supports binary operators, these tests demonstrate missed opportunities to vectorize some sitofp/uitofp and fptosi/fptoui style casts as well as some (successful) float bits manipulations llvm-svn: 336060
* [Evaluator] Improve evaluation of call instructionEugene Leviant2018-07-015-7/+314
| | | | | | Recommit of r335324 after buildbot failure fix llvm-svn: 336059
* [llvm-readobj] Fix printing formatPaul Semel2018-07-012-4/+19
| | | | | | | | | | | | We were printing every character, even those that weren't printable. It doesn't really make sense for this option. The string content was sticked to its address, added two spaces in between. Differential Revision: https://reviews.llvm.org/D48271 llvm-svn: 336058
* [X86] Remove unnecessary include. NFCCraig Topper2018-07-011-1/+0
| | | | | | Leftover from when the pass contained a DenseMap before it switched to binary search. llvm-svn: 336057
* [X86] Move the memory unfolding table creation into its own class and make ↵Craig Topper2018-07-015-5499/+5554
| | | | | | | | | | | | it a ManagedStatic. Also move the static folding tables, their search functions and the new class into new cpp/h files. The unfolding table is effectively static data. It's just a different ordering and a subset of the static folding tables. By putting it in a separate ManagedStatic we ensure we only have one copy instead of one per X86InstrInfo object. This way also makes it only get initialized when really needed. llvm-svn: 336056
* [X86] Move the X86InstrFMA3Info class into the cpp file. Expose only a ↵Craig Topper2018-06-303-48/+36
| | | | | | | | | | getFMA3Group free function. NFCI The class only exists to hold a DenseMap and is only created as a ManagedStatic. It used to expose a single static method that outside code was expected to use. This patch moves that static function out of the class and moves it implementation into the cpp file. It can now access the ManagedStatic directly by name without the need for the other static method that accessed the ManagedStatic. llvm-svn: 336055
* [X86] Remove the AsmName from the HAX,HDX,HCX,HBX,HSI,HDI,HBP,HSP,HIP ↵Craig Topper2018-06-301-9/+9
| | | | | | | | artificial registers so they can't be parsed by the assembly parser. There are no instructions that use them so they weren't causing any bad matches. But they weren't being diagnosed as "invalid register name" if they were used and would instead trigger some form of invalid operand. llvm-svn: 336054
* [UBsan] Enable subset of unit tests for OpenBSDDavid Carlier2018-06-3010-3/+17
| | | | | | | | | | Reviewers: kubamracek, krytarowski Reviewed By: krytarowski Differential Revision: https://reviews.llvm.org/D48805 llvm-svn: 336053
* [X86] Use MVT::i8 for scalar shift amounts since that is what they ↵Craig Topper2018-06-301-5/+5
| | | | | | | | | | ultimately need to legalize to. I believe all of these are constants so legalizing them should be pretty trivial, but this saves a step. In one case it looks like we may have been creating a shift amount larger than the shift input itself. llvm-svn: 336052
* [X86] When combining load to BZHI, make sure we create the shift instruction ↵Craig Topper2018-06-301-4/+5
| | | | | | | | | | with an i8 type. This combine runs pretty late and causes us to introduce a shift after the op legalization phase has run. We need to be sure we create the shift with the proper type for the shift amount. If we don't do this, we will still re-legalize the operation properly, but we won't get a chance to fully optimize the truncate that gets inserted. So this patch adds the necessary truncate when the shift is created. I've also narrowed the subtract that gets created to always be an i32 type. The truncate would have trigered SimplifyDemandedBits to optimize it anyway. But using a more appropriate VT here is free and saves an optimization step. llvm-svn: 336051
* [InstCombine] add tests for negate vector with undef elts; NFC Sanjay Patel2018-06-301-3/+27
| | | | llvm-svn: 336050
* Fix Wdocumentation compiler warning. NFCI.Simon Pilgrim2018-06-301-1/+1
| | | | llvm-svn: 336049
* [DAGCombiner] Handle correctly non-splat power of 2 -1 divisor (PR37119)Simon Pilgrim2018-06-302-275/+89
| | | | | | | | | | The combine added in commit 329525 overlooked the case where one, but not all, of the divisor elements is -1, -1 is the only power of two value for which the sdiv expansion recipe breaks. Thanks to @zvi for the original patch. Differential Revision: https://reviews.llvm.org/D45806 llvm-svn: 336048
* Add expected fail triple x86_64-pc-windows-gnu to test as x86_64-w64-mingw32 ↵Yaron Keren2018-06-301-1/+1
| | | | | | is already there llvm-svn: 336047
* [asan] Use MADV_NOCORE for use_madv_dontdump on FreeBSD.Fangrui Song2018-06-301-1/+3
| | | | | | | | | | | | | | | | Currently in FreeBSD 12.0-CURRENT with trunk clang+compiler-rt, faulty -fsanitize=address executable hangs at 'urdlck' state. Ka Ho Ng has verified that by backporting this to llvm 6.0.1, with use_madv_dontdump=1, shadow memory is not dumped. ASAN_OPTIONS=abort_on_error=1:disable_coredump=0:use_madv_dontdump=1 ./a Reviewers: dimitry, kcc, dvyukov, emaste, khng300 Subscribers: kubamracek, delcypher, llvm-commits, #sanitizers Differential Revision: https://reviews.llvm.org/D48257 llvm-svn: 336046
* [X86] Update some avx512 fast-isel tests to match their real clang IRgen.Craig Topper2018-06-302-332/+353
| | | | | | | | | | Especially of note was the test_mm_mask_set1_epi64 and other set1 tests that were truncating the element to be broadcasted to i8 and broadcasting that instead of a whole 64 bit value. Some of the others were just correcting mask sizes on parameters due to bugs in the clang test case they were generated from that have now been fixed. Some were converting i8 to <4 x i1>/<2 x i1> by truncating to i4/i2 and then bitcasting. But the clang codegen is bitcast to <8 x i1>, then extract to <4 x i1>/<2 x i1>. This is likely to incur less trouble from the integer type legalizer in the backend. llvm-svn: 336045
* [X86] Change some chec-prefixes from X32 to X86 to match the FileCheck ↵Craig Topper2018-06-301-48/+48
| | | | | | | | command line. I think this test changed and these test cases were created around the same time and missed the change. llvm-svn: 336044
* [X86] Remove test cases from avx512vl-intrinsics-fast-isel.ll for intrinsics ↵Craig Topper2018-06-301-49/+0
| | | | | | that don't really exist in clang. llvm-svn: 336043
* [X86] Correct the width of mask arguments in intrinsic headers and tests.Craig Topper2018-06-306-102/+100
| | | | | | | | | | | | | All of these found by grepping through IR from the builtin tests for extra trunc and zext/sext instructions that shouldn't have been there. Some of these were real bugs where we lost bits from the user input: _mm512_mask_broadcast_f32x8 _mm512_maskz_broadcast_f32x8 _mm512_mask_broadcast_i32x8 _mm512_maskz_broadcast_i32x8 _mm256_mask_cvtusepi16_storeu_epi8 llvm-svn: 336042
* AMDGPU/GlobalISel: Make IMPLICIT_DEF of all sizes < 512 legal.Tom Stellard2018-06-302-2/+30
| | | | | | | | | | | | | | | | | | | Summary: We could split sizes that are not power of two into smaller sized G_IMPLICIT_DEF instructions, but this ends up generating G_MERGE_VALUES instructions which we then have to handle in the instruction selector. Since G_IMPLICIT_DEF is really a no-op it's easier just to keep everything that can fit into a register legal. Reviewers: arsenm Reviewed By: arsenm Subscribers: kzhuravl, wdng, nhaehnle, yaxunl, rovka, kristof.beyls, dstuttard, tpr, t-tye, llvm-commits Differential Revision: https://reviews.llvm.org/D48777 llvm-svn: 336041
* [MachineOutliner] Add support for target-default outlining.Jessica Paquette2018-06-307-10/+56
| | | | | | | | | | | | | | | | | This adds functionality to the outliner that allows targets to specify certain functions that should be outlined from by default. If a target supports default outlining, then it specifies that in its TargetOptions. In the case that it does, and the user hasn't specified that they *never* want to outline, the outliner will be added to the pass pipeline and will run on those default functions. This is a preliminary patch for turning the outliner on by default under -Oz for AArch64. https://reviews.llvm.org/D48776 llvm-svn: 336040
* Driver: Add an explicit target to testcase from r336037Tom Stellard2018-06-301-0/+1
| | | | llvm-svn: 336039
* Driver: Don't mix system tools with devtoolset tools on RHELTom Stellard2018-06-302-0/+18
| | | | | | | | | | | | | | | | | Summary: On RHEL, devtoolset provides a more up-to-date toolchain than the base install, and we want to make sure all the tools use are from the same toolchain. Reviewers: rsmith, bruno Reviewed By: bruno Subscribers: bruno, cfe-commits Differential Revision: https://reviews.llvm.org/D34848 llvm-svn: 336037
* [X86] Remove masking from the avx512 rotate builtins. Use a select builtin ↵Craig Topper2018-06-306-402/+345
| | | | | | instead. llvm-svn: 336036
* [X86] Remove masking from avx512 rotate intrinsics. Use select in IR instead.Craig Topper2018-06-3011-314/+2674
| | | | llvm-svn: 336035
* [libc++abi] Look for __config instead of vectorShoaib Meenai2018-06-301-1/+1
| | | | | | | | | | | | | | | | vector is a generic C++ header, whereas __config is libc++-specific, so we can look for it instead to guarantee we're finding a libc++ installation. This was suggested by Eric in https://reviews.llvm.org/D48694. This is less important now that we're limiting the header search to the specified directories (which definitely shouldn't have any other C++ library's headers anyway), but it shouldn't hurt either. There's a chance some other library could also be providing a __config header, so there's still a trade-off there. It would be ideal if we could check for the presence of both __config and vector in the same directory, but there doesn't seem to be any easy way to do that in CMake. llvm-svn: 336034
* [libc++abi] Limit libc++ header search to specified pathsShoaib Meenai2018-06-301-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | Right now, when libc++abi is locating libc++ headers, it specifies several search locations, but it also doesn't prevent CMake from looking for those headers in system directories. I don't know if this was intentional or an oversight, but it has several issues: * We're looking specifically for the vector header, which could just as easily be found in a libstdc++ (or other C++ library) installation. * No system I know of places their C++ headers directly in system include directories (they're always under a C++ subdirectory), so the system search will never succeed. * find_path searches system paths before the user-specified PATHS, so if some system does happen to have C++ headers in its system include directories, those headers will be preferred, which doesn't seem desirable. It makes sense to me to limit this header search to the explicitly specified paths (using NO_DEFAULT_PATH, as is done for the other find_path call in this file), but I'm putting it up for review in case there's some use case I'm not thinking of. Differential Revision: https://reviews.llvm.org/D48694 llvm-svn: 336032
* Add protocol redefinition to the current scope/contextBruno Cardoso Lopes2018-06-306-0/+28
| | | | | | | | | | | | Not doing so causes the AST writter to assert since the decl in question never gets emitted. This is fine when modules is not used, but otherwise we need to serialize something other than garbage. rdar://problem/39844933 Differential Revision: https://reviews.llvm.org/D47297 llvm-svn: 336031
* [instsimplify] Move the instsimplify pass to use more obvious file namesChandler Carruth2018-06-2915-102/+104
| | | | | | | | | | | | | | | | and diretory. Also cleans up all the associated naming to be consistent and removes the public access to the pass ID which was unused in LLVM. Also runs clang-format over parts that changed, which generally cleans up a bunch of formatting. This is in preparation for doing some internal cleanups to the pass. Differential Revision: https://reviews.llvm.org/D47352 llvm-svn: 336028
* Fix test after S_PROCREF change.Zachary Turner2018-06-292-6/+6
| | | | | | | | Since the names are being hashed correctly now, enumerating them returns them in a different order. Update the test to reflect that. llvm-svn: 336027
* [CUDA] Make __host__/__device__ min/max overloads constexpr in C++14.Justin Lebar2018-06-291-4/+13
| | | | | | | | | | | | Summary: Tests in a separate change to the test-suite. Reviewers: rsmith, tra Subscribers: lahwaacz, sanjoy, cfe-commits Differential Revision: https://reviews.llvm.org/D48151 llvm-svn: 336026
* [CUDA] Make min/max shims host+device.Justin Lebar2018-06-291-4/+4
| | | | | | | | | | | | | | | | Summary: Fixes PR37753: min/max can't be called from __host__ __device__ functions in C++14 mode. Testcase in a separate test-suite commit. Reviewers: rsmith Subscribers: sanjoy, lahwaacz, cfe-commits Differential Revision: https://reviews.llvm.org/D48036 llvm-svn: 336025
* [CodeView] Correctly compute the name of S_PROCREF symbols.Zachary Turner2018-06-291-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We have a function which switches on the type of a symbol record to return a hardcoded offset into the record that contains the symbol name. Not all symbols have names to begin with, and for those records we return -1 for the offset. Names are used for various things. Importantly for this particular bug, a hash of the record name is used as a key for certain hash tables which are serialied into the PDB file. One of these hash tables is for the global symbol stream, which is basically a collection of S_PROCREF symbols which contain the name of the symbol, a module, and an address offset. However, for S_PROCREF symbols, the function to return the offset of the name was returning -1: basically it wasn't implemented. As a result of this, all global symbols were hashing to the same value, essentially it was as if every single global symbol's name was the empty string. This manifests in the VS debugger when you try to call a function (global or member, doesn't matter) through the immediate window and the debugger simply reports an error because it can't find the function. This makes perfect sense, because it is hashing the name for real, looking in the global symbol hash table, and there is only 1 entry there which corresponds to a symbol whose name is the empty string. Fixing this fixes the MSVC debugger in this case. llvm-svn: 336024
* [analyzer] [tests] Allow the tested project to specify it's own analyzer wrapperGeorge Karpenkov2018-06-291-0/+14
| | | | llvm-svn: 336023
* [analyzer] [tests] Fix 80 column violation in SATestBuild.pyGeorge Karpenkov2018-06-291-5/+5
| | | | llvm-svn: 336022
* PR33924: merge local declarations that have linkage of some kind withinRichard Smith2018-06-296-26/+203
| | | | | | | | | | | | | | | | | | | | | merged function definitions; also merge functions with deduced return types. This seems like two independent fixes, but unfortunately they are hard to separate because it's challenging to reliably test either one of them without also testing the other. A complication arises with deduced return type support: we need the type of the function in order to know how to merge it, but we can't load the actual type of the function because it might reference an entity declared within the function (and we need to have already merged the function to correctly merge that entity, which we would need to do to determine if the function types match). So we instead compare the declared function type when merging functions, and defer loading the actual type of a function with a deduced type until we've finished loading and merging the function. llvm-svn: 336021
* Spurious commit just to help Richard, because git is weird.David Blaikie2018-06-291-0/+1
| | | | llvm-svn: 336020
* [profile] Add llvm_gcov_flush to be called outside a shared libraryChih-Hung Hsieh2018-06-292-0/+40
| | | | | | | | | | __gcov_flush is hidden. For applications to dump profiling data of selected .so files, they can use dlsym to find and call llvm_gcov_flush in each .so file. Differential Revision: https://reviews.llvm.org/D45454 llvm-svn: 336019
* [WebAssembly] Update comments for non-splat pow2 vector test caseHeejin Ahn2018-06-291-1/+3
| | | | | | | | | | | | | | | | | | | Summary: After rL335727, (sdiv X, 1) is treated as a special case, so we can safely transform 'sdiv's in non-splat pow vectors into 'shr's even when some of its entries are '1'. The test expectations have been already fixed in rL335771, but the comments were out of date. Also changed the filename from `vector_sdiv.ll` to `vector-sdiv.ll` to be consistent with other test file names. Reviewers: RKSimon Subscribers: dschuff, sbc100, jgravelle-google, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D48692 llvm-svn: 336018
* [WebAssembly] Comment out a switch block in ISelDAGToDAGHeejin Ahn2018-06-291-5/+4
| | | | | | | | | | | | Summary: Fixes PR37977. Reviewers: RKSimon Subscribers: dschuff, sbc100, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D48737 llvm-svn: 336017
* [modules] Emit the type of the TypeSourceInfo for a DeclaratorDecl (butRichard Smith2018-06-296-18/+36
| | | | | | | | | | | not the corresponding location information) earlier. We need the type as written in order to properly merge functions with deduced return types, so we need to load that early. But we don't want to load the location information early, because that contains problematic things such as the function parameters. llvm-svn: 336016
* [MemorySSA] Add APIs to MemoryPhis to delete incoming blocks/values, and an ↵Alina Sbirlea2018-06-294-3/+88
| | | | | | | | | | | | | | | | updater API to remove blocks. Summary: MemoryPhis now have APIs analogous to BB Phis to remove an incoming value/block. The MemorySSAUpdater uses the above APIs when updating MemorySSA given a set of dead blocks about to be deleted. Reviewers: george.burgess.iv Subscribers: sanjoy, jlebar, Prazek, llvm-commits Differential Revision: https://reviews.llvm.org/D48396 llvm-svn: 336015
OpenPOWER on IntegriCloud