platform/upstream/llvm.git
9 years agoCheck the host platform to determine logging channel to test in TestRegisters.py
Robert Flack [Wed, 13 May 2015 18:23:10 +0000 (18:23 +0000)]
Check the host platform to determine logging channel to test in TestRegisters.py

Checks the host platform to determine logging channel to test in
TestRegisters.py as the logging runs host side.

Test Plan:
./dotest.py $DOTEST_OPTS -v -t -p TestRegisters.py
This passes mac -> linux as it's logging the correct channel.

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

llvm-svn: 237271

9 years agoEnable workaround for finding functions in global namespace on linux binaries on
Robert Flack [Wed, 13 May 2015 18:20:02 +0000 (18:20 +0000)]
Enable workaround for finding functions in global namespace on linux binaries on
all hosts.

We require a workaround to be able to locate global and anonymous namespace
functions in the dwarf symbols on linux binaries. This patch enables this code
on all platforms so that we can still find these symbols when debugging from a
different host platform.

Test Plan:
The following tests begin passing when running with a mac host to linux client:
TestCallCPPFunction.py
TestCallStopAndContinue.py
TestExprs.py
TestExprsChar.py
TestNamespace.py
TestOverloadedFunctions.py
TestRvalueReferences.py
TestThreadExit.py

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

llvm-svn: 237270

9 years ago[NaryReassociate] avoid running forever
Jingyue Wu [Wed, 13 May 2015 18:12:24 +0000 (18:12 +0000)]
[NaryReassociate] avoid running forever

Avoid running forever by checking we are not reassociating an expression into
the same form.

Tested with @avoid_infinite_loops in nary-add.ll

llvm-svn: 237269

9 years agoMade considerable updates to the documentation explaining how to add a new attribute...
Aaron Ballman [Wed, 13 May 2015 18:06:48 +0000 (18:06 +0000)]
Made considerable updates to the documentation explaining how to add a new attribute to clang. Cleans up some of the existing wording, as well as adding new information and better explanations.

llvm-svn: 237268

9 years agoSilence Visual C++ warning C4189: 'Result' : local variable is initialized but not...
Yaron Keren [Wed, 13 May 2015 17:56:46 +0000 (17:56 +0000)]
Silence Visual C++ warning C4189: 'Result' : local variable is initialized but not referenced.

Sadly, LLVM_ATTRIBUTE_UNUSED does nothing with Visual C++ which means
we'll have to workaround such cases again and again.

llvm-svn: 237267

9 years ago[Hexagon] Generate loop1 instruction for nested loops
Brendon Cahoon [Wed, 13 May 2015 17:56:03 +0000 (17:56 +0000)]
[Hexagon] Generate loop1 instruction for nested loops

loop1 is for the outer loop and loop0 is for the inner loop.

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

llvm-svn: 237266

9 years agoAdd function entry counts from sample profiles.
Diego Novillo [Wed, 13 May 2015 17:04:29 +0000 (17:04 +0000)]
Add function entry counts from sample profiles.

This patch uses the new function profile metadata "function_entry_count"
to annotate entry counts from sample profiles.

In a sampling profile, the total samples collected at the function entry
are an approximation for the number of times that function was invoked.

llvm-svn: 237265

9 years agoImplement std::experimental::sample.
Evgeniy Stepanov [Wed, 13 May 2015 16:55:41 +0000 (16:55 +0000)]
Implement std::experimental::sample.

Following specification in "C++ Extensions for Library Fundamentals":
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2015/n4480.html#alg.random.sample

llvm-svn: 237264

9 years agoclang-format: Improve nested block / lambda indentation when wrapping
Daniel Jasper [Wed, 13 May 2015 16:09:21 +0000 (16:09 +0000)]
clang-format: Improve nested block / lambda indentation when wrapping
before binary/ternary operators.

Basically, it doesn't seem right to indent a nested block aligned to a
binary or ternary operator.

Before:
  int i = aaaaaa ? 1  //
                 : [] {
                   return 2;  //
                 }();
  llvm::errs() << "number of twos is "
               << std::count_if(v.begin(), v.end(), [](int x) {
                 return x == 2;  // force break
               });

After:
  int i = aaaaaa ? 1  //
                 : [] {
                     return 2;  //
                   }();
  llvm::errs() << "number of twos is "
               << std::count_if(v.begin(), v.end(), [](int x) {
                    return x == 2;  // force break
                  });

llvm-svn: 237263

9 years ago[mips] [IAS] Preemptively fix warning introduced by r237255. NFC.
Toma Tabacu [Wed, 13 May 2015 16:02:41 +0000 (16:02 +0000)]
[mips] [IAS] Preemptively fix warning introduced by r237255. NFC.

Some compilers warn about using the ternary operator with an unsigned variable
and enum.
I haven't seen this trigger in the llvm.org buildbots yet, but it probably will
at some point.

Reported by Daniel Sanders.

llvm-svn: 237262

9 years agoUpdate ELFObjectWriter::reset() following r236255.
Yaron Keren [Wed, 13 May 2015 15:17:19 +0000 (15:17 +0000)]
Update ELFObjectWriter::reset() following r236255.

llvm-svn: 237261

9 years agoAdd function entry count metadata.
Diego Novillo [Wed, 13 May 2015 15:13:45 +0000 (15:13 +0000)]
Add function entry count metadata.

