lldb.git
6 years agoFold compares irrespective of whether allocation can be elided
Anna Thomas [Tue, 3 May 2016 14:58:21 +0000 (14:58 +0000)]
Fold compares irrespective of whether allocation can be elided

Summary
When a non-escaping pointer is compared to a global value, the
comparison can be folded even if the corresponding malloc/allocation
call cannot be elided.
We need to make sure the global value is not null, since comparisons to
null cannot be folded.

In future, we should also handle cases when the the comparison
instruction dominates the pointer escape.

Reviewers: sanjoy
Subscribers s.egerton, llvm-commits

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

llvm-svn: 268390

6 years ago[Sparc] Constification of TargetMachine arguments
James Y Knight [Tue, 3 May 2016 14:57:18 +0000 (14:57 +0000)]
[Sparc] Constification of TargetMachine arguments

This patch changes the TargetMachine arguments to be const. This is
required for {D19265}, and was requested to be done in a separate patch.

Patch by Jacob Hansen!

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

llvm-svn: 268389

6 years agoDon't depend on checking the response file when lld fails.
Rafael Espindola [Tue, 3 May 2016 14:29:42 +0000 (14:29 +0000)]
Don't depend on checking the response file when lld fails.

llvm-svn: 268388

6 years ago[clang][AVX512][BuiltIn] Adding intrinsics for cast{pd|ps|si}128_{pd|ps|si}512 and...
Michael Zuckerman [Tue, 3 May 2016 14:26:52 +0000 (14:26 +0000)]
[clang][AVX512][BuiltIn] Adding intrinsics for cast{pd|ps|si}128_{pd|ps|si}512 and castsi256_si512 instruction set

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

llvm-svn: 268387

6 years ago[mips][fastisel] ADJCALLSTACKUP has a second immediate operand.
Daniel Sanders [Tue, 3 May 2016 14:19:26 +0000 (14:19 +0000)]
[mips][fastisel] ADJCALLSTACKUP has a second immediate operand.

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

Reviewers: sdardis

Subscribers: dsanders, llvm-commits, sdardis

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

llvm-svn: 268386

6 years ago[Clang][avx512][Builtin] Adding intrinsics for cvtw2mask{128|256|512} instruction set
Michael Zuckerman [Tue, 3 May 2016 14:12:23 +0000 (14:12 +0000)]
[Clang][avx512][Builtin] Adding intrinsics for cvtw2mask{128|256|512} instruction set

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

llvm-svn: 268385

6 years agoRevert "Add a read_full_buffer argument to ConnectionFileDescriptor::Read"
Pavel Labath [Tue, 3 May 2016 14:07:41 +0000 (14:07 +0000)]
Revert "Add a read_full_buffer argument to ConnectionFileDescriptor::Read"

This reverts commit r268380 as it breaks windows build (I forgot to make neccesary adjustments to
ConnectionGenericFileWindows).

llvm-svn: 268384

6 years ago[mips] Fix unused variable warning for release builds introduced by r268379.
Daniel Sanders [Tue, 3 May 2016 14:00:37 +0000 (14:00 +0000)]
[mips] Fix unused variable warning for release builds introduced by r268379.

llvm-svn: 268383

6 years agotsan: update tsan_analyze to what tip clang generates
Dmitry Vyukov [Tue, 3 May 2016 13:59:41 +0000 (13:59 +0000)]
tsan: update tsan_analyze to what tip clang generates

We used to depend on host gcc. But some distributions got
new gcc recently which broke the check. Generally, we can't
depend that an arbitrary host gcc generates something stable.

Switch to clang.
This has an additional advantage of catching regressions in
clang codegen.

llvm-svn: 268382

6 years agoRemove unused includes.
Rafael Espindola [Tue, 3 May 2016 13:57:49 +0000 (13:57 +0000)]
Remove unused includes.

llvm-svn: 268381

6 years agoAdd a read_full_buffer argument to ConnectionFileDescriptor::Read
Pavel Labath [Tue, 3 May 2016 13:55:53 +0000 (13:55 +0000)]
Add a read_full_buffer argument to ConnectionFileDescriptor::Read

Summary:
AdbClient was attempting to handle the case where the socket input arrived in pieces, but it was
failing to handle the case where the connection was closed before that happened. In this case, it
would just spin in an infinite loop calling Connection::Read. (This was also the cause of the
spurious timeouts on the darwin->android buildbot. The exact cause of the premature EOF remains
to be investigated, but is likely a server bug.)

Since this wait-for-a-certain-number-of-bytes seems like a useful functionality to have, I am
moving it (with the infinite loop fixed) to the Connection class, and adding an
appropriate test for it.

Reviewers: clayborg, zturner, ovyalov

Subscribers: tberghammer, danalbert, lldb-commits

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

llvm-svn: 268380

6 years ago[mips] Use MipsMCExpr instead of MCSymbolRefExpr for all relocations.
Daniel Sanders [Tue, 3 May 2016 13:35:44 +0000 (13:35 +0000)]
[mips] Use MipsMCExpr instead of MCSymbolRefExpr for all relocations.

Summary:
This is much closer to the way MIPS relocation expressions work
(%hi(foo + 2) rather than %hi(foo) + 2) and removes the need for the
various bodges in MipsAsmParser::evaluateRelocExpr().

Removing those bodges ensures that the constant stored in MCValue is the
full 32 or 64-bit (depending on ABI) offset from the symbol. This will be used
to correct the %hi/%lo matching needed to sort the relocation table correctly.

