llvm-project.git
6 years agoMerging r257663:llvmorg-3.8.1llvmorg-3.8.1-rc1
Tom Stellard [Sat, 4 Jun 2016 03:43:08 +0000 (4 03:43 +0000)]
Merging r257663:

------------------------------------------------------------------------
r257663 | dimitry | 2016-01-13 11:48:50 -0800 (Wed, 13 Jan 2016) | 4 lines

Remove bashism from merge.sh: POSIX sh does not have the `function`
reserved word, and it is even superfluous in bash, for this particular
instance.

------------------------------------------------------------------------

llvm-svn: 271772

6 years agoMerging r268295:
Tom Stellard [Sat, 4 Jun 2016 03:43:07 +0000 (4 03:43 +0000)]
Merging r268295:

------------------------------------------------------------------------
r268295 | thomas.stellard | 2016-05-02 13:11:44 -0700 (Mon, 02 May 2016) | 7 lines

AMDGPU/SI: Use v_readfirstlane_b32 when restoring SGPRs spilled to
scratch

We were using v_readlane_b32 with the lane set to zero, but this won't
work if thread 0 is not active.

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

------------------------------------------------------------------------

llvm-svn: 271771

6 years agoMerging r268287:
Tom Stellard [Sat, 4 Jun 2016 03:43:06 +0000 (4 03:43 +0000)]
Merging r268287:

------------------------------------------------------------------------
r268287 | thomas.stellard | 2016-05-02 12:37:56 -0700 (Mon, 02 May 2016) | 19 lines

AMDGPU/SI: Set the kill flag on temp VGPRs used to restore SGPRs from scratch

Summary:
When we restore an SGPR value from scratch, we first load it into a
temporary VGPR and then use v_readlane_b32 to copy the value from the
VGPR back into an SGPR.

We weren't setting the kill flag on the VGPR in the v_readlane_b32
instruction, so the register scavenger wasn't able to re-use this
temp value later.

I wasn't able to create a lit test for this.

Reviewers: arsenm

Subscribers: arsenm, llvm-commits

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

------------------------------------------------------------------------

llvm-svn: 271770

6 years agoMerging r268259:
Tom Stellard [Sat, 4 Jun 2016 03:43:05 +0000 (4 03:43 +0000)]
Merging r268259:

------------------------------------------------------------------------
r268259 | nhaehnle | 2016-05-02 10:37:01 -0700 (Mon, 02 May 2016) | 14 lines

AMDGPU: llvm.SI.fs.constant is a source of divergence

Summary:
This intrinsic is used to get flat-shaded fragment shader inputs. Those are
uniform across a primitive, but a fragment shader wave may process pixels from
multiple primitives (as indicated by the prim_mask), and so that's where
divergence can arise.

Reviewers: arsenm, tstellarAMD

Subscribers: arsenm, llvm-commits

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

------------------------------------------------------------------------

llvm-svn: 271769

6 years agoMerging r267916:
Tom Stellard [Sat, 4 Jun 2016 03:43:04 +0000 (4 03:43 +0000)]
Merging r267916:

------------------------------------------------------------------------
r267916 | Matthew.Arsenault | 2016-04-28 11:38:48 -0700 (Thu, 28 Apr 2016) | 6 lines

AMDGPU: Fix mishandling array allocations when promoting alloca

The canonical form for allocas is a single allocation of the array type.
In case we see a non-canonical array alloca, make sure we aren't
replacing this with an array N times smaller.

------------------------------------------------------------------------

llvm-svn: 271768

6 years agoMerging r266825:
Tom Stellard [Sat, 4 Jun 2016 03:43:02 +0000 (4 03:43 +0000)]
Merging r266825:

------------------------------------------------------------------------
r266825 | nhaehnle | 2016-04-19 14:58:22 -0700 (Tue, 19 Apr 2016) | 12 lines

AMDGPU: Guard VOPC instructions against incorrect commute

Summary:
The added testcase, which triggered this, was derived from a shader-db case
via bugpoint. A separate question is why scalar branching wasn't used.

Reviewers: arsenm, tstellarAMD

Subscribers: arsenm, llvm-commits

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

------------------------------------------------------------------------

llvm-svn: 271767

6 years agoMerging r266824:
Tom Stellard [Sat, 4 Jun 2016 03:43:01 +0000 (4 03:43 +0000)]
Merging r266824:

------------------------------------------------------------------------
r266824 | nhaehnle | 2016-04-19 14:58:17 -0700 (Tue, 19 Apr 2016) | 21 lines

AMDGPU/SI: SGPR accounting in getSIProgramInfo must ignore exec_lo/hi

Summary:
A shader stored the live mask (initial exec mask) in an SGPR which was then
spilled during register allocation. The allocator quite reasonably
optimized turned the spill into

  v_writelane_b32 %vgpr, exec_lo, N
  v_writelane_b32 %vgpr, exec_hi, N+1

at the beginning of the shader, confusing the SGPR accounting.

No test case, because si-sgpr-spill.ll together with an upcoming patch for
WQM handling exhibits the problem.

Reviewers: arsenm, tstellarAMD

Subscribers: arsenm, llvm-commits

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

------------------------------------------------------------------------

llvm-svn: 271766

6 years agoMerging r266244:
Tom Stellard [Sat, 4 Jun 2016 03:43:00 +0000 (4 03:43 +0000)]
Merging r266244:

------------------------------------------------------------------------
r266244 | thomas.stellard | 2016-04-13 13:44:16 -0700 (Wed, 13 Apr 2016) | 13 lines

AMDGPU/SI: Add support for spilling VGPRs without having to scavenge registers

Summary:
When we are spilling SGPRs to scratch memory, we usually don't have
free SGPRs to do the address calculation, so we need to re-use the
ScratchOffset register for the calculation.

Reviewers: arsenm

Subscribers: arsenm, llvm-commits

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

------------------------------------------------------------------------

llvm-svn: 271765

6 years agoMerging r266152:
Tom Stellard [Fri, 3 Jun 2016 20:48:40 +0000 (3 20:48 +0000)]
Merging r266152:

------------------------------------------------------------------------
r266152 | thomas.stellard | 2016-04-12 16:57:30 -0700 (Tue, 12 Apr 2016) | 13 lines

AMDGPU/SI: Fix spilling of 96-bit registers

Summary:
It seems like this was broken in r252327.  I thought we had test cases
for this, but it's really hard to tirgger spills of this exact register
size since they aren't used very much.

Reviewers: arsenm, nhaehnle

Subscribers: nhaehnle, arsenm, llvm-commits

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

------------------------------------------------------------------------

llvm-svn: 271735

6 years agoMerging r266105:
Tom Stellard [Fri, 3 Jun 2016 20:43:03 +0000 (3 20:43 +0000)]
Merging r266105:

------------------------------------------------------------------------
r266105 | thomas.stellard | 2016-04-12 11:40:43 -0700 (Tue, 12 Apr 2016) | 15 lines

AMDGPU/SI: Insert wait states required after v_readfirstlane on SI

Summary:
We will be able to handle this case much better once the hazard
recognizer
is finished, but this conservative implementation  fixes a hang with the
piglit
test:

spec/arb_arrays_of_arrays/execution/sampler/fs-nested-struct-arrays-nonconst-nested-arra

Reviewers: arsenm, nhaehnle

Subscribers: arsenm, llvm-commits

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

------------------------------------------------------------------------

llvm-svn: 271731

6 years agoMerging r266088:
Tom Stellard [Fri, 3 Jun 2016 20:43:01 +0000 (3 20:43 +0000)]
Merging r266088:

------------------------------------------------------------------------
r266088 | nhaehnle | 2016-04-12 09:10:38 -0700 (Tue, 12 Apr 2016) | 16 lines

AMDGPU/SI: Fix a mis-compilation of multi-level breaks

Summary:
Under certain circumstances, multi-level breaks (or what is understood by
the control flow passes as such) could be miscompiled in a way that causes
infinite loops, by emitting incorrect control flow intrinsics.