Summary:
This adds three Function methods to handle function entry counts:
setEntryCount() and getEntryCount().

Entry counts are stored under the MD_prof metadata node with the name
"function_entry_count". They are unsigned 64 bit values set by profilers
(instrumentation and sample profiler changes coming up).

Added documentation for new profile metadata and tests.

Reviewers: dexonsmith, bogner

Subscribers: llvm-commits

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

llvm-svn: 237260

9 years agoTest commit: Remove unnecessary spaces.
Teresa Johnson [Wed, 13 May 2015 15:04:14 +0000 (15:04 +0000)]
Test commit: Remove unnecessary spaces.

llvm-svn: 237259

9 years ago[Hexagon] Generate hardware loop when loop has a critical edge
Brendon Cahoon [Wed, 13 May 2015 14:54:24 +0000 (14:54 +0000)]
[Hexagon] Generate hardware loop when loop has a critical edge

The hardware loop pass should try to generate a hardware loop
instruction when the original loop has a critical edge.

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

llvm-svn: 237258

9 years ago[mips][microMIPSr6] Implement CLO and CLZ instructions
Jozef Kolek [Wed, 13 May 2015 14:18:11 +0000 (14:18 +0000)]
[mips][microMIPSr6] Implement CLO and CLZ instructions

This patch implements CLO and CLZ instructions using mapping.

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

llvm-svn: 237257

9 years agoRevert r237247 - [AArch64] Codegen VMAX/VMIN.. as it is causing failures in SPEC2000...
Silviu Baranga [Wed, 13 May 2015 14:03:18 +0000 (14:03 +0000)]
Revert r237247 - [AArch64] Codegen VMAX/VMIN.. as it is causing failures in SPEC2000/2006

llvm-svn: 237256

9 years ago[mips] [IAS] Unify common functionality of LA and LI.
Toma Tabacu [Wed, 13 May 2015 13:56:16 +0000 (13:56 +0000)]
[mips] [IAS] Unify common functionality of LA and LI.

Summary: A side-effect of this is that LA gains proper handling of unsigned and positive signed 16-bit immediates and more accurate error messages.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 237255

9 years agoRemoved mentioning of OpenMP as unsupported feature (patch2 from A.Bokhanko)
Andrey Churbanov [Wed, 13 May 2015 13:42:59 +0000 (13:42 +0000)]
Removed mentioning of OpenMP as unsupported feature (patch2 from A.Bokhanko)

llvm-svn: 237253

9 years agoUpdate isl to 9f767f1766a0
Tobias Grosser [Wed, 13 May 2015 13:10:13 +0000 (13:10 +0000)]
Update isl to 9f767f1766a0

This fixes a bug in the isl scheduler (http://llvm.org/PR21934)

Otherwise mostly minor changes.

llvm-svn: 237250

9 years agoclang-format: Fix incorrect */& classification.
Daniel Jasper [Wed, 13 May 2015 12:54:30 +0000 (12:54 +0000)]
clang-format: Fix incorrect */& classification.

Before:
  void f() { f(new a(), c *d); }

After:
  void f() { f(new a(), c * d); }

llvm-svn: 237249

9 years agoRefactor lldb-mi's prompt
Ilia K [Wed, 13 May 2015 12:18:20 +0000 (12:18 +0000)]
Refactor lldb-mi's prompt

Summary:
This patch fixes/cleans code around of (gdb) prompt:
# Add CMICmnStreamStdout::WritePrompt
# Clean up CMICmnStreamStdout::TextToStdout (don't lock
  the m_mutex twice because it will be locked in CMICmnStreamStdout::WritePriv)
# Remove unused CMICmnStreamStdin::m_bShowPrompt field
# Refactor CMICmnLLDBDebuggerHandleEvents to use CMICmnStreamStdout::WritePrompt
  instead of TextToStdout("(gdb)")
# Refactor CMIDriver to use CMICmnStreamStdout::WritePrompt instead of
  ```
    if (bOk && m_rStdin.GetEnablePrompt())
        bOk = m_rStdOut.WriteMIResponse(m_rStdin.GetPrompt());
  ```

Test Plan: ./dotest.py -v --executable $BUILDDIR/bin/lldb tools/lldb-mi/

Reviewers: abidh

Reviewed By: abidh

Subscribers: lldb-commits, abidh

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

llvm-svn: 237248

9 years ago[AArch64] Codegen VMAX/VMIN for safe math cases
Artyom Skrobov [Wed, 13 May 2015 12:01:09 +0000 (12:01 +0000)]
[AArch64] Codegen VMAX/VMIN for safe math cases

llvm-svn: 237247

9 years agoclang-format: Fix semicolon less macro-detection.
Daniel Jasper [Wed, 13 May 2015 11:35:53 +0000 (11:35 +0000)]
clang-format: Fix semicolon less macro-detection.

It was fooled by the comment.

Before:
  SOME_UNRELATED_MACRO
      /*static*/ int i;

After:
  SOME_UNRELATED_MACRO
  /*static*/ int i;

llvm-svn: 237246

9 years agoReverting r237234, "Use std::bitset for SubtargetFeatures"
Michael Kuperstein [Wed, 13 May 2015 10:28:46 +0000 (10:28 +0000)]
Reverting r237234, "Use std::bitset for SubtargetFeatures"