As part of this:
* Gave MCExpr::print() the ability to omit parenthesis when emitting a
  symbol reference inside a MipsMCExpr operator like %hi(X). Without this
  we print things like %lo(($L1)).
* %hi(%neg(%gprel(X))) is now three MipsMCExpr's instead of one. Most of
  the related special cases have been removed or moved to MipsMCExpr. We
  can remove the rest as we gain support for the less common relocations
  when they are not part of this specific combination.
* Renamed MipsMCExpr::VariantKind and the enum prefix ('VK_') to avoid confusion
  with MCSymbolRefExpr::VariantKind and its prefix (also 'VK_').
* fixup_Mips_GOT_Local and fixup_Mips_GOT_Global were found to be identical
  and merged into fixup_Mips_GOT.
* MO_GOT16 and MO_GOT turned out to be identical and have been merged into
  MO_GOT.
* VK_Mips_GOT and VK_Mips_GOT16 turned out to be the same thing so they
  have been merged into MEK_GOT

Reviewers: sdardis

Subscribers: dsanders, sdardis, llvm-commits

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

llvm-svn: 268379

6 years ago[X86][SSSE3] Missing combine opportunity to simplify to a MOVQ shuffle
Simon Pilgrim [Tue, 3 May 2016 13:12:44 +0000 (13:12 +0000)]
[X86][SSSE3] Missing combine opportunity to simplify to a MOVQ shuffle

llvm-svn: 268378

6 years ago[Clang][AVX512][Builtin] Adding intrinsics for vcvt{ph|ps}2{ps|ph} instruction set
Michael Zuckerman [Tue, 3 May 2016 12:45:04 +0000 (12:45 +0000)]
[Clang][AVX512][Builtin] Adding intrinsics for vcvt{ph|ps}2{ps|ph} instruction set

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

llvm-svn: 268376

