platform/upstream/llvm.git
6 years ago[AArch64] optimise v4f16 fcmps to utilise vector instructions
Carey Williams [Mon, 22 Jan 2018 14:16:11 +0000 (14:16 +0000)]
[AArch64] optimise v4f16 fcmps to utilise vector instructions

Improves the code generation for v4f16 FCMP instructions when FullFP16 is not supported.
Generating FCTVL(s) rather than a longer series of FCVTs.

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

llvm-svn: 323118

6 years ago[ThinLTO] Re-commit of dot dumper after test fix
Eugene Leviant [Mon, 22 Jan 2018 13:35:40 +0000 (13:35 +0000)]
[ThinLTO] Re-commit of dot dumper after test fix

llvm-svn: 323116

6 years ago[analyzer] Model and check unrepresentable left shifts
Gabor Horvath [Mon, 22 Jan 2018 13:32:10 +0000 (13:32 +0000)]
[analyzer] Model and check unrepresentable left shifts

Patch by: Reka Nikolett Kovacs

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

llvm-svn: 323115

6 years agoFixing warnings caused by commit 323095
Marina Yatsina [Mon, 22 Jan 2018 13:24:10 +0000 (13:24 +0000)]
Fixing warnings caused by commit 323095

Change-Id: I4e1f81db2f5382a820f4016c23b243e4d5aebf51
llvm-svn: 323114

6 years agoRename DwarfAcceleratorTable to AppleAcceleratorTable. NFC
Pavel Labath [Mon, 22 Jan 2018 13:17:23 +0000 (13:17 +0000)]
Rename DwarfAcceleratorTable to AppleAcceleratorTable. NFC

This frees up the first name to be used as an base class for the
apple table and the dwarf5 .debug_names accel table. The rename  was
split off from D42297 (adding of debug_names support), which is still
under review.

llvm-svn: 323113

6 years agoFix MSVC implicit double-float truncation warning. NFCI.
Simon Pilgrim [Mon, 22 Jan 2018 13:15:16 +0000 (13:15 +0000)]
Fix MSVC implicit double-float truncation warning. NFCI.

llvm-svn: 323112

6 years ago[clangd] Try to fix build bot failue in r323101
Eric Liu [Mon, 22 Jan 2018 13:03:25 +0000 (13:03 +0000)]
[clangd] Try to fix build bot failue in r323101

llvm-svn: 323111

6 years ago[X86][AVX] Add test case for PR34370
Simon Pilgrim [Mon, 22 Jan 2018 12:27:22 +0000 (12:27 +0000)]
[X86][AVX] Add test case for PR34370

llvm-svn: 323106

6 years ago[X86][SSE] Add ISD::VECTOR_SHUFFLE to faux shuffle decoding (Reapplied)
Simon Pilgrim [Mon, 22 Jan 2018 12:05:17 +0000 (12:05 +0000)]
[X86][SSE] Add ISD::VECTOR_SHUFFLE to faux shuffle decoding (Reapplied)

Primarily, this allows us to use the aggressive extraction mechanisms in combineExtractWithShuffle earlier and make use of UNDEF elements that may be lost during lowering.

Reapplied after rL322279 was reverted at rL322335 due to PR35918, underlying issue was fixed at rL322644.

llvm-svn: 323104

6 years agoRevert "[SymbolFilePDB] Fix null array access when parsing the type of a function...
Pavel Labath [Mon, 22 Jan 2018 11:51:56 +0000 (11:51 +0000)]
Revert "[SymbolFilePDB] Fix null array access when parsing the type of a function without any arguments, i.e. 'int main()' and add support to test it"

This reverts commit r322995, as it breaks
lldb-Unit::SymbolFilePDBTests.TestTypedefs
<http://lab.llvm.org:8011/builders/lldb-windows7-android/builds/7715>.

llvm-svn: 323102

6 years ago[clangd] Add support for different file URI schemas.
Eric Liu [Mon, 22 Jan 2018 11:48:20 +0000 (11:48 +0000)]
[clangd] Add support for different file URI schemas.

Summary: I will replace the existing URI struct in Protocol.h with the new URI and rename FileURI to URI in a followup patch.

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: jkorous-apple, klimek, mgorny, ilya-biryukov, cfe-commits

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

llvm-svn: 323101

6 years agoAdd SysV Abi for PPC64le
Pavel Labath [Mon, 22 Jan 2018 11:27:43 +0000 (11:27 +0000)]
Add SysV Abi for PPC64le

Summary:
This patch implements the ABI Plugin for PPC64le. It was based on the
ABI for PPC64. It also enables LLDB to evaluate expressions using JIT.

Reviewers: labath, clayborg, jhibbits, davide

Reviewed By: labath, clayborg, jhibbits, davide

Subscribers: davide, JDevlieghere, chmeee, emaste, jhibbits, hfinkel, lldb-commits, nemanjai, luporl, lbianc, mgorny, anajuliapc, kbarton

Differential Revision: https://reviews.llvm.org/D41702
Patch by Alexandre Yukio Yamashita <alexandre.yamashita@eldorado.org.br>

llvm-svn: 323100

6 years agoAdd test for interaction of --gc-sections and undefined references
James Henderson [Mon, 22 Jan 2018 10:58:06 +0000 (10:58 +0000)]
Add test for interaction of --gc-sections and undefined references

It is possible for a link to fail with an undefined reference, unless
--gc-sections is specified, removing the reference in the process. This
doesn't look to be tested anywhere explicitly, so I thought it useful
to add a test for it to ensure the behaviour is maintained.

Reviewers: ruiu

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

llvm-svn: 323099

6 years ago[AArch64][SVE] Asm: Predicate patterns
Sander de Smalen [Mon, 22 Jan 2018 10:46:00 +0000 (10:46 +0000)]
[AArch64][SVE] Asm: Predicate patterns

Summary:
This patch adds support for parsing/printing of named or unnamed
patterns that are used in SVE's PTRUE instruction, amongst others.

The pattern can be specified as a named pattern to initialize the predicate
vector or it can be specified as an immediate in the range 0-31.

Reviewers: fhahn, rengolin, evandro, mcrosier, t.p.northover

Reviewed By: fhahn

Subscribers: aemerson, javed.absar, tschuett, kristof.beyls, llvm-commits

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

llvm-svn: 323098

6 years ago[YAML] Plain scalars can not begin with most indicators.
Haojian Wu [Mon, 22 Jan 2018 10:20:48 +0000 (10:20 +0000)]
[YAML] Plain scalars can not begin with most indicators.

