platform/upstream/llvm.git
9 years agoFix test/COFF/dll.test after r242342.
Nico Weber [Thu, 16 Jul 2015 16:45:01 +0000 (16:45 +0000)]
Fix test/COFF/dll.test after r242342.

r242342 removed the RUN line that wrote t2.obj, but another RUN line further
down still reads t2.obj, so add it back.

llvm-svn: 242415

9 years agoMake ExecutionEngine owning a DataLayout
Mehdi Amini [Thu, 16 Jul 2015 16:34:23 +0000 (16:34 +0000)]
Make ExecutionEngine owning a DataLayout

Summary:
This change is part of a series of commits dedicated to have a single
DataLayout during compilation by using always the one owned by the
module.

The ExecutionEngine will act as an exception and will be unsafe to
be reused across context. We don't enforce this rule but undefined
behavior can occurs if the user tries to do it.

Reviewers: lhames

Subscribers: echristo, llvm-commits, rafael, yaron.keren

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

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

9 years agoCorrect lowering of memmove in NVPTX
Eli Bendersky [Thu, 16 Jul 2015 16:27:19 +0000 (16:27 +0000)]
Correct lowering of memmove in NVPTX

This fixes https://llvm.org/bugs/show_bug.cgi?id=24056

Also a bit of refactoring along the way.

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

llvm-svn: 242413

9 years agoAMDGPU/R600: Remove unused variable
Tom Stellard [Thu, 16 Jul 2015 16:13:34 +0000 (16:13 +0000)]
AMDGPU/R600: Remove unused variable

This fixes a warning introduced by r242410.

llvm-svn: 242412

9 years agoAMDPGU/R600: Replace llvm_unreachable() call with LLVMContext::emitError()
Tom Stellard [Thu, 16 Jul 2015 15:38:29 +0000 (15:38 +0000)]
AMDPGU/R600: Replace llvm_unreachable() call with LLVMContext::emitError()

Summary:
This fixes an issue on MIPS where the infinite-loop-evergreen.ll test
was failing to terminate.

Fixes PR24147.

Reviewers: arsenm, dsanders

Subscribers: llvm-commits

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

llvm-svn: 242410

9 years ago[Codegen] Add intrinsics 'absdiff' and corresponding SDNodes for absolute difference...
James Molloy [Thu, 16 Jul 2015 15:22:46 +0000 (15:22 +0000)]
[Codegen] Add intrinsics 'absdiff' and corresponding SDNodes for absolute difference operation

This adds new intrinsics "*absdiff" for absolute difference ops to facilitate efficient code generation for "sum of absolute differences" operation.
The patch also contains the introduction of corresponding SDNodes and basic legalization support.Sanity of the generated code is tested on X86.

This is 1st of the three patches.

Patch by Shahid Asghar-ahmad!

llvm-svn: 242409

9 years ago- TargetParser does not handle armv7l in parseArchProfile().
Alexandros Lamprineas [Thu, 16 Jul 2015 14:54:41 +0000 (14:54 +0000)]
- TargetParser does not handle armv7l in parseArchProfile().
- ARM V7L matches the 'A' profile of ARM architecture.

Change-Id: I80c8b973f5c93fb040c177a227644d56b1b83ea8
Phabricator: http://reviews.llvm.org/D11261
llvm-svn: 242406

9 years agoclang-format: [Proto] Handle enum bodies differently.
Daniel Jasper [Thu, 16 Jul 2015 14:25:43 +0000 (14:25 +0000)]
clang-format: [Proto] Handle enum bodies differently.

In proto, enum constants can contain complex options and should be
handled more like individual declarations.

Before:
  enum Type {
    UNKNOWN = 0 [(some_options) =
                     {
                       a: aa,
                       b: bb
                     }];
  };

After:
  enum Type {
    UNKNOWN = 0 [(some_options) = {
      a: aa,
      b: bb
    }];
  };

llvm-svn: 242404

9 years agoFix compiler warning in ThreadPlanStepRange
Pavel Labath [Thu, 16 Jul 2015 14:21:49 +0000 (14:21 +0000)]
Fix compiler warning in ThreadPlanStepRange

llvm-svn: 242403

9 years agoAdd jThreadsInfo support to lldb-server
Pavel Labath [Thu, 16 Jul 2015 14:14:35 +0000 (14:14 +0000)]
Add jThreadsInfo support to lldb-server

