platform/upstream/llvm.git
8 years agoDo not add but record signed-unsigned assumptions
Johannes Doerfert [Tue, 26 Apr 2016 09:16:36 +0000 (09:16 +0000)]
Do not add but record signed-unsigned assumptions

llvm-svn: 267528

8 years ago[ppc64] Reenable sibling call optimization on ppc64 since fixed tsan library tail...
Chuang-Yu Cheng [Tue, 26 Apr 2016 07:38:24 +0000 (07:38 +0000)]
[ppc64] Reenable sibling call optimization on ppc64 since fixed tsan library tail-call issue

print-stack-trace.cc test failure of compiler-rt has been fixed by
r266869 (http://reviews.llvm.org/D19148), so reenable sibling call
optimization on ppc64

Reviewers: nemanjai kbarton
llvm-svn: 267527

8 years agoRevert "[sanitizers] read/write page fault detection on mac."
Mehdi Amini [Tue, 26 Apr 2016 07:03:11 +0000 (07:03 +0000)]
Revert "[sanitizers] read/write page fault detection on mac."

This reverts commit r267477.
It broke our bots that enables the AArch64 backends, it seems that
this code is using a Darwin *X86 specific* field.

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 267526

8 years agoAlign case statements (whitespace-only cleanup)
Sanjoy Das [Tue, 26 Apr 2016 05:59:14 +0000 (05:59 +0000)]
Align case statements (whitespace-only cleanup)

llvm-svn: 267525

8 years agoSymbolize operand bundle blocks for bcanalyzer
Sanjoy Das [Tue, 26 Apr 2016 05:59:08 +0000 (05:59 +0000)]
Symbolize operand bundle blocks for bcanalyzer

Reviewers: joker.eph

Subscribers: mcrosier, llvm-commits

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

llvm-svn: 267524

8 years ago[ELF] Simplify. Pointed out by Rui Ueyama.
Davide Italiano [Tue, 26 Apr 2016 05:51:37 +0000 (05:51 +0000)]
[ELF] Simplify. Pointed out by Rui Ueyama.

llvm-svn: 267523

8 years ago[AArch64] Expand v1i64 and v2i64 ctlz.
Craig Topper [Tue, 26 Apr 2016 05:26:51 +0000 (05:26 +0000)]
[AArch64] Expand v1i64 and v2i64 ctlz.

The default is legal, which results in 'Cannot select' errors.

llvm-svn: 267522

8 years ago[ARM] Expand vector ctlz_zero_undef so it becomes ctlz.
Craig Topper [Tue, 26 Apr 2016 05:04:37 +0000 (05:04 +0000)]
[ARM] Expand vector ctlz_zero_undef so it becomes ctlz.

The default is Legal, which results in 'Cannot select' errors.

llvm-svn: 267521

8 years ago[ARM] Expand v1i64 and v2i64 ctlz.
Craig Topper [Tue, 26 Apr 2016 05:04:33 +0000 (05:04 +0000)]
[ARM] Expand v1i64 and v2i64 ctlz.

The default is legal, which results in 'Cannot select' errors.

llvm-svn: 267520

8 years agoTune basic block annotation algorithm.
Dehao Chen [Tue, 26 Apr 2016 04:59:11 +0000 (04:59 +0000)]
Tune basic block annotation algorithm.

Summary:
Instead of using maximum IR weight as the basic block weight, this patch uses the voting algorithm to find the most likely weight for the basic block. This can effectively avoid the cases when some IRs are annotated incorrectly due to code motion of the profiled binary.

This patch also updates propagate.ll unittest to include discriminator in the input file so that it is testing something meaningful.

Reviewers: davidxl, dnovillo

Subscribers: llvm-commits

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

llvm-svn: 267519

8 years ago[powerpc] mark JIT tests as UNSUPPORTED on powerpc64 big endian
Bill Seurer [Tue, 26 Apr 2016 03:59:19 +0000 (03:59 +0000)]
[powerpc] mark JIT tests as UNSUPPORTED on powerpc64 big endian

Some of the JIT tests began failing with "[llvm] r266663 - [Orc] Re-commit
r266581 with fixes for MSVC, and format cleanups." on powerpc64 big endian.
To get the buildbots running I am marking these as UNSUPPORTED for now.

If this is fixed remove the UNSUPPORTED flag "powerpc64-unknown-linux-gnu".

In r267516 I marked these as XFAIL but they succeed on some of the bots
on stage1.

llvm-svn: 267518

8 years agoPass the test file in through stdin instead of by filename.
Richard Trieu [Tue, 26 Apr 2016 03:43:49 +0000 (03:43 +0000)]
Pass the test file in through stdin instead of by filename.

When passed in via filename, this test will fail if the path to the test
has the strings "f1" and "f2" in somewhere.  Pass the file through stdin
to prevent test failures due to coincidences in path names.

llvm-svn: 267517

8 years ago[powerpc] mark JIT tests as XFAIL on powerpc64 big endian
Bill Seurer [Tue, 26 Apr 2016 02:33:22 +0000 (02:33 +0000)]
[powerpc] mark JIT tests as XFAIL on powerpc64 big endian

Some of the JIT tests began failing with "[llvm] r266663 - [Orc] Re-commit
r266581 with fixes for MSVC, and format cleanups." on powerpc64 big endian.
To get the buildbots running I am marking these as XFAIL for now.

If this is fixed remove the XFAIL flag "powerpc64-unknown-linux-gnu".

llvm-svn: 267516

8 years ago[SimplifyCFG] Preserve !llvm.mem.parallel_loop_access when merging
Hal Finkel [Tue, 26 Apr 2016 02:06:06 +0000 (02:06 +0000)]
[SimplifyCFG] Preserve !llvm.mem.parallel_loop_access when merging

When SimplifyCFG merges identical instructions from both sides of a diamond, it
can preserve !llvm.mem.parallel_loop_access (as it does with most of the other
metadata). There's no real data or control dependency change in this case.

llvm-svn: 267515

8 years ago[LoopVectorize] Don't consider conditional-load dereferenceability for marked paralle...
Hal Finkel [Tue, 26 Apr 2016 02:00:36 +0000 (02:00 +0000)]
[LoopVectorize] Don't consider conditional-load dereferenceability for marked parallel loops

I really thought we were doing this already, but we were not. Given this input:

void Test(int *res, int *c, int *d, int *p) {
  for (int i = 0; i < 16; i++)
    res[i] = (p[i] == 0) ? res[i] : res[i] + d[i];
}

we did not vectorize the loop. Even with "assume_safety" the check that we
don't if-convert conditionally-executed loads (to protect against
data-dependent deferenceability) was not elided.