The buildbots are still not satisfied.
MIPS and ARM are failing (even though at least MIPS was expected to pass).

llvm-svn: 237245

9 years agoclang-format: [ObjC] Further improve wrapping of methods calls without inputs.
Daniel Jasper [Wed, 13 May 2015 10:23:03 +0000 (10:23 +0000)]
clang-format: [ObjC] Further improve wrapping of methods calls without inputs.

Before:
  [aaaaaaaaaaaaaaaaaaaaaaa
      .aaaaaaaa[aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa];

After:
  [aaaaaaaaaaaaaaaaaaaaaaa.aaaaaaaa[aaaaaaaaaaaaaaaaaaaaa]
      aaaaaaaaaaaaaaaaaaaaaa];

llvm-svn: 237244

9 years ago[OPENMP] Fixed codegen for firstprivate variables, also marked as lastprivate.
Alexey Bataev [Wed, 13 May 2015 10:23:02 +0000 (10:23 +0000)]
[OPENMP] Fixed codegen for firstprivate variables, also marked as lastprivate.

In some rare cases shared copies of lastprivate/firstprivate variables were not updated after the loop directive.

llvm-svn: 237243

9 years ago[mips] [IAS] Merge the micromips-expressions.s test into expr1.s. NFC.
Toma Tabacu [Wed, 13 May 2015 09:53:53 +0000 (09:53 +0000)]
[mips] [IAS] Merge the micromips-expressions.s test into expr1.s. NFC.

Summary: Also did some minor reformatting in the resulting test.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 237242

9 years agoclang-format: [ObjC] Make IndentWrappedFunctionNames work with ObjC functions
Daniel Jasper [Wed, 13 May 2015 09:38:25 +0000 (09:38 +0000)]
clang-format: [ObjC] Make IndentWrappedFunctionNames work with ObjC functions

llvm-svn: 237241

9 years agoFix arm instruction emulation of add (imm) and sub (imm)
Tamas Berghammer [Wed, 13 May 2015 09:25:06 +0000 (09:25 +0000)]
Fix arm instruction emulation of add (imm) and sub (imm)

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

llvm-svn: 237240

9 years agoRemote Non-Stop Support
Ewan Crawford [Wed, 13 May 2015 09:18:18 +0000 (09:18 +0000)]
Remote Non-Stop Support

Summary:

This patch is the beginnings of support for Non-stop mode in the remote protocol. Letting a user examine stopped threads, while other threads execute freely.

Non-stop mode is enabled using the setting target.non-stop-mode, which sends a QNonStop packet when establishing the remote connection.
Changes are also made to treat the '?' stop reply packet differently in non-stop mode, according to spec https://sourceware.org/gdb/current/onlinedocs/gdb/Remote-Non_002dStop.html#Remote-Non_002dStop.
A setting for querying the remote for default thread on setup is also included.

Handling of '%' async notification packets will be added next.

Reviewers: clayborg

Subscribers: lldb-commits, ADodds, ted, deepak2427

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

llvm-svn: 237239

9 years agoFix a few compile warnings
Ilia K [Wed, 13 May 2015 09:04:59 +0000 (09:04 +0000)]
Fix a few compile warnings

llvm-svn: 237238

9 years ago[DebugInfo] Debug locations for constant SD nodes
Sergey Dmitrouk [Wed, 13 May 2015 08:58:03 +0000 (08:58 +0000)]
[DebugInfo] Debug locations for constant SD nodes

Several updates for [DebugInfo] Add debug locations to constant SD nodes (r235989).
Includes:

 *  re-enabling the change (disabled recently);
 *  missing change for FP constants;
 *  resetting debug location of constant node if it's used more than at one place
    to prevent emission of wrong locations in case of coalesced constants;
 *  a couple of additional tests.

Now all look ups in CSEMap are wrapped by additional method.

Comment in D9084 suggests that debug locations aren't useful for "target constants",
so there might be one more change related to this API (namely, dropping debug
locations for getTarget*Constant methods).

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

llvm-svn: 237237

9 years agoclang-format: Prefer formatting local lambdas like functions.
Daniel Jasper [Wed, 13 May 2015 08:47:16 +0000 (08:47 +0000)]
clang-format: Prefer formatting local lambdas like functions.

Before:
  auto my_lambda =
      [](const string &some_parameter) { return some_parameter.size(); };

After:
  auto my_lambda = [](const string &some_parameter) {
    return some_parameter.size();
  };

llvm-svn: 237235

9 years agoUse std::bitset for SubtargetFeatures
Michael Kuperstein [Wed, 13 May 2015 08:27:08 +0000 (08:27 +0000)]
Use std::bitset for SubtargetFeatures

Previously, subtarget features were a bitfield with the underlying type being uint64_t.
Since several targets (X86 and ARM, in particular) have hit or were very close to hitting this bound, switching the features to use a bitset.
No functional change.

The first two times this was committed (r229831, r233055), it caused several buildbot failures.
At least some of the ARM and MIPS ones were due to gcc/binutils issues, and should now be fixed.

llvm-svn: 237234

9 years agoclang-format: Support column layout with comment after {.
Daniel Jasper [Wed, 13 May 2015 08:16:00 +0000 (08:16 +0000)]
clang-format: Support column layout with comment after {.

Before:
  vector<int> iiiiiiiiiiiiiii = {                      //
      11111111112222222222333333333334444444444, //
      1111111112222222223333333333444444444,     //
      111111112222222233333333344444444};

After:
  vector<int> iiiiiiiiiiiiiii = {                      //
      11111111112222222222333333333334444444444, //
      111111111,  222222222,  3333333333,  444444444,  //
      11111111,   22222222,   333333333,   44444444};

llvm-svn: 237233

9 years agoAVX-512: fixed a bug in encoding of VPSRAQ instrcution,
Elena Demikhovsky [Wed, 13 May 2015 07:35:05 +0000 (07:35 +0000)]
AVX-512: fixed a bug in encoding of VPSRAQ instrcution,
added a bunch of encoding tests.

llvm-svn: 237232

9 years agoUse ArrayRef::slice instead of manually constructing an ArrayRef from ArrayRef iterat...
Craig Topper [Wed, 13 May 2015 06:57:51 +0000 (06:57 +0000)]
Use ArrayRef::slice instead of manually constructing an ArrayRef from ArrayRef iterators. NFC

llvm-svn: 237231

9 years agoDarwin - fix intermitent crashes in import crashinfo
Vince Harron [Wed, 13 May 2015 05:00:23 +0000 (05:00 +0000)]
Darwin - fix intermitent crashes in import crashinfo

Summary:
"import crashinfo" was probably failing because multiple dotest invocations
are all trying to compile crashinfo.so at the same time.

I've put a mutex around the compile step to prevent this.

Reviewers: clayborg, chying

Subscribers: lldb-commits

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

llvm-svn: 237230

9 years agoUse a more accurate implementation for exp
Tom Stellard [Wed, 13 May 2015 03:55:09 +0000 (03:55 +0000)]
Use a more accurate implementation for exp

Using exp2(x * M_LOG2E_F) does not give us accurate enough results for
OpenCL.  If you look at the new exp implementation you'll see that
it does multiply the input by M_LOG2E_F, but it still uses the original
input in part of the calculation.

This exp implementation was ported from the AMD builtin library
and has been tested with piglit, OpenCV, and the ocl conformance tests.

llvm-svn: 237229

9 years agoImplement exp2 using OpenCL C rather than using an intrinsic
Tom Stellard [Wed, 13 May 2015 03:55:07 +0000 (03:55 +0000)]
Implement exp2 using OpenCL C rather than using an intrinsic

Not all targets support the intrinsic, so it's better to have a
generic implementation which does not use it.

This exp2 implementation was ported from the AMD builtin library
and has been tested with piglit, OpenCV, and the ocl conformance tests.

llvm-svn: 237228

9 years agoConstify arguments to methods in LICM. NFC
Pete Cooper [Wed, 13 May 2015 01:12:18 +0000 (01:12 +0000)]
Constify arguments to methods in LICM.  NFC

llvm-svn: 237227

9 years agoChange LoadAndStorePromoter to take ArrayRef instead of SmallVectorImpl&.
Pete Cooper [Wed, 13 May 2015 01:12:16 +0000 (01:12 +0000)]
Change LoadAndStorePromoter to take ArrayRef instead of SmallVectorImpl&.

The array passed to LoadAndStorePromoter's constructor was a constant reference to a SmallVectorImpl, which is just the same as passing an ArrayRef.

Also, the data in the array can be 'const Instruction*' instead of 'Instruction*'.  Its not possible to convert a SmallVectorImpl<T*> to SmallVectorImpl<const T*>, but ArrayRef does provide such a method.

Currently this added calls to makeArrayRef which should be a nop, but i'm going to kick off a discussion about improving ArrayRef to not need these.

llvm-svn: 237226

9 years agoConstify arguments in AliasSetTracker methods. NFC
Pete Cooper [Wed, 13 May 2015 01:12:12 +0000 (01:12 +0000)]
Constify arguments in AliasSetTracker methods.  NFC

llvm-svn: 237225

9 years agoChange a loop in LoopInfo to foreach. NFC
Pete Cooper [Wed, 13 May 2015 01:12:09 +0000 (01:12 +0000)]
Change a loop in LoopInfo to foreach.  NFC

llvm-svn: 237224

9 years agoConstify arguments to methods in LoopInfo. NFC
Pete Cooper [Wed, 13 May 2015 01:12:06 +0000 (01:12 +0000)]
Constify arguments to methods in LoopInfo.  NFC

llvm-svn: 237223

9 years ago[LLD] Properly relocate the LSDA field of MachO eh-frames.
Lang Hames [Wed, 13 May 2015 00:44:47 +0000 (00:44 +0000)]
[LLD] Properly relocate the LSDA field of MachO eh-frames.

Previously the LSDA field was not being relocated during linking, leading to
failures for some EH tests.

llvm-svn: 237222

9 years agoDon't change the selected platform when creating the dummy target.
Robert Flack [Wed, 13 May 2015 00:39:24 +0000 (00:39 +0000)]
Don't change the selected platform when creating the dummy target.

A dummy target is used by TargetList::CreateTargetInternal to prime newly
created targets. the first time this is done it creates the dummy target. The
dummy target is created with the host platform (See
TargetList::CreateDummyTarget) which results in switching the selected platform
back to the host platform even when creating a target for a different platform.
This change avoids changing the selected platform while creating the dummy
target to prevent this side effect.

Test Plan:
./dotest.py $DOTEST_OPTS -t -p TestCreateAfterAttach.py
Tests using process attach (e.g. TestCreateAfterAttach.py, TestHelloWorld.py)
now run successfully mac -> linux.

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

llvm-svn: 237221

9 years ago[PlaceSafepoints] Reduce dominator tree recalculation
Philip Reames [Wed, 13 May 2015 00:32:23 +0000 (00:32 +0000)]
[PlaceSafepoints] Reduce dominator tree recalculation

Reduce recalculation of the dominator tree by identifying all sites that will need a safepoint poll before doing any of the insertion. This allows us to invalidate the dominator info once, rather than once per safepoint poll inserted.

While I'm at it, update findLocationForEntrySafepoint to properly update the dom tree now that the interface has been made easy. When first written, it wasn't per comment in the code.

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

llvm-svn: 237220

9 years ago[LLD] Add support for MachO ripRel32MinusNAnon relocations.
Lang Hames [Wed, 13 May 2015 00:29:43 +0000 (00:29 +0000)]
[LLD] Add support for MachO ripRel32MinusNAnon relocations.

llvm-svn: 237219

9 years agoFixed a ton of gcc compile warnings
Vince Harron [Wed, 13 May 2015 00:25:54 +0000 (00:25 +0000)]
Fixed a ton of gcc compile warnings

Removed some unused variables, added some consts, changed some casts
to const_cast. I don't think any of these changes are very
controversial.

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

llvm-svn: 237218

9 years ago[LLD] Add a mutex to prevent concurrent modification of the dylib maps in
Lang Hames [Wed, 13 May 2015 00:17:08 +0000 (00:17 +0000)]
[LLD] Add a mutex to prevent concurrent modification of the dylib maps in
MachOLinkingContext.

llvm-svn: 237217

9 years ago[SLSR] handles non-canonicalized Mul candidates
Jingyue Wu [Wed, 13 May 2015 00:03:17 +0000 (00:03 +0000)]
[SLSR] handles non-canonicalized Mul candidates

such as (2 + B) * S.

Tested by @non_canonicalized in slsr-mul.ll

llvm-svn: 237216

9 years ago[Statepoints] Support for "patchable" statepoints.
Sanjoy Das [Tue, 12 May 2015 23:52:24 +0000 (23:52 +0000)]
[Statepoints] Support for "patchable" statepoints.

Summary:
This change adds two new parameters to the statepoint intrinsic, `i64 id`
and `i32 num_patch_bytes`.  `id` gets propagated to the ID field
in the generated StackMap section.  If the `num_patch_bytes` is
non-zero then the statepoint is lowered to `num_patch_bytes` bytes of
nops instead of a call (the spill and reload code remains unchanged).
A non-zero `num_patch_bytes` is useful in situations where a language
runtime requires complete control over how a call is lowered.

This change brings statepoints one step closer to patchpoints.  With
some additional work (that is not part of this patch) it should be
possible to get rid of `TargetOpcode::STATEPOINT` altogether.

PlaceSafepoints generates `statepoint` wrappers with `id` set to
`0xABCDEF00` (the old default value for the ID reported in the stackmap)
and `num_patch_bytes` set to `0`.  This can be made more sophisticated
later.

Reviewers: reames, pgavlin, swaroop.sridhar, AndyAyers

Subscribers: llvm-commits

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

llvm-svn: 237214

9 years ago[PlaceSafepoints] Followup to commit L237172
Philip Reames [Tue, 12 May 2015 23:39:23 +0000 (23:39 +0000)]
[PlaceSafepoints] Followup to commit L237172

Responding to review feedback from http://reviews.llvm.org/D9585

1) Remove a variable shadow by converting the outer loop to a range for loop.  We never really used the 'i' variable which was being shadowed.
2) Reduce DominatorTree recalculations by passing the DT to SplitEdge.

llvm-svn: 237212

9 years agoCodeGen: ignore DEBUG_VALUE nodes in KILL tagging
Saleem Abdulrasool [Tue, 12 May 2015 23:36:18 +0000 (23:36 +0000)]
CodeGen: ignore DEBUG_VALUE nodes in KILL tagging

DEBUG_VALUE nodes do not take part in code generation.  Ignore them when
performing KILL updates.  Addresses PR23486.

llvm-svn: 237211

9 years agoRevert r237175: [X86] Always return the sret parameter in eax/rax ...
Chandler Carruth [Tue, 12 May 2015 23:34:27 +0000 (23:34 +0000)]
Revert r237175: [X86] Always return the sret parameter in eax/rax ...

This commit broke an x86 test and the bots have been broken for well
over an hour now so I'm just reverting.

llvm-svn: 237210

9 years ago[Unrolling] Refactor the start and step offsets to simplify overflow
Chandler Carruth [Tue, 12 May 2015 23:32:56 +0000 (23:32 +0000)]
[Unrolling] Refactor the start and step offsets to simplify overflow
checking and make the cache faster and smaller.

I had thought that using an APInt here would be useful, but I think
I was just wrong. Notably, we don't have to do any fancy overflow
checking, we can just bound the values as quite small and do the math in
a higher precision integer. I've switched to a signed integer so that
UBSan will even point out if we ever have integer overflow. I've added
various asserts to try to catch things as well and hoisted the overflow
checks so that we just leave the too-large offsets out of the SCEV-GEP
cache. This makes the value in the cache quite a bit smaller which is
probably worthwhile.

No functionality changed here (for trip counts under 1 billion).

llvm-svn: 237209

9 years ago[lib/Fuzzer] A simple script to synchronise a fuzz test corpus with an external git...
Kostya Serebryany [Tue, 12 May 2015 23:19:12 +0000 (23:19 +0000)]
[lib/Fuzzer] A simple script to synchronise a fuzz test corpus with an external git repository.

llvm-svn: 237208

9 years agodosep can run tests in a specific subfolder
Vince Harron [Tue, 12 May 2015 23:12:19 +0000 (23:12 +0000)]
dosep can run tests in a specific subfolder

For example:

./dosep.py -o "$DOTEST_OPTS" lang/c/

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

llvm-svn: 237207

9 years agoAdded support for XTIMEOUT to dosep
Vince Harron [Tue, 12 May 2015 23:10:36 +0000 (23:10 +0000)]
Added support for XTIMEOUT to dosep

Ideally, this would be put in the individual test files.

Unfortunately, I'm not sure how to do that quickly/easily.
I'm open to suggestions.

In the meantime, I'll submit this to stabilze the build server.

llvm-svn: 237206

9 years agoDocument a known build issue on OS X 10.8 and later.
Eric Fiselier [Tue, 12 May 2015 22:55:30 +0000 (22:55 +0000)]
Document a known build issue on OS X 10.8 and later.

llvm-svn: 237205

9 years agoAllow the CMake option 'LLVM_ABI_BREAKING_CHECKS' to be undefined.
Eric Fiselier [Tue, 12 May 2015 22:49:18 +0000 (22:49 +0000)]
Allow the CMake option 'LLVM_ABI_BREAKING_CHECKS' to be undefined.

When building libc++abi in a standalone configuration the CMake option
'LLVM_ABI_BREAKING_CHECKS` will not be defined.

llvm-svn: 237204

9 years agoChanged renaming of local symbols by inserting a dot before the numeric suffix.
Sunil Srivastava [Tue, 12 May 2015 22:44:24 +0000 (22:44 +0000)]
Changed renaming of local symbols by inserting a dot before the numeric suffix.
Modified two test cases to adjust to the above change in renaming.
These two files were causing the buildbot failure in Polly, #30204 for example.
Details in http://reviews.llvm.org/D9483
This checkin goes with r237150 and r237151

llvm-svn: 237203

9 years agoHave '__have_extension(cxx_variadic_templates)' return true for any C++ standard.
Eric Fiselier [Tue, 12 May 2015 22:37:23 +0000 (22:37 +0000)]
Have '__have_extension(cxx_variadic_templates)' return true for any C++ standard.

llvm-svn: 237202

9 years agoCVP: Improve handling of Selects used as incoming PHI values
Bjorn Steinbrink [Tue, 12 May 2015 22:31:47 +0000 (22:31 +0000)]
CVP: Improve handling of Selects used as incoming PHI values

Summary:
If the branch that leads to the PHI node and the Select instruction
depend on correlated conditions, we might be able to directly use the
corresponding value from the Select instruction as the incoming value
for the PHI node, allowing later removal of the select instruction.

Subscribers: llvm-commits

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

llvm-svn: 237201

9 years ago[RewriteStatepointsForGC] Extend base pointer to handle more cases w/vectors
Philip Reames [Tue, 12 May 2015 22:19:52 +0000 (22:19 +0000)]
[RewriteStatepointsForGC] Extend base pointer to handle more cases w/vectors

When relocating a pointer, we need to determine a base pointer for the derived pointer being relocated. We have limited support for handling a pointer extracted from a vector; the current code only handled the case where the entire vector was known to contain base pointers. This patch extends the reasoning to handle chains of insertelements where the indices are constants. This case turns out to be fairly common in vectorized code. We can now handle vectors which contains mixtures of base and derived pointers provided the insertelements use constant indices.

Note that this doesn't solve the general problem. To handle variable indexed insertelements, we'd need to scalarize and introduce conditional branching based on the index. Alternatively, we could eagerly scalarize, but the code structure doesn't currently make either fix easy. The patch also doesn't handle shufflevector or other vector manipulation for much the same reasons. I plan to defer this work until I have a motivating test case.

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

llvm-svn: 237200

9 years agobenchcomp: Add macho_symsizes mode for comparing Mach-O object symbol sizes.
Peter Collingbourne [Tue, 12 May 2015 22:14:26 +0000 (22:14 +0000)]
benchcomp: Add macho_symsizes mode for comparing Mach-O object symbol sizes.

llvm-svn: 237199

9 years ago[lib/Fuzzer] use sha1sum for the file hash
Kostya Serebryany [Tue, 12 May 2015 22:03:34 +0000 (22:03 +0000)]
[lib/Fuzzer] use sha1sum for the file hash

llvm-svn: 237198

9 years agoTidy comments in SampleProfile header. NFC.
Diego Novillo [Tue, 12 May 2015 22:03:00 +0000 (22:03 +0000)]
Tidy comments in SampleProfile header. NFC.

llvm-svn: 237197

9 years ago[PlaceSafepoints] Add missing "override" to PlaceBackedgeSafepointsImpl::runOnFunction
Justin Bogner [Tue, 12 May 2015 21:49:47 +0000 (21:49 +0000)]
[PlaceSafepoints] Add missing "override" to PlaceBackedgeSafepointsImpl::runOnFunction

Pointed out by -Winconsistent-missing-override.

llvm-svn: 237196

9 years agoAdd missing #include and forward decl, found by modules build.
Richard Smith [Tue, 12 May 2015 21:49:03 +0000 (21:49 +0000)]
Add missing #include and forward decl, found by modules build.

llvm-svn: 237195

9 years agoAdd missing #includes, found by modules build.
Richard Smith [Tue, 12 May 2015 21:48:00 +0000 (21:48 +0000)]
Add missing #includes, found by modules build.

llvm-svn: 237194

9 years agoMergeFunctions: Two different sized allocas are *not* the same
Arnold Schwaighofer [Tue, 12 May 2015 21:42:22 +0000 (21:42 +0000)]
MergeFunctions: Two different sized allocas are *not* the same

llvm-svn: 237193

9 years agoAdd a new error for unexpected semi-colon before closing delimiter.
Richard Trieu [Tue, 12 May 2015 21:36:35 +0000 (21:36 +0000)]
Add a new error for unexpected semi-colon before closing delimiter.

Previously, if a semi-colon is unexpectedly added before a closing ')', ']' or
'}', two errors and one note would emitted, and the parsing would get confused
to which scope it was in.  This change consumes the semi-colon, recovers
parsing better, and emits only one error with a fix-it.

llvm-svn: 237192

9 years ago[Statepoints] Clean up statepoint argument accessors.
Pat Gavlin [Tue, 12 May 2015 21:33:48 +0000 (21:33 +0000)]
[Statepoints] Clean up statepoint argument accessors.

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

llvm-svn: 237191

9 years agoInclude missing 'sanitizer_platform_limits_posix.h'
Ismail Pazarbasi [Tue, 12 May 2015 21:30:16 +0000 (21:30 +0000)]
Include missing 'sanitizer_platform_limits_posix.h'

Unbreak Mac builds. `#include` seems to be forgotten during staging.

llvm-svn: 237190

9 years agoRevert "ARM: Remove Itineraries for swift CPU"
Matthias Braun [Tue, 12 May 2015 21:28:39 +0000 (21:28 +0000)]
Revert "ARM: Remove Itineraries for swift CPU"

Reverting until I figure out the new lit failures.

This reverts commit r237179.

llvm-svn: 237189

9 years agoInstrProf: Update name of compiler-rt routine for setting filename
Justin Bogner [Tue, 12 May 2015 21:23:16 +0000 (21:23 +0000)]
InstrProf: Update name of compiler-rt routine for setting filename

Patch by Teresa Johnson.

llvm-svn: 237187

9 years agoInstrProf: Update name of compiler-rt routine for setting filename
Justin Bogner [Tue, 12 May 2015 21:23:09 +0000 (21:23 +0000)]
InstrProf: Update name of compiler-rt routine for setting filename

Patch by Teresa Johnson.

llvm-svn: 237186

9 years ago[PlaceSafepoints] Switch to being a FunctionPass
Philip Reames [Tue, 12 May 2015 21:21:18 +0000 (21:21 +0000)]
[PlaceSafepoints] Switch to being a FunctionPass

The pass doesn't actually modify the module outside of the function being processed. The only confusing piece is that it both inserts calls and then inlines the resulting calls. Given that, it definitely invalidates module level analysis results, but many FunctionPasses do that.

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

llvm-svn: 237185

9 years agoRevert accidental file checkin
Vince Harron [Tue, 12 May 2015 21:19:39 +0000 (21:19 +0000)]
Revert accidental file checkin

llvm-svn: 237184

9 years agoclang-format AllocateTarget. NFC
Douglas Katzman [Tue, 12 May 2015 21:18:10 +0000 (21:18 +0000)]
clang-format AllocateTarget. NFC

llvm-svn: 237183

9 years agoXFAIL'd TestPersistObjCPointeeType.py
Vince Harron [Tue, 12 May 2015 21:16:51 +0000 (21:16 +0000)]
XFAIL'd TestPersistObjCPointeeType.py

llvm-svn: 237182

9 years agofix formatting; NFC
Sanjay Patel [Tue, 12 May 2015 21:14:24 +0000 (21:14 +0000)]
fix formatting; NFC

llvm-svn: 237181

9 years ago[PlaceSafepoints] Make internal helper pass a FunctionPass
Philip Reames [Tue, 12 May 2015 21:09:36 +0000 (21:09 +0000)]
[PlaceSafepoints] Make internal helper pass a FunctionPass

Switch from using a LoopPass to using a FunctionPass for the internal helper analysis pass. The next step is going to be to make this a true analysis pass which is required by the PlaceSafepoints pass itself.

p.s. The interesting semantic part here is that we're changing the iteration order over the loops. It shouldn't matter, but that's the reason to separate this into it's own distinct patch.

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

llvm-svn: 237180

9 years agoARM: Remove Itineraries for swift CPU
Matthias Braun [Tue, 12 May 2015 21:07:54 +0000 (21:07 +0000)]
ARM: Remove Itineraries for swift CPU

They do more harm than good when used in the MachineScheduler as they
tend to take preference to register pressure minimsation which is more
important for swift.

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

llvm-svn: 237179

9 years agoPlatform settings doesn't need permission options.
Chaoren Lin [Tue, 12 May 2015 21:06:48 +0000 (21:06 +0000)]
Platform settings doesn't need permission options.

Summary:
Also removes conflict error message for '-w' between
--user-write and --working-dir.

Reviewers: flackr, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

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

llvm-svn: 237178

9 years agoCall system's sigfillset and sigprocmask functions from sanitizers
Ismail Pazarbasi [Tue, 12 May 2015 20:56:44 +0000 (20:56 +0000)]
Call system's sigfillset and sigprocmask functions from sanitizers

Reviewers: kcc, glider, dvyukov

Subscribers: llvm-commits

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

llvm-svn: 237177

9 years ago[PlaceSafepoints] Use analysis infrastructure to get dominator tree
Philip Reames [Tue, 12 May 2015 20:56:33 +0000 (20:56 +0000)]
[PlaceSafepoints] Use analysis infrastructure to get dominator tree

The old code computed dominators for every loop. This was terribly slow with no good reason. Just use the standard infrastructure for analysis passes.

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

llvm-svn: 237176

9 years ago[X86] Always return the sret parameter in eax/rax, even on 32-bit
Reid Kleckner [Tue, 12 May 2015 20:56:32 +0000 (20:56 +0000)]
[X86] Always return the sret parameter in eax/rax, even on 32-bit

Summary:
This rule was always in the old SysV i386 ABI docs and the new ones that
H.J. Lu has put together, but we never noticed:

  EAX   scratch register; also used to return integer and pointer values
        from functions; also stores the address of a returned struct or union

Fixes PR23491.

Reviewers: majnemer

Subscribers: llvm-commits

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

llvm-svn: 237175

9 years agoAdded minor comment
Vince Harron [Tue, 12 May 2015 20:55:43 +0000 (20:55 +0000)]
Added minor comment

llvm-svn: 237174

9 years agoSanitizers: Implement `GetRSS` on Mac OS X
Ismail Pazarbasi [Tue, 12 May 2015 20:47:21 +0000 (20:47 +0000)]
Sanitizers: Implement `GetRSS` on Mac OS X

Reviewers: kcc, glider, dvyukov

Subscribers: llvm-commits

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

llvm-svn: 237173

9 years ago[PlaceSafepoints] Remove dependence on LoopSimplify
Philip Reames [Tue, 12 May 2015 20:43:48 +0000 (20:43 +0000)]
[PlaceSafepoints] Remove dependence on LoopSimplify

As a step towards getting rid of internal pass manager hack entirely, remove the need for loop simplify to run in the inner pass manager. The new code does produce slightly different loop structures, so this isn't technically NFC.

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

llvm-svn: 237172

9 years agoList Alexey Bataev as code owner for Clang's OpenMP support, as discussed offline.
Richard Smith [Tue, 12 May 2015 20:29:41 +0000 (20:29 +0000)]
List Alexey Bataev as code owner for Clang's OpenMP support, as discussed offline.

Thanks for all your hard work getting us OpenMP feature-complete, Alexey!

llvm-svn: 237171

9 years ago[PATCH] [HEXAGON] Add a test program to verify calling convention
Sundeep Kushwaha [Tue, 12 May 2015 20:13:10 +0000 (20:13 +0000)]
[PATCH] [HEXAGON] Add a test program to verify calling convention
for large struct return by value.

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

llvm-svn: 237170

9 years agoConvert PHI getIncomingValue() to foreach over incoming_values(). NFC.
Pete Cooper [Tue, 12 May 2015 20:05:31 +0000 (20:05 +0000)]
Convert PHI getIncomingValue() to foreach over incoming_values().  NFC.

We already had a method to iterate over all the incoming values of a PHI.  This just changes all eligible code to use it.

Ineligible code included anything which cared about the index, or was also trying to get the i'th incoming BB.

llvm-svn: 237169

9 years agoAdd a const method to iterator over PHI incoming values.
Pete Cooper [Tue, 12 May 2015 20:05:23 +0000 (20:05 +0000)]
Add a const method to iterator over PHI incoming values.

This will be used in the next commit which converts code to use incoming_values().

llvm-svn: 237168

9 years agoConstify method. NFC
Pete Cooper [Tue, 12 May 2015 20:05:20 +0000 (20:05 +0000)]
Constify method.  NFC

llvm-svn: 237167

9 years ago[Statepoints] Split the calling convention and statepoint flags operand to STATEPOINT...
Pat Gavlin [Tue, 12 May 2015 19:50:19 +0000 (19:50 +0000)]
[Statepoints] Split the calling convention and statepoint flags operand to STATEPOINT into two separate operands.

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

llvm-svn: 237166

9 years agoStrip trailing whitespace. NFC
Douglas Katzman [Tue, 12 May 2015 19:42:31 +0000 (19:42 +0000)]
Strip trailing whitespace. NFC

llvm-svn: 237165