platform/upstream/llvm.git
9 years ago[clang-tidy] Slighly clarified a comment.
Alexander Kornienko [Thu, 5 Mar 2015 14:58:03 +0000 (14:58 +0000)]
[clang-tidy] Slighly clarified a comment.

llvm-svn: 231370

9 years ago[clang-tidy] Replace unrecognized namespace ending comments.
Alexander Kornienko [Thu, 5 Mar 2015 14:56:11 +0000 (14:56 +0000)]
[clang-tidy] Replace unrecognized namespace ending comments.

Summary:
Replace unrecognized namespace ending comments. This will help in particular when a namespace ending comment is mistyped or doesn't fit the regexp for other reason, e.g.:

  namespace a {
  namespace b {
  namespace {
  } // anoynmous namespace
  } // b
  } // namesapce a

Reviewers: djasper

Reviewed By: djasper

Subscribers: curdeius, cfe-commits

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

llvm-svn: 231369

9 years agoFix -Woverflow warning in unittest.
Frederic Riss [Thu, 5 Mar 2015 14:43:15 +0000 (14:43 +0000)]
Fix -Woverflow warning in unittest.

llvm-svn: 231368

9 years agotsan: fix signal handling during stop-the-world
Dmitry Vyukov [Thu, 5 Mar 2015 14:37:28 +0000 (14:37 +0000)]
tsan: fix signal handling during stop-the-world

Long story short: stop-the-world briefly resets SIGSEGV handler to SIG_DFL.
This breaks programs that handle and continue after SIGSEGV (namely JVM).
See the test and comments for details.