Summary:
Discovered when clangd loads YAML symbols, some symbol documentations
start with indicators (e.g. "-"), but YAML prints them as plain scalars
(no quotes), which make the YAML parser fail to parse.

For these kind of strings, we need quotes.

Reviewers: sammccall

Reviewed By: sammccall

Subscribers: ilya-biryukov, ioeric, llvm-commits, cfe-commits

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

llvm-svn: 323097

6 years agoBreak false dependencies for POPCNT, LZCNT, TZCNT
Marina Yatsina [Mon, 22 Jan 2018 10:07:01 +0000 (10:07 +0000)]
Break false dependencies for POPCNT, LZCNT, TZCNT

Add POPCNT, LZCNT, TZCNT to the list of instructions that have false dependency.
Add a test to make sure BreakFalseDeps breaks the dependencies for these instructions.
Update affected tests.

This fixes bugzilla https://bugs.llvm.org/show_bug.cgi?id=33869

This is the final of multiple patches that fix this bugzilla.
Most of the patches are intended at refactoring the existent code.

Reviews of the refactoring done to enable this change:
https://reviews.llvm.org/D40330
https://reviews.llvm.org/D40331
https://reviews.llvm.org/D40332
https://reviews.llvm.org/D40333

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

Change-Id: If95cbf1a3f5c7dccff8f1b22ecb397542147303d
llvm-svn: 323096

6 years agoSeparate LoopTraversal, ReachingDefAnalysis and BreakFalseDeps into their own files.
Marina Yatsina [Mon, 22 Jan 2018 10:06:50 +0000 (10:06 +0000)]
Separate LoopTraversal, ReachingDefAnalysis and BreakFalseDeps into their own files.

This is the one of multiple patches that fix bugzilla https://bugs.llvm.org/show_bug.cgi?id=33869
Most of the patches are intended at refactoring the existent code.

Additional relevant reviews:
https://reviews.llvm.org/D40330
https://reviews.llvm.org/D40331
https://reviews.llvm.org/D40332
https://reviews.llvm.org/D40334

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

Change-Id: Ie5f8eb34d98cfdfae23a3072eb69b5794f0e2d56
llvm-svn: 323095

6 years agoRename ExecutionDepsFix files to ExecutionDomainFix
Marina Yatsina [Mon, 22 Jan 2018 10:06:33 +0000 (10:06 +0000)]
Rename ExecutionDepsFix files to ExecutionDomainFix

This is the one of multiple patches that fix bugzilla https://bugs.llvm.org/show_bug.cgi?id=33869
Most of the patches are intended at refactoring the existent code.

Additional relevant reviews:
https://reviews.llvm.org/D40330
https://reviews.llvm.org/D40331
https://reviews.llvm.org/D40333
https://reviews.llvm.org/D40334

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

Change-Id: I6a048cca7fdafbfc42fb1bac94343e483befded8
llvm-svn: 323094

6 years agoExecutionDepsFix refactoring:
Marina Yatsina [Mon, 22 Jan 2018 10:06:18 +0000 (10:06 +0000)]
ExecutionDepsFix refactoring:
- clang-format

This is the one of multiple patches that fix bugzilla https://bugs.llvm.org/show_bug.cgi?id=33869
Most of the patches are intended at refactoring the existent code.

Additional relevant reviews:
https://reviews.llvm.org/D40330
https://reviews.llvm.org/D40332
https://reviews.llvm.org/D40333
https://reviews.llvm.org/D40334

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

Change-Id: I131b126af13bc743bc5d69d83699e52b9b720979
llvm-svn: 323093

6 years agoExecutionDepsFix refactoring:
Marina Yatsina [Mon, 22 Jan 2018 10:06:10 +0000 (10:06 +0000)]
ExecutionDepsFix refactoring:
- Moving comments to class definition in header file
- Changing comments to doxygen style
- Rephrase loop traversal explaining comment

This is the one of multiple patches that fix bugzilla https://bugs.llvm.org/show_bug.cgi?id=33869
Most of the patches are intended at refactoring the existent code.

Additional relevant reviews:
https://reviews.llvm.org/D40330
https://reviews.llvm.org/D40332
https://reviews.llvm.org/D40333
https://reviews.llvm.org/D40334

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

Change-Id: I9a12618db5b66128611fa71b54a233414f6012ac
llvm-svn: 323092

6 years agoExecutionDepsFix refactoring:
Marina Yatsina [Mon, 22 Jan 2018 10:06:01 +0000 (10:06 +0000)]
ExecutionDepsFix refactoring:
- Removing LiveRegs

This is the one of multiple patches that fix bugzilla https://bugs.llvm.org/show_bug.cgi?id=33869
Most of the patches are intended at refactoring the existent code.

Additional relevant reviews:
https://reviews.llvm.org/D40330
https://reviews.llvm.org/D40332
https://reviews.llvm.org/D40333
https://reviews.llvm.org/D40334

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

Change-Id: I8ab56d99951a6d6981542f68d94c1f624f3c9fbf
llvm-svn: 323091

6 years agoExecutionDepsFix refactoring:
Marina Yatsina [Mon, 22 Jan 2018 10:05:53 +0000 (10:05 +0000)]
ExecutionDepsFix refactoring:
- Changing LiveRegs to be a vector

This is the one of multiple patches that fix bugzilla https://bugs.llvm.org/show_bug.cgi?id=33869
Most of the patches are intended at refactoring the existent code.

Additional relevant reviews:
https://reviews.llvm.org/D40330
https://reviews.llvm.org/D40332
https://reviews.llvm.org/D40333
https://reviews.llvm.org/D40334

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

Change-Id: I9cdd364bd7bf2a0bf61ea41a48d4bd310ec3bce4
llvm-svn: 323090

6 years agoExecutionDepsFix refactoring:
Marina Yatsina [Mon, 22 Jan 2018 10:05:45 +0000 (10:05 +0000)]
ExecutionDepsFix refactoring:
- Changing DenseMap<MBB*, LiveReg*> to SmallVector<LiveReg*>
- Now the MBB number will be the index of LiveReg in the vector.
- Adding asserts

This patch is NFC.

This is the one of multiple patches that fix bugzilla https://bugs.llvm.org/show_bug.cgi?id=33869
Most of the patches are intended at refactoring the existent code.

Additional relevant reviews:
https://reviews.llvm.org/D40330
https://reviews.llvm.org/D40332
https://reviews.llvm.org/D40333
https://reviews.llvm.org/D40334

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

