summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* [Sanitizers] Disable new_delete_test.cc on Android until it's supported.Alex Shlyapnikov2017-12-221-2/+2
| | | | llvm-svn: 321374
* [Sanitizers, CMake] Basic sanitizer Solaris support (PR 33274)Alex Shlyapnikov2017-12-226-6/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This patch, on top of https://reviews.llvm.org/D40898, contains the build system changes necessary to enable the Solaris/x86 sanitizer port. The only issue of note is the libclang_rt.sancov_{begin, end} libraries: clang relies on the linker automatically defining __start_SECNAME and __stop_SECNAME labels for sections whose names are valid C identifiers. This is a GNU ld extension not present in the ELF gABI, also implemented by gold and lld, but not by Solaris ld. To work around this, I automatically link the sancov_{begin,end} libraries into every executable for now. There seems to be now way to build individual startup objects like crtbegin.o/crtend.o, so I've followed the lead of libclang_rt.asan-preinit which also contains just a single object. Reviewers: kcc, alekseyshl Reviewed By: alekseyshl Subscribers: srhines, kubamracek, mgorny, fedor.sergeev, llvm-commits, #sanitizers Tags: #sanitizers Differential Revision: https://reviews.llvm.org/D40899 llvm-svn: 321373
* [AMDGPU][MC] Corrected handling of negative expressionsDmitry Preobrazhensky2017-12-223-4/+17
| | | | | | | | | | See bug 35716: https://bugs.llvm.org/show_bug.cgi?id=35716 Reviewers: artem.tamazov, arsenm Differential Revision: https://reviews.llvm.org/D41488 llvm-svn: 321372
* [CodeGen] Fix noalias annotations for memcpy/memmove.Michael Kruse2017-12-222-0/+47
| | | | | | | | | | | | | | | | Memory transfer instructions take two pointers. It is not defined to which of those a noalias annotation applies. To ensure correctness, do not add noalias annotations to memcpy/memmove instructions anymore. The caused a miscompile with test-suite's MultiSource/Applications/obsequi. Since r321138, the MemCpyOpt pass would remove memcpy/memmove calls if known to copy uninitialized memory. In that case, it was initialized by another memcpy, but the annotation for the target pointer said it would not alias. The annotation was actually meant for the source pointer, which was was an alloca and could not alias with the target pointer. llvm-svn: 321371
* [SelectionDAG] Reverse the order of operands in the ISD::ADD created by ↵Craig Topper2017-12-229-627/+526
| | | | | | | | | | TargetLowering::getVectorElementPointer so that the FrameIndex is on the left. This seems to improve X86's ability to match this into an address computation. Otherwise the other operand gets assigned to the base register and the stack pointer + frame index ends up in the index register. But index registers can't encode ESP/RSP so we end up having to move it into another register to meet the constraint. I could try to improve the address matcher in X86, but swapping the producer seemed easier. Several other places already have the operands in this order so this is at least consistent. llvm-svn: 321370
* [X86] When lowering insert_vector_elt/extract_vector_elt of vXi1 with a ↵Craig Topper2017-12-222-70/+36
| | | | | | | | non-constant index just use either a 128-bit type or the vXi8 type with the correct number of elements. Despite what the comment said there isn't better codegen for 512-bit vectors. The 128/256/512 bit implementation jus stores to memory and loads an element. There's no advantage to doing that with a larger size. In fact in many cases it causes a stack realignment and generates worse code. llvm-svn: 321369
* [X86] Improve the printing of address mode during isel matching.Craig Topper2017-12-221-4/+5
| | | | | | Fix some inconsistent new line behavior and only print the FrameIndex when the address mode is a FrameIndexBase addressing mode. llvm-svn: 321368
* [AMDGPU][MC] Corrected parsing of optional operands for ds_swizzle_b32Dmitry Preobrazhensky2017-12-223-1/+10
| | | | | | | | | | See bug 35645: https://bugs.llvm.org/show_bug.cgi?id=35645 Reviewers: artem.tamazov, arsenm Differential Revision: https://reviews.llvm.org/D41186 llvm-svn: 321367
* [InlineCost] Find more free binary operationsHaicheng Wu2017-12-222-40/+309
| | | | | | | | | | | | Currently, inline cost model considers a binary operator as free only if both its operands are constants. Some simple cases are missing such as a + 0, a - a, etc. This patch modifies visitBinaryOperator() to call SimplifyBinOp() without going through simplifyInstruction() to get rid of the constant restriction. Thus, visitAnd() and visitOr() are not needed. Differential Revision: https://reviews.llvm.org/D41494 llvm-svn: 321366
* [MSan,TSan] Add aligned new/delete interceptors.Alex Shlyapnikov2017-12-223-1/+220
| | | | | | | | | | | | | | | Summary: Providing aligned new/delete implementations to match ASan. Unlike ASan, MSan and TSan do not perform any additional checks on overaligned memory, hence no sanitizer specific tests. Reviewers: eugenis Subscribers: kubamracek, #sanitizers, llvm-commits Differential Revision: https://reviews.llvm.org/D41532 llvm-svn: 321365
* [DAG] Integrate findBaseOffset address analyses to BaseIndexOffset. NFCI.Nirav Dave2017-12-222-70/+27
| | | | | | | BaseIndexOffset supercedes findBaseOffset analysis save only Constant Pool addresses. Migrate analysis to BaseIndexOffset. llvm-svn: 321364
* [clang-tidy] Adding Fuchsia checker for overloaded operatorsJulie Hockett2017-12-228-1/+121
| | | | | | | | | | | | Adds a check to the Fuchsia module to warn if an operator is overloaded, except move and copy operators. See https://fuchsia.googlesource.com/zircon/+/master/docs/cxx.md for reference. Differential Revision: https://reviews.llvm.org/D41363 llvm-svn: 321363
* [OMPT] Fix failing test cases for gcc on UbuntuJoachim Protze2017-12-222-2/+3
| | | | | | | | | | | | | | The compiler warns that _BSD_SOURCE is deprecated and _DEFAULT_SOURCE should be used instead. We keep _BSD_SOURCE for older compilers, that don't know about _DEFAULT_SOURCE. The linker drops the tool when linking, since there is no visible need for the library. So we need to tell the linker, that the tool should be linked anyway. Differential Revision: https://reviews.llvm.org/D41499 llvm-svn: 321362
* Remove unused positional argument for printfJoachim Protze2017-12-222-2/+4
| | | | | | | | | | | | | | | | | The format string for hints only prints the second argument (string) and drops the first argument (hint id). Depending on how you read the POSIX text for printf, this could be valid. But for practical reason, i.e., unpacking the va_list passed to printf based on the formating information, it makes sense to fix the implementation and not pass the id for hint. Failing testcases were: misc_bugs/teams-reduction.c ompt/parallel/not_enough_threads.c Differential Revision: https://reviews.llvm.org/D41504 llvm-svn: 321361
* Unit tests for TBAA metadata generation.Serge Pavlov2017-12-223-0/+1753
| | | | | | | | | | | | | | | | | | Now tests for metadata created by clang involve compiling code snippets placed into c/c++ source files and matching interesting patterns in the obtained textual representation of IR. Writting such tests is a painful process as metadata often form complex tree-like structures but textual representation of IR contains only a pile of metadata at the module end. This change implements IR matchers that may be used to match required patterns in the binary IR representation. In this case the metadata structure is not broken and creation of match patterns is easier. The change adds unit tests for TBAA metadata generation. Differential Revision: https://reviews.llvm.org/D41433 llvm-svn: 321360
* [AMDGPU][MC] Added support of 256- and 512-bit tuples of ttmp registersDmitry Preobrazhensky2017-12-2210-43/+287
| | | | | | | | | | | | See bug 35561: https://bugs.llvm.org/show_bug.cgi?id=35561 This patch also affects implementation of SGPR and VGPR registers though changes are cosmetic. Reviewers: artem.tamazov, arsenm Differential Revision: https://reviews.llvm.org/D41437 llvm-svn: 321359
* [clangd] Add a tool to build YAML-format global symbols.Haojian Wu2017-12-224-0/+134
| | | | | | | | | | | | | | | | | | | | | | Summary: The tools is used to generate global symbols for clangd (global code completion), The format is YAML, which is only for **experiment**. Usage: ./bin/global-symbol-builder </path/to/llvm-dir> > global-symbols.yaml TEST: used the tool to generate global symbols for LLVM (~72MB). Reviewers: sammccall Reviewed By: sammccall Subscribers: klimek, mgorny, ilya-biryukov, cfe-commits Differential Revision: https://reviews.llvm.org/D41491 llvm-svn: 321358
* [mips] Add test case to check that calls to mcount follow long calls / short ↵Simon Atanasyan2017-12-221-0/+19
| | | | | | calls options. NFC llvm-svn: 321357
* [ARM GlobalISel] Support G_INTTOPTR and G_PTRTOINT for s32Diana Picus2017-12-226-0/+169
| | | | | | | Mark conversions between pointers and 32-bit scalars as legal, map them to the GPR and select to a simple COPY. llvm-svn: 321356
* debugserver: Propagate environment in launch-mode (pr35671)Pavel Labath2017-12-227-22/+77
| | | | | | | | | | | | | | | | | | Summary: Make sure we propagate environment when starting debugserver with a pre-loaded inferior. AFAIK, RNBRunLoopLaunchInferior is only called in pre-loaded inferior scenario, so we can just pick up the debugserver environment instead of trying to construct an envp from the (empty) context. This makes debugserver pass an test added for an equivalent lldb-server fix. Reviewers: jasonmolenda, clayborg Subscribers: JDevlieghere, lldb-commits Differential Revision: https://reviews.llvm.org/D41352 llvm-svn: 321355
* [ARM GlobalISel] Support pointer constantsDiana Picus2017-12-224-1/+34
| | | | | | | | | | Pointer constants are pretty rare, since we usually represent them as integer constants and then cast to pointer. One notable exception is the null pointer constant, which is represented directly as a G_CONSTANT 0 with pointer type. Mark it as legal and make sure it is selected like any other integer constant. llvm-svn: 321354
* Enable TestReadMemCString on non-darwin targetsPavel Labath2017-12-222-11/+4
| | | | | | | | | | | | | | The test works fine on linux, and I believe other targets should not have an issue with as well. If they do, we can start blacklisting instead of whitelisting. The idea of using "-1" as the value of the pointer on non-apple targets backfired, as it fails the "address != LLDB_INVALID_ADDRESS" test (-1 is the value of LLDB_INVALID_ADDRESS). However, it should be safe to use 0x100 for other targets as well. The first page of memory is generally kept unreadable to catch null pointer dereferences. llvm-svn: 321353
* [CodeGen] Represent array members in new-format TBAA type descriptorsIvan A. Kosarev2017-12-222-0/+38
| | | | | | | | | | | | | Now that in the new TBAA format we allow access types to be of any object types, including aggregate ones, it becomes critical to specify types of all sub-objects such aggregates comprise as their members. In order to meet this requirement, this patch enables generation of field descriptors for members of array types. Differential Revision: https://reviews.llvm.org/D41399 llvm-svn: 321352
* [CodeGen] Support generation of TBAA info in the new formatIvan A. Kosarev2017-12-222-30/+70
| | | | | | | | | | Now that the MDBuilder helpers generating TBAA type and access descriptors in the new format are in place, we can teach clang to use them when requested. Differential Revision: https://reviews.llvm.org/D41394 llvm-svn: 321351
* [clangd] Simplify GlobalCompilationDatabase, cache missing GCDsSam McCall2017-12-222-47/+23
| | | | llvm-svn: 321350
* [DAGCombine] Revert r321259Sam Parker2017-12-223-140/+22
| | | | | | | Improve ReduceLoadWidth for SRL Patch is causing an issue on the PPC64 BE santizer. llvm-svn: 321349
* [clangd] Improve packing of Symbol struct. NFCSam McCall2017-12-222-4/+10
| | | | llvm-svn: 321348
* Fix unused variable warning in SemaTemplate. NFCSam McCall2017-12-221-1/+1
| | | | llvm-svn: 321346
* Rewrite the cached map used for locating the most precise DIE amongChandler Carruth2017-12-222-33/+397
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | inlined subroutines for a given address. This is essentially the hot path of llvm-symbolizer when extracting inlined frames during symbolization. Previously, we would read every subprogram and every inlined subroutine, building a std::map across the entire PC space to the best DIE, and then do only a handful of queries as we symbolized a backtrace. A huge fraction of the time was spent building the map itself. This patch changes it two a two-level system. First, we just build a map from PC-interval to DWARF subprograms. These are required to be disjoint and so constructing this is pretty easy. Second, we build a map *just* for the inlined subroutines within the subprogram containing the query address. This allows us to look at far fewer DIEs and build a *much* smaller set of cached maps in the llvm-symbolizer case where only a few address get symbolized during the entire run. It also builds both interval maps in a very different way. It constructs a single flat vector of pairs that maps from offset -> index. The indices point into collections of DIE objects, but can also be "tombstones" (-1) to mark gaps. In the case of subprograms, this mostly just simplifies the data structure a bit. For inlined subroutines, because we carefully split them as we build the map, we end up in many cases having no holes and not having to store both start and stop offsets. Finally, the PC ranges for the inlined subroutines are compressed into 32-bits by making them relative to the base PC of the outer subprogram. This means that if you have a single function body with over 2gb of executable code in it, we will stop mapping address past the first 2gb of that function into inlined subroutines and just give you the subprogram. This doesn't seem like a problem. ;] All of this combines to make llvm-symbolizer *well* over 2x faster for symbolizing backtraces out of LLVM's unittests. Death-test heavy unit tests are running >2x faster. I'm still going to look at completely disabling symbolization there, but figured while I had a good benchmark we should make symbolization a bit better. Sadly, the logic to build the flat interval map for the inlined subroutines is fairly complex. I'm not super happy about this and welcome any simplifying suggestions. Huge thanks to Dave Blaikie who helped walk me through what the various things I needed to do in DWARF to make this work. Differential Revision: https://reviews.llvm.org/D40987 llvm-svn: 321345
* [lldb] Stop searching for a symbol in a pdb by regexAaron Smith2017-12-224-15/+24
| | | | | | | | | | | | | | | | | Summary: It was possible when searching for a symbol by regex in a pdb that an invalid regex would cause an exception on Windows. This updates the code to avoid throwing an exception. When fixing the exception it was decided there is no reason to search for a symbol in a pdb by regex. To support this, SymbolFilePDB::FindTypes() now only searches for types by name and no longer calls FindTypesByRegEx(). Reviewers: zturner, lldb-commits Reviewed By: zturner Subscribers: clayborg Differential Revision: https://reviews.llvm.org/D41086 llvm-svn: 321344
* [X86] Add missing check lines for the silvermont cases in ↵Craig Topper2017-12-221-0/+8
| | | | | | predefined-arch-macros.c test. llvm-svn: 321343
* [Modules] Map missing private submodules from Foo.Private to Foo_PrivateBruno Cardoso Lopes2017-12-223-2/+53
| | | | | | | | | | | | | | In case `@import Foo.Private` fails because the submodule doesn't exist, look for `Foo_Private` (if available) and build/load that module instead. In that process emit a warning and tell the user about the assumption. The intention here is to assist all existing private modules owners (in ObjC and Swift) to migrate to the new `Foo_Private` syntax. rdar://problem/36023940 llvm-svn: 321342
* [X86] Add 'prfchw' to the correct CPUs to match the backend.Craig Topper2017-12-222-0/+21
| | | | llvm-svn: 321341
* [X86] Add missing initialization for the HasPREFETCHWT1 subtarget variable.Craig Topper2017-12-221-0/+1
| | | | llvm-svn: 321340
* Diagnose the various invalid decl-specifiers on nontype template parameters.Faisal Vali2017-12-223-3/+85
| | | | | | | | | | | | | The standard correctly forbids various decl-specifiers that dont make sense on non-type template parameters - such as the extern in: template<extern int> struct X; This patch implements those restrictions (in a fashion similar to the corresponding checks on function parameters within ActOnParamDeclarator). Credit goes to miyuki (Mikhail Maltsev) for drawing attention to this issue, authoring the initial versions of this patch, and supporting the effort to re-engineer it slightly. Thank you! For details of how this patch evolved please see: https://reviews.llvm.org/D40705 llvm-svn: 321339
* Change SBProcess::ReadCStringFromMemory() back to returningJason Molenda2017-12-225-2/+84
| | | | | | | | | an empty Python string object when it reads a 0-length string out of memory (and a successful SBError object). <rdar://problem/26186692> llvm-svn: 321338
* [Modules] Change private modules rules and warningsBruno Cardoso Lopes2017-12-2229-87/+216
| | | | | | | | | | | | | | | | We used to advertise private modules to be declared as submodules (Foo.Private). This has proven to not scale well since private headers might carry several dependencies, introducing unwanted content into the main module and often causing dep cycles. Change the canonical way to name it to Foo_Private, forcing private modules as top level ones, and provide warnings under -Wprivate-module to suggest fixes for other private naming. Update documentation to reflect that. rdar://problem/31173501 llvm-svn: 321337
* [X86] Enable PRFCHW feature on KNL/KNM and all CPUs inherited from Broadwell.Craig Topper2017-12-221-2/+4
| | | | llvm-svn: 321336
* [X86] Add prefetchwt1 instruction and overhaul priorities and isel enabling ↵Craig Topper2017-12-229-21/+126
| | | | | | | | | | | | | | for prefetch instructions. Previously prefetch was only considered legal if sse was enabled, but it should be supported with 3dnow as well. The prfchw flag now imply at least some form of prefetch without the write hint is available, either the sse or 3dnow version. This is true even if 3dnow and sse are explicitly disabled. Similarly prefetchwt1 feature implies availability of prefetchw and the the prefetcht0/1/2/nta instructions. This way we can support _MM_HINT_ET0 using prefetchw and _MM_HINT_ET1 with prefetchwt1. And its assumed that if we have levels for the write hint we would have levels for the non-write hint, thus why we enable the sse prefetch instructions. I believe this behavior is consistent with gcc. I've updated the prefetch.ll to test all of these combinations. llvm-svn: 321335
* [X86] Use SIGN_EXTEND to implement ANY_EXTEND from vXi1.Craig Topper2017-12-226-170/+156
| | | | llvm-svn: 321334
* inline-fp.ll was moved in r321332; delete it properly.Eli Friedman2017-12-221-137/+0
| | | | llvm-svn: 321333
* [Inliner] Restrict soft-float inlining penalty.Eli Friedman2017-12-225-35/+143
| | | | | | | | | | | | | | The penalty is currently getting applied in a bunch of places where it doesn't make sense, like bitcasts (which are free) and calls (which were getting the call penalty applied twice). Instead, just apply the penalty to binary operators and floating-point casts. While I'm here, also fix getFPOpCost() to do the right thing in more cases, so we don't have to dig into function attributes. Differential Revision: https://reviews.llvm.org/D41522 llvm-svn: 321332
* Add hasProfileData() to check if a function has profile data. NFC.Easwaran Raman2017-12-2210-16/+21
| | | | | | | | | | | | | | | | | | | Summary: This replaces calls to getEntryCount().hasValue() with hasProfileData that does the same thing. This refactoring is useful to do before adding synthetic function entry counts but also a useful cleanup IMO even otherwise. I have used hasProfileData instead of hasRealProfileData as David had earlier suggested since I think profile implies "real" and I use the phrase "synthetic entry count" and not "synthetic profile count" but I am fine calling it hasRealProfileData if you prefer. Reviewers: davidxl, silvas Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D41461 llvm-svn: 321331
* [DWARF] Fix formatting bug with r321295. This fixes a MIPS buildbot failure.Wolfgang Pieb2017-12-221-1/+1
| | | | llvm-svn: 321330
* Fix isl out-of-quota errors affecting later quota guards.Michael Kruse2017-12-222-0/+20
| | | | | | | | | | | | | | | | | | | If an out-of-quota error occurred, the last error would be isl_error_quota unless a different error occured. We typically check whether the max-operations occured by comparing to that error value after leaving the quota guard. This would check whether there ever was a quota-error, not just in the last quota guards. The observable bug occurred if the max-operations limit was reached in DeLICM, and if -polly-dependences-computout=0, DependenceInfo would think that the quota for computing dependencies was the reason, i.e., fail the operation even if the calculation itself was successful. Fix by reseting the last error to isl_error_none when entering a quota guard, signaling that no quota error occured unless in the guard's scope. llvm-svn: 321329
* Change the default Aarch64 ISA to be v8.2 to correctly decode newerJason Molenda2017-12-221-0/+5
| | | | | | | instructions (e.g. on the new iphones). <rdar://problem/30585124> llvm-svn: 321328
* Enable more abilities in SymbolFilePDBAaron Smith2017-12-222-4/+46
| | | | | | | | | | | | | | | | Summary: 1) Finding symbols through --symfile 2) More abilities: Functions, Blocks, GlobalVariables, LocalVariables, VariableTypes Reviewers: zturner, lldb-commits Reviewed By: zturner Subscribers: clayborg Differential Revision: https://reviews.llvm.org/D41092 llvm-svn: 321327
* [CUDA] More fixes for __shfl_* intrinsics.Artem Belevich2017-12-211-28/+49
| | | | | | | | | * __shfl_{up,down}* uses unsigned int for the third parameter. * added [unsigned] long overloads for non-sync shuffles. Differential Revision: https://reviews.llvm.org/D41521 llvm-svn: 321326
* [X86] Allow _mm_prefetch (both the header implementation and the builtin) to ↵Craig Topper2017-12-213-7/+11
| | | | | | | | accept bit 2 which is supposed to indicate the prefetched addresses will be written to Add the appropriate _MM_HINT_ET0/ET1 defines to match gcc. llvm-svn: 321325
* Correct hasFeature/isValidFeatureName's handling of shstk/adx/mwaitxErich Keane2017-12-211-2/+7
| | | | | | | | | | | | https://bugs.llvm.org/show_bug.cgi?id=35721 reports that x86intrin.h is issuing a few warnings. This is because attribute target is using isValidFeatureName for its source. It was also discovered that two of these were missing from hasFeature. Additionally, shstk is and ibu are reordered alphabetically, as came up during code review. llvm-svn: 321324
OpenPOWER on IntegriCloud