This is reincarnation of reverted r229678 (http://reviews.llvm.org/D7722).
Changed:
- execute TracerThreadDieCallback only on tracer thread
- reset global data in TracerThreadSignalHandler/TracerThreadDieCallback
- handle EINTR from waitpid

Add 3 new test:
- SIGSEGV during leak checking
- StopTheWorld operation during signal storm from an external process
- StopTheWorld operation when the program generates and handles SIGSEGVs

http://reviews.llvm.org/D8032

llvm-svn: 231367

9 years agoTeach lowering to correctly handle invoke statepoint and gc results tied to them...
Igor Laevsky [Thu, 5 Mar 2015 14:11:21 +0000 (14:11 +0000)]
Teach lowering to correctly handle invoke statepoint and gc results tied to them. Note that we still can not lower gc.relocates for invoke statepoints.
Also it extracts getCopyFromRegs helper function in SelectionDAGBuilder as we need to be able to customize type of the register exported from basic block during lowering of the gc.result.

llvm-svn: 231366

9 years ago[clang-tidy] Fix diag message in clang-tidy misc-uniqueptr-reset-release if right...
Alexander Kornienko [Thu, 5 Mar 2015 13:53:21 +0000 (13:53 +0000)]
[clang-tidy] Fix diag message in clang-tidy misc-uniqueptr-reset-release if right side is rvalue

http://reviews.llvm.org/D8071

Patch by Alexey Sokolov!

llvm-svn: 231365

9 years ago[clang-tidy] Refactor: Move google clang-tidy checks to namespace clang::tidy::google
Alexander Kornienko [Thu, 5 Mar 2015 13:46:14 +0000 (13:46 +0000)]
[clang-tidy] Refactor: Move google clang-tidy checks to namespace clang::tidy::google

http://reviews.llvm.org/D7994

Patch by Richard Thomson!

llvm-svn: 231364

9 years agoRecommit "[IAS] Teach -cc1as about the 'target-abi' option."
Toma Tabacu [Thu, 5 Mar 2015 13:39:14 +0000 (13:39 +0000)]
Recommit "[IAS] Teach -cc1as about the 'target-abi' option."

Added a REQUIRES for the Mips target.
Also, switched to using plain CHECKs, at the suggestion of Eric Christopher.

llvm-svn: 231363

9 years agoFix compilation after 'Make DataLayout Non-Optional in the Module' commit
Tobias Grosser [Thu, 5 Mar 2015 09:48:20 +0000 (09:48 +0000)]
Fix compilation after 'Make DataLayout Non-Optional in the Module' commit

llvm-svn: 231362

9 years agoSymbolizer refactoring: Link symbolizer tools into a fallback chain
Kuba Brecka [Thu, 5 Mar 2015 09:47:13 +0000 (09:47 +0000)]
Symbolizer refactoring: Link symbolizer tools into a fallback chain

Reviewed at http://reviews.llvm.org/D8049

llvm-svn: 231361

9 years ago[PBQP] Use a local bit-matrix to speedup searching an edge in the graph.
Arnaud A. de Grandmaison [Thu, 5 Mar 2015 09:12:59 +0000 (09:12 +0000)]
[PBQP] Use a local bit-matrix to speedup searching an edge in the graph.

Build time (user time) for building llvm+clang+lldb in release mode:
 - default allocator: 9086 seconds
 - with PBQP: 9126 seconds
 - with PBQP + local bit matrix cache: 9097 seconds

llvm-svn: 231360

9 years ago[InstCombine] Fix an assertion when fmul has a ConstantExpr operand
Michael Kuperstein [Thu, 5 Mar 2015 08:38:57 +0000 (08:38 +0000)]
[InstCombine] Fix an assertion when fmul has a ConstantExpr operand

isNormalFp and isFiniteNonZeroFp should not assume vector operands can not be constant expressions.

Patch by Pawel Jurek <pawel.jurek@intel.com>
Differential Revision: http://reviews.llvm.org/D8053

llvm-svn: 231359

9 years agoRevert "[TableGen] Implement at least some support for multiple explicit results...
Craig Topper [Thu, 5 Mar 2015 07:17:52 +0000 (07:17 +0000)]
Revert "[TableGen] Implement at least some support for multiple explicit results in an instruction pattern. No functional change to existing patterns."

This is failing on several build bots.

llvm-svn: 231358

9 years ago[TableGen] Implement at least some support for multiple explicit results in an instru...
Craig Topper [Thu, 5 Mar 2015 07:11:36 +0000 (07:11 +0000)]
[TableGen] Implement at least some support for multiple explicit results in an instruction pattern. No functional change to existing patterns.

This should help with the AVX512 masked gather changes Elena is working on. This patch is derived from some of the changes Elena made to tablegen, but modified by me to support arbitrary number of results.

llvm-svn: 231357

9 years ago[TableGen] Add support constraining a vector type in a pattern to have a specific...
Craig Topper [Thu, 5 Mar 2015 07:11:34 +0000 (07:11 +0000)]
[TableGen] Add support constraining a vector type in a pattern to have a specific element type and for constraining a vector type to have the same number of elements as another vector type. This is useful for AVX512 mask operations so we relate the mask type to the type of the other arguments.

llvm-svn: 231356

9 years agoFix leftover Dependences.cpp -> DependenceInfo.cpp
Tobias Grosser [Thu, 5 Mar 2015 06:52:42 +0000 (06:52 +0000)]
Fix leftover Dependences.cpp -> DependenceInfo.cpp

llvm-svn: 231355

9 years ago[X86] Use vmovss to handle inserting an element into index 0 of a v8f32 vector of...
Craig Topper [Thu, 5 Mar 2015 06:38:42 +0000 (06:38 +0000)]
[X86] Use vmovss to handle inserting an element into index 0 of a v8f32 vector of zeros.

llvm-svn: 231354

9 years agoRemove useless break after return.
Frederic Riss [Thu, 5 Mar 2015 06:13:39 +0000 (06:13 +0000)]
Remove useless break after return.

Pointed out by Paul Robinson.

llvm-svn: 231353

9 years agoAdd a few more performance tips
Philip Reames [Thu, 5 Mar 2015 05:55:55 +0000 (05:55 +0000)]
Add a few more performance tips

These came from my own experience and may not apply equally to all use cases.  Any alternate perspective anyone has should be used to refine these.

As always, grammar and spelling adjustments are more than welcome.  Please just directly commit a fix if you see something problematic.

llvm-svn: 231352

9 years agoRevert "[dsymutil] MSVC does generate move constructors, but it should accept to...
Frederic Riss [Thu, 5 Mar 2015 05:29:05 +0000 (05:29 +0000)]
Revert "[dsymutil] MSVC does generate move constructors, but it should accept to default them"

This reverts commit r231350.

It turns out MSVC doesn't generate implicit move constructors and also doesn't accept to default them...
See for example http://lab.llvm.org:8011/builders/lldb-x86-windows-msvc/builds/2786

llvm-svn: 231351

9 years ago[dsymutil] MSVC does generate move constructors, but it should accept to default...
Frederic Riss [Thu, 5 Mar 2015 05:17:06 +0000 (05:17 +0000)]
[dsymutil] MSVC does generate move constructors, but it should accept to default them

llvm-svn: 231350

9 years agoAdd a link to the new PerformanceTips docs from the 3.7 release notes
Philip Reames [Thu, 5 Mar 2015 05:11:05 +0000 (05:11 +0000)]
Add a link to the new PerformanceTips docs from the 3.7 release notes

llvm-svn: 231349

9 years agoRevert r231324 "Remove the conditional addition of the execution dependency fixing"
Hans Wennborg [Thu, 5 Mar 2015 03:24:49 +0000 (03:24 +0000)]
Revert r231324 "Remove the conditional addition of the execution dependency fixing"

See PR22799.

llvm-svn: 231348

9 years ago[MBP] Use range based for-loops throughout this code. Several had
Chandler Carruth [Thu, 5 Mar 2015 03:19:05 +0000 (03:19 +0000)]
[MBP] Use range based for-loops throughout this code. Several had
already been added and the inconsistency made choosing names and
changing code more annoying. Plus, wow are they better for this code!

llvm-svn: 231347

9 years ago[test] Expand a bit on the test case from r231251. NFC.
Argyrios Kyrtzidis [Thu, 5 Mar 2015 03:12:33 +0000 (03:12 +0000)]
[test] Expand a bit on the test case from r231251. NFC.

llvm-svn: 231346

9 years agoRemove dead code.
Rui Ueyama [Thu, 5 Mar 2015 02:58:13 +0000 (02:58 +0000)]
Remove dead code.

This hook is called from one of the hottest loops in LLD and does nothing.

llvm-svn: 231345

9 years agoFix build with GCC:
Nick Lewycky [Thu, 5 Mar 2015 02:56:05 +0000 (02:56 +0000)]
Fix build with GCC:
 - GCC doesn't support #pragma mark, only Apple GCC and clang. Wrap the pragma mark's in #if 0 to make gcc ignore them but xcode still see them.
 - Wrap a bunch of "#pragma clang" lines in #ifdef __clang__.
 - Pacify gcc's -Wparenthesis in a case where it's quite reasonable.

llvm-svn: 231344

9 years ago[sanitizer] add a run-time flag to dump the coverage counter bitset
Kostya Serebryany [Thu, 5 Mar 2015 02:48:51 +0000 (02:48 +0000)]
[sanitizer] add a run-time flag to dump the coverage counter bitset

llvm-svn: 231343

9 years agoAdd support for the DWARFv3 (circa 2005) DW_OP_form_tls_address
Jason Molenda [Thu, 5 Mar 2015 02:42:06 +0000 (02:42 +0000)]
Add support for the DWARFv3 (circa 2005) DW_OP_form_tls_address
operator in addition to the vendor-extension DW_OP_GNU_push_tls_address.
clang on PS4 and Darwin will be emitting the standard opcode
as of r231286 via http://reviews.llvm.org/D8018

Behavior of this standard  opcode is the same as
DW_OP_GNU_push_tls_address.

<rdar://problem/20043195>

llvm-svn: 231342

9 years ago[MBP] NFC, run clang-format over this code and tweak things to make the
Chandler Carruth [Thu, 5 Mar 2015 02:35:31 +0000 (02:35 +0000)]
[MBP] NFC, run clang-format over this code and tweak things to make the
result reasonable.

This code predated clang-format and so there was a reasonable amount of
crufty formatting that had accumulated. This should ensure that neither
myself nor others end up with formatting-only changes sneaking into
other fixes.

llvm-svn: 231341

9 years ago[MBP] This is no longer 'block-placement2'. ;] The old variants are long
Chandler Carruth [Thu, 5 Mar 2015 02:28:25 +0000 (02:28 +0000)]
[MBP] This is no longer 'block-placement2'. ;] The old variants are long
gone, update this code to reflect that.