This fixes a hang in
dEQP-GLES3.functional.shaders.loops.while_dynamic_iterations.conditional_continue_vertex

Reviewers: arsenm, tstellarAMD

Subscribers: arsenm, llvm-commits

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

------------------------------------------------------------------------

llvm-svn: 271730

6 years agoMerging r264214:
Tom Stellard [Fri, 3 Jun 2016 20:42:59 +0000 (3 20:42 +0000)]
Merging r264214:

------------------------------------------------------------------------
r264214 | Matthew.Arsenault | 2016-03-23 16:17:29 -0700 (Wed, 23 Mar 2016) | 2 lines

AMDGPU: Promote alloca should skip volatiles

------------------------------------------------------------------------

llvm-svn: 271729

6 years agoMerging r263627:
Tom Stellard [Fri, 3 Jun 2016 20:22:47 +0000 (3 20:22 +0000)]
Merging r263627:

------------------------------------------------------------------------
r263627 | michel.daenzer | 2016-03-16 02:10:42 -0700 (Wed, 16 Mar 2016) | 11 lines

AMDGPU: Verify instructions in non-debug builds as well

And emit an error if it fails.

This prevents illegal instructions from getting sent to the GPU, which
would potentially result in a hang.

This is a candidate for the stable branch(es).

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
------------------------------------------------------------------------

llvm-svn: 271724

6 years agoMerging r263441:
Tom Stellard [Fri, 3 Jun 2016 20:22:46 +0000 (3 20:22 +0000)]
Merging r263441:

------------------------------------------------------------------------
r263441 | marek.olsak | 2016-03-14 08:57:14 -0700 (Mon, 14 Mar 2016) | 8 lines

AMDGPU/SI: Incomplete shader binaries need to finish execution at the end

Reviewers: tstellarAMD, arsenm

Subscribers: arsenm

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

------------------------------------------------------------------------

llvm-svn: 271723

6 years agoMerging r262732:
Tom Stellard [Fri, 3 Jun 2016 20:22:44 +0000 (3 20:22 +0000)]
Merging r262732:

------------------------------------------------------------------------
r262732 | thomas.stellard | 2016-03-04 10:31:18 -0800 (Fri, 04 Mar 2016) | 12 lines

AMDGPU/SI: Add support for spiling SGPRs to scratch buffer

Summary:
This is necessary for when we run out of VGPRs and can no
longer use v_{read,write}_lane for spilling SGPRs.

Reviewers: arsenm

Subscribers: arsenm, llvm-commits

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

------------------------------------------------------------------------

llvm-svn: 271722

6 years agoMerging r262728:
Tom Stellard [Fri, 3 Jun 2016 20:22:42 +0000 (3 20:22 +0000)]
Merging r262728:

------------------------------------------------------------------------
r262728 | thomas.stellard | 2016-03-04 10:02:01 -0800 (Fri, 04 Mar 2016) | 19 lines

AMDGPU/SI: Enable frame index scavenging during PrologEpilogueInserter

Summary:
This allows us to use virtual registers when we need extra registers
for inserting spill instructions in SIRegisterInfo:eliminateFrameIndex().

Once all the frame indices have been eliminated, the
PrologEpilogueInserter does an extra pass over the program to replace
all virtual registers with physical ones.

This allows us to make more efficient use of our emergency spill slots,
so we only need to create one.

Reviewers: arsenm

Subscribers: arsenm, llvm-commits

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

------------------------------------------------------------------------

llvm-svn: 271721

6 years agoMerging r262577:
Tom Stellard [Fri, 3 Jun 2016 20:22:40 +0000 (3 20:22 +0000)]
Merging r262577:

------------------------------------------------------------------------
r262577 | thomas.stellard | 2016-03-02 19:45:09 -0800 (Wed, 02 Mar 2016) | 12 lines

AMDGPU/SI: Don't try to move scratch wave offset when there are no free SGPRs

Summary:
When there were no free SGPRs, we were trying to move this value into
some of the reserved registers which was causing a segmentation fault.

Reviewers: arsenm

Subscribers: arsenm, llvm-commits

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

------------------------------------------------------------------------

llvm-svn: 271720

6 years agoMerging r262297:
Tom Stellard [Fri, 3 Jun 2016 20:22:39 +0000 (3 20:22 +0000)]
Merging r262297:

------------------------------------------------------------------------
r262297 | Matthew.Arsenault | 2016-02-29 20:58:20 -0800 (Mon, 29 Feb 2016) | 2 lines

AMDGPU: Don't use estimated stack size when we know the real stack size

------------------------------------------------------------------------

llvm-svn: 271719

6 years agoMerging r261385:
Tom Stellard [Fri, 3 Jun 2016 18:16:01 +0000 (3 18:16 +0000)]
Merging r261385:

------------------------------------------------------------------------
r261385 | thomas.stellard | 2016-02-19 16:37:25 -0800 (Fri, 19 Feb 2016) | 20 lines

AMDGPU/SI: Use v_readfirstlane to legalize SMRD with VGPR base pointer

Summary:
Instead of trying to replace SMRD instructions with a VGPR base pointer
with an equivalent MUBUF instruction, we now copy the base pointer to
SGPRs using v_readfirstlane.

This is safe to do, because any load selected as an SMRD instruction
has been proven to have a uniform base pointer, so each thread in the
wave will have the same pointer value in VGPRs.

This will fix some errors on VI from trying to replace SMRD instructions
with addr64-enabled MUBUF instructions that don't exist.

Reviewers: arsenm, cfang, nhaehnle

Subscribers: arsenm, llvm-commits

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

------------------------------------------------------------------------

llvm-svn: 271700

6 years agoMerging r260692:
Tom Stellard [Fri, 3 Jun 2016 16:45:55 +0000 (3 16:45 +0000)]
Merging r260692:

------------------------------------------------------------------------
r260692 | changpeng.fang | 2016-02-12 09:11:04 -0800 (Fri, 12 Feb 2016) | 13 lines

AMDGPU/SI: Annotate Loops with Constant Condition in SIAnnotateControlFlow pass.

Summary:
  It is possible that the loop condition can be a boolean constant (infinite loop,
for example). So we sould handle constant condition in annotating a loop. This
patch adds this functionality to support annotating constant condition.

Reviewers: tstellarAMD, arsenm

Subscribers: llvm-commits, arsenm

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

------------------------------------------------------------------------

llvm-svn: 271685

6 years agoMerging r260658:
Tom Stellard [Fri, 3 Jun 2016 16:45:46 +0000 (3 16:45 +0000)]
Merging r260658:

------------------------------------------------------------------------
r260658 | Matthew.Arsenault | 2016-02-11 22:31:30 -0800 (Thu, 11 Feb 2016) | 12 lines

AMDGPU: Set flat_scratch from flat_scratch_init reg

This was hardcoded to the static private size, but this
would be missing the offset and additional size for someday
when we have dynamic sizing.

Also stops always initializing flat_scratch even when unused.

In the future we should stop emitting this unless flat instructions
are used to access private memory. For example this will initialize
it almost always on VI because flat is used for global access.

------------------------------------------------------------------------

llvm-svn: 271684

6 years agoMerging r260651:
Tom Stellard [Fri, 3 Jun 2016 15:58:20 +0000 (3 15:58 +0000)]
Merging r260651:

------------------------------------------------------------------------
r260651 | Matthew.Arsenault | 2016-02-11 18:40:47 -0800 (Thu, 11 Feb 2016) | 7 lines

AMDGPU: Set element_size in private resource descriptor

Introduce a subtarget feature for this, and leave the default with
the current behavior which assumes up to 16-byte loads/stores can
be used. The field also seems to have the ability to be set to 2 bytes,
but I'm not sure what that would be used for.

------------------------------------------------------------------------

llvm-svn: 271679

6 years agoMerging r260645:
Tom Stellard [Fri, 3 Jun 2016 09:50:14 +0000 (3 09:50 +0000)]
Merging r260645:

------------------------------------------------------------------------
r260645 | Matthew.Arsenault | 2016-02-11 18:16:10 -0800 (Thu, 11 Feb 2016) | 2 lines

AMDGPU: Initialize SILowerControlFlow

------------------------------------------------------------------------

llvm-svn: 271643

6 years agoMerging r260599:
Tom Stellard [Fri, 3 Jun 2016 09:50:12 +0000 (3 09:50 +0000)]
Merging r260599:

------------------------------------------------------------------------
r260599 | thomas.stellard | 2016-02-11 13:45:07 -0800 (Thu, 11 Feb 2016) | 14 lines

AMDGPU/SI: Make sure MIMG descriptors and samplers stay in SGPRs

Summary:
It's possible to have resource descriptors and samplers stored in
VGPRs, either by a VMEM instruction or in the case of samplers,
floating-point calculations.  When this happens, we need to use
v_readfirstlane to copy these values back to sgprs.

Reviewers: mareko, arsenm

Subscribers: arsenm, llvm-commits

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

------------------------------------------------------------------------

llvm-svn: 271642

6 years agoMerging r260588:
Tom Stellard [Fri, 3 Jun 2016 09:50:09 +0000 (3 09:50 +0000)]
Merging r260588:

------------------------------------------------------------------------
r260588 | thomas.stellard | 2016-02-11 13:14:34 -0800 (Thu, 11 Feb 2016) | 20 lines

AMDGPU/SI: When splitting SMRD instructions, add its users to VALU worklist

Summary:
When we split SMRD instructions into two MUBUFs we were adding the users
of the newly created MUBUFs to the VALU worklist.  However, the only
users these instructions had was the REG_SEQUENCE that was inserted
by splitSMRD when the original SMRD instruction was split.

We need to make sure to add the users of the original SMRD to the VALU
worklist before it is split.

I have a test case, but it requires one other bug fix, so it will be
added in a later commt.

Reviewers: mareko, arsenm

Subscribers: arsenm, llvm-commits

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

------------------------------------------------------------------------

llvm-svn: 271641

6 years agoMerging r260495:
Tom Stellard [Fri, 3 Jun 2016 09:50:08 +0000 (3 09:50 +0000)]
Merging r260495:

------------------------------------------------------------------------
r260495 | Matthew.Arsenault | 2016-02-10 22:15:39 -0800 (Wed, 10 Feb 2016) | 9 lines

AMDGPU: Fix constant bus use check with subregisters

If the two operands to an instruction were both
subregisters of the same super register, it would incorrectly
think this counted as the same constant bus use.

This fixes the verifier error in fmin_legacy.ll which
was missing -verify-machineinstrs.

------------------------------------------------------------------------

llvm-svn: 271640

6 years agoMerging r259911:
Tom Stellard [Fri, 3 Jun 2016 09:50:05 +0000 (3 09:50 +0000)]
Merging r259911:

------------------------------------------------------------------------
r259911 | Matthew.Arsenault | 2016-02-05 11:47:23 -0800 (Fri, 05 Feb 2016) | 5 lines

AMDGPU: Preserve alignments on new created globals

Also switch to internal linkage, and include the name of the function in
the name.

------------------------------------------------------------------------

llvm-svn: 271639

6 years agoMerging r259894:
Tom Stellard [Thu, 2 Jun 2016 21:01:47 +0000 (2 21:01 +0000)]
Merging r259894:

------------------------------------------------------------------------
r259894 | thomas.stellard | 2016-02-05 09:42:38 -0800 (Fri, 05 Feb 2016) | 8 lines

AMDGPU/SI: Correctly initialize SIInsertWaits pass

Reviewers: arsenm

Subscribers: arsenm, llvm-commits

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

------------------------------------------------------------------------

llvm-svn: 271594

6 years agoMerging r259558:
Tom Stellard [Thu, 2 Jun 2016 21:01:46 +0000 (2 21:01 +0000)]
Merging r259558:

------------------------------------------------------------------------
r259558 | Matthew.Arsenault | 2016-02-02 12:28:10 -0800 (Tue, 02 Feb 2016) | 4 lines

AMDGPU: Handle promoting memmove

Also add missing tests for the others.

------------------------------------------------------------------------

llvm-svn: 271593

6 years agoMerging r259546:
Tom Stellard [Thu, 2 Jun 2016 21:01:44 +0000 (2 21:01 +0000)]
Merging r259546:

------------------------------------------------------------------------
r259546 | Matthew.Arsenault | 2016-02-02 11:18:53 -0800 (Tue, 02 Feb 2016) | 5 lines

AMDGPU: Whitelist handled intrinsics

We shouldn't crash on unhandled intrinsics.
Also simplify failure handling in loop.

------------------------------------------------------------------------

llvm-svn: 271592

6 years agoMerging part of r259297:
Tom Stellard [Thu, 2 Jun 2016 21:01:43 +0000 (2 21:01 +0000)]
Merging part of r259297:

We need to correctly initialize the AMDGPUPromoteAlloca pass, because
later commits will add tests that try to pass the -amdgpu-promote-alloca
flag to opt.

llvm-svn: 271591

6 years agoMerging r259059:
Tom Stellard [Thu, 2 Jun 2016 21:01:41 +0000 (2 21:01 +0000)]
Merging r259059:

------------------------------------------------------------------------
r259059 | thomas.stellard | 2016-01-28 09:13:44 -0800 (Thu, 28 Jan 2016) | 14 lines

AMDGPU: waitcnt operand fixes

Summary:
Allow lgkmcnt up to 0xF (hardware allows that).
Fix mask for ExpCnt in AMDGPUInstPrinter.

Reviewers: tstellarAMD, arsenm

Subscribers: arsenm

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

Patch by: Nikolay Haustov

------------------------------------------------------------------------

llvm-svn: 271590

6 years agoMerging r258936:
Tom Stellard [Thu, 2 Jun 2016 21:01:40 +0000 (2 21:01 +0000)]
Merging r258936:

------------------------------------------------------------------------
r258936 | thomas.stellard | 2016-01-27 07:53:52 -0800 (Wed, 27 Jan 2016) | 14 lines

AMDGPU/SI: Fix commuting of 32-bit VOPC instructions

Summary:
We didn't have entries in the commuting table for the 32-bit
instructions.  I don't think we hit this problem now, but we
will once uniform branching is enabled.  Tests will come in
a later commit.

Reviewers: arsenm

Subscribers: arsenm, llvm-commits

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

------------------------------------------------------------------------

llvm-svn: 271589

6 years agoMerging r258901:
Tom Stellard [Thu, 2 Jun 2016 21:01:38 +0000 (2 21:01 +0000)]
Merging r258901:

------------------------------------------------------------------------
r258901 | Matthew.Arsenault | 2016-01-26 18:17:49 -0800 (Tue, 26 Jan 2016) | 17 lines

AMDGPU: Fix default device handling

When no device name is specified, default to kaveri
for HSA since SI is not supported and it woud fail.

Default to "tahiti" instead of "SI" since these are
effectively the same, and tahiti is an actual device.

Move default device handling to the TargetMachine
rather than the AMDGPUSubtarget. The module ISA version
is computed from the device name provided with the target
machine, so the attributes printed by the AsmPrinter were
inconsistent with those computed in the subtarget.

Also remove DevName field from subtarget since it's redundant
with getCPU() in the superclass.

------------------------------------------------------------------------

llvm-svn: 271588

6 years agoMerging r258606:
Tom Stellard [Thu, 2 Jun 2016 20:59:25 +0000 (2 20:59 +0000)]
Merging r258606:

------------------------------------------------------------------------
r258606 | Matthew.Arsenault | 2016-01-22 21:32:14 -0800 (Fri, 22 Jan 2016) | 5 lines

AMDGPU: Remove Feature64BitPtr

This is a leftover from AMDIL that doesn't do anything
and doesn't belong here.

