platform/upstream/llvm.git
5 years ago.
Fangrui Song [Sun, 7 Apr 2019 08:28:56 +0000 (08:28 +0000)]
.

llvm-svn: 357856

5 years ago[llvm-objdump] Simplify Expected<T> handling with unwrapOrError
Fangrui Song [Sun, 7 Apr 2019 08:19:55 +0000 (08:19 +0000)]
[llvm-objdump] Simplify Expected<T> handling with unwrapOrError

llvm-svn: 357855

5 years ago[ConstantRange] Shl considers full-set shifting to last bit position.
Marcello Maggioni [Sun, 7 Apr 2019 06:12:44 +0000 (06:12 +0000)]
[ConstantRange] Shl considers full-set shifting to last bit position.

if we do SHL of two 16-bit ranges like [0, 30000) with [1,2) we get
"full-set" instead of what I would have expected [0, 60000) which is
still in the 16-bit unsigned range.

This patch changes the SHL algorithm to allow getting a usable range
even in this case.

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

llvm-svn: 357854

5 years ago[llvm-objdump] Simplify disassembleObject
Fangrui Song [Sun, 7 Apr 2019 05:32:16 +0000 (05:32 +0000)]
[llvm-objdump] Simplify disassembleObject

* Use std::binary_search to replace some std::lower_bound
* Use llvm::upper_bound to replace some std::upper_bound
* Use format_hex and support::endian::read{16,32}

llvm-svn: 357853

5 years agoChange some StringRef::data() reinterpret_cast to bytes_begin() or arrayRefFromString...
Fangrui Song [Sun, 7 Apr 2019 03:58:42 +0000 (03:58 +0000)]
Change some StringRef::data() reinterpret_cast to bytes_begin() or arrayRefFromStringRef()

llvm-svn: 357852

5 years ago[clang-format] Fix Bug 41407
Owen Pan [Sat, 6 Apr 2019 23:10:11 +0000 (23:10 +0000)]
[clang-format] Fix Bug 41407
Differential Revision: https://reviews.llvm.org/D60359

llvm-svn: 357851

5 years ago[gn] Support for per-target runtime directory layout
Petr Hosek [Sat, 6 Apr 2019 23:05:56 +0000 (23:05 +0000)]
[gn] Support for per-target runtime directory layout

This change also introduces the clang_enable_per_target_runtime_dir
to enable the use of per-target runtime directory layout which is the
equivalent of LLVM_ENABLE_PER_TARGET_RUNTIME_DIR CMake option.

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

llvm-svn: 357850

5 years ago[NFC] Fix typo in comment.
Nick Lewycky [Sat, 6 Apr 2019 22:05:24 +0000 (22:05 +0000)]
[NFC] Fix typo in comment.

llvm-svn: 357849

5 years ago[X86] When converting (x << C1) AND C2 to (x AND (C2>>C1)) << C1 during isel, try...
Craig Topper [Sat, 6 Apr 2019 19:00:11 +0000 (19:00 +0000)]
[X86] When converting (x << C1) AND C2 to (x AND (C2>>C1)) << C1 during isel, try using andl over andq by favoring 32-bit unsigned immediates.

llvm-svn: 357848

5 years ago[X86] combineBitcastvxi1 - provide dst VT and src SDValue directly. NFCI.
Simon Pilgrim [Sat, 6 Apr 2019 18:54:17 +0000 (18:54 +0000)]
[X86] combineBitcastvxi1 - provide dst VT and src SDValue directly. NFCI.

Prep work to make it easier to reuse the BITCAST->MOVSMK combine in other cases.

llvm-svn: 357847

5 years ago[X86] Use a signed mask in foldMaskedShiftToScaledMask to enable a shorter immediate...
Craig Topper [Sat, 6 Apr 2019 18:00:50 +0000 (18:00 +0000)]
[X86] Use a signed mask in foldMaskedShiftToScaledMask to enable a shorter immediate encoding.

This function reorders AND and SHL to enable the SHL to fold into an LEA. The
upper bits of the AND will be shifted out by the SHL so it doesn't matter what
mask value we use for these bits. By using sign bits from the original mask in
these upper bits we might enable a shorter immediate encoding to be used.

llvm-svn: 357846

5 years ago[X86] Add test cases to show missed opportunities to use a sign extended 8 or 32...
Craig Topper [Sat, 6 Apr 2019 18:00:45 +0000 (18:00 +0000)]
[X86] Add test cases to show missed opportunities to use a sign extended 8 or 32 bit immediate AND when reversing SHL+AND to form an LEA.

When we shift the AND mask over we should shift in sign bits instead of zero bits. The scale in the LEA will shift these bits out so it doesn't matter whether we mask the bits off or not. Using sign bits will potentially allow a sign extended immediate to be used.

Also add some other test cases for cases that are currently optimal.

llvm-svn: 357845

5 years ago[X86] Autogenerate complete checks. NFC
Craig Topper [Sat, 6 Apr 2019 18:00:41 +0000 (18:00 +0000)]
[X86] Autogenerate complete checks. NFC

llvm-svn: 357844

5 years agoFix spelling mistake. NFCI.
Simon Pilgrim [Sat, 6 Apr 2019 15:38:34 +0000 (15:38 +0000)]
Fix spelling mistake. NFCI.

llvm-svn: 357843

5 years ago[X86] Add AVX-target expandload and compressstore tests
Simon Pilgrim [Sat, 6 Apr 2019 14:40:52 +0000 (14:40 +0000)]
[X86] Add AVX-target expandload and compressstore tests

llvm-svn: 357842

5 years ago[llvm-exegesis][X86] Handle CMOVcc/SETcc OPERAND_COND_CODE OperandType
Roman Lebedev [Sat, 6 Apr 2019 14:16:26 +0000 (14:16 +0000)]
[llvm-exegesis][X86] Handle CMOVcc/SETcc OPERAND_COND_CODE OperandType

Summary:
D60041 / D60138 refactoring changed how CMOV/SETcc opcodes
are handled. concode is now an immediate, with it's own operand type.

This at least allows to not crash on the opcode.
However, this still won't generate all the snippets
with all the condcode enumerators. D60066 does that.