llvm-svn: 231340

9 years agoFix msvc-link.c test for environments with link.exe on PATH
Hans Wennborg [Thu, 5 Mar 2015 02:26:58 +0000 (02:26 +0000)]
Fix msvc-link.c test for environments with link.exe on PATH

Patch by Michael Edwards!

llvm-svn: 231339

9 years agoUse the existing begin and end symbol for debug info.
Rafael Espindola [Thu, 5 Mar 2015 02:05:42 +0000 (02:05 +0000)]
Use the existing begin and end symbol for debug info.

llvm-svn: 231338

9 years ago[sanitizer] use simpler symbolizer interface (GetModuleNameForPc) where applicable
Kostya Serebryany [Thu, 5 Mar 2015 01:30:36 +0000 (01:30 +0000)]
[sanitizer] use simpler symbolizer interface (GetModuleNameForPc) where applicable

llvm-svn: 231337

9 years agoReformat.
NAKAMURA Takumi [Thu, 5 Mar 2015 01:25:19 +0000 (01:25 +0000)]
Reformat.

llvm-svn: 231336

9 years agoRevert r231103, "FullDependenceAnalysis: Avoid using the (deprecated in C++11) copy...
NAKAMURA Takumi [Thu, 5 Mar 2015 01:25:12 +0000 (01:25 +0000)]
Revert r231103, "FullDependenceAnalysis: Avoid using the (deprecated in C++11) copy ctor"

It is miscompiled on msc18.

llvm-svn: 231335

9 years agoRevert r231104, "unique_ptrify FullDependenceAnalysis::DV", to appease msc18 C2280.
NAKAMURA Takumi [Thu, 5 Mar 2015 01:25:06 +0000 (01:25 +0000)]
Revert r231104, "unique_ptrify FullDependenceAnalysis::DV", to appease msc18 C2280.

llvm-svn: 231334

9 years ago[sanitizer] add nosanitize metadata to more coverage instrumentation instructions
Kostya Serebryany [Thu, 5 Mar 2015 01:20:05 +0000 (01:20 +0000)]
[sanitizer] add nosanitize metadata to more coverage instrumentation instructions