------------------------------------------------------------------------

llvm-svn: 271587

6 years agoMerging r271035:
Jonathan Peyton [Thu, 2 Jun 2016 20:33:53 +0000 (2 20:33 +0000)]
Merging r271035:
------------------------------------------------------------------------
r271035 | hfinkel | 2016-05-27 14:04:05 -0500 (Fri, 27 May 2016) | 3 lines

Fix storing the frame pointer for OMP-T during ppc64 microtask dispatch

Thanks to John Mellor-Crummey for reporting the omission.
------------------------------------------------------------------------

llvm-svn: 271583

6 years agoMerging r270884:
Jonathan Peyton [Thu, 2 Jun 2016 20:32:40 +0000 (2 20:32 +0000)]
Merging r270884:
------------------------------------------------------------------------
r270884 | jlpeyton | 2016-05-26 13:19:10 -0500 (Thu, 26 May 2016) | 11 lines

Make LIBOMP_USE_ITT_NOTIFY a setting that can be enabled or disabled

On Blue Gene/Q, having LIBOMP_USE_ITT_NOTIFY support compiled into a
statically-linked binary causes a failure at runtime because dlopen fails.
This patch changes LIBOMP_USE_ITT_NOTIFY to a cacheable configuration setting
that can be disabled.

Patch by John Mellor-Crummey

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

------------------------------------------------------------------------

llvm-svn: 271581

6 years agoMerging r270821:
Jonathan Peyton [Thu, 2 Jun 2016 20:28:43 +0000 (2 20:28 +0000)]
Merging r270821:
------------------------------------------------------------------------
r270821 | hfinkel | 2016-05-25 23:48:14 -0500 (Wed, 25 May 2016) | 6 lines

Add an assembly __kmp_invoke_microtask for ppc64[le]

Clang no longer restricts itself to generating microtasks with a small number
of arguments, and so an assembly implementation is required to prevent hitting
the parameter limit present in the C implementation. This adds an
implementation for ppc64[le].
------------------------------------------------------------------------

llvm-svn: 271580

6 years agoMerging r270464:
Jonathan Peyton [Thu, 2 Jun 2016 20:19:12 +0000 (2 20:19 +0000)]
Merging r270464:
------------------------------------------------------------------------
r270464 | jlpeyton | 2016-05-23 12:50:32 -0500 (Mon, 23 May 2016) | 12 lines

Allow unit testing on Windows

These changes allow testing on Windows using clang.exe.
There are two main changes:
1. Only link to -lm when it actually exists on the system
2. Create basic versions of pthread_create() and pthread_join() for windows.
   They are not POSIX compliant by any stretch but will allow any existing
   and future tests to use pthread_create() and pthread_join() for testing
   interactions of libomp with os threads.

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

------------------------------------------------------------------------

llvm-svn: 271578

6 years agoMerging r258607:
Tom Stellard [Thu, 2 Jun 2016 04:32:16 +0000 (2 04:32 +0000)]
Merging r258607:

------------------------------------------------------------------------
r258607 | Matthew.Arsenault | 2016-01-22 21:32:18 -0800 (Fri, 22 Jan 2016) | 4 lines

AMDGPU: Remove IntrNoMem from llvm.SI.sendmsg

This has side effects.

------------------------------------------------------------------------

llvm-svn: 271485

6 years agoMerging r258537:
Tom Stellard [Thu, 2 Jun 2016 04:32:15 +0000 (2 04:32 +0000)]
Merging r258537:

------------------------------------------------------------------------
r258537 | Matthew.Arsenault | 2016-01-22 11:47:54 -0800 (Fri, 22 Jan 2016) | 6 lines

AMDGPU: Fix crash with invariant markers

The promote alloca pass didn't handle these intrinsics and crashed.
These intrinsics should accept any address space, but for now just
erase them to avoid breaking.

------------------------------------------------------------------------

llvm-svn: 271484

6 years agoMerging r258319:
Tom Stellard [Thu, 2 Jun 2016 04:32:11 +0000 (2 04:32 +0000)]
Merging r258319:

------------------------------------------------------------------------
r258319 | thomas.stellard | 2016-01-20 07:48:27 -0800 (Wed, 20 Jan 2016) | 8 lines

Correctly initialize SIAnnotateControlFlow

Reviewers: arsenm

Subscribers: arsenm, llvm-commits

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

------------------------------------------------------------------------

llvm-svn: 271483

6 years agoRevert unintentional change.
Joerg Sonnenberger [Wed, 1 Jun 2016 14:11:09 +0000 (1 14:11 +0000)]
Revert unintentional change.

llvm-svn: 271395

6 years agoMerging rr261430:
Joerg Sonnenberger [Wed, 1 Jun 2016 14:10:10 +0000 (1 14:10 +0000)]
Merging rr261430:
------------------------------------------------------------------------
r261430 | joerg | 2016-02-20 12:24:44 +0100 (Sat, 20 Feb 2016) | 15 lines

When MemoryDependenceAnalysis hits a CFG with many transparent blocks,
the algorithm easily degrades into quadratic memory and time complexity.
The easiest example is a long chain of BBs that don't otherwise use a
location. The caching will add an entry for every intermediate block and
limiting the number of results doesn't help as no results are produced
until a definition is found.

Introduce a limit similar to the existing instructions-per-block limit.
This limit counts the total number of blocks checked. If the limit is
reached, entries are considered unknown. The initial value is 1000,
which avoids regressions for normal sized functions while still
limiting edge cases to reasnable memory consumption and execution time.

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

------------------------------------------------------------------------

llvm-svn: 271394

6 years agoMerging r270564:
Mohit K. Bhakkad [Wed, 1 Jun 2016 13:18:51 +0000 (1 13:18 +0000)]
Merging r270564:
------------------------------------------------------------------------
r270564 | slthakur | 2016-05-24 20:22:50 +0530 (Tue, 24 May 2016) | 9 lines

[LLDB][MIPS] Fix floating point handling in case of thread step-out

Patch by Nitesh Jain.

Summary: These patch fix thread step-out for hard and soft float.

Reviewers: jaydeep, bhushan, clayborg
Differential Revision: http://reviews.llvm.org/D20416

------------------------------------------------------------------------

llvm-svn: 271390

6 years agoMerging r270208:
Mohit K. Bhakkad [Wed, 1 Jun 2016 11:46:30 +0000 (1 11:46 +0000)]
Merging r270208:
------------------------------------------------------------------------
r270208 | slthakur | 2016-05-20 17:41:52 +0530 (Fri, 20 May 2016) | 10 lines

[LLDB][MIPS] Fix Floating point Registers Encoding

Patch by Nitesh Jain.

Summary: Currently floating point regsiters has eEncodingUint encoding. Hence register write  '1.25' will failed. This patch add eEncodingIEEE754 encoding for floating point registers( - ). This patch will fix test_fp_register_write in TestRegisters.py

Reviewers: clayborg, sagar
Subscribers: mohit.bhakkad, jaydeep, bhushan, sdardis, lldb-commits
Differential: D18853

------------------------------------------------------------------------

llvm-svn: 271383

6 years agoMerging r269407:
Mohit K. Bhakkad [Wed, 1 Jun 2016 11:41:12 +0000 (1 11:41 +0000)]
Merging r269407:
------------------------------------------------------------------------
r269407 | slthakur | 2016-05-13 16:34:47 +0530 (Fri, 13 May 2016) | 10 lines

[LLDB][MIPS] Provide ABI string to compiler for appropriate code generation for MIPS

Patch by Nitesh Jain.

Summary: These patch will set clang::TargetOptions::ABI and accordingly code will be generated for MIPS target.

Reviewers: ovyalov, clayborg
Subscribers: lldb-commits, mohit.bhakkad, sagar, jaydeep, bhushan
Differential: D18638

------------------------------------------------------------------------

llvm-svn: 271381

