platform/upstream/llvm.git
4 years ago[Tools] Mark output of tools as text if it is text
Kai Nacke [Tue, 8 Oct 2019 08:21:20 +0000 (08:21 +0000)]
[Tools] Mark output of tools as text if it is text

Several LLVM tools write text files/streams without using OF_Text.
This can cause problems on platforms which distinguish between
text and binary output. This PR adds the OF_Text flag for the
following tools:

- llvm-dis
- llvm-dwarfdump
- llvm-mca
- llvm-mc (assembler files only)
- opt (assembler files only)
- RemarkStreamer (used e.g. by opt)

Reviewers: rnk, vivekvpandya, Bigcheese, andreadb

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

llvm-svn: 374024

4 years agoUse /dev/null for tests that we do not need outputs
Rui Ueyama [Tue, 8 Oct 2019 08:03:44 +0000 (08:03 +0000)]
Use /dev/null for tests that we do not need outputs

llvm-svn: 374023

4 years agoReport error if -export-dynamic is used with -r
Rui Ueyama [Tue, 8 Oct 2019 08:03:40 +0000 (08:03 +0000)]
Report error if -export-dynamic is used with -r

The combination of the two flags doesn't make sense. And other linkers
seem to just ignore --export-dynamic if --relocatable is given, but
we probably should report it as an error to let users know that is
an invalid combination.

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

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

llvm-svn: 374022

4 years ago[LoopVectorize] Fix non-debug builds after rL374017
Kadir Cetinkaya [Tue, 8 Oct 2019 07:39:50 +0000 (07:39 +0000)]
[LoopVectorize] Fix non-debug builds after rL374017

llvm-svn: 374021

4 years ago[llvm-exegesis] Add stabilization test with config
Clement Courbet [Tue, 8 Oct 2019 07:08:48 +0000 (07:08 +0000)]
[llvm-exegesis] Add stabilization test with config

In preparation for D68629.

llvm-svn: 374020

4 years ago[IA] Recognize hexadecimal escape sequences
Bill Wendling [Tue, 8 Oct 2019 04:39:52 +0000 (04:39 +0000)]
[IA] Recognize hexadecimal escape sequences

Summary:
Implement support for hexadecimal escape sequences to match how GNU 'as'
handles them. I.e., read all hexadecimal characters and truncate to the
lower 16 bits.

Reviewers: nickdesaulniers, jcai19

Subscribers: llvm-commits, hiraditya

Tags: #llvm

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

llvm-svn: 374018

4 years ago[LoopVectorize][PowerPC] Estimate int and float register pressure separately in loop...
Zi Xuan Wu [Tue, 8 Oct 2019 03:28:33 +0000 (03:28 +0000)]
[LoopVectorize][PowerPC] Estimate int and float register pressure separately in loop-vectorize

In loop-vectorize, interleave count and vector factor depend on target register number. Currently, it does not
estimate different register pressure for different register class separately(especially for scalar type,
float type should not be on the same position with int type), so it's not accurate. Specifically,
it causes too many times interleaving/unrolling, result in too many register spills in loop body and hurting performance.

So we need classify the register classes in IR level, and importantly these are abstract register classes,
and are not the target register class of backend provided in td file. It's used to establish the mapping between
the types of IR values and the number of simultaneous live ranges to which we'd like to limit for some set of those types.

For example, POWER target, register num is special when VSX is enabled. When VSX is enabled, the number of int scalar register is 32(GPR),
float is 64(VSR), but for int and float vector register both are 64(VSR). So there should be 2 kinds of register class when vsx is enabled,
and 3 kinds of register class when VSX is NOT enabled.

It runs on POWER target, it makes big(+~30%) performance improvement in one specific bmk(503.bwaves_r) of spec2017 and no other obvious degressions.

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

llvm-svn: 374017

4 years ago[ConstantRange] [NFC] replace addWithNoSignedWrap with addWithNoWrap.
Chen Zheng [Tue, 8 Oct 2019 03:00:31 +0000 (03:00 +0000)]
[ConstantRange] [NFC] replace addWithNoSignedWrap with addWithNoWrap.

llvm-svn: 374016

4 years ago[WebAssembly] Add REQUIRES: asserts to cfg-stackify-eh.ll
Heejin Ahn [Tue, 8 Oct 2019 02:50:27 +0000 (02:50 +0000)]
[WebAssembly] Add REQUIRES: asserts to cfg-stackify-eh.ll

This was missing in D68552.

llvm-svn: 374015

4 years ago[ItaniumMangle] Fix mangling of GNU __null in an expression to match GCC
James Clarke [Tue, 8 Oct 2019 02:28:57 +0000 (02:28 +0000)]
[ItaniumMangle] Fix mangling of GNU __null in an expression to match GCC

Reviewers: rsmith

Reviewed By: rsmith

Subscribers: erik.pilkington, cfe-commits

Tags: #clang

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

llvm-svn: 374013

4 years ago[NFC] Fix ubsan-blacklist test
Jan Korous [Tue, 8 Oct 2019 02:26:17 +0000 (02:26 +0000)]
[NFC] Fix ubsan-blacklist test

Restored original test and marked tests for VFS as unsupported on Windows.

llvm-svn: 374011

4 years ago[sanitizer] Fix signal_trap_handler.cpp on android
Vitaly Buka [Tue, 8 Oct 2019 02:00:53 +0000 (02:00 +0000)]
[sanitizer] Fix signal_trap_handler.cpp on android

llvm-svn: 374010

4 years ago[LitConfig] Silenced notes/warnings on quiet.
Andrew Trick [Tue, 8 Oct 2019 01:31:02 +0000 (01:31 +0000)]
[LitConfig] Silenced notes/warnings on quiet.

Lit has a "quiet" option, -q, which is documented to "suppress no
error output". Previously, LitConfig displayed notes and warnings when
the quiet option was specified. The result was that it was not
possible to get only pertinent file/line information to be used by an
editor to jump to the location where checks were failing without
passing a number of unhelpful locations first. Here, the
implementations of LitConfig.note and LitConfig.warning are modified
to account for the quiet flag and avoid displaying if the flag has
indeed been set.

Patch by Nate Chandler

Reviewed by yln

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

llvm-svn: 374009

