Commit Graph

315103 Commits

Author SHA1 Message Date
Martin Storsjo da93dec330 [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
2019-04-26 19:31:39 +00:00
Alexey Bataev c03fe73176 [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
2019-04-26 19:30:34 +00:00
Alexey Bataev 5ddc6d180c [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
2019-04-26 19:28:37 +00:00
Julian Lettner 93c05f097a [Sanitizer][Windows] Speculative fix for broken build on Windows
llvm-svn: 359339
2019-04-26 19:06:55 +00:00
Shafik Yaghmour 16b90733c7 [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
2019-04-26 18:51:28 +00:00
Nick Desaulniers 7ab164c4a4 [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
2019-04-26 18:45:04 +00:00
Julian Lettner 74967cb4e0 [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
2019-04-26 18:39:02 +00:00
Julian Lettner d0e5830017 [Sanitizer] Fix compliation error in test
Remove obsolete assert. I missed this in my previous patch:
https://reviews.llvm.org/D61145

llvm-svn: 359335
2019-04-26 18:27:35 +00:00
Vitaly Buka 077c502ddc Implement __sanitizer::conditional<B, T, F>
llvm-svn: 359334
2019-04-26 18:22:55 +00:00
Vitaly Buka 85dcdae5e3 [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
2019-04-26 18:22:47 +00:00
Simon Pilgrim 27e01e675c [X86][AVX] Fold extract_subvector(broadcast(x)) -> broadcast(x) iff x has one use
llvm-svn: 359332
2019-04-26 18:02:14 +00:00
Jessica Paquette 67ab9eb193 [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
2019-04-26 18:00:01 +00:00
Jonas Devlieghere 8d1fb84327 [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
2019-04-26 17:58:19 +00:00
Nick Lewycky 1d30f0c93e Fix typo in documentation.
llvm-svn: 359329
2019-04-26 17:56:22 +00:00
Stanislav Mekhanoshin 61beff020e [AMDGPU] gfx1010 VOP3 and VOP3P implementation
Differential Revision: https://reviews.llvm.org/D61202

llvm-svn: 359328
2019-04-26 17:56:03 +00:00
Dan Liew 18bc872405 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
2019-04-26 17:53:25 +00:00
Simon Pilgrim ef54b1dddf [DAGCombine] Cleanup visitEXTRACT_SUBVECTOR. NFCI.
Use ArrayRef::slice, reduce some rather awkward long lines for legibility and run clang-format.

llvm-svn: 359326
2019-04-26 17:49:02 +00:00
Julian Lettner aebd3014a5 [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
2019-04-26 17:29:22 +00:00
Marshall Clow c29db2d83e 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
2019-04-26 17:10:03 +00:00
Vitaly Buka efc94feef9 [NFC] Remove ::kForTest from AP64, it does not use it.
llvm-svn: 359323
2019-04-26 17:04:05 +00:00
Dan Liew 60f5df948b [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
2019-04-26 16:54:09 +00:00
Nikita Popov c0fa4ec01d [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
2019-04-26 16:50:31 +00:00
Louis Dionne f30f261dc5 [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
2019-04-26 16:46:37 +00:00
Tatyana Krasnukha edebf12acf Replace local utility class OnExit with llvm::scope_exit (NFC)
llvm-svn: 359319
2019-04-26 16:41:04 +00:00
Craig Topper 354247c08d [X86] Sink NoRegister creation for unused Base/Index registers into getAddressOperands. NFCI
llvm-svn: 359318
2019-04-26 16:39:38 +00:00
Craig Topper ad662cf4c1 [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
2019-04-26 16:39:35 +00:00
Stanislav Mekhanoshin 8f3da70eed [AMDGPU] gfx1010 VOP2 changes
Differential Revision: https://reviews.llvm.org/D61156

llvm-svn: 359316
2019-04-26 16:37:51 +00:00
Fangrui Song 283bc74054 [llvm-nm] Revert inadvertently committed 'i' change in r359314
llvm-svn: 359315
2019-04-26 16:27:11 +00:00
Fangrui Song 5015aa854d [ThinLTO] Fix X86/strong_non_prevailing.ll after llvm-nm 'r' change
llvm-svn: 359314
2019-04-26 16:21:51 +00:00
Roland Froese 4b17772b9e [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
2019-04-26 16:14:17 +00:00
Fangrui Song 5f184f1780 [llvm-nm] Generalize symbol types 'N', 'n' and '?'
llvm-svn: 359312
2019-04-26 16:03:31 +00:00
Fangrui Song 0bf06a8f59 [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
2019-04-26 16:01:48 +00:00
Yonghong Song 51a4a0d68f [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
2019-04-26 15:35:51 +00:00
Don Hinton 6ee3fef9a4 [docs] Put DefaultOption bullet in alphabetical order.
llvm-svn: 359309
2019-04-26 15:22:21 +00:00
Fangrui Song 41327e3522 [llvm-nm][llvm-size] Use --double-dash options in tests
llvm-svn: 359308
2019-04-26 13:42:16 +00:00
Fangrui Song 3153764c88 s/Dwarf 5/DWARF v5/ NFC
llvm-svn: 359307
2019-04-26 13:41:19 +00:00
Sanjay Patel 8224bc081c [x86] add tests for fmin/fmax; NFC
'maximum' and 'minimum' still crash, so they are commented out.

llvm-svn: 359306
2019-04-26 13:36:37 +00:00
Dan Liew 9f59704a5d [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
2019-04-26 13:22:39 +00:00
Michal Gorny 2ff59e554b [lldb] [lit] Add register read tests for YMM registers (AVX)
Differential Revision: https://reviews.llvm.org/D61074

llvm-svn: 359304
2019-04-26 13:21:58 +00:00
Michal Gorny 9c3824aad7 [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
2019-04-26 13:21:46 +00:00
Alexandre Ganea 8245140d3f Fix llvm-objcopy/ELF/preserve-segment-contents test on UTF-8 locale
Differential Revision: https://reviews.llvm.org/D61137

llvm-svn: 359302
2019-04-26 13:09:26 +00:00
George Rimar 5fcdebe75f [yaml2obj] - Make implicitSectionNames() return std::vector<StringRef>. NFCI.
No need to use SmallVector of char* here.
This simplifies the code.

llvm-svn: 359301
2019-04-26 13:09:11 +00:00
George Rimar c1da14941f [yaml2obj] - Remove excessive variable. NFC.
`auto &Strtab` was used only once.

llvm-svn: 359300
2019-04-26 12:45:54 +00:00
Simon Pilgrim c3a34c3e07 Fix Wparentheses warning. NFCI.
llvm-svn: 359299
2019-04-26 12:23:42 +00:00
George Rimar fb7780a41f [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
2019-04-26 12:20:51 +00:00
George Rimar da1b3abad6 [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
2019-04-26 12:15:32 +00:00
Simon Pilgrim bb230c5e79 [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
2019-04-26 11:45:54 +00:00
Nico Weber ae73e1fcfb Minor formatting tweak, no behavior change
llvm-svn: 359295
2019-04-26 11:44:10 +00:00
Fangrui Song 50dcd8bf90 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
2019-04-26 10:56:10 +00:00
Simon Pilgrim 5d6ef94c36 [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
2019-04-26 10:49:13 +00:00