6 years agoMerging r269181:
Mohit K. Bhakkad [Wed, 1 Jun 2016 10:39:18 +0000 (1 10:39 +0000)]
Merging r269181:
------------------------------------------------------------------------
r269181 | slthakur | 2016-05-11 18:38:29 +0530 (Wed, 11 May 2016) | 10 lines

[LLDB][MIPS] Setting appropriate ArchSpec::m_flags based on ABI

Patch by Nitesh Jain.

Summary: The ArchSpec::m_flags will be set based on ELF flag ABI.

Reviewers: ovyalov, clayborg
Subscribers: lldb-commits, mohit.bhakkad, sagar, jaydeep, bhushan
Differential: D18858

------------------------------------------------------------------------

llvm-svn: 271379

6 years agoMerging r261206:
Mohit K. Bhakkad [Wed, 1 Jun 2016 10:36:32 +0000 (1 10:36 +0000)]
Merging r261206:
------------------------------------------------------------------------
r261206 | bhushan.attarde | 2016-02-18 17:23:28 +0530 (Thu, 18 Feb 2016) | 9 lines

[LLDB][MIPS] Provide CPU string to compiler for appropriate code generation for MIPS

    SUMMARY:
    This patch implements ArchSpec::GetClangTargetCPU() that provides string representing current architecture as a target CPU.
    This string is then passed to tools like clang so that they generate correct code for that target.

    Reviewers: clayborg, zturner
    Subscribers: mohit.bhakkad, sagar, jaydeep, lldb-commits
    Differential Revision: http://reviews.llvm.org/D17022
------------------------------------------------------------------------

llvm-svn: 271378

6 years agoMerging r263621:
Mohit K. Bhakkad [Wed, 1 Jun 2016 08:17:03 +0000 (1 08:17 +0000)]
Merging r263621:
------------------------------------------------------------------------
r263621 | mohit.bhakkad | 2016-03-16 13:53:10 +0530 (Wed, 16 Mar 2016) | 9 lines

[ASAN] Add support for mips/mips64 android

Patch by Duane Sand

Reviewers: samsonov

Subscribers: duanesand, jaydeep, sagar, llvm-commits, filcab.

Differential Revision: http://reviews.llvm.org/D17883
------------------------------------------------------------------------

llvm-svn: 271372

6 years ago[r260944] clang-tools-extra/test/Unit/lit.site.cfg.in: Prune on_clone. I guess it...
NAKAMURA Takumi [Wed, 1 Jun 2016 00:27:34 +0000 (1 00:27 +0000)]
[r260944] clang-tools-extra/test/Unit/lit.site.cfg.in: Prune on_clone. I guess it has been unused since r188006.

llvm-svn: 271354

6 years agoMerging r261139:
Tom Stellard [Mon, 30 May 2016 20:42:50 +0000 (30 20:42 +0000)]
Merging r261139:

------------------------------------------------------------------------
r261139 | deadalnix | 2016-02-17 11:21:28 -0800 (Wed, 17 Feb 2016) | 10 lines

Fix load alignement when unpacking aggregates structs

Summary: Store and loads unpacked by instcombine do not always have the
right alignement. This explicitely compute the alignement and set it.

Reviewers: dblaikie, majnemer, reames, hfinkel, joker.eph

Subscribers: llvm-commits

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

------------------------------------------------------------------------

llvm-svn: 271230

6 years agoMerging r270550:
Daniel Sanders [Mon, 30 May 2016 18:46:52 +0000 (30 18:46 +0000)]
Merging r270550:
------------------------------------------------------------------------
r270550 | rafael | 2016-05-24 12:16:14 +0100 (Tue, 24 May 2016) | 1 line

Update for llvm change.
------------------------------------------------------------------------
The referenced llvm change was r270542.

llvm-svn: 271223

6 years agoMerging r266438:
Tom Stellard [Mon, 30 May 2016 17:38:43 +0000 (30 17:38 +0000)]
Merging r266438:

------------------------------------------------------------------------
r266438 | niravd | 2016-04-15 08:01:38 -0700 (Fri, 15 Apr 2016) | 15 lines

Fix typing on generated LXV2DX/STXV2DX instructions

[PPC] Previously when casting generic loads to LXV2DX/ST instructions we
would leave the original load return type in place allowing for an
assertion failure when we merge two equivalent LXV2DX nodes with
different types.

This fixes PR27350.

Reviewers: nemanjai

Subscribers: llvm-commits

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

------------------------------------------------------------------------

llvm-svn: 271217

6 years agoMerging r266217:
Tom Stellard [Mon, 30 May 2016 17:38:42 +0000 (30 17:38 +0000)]
Merging r266217:

------------------------------------------------------------------------
r266217 | niravd | 2016-04-13 10:27:26 -0700 (Wed, 13 Apr 2016) | 12 lines

Cleanup Store Merging in UseAA case

This patch fixes a bug (PR26827) when using anti-aliasing in store
merging. This sets the chain users of the component stores to point to
the new store instead of the component stores chain parent.

Reviewers: jyknight

Subscribers: llvm-commits

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

------------------------------------------------------------------------

llvm-svn: 271216

6 years agoMerging r263428:
Daniel Sanders [Sat, 28 May 2016 16:11:58 +0000 (28 16:11 +0000)]
Merging r263428:
------------------------------------------------------------------------
r263428 | zbuljan | 2016-03-14 12:50:23 +0000 (Mon, 14 Mar 2016) | 3 lines

[mips] Fix an issue with long double when function roundl is defined
Differential Revision: http://reviews.llvm.org/D17760

------------------------------------------------------------------------

llvm-svn: 271127

6 years agoMerging r262230:
Daniel Sanders [Sat, 28 May 2016 16:11:08 +0000 (28 16:11 +0000)]
Merging r262230:
------------------------------------------------------------------------
r262230 | vkalintiris | 2016-02-29 15:58:12 +0000 (Mon, 29 Feb 2016) | 7 lines

[mips] Do not use SLL for ANY_EXTEND nodes as the high bits are undefined.

Reviewers: dsanders

Subscribers: dsanders, llvm-commits

Differential Revision: http://reviews.llvm.org/D15420
------------------------------------------------------------------------

llvm-svn: 271126

6 years agoMerging r268386:
Daniel Sanders [Sat, 28 May 2016 16:10:01 +0000 (28 16:10 +0000)]
Merging r268386:
------------------------------------------------------------------------
r268386 | dsanders | 2016-05-03 15:19:26 +0100 (Tue, 03 May 2016) | 11 lines

[mips][fastisel] ADJCALLSTACKUP has a second immediate operand.

Summary:
It's always zero for SelectionDAG and is never read by the MIPS backend so
do the same for FastISel.

Reviewers: sdardis

Subscribers: dsanders, llvm-commits, sdardis

Differential Revision: http://reviews.llvm.org/D19863
------------------------------------------------------------------------

llvm-svn: 271124

6 years agoMerging r268053:
Daniel Sanders [Sat, 28 May 2016 16:09:06 +0000 (28 16:09 +0000)]
Merging r268053:
------------------------------------------------------------------------
r268053 | sdardis | 2016-04-29 17:07:47 +0100 (Fri, 29 Apr 2016) | 9 lines

[mips][FastISel] A store is not a load.

Correct trivial error. One of the failing tests from PR/27458.

Reviewers: dsanders, vkalintiris, mcrosier

Differential Review: http://reviews.llvm.org/D19726

------------------------------------------------------------------------

llvm-svn: 271123

6 years agoMerging r259039:
Daniel Sanders [Sat, 28 May 2016 16:08:13 +0000 (28 16:08 +0000)]
Merging r259039:
------------------------------------------------------------------------
r259039 | zjovanovic | 2016-01-28 11:08:03 +0000 (Thu, 28 Jan 2016) | 9 lines

[mips][microMIPS] Disable FastISel for microMIPS

Author: milena.vujosevic.janicic
Reviewers: dsanders