Change-Id: If4a3f141693d0361ddb292432337dbb63a1e69ee
llvm-svn: 323089

6 years agoExecutionDepsFix refactoring:
Marina Yatsina [Mon, 22 Jan 2018 10:05:37 +0000 (10:05 +0000)]
ExecutionDepsFix refactoring:
- Remove unneeded includes and unneeded members
- Use range iterators
- Variable renaming, typedefs, extracting constants
- Removing {} from one line ifs

This patch is NFC.

This is the one of multiple patches that fix bugzilla https://bugs.llvm.org/show_bug.cgi?id=33869
Most of the patches are intended at refactoring the existent code.

Additional relevant reviews:
https://reviews.llvm.org/D40330
https://reviews.llvm.org/D40332
https://reviews.llvm.org/D40333
https://reviews.llvm.org/D40334

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

Change-Id: Ib59060ab3fa5bee3bf2ca2045c24e572635ee7f6
llvm-svn: 323088

6 years agoSeparate ExecutionDepsFix into 4 parts:
Marina Yatsina [Mon, 22 Jan 2018 10:05:23 +0000 (10:05 +0000)]
Separate ExecutionDepsFix into 4 parts:
1. ReachingDefsAnalysis - Allows to identify for each instruction what is the “closest” reaching def of a certain register. Used by BreakFalseDeps (for clearance calculation) and ExecutionDomainFix (for arbitrating conflicting domains).
2. ExecutionDomainFix - Changes the variant of the instructions in order to minimize domain crossings.
3. BreakFalseDeps - Breaks false dependencies.
4. LoopTraversal - Creatws a traversal order of the basic blocks that is optimal for loops (introduced in revision L293571). Both ExecutionDomainFix and ReachingDefsAnalysis use this to determine the order they will traverse the basic blocks.

This also included the following changes to ExcecutionDepsFix original logic:
1. BreakFalseDeps and ReachingDefsAnalysis logic no longer restricted by a register class.
2. ReachingDefsAnalysis tracks liveness of reg units instead of reg indices into a given reg class.

Additional changes in affected files:
1. X86 and ARM targets now inherit from ExecutionDomainFix instead of ExecutionDepsFix. BreakFalseDeps also was added to the passes they activate.
2. Comments and references to ExecutionDepsFix replaced with ExecutionDomainFix and BreakFalseDeps, as appropriate.

Additional refactoring changes will follow.

This commit is (almost) NFC.
The only functional change is that now BreakFalseDeps will break dependency for all register classes.
Since no additional instructions were added to the list of instructions that have false dependencies, there is no actual change yet.
In a future commit several instructions (and tests) will be added.

This is the first of multiple patches that fix bugzilla https://bugs.llvm.org/show_bug.cgi?id=33869
Most of the patches are intended at refactoring the existent code.

Additional relevant reviews:
https://reviews.llvm.org/D40331
https://reviews.llvm.org/D40332
https://reviews.llvm.org/D40333
https://reviews.llvm.org/D40334

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

Change-Id: Icaeb75e014eff96a8f721377783f9a3e6c679275
llvm-svn: 323087

6 years agoFix TestTargetSymbolsAddCommand [getBuildArtifact refactor]
Pavel Labath [Mon, 22 Jan 2018 09:55:30 +0000 (09:55 +0000)]
Fix TestTargetSymbolsAddCommand [getBuildArtifact refactor]

llvm-svn: 323086

6 years agoFix memory leaks in MinidumpParserTest
Raphael Isemann [Mon, 22 Jan 2018 09:48:40 +0000 (09:48 +0000)]
Fix memory leaks in MinidumpParserTest

Summary: We never delete the allocated RegisterContext objects, causing those tests to fail with enabled memory sanitizer.

Reviewers: dvlahovski, zturner

Reviewed By: zturner

Subscribers: zturner, lldb-commits

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

llvm-svn: 323085

6 years ago[BinaryFormat] Add .debug_names support
Pavel Labath [Mon, 22 Jan 2018 09:41:36 +0000 (09:41 +0000)]
[BinaryFormat] Add .debug_names support

Summary:
This adds a definition of the .debug_names section and the new constants
(DW_IDX_???) which are used in it.

Reviewers: JDevlieghere, aprantl

Subscribers: llvm-commits

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

llvm-svn: 323084

6 years ago[lsan] Respect log_path option in standalone LSan
Maxim Ostapenko [Mon, 22 Jan 2018 09:30:27 +0000 (09:30 +0000)]
[lsan] Respect log_path option in standalone LSan

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

llvm-svn: 323083

6 years agoFix use after free in DiskFilesOrDirectories
Raphael Isemann [Mon, 22 Jan 2018 09:17:16 +0000 (09:17 +0000)]
Fix use after free in DiskFilesOrDirectories

Summary:
We copy the local variable `Resolved` into `Storage` to keep it around. However, we then still let the `SearchDir` ref point to `Resolved` which then is used to access the already freed memory later on. With this patch we point to `Storage` which doesn't get deleted after the current scope exits.

Discovered by memory sanitizer in the CompletionTest.DirCompletionUsername test.

Reviewers: zturner

Subscribers: lldb-commits

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

llvm-svn: 323082

6 years agoFix unrepresentable float value in ScalarTest
Raphael Isemann [Mon, 22 Jan 2018 08:11:29 +0000 (08:11 +0000)]
Fix unrepresentable float value in ScalarTest

Summary: float can't represent the given value in the literal, so we get this UB error: `runtime error: 1.23457e+48 is outside the range of representable values of type 'float'`. The test seems to not rely on this specific value, so let's just choose a smaller one that can be represented.

Reviewers: uweigand

Subscribers: lldb-commits

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

llvm-svn: 323081

6 years ago[NFC] fix trivial typos in comments
Hiroshi Inoue [Mon, 22 Jan 2018 07:51:37 +0000 (07:51 +0000)]
[NFC] fix trivial typos in comments

"the the" -> "the"

llvm-svn: 323080

6 years agoRevert [SCEV] Fix isLoopEntryGuardedByCond usage
Serguei Katkov [Mon, 22 Jan 2018 07:47:02 +0000 (07:47 +0000)]
Revert [SCEV] Fix isLoopEntryGuardedByCond usage

It causes buildbot failures. New added assert is fired.
It seems not all usages of isLoopEntryGuardedByCond are fixed.

llvm-svn: 323079

6 years ago[NFC] fix trivial typos in comments
Hiroshi Inoue [Mon, 22 Jan 2018 07:44:38 +0000 (07:44 +0000)]
[NFC] fix trivial typos in comments

