Julie Hockett [Fri, 22 Dec 2017 16:52:25 +0000 (16:52 +0000)]
[clang-tidy] Adding Fuchsia checker for overloaded operators
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
Joachim Protze [Fri, 22 Dec 2017 16:40:32 +0000 (16:40 +0000)]
[OMPT] Fix failing test cases for gcc on Ubuntu
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
Joachim Protze [Fri, 22 Dec 2017 16:40:26 +0000 (16:40 +0000)]
Remove unused positional argument for printf
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
Serge Pavlov [Fri, 22 Dec 2017 15:22:45 +0000 (15:22 +0000)]
Unit tests for TBAA metadata generation.
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
Dmitry Preobrazhensky [Fri, 22 Dec 2017 15:18:06 +0000 (15:18 +0000)]
[AMDGPU][MC] Added support of 256- and 512-bit tuples of ttmp registers
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
Haojian Wu [Fri, 22 Dec 2017 14:38:05 +0000 (14:38 +0000)]
[clangd] Add a tool to build YAML-format global symbols.
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
Simon Atanasyan [Fri, 22 Dec 2017 13:45:46 +0000 (13:45 +0000)]
[mips] Add test case to check that calls to mcount follow long calls / short calls options. NFC
llvm-svn: 321357
Diana Picus [Fri, 22 Dec 2017 13:05:51 +0000 (13:05 +0000)]
[ARM GlobalISel] Support G_INTTOPTR and G_PTRTOINT for s32
Mark conversions between pointers and 32-bit scalars as legal, map them
to the GPR and select to a simple COPY.
llvm-svn: 321356
Pavel Labath [Fri, 22 Dec 2017 11:09:21 +0000 (11:09 +0000)]
debugserver: Propagate environment in launch-mode (pr35671)
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
Diana Picus [Fri, 22 Dec 2017 11:09:18 +0000 (11:09 +0000)]
[ARM GlobalISel] Support pointer constants
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
Pavel Labath [Fri, 22 Dec 2017 10:26:59 +0000 (10:26 +0000)]
Enable TestReadMemCString on non-darwin targets
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
Ivan A. Kosarev [Fri, 22 Dec 2017 09:57:24 +0000 (09:57 +0000)]
[CodeGen] Represent array members in new-format TBAA type descriptors
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
Ivan A. Kosarev [Fri, 22 Dec 2017 09:54:23 +0000 (09:54 +0000)]
[CodeGen] Support generation of TBAA info in the new format
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
Sam McCall [Fri, 22 Dec 2017 09:47:34 +0000 (09:47 +0000)]
[clangd] Simplify GlobalCompilationDatabase, cache missing GCDs
llvm-svn: 321350
Sam Parker [Fri, 22 Dec 2017 08:36:25 +0000 (08:36 +0000)]
[DAGCombine] Revert r321259
Improve ReduceLoadWidth for SRL Patch is causing an issue on the
PPC64 BE santizer.
llvm-svn: 321349
Sam McCall [Fri, 22 Dec 2017 08:12:39 +0000 (08:12 +0000)]
[clangd] Improve packing of Symbol struct. NFC
llvm-svn: 321348
Sam McCall [Fri, 22 Dec 2017 07:09:51 +0000 (07:09 +0000)]
Fix unused variable warning in SemaTemplate. NFC
llvm-svn: 321346
Chandler Carruth [Fri, 22 Dec 2017 06:41:23 +0000 (06:41 +0000)]
Rewrite the cached map used for locating the most precise DIE among
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
Aaron Smith [Fri, 22 Dec 2017 05:26:50 +0000 (05:26 +0000)]
[lldb] Stop searching for a symbol in a pdb by regex
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
Craig Topper [Fri, 22 Dec 2017 05:09:38 +0000 (05:09 +0000)]
[X86] Add missing check lines for the silvermont cases in predefined-arch-macros.c test.
llvm-svn: 321343
Bruno Cardoso Lopes [Fri, 22 Dec 2017 05:04:43 +0000 (05:04 +0000)]
[Modules] Map missing private submodules from Foo.Private to Foo_Private
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
Craig Topper [Fri, 22 Dec 2017 04:51:00 +0000 (04:51 +0000)]
[X86] Add 'prfchw' to the correct CPUs to match the backend.
llvm-svn: 321341
Craig Topper [Fri, 22 Dec 2017 03:53:14 +0000 (03:53 +0000)]
[X86] Add missing initialization for the HasPREFETCHWT1 subtarget variable.
llvm-svn: 321340
Faisal Vali [Fri, 22 Dec 2017 03:50:55 +0000 (03:50 +0000)]
Diagnose the various invalid decl-specifiers on nontype template parameters.
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
Jason Molenda [Fri, 22 Dec 2017 03:27:02 +0000 (03:27 +0000)]
Change SBProcess::ReadCStringFromMemory() back to returning
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
Bruno Cardoso Lopes [Fri, 22 Dec 2017 02:53:30 +0000 (02:53 +0000)]
[Modules] Change private modules rules and warnings
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
Craig Topper [Fri, 22 Dec 2017 02:41:12 +0000 (02:41 +0000)]
[X86] Enable PRFCHW feature on KNL/KNM and all CPUs inherited from Broadwell.
llvm-svn: 321336
Craig Topper [Fri, 22 Dec 2017 02:30:30 +0000 (02:30 +0000)]
[X86] Add prefetchwt1 instruction and overhaul priorities and isel enabling 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
Craig Topper [Fri, 22 Dec 2017 02:30:26 +0000 (02:30 +0000)]
[X86] Use SIGN_EXTEND to implement ANY_EXTEND from vXi1.
llvm-svn: 321334
Eli Friedman [Fri, 22 Dec 2017 02:10:40 +0000 (02:10 +0000)]
inline-fp.ll was moved in r321332; delete it properly.
llvm-svn: 321333
Eli Friedman [Fri, 22 Dec 2017 02:08:08 +0000 (02:08 +0000)]
[Inliner] Restrict soft-float inlining penalty.
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
Easwaran Raman [Fri, 22 Dec 2017 01:33:52 +0000 (01:33 +0000)]
Add hasProfileData() to check if a function has profile data. NFC.
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
Wolfgang Pieb [Fri, 22 Dec 2017 01:12:24 +0000 (01:12 +0000)]
[DWARF] Fix formatting bug with r321295. This fixes a MIPS buildbot failure.
llvm-svn: 321330
Michael Kruse [Fri, 22 Dec 2017 01:10:31 +0000 (01:10 +0000)]
Fix isl out-of-quota errors affecting later quota guards.
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
Jason Molenda [Fri, 22 Dec 2017 00:16:04 +0000 (00:16 +0000)]
Change the default Aarch64 ISA to be v8.2 to correctly decode newer
instructions (e.g. on the new iphones).
<rdar://problem/
30585124>
llvm-svn: 321328
Aaron Smith [Fri, 22 Dec 2017 00:04:36 +0000 (00:04 +0000)]
Enable more abilities in SymbolFilePDB
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
Artem Belevich [Thu, 21 Dec 2017 23:52:09 +0000 (23:52 +0000)]
[CUDA] More fixes for __shfl_* intrinsics.
* __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
Craig Topper [Thu, 21 Dec 2017 23:50:22 +0000 (23:50 +0000)]
[X86] Allow _mm_prefetch (both the header implementation and the builtin) to 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
Erich Keane [Thu, 21 Dec 2017 23:27:36 +0000 (23:27 +0000)]
Correct hasFeature/isValidFeatureName's handling of shstk/adx/mwaitx
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
Paul Robinson [Thu, 21 Dec 2017 23:19:25 +0000 (23:19 +0000)]
Update test after r321312
llvm-svn: 321323
Adrian Prantl [Thu, 21 Dec 2017 23:04:51 +0000 (23:04 +0000)]
Bring clang options in error messages up to date.
llvm-svn: 321322
Adrian Prantl [Thu, 21 Dec 2017 23:03:05 +0000 (23:03 +0000)]
Delete dead code.
llvm-svn: 321321
George Karpenkov [Thu, 21 Dec 2017 22:57:51 +0000 (22:57 +0000)]
[analyzer] Add Javascript to analyzer HTML output to allow keyboard navigation.
Differential Revision: https://reviews.llvm.org/D41414
llvm-svn: 321320
Richard Trieu [Thu, 21 Dec 2017 22:38:29 +0000 (22:38 +0000)]
[ODRHash] Canonicalize Decl's before processing.
Canonicalizing the Decl before processing it as part of the hash should reduce
issues with non-canonical types showing up as mismatches.
llvm-svn: 321319
Richard Smith [Thu, 21 Dec 2017 22:26:47 +0000 (22:26 +0000)]
Suppress "redundant parens" warning for "A (::B())".
This is a slightly odd construct (it's more common to see "A (::B)()") but can
happen in friend declarations, and the parens are not redundant as they prevent
the :: binding to the left.
llvm-svn: 321318
Rafael Espindola [Thu, 21 Dec 2017 22:26:44 +0000 (22:26 +0000)]
Define isUndefWeak inline.
This small function was showing up in the profile. Defining it inline
gives about 0.3% speedup.
llvm-svn: 321317
Petr Hosek [Thu, 21 Dec 2017 22:10:27 +0000 (22:10 +0000)]
[CMake][Fuchsia] Enable assertions
Enable assertions in both stages.
Release+Asserts is fast enough.
No need to let insanity through.
Patch By: mcgrathr
Reviewers: phosek
Reviewed By: phosek
Differential Revision: https://reviews.llvm.org/D41471
llvm-svn: 321316
Craig Topper [Thu, 21 Dec 2017 22:08:23 +0000 (22:08 +0000)]
[X86] Use SIGN_EXTEND rather than ZERO_EXTEND for lowering extract_vector_elt from vXi1 with a non-const index.
We have a better range of instructions we can use if we can fill with the value i1 value rather than zeroing.
llvm-svn: 321315
Petr Hosek [Thu, 21 Dec 2017 22:04:31 +0000 (22:04 +0000)]
[scudo] Add -fsanitize=scudo option to Fuchsia
Apparently the -fsanitize flag hadn't been added for Scudo upstream yet.
Patch By: flowerhack
Reviewers: cryptoad, alekseyshl, mcgrathr, phosek
Reviewed By: mcgrathr, phosek
Differential Revision: https://reviews.llvm.org/D41413
llvm-svn: 321314
Reid Kleckner [Thu, 21 Dec 2017 21:48:55 +0000 (21:48 +0000)]
Include process.h for getpid on Windows in instr profiling
llvm-svn: 321313
Paul Robinson [Thu, 21 Dec 2017 21:47:22 +0000 (21:47 +0000)]
[AST] Incorrectly qualified unscoped enumeration as template actual parameter.
An unscoped enumeration used as template argument, should not have any
qualified information about its enclosing scope, as its visibility is
global.
In the case of scoped enumerations, they must include information
about their enclosing scope.
Patch by Carlos Alberto Enciso!
Differential Revision: https://reviews.llvm.org/D39239
llvm-svn: 321312
Rafael Espindola [Thu, 21 Dec 2017 21:45:35 +0000 (21:45 +0000)]
Call isStaticLinkTimeConstant only once per relocation.
It is a pretty expensive function. Some of the speedups:
clang: 1.92%
chrome: 1.15%
linux-kernel: 1.40%
llvm-svn: 321311
Aaron Ballman [Thu, 21 Dec 2017 21:42:42 +0000 (21:42 +0000)]
Re-commit r321223, which adds a printing policy to the ASTDumper.
This allows you to dump C++ code that spells bool instead of _Bool, leaves off the elaborated type specifiers when printing struct or class names, and other C-isms.
Fixes the -Wreorder issue and fixes the ast-dump-color.cpp test.
llvm-svn: 321310
Alina Sbirlea [Thu, 21 Dec 2017 21:41:53 +0000 (21:41 +0000)]
[ModRefInfo] Add must alias info to ModRefInfo.
Summary:
Add an additional bit to ModRefInfo, ModRefInfo::Must, to be cleared for known must aliases.
Shift existing Mod/Ref/ModRef values to include an additional most
significant bit. Update wrappers that modify ModRefInfo values to
reflect the change.
Notes:
* ModRefInfo::Must is almost entirely cleared in the AAResults methods, the remaining changes are trying to preserve it.
* Only some small changes to make custom AA passes set ModRefInfo::Must (BasicAA).
* GlobalsModRef already declares a bit, who's meaning overlaps with the most significant bit in ModRefInfo (MayReadAnyGlobal). No changes to shift the value of MayReadAnyGlobal (see AlignedMap). FunctionInfo.getModRef() ajusts most significant bit so correctness is preserved, but the Must info is lost.
* There are cases where the ModRefInfo::Must is not set, e.g. 2 calls that only read will return ModRefInfo::NoModRef, though they may read from exactly the same location.
Reviewers: dberlin, hfinkel, george.burgess.iv
Subscribers: llvm-commits, sanjoy
Differential Revision: https://reviews.llvm.org/D38862
llvm-svn: 321309
Sam Clegg [Thu, 21 Dec 2017 21:15:00 +0000 (21:15 +0000)]
[WebAssembly] Add extra test for weak global symbols
Summary:
Currently the test only checks behaviour for weak function symbols.
Should be good to merge straight away?
Reviewers: sbc100
Reviewed By: sbc100
Subscribers: jfb, dschuff, jgravelle-google, aheejin, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D41449
llvm-svn: 321308
Volodymyr Sapsai [Thu, 21 Dec 2017 20:52:59 +0000 (20:52 +0000)]
Revert "[CodeGen] Fix crash when a function taking transparent union is redeclared."
This reverts commit r321296. It caused performance regressions
FAIL: imp.execution_time
FAIL: 2007-01-04-KNR-Args.execution_time
FAIL: sse_expandfft.execution_time
FAIL: sse_stepfft.execution_time
llvm-svn: 321306
Petr Hosek [Thu, 21 Dec 2017 20:51:16 +0000 (20:51 +0000)]
[sanitizer] Make function declarations C-compatible
The public sanitizer headers are intended to be usable from either
C++ or C, but they declare no-argument functions with the syntax that
is not a proper prototype declaration in C. This goes unnoticed until
someone uses -Wsystem-headers.
Patch By: mcgrathr
Reviewers: phosek, vitalybuka
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D41475
llvm-svn: 321305
Richard Smith [Thu, 21 Dec 2017 20:50:39 +0000 (20:50 +0000)]
Don't produce redundant parentheses warning for "A (::B);" and the like.
The parentheses here are not redundant as they affect the binding of the
'::' token.
llvm-svn: 321304
Craig Topper [Thu, 21 Dec 2017 20:45:13 +0000 (20:45 +0000)]
[X86] When lowering truncates to vXi1, don't sign extend i16/i8 types to 512-bit if we have VLX.
This should only affect what we do for v8i16. Previously we went to v8i64, but if we have VLX we only need v8i32. This prevents an unnecessary zmm usage.
llvm-svn: 321303
Sam McCall [Thu, 21 Dec 2017 20:11:46 +0000 (20:11 +0000)]
[clangd] Don't re-hash SymbolID in maps, just use the SHA1 data
llvm-svn: 321302
Abderrazek Zaafrani [Thu, 21 Dec 2017 20:10:03 +0000 (20:10 +0000)]
[AArch64] Enable fp16 data type for the Builtin for AArch64 only.
Differential Revision: https:://reviews.llvm.org/D41360
llvm-svn: 321301
Petr Hosek [Thu, 21 Dec 2017 20:04:10 +0000 (20:04 +0000)]
[CMake] Allow passing extra CMake arguments to custom libc++
This can be used to customize the libc++ build.
Differential Revision: https://reviews.llvm.org/D41103
llvm-svn: 321299
Reid Kleckner [Thu, 21 Dec 2017 19:44:23 +0000 (19:44 +0000)]
Revert "Fix for PR32990"
This reverts commit r321239. It broke the Chromium DLL build:
[8834/50217] LINK(DLL) icui18n.dll icui18n.dll.lib icui18n.dll.pdb
FAILED: icui18n.dll icui18n.dll.lib icui18n.dll.pdb
zrule.obj : error LNK2001: unresolved external symbol
"__declspec(dllimport) public: void __cdecl icu_60::UnicodeString::`vbase destructor'(void)"
(__imp_??_DUnicodeString@icu_60@@QEAAXXZ)
llvm-svn: 321298
Richard Smith [Thu, 21 Dec 2017 19:43:39 +0000 (19:43 +0000)]
When instantiating a deduction guide, transform its name.
Otherwise it will serve as a deduction guide for the wrong class template.
llvm-svn: 321297
Volodymyr Sapsai [Thu, 21 Dec 2017 19:42:37 +0000 (19:42 +0000)]
[CodeGen] Fix crash when a function taking transparent union is redeclared.
When a function taking transparent union is declared as taking one of
union members earlier in the translation unit, clang would hit an
"Invalid cast" assertion during EmitFunctionProlog. This case
corresponds to function f1 in test/CodeGen/transparent-union-redecl.c.
We decided to cast i32 to union because after merging function
declarations function parameter type becomes int,
CGFunctionInfo::ArgInfo type matches with ABIArgInfo type, so we decide
it is a trivial case. But these types should also be castable to
parameter declaration type which is not the case here.
The fix is in checking for the trivial case if ABIArgInfo type matches with
parameter declaration type. It exposed inconsistency that we check
hasScalarEvaluationKind for different types in EmitParmDecl and
EmitFunctionProlog, and comment says they should match.
Additional tests in Sema/transparent-union.c capture current behavior and make
sure there are no regressions.
rdar://problem/
34949329
Reviewers: rjmccall, rafael
Reviewed By: rjmccall
Subscribers: aemerson, cfe-commits, kristof.beyls
Differential Revision: https://reviews.llvm.org/D41311
llvm-svn: 321296
Wolfgang Pieb [Thu, 21 Dec 2017 19:38:13 +0000 (19:38 +0000)]
[DWARF v5] Rework of string offsets table reader
Reorganizes the DWARF consumer to derive the string offsets table
contribution's format from the contribution header instead of
(incorrectly) from the unit's format.
Reviewers: JDevliegehere, aprantl
Differential Revision: https://reviews.llvm.org/D41146
llvm-svn: 321295
Abderrazek Zaafrani [Thu, 21 Dec 2017 19:20:01 +0000 (19:20 +0000)]
[AARch64] Add ARMv8.2-A FP16 vector intrinsics
Putting back the code that was reverted few weeks ago.
Differential Revision: https://reviews.llvm.org/D34161
llvm-svn: 321294
Simon Dardis [Thu, 21 Dec 2017 19:01:32 +0000 (19:01 +0000)]
Revert "[mips][compiler-rt] Provide 64bit atomic add and sub"
This reverts commit r321260. It appears to have broken the sanitizer
bot sanitizer-ppc64be-linux.
http://lab.llvm.org:8011/builders/sanitizer-ppc64be-linux/builds/5029
Reverting to see if the buildbot turns green.
llvm-svn: 321292
Craig Topper [Thu, 21 Dec 2017 18:44:06 +0000 (18:44 +0000)]
[X86] Promote v8i1 shuffles to v8i32 instead of v8i64 if we have VLX.
We should have equally good shuffle options for v8i32 with VLX. This was spotted during my attempts to remove 512-bit vectors from SKX.
We still use 512-bits for v16i1, v32i1, and v64i1. I'm less sure we can handle those well with narrower vectors. i32 and i64 element sizes get the best shuffle support.
llvm-svn: 321291
Artem Dergachev [Thu, 21 Dec 2017 18:43:02 +0000 (18:43 +0000)]
[analyzer] Fix zero-initialization of stack VLAs under ObjC ARC.
Using ARC, strong, weak, and autoreleasing stack variables are implicitly
initialized with nil. This includes variable-length arrays of Objective-C object
pointers. However, in the analyzer we don't zero-initialize them. We used to,
but it accidentally regressed after r289618.
Under ARC, the array variable's initializer within DeclStmt is an
ImplicitValueInitExpr. Environment doesn't maintain any bindings for this
expression kind - instead it always knows that it's a known constant
(0 in our case), so it just returns the known value by calling
SValBuilder::makeZeroVal() (see EnvironmentManager::getSVal().
Commit r289618 had introduced reasonable behavior of SValBuilder::makeZeroVal()
for the arrays, which produces a zero-length compoundVal{}. When such value
is bound to arrays, in RegionStoreManager::bindArray() "remaining" items in the
array are default-initialized with zero, as in
RegionStoreManager::setImplicitDefaultValue(). The similar mechanism works when
an array is initialized by an initializer list that is too short, eg.
int a[3] = { 1, 2 };
would result in a[2] initialized with 0. However, in case of variable-length
arrays it didn't know if any more items need to be added,
because, well, the length is variable.
Add the default binding anyway, regardless of how many actually need
to be added. We don't really care how many, because the default binding covers
the whole array anyway.
Differential Revision: https://reviews.llvm.org/D41478
rdar://problem/
35477763
llvm-svn: 321290
Simon Pilgrim [Thu, 21 Dec 2017 18:12:31 +0000 (18:12 +0000)]
[X86][SSE] Split large PAVGB/PAVGW vectors to legal widths
Patch to allow detectAVGPattern handle vectors larger than the legal size (128 SSE2, 256 AVX2, 512 AVX512BW), splitting the vectors accordingly.
Differential Revision: https://reviews.llvm.org/D41440
llvm-svn: 321288
Benjamin Kramer [Thu, 21 Dec 2017 17:51:35 +0000 (17:51 +0000)]
[clangd] Fix use after free.
Found by asan.
llvm-svn: 321286
Aleksei Sidorin [Thu, 21 Dec 2017 17:41:06 +0000 (17:41 +0000)]
[ASTImporterTest] Add mandatory testing with '-fdelayed-template-parsing'
* While running ASTImporterTests, we often forget about Windows MSVC
buildbots which enable '-fdelayed-template-parsing' by default.
This leads to AST import errors because templates are not parsed
and corresponding parts of AST are not built so importer cannot import them.
It takes both reviewing time to find such issues and post-commit time
to fix unexpected buildbot failures. To solve this issue, we enable testing
with '-fdelayed-template-parsing' option enabled by default in addition
to testing with default compiler options. This allows us to catch
the problem during development.
Differential Revision: https://reviews.llvm.org/D41444
llvm-svn: 321285
Francis Visoiu Mistrih [Thu, 21 Dec 2017 17:14:13 +0000 (17:14 +0000)]
[YAML] Refactor escaping unittests
llvm-svn: 321284
Francis Visoiu Mistrih [Thu, 21 Dec 2017 17:14:09 +0000 (17:14 +0000)]
[YAML] Fix UTF-8 handling
Previous YAML quoting patches broke UTF-8 printing in YAML: see https://reviews.llvm.org/D41290#961801.
Differential Revision: https://reviews.llvm.org/D41490
llvm-svn: 321283
Krzysztof Parzyszek [Thu, 21 Dec 2017 17:12:43 +0000 (17:12 +0000)]
[TableGen] Print more helpful information in case of type contradiction
Dump the failing TreePattern.
llvm-svn: 321282
Simon Pilgrim [Thu, 21 Dec 2017 16:54:03 +0000 (16:54 +0000)]
[DAGCombiner] Remove (xor (xor x, c1), c2) -> (xor x, (xor c1, c2)) fold. NFCI.
More general cases are already handled by constant canonicalization and then the ReassociateOps call at line 5327
llvm-svn: 321280
Simon Pilgrim [Thu, 21 Dec 2017 16:34:46 +0000 (16:34 +0000)]
[DAGCombiner] Generalize (or (and X, c1), c2) -> (and (or X, c2), c1|c2) combine to work on non-splat vectors
The knownbits_mask_or_shuffle_uitofp change is interesting - shuffle combines manage to kick in, removing the AND constant mask load. For targets with fast-variable-shuffle this should reduce further to VPOR+VPSHUFB+VCVTDQ2PS.
llvm-svn: 321279
Simon Pilgrim [Thu, 21 Dec 2017 16:08:41 +0000 (16:08 +0000)]
[X86] Add (or (and X, c1), c2) -> (and (or X, c2), c1|c2) non-splat vector test
llvm-svn: 321278
Pavel Labath [Thu, 21 Dec 2017 15:52:59 +0000 (15:52 +0000)]
Make one more test redhat-compatible
This test was also using "a" in an expression.
llvm-svn: 321277
Tony Jiang [Thu, 21 Dec 2017 15:42:50 +0000 (15:42 +0000)]
[PowerPC] Fix parest build failure in SPEC2017.
The build failure was caused by an assertion in pre-legalization DAGCombine:
Combining: t6: ppcf128 = uint_to_fp t5
... into: t20: f32 = PPCISD::FCFIDUS t19
which is clearly wrong since ppcf128 are definitely different type with f32 and
we cannot change the node value type when do DAGCombine. The fix is don't
handle ppc_fp128 or i1 conversions in PPCTargetLowering::combineFPToIntToFP and
leave it to downstream to legalize it and expand it to small legal types.
Differential Revision: https://reviews.llvm.org/D41411
llvm-svn: 321276
Simon Pilgrim [Thu, 21 Dec 2017 15:17:29 +0000 (15:17 +0000)]
[DAGCombiner] Generalize (and (or x, C), D) -> D iff (C & D) == D combine to work on non-splat vectors
llvm-svn: 321275
Simon Dardis [Thu, 21 Dec 2017 15:14:07 +0000 (15:14 +0000)]
[mips] Fix the invalid EVA test
During the review of D40362 I spotted that this test wasn't actually
testing the eva instructions due to '-mattr==eva', rather than '-mattr=+eva',
which resulted in test having no effect.
llvm-svn: 321273
Sam McCall [Thu, 21 Dec 2017 14:58:44 +0000 (14:58 +0000)]
[clangd] Index symbols share storage within a slab.
Summary:
Symbols are not self-contained - it's only safe to hand them out if you
guarantee the lifetime of the underlying data.
Before this lands, I'm going to measure the before/after memory usage of the
LLVM index loaded into memory in a single slab.
Reviewers: hokein
Subscribers: klimek, ilya-biryukov, cfe-commits
Differential Revision: https://reviews.llvm.org/D41483
llvm-svn: 321272
Pavel Labath [Thu, 21 Dec 2017 14:40:03 +0000 (14:40 +0000)]
Work around test failures on red-hat linux
Two tests were failing because the debugger was picking up multiply
defined internal symbols from the system libraries. This is a bug, as
there should be no ambiguity because the tests are defining variables
with should shadow these symbols, but lldb is not smart enough to figure
that out.
I work around the issue by renaming the variables in these tests, and in
exchange I create a self-contained test which reproduces the issue
without depending on the system libraries.
This increases the predictability of our test suite.
llvm-svn: 321271
Joachim Protze [Thu, 21 Dec 2017 14:36:36 +0000 (14:36 +0000)]
Add missing test case from D41171 commit
llvm-svn: 321270
Joachim Protze [Thu, 21 Dec 2017 14:36:30 +0000 (14:36 +0000)]
[OMPT] Add missing ompt_get_num_procs function
This function is defined in OpenMP-TR6 section 4.1.5.1.6
The functions was not implemented yet.
Since ompt-functions can only be called after the runtime was initialized and
has loaded a tool, it can assume the runtime to be initialized. In contrast
to omp_get_num_procs which needs to check whether the runtime is initialized.
Differential Revision: https://reviews.llvm.org/D40949
llvm-svn: 321269
Simon Pilgrim [Thu, 21 Dec 2017 14:33:40 +0000 (14:33 +0000)]
[X86] Add (and (or x, C), D) -> D iff (C & D) == D non-splat vector test
llvm-svn: 321268
Ilya Biryukov [Thu, 21 Dec 2017 14:05:28 +0000 (14:05 +0000)]
[clangd] Log more info about preambles
llvm-svn: 321267
Ilya Biryukov [Thu, 21 Dec 2017 14:04:39 +0000 (14:04 +0000)]
Added helper to get size of PrecompiledPreamble
llvm-svn: 321266
Joachim Protze [Thu, 21 Dec 2017 13:55:39 +0000 (13:55 +0000)]
[OMPT] Fix return address handling in a few GOMP interface methods
This revision fixes failing testcases with parallel for loops and the gomp
interface. The return address needs to be stored at entry to runtime.
The storage is cleared on usage, so we need to update the storage before
calling again internal functions, that will trigger event callbacks.
Differential Revision: https://reviews.llvm.org/D41181
llvm-svn: 321265
Joachim Protze [Thu, 21 Dec 2017 13:55:34 +0000 (13:55 +0000)]
[OMPT] Handle null pointer in set_callback to improve performance
We use the bitmap ompt_enabled thoughout the runtime, to avoid loading the
vector of callback functions when testing if specific code should be executed.
Before invoking an event callback function, the pointer is tested for NULL.
This revision resets the corresponding bit in ompt_enabled to 0 if
NULL is passed in set_callback.
Differential Revision: https://reviews.llvm.org/D41171
llvm-svn: 321264
Joachim Protze [Thu, 21 Dec 2017 13:55:29 +0000 (13:55 +0000)]
[OMPT] Use frames at different level when using clang version 5 or higher with debug flag
Clang 5 or higher adds an intermediate function call in certain cases when
compiling with debug flag. This revision updates the testcases to work
correctly.
Differential Revision: https://reviews.llvm.org/D40595
llvm-svn: 321263
Joachim Protze [Thu, 21 Dec 2017 13:55:16 +0000 (13:55 +0000)]
[OMPT] Add annotations to testcases that are expected to fail when using certain compilers
Reasons for expected failures are mainly bugs when using lables in OpenMP regions
or missing support of some OpenMP features.
For some worksharing clauses, support to distinguish the kind of workshare was
added just recently.
If an issue was fixed in a minor release version of a compiler, we flag the
test as unsupported for this compiler version to avoid false positives.
Same for fixes that where backported to older compiler versions.
Differential Revision: https://reviews.llvm.org/D40384
llvm-svn: 321262
Simon Pilgrim [Thu, 21 Dec 2017 13:18:19 +0000 (13:18 +0000)]
[X86] Add v48i8 AVG test case, based on discussion on D41440
llvm-svn: 321261
Simon Dardis [Thu, 21 Dec 2017 13:05:41 +0000 (13:05 +0000)]
[mips][compiler-rt] Provide 64bit atomic add and sub
r318733 introduced a build failure for native MIPS32 systems for xray due
to the lack of __sync_fetch_and_add / __syn_fetch_and_sub support. This patch
extends the existing support providing atomics so that xray can be
successfully built.
Reviewers: atanasyan, dberris
Differential Revision: https://reviews.llvm.org/D40385
llvm-svn: 321260
Sam Parker [Thu, 21 Dec 2017 12:55:04 +0000 (12:55 +0000)]
[DAGCombine] Improve ReduceLoadWidth for SRL
If the SRL node is only used by an AND, we may be able to set the
ExtVT to the width of the mask, making the AND redundant. To support
this, another check has been added in isLegalNarrowLoad which queries
whether the load is valid.
Differential Revision: https://reviews.llvm.org/D41350
llvm-svn: 321259
Paul Osmialowski [Thu, 21 Dec 2017 12:33:31 +0000 (12:33 +0000)]
[AArch64] add required arch specific code for running OMPT test cases
Differential Revision: https://reviews.llvm.org/D41482
llvm-svn: 321258
Pavel Labath [Thu, 21 Dec 2017 11:27:21 +0000 (11:27 +0000)]
[Support] Remove MemoryBuffer::getNewUninitMemBuffer
There is nothing useful that can be done with a read-only uninitialized
buffer without const_casting its contents to initialize it. A better
solution is to obtain a writable buffer
(WritableMemoryBuffer::getNewUninitMemBuffer), and then convert it to a
read-only buffer after initialization. All callers of this function have
already been updated to do this, so this function is now unused.
llvm-svn: 321257
Sam Parker [Thu, 21 Dec 2017 11:17:49 +0000 (11:17 +0000)]
[ARM] Armv8-R DFB instruction
Implement MC support for the Armv8-R 'Data Full Barrier' instruction.
Differential Revision: https://reviews.llvm.org/D41430
llvm-svn: 321256