FastIsel is not supported for microMIPS, thus it needs to be disabled.
Test micromips-zero-mat-uses.ll is deleted since the tested sequence of instructions is not generated for microMIPS without FastISel.
Differential Revision: http://reviews.llvm.org/D15892

------------------------------------------------------------------------

llvm-svn: 271122

6 years agoMerging r268673:
Daniel Sanders [Sat, 28 May 2016 15:58:03 +0000 (28 15:58 +0000)]
Merging r268673:
------------------------------------------------------------------------
r268673 | koriakin | 2016-05-05 21:13:17 +0100 (Thu, 05 May 2016) | 5 lines

[MSan] [MIPS64] Fix vararg helper for >1 fixed argument.

This fixes http://llvm.org/PR27646 on Mips64.

Differential Revision: http://reviews.llvm.org/D19989
------------------------------------------------------------------------

llvm-svn: 271121

6 years agoMerging r268531:
Daniel Sanders [Sat, 28 May 2016 15:57:13 +0000 (28 15:57 +0000)]
Merging r268531:
------------------------------------------------------------------------
r268531 | koriakin | 2016-05-04 19:39:14 +0100 (Wed, 04 May 2016) | 3 lines

[MSan] [Mips64] Add tests for vararg handling.

Differential Revision: http://reviews.llvm.org/D19919
------------------------------------------------------------------------

llvm-svn: 271120

6 years agoMerging r266833:
Daniel Sanders [Sat, 28 May 2016 15:56:22 +0000 (28 15:56 +0000)]
Merging r266833:
------------------------------------------------------------------------
r266833 | koriakin | 2016-04-20 00:46:59 +0100 (Wed, 20 Apr 2016) | 5 lines

[Mips] [MSan] VarArgMIPS64Helper: Use target's endian, not host's.

Ugh.

Differential Revision: http://reviews.llvm.org/D19292
------------------------------------------------------------------------

llvm-svn: 271119

6 years agoMerging r270542:
Mohit K. Bhakkad [Wed, 25 May 2016 06:32:18 +0000 (25 06:32 +0000)]
Merging r270542:
------------------------------------------------------------------------
r270542 | slthakur | 2016-05-24 15:27:10 +0530 (Tue, 24 May 2016) | 9 lines

[MIPS][LLVM-MC] Fix Disassemble of Negative Offset

Patch by Nitesh Jain.

Summary: The type of Imm in MipsDisassembler.cpp was incorrect since SignExtend64 return int64_t type.As per the MIPSr6 doc ,the offset is added to the address of the instruction following the branch (not the branch itself), to form a PC-relative effective target address hence “4” is added to the offset. The offset of some test case are update to reflect the changes due to “ + 4 ” offset and new test case for negative offset are added.

Reviewers: dsanders, vkalintiris
Differential Revision: http://reviews.llvm.org/D17540

------------------------------------------------------------------------

llvm-svn: 270676

6 years agoMerging r265134:
Mohit K. Bhakkad [Wed, 25 May 2016 06:30:52 +0000 (25 06:30 +0000)]
Merging r265134:
------------------------------------------------------------------------
r265134 | slthakur | 2016-04-01 17:25:33 +0530 (Fri, 01 Apr 2016) | 9 lines

[MIPS][LLVM-MC] Fix JR encoding for MIPSR6 ISA

Summary: The assembler was picking the wrong JR variant because the pre-R6 one was still enabled at R6.

Author: nitesh.jain
Reviewers: vkalintiris, dsanders
Subscribers: dsanders, llvm-commits, mohit.bhakkad, sagar, bhushan, jaydeep
Differential: D18387

------------------------------------------------------------------------

llvm-svn: 270675

6 years agoMerging r265134:
Mohit K. Bhakkad [Wed, 25 May 2016 05:59:50 +0000 (25 05:59 +0000)]
Merging r265134:
------------------------------------------------------------------------

llvm-svn: 270673

6 years agoMerging r269882:
Sagar Thakur [Wed, 25 May 2016 05:57:29 +0000 (25 05:57 +0000)]
Merging r269882:
------------------------------------------------------------------------
r269882 | slthakur | 2016-05-18 11:39:26 +0530 (Wed, 18 May 2016) | 7 lines

[LSAN] Fix test swapcontext.cc on MIPS

There is no frame validity check in the slow unwinder like there is in the fast unwinder due to which lsan reports a leak even for heap allocated coroutine in the test swapcontext.cc. Since mips/linux uses slow unwindwer instead of fast unwinder, the test fails for mips/linux. Therefore adding the checks before unwinding fixes the test for mips/linux.

Reviewed by aizatsky.
Differential: http://reviews.llvm.org/D19961

------------------------------------------------------------------------

llvm-svn: 270672

6 years agoMerging r267674:
Mohit K. Bhakkad [Wed, 25 May 2016 05:49:40 +0000 (25 05:49 +0000)]
Merging r267674:
------------------------------------------------------------------------
r267674 | mohit.bhakkad | 2016-04-27 11:19:42 +0530 (Wed, 27 Apr 2016) | 7 lines

[Compiler-rt][CFI] Enabling CFI for MIPS64

Reviewers: eugenis

Subscribers: jaydeep, sagar, Sanitizers

Differential Revision: http://reviews.llvm.org/D19531
------------------------------------------------------------------------

llvm-svn: 270668

6 years agoMerging r262838:
Joerg Sonnenberger [Tue, 24 May 2016 19:36:54 +0000 (24 19:36 +0000)]
Merging r262838:
------------------------------------------------------------------------
r262838 | joerg | 2016-03-07 18:19:15 +0100 (Mon, 07 Mar 2016) | 2 lines

Implement __builtin_eh_return_data_regno for SPARC and SPARC64.

------------------------------------------------------------------------

llvm-svn: 270602

6 years agoMerging r261980:
Sagar Thakur [Tue, 24 May 2016 11:11:57 +0000 (24 11:11 +0000)]
Merging r261980:
------------------------------------------------------------------------
r261980 | slthakur | 2016-02-26 11:26:54 +0530 (Fri, 26 Feb 2016) | 8 lines

[MSAN] Fix test SmallPreAllocatedStackThread for MIPS

Summary: Msan was intercepting version 2.1 of the pthread_create function which was making it to crash in libc because __pthread_create_2_1 modifies the stack attributes of the thread. Intercepting the correct version fixes the test SmallPreAllocatedStackThread.

Reviewers: eugenis, samsonov
Subscribers: llvm-commits, mohit.bhakkad, jaydeep
Differential: http://reviews.llvm.org/D17603

------------------------------------------------------------------------

llvm-svn: 270549

6 years agoMerging r264030:
Mohit K. Bhakkad [Tue, 24 May 2016 10:50:09 +0000 (24 10:50 +0000)]
Merging r264030:
------------------------------------------------------------------------
r264030 | mohit.bhakkad | 2016-03-22 13:38:02 +0530 (Tue, 22 Mar 2016) | 6 lines

[LLDB]{MIPS] Fix TestPlatformProcessConnect.py
Patch by Nitesh Jain

Reviewers: clayborg, labath.
Subscribers: jaydeep, bhushan, mohit.bhakkad, sagar, lldb-commits.
Differential Revision: http://reviews.llvm.org/D18082
------------------------------------------------------------------------

llvm-svn: 270546

6 years agoMerging r262819:
Mohit K. Bhakkad [Tue, 24 May 2016 10:49:10 +0000 (24 10:49 +0000)]
Merging r262819:
------------------------------------------------------------------------
r262819 | mohit.bhakkad | 2016-03-07 14:42:49 +0530 (Mon, 07 Mar 2016) | 7 lines

[LLDB][MIPS] Fix TestDisassembleBreakpoint

Patch by Nitesh Jain

Reviewers: clayborg, jaydeep.
Subscribers: bhushan, mohit.bhakkad, sagar, lldb-commits.
Differential Revision: http://reviews.llvm.org/D17597
------------------------------------------------------------------------

llvm-svn: 270545