One subtlety: As implemented, it will still prefer to use a masked-load
instrinsic (given target support) over the speculated load. The choice here
seems architecture specific; the best option depends on how expensive the
masked load is compared to a regular load. Ideally, using the masked load still
reduces unnecessary memory traffic, and so should be preferred. If we'd rather
do it the other way, flipping the order of the checks is easy.

The LangRef is updated to make explicit that llvm.mem.parallel_loop_access also
implies that if conversion is okay.

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

llvm-svn: 267514

8 years agotrying to fix the windows build broken by r267496
Kostya Serebryany [Tue, 26 Apr 2016 01:53:49 +0000 (01:53 +0000)]
trying to fix the windows build broken by r267496

llvm-svn: 267513

8 years ago[lli] Fix a sign-compare warning.
Lang Hames [Tue, 26 Apr 2016 01:45:25 +0000 (01:45 +0000)]
[lli] Fix a sign-compare warning.

llvm-svn: 267512

8 years ago[WebAssembly] Account for implicit operands when computing operand indices.
Dan Gohman [Tue, 26 Apr 2016 01:40:56 +0000 (01:40 +0000)]
[WebAssembly] Account for implicit operands when computing operand indices.

llvm-svn: 267511

8 years ago[ORC] Try to work around a GCC 4.7 bug triggered by r267457.
Lang Hames [Tue, 26 Apr 2016 01:27:54 +0000 (01:27 +0000)]
[ORC] Try to work around a GCC 4.7 bug triggered by r267457.

llvm-svn: 267510

8 years agounwind: remove last instance of -Wexpansion-to-defined
Saleem Abdulrasool [Tue, 26 Apr 2016 01:11:29 +0000 (01:11 +0000)]
unwind: remove last instance of -Wexpansion-to-defined

This unifies the definition of _LIBUNWIND_BUILD_SJLJ_APIS.  It also further
generalises the definition to allow building these APIs on non-Apple targets
when `-fsjlj-excceptions` is used.  The header is now clean of macros which
expand to defined checks.

llvm-svn: 267509

8 years agoFix arm-linux-gnueabi regression due to rL267291
Omair Javaid [Tue, 26 Apr 2016 01:08:59 +0000 (01:08 +0000)]
Fix arm-linux-gnueabi regression due to rL267291

rL267291 introduces a lot regression on arm-linux LLDB testsuite.

This patch fixes half of them. I am merging it under already revied android counterpart.

Another patch fixing rest of the issue will follow this commit.

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

llvm-svn: 267508

8 years ago[SROA] Don't falsely report that changes have occured
David Majnemer [Tue, 26 Apr 2016 01:05:00 +0000 (01:05 +0000)]
[SROA] Don't falsely report that changes have occured

We would report that the function changed despite creating no new
allocas or performing any promotion.

This fixes PR27316.

llvm-svn: 267507

8 years agoReverting Thumb2SizeReduction opt bisect change to fix failing buildbots.
Andrew Kaylor [Tue, 26 Apr 2016 00:56:36 +0000 (00:56 +0000)]
Reverting Thumb2SizeReduction opt bisect change to fix failing buildbots.

llvm-svn: 267506

8 years ago[Tests] Run reproduces.s only on UNIX until I investigate a windows failure.
Davide Italiano [Tue, 26 Apr 2016 00:56:19 +0000 (00:56 +0000)]
[Tests] Run reproduces.s only on UNIX until I investigate a windows failure.

llvm-svn: 267505

8 years ago[CodeGenPrepare] don't convert an unpredictable select into control flow
Sanjay Patel [Tue, 26 Apr 2016 00:47:39 +0000 (00:47 +0000)]
[CodeGenPrepare] don't convert an unpredictable select into control flow

Suggested in the review of D19488:
http://reviews.llvm.org/D19488