"the the" -> "the"

llvm-svn: 323078

6 years ago[SCEV] Fix isLoopEntryGuardedByCond usage
Serguei Katkov [Mon, 22 Jan 2018 07:31:41 +0000 (07:31 +0000)]
[SCEV] Fix isLoopEntryGuardedByCond usage

ScalarEvolution::isKnownPredicate invokes isLoopEntryGuardedByCond without check
that SCEV is available at entry point of the loop. It is incorrect and fixed by patch.

Reviewers: sanjoy, mkazantsev, anna, dorit
Reviewed By: mkazantsev
Subscribers: llvm-commits
Differential Revision: https://reviews.llvm.org/D42165

llvm-svn: 323077

6 years agoFix memory leaks in TestArm64InstEmulation
Raphael Isemann [Mon, 22 Jan 2018 07:22:13 +0000 (07:22 +0000)]
Fix memory leaks in TestArm64InstEmulation

Summary: We never delete the created instances, so those test fail with the memory sanitizer.

Reviewers: jasonmolenda

Reviewed By: jasonmolenda

Subscribers: aemerson, javed.absar, kristof.beyls, lldb-commits

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

llvm-svn: 323076

6 years agoMake loop counter unsigned in SymbolFilePDB::GetCompileUnitIndex
Raphael Isemann [Mon, 22 Jan 2018 06:56:09 +0000 (06:56 +0000)]
Make loop counter unsigned in SymbolFilePDB::GetCompileUnitIndex

Summary: This fixes a clang warning.

Reviewers: zturner

Reviewed By: zturner

Subscribers: zturner, lldb-commits

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

llvm-svn: 323075

6 years ago[NFC] fix trivial typos in comments
Hiroshi Inoue [Mon, 22 Jan 2018 05:54:46 +0000 (05:54 +0000)]
[NFC] fix trivial typos in comments

"the the" -> "the"

llvm-svn: 323074

6 years ago[ORC] Add orc::SymbolResolver, a Orc/Legacy API interop header, and an
Lang Hames [Mon, 22 Jan 2018 03:00:31 +0000 (03:00 +0000)]
[ORC] Add orc::SymbolResolver, a Orc/Legacy API interop header, and an
orc::SymbolResolver to JITSymbolResolver adapter.

The new orc::SymbolResolver interface uses asynchronous queries for better
performance. (Asynchronous queries with bulk lookup minimize RPC/IPC overhead,
support parallel incoming queries, and expose more available work for
distribution). Existing ORC layers will soon be updated to use the
orc::SymbolResolver API rather than the legacy llvm::JITSymbolResolver API.

Because RuntimeDyld still uses JITSymbolResolver, this patch also includes an
adapter that wraps an orc::SymbolResolver with a JITSymbolResolver API.

llvm-svn: 323073

6 years agoReally comment out the constexpr tests.
Marshall Clow [Mon, 22 Jan 2018 01:51:49 +0000 (01:51 +0000)]
Really comment out the constexpr tests.

llvm-svn: 323072

6 years agoChange a static_assert to check for is_trivial instead of is_pod, as is mandated...
Marshall Clow [Mon, 22 Jan 2018 00:17:48 +0000 (00:17 +0000)]
Change a static_assert to check for is_trivial instead of is_pod, as is mandated by P0767.

llvm-svn: 323071

6 years agoimplement (but leave commented out) the constexpr tests from P0202 for std::merge...
Marshall Clow [Mon, 22 Jan 2018 00:11:44 +0000 (00:11 +0000)]
implement (but leave commented out) the constexpr tests from P0202 for std::merge. merge requires std::copy, which isn't constexpr yet.

llvm-svn: 323070

6 years agoClean up #include "DWARFCompileUnit.h"
Jan Kratochvil [Sun, 21 Jan 2018 18:03:17 +0000 (18:03 +0000)]
Clean up #include "DWARFCompileUnit.h"

Clean up needless+missing #include "DWARFCompileUnit.h" for split of
DWARFCompileUnit to DWARFUnit as discussed in D40466.

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

llvm-svn: 323069

6 years ago[InstCombine] (X << Y) / X -> 1 << Y
Sanjay Patel [Sun, 21 Jan 2018 16:14:51 +0000 (16:14 +0000)]
[InstCombine] (X << Y) / X -> 1 << Y

...when the shift is known to not overflow with the matching
signed-ness of the division.

This closes an optimization gap caused by canonicalizing mul
by power-of-2 to shl as shown in PR35709:
https://bugs.llvm.org/show_bug.cgi?id=35709

Patch by Anton Bikineev!

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

llvm-svn: 323068

6 years ago[InstSimplify] add baseline tests for (X << Y) % X -> 0; NFC
Sanjay Patel [Sun, 21 Jan 2018 15:36:15 +0000 (15:36 +0000)]
[InstSimplify] add baseline tests for (X << Y) % X -> 0; NFC

This is the 'rem' counterpart to D42032 and would be folded by
D42341.

Patch by Anton Bikineev.

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

llvm-svn: 323067

6 years agoTemporarily revert r323062 to investigate buildbot failures
Eugene Leviant [Sun, 21 Jan 2018 10:22:19 +0000 (10:22 +0000)]
Temporarily revert r323062 to investigate buildbot failures

llvm-svn: 323065

6 years ago[modules] Fix missing includes/typo in LLDB's includes. [NFC]
Raphael Isemann [Sun, 21 Jan 2018 09:54:19 +0000 (09:54 +0000)]
[modules] Fix missing includes/typo in LLDB's includes. [NFC]

Summary:
This patch adds missing includes to the LLDB headers inside `include/` as a first step of building LLDB's source with C++ modules. It also fixes this single `stds::` typo.

Some quick map why some non-obvious includes were necessary:
* lldb/lldb-defines.h for LLDB_INVALID_ADDRESS
* lldb/lldb-types.h for addr_t
* lldb/lldb-defines.h for DISALLOW_COPY_AND_ASSIG
* lldb/DataFormatters/TypeSynthetic.h for SyntheticChildrenFrontEnd

Reviewers: aprantl

Reviewed By: aprantl

Subscribers: zturner, lldb-commits

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

llvm-svn: 323064

6 years agoAn attempt to fix buildbot after rL323062
Eugene Leviant [Sun, 21 Jan 2018 08:49:07 +0000 (08:49 +0000)]
An attempt to fix buildbot after rL323062

llvm-svn: 323063

