platform/upstream/llvm.git
5 years ago[x86] add tests for fmin/fmax; NFC
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

5 years ago[CMake] Fix the value of `config.target_cflags` for non-macOS Apple
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

5 years ago[lldb] [lit] Add register read tests for YMM registers (AVX)
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

5 years ago[lldb] [lit] Add feature flags for native CPU features
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

5 years agoFix llvm-objcopy/ELF/preserve-segment-contents test on UTF-8 locale
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

5 years ago[yaml2obj] - Make implicitSectionNames() return std::vector<StringRef>. NFCI.
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

5 years ago[yaml2obj] - Remove excessive variable. NFC.
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

5 years agoFix Wparentheses warning. NFCI.
Simon Pilgrim [Fri, 26 Apr 2019 12:23:42 +0000 (12:23 +0000)]
Fix Wparentheses warning. NFCI.

llvm-svn: 359299

5 years ago[yaml2obj] - Make the code to match the LLVM style. NFCI.
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

5 years ago[yaml2elf] - Cleanup the initSectionHeaders(). NFCI.
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

5 years ago[X86][SSE] Pull out OR(EXTRACTELT(X,0),OR(EXTRACTELT(X,1),...)) matching code from...
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

5 years agoMinor formatting tweak, no behavior change
Nico Weber [Fri, 26 Apr 2019 11:44:10 +0000 (11:44 +0000)]
Minor formatting tweak, no behavior change

llvm-svn: 359295

5 years agocaseFoldingDjbHash: simplify and make the US-ASCII fast path faster
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

5 years ago[X86][SSE] Disable shouldFoldConstantShiftPairToMask for btver1/btver2 targets (PR40758)
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

5 years ago[X86][AVX] Combine shuffles extracted from a common vector
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

5 years ago[clangd] Remove unused ClangdServer::dynamicIndex(). NFC
Ilya Biryukov [Fri, 26 Apr 2019 09:36:22 +0000 (09:36 +0000)]
[clangd] Remove unused ClangdServer::dynamicIndex(). NFC

llvm-svn: 359291

5 years ago[InferAddressSpaces] Add AS parameter to the pass factory
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

5 years agofilecheck etc are not clangd-specific deps. NFC
Sam McCall [Fri, 26 Apr 2019 09:20:36 +0000 (09:20 +0000)]
filecheck etc are not clangd-specific deps. NFC

llvm-svn: 359289

5 years agoPostfixExpression: move DWARF generator out of NativePDB internals
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

5 years agoFix alignment in AArch64InstructionSelector::emitConstantPoolEntry()
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

5 years ago[lsan] Use SANITIZER_WORDSIZE when selecting ByteMap
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

5 years ago[MinGW] Fix dllexport of explicit template instantiation
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

5 years ago[clangd] Query index in code completion no-compile mode.
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

5 years ago[Analyzer] Iterator Checkers - Do an early return after handling calls
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

5 years ago[GlobalISel] Fix inserting copies in the right position for reg definitions
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

5 years agoAllow direct comparison of ConstString against StringRef
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

5 years ago[clang-format] Fix documentation for FixNamespaceComments
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

5 years ago[LLD][ELF] - Do not remove empty sections referenced in LOADADDR/ADDR commands.
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

5 years agoFix typos: (re)?sor?uce -> (re)?source
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

5 years agoRevert "[lsan] Use SANITIZER_WORDSIZE when selecting ByteMap"
Vitaly Buka [Fri, 26 Apr 2019 05:19:32 +0000 (05:19 +0000)]
Revert "[lsan] Use SANITIZER_WORDSIZE when selecting ByteMap"

New static_assert fails on a bot.

This reverts commit r359269.

llvm-svn: 359276

5 years agoFix r359229 which tried to fix r359159...
Chandler Carruth [Fri, 26 Apr 2019 05:04:33 +0000 (05:04 +0000)]
Fix r359229 which tried to fix r359159...

When r359229 added noexcept to the declaration of `~mutex`, it didn't
add it to the definition which caused -Wimplicit-exception-spec-mismatch
to fire. This just adapts the definition to agree with the declaration.

llvm-svn: 359275

5 years agoNFC: Clang-format msan_allocator.cc
Vitaly Buka [Fri, 26 Apr 2019 04:22:28 +0000 (04:22 +0000)]
NFC: Clang-format msan_allocator.cc

llvm-svn: 359270

5 years ago[lsan] Use SANITIZER_WORDSIZE when selecting ByteMap
Vitaly Buka [Fri, 26 Apr 2019 04:20:27 +0000 (04:20 +0000)]
[lsan] Use SANITIZER_WORDSIZE when selecting ByteMap

Originally this code as added for 64-bit platform and was never changed.
Add static_assert to make sure that we have correct map on all platforms.

llvm-svn: 359269

5 years ago[ELF] Change std::max<uint64_t> to uint32_t for section alignment
Fangrui Song [Fri, 26 Apr 2019 04:07:58 +0000 (04:07 +0000)]
[ELF] Change std::max<uint64_t> to uint32_t for section alignment

Summary:
We use `uint32_t SectionBase::Alignment` and `uint32_t
PhdrEntry::p_align` despite alignments being 64 bits in ELF64.
Fix the std::max template arguments accordingly.