llvm-svn: 267504

8 years agoCGOpenMPRuntime.h: Prune '\param IfCond' in r267395. [-Wdocumentation]
NAKAMURA Takumi [Tue, 26 Apr 2016 00:45:00 +0000 (00:45 +0000)]
CGOpenMPRuntime.h: Prune '\param IfCond' in r267395. [-Wdocumentation]

llvm-svn: 267503

8 years agoRemove MinLatency in SchedMachineModel. NFC.
Junmo Park [Tue, 26 Apr 2016 00:37:46 +0000 (00:37 +0000)]
Remove MinLatency in SchedMachineModel. NFC.

Summary:
We don't use MinLatency any more since r184032.

Reviewers: atrick, hfinkel, mcrosier

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

llvm-svn: 267502

8 years ago[Docs] Fix indentation error introduced by r267447.
George Burgess IV [Tue, 26 Apr 2016 00:31:29 +0000 (00:31 +0000)]
[Docs] Fix indentation error introduced by r267447.

llvm-svn: 267501

8 years agoWhen building the list of variables we're going to write "using $_lldb_local_vars"
Jim Ingham [Tue, 26 Apr 2016 00:29:59 +0000 (00:29 +0000)]
When building the list of variables we're going to write "using $_lldb_local_vars"
statements for, be sure not to include variables that have no locations.  We wouldn't
be able to realize them, and that will cause all expressions to fail.

llvm-svn: 267500

8 years agoPM: Port GlobalOpt to the new pass manager
Justin Bogner [Tue, 26 Apr 2016 00:28:01 +0000 (00:28 +0000)]
PM: Port GlobalOpt to the new pass manager

llvm-svn: 267499

8 years agoPM: Convert the logic for GlobalOpt into static functions. NFC
Justin Bogner [Tue, 26 Apr 2016 00:27:56 +0000 (00:27 +0000)]
PM: Convert the logic for GlobalOpt into static functions. NFC

Pass all of the state we need around as arguments, so that these
functions are easier to reuse. There is one part of this that is
unusual: we pass around a functor to look up a DomTree for a function.
This will be a necessary abstraction when we try to use this code in
both the legacy and the new pass manager.

llvm-svn: 267498

8 years ago[ELF] Introduce --reproduce flag.
Davide Italiano [Tue, 26 Apr 2016 00:22:24 +0000 (00:22 +0000)]
[ELF] Introduce --reproduce flag.

--reproduce dumps the object files in a directory chosen
(preserving the file system layout) and the linker invocation
so that people can create an archive and upload for debugging.

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

llvm-svn: 267497

8 years ago[lanai] Update handling of structs in arguments to be passed in registers.
Jacques Pienaar [Tue, 26 Apr 2016 00:09:29 +0000 (00:09 +0000)]
[lanai] Update handling of structs in arguments to be passed in registers.

Previously aggregate types were passed byval, change the ABI to pass these in registers instead.

llvm-svn: 267496

8 years ago[X86] Use LivePhysRegs in X86FixupBWInsts.
Ahmed Bougacha [Tue, 26 Apr 2016 00:00:48 +0000 (00:00 +0000)]
[X86] Use LivePhysRegs in X86FixupBWInsts.

Kill-flags, which computeRegisterLiveness uses, are not reliable.
LivePhysRegs is.

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

llvm-svn: 267495

8 years agoMake sure that the following SymbolFileDWARF functions can handle getting a lldb...
Greg Clayton [Mon, 25 Apr 2016 23:39:19 +0000 (23:39 +0000)]
Make sure that the following SymbolFileDWARF functions can handle getting a lldb::user_id_t for another SymbolFileDWARF:

CompilerDecl
SymbolFileDWARF::GetDeclForUID (lldb::user_id_t type_uid);

CompilerDeclContext
SymbolFileDWARF::GetDeclContextForUID (lldb::user_id_t type_uid)

CompilerDeclContext
SymbolFileDWARF::GetDeclContextContainingUID (lldb::user_id_t type_uid)

Type*
SymbolFileDWARF::ResolveTypeUID (lldb::user_id_t type_uid)

<rdar://problem/25592223>

llvm-svn: 267494

8 years agoGlobalOpt: Convert a bunch of tests from grep to FileCheck
Justin Bogner [Mon, 25 Apr 2016 23:36:50 +0000 (23:36 +0000)]
GlobalOpt: Convert a bunch of tests from grep to FileCheck

llvm-svn: 267493

8 years agoFix TestGetVariables.py.
Chaoren Lin [Mon, 25 Apr 2016 23:29:53 +0000 (23:29 +0000)]
Fix TestGetVariables.py.

Reviewers: sivachandra, clayborg

Subscribers: lldb-commits

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

llvm-svn: 267492

8 years agoAdd check for "branch_weights" with prof metadata
Sanjay Patel [Mon, 25 Apr 2016 23:15:16 +0000 (23:15 +0000)]
Add check for "branch_weights" with prof metadata

While we're here, fix the comment and variable names to make it
clear that these are raw weights, not percentages.

llvm-svn: 267491

8 years ago[CMake] If set we should pass LLVM_VERSION_INFO into config.h
Chris Bieneman [Mon, 25 Apr 2016 23:02:47 +0000 (23:02 +0000)]
[CMake] If set we should pass LLVM_VERSION_INFO into config.h