6 years ago[ThinLTO] Implement summary visualizer
Eugene Leviant [Sun, 21 Jan 2018 07:27:32 +0000 (07:27 +0000)]
[ThinLTO] Implement summary visualizer

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

llvm-svn: 323062

6 years ago[sanitizer] Pass the CMake compiler to custom libc++ build
Petr Hosek [Sun, 21 Jan 2018 03:22:22 +0000 (03:22 +0000)]
[sanitizer] Pass the CMake compiler to custom libc++ build

This addresses the error introduced in r323054 on some bots.

llvm-svn: 323061

6 years ago[ORC] Add a lookupFlags method to VSO.
Lang Hames [Sun, 21 Jan 2018 03:20:39 +0000 (03:20 +0000)]
[ORC] Add a lookupFlags method to VSO.

lookupFlags returns a SymbolFlagsMap for the requested symbols, along with a
set containing the SymbolStringPtr for any symbol not found in the VSO.

The JITSymbolFlags for each symbol will have been stripped of its transient
JIT-state flags (i.e. NotMaterialized, Materializing).

Calling lookupFlags does not trigger symbol materialization.

llvm-svn: 323060

6 years ago[ORC] More cleanup. NFC.
Lang Hames [Sun, 21 Jan 2018 03:20:36 +0000 (03:20 +0000)]
[ORC] More cleanup. NFC.

llvm-svn: 323059

6 years ago[Dominators] Remove misleading double-deletion test
Jakub Kuderski [Sun, 21 Jan 2018 03:07:16 +0000 (03:07 +0000)]
[Dominators] Remove misleading double-deletion test

Summary:
It's generally not safe to perform multiple DomTree updates without using the incremental API.

Although it is supposed to work in this particular case, the testcase is misleading/confusing, and it's better to remove it.

Reviewers: dberlin, brzycki, davide, grosser

Reviewed By: davide

Subscribers: llvm-commits

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

llvm-svn: 323058

6 years ago[ORC] Cleanup. NFC.
Lang Hames [Sun, 21 Jan 2018 02:24:45 +0000 (02:24 +0000)]
[ORC] Cleanup. NFC.

llvm-svn: 323057

6 years ago[DSE] Factor out common code [NFC]
Philip Reames [Sun, 21 Jan 2018 02:10:54 +0000 (02:10 +0000)]
[DSE] Factor out common code [NFC]

We already had the pointer being stored to in the MemLoc, reuse that code.  In merging cases, it turned out the interface of the getLocForWrite had become inconsitent with other related utilities.  Fix that by making sure the input passes hasAnalyzableWrite as well.

llvm-svn: 323056

6 years ago[DSE] Minor rename for clarity sake [NFC]
Philip Reames [Sun, 21 Jan 2018 01:44:33 +0000 (01:44 +0000)]
[DSE] Minor rename for clarity sake [NFC]

llvm-svn: 323055

6 years agoReland "[Fuzzer] Parametrize add_custom_libcxx"
Petr Hosek [Sun, 21 Jan 2018 01:01:53 +0000 (01:01 +0000)]
Reland "[Fuzzer] Parametrize add_custom_libcxx"

add_custom_libcxx uses the just built compiler and installs the
built libc++, e.g. for testing, neither of which is desirable in
case of Fuzzer where the libc++ should be built using the host
compiler and it's only linked into the libFuzzer and should never
be installed. This change introduces additional arguments to
add_custom_libcxx to allow parametrizing its behavior.

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

llvm-svn: 323054

6 years ago[cmake] Don't build Native llvm-config when cross compiling if passed by user.
Don Hinton [Sun, 21 Jan 2018 00:29:00 +0000 (00:29 +0000)]
[cmake] Don't build Native llvm-config when cross compiling if passed by user.

Summary:
Rename LLVM_CONFIG_EXE to LLVM_CONFIG_PATH, and avoid building it if
passed in by user.  This is the same way CLANG_TABLEGEN and
LLVM_TABLEGEN are handled, e.g., when -DLLVM_OPTIMIZED_TABLEGEN=ON is
passed.

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

llvm-svn: 323053

6 years ago[analyzer] Provide a check name when MallocChecker enables CStringChecker
Devin Coughlin [Sat, 20 Jan 2018 23:11:17 +0000 (23:11 +0000)]
[analyzer] Provide a check name when MallocChecker enables CStringChecker

Fix an assertion failure caused by a missing CheckName. The malloc checker
enables "basic" support in the CStringChecker, which causes some CString
bounds checks to be enabled. In this case, make sure that we have a
valid CheckName for the BugType.

llvm-svn: 323052

6 years ago[cmake] Use CLANG_BINARY_DIR to determine the build directory.
Vassil Vassilev [Sat, 20 Jan 2018 21:43:35 +0000 (21:43 +0000)]
[cmake] Use CLANG_BINARY_DIR to determine the build directory.

The patch puts the ClangConfig.cmake in the expected location  when clang is
embedded into a framework.

llvm-svn: 323051

6 years agoMore P0202 constexpr work. This commit adds fill/fill_n/generate/generate_n/unique...
Marshall Clow [Sat, 20 Jan 2018 20:14:32 +0000 (20:14 +0000)]
More P0202 constexpr work. This commit adds fill/fill_n/generate/generate_n/unique/unique_copy. I removed a specialization of fill_n that recognized when we were dealing with raw pointers and 1 byte trivially-assignable types and did a memset, because the compiler will do that optimization for us.

llvm-svn: 323050

6 years ago[ValueLattice] Use union to shave off ptr size bytes from elements.
Florian Hahn [Sat, 20 Jan 2018 19:52:16 +0000 (19:52 +0000)]
[ValueLattice] Use union to shave off ptr size bytes from elements.

By using a union for Constant* and ConstantRange we can shave off ptr
size bytes off lattice elements. On 64 bit systems, it brings down the
size to 40 bytes from 48 bytes.

Initialization of Range happens on-demand using placement new, if the
state changes to constantrange from non-constantrange. Similarly, the
Range object is destroyed if the state changes from constantrange to
non-constantrange.

Reviewers: reames, anna, davide

Reviewed By: reames, davide

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

llvm-svn: 323049

6 years ago[X86] Add an override of targetShrinkDemandedConstant to limit the damage that shrink...
Craig Topper [Sat, 20 Jan 2018 18:50:09 +0000 (18:50 +0000)]
[X86] Add an override of targetShrinkDemandedConstant to limit the damage that shrinkdemandedbits can do to zext_in_reg operations

Summary:
This patch adds an implementation of targetShrinkDemandedConstant that tries to keep shrinkdemandedbits from removing bits that would otherwise have been recognized as a movzx.