The currently 160-byte InputSection will become 168 bytes if we make SectionBase::Alignment uint64_t.

Differential Revision: https://reviews.llvm.org/D61171

llvm-svn: 359268

5 years ago[NFC] Add baseline tests for int isKnownNonZero
Dan Robertson [Fri, 26 Apr 2019 02:55:54 +0000 (02:55 +0000)]
[NFC] Add baseline tests for int isKnownNonZero

Add baseline tests for improvements of isKnownNonZero for integer types.

Differential Revision: https://reviews.llvm.org/D60932

llvm-svn: 359267

5 years agoPR41607: Don't forget to substitute outer template arguments into a
Richard Smith [Fri, 26 Apr 2019 02:11:23 +0000 (02:11 +0000)]
PR41607: Don't forget to substitute outer template arguments into a
class-scope explicit specialization of a class template.

llvm-svn: 359266

5 years ago[llvm-objcopy] Accept --long-option but not -long-option
Fangrui Song [Fri, 26 Apr 2019 02:10:10 +0000 (02:10 +0000)]
[llvm-objcopy] Accept --long-option but not -long-option

Summary:

llvm-{objcopy,strip} (and many other LLVM binary utilities) accept
cl::opt style -long-option as well as many short options (e.g. -p -S
-x). People who use them as replacement of GNU binutils often use the
grouped option syntax (POSIX Utility Conventions), e.g. -Sx => -S -x,
-Wd => -W -d, -sj.text => -s -j.text

There is ambiguity if a long option starts with the character used by a
short option. Drop the support for -long-option to resolve the ambiguity.

This divergence from other utilities is accepted (other utilities
continue supporting -long-option).
https://lists.llvm.org/pipermail/llvm-dev/2019-April/131786.html

Reviewers: alexshap, jakehehrlich, jhenderson, rupprecht, espindola

Reviewed By: jakehehrlich, jhenderson, rupprecht

Subscribers: grimar, emaste, arichardson, llvm-commits

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D60439

llvm-svn: 359265

5 years ago[analyzer] RetainCount: Add a suppression for "the Matching rule".
Artem Dergachev [Fri, 26 Apr 2019 02:05:18 +0000 (02:05 +0000)]
[analyzer] RetainCount: Add a suppression for "the Matching rule".

In the OSObject universe there appears to be another slightly popular contract,
apart from "create" and "get", which is "matching". It optionally consumes
a "table" parameter and if a table is passed, it fills in the table and
returns it at +0; otherwise, it creates a new table, fills it in and
returns it at +1.

For now suppress false positives by doing a conservative escape on all functions
that end with "Matching", which is the naming convention that seems to be
followed by all such methods.

Differential Revision: https://reviews.llvm.org/D61161

llvm-svn: 359264

5 years ago[analyzer] RetainCount: Allow offsets in return values.
Artem Dergachev [Fri, 26 Apr 2019 02:05:15 +0000 (02:05 +0000)]
[analyzer] RetainCount: Allow offsets in return values.

Because RetainCountChecker has custom "local" reasoning about escapes,
it has a separate facility to deal with tracked symbols at end of analysis
and check them for leaks regardless of whether they're dead or not.
This facility iterates over the list of tracked symbols and reports
them as leaks, but it needs to treat the return value specially.

Some custom allocators tend to return the value with an offset, storing
extra metadata at the beginning of the buffer. In this case the return value
would be a non-base region. In order to avoid false positives, we still need to
find the original symbol within the return value, otherwise it'll be unable
to match it to the item in the list of tracked symbols.

Differential Revision: https://reviews.llvm.org/D60991

llvm-svn: 359263

5 years ago[analyzer] Fix crash when returning C++ objects from ObjC messages-to-nil.
Artem Dergachev [Fri, 26 Apr 2019 02:05:12 +0000 (02:05 +0000)]
[analyzer] Fix crash when returning C++ objects from ObjC messages-to-nil.

the assertion is in fact incorrect: there is a cornercase in Objective-C++
in which a C++ object is not constructed with a constructor, but merely
zero-initialized. Namely, this happens when an Objective-C message is sent
to a nil and it is supposed to return a C++ object.

Differential Revision: https://reviews.llvm.org/D60988

llvm-svn: 359262

5 years ago[www] Rebuild cxx_dr_status.
Richard Smith [Fri, 26 Apr 2019 01:51:08 +0000 (01:51 +0000)]
[www] Rebuild cxx_dr_status.

llvm-svn: 359261

5 years agoC++ DR2387: a variable template declared wtih (or instantiated with) a
Richard Smith [Fri, 26 Apr 2019 01:51:08 +0000 (01:51 +0000)]
C++ DR2387: a variable template declared wtih (or instantiated with) a
const-qualified type is not implicitly given internal linkage. But a
variable template declared 'static' is.

This reinstates part of r359048, reverted in r359076.

llvm-svn: 359260

5 years agoAdd missing diagnostic for explicit instantiation declarations naming
Richard Smith [Fri, 26 Apr 2019 01:51:07 +0000 (01:51 +0000)]
Add missing diagnostic for explicit instantiation declarations naming
internal linkage entities.