Autoconf used to support setting LLVM_VERSION_INFO and there is some code filtered around llvm in Support/CommandLine.cpp and LTO/LTOCodeGenerator.cpp that uses it if it is set.

We also shouldn't be explicitly setting it as a define on llvm-shlib. It is pointless there because there is no code using it in llvm-shlib, and it is better to have it as part of the generated config.h so that it is available everywhere.

llvm-svn: 267490

8 years ago[Sparc] Fix double-float fabs and fneg on little endian CPUs.
James Y Knight [Mon, 25 Apr 2016 22:54:09 +0000 (22:54 +0000)]
[Sparc] Fix double-float fabs and fneg on little endian CPUs.

The SparcV8 fneg and fabs instructions interestingly come only in a
single-float variant. Since the sign bit is always the topmost bit no
matter what size float it is, you simply operate on the high
subregister, as if it were a single float.

However, the layout of double-floats in the float registers is reversed
on little-endian CPUs, so that the high bits are in the second
subregister, rather than the first.

Thus, this expansion must check the endianness to use the correct
subregister.

llvm-svn: 267489

8 years agoARM: put correct symbol index on indirect pointers in __thread_ptr.
Tim Northover [Mon, 25 Apr 2016 22:36:07 +0000 (22:36 +0000)]
ARM: put correct symbol index on indirect pointers in __thread_ptr.

Otherwise the linker has no idea what should be resolved.

llvm-svn: 267488

8 years agoFix build warning
Andrew Kaylor [Mon, 25 Apr 2016 22:27:30 +0000 (22:27 +0000)]
Fix build warning

llvm-svn: 267487

8 years ago[MSan] Use COMMON_INTERCEPTOR_ENTER in libdl interceptors.
Marcin Koscielnicki [Mon, 25 Apr 2016 22:25:49 +0000 (22:25 +0000)]
[MSan] Use COMMON_INTERCEPTOR_ENTER in libdl interceptors.

This fixes fails in test/msan/dlerror.cc - when real dlerror calls strcmp,
our strcmp interceptor now skips poison checking, since it's called in
interceptor context.  Strictly speaking, only the dlerror change is
necessary to fix the fail, but let's also change the other two just in case.

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

llvm-svn: 267486

8 years agoAdd optimization bisect opt-in calls for AMDGPU passes
Andrew Kaylor [Mon, 25 Apr 2016 22:23:44 +0000 (22:23 +0000)]
Add optimization bisect opt-in calls for AMDGPU passes

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

llvm-svn: 267485

8 years agoReformat LLVMConstPointerNull. NFC
Amaury Sechet [Mon, 25 Apr 2016 22:23:35 +0000 (22:23 +0000)]
Reformat LLVMConstPointerNull. NFC

llvm-svn: 267484

8 years agoComment formating. NFC
Amaury Sechet [Mon, 25 Apr 2016 22:23:30 +0000 (22:23 +0000)]
Comment formating. NFC

llvm-svn: 267483

8 years agoOptimize store of "bitcast" from vector to aggregate.
Arch D. Robison [Mon, 25 Apr 2016 22:22:39 +0000 (22:22 +0000)]
Optimize store of "bitcast" from vector to aggregate.

This patch is what was the "instcombine" portion of D14185, with an additional
test added (see julia_pseudovec in test/Transforms/InstCombine/insert-val-extract-elem.ll).
The patch causes instcombine to replace sequences of extractelement-insertvalue-store
that act essentially like a bitcast followed by a store.

Differential review: http://reviews.llvm.org/D14260

llvm-svn: 267482

8 years ago[LVI] Make a precondition explicit rather than handling a case which never happens...
Philip Reames [Mon, 25 Apr 2016 22:21:24 +0000 (22:21 +0000)]
[LVI] Make a precondition explicit rather than handling a case which never happens [NFC]

llvm-svn: 267481

8 years agoAdd optimization bisect opt-in calls for ARM passes
Andrew Kaylor [Mon, 25 Apr 2016 22:01:04 +0000 (22:01 +0000)]
Add optimization bisect opt-in calls for ARM passes

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

llvm-svn: 267480

8 years agoAdd optimization bisect opt-in calls for AArch64 passes
Andrew Kaylor [Mon, 25 Apr 2016 21:58:52 +0000 (21:58 +0000)]
Add optimization bisect opt-in calls for AArch64 passes

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

llvm-svn: 267479

8 years agoFix StackFrame::GetVariables(...) function that was broken by 261858 when lambda...
Greg Clayton [Mon, 25 Apr 2016 21:54:10 +0000 (21:54 +0000)]
Fix StackFrame::GetVariables(...) function that was broken by 261858 when lambda functions were added to Block::AppendBlockVariables(). The Stackframe::GetVariables(...) function should get all variables regardless if they are in scope.

This wasn't caught by the test suite so I added a test for it.

llvm-svn: 267478

8 years ago[sanitizers] read/write page fault detection on mac.
Mike Aizatsky [Mon, 25 Apr 2016 21:44:43 +0000 (21:44 +0000)]
[sanitizers] read/write page fault detection on mac.

Subscribers: kubabrecka

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

