platform/upstream/llvm.git
8 years ago[PPC] Fix PR24216: Don't generate splat for misaligned shuffle mask
Bill Schmidt [Wed, 29 Jul 2015 14:31:57 +0000 (14:31 +0000)]
[PPC] Fix PR24216: Don't generate splat for misaligned shuffle mask

Given certain shuffle-vector masks, LLVM emits splat instructions
which splat the wrong bytes from the source register.  The issue is
that the function PPC::isSplatShuffleMask() in PPCISelLowering.cpp
does not ensure that the splat pattern found is requesting bytes that
are aligned on an EltSize boundary.  This patch detects this situation
as not a valid splat mask, resulting in a permute being generated
instead of a splat.

Patch and test case by Tyler Kenney, cleaned up a bit by me.

This is a simple bug fix that would be good to incorporate into 3.7.

llvm-svn: 243519

8 years ago[AArch64] Pass subtarget feature "+strict-align".
Akira Hatanaka [Wed, 29 Jul 2015 14:25:58 +0000 (14:25 +0000)]
[AArch64] Pass subtarget feature "+strict-align".

This commit changes the driver to save subtarget feature "+strict-align"
to the IR instead of using backend option "aarch64-strict-align". This is
needed for LTO.

rdar://problem/21529937

llvm-svn: 243518

8 years agoRemove unnecessary variable.
Yaron Keren [Wed, 29 Jul 2015 14:21:47 +0000 (14:21 +0000)]
Remove unnecessary variable.

llvm-svn: 243517

8 years ago[AArch64] Define subtarget feature strict-align.
Akira Hatanaka [Wed, 29 Jul 2015 14:17:26 +0000 (14:17 +0000)]
[AArch64] Define subtarget feature strict-align.

This commit defines subtarget feature strict-align and uses it instead of
cl::opt -aarch64-strict-align to decide whether strict alignment should be
forced.

rdar://problem/21529937

llvm-svn: 243516

8 years agoDo not detect scops that are delinearized to arrays with "undef" size
Tobias Grosser [Wed, 29 Jul 2015 13:52:05 +0000 (13:52 +0000)]
Do not detect scops that are delinearized to arrays with "undef" size

Such codes are not interesting to optimize and most likely never appear in the
normal compilation flow. However, they show up during test case reduction with
bugpoint and trigger -- without this change -- an assert in
polly::MemoryAccess::foldAccess(). It is better to detect them in
ScopDetection itself and just bail out.

Contributed-by: Utpal Bora <cs14mtech11017@iith.ac.in>
Reviewers: grosser

Subscribers: pollydev, llvm-commits

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

llvm-svn: 243515

8 years ago[X86][AVX512BW] add convert i16 to i8 and unpack intrinsics
Asaf Badouh [Wed, 29 Jul 2015 12:34:20 +0000 (12:34 +0000)]
[X86][AVX512BW] add convert i16 to i8 and unpack intrinsics

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

llvm-svn: 243514

8 years ago[LLGS] Spawned process handling cleanup
Pavel Labath [Wed, 29 Jul 2015 12:33:31 +0000 (12:33 +0000)]
[LLGS] Spawned process handling cleanup

Summary:
This commit moves the m_spawned_pids member from the common LLGS/Platform class to the plaform
specific part. This enables us to remove LLGS code, which was attempting to manage the
m_spawned_pids contents, but at the same time making sure, there is only one debugged process. If
we ever want to do multi-process debugging, we will probably want to replace this with a set of
NativeProcessProtocolSP anyway. The only functional change is that support for
qKillSpawnedProcess packet is removed from LLGS, but this was not used there anyway (we have the
k packet for that).

Reviewers: ovyalov, clayborg

Subscribers: lldb-commits

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

llvm-svn: 243513

8 years ago[X86][AVX512BW] Replace attributes with __DEFAULT_FN_ATTRS
Asaf Badouh [Wed, 29 Jul 2015 12:22:19 +0000 (12:22 +0000)]
[X86][AVX512BW] Replace attributes with __DEFAULT_FN_ATTRS

llvm-svn: 243512

8 years agoWhen debugserver fails to attach to a process on a Darwin
Jason Molenda [Wed, 29 Jul 2015 01:42:16 +0000 (01:42 +0000)]
When debugserver fails to attach to a process on a Darwin
system, make a couple of additional checks to see if the
attach was denied via the System Integrity Protection that
is new in Mac OS X 10.11.  If so, return a special E87
error code to indicate this to lldb.

Up in lldb, if we receive the E87 error code, be specific
about why the attach failed.

Also detect the more common case of general attach failure
and print a better error message than "lost connection".

I believe this code will all build on Mac OS X 10.10 systems.
It may not compile or run on earlier versions of the OS.
None of this should build on other non-darwin systems.

llvm-svn: 243511

8 years ago[lldb-mi] Fix tests added in r243484 for breakpoints using file:func syntax.
Dawn Perchik [Wed, 29 Jul 2015 01:01:14 +0000 (01:01 +0000)]
[lldb-mi] Fix tests added in r243484 for breakpoints using file:func syntax.

llvm-svn: 243510

8 years ago[ELF2] Emit correct section types.
Michael J. Spencer [Wed, 29 Jul 2015 00:52:17 +0000 (00:52 +0000)]
[ELF2] Emit correct section types.

llvm-svn: 243509

8 years agoFirst part of an attempt to indicate to the user when they are
Jason Molenda [Wed, 29 Jul 2015 00:42:47 +0000 (00:42 +0000)]
First part of an attempt to indicate to the user when they are
debugging optimized code.  Adds new methods on Function/SBFunction
to query whether a given function is optimized.  Adds a new
function.is-optimized format entity and changes the default
frame-format to append "[opt]" if the function was built with
optimization.