6 years agoMerging r260362:
Mohit K. Bhakkad [Tue, 24 May 2016 10:48:17 +0000 (24 10:48 +0000)]
Merging r260362:
------------------------------------------------------------------------
r260362 | mohit.bhakkad | 2016-02-10 12:28:13 +0530 (Wed, 10 Feb 2016) | 6 lines

[LLDB][MIPS] Generalise MIPS arch names
Patch by Nitesh Jain

Reviewers: clayborg, jaydeep.
Subscribers: zturner, bhushan, mohit.bhakkad, sagar, lldb-commits.
Differential Revision: http://reviews.llvm.org/D16840
------------------------------------------------------------------------

llvm-svn: 270544

6 years agoMerging r263218:
Mohit K. Bhakkad [Mon, 23 May 2016 08:30:41 +0000 (23 08:30 +0000)]
Merging r263218:
------------------------------------------------------------------------
r263218 | mohit.bhakkad | 2016-03-11 16:21:03 +0530 (Fri, 11 Mar 2016) | 7 lines

[Sanitizer][MIPS] internal lstat and fstat for mips64

Reviewers: dvyukov

Subscribers: jaydeep, sagar, llvm-commits

Differential Revision: http://reviews.llvm.org/D18078
------------------------------------------------------------------------

llvm-svn: 270407

6 years agoMerging r263001:
Mohit K. Bhakkad [Mon, 23 May 2016 08:24:51 +0000 (23 08:24 +0000)]
Merging r263001:
------------------------------------------------------------------------
r263001 | mohit.bhakkad | 2016-03-09 13:30:37 +0530 (Wed, 09 Mar 2016) | 7 lines

[DFSan] Fix test_inet_pton for big endian archs

Reviewers: samsonov

Subscribers: ed, jaydeep, sagar, llvm-commits

Differential Revision: http://reviews.llvm.org/D17751
------------------------------------------------------------------------

llvm-svn: 270406

6 years agoMerging r262303:
Mohit K. Bhakkad [Mon, 23 May 2016 08:21:21 +0000 (23 08:21 +0000)]
Merging r262303:
------------------------------------------------------------------------
r262303 | mohit.bhakkad | 2016-03-01 11:26:33 +0530 (Tue, 01 Mar 2016) | 7 lines

[Compiler-rt][MIPS] Correct Dynamic Thread Vector offset for MIPS

Reviewers: samsonov

Subscribers: dsanders, jaydeep, sagar, llvm-commits

Differential Revision: http://reviews.llvm.org/D17703
------------------------------------------------------------------------

llvm-svn: 270405

6 years agoMerging r262690:
Mohit K. Bhakkad [Mon, 23 May 2016 08:20:45 +0000 (23 08:20 +0000)]
Merging r262690:
------------------------------------------------------------------------
r262690 | mohit.bhakkad | 2016-03-04 11:45:59 +0530 (Fri, 04 Mar 2016) | 7 lines

[Compiler-rt][safestack] Enable for MIPS

Reviewers: samsonov

Subscribers: jaydeep, sagar, llvm-commits

Differential Revision: http://reviews.llvm.org/D17846
------------------------------------------------------------------------

llvm-svn: 270404

6 years agoMerging r262209:
Mohit K. Bhakkad [Mon, 23 May 2016 08:19:53 +0000 (23 08:19 +0000)]
Merging r262209:
------------------------------------------------------------------------
r262209 | mohit.bhakkad | 2016-02-29 13:52:55 +0530 (Mon, 29 Feb 2016) | 1 line

Update the link of issue
------------------------------------------------------------------------

llvm-svn: 270403

6 years agoMerging r262302:
Mohit K. Bhakkad [Mon, 23 May 2016 08:19:11 +0000 (23 08:19 +0000)]
Merging r262302:
------------------------------------------------------------------------
r262302 | mohit.bhakkad | 2016-03-01 11:23:30 +0530 (Tue, 01 Mar 2016) | 7 lines

[Compiler-rt][MSan] fix param_tls_limit test for platforms where big arguments are sliced in smaller ones

Reviewers: eugenis

Subscribers: dsanders, jaydeep, sagar, llvm-commits

Differential Revision: http://reviews.llvm.org/D17129
------------------------------------------------------------------------

llvm-svn: 270402

6 years agoMerging r261982:
Mohit K. Bhakkad [Mon, 23 May 2016 07:04:33 +0000 (23 07:04 +0000)]
Merging r261982:
------------------------------------------------------------------------
r261982 | mohit.bhakkad | 2016-02-26 12:14:10 +0530 (Fri, 26 Feb 2016) | 8 lines

[MSan] Endianness should not matter while printing a byte

Reviewers: eugenis

Subscribers: jaydeep, sagar, llvm-commits

Differential Revision: http://reviews.llvm.org/D17264
Differential Revision: http://reviews.llvm.org/D17563
------------------------------------------------------------------------

llvm-svn: 270400

6 years agoMerging r261837:
Mohit K. Bhakkad [Mon, 23 May 2016 07:03:45 +0000 (23 07:03 +0000)]
Merging r261837:
------------------------------------------------------------------------
r261837 | mohit.bhakkad | 2016-02-25 13:37:44 +0530 (Thu, 25 Feb 2016) | 7 lines

[Compiler-rt][MSan]Fix shmat testcase: Pass SHMLBA-alligned address to shmat

Reviewers: samsonov

Subscribers: jaydeep, sagar, llvm-commits

Differential Revision: http://reviews.llvm.org/D17262
------------------------------------------------------------------------

llvm-svn: 270399

6 years agoMerging r261723:
Mohit K. Bhakkad [Mon, 23 May 2016 07:02:26 +0000 (23 07:02 +0000)]
Merging r261723:
------------------------------------------------------------------------
r261723 | mohit.bhakkad | 2016-02-24 13:44:41 +0530 (Wed, 24 Feb 2016) | 7 lines