llvm-svn: 267477

8 years agoAdd accidentally deleted "break"
Krzysztof Parzyszek [Mon, 25 Apr 2016 21:28:52 +0000 (21:28 +0000)]
Add accidentally deleted "break"

llvm-svn: 267476

8 years ago[ORC] clang-format code that was touched in r267457. NFC.
Lang Hames [Mon, 25 Apr 2016 21:21:20 +0000 (21:21 +0000)]
[ORC] clang-format code that was touched in r267457. NFC.

Commit r267457 made a lot of type-substitutions threw off code formatting and
alignment. This patch should tidy those changes up.

llvm-svn: 267475

8 years agodriver: Add a `--rsp-quoting` flag to pick response file quoting.
Nico Weber [Mon, 25 Apr 2016 21:15:49 +0000 (21:15 +0000)]
driver: Add a `--rsp-quoting` flag to pick response file quoting.

Currently, clang-cl always uses Windows style for unquoting, and clang always
uses POSIX style for unquoting.

With this flag, it's possible to change these defaults.

In general, response file quoting should match the shell the response file is
used in.  On Windows, it's possible to run clang-cl in a bash shell, or clang in
cmd.exe, so a flag for overriding the default behavior is natural there.

On non-Windows, Windows quoting probably never makes sense (except maybe in
Wine), but having clang-cl behave differently based on the host OS seems
strange too.  So require that people who want to use posix-style response
files with clang-cl on non-Windows pass --rsp-quoting=posix.

http://reviews.llvm.org/D19425

llvm-svn: 267474

8 years agoARM: put extern __thread stubs in a special section.
Tim Northover [Mon, 25 Apr 2016 21:12:04 +0000 (21:12 +0000)]
ARM: put extern __thread stubs in a special section.

The linker needs to know that the symbols are thread-local to do its job
properly.

llvm-svn: 267473

8 years agoRemove architecture dependent Hwloc DEBUG section
Jonathan Peyton [Mon, 25 Apr 2016 21:11:26 +0000 (21:11 +0000)]
Remove architecture dependent Hwloc DEBUG section

This debug sections's functionality can be replicated using the environment
variable KMP_TOPOLOGY_METHOD with different values and KMP_AFFINITY=verbose

llvm-svn: 267472

8 years ago[ThinLTO] Introduce typedef for commonly-used map type (NFC)
Teresa Johnson [Mon, 25 Apr 2016 21:09:51 +0000 (21:09 +0000)]
[ThinLTO] Introduce typedef for commonly-used map type (NFC)

Add a typedef for the std::map<GlobalValue::GUID, GlobalValueSummary *>
map that is passed around to identify summaries for values defined in a
particular module. This shortens up declarations in a variety of places.

llvm-svn: 267471

8 years agoFix buffer problem with printing long Hwloc affinity mask
Jonathan Peyton [Mon, 25 Apr 2016 21:08:31 +0000 (21:08 +0000)]
Fix buffer problem with printing long Hwloc affinity mask

This change has the hwloc_bitmap_list_snprintf() function use the entire buffer
to print the mask.  There is no need to shorten the buffer length by 7.  It only
needs to be shortened by one byte.

llvm-svn: 267470

8 years ago[Hexagon] Few fixes for exception handling
Krzysztof Parzyszek [Mon, 25 Apr 2016 21:05:19 +0000 (21:05 +0000)]
[Hexagon] Few fixes for exception handling

llvm-svn: 267469

8 years agoMaintain register numbering across xml include features
Francis Ricci [Mon, 25 Apr 2016 21:03:55 +0000 (21:03 +0000)]
Maintain register numbering across xml include features

Summary:
If the remote uses include features when communicating
xml register info back to lldb, the existing code would reset the
lldb register index at the beginning of each include node.
This would lead to multiple registers having the same lldb register index.
Since the lldb register numbers should be contiguous and unique,
maintain them accross the parsing of all of the xml feature nodes.

Reviewers: jingham, jasonmolenda, clayborg

Subscribers: lldb-commits, sas

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

llvm-svn: 267468

8 years agoProperly unload modules from target image list when using svr4 packets
Francis Ricci [Mon, 25 Apr 2016 21:02:24 +0000 (21:02 +0000)]
Properly unload modules from target image list when using svr4 packets

Summary:
When we receive an svr4 packet from the remote, we check for new modules
and add them to the list of images in the target. However, we did not
do the same for modules which have been removed.

This was causing TestLoadUnload to fail when using ds2, which uses
svr4 packets to communicate all library info on Linux. This patch fixes
the failing test.

Reviewers: zturner, tfiala, ADodds

Subscribers: lldb-commits, sas

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

llvm-svn: 267467

8 years agoUse Process Plugin register indices when communicating with remote
Francis Ricci [Mon, 25 Apr 2016 20:59:11 +0000 (20:59 +0000)]
Use Process Plugin register indices when communicating with remote

Summary:
eRegisterKindProcessPlugin is used to store the register
indices used by the remote, and eRegisterKindLLDB is used
to store the internal lldb register indices. However, we're currently
using the lldb indices instead of the process plugin indices
when sending p/P packets. This will break if the remote uses
non-contiguous register indices.

Reviewers: jasonmolenda, clayborg