We still need a follow patch to stop moving ands across srl if the and could be represented as a movzx before the shift but not after. I think this should help with some of the cases that D42088 ended up removing during isel.

Reviewers: spatel, RKSimon

Reviewed By: spatel

Subscribers: llvm-commits

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

llvm-svn: 323048

6 years ago[X86] Add rdpid command line option and intrinsics.
Craig Topper [Sat, 20 Jan 2018 18:36:52 +0000 (18:36 +0000)]
[X86] Add rdpid command line option and intrinsics.

Summary: This patch adds -mrdpid/-mno-rdpid and the rdpid intrinsic. The corresponding LLVM commit has already been made.

Reviewers: RKSimon, spatel, zvi, AndreiGrischenko

Reviewed By: RKSimon

Subscribers: cfe-commits

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

llvm-svn: 323047

6 years ago[X86] Put the code that defines __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 for the preproces...
Craig Topper [Sat, 20 Jan 2018 18:36:06 +0000 (18:36 +0000)]
[X86] Put the code that defines __GCC_HAVE_SYNC_COMPARE_AND_SWAP_16 for the preprocessor with the other __GCC_HAVE_SYNC_COMPARE_AND_SWAP_* defines. NFC

llvm-svn: 323046

6 years ago[X86][SSE] Check for out of bounds PEXTR/PINSR indices during faux shuffle combining.
Simon Pilgrim [Sat, 20 Jan 2018 17:16:01 +0000 (17:16 +0000)]
[X86][SSE] Check for out of bounds PEXTR/PINSR indices during faux shuffle combining.

llvm-svn: 323045

6 years agoMove new test from Generic to SystemZ.
Jonas Paulsson [Sat, 20 Jan 2018 16:57:06 +0000 (16:57 +0000)]
Move new test from Generic to SystemZ.

A few build bots failed with r323042 because they are not configured to
build the SystemZ target.

llvm-svn: 323044

6 years ago[InstCombine] add baseline tests for (X << Y) / X -> 1 << Y; NFC
Sanjay Patel [Sat, 20 Jan 2018 16:13:40 +0000 (16:13 +0000)]
[InstCombine] add baseline tests for (X << Y) / X -> 1 << Y; NFC

This fold is proposed in D42032.

llvm-svn: 323043

6 years ago[SelectionDAG] Fix codegen of vector stores with non byte-sized elements.
Jonas Paulsson [Sat, 20 Jan 2018 16:05:10 +0000 (16:05 +0000)]
[SelectionDAG] Fix codegen of vector stores with non byte-sized elements.

This was completely broken, but hopefully fixed by this patch.

In cases where it is needed, a vector with non byte-sized elements is stored
by extracting, zero-extending, shift:ing and or:ing the elements into an
integer of the same width as the vector, which is then stored.

Review: Eli Friedman, Ulrich Weigand
https://reviews.llvm.org/D42100#inline-369520
https://bugs.llvm.org/show_bug.cgi?id=35520

llvm-svn: 323042

6 years agoAssume the shared library path variable is LD_LIBRARY_PATH on systems
Dimitry Andric [Sat, 20 Jan 2018 14:35:05 +0000 (14:35 +0000)]
Assume the shared library path variable is LD_LIBRARY_PATH on systems
except Darwin and Windows.  This prevents inserting an environment
variable with an empty name (which is illegal and leads to a Python
exception) on any of the BSDs.

llvm-svn: 323041

6 years agoAssume the shared library path variable is LD_LIBRARY_PATH on systems
Dimitry Andric [Sat, 20 Jan 2018 14:34:33 +0000 (14:34 +0000)]
Assume the shared library path variable is LD_LIBRARY_PATH on systems
except Darwin and Windows.  This prevents inserting an environment
variable with an empty name (which is illegal and leads to a Python
exception) on any of the BSDs.

llvm-svn: 323040

6 years ago[compiler-rt] Implement __clear_cache() on OpenBSD/mips64
Kamil Rytarowski [Sat, 20 Jan 2018 14:16:16 +0000 (14:16 +0000)]
[compiler-rt] Implement __clear_cache() on OpenBSD/mips64

Summary:
Make __clear_cache() invoke the platform's cache flush function
on OpenBSD/mips64.

Reviewers: krytarowski

Reviewed By: krytarowski

Subscribers: sdardis, dberris, arichardson, krytarowski, llvm-commits, #sanitizers

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

llvm-svn: 323039

6 years ago[COFF] Keep the underscore on exported decorated stdcall functions in MSVC mode
Martin Storsjo [Sat, 20 Jan 2018 11:44:42 +0000 (11:44 +0000)]
[COFF] Keep the underscore on exported decorated stdcall functions in MSVC mode

This fixes PR35733.

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

llvm-svn: 323036

6 years ago[COFF] Keep the underscore on exported decorated stdcall functions in MSVC mode
Martin Storsjo [Sat, 20 Jan 2018 11:44:32 +0000 (11:44 +0000)]
[COFF] Keep the underscore on exported decorated stdcall functions in MSVC mode

This (together with the corresponding LLD commit, that contains the
testcase updates) fixes PR35733.

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

llvm-svn: 323035

6 years ago[Dominators] Fix some edge cases for PostDomTree updating
David Green [Sat, 20 Jan 2018 10:29:37 +0000 (10:29 +0000)]
[Dominators] Fix some edge cases for PostDomTree updating

These fix some odd cfg cases where batch-updating the post
dom tree fails. Usually around infinite loops and roots
ending up being different.

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

llvm-svn: 323034

6 years agoRevert "[Fuzzer] Parametrize add_custom_libcxx"
Petr Hosek [Sat, 20 Jan 2018 09:21:00 +0000 (09:21 +0000)]
Revert "[Fuzzer] Parametrize add_custom_libcxx"

This reverts commit r323032: failing on the sanitizer-x86_64-linux-autoconf bot.

llvm-svn: 323033

6 years ago[Fuzzer] Parametrize add_custom_libcxx
Petr Hosek [Sat, 20 Jan 2018 09:03:16 +0000 (09:03 +0000)]
[Fuzzer] Parametrize add_custom_libcxx

add_custom_libcxx uses the just built compiler and installs the
built libc++, e.g. for testing, neither of which is desirable in
case of Fuzzer where the libc++ should be built using the host
compiler and it's only linked into the libFuzzer and should never
be installed. This change introduces additional arguments to
add_custom_libcxx to allow parametrizing its behavior.

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