4 years agoRevert "ProcessInstanceInfoMatch: Don't match processes with no name if a name match...
Jonas Devlieghere [Tue, 8 Oct 2019 01:16:59 +0000 (01:16 +0000)]
Revert "ProcessInstanceInfoMatch: Don't match processes with no name if a name match was requested"

This breaks TestProcessAttach and TestHelloWorld on Darwin.

llvm-svn: 374008

4 years agotest fix: TestLoadUsingPaths should use realpath
Lawrence D'Anna [Tue, 8 Oct 2019 01:16:29 +0000 (01:16 +0000)]
test fix: TestLoadUsingPaths should use realpath

Summary:
TestLoadUsingPaths will fail if the build directory has
symlinks in its path, because the real paths reported by
the debugger won't match the symlink-laden paths it's expecting.

This can be solved just by using os.path.realpath on the base
path for the test.

Reviewers: JDevlieghere, jasonmolenda, labath

Reviewed By: JDevlieghere

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 374007

4 years agoReland 'Add VFS support for sanitizers' blacklist'
Jan Korous [Tue, 8 Oct 2019 01:13:17 +0000 (01:13 +0000)]
Reland 'Add VFS support for sanitizers' blacklist'

The original patch broke the test for Windows.
Trying to fix as per Reid's suggestions outlined here:
https://reviews.llvm.org/rC371663

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

llvm-svn: 374006

4 years agoFixing missing lldb-scripts rename from D68370
Antonio Afonso [Tue, 8 Oct 2019 01:10:03 +0000 (01:10 +0000)]
Fixing missing lldb-scripts rename from D68370

llvm-svn: 374005

4 years ago[CMake] Add two more uses of add_lldb_test_dependency
Jonas Devlieghere [Tue, 8 Oct 2019 00:44:54 +0000 (00:44 +0000)]
[CMake] Add two more uses of add_lldb_test_dependency

llvm-svn: 374000

4 years agoRevert "Add VFS support for sanitizers' blacklist"
Jan Korous [Tue, 8 Oct 2019 00:36:19 +0000 (00:36 +0000)]
Revert "Add VFS support for sanitizers' blacklist"

Fix tests on Windows for now.

This reverts commit 96ac97a4213287003f08636d0c372b3f71e9cfca.

llvm-svn: 373999

4 years ago[lldb] Reverts part of 61f471a
Haibo Huang [Tue, 8 Oct 2019 00:33:26 +0000 (00:33 +0000)]
[lldb] Reverts part of 61f471a

Seems I wrongly merged an old patch.

Reverts the change related to python dir for windows.

FileSpec should always contain normalized path. I.e. using '/' even in
windows.

llvm-svn: 373998

4 years agoDWIMy filterspecs for dotest.py
Lawrence D'Anna [Tue, 8 Oct 2019 00:26:53 +0000 (00:26 +0000)]
DWIMy filterspecs for dotest.py

Summary:
dotest.py currently requires a filterspec to be of the
form `TestCase.test_method`.   This patch makes it more
flexible, so you can pass `TestModule.TestCase.test_method`
or `TestModule.TestCase` or `TestCase.test_method` or just
`test_method`.

This makes it more convenient to just copy a test name
out of the terminal after running a bunch of tests and use
it as a filterspec.

Reviewers: JDevlieghere, jasonmolenda, labath

Reviewed By: JDevlieghere

Subscribers: jingham, lldb-commits

Tags: #lldb

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

llvm-svn: 373997

4 years ago[CMake] Track test dependencies with add_lldb_test_dependency
Jonas Devlieghere [Tue, 8 Oct 2019 00:21:34 +0000 (00:21 +0000)]
[CMake] Track test dependencies with add_lldb_test_dependency

I often use `ninja lldb-test-deps` to build all the test dependencies
before running a subset of the tests with `lit --filter`. This
functionality seems to break relatively often because test dependencies
are tracked in an ad-hoc way acrooss cmake files. This patch adds a
helper function `add_lldb_test_dependency` to unify test dependency
tracking by adding dependencies to lldb-test-deps.

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

llvm-svn: 373996

4 years ago[CMake] Remove stale comment
Jonas Devlieghere [Tue, 8 Oct 2019 00:14:02 +0000 (00:14 +0000)]
[CMake] Remove stale comment

llvm-svn: 373995

4 years ago[MachO] Fix symbol merging during symtab parsing.
Jonas Devlieghere [Tue, 8 Oct 2019 00:13:59 +0000 (00:13 +0000)]
[MachO] Fix symbol merging during symtab parsing.

The symtab parser in ObjectFileMachO has logic to coalesce debug (STAB)
and non-debug symbols, based on the address and the symbol name for
static (STSYM) and global symbols (GSYM) respectively. It makes the
assumption that the debug variant is always encountered first. Rather
than creating a second entry in the symbol table for the non-debug
symbol, the latter gets merged into the existing debug symbol.

This breaks when the linker emits the non-debug symbol first. We'd end
up with two entries in the symbol table, each containing part of the
information LLDB relies on. Indeed, commenting out the merging logic
breaks the test suite spectacularly.

This patch solves that problem by always parsing the debug symbols
first. This guarantees that the assumption for merging holds.

I'm not particularly happy with  adding a lambda, but after numerous
attempts this is the best solution I could come up with. The symtab
parsing logic is pretty complex in that it touches a lot of things. I've
experienced first hand that it's very easy to break things. I believe
this approach strikes a balance between fixing the issue while limiting
the risk of regressions.

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

llvm-svn: 373994

4 years ago[msan] Add interceptors: crypt, crypt_r.
Evgeniy Stepanov [Tue, 8 Oct 2019 00:00:30 +0000 (00:00 +0000)]
[msan] Add interceptors: crypt, crypt_r.

Reviewers: vitalybuka

Subscribers: srhines, #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

llvm-svn: 373993

4 years ago[clang] Accept -ftrivial-auto-var-init in clang-cl
Vitaly Buka [Mon, 7 Oct 2019 23:57:11 +0000 (23:57 +0000)]
[clang] Accept -ftrivial-auto-var-init in clang-cl

Reviewers: eugenis, rnk

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 373992

4 years ago[lldb] Unifying lldb python path
Haibo Huang [Mon, 7 Oct 2019 23:49:01 +0000 (23:49 +0000)]
[lldb] Unifying lldb python path

Based on mgorny@'s D67890