Subscribers: lldb-commits, sas

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

llvm-svn: 267466

8 years agoRe-apply r267206 with a fix for the encoding problem: when the immediate of
Quentin Colombet [Mon, 25 Apr 2016 20:54:08 +0000 (20:54 +0000)]
Re-apply r267206 with a fix for the encoding problem: when the immediate of
log2(Mask) is smaller than 32, we must use the 32-bit variant because the 64-bit
variant cannot encode it. Therefore, set the subreg part accordingly.

[AArch64] Fix optimizeCondBranch logic.

The opcode for the optimized branch does not depend on the size
of the activate bits in the AND masks, but the AND opcode itself.
Indeed, we need to use a X or W variant based on the AND variant
not based on whether the mask fits into the related variant.
Otherwise, we may end up using the W variant of the optimized branch
for 64-bit register inputs!

This fixes the last make check verifier issues for AArch64: PR27479.

llvm-svn: 267465

8 years agoModule Debugging: Fix the condition for determining whether a template
Adrian Prantl [Mon, 25 Apr 2016 20:52:40 +0000 (20:52 +0000)]
Module Debugging: Fix the condition for determining whether a template
instantiation is in a module.

This patch fixes the condition for determining whether the debug info for a
template instantiation will exist in an imported clang module by:

- checking whether the ClassTemplateSpecializationDecl is complete and
- checking that the instantiation was in a module by looking at the first field.

I also added a negative check to make sure that a typedef to a forward-declared
template (with the definition outside of the module) is handled correctly.

http://reviews.llvm.org/D19443
rdar://problem/25553724

llvm-svn: 267464

8 years agoStore absolute path for lldb executable in dotest.py
Francis Ricci [Mon, 25 Apr 2016 20:36:22 +0000 (20:36 +0000)]
Store absolute path for lldb executable in dotest.py

Summary:
lldb-server tests are currently being skipped on the
check-lldb target. This is because we get the path of
lldb-server by modifying the path to the lldb executable.
However, by this point, we've changed directories, and a
relative path to the build/bin directory will no longer point
to the location of lldb-server.

Storing an absolute path solves this issue.

Reviewers: vharron, zturner, tfiala, labath

Subscribers: labath, lldb-commits, sas

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

llvm-svn: 267463

8 years agoCreate _lldb python symlink correctly when LLVM_LIBDIR_SUFFIX is used
Francis Ricci [Mon, 25 Apr 2016 20:34:34 +0000 (20:34 +0000)]
Create _lldb python symlink correctly when LLVM_LIBDIR_SUFFIX is used

Summary:
Do not assume that liblldb.so is located in $(lldb -P)/../../../lib
when creating the _lldb python symlink. Instead, use the path passed
to LLVM_LIBDIR_SUFFIX, defaulting to $(lldb -P)/../../../lib when this
variable is not set.

Reviewers: vharron, emaste, zturner

Subscribers: zturner, labath, lldb-commits, sas

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

llvm-svn: 267462

8 years ago[ELF][MIPS] Move MIPS GOT header generation to the GotSection
Simon Atanasyan [Mon, 25 Apr 2016 20:25:05 +0000 (20:25 +0000)]
[ELF][MIPS] Move MIPS GOT header generation to the GotSection

MIPS is the only target requires GOT header. We already have MIPS
specific code in the `GotSection` class, so move MIPS GOT header
generation there and delete redundant stuff like `GotHeaderEntriesNum`
field and `writeGotHeader` method.

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

llvm-svn: 267460

8 years agoAdd missing qRegisterInfo option to gdbremote testcase
Francis Ricci [Mon, 25 Apr 2016 20:24:30 +0000 (20:24 +0000)]
Add missing qRegisterInfo option to gdbremote testcase

Summary:
"gcc" is equivalent to "ehframe" in ProcessGDBRemote, but
only "ehframe" was a valid response in the test suite.

Reviewers: tfiala, jasonmolenda, clayborg

Subscribers: lldb-commits, sas

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

llvm-svn: 267459

8 years agoCleanup redundant expression in InstCombineAndOrXor.
Etienne Bergeron [Mon, 25 Apr 2016 20:15:33 +0000 (20:15 +0000)]
Cleanup redundant expression in InstCombineAndOrXor.

Summary:
The expression is redundant on both side of operator |.

detected by : http://reviews.llvm.org/D19451

Reviewers: rnk, majnemer

Subscribers: cfe-commits

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

llvm-svn: 267458

8 years ago[ORC] Thread Error/Expected through the RPC library.
Lang Hames [Mon, 25 Apr 2016 19:56:45 +0000 (19:56 +0000)]
[ORC] Thread Error/Expected through the RPC library.

This replaces use of std::error_code and ErrorOr in the ORC RPC support library
with Error and Expected. This required updating the OrcRemoteTarget API, Client,
and server code, as well as updating the Orc C API.

This patch also fixes several instances where Errors were dropped.

llvm-svn: 267457

8 years agoAMDGPU/SI: Optimize adjacent s_nop instructions
Matt Arsenault [Mon, 25 Apr 2016 19:53:22 +0000 (19:53 +0000)]
AMDGPU/SI: Optimize adjacent s_nop instructions