llvm-svn: 231333

9 years ago[MBP] Revert r231238 which attempted to fix a nasty bug where MBP is
Chandler Carruth [Thu, 5 Mar 2015 01:07:03 +0000 (01:07 +0000)]
[MBP] Revert r231238 which attempted to fix a nasty bug where MBP is
just arbitrarily interleaving unrelated control flows once they get
moved "out-of-line" (both outside of natural CFG ordering and with
diamonds that cannot be fully laid out by chaining fallthrough edges).

This easy solution doesn't work in practice, and it isn't just a small
bug. It looks like a very different strategy will be required. I'm
working on that now, and it'll again go behind some flag so that
everyone can experiment and make sure it is working well for them.

llvm-svn: 231332

9 years agoScalarEvolution.cpp: Appease g++-4.7. He missed implicit "this" in lambda.
NAKAMURA Takumi [Thu, 5 Mar 2015 01:02:45 +0000 (01:02 +0000)]
ScalarEvolution.cpp: Appease g++-4.7. He missed implicit "this" in lambda.

llvm-svn: 231331

9 years agoRemove else if a last block ends with return.
Rui Ueyama [Thu, 5 Mar 2015 01:02:20 +0000 (01:02 +0000)]
Remove else if a last block ends with return.

llvm-svn: 231330

9 years agoRemove redundant virtual destructor.
Rui Ueyama [Thu, 5 Mar 2015 00:55:04 +0000 (00:55 +0000)]
Remove redundant virtual destructor.

DefinedAtom, which is the base class of ELFCommonAtom, has a
virtual destructor, so this is redundant.

llvm-svn: 231329

9 years agoMS ABI: Implement support for throwing a C++ exception
David Majnemer [Thu, 5 Mar 2015 00:46:22 +0000 (00:46 +0000)]
MS ABI: Implement support for throwing a C++ exception

Throwing a C++ exception, under the MS ABI, is implemented using three
components:
- ThrowInfo structure which contains information like CV qualifiers,
  what destructor to call and a pointer to the CatchableTypeArray.
- In a significant departure from the Itanium ABI, copying by-value
  occurs in the runtime and not at the catch site.  This means we need
  to enumerate all possible types that this exception could be caught as
  and encode the necessary information to convert from the exception
  object's type to the catch handler's type.  This includes complicated
  derived to base conversions and the execution of copy-constructors.

N.B. This implementation doesn't support the execution of a
copy-constructor from within the runtime for now.  Adding support for
that functionality is quite difficult due to things like default
argument expressions which may evaluate arbitrary code hiding in the
copy-constructor's parameters.

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

llvm-svn: 231328

9 years agoCreate a dependence struct to hold dependence information for a SCoP.
Johannes Doerfert [Thu, 5 Mar 2015 00:43:48 +0000 (00:43 +0000)]
Create a dependence struct to hold dependence information for a SCoP.

  The new Dependences struct in the DependenceInfo holds all information
  that was formerly part of the DependenceInfo. It also provides the
  same interface for the user to access this information.

  This is another step to a more general ScopPass interface that does
  allow multiple SCoPs to be "in flight".

llvm-svn: 231327

9 years agoAdd missing forward declaration [NFC]
Johannes Doerfert [Thu, 5 Mar 2015 00:40:07 +0000 (00:40 +0000)]
Add missing forward declaration [NFC]

llvm-svn: 231326

9 years ago[ASan] Fix asan-(32|64)-bits lit tests feature.
Alexey Samsonov [Thu, 5 Mar 2015 00:33:11 +0000 (00:33 +0000)]
[ASan] Fix asan-(32|64)-bits lit tests feature.

It broke down at some point, and all tests with
  REQUIRES: asan-(32|64)-bits
line stopped being executed. Restore the intended behavior.

llvm-svn: 231325

9 years agoRemove the conditional addition of the execution dependency fixing
Eric Christopher [Thu, 5 Mar 2015 00:28:55 +0000 (00:28 +0000)]
Remove the conditional addition of the execution dependency fixing
pass from the ARM backend as the pass itself will detect any use
of the appropriate register class.

llvm-svn: 231324

9 years agoCleanup and remove a chunk of getARMSubtarget calls in the
Eric Christopher [Thu, 5 Mar 2015 00:23:40 +0000 (00:23 +0000)]
Cleanup and remove a chunk of getARMSubtarget calls in the
ARM TargetMachine pass pipeline construction by pushing them down
into the appropriate pass.

llvm-svn: 231323

9 years agoTurn off .debug_pubnames/pubtypes for PS4.
Paul Robinson [Thu, 5 Mar 2015 00:08:27 +0000 (00:08 +0000)]
Turn off .debug_pubnames/pubtypes for PS4.

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

llvm-svn: 231322