[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: 270398

6 years agoMerging r261721:
Mohit K. Bhakkad [Mon, 23 May 2016 07:00:54 +0000 (23 07:00 +0000)]
Merging r261721:
------------------------------------------------------------------------
r261721 | mohit.bhakkad | 2016-02-24 12:38:33 +0530 (Wed, 24 Feb 2016) | 7 lines

[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: 270397

6 years agoMerging r261513:
Mohit K. Bhakkad [Mon, 23 May 2016 06:55:35 +0000 (23 06:55 +0000)]
Merging r261513:
------------------------------------------------------------------------
r261513 | mohit.bhakkad | 2016-02-22 11:46:28 +0530 (Mon, 22 Feb 2016) | 7 lines

[MSan] Make unaligned load/store functions compatible for both endians

Reviewers: eugenis

Subscribers: jaydeep, sagar, llvm-commits

Differential Revision: http://reviews.llvm.org/D17371
------------------------------------------------------------------------

llvm-svn: 270396

6 years agoMerging r263199:
Daniel Sanders [Sun, 22 May 2016 14:18:22 +0000 (22 14:18 +0000)]
Merging r263199:
------------------------------------------------------------------------
r263199 | mohit.bhakkad | 2016-03-11 05:57:20 +0000 (Fri, 11 Mar 2016) | 7 lines

[Compiler-rt] Fix ioctl codes for MIPS in sanitizer_ioctl_test

Reviewers: samsonov

Subscribers: jaydeep, sagar, llvm-commits

Differential Revision: http://reviews.llvm.org/D17985
------------------------------------------------------------------------

llvm-svn: 270362

6 years agoMerging r263000:
Daniel Sanders [Sun, 22 May 2016 14:17:10 +0000 (22 14:17 +0000)]
Merging r263000:
------------------------------------------------------------------------
r263000 | mohit.bhakkad | 2016-03-09 07:57:20 +0000 (Wed, 09 Mar 2016) | 7 lines

[Compiler-rt][MIPS] Defining macros for MIPS archs

Reviewers: samsonov

Subscribers: filcab, jaydeep, sagar, llvm-commits

Differential Revision: http://reviews.llvm.org/D17881
------------------------------------------------------------------------

llvm-svn: 270361

6 years agoMerging r262581:
Daniel Sanders [Sun, 22 May 2016 14:14:59 +0000 (22 14:14 +0000)]
Merging r262581:
------------------------------------------------------------------------
r262581 | mohit.bhakkad | 2016-03-03 05:05:20 +0000 (Thu, 03 Mar 2016) | 7 lines

[LSan] Enable use_registers test for MIPS

Reviewers: samsonov

Subscribers: jaydeep, sagar, llvm-commits

Differential Revision: http://reviews.llvm.org/D17797
------------------------------------------------------------------------

llvm-svn: 270360

6 years agoMerging r269676:
Michael Kuperstein [Thu, 19 May 2016 22:07:45 +0000 (19 22:07 +0000)]
Merging r269676:

------------------------------------------------------------------------
r269676 | mkuper | 2016-05-16 11:27:00 -0700 (Mon, 16 May 2016) | 14 lines

[X86] Remove transformVSELECTtoBlendVECTOR_SHUFFLE

The new X86 shuffle lowering can do just fine without transforming vselects
into vector_shuffles. It looks like the only thing this code does right now
is cause trouble - in particular, it can lead to combine/legalization infinite
loops.

Note that it's not completely NFC, since some of the shuffle masks get inverted,
which may cause slight differences further down the line. We may want to find
a way to invert those masks, but that's orthogonal to this commit.

This fixes the hang in PR27689.

------------------------------------------------------------------------

llvm-svn: 270146

6 years agoUse absolute module path when possible if sent in svr4 packets
Francis Ricci [Thu, 19 May 2016 21:11:37 +0000 (19 21:11 +0000)]
Use absolute module path when possible if sent in svr4 packets

Summary:
If the remote uses svr4 packets to communicate library info,
the LoadUnload tests will fail, as lldb only used the basename
for modules, causing problems when two modules have the same basename.

Using absolute path as sent by the remote will ensure that lldb
locates the module from the correct directory when there are overlapping
basenames. When debugging a remote process, LoadModuleAtAddress will still
fall back to using basename and module_search_paths, so we don't
need to worry about using absolute paths in this case.

Reviewers: ADodds, jasonmolenda, clayborg, ovyalov

Subscribers: lldb-commits, sas

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

This is a cherry-pick of r267741

llvm-svn: 270140

6 years agoFixed the failing test TestCommandScriptImmediateOutput on MacOSX. Turns out that...
Francis Ricci [Thu, 19 May 2016 21:09:04 +0000 (19 21:09 +0000)]
Fixed the failing test TestCommandScriptImmediateOutput on MacOSX. Turns out that there are few things to watch out for when writing pexpect tests:

1 - If you plan on looking for the "(lldb) " prompt as a regular expression, look for "\(lldb\) " so you don't just find "lldb".
2 - Make sure to not use colors (specify --no-use-colors as an option to lldb when launching it) as our editline will print:

"(lldb) <color junk>(lldb) "

where "<color junk>" is a work around that is used to allow us to colorize our prompts. The bad thing is this will make pexepct code like this not execute as you would expect:

prompt = "\(lldb\) "
self.child.sendline("breakpoint set ...", prompt)
self.child.sendline("breakpoint clear ...", prompt)

The problem is the first "sendline" will create two lldb prompts and will match both the first and second prompts and you output will get off. So be sure to disable colors if you need to.

Fixed a case where "TestCommandScriptImmediateOutput.py" would fail if you have spaces in your directory names. I modified custom_command.py to use shlex to parse arguments and I quoted the file path we sent down to the custom_command.write_file function.

Author:    Greg Clayton <gclayton@apple.com>
Date:      Wed Mar 30 00:02:13 2016 +0000

This is a cherry-pick of r264810

llvm-svn: 270138

6 years agoMaintain register numbering across xml include features
Francis Ricci [Thu, 19 May 2016 21:05:57 +0000 (19 21:05 +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

This is a cherry-pick of 267468

llvm-svn: 270134

6 years agoProperly unload modules from target image list when using svr4 packets
Francis Ricci [Thu, 19 May 2016 21:04:16 +0000 (19 21:04 +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

This is a cherry-pick of 267467

llvm-svn: 270133

6 years agoUse Process Plugin register indices when communicating with remote
Francis Ricci [Thu, 19 May 2016 21:03:40 +0000 (19 21:03 +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

This is a cherry-pick of r267466

llvm-svn: 270132

6 years agoStore absolute path for lldb executable in dotest.py
Francis Ricci [Thu, 19 May 2016 21:02:55 +0000 (19 21:02 +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

This is a cherry-pick of r267463

llvm-svn: 270131

6 years agoCreate _lldb python symlink correctly when LLVM_LIBDIR_SUFFIX is used
Francis Ricci [Thu, 19 May 2016 21:02:17 +0000 (19 21:02 +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

This is a cherry-pick of r267462

llvm-svn: 270130

6 years agoFix dotest.py '-p' option for multi-process mode
Francis Ricci [Thu, 19 May 2016 21:01:31 +0000 (19 21:01 +0000)]
Fix dotest.py '-p' option for multi-process mode

Summary:
The '-p' option for dotest.py was ignored in multiprocess mode,
as the -p argument to the inferior would overwrite the -p argument
passed on the command line.

Reviewers: zturner, tfiala

Subscribers: lldb-commits, sas

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

Change by Francis Ricci <fjricci@fb.com>

This is a cherry-pick of r265422

llvm-svn: 270129

6 years agoPrint environment when dumping arch triple
Francis Ricci [Thu, 19 May 2016 21:00:01 +0000 (19 21:00 +0000)]
Print environment when dumping arch triple

Summary: Print environment from triple if it exists.

Reviewers: tfiala, clayborg

Subscribers: lldb-commits, sas

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

Change by Francis Ricci <fjricci@fb.com>

This is a cherry-pick of r265420

llvm-svn: 270127

6 years agoMake sure to update Target arch if environment changed
Francis Ricci [Thu, 19 May 2016 20:57:34 +0000 (19 20:57 +0000)]
Make sure to update Target arch if environment changed

Summary: Fixes "target list" for non-android linux platforms (ie gnu, gnueabi)

Reviewers: jasonmolenda, tfiala, clayborg, tberghammer

Subscribers: tberghammer, danalbert, lldb-commits, sas

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

Change by Francis Ricci <fjricci@fb.com>

This is a cherry-pick of r265419

llvm-svn: 270126

6 years agoAllow gdbremote process to read modules from memory
Francis Ricci [Thu, 19 May 2016 20:55:51 +0000 (19 20:55 +0000)]
Allow gdbremote process to read modules from memory

Summary:
The logic to read modules from memory was added to LoadModuleAtAddress
in the dynamic loader, but not in process gdb remote. This means that when
the remote uses svr4 packets to give library info, libraries only present
on the remote will not be loaded.

This patch therefore involves some code duplication from LoadModuleAtAddress
in the dynamic loader, but removing this would require some amount of code
refactoring.

Reviewers: ADodds, tberghammer, tfiala, deepak2427, ted

Subscribers: tfiala, lldb-commits, sas

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

Change by Francis Ricci <fjricci@fb.com>

This is a cherry-pick of r265418

llvm-svn: 270125

6 years agoMake File option flags consistent for Python API
Francis Ricci [Thu, 19 May 2016 20:52:14 +0000 (19 20:52 +0000)]
Make File option flags consistent for Python API

Summary:
Fixes SBCommandReturnObject::SetImmediateOutputFile() and
SBCommandReturnObject::SetImmediateOutputFile() for files opened
with "a" or "a+" by resolving inconsistencies between File and
our Python parsing of file objects.

Reviewers: granata.enrico, Eugene.Zelenko, jingham, clayborg

Subscribers: lldb-commits, sas

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

Change by Francis Ricci <fjricci@fb.com>

This is a cherry-pick of r264351

llvm-svn: 270123