Use the operand for how long to wait. This is somewhat
distasteful, since it would be better to just emit s_nop
with the right argument in the first place. This would require
changing TII::insertNoop to emit N operands, which would be easy.
Slightly more problematic is the post-RA scheduler and hazard recognizer
represent nops as a single null node, and would require inventing
another way of representing N nops.

llvm-svn: 267456

8 years ago[libFuzzer] remove dead code
Kostya Serebryany [Mon, 25 Apr 2016 19:41:45 +0000 (19:41 +0000)]
[libFuzzer] remove dead code

llvm-svn: 267455

8 years agoImplement support for conditional between xvalues of reference-compatible
Richard Smith [Mon, 25 Apr 2016 19:30:37 +0000 (19:30 +0000)]
Implement support for conditional between xvalues of reference-compatible
types. Patch by Erik Pilkington!

llvm-svn: 267454

8 years agoRefactor traversal of bases in deduction of template parameters from base
Richard Smith [Mon, 25 Apr 2016 19:28:08 +0000 (19:28 +0000)]
Refactor traversal of bases in deduction of template parameters from base
classes of an argument to use CXXRecordDecl::forallBases. Fix forallBases to
only visit each base class once.

llvm-svn: 267453

8 years agoAMDGPU: Implement addrspacecast
Matt Arsenault [Mon, 25 Apr 2016 19:27:24 +0000 (19:27 +0000)]
AMDGPU: Implement addrspacecast

llvm-svn: 267452

8 years agoAMDGPU: Add queue ptr intrinsic
Matt Arsenault [Mon, 25 Apr 2016 19:27:18 +0000 (19:27 +0000)]
AMDGPU: Add queue ptr intrinsic

llvm-svn: 267451

8 years agoAdd useful helpers to AddrSpaceCastInst
Matt Arsenault [Mon, 25 Apr 2016 19:27:13 +0000 (19:27 +0000)]
Add useful helpers to AddrSpaceCastInst

llvm-svn: 267450

8 years agoAMDGPU: Add DAG to debug dump
Matt Arsenault [Mon, 25 Apr 2016 19:27:09 +0000 (19:27 +0000)]
AMDGPU: Add DAG to debug dump

Also reorder case to match enum order

llvm-svn: 267449

8 years ago[Support] Fix latent bugs in Expected and ExitOnError that were preventing them
Lang Hames [Mon, 25 Apr 2016 19:21:57 +0000 (19:21 +0000)]
[Support] Fix latent bugs in Expected and ExitOnError that were preventing them
from working with reference types.

llvm-svn: 267448

8 years ago[Docs] Clarify what the object-size sanitizer does.
George Burgess IV [Mon, 25 Apr 2016 19:21:45 +0000 (19:21 +0000)]
[Docs] Clarify what the object-size sanitizer does.

Currently, the UBSan docs make it sound like the object-size sanitizer
will only detect out-of-bounds reads/writes. It also catches some
operations that don't necessarily access memory (invalid downcasts,
calls of methods on invalid pointers, ...). This patch adds a note
about this behavior in the docs.

llvm-svn: 267447

8 years agoARM Limited license agreement from the copyright/patent holder
Jonathan Peyton [Mon, 25 Apr 2016 19:12:20 +0000 (19:12 +0000)]
ARM Limited license agreement from the copyright/patent holder

I have prepared some patches for LLVM OpenMP runtime, mostly addressing
ARMv8 support. Before I upstream them, I must address legal issues that
arose around my planned contribution. I was advised that before I send any
substantial commit, I need to make sure that LICENSE.txt file in the projects
repository contains a statement submitted by ARM, similar to the one provided
by Intel (see "a license agreement from the copyright/patent holders"). This is
the same situation as with top-level LLVM project: ARM has provided the same
statement in http://llvm.org/svn/llvm-project/llvm/trunk/lib/Target/ARM/LICENSE.TXT file.

Patch by Paul Osmialowski

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

llvm-svn: 267446

8 years agoExtract some constant factors from "SCEVAddExprs"
Johannes Doerfert [Mon, 25 Apr 2016 19:09:10 +0000 (19:09 +0000)]
Extract some constant factors from "SCEVAddExprs"

  Additive expressions can have constant factors too that we can extract
  and thereby simplify the internal representation. For now we do
  compute the gcd of all constant factors but only extract the same
  (possibly negated) factor if there is one.

llvm-svn: 267445

8 years agoWhen deducing template parameters from base classes of an argument type, don't
Richard Smith [Mon, 25 Apr 2016 19:09:05 +0000 (19:09 +0000)]
When deducing template parameters from base classes of an argument type, don't
preserve any deduced types from a failed deduction to a subsequent attempt at
deduction. Patch by Erik Pilkington!

llvm-svn: 267444

8 years agotest commit
Francis Ricci [Mon, 25 Apr 2016 19:02:05 +0000 (19:02 +0000)]
test commit

llvm-svn: 267443

8 years agoDo not check all GEPs for assumptions
Johannes Doerfert [Mon, 25 Apr 2016 18:55:15 +0000 (18:55 +0000)]
Do not check all GEPs for assumptions

  Before, we checked all GEPs in a statement in order to derive
  out-of-bound assumptions. However, this can not only introduce new
  parameters but it is also not clear what we can learn from GEPs that
  are not immediately used in a memory accesses inside the SCoP. As this
  case is very rare, no actual change in the behaviour is expected.