Reviewers: courbet, gchatelet

Reviewed By: gchatelet

Subscribers: tschuett, llvm-commits

Tags: #llvm

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

llvm-svn: 357841

5 years ago[X86] Split expandload and compressstore tests
Simon Pilgrim [Sat, 6 Apr 2019 14:14:54 +0000 (14:14 +0000)]
[X86] Split expandload and compressstore tests

llvm-svn: 357840

5 years ago[X86][SSE] Add more exhaustive masked load/store tests
Simon Pilgrim [Sat, 6 Apr 2019 14:01:37 +0000 (14:01 +0000)]
[X86][SSE] Add more exhaustive masked load/store tests

Reordered/renamed some existing tests to match the cleaned up order

llvm-svn: 357839

5 years ago[CostModel][X86] Add more exhaustive masked load/store/gather/scatter/expand/compress...
Simon Pilgrim [Sat, 6 Apr 2019 12:08:37 +0000 (12:08 +0000)]
[CostModel][X86] Add more exhaustive masked load/store/gather/scatter/expand/compress cost tests

llvm-svn: 357838

5 years ago[clang-format] BreakAfterReturnType ignored on functions with numeric template parameters
Paul Hoad [Sat, 6 Apr 2019 10:13:04 +0000 (10:13 +0000)]
[clang-format] BreakAfterReturnType ignored on functions with numeric template parameters

Summary:
Addresses PR40696 - https://bugs.llvm.org/show_bug.cgi?id=40696

The BreakAfterReturnType didn't work if it had a single arguments which was a template with an integer template parameter

```
int  foo(A<8> a) { return a; }
```

When run with the Mozilla style. would not break after the `int`

```
int TestFn(A<8> a)
{
  return a;
}

```

This revision resolves this issue by allowing numeric constants to be considered function parameters if if seen inside `<>`

Reviewers: djasper, klimek, JonasToth, krasimir, reuk, alexfh

Reviewed By: klimek

Subscribers: cfe-commits, llvm-commits

Tags: #clang-tools-extra

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

llvm-svn: 357837

5 years ago[AMDGPU] Sort out and rename multiple CI/VI predicates
Stanislav Mekhanoshin [Sat, 6 Apr 2019 09:20:48 +0000 (09:20 +0000)]
[AMDGPU] Sort out and rename multiple CI/VI predicates

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

llvm-svn: 357835

5 years ago[DWARF] Simplify DWARFDebugAranges::findAddress
Fangrui Song [Sat, 6 Apr 2019 09:12:53 +0000 (09:12 +0000)]
[DWARF] Simplify DWARFDebugAranges::findAddress

The current lower_bound approach has to check two iterators pos and pos-1.
Changing it to upper_bound allows us to check one iterator (similar to
DWARFUnitVector::getUnitFor*).

llvm-svn: 357834

5 years ago[Symbolize] Uniquify sorted vector<pair<SymbolDesc, StringRef>>
Fangrui Song [Sat, 6 Apr 2019 02:18:56 +0000 (02:18 +0000)]
[Symbolize] Uniquify sorted vector<pair<SymbolDesc, StringRef>>

llvm-svn: 357833

5 years ago[TSan][libdispatch] Remove Darwin-only version of fully-ported tests
Julian Lettner [Sat, 6 Apr 2019 01:41:40 +0000 (01:41 +0000)]
[TSan][libdispatch] Remove Darwin-only version of fully-ported tests

Remove 10 tests that already have a copy in tsan/libdispatch, without
dependencies on Darwin-specifis.

llvm-svn: 357832

5 years agotsan: Update test expectations.
Peter Collingbourne [Sat, 6 Apr 2019 00:43:17 +0000 (00:43 +0000)]
tsan: Update test expectations.

llvm-svn: 357831

5 years agogn build: Pacify `gn format`
Nico Weber [Fri, 5 Apr 2019 23:57:10 +0000 (23:57 +0000)]
gn build: Pacify `gn format`

llvm-svn: 357830

5 years agoUnify random timeouts throughout LLDB and make them configurable.
Adrian Prantl [Fri, 5 Apr 2019 22:43:42 +0000 (22:43 +0000)]
Unify random timeouts throughout LLDB and make them configurable.

Since these timeouts guard against catastrophic error in debugserver,
I also increased all of them to the maximum value among them.

The motivation for this test was the observation that an asanified
LLDB would often exhibit seemingly random test failures that could be
traced back to debugserver packets getting out of sync. With this path
applied I can no longer reproduce the one particular failure mode that
I was investigating.

rdar://problem/49441261

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

llvm-svn: 357829

5 years agoAfter rL357618, quote ${CMAKE_THREAD_LIBS_INIT} so CMake does not
Dimitry Andric [Fri, 5 Apr 2019 22:19:40 +0000 (22:19 +0000)]
After rL357618, quote ${CMAKE_THREAD_LIBS_INIT} so CMake does not
complain when the variable is empty.  Fixes PR 41401.

llvm-svn: 357828

5 years agoRevert "[Lexer] NFC: Fix an off-by-one bug in getAsCharRange()."
Artem Dergachev [Fri, 5 Apr 2019 22:11:28 +0000 (22:11 +0000)]
Revert "[Lexer] NFC: Fix an off-by-one bug in getAsCharRange()."

This reverts commit r357823.

Was breaking clang-tidy!

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

llvm-svn: 357827

5 years ago[PDB Docs] Add documentation for the hash table format.
Zachary Turner [Fri, 5 Apr 2019 22:09:30 +0000 (22:09 +0000)]
[PDB Docs] Add documentation for the hash table format.

llvm-svn: 357826

5 years ago[PDB Docs] The IPI Stream actually has index 4.
Zachary Turner [Fri, 5 Apr 2019 22:09:14 +0000 (22:09 +0000)]
[PDB Docs] The IPI Stream actually has index 4.

llvm-svn: 357825

5 years ago[testsuite] Split Objective-C new syntax test
Jonas Devlieghere [Fri, 5 Apr 2019 22:06:53 +0000 (22:06 +0000)]
[testsuite] Split Objective-C new syntax test