llvm-svn: 323032

6 years ago[X86] Add some more v32i1 shuffle tests with shuffles between mask creation and mask...
Craig Topper [Sat, 20 Jan 2018 08:13:35 +0000 (08:13 +0000)]
[X86] Add some more v32i1 shuffle tests with shuffles between mask creation and mask usage rather than being just shuffling input arguments.

The existing tests just tested shuffles of v32i1 inputs, but arguments are promoted to v32i8. So it wasn't a good demonstration of v32i1 shuffle handling.

The new test cases use compares and selects to get k-register operations around the shuffle.

This is prep work for demonstrating changes from D42031.

llvm-svn: 323031

6 years ago[X86] Add test cases for failures to use movzx due to various issues with demanded...
Craig Topper [Sat, 20 Jan 2018 07:50:57 +0000 (07:50 +0000)]
[X86] Add test cases for failures to use movzx due to various issues with demanded bits.

D42265 and D42313 should help with some of these.

llvm-svn: 323030

6 years agoReland "Fix syntax error introduced in r322991"
Petr Hosek [Sat, 20 Jan 2018 03:37:47 +0000 (03:37 +0000)]
Reland "Fix syntax error introduced in r322991"

This triggers compiler error when building sanitizers for Fuchsia.

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

llvm-svn: 323029

6 years agoRevert "[sanitizer] Fix syntax error introduced in r322991"
Petr Hosek [Sat, 20 Jan 2018 03:23:45 +0000 (03:23 +0000)]
Revert "[sanitizer] Fix syntax error introduced in r322991"

This reverts commit r323027: it breaks the SanitizerLintCheck.

llvm-svn: 323028

6 years ago[sanitizer] Fix syntax error introduced in r322991
Petr Hosek [Sat, 20 Jan 2018 02:34:33 +0000 (02:34 +0000)]
[sanitizer] Fix syntax error introduced in r322991

This triggers compiler error when building sanitizers for Fuchsia.

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

llvm-svn: 323027

6 years agoForce lit to execute the ASan and TSan tests on iOS devices
Dan Liew [Sat, 20 Jan 2018 02:07:30 +0000 (02:07 +0000)]
Force lit to execute the ASan and TSan tests on iOS devices
sequentially.

The current implementation of commands in
`test/sanitizer_common/ios_commands/` for iOS devices cannot be executed
in parallel which results in the ASan and TSan tests failing when
executed in parallel by lit which was the default behaviour.

We now force the ASan and TSan tests to be a new parallelism group named
`darwin-ios-device-sanitizer` which allows only one test to be run at a
time.  We also emit a warning informing the user that tests are being
run sequentially.

This only applies if the target is an iOS device.

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

llvm-svn: 323026

6 years ago[WebAssembly] Remove special handling of entry point export.
Sam Clegg [Sat, 20 Jan 2018 01:44:45 +0000 (01:44 +0000)]
[WebAssembly] Remove special handling of entry point export.

Its much easier to export it via setHidden(false), now that
that is a thing.

As a side effect the start function is not longer always exports first
(becuase its being exported just like all the other function).

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

llvm-svn: 323025

6 years ago[WebAssembly] Remove redundant function: addSyntheticUndefinedFunction. NFC.
Sam Clegg [Sat, 20 Jan 2018 01:40:17 +0000 (01:40 +0000)]
[WebAssembly] Remove redundant function: addSyntheticUndefinedFunction.  NFC.

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

llvm-svn: 323024

6 years agotest: fix ARM tests harder
Saleem Abdulrasool [Sat, 20 Jan 2018 01:26:46 +0000 (01:26 +0000)]
test: fix ARM tests harder

Remove the missed check update for the removal of the x86 specific
vector call on ARM.

llvm-svn: 323023

6 years agoLink sanitized programs on NetBSD with -lkvm
Kamil Rytarowski [Sat, 20 Jan 2018 01:03:45 +0000 (01:03 +0000)]
Link sanitized programs on NetBSD with -lkvm

Summary:
kvm - kernel memory interface

The kvm(3) functions like kvm_open(), kvm_getargv() or kvm_getenvv()
are used in programs that can request information about a kernel and
its processes. The LLVM sanitizers will make use of them on NetBSD.

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, vitalybuka, dvyukov

Reviewed By: vitalybuka

Subscribers: llvm-commits, cfe-commits, #sanitizers

Tags: #sanitizers

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

llvm-svn: 323022

6 years agotest: move ARM test from x86
Saleem Abdulrasool [Sat, 20 Jan 2018 01:03:11 +0000 (01:03 +0000)]
test: move ARM test from x86

The ARM backend is not guaranteed to be present on x86, move the test to
the ARM tests.

llvm-svn: 323021

6 years ago[WebAssembly] Remove custom handling for undefined entry
Sam Clegg [Sat, 20 Jan 2018 00:52:51 +0000 (00:52 +0000)]
[WebAssembly] Remove custom handling for undefined entry

This code was needed back when we were not able to write
out the synthetic symbol for main.

Add tests to make sure we can handle this now.

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

llvm-svn: 323020

6 years agoSupport the localtime interceptor for NetBSD
Kamil Rytarowski [Sat, 20 Jan 2018 00:40:29 +0000 (00:40 +0000)]
Support the localtime interceptor for NetBSD

Summary:
The localtime symbol is mangled to __locatime50
on NetBSD.

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, vitalybuka

Reviewed By: vitalybuka

Subscribers: kubamracek, llvm-commits, #sanitizers

Tags: #sanitizers

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

llvm-svn: 323019

6 years agoIntercept accept4() on NetBSD
Kamil Rytarowski [Sat, 20 Jan 2018 00:37:27 +0000 (00:37 +0000)]
Intercept accept4() on NetBSD

Summary:
The accept4() function first appeared in NetBSD 8.0.

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, vitalybuka

Reviewed By: vitalybuka

Subscribers: llvm-commits, srhines, kubamracek, #sanitizers

Tags: #sanitizers

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

llvm-svn: 323018

6 years agoCodeGen: handle llvm.used properly for COFF
Saleem Abdulrasool [Sat, 20 Jan 2018 00:28:02 +0000 (00:28 +0000)]
CodeGen: handle llvm.used properly for COFF

`llvm.used` contains a list of pointers to named values which the
compiler, assembler, and linker are required to treat as if there is a
reference that they cannot see.  Ensure that the symbols are preserved
by adding an explicit `-include` reference to the linker command.

llvm-svn: 323017