llvm-svn: 267442

8 years agoOnly add user assumptions on known parameters [NFC]
Johannes Doerfert [Mon, 25 Apr 2016 18:51:27 +0000 (18:51 +0000)]
Only add user assumptions on known parameters [NFC]

  Before, assumptions derived from llvm.assume could reference new
  parameters that were not known to the SCoP before. These were neither
  beneficial to the representation nor to the user that reads the
  emitted remark. Now we project them out and keep only user assumptions
  on known parameters. Nevertheless, the new parameters are still part
  of the SCoPs parameter space as the SCEVAffinator currently adds them
  on demand.

llvm-svn: 267441

8 years ago[LVI] Clarify comments describing the lattice values
Philip Reames [Mon, 25 Apr 2016 18:48:43 +0000 (18:48 +0000)]
[LVI] Clarify comments describing the lattice values

There has been much recent confusion about the partition in the lattice between constant and non-constant values.  Hopefully, documenting this will prevent confusion going forward.

llvm-svn: 267440

8 years ago[LVI] Split solveBlockValueConstantRange into two [NFC]
Philip Reames [Mon, 25 Apr 2016 18:30:31 +0000 (18:30 +0000)]
[LVI] Split solveBlockValueConstantRange into two [NFC]

This function handled both unary and binary operators.  Cloning and specializing leads to much easier to follow code with minimal duplicatation.

llvm-svn: 267438

8 years ago[gold] Fix linkInModule and extend common.ll test.
Evgeniy Stepanov [Mon, 25 Apr 2016 18:23:29 +0000 (18:23 +0000)]
[gold] Fix linkInModule and extend common.ll test.

Fix early exit from linkInModule. IRMover::move returns false on
success and true on error.

Add a few more cases of merged common linkage variables with
different sizes and alignments.

llvm-svn: 267437

8 years agoFix typo from r267432.
Chad Rosier [Mon, 25 Apr 2016 18:20:27 +0000 (18:20 +0000)]
Fix typo from r267432.

llvm-svn: 267436

8 years ago[Hexagon] Use llvm-mc instead of llc in an MC testcase
Krzysztof Parzyszek [Mon, 25 Apr 2016 18:09:36 +0000 (18:09 +0000)]
[Hexagon] Use llvm-mc instead of llc in an MC testcase

Remember to svn add the new file.

llvm-svn: 267435

8 years ago[Hexagon] Use llvm-mc instead of llc in an MC testcase
Krzysztof Parzyszek [Mon, 25 Apr 2016 18:08:33 +0000 (18:08 +0000)]
[Hexagon] Use llvm-mc instead of llc in an MC testcase

llvm-svn: 267434

8 years ago[Hexagon] Register save/restore functions do not follow regular conventions
Krzysztof Parzyszek [Mon, 25 Apr 2016 17:49:44 +0000 (17:49 +0000)]
[Hexagon] Register save/restore functions do not follow regular conventions

Do not mark them as modifying any of the volatile registers by default.

llvm-svn: 267433

8 years ago[ValueTracking] Add an additional test case for r266767 where one operand is a const.
Chad Rosier [Mon, 25 Apr 2016 17:41:48 +0000 (17:41 +0000)]
[ValueTracking] Add an additional test case for r266767 where one operand is a const.

llvm-svn: 267432

8 years agoResubmit "Refactor raw pdb dumper into library"
Zachary Turner [Mon, 25 Apr 2016 17:38:08 +0000 (17:38 +0000)]
Resubmit "Refactor raw pdb dumper into library"

This fixes a number of endianness issues as well as an ODR
violation that hopefully causes everything to be happy.

llvm-svn: 267431

8 years ago[ValueTracking] Improve isImpliedCondition when the dominating cond is false.
Chad Rosier [Mon, 25 Apr 2016 17:23:36 +0000 (17:23 +0000)]
[ValueTracking] Improve isImpliedCondition when the dominating cond is false.

llvm-svn: 267430

8 years ago[gold-plugin] Remove dead assignment. NFC.
Davide Italiano [Mon, 25 Apr 2016 17:18:45 +0000 (17:18 +0000)]
[gold-plugin] Remove dead assignment. NFC.

llvm-svn: 267429

8 years ago[ELFRelocs] Other architectures do not have *_NUM reloc.
Davide Italiano [Mon, 25 Apr 2016 17:13:39 +0000 (17:13 +0000)]
[ELFRelocs] Other architectures do not have *_NUM reloc.

It also seems to be unused. Get rid of it.
Thanks to Rafael for pointing out.

llvm-svn: 267428

8 years agodsymutil: Only warn about clang module DWO id mismatches in verbose mode.
Adrian Prantl [Mon, 25 Apr 2016 17:04:32 +0000 (17:04 +0000)]
dsymutil: Only warn about clang module DWO id mismatches in verbose mode.
Until PR27449 (https://llvm.org/bugs/show_bug.cgi?id=27449) is fixed in
clang this warning is pointless, since ASTFileSignatures will change
randomly when a module is rebuilt.

rdar://problem/25610919

llvm-svn: 267427