This splits the second longest test into separate test cases. Similar to
what we did for the Objective-C data formatters in r357786.

llvm-svn: 357824

5 years ago[Lexer] NFC: Fix an off-by-one bug in getAsCharRange().
Artem Dergachev [Fri, 5 Apr 2019 21:48:52 +0000 (21:48 +0000)]
[Lexer] NFC: Fix an off-by-one bug in getAsCharRange().

As the unit test demonstrates, subtracting 1 from the offset was unnecessary.

The only user of this function was the plist file emitter (in Static Analyzer
and ARCMigrator). It means that a lot of Static Analyzer's plist arrows
are in fact off by one character. The patch carefully preserves this
completely incorrect behavior and causes no functional change,
i.e. no plist format breakage.

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

llvm-svn: 357823

5 years ago[LLVM-C] Begin to Expose A More General Binary Interface
Robert Widmann [Fri, 5 Apr 2019 21:36:50 +0000 (21:36 +0000)]
[LLVM-C] Begin to Expose A More General Binary Interface

Summary:
Provides a new type, `LLVMBinaryRef`, and a binding to `llvm::object::createBinary` for more general interoperation with binary files than `LLVMObjectFileRef`.  It also provides the proper non-consuming API for input buffers and populates an out parameter for error handling if necessary - two things the previous API did not do.

In a follow-up, I'll define section and symbol iterators and begin to build upon the existing test infrastructure.

This patch is a first step towards deprecating that API and replacing it with something more robust.

Reviewers: deadalnix, whitequark

Reviewed By: whitequark

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 357822

5 years ago[gn] Support for building compiler-rt builtins
Petr Hosek [Fri, 5 Apr 2019 21:30:40 +0000 (21:30 +0000)]
[gn] Support for building compiler-rt builtins

This is support for building compiler-rt builtins, The library build
should be complete for a subset of supported platforms, but not all
CMake options have been replicated in GN.

We always use the just built compiler to build all the runtimes, which
is equivalent to the CMake runtimes build. This simplifies the build
configuration because we don't need to support arbitrary host compiler
and can always assume the latest Clang. With GN's toolchain support,
this is significantly more efficient than the CMake runtimes build.

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

llvm-svn: 357821

5 years ago[globalisel] Allow combiners to query legality
Daniel Sanders [Fri, 5 Apr 2019 21:22:17 +0000 (21:22 +0000)]
[globalisel] Allow combiners to query legality

llvm-svn: 357820

5 years ago[PDB Docs] Delete * LINKER * Stream information.
Zachary Turner [Fri, 5 Apr 2019 21:16:00 +0000 (21:16 +0000)]
[PDB Docs] Delete * LINKER * Stream information.

This is actually just a module debug info stream, so it should
technically be covered by a discussion of the module list.

llvm-svn: 357819

5 years ago[libc++][CMake] Make sure the benchmarks link against libc++abi
Louis Dionne [Fri, 5 Apr 2019 21:05:32 +0000 (21:05 +0000)]
[libc++][CMake] Make sure the benchmarks link against libc++abi

The refactoring in r357811 made it so that we didn't add the ABI library
to the list of LIBCXX_LIBRARIES. As a result, benchmarks didn't link to
the ABI library and were missing symbols. This broke the build bots.

As a drive-by fix, we also provide the SHARED ABI library to the linker
script instead of the STATIC ABI library.

This couldn't be discovered on Apple platforms because libc++.dylib
re-exports libc++abi.dylib symbols there.

llvm-svn: 357818

5 years ago[CMake] Don't explicitly use LLVM_LIBRARY_DIR in standalone builds
Alex Langford [Fri, 5 Apr 2019 21:01:50 +0000 (21:01 +0000)]
[CMake] Don't explicitly use LLVM_LIBRARY_DIR in standalone builds

Summary:
This line is unnecessary because add_llvm_executable will handle
linking the correct LLVM libraries for you. LLDB standalone builds are totally
fine without this.

In the best case, having this line here is harmless. In the worst case it can
cause link issues.

If you build lldb-server for android using the standalone build, this line
will cause LLVM_LIBRARY_DIR to be the first place you look for libraries.
This is an issue because if you built libc++, it will try to link against
that one instead of the one from the android NDK.  Meanwhile, the LLVM libraries
you're linking against were linked against the libc++ from the NDK.

Ideally, we would take advantage of the AFTER option for link_directories(), but
that was not available in LLDB's minimum supported version of CMake (CMake 3.4.3).

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

llvm-svn: 357817

5 years ago[InstCombine] add more tests for fmul+fdiv+sqrt; NFC
Sanjay Patel [Fri, 5 Apr 2019 20:54:35 +0000 (20:54 +0000)]
[InstCombine] add more tests for fmul+fdiv+sqrt; NFC

llvm-svn: 357816

5 years ago[globalisel] Support 3-type legalForCartesianProduct()
Daniel Sanders [Fri, 5 Apr 2019 20:47:13 +0000 (20:47 +0000)]
[globalisel] Support 3-type legalForCartesianProduct()

llvm-svn: 357815

5 years agoFix PR41395 - __cxa_vec_new may overflow in allocation size calculation.
Eric Fiselier [Fri, 5 Apr 2019 20:38:43 +0000 (20:38 +0000)]
Fix PR41395 - __cxa_vec_new may overflow in allocation size calculation.

llvm-svn: 357814

5 years ago[Test] Remove no_debug_info_test decorator from Obj-C data formatters.
Jonas Devlieghere [Fri, 5 Apr 2019 20:37:52 +0000 (20:37 +0000)]
[Test] Remove no_debug_info_test decorator from Obj-C data formatters.

As discussed in https://reviews.llvm.org/D60300.

llvm-svn: 357813

5 years ago[LLVM-C] Add bindings to insert basic blocks
Robert Widmann [Fri, 5 Apr 2019 20:32:43 +0000 (20:32 +0000)]
[LLVM-C] Add bindings to insert basic blocks

Summary:
Now that we can create standalone basic blocks, it's useful to be able to append them.  Add bindings to

- Insert a basic block after the current insertion block
- Append a basic block to the end of a function's list of basic blocks