6 years ago[AVX512] Add support for commutative MAX/MIN . In general VMAX{PS,PD} and VMIN{PS...
Igor Breger [Tue, 3 May 2016 11:51:45 +0000 (11:51 +0000)]
[AVX512] Add support for commutative MAX/MIN . In general VMAX{PS,PD} and VMIN{PS,PD} instruction are not commutative . In combine pass only if UnsafeFPMath are used VMAX/VMAX are converted to commutative nodes VMAXC/VMAXC.

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

llvm-svn: 268375

6 years agoFix cppcoreguidelines-pro-type-member-init failure test on Windows.
Haojian Wu [Tue, 3 May 2016 11:19:46 +0000 (11:19 +0000)]
Fix cppcoreguidelines-pro-type-member-init failure test on Windows.

llvm-svn: 268374

6 years ago[Clang][AVX512][Builtin] Adding intrinsics for vcvttpd2udq instruction set
Michael Zuckerman [Tue, 3 May 2016 11:05:24 +0000 (11:05 +0000)]
[Clang][AVX512][Builtin] Adding intrinsics for vcvttpd2udq instruction set

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

llvm-svn: 268373

6 years ago[Clang][AVX512][BUILTIN] Adding intrinsics for compressstore{df|di|sf|si} instruction...
Michael Zuckerman [Tue, 3 May 2016 10:42:46 +0000 (10:42 +0000)]
[Clang][AVX512][BUILTIN] Adding intrinsics for compressstore{df|di|sf|si} instruction set.

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

llvm-svn: 268372

6 years ago[include-fixer] Abstract includeFixerMain function.
Haojian Wu [Tue, 3 May 2016 08:38:35 +0000 (08:38 +0000)]
[include-fixer] Abstract includeFixerMain function.

llvm-svn: 268371

6 years agoMark that SpeculativeExecution preserves Globals Alias Analysis.
Kristof Beyls [Tue, 3 May 2016 08:33:26 +0000 (08:33 +0000)]
Mark that SpeculativeExecution preserves Globals Alias Analysis.

A few benchmarks with lots of accesses to global variables in the hot
loops regressed a lot since r266399, which added the
SpeculativeExecution pass to the default pipeline. The problem is that
this pass doesn't mark Globals Alias Analysis as preserved. Globals
Alias Analysis is computed in a module pass, whereas
SpeculativeExecution is a function pass, and a lot of passes dependent
on the Globals Alias Analysis to optimize these benchmarks are also
function passes. As such, the Globals Alias Analysis information cannot
be recomputed between SpeculativeExecution and the following function
passes needing that information.

SpeculativeExecution doesn't invalidate Globals Alias Analysis, so mark
it as such to fix those performance regressions.

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

llvm-svn: 268370

6 years agoFix a crash in cppcoreguidelines-pro-type-member-init when checking a class that...
Haojian Wu [Tue, 3 May 2016 08:11:47 +0000 (08:11 +0000)]
Fix a crash in cppcoreguidelines-pro-type-member-init when checking a class that initializes itself as a base

Summary: Fix a crash when a record type initializes itself in its own base class initializer list.

Patch by Michael Miller!

Reviewers: alexfh, aaron.ballman, hokein

Subscribers: cfe-commits

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

llvm-svn: 268369

6 years ago[AVX512] Fix lowerV4X128VectorShuffle to select correctly input operands .
Igor Breger [Tue, 3 May 2016 08:08:44 +0000 (08:08 +0000)]
[AVX512] Fix lowerV4X128VectorShuffle to select correctly input operands .

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

llvm-svn: 268368

6 years ago[lib/Object] Make this assertion more useful.
Davide Italiano [Tue, 3 May 2016 07:30:56 +0000 (07:30 +0000)]
[lib/Object] Make this assertion more useful.

llvm-svn: 268367

6 years ago[libclang] Expose the ElaboratedType
Sergey Kalinichev [Tue, 3 May 2016 06:58:29 +0000 (06:58 +0000)]
[libclang] Expose the ElaboratedType

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

llvm-svn: 268366

6 years ago[CodeGen] Add some space optimized forms of EmitNode and MorphNodeTo that implicitly...
Craig Topper [Tue, 3 May 2016 05:54:13 +0000 (05:54 +0000)]
[CodeGen] Add some space optimized forms of EmitNode and MorphNodeTo that implicitly indicate the number of result VTs. This shaves about 16K off the X86 matching table taking it down to about 470K.

Overall this reduces the llc binary size with all in-tree targets by about 40K.

llvm-svn: 268365

6 years ago[OpenCL] Fix pipe type dump.
Xiuli Pan [Tue, 3 May 2016 05:37:07 +0000 (05:37 +0000)]
[OpenCL] Fix pipe type dump.

Summary:
Fix the dump of PipeType.
Now we will have "pipe int" and element type.

Reviewers: yaxunl, Anastasia

Subscribers: cfe-commits, bader

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

llvm-svn: 268364

6 years agoFix dependencies on install-libcxx CMake target
Eric Fiselier [Tue, 3 May 2016 05:34:38 +0000 (05:34 +0000)]
Fix dependencies on install-libcxx CMake target

llvm-svn: 268363

6 years agoFix uppercase typo
Matthias Braun [Tue, 3 May 2016 05:21:53 +0000 (05:21 +0000)]
Fix uppercase typo

llvm-svn: 268362

6 years agoRemove unused header, NFC
Vedant Kumar [Tue, 3 May 2016 05:05:38 +0000 (05:05 +0000)]
Remove unused header, NFC

llvm-svn: 268361

6 years agoAArch64/optimizeCondBranch: Remove earlier kill flag when forming TBZ
Matthias Braun [Tue, 3 May 2016 04:54:16 +0000 (04:54 +0000)]
AArch64/optimizeCondBranch: Remove earlier kill flag when forming TBZ

This fixes -verify-machineinstrs complaints when compiling
test-suite/SingleSource/Benchmarks/Shootout-C++/wordfreq.cpp

llvm-svn: 268360

6 years agoFix PR27538. Remove __is_convertible specializations for array and function types.
Eric Fiselier [Tue, 3 May 2016 04:26:02 +0000 (04:26 +0000)]
Fix PR27538. Remove __is_convertible specializations for array and function types.

This patch fixes a bunch of bugs in the fallback implementation of
is_convertible, which is used by GCC. Removing the "__is_convertible"
specializations for array/function types we fallback on the SFINAE test,
which is more correct.

See https://llvm.org/bugs/show_bug.cgi?id=27538

llvm-svn: 268359

6 years agotest commit
Jack Liu [Tue, 3 May 2016 04:06:24 +0000 (04:06 +0000)]
test commit

llvm-svn: 268358

6 years ago[LoopUnroll] Unroll loops which have exit blocks to EH pads
David Majnemer [Tue, 3 May 2016 03:57:40 +0000 (03:57 +0000)]
[LoopUnroll] Unroll loops which have exit blocks to EH pads

We were overly cautious in our analysis of loops which have invokes
which unwind to EH pads.  The loop unroll transform is safe because it
only clones blocks in the loop body, it does not try to split critical
edges involving EH pads.  Instead, move the necessary safety check to
LoopUnswitch.

N.B. The safety check for loop unswitch is covered by an existing test
which fails without it.

llvm-svn: 268357

6 years ago[clang-tidy] Cleanup namespace in utils folder.
Etienne Bergeron [Tue, 3 May 2016 02:54:05 +0000 (02:54 +0000)]
[clang-tidy] Cleanup namespace in utils folder.

Summary:
This is a step forward cleaning up the namespaces in clang-tidy/utils.
There is no behavior change.

Reviewers: alexfh

Subscribers: cfe-commits

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

llvm-svn: 268356

6 years ago[libcxx] [test] Replace non-Standard "atomic_flag f(false);" with Standard "atomic_fl...
Eric Fiselier [Tue, 3 May 2016 02:12:26 +0000 (02:12 +0000)]
[libcxx] [test] Replace non-Standard "atomic_flag f(false);" with Standard "atomic_flag f;"

Summary:
Replace non-Standard "atomic_flag f(false);" with Standard "atomic_flag f;" in clear tests.
Although the  value of 'f' is unspecified it shouldn't matter because these tests always call `f.test_and_set()` without checking the result, so the initial state shouldn't matter.

The test init03.pass.cpp is explicitly testing this non-Standard extension; It has been moved into the `test/libcxx` directory.

Reviewers: mclow.lists, STL_MSFT

Subscribers: cfe-commits

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

llvm-svn: 268355

6 years agoDon't use std::__clz in 'test/support/hexfloat.h'.
Eric Fiselier [Tue, 3 May 2016 02:04:26 +0000 (02:04 +0000)]
Don't use std::__clz in 'test/support/hexfloat.h'.

std::__clz is a libc++ specific function so it can't be used in the test suite.
This patch implements a dumb "count leading zeros" implementation within
hexfloat itself.

This patch also fixes UB since the output of `__builtin_clz(0)` is undefined
according to the GCC docs.

llvm-svn: 268354

6 years agoELF: Remove the function SymbolTable<ELFT>::findFile.
Peter Collingbourne [Tue, 3 May 2016 01:48:25 +0000 (01:48 +0000)]
ELF: Remove the function SymbolTable<ELFT>::findFile.

We already have the function SymbolBody::getSourceFile which does the same thing.

llvm-svn: 268353

6 years ago[clang-tidy] ProTypeMemberInitCheck - check that field decls do not have in-class...
Felix Berger [Tue, 3 May 2016 01:41:19 +0000 (01:41 +0000)]
[clang-tidy] ProTypeMemberInitCheck - check that field decls do not have in-class initializer.

Reviewers: alexfh, JVApen, aaron.ballman

Subscribers: flx, aaron.ballman, cfe-commits

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

llvm-svn: 268352

6 years agoTry harder to get the bots green.
Sean Silva [Tue, 3 May 2016 01:25:28 +0000 (01:25 +0000)]
Try harder to get the bots green.

The test is now unexpectedly passing on
llvm-clang-lld-x86_64-scei-ps4-ubuntu-fast which is treated as an error.
For now, disable Windows testing of the feature.
Rafael is working on generating an archive, which will hopefully allow
us to turn this test back on.

Unfortunately, we don't have a way to temporarily XFAIL this test just
on llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast.

llvm-svn: 268351

6 years agoELF: Forbid all relative relocations to absolute symbols in PIC, except for weak...
Peter Collingbourne [Tue, 3 May 2016 01:21:08 +0000 (01:21 +0000)]
ELF: Forbid all relative relocations to absolute symbols in PIC, except for weak undefined.

Weak undefined symbols resolve to the image base. This is a little strange,
but it allows us to link function calls to such symbols. Normally such a
call will be guarded with a comparison, which will load a zero from the GOT.

There's one example of such a function call in crti.o in Linux's CRT.

As part of this change, I also needed to make the synthetic start and end
symbols image base relative in the case where their sections were empty,
so that PC-relative references to those symbols would continue to work.

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

llvm-svn: 268350

6 years ago[Clang-tidy] Fix Clang-tidy modernize-use-override and some Include What You Use...
Eugene Zelenko [Tue, 3 May 2016 01:13:27 +0000 (01:13 +0000)]
[Clang-tidy] Fix Clang-tidy modernize-use-override and some Include What You Use warnings in modernize/MakeSmartPtrCheck.h.

llvm-svn: 268349

6 years agoChange operation_not_supported to not_supported.
Zachary Turner [Tue, 3 May 2016 00:53:16 +0000 (00:53 +0000)]
Change operation_not_supported to not_supported.

Apparently operation_not_supported is...  not supported everywhere.

llvm-svn: 268348

6 years ago[codeview] Maintain the type enum-to-classname mapping in the .def file
Reid Kleckner [Tue, 3 May 2016 00:45:14 +0000 (00:45 +0000)]
[codeview] Maintain the type enum-to-classname mapping in the .def file

This way it will be easy to stamp out something like a type visitor.

llvm-svn: 268347

6 years agoGuard use of <unistd.h> in test.
Eric Fiselier [Tue, 3 May 2016 00:36:57 +0000 (00:36 +0000)]
Guard use of <unistd.h> in test.

llvm-svn: 268346

6 years agoTemporarily disable this test on llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast
Sean Silva [Tue, 3 May 2016 00:36:15 +0000 (00:36 +0000)]
Temporarily disable this test on llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast

`REQUIRES: shell` is not appropriate because that would mean that there
are no windows bots testing this, and that is precisely where it needs
the most testing.

Rafael or Rui are working on generating an archive directly, which
should avoid this issue.
We can try to move the bot to a shorter build directory path.

llvm-svn: 268345

6 years agoAdding a test for a compiler crash that was fixed in r248069.
Douglas Yung [Tue, 3 May 2016 00:29:56 +0000 (00:29 +0000)]
Adding a test for a compiler crash that was fixed in r248069.

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

llvm-svn: 268344

6 years agoParse the TPI (type information) stream of PDB files.
Zachary Turner [Tue, 3 May 2016 00:28:21 +0000 (00:28 +0000)]
Parse the TPI (type information) stream of PDB files.

This parses the TPI stream (stream 2) from the PDB file. This stream
contains some header information followed by a series of codeview records.
There is some additional complexity here in that alongside this stream of
codeview records is a serialized hash table in order to efficiently query
the types. We parse the necessary bookkeeping information to allow us to
reconstruct the hash table, but we do not actually construct it yet as
there are still a few things that need to be understood first.

Differential Revision: http://reviews.llvm.org/D19840
Reviewed By: ruiu, rnk

llvm-svn: 268343

6 years agoMove llvm-readobj/StreamWriter to Support.
Zachary Turner [Tue, 3 May 2016 00:28:04 +0000 (00:28 +0000)]
Move llvm-readobj/StreamWriter to Support.

We wish to re-use this from llvm-pdbdump, and it provides a nice
way to print structured data in scoped format that could prove
useful for many other dumping tools as well.  Moving to support
and changing name to ScopedPrinter to better reflect its purpose.

llvm-svn: 268342

6 years agoThinLTO: do not import function whose linkage prevents inlining.
Mehdi Amini [Tue, 3 May 2016 00:27:28 +0000 (00:27 +0000)]
ThinLTO: do not import function whose linkage prevents inlining.

There is not point in importing a "weak" or a "linkonce" function
since we won't be able to inline it anyway.
We already had a targeted check for WeakAny, this is using the
same check on GlobalValue as the inline, i.e.
isMayBeOverriddenLinkage()

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

6 years agolivePhysRegs: Pass MBB by reference in addLive{Ins|Outs}(); NFC
Matthias Braun [Tue, 3 May 2016 00:24:32 +0000 (00:24 +0000)]
livePhysRegs: Pass MBB by reference in addLive{Ins|Outs}(); NFC

The block must no be nullptr for the addLiveIns()/addLiveOuts()
function.

llvm-svn: 268340

6 years agoMoved test case for r268323 to DebugInfo/X86 to unbreak aarch64.
Wolfgang Pieb [Tue, 3 May 2016 00:22:09 +0000 (00:22 +0000)]
Moved test case for r268323 to DebugInfo/X86 to unbreak aarch64.

llvm-svn: 268339

6 years agoAnother little example use of scripted thread plans.
Jim Ingham [Tue, 3 May 2016 00:14:52 +0000 (00:14 +0000)]
Another little example use of scripted thread plans.

llvm-svn: 268338

6 years agoAdding period to the end of a comment to test out commit access.
Douglas Yung [Tue, 3 May 2016 00:12:59 +0000 (00:12 +0000)]
Adding period to the end of a comment to test out commit access.

llvm-svn: 268337

6 years agoLivePhysRegs: Automatically determine presence of pristine regs.
Matthias Braun [Tue, 3 May 2016 00:08:46 +0000 (00:08 +0000)]
LivePhysRegs: Automatically determine presence of pristine regs.

Remove the AddPristinesAndCSRs parameters from
addLiveIns()/addLiveOuts().

We need to respect pristine registers after prologue epilogue insertion,
Seeing that we got this wrong in at least two commits already, we should
rather pay the small price to query MachineFrameInfo for it.

There are three cases that did not set AddPristineAndCSRs to true even
after register allocation:
- ExecutionDepsFix: live-out registers are used as a hint that the
  register is used soon. This is not true for pristine registers so
  use the new addLiveOutsNoPristines() to maintain this behaviour.
- SystemZShortenInst: Not setting AddPristineAndCSRs to true looks like
  a bug, should do the right thing automatically now.
- StackMapLivenessAnalysis: Not adding pristine registers looks like a
  bug to me. Added a FIXME comment but maintain the current behaviour
  as a change may need to get coordinated with GC runtimes.

llvm-svn: 268336

6 years agoMITests: Update libdeps.
NAKAMURA Takumi [Tue, 3 May 2016 00:04:07 +0000 (00:04 +0000)]
MITests: Update libdeps.

llvm-svn: 268335

6 years agoNFC: An iterator for stepping through CodeView type stream in llvm-readobj
Adrian McCarthy [Mon, 2 May 2016 23:45:03 +0000 (23:45 +0000)]
NFC: An iterator for stepping through CodeView type stream in llvm-readobj

This is a small refactoring step toward moving CodeView type stream logic from llvm-readobj to a library. It abstracts the logic of stepping through the stream into an iterator class and updates llvm-readobj to use that iterator. This has no functional change; llvm-readobj produces identical output.

The next step is to abstract the parsing of the different leaf types and then move that and the iterator into a library.

Since this is my first contrib outside LLDB, please let me know if I'm messing up on any of the LLVM style guidelines, idioms, or patterns.

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

llvm-svn: 268334

6 years agoPass all buffers to BuildId hash function at once. NFC.
Rui Ueyama [Mon, 2 May 2016 23:35:59 +0000 (23:35 +0000)]
Pass all buffers to BuildId hash function at once. NFC.

This change simplifies the BuildId classes by removing a few member
functions and variables from them. It should also make it easy to
parallelize hash computation in future because now each BuildId object
see all inputs rather than one at a time.

llvm-svn: 268333

6 years agoRelax stack check as on some platforms demanglers fail
Vitaly Buka [Mon, 2 May 2016 23:34:40 +0000 (23:34 +0000)]
Relax stack check as on some platforms demanglers fail

Summary:
  On Windows (already fixed) and FreeBSD we have stacks traces without
  operator().

Reviewers: eugenis

Subscribers: llvm-commits

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

llvm-svn: 268332

6 years ago[MC] Create unique .pdata sections for every .text section
Reid Kleckner [Mon, 2 May 2016 23:22:18 +0000 (23:22 +0000)]
[MC] Create unique .pdata sections for every .text section

Summary:
This adds a unique ID to the COFF section uniquing map, similar to the
one we have for ELF.  The unique id is not currently exposed via the
assembler because we don't have a use case for it yet. Users generally
create .pdata with the .seh_* family of directives, and the assembler
internally needs to produce .pdata and .xdata sections corresponding to
the code section.

The association between .text sections and the assembler-created .xdata
and .pdata sections is maintained as an ID field of MCSectionCOFF. The
CFI-related sections are created with the given unique ID, so if more
code is added to the same text section, we can find and reuse the CFI
sections that were already created.

Reviewers: majnemer, rafael

Subscribers: llvm-commits

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

llvm-svn: 268331

6 years agoAdd another failing use-after-scope test
Vitaly Buka [Mon, 2 May 2016 23:12:04 +0000 (23:12 +0000)]
Add another failing use-after-scope test

Summary:
  Use after scope is not detected if array larger then 8 bytes.

Subscribers: kubabrecka

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

llvm-svn: 268330

6 years agoAdd unittest for LiveIntervalAnalysis::handleMove()
Matthias Braun [Mon, 2 May 2016 23:05:48 +0000 (23:05 +0000)]
Add unittest for LiveIntervalAnalysis::handleMove()

This re-applies r260905. It requires LiveIntervals to not require
LiveVariables which was reverted and re-applied in r267954.

llvm-svn: 268329

6 years ago[MachineBlockPlacement] Let the target optimize the branches at the end.
Quentin Colombet [Mon, 2 May 2016 22:58:59 +0000 (22:58 +0000)]
[MachineBlockPlacement] Let the target optimize the branches at the end.

After the layout of the basic blocks is set, the target may be able to get rid
of unconditional branches to fallthrough blocks that the generic code does not
catch. This happens any time TargetInstrInfo::AnalyzeBranch is not able to
analyze all the branches involved in the terminators sequence, while still
understanding a few of them.

In such situation, AnalyzeBranch can directly modify the branches if it has been
instructed to do so.

This patch takes advantage of that.

llvm-svn: 268328

6 years ago[X86] Model FAULTING_LOAD_OP as a terminator and branch.
Quentin Colombet [Mon, 2 May 2016 22:58:54 +0000 (22:58 +0000)]
[X86] Model FAULTING_LOAD_OP as a terminator and branch.

This operation may branch to the handler block and we do not want it
to happen anywhere within the basic block.
Moreover, by marking it "terminator and branch" the machine verifier
does not wrongly assume (because of AnalyzeBranch not knowing better)
the branch is analyzable. Indeed, the target was seeing only the
unconditional branch and not the faulting load op and thought it was
a simple unconditional block.
The machine verifier was complaining because of that and moreover,
other optimizations could have done wrong transformation!

In the process, simplify the representation of the handler block in
the faulting load op. Now, we directly reference the handler block
instead of using a label. This has the benefits of:
1. MC knows how to issue a label for a BB, so leave that to it.
2. Accessing the target BB from its label is painful, whereas it is
   direct from a MBB operand.

Note: The 2 bytes offset in implicit-null-check.ll comes from the
fact the unconditional jumps are not removed anymore, as the whole
terminator sequence is not analyzable anymore.

Will fix it in a subsequence commit.

llvm-svn: 268327

6 years agoSimplify. NFC.
Rafael Espindola [Mon, 2 May 2016 22:53:32 +0000 (22:53 +0000)]
Simplify. NFC.

llvm-svn: 268326

6 years agodebugserver should fflush its log stream in FileLogCallback, now it does.
Greg Clayton [Mon, 2 May 2016 22:53:08 +0000 (22:53 +0000)]
debugserver should fflush its log stream in FileLogCallback, now it does.

<rdar://problem/24728287>

llvm-svn: 268325

6 years agoSimplify. NFC.
Rafael Espindola [Mon, 2 May 2016 22:52:15 +0000 (22:52 +0000)]
Simplify. NFC.

llvm-svn: 268324

6 years agoDebugInfo: Avoid propagating incorrect debug locations in SelectionDAG via CSE.
Wolfgang Pieb [Mon, 2 May 2016 22:50:51 +0000 (22:50 +0000)]
DebugInfo: Avoid propagating incorrect debug locations in SelectionDAG via CSE.

Summary:
When SelectionDAG performs CSE it is possible that the context's source
location is different from that of the selected node. This can lead to
incorrect line number records. We update the debug location to the
one that occurs earlier in the instruction sequence.

This fixes PR21006.

Reviewers: echristo, sdmitrouk

Subscribers: jevinskie, asl, llvm-commits

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

llvm-svn: 268323

6 years ago[CMake] Enable LIBCXX HEADERS in Apple-Stage2.cmake
Chris Bieneman [Mon, 2 May 2016 22:43:23 +0000 (22:43 +0000)]
[CMake] Enable LIBCXX HEADERS in Apple-Stage2.cmake

This enables installing the libcxx headers.

llvm-svn: 268322

6 years agoFix argument expansion of reference fields of structs
Reid Kleckner [Mon, 2 May 2016 22:42:34 +0000 (22:42 +0000)]
Fix argument expansion of reference fields of structs

r268261 made Clang "expand" more struct arguments on Windows. It removed
the check for 'RD->isCLike()', which was preventing us from attempting
to expand structs with reference type fields.

Our expansion code was attempting to load and pass each field of the
type in turn. We were accidentally doing one to many loads on reference
type fields.

On the function prologue side, we can use
EmitLValueForFieldInitialization, which obviously gets the address of
the field. On the call side, I tweaked EmitRValueForField directly,
since this is the only use of this method.

Fixes PR27607

llvm-svn: 268321

6 years ago[CMake] Install libcxx-headers as part of the Apple-stage2 distribution
Chris Bieneman [Mon, 2 May 2016 22:42:09 +0000 (22:42 +0000)]
[CMake] Install libcxx-headers as part of the Apple-stage2 distribution

This installs the clang headers as part of the install-distribution target.

llvm-svn: 268320

6 years ago[CMake] Adding clang-headers to the Apple-stage2 distribution
Chris Bieneman [Mon, 2 May 2016 22:38:06 +0000 (22:38 +0000)]
[CMake] Adding clang-headers to the Apple-stage2 distribution

This installs the clang headers as part of the install-distribution target.

llvm-svn: 268319

6 years agoRemove unneeded test in tryCaptureAsConstant.
Akira Hatanaka [Mon, 2 May 2016 22:29:40 +0000 (22:29 +0000)]
Remove unneeded test in tryCaptureAsConstant.

It isn't necessary to call hasDefaultArg because we can't rematerialize
a captured variable that is a function parameter, regardless of whether
or not it has a default argument. NFC.

llvm-svn: 268318

6 years agoRevert "ThinLTO: do not import function whose linkage prevents inlining."
Mehdi Amini [Mon, 2 May 2016 22:26:04 +0000 (22:26 +0000)]
Revert "ThinLTO: do not import function whose linkage prevents inlining."

This reverts commit r268315, the tests are not passing.

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

6 years ago[llvm-pdbdump] Fix read past EOF when file is too small.
Zachary Turner [Mon, 2 May 2016 22:16:57 +0000 (22:16 +0000)]
[llvm-pdbdump] Fix read past EOF when file is too small.

llvm-svn: 268316

6 years agoThinLTO: do not import function whose linkage prevents inlining.
Mehdi Amini [Mon, 2 May 2016 22:11:27 +0000 (22:11 +0000)]
ThinLTO: do not import function whose linkage prevents inlining.

There is not point in importing a "weak" or a "linkonce" function
since we won't be able to inline it anyway.
We already had a targeted check for WeakAny, this is using the
same check on GlobalValue as the inline, i.e.
isMayBeOverriddenLinkage()

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

6 years ago[CodeGenObjCXX] Don't rematerialize default arguments of function
Akira Hatanaka [Mon, 2 May 2016 21:52:57 +0000 (21:52 +0000)]
[CodeGenObjCXX] Don't rematerialize default arguments of function
parameters in the body of a block.

This fixes a bug where clang would materialize the default argument
inside the body of a block instead of passing the value via the block
descriptor.

For example, in the code below, foo1 would always print 42 regardless
of the value of argument "a" passed to foo1.

void foo1(const int a = 42 ) {
  auto block = ^{
    printf("%d\n", a);
  };
  block();
}

rdar://problem/24449235

llvm-svn: 268314

6 years agoFix llvm-size to exit with non zero when it can’t open a file.
Kevin Enderby [Mon, 2 May 2016 21:41:03 +0000 (21:41 +0000)]
Fix llvm-size to exit with non zero when it can’t open a file.

rdar://26027819

llvm-svn: 268313

6 years agoRemove redundant return, NFC
Vedant Kumar [Mon, 2 May 2016 21:33:36 +0000 (21:33 +0000)]
Remove redundant return, NFC

llvm-svn: 268312

6 years agoFix a typo, NFC
Vedant Kumar [Mon, 2 May 2016 21:32:07 +0000 (21:32 +0000)]
Fix a typo, NFC

llvm-svn: 268311

6 years agoTeach Undefined symbols from which file they are created from.
Rui Ueyama [Mon, 2 May 2016 21:30:42 +0000 (21:30 +0000)]
Teach Undefined symbols from which file they are created from.

This patch increases the size of Undefined by the size of a pointer,
but it wouldn't actually increase the size of memory that LLD uses
because we are not allocating the exact size but the size of the
largest SymbolBody.

llvm-svn: 268310

6 years agoFix an issue where the apropos command would not print fully qualified command names...
Enrico Granata [Mon, 2 May 2016 21:28:40 +0000 (21:28 +0000)]
Fix an issue where the apropos command would not print fully qualified command names for nested command objects

rdar://problem/26020072

llvm-svn: 268309

6 years agoRevert "Temporary hack to see what is going on on a windows bot."
Rafael Espindola [Mon, 2 May 2016 21:21:26 +0000 (21:21 +0000)]
Revert "Temporary hack to see what is going on on a windows bot."

This reverts commit r268302.

llvm-svn: 268308

6 years agoImport block pointers from DWARF as Clang block pointers, not as structs.
Sean Callanan [Mon, 2 May 2016 21:15:31 +0000 (21:15 +0000)]
Import block pointers from DWARF as Clang block pointers, not as structs.

Also added a data formatter that presents them as structs if you use frame
variable to look at their contents.  Now the blocks testcase works.

<rdar://problem/15984431>

llvm-svn: 268307

6 years ago[X86][SSE] Added placeholder for 128/256-bit wide shuffle combines
Simon Pilgrim [Mon, 2 May 2016 21:12:48 +0000 (21:12 +0000)]
[X86][SSE] Added placeholder for 128/256-bit wide shuffle combines

Begun adding placeholder for future support for vperm2f128/vshuff64x2 style 128/256-bit wide shuffles

llvm-svn: 268306

6 years agoDon't try to create thin bsd archives.
Rafael Espindola [Mon, 2 May 2016 21:06:57 +0000 (21:06 +0000)]
Don't try to create thin bsd archives.

Not such variant has been specified yet.

llvm-svn: 268305

6 years ago[dsymutil] Create the temporary files in the system temp directory.
Frederic Riss [Mon, 2 May 2016 21:06:14 +0000 (21:06 +0000)]
[dsymutil] Create the temporary files in the system temp directory.

llvm-dsymutil used to create the temporary files in the output directory.
This works fine except when the output directory contains a '%' char, which
is then replaced by llvm::sys::fs::createUniqueFile() generating an invalid
path.
Just use the default temp dir for those files.

llvm-svn: 268304

6 years agoAdd more debug logging to g_get_shared_cache_class_info_body
Enrico Granata [Mon, 2 May 2016 20:58:15 +0000 (20:58 +0000)]
Add more debug logging to g_get_shared_cache_class_info_body

llvm-svn: 268303

6 years agoTemporary hack to see what is going on on a windows bot.
Rafael Espindola [Mon, 2 May 2016 20:47:06 +0000 (20:47 +0000)]
Temporary hack to see what is going on on a windows bot.

llvm-svn: 268302

6 years agoCode refactoring -- preparation for new PM porting /NFC
Xinliang David Li [Mon, 2 May 2016 20:33:59 +0000 (20:33 +0000)]
Code refactoring -- preparation for new PM porting /NFC

llvm-svn: 268301

6 years ago[codeview] Isolate type dumping from object file state
Reid Kleckner [Mon, 2 May 2016 20:30:47 +0000 (20:30 +0000)]
[codeview] Isolate type dumping from object file state

This isolates the state we use for type dumping from the knowledge of
object files. We can use CVTypeDumper to dump types from anywhere in
memory now.

NFC

Reviewers: zturner

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

llvm-svn: 268300

6 years ago[CUDA] Make sure device-side __global__ functions are always visible.
Artem Belevich [Mon, 2 May 2016 20:30:03 +0000 (20:30 +0000)]
[CUDA] Make sure device-side __global__ functions are always visible.

__global__ functions are a special case in CUDA.

Even when the symbol would normally not be externally
visible according to C++ rules, they still must be visible
in CUDA GPU object so host-side stub can launch them.

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

llvm-svn: 268299

6 years agoThread Expected<...> up from libObject’s getType() for symbols to allow llvm-objdump...
Kevin Enderby [Mon, 2 May 2016 20:28:12 +0000 (20:28 +0000)]
Thread Expected<...> up from libObject’s getType() for symbols to allow llvm-objdump to produce a good error message.

Produce another specific error message for a malformed Mach-O file when a symbol’s
section index is more than the number of sections.  The existing test case in test/Object/macho-invalid.test
for macho-invalid-section-index-getSectionRawName now reports the error with the message indicating
that a symbol at a specific index has a bad section index and that bad section index value.

Again converting interfaces to Expected<> from ErrorOr<> does involve
touching a number of places. Where the existing code reported the error with a
string message or an error code it was converted to do the same.

Also there some were bugs in the existing code that did not deal with the
old ErrorOr<> return values.  So now with Expected<> since they must be
checked and the error handled, I added a TODO and a comment:
"// TODO: Actually report errors helpfully" and a call something like
consumeError(NameOrErr.takeError()) so the buggy code will not crash
since needed to deal with the Error.

llvm-svn: 268298

6 years agoRevert "[Driver] Quote clang full version in dwarf producer when invoking cc1as"
Bruno Cardoso Lopes [Mon, 2 May 2016 20:20:49 +0000 (20:20 +0000)]
Revert "[Driver] Quote clang full version in dwarf producer when invoking cc1as"

This reverts commit r264813 / 6484b95d634f53dd929c75265ef3c4decf397584.

While using it in the shell is fine, this a problem when cc1as is
invoked directly by the driver because single quoting the clang full
version makes cc1as write out the version with the quotes in the final
binary.

If the user wants to copy-n-pastable output, it could use either -###
or CC_PRINT_OPTIONS=1 clang -v ...

llvm-svn: 268297

6 years agoAMDGPU: Custom lower v2i32 loads and stores
Matt Arsenault [Mon, 2 May 2016 20:13:51 +0000 (20:13 +0000)]
AMDGPU: Custom lower v2i32 loads and stores

This will allow us to split up 64-bit private accesses when
necessary.

llvm-svn: 268296

6 years agoAMDGPU/SI: Use v_readfirstlane_b32 when restoring SGPRs spilled to scratch
Tom Stellard [Mon, 2 May 2016 20:11:44 +0000 (20:11 +0000)]
AMDGPU/SI: Use v_readfirstlane_b32 when restoring SGPRs spilled to scratch

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

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

llvm-svn: 268295

6 years agoCleanup warnings and remove use of __builtin_va_list in depr.c.headers
Eric Fiselier [Mon, 2 May 2016 20:08:16 +0000 (20:08 +0000)]
Cleanup warnings and remove use of __builtin_va_list in depr.c.headers

llvm-svn: 268294

6 years agoAMDGPU: Make i64 loads/stores promote to v2i32
Matt Arsenault [Mon, 2 May 2016 20:07:26 +0000 (20:07 +0000)]
AMDGPU: Make i64 loads/stores promote to v2i32

Now that unaligned access expansion should not attempt
to produce i64 accesses, we can remove the hack in
PreprocessISelDAG where this is done.

This allows splitting i64 private accesses while
allowing the new add nodes indexing the vector components
can be folded with the base pointer arithmetic.

llvm-svn: 268293

6 years agoRemove unnecessary namespace specifiers.
Rui Ueyama [Mon, 2 May 2016 19:59:56 +0000 (19:59 +0000)]
Remove unnecessary namespace specifiers.

llvm-svn: 268292

6 years ago[LVI] Add an API to LazyValueInfo so that it can export ConstantRanges
John Regehr [Mon, 2 May 2016 19:58:00 +0000 (19:58 +0000)]
[LVI] Add an API to LazyValueInfo so that it can export ConstantRanges
that it computes. Currently this is used for testing and precision
tuning, but it might be used by optimizations later.

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

llvm-svn: 268291

6 years ago[X86][AVX2] Added 128-bit wide shuffle test
Simon Pilgrim [Mon, 2 May 2016 19:46:58 +0000 (19:46 +0000)]
[X86][AVX2] Added 128-bit wide shuffle test

Demonstrate missing 128-bit wide shuffle combine support

llvm-svn: 268290