9 years agoUse range-based for loops to iterate over file nodes.
Rui Ueyama [Thu, 5 Mar 2015 00:07:38 +0000 (00:07 +0000)]
Use range-based for loops to iterate over file nodes.

I converted them to non-range-based loops in r226883 and r226893
because at that moment File::parse() may have side effects and
may update the vector that the reference returned from
LinkingContext::nodes().

Now File::parse() is free from side effects. We can use range-based
loops again.

llvm-svn: 231321

9 years agoGive some obj-c rewriter tests that use MS pragmas a triple as a speculative fix
Reid Kleckner [Thu, 5 Mar 2015 00:04:18 +0000 (00:04 +0000)]
Give some obj-c rewriter tests that use MS pragmas a triple as a speculative fix

llvm-svn: 231320

9 years ago[sanitizer] when dumping coverage bitset, dump seperate file for every module, instea...
Kostya Serebryany [Wed, 4 Mar 2015 23:41:55 +0000 (23:41 +0000)]
[sanitizer] when dumping coverage bitset, dump seperate file for every module, instead of dumping a single combined bitset

llvm-svn: 231319

9 years agoTemporary XFAILs for Hexagon
Rick Foos [Wed, 4 Mar 2015 23:40:38 +0000 (23:40 +0000)]
Temporary XFAILs for Hexagon

Summary: Temporary XFAIL's until patches done.

Reviewers: echristo, adasgupt, colinl

Reviewed By: colinl

Subscribers: llvm-commits

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

llvm-svn: 231318

9 years agoImplement section pragma feedback on r205810
Reid Kleckner [Wed, 4 Mar 2015 23:39:17 +0000 (23:39 +0000)]
Implement section pragma feedback on r205810

Mostly short-circuits some conditionals.  Adds target validation of
sections passed to these pragmas.

llvm-svn: 231317

9 years agoPECOFF: Update comments on .drectve section encoding.
Rui Ueyama [Wed, 4 Mar 2015 23:22:48 +0000 (23:22 +0000)]
PECOFF: Update comments on .drectve section encoding.

llvm-svn: 231316

9 years agoAppease the Windows bot
Enrico Granata [Wed, 4 Mar 2015 23:19:36 +0000 (23:19 +0000)]
Appease the Windows bot

llvm-svn: 231315

9 years ago[analyzer] Bug fix: do not report leaks for alloca()
Anton Yartsev [Wed, 4 Mar 2015 23:18:21 +0000 (23:18 +0000)]
[analyzer] Bug fix: do not report leaks for alloca()

llvm-svn: 231314

9 years agoInitializer lists are supported in MSVC 2013. Since that's our minimum required versi...
Aaron Ballman [Wed, 4 Mar 2015 23:17:31 +0000 (23:17 +0000)]
Initializer lists are supported in MSVC 2013. Since that's our minimum required version, we can move that to the list of acceptable C++11 features.

llvm-svn: 231313

9 years agoPass -dll to link.exe when building with -shared (PR22697)
Hans Wennborg [Wed, 4 Mar 2015 23:16:21 +0000 (23:16 +0000)]
Pass -dll to link.exe when building with -shared (PR22697)

And start building a test for non-clang-cl link.exe invocations.

llvm-svn: 231312

9 years agoMove the <dynarray> tests out of the std/ hierarchy, since it's not really part of...
Marshall Clow [Wed, 4 Mar 2015 23:09:15 +0000 (23:09 +0000)]
Move the <dynarray> tests out of the std/ hierarchy, since it's not really part of the standard any more.

llvm-svn: 231311

9 years agoIntroduce lldbassert(x)
Enrico Granata [Wed, 4 Mar 2015 22:59:20 +0000 (22:59 +0000)]
Introduce lldbassert(x)

We would like it if LLDB never crashed, especially if we never caused LLDB to crash
On the other hand, having assertions can sometimes be useful

lldbassert(x) is the best of both worlds:
- in debug builds, it turns into a regular assert, which is fine because we don't mind debug LLDB to crash on development machines
- in non-debug builds, it emits a message formatted just like assert(x) would, but then instead of crashing, it dumps a backtrace, suggests filing a bug, and keeps running

llvm-svn: 231310

9 years ago[Support] Increase timeout for the LockFileManager back to 5 mins.
Argyrios Kyrtzidis [Wed, 4 Mar 2015 22:54:38 +0000 (22:54 +0000)]
[Support] Increase timeout for the LockFileManager back to 5 mins.

Waiting for just 1 min may not be enough for some contexts.

llvm-svn: 231309

9 years agoRename the Dependences pass to DependenceInfo [NFC]
Johannes Doerfert [Wed, 4 Mar 2015 22:43:40 +0000 (22:43 +0000)]
Rename the Dependences pass to DependenceInfo [NFC]

  We rename the Dependences pass to DependenceInfo as a first step to a
  caching pass policy. The new DependenceInfo pass will later provide
  "Dependences" for a SCoP.

  To keep consistency the test folder is renamed too.