There are 3 places where python site-package path is calculated
independently:

1. finishSwigPythonLLDB.py where files are written to site-packages.

2. lldb/scripts/CMakeLists.txt where site-packages are installed.

3. ScriptInterpreterPython.cpp where site-packages are added to
PYTHONPATH.

This change creates the path once and use it everywhere. So that they
will not go out of sync.

Also it provides a chance for cross compiling users to specify the right
path for site-packages.

Subscribers: lldb-commits

Tags: #lldb

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

llvm-svn: 373991

4 years ago[Symbol] Remove unused method ClangASTContext::GetObjCClassName
Alex Langford [Mon, 7 Oct 2019 23:43:33 +0000 (23:43 +0000)]
[Symbol] Remove unused method ClangASTContext::GetObjCClassName

llvm-svn: 373990

4 years agoAMDGPU/GlobalISel: Clamp G_SITOFP/G_UITOFP sources
Matt Arsenault [Mon, 7 Oct 2019 23:33:08 +0000 (23:33 +0000)]
AMDGPU/GlobalISel: Clamp G_SITOFP/G_UITOFP sources

llvm-svn: 373989

4 years ago[Attributor][NFC] Add debug output
Johannes Doerfert [Mon, 7 Oct 2019 23:30:04 +0000 (23:30 +0000)]
[Attributor][NFC] Add debug output

llvm-svn: 373988

4 years ago[Attributor][FIX] Remove initialize calls and add undefs
Johannes Doerfert [Mon, 7 Oct 2019 23:28:54 +0000 (23:28 +0000)]
[Attributor][FIX] Remove initialize calls and add undefs

The initialization logic has become part of the Attributor but the
patches that introduced these calls here were in development when the
transition happened.

We also now clean up (undefine) the macros used to create attributes.

llvm-svn: 373987

4 years ago[Attributor] Use local linkage instead of internal
Johannes Doerfert [Mon, 7 Oct 2019 23:21:52 +0000 (23:21 +0000)]
[Attributor] Use local linkage instead of internal

Local linkage is internal or private, and private is a specialization of
internal, so either is fine for all our "local linkage" queries.

llvm-svn: 373986

4 years ago[Attributor] Use abstract call sites for call site callback
Johannes Doerfert [Mon, 7 Oct 2019 23:14:58 +0000 (23:14 +0000)]
[Attributor] Use abstract call sites for call site callback

Summary:
When we iterate over uses of functions and expect them to be call sites,
we now use abstract call sites to allow callback calls.

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, hfinkel, llvm-commits

Tags: #llvm

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

llvm-svn: 373985

4 years ago[tsan, go] fix Go windows build
Vitaly Buka [Mon, 7 Oct 2019 23:11:07 +0000 (23:11 +0000)]
[tsan, go] fix Go windows build

Summary:
Don't use weak exports when building tsan into a shared library for Go. gcc can't handle the pragmas used to make the weak references.

Include files that have been added since the last update to build.bat. (We should really find a better way to list all the files needed.)

Add windows version defines (WINVER and _WIN32_WINNT) to get AcquireSRWLockExclusive and ReleaseSRWLockExclusive defined.

Define GetProcessMemoryInfo to use the kernel32 version. This is kind of a hack, the windows header files should do this translation for us. I think we're not in the right family partition (we're using Desktop, but that translation only happens for App and System partitions???), but hacking the family partition seems equally gross and I have no idea what the consequences of that might be.

Patch by Keith Randall.

Reviewers: dvyukov, vitalybuka

Reviewed By: vitalybuka

Subscribers: jfb, delcypher, #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

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

llvm-svn: 373984

4 years ago[tsan, go] break commands into multiple lines
Vitaly Buka [Mon, 7 Oct 2019 23:04:16 +0000 (23:04 +0000)]
[tsan, go] break commands into multiple lines

Summary: Patch by Keith Randall.

Reviewers: dvyukov, vitalybuka

Subscribers: delcypher, jfb, #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

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

llvm-svn: 373983

4 years ago[X86] Shrink zero extends of gather indices from type less than i32 to types larger...
Craig Topper [Mon, 7 Oct 2019 23:03:12 +0000 (23:03 +0000)]
[X86] Shrink zero extends of gather indices from type less than i32 to types larger than i32.

Gather instructions can use i32 or i64 elements for indices. If
the index is zero extended from a type smaller than i32 to i64, we
can shrink the extend to just extend to i32.

llvm-svn: 373982

4 years ago[X86] Add test cases for zero extending a gather index from less than i32 to i64.
Craig Topper [Mon, 7 Oct 2019 23:02:03 +0000 (23:02 +0000)]
[X86] Add test cases for zero extending a gather index from less than i32 to i64.

We should be able to use a smaller zero extend.

llvm-svn: 373981

4 years agoFix the spelling of my name.
Joerg Sonnenberger [Mon, 7 Oct 2019 22:55:42 +0000 (22:55 +0000)]
Fix the spelling of my name.

llvm-svn: 373980

4 years ago[sanitizer] Print SIGTRAP for corresponding signal
Vitaly Buka [Mon, 7 Oct 2019 22:43:19 +0000 (22:43 +0000)]
[sanitizer] Print SIGTRAP for corresponding signal

Reviewers: eugenis, jfb

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

llvm-svn: 373979

4 years ago[tsan] Don't delay SIGTRAP handler
Vitaly Buka [Mon, 7 Oct 2019 22:43:17 +0000 (22:43 +0000)]
[tsan] Don't delay SIGTRAP handler

Reviewers: eugenis, jfb

Subscribers: #sanitizers, llvm-commits

Tags: #sanitizers, #llvm

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

llvm-svn: 373978

4 years agoAdd VFS support for sanitizers' blacklist
Jan Korous [Mon, 7 Oct 2019 22:36:19 +0000 (22:36 +0000)]
Add VFS support for sanitizers' blacklist

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

llvm-svn: 373977

4 years ago[X86] Add new calling convention that guarantees tail call optimization
Reid Kleckner [Mon, 7 Oct 2019 22:28:58 +0000 (22:28 +0000)]
[X86] Add new calling convention that guarantees tail call optimization

When the target option GuaranteedTailCallOpt is specified, calls with
the fastcc calling convention will be transformed into tail calls if
they are in tail position. This diff adds a new calling convention,
tailcc, currently supported only on X86, which behaves the same way as
fastcc, except that the GuaranteedTailCallOpt flag does not need to
enabled in order to enable tail call optimization.

