Fangrui Song [Sat, 27 Apr 2019 15:33:22 +0000 (15:33 +0000)]
[DJB] Fix variable case after D61178
llvm-svn: 359381
Fangrui Song [Sat, 27 Apr 2019 15:32:53 +0000 (15:32 +0000)]
[llvm-nm] Support section type 'u': STB_GNU_UNIQUE
llvm-svn: 359380
Simon Pilgrim [Sat, 27 Apr 2019 15:30:06 +0000 (15:30 +0000)]
[X86][SSE] Add initial test case for subvector insert/extract of illegal types
Suggested by @nikic on D59188
llvm-svn: 359379
Simon Pilgrim [Sat, 27 Apr 2019 13:35:32 +0000 (13:35 +0000)]
[X86][AVX] Merge mask select with shuffles across extract_subvector (PR40332)
Fixes PR40332 in the limited case where we're selecting between a target shuffle and a zero vector.
We can extend this in the future to handle more opcodes and non-zero selections.
llvm-svn: 359378
Andrea Di Biagio [Sat, 27 Apr 2019 11:59:11 +0000 (11:59 +0000)]
[MCA] Add field `IsEliminated` to class Instruction. NFCI
llvm-svn: 359377
Simon Atanasyan [Sat, 27 Apr 2019 09:28:54 +0000 (09:28 +0000)]
[cmake] Disable a GCC optimization when building LLVM for MIPS
GCC when compiling LLVM for MIPS can introduce a jump to an uninitialized
value when shrink wrapping is enabled. As shrink wrapping is enabled in
GCC at all optimization levels, it must be disabled. This bug exists for
all versions of GCC since 4.9.2.
This partially resolves PR37701 / GCC PR target/86069.
Patch by Simon Dardis.
Differential Revision: https://reviews.llvm.org/D48069
llvm-svn: 359376
Michal Gorny [Sat, 27 Apr 2019 07:43:29 +0000 (07:43 +0000)]
[lldb] [lit] Cleanly terminate Register tests
Continue the Register test processes, and let them terminate cleanly
rather than implicitly terminating them along with lldb.
llvm-svn: 359375
Vitaly Buka [Sat, 27 Apr 2019 06:30:52 +0000 (06:30 +0000)]
[sanitizer] Calculate SizeClassAllocator32::ByteMap type from Params::kSpaceSize and Params::kRegionSizeLog
Reviewers: eugenis
Subscribers: kubamracek, cryptoad, #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D61206
llvm-svn: 359374
Jonas Devlieghere [Sat, 27 Apr 2019 06:19:42 +0000 (06:19 +0000)]
[CommandObject] Use GetDebugger() helper method (NFC)
In r359354 a GetDebugger() method was added to the CommandObject class,
so that we didn't have to go through the command interpreter to obtain
the script interpreter. This patch simplifies other call sites where
m_interpreter.GetDebugger() was used, and replaces them with a shorter
call to the new method.
llvm-svn: 359373
Jonas Devlieghere [Sat, 27 Apr 2019 05:36:57 +0000 (05:36 +0000)]
[FormatEntity] Remove unused format type (NFC)
The FormatType enum and corresponding field are unused. This patch
removes the type, field and simplifies the macros that initialize them.
llvm-svn: 359372
Craig Topper [Sat, 27 Apr 2019 03:38:15 +0000 (03:38 +0000)]
[X86] Use MOVQ for i64 atomic_stores when SSE2 is enabled
Summary: If we have SSE2 we can use a MOVQ to store 64-bits and avoid falling back to a cmpxchg8b loop. If its a seq_cst store we need to insert an mfence after the store.
Reviewers: spatel, RKSimon, reames, jfb, efriedma
Reviewed By: RKSimon
Subscribers: hiraditya, dexonsmith, llvm-commits
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60546
llvm-svn: 359368
Richard Smith [Sat, 27 Apr 2019 02:58:17 +0000 (02:58 +0000)]
Reinstate r359059, reverted in r359361, with a fix to properly prevent
us emitting the operand of __builtin_constant_p if it has side-effects.
Original commit message:
Fix interactions between __builtin_constant_p and constexpr to match
current trunk GCC.
GCC permits information from outside the operand of
__builtin_constant_p (but in the same constant evaluation context) to be
used within that operand; clang now does so too. A few other minor
deviations from GCC's behavior showed up in my testing and are also
fixed (matching GCC):
* Clang now supports nullptr_t as the argument type for
__builtin_constant_p
* Clang now returns true from __builtin_constant_p if called with a
null pointer
* Clang now returns true from __builtin_constant_p if called with an
integer cast to pointer type
llvm-svn: 359367
Vitaly Buka [Sat, 27 Apr 2019 02:40:01 +0000 (02:40 +0000)]
[AArch64] Initialize HasMTE
llvm-svn: 359366
Vitaly Buka [Sat, 27 Apr 2019 02:13:26 +0000 (02:13 +0000)]
[sanitizer] NFC: add static_assert to confirm that we use reasonable ByteMap type
Summary: If bots work we can replace #ifs with template specialization by TwoLevelByteMapSize1.
There is known users of TwoLevelByteMap with TwoLevelByteMapSize1 equal 8,
and users of FlatByteMap with TwoLevelByteMapSize1 equal 2.
Reviewers: eugenis
Subscribers: kubamracek, #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D61200
llvm-svn: 359364
Mark Searles [Sat, 27 Apr 2019 00:51:18 +0000 (00:51 +0000)]
Revert "AMDGPU: Split block for si_end_cf"
This reverts commit
7a6ef3004655dd86d722199c471ae78c28e31bb4.
We discovered some internal test failures, so reverting for now.
Differential Revision: https://reviews.llvm.org/D61213
llvm-svn: 359363
Julian Lettner [Sat, 27 Apr 2019 00:49:14 +0000 (00:49 +0000)]
[NFC][Sanitizer] Remove GetRealFunctionAddress and replace usages
Reviewers: vitalybuka
Differential Revision: https://reviews.llvm.org/D61205
llvm-svn: 359362
Jorge Gorbe Moya [Sat, 27 Apr 2019 00:32:04 +0000 (00:32 +0000)]
Revert Fix interactions between __builtin_constant_p and constexpr to match current trunk GCC.
This reverts r359059 (git commit
0b098754b73f3b96d00ecb1c7605760b11c90298)
llvm-svn: 359361
Petr Hosek [Sat, 27 Apr 2019 00:25:13 +0000 (00:25 +0000)]
[Fuchsia] Support multilib for -fsanitize=address and -fno-exceptions
This introduces a support for multilibs to Fuchsia driver. Unlike the
existing multilibs that are used primarily for handling different
architecture variants, we use multilibs to handle different variants
of Clang runtime libraries: -fsanitize=address and -fno-exceptions
are the two we support initially. This replaces the existing support
for sanitized runtimes libraries that was only used by Fuchsia driver
and it also refactors some of the logic to allow sharing between GNU
and Fuchsia drivers.
Differential Revision: https://reviews.llvm.org/D61040
llvm-svn: 359360
Petr Hosek [Sat, 27 Apr 2019 00:25:11 +0000 (00:25 +0000)]
[Driver] Support priority for multilibs
When more than one multilib flag matches, try to select the best
possible match based on priority. When two different multilibs with
the same same priority match, we still throw an error matching the
existing behavior.
Differential Revision: https://reviews.llvm.org/D60990
llvm-svn: 359359
Stanislav Mekhanoshin [Fri, 26 Apr 2019 23:16:16 +0000 (23:16 +0000)]
[AMDGPU] gfx1010 VOPC implementation
Differential Revision: https://reviews.llvm.org/D61208
llvm-svn: 359358
Lang Hames [Fri, 26 Apr 2019 22:58:39 +0000 (22:58 +0000)]
[ORC] Add a 'plugin' interface to ObjectLinkingLayer for events/configuration.
ObjectLinkingLayer::Plugin provides event notifications when objects are loaded,
emitted, and removed. It also provides a modifyPassConfig callback that allows
plugins to modify the JITLink pass configuration.
This patch moves eh-frame registration into its own plugin, and teaches
llvm-jitlink to only add that plugin when performing execution runs on
non-Windows platforms. This should allow us to re-enable the test case that was
removed in r359198.
llvm-svn: 359357
Alex Lorenz [Fri, 26 Apr 2019 22:58:31 +0000 (22:58 +0000)]
[clang][driver] Weaken the test from 359353 to appease Windows bots
llvm-svn: 359356
Jonas Devlieghere [Fri, 26 Apr 2019 22:54:39 +0000 (22:54 +0000)]
[Driver] Remove unused functions (NFC)
Remove unused from the driver class. I noticed a bunch of small thing
while doing this that didn't warrant separate commits, so I've lumped
them together into this patch.
llvm-svn: 359355
Jonas Devlieghere [Fri, 26 Apr 2019 22:43:16 +0000 (22:43 +0000)]
[ScriptInterpreter] Move ownership into debugger (NFC)
This is part two of the change started in r359330. This patch moves the
ownership of the script interpreter from the command interpreter into
the debugger. I would've preferred to remove the lazy initialization,
however the fact that the scripting language is set after the debugger
is created makes that tricky. So for now this does exactly the same
thing as when it was under the command interpreter. The result is that
this patch is fully NFC.
Differential revision: https://reviews.llvm.org/D61211
llvm-svn: 359354
Alex Lorenz [Fri, 26 Apr 2019 22:40:47 +0000 (22:40 +0000)]
[driver][macOS] Link libarclite from the default toolchain when clang
is running in a toolchain outside of xcode
'libarclite' usually lives in the same toolchain as 'clang'. However, the
Swift open source toolchains for macOS distribute Clang without 'libarclite'.
In that case, to allow the linker to find 'libarclite', we point to the
'libarclite' that should be in the XcodeDefault toolchain instead. The
path to the toolchain is inferred from the SDK path if it's specified.
https://bugs.swift.org/browse/SR-9972
rdar://
49947573
llvm-svn: 359353
JF Bastien [Fri, 26 Apr 2019 22:29:49 +0000 (22:29 +0000)]
Revert "[sanitizer] NFC: add static_assert to confirm that we use optimal ByteMap type"
Fails on bots with:
/Users/buildslave/jenkins/workspace/clang-stage1-cmake-RA-expensive/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_allocator_primary32.h:69:3: error: static_assert failed due to requirement 'TwoLevelByteMapSize1 > 128' "TwoLevelByteMap should be used"
static_assert(TwoLevelByteMapSize1 > 128, "TwoLevelByteMap should be used");
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/buildslave/jenkins/workspace/clang-stage1-cmake-RA-expensive/llvm/projects/compiler-rt/lib/sanitizer_common/sanitizer_allocator_combined.h:29:34: note: in instantiation of template class '__sanitizer::SizeClassAllocator32<__sanitizer::AP32>' requested here
typename PrimaryAllocator::AddressSpaceView>::value,
^
http://green.lab.llvm.org/green/job/clang-stage1-cmake-RA-expensive/13960/console
llvm-svn: 359352
Jessica Paquette [Fri, 26 Apr 2019 21:53:13 +0000 (21:53 +0000)]
[GlobalISel][AArch64] Use getConstantVRegValWithLookThrough for extracts
getConstantVRegValWithLookThrough does the same thing as the
getConstantValueForReg function, and has more visibility across GISel. Plus, it
supports looking through G_TRUNC, G_SEXT, and G_ZEXT. So, we get better code
reuse and more functionality for free by using it.
Add some test cases to select-extract-vector-elt.mir to show that we can now
look through those instructions.
llvm-svn: 359351
Sylvestre Ledru [Fri, 26 Apr 2019 21:46:33 +0000 (21:46 +0000)]
Add to the release notes the fact that UninitializedObject checker is now
considered as stable
llvm-svn: 359350
Frederic Riss [Fri, 26 Apr 2019 21:16:15 +0000 (21:16 +0000)]
Pass explicit C++ version to test
stop-hook-threads.cpp uses C++11 features, so ask for C++11 explicitely.
This isn't broken on mainstream because clang defaults to a newer C++
version now, but it breaks if testing against an older compiler.
llvm-svn: 359349
Javed Absar [Fri, 26 Apr 2019 21:08:11 +0000 (21:08 +0000)]
[AArch64] Add support for MTE intrinsics
This provides intrinsics support for Memory Tagging Extension (MTE),
which was introduced with the Armv8.5-a architecture.
These intrinsics are available when __ARM_FEATURE_MEMORY_TAGGING is defined.
Each intrinsic is described in detail in the ACLE Q1 2019 documentation:
https://developer.arm.com/docs/101028/latest
Reviewed By: Tim Nortover, David Spickett
Differential Revision: https://reviews.llvm.org/D60485
llvm-svn: 359348
Frederic Riss [Fri, 26 Apr 2019 20:23:55 +0000 (20:23 +0000)]
TestZMMRegister: use an integer division as intended
llvm-svn: 359347
Jonas Devlieghere [Fri, 26 Apr 2019 20:03:22 +0000 (20:03 +0000)]
[CommandInterpreter] Remove scripting language argument. (NFC)
The script language argument was passed from the debugger to the command
interpreter, only to call SetScriptLanguage on the debugger again. It
wasn't even used to initialize the script interpreter, because that
would query the debugger again. This patch removes the needless back and
forth.
llvm-svn: 359346
Martin Storsjo [Fri, 26 Apr 2019 19:31:51 +0000 (19:31 +0000)]
[MinGW] Always emit local typeinfo
This makes sure that code built with headers for a statically linked
libc++ also works when linking to the DLL version, when the DLL
hasn't been built with --export-all-symbols.
This matches what GCC for MinGW does for this test case.
Differential Revision: https://reviews.llvm.org/D61177
llvm-svn: 359345
Michael Liao [Fri, 26 Apr 2019 19:31:48 +0000 (19:31 +0000)]
[HIP] Fix visibility of `__constant__` variables.
Summary:
- `__constant__` variables should not be `hidden` as the linker may turn
them into `LOCAL` symbols.
Reviewers: yaxunl
Subscribers: jvesely, nhaehnle, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D61194
llvm-svn: 359344
Martin Storsjo [Fri, 26 Apr 2019 19:31:46 +0000 (19:31 +0000)]
[MinGW] Do dllexport inline methods in template instantiation
Normally, in MinGW mode, inline methods aren't dllexported.
However, in the case of a dllimported template instantiation,
the inline methods aren't instantiated locally, but referenced
from the instantiation. Therefore, those methods also need to
be dllexported, in the case of an instantiation.
GCC suffers from the same issue, reported at [1], but the issue
is still unresolved there.
[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89088
Differential Revision: https://reviews.llvm.org/D61176
llvm-svn: 359343
Martin Storsjo [Fri, 26 Apr 2019 19:31:39 +0000 (19:31 +0000)]
[MinGW] Don't let template instantiation declarations cover nested classes
An explicit template instantiation declaration used to let
callers assume both outer and nested classes instantiations were
defined in a different translation unit.
If the instantiation is marked dllexport, only the outer class
is exported, but the caller will try to reference the instantiation
of both outer and inner classes.
This makes MinGW mode match both MSVC and Windows Itanium, by
having instantations only cover the outer class, and locally emitting
definitions of the nested classes. Windows Itanium was changed to
use this behavious in SVN r300804.
This deviates from what GCC does, but should be safe (and only
inflate the object file size a bit, but MSVC and Windows Itanium
modes do the same), and fixes cases where inner classes aren't
dllexported.
This fixes missing references in combination with dllexported/imported
template intantiations.
GCC suffers from the same issue, reported at [1], but the issue
is still unresolved there. The issue can probably be solved either
by making dllexport cover all nested classes as well, or this
way (matching MSVC).
[1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89087
Differential Revision: https://reviews.llvm.org/D61175
llvm-svn: 359342
Alexey Bataev [Fri, 26 Apr 2019 19:30:34 +0000 (19:30 +0000)]
[OPENMP][NVPTX]Correctly handle L2 parallelism in SPMD mode.
Summary:
The parallelLevel counter must be on per-thread basis to fully support
L2+ parallelism, otherwise we may end up with undefined behavior.
Introduce the parallelLevel on per-warp basis using shared memory. It
allows to avoid the problems with the synchronization and allows fully
support L2+ parallelism in SPMD mode with no runtime.
Reviewers: gtbercea, grokos
Subscribers: guansong, jdoerfert, caomhin, kkwli0, openmp-commits
Tags: #openmp
Differential Revision: https://reviews.llvm.org/D60918
llvm-svn: 359341
Alexey Bataev [Fri, 26 Apr 2019 19:28:37 +0000 (19:28 +0000)]
[OPENMP]Added check for non-random access types for the dependent loop
counters.
According to the OpenMP 5.0, For any associated loop where the b or lb
expression is not loop invariant with respect to the outermost loop, the
var-outer that appears in the expression may not have a random access
iterator type.
llvm-svn: 359340
Julian Lettner [Fri, 26 Apr 2019 19:06:55 +0000 (19:06 +0000)]
[Sanitizer][Windows] Speculative fix for broken build on Windows
llvm-svn: 359339
Shafik Yaghmour [Fri, 26 Apr 2019 18:51:28 +0000 (18:51 +0000)]
[ASTImporter] Copy Argument Passing Restrictions setting when importing a CXXRecordDecl definition
Summary:
For a CXXRecordDecl the RecordDeclBits are stored in the DeclContext. Currently when we import the definition of a CXXRecordDecl via the ASTImporter we do not copy over this data.
This change will add support for copying the ArgPassingRestrictions from RecordDeclBits to fix an LLDB expression parsing bug where we would set it to not pass in registers.
Note, we did not copy over any other of the RecordDeclBits since we don't have tests for those. We know that copying over LoadedFieldsFromExternalStorage would be a error and that may be the case for others as well.
The companion LLDB review: https://reviews.llvm.org/D61146
Differential Review: https://reviews.llvm.org/D61140
llvm-svn: 359338
Nick Desaulniers [Fri, 26 Apr 2019 18:45:04 +0000 (18:45 +0000)]
[AsmPrinter] refactor to support %c w/ GlobalAddress'
Summary:
Targets like ARM, MSP430, PPC, and SystemZ have complex behavior when
printing the address of a MachineOperand::MO_GlobalAddress. Move that
handling into a new overriden method in each base class. A virtual
method was added to the base class for handling the generic case.
Refactors a few subclasses to support the target independent %a, %c, and
%n.
The patch also contains small cleanups for AVRAsmPrinter and
SystemZAsmPrinter.
It seems that NVPTXTargetLowering is possibly missing some logic to
transform GlobalAddressSDNodes for
TargetLowering::LowerAsmOperandForConstraint to handle with "i" extended
inline assembly asm constraints.
Fixes:
- https://bugs.llvm.org/show_bug.cgi?id=41402
- https://github.com/ClangBuiltLinux/linux/issues/449
Reviewers: echristo, void
Reviewed By: void
Subscribers: void, craig.topper, jholewinski, dschuff, jyknight, dylanmckay, sdardis, nemanjai, javed.absar, sbc100, jgravelle-google, eraman, kristof.beyls, hiraditya, aheejin, kbarton, fedor.sergeev, jrtc27, atanasyan, jsji, llvm-commits, kees, tpimh, nathanchance, peter.smith, srhines
Tags: #llvm
Differential Revision: https://reviews.llvm.org/D60887
llvm-svn: 359337
Julian Lettner [Fri, 26 Apr 2019 18:39:02 +0000 (18:39 +0000)]
[Sanitizer] Fix test
I broke the build, panicked and applied the wrong fix in my previous
commit. The ASSERT was obsolete, but not the call INTERCEPT_FUNCTION.
llvm-svn: 359336
Julian Lettner [Fri, 26 Apr 2019 18:27:35 +0000 (18:27 +0000)]
[Sanitizer] Fix compliation error in test
Remove obsolete assert. I missed this in my previous patch:
https://reviews.llvm.org/D61145
llvm-svn: 359335
Vitaly Buka [Fri, 26 Apr 2019 18:22:55 +0000 (18:22 +0000)]
Implement __sanitizer::conditional<B, T, F>
llvm-svn: 359334
Vitaly Buka [Fri, 26 Apr 2019 18:22:47 +0000 (18:22 +0000)]
[sanitizer] NFC: add static_assert to confirm that we use optimal ByteMap type
Summary: If bots work we can replace #ifs with template specialization by TwoLevelByteMapSize1.
Reviewers: eugenis
Subscribers: kubamracek, #sanitizers, llvm-commits
Tags: #sanitizers, #llvm
Differential Revision: https://reviews.llvm.org/D61200
llvm-svn: 359333
Simon Pilgrim [Fri, 26 Apr 2019 18:02:14 +0000 (18:02 +0000)]
[X86][AVX] Fold extract_subvector(broadcast(x)) -> broadcast(x) iff x has one use
llvm-svn: 359332
Jessica Paquette [Fri, 26 Apr 2019 18:00:01 +0000 (18:00 +0000)]
[AArch64][GlobalISel] Select G_BSWAP for vectors of s32 and s64
There are instructions for these, so mark them as legal. Select the correct
instruction in AArch64InstructionSelector.cpp.
Update select-bswap.mir and arm64-rev.ll to reflect the changes.
llvm-svn: 359331
Jonas Devlieghere [Fri, 26 Apr 2019 17:58:19 +0000 (17:58 +0000)]
[ScriptInterpreter] Pass the debugger instead of the command interpreter
As discussed in D61090, there's no good reason for the script
interpreter to depend on the command interpreter. When looking at the
code, it becomes clear that we mostly use the command interpreter as a
way to access the debugger. Hence, it makes more sense to just pass that
to the script interpreter directly.
This is part 1 out of 2. I have another patch in the pipeline that
changes the ownership of the script interpreter to the debugger as well,
but I didn't get around to finish that today.
Differential revision: https://reviews.llvm.org/D61172
llvm-svn: 359330
Nick Lewycky [Fri, 26 Apr 2019 17:56:22 +0000 (17:56 +0000)]
Fix typo in documentation.
llvm-svn: 359329
Stanislav Mekhanoshin [Fri, 26 Apr 2019 17:56:03 +0000 (17:56 +0000)]
[AMDGPU] gfx1010 VOP3 and VOP3P implementation
Differential Revision: https://reviews.llvm.org/D61202
llvm-svn: 359328
Dan Liew [Fri, 26 Apr 2019 17:53:25 +0000 (17:53 +0000)]
Revert "[CMake] Fix the value of `config.target_cflags` for non-macOS Apple"
This reverts commit
1bcdbd68616dc7f8debe126caafef7a7242a0e6b.
It's been reported that some bots are failing with this change with CMake
error like:
```
CMake Error at /b/s/w/ir/k/llvm-project/compiler-rt/cmake/config-ix.cmake:177 (message):
Unsupported architecture: arm64
Call Stack (most recent call first):
/b/s/w/ir/k/llvm-project/compiler-rt/cmake/config-ix.cmake:216 (get_target_flags_for_arch)
/b/s/w/ir/k/llvm-project/compiler-rt/test/tsan/CMakeLists.txt:78 (get_test_cflags_for_apple_platform)
```
I'm reverting the patch now to unbreak builds. I will investigate properly when time permits.
rdar://problem/
50124489
llvm-svn: 359327
Simon Pilgrim [Fri, 26 Apr 2019 17:49:02 +0000 (17:49 +0000)]
[DAGCombine] Cleanup visitEXTRACT_SUBVECTOR. NFCI.
Use ArrayRef::slice, reduce some rather awkward long lines for legibility and run clang-format.
llvm-svn: 359326
Julian Lettner [Fri, 26 Apr 2019 17:29:22 +0000 (17:29 +0000)]
[NFC][Sanitizer] Change "return type" of INTERCEPT_FUNCTION to void
This temporary change tells us about all the places where the return
value of the INTERCEPT_FUNCTION macro is actually used. In the next
patch I will cleanup the macro and remove GetRealFuncAddress.
Reviewed By: vitalybuka
Differential Revision: https://reviews.llvm.org/D61145
llvm-svn: 359325
Marshall Clow [Fri, 26 Apr 2019 17:10:03 +0000 (17:10 +0000)]
Add '_LIBCPP_ASSERT(ready())' to several match_results method that have this precondtion. Fix several tests which did not honor this precondition. Thanks to Andrey Maksimov for pointing this out.
llvm-svn: 359324
Vitaly Buka [Fri, 26 Apr 2019 17:04:05 +0000 (17:04 +0000)]
[NFC] Remove ::kForTest from AP64, it does not use it.
llvm-svn: 359323
Dan Liew [Fri, 26 Apr 2019 16:54:09 +0000 (16:54 +0000)]
[asan_symbolize] Teach `asan_symbolize.py` to symbolicate using a module map
Summary:
The use case here is to be able get the UUIDs of the modules that need
to be symbolicated so that external plugins can see them. This
information can be extracted from ASan reports if the `print_module_map`
ASan option is enabled. Currently printing of the module map is only
implemented on Darwin and so this is effectively a Darwin only feature
right now.
The module map hooks into symbolization using the new plugin
infrastructure. A new hook in `AsanSymbolizerPlugInProxy` (and in
`AsanSymbolizerPlugIn`) is also provided to allow external plugins to hook
into the module look up process. This will allow external plugins to
look up modules with knowledge of their UUID.
The new plug-in is currently stored in the `asan_symbolize.py` script.
We could potentially move this into a separate file in the future (to
reduce clutter) if we can come up with a policy for where to search for
plugins that should always get loaded.
rdar://problem/
49476995
Reviewers: kubamracek, yln, samsonov, dvyukov, vitalybuka
Subscribers: #sanitizers, llvm-commits
Tags: #llvm, #sanitizers
Differential Revision: https://reviews.llvm.org/D60531
llvm-svn: 359322
Nikita Popov [Fri, 26 Apr 2019 16:50:31 +0000 (16:50 +0000)]
[ConstantRange] Add abs() support
Add support for abs() to ConstantRange. This will allow to handle
SPF_ABS select flavor in LVI and will also come in handy as a
primitive for the srem implementation.
The implementation is slightly tricky, because a) abs of signed min
is signed min and b) sign-wrapped ranges may have an abs() that is
smaller than a full range, so we need to explicitly handle them.
Differential Revision: https://reviews.llvm.org/D61084
llvm-svn: 359321
Louis Dionne [Fri, 26 Apr 2019 16:46:37 +0000 (16:46 +0000)]
[libc++] Relax libc++-only test on regex_constants
The standard requires the following for the std::regex_constants::error_type
values: "The type error_type is an implementation-defined enumerated type."
The values of this enumerated type are not required to be non-zero.
This patch makes such checks in tests libc++-specific to let the tests
pass for other conforming implementations.
Thanks to Andrey Maksimov for the patch.
Differential Revision: https://reviews.llvm.org/D61195
llvm-svn: 359320
Tatyana Krasnukha [Fri, 26 Apr 2019 16:41:04 +0000 (16:41 +0000)]
Replace local utility class OnExit with llvm::scope_exit (NFC)
llvm-svn: 359319
Craig Topper [Fri, 26 Apr 2019 16:39:38 +0000 (16:39 +0000)]
[X86] Sink NoRegister creation for unused Base/Index registers into getAddressOperands. NFCI
llvm-svn: 359318
Craig Topper [Fri, 26 Apr 2019 16:39:35 +0000 (16:39 +0000)]
[X86] Segment registers should have i16 type not i32.
Probably doesn't really matter, but was inconsistent with the rest of the code.
llvm-svn: 359317
Stanislav Mekhanoshin [Fri, 26 Apr 2019 16:37:51 +0000 (16:37 +0000)]
[AMDGPU] gfx1010 VOP2 changes
Differential Revision: https://reviews.llvm.org/D61156
llvm-svn: 359316
Fangrui Song [Fri, 26 Apr 2019 16:27:11 +0000 (16:27 +0000)]
[llvm-nm] Revert inadvertently committed 'i' change in r359314
llvm-svn: 359315
Fangrui Song [Fri, 26 Apr 2019 16:21:51 +0000 (16:21 +0000)]
[ThinLTO] Fix X86/strong_non_prevailing.ll after llvm-nm 'r' change
llvm-svn: 359314
Roland Froese [Fri, 26 Apr 2019 16:14:17 +0000 (16:14 +0000)]
[PowerPC] Update P9 vector costs for insert/extract element
The PPC vector cost model values for insert/extract element reflect older
processors that lacked vector insert/extract and move-to/move-from VSR
instructions. Update getVectorInstrCost to give appropriate values for when
the newer instructions are present.
Differential Revision: https://reviews.llvm.org/D60160
llvm-svn: 359313
Fangrui Song [Fri, 26 Apr 2019 16:03:31 +0000 (16:03 +0000)]
[llvm-nm] Generalize symbol types 'N', 'n' and '?'
llvm-svn: 359312
Fangrui Song [Fri, 26 Apr 2019 16:01:48 +0000 (16:01 +0000)]
[llvm-nm] Fix handling of symbol types 't' 'd' 'r'
In addition, fix and convert the two tests to yaml2obj based. This
allows us to delete two executables.
X86/weak.test: 'v' was not tested
X86/init-fini.test: symbol types of __bss_start _edata _end were wrong
GNU nm reports __init_array_start as 't', and __preinit_array_start as 'd'.
__init_array_start is 't' just because its section ".init_array" starts with ".init"
'd' makes more sense and allows us to drop the weird SHT_INIT_ARRAY rule.
So, change __init_array_start to 'd' instead.
llvm-svn: 359311
Yonghong Song [Fri, 26 Apr 2019 15:35:51 +0000 (15:35 +0000)]
[BPF] do not generate predefined macro bpf
"DefineStd(Builder, "bpf", Opts)" generates the following three
macros:
bpf
__bpf
__bpf__
and the macro "bpf" is due to the fact that the target language
is C which allows GNU extensions.
The name "bpf" could be easily used as variable name or type
field name. For example, in current linux kernel, there are
four places where bpf is used as a field name. If the corresponding
types are included in bpf program, the compilation error will
occur.
This patch removed predefined macro "bpf" as well as "__bpf" which
is rarely used if used at all.
Signed-off-by: Yonghong Song <yhs@fb.com>
Differential Revision: https://reviews.llvm.org/D61173
llvm-svn: 359310
Don Hinton [Fri, 26 Apr 2019 15:22:21 +0000 (15:22 +0000)]
[docs] Put DefaultOption bullet in alphabetical order.
llvm-svn: 359309
Fangrui Song [Fri, 26 Apr 2019 13:42:16 +0000 (13:42 +0000)]
[llvm-nm][llvm-size] Use --double-dash options in tests
llvm-svn: 359308
Fangrui Song [Fri, 26 Apr 2019 13:41:19 +0000 (13:41 +0000)]
s/Dwarf 5/DWARF v5/ NFC
llvm-svn: 359307
Sanjay Patel [Fri, 26 Apr 2019 13:36:37 +0000 (13:36 +0000)]
[x86] add tests for fmin/fmax; NFC
'maximum' and 'minimum' still crash, so they are commented out.
llvm-svn: 359306
Dan Liew [Fri, 26 Apr 2019 13:22:39 +0000 (13:22 +0000)]
[CMake] Fix the value of `config.target_cflags` for non-macOS Apple
platforms.
The main problem here is that `-*-version_min=` was not being passed to
the compiler when building test cases. This can cause problems when
testing on devices running older OSs because Clang would previously
assume the minimum deployment target is the the latest OS in the SDK
which could be much newer than what the device is running.
Previously the generated value looked like this:
`-arch arm64 -isysroot
<path_to_xcode>/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk`
With this change it now looks like:
`-arch arm64 -stdlib=libc++ -miphoneos-version-min=8.0 -isysroot
<path_to_xcode>/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS12.1.sdk`
This mirrors the setting of `config.target_cflags` on macOS.
This change is made for ASan, LibFuzzer, TSan, and UBSan.
To implement this a new `get_test_cflags_for_apple_platform()` function
has been added that when given an Apple platform name and architecture
returns a string containing the C compiler flags to use when building
tests. This also calls a new helper function `is_valid_apple_platform()`
that validates Apple platform names.
rdar://problem/
50124489
Differential Revision: https://reviews.llvm.org/D58578
llvm-svn: 359305
Michal Gorny [Fri, 26 Apr 2019 13:21:58 +0000 (13:21 +0000)]
[lldb] [lit] Add register read tests for YMM registers (AVX)
Differential Revision: https://reviews.llvm.org/D61074
llvm-svn: 359304
Michal Gorny [Fri, 26 Apr 2019 13:21:46 +0000 (13:21 +0000)]
[lldb] [lit] Add feature flags for native CPU features
Add a new lit-cpuid tool that detects CPU features used by some of
the tests, and use it to populate available_features in lit. For now,
this means that the test for MM/XMM register read will be run only
when the host CPU support SSE instruction set. However, this is going
to make it possible to introduce additional tests relying on AVX.
Differential Revision: https://reviews.llvm.org/D61073
llvm-svn: 359303
Alexandre Ganea [Fri, 26 Apr 2019 13:09:26 +0000 (13:09 +0000)]
Fix llvm-objcopy/ELF/preserve-segment-contents test on UTF-8 locale
Differential Revision: https://reviews.llvm.org/D61137
llvm-svn: 359302
George Rimar [Fri, 26 Apr 2019 13:09:11 +0000 (13:09 +0000)]
[yaml2obj] - Make implicitSectionNames() return std::vector<StringRef>. NFCI.
No need to use SmallVector of char* here.
This simplifies the code.
llvm-svn: 359301
George Rimar [Fri, 26 Apr 2019 12:45:54 +0000 (12:45 +0000)]
[yaml2obj] - Remove excessive variable. NFC.
`auto &Strtab` was used only once.
llvm-svn: 359300
Simon Pilgrim [Fri, 26 Apr 2019 12:23:42 +0000 (12:23 +0000)]
Fix Wparentheses warning. NFCI.
llvm-svn: 359299
George Rimar [Fri, 26 Apr 2019 12:20:51 +0000 (12:20 +0000)]
[yaml2obj] - Make the code to match the LLVM style. NFCI.
This renames the variables to uppercase and
removes use of `auto` for unobvious type.
llvm-svn: 359298
George Rimar [Fri, 26 Apr 2019 12:15:32 +0000 (12:15 +0000)]
[yaml2elf] - Cleanup the initSectionHeaders(). NFCI.
This encapsulates the section specific code inside the
corresponding writeSectionContent methods.
Making the code a bit more consistent.
llvm-svn: 359297
Simon Pilgrim [Fri, 26 Apr 2019 11:45:54 +0000 (11:45 +0000)]
[X86][SSE] Pull out OR(EXTRACTELT(X,0),OR(EXTRACTELT(X,1),...)) matching code from LowerVectorAllZeroTest
Create a matchBitOpReduction helper that checks for the pattern with any opcode.
First step towards reusing this code to recognize other scalar reduction patterns.
llvm-svn: 359296
Nico Weber [Fri, 26 Apr 2019 11:44:10 +0000 (11:44 +0000)]
Minor formatting tweak, no behavior change
llvm-svn: 359295
Fangrui Song [Fri, 26 Apr 2019 10:56:10 +0000 (10:56 +0000)]
caseFoldingDjbHash: simplify and make the US-ASCII fast path faster
The slow path (with at least one non US-ASCII) will be slower but that
doesn't matter.
Differential Revision: https://reviews.llvm.org/D61178
llvm-svn: 359294
Simon Pilgrim [Fri, 26 Apr 2019 10:49:13 +0000 (10:49 +0000)]
[X86][SSE] Disable shouldFoldConstantShiftPairToMask for btver1/btver2 targets (PR40758)
As detailed on PR40758, Bobcat/Jaguar can perform vector immediate shifts on the same pipes as vector ANDs with the same latency - so it doesn't make sense to replace a shl+lshr with a shift+and pair as it requires an additional mask (with the extra constant pool, loading and register pressure costs).
Differential Revision: https://reviews.llvm.org/D61068
llvm-svn: 359293
Simon Pilgrim [Fri, 26 Apr 2019 09:56:14 +0000 (09:56 +0000)]
[X86][AVX] Combine shuffles extracted from a common vector
A small step towards combining shuffles across vector sizes - this recognizes when a shuffle's operands are all extracted from the same larger source and tries to combine to an unary shuffle of that source instead. Fixes one of the test cases from PR34380.
Differential Revision: https://reviews.llvm.org/D60512
llvm-svn: 359292
Ilya Biryukov [Fri, 26 Apr 2019 09:36:22 +0000 (09:36 +0000)]
[clangd] Remove unused ClangdServer::dynamicIndex(). NFC
llvm-svn: 359291
Sven van Haastregt [Fri, 26 Apr 2019 09:21:25 +0000 (09:21 +0000)]
[InferAddressSpaces] Add AS parameter to the pass factory
This enables the pass to be used in the absence of
TargetTransformInfo. When the argument isn't passed, the factory
defaults to UninitializedAddressSpace and the flat address space is
obtained from the TargetTransformInfo as before this change. Existing
users won't have to change.
Patch by Kevin Petit.
Differential Revision: https://reviews.llvm.org/D60602
llvm-svn: 359290
Sam McCall [Fri, 26 Apr 2019 09:20:36 +0000 (09:20 +0000)]
filecheck etc are not clangd-specific deps. NFC
llvm-svn: 359289
Pavel Labath [Fri, 26 Apr 2019 08:52:04 +0000 (08:52 +0000)]
PostfixExpression: move DWARF generator out of NativePDB internals
Summary:
The new dwarf generator is pretty much a verbatim copy of the one in
PDB.
In order to write a pdb-independent test for it, I needed to write a
dummy "symbol resolver", which (together with the fact that I'll need
one more for breakpad-specific resolution logic) prompted me to create a
more simple interface for algorithms which replace or "resolve"
SymbolNodes. The resolving algorithms in NativePDB have been updated to
make use of that too.
I have removed a couple of NativePDB tests which weren't testing
anything pdb-specific and where the tested functionality was covered by
the new format-agnostic tests I have added.
Reviewers: amccarth, clayborg, aleksandr.urakov
Subscribers: aprantl, markmentovai, lldb-commits, jasonmolenda, JDevlieghere
Differential Revision: https://reviews.llvm.org/D61056
llvm-svn: 359288
Hans Wennborg [Fri, 26 Apr 2019 08:31:00 +0000 (08:31 +0000)]
Fix alignment in AArch64InstructionSelector::emitConstantPoolEntry()
The code was using the alignment of a pointer to the value, not the
alignment of the constant itself.
Maybe we got away with it so far because the pointer alignment is
fairly high, but we did end up under-aligning <16 x i8> vectors,
which was caught in the Chromium build after lld stopped over-aligning
the .rodata.cst16 section in r356428. (See crbug.com/953815)
Differential revision: https://reviews.llvm.org/D61124
llvm-svn: 359287
Vitaly Buka [Fri, 26 Apr 2019 08:24:38 +0000 (08:24 +0000)]
[lsan] Use SANITIZER_WORDSIZE when selecting ByteMap
Originally this code was added for 64-bit platform and it was never update.
Add static_assert to validate type of ByteMap.
llvm-svn: 359286
Martin Storsjo [Fri, 26 Apr 2019 08:09:51 +0000 (08:09 +0000)]
[MinGW] Fix dllexport of explicit template instantiation
Contrary to MSVC, GCC/MinGW needs to have the dllexport attribute
on the template instantiation declaration, not on the definition.
Previously clang never marked explicit template instantiations as
dllexport in MinGW mode, if the instantiation had a previous
declaration, regardless of where the attribute was placed. This
makes Clang behave like GCC in this regard, and allows using the
same attribute form for both MinGW compilers.
This fixes PR40256.
Differential Revision: https://reviews.llvm.org/D61118
llvm-svn: 359285
Sam McCall [Fri, 26 Apr 2019 07:45:49 +0000 (07:45 +0000)]
[clangd] Query index in code completion no-compile mode.
Summary: We scrape the enclosing scopes from the source file, and use them in the query.
Reviewers: kadircet
Subscribers: ilya-biryukov, MaskRay, jkorous, mgrang, arphaman, cfe-commits
Tags: #clang
Differential Revision: https://reviews.llvm.org/D61077
llvm-svn: 359284
Adam Balogh [Fri, 26 Apr 2019 07:30:07 +0000 (07:30 +0000)]
[Analyzer] Iterator Checkers - Do an early return after handling calls
This patch is more of a fix than a real improvement: in checkPostCall()
we should return immediately after finding the right call and handling
it. This both saves unnecessary processing and double-handling calls by
mistake.
Differential Revision: https://reviews.llvm.org/D61134
llvm-svn: 359283
Marcello Maggioni [Fri, 26 Apr 2019 07:21:56 +0000 (07:21 +0000)]
[GlobalISel] Fix inserting copies in the right position for reg definitions
When constrainRegClass is called if the constraining happens on a use the COPY
needs to be inserted before the instruction that contains the MachineOperand,
but if we are constraining a definition it actually needs to be added
after the instruction. In addition, the COPY needs to have its operands
flipped (in the use case we are copying from the old unconstrained register
to the new constrained register, while in the definition case we are copying
from the new constrained register that the instruction defines to the old
unconstrained register).
llvm-svn: 359282
Raphael Isemann [Fri, 26 Apr 2019 07:21:36 +0000 (07:21 +0000)]
Allow direct comparison of ConstString against StringRef
Summary:
When we want to compare a ConstString against a string literal (or any other non-ConstString),
we currently have to explicitly turn the other string into a ConstString. This makes sense as
comparing ConstStrings against each other is only a fast pointer comparison.
However, currently we (rather incorrectly) use in several places in LLDB temporary ConstStrings when
we just want to compare a given ConstString against a hardcoded value, for example like this:
```
if (extension != ConstString(".oat") && extension != ConstString(".odex"))
```
Obviously this kind of defeats the point of ConstStrings. In the comparison above we would
construct two temporary ConstStrings every time we hit the given code. Constructing a
ConstString is relatively expensive: we need to go to the StringPool, take a read and possibly
an exclusive write-lock and then look up our temporary string in the string map of the pool.
So we do a lot of heavy work for essentially just comparing a <6 characters in two strings.
I initially wanted to just fix these issues by turning the temporary ConstString in static variables/
members, but that made the code much less readable. Instead I propose to add a new overload
for the ConstString comparison operator that takes a StringRef. This comparison operator directly
compares the ConstString content against the given StringRef without turning the StringRef into
a ConstString.
This means that the example above can look like this now:
```
if (extension != ".oat" && extension != ".odex")
```
It also no longer has to unlock/lock two locks and call multiple functions in other TUs for constructing
the temporary ConstString instances. Instead this should end up just being a direct string comparison
of the two given strings on most compilers.
This patch also directly updates all uses of temporary and short ConstStrings in LLDB to use this new
comparison operator. It also adds a some unit tests for the new and old comparison operator.
Reviewers: #lldb, JDevlieghere, espindola, amccarth
Reviewed By: JDevlieghere, amccarth
Subscribers: amccarth, clayborg, JDevlieghere, emaste, arichardson, MaskRay, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D60667
llvm-svn: 359281
Owen Pan [Fri, 26 Apr 2019 07:05:47 +0000 (07:05 +0000)]
[clang-format] Fix documentation for FixNamespaceComments
Fixes PR40409
Differential Revision: https://reviews.llvm.org/D61174
llvm-svn: 359280
George Rimar [Fri, 26 Apr 2019 06:59:30 +0000 (06:59 +0000)]
[LLD][ELF] - Do not remove empty sections referenced in LOADADDR/ADDR commands.
This is https://bugs.llvm.org//show_bug.cgi?id=38750.
If script references empty sections in LOADADDR/ADDR commands
.empty : { *(.empty ) }
.text : AT(LOADADDR (.empty) + SIZEOF (.empty)) { *(.text) }
then an empty section will be removed and LOADADDR/ADDR will evaluate to null.
It is not that user may expect from using of the generic script, what is a common case.
Differential revision: https://reviews.llvm.org/D54621
llvm-svn: 359279
Fangrui Song [Fri, 26 Apr 2019 05:56:23 +0000 (05:56 +0000)]
Fix typos: (re)?sor?uce -> (re)?source
Closes: https://github.com/llvm/llvm-project/pull/10
In-collaboration-with: Olivier Cochard-Labbé <olivier@FreeBSD.org>
Signed-off-by: Enji Cooper <yaneurabeya@gmail.com>
Differential Revision: https://reviews.llvm.org/D61021
llvm-svn: 359277