llvm-svn: 231308

9 years agoImprove test robustness
Matthias Braun [Wed, 4 Mar 2015 22:31:18 +0000 (22:31 +0000)]
Improve test robustness

Improve test robustness in preparation of coming commits:
- Avoid undefs which may get propagated too much.
- Remove several pointless add 0, instructions

llvm-svn: 231307

9 years ago[IndVarSimplify] use the "canonical" way to infer no-wrap.
Sanjoy Das [Wed, 4 Mar 2015 22:24:23 +0000 (22:24 +0000)]
[IndVarSimplify] use the "canonical" way to infer no-wrap.

Summary:
rL225282 introduced an ad-hoc way to promote some additions to nuw or
nsw.  Since then SCEV has become smarter in directly proving no-wrap;
and using the canonical "ext(A op B) == ext(A) op ext(B)" method of
proving no-wrap is just as powerful now.  Rip out the existing
complexity in favor of getting SCEV to do all the heaving lifting
internally.

This change does not add any unit tests because it is supposed to be a
non-functional change.  Tests added in rL225282 and rL226075 are valid
tests for this change.

Reviewers: atrick, majnemer

Subscribers: llvm-commits

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

llvm-svn: 231306

9 years ago[SCEV] make SCEV smarter about proving no-wrap.
Sanjoy Das [Wed, 4 Mar 2015 22:24:17 +0000 (22:24 +0000)]
[SCEV] make SCEV smarter about proving no-wrap.

Summary:
Teach SCEV to prove no overflow for an add recurrence by proving
something about the range of another add recurrence a loop-invariant
distance away from it.

Reviewers: atrick, hfinkel

Subscribers: llvm-commits

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

llvm-svn: 231305

9 years agoSimplify dropConstantScheduleDims [NFC]
Johannes Doerfert [Wed, 4 Mar 2015 22:23:21 +0000 (22:23 +0000)]
Simplify dropConstantScheduleDims [NFC]

llvm-svn: 231304

9 years agoProvide an explicit move ctor because MSVC can't synthesize one
David Blaikie [Wed, 4 Mar 2015 22:20:52 +0000 (22:20 +0000)]
Provide an explicit move ctor because MSVC can't synthesize one

llvm-svn: 231303

9 years agoFix the clang self-host -Werror build
David Blaikie [Wed, 4 Mar 2015 22:15:41 +0000 (22:15 +0000)]
Fix the clang self-host -Werror build

Sorry about the breakage.

llvm-svn: 231302

9 years agoPECOFF: Do not add layout-after edges.
Rui Ueyama [Wed, 4 Mar 2015 22:13:25 +0000 (22:13 +0000)]
PECOFF: Do not add layout-after edges.

The last use of layout-after edge for PE/COFF was removed in r231290.
Now layout-after edges do nothing. We can stop adding them to the graph.
No functionality change intended.

llvm-svn: 231301

9 years ago[dsymutil] Add minimal code to emit DIE trees.
Frederic Riss [Wed, 4 Mar 2015 22:07:44 +0000 (22:07 +0000)]
[dsymutil] Add minimal code to emit DIE trees.

This commit adds code to emit DIE trees that have been pruned from the
parts that haven't been marked as kept in the previous pass.