Summary:
This commit adds initial support for the jThreadsInfo packet to lldb-server. The current
implementation does not expedite inferior memory.  I have also added a description of the new
packet to our protocol documentation (mostly taken from Greg's earlier commit message).

Reviewers: clayborg, ovyalov, tberghammer

Subscribers: lldb-commits

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

llvm-svn: 242402

9 years agoRevert "Default to linking lldb-server statically for Android."
Tamas Berghammer [Thu, 16 Jul 2015 14:13:01 +0000 (14:13 +0000)]
Revert "Default to linking lldb-server statically for Android."

With static linking lldb-server crashes in platform mode when
tries to listen on localhost:5432 on the android build bot.

This reverts commit 3ea861707dec8423746679ff496e4fd03255d4cf.

llvm-svn: 242401

9 years agoFix memcheck interval ends for pointers with negative strides
Silviu Baranga [Thu, 16 Jul 2015 14:02:58 +0000 (14:02 +0000)]
Fix memcheck interval ends for pointers with negative strides

Summary:
The checking pointer grouping algorithm assumes that the
starts/ends of the pointers are well formed (start <= end).

The runtime memory checking algorithm also assumes this by doing:

 start0 < end1 && start1 < end0

to detect conflicts. This check only works if start0 <= end0 and
start1 <= end1.

This change correctly orders the interval ends by either checking
the stride (if it is constant) or by using min/max SCEV expressions.

Reviewers: anemet, rengolin

Subscribers: rengolin, llvm-commits

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

llvm-svn: 242400

9 years ago[X86] Test for r242395 (Fix emitPrologue() to make less assumptions about pushes)
Michael Kuperstein [Thu, 16 Jul 2015 13:55:39 +0000 (13:55 +0000)]
[X86] Test for r242395 (Fix emitPrologue() to make less assumptions about pushes)

llvm-svn: 242399

9 years ago[X86] Reapply r240257 : "Allow more call sequences to use push instructions for argum...
Michael Kuperstein [Thu, 16 Jul 2015 13:54:14 +0000 (13:54 +0000)]
[X86] Reapply r240257 : "Allow more call sequences to use push instructions for argument passing"

This allows more call sequences to use pushes instead of movs when optimizing for size.
In particular, calling conventions that pass some parameters in registers (e.g. thiscall) are now supported.

This should no longer cause miscompiles, now that a bug in emitPrologue was fixed in r242395.

llvm-svn: 242398

9 years agoFix compiler warning in ArchSpec
Pavel Labath [Thu, 16 Jul 2015 13:11:34 +0000 (13:11 +0000)]
Fix compiler warning in ArchSpec

llvm-svn: 242397

9 years agoAdd missing include for android-arm build
Tamas Berghammer [Thu, 16 Jul 2015 12:35:04 +0000 (12:35 +0000)]
Add missing include for android-arm build

llvm-svn: 242396

9 years ago[X86] Fix emitPrologue() to make less assumptions about pushes
Michael Kuperstein [Thu, 16 Jul 2015 12:27:59 +0000 (12:27 +0000)]
[X86] Fix emitPrologue() to make less assumptions about pushes

When X86FrameLowering::emitPrologue() looks for where to insert the %esp subtraction
to allocate stack space for local allocations, it assumes that any sequence of push
instructions that starts at function entry consists purely of spills of callee-save
registers.
This may be false, since from some point forward, the pushes may pushing arguments
to a subsequent function call.

This caused a miscompile that was exposed by r240257, and is not easily testable
since r240257 was reverted. A test will be committed separately after r240257 is
reapplied.

llvm-svn: 242395

9 years agoRevert "Make ExecutionEngine owning a DataLayout"
Michael Kuperstein [Thu, 16 Jul 2015 12:20:31 +0000 (12:20 +0000)]
Revert "Make ExecutionEngine owning a DataLayout"

Reverting to fix buildbot breakage.

This reverts commit r242387.

llvm-svn: 242394

9 years ago[Mips] Make helper function static, NFC.
Benjamin Kramer [Thu, 16 Jul 2015 11:12:05 +0000 (11:12 +0000)]
[Mips] Make helper function static, NFC.

llvm-svn: 242393

9 years agoImprove XFAIL for test_lldb_process_load_and_unload_commands
Tamas Berghammer [Thu, 16 Jul 2015 10:00:06 +0000 (10:00 +0000)]
Improve XFAIL for test_lldb_process_load_and_unload_commands

llvm-svn: 242392

9 years agoRevert "[NativeProcessLinux] Integrate MainLoop"
Pavel Labath [Thu, 16 Jul 2015 08:45:03 +0000 (08:45 +0000)]
Revert "[NativeProcessLinux] Integrate MainLoop"

This seems to be causing major slowdows on the android buildbot. Reverting while I investigate.

llvm-svn: 242391

9 years agoAdd option to choose where in the pass pipeline polly is run
Tobias Grosser [Thu, 16 Jul 2015 08:28:09 +0000 (08:28 +0000)]
Add option to choose where in the pass pipeline polly is run

These options are useful to play with the location of Polly within LLVM's
pass manager.

llvm-svn: 242390

9 years agoAdd PM extension point EP_VectorizerStart
Tobias Grosser [Thu, 16 Jul 2015 08:20:37 +0000 (08:20 +0000)]
Add PM extension point EP_VectorizerStart

This extension point allows passes to be executed right before the vectorizer
and other highly target specific optimizations are run.

llvm-svn: 242389

9 years agoAdd missing break in switch case in R600ISelLowering
Mehdi Amini [Thu, 16 Jul 2015 06:23:12 +0000 (06:23 +0000)]
Add missing break in switch case in R600ISelLowering

Summary: Catched by coverity.

Reviewers: arsenm

Subscribers: llvm-commits

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

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

9 years agoMake ExecutionEngine owning a DataLayout
Mehdi Amini [Thu, 16 Jul 2015 06:17:14 +0000 (06:17 +0000)]
Make ExecutionEngine owning a DataLayout

Summary:
This change is part of a series of commits dedicated to have a single
DataLayout during compilation by using always the one owned by the
module.

The ExecutionEngine will act as an exception and will be unsafe to
be reused across context. We don't enforce this rule but undefined
behavior can occurs if the user tries to do it.

Reviewers: lhames

Subscribers: echristo, llvm-commits, rafael, yaron.keren

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

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

9 years agoMove most user of TargetMachine::getDataLayout to the Module one
Mehdi Amini [Thu, 16 Jul 2015 06:11:10 +0000 (06:11 +0000)]
Move most user of TargetMachine::getDataLayout to the Module one

Summary:
This change is part of a series of commits dedicated to have a single
DataLayout during compilation by using always the one owned by the
module.

This patch is quite boring overall, except for some uglyness in
ASMPrinter which has a getDataLayout function but has some clients
that use it without a Module (llmv-dsymutil, llvm-dwarfdump), so
some methods are taking a DataLayout as parameter.

Reviewers: echristo

Subscribers: yaron.keren, rafael, llvm-commits, jholewinski

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

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

9 years agoRemove DataLayout from TargetLoweringObjectFile, redirect to Module
Mehdi Amini [Thu, 16 Jul 2015 06:04:17 +0000 (06:04 +0000)]
Remove DataLayout from TargetLoweringObjectFile, redirect to Module

Summary:
This change is part of a series of commits dedicated to have a single
DataLayout during compilation by using always the one owned by the
module.

Reviewers: echristo

Subscribers: yaron.keren, rafael, llvm-commits, jholewinski

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

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

9 years agoRedirect pointerSize query to the TargetMachine in ASMPrinter
Mehdi Amini [Thu, 16 Jul 2015 05:59:25 +0000 (05:59 +0000)]
Redirect pointerSize query to the TargetMachine in ASMPrinter

Summary:
Because llvm-dsymutil is using ASMPrinter without any MachineFunction
of Module available.

This change is part of a series of commits dedicated to have a single
DataLayout during compilation by using always the one owned by the
module.

Reviewers: echristo

Subscribers: yaron.keren, rafael, llvm-commits

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

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

9 years agoActually "RUN:" the tests...
Filipe Cabecinhas [Thu, 16 Jul 2015 05:22:17 +0000 (05:22 +0000)]
Actually "RUN:" the tests...

llvm-svn: 242383

9 years ago[OPENMP] Fixed detection of canonical loops with random access iterators.
Alexey Bataev [Thu, 16 Jul 2015 04:19:43 +0000 (04:19 +0000)]
[OPENMP] Fixed detection of canonical loops with random access iterators.

Add handling of iterators with copy/move constructors with default arguments + converting template constructors.

llvm-svn: 242382

9 years ago[LLDB][MIPS] Detect MIPS application specific extensions like micromips
Jaydeep Patil [Thu, 16 Jul 2015 03:51:55 +0000 (03:51 +0000)]
[LLDB][MIPS] Detect MIPS application specific extensions like micromips
    SUMMARY:
    The patch detects MIPS application specific extensions (ASE) like micromips by reading
    ELF header.e_flags and SHT_MIPS_ABIFLAGS section. MIPS triple does not contain ASE
    information like micromips, mips16, DSP, MSA etc. These can be read from header.e_flags
    or SHT_MIPS_ABIFLAGS section.

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

llvm-svn: 242381

9 years agoOnly include the stack memory for the caller stack
Jason Molenda [Thu, 16 Jul 2015 03:42:40 +0000 (03:42 +0000)]
Only include the stack memory for the caller stack
frame, don't go any further, in RNBRemote::SendStopReplyPacketForThread.

These are the memory pre-fetches in the T05 packet and are
included in every private stop that lldb does.  lldb needs, at most,
the caller stack frame so we're sending more data than needed by
including additional stack memory prefetches in this reply packet.

Once we've stopped for a public stop, we're going to do a jThreadsInfo
which will include the stack memory prefetches for all threads,
including the one which had the stop reason.

llvm-svn: 242380

9 years agoBuild ValueObjectConstResultCast.cpp.
Jason Molenda [Thu, 16 Jul 2015 03:38:17 +0000 (03:38 +0000)]
Build ValueObjectConstResultCast.cpp.

llvm-svn: 242379

9 years ago[Intrin.h] Use compiler builtins to model memory barriers
David Majnemer [Thu, 16 Jul 2015 03:13:02 +0000 (03:13 +0000)]
[Intrin.h] Use compiler builtins to model memory barriers

_ReadBarrier, _WriteBarrier, and _ReadWriteBarrier are essentially
memory barriers of one form or another.  Model these as
atomic_signal_fence(ATOMIC_SEQ_CST).

__faststorefence is a curious intrinsic.  It's single purpose seems to
an alternative to mfence when that instruction is slow.  However, mfence
is not always slow and is, in general, preferable to a 'lock or'
sequence on certain CPUs.  Give the compiler freedom to select the best
sequence to get a fence.

llvm-svn: 242378

9 years agoMake sure that __libcpp_compressed_pair_imp default-constructs its' members, rather...
Marshall Clow [Thu, 16 Jul 2015 03:05:06 +0000 (03:05 +0000)]
Make sure that __libcpp_compressed_pair_imp default-constructs its' members, rather than value-initializing them. Fixes PR#24137

llvm-svn: 242377

9 years ago[LAA] Split out a helper to check the pointer partitions, NFC
Adam Nemet [Thu, 16 Jul 2015 02:48:05 +0000 (02:48 +0000)]
[LAA] Split out a helper to check the pointer partitions, NFC

This is made a static public member function to allow the transition of
this logic from LAA to LoopDistribution.  (Technically, it could be an
implementation-local static function but then it would not be accessible
from LoopDistribution.)

llvm-svn: 242376

9 years agoMark two tests as failing on clang 3.8 (they failed on 3.7, too)
Marshall Clow [Thu, 16 Jul 2015 02:44:33 +0000 (02:44 +0000)]
Mark two tests as failing on clang 3.8 (they failed on 3.7, too)

llvm-svn: 242375

9 years agoAdd a class ValueObjectConstResultCast.
Siva Chandra [Thu, 16 Jul 2015 01:47:12 +0000 (01:47 +0000)]
Add a class ValueObjectConstResultCast.

Summary:
Other changes around the main change include:

1. Add a method Cast to ValueObjectConstResult, ValueObjectConstResultImpl
and ValueObjectConstResultChild.

2. Add an argument |live_address| of type lldb::addr_t to the constructor
of ValueObjectConstResultChild. This is passed on to the backing
ValueObjectConstResultImpl object constructor so that the address of the
child value can be calculated properly.

Reviewers: granata.enrico, clayborg

Subscribers: lldb-commits

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

llvm-svn: 242374

9 years agoRevert "[X86] Allow more call sequences to use push instructions for argument passing"
Reid Kleckner [Thu, 16 Jul 2015 01:30:00 +0000 (01:30 +0000)]
Revert "[X86] Allow more call sequences to use push instructions for argument passing"

It miscompiles some code and a reduced test case has been sent to the
author.

This reverts commit r240257.

llvm-svn: 242373

9 years agoRevert "Update LLVM bindings after r239940. ..."
Reid Kleckner [Thu, 16 Jul 2015 01:16:39 +0000 (01:16 +0000)]
Revert "Update LLVM bindings after r239940. ..."

Revert the changes to the C API LLVMBuildLandingPad that were part of
the personality function move. We now set the personality on the parent
function when the C API attempts to construct a landingpad with a
personality.

This reverts commit r240010.

llvm-svn: 242372

9 years agoPR10405 - Desugar FunctionType and TemplateSpecializationType if any type that appear...
Nikola Smiljanic [Thu, 16 Jul 2015 01:06:17 +0000 (01:06 +0000)]
PR10405 - Desugar FunctionType and TemplateSpecializationType if any type that appears inside needs to be desugared.

llvm-svn: 242371

9 years agoFix broken testcase from r242358.
Alex Lorenz [Thu, 16 Jul 2015 00:58:33 +0000 (00:58 +0000)]
Fix broken testcase from r242358.

The testcase failed on non X86 targets, because I forgot to pass the
'-march=x86-64' option into llc for one of the X86 specific tests.

llvm-svn: 242370

9 years ago[ARM] Define a subtarget feature that is used to avoid using movt/movw
Akira Hatanaka [Thu, 16 Jul 2015 00:58:23 +0000 (00:58 +0000)]
[ARM] Define a subtarget feature that is used to avoid using movt/movw
pairs for 32-bit immediates.

This change is needed to avoid emitting movt/movw pairs when doing LTO
and do so on a per-function basis.

Out-of-tree projects currently using cl::opt option -arm-use-movt=0 or
false to avoid emitting movt/movw pairs should make changes to add
subtarget feature "+no-movt" (see the changes made to clang in r242368).

rdar://problem/21529937

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

llvm-svn: 242369

9 years ago[ARM] Pass subtarget feature "+no-movt" instead of passing backend option
Akira Hatanaka [Thu, 16 Jul 2015 00:43:00 +0000 (00:43 +0000)]
[ARM] Pass subtarget feature "+no-movt" instead of passing backend option
"-arm-use-movt=0".

This change is needed since backend options do not make it to the backend
when doing LTO and are not capable of changing the behavior of code-gen
passes on a per-function basis.

rdar://problem/21529937

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

llvm-svn: 242368

9 years agoTrying to fix the windows bots.
Rafael Espindola [Thu, 16 Jul 2015 00:38:34 +0000 (00:38 +0000)]
Trying to fix the windows bots.

llvm-svn: 242367

9 years agoRevert r242365.
Evgeniy Stepanov [Thu, 16 Jul 2015 00:32:26 +0000 (00:32 +0000)]
Revert r242365.

r242365 removed two unrelated files by accident.

llvm-svn: 242366

9 years agoupdated tests for correct commit, concerning D11198
Naomi Musgrave [Thu, 16 Jul 2015 00:25:46 +0000 (00:25 +0000)]
updated tests for correct commit, concerning D11198

Summary: Updating missed changes in revision D11198

Reviewers: eugenis, kcc

Subscribers: cfe-commits

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

llvm-svn: 242365

9 years agoupdated tests for correct commit
Naomi Musgrave [Thu, 16 Jul 2015 00:25:45 +0000 (00:25 +0000)]
updated tests for correct commit

llvm-svn: 242364

9 years ago[CMake] Revisit PR23539: allow to override SANITIZER_MIN_OSX_VERSION at configure...
Alexey Samsonov [Thu, 16 Jul 2015 00:20:50 +0000 (00:20 +0000)]
[CMake] Revisit PR23539: allow to override SANITIZER_MIN_OSX_VERSION at configure time.

Some users may need to configure Clang/compiler-rt with
-DMACOSX_DEPLOYMENT_TARGET=10.6, as they expect Clang to produce working
(non-sanitized) binaries on 10.6. In this case they would need to
additionally provide -DSANITIZER_MIN_OSX_VERSION=10.7 to mark
that sanitizer runtimes may only be used on 10.7+ (where they are
supported).

llvm-svn: 242363

9 years agoFix handling of relative paths in thin archives.
Rafael Espindola [Thu, 16 Jul 2015 00:14:49 +0000 (00:14 +0000)]
Fix handling of relative paths in thin archives.

The member has to end up with a path relative to the archive.

llvm-svn: 242362

9 years agoClear kill flags in ARMLoadStoreOptimizer.
Pete Cooper [Thu, 16 Jul 2015 00:09:18 +0000 (00:09 +0000)]
Clear kill flags in ARMLoadStoreOptimizer.

The pass here was clearing kill flags on instructions which had
their sources killed in the instruction being combined.  But
given that the new instruction is inserted after the existing ones,
any existing instructions with kill flags will lead to the verifier
complaining that we are reading an undefined physreg.

For example, what we had prior to this optimization is
t2STRi12 %R1, %SP, 12
t2STRi12 %R1<kill>, %SP, 16
t2STRi12 %R0<kill>, %SP, 8

and prior to this fix that would generate
t2STRi12 %R1<kill>, %SP, 16
t2STRDi8 %R0<kill>, %R1, %SP, 8

This is clearly incorrect as it didn't clear the kill flag on R1
used with offset 16 because there was no kill flag on the instruction
with offset 12.

After this change we clear the kill flag on the offset 16 instruction
because we know it will be used afterwards in the new instruction.

I haven't provided a test case.  I have a small test, but even it is
very sensitive to register allocation order which isn't ideal.

llvm-svn: 242359

9 years agoMIR Serialization: Serialize the jump table index operands.
Alex Lorenz [Wed, 15 Jul 2015 23:38:35 +0000 (23:38 +0000)]
MIR Serialization: Serialize the jump table index operands.

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

9 years agoMIR Serialization: Serialize the jump table info.
Alex Lorenz [Wed, 15 Jul 2015 23:31:07 +0000 (23:31 +0000)]
MIR Serialization: Serialize the jump table info.

The jump table info is serialized using a YAML mapping that contains its kind
and a YAML sequence of jump table entries. A jump table entry is a YAML mapping
that has an ID and an inline YAML sequence of machine basic block references.

The testcase 'CodeGen/MIR/X86/jump-table-info.mir' doesn't have any instructions
because one of them contains a jump table index operand. The jump table index
operands will be serialized in a follow up patch, and the appropriate
instructions will be added to this testcase.

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

9 years agoAdd a test for r242281 from an old patch of mine.
Sean Silva [Wed, 15 Jul 2015 23:23:02 +0000 (23:23 +0000)]
Add a test for r242281 from an old patch of mine.

This isn't thorough, but should serve as a sanity check.

llvm-svn: 242356

9 years agoRemove a private member of BranchProbabilityInfo which is not used at all.
Cong Hou [Wed, 15 Jul 2015 23:20:34 +0000 (23:20 +0000)]
Remove a private member of BranchProbabilityInfo which is not used at all.

The member to be removed is LoopInfo *LI.

llvm-svn: 242355

9 years agollvm-ar: Don't write the directory in the string table.
Rafael Espindola [Wed, 15 Jul 2015 23:15:33 +0000 (23:15 +0000)]
llvm-ar: Don't write the directory in the string table.

We were already doing the right thing for short file names, but not long
ones.

llvm-svn: 242354

9 years agoCOFF: Fix offset in x86 delay-load thunks.
Rui Ueyama [Wed, 15 Jul 2015 23:01:36 +0000 (23:01 +0000)]
COFF: Fix offset in x86 delay-load thunks.

llvm-svn: 242353

9 years agoAdded the ability to get JSON thread stop info with thread ID and stop info only...
Greg Clayton [Wed, 15 Jul 2015 22:59:03 +0000 (22:59 +0000)]
Added the ability to get JSON thread stop info with thread ID and stop info only in the normal stop reply packets using the new "jthreads" key value pair.

This allows stepping operations that don't ever do a public stop to get all the info they need without having to send a jThreadsInfo packet since those tend to be large.

This patch will be followed by a patch that will detect when we do a public stop, and when that happens we will send a jThreadsInfo packet at that time to get all expedited registers and memory.

llvm-svn: 242352

9 years agoadding tests for various dtor decl types
Naomi Musgrave [Wed, 15 Jul 2015 22:57:10 +0000 (22:57 +0000)]
adding tests for various dtor decl types

Reviewers: eugenis, kcc

Subscribers: cfe-commits

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

llvm-svn: 242351

9 years ago[probile] Fix memory leak introduced in r241824.
Alexey Samsonov [Wed, 15 Jul 2015 22:50:39 +0000 (22:50 +0000)]
[probile] Fix memory leak introduced in r241824.

llvm-svn: 242350

9 years agoCreate a wrapper pass for BranchProbabilityInfo.
Cong Hou [Wed, 15 Jul 2015 22:48:29 +0000 (22:48 +0000)]
Create a wrapper pass for BranchProbabilityInfo.

This new wrapper pass is useful when we want to do branch probability analysis conditionally (e.g. only in PGO mode) but don't want to add one more pass dependence.

http://reviews.llvm.org/D11241

llvm-svn: 242349

9 years agoSilence GCC -Wparenthesis warning
David Majnemer [Wed, 15 Jul 2015 22:48:26 +0000 (22:48 +0000)]
Silence GCC -Wparenthesis warning

llvm-svn: 242348

9 years agoFor new archive member we only need to store the full path.
Rafael Espindola [Wed, 15 Jul 2015 22:46:53 +0000 (22:46 +0000)]
For new archive member we only need to store the full path.

We were storing both the path and the file name, which was redundant
and easy to get confused up with.

llvm-svn: 242347

9 years ago[clang-cl] Use the Windows response file tokenizer
Reid Kleckner [Wed, 15 Jul 2015 22:42:37 +0000 (22:42 +0000)]
[clang-cl] Use the Windows response file tokenizer

We were still using the Unix response file tokenizer for all driver
modes. This was difficult to get right in the beginning because there is
a circular dependency. The Driver class also can't officially determine
its mode until it can see all possible --driver-mode= flags, and those
flags could come from the response file.

Now we use the Windows parsing algorithm if the program name looks like
clang-cl, or if the --driver-mode=cl flag is present on the main command
line.

Fixes PR23709.

Reviewers: hans

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

llvm-svn: 242346

9 years ago[LoopUnswitch] Add an else clause to IsTrivialUnswitchCondition() when checking Heade...
Chen Li [Wed, 15 Jul 2015 22:41:13 +0000 (22:41 +0000)]
[LoopUnswitch] Add an else clause to IsTrivialUnswitchCondition() when checking HeaderTerm instruction type

Summary:
This is a trivial code change with no functionality effect.

When LoopUnswitch determines trivial unswitch condition, it checks whether the loop header's terminator instruction is a branch instruction or switch instruction since trivial unswitch condition can only apply to these two instruction types. The current code does not fail the check directly on other instruction types, but check the nullness of LoopExitBB variable instead. The added else clause makes the check fail immediately on other instruction types and makes the code more obvious.

Reviewers: reames

Subscribers: llvm-commits

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

llvm-svn: 242345

9 years ago[Makefiles] One more library rename to align with CMake
Keno Fischer [Wed, 15 Jul 2015 22:39:44 +0000 (22:39 +0000)]
[Makefiles] One more library rename to align with CMake

This one I accidentally missed last time because I confused it with
the lldbUtility library. After this, all makefile libraries should
have the same names as their CMake counterparts.

llvm-svn: 242344

9 years agoCOFF: Implement x86 delay-load thunks.
Rui Ueyama [Wed, 15 Jul 2015 22:26:57 +0000 (22:26 +0000)]
COFF: Implement x86 delay-load thunks.

llvm-svn: 242343

9 years agoCOFF: Fix mangled dllexported names.
Rui Ueyama [Wed, 15 Jul 2015 22:21:08 +0000 (22:21 +0000)]
COFF: Fix mangled dllexported names.

If a symbol is exported as /export:foo, and foo is resolved as a
mangled name (_foo@<number> or ?foo@@Y...), that mangled name should
be written to the export table. Previously, we wrote the original
name to the export table.

llvm-svn: 242342

9 years agotest-release.sh: Run both .o files through sed before comparing them
Hans Wennborg [Wed, 15 Jul 2015 22:18:25 +0000 (22:18 +0000)]
test-release.sh: Run both .o files through sed before comparing them

On some systems (e.g. Mac OS X), sed will add a newline to the end of
the output if there wasn't one already. This would cause false
cmp errors since the .o file from Phase 2 was passed through sed and
the one from Phase 3 wasn't. Work around this by passing both through
sed.

llvm-svn: 242341

9 years agoTargetRegisterInfo: Provide a way to check assigned registers in getRegAllocationHints()
Matthias Braun [Wed, 15 Jul 2015 22:16:00 +0000 (22:16 +0000)]
TargetRegisterInfo: Provide a way to check assigned registers in getRegAllocationHints()

Pass a const reference to LiveRegMatrix to getRegAllocationHints()
because some targets can prodive better hints if they can test whether a
physreg has been used for register allocation yet.

llvm-svn: 242340

9 years agoMIR Serialization: Serialize references from the stack objects to named allocas.
Alex Lorenz [Wed, 15 Jul 2015 22:14:49 +0000 (22:14 +0000)]
MIR Serialization: Serialize references from the stack objects to named allocas.

This commit serializes the references to the named LLVM alloca instructions from
the stack objects in the machine frame info. This commit adds a field 'Name' to
the struct 'yaml::MachineStackObject'. This new field is used to store the name
of the alloca instruction when the alloca is present and when it has a name.

llvm-svn: 242339

9 years agoAdd a "debugger tuning" concept that allows us to fine-tune how we
Paul Robinson [Wed, 15 Jul 2015 22:04:54 +0000 (22:04 +0000)]
Add a "debugger tuning" concept that allows us to fine-tune how we
emit debug info, according to the preferences of the different
debuggers used on various targets.
Darwin and FreeBSD default to tuning for LLDB; PS4 defaults to tuning for
the SCE (Sony Computer Entertainment) debugger.  All others default to GDB.

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

llvm-svn: 242338

9 years agoFix mergefunc infinite loop
JF Bastien [Wed, 15 Jul 2015 21:51:33 +0000 (21:51 +0000)]
Fix mergefunc infinite loop

Self-referential constants containing references to a merged function
no longer cause the MergeFunctions pass to infinite loop. Also adds a
reproduction IR which would otherwise fail, which was isolated from a similar
issue in Chromium.

Author: jrkoenig
Reviewers: nlewycky, jfb
Subscribers: llvm-commits, nlewycky, jfb

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

llvm-svn: 242337

9 years agoSimplify a few uses of remove_filename by using parent_path instead.
Rafael Espindola [Wed, 15 Jul 2015 21:24:07 +0000 (21:24 +0000)]
Simplify a few uses of remove_filename by using parent_path instead.

llvm-svn: 242334

9 years agoRemove shell-specific code from TestLoadUnload Makefile.
Chaoren Lin [Wed, 15 Jul 2015 21:18:26 +0000 (21:18 +0000)]
Remove shell-specific code from TestLoadUnload Makefile.

Reviewers: clayborg, sivachandra

Subscribers: lldb-commits

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

llvm-svn: 242332

9 years agoSwitch the release script to build with CMake by default (PR21561)
Hans Wennborg [Wed, 15 Jul 2015 21:06:16 +0000 (21:06 +0000)]
Switch the release script to build with CMake by default (PR21561)

It retains the possibility to use the autoconf build with a
command-line option ('-use-autoconf'), and uses that by default on Darwin since
compiler-rt requires it on that platform.

This commit also removes the "Release-64" flavour and related logic. The script
would previously do two builds unless the '-no-64bit' flag was passed, but on
my machine and from those I asked this always ended up producing two 64-bit builds,
causing much confusion.

It also removes the -build-triple option, which caused the --build= flag to
get passed to ./configure. This was presumably intended for cross-compiling,
but none of the release testers use it. If someone does want to pass it,
they can use '-configure-flags --build=foo' instead.

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

llvm-svn: 242331

9 years agoHandle the error of trying to convert a regular archive to a thin one.
Rafael Espindola [Wed, 15 Jul 2015 20:45:56 +0000 (20:45 +0000)]
Handle the error of trying to convert a regular archive to a thin one.

While at it, test that we can add to a thin archive.

llvm-svn: 242330

9 years agoFinally, with no users for shell-preserves-root, remove it from lit.cfg.
Yaron Keren [Wed, 15 Jul 2015 20:41:28 +0000 (20:41 +0000)]
Finally, with no users for shell-preserves-root, remove it from lit.cfg.

llvm-svn: 242329

9 years ago[Static Analyzer] Do not fail silently, when the analyzer is invoked from tooling...
Gabor Horvath [Wed, 15 Jul 2015 20:32:07 +0000 (20:32 +0000)]
[Static Analyzer] Do not fail silently, when the analyzer is invoked from tooling lib, an analyzer plugin is loaded, but the runtime linker fails to link.

llvm-svn: 242326

9 years agoErase REQUIRES: shell-preserves-root from remaining tests, see r242312.þ
Yaron Keren [Wed, 15 Jul 2015 20:04:18 +0000 (20:04 +0000)]
Erase REQUIRES: shell-preserves-root from remaining tests, see r242312.þ

llvm-svn: 242323

9 years agoRename doFunction() in BFI to calculate() and change its parameters from pointers...
Cong Hou [Wed, 15 Jul 2015 19:58:26 +0000 (19:58 +0000)]
Rename doFunction() in BFI to calculate() and change its parameters from pointers to references.

http://reviews.llvm.org/D11196

llvm-svn: 242322

9 years agoErase REQUIRES: shell-preserves-root from more tests, see r242312.
Yaron Keren [Wed, 15 Jul 2015 19:42:18 +0000 (19:42 +0000)]
Erase REQUIRES: shell-preserves-root from more tests, see r242312.

llvm-svn: 242321

9 years agoAnalyze recursive PHI nodes in BasicAA
Tobias Edler von Koch [Wed, 15 Jul 2015 19:32:22 +0000 (19:32 +0000)]
Analyze recursive PHI nodes in BasicAA

Summary:
This patch allows phi nodes like
  %x = phi [ %incptr, ... ] [ %var, ... ]
  %incptr = getelementptr %x, 1
to be analyzed by BasicAliasAnalysis.

In aliasPHI, we can detect incoming values that are recursive GEPs with a
constant offset. Instead of trying to analyze a recursive GEP (and failing),
we now ignore it and instead set the size of the memory referenced by
the PHINode to UnknownSize. This represents all the possible memory
locations the pointer represented by the PHINode could be advanced to
by the GEP.

For now, this new behavior is turned off by default to allow debugging of
performance degradations seen with SPEC/x86 and Hexagon benchmarks.
The flag -basicaa-recphi turns it on.

Reviewers: hfinkel, sanjoy

Subscribers: tobiasvk_caf, sanjoy, llvm-commits

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

llvm-svn: 242320

9 years agoUse accept instead of accept4 for Android.
Chaoren Lin [Wed, 15 Jul 2015 19:22:12 +0000 (19:22 +0000)]
Use accept instead of accept4 for Android.

Summary:
The accept4 syscall is missing on older ARM Android kernels, and the accept()
call is implemented with the accept4 syscall, so we'll need to call the accept
syscall directly.

Reviewers: vharron, tberghammer, labath

Subscribers: ovyalov, chaoren, labath, tberghammer, aemerson, lldb-commits

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

llvm-svn: 242319

9 years agoDefault to linking lldb-server statically for Android.
Chaoren Lin [Wed, 15 Jul 2015 19:22:09 +0000 (19:22 +0000)]
Default to linking lldb-server statically for Android.

Reviewers: vharron, tberghammer

Subscribers: chaoren, labath, tberghammer, lldb-commits

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

llvm-svn: 242318

9 years agoAllow any comment to be a trailing comment when -fparse-all-comments is on.
James Dennett [Wed, 15 Jul 2015 19:13:39 +0000 (19:13 +0000)]
Allow any comment to be a trailing comment when -fparse-all-comments is on.

This helps with freeform documentation styles, where otherwise code like
  enum class E {
    E1,  // D1
    E2   // D2
  };
would result in D1 being associated with E2. To properly associate E1
with D1 and E2 with D2, this patch allows all raw comments C such that
C.isParseAllComments() to participate in trailing comment checks inside
getRawCommentForDeclNoCache. This takes care of linking the intended
documentation with the intended decls. There remains an issue with code
like:
  foo();  // DN
  int x;
To prevent DN from being associated with x, this patch adds a new test
on preceding-line comments C (where C.isParseAllComments() and also
C's kind is RCK_OrdinaryBCPL or RCK_OrdinaryC) that checks whether C
is the first non-whitespace thing on C's starting line.

Patch from Luke Zarko <zarko@google.com>, D11069 reviewed by rsmith.

llvm-svn: 242317

9 years agoclang-format: Fix return type breaking with overloaded operator functions
Birunthan Mohanathas [Wed, 15 Jul 2015 19:11:58 +0000 (19:11 +0000)]
clang-format: Fix return type breaking with overloaded operator functions

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

llvm-svn: 242316

9 years ago-disable-llvm-optzns in one clang test.
Evgeniy Stepanov [Wed, 15 Jul 2015 18:57:57 +0000 (18:57 +0000)]
-disable-llvm-optzns in one clang test.

The intent is to test Clang codegen at -O1, and not the LLVM
optimization pipeline.

llvm-svn: 242315

9 years agoActually requiring shell disables the test on Windows whereas
Yaron Keren [Wed, 15 Jul 2015 18:55:39 +0000 (18:55 +0000)]
Actually requiring shell disables the test on Windows whereas
previously requiring shell-preserves-root did not, so do not
require anything.

llvm-svn: 242314

9 years ago[PPC64] Update tests for vec_sld
Bill Schmidt [Wed, 15 Jul 2015 18:55:02 +0000 (18:55 +0000)]
[PPC64] Update tests for vec_sld

Revision 224297 modified the behavior of vec_sld for little endian so
that LLVM will generate the correct corresponding vsldoi instruction.
I neglected to update the existing tests, which continued to pass
because they were not specific enough.  This patch adds enough
specificity to the tests to make them useful for BE and LE testing of
vec_sld.

llvm-svn: 242313

9 years agoSince r179283, internal shell is default on windows and so shell-preserves-root
Yaron Keren [Wed, 15 Jul 2015 18:40:05 +0000 (18:40 +0000)]
Since r179283, internal shell is default on windows and so shell-preserves-root
is true on MSYS bash although this requires: used to disable tests on MSYS bash.

Nevertheless, all tests requiring shell-preserves-root do pass except for
Driver/darwin-sdkroot.c. It will require a patch, either by disabling it on
Windows or by fixing shell-preserves-root to really be true only on MSYS
and making darwin-sdkroot.c its only user.

In any case, all other tests requiring shell-preserves-root do not really require
it so I'm replacing REQUIRES: shell-preserves-root with REQUIRES: shell in two
tests first.

llvm-svn: 242312

9 years agoRevert "Refactor optimizeUncoalescable logic"
Bruno Cardoso Lopes [Wed, 15 Jul 2015 18:10:46 +0000 (18:10 +0000)]
Revert "Refactor optimizeUncoalescable logic"

Likely broke compilation on ARM:

http://lab.llvm.org:8011/builders/clang-native-arm-lnt/builds/13054

This reverts commit 0b7824464fbe3d3f386e2d4aef6a431422709e53.

llvm-svn: 242311

9 years agoRevert "Look through PHIs to find additional register sources"
Bruno Cardoso Lopes [Wed, 15 Jul 2015 18:10:35 +0000 (18:10 +0000)]
Revert "Look through PHIs to find additional register sources"

Likely broke compilation on ARM:

http://lab.llvm.org:8011/builders/clang-native-arm-lnt/builds/13054

This reverts commit 131ce4a838c081516cbfed039fc986b33e3979d6.

llvm-svn: 242310

9 years agoRun clang-format on Tools.h, the indentation is inconsistent
Reid Kleckner [Wed, 15 Jul 2015 17:58:55 +0000 (17:58 +0000)]
Run clang-format on Tools.h, the indentation is inconsistent

llvm-svn: 242309

9 years agoTest commit.
Cong Hou [Wed, 15 Jul 2015 17:58:15 +0000 (17:58 +0000)]
Test commit.

This is a test commit (one blank line deleted).

llvm-svn: 242308

9 years ago[Targets] Define __BOOL_DEFINED for Windows targets in C++ mode
David Majnemer [Wed, 15 Jul 2015 17:32:34 +0000 (17:32 +0000)]
[Targets] Define __BOOL_DEFINED for Windows targets in C++ mode

MSVC 4.2 didn't have bool as a builtin type but MSVC 5.0 does.  When
they added it, they added a macro (__BOOL_DEFINED) which allows build
scripts and the like to know if they should provide their own bool.

Clang always supports bool as a builtin type in C++ mode.

llvm-svn: 242307

9 years agoFix -data-info-line when source includes column number.
Dawn Perchik [Wed, 15 Jul 2015 17:25:01 +0000 (17:25 +0000)]
Fix -data-info-line when source includes column number.

This fixes an off-by-one bug in CMICmdCmdDataInfoLine::Acknowledge.  Given:
    LineEntry: \[0x0000000100000f37-0x0000000100000f45\): /path/to/file:123:1
-data-info-line would report the line as 12, omitting the last digit.

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

llvm-svn: 242306

9 years ago[NativeProcessLinux] Integrate MainLoop
Pavel Labath [Wed, 15 Jul 2015 17:20:01 +0000 (17:20 +0000)]
[NativeProcessLinux] Integrate MainLoop

Summary:
This commit integrates MainLoop into NativeProcessLinux. By registering a SIGCHLD handler with
the llgs main loop, we can get rid of the special monitor thread in NPL, which saves as a lot of
thread ping-pong when responding to client requests (e.g. qThreadInfo processing time has been
reduced by about 40%). It also makes the code simpler, IMHO.

Reviewers: ovyalov, clayborg, tberghammer, chaoren

Subscribers: lldb-commits

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

llvm-svn: 242305

9 years agoDelete declared but not implemented functions.
Rafael Espindola [Wed, 15 Jul 2015 17:19:39 +0000 (17:19 +0000)]
Delete declared but not implemented functions.

llvm-svn: 242304

9 years agoAdd the ability to AST match a variable declaration that is an exception variable.
Aaron Ballman [Wed, 15 Jul 2015 17:11:21 +0000 (17:11 +0000)]
Add the ability to AST match a variable declaration that is an exception variable.

llvm-svn: 242303