Patch by Dwight Guth <dwight.guth@runtimeverification.com>!

Reviewed By: lebedev.ri, paquette, rnk

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

llvm-svn: 373976

4 years ago[WebAssembly] Fix unwind mismatch stat computation
Heejin Ahn [Mon, 7 Oct 2019 22:19:40 +0000 (22:19 +0000)]
[WebAssembly] Fix unwind mismatch stat computation

Summary:
There was a bug when computing the number of unwind destination
mismatches in CFGStackify. When there are many mismatched calls that
share the same (original) destination BB, they have to be counted
separately.

This also fixes a typo and runs `fixUnwindMismatches` only when the wasm
exception handling is enabled. This is to prevent unnecessary
computations and does not change behavior.

Reviewers: dschuff

Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits

Tags: #llvm

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

llvm-svn: 373975

4 years ago[llvm-lipo] Add TextAPI to LINK_COMPONENTS
Heejin Ahn [Mon, 7 Oct 2019 22:11:30 +0000 (22:11 +0000)]
[llvm-lipo] Add TextAPI to LINK_COMPONENTS

Summary:
D68319 uses `MachO::getCPUTypeFromArchitecture` and without this builds
with `-DBUILD_SHARED_LIBS=ON` fail.

Reviewers: alexshap

Subscribers: mgorny, llvm-commits

Tags: #llvm

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

llvm-svn: 373974

4 years ago[Diagnostics] Emit better -Wbool-operation's warning message if we known that the...
David Bolvansky [Mon, 7 Oct 2019 21:57:03 +0000 (21:57 +0000)]
[Diagnostics] Emit better -Wbool-operation's warning message if we known that the result is always true

llvm-svn: 373973

4 years ago[Attributor][FIX] Remove assertion wrong for on invalid IRPositions
Johannes Doerfert [Mon, 7 Oct 2019 21:48:08 +0000 (21:48 +0000)]
[Attributor][FIX] Remove assertion wrong for on invalid IRPositions

llvm-svn: 373972

4 years ago [libc++] Remove C++03 variadics in shared_ptr (v2)
Zoe Carver [Mon, 7 Oct 2019 21:41:15 +0000 (21:41 +0000)]
[libc++] Remove C++03 variadics in shared_ptr (v2)

    Summary: In my last patch (D67675) I forgot a few variadics. This patch removes the remaining make_shared and allocate_shared C++03 variadics.

    Reviewers: ldionne, EricWF, mclow.lists

    Subscribers: christof, dexonsmith, libcxx-commits

    Tags: #libc

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

llvm-svn: 373971

4 years ago[CMake] We only want to copy the headers for macOS.
Davide Italiano [Mon, 7 Oct 2019 21:38:30 +0000 (21:38 +0000)]
[CMake] We only want to copy the headers for macOS.

<rdar://problem/55916729>

llvm-svn: 373970

4 years ago[llvm-c] Add UnaryOperator to LLVM_FOR_EACH_VALUE_SUBCLASS macro
Cameron McInally [Mon, 7 Oct 2019 21:33:39 +0000 (21:33 +0000)]
[llvm-c] Add UnaryOperator to LLVM_FOR_EACH_VALUE_SUBCLASS macro

Note that we are not sure where the tests for these functions lives. This was discussed in the Phab Diff.

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

llvm-svn: 373969

4 years agoMark constructor as default and remove implementation (NFC)
Adrian Prantl [Mon, 7 Oct 2019 21:23:19 +0000 (21:23 +0000)]
Mark constructor as default and remove implementation (NFC)

llvm-svn: 373968

4 years ago[WebAssembly] Add memory intrinsics handling to mayThrow()
Heejin Ahn [Mon, 7 Oct 2019 21:14:45 +0000 (21:14 +0000)]
[WebAssembly] Add memory intrinsics handling to mayThrow()

Summary:
Previously, `WebAssembly::mayThrow()` assumed all inputs are global
addresses. But when intrinsics, such as `memcpy`, `memmove`, or `memset`
are lowered to external symbols in instruction selection and later
emitted as library calls. And these functions don't throw.

This patch adds handling to those memory intrinsics to `mayThrow`
function. But while most of libcalls don't throw, we can't guarantee all
of them don't throw, so currently we conservatively return true for all
other external symbols.

I think a better way to solve this problem is to embed 'nounwind' info
in `TargetLowering::CallLoweringInfo`, so that we can access the info
from the backend. This will also enable transferring 'nounwind'
properties of LLVM IR instructions. Currently we don't transfer that
info and we can only access properties of callee functions, if the
callees are within the module. Other targets don't need this info in the
backend because they do all the processing before isel, but it will help
us because that info will reduce code size increase in fixing unwind
destination mismatches in CFGStackify.

But for now we return false for these memory intrinsics and true for all
other libcalls conservatively.

Reviewers: dschuff

Subscribers: sbc100, jgravelle-google, hiraditya, sunfish, llvm-commits

Tags: #llvm

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

llvm-svn: 373967

4 years ago[llvm-lipo] Relax the check of the specified input file architecture
Alexander Shaposhnikov [Mon, 7 Oct 2019 21:14:22 +0000 (21:14 +0000)]
[llvm-lipo] Relax the check of the specified input file architecture

cctools lipo only compares the cputypes when it verifies that
the specified (via -arch) input file and the architecture match.
This diff adjusts the behavior of llvm-lipo accordingly.

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

Test plan: make check-all

llvm-svn: 373966

4 years ago[Attributor] Deduce memory behavior of functions and arguments
Johannes Doerfert [Mon, 7 Oct 2019 21:07:57 +0000 (21:07 +0000)]
[Attributor] Deduce memory behavior of functions and arguments

Deduce the memory behavior, aka "read-none", "read-only", or
"write-only", for functions and arguments.

Reviewers: sstefan1, uenoku

Subscribers: hiraditya, bollu, jfb, llvm-commits

Tags: #llvm

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

llvm-svn: 373965

4 years ago[InstCombine] Fold conditional sign-extend of high-bit-extract into high-bit-extract...
Roman Lebedev [Mon, 7 Oct 2019 20:53:27 +0000 (20:53 +0000)]
[InstCombine] Fold conditional sign-extend of high-bit-extract into high-bit-extract-with-signext (PR42389)