Reviewers: whitequark, deadalnix, harlanhaskins

Reviewed By: whitequark, harlanhaskins

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 357812

5 years ago[libc++] Localize CMake code only related to the shared library
Louis Dionne [Fri, 5 Apr 2019 20:29:54 +0000 (20:29 +0000)]
[libc++] Localize CMake code only related to the shared library

Summary:
There's a lot of CMake logic that's only relevant to the shared library,
yet it was using a code path and setting variables that impact both the
shared and the static libraries. This patch moves this logic so that it
clearly only impacts the shared library.

Reviewers: phosek, smeenai, EricWF

Subscribers: mgorny, christof, jkorous, dexonsmith, libcxx-commits

Tags: #libc

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

llvm-svn: 357811

5 years ago[analyzer] NoStoreFuncVisitor: Suppress reports with no-store in system headers.
Artem Dergachev [Fri, 5 Apr 2019 20:18:53 +0000 (20:18 +0000)]
[analyzer] NoStoreFuncVisitor: Suppress reports with no-store in system headers.

The idea behind this heuristic is that normally the visitor is there to
inform the user that a certain function may fail to initialize a certain
out-parameter. For system header functions this is usually dictated by the
contract, and it's unlikely that the header function has accidentally
forgot to put the value into the out-parameter; it's more likely
that the user has intentionally skipped the error check.

Warnings on skipped error checks are more like security warnings;
they aren't necessarily useful for all users, and they should instead
be introduced on a per-API basis.

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

llvm-svn: 357810

5 years ago[X86] Enable tail calls for CallingConv::Swift
Francis Visoiu Mistrih [Fri, 5 Apr 2019 20:18:25 +0000 (20:18 +0000)]
[X86] Enable tail calls for CallingConv::Swift

It's currently only enabled on AArch64 (enabled in r281376).

llvm-svn: 357809

5 years ago[X86] Preserve operand flag when expanding TCRETURNri
Francis Visoiu Mistrih [Fri, 5 Apr 2019 20:18:21 +0000 (20:18 +0000)]
[X86] Preserve operand flag when expanding TCRETURNri

The expansion of TCRETURNri(64) would not keep operand flags like
undef/renamable/etc. which can result in machine verifier issues.

Also add plumbing to be able to use `-run-pass=x86-pseudo`.

llvm-svn: 357808

5 years agoUse binary write mode in WriteToFile function to avoid appended \r characters on...
Vitaly Buka [Fri, 5 Apr 2019 20:17:03 +0000 (20:17 +0000)]
Use binary write mode in WriteToFile function to avoid appended \r characters on Windows

Summary:
When using libfuzzer on Windows, in the contents of a crash sample, bytes that can be mistaken for a \n are replaced by a \r\n sequence. As a consequence, crashes are not reproducible. This patch will open files in binary mode to fix this issue. The patch does not affect POSIX systems.

Patch by tuktuk

Reviewers: kcc, vitalybuka

Reviewed By: vitalybuka

Subscribers: dexonsmith, jdoerfert, llvm-commits, #sanitizers

Tags: #llvm, #sanitizers

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

llvm-svn: 357807

5 years agoELF: De-template ELFFileBase. NFCI.
Peter Collingbourne [Fri, 5 Apr 2019 20:16:26 +0000 (20:16 +0000)]
ELF: De-template ELFFileBase. NFCI.

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

llvm-svn: 357806

5 years ago[AMDGPU] Add MachineDCE pass after RenameIndependentSubregs
Stanislav Mekhanoshin [Fri, 5 Apr 2019 20:11:32 +0000 (20:11 +0000)]
[AMDGPU] Add MachineDCE pass after RenameIndependentSubregs

Detect dead lanes can create some dead defs. Then RenameIndependentSubregs
will break a REG_SEQUENCE which may use these dead defs. At this point
a dead instruction can be removed but we do not run a DCE anymore.

MachineDCE was only running before live variable analysis. The patch
adds a mean to preserve LiveIntervals and SlotIndexes in case it works
past this.

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

llvm-svn: 357805

5 years agoFurther refactor cxa_guard.cpp
Eric Fiselier [Fri, 5 Apr 2019 19:58:15 +0000 (19:58 +0000)]
Further refactor cxa_guard.cpp

This patch is a part of a series of patches to cleanup
our implementation of __cxa_acquire et al. No functionality
change was intended.

This patch does two primary things.

It introduces the GuardObject class to abstract the reading
and writing to the guard object. In future, it will be used
to ensure atomic accesses are used when needed.

It also introduces the GuardValue class used to represent
values of the guard object. It is an abstraction to access
and write to the various different bits of a guard.

llvm-svn: 357804

5 years ago[clang-fuzzer] Include ExternalProject before using it.
Matt Morehouse [Fri, 5 Apr 2019 19:47:17 +0000 (19:47 +0000)]
[clang-fuzzer] Include ExternalProject before using it.

Some versions of CMake require ExternalProject to be included before we
can use ExternalProject_Add.

llvm-svn: 357803

5 years ago[X86] Merge the different Jcc instructions for each condition code into single instru...
Craig Topper [Fri, 5 Apr 2019 19:28:09 +0000 (19:28 +0000)]
[X86] Merge the different Jcc instructions for each condition code into single instructions that store the condition code as an operand.

Summary:
This avoids needing an isel pattern for each condition code. And it removes translation switches for converting between Jcc instructions and condition codes.

Now the printer, encoder and disassembler take care of converting the immediate. We use InstAliases to handle the assembly matching. But we print using the asm string in the instruction definition. The instruction itself is marked IsCodeGenOnly=1 to hide it from the assembly parser.

Reviewers: spatel, lebedev.ri, courbet, gchatelet, RKSimon

Reviewed By: RKSimon

Subscribers: MatzeB, qcolombet, eraman, hiraditya, arphaman, llvm-commits

Tags: #llvm

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

llvm-svn: 357802

5 years ago[X86] Merge the different SETcc instructions for each condition code into single...
Craig Topper [Fri, 5 Apr 2019 19:27:49 +0000 (19:27 +0000)]
[X86] Merge the different SETcc instructions for each condition code into single instructions that store the condition code as an operand.

