platform/upstream/llvm.git
8 years ago[SimplifyCFG] Do not blindly remove unreachable blocks
David Majnemer [Wed, 24 Feb 2016 10:02:16 +0000 (10:02 +0000)]
[SimplifyCFG] Do not blindly remove unreachable blocks

DeleteDeadBlock was called indiscriminately, leading to cleanuprets with
undef cleanuppad references.

Instead, try to drain the BB of most of it's instructions if it is
unreachable.  We can then remove the BB if it solely consists of a
terminator (and maybe some phis).

llvm-svn: 261731

8 years ago[CodeView] Describe variables live in x87 registers
David Majnemer [Wed, 24 Feb 2016 10:01:24 +0000 (10:01 +0000)]
[CodeView] Describe variables live in x87 registers

We didn't have a mapping from LLVM's x87 floating point registers to
CodeView's encoding.

llvm-svn: 261730

8 years ago[ELF] - replaced std::function with raw pointers in LinkerScript.cpp
George Rimar [Wed, 24 Feb 2016 09:21:47 +0000 (09:21 +0000)]
[ELF] - replaced std::function with raw pointers in LinkerScript.cpp

Change as was proposed by David Blaikie.

Differential revision: http://reviews.llvm.org/D17499

llvm-svn: 261729

8 years agotsan: disable ignore_lib4.cc test on powerpc64 and aarch64
Dmitry Vyukov [Wed, 24 Feb 2016 09:14:46 +0000 (09:14 +0000)]
tsan: disable ignore_lib4.cc test on powerpc64 and aarch64

Fails on bots:
http://lab.llvm.org:8011/builders/clang-ppc64be-linux/builds/1555/steps/ninja%20check%201/logs/FAIL%3A%20ThreadSanitizer-powerpc64%3A%3A%20ignore_lib4.cc
http://lab.llvm.org:8011/builders/sanitizer-ppc64be-linux/builds/725/steps/ninja%20check-tsan/logs/stdio
http://lab.llvm.org:8011/builders/clang-cmake-aarch64-full/builds/1468/steps/ninja%20check%202/logs/FAIL%3A%20ThreadSanitizer-aarch64%3A%3A%20ignore_lib4.cc
http://lab.llvm.org:8011/builders/clang-native-aarch64-full/builds/2787/steps/ninja%20check%202/logs/FAIL%3A%20ThreadSanitizer-aarch64%3A%3A%20ignore_lib4.cc

llvm-svn: 261728

8 years ago[X86][SSE] Don't get target shuffle operands prematurely.
Simon Pilgrim [Wed, 24 Feb 2016 09:07:47 +0000 (09:07 +0000)]
[X86][SSE] Don't get target shuffle operands prematurely.

PerformShuffleCombine should be usable by unary and binary target shuffles, but was attempting to get the first two operands whatever the instruction type. Since these are only used for VECTOR_SHUFFLE instructions for one particular combine I've moved them inside the relevant if statement.

llvm-svn: 261727

8 years ago[ELF] - Teach input section wildcard patterns to recognize '?' meta character.
George Rimar [Wed, 24 Feb 2016 08:49:50 +0000 (08:49 +0000)]
[ELF] - Teach input section wildcard patterns to recognize '?' meta character.