This can come up in Bit Stream abstractions.

The pattern looks big/scary, but it can't be simplified any further.
It only is so simple because a number of my preparatory folds had
happened already (shift amount reassociation / shift amount
reassociation in bit test, sign bit test detection).

Highlights:
* There are two main flavors: https://rise4fun.com/Alive/zWi
  The difference is add vs. sub, and left-shift of -1 vs. 1
* Since we only change the shift opcode,
  we can preserve the exact-ness: https://rise4fun.com/Alive/4u4
* There can be truncation after high-bit-extraction:
  https://rise4fun.com/Alive/slHc1   (the main pattern i'm after!)
  Which means that we need to ignore zext of shift amounts and of NBits.
* The sign-extending magic can be extended itself (in add pattern
  via sext, in sub pattern via zext. not the other way around!)
  https://rise4fun.com/Alive/NhG
  (or those sext/zext can be sinked into `select`!)
  Which again means we should pay attention when matching NBits.
* We can have both truncation of extraction and widening of magic:
  https://rise4fun.com/Alive/XTw
  In other words, i don't believe we need to have any checks on
  bitwidths of any of these constructs.

This is worsened in general by the fact that we may have `sext` instead
of `zext` for shift amounts, and we don't yet canonicalize to `zext`,
although we should. I have not done anything about that here.

Also, we really should have something to weed out `sub` like these,
by folding them into `add` variant.

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

llvm-svn: 373964

4 years ago[InstCombine][NFC] Tests for "conditional sign-extend of high-bit-extract" pattern...
Roman Lebedev [Mon, 7 Oct 2019 20:53:16 +0000 (20:53 +0000)]
[InstCombine][NFC] Tests for "conditional sign-extend of high-bit-extract" pattern (PR42389)

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

llvm-svn: 373963

4 years ago[InstCombine] Move isSignBitCheck(), handle rest of the predicates
Roman Lebedev [Mon, 7 Oct 2019 20:53:08 +0000 (20:53 +0000)]
[InstCombine] Move isSignBitCheck(), handle rest of the predicates

True, no test coverage is being added here. But those non-canonical
predicates that are already handled here already have no test coverage
as far as i can tell. I tried to add tests for them, but all the patterns
already get handled elsewhere.

llvm-svn: 373962

4 years ago[InstCombine][NFC] dropRedundantMaskingOfLeftShiftInput(): change how we deal with...
Roman Lebedev [Mon, 7 Oct 2019 20:53:00 +0000 (20:53 +0000)]
[InstCombine][NFC] dropRedundantMaskingOfLeftShiftInput(): change how we deal with mask

Summary:
Currently, we pre-check whether we need to produce a mask or not.
This involves some rather magical constants.
I'd like to extend this fold to also handle the situation
when there's also a `trunc` before outer shift.
That will require another set of magical constants.
It's ugly.

Instead, we can just compute the mask, and check
whether mask is a pass-through (all-ones) or not.
This way we don't need to have any magical numbers.

This change is NFC other than the fact that we now compute
the mask and then check if we need (and can!) apply it.

Reviewers: spatel

Reviewed By: spatel

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 373961

4 years ago[InstCombine] dropRedundantMaskingOfLeftShiftInput(): propagate undef shift amounts
Roman Lebedev [Mon, 7 Oct 2019 20:52:52 +0000 (20:52 +0000)]
[InstCombine] dropRedundantMaskingOfLeftShiftInput(): propagate undef shift amounts

Summary:
When we do `ConstantExpr::getZExt()`, that "extends" `undef` to `0`,
which means that for patterns a/b we'd assume that we must not produce
any bits for that channel, while in reality we simply didn't care
about that channel - i.e. we don't need to mask it.

Reviewers: spatel

Reviewed By: spatel

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 373960

4 years ago[Bitcode] Update naming of UNOP_NEG to UNOP_FNEG
Cameron McInally [Mon, 7 Oct 2019 20:41:25 +0000 (20:41 +0000)]
[Bitcode] Update naming of UNOP_NEG to UNOP_FNEG

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

llvm-svn: 373958

4 years ago[debugserver] Include the correct header.
Davide Italiano [Mon, 7 Oct 2019 20:35:22 +0000 (20:35 +0000)]
[debugserver] Include the correct header.

<rdar://problem/55916729>

llvm-svn: 373957

4 years ago[AccelTable] Remove stale comment (NFC)
Jonas Devlieghere [Mon, 7 Oct 2019 20:33:20 +0000 (20:33 +0000)]
[AccelTable] Remove stale comment (NFC)

rdar://55857228

llvm-svn: 373956

4 years ago[test] Rename `Modules` to `ObjectFile` (NFC)
Jonas Devlieghere [Mon, 7 Oct 2019 20:31:28 +0000 (20:31 +0000)]
[test] Rename `Modules` to `ObjectFile` (NFC)

llvm-svn: 373955

4 years ago[MachO] Shuffle some things around in ParseSymtab (NFC)
Jonas Devlieghere [Mon, 7 Oct 2019 20:31:22 +0000 (20:31 +0000)]
[MachO] Shuffle some things around in ParseSymtab (NFC)

llvm-svn: 373954

4 years ago[gdb-remote] process properly effective uid
Walter Erquinigo [Mon, 7 Oct 2019 20:26:49 +0000 (20:26 +0000)]
[gdb-remote] process properly effective uid

Summary:
Someone wrote SetEffectiveSetEffectiveGroupID instead of SetEffectiveUserID.

After this fix, the android process list can show user names, e.g.

```
PID    PARENT USER       GROUP      EFF USER   EFF GROUP  TRIPLE                               ARGUMENTS
====== ====== ========== ========== ========== ========== ============================== ============================
529    1      root       0          root       0                                         /sbin/ueventd
```
Reviewers: labath,clayborg,aadsm,xiaobai

Subscribers:

llvm-svn: 373953

4 years ago[OPENMP]Fix caonical->canonical, NFC.
Alexey Bataev [Mon, 7 Oct 2019 19:57:40 +0000 (19:57 +0000)]
[OPENMP]Fix caonical->canonical, NFC.

Fixed typo.

llvm-svn: 373952