Summary:
This avoids needing an isel pattern for each condition code. And it removes translation switches for converting between SETcc instructions and condition codes.

Now the printer, encoder and disassembler take care of converting the immediate. We use InstAliases to handle the assembly matching. But we print using the asm string in the instruction definition. The instruction itself is marked IsCodeGenOnly=1 to hide it from the assembly parser.

Reviewers: andreadb, courbet, RKSimon, spatel, lebedev.ri

Reviewed By: andreadb

Subscribers: hiraditya, lebedev.ri, llvm-commits

Tags: #llvm

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

llvm-svn: 357801

5 years ago[X86] Merge the different CMOV instructions for each condition code into single instr...
Craig Topper [Fri, 5 Apr 2019 19:27:41 +0000 (19:27 +0000)]
[X86] Merge the different CMOV instructions for each condition code into single instructions that store the condition code as an immediate.

Summary:
Reorder the condition code enum to match their encodings. Move it to MC layer so it can be used by the scheduler models.

This avoids needing an isel pattern for each condition code. And it removes
translation switches for converting between CMOV instructions and condition
codes.

Now the printer, encoder and disassembler take care of converting the immediate.
We use InstAliases to handle the assembly matching. But we print using the
asm string in the instruction definition. The instruction itself is marked
IsCodeGenOnly=1 to hide it from the assembly parser.

This does complicate the scheduler models a little since we can't assign the
A and BE instructions to a separate class now.

I plan to make similar changes for SETcc and Jcc.

Reviewers: RKSimon, spatel, lebedev.ri, andreadb, courbet

Reviewed By: RKSimon

Subscribers: gchatelet, hiraditya, kristina, lebedev.ri, jdoerfert, llvm-commits

Tags: #llvm

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

llvm-svn: 357800

5 years agoFix error in NamedDeclPrinterTest
David Goldman [Fri, 5 Apr 2019 19:17:24 +0000 (19:17 +0000)]
Fix error in NamedDeclPrinterTest

Caused by D56924, shouldn't use raw string literals in macros.

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

llvm-svn: 357799

5 years ago[gn] Rebase paths in symlink_or_copy against root_build_dir
Petr Hosek [Fri, 5 Apr 2019 19:13:54 +0000 (19:13 +0000)]
[gn] Rebase paths in symlink_or_copy against root_build_dir

We should be always rebasing paths against root_build_dir which is
the directory where scripts are run from, not root_out_dir which is
the current toolchain directory. The latter can result in invalid
paths when the action is being used from a non-default toolchain.

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

llvm-svn: 357798

5 years ago[gn] Make -no-exceptions flag a config
Petr Hosek [Fri, 5 Apr 2019 19:12:37 +0000 (19:12 +0000)]
[gn] Make -no-exceptions flag a config

This allows it to be disabled for targets that need exceptions
like libunwind, libc++abi and libc++.

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

llvm-svn: 357797

5 years ago[LCG] Add aliased functions as LCG roots
Guozhi Wei [Fri, 5 Apr 2019 18:51:08 +0000 (18:51 +0000)]
[LCG] Add aliased functions as LCG roots

Current LCG doesn't check aliased functions. So if an internal function has a public alias it will not be added to CG SCC, but it is still reachable from outside through the alias.
So this patch adds aliased functions to SCC.

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

llvm-svn: 357795

5 years ago[libc++] Add XFAILs for istream tests that were added in r357775
Louis Dionne [Fri, 5 Apr 2019 18:50:47 +0000 (18:50 +0000)]
[libc++] Add XFAILs for istream tests that were added in r357775

We fixed incorrect behavior of input streams in r357775 and tests were
added accordingly. However, older versions of macOS don't have the
change in the dylib yet, so the tests fail on those platforms.

llvm-svn: 357794

5 years ago[docs] Fix rst title in clang langext docs. NFCI
Kristina Brooks [Fri, 5 Apr 2019 18:26:43 +0000 (18:26 +0000)]
[docs] Fix rst title in clang langext docs. NFCI

Fix an odd line in LanguageExtensions.rst which
rendered incorrectly due to an underscore being
mixed in with dashes.

llvm-svn: 357793

5 years ago[AMDGPU] rename vi-insts into gfx8-insts
Stanislav Mekhanoshin [Fri, 5 Apr 2019 18:25:00 +0000 (18:25 +0000)]
[AMDGPU] rename vi-insts into gfx8-insts

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

llvm-svn: 357792

5 years ago[AMDGPU] predicate and feature refactoring
Stanislav Mekhanoshin [Fri, 5 Apr 2019 18:24:34 +0000 (18:24 +0000)]
[AMDGPU] predicate and feature refactoring

We have done some predicate and feature refactoring lately but
did not upstream it. This is to sync.

Differential revision: https://reviews.llvm.org/D60292

llvm-svn: 357791

5 years agoTry to fix Sphinx bot.
Zachary Turner [Fri, 5 Apr 2019 18:06:42 +0000 (18:06 +0000)]
Try to fix Sphinx bot.

llvm-svn: 357790

5 years agolit: make rm python 3 friendly (NFC)
Saleem Abdulrasool [Fri, 5 Apr 2019 18:00:49 +0000 (18:00 +0000)]
lit: make rm python 3 friendly (NFC)

Add some alterations for python 3 compatibility.

llvm-svn: 357789

5 years ago[PDB Docs] Finish documentation for PDB Info Stream.
Zachary Turner [Fri, 5 Apr 2019 17:59:26 +0000 (17:59 +0000)]
[PDB Docs] Finish documentation for PDB Info Stream.

The information about the named stream map and feature codes
was not present.  This patch adds it.

llvm-svn: 357788

5 years agoAdd .noindex to the gitignore
Jonas Devlieghere [Fri, 5 Apr 2019 17:57:42 +0000 (17:57 +0000)]
Add .noindex to the gitignore

The .noindex suffix is used on macOS to prevent Spotlight from indexing
its contents. These folders contain test output from dotest.py and
should be ignored when dotest is run from the LLDB source directory.

llvm-svn: 357787

