platform/upstream/llvm.git
5 years ago[clang-doc] Avoid parsing undefined base classes
Julie Hockett [Wed, 3 Oct 2018 18:25:27 +0000 (18:25 +0000)]
[clang-doc] Avoid parsing undefined base classes

Don't try to parse base classes for declarations that are not
definitions (segfaults, as there is no DefinitionData to access).

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

llvm-svn: 343703

5 years ago[test] Use --sysroot instead of -B in print-multi-directory.c
Martin Storsjo [Wed, 3 Oct 2018 18:24:05 +0000 (18:24 +0000)]
[test] Use --sysroot instead of -B in print-multi-directory.c

This avoids finding a similar matching GCC installation outside
of the test directory tree in the surrounding environment, which
would make the test fail. (This happened on Ubuntu 16.04.)

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

llvm-svn: 343702

5 years ago[X86][Btver2] Fix MMX PSHUFB schedule
Simon Pilgrim [Wed, 3 Oct 2018 18:18:50 +0000 (18:18 +0000)]
[X86][Btver2] Fix MMX PSHUFB schedule

Match AMD Fam16h SOG + llvm-exegesis tests

llvm-svn: 343701

5 years ago[X86] Move Atomic CMPXCHG to WriteCMPXCHGRMW schedule class
Simon Pilgrim [Wed, 3 Oct 2018 18:05:01 +0000 (18:05 +0000)]
[X86] Move Atomic CMPXCHG to WriteCMPXCHGRMW schedule class

llvm-svn: 343700

5 years ago[COFF, ARM64] Add _ReadWriteBarrier intrinsic
Mandeep Singh Grang [Wed, 3 Oct 2018 17:24:21 +0000 (17:24 +0000)]
[COFF, ARM64] Add _ReadWriteBarrier intrinsic

Reviewers: rnk, mstorsjo, compnerd, TomTan, haripul, javed.absar

Reviewed By: rnk

Subscribers: kristof.beyls, chrib, jfb, cfe-commits

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

llvm-svn: 343699

5 years agolld-link: Several tweaks to default entry point selection.
Nico Weber [Wed, 3 Oct 2018 17:01:39 +0000 (17:01 +0000)]
lld-link: Several tweaks to default entry point selection.

Three related changes:

1. link.exe uses the presence of main and wmain to decide if it should call
   mainCRTStartup or wmainCRTStartup, even if /nodefaultlib is passed. For
   compatibility, remove FindMain logic.

2. Default to the non-wide entrypoint if main is not found. This has two effects:

2a. In normal links, lld-link now prints

        lld-link: error: undefined symbol: _main
        >>> referenced by f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:78
        >>>               libcmt.lib(exe_main.obj):("int __cdecl invoke_main(void)" (?invoke_main@@YAHXZ))
        >>> referenced by f:\dd\vctools\crt\vcstartup\src\startup\exe_common.inl:283
        >>>               libcmt.lib(exe_main.obj):("int __cdecl __scrt_common_main_seh(void)" (?__scrt_common_main_seh@@YAHXZ))

    instead of

        lld-link: error: entry point must be defined

    This is arguably a better error message, since it now mentions that _main is
    missing. (This matches link.exe's diagnostic in this case.)

2b. With /nodefautlib, we now default to mainCRTStartup if no main() is
    present, again matching link.exe. This makes r337407 obsolete.

This means if you have a cc file containing both mainCRTStartup and
wmainCRTStartup and you pass /nodefaultlib /subsystem:console, lld-link will
now call mainCRTStartup, matching link.exe

3. Print a warning if both main and wmain are present, similar to link.exe's
   LNK4067.

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

llvm-svn: 343698

5 years ago[X86] Add SkylakeClient uops counter - same as the other Intel models.
Simon Pilgrim [Wed, 3 Oct 2018 16:45:26 +0000 (16:45 +0000)]
[X86] Add SkylakeClient uops counter - same as the other Intel models.

llvm-svn: 343697

5 years agoCorrect implementation of -verify-machineinstrs such that it's still overridable...
Daniel Sanders [Wed, 3 Oct 2018 16:29:24 +0000 (16:29 +0000)]
Correct implementation of -verify-machineinstrs such that it's still overridable for EXPENSIVE_CHECKS

-verify-machineinstrs was implemented as a simple bool. As a result, the
'VerifyMachineCode == cl::BOU_UNSET' used by EXPENSIVE_CHECKS to make it on by
default but possible to disable didn't work as intended. Changed
-verify-machineinstrs to a boolOrDefault to correct this.

llvm-svn: 343696

5 years agoSkip test with older versions of clang
Adrian Prantl [Wed, 3 Oct 2018 16:24:14 +0000 (16:24 +0000)]
Skip test with older versions of clang

llvm-svn: 343695

5 years ago[InstCombine] clean up foldVectorBinop(); NFC
Sanjay Patel [Wed, 3 Oct 2018 15:46:03 +0000 (15:46 +0000)]
[InstCombine] clean up foldVectorBinop(); NFC

1. Fix include ordering.
2. Improve variable name (width is bitwidth not number-of-elements).
3. Add local Opcode variable to reduce code duplication.

llvm-svn: 343694

5 years ago[globalisel][combines] Don't sink G_TRUNC down to use if that use is a G_PHI
Daniel Sanders [Wed, 3 Oct 2018 15:43:39 +0000 (15:43 +0000)]
[globalisel][combines] Don't sink G_TRUNC down to use if that use is a G_PHI

This fixes a problem where the register allocator fails to eliminate a PHI
because there's a non-PHI in the middle of the PHI instructions at the start
of a BB.

This G_TRUNC can be better placed but this at least fixes the correctness issue
quickly. I'll follow up with a patch to the verifier to catch this kind of bug
in future.

llvm-svn: 343693

5 years ago[InstCombine] name change: foldShuffledBinop -> foldVectorBinop; NFC
Sanjay Patel [Wed, 3 Oct 2018 15:20:58 +0000 (15:20 +0000)]
[InstCombine] name change: foldShuffledBinop -> foldVectorBinop; NFC

This function will deal with more than shuffles with D50992, and I
have another potential per-element fold that could live here.

llvm-svn: 343692

5 years ago[llvm-mca] Add support for move elimination in class RegisterFile.
Andrea Di Biagio [Wed, 3 Oct 2018 15:02:44 +0000 (15:02 +0000)]
[llvm-mca] Add support for move elimination in class RegisterFile.

This patch teaches class RegisterFile how to analyze register writes from
instructions that are move elimination candidates.
In particular, it teaches it how to check if a move can be effectively eliminated
by the underlying PRF, and (if necessary) how to perform move elimination.

The long term goal is to allow processor models to describe instructions that
are valid move elimination candidates.
The idea is to let register file definitions in tablegen declare if/when moves
can be eliminated.

This patch is a non functional change.
The logic that performs move elimination is currently disabled.  A future patch
will add support for move elimination in the processor models, and enable this
new code path.

llvm-svn: 343691

5 years ago[llvm-exegesis] Avoid yaml parser from calling sscanf for obvious non-matches (PR39102)
Simon Pilgrim [Wed, 3 Oct 2018 14:51:09 +0000 (14:51 +0000)]
[llvm-exegesis] Avoid yaml parser from calling sscanf for obvious non-matches (PR39102)

deserializeMCOperand - ensure that we at least match the first character of the sscanf pattern before calling

This reduces llvm-exegesis uops analysis of the instructions supported from btver2 from 5m13s to 2m1s on debug builds.

llvm-svn: 343690

5 years ago[X86] Correctly use SSE registers if no-x87 is selected.
Nirav Dave [Wed, 3 Oct 2018 14:13:30 +0000 (14:13 +0000)]
[X86] Correctly use SSE registers if no-x87 is selected.

Fix use of SSE1 registers for f32 ops in no-x87 mode.

Notably, allow use of SSE instructions for f32 operations in 64-bit
mode (but not 32-bit which is disallowed by callign convention).

Also avoid translating memset/memcopy/memmove into SSE registers
without X87 for 32-bit mode.

This fixes PR38738.

Reviewers: nickdesaulniers, craig.topper

Subscribers: hiraditya, llvm-commits

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

llvm-svn: 343689

5 years ago[RISCV][NFC] Refactor RISCVDAGToDAGISel::Select
Alex Bradbury [Wed, 3 Oct 2018 13:13:13 +0000 (13:13 +0000)]
[RISCV][NFC] Refactor RISCVDAGToDAGISel::Select

Introduce and use a switch on the opcode.

llvm-svn: 343688

5 years ago[ThinLTO]Expose cache entry expiration time option in llvm-lto and fix a test
James Henderson [Wed, 3 Oct 2018 13:00:20 +0000 (13:00 +0000)]
[ThinLTO]Expose cache entry expiration time option in llvm-lto and fix a test

Two cases in a ThinLTO test were passing for the wrong reasons, since
rL340374. The tests were supposed to be testing that files were being
pruned due to the cache size, but they were in fact being pruned because
they were older than the default expiration period of 1 week.

This change fixes the tests by explicitly setting the expiration time to
the maximum value. This required the option to be exposed in llvm-lto.

By assigning all files in the cache a similar time, it is possible to see
that the newest files are still being kept, and that we aren't passing
for the wrong reason again. In the event that the entry expiration were
to expire for them, then the test would start failing, because these
files would be removed too.

Reviewed by: rnk, inglorion

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

llvm-svn: 343687

5 years ago[RA CopyHints] Fix compile-time regression
Jonas Paulsson [Wed, 3 Oct 2018 12:51:19 +0000 (12:51 +0000)]
[RA CopyHints] Fix compile-time regression

This patch makes sure that a register is only hinted once to RA. In extreme
cases the same register can otherwise be hinted numerous times and cause a
compile time slowdown.

Review: Simon Pilgrim
https://reviews.llvm.org/D52826

llvm-svn: 343686

5 years ago[llvm-exegesis][NFC] Revert rL343682 "Fix unused variable warning".
Clement Courbet [Wed, 3 Oct 2018 12:48:50 +0000 (12:48 +0000)]
[llvm-exegesis][NFC] Revert rL343682 "Fix unused variable warning".

That was not the proper fix: the variable is used in debug mode.

llvm-svn: 343685

5 years ago[llvm-exegesis] Fix rL343680 in release mode.
Clement Courbet [Wed, 3 Oct 2018 12:35:35 +0000 (12:35 +0000)]
[llvm-exegesis] Fix rL343680 in release mode.

llvm-svn: 343684

5 years agoPull FixupBreakpointPCAsNeeded into base class
Pavel Labath [Wed, 3 Oct 2018 12:29:33 +0000 (12:29 +0000)]
Pull FixupBreakpointPCAsNeeded into base class

Summary:
This function existed (with identical code) in both NativeProcessLinux
and NativeProcessNetBSD, and it is likely that it would be useful to any
future implementation of NativeProcessProtocol.

Therefore I move it to the base class.

Reviewers: krytarowski

Subscribers: lldb-commits

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

llvm-svn: 343683

5 years ago[llvm-exegesis][NFC] Fix unused variable warning.
Clement Courbet [Wed, 3 Oct 2018 12:27:43 +0000 (12:27 +0000)]
[llvm-exegesis][NFC] Fix unused variable warning.

llvm-svn: 343682

5 years agoThread safety analysis: Unwrap __builtin_expect in getTrylockCallExpr
Aaron Puchert [Wed, 3 Oct 2018 11:58:19 +0000 (11:58 +0000)]
Thread safety analysis: Unwrap __builtin_expect in getTrylockCallExpr

Summary:
When people are really sure they'll get the lock they sometimes use
__builtin_expect. It's also used by some assertion implementations.
Asserting that try-lock succeeded is basically the same as asserting
that the lock is not held by anyone else (and acquiring it).

Reviewers: aaron.ballman, delesley

Reviewed By: aaron.ballman

Subscribers: kristina, cfe-commits

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

llvm-svn: 343681

5 years ago[llvm-exegesis] Resolve variant classes in analysis.
Clement Courbet [Wed, 3 Oct 2018 11:50:25 +0000 (11:50 +0000)]
[llvm-exegesis] Resolve variant classes in analysis.

Summary: See PR38884.

Reviewers: gchatelet

Subscribers: tschuett, RKSimon, llvm-commits

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

llvm-svn: 343680

5 years ago[RISCV] Gate float<->int and double<->int conversion patterns on IsRV32
Alex Bradbury [Wed, 3 Oct 2018 11:35:22 +0000 (11:35 +0000)]
[RISCV] Gate float<->int and double<->int conversion patterns on IsRV32

The patterns as defined are correct only when XLen==32.

This is another preparatory patch for a set of patches that flesh out RV64
codegen.

llvm-svn: 343679

5 years ago[RISCV] Remove XLenVT==i32 assumptions from RISCVInstrInfo td
Alex Bradbury [Wed, 3 Oct 2018 11:14:26 +0000 (11:14 +0000)]
[RISCV] Remove XLenVT==i32 assumptions from RISCVInstrInfo td

1. brcond operates on an condition.
2. atomic_fence and the pseudo AMO instructions should all take xlen immediates

This allows the same definitions and patterns to work for RV64 (XLenVT==i64).

llvm-svn: 343678

5 years ago[RISCV] Gate simm32 materialisation pattern and SW pattern on IsRV32
Alex Bradbury [Wed, 3 Oct 2018 11:04:59 +0000 (11:04 +0000)]
[RISCV] Gate simm32 materialisation pattern and SW pattern on IsRV32

These patterns are not correct for RV64.

llvm-svn: 343677

5 years ago[LoopInterchange] Remove unused variable PreserveLCSSA (NFC).
Florian Hahn [Wed, 3 Oct 2018 11:01:23 +0000 (11:01 +0000)]
[LoopInterchange] Remove unused variable PreserveLCSSA (NFC).

llvm-svn: 343676

5 years ago[RISCV] Remove RV64 test lines from umulo-128-legalisation-lowering.ll
Alex Bradbury [Wed, 3 Oct 2018 10:59:42 +0000 (10:59 +0000)]
[RISCV] Remove RV64 test lines from umulo-128-legalisation-lowering.ll

The generated code is incorrect anyway, and this test adds noise to the
upcoming set of patches that flesh out RV64 support.

llvm-svn: 343675

5 years ago[CodeGen] NFC fix pedantic warning from extra semicolon
Jonas Toth [Wed, 3 Oct 2018 10:59:19 +0000 (10:59 +0000)]
[CodeGen] NFC fix pedantic warning from extra semicolon

llvm-svn: 343674

5 years ago[clang-tidy] NFC reorder registering in CppCoreGuidelines module
Jonas Toth [Wed, 3 Oct 2018 10:37:19 +0000 (10:37 +0000)]
[clang-tidy] NFC reorder registering in CppCoreGuidelines module

llvm-svn: 343673

5 years ago[AMDGPU] Fix for negative offsets in buffer/tbuffer intrinsics
Tim Renouf [Wed, 3 Oct 2018 10:29:43 +0000 (10:29 +0000)]
[AMDGPU] Fix for negative offsets in buffer/tbuffer intrinsics

Summary:
The new buffer/tbuffer intrinsics handle an out-of-range immediate
offset by moving/adding offset&-4096 to a vgpr, leaving an in-range
immediate offset, with a chance of the move/add being CSEd for similar
loads/stores.

However it turns out that a negative offset in a vgpr is illegal, even
if adding the immediate offset makes it legal again.

Therefore, this commit disables the offset&-4096 thing if the offset is
negative.

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

Change-Id: Ie02f0a74f240a138dc2a29d17cfbd9e350e4ed13
llvm-svn: 343672

5 years ago[X86][Btver2] Most RMW instructions don't require an additional uop
Simon Pilgrim [Wed, 3 Oct 2018 10:28:43 +0000 (10:28 +0000)]
[X86][Btver2] Most RMW instructions don't require an additional uop

Remove uop on WriteRMW and move it into the few instructions that need it.

Match AMD Fam16h SOG + llvm-exegesis tests

llvm-svn: 343671

5 years ago[X86] ALU/ADC RMW instructions should use the WriteRMW sequence class
Simon Pilgrim [Wed, 3 Oct 2018 10:01:13 +0000 (10:01 +0000)]
[X86] ALU/ADC RMW instructions should use the WriteRMW sequence class

I was expecting this to be a nfc but Silvermont seems to be setup a little differently:

// A folded store needs a cycle on MEC_RSV for the store data, but it does not need an extra port cycle to recompute the address.
def : WriteRes<WriteRMW, [SLM_MEC_RSV]>;

So moving from WriteStore to WriteRMW reduces predicted port pressure, confirmed by @craig.topper that this is correct.

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

llvm-svn: 343670

5 years ago[ELF] - Fix BB after r343668
George Rimar [Wed, 3 Oct 2018 09:59:08 +0000 (09:59 +0000)]
[ELF] - Fix BB after r343668

This stops testing the value of .rela.plt section offset.

Also makes _start global to eliminate
'cannot find entry symbol _start' warning.

llvm-svn: 343669

5 years ago[ELF] - Do not forget to include to .dymsym symbols that were converted to Defined.
George Rimar [Wed, 3 Oct 2018 09:33:00 +0000 (09:33 +0000)]
[ELF] - Do not forget to include to .dymsym symbols that were converted to Defined.

This is the fix for
"Bug 39104 - LLD links incorrect ELF executable if version script contains "local: *;"
(https://bugs.llvm.org/show_bug.cgi?id=39104).

The issue happens when we have non-PIC program call to function in a shared library.
(for example, the PR above has R_X86_64_PC32 relocation against __libc_start_main)

LLD converts symbol to Defined in that case with the use of replaceWithDefined()

The issue is that after above we create a broken relocation because do not
include the symbol into .dynsym.

That happens when the version script is used because we treat the symbol as
STB_LOCAL if the following condition match:
VersionId == VER_NDX_LOCAL && isDefined() and do not include it to
.dynsym because of that. Patch fixes the issue.

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

llvm-svn: 343668

5 years ago[LLD] - Do not crash when reporting errors when .debug_line_str (DWARF5) is used
George Rimar [Wed, 3 Oct 2018 08:59:46 +0000 (08:59 +0000)]
[LLD] - Do not crash when reporting errors when .debug_line_str (DWARF5) is used

Imagine we have the following code:

int foo();
int main() { return foo(); }

It will crash if you try to compile it with
`clang -O0 -gdwarf-5 test.cpp -o test -g -fuse-ld=lld`

The crash happens inside the LLVM DWARF parser because LLD does not provide
the .debug_line_str section. At the same time for correct parsing and reporting,
we anyways need to provide this section from our side.

The patch fixes the issue.

llvm-svn: 343667

5 years ago[clang-query] Add comment token handling
Stephen Kelly [Wed, 3 Oct 2018 08:21:54 +0000 (08:21 +0000)]
[clang-query] Add comment token handling

Summary:
It is possible to pass a file of commands to clang-query using the
command line option -f or --preload.  Make it possible to write comments
in such files.

Reviewers: aaron.ballman

Reviewed By: aaron.ballman

Subscribers: mgorny, cfe-commits

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

llvm-svn: 343666

5 years agoAllow comments with '#' in dynamic AST Matchers
Stephen Kelly [Wed, 3 Oct 2018 07:56:43 +0000 (07:56 +0000)]
Allow comments with '#' in dynamic AST Matchers

Summary: This is necessary for clang-query to be able to handle comments.

Reviewers: aaron.ballman

Reviewed By: aaron.ballman

Subscribers: cfe-commits

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

llvm-svn: 343665

5 years ago[clang-query] Add single-letter 'q' alias for 'quit'
Stephen Kelly [Wed, 3 Oct 2018 07:52:44 +0000 (07:52 +0000)]
[clang-query] Add single-letter 'q' alias for 'quit'

Reviewers: aaron.ballman, pcc

Reviewed By: aaron.ballman

Subscribers: Szelethus, cfe-commits

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

llvm-svn: 343664

5 years agoImprove static analysis of cold basic blocks
Aditya Kumar [Wed, 3 Oct 2018 06:21:05 +0000 (06:21 +0000)]
Improve static analysis of cold basic blocks

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

Reviewers: sebpop, tejohnson, brzycki, SirishP
Reviewed By: sebpop

llvm-svn: 343663

5 years agoAdd support for new pass manager
Aditya Kumar [Wed, 3 Oct 2018 05:55:20 +0000 (05:55 +0000)]
Add support for new pass manager

Modified the testcases to use both pass managers
Use single commandline flag for both pass managers.

Differential Revision: https://reviews.llvm.org/D52708
Reviewers: sebpop, tejohnson, brzycki, SirishP
Reviewed By: tejohnson, brzycki

llvm-svn: 343662

5 years agoFix compilation warning by removing unused variable [NFC]
Mikael Holmen [Wed, 3 Oct 2018 05:41:14 +0000 (05:41 +0000)]
Fix compilation warning by removing unused variable [NFC]

clang complained with

../tools/clang/tools/extra/clangd/FS.cpp:19:12: error: unused variable 'Err' [-Werror,-Wunused-variable]
  if (auto Err = FS.makeAbsolute(PathStore))
           ^
1 error generated.

llvm-svn: 343661

5 years ago[Frontend] Delete -print-decl-contexts
Fangrui Song [Wed, 3 Oct 2018 03:50:44 +0000 (03:50 +0000)]
[Frontend] Delete -print-decl-contexts

Summary: Its job is covered by -ast-dump. The option is rarely used and lacks many AST nodes which will lead to llvm_unreachable() crash.

Reviewers: rsmith, arphaman

Reviewed By: rsmith

Subscribers: jfb, cfe-commits

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

llvm-svn: 343660

5 years ago[AMDGPU] Rename pass "isel" to "amdgpu-isel"
Fangrui Song [Wed, 3 Oct 2018 03:38:22 +0000 (03:38 +0000)]
[AMDGPU] Rename pass "isel" to "amdgpu-isel"

Summary: The AMDGPU target specific pass "isel" is a misleading name.

Reviewers: tstellar, echristo, javed.absar, arsenm

Reviewed By: arsenm

Subscribers: arsenm, kzhuravl, jvesely, wdng, nhaehnle, yaxunl, dstuttard, tpr, t-tye, kristof.beyls, llvm-commits

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

llvm-svn: 343659

5 years ago[globalisel] Fix one more missing Verifier pass from gisel-commandline-option.ll
Daniel Sanders [Wed, 3 Oct 2018 02:52:54 +0000 (02:52 +0000)]
[globalisel] Fix one more missing Verifier pass from gisel-commandline-option.ll

llvm-svn: 343658

5 years agoAMDGPU: Always run AMDGPUAlwaysInline
Matt Arsenault [Wed, 3 Oct 2018 02:47:25 +0000 (02:47 +0000)]
AMDGPU: Always run AMDGPUAlwaysInline

Even if calls are enabled, it still needs to be run
for forcing inline of functions that use LDS.

llvm-svn: 343657

5 years agoAdd atomicrmw operation to error messages
Matt Arsenault [Wed, 3 Oct 2018 02:37:15 +0000 (02:37 +0000)]
Add atomicrmw operation to error messages

llvm-svn: 343656

5 years agoAdd the missing new files from r343654
Daniel Sanders [Wed, 3 Oct 2018 02:21:30 +0000 (02:21 +0000)]
Add the missing new files from r343654

llvm-svn: 343655

5 years agoRe-commit: [globalisel] Add a combiner helpers for extending loads and use them in...
Daniel Sanders [Wed, 3 Oct 2018 02:12:17 +0000 (02:12 +0000)]
Re-commit: [globalisel] Add a combiner helpers for extending loads and use them in a pre-legalize combiner for AArch64

Summary: Depends on D45541

Reviewers: ab, aditya_nandakumar, bogner, rtereshin, volkan, rovka, javed.absar, aemerson

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

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

The previous commit failed portions of the test-suite on GreenDragon due to
duplicate COPY instructions and iterator invalidation. Both issues have now
been fixed. To assist with this, a helper (cloneVirtualRegister) has been added
to MachineRegisterInfo that can be used to get another register that has the same
type and class/bank as an existing one.

llvm-svn: 343654

5 years agoOpenCL: Mark printf format string argument
Matt Arsenault [Wed, 3 Oct 2018 02:01:19 +0000 (02:01 +0000)]
OpenCL: Mark printf format string argument

Fixes not warning on format string errors.

llvm-svn: 343653

5 years ago[CMake][Fuchsia] Use libc++ ABIv2 for Fuchsia toolchain
Petr Hosek [Wed, 3 Oct 2018 01:27:00 +0000 (01:27 +0000)]
[CMake][Fuchsia] Use libc++ ABIv2 for Fuchsia toolchain

We don't need to provide stable ABI and hence we can use the v2.

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

llvm-svn: 343652

5 years agoMark two tests, which require too much available VM, as "UNSUPPORTED: ios".
Kuba Mracek [Wed, 3 Oct 2018 00:30:03 +0000 (00:30 +0000)]
Mark two tests, which require too much available VM, as "UNSUPPORTED: ios".

llvm-svn: 343650

5 years ago[WebAssembly] any_true and all_true intrinsics and instructions
Thomas Lively [Wed, 3 Oct 2018 00:19:39 +0000 (00:19 +0000)]
[WebAssembly] any_true and all_true intrinsics and instructions

Reviewers: aheejin, dschuff

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

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

llvm-svn: 343649

5 years ago[AMDGPU] Assert in getOpSize() there are no sub-dword subregs
Stanislav Mekhanoshin [Wed, 3 Oct 2018 00:00:41 +0000 (00:00 +0000)]
[AMDGPU] Assert in getOpSize() there are no sub-dword subregs

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

llvm-svn: 343648

5 years agoIR: Move AtomicRMW string names into class
Matt Arsenault [Tue, 2 Oct 2018 23:44:11 +0000 (23:44 +0000)]
IR: Move AtomicRMW string names into class

This will be used to improve error messages in a future commit.

llvm-svn: 343647

5 years ago[InstCombine] add icmp+logic tests with commuted ops; NFC
Sanjay Patel [Tue, 2 Oct 2018 22:53:37 +0000 (22:53 +0000)]
[InstCombine] add icmp+logic tests with commuted ops; NFC

The transform in question is located in foldICmpAndConstConst(),
but as shown here, it doesn't work if operands are commuted.

llvm-svn: 343646

5 years ago[analyzer] [tests] Hotfix: missing space
George Karpenkov [Tue, 2 Oct 2018 22:31:44 +0000 (22:31 +0000)]
[analyzer] [tests] Hotfix: missing space

llvm-svn: 343643

5 years agoRelax dbg-declare-inalloca.ll test more
Reid Kleckner [Tue, 2 Oct 2018 22:28:10 +0000 (22:28 +0000)]
Relax dbg-declare-inalloca.ll test more

We don't need to match the precise type index number here. It's not
important. The type name is what matters to make this test useful.

llvm-svn: 343642

5 years agoRemove spurious assertion in -Wdocumentation
Reid Kleckner [Tue, 2 Oct 2018 22:23:27 +0000 (22:23 +0000)]
Remove spurious assertion in -Wdocumentation

Some code in OpenCV uses interesting doxygen directives that make it so
we don't see any tokens inside a @note, despite there definitely being
non-whitespace characters there. The consistency check isn't needed.
ParagraphComment supports receiving an empty list of comments.

Fixes PR39007

llvm-svn: 343641

5 years ago[WebAssembly] Stop generating helper functions in WebAssemblyLowerEmscriptenEHSjLj
Sam Clegg [Tue, 2 Oct 2018 22:12:15 +0000 (22:12 +0000)]
[WebAssembly] Stop generating helper functions in WebAssemblyLowerEmscriptenEHSjLj

Previously we were creating weakly defined helper function in
each translation unit:

-  setThrew
-  setTempRet0

Instead we now assume these will be provided at link time.  In
emscripten they are provided in compiler-rt:
 https://github.com/kripken/emscripten/pull/7203

Additionally we previously created three global variable which are
also now required to exist at link time instead.

- __THREW__
- _threwValue
- __tempRet0

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

llvm-svn: 343640

5 years ago[CodeView] Try fixing DebugInfo/X86/dbg-declare-inalloca.ll
Fangrui Song [Tue, 2 Oct 2018 22:03:31 +0000 (22:03 +0000)]
[CodeView] Try fixing DebugInfo/X86/dbg-declare-inalloca.ll

llvm-svn: 343639

5 years ago[hwasan] Fix top PC in error stack trace being off by 1 instruction.
Evgeniy Stepanov [Tue, 2 Oct 2018 21:52:02 +0000 (21:52 +0000)]
[hwasan] Fix top PC in error stack trace being off by 1 instruction.

Summary:
GetStackTrace treats top PC as a return address from an error reporting
function, and adjusts it down by 1 instruction. This is not necessary in
a signal handler, so adjust PC up to compensate.

Reviewers: kcc, vitalybuka, jfb

Subscribers: kubamracek, llvm-commits

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

llvm-svn: 343638

5 years ago[clangd] Temporarily disable VFS stats cache test for windows.
Eric Liu [Tue, 2 Oct 2018 21:47:41 +0000 (21:47 +0000)]
[clangd] Temporarily disable VFS stats cache test for windows.

llvm-svn: 343637

5 years ago[analyzer] [tests] Allow specifying entire -analyze-config on the command line, make...
George Karpenkov [Tue, 2 Oct 2018 21:19:23 +0000 (21:19 +0000)]
[analyzer] [tests] Allow specifying entire -analyze-config on the command line, make sure it's always propagated

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

llvm-svn: 343636

5 years ago[analyzer] Fix crash in exploded graph dumping
George Karpenkov [Tue, 2 Oct 2018 21:19:01 +0000 (21:19 +0000)]
[analyzer] Fix crash in exploded graph dumping

By allocating new DeclStmt to ASTContext

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

llvm-svn: 343635

5 years ago[globalisel] Attempt to fix llvm-clang-x86_64-expensive-checks-win
Daniel Sanders [Tue, 2 Oct 2018 20:51:27 +0000 (20:51 +0000)]
[globalisel] Attempt to fix llvm-clang-x86_64-expensive-checks-win

The behaviour of this bot indicates that -verify-machineinstrs has been forced
on and is therefore inserting the verifier on builds that don't expect it.
Explicitly specify whether it's enabled or disabled for each test.

llvm-svn: 343633

5 years ago[analyzer] Promote StdCLibraryFunctionsChecker to the apiModeling category.
Artem Dergachev [Tue, 2 Oct 2018 20:50:40 +0000 (20:50 +0000)]
[analyzer] Promote StdCLibraryFunctionsChecker to the apiModeling category.

Because all our languages are C-based, there's no reason to
enable this checker only on UNIX targets.

Patch by DonĂ¡t Nagy!

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

llvm-svn: 343632

5 years ago[analyzer] Fix symbol discovery in nonloc::LocAsInteger values.
Artem Dergachev [Tue, 2 Oct 2018 20:48:12 +0000 (20:48 +0000)]
[analyzer] Fix symbol discovery in nonloc::LocAsInteger values.

Doesn't do much despite sounding quite bad, but fixes an exotic test case where
liveness of a nonloc::LocAsInteger array index is now evaluated correctly.

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

llvm-svn: 343631

5 years ago[cl-compat] Change /JMC from unsupported to ignored.
Zachary Turner [Tue, 2 Oct 2018 20:42:36 +0000 (20:42 +0000)]
[cl-compat] Change /JMC from unsupported to ignored.

A tracking bug for actually implementing this in clang-cl is at
https://bugs.llvm.org/show_bug.cgi?id=39156.

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

llvm-svn: 343629

5 years agoIntroduce a flag to warn when ifunc symbols are used with text relocations.
Ali Tamur [Tue, 2 Oct 2018 20:30:22 +0000 (20:30 +0000)]
Introduce a flag to warn when ifunc symbols are used with text relocations.

Summary:
This patch adds a new flag, --warn-ifunc-textrel, to work around a glibc bug. When a code with ifunc symbols is used to produce an object file with text relocations, lld always succeeds. However, if that object file is linked using an old version of glibc, the resultant binary just crashes with segmentation fault when it is run (The bug is going to be corrected as of glibc 2.19).

Since there is no way to tell beforehand what library the object file will be linked against in the future, there does not seem to be a fool-proof way for lld to give an error only in cases where the binary will crash. So, with this change (dated 2018-09-25), lld starts to give a warning, contingent on a new command line flag that does not have a gnu counter part. The default value for --warn-ifunc-textrel is false, so lld behaviour will not change unless the user explicitly asks lld to give a warning. Users that link with a glibc library with version 2.19 or newer, or does not use ifunc symbols, or does not generate object files with text relocations do not need to take any action. Other users may consider to start passing warn-ifunc-textrel to lld to get early warnings.

Reviewers: ruiu, espindola

Reviewed By: ruiu

Subscribers: grimar, MaskRay, markj, emaste, arichardson, llvm-commits

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

llvm-svn: 343628

5 years ago [CodeView] Only add the Scoped flag for an enum type when it has an immediate functi...
Aaron Smith [Tue, 2 Oct 2018 20:28:15 +0000 (20:28 +0000)]
 [CodeView] Only add the Scoped flag for an enum type when it has an immediate function scope to match MSVC

Reviewers: rnk, zturner, llvm-commits

Reviewed By: rnk

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

llvm-svn: 343627

5 years ago[CodeView] Emit function options for subprogram and member functions
Aaron Smith [Tue, 2 Oct 2018 20:21:05 +0000 (20:21 +0000)]
[CodeView] Emit function options for subprogram and member functions

Summary:
Use the newly added DebugInfo (DI) Trivial flag, which indicates if a C++ record is trivial or not, to determine Codeview::FunctionOptions.

Clang and MSVC generate slightly different Codeview for C++ records. For example, here is the C++ code for a class with a defaulted ctor,

       class C {
       public:
         C() = default;
       };

Clang will produce a LF for the defaulted ctor while MSVC does not. For more details, refer to FIXMEs in the test cases in "function-options.ll" included with this set of changes.

Reviewers: zturner, rnk, llvm-commits, aleksandr.urakov

Reviewed By: rnk

Subscribers: Hui, JDevlieghere

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

llvm-svn: 343626

5 years agoRemove unnecessary field
Adrian Prantl [Tue, 2 Oct 2018 20:14:12 +0000 (20:14 +0000)]
Remove unnecessary field

llvm-svn: 343624

5 years ago[clangd] Try to fix windows buildbot after r343576
Eric Liu [Tue, 2 Oct 2018 20:00:32 +0000 (20:00 +0000)]
[clangd] Try to fix windows buildbot after r343576

http://lab.llvm.org:8011/builders/llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast/builds/20347/steps/test/logs/stdio

llvm-svn: 343623

5 years agoReland r343589 "[clangd] Dex: add Corpus factory for iterators, rename, fold constant...
Sam McCall [Tue, 2 Oct 2018 19:59:23 +0000 (19:59 +0000)]
Reland r343589 "[clangd] Dex: add Corpus factory for iterators, rename, fold constant. NFC""

This reverts commit r343610.

llvm-svn: 343622

5 years ago[llvm-mca] Remove unecessary forward decls. NFC.
Matt Davis [Tue, 2 Oct 2018 19:42:46 +0000 (19:42 +0000)]
[llvm-mca] Remove unecessary forward decls. NFC.

This patch also removes an unecessary include.

llvm-svn: 343621

5 years ago[analyzer][NFC] Refactor functions in PlistDiagnostics to take AnalyzerOptions as...
Kristof Umann [Tue, 2 Oct 2018 19:27:34 +0000 (19:27 +0000)]
[analyzer][NFC] Refactor functions in PlistDiagnostics to take AnalyzerOptions as parameter

I intend to add a new flag macro-expnasions-as-events, and unfortunately
I'll only be able to convert the macro piece into an event one once I'm
about to emit it, due to the lack of an avaible Preprocessor object in
the BugReporter.

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

llvm-svn: 343620

5 years ago[OpenMP] Shutdown library on Windows if possible for better OMPT behavior
Jonathan Peyton [Tue, 2 Oct 2018 19:15:04 +0000 (19:15 +0000)]
[OpenMP] Shutdown library on Windows if possible for better OMPT behavior

On Windows, child workers are terminated by the parent during the normal
program exit process (ExitProcess()) and they are not able to finish generating
their OpenMP events. We can force manual library shut down in __kmpc_end() to
fix this at least for the cases where __kmpc_end() is properly inserted.

Patch by Hansang Bae

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

llvm-svn: 343619

5 years ago[OpenMP][NVPTX] Simplify codegen for orphaned parallel, NFCI.
Jonas Hahnfeld [Tue, 2 Oct 2018 19:12:54 +0000 (19:12 +0000)]
[OpenMP][NVPTX] Simplify codegen for orphaned parallel, NFCI.

Worker threads fork off to the compiler generated worker function
directly after entering the kernel function. Hence, there is no
need to check whether the current thread is the master if we are
outside of a parallel region (neither SPMD nor parallel_level > 0).

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

llvm-svn: 343618

5 years ago[OpenMP] Simplify code for reductions on distribute directives, NFC.
Jonas Hahnfeld [Tue, 2 Oct 2018 19:12:47 +0000 (19:12 +0000)]
[OpenMP] Simplify code for reductions on distribute directives, NFC.

Only need to care about the 'distribute simd' case, all other composite
directives are handled elsewhere. This was already reflected in the
outer 'if' condition, so all other inner conditions could never be true.

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

llvm-svn: 343617

5 years agoRevert "X86, AArch64, ARM: Do not attach debug location to spill/reload instructions"
Matt Morehouse [Tue, 2 Oct 2018 18:35:44 +0000 (18:35 +0000)]
Revert "X86, AArch64, ARM: Do not attach debug location to spill/reload instructions"

This reverts r343520 due to breakage of HWASan tests on Android.

llvm-svn: 343616

5 years ago[llvm-mca] Constify the 'notify' routines. NFC.
Matt Davis [Tue, 2 Oct 2018 18:26:33 +0000 (18:26 +0000)]
[llvm-mca] Constify the 'notify' routines. NFC.

Also fixed up some whitespace formatting in DispatchStage.cpp.

llvm-svn: 343615

5 years ago[X86][Disassembler] Add bizarro versions of the MOVSXD instruction that sign extend...
Craig Topper [Tue, 2 Oct 2018 18:16:19 +0000 (18:16 +0000)]
[X86][Disassembler] Add bizarro versions of the MOVSXD instruction that sign extend from a GR32 to GR32 or GR16.

The 0x63 opcodes in 64-bit mode have a fixed source size of 32-bits, but the destination size is controlled by REX.W and the 0x66 opsize prefix. This instruction is normally used with a REX.W prefix which provides desired behavior. The other encodings are interpretted as valid by the processor, but aren't useful.

This patch makes us recognize them for the disassembler to match objdump.

llvm-svn: 343614

5 years ago[globalisel][verifier] Run the MachineVerifier from IRTranslator onwards
Daniel Sanders [Tue, 2 Oct 2018 17:56:58 +0000 (17:56 +0000)]
[globalisel][verifier] Run the MachineVerifier from IRTranslator onwards

-verify-machineinstrs inserts the MachineVerifier after every MachineInstr-based
pass. However, GlobalISel creates MachineInstr-based passes earlier than DAGISel
and the corresponding verifiers are not being added. This patch fixes that.

If GlobalISel triggers the fallback path then the MIR can be left in a bad
state that is going to be cleared by ResetMachineFunctions. In this situation
verifying between GlobalISel passes will prevent the fallback path from
recovering from this. As a result, we bail out of verifying a function if the
FailedISel attribute is present.

llvm-svn: 343613

5 years agoDWARFExpression: Resolve file addresses in the linked module
Adrian Prantl [Tue, 2 Oct 2018 17:50:42 +0000 (17:50 +0000)]
DWARFExpression: Resolve file addresses in the linked module

This is a follow-up to https://reviews.llvm.org/D46362.

When evaluating a complex expression in DWARFExpression::Evaluate,
file addresses must be resolved to load addresses before we can
perform operations such as DW_OP_deref on them.

For this the address goes through three steps

1. Read the file address as stored in the DWARF
2. Link/relocate the file address (when reading from a .dSYM, this is a no-op)
3. Convert the file address to a load address.

D46362 implemented step (3) by resolving the file address using the
Module that the original DWARF came from. In the case of a dSYM that
is correct, but when reading from .o files, we need to look up
relocated/linked addresses, so the right place to look them up is the
current frame's module. This patch fixes that by setting the
expression's Module to point to the linked debugmap object.

A word a bout the unorthodox testcase: The motivating testcase for
this fix is in Swift, but I managed to hand-modify LLVM-IR for a
trivial C program to exhibit the same problem, so we can fix this in
llvm.org.

rdar://problem/44689915

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

llvm-svn: 343612

5 years ago[HIP] Support early finalization of device code for -fno-gpu-rdc
Yaxun Liu [Tue, 2 Oct 2018 17:48:54 +0000 (17:48 +0000)]
[HIP] Support early finalization of device code for -fno-gpu-rdc

This patch renames -f{no-}cuda-rdc to -f{no-}gpu-rdc and keeps the original
options as aliases. When -fgpu-rdc is off,
clang will assume the device code in each translation unit does not call
external functions except those in the device library, therefore it is possible
to compile the device code in each translation unit to self-contained kernels
and embed them in the host object, so that the host object behaves like
usual host object which can be linked by lld.

The benefits of this feature is: 1. allow users to create static libraries which
can be linked by host linker; 2. amortized device code linking time.

This patch modifies HIP action builder to insert actions for linking device
code and generating HIP fatbin, and pass HIP fatbin to host backend action.
It extracts code for constructing command for generating HIP fatbin as
a function so that it can be reused by early finalization. It also modifies
codegen of HIP host constructor functions to embed the device fatbin
when it is available.

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

llvm-svn: 343611

5 years agoRevert r343589 "[clangd] Dex: add Corpus factory for iterators, rename, fold constant...
Reid Kleckner [Tue, 2 Oct 2018 17:31:43 +0000 (17:31 +0000)]
Revert r343589 "[clangd] Dex: add Corpus factory for iterators, rename, fold constant. NFC"

Declaring a field with the same name as a type causes GCC to error out:

Dex.h:104:10: error: declaration of 'clang::clangd::dex::Corpus clang::clangd::dex::Dex::Corpus' [-fpermissive]
   Corpus Corpus;
          ^
Iterator.h:127:7: error: changes meaning of 'Corpus' from 'class clang::clangd::dex::Corpus' [-fpermissive]
 class Corpus {

llvm-svn: 343610

5 years agoRemove GetPythonDir declaration from HostInfoBase class
Tatyana Krasnukha [Tue, 2 Oct 2018 17:24:58 +0000 (17:24 +0000)]
Remove GetPythonDir declaration from HostInfoBase class

llvm-svn: 343609

5 years ago[clangd] Don't make check-clangd as a dependency in check-clang-tools
Haojian Wu [Tue, 2 Oct 2018 17:22:11 +0000 (17:22 +0000)]
[clangd] Don't make check-clangd as a dependency in check-clang-tools

Summary:
check-clang-tools will run check-clangd first, and then run the rest
tests. If clangd tests fails, check-clang-tools would be stopped.

This would block other clang-tools developers if clangd is broken.

Reviewers: sammccall

Subscribers: mgorny, ilya-biryukov, ioeric, MaskRay, jkorous, arphaman, kadircet, cfe-commits

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

llvm-svn: 343608

5 years ago[lib/fuzzer] Fix logging for Fuchsia
Petr Hosek [Tue, 2 Oct 2018 17:21:04 +0000 (17:21 +0000)]
[lib/fuzzer] Fix logging for Fuchsia

This change fixes two aspects of logging on Fuchsia:

1. When logging to stdout, the output file descriptor should not be
closed in ExecuteCommand, as it prevent fdio_spawn_etc from succeeding
in subsequent calls.
2. When logging to a file in anything other than standalone Zircon, the
log file needs to be created in mutable storage. The best indicator
where this is relative to the Fuchsia component will be given by
'-artifact_prefix=...', so save the log file relative to that path.

Patch by: aarongreen
Differential Revision: https://reviews.llvm.org/D52562

llvm-svn: 343607

5 years agoReland r342652 "[winasan] Unpoison the stack in NtTerminateThread"
David Major [Tue, 2 Oct 2018 17:17:12 +0000 (17:17 +0000)]
Reland r342652 "[winasan] Unpoison the stack in NtTerminateThread"

In long-running builds we've seen some ASan complaints during thread creation that we suspect are due to leftover poisoning from previous threads whose stacks occupied that memory. This patch adds a hook that unpoisons the stack just before the NtTerminateThread syscall.

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

llvm-svn: 343606

5 years ago[sanitizer] Include inlined frames into __sanitizer_symbolize_pc output
Vitaly Buka [Tue, 2 Oct 2018 17:01:18 +0000 (17:01 +0000)]
[sanitizer] Include inlined frames into __sanitizer_symbolize_pc output

Summary:
Behavior for existing used is not changing as the first line is going
to be the same, and it was invalid to try to read more lines.

New clients can read until they get empty string.

Reviewers: eugenis, morehouse

Subscribers: kubamracek, eraman, llvm-commits

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

llvm-svn: 343605

5 years ago[NFC][BUG-FIX][ARM] Add missing data symbol
Diogo N. Sampaio [Tue, 2 Oct 2018 16:53:12 +0000 (16:53 +0000)]
[NFC][BUG-FIX][ARM] Add missing data symbol

llvm rL343594: [ARM] Emmit data symbol
for constant pool data fixed a bug that ommited
required data symbols.
Such change breaked a test case in lld:
test/ELF/arm-thunk-largesection.s

llvm-svn: 343604

5 years ago[codeview] Fix 32-bit x86 variable locations in realigned stack frames
Reid Kleckner [Tue, 2 Oct 2018 16:43:52 +0000 (16:43 +0000)]
[codeview] Fix 32-bit x86 variable locations in realigned stack frames

Add the .cv_fpo_stackalign directive so that we can define $T0, or the
VFRAME virtual register, with it. This was overlooked in the initial
implementation because unlike MSVC, we push CSRs before allocating stack
space, so this value is only needed to describe local variable
locations. Variables that the compiler now addresses via ESP are instead
described as being stored at offsets from VFRAME, which for us is ESP
after alignment in the prologue.

This adds tests that show that we use the VFRAME register properly in
our S_DEFRANGE records, and that we emit the correct FPO data to define
it.

Fixes PR38857

llvm-svn: 343603

5 years agoclang-format: better handle statement macros
Francois Ferrand [Tue, 2 Oct 2018 16:37:51 +0000 (16:37 +0000)]
clang-format: better handle statement macros

Summary:
Some macros are used in the body of function, and actually contain the trailing semicolon: they should thus be automatically followed by a new line, and not get merged with the next line. This is for example the case with Qt's Q_UNUSED macro:

  void foo(int a, int b) {
    Q_UNUSED(a)
    return b;
  }

This patch deals with these cases by introducing a new option to specify list of statement macros. This re-uses the system already in place for foreach macros, to ensure there is no impact on performance.

Reviewers: krasimir, djasper, klimek

Reviewed By: krasimir

Subscribers: acoomans, mgrang, alexfh, klimek, cfe-commits

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

llvm-svn: 343602

5 years ago[Arm builtins] Remove non-necessary IS check
Kristina Brooks [Tue, 2 Oct 2018 16:32:32 +0000 (16:32 +0000)]
[Arm builtins] Remove non-necessary IS check

This patch removes the instruction set check to make the msr APSR_nzcvq,
ip instruction only execute if Thumb2 is used.
The APSR is a subset of the bits of the CPSR
(B.1.3.3 of the Arm v7 A and R ARM [1]) and is only available for A and
R profiles.
However in section B.9.3.11 of the same document we see that:

"In the A and R profiles, APSR_nzcvq is the same as CPSR_f"
"ARM recommends the APSR forms when only the N, Z, C, V, Q, and GE[3:0]
bits are being written."

This patch also make those files assemble for Armv8-M Mainline
architecture profile.

The builtins were cross-compiled for Arm, Aarch64 and Armv6-M, Armv7-M
and Armv7E-M targets.
Cross-compiled tests were executed for Arm target.

[1]: https://developer.arm.com/docs/ddi0406/latest/arm-architecture-reference-manual-armv7-a-and-armv7-r-edition

Patch by hug-dev (Hugues de Valon).

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

llvm-svn: 343601

5 years agoRevert "[sanitizer] Include inlined frames into __sanitizer_symbolize_pc output"
Jessica Paquette [Tue, 2 Oct 2018 16:28:52 +0000 (16:28 +0000)]
Revert "[sanitizer] Include inlined frames into __sanitizer_symbolize_pc output"

This reverts r343554.

It was breaking some bots:
http://lab.llvm.org:8080/green/job/clang-stage1-configure-RA/49997/

llvm-svn: 343600

5 years ago[sanitizer] Use -Wl,-z,global on Android for sanitizers except UBsan
Stephen Hines [Tue, 2 Oct 2018 16:19:42 +0000 (16:19 +0000)]
[sanitizer] Use -Wl,-z,global on Android for sanitizers except UBsan

Summary:
This essentially reverts r337010 since it breaks UBSan, which is used
for a few platform libraries. The "-z global" flag is now added for
Scudo as well. The only other sanitizer shared libraries are for asan
and hwasan, which have also been reinstated to use the global flag.

Reviewers: cryptoad, eugenis

Reviewed By: cryptoad

Subscribers: kubamracek, mgorny, delcypher, #sanitizers, nickdesaulniers, chh, kongyi, pirama, llvm-commits

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

llvm-svn: 343599

5 years ago[X86][Btver2] Fix BLENDV and AESDEC schedules
Simon Pilgrim [Tue, 2 Oct 2018 15:13:18 +0000 (15:13 +0000)]
[X86][Btver2] Fix BLENDV and AESDEC schedules

Match AMD Fam16h SOG + llvm-exegesis tests

llvm-svn: 343597