4 years agoAttempt to fix a few clang-tidy tests on Windows, see PR43593.
Nico Weber [Mon, 7 Oct 2019 19:54:19 +0000 (19:54 +0000)]
Attempt to fix a few clang-tidy tests on Windows, see PR43593.

llvm-svn: 373951

4 years agoFix for expanding __pragmas in macro arguments
Amy Huang [Mon, 7 Oct 2019 19:41:53 +0000 (19:41 +0000)]
Fix for expanding __pragmas in macro arguments

Summary:
Avoid parsing __pragma into an annotation token when macro arguments are pre-expanded.
This is what clang currently does when parsing _Pragmas.

Fixes https://bugs.llvm.org/show_bug.cgi?id=41128, where clang crashed
when trying to get the length of an annotation token.

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 373950

4 years ago[libc++abi] Introduce a LIBCXXABI_LIBRARY_VERSION option
Louis Dionne [Mon, 7 Oct 2019 19:22:04 +0000 (19:22 +0000)]
[libc++abi] Introduce a LIBCXXABI_LIBRARY_VERSION option

That option controls the 'VERSION' attribute of the libc++abi shared
library, which in turn controls the name of the actual dylib being
produced.

llvm-svn: 373949

4 years agogn build: try to make system-libs.windows.test pass
Nico Weber [Mon, 7 Oct 2019 19:17:02 +0000 (19:17 +0000)]
gn build: try to make system-libs.windows.test pass

llvm-svn: 373948

4 years agoAMDGPU/GlobalISel: Handle more G_INSERT cases
Matt Arsenault [Mon, 7 Oct 2019 19:16:26 +0000 (19:16 +0000)]
AMDGPU/GlobalISel: Handle more G_INSERT cases

Start manually writing a table to get the subreg index. TableGen
should probably generate this, but I'm not sure what it looks like in
the arbitrary case where subregisters are allowed to not fully cover
the super-registers.

llvm-svn: 373947

4 years agoGlobalISel: Partially implement lower for G_INSERT
Matt Arsenault [Mon, 7 Oct 2019 19:13:27 +0000 (19:13 +0000)]
GlobalISel: Partially implement lower for G_INSERT

llvm-svn: 373946

4 years agoAMDGPU/GlobalISel: Fix selection of 16-bit shifts
Matt Arsenault [Mon, 7 Oct 2019 19:10:44 +0000 (19:10 +0000)]
AMDGPU/GlobalISel: Fix selection of 16-bit shifts

llvm-svn: 373945

4 years agoAMDGPU/GlobalISel: Select VALU G_AMDGPU_FFBH_U32
Matt Arsenault [Mon, 7 Oct 2019 19:10:43 +0000 (19:10 +0000)]
AMDGPU/GlobalISel: Select VALU G_AMDGPU_FFBH_U32

llvm-svn: 373944

4 years agoAMDGPU/GlobalISel: Use S_MOV_B64 for inline constants
Matt Arsenault [Mon, 7 Oct 2019 19:07:19 +0000 (19:07 +0000)]
AMDGPU/GlobalISel: Use S_MOV_B64 for inline constants

This hides some defects in SIFoldOperands when the immediates are
split.

llvm-svn: 373943

4 years agoAMDGPU/GlobalISel: Widen 16-bit G_MERGE_VALUEs sources
Matt Arsenault [Mon, 7 Oct 2019 19:05:58 +0000 (19:05 +0000)]
AMDGPU/GlobalISel: Widen 16-bit G_MERGE_VALUEs sources

Continue making a mess of merge/unmerge legality.

llvm-svn: 373942

4 years ago[libc++abi] Do not define -Dcxxabi_shared_EXPORTS when building libc++abi
Louis Dionne [Mon, 7 Oct 2019 18:55:15 +0000 (18:55 +0000)]
[libc++abi] Do not define -Dcxxabi_shared_EXPORTS when building libc++abi

CMake sets adds that definition automatically, but we don't need
or use it.

llvm-svn: 373940

4 years ago[OPENMP50]Treat range-based for as canonical loop.
Alexey Bataev [Mon, 7 Oct 2019 18:54:57 +0000 (18:54 +0000)]
[OPENMP50]Treat range-based for as canonical loop.

According to OpenMP 5.0, range-based for is also considered as a
canonical form of loops.

llvm-svn: 373939

4 years agoAMDGPU/GlobalISel: Select more G_INSERT cases
Matt Arsenault [Mon, 7 Oct 2019 18:43:31 +0000 (18:43 +0000)]
AMDGPU/GlobalISel: Select more G_INSERT cases

At minimum handle the s64 insert type, which are emitted in real cases
during legalization.

We really need TableGen to emit something to emit something like the
inverse of composeSubRegIndices do determine the subreg index to use.

llvm-svn: 373938

4 years agoGlobalISel: Add target pre-isel instructions
Matt Arsenault [Mon, 7 Oct 2019 18:43:29 +0000 (18:43 +0000)]
GlobalISel: Add target pre-isel instructions

Allows targets to introduce regbankselectable
pseudo-instructions. Currently the closet feature to this is an
intrinsic. However this requires creating a public intrinsic
declaration. This litters the public intrinsic namespace with
operations we don't necessarily want to expose to IR producers, and
would rather leave as private to the backend.

Use a new instruction bit. A previous attempt tried to keep using enum
value ranges, but it turned into a mess.

llvm-svn: 373937

4 years ago[clang] [cmake] Support LLVM_DISTRIBUTION_COMPONENTS in stand-alone build
Michal Gorny [Mon, 7 Oct 2019 18:14:56 +0000 (18:14 +0000)]
[clang] [cmake] Support LLVM_DISTRIBUTION_COMPONENTS in stand-alone build

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

llvm-svn: 373936

4 years agoSecond attempt to add iterator_range::empty()
Jordan Rose [Mon, 7 Oct 2019 18:14:24 +0000 (18:14 +0000)]
Second attempt to add iterator_range::empty()

Doing this makes MSVC complain that `empty(someRange)` could refer to
either C++17's std::empty or LLVM's llvm::empty, which previously we
avoided via SFINAE because std::empty is defined in terms of an empty
member rather than begin and end. So, switch callers over to the new
method as it is added.

https://reviews.llvm.org/D68439

llvm-svn: 373935