The only indication that a binary was built with optimization
that we have right now is the presence of the DW_AT_APPLE_optimized
attribute (DW_FORM_flag value 1) in the DW_TAG_compile_unit.
The absence of this flag may mean that the compile_unit was not
compiled with optimization, or it may mean that the producer
does not generate this attribute.

Currently this only works for dSYM debugging.  When we create
the CompileUnit with dwarf-in-.o-file debugging we don't have
the attribute value yet so it's not set.  I need to find the
flag value when we do start to read the .o file DWARF and
set the CompileUnit's status at that point - but haven't
done it yet.

I'm also going to add a mechanism for issuing warnings to users
such that they're only issued once in a debug session and
there is away for users to suppress these warnings altogether
via .lldbinit file settings.  But I want to get this changeset
committed now that it's at a useful state.

<rdar://problem/19281172>

llvm-svn: 243508

8 years agoLock the owners mutex in the BreakpointSite before updating the hit
Jim Ingham [Wed, 29 Jul 2015 00:40:36 +0000 (00:40 +0000)]
Lock the owners mutex in the BreakpointSite before updating the hit
counts.  If you delete a breakpoint belonging to a site just as you are
processing a hit on that site, you could cause the BreakpointSite loop to
access a now deleted location.

<rdar://problem/19310323>

llvm-svn: 243507

8 years ago[ELF2] Emit section table.
Michael J. Spencer [Wed, 29 Jul 2015 00:30:10 +0000 (00:30 +0000)]
[ELF2] Emit section table.

llvm-svn: 243506

8 years agoMake function comments consistently imperative.
Bjarke Hammersholt Roune [Wed, 29 Jul 2015 00:29:08 +0000 (00:29 +0000)]
Make function comments consistently imperative.

(tiny edit, mostly a test that my new commit access works)

llvm-svn: 243505

8 years ago[lldb-mi] XFAIL new test added in r243484.
Dawn Perchik [Wed, 29 Jul 2015 00:22:53 +0000 (00:22 +0000)]
[lldb-mi] XFAIL new test added in r243484.

llvm-svn: 243504

8 years ago[libcxx] Cleanup CMake configuration and integrate with LLVM
Eric Fiselier [Wed, 29 Jul 2015 00:03:51 +0000 (00:03 +0000)]
[libcxx] Cleanup CMake configuration and integrate with LLVM

Summary:
This patch contains the following changes:

1. Require that libc++ can find a LLVM source directory. This is done the same way as `libc++abi` currently does.
2. Cleanup ugly configuration code in CMakeLists.txt by using `add_flags`, `add_flags_if`, and `add_flags_if_supported` macros.

The goals for this patch are:

1. Help libc++ be more consistent with how LLVM handles CMake options (see PR23670 PR23671).
2. Make it easier to use sanitizers using the `LLVM_USE_SANITIZER` option.
3. Make libc++'s CMakeLists.txt file easier to understand and change.
4. Move towards allowing libc++ to create Sphinx documentation (see http://efcs.ca/libcxx-docs).
5. Move towards allowing  libc++ to use other LLVM utilities such as `not` and `FileCheck`.

Reviewers: mclow.lists, jroelofs, danalbert

Subscribers: cfe-commits

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

llvm-svn: 243503

8 years ago[Statepoints] Let patchable statepoints have a symbolic call target.
Sanjoy Das [Tue, 28 Jul 2015 23:50:30 +0000 (23:50 +0000)]
[Statepoints] Let patchable statepoints have a symbolic call target.

Summary:
As added initially, statepoints required their call targets to be a
constant pointer null if ``numPatchBytes`` was non-zero.  This turns out
to be a problem ergonomically, since there is no way to mark patchable
statepoints as calling a (readable) symbolic value.

This change remove the restriction of requiring ``null`` call targets
for patchable statepoints, and changes PlaceSafepoints to maintain the
symbolic call target through its transformation.

Reviewers: reames, swaroop.sridhar

Subscribers: llvm-commits

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

llvm-svn: 243502

8 years agoFix broken ArrayRef conversion from r243497.
Alex Lorenz [Tue, 28 Jul 2015 23:34:27 +0000 (23:34 +0000)]
Fix broken ArrayRef conversion from r243497.

llvm-svn: 243501

8 years agoignore duplicate divisor uses when transforming into reciprocal multiplies (PR24141)
Sanjay Patel [Tue, 28 Jul 2015 23:28:22 +0000 (23:28 +0000)]
ignore duplicate divisor uses when transforming into reciprocal multiplies (PR24141)

PR24141: https://llvm.org/bugs/show_bug.cgi?id=24141
contains a test case where we have duplicate entries in a node's uses() list.

After r241826, we use CombineTo() to delete dead nodes when combining the uses into
reciprocal multiplies, but this fails if we encounter the just-deleted node again in
the list.

The solution in this patch is to not add duplicate entries to the list of users that
we will subsequently iterate over. For the test case, this avoids triggering the
combine divisors logic entirely because there really is only one user of the divisor.

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

llvm-svn: 243500

8 years agoRemove sanitizer XFAILs on a test.
Eric Fiselier [Tue, 28 Jul 2015 23:27:03 +0000 (23:27 +0000)]
Remove sanitizer XFAILs on a test.

llvm-svn: 243499

8 years agofix TLI's combineRepeatedFPDivisors interface to return the minimum user threshold
Sanjay Patel [Tue, 28 Jul 2015 23:05:48 +0000 (23:05 +0000)]
fix TLI's combineRepeatedFPDivisors interface to return the minimum user threshold

This fix was suggested as part of D11345 and is part of fixing PR24141.

With this change, we can avoid walking the uses of a divisor node if the target
doesn't want the combineRepeatedFPDivisors transform in the first place.

There is no NFC-intended other than that.

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

llvm-svn: 243498

8 years agoMIR Serialization: Serialize the target index machine operands.
Alex Lorenz [Tue, 28 Jul 2015 23:02:45 +0000 (23:02 +0000)]
MIR Serialization: Serialize the target index machine operands.

Reviewers: Duncan P. N. Exon Smith
llvm-svn: 243497

8 years ago[ELF2] Devirtualize SymbolBody.
Michael J. Spencer [Tue, 28 Jul 2015 22:58:25 +0000 (22:58 +0000)]
[ELF2] Devirtualize SymbolBody.

llvm-svn: 243496

8 years agoCOFF: _tls_used is __tls_used on x86.
Rui Ueyama [Tue, 28 Jul 2015 22:56:02 +0000 (22:56 +0000)]
COFF: _tls_used is __tls_used on x86.

llvm-svn: 243495

8 years ago[asan] Support per-application flags in the Android setup script.
Evgeniy Stepanov [Tue, 28 Jul 2015 22:45:24 +0000 (22:45 +0000)]
[asan] Support per-application flags in the Android setup script.

llvm-svn: 243494

8 years ago[ARM] Define subtarget feature strict-align.
Akira Hatanaka [Tue, 28 Jul 2015 22:44:28 +0000 (22:44 +0000)]
[ARM] Define subtarget feature strict-align.

This commit defines subtarget feature strict-align and uses it instead of
cl::opt -arm-strict-align to decide whether strict alignment should be
forced. Also, remove the logic that was checking the OS and architecture
as clang is now responsible for setting strict-align based on the command
line options specified and the target architecute and OS.

rdar://problem/21529937

http://reviews.llvm.org/D11470

llvm-svn: 243493

8 years agoAArch64: be careful of large immediates when optimising cmps.
Tim Northover [Tue, 28 Jul 2015 22:42:32 +0000 (22:42 +0000)]
AArch64: be careful of large immediates when optimising cmps.

llvm-svn: 243492

8 years agoMove an extra switch to clang-tools-extra/test/clang-tidy/misc-unused-parameters...
NAKAMURA Takumi [Tue, 28 Jul 2015 22:41:04 +0000 (22:41 +0000)]
Move an extra switch to clang-tools-extra/test/clang-tidy/misc-unused-parameters.cpp from check_clang_tidy.sh.

It also rolls back r242984 and r242985.

llvm-svn: 243491

8 years agoCOFF: Fix export symbol names for x86.
Rui Ueyama [Tue, 28 Jul 2015 22:34:24 +0000 (22:34 +0000)]
COFF: Fix export symbol names for x86.

I don't fully understand the rationale behind the name mangling
scheme used for the DLL export table and the import library.
Why only leading "_" is dropped for the import library while
both "_" and "@" are dropped from DLL symbol table? But this seems
to be what MSVC linker does.

llvm-svn: 243490

8 years ago[ARM] Pass subtarget feature "+strict-align".
Akira Hatanaka [Tue, 28 Jul 2015 22:26:45 +0000 (22:26 +0000)]
[ARM] Pass subtarget feature "+strict-align".

This commit changes the driver to save subtarget feature "+strict-align" to the
IR instead of using backend option "arm-strict-align". This is needed for LTO.

Also, move the logic in ARM backend that was deciding whether strict alignment
should be forced to the front-end.

rdar://problem/21529937

http://reviews.llvm.org/D11472

llvm-svn: 243489

8 years agoFix comment in TestExprOptions to match change of language from ObjC to ObjC++.
Dawn Perchik [Tue, 28 Jul 2015 22:19:42 +0000 (22:19 +0000)]
Fix comment in TestExprOptions to match change of language from ObjC to ObjC++.

llvm-svn: 243488

8 years ago[tests] Use llvm-readobj instead of macho-dump.
Davide Italiano [Tue, 28 Jul 2015 21:58:08 +0000 (21:58 +0000)]
[tests] Use llvm-readobj instead of macho-dump.

llvm-svn: 243487

8 years ago[PeepholeOptimizer] Look through PHIs to find additional register sources
Bruno Cardoso Lopes [Tue, 28 Jul 2015 21:45:50 +0000 (21:45 +0000)]
[PeepholeOptimizer] Look through PHIs to find additional register sources

Reapply 243271 with more fixes; although we are not handling multiple
sources with coalescable copies, we were not properly skipping this
case.

- Teaches the ValueTracker in the PeepholeOptimizer to look through PHI
instructions.
- Add findNextSourceAndRewritePHI method to lookup into multiple sources
returnted by the ValueTracker and rewrite PHIs with new sources.

With these changes we can find more register sources and rewrite more
copies to allow coaslescing of bitcast instructions. Hence, we eliminate
unnecessary VR64 <-> GR64 copies in x86, but it could be extended to
other archs by marking "isBitcast" on target specific instructions. The
x86 example follows:

A:
  psllq %mm1, %mm0
  movd  %mm0, %r9
  jmp C

B:
  por %mm1, %mm0
  movd  %mm0, %r9
  jmp C

C:
  movd  %r9, %mm0
  pshufw  $238, %mm0, %mm0

Becomes:

A:
  psllq %mm1, %mm0
  jmp C

B:
  por %mm1, %mm0
  jmp C

C:
  pshufw  $238, %mm0, %mm0

Differential Revision: http://reviews.llvm.org/D11197
rdar://problem/20404526

llvm-svn: 243486

8 years ago[mips][FastISel] Fix call lowering by bailing out on "fastcc" calls.
Vasileios Kalintiris [Tue, 28 Jul 2015 21:43:31 +0000 (21:43 +0000)]
[mips][FastISel] Fix call lowering by bailing out on "fastcc" calls.

Summary:
Currently, we support only the MIPS O32 ABI calling convention for call
lowering. With this change we avoid using the O32 calling convetion for
lowering calls marked as using the fast calling convention.

Reviewers: dsanders

Subscribers: llvm-commits

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

llvm-svn: 243485

8 years ago[lldb-mi] Fix setting of breakpoints using file:func syntax.
Dawn Perchik [Tue, 28 Jul 2015 21:40:57 +0000 (21:40 +0000)]
[lldb-mi] Fix setting of breakpoints using file:func syntax.

Reviewed by: ki.stfu
Subscribers: lldb-commits
Differential Revision: http://reviews.llvm.org/D11499

llvm-svn: 243484

8 years agoCleanup a few stale comments in FormattersContainer.h
Enrico Granata [Tue, 28 Jul 2015 21:28:33 +0000 (21:28 +0000)]
Cleanup a few stale comments in FormattersContainer.h

llvm-svn: 243483

8 years agoMake ClangASTType::RemoveFastQualifiers() actually do something useful
Enrico Granata [Tue, 28 Jul 2015 21:24:39 +0000 (21:24 +0000)]
Make ClangASTType::RemoveFastQualifiers() actually do something useful

llvm-svn: 243482

8 years ago[sanitizer] Fix Mac build.
Evgeniy Stepanov [Tue, 28 Jul 2015 21:01:42 +0000 (21:01 +0000)]
[sanitizer] Fix Mac build.

llvm-svn: 243480

8 years agoSilence unused argument warning for --cuda-host-only.
Artem Belevich [Tue, 28 Jul 2015 21:01:30 +0000 (21:01 +0000)]
Silence unused argument warning for --cuda-host-only.

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

llvm-svn: 243479

8 years ago--cuda-host-only should not disable linking phase.
Artem Belevich [Tue, 28 Jul 2015 21:01:21 +0000 (21:01 +0000)]
--cuda-host-only should not disable linking phase.

Host-only cuda compilation does produce valid host object
file and in some cases users do want to proceed on to the linking phase.
The change removes special case that stopped compilation pipeline at
the Assembly phase. Device-side compilation is still stopped early
by the types::getCompilationPhases().

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

llvm-svn: 243478

8 years agoUse an iterative method instead of recursion for printing macro backtraces.
Richard Trieu [Tue, 28 Jul 2015 20:53:46 +0000 (20:53 +0000)]
Use an iterative method instead of recursion for printing macro backtraces.

Store the locations for a macro expansion in a vector, then iterate over them
instead of using recursion.  This simplifies the logic around the backtrace
limit and gives easier access to the source locations.  No functionality change.

Patch by Zhengkai Wu.

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

llvm-svn: 243477

8 years ago[RuntimeDyld] Remove a memory-leak that was introduced in r243456. Thanks to Ben
Lang Hames [Tue, 28 Jul 2015 20:51:53 +0000 (20:51 +0000)]
[RuntimeDyld] Remove a memory-leak that was introduced in r243456. Thanks to Ben
Kramer for catching this.

llvm-svn: 243476

8 years agoFix typo.
Chih-Hung Hsieh [Tue, 28 Jul 2015 20:38:29 +0000 (20:38 +0000)]
Fix typo.

llvm-svn: 243475

8 years agoLimit this test only on linux.
Chih-Hung Hsieh [Tue, 28 Jul 2015 20:31:10 +0000 (20:31 +0000)]
Limit this test only on linux.

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

llvm-svn: 243474

8 years ago[asan] Read process name from /proc/self/cmdline on Linux.
Evgeniy Stepanov [Tue, 28 Jul 2015 20:27:51 +0000 (20:27 +0000)]
[asan] Read process name from /proc/self/cmdline on Linux.

Rename getBinaryBasename() to getProcessName() and, on Linux,
read it from /proc/self/cmdline instead of /proc/self/exe. The former
can be modified by the process. The main motivation is Android, where
application processes re-write cmdline to a package name. This lets
us setup per-application ASAN_OPTIONS through include=/some/path/%b.

llvm-svn: 243473

8 years agoFix a bug where the std::list synthetic child provider would not clean its cache...
Enrico Granata [Tue, 28 Jul 2015 20:19:45 +0000 (20:19 +0000)]
Fix a bug where the std::list synthetic child provider would not clean its cache correctly on update, causing stale children to be returned in some circumstances

Fixes rdar://20560680

llvm-svn: 243472

8 years ago[Unroll] Add debug dumps to loop-unroll analyzer.
Michael Zolotukhin [Tue, 28 Jul 2015 20:07:29 +0000 (20:07 +0000)]
[Unroll] Add debug dumps to loop-unroll analyzer.

llvm-svn: 243471

8 years agoAdd commentary explaining PPC access to return address
Bill Schmidt [Tue, 28 Jul 2015 20:05:06 +0000 (20:05 +0000)]
Add commentary explaining PPC access to return address

llvm-svn: 243470

8 years ago[mips][FastISel] Fix generated code for IR's select instruction.
Vasileios Kalintiris [Tue, 28 Jul 2015 19:57:25 +0000 (19:57 +0000)]
[mips][FastISel] Fix generated code for IR's select instruction.

Summary:
Generate correct code for the select instruction by zero-extending
it's boolean/condition operand to GPR-width. This is necessary because
the conditional-move instructions operate on the whole register.

Reviewers: dsanders

Subscribers: llvm-commits

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

llvm-svn: 243469

8 years agoFreeBSDThread::GetRegisterContext is only for FreeBSD targets
Ed Maste [Tue, 28 Jul 2015 19:47:00 +0000 (19:47 +0000)]
FreeBSDThread::GetRegisterContext is only for FreeBSD targets

The removal of in-process Linux debug support left a switch statement
with llvm::Triple::FreeBSD as the only case. Simplify by replacing it
with a now-equivalent assertion.

llvm-svn: 243468

8 years agoPowerPC's ABIs differ from those of other architectures in that the
Bill Schmidt [Tue, 28 Jul 2015 19:41:49 +0000 (19:41 +0000)]
PowerPC's ABIs differ from those of other architectures in that the
callee-saved return address is stored in the caller's stack frame, not
the callee's.  This patch adjusts the logic to find the LR in the
correct place for PowerPC.

Patch joint with Bill Seurer.

llvm-svn: 243467

8 years ago[Unroll] Don't analyze blocks outside the loop.
Michael Zolotukhin [Tue, 28 Jul 2015 19:21:21 +0000 (19:21 +0000)]
[Unroll] Don't analyze blocks outside the loop.

llvm-svn: 243466

8 years agoRemove some dead code
Tobias Grosser [Tue, 28 Jul 2015 19:16:46 +0000 (19:16 +0000)]
Remove some dead code

llvm-svn: 243465

8 years agoDo not end lines with '\'
Tobias Grosser [Tue, 28 Jul 2015 19:16:42 +0000 (19:16 +0000)]
Do not end lines with '\'

This fixes 'warning: multi-line comment [-Wcomment]'

llvm-svn: 243464

8 years agoDo not give a -Wredundant-move warning when removing the move will result in an
Richard Trieu [Tue, 28 Jul 2015 19:06:16 +0000 (19:06 +0000)]
Do not give a -Wredundant-move warning when removing the move will result in an
error.

If the object being moved has a move constructor and a deleted copy constructor,
std::move is required, otherwise Clang will give a deleted constructor error.

llvm-svn: 243463

8 years agoAMDGPU: Don't try to use LDS/vector for private if pointer value stored
Matt Arsenault [Tue, 28 Jul 2015 18:47:00 +0000 (18:47 +0000)]
AMDGPU: Don't try to use LDS/vector for private if pointer value stored

If the pointer is the store's value operand, this would produce
a broken module. Make sure the use is actually for the pointer operand.

llvm-svn: 243462

8 years agoAMDGPU: Fix crash if called function is a bitcast
Matt Arsenault [Tue, 28 Jul 2015 18:29:14 +0000 (18:29 +0000)]
AMDGPU: Fix crash if called function is a bitcast

getCalledFunction() is null, so this would crash. Replace
crash with an error on unsupported call.

llvm-svn: 243461

8 years ago[SCEV] Apply NSW and NUW flags via poison value analysis
Jingyue Wu [Tue, 28 Jul 2015 18:22:40 +0000 (18:22 +0000)]
[SCEV] Apply NSW and NUW flags via poison value analysis

Summary:
Make Scalar Evolution able to propagate NSW and NUW flags from instructions to SCEVs in some cases. This is based on reasoning about when poison from instructions with these flags would trigger undefined behavior. This gives a 13% speed-up on some Eigen3-based Google-internal microbenchmarks for NVPTX.

There does not seem to be clear agreement about when poison should be considered to propagate through instructions. In this analysis, poison propagates only in cases where that should be uncontroversial.

This change makes LSR able to create induction variables for expressions like &ptr[i + offset] for loops like this:

  for (int i = 0; i < limit; ++i) {
    sum += ptr[i + offset];
  }

Here ptr is a 64 bit pointer and offset is a 32 bit integer. For NVPTX, LSR currently creates an induction variable for i + offset instead, which is not as fast. Improving this situation is what brings the 13% speed-up on some Eigen3-based Google-internal microbenchmarks for NVPTX.

There are more details in this discussion on llvmdev.
June: http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-June/thread.html#87234
July: http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-July/thread.html#87392

Patch by Bjarke Roune

Reviewers: eliben, atrick, sanjoy

Subscribers: majnemer, hfinkel, jingyue, meheff, llvm-commits

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

llvm-svn: 243460

8 years agoAMDGPU: Fix return type of getImplicitParameterOffset.
Matt Arsenault [Tue, 28 Jul 2015 18:09:55 +0000 (18:09 +0000)]
AMDGPU: Fix return type of getImplicitParameterOffset.

Patch by Zoltan Gilian <zoltan.gilian@gmail.com>

llvm-svn: 243459

8 years agoRewrite getPrevectorMap using schedule trees operations
Tobias Grosser [Tue, 28 Jul 2015 18:03:36 +0000 (18:03 +0000)]
Rewrite getPrevectorMap using schedule trees operations

Schedule trees are a lot easier to work with, for both humans and machines. For
humans the more structured schedule representation is easier to reason about.
Together with the more abstract isl programming interface this can result in a
lot cleaner code (see this changeset). For machines, the structured schedule and
the fact that we now use explicit piecewise affine expressions instead of
integer maps makes it easier to generate code from this schedule tree. As a
result, we can already see a slight compile-time improvement -- for 3mm from
0m0.593s to 0m0.551s seconds (-7 %). More importantly, future optimizations such
as full-partial tile separation will most likely result in more streamlined code
to be generated.

Contributed-by: Roman Gareev <gareevroman@gmail.com>
llvm-svn: 243458

8 years agoAdd a test case for r242191 ([MMX] Use the appropriate instructions for
Alex Lorenz [Tue, 28 Jul 2015 17:52:59 +0000 (17:52 +0000)]
Add a test case for r242191 ([MMX] Use the appropriate instructions for
GR64 <-> VR64 copies).

This commit adds a MIR test case for the commit r242191, which was committed
without one. This test case verifies that the ExpandPostRA pass expands the
GR64 <-> VR64 copies into the appropriate MMX_MOV instructions.

llvm-svn: 243457

8 years ago[RuntimeDyld] Make LoadedObjectInfo::getLoadedSectionAddress take a SectionRef
Lang Hames [Tue, 28 Jul 2015 17:52:11 +0000 (17:52 +0000)]
[RuntimeDyld] Make LoadedObjectInfo::getLoadedSectionAddress take a SectionRef
rather than a string section name.

llvm-svn: 243456

8 years ago[test] Follow-up for r243119, also add a test case using property methods.
Argyrios Kyrtzidis [Tue, 28 Jul 2015 17:38:51 +0000 (17:38 +0000)]
[test] Follow-up for r243119, also add a test case using property methods.

llvm-svn: 243455

8 years agoMove unit tests to target specific directories.
Chih-Hung Hsieh [Tue, 28 Jul 2015 17:32:49 +0000 (17:32 +0000)]
Move unit tests to target specific directories.

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

llvm-svn: 243454

8 years agoMIR Serialization: Serialize the block address machine operands.
Alex Lorenz [Tue, 28 Jul 2015 17:28:03 +0000 (17:28 +0000)]
MIR Serialization: Serialize the block address machine operands.

llvm-svn: 243453

8 years agoWebAssembly: MCAsmInfo only has one syntax variant for now.
JF Bastien [Tue, 28 Jul 2015 17:23:07 +0000 (17:23 +0000)]
WebAssembly: MCAsmInfo only has one syntax variant for now.

Summary: MCAsmInfo is set up with the default AssemblerDialect, which is zero.

Subscribers: llvm-commits, sunfish, jfb

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

llvm-svn: 243452

8 years agoadd tests to show broken current behavior of minsize attribute
Sanjay Patel [Tue, 28 Jul 2015 17:18:25 +0000 (17:18 +0000)]
add tests to show broken current behavior of minsize attribute

llvm-svn: 243451

8 years agoMIR Parser: Extract the method 'parseGlobalValue'. NFC.
Alex Lorenz [Tue, 28 Jul 2015 17:09:52 +0000 (17:09 +0000)]
MIR Parser: Extract the method 'parseGlobalValue'. NFC.

This commit extracts the code that parses a global value from the method
'parseGlobalAddressOperand' into a new method 'parseGlobalValue', so that this
code can be reused by the method which will parse the block address machine
operands.

llvm-svn: 243450

8 years agoMIR Parser: Move the function 'lexName'. NFC.
Alex Lorenz [Tue, 28 Jul 2015 17:03:40 +0000 (17:03 +0000)]
MIR Parser: Move the function 'lexName'. NFC.

This commit moves the function 'lexName' to the start of the file so it can
be reused by the function which will lex the named LLVM IR block references.

llvm-svn: 243449

8 years agoRemove eNewThreadMessage from FreeBSD process monitor
Ed Maste [Tue, 28 Jul 2015 16:57:36 +0000 (16:57 +0000)]
Remove eNewThreadMessage from FreeBSD process monitor

FreeBSD thread information is updated after stop - we do not use a
message for thread creation.

llvm-svn: 243448

8 years agoMIR Printer: Remove an outdated TODO comment and assertion. NFC.
Alex Lorenz [Tue, 28 Jul 2015 16:56:45 +0000 (16:56 +0000)]
MIR Printer: Remove an outdated TODO comment and assertion. NFC.

This commit removes an outdated TODO comment and a corresponding assertion
which asserts that the mir printer can't the print machine basic blocks that
aren't sequentially numbered.

This comment and assertion were correct when I was working on the patch which
serialized the machine basic blocks, but then I decided to add an 'ID'
attribute to the machine basic block's YAML mapping based on the patch review.
This comment and assertion then became invalid as with the 'ID' attribute we
can serialize the non sequential machine basic blocks and their references
without any problems.

llvm-svn: 243447

8 years agoLet cmake infer source file language by the file extension.
Douglas Katzman [Tue, 28 Jul 2015 16:52:42 +0000 (16:52 +0000)]
Let cmake infer source file language by the file extension.

This applies default compiler flags to .S files, in particular removing
the "-pedantic" option, which is desirable because there is nothing to
reasonably warn about; and the only thing that gcc warns about is that
you allegedly can't correctly invoke GLUE2 in lib/builtins/assembly.h
on platforms for which USER_LABEL_PREFIX is the empty string.

In the gcc bug https://gcc.gnu.org/bugzilla/show_bug.cgi?id=33305 that
added the warning, a commenter notes that giving a macro of zero characters
to another macro is not precisely the same as failing to supply an argument,
and "there is a widespread belief in C++ community that such usage is valid".
Unfortunately the only way to silence the warning is to avoid -pedantic.

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

llvm-svn: 243446

8 years agoMIR Parser: Remove redundant parameters. NFC.
Alex Lorenz [Tue, 28 Jul 2015 16:48:37 +0000 (16:48 +0000)]
MIR Parser: Remove redundant parameters. NFC.

This commit removes the redundant parameters from the two methods
'initializeRegisterInfo' and 'initializeFrameInfo'. The removed parameters are
redundant as we are already passing in the 'MachineFunction' to those methods,
and those parameters can be derived from the machine function parameter.

llvm-svn: 243445

8 years agoRename -Wmsvc-include to -Wmicrosoft-include, now that -Wmicrosoft is split up.
Nico Weber [Tue, 28 Jul 2015 16:48:12 +0000 (16:48 +0000)]
Rename -Wmsvc-include to -Wmicrosoft-include, now that -Wmicrosoft is split up.

(Keep -Wmsvc-include around as an alias.)

While here, also replace the one other mention of "MSVC" in diagnostics with
"Microsoft", for consistency.

llvm-svn: 243444

8 years agoAdd -femulated-tls flag to select the emulated TLS model.
Chih-Hung Hsieh [Tue, 28 Jul 2015 16:27:56 +0000 (16:27 +0000)]
Add -femulated-tls flag to select the emulated TLS model.

This will be used for old targets like Android that do not
support ELF TLS models.

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

llvm-svn: 243441

8 years ago[CodeGen] Simplify creation of shuffle masks.
Benjamin Kramer [Tue, 28 Jul 2015 16:25:32 +0000 (16:25 +0000)]
[CodeGen] Simplify creation of shuffle masks.

No functional change intended.

llvm-svn: 243439

8 years agoImplement target independent TLS compatible with glibc's emutls.c.
Chih-Hung Hsieh [Tue, 28 Jul 2015 16:24:05 +0000 (16:24 +0000)]
Implement target independent TLS compatible with glibc's emutls.c.

The 'common' section TLS is not implemented.
Current C/C++ TLS variables are not placed in common section.
DWARF debug info to get the address of TLS variables is not generated yet.

clang and driver changes in http://reviews.llvm.org/D10524

  Added -femulated-tls flag to select the emulated TLS model,
  which will be used for old targets like Android that do not
  support ELF TLS models.

Added TargetLowering::LowerToTLSEmulatedModel as a target-independent
function to convert a SDNode of TLS variable address to a function call
to __emutls_get_address.

Added into lib/Target/*/*ISelLowering.cpp to call LowerToTLSEmulatedModel
for TLSModel::Emulated. Although all targets supporting ELF TLS models are
enhanced, emulated TLS model has been tested only for Android ELF targets.
Modified AsmPrinter.cpp to print the emutls_v.* and emutls_t.* variables for
emulated TLS variables.
Modified DwarfCompileUnit.cpp to skip some DIE for emulated TLS variabls.

TODO: Add proper DIE for emulated TLS variables.
      Added new unit tests with emulated TLS.

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

llvm-svn: 243438

8 years agoSummary:
Martell Malone [Tue, 28 Jul 2015 16:18:17 +0000 (16:18 +0000)]
Summary:
Object: add IMAGE_FILE_MACHINE_ARM64

The official specifications state that the value of IMAGE_FILE_MACHINE_ARM64
is 0xAA64 (as per the Microsoft Portable Executable and Common Object Format
Specification v8.3).

Reviewers: rnk

Subscribers: llvm-commits, compnerd, ruiu

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

llvm-svn: 243434

8 years agoUpdate xcode for r243427
Ed Maste [Tue, 28 Jul 2015 16:11:12 +0000 (16:11 +0000)]
Update xcode for r243427

llvm-svn: 243432

8 years agoGetting rid of old iterator loops
Piotr Padlewski [Tue, 28 Jul 2015 16:10:58 +0000 (16:10 +0000)]
Getting rid of old iterator loops

llvm-svn: 243431

8 years ago[LVI] Cleanup whitespaces. NFC
Bruno Cardoso Lopes [Tue, 28 Jul 2015 15:53:21 +0000 (15:53 +0000)]
[LVI] Cleanup whitespaces. NFC

llvm-svn: 243430

8 years agoDo not force linebreaks when MaxEmptyLinesToKeep is 0.
Manuel Klimek [Tue, 28 Jul 2015 15:50:24 +0000 (15:50 +0000)]
Do not force linebreaks when MaxEmptyLinesToKeep is 0.

Previously we would format
 call(

     p);
as
 call(
     p);
with MaxEmptyLinesToKeep == 0.

Now we format it as:
  call(p);

llvm-svn: 243429

8 years agoRemove two additional files missed in r243427
Ed Maste [Tue, 28 Jul 2015 15:48:38 +0000 (15:48 +0000)]
Remove two additional files missed in r243427

llvm-svn: 243428

8 years agoRemove POSIX thread/process abstraction
Ed Maste [Tue, 28 Jul 2015 15:45:57 +0000 (15:45 +0000)]
Remove POSIX thread/process abstraction

As of r240543 ProcessPOSIX and POSIXThread are used only on FreeBSD, so
just roll them into ProcessFreeBSD and FreeBSDThread.

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

llvm-svn: 243427

8 years agoFix typo from r243418. Should fix the failing `abort_on_error.cc` test.
Kuba Brecka [Tue, 28 Jul 2015 15:43:45 +0000 (15:43 +0000)]
Fix typo from r243418.  Should fix the failing `abort_on_error.cc` test.
See http://reviews.llvm.org/D7203

llvm-svn: 243426

8 years ago[CodeGen] Clean up CGBuiltin a bit.
Benjamin Kramer [Tue, 28 Jul 2015 15:40:11 +0000 (15:40 +0000)]
[CodeGen] Clean up CGBuiltin a bit.

- Use cached LLVM types
- Turn SmallVectors into Arrays/ArrayRef if the size is static
- Use ConstantInt::get's implicit splatting for vector types

No functionality change intended.

llvm-svn: 243425

8 years agofix formatting; NFC
Sanjay Patel [Tue, 28 Jul 2015 15:38:43 +0000 (15:38 +0000)]
fix formatting; NFC

llvm-svn: 243424

8 years agoApplying the Darwin-specific default lit ASAN_OPTIONS to UBSan+ASan tests as
Kuba Brecka [Tue, 28 Jul 2015 15:35:04 +0000 (15:35 +0000)]
Applying the Darwin-specific default lit ASAN_OPTIONS to UBSan+ASan tests as
well. Should fix the test failures after r243418, see review at
http://reviews.llvm.org/D7203.

llvm-svn: 243423

8 years ago[AArch64] Match float round and convert to int instructions.
Geoff Berry [Tue, 28 Jul 2015 15:24:10 +0000 (15:24 +0000)]
[AArch64] Match float round and convert to int instructions.

Summary:
Add patterns for doing floating point round with various rounding modes
followed by conversion to int as a single FCVT* instruction.

Reviewers: t.p.northover, jmolloy

Subscribers: aemerson, rengolin, mcrosier, llvm-commits

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

llvm-svn: 243422

8 years agoFix typo in gdbremote.py
Pavel Labath [Tue, 28 Jul 2015 15:13:23 +0000 (15:13 +0000)]
Fix typo in gdbremote.py

llvm-svn: 243421

8 years agoKeep track of ScopArrayInfo objects that model PHI node storage
Tobias Grosser [Tue, 28 Jul 2015 14:53:44 +0000 (14:53 +0000)]
Keep track of ScopArrayInfo objects that model PHI node storage

Summary:
When translating PHI nodes into memory dependences during code generation we
require two kinds of memory. 'Normal memory' as for all scalar dependences and
'PHI node memory' to store the incoming values of the PHI node. With this
patch we now mark and track these two kinds of memories, which we previously
incorrectly marked as a single memory object.

Being aware of PHI node storage makes code generation easier, as we do not need
to guess what kind of storage a scalar reference requires. This simplifies the
code nicely.

Reviewers: jdoerfert

Subscribers: pollydev, llvm-commits

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

llvm-svn: 243420

8 years agoUse a specified list of languages in cmake project() command.
Douglas Katzman [Tue, 28 Jul 2015 14:43:53 +0000 (14:43 +0000)]
Use a specified list of languages in cmake project() command.

This allows asm files and Cxx files to be compiled with different flags
rather than treating them identically. LLVM itself has no asm files
other than tests, but this setting is inherited by the compiler-rt
project (unless compiled standalone), which does have asm files.

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

llvm-svn: 243419

8 years ago[asan] Set abort_on_error=1 by default on OS X
Kuba Brecka [Tue, 28 Jul 2015 14:34:13 +0000 (14:34 +0000)]
[asan] Set abort_on_error=1 by default on OS X

This sets the default ASan flags to abort_on_error=1 on OS X. For unit tests and lit tests we set ASAN_OPTIONS back to abort_on_error=0 before running the tests (to avoid crashing). I added two tests that intentionally don't respect the default ASAN_OPTIONS to test the behavior of an empty ASAN_OPTIONS (on OS X we should crash, on Linux we should exit()).

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

llvm-svn: 243418

8 years agoRegParmMax must be 0 for AArch64, as the regparm function attribute is not supported...
Kristof Beyls [Tue, 28 Jul 2015 14:23:47 +0000 (14:23 +0000)]
RegParmMax must be 0 for AArch64, as the regparm function attribute is not supported on AArch64.

llvm-svn: 243417

8 years ago[LAA] Add clarifying comments for the checking pointer grouping algorithm. NFC
Silviu Baranga [Tue, 28 Jul 2015 13:44:08 +0000 (13:44 +0000)]
[LAA] Add clarifying comments for the checking pointer grouping algorithm. NFC

llvm-svn: 243416

8 years agoConsolidate a bunch of #ifdef _LIBCPP_NO_EXCEPTIONS .. #endif blocks into a single...
Marshall Clow [Tue, 28 Jul 2015 13:30:47 +0000 (13:30 +0000)]
Consolidate a bunch of #ifdef _LIBCPP_NO_EXCEPTIONS .. #endif blocks into a single template function. NFC

llvm-svn: 243415

8 years agomisc-unused-parameters: Only remove parameters in the main source file.
Daniel Jasper [Tue, 28 Jul 2015 13:19:12 +0000 (13:19 +0000)]
misc-unused-parameters: Only remove parameters in the main source file.
In headers, they might always be pulled in to different TUs, even if
they are declared static or nested in an unnamed namespace.

llvm-svn: 243414

8 years ago[AArch64] Implement __builtin_thread_pointer
Adhemerval Zanella [Tue, 28 Jul 2015 13:10:10 +0000 (13:10 +0000)]
[AArch64] Implement __builtin_thread_pointer

This path add the aarch64 __builtin_thread_pointer support.  It will be
lowered to llvm.aarch64.thread.pointer.

llvm-svn: 243413

8 years agoImplement __builtin_thread_pointer
Adhemerval Zanella [Tue, 28 Jul 2015 13:03:31 +0000 (13:03 +0000)]
Implement __builtin_thread_pointer

This path add the aarch64 lowering of __builtin_thread_pointer.  It uses
the already implemented AArch64ISD::THREAD_POINTER used in TLS generation.

llvm-svn: 243412