5 years ago[testsuite] Split Objective-C data formatter
Jonas Devlieghere [Fri, 5 Apr 2019 17:57:40 +0000 (17:57 +0000)]
[testsuite] Split Objective-C data formatter

The testcase for objective-c data formatters is very big as it checks a
bunch of stuff. This is annoying when using the lit test driver, because
it prevents us from running the different cases in parallel. As a
result, it's always one of the last few tests that complete. This patch
splits the test into multiple files that share a common base class. This
way lit can run the different tests in parallel.

Differential revision: https://reviews.llvm.org/D60300

llvm-svn: 357786

5 years ago[PDB Docs] Add info about the hash adjustment buffer.
Zachary Turner [Fri, 5 Apr 2019 17:12:37 +0000 (17:12 +0000)]
[PDB Docs] Add info about the hash adjustment buffer.

This necessitates adding a document describing the serialized
hash table format.  This document is currently empty, although
it will be filled out in followup patches.

llvm-svn: 357784

5 years agogn build: Merge 357768 and 357770
Nico Weber [Fri, 5 Apr 2019 17:05:54 +0000 (17:05 +0000)]
gn build: Merge 357768 and 357770

llvm-svn: 357783

5 years ago[InstCombine] add tests for fdiv+fmul; NFC
Sanjay Patel [Fri, 5 Apr 2019 17:00:57 +0000 (17:00 +0000)]
[InstCombine] add tests for fdiv+fmul; NFC

llvm-svn: 357782

5 years agogn build: Merge r357719
Nico Weber [Fri, 5 Apr 2019 16:57:34 +0000 (16:57 +0000)]
gn build: Merge r357719

llvm-svn: 357781

5 years ago[InstCombine] add tests for sqrt+fdiv+fmul; NFC
Sanjay Patel [Fri, 5 Apr 2019 16:52:57 +0000 (16:52 +0000)]
[InstCombine] add tests for sqrt+fdiv+fmul; NFC

Examples based on recent llvm-dev thread. These are specific
patterns of more general enhancements that would solve these.

llvm-svn: 357780