4 years ago[libc++abi] Remove redundant link flags on Apple platforms
Louis Dionne [Mon, 7 Oct 2019 18:12:10 +0000 (18:12 +0000)]
[libc++abi] Remove redundant link flags on Apple platforms

These flags are already set when we create the cxxabi_shared target
using the SOVERSION and VERSION target properties, and the install_name
was already being overriden to '@rpath/libc++abi.1.dylib' by CMake
because no 'CMAKE_INSTALL_NAME_DIR' option was specified. So this is
effectively a removal of dead code with no intended functionality change.

The only think we're losing here is that we used to link against
libSystem.B.dylib instead of libSystem.dylib when building libc++abi
for macOS 10.6 -- however, I strongly suspect nobody's building
libc++abi from source for that target anymore.

llvm-svn: 373934

4 years agoTry to get clangd tests passing on Windows.
Nico Weber [Mon, 7 Oct 2019 17:55:05 +0000 (17:55 +0000)]
Try to get clangd tests passing on Windows.

Part of PR43592. See also r328645.

llvm-svn: 373932

4 years ago[platform process list] add a flag for showing the processes of all users
Walter Erquinigo [Mon, 7 Oct 2019 17:49:32 +0000 (17:49 +0000)]
[platform process list] add a flag for showing the processes of all users

Summary:
For context: https://reviews.llvm.org/D68293

We need a way to show all the processes on android regardless of the user id.
When you run `platform process list`, you only see the processes with the same user as the user that launched lldb-server. However, it's quite useful to see all the processes, though, and it will lay a foundation for full apk debugging support from lldb.

Before:
```
PID    PARENT USER       TRIPLE                   NAME
====== ====== ========== ======================== ============================
3234   1                 aarch64-unknown-linux-android adbd
8034   3234              aarch64-unknown-linux-android sh
9096   3234              aarch64-unknown-linux-android sh
9098   9096              aarch64-unknown-linux-android lldb-server
(lldb) ^D
```

Now:
```
(lldb) platform process list -x
205 matching processes were found on "remote-android"
PID    PARENT USER       TRIPLE                   NAME
====== ====== ========== ======================== ============================
1      0                                          init
524    1                                          init
525    1                                          init
531    1                                          ueventd
568    1                                          logd
569    1                 aarch64-unknown-linux-android servicemanager
570    1                 aarch64-unknown-linux-android hwservicemanager
571    1                 aarch64-unknown-linux-android vndservicemanager
577    1                 aarch64-unknown-linux-android qseecomd
580    577               aarch64-unknown-linux-android qseecomd
...
23816  979                                        com.android.providers.calendar
24600  979                                        com.verizon.mips.services
27888  979                                        com.hualai
28043  2378                                       com.android.chrome:sandboxed_process0
31449  979                                        com.att.shm
31779  979                                        com.samsung.android.authfw
31846  979                                        com.samsung.android.server.iris
32014  979                                        com.samsung.android.MtpApplication
32045  979                                        com.samsung.InputEventApp
```

Reviewers: labath,xiaobai,aadsm,clayborg

Subscribers:

llvm-svn: 373931

4 years ago[scudo][standalone] Correct releaseToOS behavior
Kostya Kortchinsky [Mon, 7 Oct 2019 17:37:39 +0000 (17:37 +0000)]
[scudo][standalone] Correct releaseToOS behavior

Summary:
There was an issue in `releaseToOSMaybe`: one of the criteria to
decide if we should proceed with the release was wrong. Namely:

```
const uptr N = Sci->Stats.PoppedBlocks - Sci->Stats.PushedBlocks;
if (N * BlockSize < PageSize)
  return; // No chance to release anything.
```

I meant to check if the amount of bytes in the free list was lower
than a page, but this actually checks if the amount of **in use** bytes
was lower than a page.

The correct code is:

```
const uptr BytesInFreeList =
  Region->AllocatedUser -
  (Region->Stats.PoppedBlocks - Region->Stats.PushedBlocks) * BlockSize;
if (BytesInFreeList < PageSize)
  return 0; // No chance to release anything.
```

Consequences of the bug:
- if a class size has less than a page worth of in-use bytes (allocated
  or in a cache), reclaiming would not occur, whatever the amount of
  blocks in the free list; in real world scenarios this is unlikely to
  happen and be impactful;
- if a class size had less than a page worth of free bytes (and enough
  in-use bytes, etc), then reclaiming would be attempted, with likely
  no result. This means the reclaiming was overzealous at times.

I didn't have a good way to test for this, so I changed the prototype
of the function to return the number of bytes released, allowing to
get the information needed. The test added fails with the initial
criteria.