Such constructs are ill-formed by [temp.explicit]p13. We make a special
exception to permit an invalid construct used by libc++ in some build
modes: its <valarray> header declares some functions with the
internal_linkage attribute and then (meaninglessly) provides explicit
instantiation declarations for them. Luckily, Clang happens to
effectively ignore the explicit instantiation declaration when
generating code in this case, and this change codifies that behavior.

This reinstates part of r359048, reverted in r359076. (The libc++ issue
triggering the rollback has been addressed.)

llvm-svn: 359259

5 years agoRevert lib/Header: Fix Visual Studio builds
Tom Stellard [Fri, 26 Apr 2019 01:43:59 +0000 (01:43 +0000)]
Revert lib/Header: Fix Visual Studio builds

This reverts r359257 (git commit 00d9789509a4c573a48f60893b95314a119edd42)

This broke check-clang.

llvm-svn: 359258

5 years agolib/Header: Fix Visual Studio builds
Tom Stellard [Fri, 26 Apr 2019 01:18:59 +0000 (01:18 +0000)]
lib/Header: Fix Visual Studio builds

Summary:
This is a follow up to r355253, which inadvertently broke Visual
Studio builds by trying to copy files from CMAKE_CFG_INTDIR.

See https://reviews.llvm.org/D58537#inline-532492

Reviewers: smeenai, vzakhari, phosek

Reviewed By: smeenai

Subscribers: mgorny, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D61054

llvm-svn: 359257

5 years agoadd tuple_cat test for const T
Eric Fiselier [Fri, 26 Apr 2019 01:06:32 +0000 (01:06 +0000)]
add tuple_cat test for const T

llvm-svn: 359256

5 years agoFix return type of std::tuple_cat.
Eric Fiselier [Fri, 26 Apr 2019 01:02:18 +0000 (01:02 +0000)]
Fix return type of std::tuple_cat.

When the arguments to tuple cat were const, the const was incorrectly
propagated into the type of the resulting tuple. For example:

const std::tuple<int> t(42);
auto r = std::tuple_cat(t, t);
// Incorrect! should be std::tuple<int, int>.
static_assert(is_same_v<decltype(r), std::tuple<const int, const int>>);

llvm-svn: 359255

5 years ago[libFuzzer] Disable MSan interceptors in SIGINT handler.
Matt Morehouse [Fri, 26 Apr 2019 00:17:41 +0000 (00:17 +0000)]
[libFuzzer] Disable MSan interceptors in SIGINT handler.

Summary:
Avoids an MSan false positive if the SIGINT comes while the user
callback is running.  The false positive happens when the interrupt
handler calls opendir() to remove some temporary files, which is
intercepted by MSan.

Fixes https://github.com/google/oss-fuzz/issues/2332.

Reviewers: kcc

Reviewed By: kcc

Subscribers: llvm-commits, Dor1s, metzman

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D61163

llvm-svn: 359254

5 years ago[GlobalOpt] Swap the expensive check for cold calls with the cheap TTI check
Justin Bogner [Fri, 26 Apr 2019 00:12:50 +0000 (00:12 +0000)]
[GlobalOpt] Swap the expensive check for cold calls with the cheap TTI check

isValidCandidateForColdCC is much more expensive than
TTI.useColdCCForColdCall, which by default just returns false. Avoid
doing this work if we're not going to look at the answer anyway.

This change is NFC, but I see significant compile time improvements on
some code with pathologically many functions.

llvm-svn: 359253

5 years ago[ORC] Remove symbols from dependency lists when failing materialization.
Lang Hames [Thu, 25 Apr 2019 23:31:33 +0000 (23:31 +0000)]
[ORC] Remove symbols from dependency lists when failing materialization.

When failing materialization of a symbol X, remove X from the dependants list
of any of X's dependencies. This ensures that when X's dependencies are
emitted (or fail themselves) they do not try to access the no-longer-existing
MaterializationInfo for X.

llvm-svn: 359252

5 years agoRevert [COFF] Statically link certain runtime library functions
Reid Kleckner [Thu, 25 Apr 2019 23:30:41 +0000 (23:30 +0000)]
Revert [COFF] Statically link certain runtime library functions

This reverts r359250 (git commit 4730604bd3a361c68b92b18bf73a5daa15afe9f4)

The newly added test should use -cc1 and -emit-llvm and there are other
test failures that need fixing.

llvm-svn: 359251

5 years ago[COFF] Statically link certain runtime library functions
Reid Kleckner [Thu, 25 Apr 2019 23:04:20 +0000 (23:04 +0000)]
[COFF] Statically link certain runtime library functions

Statically link certain runtime library functions for MSVC/GNU Windows
environments. This is consistent with MSVC behavior.