It works by 'cloning' the input DIE tree (as read by libDebugInfoDwarf)
into a tree of DIE objects. Cloning the DIEs means essentially cloning
their attributes. The code in this commit does only handle scalar and
block attributes (scalar because they are trivial, blocks because they
can't be easily replaced by a scalr placeholder), all the other ones
are replaced by placeholder zero values and will be handled in
further commits.

The added tests mostly check that the DIE tree has the correct layout and
also verify that a few chosen scalar and block attributes correctly make
their way into the output.

llvm-svn: 231300

9 years agoDWARFFormValue: Add getAsSignedConstant method.
Frederic Riss [Wed, 4 Mar 2015 22:07:41 +0000 (22:07 +0000)]
DWARFFormValue: Add getAsSignedConstant method.

The implementation accepts explicitely signed forms (DW_FORM_sdata),
but also unsigned forms as long as they fit in an int64_t.

llvm-svn: 231299

9 years agoTeach DIEInteger to emit FORM_strp and FORM_ref_addr attributes.
Frederic Riss [Wed, 4 Mar 2015 22:07:36 +0000 (22:07 +0000)]
Teach DIEInteger to emit FORM_strp and FORM_ref_addr attributes.

To be used/tested by llvm-dsymutil. (llvm-dsymutil does a 'static' link,
no need for relocations for most things, so it'll just emit raw integers
for most attributes)

llvm-svn: 231298

9 years agoMake the DWARFAbbreviationDeclaration::AttributeSpec type public.
Frederic Riss [Wed, 4 Mar 2015 22:07:30 +0000 (22:07 +0000)]
Make the DWARFAbbreviationDeclaration::AttributeSpec type public.

It was already exposed through the iterators anyway.

llvm-svn: 231297

9 years agoUpdate LangRef for explicit type changes to 'load' instruction
David Blaikie [Wed, 4 Mar 2015 22:06:14 +0000 (22:06 +0000)]
Update LangRef for explicit type changes to 'load' instruction

llvm-svn: 231296

9 years agoExpand variables when evaluating absolute expressions.
Rafael Espindola [Wed, 4 Mar 2015 22:03:21 +0000 (22:03 +0000)]
Expand variables when evaluating absolute expressions.

This allows for variables to be used in .size.
This matches gnu AS functionality.

llvm-svn: 231295

9 years agoUpdate LangRef for getelementptr explicit type changes
David Blaikie [Wed, 4 Mar 2015 22:02:58 +0000 (22:02 +0000)]
Update LangRef for getelementptr explicit type changes

Here's a rough/first draft - it at least hits the actual textual IR
examples and some of the phrasing. It's probably worth a full pass over,
but I'm not sure how much these docs should reflect the strange
intermediate state we're in anyway.

Totally open to lots of review/feedback/suggestions.

llvm-svn: 231294

9 years ago[Sanitizer] Fix/suppress compiler warnings in unit tests.
Alexey Samsonov [Wed, 4 Mar 2015 21:54:20 +0000 (21:54 +0000)]
[Sanitizer] Fix/suppress compiler warnings in unit tests.

llvm-svn: 231293

9 years agodon't repeat class / function / variable names in comments; NFC
Sanjay Patel [Wed, 4 Mar 2015 21:49:03 +0000 (21:49 +0000)]
don't repeat class / function / variable names in comments; NFC

llvm-svn: 231292

9 years agoAdd Clang support for PPC cryptography builtins
Nemanja Ivanovic [Wed, 4 Mar 2015 21:48:22 +0000 (21:48 +0000)]
Add Clang support for PPC cryptography builtins
Review: http://reviews.llvm.org/D7951

llvm-svn: 231291

9 years agoDefine DefinedAtom::sectionSize.
Rui Ueyama [Wed, 4 Mar 2015 21:40:46 +0000 (21:40 +0000)]
Define DefinedAtom::sectionSize.

Merge::mergeByLargestSection is half-baked since it's defined
in terms of section size, there's no way to get the section size
of an atom.

Currently we work around the issue by traversing the layout edges
to both directions and calculate the sum of all atoms reachable.
I wrote that code but I knew it's hacky. It's even not guaranteed
to work. If you add layout edges before the core linking, it
miscalculates a size.

Also it's of course slow. It's basically a linked list traversal.

In this patch I added DefinedAtom::sectionSize so that we can use
that for mergeByLargestSection. I'm not very happy to add a new
field to DefinedAtom base class, but I think it's legitimate since
mergeByLargestSection is defined for section size, and the section
size is currently just missing.

http://reviews.llvm.org/D7966

llvm-svn: 231290

9 years agoExclude LLVM sources from lint check.
Alexey Samsonov [Wed, 4 Mar 2015 21:38:10 +0000 (21:38 +0000)]
Exclude LLVM sources from lint check.

Checking files from different repository is not nice, and LLVM code
follows its own style guide anyway.

llvm-svn: 231289

9 years agoAdd a required #include
Enrico Granata [Wed, 4 Mar 2015 21:33:45 +0000 (21:33 +0000)]
Add a required #include

llvm-svn: 231288

9 years agoFix a thinko in the case where we return a launch error with no error
Jim Ingham [Wed, 4 Mar 2015 21:28:55 +0000 (21:28 +0000)]
Fix a thinko in the case where we return a launch error with no error
string.  Return "<unknown error>" rather than the empty launch error...

<rdar://problem/20026469>

llvm-svn: 231287

9 years agoSupport standard DWARF TLS opcode; Darwin and PS4 use it.
Paul Robinson [Wed, 4 Mar 2015 20:55:11 +0000 (20:55 +0000)]
Support standard DWARF TLS opcode; Darwin and PS4 use it.

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

llvm-svn: 231286

9 years agoAdd LLVM support for PPC cryptography builtins
Nemanja Ivanovic [Wed, 4 Mar 2015 20:44:33 +0000 (20:44 +0000)]
Add LLVM support for PPC cryptography builtins
Review: http://reviews.llvm.org/D7955

llvm-svn: 231285

9 years agoTry to satisfy sanitizer lint check
Reid Kleckner [Wed, 4 Mar 2015 20:38:59 +0000 (20:38 +0000)]
Try to satisfy sanitizer lint check

llvm-svn: 231284

9 years ago[sanitizer] Since x32 runs under 64-bit kernel, GetKernelAreaSize should return 0
Kostya Serebryany [Wed, 4 Mar 2015 20:32:06 +0000 (20:32 +0000)]
[sanitizer] Since x32 runs under 64-bit kernel, GetKernelAreaSize should return 0

llvm-svn: 231283

9 years agoAdd a FIXME for PR22796, broken ordering of ClassInfo in TableGen
David Blaikie [Wed, 4 Mar 2015 19:56:44 +0000 (19:56 +0000)]
Add a FIXME for PR22796, broken ordering of ClassInfo in TableGen

As discussed (at length) in code review of r222935, with Duncan.

llvm-svn: 231282

9 years agoRemove unnecessary dynamic memory management
Tobias Grosser [Wed, 4 Mar 2015 19:33:31 +0000 (19:33 +0000)]
Remove unnecessary dynamic memory management

llvm-svn: 231281

9 years agoFix test/CodeGen/builtins.c for platforms that don't lower sjlj
Reid Kleckner [Wed, 4 Mar 2015 19:24:16 +0000 (19:24 +0000)]
Fix test/CodeGen/builtins.c for platforms that don't lower sjlj

Opt in Win64 to supporting sjlj lowering. We have the backend lowering,
so I think this was just an oversight because WinX86_64TargetCodeGenInfo
doesn't inherit from X86_64TargetCodeGenInfo.

llvm-svn: 231280

9 years agoFix the build of the gold-plugin and examples.
Rafael Espindola [Wed, 4 Mar 2015 19:15:29 +0000 (19:15 +0000)]
Fix the build of the gold-plugin and examples.

llvm-svn: 231279

9 years agoTry to fix the build after removing DataLayoutPass
Reid Kleckner [Wed, 4 Mar 2015 19:10:41 +0000 (19:10 +0000)]
Try to fix the build after removing DataLayoutPass

llvm-svn: 231278

9 years agoAdd missing <atomic> include to PassRegistry.h
Reid Kleckner [Wed, 4 Mar 2015 19:06:17 +0000 (19:06 +0000)]
Add missing <atomic> include to PassRegistry.h

llvm-svn: 231277

9 years agoAdd a lock() function in PassRegistry to speed up multi-thread synchronization.
Erik Eckstein [Wed, 4 Mar 2015 18:57:11 +0000 (18:57 +0000)]
Add a lock() function in PassRegistry to speed up multi-thread synchronization.

When calling lock() after all passes are registered, the PassRegistry doesn't need a mutex anymore to look up passes.
This speeds up multithreaded llvm execution by ~5% (tested with 4 threads).
In an asserts build of llvm this has an even bigger impact.

Note that it's not required to use the lock function.

llvm-svn: 231276

9 years agoRecommit r231221: "Devirtualize ~parser<T> by making it protected in base classes...
David Blaikie [Wed, 4 Mar 2015 18:52:32 +0000 (18:52 +0000)]
Recommit r231221: "Devirtualize ~parser<T> by making it protected in base classes and making derived classes final"

Reverted in r231254 due to a self-hosting crash of Clang (see Clang
PR22793). Workaround the crash by using {} instead of = default to
define a dtor.

llvm-svn: 231274

9 years agoBring r231132 back with a fix.
Rafael Espindola [Wed, 4 Mar 2015 18:51:45 +0000 (18:51 +0000)]
Bring r231132 back with a fix.

The issue was that we were always printing the remarks. Fix that and add a test
showing that it prints nothing if -pass-remarks is not given.

Original message:
Correctly handle -pass-remarks in the gold plugin.

llvm-svn: 231273

9 years agoAllow to build shared libraries if BUILD_SHARED_LIBS is enabled
Tobias Grosser [Wed, 4 Mar 2015 18:51:27 +0000 (18:51 +0000)]
Allow to build shared libraries if BUILD_SHARED_LIBS is enabled

Contributed-by: Richard Membarth <richard.membarth@uni-saarland.de>
llvm-svn: 231272

9 years agoRemove "inline" from inlined functions.
Rui Ueyama [Wed, 4 Mar 2015 18:51:19 +0000 (18:51 +0000)]
Remove "inline" from inlined functions.

llvm-svn: 231271

9 years agoMake DataLayout Non-Optional in the Module
Mehdi Amini [Wed, 4 Mar 2015 18:43:29 +0000 (18:43 +0000)]
Make DataLayout Non-Optional in the Module

Summary:
DataLayout keeps the string used for its creation.

As a side effect it is no longer needed in the Module.
This is "almost" NFC, the string is no longer
canonicalized, you can't rely on two "equals" DataLayout
having the same string returned by getStringRepresentation().

Get rid of DataLayoutPass: the DataLayout is in the Module

The DataLayout is "per-module", let's enforce this by not
duplicating it more than necessary.
One more step toward non-optionality of the DataLayout in the
module.

Make DataLayout Non-Optional in the Module

Module->getDataLayout() will never returns nullptr anymore.

Reviewers: echristo

Subscribers: resistor, llvm-commits, jholewinski

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

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