Another issue is that `ReleaseToOsInterval` can actually be 0, meaning
we always try to release (side note: it's terrible for performances).
so change a `> 0` check to `>= 0`.

Additionally, decrease the `CanRelease` threshold to `PageSize / 32`.
I still have to make that configurable but I will do it at another time.

Finally, rename some variables in `printStats`: I feel like "available"
was too ambiguous, so change it to "total".

Reviewers: morehouse, hctim, eugenis, vitalybuka, cferris

Reviewed By: morehouse

Subscribers: delcypher, #sanitizers, llvm-commits

Tags: #llvm, #sanitizers

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

llvm-svn: 373930

4 years agoFix Calling Convention through aliases
Erich Keane [Mon, 7 Oct 2019 17:28:03 +0000 (17:28 +0000)]
Fix Calling Convention through aliases

r369697 changed the behavior of stripPointerCasts to no longer include
aliases.  However, the code in CGDeclCXX.cpp's createAtExitStub counted
on the looking through aliases to properly set the calling convention of
a call.

The result of the change was that the calling convention mismatch of the
call would be replaced with a llvm.trap, causing a runtime crash.

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

llvm-svn: 373929

4 years ago[libTooling][NFC] Fix build break in r373916.
Yitzhak Mandelbaum [Mon, 7 Oct 2019 17:24:23 +0000 (17:24 +0000)]
[libTooling][NFC] Fix build break in r373916.

r373916 used raw strings inside macro calls, which breaks some builds.

llvm-svn: 373928

4 years ago[DWARFASTParserClang] Factor out structure-like type parsing, NFC
Vedant Kumar [Mon, 7 Oct 2019 17:22:53 +0000 (17:22 +0000)]
[DWARFASTParserClang] Factor out structure-like type parsing, NFC

Split out the logic to parse structure-like types into a separate
function, in an attempt to reduce the complexity of ParseTypeFromDWARF.

Inspired by discussion in https://reviews.llvm.org/D68130.

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

llvm-svn: 373927

4 years ago[DWARFASTParserClang] Delete commented-out typedef, NFC
Vedant Kumar [Mon, 7 Oct 2019 17:22:50 +0000 (17:22 +0000)]
[DWARFASTParserClang] Delete commented-out typedef, NFC

(& group together all the protected members & typedefs)

llvm-svn: 373926

4 years agoProcessInstanceInfoMatch: Don't match processes with no name if a name match was...
Pavel Labath [Mon, 7 Oct 2019 17:17:53 +0000 (17:17 +0000)]
ProcessInstanceInfoMatch: Don't match processes with no name if a name match was requested

Since D68289, a couple of tests on linux started being extremely flaky.
All of them were doing name-based attaching and were failing because
they couldn't find an unambiguous process to attach to.

The patch above changed the process finding logic, so that failure to
find a process name does not constitute an error. This meant that a lot
more transient processes showed up in the process list during the test
suite run. Previously, these processes would not appear as they would be
gone by the time we went to read their executable name, arguments, etc.

Now, this alone should not cause an issue were it not for the fact that
we were considering a process with no name as if it matched by default
(even if we were explicitly searching for a process with a specified
name). This meant that any of the "transient" processes with no name
would make the name match ambiguous. That clearly seems like a bug to me
so I fix that.

llvm-svn: 373925

4 years ago[clangd] Fix raciness in code completion tests
Kadir Cetinkaya [Mon, 7 Oct 2019 17:12:18 +0000 (17:12 +0000)]
[clangd] Fix raciness in code completion tests

Reviewers: sammccall, ilya-biryukov

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

Tags: #clang

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

llvm-svn: 373924

4 years ago[Remarks] Pass StringBlockValue as StringRef.
Florian Hahn [Mon, 7 Oct 2019 17:05:09 +0000 (17:05 +0000)]
[Remarks] Pass StringBlockValue as StringRef.

After changing the remark serialization, we now pass StringRefs to the
serializer. We should use StringRef for StringBlockVal, to avoid
creating temporary objects, which then cause StringBlockVal.Value to
point to invalid memory.

Reviewers: thegameg, anemet

Reviewed By: thegameg

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

llvm-svn: 373923

4 years ago[clang-format] [PR27004] omits leading space for noexcept when formatting operator...
Paul Hoad [Mon, 7 Oct 2019 17:03:44 +0000 (17:03 +0000)]
[clang-format] [PR27004] omits leading space for noexcept when formatting operator delete()

Summary:
clang-format is incorrectly thinking the parameter parens are part of a cast operation, this is resulting in there sometimes being not space between the paren and the noexcept (and other keywords like volatile etc..)

```
void operator++(int) noexcept;
void operator++(int &) noexcept;
void operator delete(void *, std::size_t, const std::nothrow_t &)noexcept;
```

Reviewers: klimek, owenpan, mitchell-stellar

Reviewed By: mitchell-stellar

Subscribers: cfe-commits

Tags: #clang-format, #clang

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

llvm-svn: 373922

4 years ago[clang-format] [NFC] Ensure clang-format is itself clang-formatted.
Paul Hoad [Mon, 7 Oct 2019 16:53:35 +0000 (16:53 +0000)]
[clang-format] [NFC] Ensure clang-format is itself clang-formatted.

Summary:
Before making a proposed change, ensure ClangFormat.cpp is fully clang-formatted,

no functional change just clang-formatting using the in tree .clang-format.

Reviewers: mitchell-stellar

Reviewed By: mitchell-stellar

Subscribers: Eugene.Zelenko, cfe-commits

Tags: #clang-format, #clang

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

llvm-svn: 373921

4 years agoFix build errors caused by rL373914.
Wei Mi [Mon, 7 Oct 2019 16:45:47 +0000 (16:45 +0000)]
Fix build errors caused by rL373914.

llvm-svn: 373919

4 years agoCodegen - silence static analyzer getAs<> null dereference warnings. NFCI.
Simon Pilgrim [Mon, 7 Oct 2019 16:42:25 +0000 (16:42 +0000)]
Codegen - silence static analyzer getAs<> null dereference warnings. NFCI.

The static analyzer is warning about potential null dereferences, but in these cases we should be able to use castAs<> directly and if not assert will fire for us.

llvm-svn: 373918

4 years ago[llvm-profdata] Minor format fix
Wenlei He [Mon, 7 Oct 2019 16:30:31 +0000 (16:30 +0000)]
[llvm-profdata] Minor format fix

Summary: Minor format fix for output of "llvm-profdata -show"

Reviewers: wmi

Subscribers: hiraditya, llvm-commits

Tags: #llvm

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

llvm-svn: 373917

4 years ago[libTooling] Add `toString` method to the Stencil class
Yitzhak Mandelbaum [Mon, 7 Oct 2019 16:20:22 +0000 (16:20 +0000)]
[libTooling] Add `toString` method to the Stencil class

Summary:
`toString` generates a string representation of the stencil.

Patch by Harshal T. Lehri.

Reviewers: gribozavr

Subscribers: cfe-commits

Tags: #clang

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

llvm-svn: 373916

4 years ago[X86][SSE] getTargetShuffleInputs - move VT.isSimple/isVector checks inside. NFCI.
Simon Pilgrim [Mon, 7 Oct 2019 16:15:20 +0000 (16:15 +0000)]
[X86][SSE] getTargetShuffleInputs - move VT.isSimple/isVector checks inside. NFCI.

Stop all the callers from having to check the value type before calling getTargetShuffleInputs.

llvm-svn: 373915

4 years ago[SampleFDO] Add compression support for any section in ExtBinary profile format
Wei Mi [Mon, 7 Oct 2019 16:12:37 +0000 (16:12 +0000)]
[SampleFDO] Add compression support for any section in ExtBinary profile format

Previously ExtBinary profile format only supports compression using zlib for
profile symbol list. In this patch, we extend the compression support to any
section. User can select some or all of the sections to compress. In an
experiment, for a 45M profile in ExtBinary format, compressing name table
reduced its size to 24M, and compressing all the sections reduced its size
to 11M.

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

llvm-svn: 373914