James Henderson [Thu, 10 Jan 2019 14:10:02 +0000 (14:10 +0000)]
[llvm-symbolizer] Add support for specifying addresses on command-line
See https://bugs.llvm.org/show_bug.cgi?id=40070.
GNU addr2line accepts input addresses both on the command-line and via
stdin. llvm-symbolizer previously only supported the latter. This
change adds support for the former. As with addr2line, the new
behaviour is to only look for addresses on stdin if no positional
arguments were provided to llvm-symbolizer.
Reviewed by: ruiu
Differential Revision: https://reviews.llvm.org/D56272
llvm-svn: 350821
Andrea Di Biagio [Thu, 10 Jan 2019 13:59:13 +0000 (13:59 +0000)]
[MCA] Fix wrong definition of ResourceUnitMask in DefaultResourceStrategy.
Field ResourceUnitMask was incorrectly defined as a 'const unsigned' mask. It
should have been a 64 bit quantity instead. That means, ResourceUnitMask was
always implicitly truncated to a 32 bit quantity.
This issue has been found by inspection. Surprisingly, that bug was latent, and
it never negatively affected any existing upstream targets.
This patch fixes the wrong definition of ResourceUnitMask, and adds a bunch of
extra debug prints to help debugging potential issues related to invalid
processor resource masks.
llvm-svn: 350820
George Rimar [Thu, 10 Jan 2019 13:43:06 +0000 (13:43 +0000)]
[LLD][ELF] - Support MSP430.
Patch by Michael Skvortsov!
This change adds a basic support for linking static MSP430 ELF code.
Implemented relocation types are intended to correspond to the BFD.
Differential revision: https://reviews.llvm.org/D56535
llvm-svn: 350819
Amy Kwan [Thu, 10 Jan 2019 13:23:33 +0000 (13:23 +0000)]
[compiler-rt][builtins][PowerPC] Implemented __floattitf builtin on PowerPC
This patch implements the long double __floattitf (int128_t) method for
PowerPC -- specifically to convert a 128 bit integer into a long double
(IBM double-double).
To invoke this method, one can do so by linking against compiler-rt, via the
--rtlib=compiler-rt command line option supplied to clang.
Differential Revision: https://reviews.llvm.org/D54313/
llvm-svn: 350818
Aaron Ballman [Thu, 10 Jan 2019 13:19:48 +0000 (13:19 +0000)]
Correct the spelling of helpURI to helpUri.
JSON is case sensitive and the SARIF spec uses the corrected spelling.
llvm-svn: 350817
Amy Kwan [Thu, 10 Jan 2019 12:30:12 +0000 (12:30 +0000)]
[compiler-rt][builtins][PowerPC] Implemented __fixunstfti builtin on PowerPC
This patch implements the __uint128_t __fixunstfti (long double) method for
PowerPC -- specifically to convert a long double (IBM double-double) to an
unsigned 128 bit integer.
The general approach of this algorithm is to convert the high and low doubles
of the long double and add them together if the doubles fit within 64 bits.
However, additional adjustments and scaling is performed when the high or low
double does not fit within a 64 bit integer.
To invoke this method, one can do so by linking against compiler-rt, via the
--rtlib=compiler-rt command line option supplied to clang.
Differential Revision: https://reviews.llvm.org/D54911
llvm-svn: 350815
Jonas Toth [Thu, 10 Jan 2019 11:56:44 +0000 (11:56 +0000)]
[clang-tidy] Fix case of local variables in modernize-use-nodiscard checker
Summary:
Correct the case of the local variables..
Rational:
I want to be able to run clang-tidy on new clang-tidy checker code prior to creating a review (to demonstrate we should dog food our own tools during development, not my suggestion but @Eugene.Zelenko)
To this end I am running the following in a script, prior to make a change.
```
tidy:
@for source in $$(git status -suno | grep ".cpp$$" | cut -c4-) ;\
do \
clang-tidy -quiet $$source -- $(TIDY_FLAGS);\
done
```
I then want to go through the checkers and see which checkers most closely match the review style of the reviewers
```
---
Checks: '
-clang-diagnostic-*,
readability-identifier-naming,
llvm-header-guard
'
WarningsAsErrors: ''
HeaderFilterRegex: ''
AnalyzeTemporaryDtors: false
FormatStyle: LLVM
CheckOptions:
- key: readability-identifier-naming.IgnoreFailedSplit
value: '0'
- key: readability-identifier-naming.VariableCase
value: 'CamelCase'
- key: readability-identifier-naming.LocalVariableCase
value: 'CamelCase'
...
```
Unfortunately in doing so, I have identified that my previous review {D55433} it violates what looks like to be the convention of local variables being in CamelCase.
Sending this small review in the hope it can be corrected.
Patch by MyDeveloperDay.
Reviewers: JonasToth, Eugene.Zelenko
Reviewed By: JonasToth
Subscribers: xazax.hun, Eugene.Zelenko
Differential Revision: https://reviews.llvm.org/D56536
llvm-svn: 350814
Louis Dionne [Thu, 10 Jan 2019 11:23:33 +0000 (11:23 +0000)]
[pstl] Fix compile errors when PARALLEL_POLICIES is disabled
Reviewed as https://reviews.llvm.org/D56139.
Thanks to @jerryct for the patch.
llvm-svn: 350813
Louis Dionne [Thu, 10 Jan 2019 11:17:26 +0000 (11:17 +0000)]
[pstl] Fix CMake configuration when parallel policies are disabled
llvm-svn: 350812
Sam Parker [Thu, 10 Jan 2019 10:47:23 +0000 (10:47 +0000)]
[ARM] Fix for verifier buildbot
Copy the MachineOperand first and then change the flags instead of
making a copy.
llvm-svn: 350811
Pavel Labath [Thu, 10 Jan 2019 10:23:27 +0000 (10:23 +0000)]
Revert "Add a verbose mode to "image dump line-table" and use it to write a .debug_line test"
This reverts commit r350802 because the test fails on windows. This
happens because we treat the paths as windows paths even though they
have linux path separators in the asm file. That results in wrong paths
being computed (\tmp\tmp\a.c instead of /tmp/a.c).
Reverting until I can figure out what to do with this.
llvm-svn: 350810
Pavel Labath [Thu, 10 Jan 2019 10:23:19 +0000 (10:23 +0000)]
PECOFF: Fix section name computation
If a section name is exactly 8 bytes long (or has been truncated to 8
bytes), it will not contain the terminating nul character. This means
reading the name as a c string will pick up random data following the
name field (which happens to be the section vm size).
This fixes the name computation to avoid out-of-bounds access and adds a
test.
Reviewers: zturner, stella.stamenova
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D56124
llvm-svn: 350809
Fedor Sergeev [Thu, 10 Jan 2019 10:01:53 +0000 (10:01 +0000)]
[LoopUnroll] add parsing for unroll parameters in -passes pipeline
Allow to specify loop-unrolling with optional parameters explicitly
spelled out in -passes pipeline specification.
Introducing somewhat generic way of specifying parameters parsing via
FUNCTION_PASS_PARAMETRIZED pass registration.
Syntax of parametrized unroll pass name is as follows:
'unroll<' parameter-list '>'
Where parameter-list is ';'-separate list of parameter names and optlevel
optlevel: 'O[0-3]'
parameter: { 'partial' | 'peeling' | 'runtime' | 'upperbound' }
negated: 'no-' parameter
Example:
-passes=loop(unroll<O3;runtime;no-upperbound>)
this invokes LoopUnrollPass configured with OptLevel=3,
Runtime, no UpperBound, everything else by default.
llvm-svn: 350808
Bjorn Pettersson [Thu, 10 Jan 2019 09:58:23 +0000 (09:58 +0000)]
Fix RUN line in test/Transforms/LoopDeletion/crashbc.ll
llvm-svn: 350807
Diana Picus [Thu, 10 Jan 2019 09:40:56 +0000 (09:40 +0000)]
[asan] Mark tests as UNSUPPORTED on arm
Temporarily mark a couple of tests as UNSUPPORTED until we figure out
why they fail on the thumb bots.
The failure was introduced in
r350139 - Add support for background thread on NetBSD in ASan.
llvm-svn: 350806
Ivan Donchevskii [Thu, 10 Jan 2019 09:34:44 +0000 (09:34 +0000)]
[libclang] Fix clang_Cursor_isAnonymous
Use the same logic as in TypePrinter::printTag to determine that the tag is anonymous and the separate check for namespaces.
Differential Revision: https://reviews.llvm.org/D54996
llvm-svn: 350805
Pavel Labath [Thu, 10 Jan 2019 09:32:31 +0000 (09:32 +0000)]
Implement ObjectFileELF::GetBaseAddress
Summary:
The concept of a base address was already present in the implementation
(it's needed for computing section load addresses properly), but it was
never exposed through this function. This fixes that.
llvm-svn: 350804
Haojian Wu [Thu, 10 Jan 2019 09:22:40 +0000 (09:22 +0000)]
[clangd] Don't store completion info if the symbol is not used for code completion.
Summary:
This would save us some memory and disk space:
- Dex usage (261 MB vs 266 MB)
- Disk (75 MB vs 76 MB)
It would save more when we index the main file symbol D55185.
Reviewers: ilya-biryukov
Reviewed By: ilya-biryukov
Subscribers: nridge, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Differential Revision: https://reviews.llvm.org/D56314
llvm-svn: 350803
Pavel Labath [Thu, 10 Jan 2019 09:16:00 +0000 (09:16 +0000)]
Add a verbose mode to "image dump line-table" and use it to write a .debug_line test
Summary:
The motivation for this is being able to write tests for the upcoming
breakpad line table parser, but this could be useful for testing the
low-level workings of any line table format. Or simply for viewing the
line table information with more detail (the brief format doesn't
include any of the flags for end_of_prologue and similar).
I've also removed the load_addresses argument from the
DumpCompileUnitLineTable function, as it wasn't being used anywhere.
Reviewers: clayborg, zturner
Subscribers: JDevlieghere, lldb-commits
Differential Revision: https://reviews.llvm.org/D56315
llvm-svn: 350802
Sam Parker [Thu, 10 Jan 2019 08:36:33 +0000 (08:36 +0000)]
[ARM] Size reduce teq to eors
Add t2TEQrr to the map of instructions with can be reduced down into
a T1 instruction. This is a special case because TEQ just sets the
CPSR and doesn't write to a GPR, which is not the case for EOR. So,
we need to ensure that the EOR can write to the first operand.
Differential Revision: https://reviews.llvm.org/D56255
llvm-svn: 350801
Craig Topper [Thu, 10 Jan 2019 07:43:54 +0000 (07:43 +0000)]
[X86] Disable DomainReassignment pass when AVX512BW is disabled to avoid injecting VK32/VK64 references into the MachineIR
Summary:
This pass replaces GR8/GR16/GR32/GR64 with their equivalent sized mask register classes. But VK32/VK64 aren't legal without AVX512BW. Apparently this mostly appears to work if the register coalescer is able to remove the VK32/VK64 register class reference. Or if we don't ever spill it. But there's no guarantee of that.
Another Intel employee managed to trigger a crash due to this with ISPC. Unfortunately, I've lost the test case he sent me at the time. I'm trying to get him to reproduce it for me. I'd like to get this in before 8.0 branches since its a little scary.
The regressions here are unfortunate, but I think we can make some improvements to DAG combine, load folding, etc. to fix them. Just not sure if we can get that done for 8.0.
Fixes PR39741
Reviewers: RKSimon, spatel
Reviewed By: RKSimon
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D56460
llvm-svn: 350800
Zi Xuan Wu [Thu, 10 Jan 2019 06:20:14 +0000 (06:20 +0000)]
Recommit "[PowerPC] Fix assert from machine verify pass that unmatched register class about fcmp selection in fast-isel"
This re-commit r350685.
Differential Revision: https://reviews.llvm.org/D55686
llvm-svn: 350799
Mandeep Singh Grang [Thu, 10 Jan 2019 04:59:44 +0000 (04:59 +0000)]
[AArch64] Emit the correct MCExpr relocations specifiers like VK_ABS_G0, etc
Summary:
D55896 and D56029 add support to emit fixups for :abs_g0: , :abs_g1_s: , etc.
This patch adds the necessary enums and MCExpr needed for lowering these.
Reviewers: rnk, mstorsjo, efriedma
Reviewed By: efriedma
Subscribers: javed.absar, kristof.beyls, llvm-commits
Differential Revision: https://reviews.llvm.org/D56037
llvm-svn: 350798
Richard Trieu [Thu, 10 Jan 2019 04:53:10 +0000 (04:53 +0000)]
Remove unnecessary include.
QuerySession.h does not need anything from Query.h, so it does not need to
include it.
llvm-svn: 350797
David Carlier [Thu, 10 Jan 2019 04:19:30 +0000 (04:19 +0000)]
i[Sanitizer] Enable pututxline interception
Reviewers: krytarowski
Reviewed By: krytarowski
Differential Revision: https://reviews.llvm.org/D56495
llvm-svn: 350796
Thomas Lively [Thu, 10 Jan 2019 04:09:25 +0000 (04:09 +0000)]
Revert "[WebAssembly] Add simd128-unimplemented subtarget feature"
This reverts rL350791.
llvm-svn: 350795
Stanislav Mekhanoshin [Thu, 10 Jan 2019 03:25:47 +0000 (03:25 +0000)]
[AMDGPU] Separate feature dot-insts
Differential Revision: https://reviews.llvm.org/D56525
llvm-svn: 350794
Stanislav Mekhanoshin [Thu, 10 Jan 2019 03:25:20 +0000 (03:25 +0000)]
[AMDGPU] Separate feature dot-insts
Differential Revision: https://reviews.llvm.org/D56524
llvm-svn: 350793
Richard Trieu [Thu, 10 Jan 2019 03:23:25 +0000 (03:23 +0000)]
Refactor declarations of ASTContext allocate functions into its own header.
Forward declarations of the allocate functions combine with the forward
declaration of the ASTContext class is enough information for some headers
without pulling in ASTContext.h in its entirety. Pull the existing
declarations from AttrIterator.h into a new header. Also place the default
alignment size into this header. Previously, new had its default in
AttrIterator.h while new[] had its default in ASTContext.h. Add new header
includes where it is needed. Specifically to ASTVector.h to make it a
standalone header, unlike previously which it was standalone as long as
none of its functions were called.
llvm-svn: 350792
Thomas Lively [Thu, 10 Jan 2019 02:55:52 +0000 (02:55 +0000)]
[WebAssembly] Add simd128-unimplemented subtarget feature
This is a second attempt at r350778, which was reverted in
r350789. The only change is that the unimplemented-simd128 feature has
been renamed simd128-unimplemented, since naming it
unimplemented-simd128 somehow made the simd128 feature flag enable the
unimplemented-simd128 feature on Windows.
llvm-svn: 350791
Jorge Gorbe Moya [Thu, 10 Jan 2019 01:51:54 +0000 (01:51 +0000)]
Revert "Fix go bindings for r350647: missed a function rename"
This reverts commit
a74266858a8164cfb23d4e138cd4c7c37be0b5d1. SVN revision r350657.
llvm-svn: 350790
Thomas Lively [Thu, 10 Jan 2019 01:37:44 +0000 (01:37 +0000)]
Revert "[WebAssembly] Add unimplemented-simd128 subtarget feature"
This reverts L350778.
llvm-svn: 350789
Davide Italiano [Thu, 10 Jan 2019 01:15:18 +0000 (01:15 +0000)]
[Python] Update checkDsymForUUIDIsOn to be compatible with Python 3.
Summary:
In python 2, strings and bytes are the same, but they're not in
python 3, hence the return of read() needs an explicit conversion.
While I'm around, rename the return of Popen() from `pipe` to
`process`, as that's what Popen returns.
Reviewers: JDevlieghere, friss, zturner, aprantl, serge-sans-paille
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D56517
llvm-svn: 350788
Jorge Gorbe Moya [Thu, 10 Jan 2019 01:08:31 +0000 (01:08 +0000)]
Revert "[Sparc] Add Sparc V8 support"
This reverts commit r350705.
llvm-svn: 350787
Jason Molenda [Thu, 10 Jan 2019 00:57:54 +0000 (00:57 +0000)]
A little cleanup / commenting on locating kernel binaries while I
was working on something else.
DynamicLoaderDarwinKernel::SearchForKernelNearPC should have had
an early return if the pc value is not in high memory; add that.
The search for a kernel at 0x2000 offsets was a stopgap; it doesn't
need to be checked any longer.
llvm-svn: 350786
Craig Topper [Thu, 10 Jan 2019 00:47:25 +0000 (00:47 +0000)]
[X86] Really make the pointer arguments to avx512 gather/scatter intrinsics 'void*' to match gcc and Intel's documentation.
The avx2 gather intrinsics are documented to use 'int', 'long long', 'float', or 'double' *. So I'm leaving those. This matches gcc.
I tried to do this in r350696, but I only updated the header not the builtin definition.
llvm-svn: 350785
Aaron Smith [Thu, 10 Jan 2019 00:46:09 +0000 (00:46 +0000)]
[lldb-server] Add unnamed pipe support to PipeWindows
Summary:
This adds unnamed pipe support in PipeWindows to support communication between a debug server and child process.
Modify PipeWindows::CreateNew to support the creation of an unnamed pipe.
Rename the previous method that created a named pipe to PipeWindows::CreateNewNamed.
Reviewers: zturner, llvm-commits
Reviewed By: zturner
Subscribers: Hui, labath, lldb-commits
Differential Revision: https://reviews.llvm.org/D56234
llvm-svn: 350784
Alina Sbirlea [Thu, 10 Jan 2019 00:16:54 +0000 (00:16 +0000)]
[MemorySSA] Remove optimized value when reseting optimized.
Summary:
If we don't reset the optimized value O for access A, even though A is no longer optimized to O, A will still show up in that O's users list.
This fails verification when hoisting a Def outside a loop, even though the updates are correct.
The reason is that the phi in the loop header still find as user the hoisted def, because the Def has a pointer to the Phi in its optimized operand.
Reviewers: george.burgess.iv
Subscribers: sanjoy, jlebar, Prazek, llvm-commits
Differential Revision: https://reviews.llvm.org/D56467
llvm-svn: 350783
Craig Topper [Thu, 10 Jan 2019 00:14:27 +0000 (00:14 +0000)]
[X86] After turning VSELECT into SHRUNKBLEND, make we push the VSELECT into the worklist so it can be deleted.
Found while trying to figure out why my second version of D56421 worked better than the first version. We weren't deleting the vselect in a timely fashion and that caused SimplfyDemandedBit to see an additional user.
The new version doesn't have this problem so this fix isn't needed there, but seemed like the right thing to do.
llvm-svn: 350781
Richard Smith [Thu, 10 Jan 2019 00:03:29 +0000 (00:03 +0000)]
In nothrow new-expressions, null-check the result if we're going to
apply sanitizers to it.
This avoids a sanitizer false positive that we are initializing a null
pointer.
llvm-svn: 350779
Thomas Lively [Wed, 9 Jan 2019 23:59:37 +0000 (23:59 +0000)]
[WebAssembly] Add unimplemented-simd128 subtarget feature
Summary:
This replaces the old ad-hoc -wasm-enable-unimplemented-simd
flag. Also makes the new unimplemented-simd128 feature imply the
simd128 feature.
Reviewers: aheejin, dschuff
Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits, alexcrichton
Differential Revision: https://reviews.llvm.org/D56501
llvm-svn: 350778
Evandro Menezes [Wed, 9 Jan 2019 23:57:15 +0000 (23:57 +0000)]
[llvm-mca] Display masks in hex
Display the resources masks as hexadecimal. Otherwise, NFC.
llvm-svn: 350777
Nick Desaulniers [Wed, 9 Jan 2019 23:54:55 +0000 (23:54 +0000)]
[Sema] Mark target of __attribute__((alias("target"))) used for C
Summary:
Prevents -Wunneeded-internal-delcaration warnings when the target has no
other references. This occurs frequently in device drivers in the Linux
kernel.
Sema would need to invoke the demangler on the target, since in C++ the
target name is mangled:
int f() { return 42; }
int g() __attribute__((alias("_Z1fv")));
Sema does not have the ability to demangle names at this time.
https://bugs.llvm.org/show_bug.cgi?id=39088
https://github.com/ClangBuiltLinux/linux/issues/232
Reviewers: rsmith, rjmccall
Reviewed By: rsmith
Subscribers: erik.pilkington, cfe-commits, pirama, srhines
Differential Revision: https://reviews.llvm.org/D54188
llvm-svn: 350776
Eli Friedman [Wed, 9 Jan 2019 23:39:26 +0000 (23:39 +0000)]
[SimplifyLibCalls] Fix memchr expansion for constant strings.
The C standard says "The memchr function locates the first
occurrence of c (converted to an unsigned char)[...]". The expansion
was missing the conversion to unsigned char.
Fixes https://bugs.llvm.org/show_bug.cgi?id=39041 .
Differential Revision: https://reviews.llvm.org/D55947
llvm-svn: 350775
David Major [Wed, 9 Jan 2019 23:36:32 +0000 (23:36 +0000)]
Don't require a null terminator when loading objects
When a null terminator is required and the file size is a multiple of the system page size, MemoryBuffer will prefer pread() over mmap(), which can result in excessive memory usage.
Patch by Mike Hommey!
Differential Revision: https://reviews.llvm.org/D56475
llvm-svn: 350774
Zachary Turner [Wed, 9 Jan 2019 23:26:50 +0000 (23:26 +0000)]
Write PDB/variables.test to be more robust.
CHECK-DAG can't really be mixed with CHECK-NEXT statements because
each non DAG check sets a new search-origin for following CHECK-DAG
statements. This was passing by coincidence before, but a benign
change in the way we process symbols caused the order of the output
to be different, which triggered this test to fail.
This change makes the test resilient against ordering problems by
running a separate invocation of FileCheck for each function that
we want to test.
Note that with the Native PDB reader, we have full control over
the ordering that symbols are processed in, so we don't have
to worry about different machines returning things in different
orders due to different DIA SDK versions.
llvm-svn: 350773
JF Bastien [Wed, 9 Jan 2019 23:20:24 +0000 (23:20 +0000)]
[NFC] Always lock free test: add indirection
I have a big patch coming up, and this indirection is required to avoid hitting the following after my big change:
error: empty struct has size 0 in C, size 1 in C++ [-Werror,-Wextern-c-compat]
llvm-svn: 350772
Heejin Ahn [Wed, 9 Jan 2019 23:05:21 +0000 (23:05 +0000)]
[WebAssembly] Print a debug message at the start of each pass
Summary:
Looks like many passes print its pass description as a debug message at
the start of each pass, so added that to (mostly newly added) other
passes as well.
Reviewers: dschuff
Subscribers: jgravelle-google, sbc100, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D56142
llvm-svn: 350771
JF Bastien [Wed, 9 Jan 2019 22:56:45 +0000 (22:56 +0000)]
[NFC] Normalize some test 'main' signatures
There were 3 tests with 'int main(void)', and 6 with the return type on a different line. I'm about to send a patch for main in tests, and this NFC change is unrelated.
llvm-svn: 350770
Davide Italiano [Wed, 9 Jan 2019 22:52:47 +0000 (22:52 +0000)]
[Python] Update PyString_FromString() to work for python 2 and 3.
Reviewers: aprantl, JDevlieghere, friss, zturner
Subscribers: lldb-commits
Differential Revision: https://reviews.llvm.org/D56511
llvm-svn: 350769
Alex Lorenz [Wed, 9 Jan 2019 22:31:37 +0000 (22:31 +0000)]
[ObjC] Allow the use of implemented unavailable methods from within
the @implementation context
In Objective-C, it's common for some frameworks to mark some methods like init
as unavailable in the @interface to prohibit their usage. However, these
frameworks then often implemented said method and refer to it in another method
that acts as a factory for that object. The recent change to how messages to
self are type checked in clang (r349841) introduced a regression which started
to prohibit this pattern with an X is unavailable error. This commit addresses
the aforementioned regression.
rdar://
47134898
Differential Revision: https://reviews.llvm.org/D56469
llvm-svn: 350768
Rui Ueyama [Wed, 9 Jan 2019 22:24:27 +0000 (22:24 +0000)]
Fix formatting. NFC.
llvm-svn: 350767
Jonathan Metzman [Wed, 9 Jan 2019 21:46:09 +0000 (21:46 +0000)]
[libfuzzer][MSVC] Make calls to builtin functions work with MSVC
Summary:
Replace calls to builtin functions with macros or functions that call the
Windows-equivalents when targeting windows and call the original
builtin functions everywhere else.
This change makes more parts of libFuzzer buildable with MSVC.
Reviewers: vitalybuka
Reviewed By: vitalybuka
Subscribers: mgorny, rnk, thakis
Differential Revision: https://reviews.llvm.org/D56439
llvm-svn: 350766
Jonas Toth [Wed, 9 Jan 2019 21:27:59 +0000 (21:27 +0000)]
[clang-tidy] another take at fixing doc
llvm-svn: 350765
Zachary Turner [Wed, 9 Jan 2019 21:20:44 +0000 (21:20 +0000)]
Change lldb-test to use ParseAllDebugSymbols.
ParseDeclsForContext was originally created to serve the very specific
case where the context is a function block. It was never intended to be
used for arbitrary DeclContexts, however due to the generic name, the
DWARF and PDB plugins implemented it in this way "just in case". Then,
lldb-test came along and decided to use it in that way.
Related to this, there are a set of functions in the SymbolFile class
interface whose requirements and expectations are not documented. For
example, if you call ParseCompileUnitFunctions, there's an inherent
requirement that you create entries in the underlying clang AST for
these functions as well as their signature types, because in order to
create an lldb_private::Function object, you have to pass it a
CompilerType for the parameter representing the signature.
On the other hand, there is no similar requirement (either inherent or
documented) if one were to call ParseDeclsForContext. Specifically, if
one calls ParseDeclsForContext, and some variable declarations, types,
and other things are added to the clang AST, is it necessary to create
lldb::Variable, lldb::Type, etc objects representing them? Nobody knows.
There is, however, an accidental requirement, because since all of the
plugins implemented this just in case, lldb-test came along and used
ParsedDeclsForContext, and then wrote check lines that depended on this.
When I went to try and implemented the NativePDB reader, I did not
adhere to this (in fact, from a layering perspective I went out of my
way to avoid it), and as a result the existing DIA PDB tests don't work
when the native PDB reader is enabled, because they expect that calling
ParseDeclsForContext will modify the *module's* view of symbols, and not
just the internal AST.
All of this confusion, however, can be avoided if we simply stick to
using ParseDeclsForContext for its original intended use case (blocks),
and use a different function (ParseAllDebugSymbols) for its intended use
case which is, unsuprisingly, to parse all the debug symbols (which is
all lldb-test really wanted to do anyway).
In the future, I would like to change ParseDeclsForContext to
ParseDeclsForFunctionBlock, then delete all of the dead code inside that
handles other types of DeclContexts (and probably even assert if the
DeclContext is anything other than a block).
A few PDB tests needed to be fixed up as a result of this, and this also
exposed a couple of bugs in the DIA PDB reader (doesn't matter much
since it should be going away soon, but worth mentioning) where the
appropriate AST entries weren't being created always.
Differential Revision: https://reviews.llvm.org/D56418
llvm-svn: 350764
Jonas Toth [Wed, 9 Jan 2019 21:19:44 +0000 (21:19 +0000)]
[clang-tidy] tryfix documentation build
llvm-svn: 350763
Florian Hahn [Wed, 9 Jan 2019 21:04:36 +0000 (21:04 +0000)]
[AArch64] Add test for constant shrinking with multiple users (NFC).
Test to avoid regression fixed by rL350684.
llvm-svn: 350762
Jonas Toth [Wed, 9 Jan 2019 21:03:54 +0000 (21:03 +0000)]
[clang-tidy] fix-up failing tests
llvm-svn: 350761
Jonas Toth [Wed, 9 Jan 2019 20:50:50 +0000 (20:50 +0000)]
[clang-tidy] Adding a new modernize use nodiscard checker
Summary: Adds a checker to clang-tidy to warn when a non void const member function, taking only parameters passed by value or const reference could be marked as '[[nodiscard]]'
Patch by MyDeveloperDay.
Reviewers: alexfh, stephenkelly, curdeius, aaron.ballman, hokein, JonasToth
Reviewed By: curdeius, JonasToth
Subscribers: Eugene.Zelenko, lefticus, lebedev.ri, mgorny, xazax.hun, cfe-commits
Tags: #clang-tools-extra
Differential Revision: https://reviews.llvm.org/D55433
llvm-svn: 350760
Gheorghe-Teodor Bercea [Wed, 9 Jan 2019 20:45:26 +0000 (20:45 +0000)]
[OpenMP] Avoid remainder operations for loop index values on a collapsed loop nest.
Summary: Change the strategy for computing loop index variables after collapsing a loop nest via the collapse clause by replacing the expensive remainder operation with multiplications and additions.
Reviewers: ABataev, caomhin
Reviewed By: ABataev
Subscribers: guansong, arphaman, cfe-commits
Differential Revision: https://reviews.llvm.org/D56413
llvm-svn: 350759
Gheorghe-Teodor Bercea [Wed, 9 Jan 2019 20:38:35 +0000 (20:38 +0000)]
[OpenMP] Add flag for preventing the extension to 64 bits for the collapse loop counter
Summary: Introduce a compiler flag for cases when the user knows that the collapsed loop counter can be safely represented using at most 32 bits. This will prevent the emission of expensive mathematical operations (such as the div operation) on the iteration variable using 64 bits where 32 bit operations are sufficient.
Reviewers: ABataev, caomhin
Reviewed By: ABataev
Subscribers: hfinkel, kkwli0, guansong, cfe-commits
Differential Revision: https://reviews.llvm.org/D55928
llvm-svn: 350758
Alexey Bataev [Wed, 9 Jan 2019 20:32:56 +0000 (20:32 +0000)]
[OPENMP][DOCS]Release notes/OpenMP support updates, NFC.
llvm-svn: 350757
Aaron Ballman [Wed, 9 Jan 2019 20:15:10 +0000 (20:15 +0000)]
Removing an include that was not necessary; NFC.
The include also had a using namespace llvm in it, so this adds qualifiers where needed as well.
llvm-svn: 350756
Easwaran Raman [Wed, 9 Jan 2019 20:10:27 +0000 (20:10 +0000)]
Refactor synthetic profile count computation. NFC.
Summary:
Instead of using two separate callbacks to return the entry count and the
relative block frequency, use a single callback to return callsite
count. This would allow better supporting hybrid mode in the future as
the count of callsite need not always be derived from entry count (as in
sample PGO).
Reviewers: davidxl
Subscribers: mehdi_amini, steven_wu, dexonsmith, dang, llvm-commits
Differential Revision: https://reviews.llvm.org/D56464
llvm-svn: 350755
Shoaib Meenai [Wed, 9 Jan 2019 20:05:16 +0000 (20:05 +0000)]
[CodeGen] Clarify comment about COFF common symbol alignment
After a discussion on the commit thread, it seems the 32 byte alignment
limitation is an MSVC toolchain artifact, not an inherent COFF
restriction. Clarify the comment accordingly, since saying COFF in the
comment but using isKnownWindowsMSVCEnvironment in the conditional is
confusing. Also add a newline before the comment, which is consistent
with the local style.
Differential Revision: https://reviews.llvm.org/D56466
llvm-svn: 350754
Francis Visoiu Mistrih [Wed, 9 Jan 2019 19:46:15 +0000 (19:46 +0000)]
[CodeGen] Ignore return sext/zext attributes of unused results for tail calls
If the caller's return type does not have a zeroext attribute but the
callee does a tail call zeroext, we won't consider the tail call during
CodeGenPrepare because the attributes don't match.
However, if the result of the tail call has no uses, it makes sense to
drop the sext/zext attributes.
Differential Revision: https://reviews.llvm.org/D56486
llvm-svn: 350753
Louis Dionne [Wed, 9 Jan 2019 19:40:20 +0000 (19:40 +0000)]
[libcxx] Add a script to run CI on older MacOS versions
This script can be used by CI systems to test things like availability
markup and binary compatibility on older MacOS versions. This is still
a bit rough on the edges, for example we don't test libc++abi yet.
llvm-svn: 350752
Easwaran Raman [Wed, 9 Jan 2019 19:26:17 +0000 (19:26 +0000)]
[Inliner] Assert that the computed inline threshold is non-negative.
Reviewers: chandlerc
Subscribers: haicheng, llvm-commits
Differential Revision: https://reviews.llvm.org/D56409
llvm-svn: 350751
Nico Weber [Wed, 9 Jan 2019 19:18:03 +0000 (19:18 +0000)]
lld-link: Add help strings for /manifest, /nodefaultlib, /noentry; tweak manifest help strings
My main motivation is that I can never remember /nodefaultlib and
`lld-link /? | grep no` didn't display it due to it not having a help string.
Differential Revision: https://reviews.llvm.org/D56502
llvm-svn: 350750
David Callahan [Wed, 9 Jan 2019 19:12:38 +0000 (19:12 +0000)]
refactor BlockFrequencyInfo::view to take a title parameter
Summary: All a non-default title for the debugging this debugging aide
Reviewers: twoh, Kader, modocache
Reviewed By: twoh
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D56499
llvm-svn: 350749
Aaron Ballman [Wed, 9 Jan 2019 18:59:56 +0000 (18:59 +0000)]
Fix visualization of intrusive reference counted objects in MSVC.
llvm-svn: 350748
Gheorghe-Teodor Bercea [Wed, 9 Jan 2019 18:30:14 +0000 (18:30 +0000)]
[OpenMP][libomptarget] Use shared memory variable for tracking parallel level
Summary: Replace existing infrastructure for tracking parallel level using global memory with a per-team shared memory variable. This minimizes the impact of the overhead of tracking the parallel level for non-nested cases.
Reviewers: ABataev, caomhin
Reviewed By: ABataev
Subscribers: guansong, openmp-commits
Differential Revision: https://reviews.llvm.org/D55773
llvm-svn: 350747
Thomas Lively [Wed, 9 Jan 2019 18:13:11 +0000 (18:13 +0000)]
[WebAssembly] Standardize order of SIMD bitselect arguments
Summary:
For some reason the backend assumed that the condition mask would be
the first argument to the LLVM intrinsic, but everywhere else the
condition mask is the third argument.
Reviewers: aheejin
Subscribers: dschuff, sbc100, jgravelle-google, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D56412
llvm-svn: 350746
Sanjay Patel [Wed, 9 Jan 2019 17:29:18 +0000 (17:29 +0000)]
[x86] use 'nounwind' to remove test noise; NFC
llvm-svn: 350745
David Carlier [Wed, 9 Jan 2019 17:14:57 +0000 (17:14 +0000)]
[asan] Disable TSD dtor leak unit tests on FreeBSD x86 64
- Assertion fails in the third iteration.
Reviewers: krytarowski
Reviewed By: krytarowski
Differential Revision: https://reviews.llvm.org/D56497
llvm-svn: 350744
Pavel Labath [Wed, 9 Jan 2019 16:50:45 +0000 (16:50 +0000)]
ELF: create "container" sections from PT_LOAD segments
Summary:
This is the result of the discussion in D55356, where it was suggested
as a solution to representing the addresses that logically belong to a
module in memory, but are not a part of any of its sections.
The ELF PT_LOAD segments are similar to the MachO "load commands",
except that the relationship between them and the object file sections
is a bit weaker. While in the MachO case, the sections belonging to a
specific segment are placed directly inside it in the object file
logical structur, in the ELF case, the sections and segments form two
separate hierarchies. This means that it is in theory possible to create
an elf file where only a part of a section would belong to some segment
(and another part to a different one). However, I am not aware of any
tool which would produce such a file (and most tools will have problems
ingesting them), so this means it is still possible to follow the MachO
model and make sections children of the PT_LOAD segments.
In case we run into (corrupt?) files with overlapping sections, I have
added code (and tests) which adjusts the sizes and/or drops the offending
sections in order to present a reasonable image to the upper layers of
LLDB. This is mostly done for completeness, as I don't anticipate
running into this situation in the real world. However, if we do run
into it, and the current behavior is not suitable for some reason, we
can implement this logic differently.
Reviewers: clayborg, jankratochvil, krytarowski, joerg, espindola
Subscribers: emaste, arichardson, lldb-commits
Differential Revision: https://reviews.llvm.org/D55998
llvm-svn: 350742
Bruno Ricci [Wed, 9 Jan 2019 16:41:33 +0000 (16:41 +0000)]
[AST] Move back BasePathSize to the bit-fields of CastExpr
The number of trailing CXXBaseSpecifiers in CastExpr was moved from
CastExprBitfields to a trailing object in r338489 (D50050). At this time these
bit-fields classes were only 32 bits wide. However later r345459 widened these
bit-field classes to 64 bits.
The reason for this change was that on 64 bit archs alignment requirements
caused 4 bytes of padding after the Stmt sub-object in nearly all expression
classes. Reusing this padding yielded an >10% reduction in the size used by all
statement/expressions when parsing all of Boost (on a 64 bit arch). This
increased the size of statement/expressions for 32 bits archs, but this can be
mitigated by moving more data to the bit-fields of Stmt (and moreover most
people now care about 64 bits archs as a host).
Therefore move back the number of CXXBaseSpecifiers in CastExpr to the
bit-fields of Stmt. This in effect mostly revert r338489 while keeping the
added test.
Differential Revision: https://reviews.llvm.org/D56358
Reviewed By: lebedev.ri
Reviewers: lebedev.ri, rjmccall
llvm-svn: 350741
Louis Dionne [Wed, 9 Jan 2019 16:35:55 +0000 (16:35 +0000)]
[libcxx] Add a script to run CI on MacOS
CI systems like Green Dragon should use this script so as to make
reproducing errors easy locally.
llvm-svn: 350740
Eric Fiselier [Wed, 9 Jan 2019 16:34:17 +0000 (16:34 +0000)]
Mark two UDL tests as being unsupported with Clang 7
llvm-svn: 350739
Stefan Granitz [Wed, 9 Jan 2019 16:25:37 +0000 (16:25 +0000)]
[CMake] In standalone builds, LLVM_BINARY_DIR should point to LLVM's binary directory
Summary: In standalone builds `LLVM_BINARY_DIR` was equal to `LLDB_BINARY_DIR` so far. This is counterintuitive and invalidated the values of `LLDB_DEFAULT_TEST_DSYMUTIL/FILECHECK/COMPILER` etc.
Reviewers: zturner, labath, clayborg, JDevlieghere, stella.stamenova, serge-sans-paille
Reviewed By: labath
Subscribers: mgorny, friss, lldb-commits, #lldb
Differential Revision: https://reviews.llvm.org/D56443
llvm-svn: 350738
Stefan Granitz [Wed, 9 Jan 2019 16:25:31 +0000 (16:25 +0000)]
[CMake] Fix standalone builds: workaround the cxx target not getting imported yet (unlike clang target)
Summary: Handle standalone builds separately and print a warning if we have no libcxx.
Reviewers: aprantl, JDevlieghere
Reviewed By: JDevlieghere
Subscribers: mgorny, lldb-commits, #lldb
Differential Revision: https://reviews.llvm.org/D56399
llvm-svn: 350737
Louis Dionne [Wed, 9 Jan 2019 16:13:04 +0000 (16:13 +0000)]
[libcxx] Remove outdated XFAILs for aligned deallocation
AppleClang 10 has been fixed and so these tests don't fail anymore.
llvm-svn: 350736
Hubert Tong [Wed, 9 Jan 2019 16:00:39 +0000 (16:00 +0000)]
[unittests][Support] AIX: Skip sticky bit file tests
On AIX, attempting (without root) to set the sticky bit on a file with
the `chmod` utility will give:
```
chmod: not all requested changes were made to <file>
```
The same occurs when modifying other permission bits on a file with the
sticky bit already set.
It seems that the `chmod` function will report success despite failing
to set the sticky bit.
llvm-svn: 350735
Alexey Bataev [Wed, 9 Jan 2019 15:58:05 +0000 (15:58 +0000)]
Incorrect implicit data-sharing for nested tasks
Summary:
There is a minor issue in how the implicit data-sharings for nested tasks are computed.
For the following example:
```
int x;
#pragma omp task shared(x)
#pragma omp task
x++;
```
We compute an implicit data-sharing of shared for `x` in the second task although I think that it should be firstprivate. Below you can find the part of the OpenMP spec that covers this example:
- // In a task generating construct, if no default clause is present, a variable for which the data-sharing attribute is not determined by the rules above and that in the enclosing context is determined to be shared by all implicit tasks bound to the current team is shared.//
- //In a task generating construct, if no default clause is present, a variable for which the data-sharing attribute is not determined by the rules above is firstprivate.//
Since each implicit-task has its own copy of `x`, we shouldn't apply the first rule.
Reviewers: ABataev
Reviewed By: ABataev
Subscribers: cfe-commits, rogfer01
Tags: #openmp
Differential Revision: https://reviews.llvm.org/D56430
llvm-svn: 350734
Aleksandar Beserminji [Wed, 9 Jan 2019 15:58:02 +0000 (15:58 +0000)]
[mips][micrompis] Emit 16bit NOPs by default
Emit 16bit NOPs by default.
Use 32bit NOPs in delay slots where necessary.
Differential https://reviews.llvm.org/D55323
llvm-svn: 350733
Bruno Ricci [Wed, 9 Jan 2019 15:43:19 +0000 (15:43 +0000)]
[AST] Store the results in OverloadExpr in a trailing array
Use the newly available space in the bit-fields of Stmt to pack
OverloadExpr, UnresolvedLookupExpr and UnresolvedMemberExpr.
Additionally store the results in the overload set in a trailing array.
This saves 1 pointer + 8 bytes per UnresolvedLookupExpr and
UnresolvedMemberExpr.
Differential Revision: https://reviews.llvm.org/D56368
Reviewed By: rjmccall
llvm-svn: 350732
Alexey Bataev [Wed, 9 Jan 2019 15:41:44 +0000 (15:41 +0000)]
[DEBUGINFO][NVPTX]Make tests more strict, NFC.
NVPTX format requires that no labels/label arithmetics is used in the
debug info sections. To avoid possible problems with the adding/modifying the debug info functionality, made these tests more strict.
llvm-svn: 350731
Valery Pykhtin [Wed, 9 Jan 2019 15:21:53 +0000 (15:21 +0000)]
Revert "[AMDGPU] Fix DPP combiner"
This reverts commit
e3e2923a39cbec3b3bc3a7d3f0e9a77a4115080e, svn revision rL350721
llvm-svn: 350730
Kristof Beyls [Wed, 9 Jan 2019 15:13:34 +0000 (15:13 +0000)]
Initial AArch64 SLH implementation.
This is an initial implementation for Speculative Load Hardening for
AArch64. It builds on top of the recently introduced
AArch64SpeculationHardening pass.
This doesn't implement (yet) some of the optimizations implemented for
the X86SpeculativeLoadHardening pass. I thought introducing the
optimizations incrementally in follow-up patches should make this easier
to review.
Differential Revision: https://reviews.llvm.org/D55929
llvm-svn: 350729
George Rimar [Wed, 9 Jan 2019 15:06:57 +0000 (15:06 +0000)]
[LLD][ELF] - Fix BB after r350726.
D56123 changed the llvm-objdump output format.
Now we print the symbol address when dumping.
llvm-svn: 350728
Alexander Kornienko [Wed, 9 Jan 2019 15:00:06 +0000 (15:00 +0000)]
Remove dependency-related arguments in clang-check.
This is the default behavior of clang tools, but clang-check overrides default
argument adjusters for some reason.
llvm-svn: 350727
George Rimar [Wed, 9 Jan 2019 14:43:33 +0000 (14:43 +0000)]
[llvm-objdump] - Print symbol addressed when dumping disassembly output (-d)
When GNU objdump dumps the input with -d it prints the symbol addresses,
for example:
0000000000000031 <foo>:
31: 00 00 add %al,(%rax)
...
llvm-objdump currently does not do that.
Patch changes the behavior to match the GNU objdump.
That is useful for implementing -z/--disassemble-zeroes (D56083),
it allows omitting first zero bytes and keep the information
about the symbol address in the output.
Differential revision: https://reviews.llvm.org/D56123
llvm-svn: 350726
Nico Weber [Wed, 9 Jan 2019 14:20:20 +0000 (14:20 +0000)]
Fix typo in comment
llvm-svn: 350725
Nico Weber [Wed, 9 Jan 2019 14:19:16 +0000 (14:19 +0000)]
Fix typo in comment
llvm-svn: 350724
Louis Dionne [Wed, 9 Jan 2019 14:07:09 +0000 (14:07 +0000)]
[pstl] A fix of __pstl namespace usage for include/pstl/internal/glue_algorithm_defs.h
Reviewed as https://reviews.llvm.org/D55920
llvm-svn: 350723
Simon Pilgrim [Wed, 9 Jan 2019 13:46:14 +0000 (13:46 +0000)]
[X86][SSE] Cleanup shuffle combining test check prefixes
Share prefixes whenever possible, use X86 instead of X32.
llvm-svn: 350722
Valery Pykhtin [Wed, 9 Jan 2019 13:43:32 +0000 (13:43 +0000)]
[AMDGPU] Fix DPP combiner
Fixed issue with identity values and other cases, f32/f16 identity values to be added later. fma/mac instructions is disabled for now.
Test is fully reworked, added comments. Other fixes:
1. dpp move with uses and old reg initializer should be in the same BB.
2. bound_ctrl:0 is only considered when bank_mask and row_mask are fully enabled (0xF). Othervise the old register value is checked for identity.
3. Added add, subrev, and, or instructions to the old folding function.
4. Kill flag is cleared for the src0 (DPP register) as it may be copied into more than one user.
Differential revision: https://reviews.llvm.org/D55444
llvm-svn: 350721
Haojian Wu [Wed, 9 Jan 2019 13:42:03 +0000 (13:42 +0000)]
[clangd] Add a test for SignatureHelp on dynamic index.
Summary: This would catch regressions caused by future changes of the index.
Reviewers: ilya-biryukov
Subscribers: ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits
Differential Revision: https://reviews.llvm.org/D56483
llvm-svn: 350720
Florian Hahn [Wed, 9 Jan 2019 13:32:16 +0000 (13:32 +0000)]
Revert r350647: "[NewPM] Port tsan"
This patch breaks thread sanitizer on some macOS builders, e.g.
http://green.lab.llvm.org/green/job/clang-stage1-configure-RA/52725/
llvm-svn: 350719
Florian Hahn [Wed, 9 Jan 2019 13:30:47 +0000 (13:30 +0000)]
Revert r350648: "Fix clang for r350647: Missed a function rename"
The related commit r350647 breaks thread sanitizer on some macOS builders, e.g.
http://green.lab.llvm.org/green/job/clang-stage1-configure-RA/52725/
llvm-svn: 350718