`?' - matches any single character
https://sourceware.org/binutils/docs/ld/Input-Section-Wildcards.html

This is used in linker scripts.

Differential revision: http://reviews.llvm.org/D17290

llvm-svn: 261726

8 years ago[LLVM][AVX512][PSHUFHW ][PSHUFLW ] Change imm8 to int
Michael Zuckerman [Wed, 24 Feb 2016 08:39:05 +0000 (08:39 +0000)]
[LLVM][AVX512][PSHUFHW ][PSHUFLW ] Change imm8 to int

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

llvm-svn: 261725

8 years agoAVX512: Add vpmovzxbw/d/q ,vpmovzxw/d/q ,vpmovzxbdq lowering patterns that support...
Igor Breger [Wed, 24 Feb 2016 08:15:20 +0000 (08:15 +0000)]
AVX512: Add vpmovzxbw/d/q ,vpmovzxw/d/q ,vpmovzxbdq lowering patterns that support 256bit inputs like AVX patterns ( that are disable in case HasVLX , see SS41I_pmovx_avx2_patterns).

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

llvm-svn: 261724

8 years ago[MSan] fix process_vm_readv test: Exit silently if syscall is not implemeted
Mohit K. Bhakkad [Wed, 24 Feb 2016 08:14:41 +0000 (08:14 +0000)]
[MSan] fix process_vm_readv test: Exit silently if syscall is not implemeted

Reviewers: eugenis

Subscribers: jaydeep, sagar, llvm-commits

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

llvm-svn: 261723

8 years agoX86: Wrap a helper for an assert in #ifndef NDEBUG
Justin Bogner [Wed, 24 Feb 2016 07:58:02 +0000 (07:58 +0000)]
X86: Wrap a helper for an assert in #ifndef NDEBUG

This function is used in exactly one place, and only in asserts
builds. Move it a few lines up before the use and only define it when
asserts are enabled. Fixes the release build under -Werror.

Also remove the forward declaration and commentary that was basically
identical to the code itself.

llvm-svn: 261722

8 years ago[MSan] Mark dlerror.cc expected failure for MIPS
Mohit K. Bhakkad [Wed, 24 Feb 2016 07:08:33 +0000 (07:08 +0000)]
[MSan] Mark dlerror.cc expected failure for MIPS

Reviewers: samsonov

Subscribers: jaydeep, sagar, llvm-commits, aemerson

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

llvm-svn: 261721

8 years agoAMDGPU: Check cheaper condition before SignBitIsZero
Matt Arsenault [Wed, 24 Feb 2016 04:55:29 +0000 (04:55 +0000)]
AMDGPU: Check cheaper condition before SignBitIsZero

Don't do an expensive computeKnownBits call when we
can do the cheap check for legal offsets first.

llvm-svn: 261720

8 years ago[OpenCL] Add Sema checks for OpenCL 2.0 block
Xiuli Pan [Wed, 24 Feb 2016 04:29:36 +0000 (04:29 +0000)]
[OpenCL] Add Sema checks for OpenCL 2.0 block

Summary:
Add Sema checks for opencl 2.0 new features: Block.
This patch is partitioned from http://reviews.llvm.org/D16047

Reviewers: Anastasia

Subscribers: pekka.jaaskelainen, cfe-commits

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

llvm-svn: 261719

8 years agoFix TestCStrings for Linux with i386 inferiors.
Chaoren Lin [Wed, 24 Feb 2016 03:15:21 +0000 (03:15 +0000)]
Fix TestCStrings for Linux with i386 inferiors.

Summary: Temporarily revert part of r261704.

Reviewers: spyffe

Subscribers: lldb-commits

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

llvm-svn: 261718

8 years agoDefault vaarg lowering should support indirect struct types.
James Y Knight [Wed, 24 Feb 2016 02:59:33 +0000 (02:59 +0000)]
Default vaarg lowering should support indirect struct types.

Fixes PR11517 for SPARC.

On most targets, clang lowers va_arg itself, eschewing the use of the
llvm vaarg instruction. This is necessary (at least for now) as the type
argument to the vaarg instruction cannot represent all the ABI
information that is needed to support complex calling conventions.

However, on targets with a simpler varrags ABIs, the LLVM instruction
can work just fine, and clang can simply lower to it. Unfortunately,
even on such targets, vaarg with a struct argument would fail, because
the default lowering to vaarg was naive: it didn't take into account the
ABI attribute computed by classifyArgumentType. In particular, for the
DefaultABIInfo, structs are supposed to be passed indirectly and so
llvm's vaarg instruction should be emitted with a pointer argument.

Now, vaarg instruction emission is able to use computed ABIArgInfo for
the provided argument type, which allows the default ABI support to work
for structs too.

I haven't touched the EmitVAArg implementation for PPC32_SVR4 or XCore,
although I believe both are now redundant, and could be switched over to
use the default implementation as well.

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

llvm-svn: 261717

8 years agoFix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in some files...
Eugene Zelenko [Wed, 24 Feb 2016 02:05:55 +0000 (02:05 +0000)]
Fix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in some files in source/Commands; other minor fixes.

llvm-svn: 261716

8 years ago[tests] Portability fixup for r261713.
Alexey Samsonov [Wed, 24 Feb 2016 01:28:51 +0000 (01:28 +0000)]
[tests] Portability fixup for r261713.

llvm-svn: 261715

8 years agomath: Fix ilogb(double) return type
Aaron Watry [Wed, 24 Feb 2016 00:52:15 +0000 (00:52 +0000)]
math: Fix ilogb(double) return type

Signed-off-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 261714

8 years ago[tests] Resolve old TODOs in ASan unit tests.
Alexey Samsonov [Wed, 24 Feb 2016 00:41:29 +0000 (00:41 +0000)]
[tests] Resolve old TODOs in ASan unit tests.

llvm-svn: 261713

8 years agoELF: Remove InputSectionBase::getAlign and instead add Align member.
Rui Ueyama [Wed, 24 Feb 2016 00:38:18 +0000 (00:38 +0000)]
ELF: Remove InputSectionBase::getAlign and instead add Align member.

This is a preparation for ICF. If we merge two sections, we want to
align the merged section at the largest alignment requirement.
That means we want to update the alignment value, which was
impossible before this patch because Header is a const value.

llvm-svn: 261712

8 years agoELF: Remove InputSectionBase::isLive and use Live member instead. NFC.
Rui Ueyama [Wed, 24 Feb 2016 00:23:15 +0000 (00:23 +0000)]
ELF: Remove InputSectionBase::isLive and use Live member instead. NFC.

This is also a preparation for ICF.

llvm-svn: 261711

8 years agoELF: Make some functions constant. NFC.
Rui Ueyama [Wed, 24 Feb 2016 00:23:13 +0000 (00:23 +0000)]
ELF: Make some functions constant. NFC.

This is a preparation for ICF.

llvm-svn: 261710

8 years agoCOFF: Temporarily remove flaky a test.
Rui Ueyama [Wed, 24 Feb 2016 00:23:11 +0000 (00:23 +0000)]
COFF: Temporarily remove flaky a test.

This test is flaky for more than half a year or so on buildbots
and has been causing confusion. Remove it while I'm investing the
cause.

llvm-svn: 261709

8 years ago[tests] Don't compile CFI C tests in C++ mode.
Alexey Samsonov [Wed, 24 Feb 2016 00:16:57 +0000 (00:16 +0000)]
[tests] Don't compile CFI C tests in C++ mode.

llvm-svn: 261708

8 years ago[InstCombine] refactor visitOr() to use foldCastedBitwiseLogic()
Sanjay Patel [Tue, 23 Feb 2016 23:56:23 +0000 (23:56 +0000)]
[InstCombine] refactor visitOr() to use foldCastedBitwiseLogic()

Note: The 'and' case in foldCastedBitwiseLogic() is inheriting one extra
check from the nearly identical 'or' case:
  if ((!isa<ICmpInst>(Cast0Src) || !isa<ICmpInst>(Cast1Src))

But I'm not sure how to expose that difference in a regression test.
Without that check, the 'or' path will infinite loop on:
test/Transforms/InstCombine/zext-or-icmp.ll
because the zext-or-icmp fold is attempting a reverse transform.

The refactoring should extend to the 'xor' case next to solve part of
PR26702.

llvm-svn: 261707

8 years ago[doc] Obtaining help on LLVM's CUDA support.
Jingyue Wu [Tue, 23 Feb 2016 23:34:49 +0000 (23:34 +0000)]
[doc] Obtaining help on LLVM's CUDA support.

llvm-svn: 261706

8 years agoPR24667: fix quadratic runtime if textually-included modular headers define large...
Richard Smith [Tue, 23 Feb 2016 23:20:51 +0000 (23:20 +0000)]
PR24667: fix quadratic runtime if textually-included modular headers define large numbers of macros.

llvm-svn: 261705

8 years agoWhen looking for symbols, find load addresses in a more robust way.
Sean Callanan [Tue, 23 Feb 2016 23:09:06 +0000 (23:09 +0000)]
When looking for symbols, find load addresses in a more robust way.

IRExecutionUnit previously replicated a bunch of logic that already
existed elsewhere for the purpose of getting a load address for a
symbol.  This approach failed to resolve certain types of symbols.
Instead, we now use functions on SymbolContext to do the address
resolution.

This is a cleanup of IRExecutionUnit::FindInSymbols, and also fixes a
latent bug where we looked at the wrong SymbolContext to determine
whether or not it is external.

<rdar://problem/24770829>

llvm-svn: 261704

8 years ago[analyzer] Find ObjC 'self' decl even when block captures local named 'self'.
Devin Coughlin [Tue, 23 Feb 2016 22:26:04 +0000 (22:26 +0000)]
[analyzer] Find ObjC 'self' decl even when block captures local named 'self'.

When looking up the 'self' decl in block captures, make sure to find the actual
self declaration even when the block captures a local variable named 'self'.

rdar://problem/24751280

llvm-svn: 261703

8 years agoRevert "[WebAssembly] Stackify code emitted by eliminateFrameIndex"
Derek Schuff [Tue, 23 Feb 2016 22:13:21 +0000 (22:13 +0000)]
Revert "[WebAssembly] Stackify code emitted by eliminateFrameIndex"

This reverts r261685 due to wasm test breakage.

llvm-svn: 261702

8 years agominimize test and use FileCheck
Sanjay Patel [Tue, 23 Feb 2016 22:03:44 +0000 (22:03 +0000)]
minimize test and use FileCheck

llvm-svn: 261701

8 years ago[CMake] Support component-based installation for runtime libraries
Chris Bieneman [Tue, 23 Feb 2016 21:55:38 +0000 (21:55 +0000)]
[CMake] Support component-based installation for runtime libraries

This enables targets like "install-ubsan" and "install-asan" to install all associated runtime libraries.

llvm-svn: 261700

8 years ago[CMake] Assign components and dependencies during add_compiler_rt_resource_file
Chris Bieneman [Tue, 23 Feb 2016 21:50:39 +0000 (21:50 +0000)]
[CMake] Assign components and dependencies during add_compiler_rt_resource_file

This makes it so that component-based installations will include resource files (i.e. blacklists). My next patch will add support for component-based installations.

llvm-svn: 261699

8 years agoAArch64: rename compact unwind forms back to UNWIND_ARM64_*. NFC.
Tim Northover [Tue, 23 Feb 2016 21:49:05 +0000 (21:49 +0000)]
AArch64: rename compact unwind forms back to UNWIND_ARM64_*. NFC.

Looks like the global rename last year was a bit over-zealous. These things
really are referred to with ARM64 elsewhere (ld64, libunwind, ...).

llvm-svn: 261698

8 years ago[WebAssembly] Stackify code emitted by eliminateFrameIndex
Derek Schuff [Tue, 23 Feb 2016 21:25:17 +0000 (21:25 +0000)]
[WebAssembly] Stackify code emitted by eliminateFrameIndex

llvm-svn: 261685

8 years ago[profile] Fix iteration over profile data entries
Vedant Kumar [Tue, 23 Feb 2016 20:46:14 +0000 (20:46 +0000)]
[profile] Fix iteration over profile data entries

Fix a crash when gathering value profile data on i386 Darwin.

The Darwin linker shrinks sections containing aligned structures when
padding is not explicitly added to the end of the structure. When
iterating over these structures, be sure to not walk past the end of the
section.

No tests added, since running `ninja check-profile` on i386 Darwin is
enough to reproduce the original crash.

llvm-svn: 261683

8 years agoUse a different error in test.
Rafael Espindola [Tue, 23 Feb 2016 20:36:20 +0000 (20:36 +0000)]
Use a different error in test.

This opens the way for -r being implemented.

llvm-svn: 261682

8 years ago[CMake] Create an install-distribution target driven by LLVM_DISTRIBUTION_COMPONENTS
Chris Bieneman [Tue, 23 Feb 2016 20:33:53 +0000 (20:33 +0000)]
[CMake] Create an install-distribution target driven by LLVM_DISTRIBUTION_COMPONENTS

The idea here is to provide a customizable install target that only depends on building the things you actually want to install. It relies on each component being installed having an auto-generated install-${component}, which in turn depends only on the target being installed.

This is fundamentally a workaround for the fact that CMake generates build files which have their "install" target depend on the "all" target. This results in "ninja install" building a bunch of unneeded things.

llvm-svn: 261681

8 years ago[CMake] Add install-clang-format target by migrating to add_clang_tool
Chris Bieneman [Tue, 23 Feb 2016 20:33:15 +0000 (20:33 +0000)]
[CMake] Add install-clang-format target by migrating to add_clang_tool

This change migrates clang-format to add_clang_tool which makes a component-based install target. To support component-based installation the extra installed scripts all need to have the "clang-format" component too.

llvm-svn: 261680

8 years agoARM: fix handling of movw/movt relocations with addend.
Tim Northover [Tue, 23 Feb 2016 20:20:23 +0000 (20:20 +0000)]
ARM: fix handling of movw/movt relocations with addend.

We were emitting only one half of a the paired relocations needed for these
instructions because we decided that an offset needed a scattered relocation.
In fact, movw/movt relocations can be paired without being scattered.

llvm-svn: 261679

8 years agoFix the aarch64 logic for dynamic relocations.
Rafael Espindola [Tue, 23 Feb 2016 20:19:44 +0000 (20:19 +0000)]
Fix the aarch64 logic for dynamic relocations.

There is nothing aarch64 specific in here. If a symbol can be preempted,
we need to copy the full relocation to the dynamic linker.

If a symbol cannot be preempted, we can make the dynamic linker life
easier and produce a relative relocation.

This is directly equivalent to R_X86_64_64 to R_x86_64_RELATIVE
conversion.

llvm-svn: 261678

8 years agoFix a missing closing tag
Marshall Clow [Tue, 23 Feb 2016 19:48:44 +0000 (19:48 +0000)]
Fix a missing closing tag

llvm-svn: 261677

8 years agoMore updates
Marshall Clow [Tue, 23 Feb 2016 19:48:09 +0000 (19:48 +0000)]
More updates

llvm-svn: 261676

8 years ago[AArch64] Generate csinv instruction more often
Geoff Berry [Tue, 23 Feb 2016 19:34:13 +0000 (19:34 +0000)]
[AArch64] Generate csinv instruction more often

Reviewers: t.p.northover, jmolloy

Subscribers: aemerson, rengolin, mcrosier, llvm-commits

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

llvm-svn: 261675

8 years agoRename Action::begin() to Action::input_begin().
Nico Weber [Tue, 23 Feb 2016 19:30:43 +0000 (19:30 +0000)]
Rename Action::begin() to Action::input_begin().

Also introduce inputs() that reutnrs an llvm::iterator_range.
Iterating over A->inputs() is much less mysterious than
iterating over *A.  No intended behavior change.

llvm-svn: 261674

8 years agoReapply r261657.
Adrian Prantl [Tue, 23 Feb 2016 19:30:08 +0000 (19:30 +0000)]
Reapply r261657.
Remove an unnecessary workaround introduced in r259975. (NFC)

Now that LLVM r259973 allows replacing a temporary type with another
temporary we can rely on the original implementation.

It is possible for enums to be created as part of
their own declcontext. In this case a FwdDecl will be created
twice. This doesn't cause a problem because both FwdDecls are
entered into the ReplaceMap: finalize() will replace the first
FwdDecl with the second and then replace the second with
complete type.

Thanks to echristo for pointing this out.

# Conflicts:
# lib/CodeGen/CGDebugInfo.cpp

llvm-svn: 261673

8 years agoFix comment
Xinliang David Li [Tue, 23 Feb 2016 19:18:21 +0000 (19:18 +0000)]
Fix comment

llvm-svn: 261672

8 years agoRevert r261633 "Supporting all entities declared in lexical scope in LLVM debug info."
Hans Wennborg [Tue, 23 Feb 2016 19:17:03 +0000 (19:17 +0000)]
Revert r261633 "Supporting all entities declared in lexical scope in LLVM debug info."

This and the corresponding Clang change caused PR26715.

llvm-svn: 261671

8 years agoRevert r261634 "Supporting all entities declared in lexical scope in LLVM debug info...
Hans Wennborg [Tue, 23 Feb 2016 19:10:16 +0000 (19:10 +0000)]
Revert r261634 "Supporting all entities declared in lexical scope in LLVM debug info." and r261657

r261634 and r261633 seems to have caused PR26715. r261657 depends on the former two.

llvm-svn: 261670

8 years agoAmends r252104 to evaluate the controlling expression in an unevaluated context....
Aaron Ballman [Tue, 23 Feb 2016 18:55:15 +0000 (18:55 +0000)]
Amends r252104 to evaluate the controlling expression in an unevaluated context. This eliminates false-positive diagnostics about null pointer dereferences (etc) in the controlling expression.

llvm-svn: 261669

8 years agoSimplify. NFC.
Rafael Espindola [Tue, 23 Feb 2016 18:53:29 +0000 (18:53 +0000)]
Simplify. NFC.

llvm-svn: 261668

8 years agoDon't include tbss's alignment in offset.
Rafael Espindola [Tue, 23 Feb 2016 18:39:55 +0000 (18:39 +0000)]
Don't include tbss's alignment in offset.

The .tbss section is in the middle of a PT_LOAD. Whatever treatment we
give to its address we must also give to the offset.

We were ignoring it for address computations, but not for offset.

Fixes pr26712.

llvm-svn: 261667

8 years ago[X86ISelLowering] Stop typing the same return over and over and over.
Davide Italiano [Tue, 23 Feb 2016 18:39:38 +0000 (18:39 +0000)]
[X86ISelLowering] Stop typing the same return over and over and over.

llvm-svn: 261666

8 years agoFix PR25339: ARM Constant Island
Weiming Zhao [Tue, 23 Feb 2016 18:39:19 +0000 (18:39 +0000)]
Fix PR25339: ARM Constant Island

Summary:
Currently, the ARM Constant Island may not converge (or not converge quickly).
This patch let it move to the closest water after the user if it doesn't converge after 15 iterations.

This address https://llvm.org/bugs/show_bug.cgi?id=25339

Reviewers: t.p.northover, srhines, kristof.beyls, aadg, rengolin

Subscribers: weimingz, aemerson, rengolin, llvm-commits

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

llvm-svn: 261665

8 years ago[WebAssembly] Add TODO comment to revisit red zone size
Derek Schuff [Tue, 23 Feb 2016 18:17:46 +0000 (18:17 +0000)]
[WebAssembly] Add TODO comment to revisit red zone size

llvm-svn: 261664

8 years agoHandle bitcode files in archive files with --whole-archive.
Rui Ueyama [Tue, 23 Feb 2016 18:17:11 +0000 (18:17 +0000)]
Handle bitcode files in archive files with --whole-archive.

This patch moves BitcodeFile instantiation into createObjectFile.
Previously, we handle bitcode files outside that function and did
not handle for --whole-archive.

http://reviews.llvm.org/D17527

llvm-svn: 261663

8 years ago[WebAssembly] Implement red zone for user stack
Derek Schuff [Tue, 23 Feb 2016 18:13:07 +0000 (18:13 +0000)]
[WebAssembly] Implement red zone for user stack

Implements a mostly-conventional redzone for the userspace
stack. Because we have unsigned load/store offsets we continue to use a
local SP subtracted from the incoming SP but do not write it back to
memory.

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

llvm-svn: 261662

8 years agoThese new tests fail on the green-dragon bots, which use an old Apple compiler.
Marshall Clow [Tue, 23 Feb 2016 18:09:38 +0000 (18:09 +0000)]
These new tests fail on the green-dragon bots, which use an old Apple compiler.
Since they're scheduled to be updated soon, we'll just comment out this test for
the moment, and re-commit when the bots are updated.

llvm-svn: 261661

8 years agotsan: clean up code after r261658
Dmitry Vyukov [Tue, 23 Feb 2016 17:58:23 +0000 (17:58 +0000)]
tsan: clean up code after r261658

llvm-svn: 261660

8 years ago[InstCombine] improve readability ; NFCI
Sanjay Patel [Tue, 23 Feb 2016 17:41:34 +0000 (17:41 +0000)]
[InstCombine] improve readability ; NFCI

Less indenting, named local variables, more descriptive names.

llvm-svn: 261659

8 years agotsan: fix signal handling in ignored libraries
Dmitry Vyukov [Tue, 23 Feb 2016 17:16:26 +0000 (17:16 +0000)]
tsan: fix signal handling in ignored libraries

The first issue is that we longjmp from ScopedInterceptor scope
when called from an ignored lib. This leaves thr->in_ignored_lib set.
This, in turn, disables handling of sigaction. This, in turn,
corrupts tsan state since signals delivered asynchronously.
Another issue is that we can ignore synchronization in asignal
handler, if the signal is delivered into an IgnoreSync region.
Since signals are generally asynchronous, they should ignore
memory access/synchronization/interceptor ignores.
This could lead to false positives in signal handlers.

llvm-svn: 261658

8 years agoRemove an unnecessary workaround introduced in r259975. (NFC)
Adrian Prantl [Tue, 23 Feb 2016 17:13:47 +0000 (17:13 +0000)]
Remove an unnecessary workaround introduced in r259975. (NFC)

Now that LLVM r259973 allows replacing a temporary type with another
temporary we can rely on the original implementation.

It is possible for enums to be created as part of
their own declcontext. In this case a FwdDecl will be created
twice. This doesn't cause a problem because both FwdDecls are
entered into the ReplaceMap: finalize() will replace the first
FwdDecl with the second and then replace the second with
complete type.

Thanks to echristo for pointing this out.

llvm-svn: 261657

8 years ago[WinEH] Don't inline an 'unwinds to caller' cleanupret into funclets which locally...
David Majnemer [Tue, 23 Feb 2016 17:11:04 +0000 (17:11 +0000)]
[WinEH] Don't inline an 'unwinds to caller' cleanupret into funclets which locally unwind

It is problematic if the inlinee has a cleanupret which unwinds to
caller and we inline it into a call site which doesn't unwind.

If the funclet unwinds anywhere other than to the caller,
then we will give the funclet two unwind destinations.
This will result in a verifier failure.

Seeing as how the caller wasn't an invoke (which would locally unwind)
and that the funclet cannot unwind to caller, we must conclude that an
'unwind to caller' cleanupret is dynamically unreachable.

This fixes PR26698.

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

llvm-svn: 261656

8 years agoMore updates
Marshall Clow [Tue, 23 Feb 2016 17:07:15 +0000 (17:07 +0000)]
More updates

llvm-svn: 261655

8 years agoRevert "[VFS] Add support for handling path traversals"
Bruno Cardoso Lopes [Tue, 23 Feb 2016 17:06:50 +0000 (17:06 +0000)]
Revert "[VFS] Add support for handling path traversals"

This reverts commit r261551 due to failing tests in windows bots:

http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/10054

Failing Tests (4):
    Clang-Unit :: Basic/BasicTests.exe/VFSFromYAMLTest.CaseInsensitive
    Clang-Unit :: Basic/BasicTests.exe/VFSFromYAMLTest.DirectoryIteration
    Clang-Unit :: Basic/BasicTests.exe/VFSFromYAMLTest.MappedFiles
    Clang-Unit :: Basic/BasicTests.exe/VFSFromYAMLTest.UseExternalName

llvm-svn: 261654

8 years agoAdd tests for LWG#2560. No code changes, just tests
Marshall Clow [Tue, 23 Feb 2016 17:01:52 +0000 (17:01 +0000)]
Add tests for LWG#2560. No code changes, just tests

llvm-svn: 261653

8 years ago[InstCombine] less indenting; NFC
Sanjay Patel [Tue, 23 Feb 2016 16:59:21 +0000 (16:59 +0000)]
[InstCombine] less indenting; NFC

llvm-svn: 261652

8 years ago[lld] [ELF/AArch64] Fix R_AARCH64_ABS64 in Shared mode
Adhemerval Zanella [Tue, 23 Feb 2016 16:54:40 +0000 (16:54 +0000)]
[lld] [ELF/AArch64] Fix R_AARCH64_ABS64 in Shared mode

This patch fixes the R_AARCH64_ABS64 relocation when used in shared mode,
where it requires a dynamic R_AARCH64_RELATIVE relocation. To correct set
the addend on the dynamic relocation (since it will be used by the dynamic
linker), a new TargetInfo specific hook was created (getDynRelativeAddend)
to get the correct addend based on relocation type.

The patch fixes the issues when creating shared library code against
{init,fini}_array, where it issues R_AARCH64_ABS64 relocation against
local symbols.

llvm-svn: 261651

8 years ago[AArch64] Fix fastcc -tailcallopt epilog code generation.
Geoff Berry [Tue, 23 Feb 2016 16:54:36 +0000 (16:54 +0000)]
[AArch64] Fix fastcc -tailcallopt epilog code generation.

Summary:
Fix a bug in epilog generation where the incoming stack arguments were
not being popped for fastcc functions when -tailcallopt was passed.

Reviewers: t.p.northover, mcrosier, jmolloy, rengolin

Subscribers: aemerson, rengolin, mcrosier, llvm-commits

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

llvm-svn: 261650

8 years ago[InstCombine] add helper function to foldCastedBitwiseLogic() ; NFCI
Sanjay Patel [Tue, 23 Feb 2016 16:36:07 +0000 (16:36 +0000)]
[InstCombine] add helper function to foldCastedBitwiseLogic() ; NFCI

This is a straight cut and paste of the existing code and is intended to
be the first step in solving part of PR26702:
https://llvm.org/bugs/show_bug.cgi?id=26702

We should be able to reuse most of this and delete the nearly identical
existing code in visitOr(). Then, we can enhance visitXor() to use the
same code too.

llvm-svn: 261649

8 years agoAdd additional tests to ensure that we DTRT with short lists. This is LWG#2590, but...
Marshall Clow [Tue, 23 Feb 2016 16:25:20 +0000 (16:25 +0000)]
Add additional tests to ensure that we DTRT with short lists. This is LWG#2590, but there are no code changes, just additional tests

llvm-svn: 261648

8 years agoMore updates; patch for 2583 ready
Marshall Clow [Tue, 23 Feb 2016 16:20:24 +0000 (16:20 +0000)]
More updates; patch for 2583 ready

llvm-svn: 261647

8 years agoFix a typo. NFC
Alexander Kornienko [Tue, 23 Feb 2016 16:12:08 +0000 (16:12 +0000)]
Fix a typo. NFC

llvm-svn: 261646

8 years agoClean up clang-format options documentation. NFC
Alexander Kornienko [Tue, 23 Feb 2016 16:12:00 +0000 (16:12 +0000)]
Clean up clang-format options documentation. NFC

Use uniform style for inline code blocks, specify language for YAML code blocks,
various formatting fixes etc.

llvm-svn: 261645

8 years agoSupport language selection for \code blocks.
Alexander Kornienko [Tue, 23 Feb 2016 16:11:55 +0000 (16:11 +0000)]
Support language selection for \code blocks.

llvm-svn: 261644

8 years agoUpdate clang-format options docs.
Alexander Kornienko [Tue, 23 Feb 2016 16:11:51 +0000 (16:11 +0000)]
Update clang-format options docs.

llvm-svn: 261643

8 years agoAllow running dump_format_style.py from any directory.
Alexander Kornienko [Tue, 23 Feb 2016 16:11:43 +0000 (16:11 +0000)]
Allow running dump_format_style.py from any directory.

llvm-svn: 261642

8 years ago[CLANG] [AVX512] [BUILTIN] Adding prorv{d|q}{128|256|512} builtin to clang
Michael Zuckerman [Tue, 23 Feb 2016 15:59:47 +0000 (15:59 +0000)]
[CLANG] [AVX512] [BUILTIN] Adding prorv{d|q}{128|256|512} builtin to clang

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

llvm-svn: 261641

8 years agoSilencing a signed vs unsigned mismatch.
Aaron Ballman [Tue, 23 Feb 2016 15:02:43 +0000 (15:02 +0000)]
Silencing a signed vs unsigned mismatch.

llvm-svn: 261640

8 years agomath: Add ilogb ported from amd-builtins
Aaron Watry [Tue, 23 Feb 2016 14:43:09 +0000 (14:43 +0000)]
math: Add ilogb ported from amd-builtins

The scalar float/double function bodies are a direct copy/paste
with usage of the CLC wrappers to vectorize them.

This commit also adds in the FP_ILOGB0 and FP_ILOGBNAN macros which are
equal to the results of ilogb(0.0f) and ilogb(float nan) respectively.

v2: Add FP_ILOGB0 and FP_ILOGBNAN definitions

Signed-off-by: Aaron Watry <awatry@gmail.com>
Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
v1 Reviewed-by: Tom Stellard <thomas.stellard@amd.com>

llvm-svn: 261639

8 years ago[CLANG] [AVX512] [BUILTIN] Adding pro{lv|r}{d|q}{128|256|512} builtin to clang
Michael Zuckerman [Tue, 23 Feb 2016 14:23:53 +0000 (14:23 +0000)]
[CLANG] [AVX512] [BUILTIN] Adding pro{lv|r}{d|q}{128|256|512} builtin to clang

Adding closer to the end of macro }->})

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

llvm-svn: 261638

8 years ago[AArch64] Fix comment typo in Cyclone scheduling defs. NFC.
Chad Rosier [Tue, 23 Feb 2016 14:05:13 +0000 (14:05 +0000)]
[AArch64] Fix comment typo in Cyclone scheduling defs. NFC.

llvm-svn: 261637

8 years agoWork around a stepping bug in arm64 android M
Pavel Labath [Tue, 23 Feb 2016 13:56:30 +0000 (13:56 +0000)]
Work around a stepping bug in arm64 android M

Summary:
On arm64, linux<=4.4 and Android<=M there is a bug, which prevents single-stepping from working when
the system comes back from suspend, because of incorrectly initialized CPUs. This did not really
affect Android<M, because it did not use software suspend, but it is a problem for M, which uses
suspend (doze) quite extensively.  Fortunately, it seems that the first CPU is not affected by
this bug, so this commit implements a workaround by forcing the inferior to execute on the first
cpu whenever we are doing single stepping.

While inside, I have moved the implementations of Resume() and SingleStep() to the thread class
(instead of process).

Reviewers: tberghammer, ovyalov

Subscribers: aemerson, rengolin, tberghammer, danalbert, srhines, lldb-commits

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

llvm-svn: 261636

8 years ago[CLANG] [AVX512] [BUILTIN] Adding pro{lv|r}{d|q}{128|256|512} builtin to clang
Michael Zuckerman [Tue, 23 Feb 2016 13:41:13 +0000 (13:41 +0000)]
[CLANG] [AVX512] [BUILTIN] Adding pro{lv|r}{d|q}{128|256|512} builtin to clang

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

llvm-svn: 261635

8 years agoSupporting all entities declared in lexical scope in LLVM debug info.
Amjad Aboud [Tue, 23 Feb 2016 13:37:18 +0000 (13:37 +0000)]
Supporting all entities declared in lexical scope in LLVM debug info.

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

llvm-svn: 261634

8 years agoSupporting all entities declared in lexical scope in LLVM debug info.
Amjad Aboud [Tue, 23 Feb 2016 13:36:51 +0000 (13:36 +0000)]
Supporting all entities declared in lexical scope in LLVM debug info.

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

llvm-svn: 261633

8 years ago[analyzer] Improve pointer arithmetic checker.
Gabor Horvath [Tue, 23 Feb 2016 12:34:39 +0000 (12:34 +0000)]
[analyzer] Improve pointer arithmetic checker.

This patch is intended to improve pointer arithmetic checker.
From now on it only warns when the pointer arithmetic is likely to cause an
error. For example when the pointer points to a single object, or an array of
derived types.

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

llvm-svn: 261632

8 years ago[linux] Remove all traces of signalfd(2)
Pavel Labath [Tue, 23 Feb 2016 12:26:08 +0000 (12:26 +0000)]
[linux] Remove all traces of signalfd(2)

Summary:
Signalfd is not used in the code anymore, and given that the same functionality can be achieved
with the new MainLoop class, it's unlikely we will need it in the future. Remove all traces of
it.

Reviewers: tberghammer, ovyalov

Subscribers: tberghammer, danalbert, srhines, lldb-commits

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

llvm-svn: 261631

8 years agoXFAIL TestInlines for Linux with gcc
Tamas Berghammer [Tue, 23 Feb 2016 11:35:38 +0000 (11:35 +0000)]
XFAIL TestInlines for Linux with gcc

llvm-svn: 261630

8 years agoRemove a space after a trailing backslash.
Alexander Kornienko [Tue, 23 Feb 2016 11:19:56 +0000 (11:19 +0000)]
Remove a space after a trailing backslash.

llvm-svn: 261629

8 years agofix the indentation of the example
Sylvestre Ledru [Tue, 23 Feb 2016 11:17:27 +0000 (11:17 +0000)]
fix the indentation of the example

llvm-svn: 261628

8 years ago[PM] Remove an overly aggressive assert now that I can actually test the
Chandler Carruth [Tue, 23 Feb 2016 10:47:57 +0000 (10:47 +0000)]
[PM] Remove an overly aggressive assert now that I can actually test the
pattern that triggers it. This essentially requires an immutable
function analysis, as that will survive anything we do to invalidate it.
When we have such patterns, the function analysis manager will not get
cleared between runs of the proxy.

If we actually need an assert about how things are queried, we can add
more elaborate machinery for computing it, but so far I'm not aware of
significant value provided.

Thanks to Justin Lebar for noticing this when he made a (seemingly
innocuous) change to FunctionAttrs that is enough to trigger it in one
test there. Now it is covered by a direct test of the pass manager code.

llvm-svn: 261627

8 years agoFix a -Wunused-variable diagnostic.
Alexander Kornienko [Tue, 23 Feb 2016 10:29:04 +0000 (10:29 +0000)]
Fix a -Wunused-variable diagnostic.

llvm-svn: 261626

8 years agoPrint options, if requested.
Alexander Kornienko [Tue, 23 Feb 2016 10:29:02 +0000 (10:29 +0000)]
Print options, if requested.

llvm-svn: 261625

8 years ago[PM] Add a unittest for the CGSCC pass manager in the new pass manager
Chandler Carruth [Tue, 23 Feb 2016 10:02:02 +0000 (10:02 +0000)]
[PM] Add a unittest for the CGSCC pass manager in the new pass manager
system.

Previously, this was only being tested with larger integration tests.
That makes it hard to isolated specific issues with it, and makes the
APIs themselves less well tested. Add a unittest based around the same
patterns used for testing the general pass manager.

llvm-svn: 261624

8 years ago[ARM] fix initialization of PredictableSelectIsExpensive
Junmo Park [Tue, 23 Feb 2016 09:56:58 +0000 (09:56 +0000)]
[ARM] fix initialization of PredictableSelectIsExpensive

Summary:
If we want classify OoO or not, using getSchedModel().isOutOfOrder()
could be more proper way than using Subtarget->isLikeA9().

Reviewers: jmolloy, rengolin

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

llvm-svn: 261623

8 years ago[clang-tidy] Updated docs on testing clang-tidy checks.
Alexander Kornienko [Tue, 23 Feb 2016 09:30:20 +0000 (09:30 +0000)]
[clang-tidy] Updated docs on testing clang-tidy checks.

llvm-svn: 261622

8 years ago[AMDGPU] Fix operands of S_BFE_U64 and S_BFM_B64
Nikolay Haustov [Tue, 23 Feb 2016 09:19:14 +0000 (09:19 +0000)]
[AMDGPU] Fix operands of S_BFE_U64 and S_BFM_B64

src1 of s_bfe_u64 is 32-bit (same as s_bfe_i64).
src0 and src1 of s_bfm_b64 are 32-bit.
Update tests.

Review: http://reviews.llvm.org/D17480

Reviewers: arsenm
llvm-svn: 261621

8 years agoAnnotation of SIMD loops
Roman Gareev [Tue, 23 Feb 2016 09:00:13 +0000 (09:00 +0000)]
Annotation of SIMD loops

Use 'mark' nodes annotate a SIMD loop during ScheduleTransformation and skip
parallelism checks.

The buildbot shows the following compile/execution time changes:

  Compile time:
    Improvements    Δ     Previous  Current  σ
    …/gesummv      -6.06% 0.2640    0.2480   0.0055
    …/gemver       -4.46% 0.4480    0.4280   0.0044
    …/covariance   -4.31% 0.8360    0.8000   0.0065
    …/adi          -3.23% 0.9920    0.9600   0.0065
    …/doitgen      -2.53% 0.9480    0.9240   0.0090
    …/3mm          -2.33% 1.0320    1.0080   0.0087

  Execution time:
    Regressions     Δ     Previous  Current  σ
    …/viterbi       1.70% 5.1840    5.2720   0.0074
    …/smallpt       1.06% 12.4920   12.6240  0.0040

Reviewed-by: Tobias Grosser <tobias@grosser.es>
Differential Revision: http://reviews.llvm.org/D14491

llvm-svn: 261620

8 years agoAVX512: Fix predicate of AVX pcmpeqw/b , pcmpgtb/w/d instructions . AVX512 version...
Igor Breger [Tue, 23 Feb 2016 08:55:33 +0000 (08:55 +0000)]
AVX512: Fix predicate of AVX pcmpeqw/b , pcmpgtb/w/d instructions . AVX512 version of this instructions return result in kmask register, so AVX patterns should not be disabled.

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

llvm-svn: 261619