6 years ago[X86] Teach X86 codegen to use vector width preference to avoid promoting to 512...
Craig Topper [Sat, 20 Jan 2018 00:26:12 +0000 (00:26 +0000)]
[X86] Teach X86 codegen to use vector width preference to avoid promoting to 512-bit types when VLX is enabled and the preference is for a smaller size.

This change applies to places where we would turn 128/256-bit code into 512-bit in order to get a wider element type through sext/zext. Any 512-bit types that already existed in the IR/DAG will be left that way.

The width preference has no effect on codegen behavior when the target does not have AVX512 enabled. So AVX/AVX2 codegen cannot be limited via this mechanism yet.

If the preference is lower than 256 we may still use a 256 bit type to do the operation. Constraining to 128 bits makes it much more difficult to support some operations. For many of these cases we need to change element width while keeping element count constant which is easiest done by switching between 256 and 128 bit.

The preference is only obeyed when AVX512 and VLX are available. This means the preference is not obeyed for KNL, but is obeyed for SKX, Cannonlake, and Icelake. For KNL, the only way to do masked operation is on 512-bit registers so we would have to completely disable masking to obey the preference. We would also lose support for gather, scatter, ctlz, vXi64 multiplies, etc. This may change in the future, but this simplifies the initial implementation.

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

llvm-svn: 323016

6 years ago[X86] Add support for passing 'prefer-vector-width' function attribute into X86Subtar...
Craig Topper [Sat, 20 Jan 2018 00:26:08 +0000 (00:26 +0000)]
[X86] Add support for passing 'prefer-vector-width' function attribute into X86Subtarget and exposing via X86's getRegisterWidth TTI interface.

This will cause the vectorizers to do some limiting of the vector widths they create. This is not a strict limit. There are reasons I know of that the loop vectorizer will generate larger vectors for.

I've written this in such a way that the interface will only return a properly supported width(0/128/256/512) even if the attribute says something funny like 384 or 10.

This has been split from D41895 with the remainder in a follow up commit.

llvm-svn: 323015

6 years agoAvoid divisions.
Rui Ueyama [Sat, 20 Jan 2018 00:14:16 +0000 (00:14 +0000)]
Avoid divisions.

Compiler doesn't know the fact that Config->WordSize * 8 is always a
power of two, so it had to use the div instruction to divide some
number with C.

llvm-svn: 323014

6 years ago[TSan][MIPS] Expand sanitizer memory space to lower addresses
Petar Jovanovic [Sat, 20 Jan 2018 00:06:07 +0000 (00:06 +0000)]
[TSan][MIPS] Expand sanitizer memory space to lower addresses

MemToShadowImpl() maps lower addresses to a memory space out of sanitizers
range. The simplest example is address 0 which is mapped to 0x2000000000

static const uptr kShadowBeg     = 0x2400000000ull;

but accessing the address during tsan execution will lead to a segmentation
fault.

This patch expands the range used by the sanitizer and ensures that 1/8 of
the maximum valid address in the virtual address spaces is used for shadow
memory.

Patch by Milos Stojanovic.

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

llvm-svn: 323013

6 years ago[WebAssembly] Fix MSVC build
Derek Schuff [Sat, 20 Jan 2018 00:01:18 +0000 (00:01 +0000)]
[WebAssembly] Fix MSVC build

nullptr_t can't be used left of boolean &&

llvm-svn: 323012

6 years ago[clang-tidy] Adding Fuchsia checker for multiple inheritance
Julie Hockett [Fri, 19 Jan 2018 23:59:59 +0000 (23:59 +0000)]
[clang-tidy] Adding Fuchsia checker for multiple inheritance

Adds a check to the Fuchsia module to warn when a class
inherits from multiple classes that are not pure virtual.

See https://fuchsia.googlesource.com/zircon/+/master/docs/cxx.md
for reference.

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

llvm-svn: 323011

6 years agoMake the bloom filter a bit larger.
Rui Ueyama [Fri, 19 Jan 2018 23:54:31 +0000 (23:54 +0000)]
Make the bloom filter a bit larger.

I created https://reviews.llvm.org/D42202 to see how large the bloom
filter should be. With that patch, I tested various bloom filter sizes
with the following commands:

  $ cmake -GNinja -DCMAKE_BUILD_TYPE=Debug -DLLVM_ENABLE_LLD=true \
    -DLLVM_ENABLE_PROJECTS='clang;lld' -DBUILD_SHARED_LIBS=ON \
    -DCMAKE_SHARED_LINKER_FLAGS=-Wl,-bloom-filter-bits=<some integer> \
    ../llvm-project/llvm
  $ rm -f $(find . -name \*.so.7.0.0svn)
  $ ninja lld
  $ LD_BIND_NOW=1 perf stat bin/ld.lld

Here is the result:

  -bloom-filter-bits=8   0.220351609 seconds
  -bloom-filter-bits=10  0.217146597 seconds
  -bloom-filter-bits=12  0.206870826 seconds
  -bloom-filter-bits=16  0.209456312 seconds
  -bloom-filter-bits=32  0.195092075 seconds

Currently we allocate 8 bits for a symbol, but according to the above
result, that number is not optimal. Even though the numbers follow the
diminishing return rule, the point where a marginal improvement becomes
too small is not -bloom-filter-bits=8 but 12. So this patch sets it to 12.

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

llvm-svn: 323010

6 years ago[ObjCARC] Do not turn a call to @objc_autoreleaseReturnValue into a call
Akira Hatanaka [Fri, 19 Jan 2018 23:51:13 +0000 (23:51 +0000)]
[ObjCARC] Do not turn a call to @objc_autoreleaseReturnValue into a call
to @objc_autorelease if its operand is a PHI and the PHI has an
equivalent value that is used by a return instruction.

For example, ARC optimizer shouldn't replace the call in the following
example, as doing so breaks the AutoreleaseRV/RetainRV optimization:

  %v1 = bitcast i32* %v0 to i8*
  br label %bb3
bb2:
  %v3 = bitcast i32* %v2 to i8*
  br label %bb3
bb3:
  %p = phi i8* [ %v1, %bb1 ], [ %v3, %bb2 ]
  %retval = phi i32* [ %v0, %bb1 ], [ %v2, %bb2 ] ; equivalent to %p
  %v4 = tail call i8* @objc_autoreleaseReturnValue(i8* %p)
  ret i32* %retval

Also, make sure ObjCARCContract replaces @objc_autoreleaseReturnValue's
operand uses with its value so that the call gets tail-called.

rdar://problem/15894705

llvm-svn: 323009