Fixes LNK4286 and LNK4217 warnings from link.exe when linking the static
CRT:
  LINK : warning LNK4286: symbol '__std_terminate' defined in 'libvcruntime.lib(ehhelpers.obj)' is imported by 'ASAN_NOINST_TEST_OBJECTS.asan_noinst_test.cc.x86_64-calls.o'
  LINK : warning LNK4286: symbol '__std_terminate' defined in 'libvcruntime.lib(ehhelpers.obj)' is imported by 'ASAN_NOINST_TEST_OBJECTS.asan_test_main.cc.x86_64-calls.o'
  LINK : warning LNK4217: symbol '_CxxThrowException' defined in 'libvcruntime.lib(throw.obj)' is imported by 'ASAN_NOINST_TEST_OBJECTS.gtest-all.cc.x86_64-calls.o' in function '"int `public: static class UnitTest::GetInstance * __cdecl testing::UnitTest::GetInstance(void)'::`1'::dtor$5" (?dtor$5@?0??GetInstance@UnitTest@testing@@SAPEAV12@XZ@4HA)'

Reviewers: mstorsjo, efriedma, TomTan, compnerd, smeenai, mgrang

Subscribers: abdulras, theraven, smeenai, pcc, mehdi_amini, javed.absar, inglorion, kristof.beyls, dexonsmith, cfe-commits

Differential Revision: https://reviews.llvm.org/D55229

llvm-svn: 359250

5 years ago[TestTemplateFunction] Add a missing debug info variant.
Davide Italiano [Thu, 25 Apr 2019 22:53:10 +0000 (22:53 +0000)]
[TestTemplateFunction] Add a missing debug info variant.

llvm-svn: 359249

5 years ago[CUDA] Implemented _[bi]mma* builtins.
Artem Belevich [Thu, 25 Apr 2019 22:28:09 +0000 (22:28 +0000)]
[CUDA] Implemented _[bi]mma* builtins.

These builtins provide access to the new integer and
sub-integer variants of MMA (matrix multiply-accumulate) instructions
provided by CUDA-10.x on sm_75 (AKA Turing) GPUs.

Also added a feature for PTX 6.4. While Clang/LLVM does not generate
any PTX instructions that need it, we still need to pass it through to
ptxas in order to be able to compile code that uses the new 'mma'
instruction as inline assembly (e.g used by NVIDIA's CUTLASS library
https://github.com/NVIDIA/cutlass/blob/master/cutlass/arch/mma.h#L101)

Differential Revision: https://reviews.llvm.org/D60279

llvm-svn: 359248

5 years agoPTX 6.3 extends `wmma` instruction to support s8/u8/s4/u4/b1 -> s32.
Artem Belevich [Thu, 25 Apr 2019 22:27:57 +0000 (22:27 +0000)]
PTX 6.3 extends `wmma` instruction to support s8/u8/s4/u4/b1 -> s32.

All of the new instructions are still handled mostly by tablegen. I've slightly
refactored the code to drive intrinsic/instruction generation from a master
list of supported variants, so all irregularities have to be implemented in one place only.

The test generation script wmma.py has been refactored in a similar way.

Differential Revision: https://reviews.llvm.org/D60015

llvm-svn: 359247

5 years ago[NVPTX] generate correct MMA instruction mnemonics with PTX63+.
Artem Belevich [Thu, 25 Apr 2019 22:27:46 +0000 (22:27 +0000)]
[NVPTX] generate correct MMA instruction mnemonics with PTX63+.

PTX 6.3 requires using ".aligned" in the MMA instruction names.
In order to generate correct name, now we pass current
PTX version to each instruction as an extra constant operand
and InstPrinter adjusts its output accordingly.

Differential Revision: https://reviews.llvm.org/D59393

llvm-svn: 359246

5 years ago[NVPTX] Refactor generation of MMA intrinsics and instructions. NFC.
Artem Belevich [Thu, 25 Apr 2019 22:27:35 +0000 (22:27 +0000)]
[NVPTX] Refactor generation of MMA intrinsics and instructions. NFC.

Generalized constructions of 'fragments' of MMA operations to provide
common primitives for construction of the ops. This will make it easier
to add new variants of the instructions that operate on integer types.

Use nested foreach loops which makes it possible to better control
naming of the intrinsics.

This patch does not affect LLVM's output, so there are no test changes.

Differential Revision: https://reviews.llvm.org/D59389

llvm-svn: 359245

5 years ago[Object][XCOFF] Add intial support for section header table.
Sean Fertile [Thu, 25 Apr 2019 21:36:04 +0000 (21:36 +0000)]
[Object][XCOFF] Add intial support for section header table.

Adds a representation of the section header table to XCOFFObjectFile,
and implements enough to dump the section headers with llvm-obdump.

Differential Revision: https://reviews.llvm.org/D60784

llvm-svn: 359244

5 years agoRemove incorrect explicit instantiation declarations for valarray
Richard Smith [Thu, 25 Apr 2019 21:31:58 +0000 (21:31 +0000)]
Remove incorrect explicit instantiation declarations for valarray

libc++ ABI v1 provides three valarray symbols as part of the shared library:

valarray<size_t>::valarray(size_t)
valarray<size_t>::~valarray()
valarray<size_t>::resize(size_t, size_t)

The first two of these are intended to be removed in V2 of the ABI: they're
attributed _LIBCPP_HIDE_FROM_ABI_AFTER_V1, and  it appears that the intention
is that these symbols from the library are not used even when building using
the V1 ABI. However, there are explicit instantiation declarations for all
three symbols in the header, which are not correct as we do not intend to find
an instantiation of these functions that is provided elsewhere.

(A recent change to clang to properly diagnose explicit instantiation
declarations of internal linkage functions -- required by [temp.explicit]p13 --
had to be rolled back because it diagnosed these explicit instantiations.)

Remove the explicit instantiation declarations, and remove the explicit
instantiation definitions for V2 of the libc++ ABI onwards.

llvm-svn: 359243

5 years ago[CMake][PowerPC] Recognize LLVM_NATIVE_TARGET="ppc64le" as PowerPC
Keno Fischer [Thu, 25 Apr 2019 21:28:03 +0000 (21:28 +0000)]
[CMake][PowerPC] Recognize LLVM_NATIVE_TARGET="ppc64le" as PowerPC

Summary:
This value is derived from the host triple, which on the machine
I'm currently using is `ppc64le-linux-redhat`. This change makes
LLVM compile.

Reviewers: nemanjai
Differential Revision: https://reviews.llvm.org/D57118

llvm-svn: 359242

5 years ago[PGO] Fix buildbot failure in 359215
Rong Xu [Thu, 25 Apr 2019 21:16:41 +0000 (21:16 +0000)]
[PGO] Fix buildbot failure in 359215

Revert the part of changes in r359215 that failing in some platforms.
I will re-enable them later.

llvm-svn: 359241

5 years agoAnother use of the interactive lldb.debugger.
Jason Molenda [Thu, 25 Apr 2019 20:45:10 +0000 (20:45 +0000)]
Another use of the interactive lldb.debugger.

llvm-svn: 359240

5 years ago[AMDGPU] gfx1010 - fix ubsan failure
Stanislav Mekhanoshin [Thu, 25 Apr 2019 20:39:06 +0000 (20:39 +0000)]
[AMDGPU] gfx1010 - fix ubsan failure

Revert DecoderNamespace in one place for now. It will need more
changes to properly work.

llvm-svn: 359239

5 years ago[x86] add tests for vector fdiv reciprocal estimate; NFC
Sanjay Patel [Thu, 25 Apr 2019 20:35:47 +0000 (20:35 +0000)]
[x86] add tests for vector fdiv reciprocal estimate; NFC

llvm-svn: 359238

5 years ago[analyzer] Add FIXMEs for alpha.unix.cstring.OutOfBounds false positives.
Artem Dergachev [Thu, 25 Apr 2019 20:30:14 +0000 (20:30 +0000)]
[analyzer] Add FIXMEs for alpha.unix.cstring.OutOfBounds false positives.

Caused by incorrect strlcat() modeling in r332303,
cf. https://bugs.llvm.org/show_bug.cgi?id=37687#c8

llvm-svn: 359237

5 years agoAssigning to a local object in a return statement prevents copy elision. NFC.
David Blaikie [Thu, 25 Apr 2019 20:09:00 +0000 (20:09 +0000)]
Assigning to a local object in a return statement prevents copy elision. NFC.

I added a diagnostic along the lines of `-Wpessimizing-move` to detect `return x = y` suppressing copy elision, but I don't know if the diagnostic is really worth it. Anyway, here are the places where my diagnostic reported that copy elision would have been possible if not for the assignment.

P1155R1 in the post-San-Diego WG21 (C++ committee) mailing discusses whether WG21 should fix this pitfall by just changing the core language to permit copy elision in cases like these.

(Kona update: The bulk of P1155 is proceeding to CWG review, but specifically *not* the parts that explored the notion of permitting copy-elision in these specific cases.)

Reviewed By: dblaikie

Author: Arthur O'Dwyer

Differential Revision: https://reviews.llvm.org/D54885

llvm-svn: 359236

5 years agoSkip type units/type uniquing when we know we're only emitting the type once (vtable...
David Blaikie [Thu, 25 Apr 2019 20:05:47 +0000 (20:05 +0000)]
Skip type units/type uniquing when we know we're only emitting the type once (vtable-based emission when triggered by a strong vtable, with -fno-standalone-debug)

(this would regress size without a corresponding LLVM change that avoids
putting other user defined types inside type units when they aren't in
their own type units - instead emitting declarations inside the type
unit and a definition in the primary CU)

Reviewers: aprantl

Differential Revision: https://reviews.llvm.org/D61079

llvm-svn: 359235

5 years agoTwo tests were using the interactive convenience variable
Jason Molenda [Thu, 25 Apr 2019 20:03:39 +0000 (20:03 +0000)]
Two tests were using the interactive convenience variable
lldb.debugger.  They should not be.
<rdar://problem/50210340>

llvm-svn: 359234

5 years ago[Windows] Separate elements in -print-search-dirs with semicolons
Martin Storsjo [Thu, 25 Apr 2019 20:03:20 +0000 (20:03 +0000)]
[Windows] Separate elements in -print-search-dirs with semicolons

Path lists on windows should always be separated by semicolons, not
colons. Reuse llvm::sys::EnvPathSeparator for this purpose (as that's
also a path list that is separated in the same way).

Alternatively, this could just be a local ifdef _WIN32 in this function,
or generalizing the existing EnvPathSeparator to e.g. a
llvm::sys::path::PathListSeparator?

Differential Revision: https://reviews.llvm.org/D61121

llvm-svn: 359233

5 years agoRemove libc++ checks and workarounds for unsupported old versions of GCC (<4.9).
Richard Smith [Thu, 25 Apr 2019 20:02:10 +0000 (20:02 +0000)]
Remove libc++ checks and workarounds for unsupported old versions of GCC (<4.9).

Differential Revision: https://reviews.llvm.org/D61107

llvm-svn: 359232

5 years ago[GlobalISel][AArch64] Make G_EXTRACT_VECTOR_ELT legal for v8s16s
Jessica Paquette [Thu, 25 Apr 2019 20:00:57 +0000 (20:00 +0000)]
[GlobalISel][AArch64] Make G_EXTRACT_VECTOR_ELT legal for v8s16s

This case was missing before, so we couldn't legalize it.

Add it to AArch64LegalizerInfo.cpp and update select-extract-vector-elt.mir.

llvm-svn: 359231

5 years ago[analyzer][UninitializedObjectChecker] PR41590: Regard _Atomic types as primitive
Kristof Umann [Thu, 25 Apr 2019 20:00:51 +0000 (20:00 +0000)]
[analyzer][UninitializedObjectChecker] PR41590: Regard _Atomic types as primitive

https://bugs.llvm.org/show_bug.cgi?id=41590

For the following code snippet, UninitializedObjectChecker crashed:

struct MyAtomicInt {
  _Atomic(int) x;
  MyAtomicInt() {}
};

void entry() {
  MyAtomicInt b;
}

The problem was that _Atomic types were not regular records, unions,
dereferencable or primitive, making the checker hit the llvm_unreachable at
lib/StaticAnalyzer/Checkers/UninitializedObject/UninitializedObjectChecker.cpp:347.
The solution is to regard these types as primitive as well. The test case shows
that with this addition, not only are we able to get rid of the crash, but we
can identify x as uninitialized.

Differential Revision: https://reviews.llvm.org/D61106

llvm-svn: 359230

5 years agoFix buildbot failures after r359159.
Richard Smith [Thu, 25 Apr 2019 20:00:06 +0000 (20:00 +0000)]
Fix buildbot failures after r359159.

std::mutex was not actually is_nothrow_default_constructible in C++98/C++03,
because the variable declaration

  std::mutex M;

... could throw an exception from the mutex destructor. Fix it by marking the
destructor as non-throwing. This has no effect in C++11 onwards, because
destructors are non-throwing by default in those language modes.

llvm-svn: 359229

5 years ago[lldb] [lit] Use constexpr and better constraints in Register tests
Michal Gorny [Thu, 25 Apr 2019 19:56:54 +0000 (19:56 +0000)]
[lldb] [lit] Use constexpr and better constraints in Register tests

Use constexpr to explicitly indicate that we're dealing with integer
constants, and provoke clang to assign them straight to registers
whenever possible.  Adjust input constraints in %mmN tests to "rm"
as using integer constants is apparently disallowed there.  Also
use "i" for %rN tests, as we don't want clang to accidentally clobber
those general purpose registers while assigning to them (however
unlikely that is).

llvm-svn: 359228

5 years agoSet _LIBCPP_DLL_VIS on _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS in MinGW mode
Martin Storsjo [Thu, 25 Apr 2019 19:46:28 +0000 (19:46 +0000)]
Set _LIBCPP_DLL_VIS on _LIBCPP_EXTERN_TEMPLATE_TYPE_VIS in MinGW mode

Contrary to MSVC, MinGW compilers wants the dllexport attribute on
the declaration of an explicit template instantiation, not on the
definition.

Differential Revision: https://reviews.llvm.org/D61123

llvm-svn: 359227

5 years ago[ObjC][ARC] Let ARC optimizer bail out if the number of pointer states
Akira Hatanaka [Thu, 25 Apr 2019 19:42:55 +0000 (19:42 +0000)]
[ObjC][ARC] Let ARC optimizer bail out if the number of pointer states
it keeps track of becomes too large

ARC optimizer does a top-down and a bottom-up traversal of the whole
function to pair up retain and release instructions and remove them.
This can be expensive if the number of instructions in the function and
pointer states it tracks are large since it has to look at each pointer
state and determine whether the instruction being visited can
potentially use the pointer.

This patch adds a command line option that sets a limit to the number of
pointers it tracks.

rdar://problem/49477063

Differential Revision: https://reviews.llvm.org/D61100

llvm-svn: 359226

5 years ago[AMDGPU] gfx1010 VOP1 instructions
Stanislav Mekhanoshin [Thu, 25 Apr 2019 19:01:51 +0000 (19:01 +0000)]
[AMDGPU] gfx1010 VOP1 instructions

Differential Revision: https://reviews.llvm.org/D61099

llvm-svn: 359225

5 years ago[AMDGPU] gfx1010 utility functions
Stanislav Mekhanoshin [Thu, 25 Apr 2019 18:53:41 +0000 (18:53 +0000)]
[AMDGPU] gfx1010 utility functions

Differential Revision: https://reviews.llvm.org/D61094

llvm-svn: 359224

5 years ago[libFuzzer] Require linux for libcxx.test
Matt Morehouse [Thu, 25 Apr 2019 18:42:30 +0000 (18:42 +0000)]
[libFuzzer] Require linux for libcxx.test

llvm-svn: 359223

5 years ago[GlobalISel][AArch64] Add generic legalization rule for extends
Jessica Paquette [Thu, 25 Apr 2019 18:42:00 +0000 (18:42 +0000)]
[GlobalISel][AArch64] Add generic legalization rule for extends

This adds a legalization rule for G_ZEXT, G_ANYEXT, and G_SEXT which allows
extends whenever the types will fit in registers (or the source is an s1).

Update tests. Add GISel checks throughout all of arm64-vabs.ll,
where we now select a good portion of the code. Add GISel checks to
arm64-subvector-extend.ll, which has a good number of vector extends in it.

Differential Revision: https://reviews.llvm.org/D60889

llvm-svn: 359222

5 years ago[lldb] [lit] Un-XFAIL Register/x86-64-read.test for Darwin
Michal Gorny [Thu, 25 Apr 2019 18:38:58 +0000 (18:38 +0000)]
[lldb] [lit] Un-XFAIL Register/x86-64-read.test for Darwin

llvm-svn: 359221

5 years ago[libc++][test] Fix noexcept assertions in variant's get tests
Casey Carter [Thu, 25 Apr 2019 18:36:29 +0000 (18:36 +0000)]
[libc++][test] Fix noexcept assertions in variant's get tests

All constant expressions are non-potentially-throwing in C++14, but that is *not* the case in C++17. Change these tests of the `variant`-flavored overloads of `std::get` to expect the correct behavior when the compiler is not GCC or is GCC 9+.

Credit to Jonathan Wakely for providing an improved version of my initial change that validates the incorrect behavior on GCC < 9 as well as validating the correct behavior on other compilers.

Differential Revision: https://reviews.llvm.org/D61033

llvm-svn: 359220

5 years ago[SelectionDAG][X86] Use stack load/store in PromoteIntRes_BITCAST when the input...
Craig Topper [Thu, 25 Apr 2019 18:19:59 +0000 (18:19 +0000)]
[SelectionDAG][X86] Use stack load/store in PromoteIntRes_BITCAST when the input needs to be be split and the output type is a vector.

We had special case handling here, but it uses a scalar any_extend for the
promotion then bitcasts to the final type. This won't split up the input data
into multiple promoted elements like we need.

This patch falls back to doing the conversion through memory.

Fixes PR41594 which I believe was reflected in the bitcast-vector-bool.ll
changes. The changes to vector-half-conversions.ll are fixing a previously
unknown miscompile from this issue.

Differential Revision: https://reviews.llvm.org/D61114

llvm-svn: 359219

5 years ago[compiler-rt] Build custom libc++abi without exceptions.
Matt Morehouse [Thu, 25 Apr 2019 18:14:24 +0000 (18:14 +0000)]
[compiler-rt] Build custom libc++abi without exceptions.

Summary:
Since neither compiler-rt nor the libc++ we build use exceptions, we
don't need libc++abi to have them either.

This resolves an issue where libFuzzer's private libc++ contains
implementations for __cxa_throw and friends, causing fuzz targets built
with their own C++ library to segfault during exception unwinding.

See https://github.com/google/oss-fuzz/issues/2328.

Reviewers: phosek, EricWF, kcc

Reviewed By: phosek

Subscribers: kcc, dberris, mgorny, christof, llvm-commits, metzman

Tags: #llvm

Differential Revision: https://reviews.llvm.org/D61053

llvm-svn: 359218

5 years agoDebugInfo: Fix bitrotted test case
David Blaikie [Thu, 25 Apr 2019 18:11:48 +0000 (18:11 +0000)]
DebugInfo: Fix bitrotted test case

This test was updated with some CHECK suffix variants, but dropped
checking for the unsuffixed 'CHECK'

llvm-svn: 359217

5 years agocreduce-clang-crash: add -F flag to grep to avoid interpreting string as regex
Amy Huang [Thu, 25 Apr 2019 18:00:25 +0000 (18:00 +0000)]
creduce-clang-crash: add -F flag to grep to avoid interpreting string as regex

llvm-svn: 359216

5 years ago[PGO] Enable InstrProf lowering for Clang PGO instrumentation in the new pass manager
Rong Xu [Thu, 25 Apr 2019 17:52:43 +0000 (17:52 +0000)]
[PGO] Enable InstrProf lowering for Clang PGO instrumentation in the new pass manager
Currently InstrProf lowering is not enabled for Clang PGO instrumentation in
the new pass manager. The following command
"-fprofile-instr-generate -fexperimental-new-pass-manager ..." is broken.

This CL enables InstrProf lowering pass for Clang PGO instrumentation in the
new pass manager.

Differential Revision: https://reviews.llvm.org/D61138

llvm-svn: 359215

5 years ago[clangd] Optimize "don't include me" check.
Sam McCall [Thu, 25 Apr 2019 17:47:07 +0000 (17:47 +0000)]
[clangd] Optimize "don't include me" check.

Summary:
llvm::Regex is really slow, and regex evaluation during preamble indexing was
showing up as 25% on a profile of clangd in a codebase with large preambles.

Reviewers: ilya-biryukov

Subscribers: MaskRay, jkorous, arphaman, kadircet, cfe-commits

Tags: #clang

Differential Revision: https://reviews.llvm.org/D61120

llvm-svn: 359214

5 years ago[NFC][Sanitizer] Extract GetFuncAddr from GetRealFunctionAddress
Julian Lettner [Thu, 25 Apr 2019 17:46:29 +0000 (17:46 +0000)]
[NFC][Sanitizer] Extract GetFuncAddr from GetRealFunctionAddress

Summary:
Hopefully, this will enable cleanup/removal of GetRealFunctionAddress in
follow-up commits.

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

Differential Revision: https://reviews.llvm.org/D61110

llvm-svn: 359213

5 years agoFix bug 37903:MS ABI: handle inline static data member and inline variable as templat...
Jennifer Yu [Thu, 25 Apr 2019 17:45:45 +0000 (17:45 +0000)]
Fix bug 37903:MS ABI: handle inline static data member and inline variable as template static data member

llvm-svn: 359212

5 years agoImplement 'lerp'; which is the last bit of P0811. Mark that paper as complete.
Marshall Clow [Thu, 25 Apr 2019 17:44:18 +0000 (17:44 +0000)]
Implement 'lerp'; which is the last bit of P0811. Mark that paper as complete.

llvm-svn: 359211

5 years ago[lldb] [lit] Add tests for reading new x86_64 registers
Michal Gorny [Thu, 25 Apr 2019 17:42:49 +0000 (17:42 +0000)]
[lldb] [lit] Add tests for reading new x86_64 registers

Add tests covering read operations for the general-purpose and XMM
registers added in x86_64 (r8-r15 and xmm8-xmm15).

Differential Revision: https://reviews.llvm.org/D61072

llvm-svn: 359210

5 years ago[lldb] [lit] Remove unnecessary array use in XMM reading test
Michal Gorny [Thu, 25 Apr 2019 17:42:40 +0000 (17:42 +0000)]
[lldb] [lit] Remove unnecessary array use in XMM reading test

Remove the use of 2-element array for XMM data.  It is an accidental
leftover from previous implementation attempt, and it is unnecessary
with xmm_t.

Differential Revision: https://reviews.llvm.org/D61085

llvm-svn: 359208

5 years ago[WebAssembly] Always take into account added when applying runtime relocations
Sam Clegg [Thu, 25 Apr 2019 17:11:54 +0000 (17:11 +0000)]
[WebAssembly] Always take into account added when applying runtime relocations

The code we generate for applying data relocations at runtime omitted
the symbols with GOT entries.

Also refactor the code to reduce duplication.

Differential Revision: https://reviews.llvm.org/D61111

llvm-svn: 359207

5 years agoFixed typo in CompileUnit::GetImportedModules documentation [NFC]
Raphael Isemann [Thu, 25 Apr 2019 17:08:54 +0000 (17:08 +0000)]
Fixed typo in CompileUnit::GetImportedModules documentation [NFC]

llvm-svn: 359206

5 years ago[Evaluator] Walk initial elements when handling load through bitcast
Robert Lougher [Thu, 25 Apr 2019 17:00:01 +0000 (17:00 +0000)]
[Evaluator] Walk initial elements when handling load through bitcast

When evaluating a store through a bitcast, the evaluator tries to move the
bitcast from the pointer onto the stored value. If the cast is invalid, it
tries to "introspect" the type to get a valid cast by obtaining a pointer to
the initial element (if the type is nested, this may require walking several
initial elements).

In some situations it is possible to get a bitcast on a load (e.g. with
unions, where the bitcast may not be the same type as the store). However,
equivalent logic to the store to introspect the type is missing. This patch
add this logic.

Note, when developing the patch I was unhappy with adding similar logic
directly to the load case as it could get out of step. Instead, I have
abstracted the "introspection" into a helper function, with the specifics
being handled by a passed-in lambda function.

Differential Revision: https://reviews.llvm.org/D60793

llvm-svn: 359205

5 years ago[GlobalISel][AArch64] Legalize G_FNEARBYINT
Jessica Paquette [Thu, 25 Apr 2019 16:44:40 +0000 (16:44 +0000)]
[GlobalISel][AArch64] Legalize G_FNEARBYINT

Add legalizer support for G_FNEARBYINT. It's the same as G_FCEIL etc.

Since the importer allows us to automatically select this after legalization,
also add tests for selection etc. Also update arm64-vfloatintrinsics.ll.

llvm-svn: 359204

5 years ago[GlobalISel] Add IRTranslator support for G_FNEARBYINT
Jessica Paquette [Thu, 25 Apr 2019 16:39:28 +0000 (16:39 +0000)]
[GlobalISel] Add IRTranslator support for G_FNEARBYINT

Translate llvm.nearbyint into G_FNEARBYINT as a simple intrinsic. Update
arm64-irtranslator.ll.

Differential Revision: https://reviews.llvm.org/D60922

llvm-svn: 359203

5 years ago[clangd] Use JSON streaming API for Trace rather than pasting strings. NFC
Sam McCall [Thu, 25 Apr 2019 16:37:07 +0000 (16:37 +0000)]
[clangd] Use JSON streaming API for Trace rather than pasting strings. NFC

llvm-svn: 359202

5 years ago[GlobalISel] Add a G_FNEARBYINT opcode
Jessica Paquette [Thu, 25 Apr 2019 16:36:03 +0000 (16:36 +0000)]
[GlobalISel] Add a G_FNEARBYINT opcode

For eventually selecting llvm.nearbyint. Equivalent to the SelectionDAG
nearbyint node.

Update legalizer-info-validation.mir.

Differential Revision: https://reviews.llvm.org/D60921

llvm-svn: 359201