5 years ago[CUDA][Windows] Last fix for the clang Bug 38811 "Clang fails to compile with CUDA...
Evgeny Mankov [Fri, 5 Apr 2019 16:51:10 +0000 (16:51 +0000)]
[CUDA][Windows] Last fix for the clang Bug 38811 "Clang fails to compile with CUDA-9.x on Windows" (https://bugs.llvm.org/show_bug.cgi?id=38811).

[IMPORTANT]
With that last fix, CUDA has just started being compiling by clang on Windows after nearly a year and two clang’s major releases (7 and 8).
As long as the last LLVM release, in which clang was compiling CUDA on Windows successfully, was 6.0.1, this fix and two previous have to be included into upcoming 7.1.0 and 8.0.1 releases.

[How to repro]
clang++.exe -x cuda "c:\ProgramData\NVIDIA Corporation\CUDA Samples\v9.0\0_Simple\simplePrintf\simplePrintf.cu" -I"c:\ProgramData\NVIDIA Corporation\CUDA Samples\v9.0\common\inc" --cuda-gpu-arch=sm_50 --cuda-path="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0" -L"c:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0\lib\x64" -lcudart.lib  -v

[Output]
In file included from C:\GIT\LLVM\trunk-for-submits\llvm-64-release-vs2017-15.9.9\dist\lib\clang\9.0.0\include\__clang_cuda_runtime_wrapper.h:327:
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0/include\crt/math_functions.hpp:390:11: error: no matching function for call to '__isinfl'
  return (__isinfl(a) != 0);
          ^~~~~~~~
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0/include\crt/math_functions.hpp:2662:14: note: candidate function not viable: call to __host__ function from __device__ function
__func__(int __isinfl(long double a))
             ^
In file included from <built-in>:1:
In file included from C:\GIT\LLVM\trunk-for-submits\llvm-64-release-vs2017-15.9.9\dist\lib\clang\9.0.0\include\__clang_cuda_runtime_wrapper.h:327:
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0/include\crt/math_functions.hpp:438:11: error: no matching function for call to '__isnanl'
  return (__isnanl(a) != 0);
          ^~~~~~~~
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0/include\crt/math_functions.hpp:2672:14: note: candidate function not viable: call to __host__ function from __device__ function
__func__(int __isnanl(long double a))
             ^
In file included from <built-in>:1:
In file included from C:\GIT\LLVM\trunk-for-submits\llvm-64-release-vs2017-15.9.9\dist\lib\clang\9.0.0\include\__clang_cuda_runtime_wrapper.h:327:
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0/include\crt/math_functions.hpp:486:11: error: no matching function for call to '__finitel'
  return (__finitel(a) != 0);
          ^~~~~~~~~
C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0/include\crt/math_functions.hpp:2652:14: note: candidate function not viable: call to __host__ function from __device__ function
__func__(int __finitel(long double a))
             ^
3 errors generated when compiling for sm_50.

[Solution]
Add missing long double device functions' declarations. Provide only declarations to prevent any use of long double on the device side, because CUDA does not support long double on the device side.

[Testing]
{Windows 10, Ubuntu 16.04.5}/{Visual C++ 2017 15.9.9, gcc+ 5.4.0}/CUDA {8.0, 9.0, 9.1, 9.2, 10.0, 10.1}

Reviewed by: Artem Belevich

Differential Revision: http://reviews.llvm.org/D60220

llvm-svn: 357779

5 years agolit: support long paths on Windows
Saleem Abdulrasool [Fri, 5 Apr 2019 16:48:00 +0000 (16:48 +0000)]
lit: support long paths on Windows

Use ctypes to call into SHFileOperationW with the extended NT path to allow us
to remove paths which exceed 261 characters on Windows. This functionality is
exercised by swift's test suite.

llvm-svn: 357778

5 years agoAdd documentation for PDB TPI/IPI Stream.
Zachary Turner [Fri, 5 Apr 2019 16:43:42 +0000 (16:43 +0000)]
Add documentation for PDB TPI/IPI Stream.

llvm-svn: 357777

5 years ago[InstCombine] add test to show reassociation that creates a denormal constant; NFC
Sanjay Patel [Fri, 5 Apr 2019 16:42:21 +0000 (16:42 +0000)]
[InstCombine] add test to show reassociation that creates a denormal constant; NFC

llvm-svn: 357776

5 years ago[libc++] Fix error flags and exceptions propagated from input stream operations
Louis Dionne [Fri, 5 Apr 2019 16:33:37 +0000 (16:33 +0000)]
[libc++] Fix error flags and exceptions propagated from input stream operations

Summary:
This is a re-application of r357533 and r357531. They had been reverted
because we thought the commits broke the LLDB data formatters, but it
turns out this was because only r357531 had been included in the CI
run.

Before this patch, we would only ever throw an exception if the badbit
was set on the stream. The Standard is currently very unclear on how
exceptions should be propagated and what error flags should be set by
the input stream operations. This commit changes libc++ to behave under
a different (but valid) interpretation of the Standard. This interpretation
of the Standard matches what other implementations are doing.

This effectively implements the wording in p1264r0. It hasn't been voted
into the Standard yet, however there is wide agreement that the fix is
correct and it's just a matter of time before the fix is standardized.

PR21586
PR15949
rdar://problem/15347558

Reviewers: mclow.lists, EricWF

Subscribers: christof, dexonsmith, cfe-commits

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

llvm-svn: 357775

5 years agoRevert "[llvm-readobj] Improve error message for --string-dump"
Stephen Tozer [Fri, 5 Apr 2019 16:32:25 +0000 (16:32 +0000)]
Revert "[llvm-readobj] Improve error message for --string-dump"

This reverts commit 681b0798dbbc6b3500c9930977ec8a274b142acb.

Reverted due to causing build failures: llvm-svn: 357772

llvm-svn: 357774

5 years agoChange some dyn_cast to more apropriate isa. NFC
Fangrui Song [Fri, 5 Apr 2019 16:16:23 +0000 (16:16 +0000)]
Change some dyn_cast to more apropriate isa. NFC

llvm-svn: 357773

5 years ago[llvm-readobj] Improve error message for --string-dump
Stephen Tozer [Fri, 5 Apr 2019 16:15:50 +0000 (16:15 +0000)]
[llvm-readobj] Improve error message for --string-dump

Fixes bug 40630: https://bugs.llvm.org/show_bug.cgi?id=40630

This patch changes the error message when the section specified by
--string-dump cannot be found by including the name of the section in
the error message and changing the prefix text to not imply that the
file itself was invalid. As part of this change some uses of
std::error_code have been replaced with the llvm Error class to better
encapsulate the error info (rather than passing File strings around),
and the WithColor class replaces string literal error prefixes.

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

llvm-svn: 357772

5 years ago[format] Add correct punctuation to comment
Stephen Tozer [Fri, 5 Apr 2019 15:59:07 +0000 (15:59 +0000)]
[format] Add correct punctuation to comment

Test commit that adds a grammatically correct full stop to a single
comment.

llvm-svn: 357771

5 years ago[Tooling] add a Heuristic field indicating that a CompileCommand was guessed.
Sam McCall [Fri, 5 Apr 2019 15:22:20 +0000 (15:22 +0000)]
[Tooling] add a Heuristic field indicating that a CompileCommand was guessed.

Summary:
Use cases:
 - a tool that dumps the heuristic used for each header in a project can
   be used to evaluate changes to the heuristic
 - we want to expose this information to users in clangd as it affects
   accuracy/reliability of editor features
 - express interpolation tests more directly

Reviewers: ilya-biryukov, klimek

Subscribers: ioeric, kadircet, cfe-commits

Tags: #clang

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

llvm-svn: 357770

5 years agoAdd an option do not dump the generated object on disk
Guillaume Chatelet [Fri, 5 Apr 2019 15:18:59 +0000 (15:18 +0000)]
Add an option do not dump the generated object on disk

Reviewers: courbet

Subscribers: llvm-commits, bdb

Tags: #llvm

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

llvm-svn: 357769

5 years ago[LibTooling] Add Transformer, a library for source-to-source transformations.
Yitzhak Mandelbaum [Fri, 5 Apr 2019 15:14:05 +0000 (15:14 +0000)]
[LibTooling] Add Transformer, a library for source-to-source transformations.

Summary: Adds a basic version of Transformer, a library supporting the concise specification of clang-based source-to-source transformations.  A full discussion of the end goal can be found on the cfe-dev list with subject "[RFC] Easier source-to-source transformations with clang tooling".

Reviewers: ilya-biryukov

Reviewed By: ilya-biryukov

Subscribers: ioeric, ABataev, mgorny, jfb, jdoerfert, cfe-commits

Tags: #clang

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

llvm-svn: 357768

5 years ago[ExpandMemCmp][NFC] Add tests for `memcmp(p, q, n) < 0` case.
Clement Courbet [Fri, 5 Apr 2019 15:03:25 +0000 (15:03 +0000)]
[ExpandMemCmp][NFC] Add tests for `memcmp(p, q, n) < 0` case.

llvm-svn: 357767

5 years ago[SelectionDAG] Add fcmp UNDEF handling to SelectionDAG::FoldSetCC
Simon Pilgrim [Fri, 5 Apr 2019 14:56:21 +0000 (14:56 +0000)]
[SelectionDAG] Add fcmp UNDEF handling to SelectionDAG::FoldSetCC

Second half of PR40800, this patch adds DAG undef handling to fcmp instructions to match the behavior in llvm::ConstantFoldCompareInstruction, this permits constant folding of vector comparisons where some elements had been reduced to UNDEF (by SimplifyDemandedVectorElts etc.).

This involves a lot of tweaking to reduced tests as bugpoint loves to reduce fcmp arguments to undef........

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

llvm-svn: 357765

5 years ago[LibTooling] Add "SourceCode" library for functions relating to source-code manipulation.
Yitzhak Mandelbaum [Fri, 5 Apr 2019 14:05:03 +0000 (14:05 +0000)]
[LibTooling] Add "SourceCode" library for functions relating to source-code manipulation.

Summary:
Introduces a utility library in Refactoring/ to collect routines related to
source-code manipulation.  In this change, we move "extended-range" functions
from the FixIt library (in clangTooling) to this new library.

We need to use this functionality in Refactoring/ and cannot access it if it
resides in Tooling/, because that would cause clangToolingRefactor to depend on
clangTooling, which would be a circular dependency.

Reviewers: ilya-biryukov, ioeric

Reviewed By: ilya-biryukov

Subscribers: mgorny, cfe-commits

Tags: #clang

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

llvm-svn: 357764

5 years agoGlobalISel: Add another overload of buildUnmerge
Matt Arsenault [Fri, 5 Apr 2019 14:03:07 +0000 (14:03 +0000)]
GlobalISel: Add another overload of buildUnmerge

It's annoying to have to create an array of the result type,
particularly when you don't care about the size of the value.

llvm-svn: 357763

5 years agoAMDGPU/GlobalISel: Fix non-power-of-2 select
Matt Arsenault [Fri, 5 Apr 2019 14:03:04 +0000 (14:03 +0000)]
AMDGPU/GlobalISel: Fix non-power-of-2 select

llvm-svn: 357762

5 years ago[llvm] Add isa_and_nonnull
Don Hinton [Fri, 5 Apr 2019 13:59:24 +0000 (13:59 +0000)]
[llvm] Add isa_and_nonnull

Summary:
Add new ``isa_and_nonnull<>`` operator that works just like
the ``isa<>`` operator, except that it allows for a null pointer as an
argument (which it then returns false).

Reviewers: lattner, aaron.ballman, greened

Reviewed By: lattner

Subscribers: hubert.reinterpretcast, llvm-commits

Tags: #llvm

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

llvm-svn: 357761

5 years ago[DAGCombiner][x86] scalarize splatted vector FP ops
Sanjay Patel [Fri, 5 Apr 2019 13:32:17 +0000 (13:32 +0000)]
[DAGCombiner][x86] scalarize splatted vector FP ops

There are a variety of vector patterns that may be profitably reduced to a
scalar op when scalar ops are performed using a subset (typically, the
first lane) of the vector register file.

For x86, this is true for float/double ops and element 0 because
insert/extract is just a sub-register rename.

Other targets should likely enable the hook in a similar way.

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

llvm-svn: 357760

5 years ago[TextAPI] Fix off-by-one error in the bit index extraction loop
Petar Jovanovic [Fri, 5 Apr 2019 12:58:15 +0000 (12:58 +0000)]
[TextAPI] Fix off-by-one error in the bit index extraction loop

The loop in findNextSetBit() runs one pass more than it should.

On 64-bit architectures this does not cause a problem, but 32-bit
architectures mask the shift count to 5 bits which limits the number of
shifts inside a range of 0 to 31. Shifting by 32 has the same effect as
shifting by 0, so if the first bit in the set is 1, the function will return
with Index different from EndIndexVal. Because of that, range-based for
loops iterating thorough architectures will continue until hitting a 0 in
the set, resulting in n additional iterations, where n is equal to the
number of consecutive 1 bits at the start the set.

Ultimately TBDv1.WriteFile and TBDv2.WriteFile will output additional
architectures causing a failure in the unit tests.

Patch by Milos Stojanovic.

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

llvm-svn: 357759

5 years ago[Symbolize] Replace map<SymbolDesc, StringRef> with sorted vector
Fangrui Song [Fri, 5 Apr 2019 12:52:04 +0000 (12:52 +0000)]
[Symbolize] Replace map<SymbolDesc, StringRef> with sorted vector

llvm-svn: 357758

5 years ago[X86][AVX] Add PR34584 masked store test cases
Simon Pilgrim [Fri, 5 Apr 2019 11:34:30 +0000 (11:34 +0000)]
[X86][AVX] Add PR34584 masked store test cases

llvm-svn: 357757

5 years ago[X86] Add SSE/AVX1/AVX2 masked trunc+store tests
Simon Pilgrim [Fri, 5 Apr 2019 11:22:28 +0000 (11:22 +0000)]
[X86] Add SSE/AVX1/AVX2 masked trunc+store tests

llvm-svn: 357756

5 years agomodify-python-lldb.py: Insert initialization code with swig instead
Pavel Labath [Fri, 5 Apr 2019 09:56:55 +0000 (09:56 +0000)]
modify-python-lldb.py: Insert initialization code with swig instead

This is the last functional change to the generated python module being
done by modify-python-lldb.py. The remaining code just deals with
reformatting of comments.

llvm-svn: 357755

5 years agoFix r357749 for big-endian architectures
Pavel Labath [Fri, 5 Apr 2019 08:43:54 +0000 (08:43 +0000)]
Fix r357749 for big-endian architectures

We need to read the strings from the minidump files as little-endian,
regardless of the host byte order.

I definitely remember thinking about this case while writing the patch
(and in fact, I have implemented that for the "write" case), but somehow
I have ended up not implementing the byte swapping when reading the
data. This adds the necessary byte-swapping and should hopefully fix
test failures on big-endian bots.

llvm-svn: 357754

5 years ago[Sanitizers] Provide __internal_dup on Solaris
Rainer Orth [Fri, 5 Apr 2019 08:42:21 +0000 (08:42 +0000)]
[Sanitizers] Provide __internal_dup on Solaris

Both LLVM 8.0.0 and current trunk fail to link libclang_rt.ubsan.standalone-*.so
on Solaris 11/x86 with GCC 8.1.0:

  Undefined first referenced
   symbol       in file
  Scanning dependencies of target clang_rt.asan_cxx-x86_64
  __sanitizer::internal_dup(int)      ../sanitizer_common/CMakeFiles/RTSanitizerCommon.i386.dir/sanitizer_posix.cc.o
  ld: fatal: symbol referencing errors
  collect2: error: ld returned 1 exit status
  make[2]: *** [projects/compiler-rt/lib/ubsan/CMakeFiles/clang_rt.ubsan_standalone-dynamic-i386.dir/build.make:233: lib/clang/9.0.0/lib/sunos/libclang_rt.ubsan_standalone-i386.so] Error 1

Fixed by providing an implementation, which allowed the i386-pc-solaris2.11 build
to finish.

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

llvm-svn: 357753