platform/upstream/llvm.git
8 years ago[X86][AVX] Enabled MULHS/MULHU v16i16 vectors on AVX1 targets
Simon Pilgrim [Sat, 26 Mar 2016 15:44:55 +0000 (15:44 +0000)]
[X86][AVX] Enabled MULHS/MULHU v16i16 vectors on AVX1 targets

Correct splitting of v16i16 vectors into v8i16 vectors to prevent scalarization

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

llvm-svn: 264512

8 years ago[X86][SSE] Add MULHS/MULHU custom lowering for i8 vectors
Simon Pilgrim [Sat, 26 Mar 2016 15:27:20 +0000 (15:27 +0000)]
[X86][SSE] Add MULHS/MULHU custom lowering for i8 vectors

Currently this is to mainly to prevent scalarization of integer division by constants.

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

llvm-svn: 264511

8 years ago[X86][SSE] Added v64i8 vector integer multiply tests
Simon Pilgrim [Sat, 26 Mar 2016 09:50:06 +0000 (09:50 +0000)]
[X86][SSE] Added v64i8 vector integer multiply tests

llvm-svn: 264510

8 years ago[X86][AVX512BW] AVX512BW can sign-extend v32i8 to v32i16 for simpler v32i8 multiplies.
Simon Pilgrim [Sat, 26 Mar 2016 09:44:27 +0000 (09:44 +0000)]
[X86][AVX512BW] AVX512BW can sign-extend v32i8 to v32i16 for simpler v32i8 multiplies.

Only pre-AVX512BW targets need to split v32i8 vectors.

llvm-svn: 264509

8 years ago[PowerPC] Disable the CTR optimization in the presence of {min,max}num
David Majnemer [Sat, 26 Mar 2016 09:42:31 +0000 (09:42 +0000)]
[PowerPC] Disable the CTR optimization in the presence of {min,max}num

The minnum and maxnum intrinsics get lowered to libcalls which
invalidates the CTR optimization.

This fixes PR27083.

llvm-svn: 264508

8 years ago[X86][SSE] Refreshed vector integer multiply tests
Simon Pilgrim [Sat, 26 Mar 2016 09:35:48 +0000 (09:35 +0000)]
[X86][SSE] Refreshed vector integer multiply tests

Add all 256-bit vector tests.
Added AVX512F/AVX512BW test targets.
Renamed tests something more meaningful.

llvm-svn: 264507

8 years ago[X86][SSE] Don't duplicate Lower256IntArith functionality in LowerMul. NFC.
Simon Pilgrim [Sat, 26 Mar 2016 09:29:04 +0000 (09:29 +0000)]
[X86][SSE] Don't duplicate Lower256IntArith functionality in LowerMul. NFC.

LowerMul v32i8 on AVX2 needs to split the 256-bit sources to allow sign-extension back to v16i16 to occur. Since this is basically the same as Lower256IntArith we simplify by using that here instead.

llvm-svn: 264506

8 years agoMinor code cleanup. NFC.
Junmo Park [Sat, 26 Mar 2016 06:04:55 +0000 (06:04 +0000)]
Minor code cleanup. NFC.

llvm-svn: 264505

8 years ago[Power9] Implement new altivec instructions: permute, count zero, extend sign, negate...
Chuang-Yu Cheng [Sat, 26 Mar 2016 05:46:11 +0000 (05:46 +0000)]
[Power9] Implement new altivec instructions: permute, count zero, extend sign, negate, parity, shift/rotate, mul10

This change implements the following vector operations:
- vclzlsbb vctzlsbb vctzb vctzd vctzh vctzw
- vextsb2w vextsh2w vextsb2d vextsh2d vextsw2d
- vnegd vnegw
- vprtybd vprtybq vprtybw
- vbpermd vpermr
- vrlwnm vrlwmi vrldnm vrldmi vslv vsrv
- vmul10cuq vmul10uq vmul10ecuq vmul10euq

28 instructions

Thanks Nemanja, Kit for invaluable hints and discussion!
Reviewers: hal, nemanja, kbarton, tjablin, amehsan

Phabricator: http://reviews.llvm.org/D15887
llvm-svn: 264504

8 years agoThinLTO: use the callgraph from the combined index to drive the FunctionImporter
Mehdi Amini [Sat, 26 Mar 2016 05:40:34 +0000 (05:40 +0000)]
ThinLTO: use the callgraph from the combined index to drive the FunctionImporter

Summary:
Now that the summary contains the full reference/call graph, we can
replace the existing function importer that loads and inspect the IR
to iteratively walk the call graph by a traversal based purely on the
summary information. Decouple the actual importing decision from any
IR manipulation.

Reviewers: tejohnson

Subscribers: llvm-commits, joker.eph

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

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

8 years agoabtest: Cleanup, improve comments
Matthias Braun [Sat, 26 Mar 2016 04:07:55 +0000 (04:07 +0000)]
abtest: Cleanup, improve comments

llvm-svn: 264502

8 years ago[libprofile] Adjust dummy condition to be more forgiving.
Sean Silva [Sat, 26 Mar 2016 04:01:57 +0000 (04:01 +0000)]
[libprofile] Adjust dummy condition to be more forgiving.

On PS4, we have to fake environment variables by passing extra command
line arguments, so the dummy test `argc > 1` was failing.
The condition is just a dummy condition that the compiler can't fold
away, so the number is arbitrary as long as the condition is false.

Increase the number it compares against.

llvm-svn: 264491

8 years ago[libprofile] Add some missing `env` prefixes on commands.
Sean Silva [Sat, 26 Mar 2016 03:37:45 +0000 (03:37 +0000)]
[libprofile] Add some missing `env` prefixes on commands.

llvm-svn: 264490

8 years agoRename ModuleSummaryIndex::modPathStringEntries() into modulePaths()
Mehdi Amini [Sat, 26 Mar 2016 03:35:38 +0000 (03:35 +0000)]
Rename ModuleSummaryIndex::modPathStringEntries() into modulePaths()

It now return the map instead of an iterator.

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

8 years agoStop depending on the keys in a hash table being in a particular order.
Richard Smith [Sat, 26 Mar 2016 03:06:42 +0000 (03:06 +0000)]
Stop depending on the keys in a hash table being in a particular order.

llvm-svn: 264488

8 years agoStop testing the unspecified order in which the OnDiskHashTable stores entries.
Richard Smith [Sat, 26 Mar 2016 02:02:59 +0000 (02:02 +0000)]
Stop testing the unspecified order in which the OnDiskHashTable stores entries.

llvm-svn: 264487

8 years agoDon't force OnDiskHashTables to have a minimum of 64 buckets. That's
Richard Smith [Sat, 26 Mar 2016 01:49:50 +0000 (01:49 +0000)]
Don't force OnDiskHashTables to have a minimum of 64 buckets. That's
preposterously large for some lookup tables -- in C++ classes generated by
template instantiation, it's very common for the number of lookup results to be
either 1 or 2.

This reduces size of a libstdc++ module by 7-15%.

llvm-svn: 264486

8 years agoWhen we import the definition for a Tagdecl, propagate its completeness too.
Sean Callanan [Sat, 26 Mar 2016 00:37:55 +0000 (00:37 +0000)]
When we import the definition for a Tagdecl, propagate its completeness too.

The ASTImporter completes the full definiton for a TagDecl in several places,
including the type-deport logic.  When this happens, we should also propagate
the bit that says that this is a complete definition.  This makes (for example)
lambdas callable.

<rdar://problem/22864976>

llvm-svn: 264485

8 years agoabtest: Check all files, improve announcements
Matthias Braun [Sat, 26 Mar 2016 00:36:58 +0000 (00:36 +0000)]
abtest: Check all files, improve announcements

Simply searching for gooddir/* and baddir/* instead of *.s the script
should also work with .o files.

llvm-svn: 264484

8 years agoRecord all translation units with more than one function in them (e.g., blocks).
Sean Callanan [Sat, 26 Mar 2016 00:30:40 +0000 (00:30 +0000)]
Record all translation units with more than one function in them (e.g., blocks).

Blocks and lambdas have their implementation functions stored in the IR for an
expression.  If we put the block/lambda into a result variable it needs to stay
around.  As a heuristic, remember any execution unit that has more than one
function in it.

<rdar://problem/22864976>

llvm-svn: 264483

8 years agoPut my abtest scripts into the util directory
Matthias Braun [Sat, 26 Mar 2016 00:23:59 +0000 (00:23 +0000)]
Put my abtest scripts into the util directory

See http://lists.llvm.org/pipermail/llvm-dev/2016-March/097640.html
There is also a description/tutorial in the comments of the abtest.py
file.

llvm-svn: 264482

8 years ago[asan] bump the scariness score of read-after-frees (based on feedback from the Chrom...
Kostya Serebryany [Sat, 26 Mar 2016 00:00:19 +0000 (00:00 +0000)]
[asan] bump the scariness score of read-after-frees (based on feedback from the Chrome security team)

llvm-svn: 264481

8 years ago[profile] Add integration test to validate PGO function names
Vedant Kumar [Fri, 25 Mar 2016 23:56:23 +0000 (23:56 +0000)]
[profile] Add integration test to validate PGO function names

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

llvm-svn: 264480

8 years ago[Support] Switch to RAII helper for error-as-out-parameter idiom.
Lang Hames [Fri, 25 Mar 2016 23:54:32 +0000 (23:54 +0000)]
[Support] Switch to RAII helper for error-as-out-parameter idiom.

As discussed on the llvm-commits thread for r264467.

llvm-svn: 264479

8 years agoRemoved LoggingDiagnosticConsumer, an unused class.
Sean Callanan [Fri, 25 Mar 2016 23:51:25 +0000 (23:51 +0000)]
Removed LoggingDiagnosticConsumer, an unused class.

llvm-svn: 264478

8 years agoImprove the reliability of file renaming in Windows by having the compiler retry
Sunil Srivastava [Fri, 25 Mar 2016 23:41:28 +0000 (23:41 +0000)]
Improve the reliability of file renaming in Windows by having the compiler retry
the rename operation on 3 error conditions of ReplaceFileW() that it was
previously bailing out on.

Patch by Douglas Yung!

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

llvm-svn: 264477

8 years agoFix FILE * leak in Python API
Stephane Sezer [Fri, 25 Mar 2016 23:40:32 +0000 (23:40 +0000)]
Fix FILE * leak in Python API

Summary:
This fixes a leak introduced by some of these changes:
r257644
r250530
r250525

The changes made in these patches result in leaking the FILE* passed
to SetImmediateOutputFile. GetStream() will dup() the fd held by the
python caller and create a new FILE*. It will then pass this FILE*
to SetImmediateOutputFile, which always uses the flag
transfer_ownership=false when it creates a File from the FILE*.

Since transfer_ownership is false, the lldb File destructor will not
close the underlying FILE*. Because this FILE* came from a dup-ed fd,
it will also not be closed when the python caller closes its file.

Leaking the FILE* causes issues if the same file is used multiple times
by different python callers during the same lldb run, even if these
callers open and close the python file properly, as you can end up
with issues due to multiple buffered writes to the same file.

Reviewers: granata.enrico, zturner, clayborg

Subscribers: zturner, lldb-commits, sas

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

Change by Francis Ricci <fjricci@fb.com>

llvm-svn: 264476

8 years agoStringMap/DenseMap unittests: use piecewise_construct and ensure no copy occurs.
Mehdi Amini [Fri, 25 Mar 2016 23:25:06 +0000 (23:25 +0000)]
StringMap/DenseMap unittests: use piecewise_construct and ensure no copy occurs.

This makes us no longer relying on move-construction elision by the compiler.
Suggested by D. Blaikie.

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

8 years agoAdd a 'language cplusplus demangle' command. This can be useful to provide a low...
Enrico Granata [Fri, 25 Mar 2016 23:14:24 +0000 (23:14 +0000)]
Add a 'language cplusplus demangle' command. This can be useful to provide a low-friction reproduction for issues with the LLDB demangling of C++ symbols

llvm-svn: 264474

8 years ago[Object] Make createMachOObjectFile return Expected<...> rather than
Lang Hames [Fri, 25 Mar 2016 23:11:52 +0000 (23:11 +0000)]
[Object] Make createMachOObjectFile return Expected<...> rather than
ErrorOr<...>.

llvm-svn: 264473

8 years agoAllow value forwarding past release fences in GVN
Philip Reames [Fri, 25 Mar 2016 22:40:35 +0000 (22:40 +0000)]
Allow value forwarding past release fences in GVN

A release fence acts as a publication barrier for stores within the current thread to become visible to other threads which might observe the release fence. It does not require the current thread to observe stores performed on other threads. As a result, we can allow store-load and load-load forwarding across a release fence.

We choose to be much more conservative about stores.  In theory, nothing prevents us from shifting a store from after a release fence to before it, and then eliminating the preceeding (previously fenced) store.  Doing this without actually moving the second store is likely also legal, but we chose to be conservative at this time.

The LangRef indicates only atomic loads and stores are effected by fences. This patch chooses to be far more conservative then that.

This is the GVN companion to http://reviews.llvm.org/D11434 which applied the same logic in EarlyCSE and has been baking in tree for a while now.

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

llvm-svn: 264472

8 years agoDon't warn on "use" of undefined inline function that isn't actually an ODR
Richard Smith [Fri, 25 Mar 2016 22:29:27 +0000 (22:29 +0000)]
Don't warn on "use" of undefined inline function that isn't actually an ODR
use. In order for this to fire, the function needed to be a templated function
marked 'constexpr' and declared but not defined. This weird pattern appears in
libstdc++'s alloc_traits.h.

llvm-svn: 264471

8 years agoSelectionDAG: Remove arbitrary and bug-prone complexity from SDLoc
Justin Bogner [Fri, 25 Mar 2016 22:12:41 +0000 (22:12 +0000)]
SelectionDAG: Remove arbitrary and bug-prone complexity from SDLoc

The implementation of SDLoc has an extra layer of indirection here for
no particular reason, and was leading to problems where we were
dereferencing pointers to SDNodes that had already been deleted so
that we could get at the DebugLoc for a new SDNode. This is one of the
errors that came up often in PR26808.

Instead, we can just track the DebugLoc and IROrder directly. This
makes the code both easier to understand and more correct. It's also
basically NFC other than fixing a large number of places where we were
reading the memory of deleted SDNodes.

llvm-svn: 264470

8 years ago[Object] Make MachOObjectFile's constructor private, provide a static create
Lang Hames [Fri, 25 Mar 2016 21:59:14 +0000 (21:59 +0000)]
[Object] Make MachOObjectFile's constructor private, provide a static create
method instead.

This is not quite a named constructor: Construction may fail, and
MachOObjectFiles are usually passed by unique_ptr anyway, so create
returns an Expected<std::unique_ptr<MachOObjectFile>>.

llvm-svn: 264469

8 years agoFix an issue with nested aliases where the help system wouldn't correctly track the...
Enrico Granata [Fri, 25 Mar 2016 21:59:06 +0000 (21:59 +0000)]
Fix an issue with nested aliases where the help system wouldn't correctly track the fact that an alias is an alias to a dash-dash alias
(and I hope I typed the word 'alias' enough times in this commit message :-)

llvm-svn: 264468

8 years ago[Support] Add Error::errorForOutParameter helper.
Lang Hames [Fri, 25 Mar 2016 21:56:35 +0000 (21:56 +0000)]
[Support] Add Error::errorForOutParameter helper.

This helper method creates a pre-checked Error suitable for use as an out
parameter in a constructor. This avoids the need to have the constructor
check a known-good error before assigning to it.

llvm-svn: 264467

8 years agoStore list of undefined-but-used objects in a deterministic order to fix
Richard Smith [Fri, 25 Mar 2016 21:49:43 +0000 (21:49 +0000)]
Store list of undefined-but-used objects in a deterministic order to fix
non-deterministic diagnostics (and non-deterministic PCH files). Check these
when building a module rather than serializing it; it's not reasonable for a
module's use to be satisfied by a definition in the user of the module.

llvm-svn: 264466

8 years ago[X86] Emit a proper ADJCALLSTACKDOWN in EmitLoweredTLSAddr
David Majnemer [Fri, 25 Mar 2016 21:49:11 +0000 (21:49 +0000)]
[X86] Emit a proper ADJCALLSTACKDOWN in EmitLoweredTLSAddr

We forgot to add the second machine operand to our ADJCALLSTACKDOWN,
resulting in crashes in PEI.

This fixes PR27071.

llvm-svn: 264465

8 years agoDelete dead variable.
Richard Smith [Fri, 25 Mar 2016 21:46:44 +0000 (21:46 +0000)]
Delete dead variable.

llvm-svn: 264464

8 years ago[analyzer] Add CIFIlter modeling to DeallocChecker.
Devin Coughlin [Fri, 25 Mar 2016 21:18:22 +0000 (21:18 +0000)]
[analyzer] Add CIFIlter modeling to DeallocChecker.

The -dealloc method in CIFilter is highly unusual in that it will release
instance variables belonging to its *subclasses* if the variable name
starts with "input" or backs a property whose name starts with "input".
Subclasses should not release these ivars in their own -dealloc method --
doing so could result in an over release.

Before this commit, the DeallocChecker would warn about missing releases for
such "input" properties -- which could cause users of the analyzer to add
over releases to silence the warning.

To avoid this, DeallocChecker now treats CIFilter "input-prefixed" ivars
as MustNotReleaseDirectly and so will not require a release. Further, it
will now warn when such an ivar is directly released in -dealloc.

rdar://problem/25364901

llvm-svn: 264463

8 years ago[MachineCopyPropagation] Expose more dead copies across instructions with regmasks
Jun Bum Lim [Fri, 25 Mar 2016 21:15:35 +0000 (21:15 +0000)]
[MachineCopyPropagation] Expose more dead copies across instructions with regmasks

When encountering instructions with regmasks, instead of cleaning up all the
elements in MaybeDeadCopies map, remove only the instructions erased. By keeping
more instruction in MaybeDeadCopies, this change will expose more dead copies
across instructions with regmasks.

llvm-svn: 264462

8 years agoPrevent construction of cycle in DAG store merge
Nirav Dave [Fri, 25 Mar 2016 21:06:30 +0000 (21:06 +0000)]
Prevent construction of cycle in DAG store merge

When merging stores in DAGCombiner, add check to ensure that no
dependenices exist that would cause the construction of a cycle in our
DAG.  This may happen if one store has a data dependence on another
instruction (e.g. a load) which itself has a (chain) dependence on
another store being merged. These stores cannot be merged safely and
doing so results in a cycle that is discovered in LegalizeDAG.

This test is only done in cases where Antialias analysis is used (UseAA)
as non-AA store merge candidates will be merged logically after all
loads which have been checked to not alias.

Reviewers: ahatanak, spatel, niravd, arsenm, hfinkel, tstellarAMD, jyknight

Subscribers: llvm-commits, tberghammer, danalbert, srhines

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

llvm-svn: 264461

8 years agoAdd files forgotten in r264452
Tobias Grosser [Fri, 25 Mar 2016 20:32:51 +0000 (20:32 +0000)]
Add files forgotten in r264452

llvm-svn: 264460

8 years ago[libFuzzer] use fflush after every Printf
Kostya Serebryany [Fri, 25 Mar 2016 20:31:26 +0000 (20:31 +0000)]
[libFuzzer] use fflush after every Printf

llvm-svn: 264459

8 years agoRemove useless and unused CrashRecoveryContext::getBacktrace(). This function always...
Richard Smith [Fri, 25 Mar 2016 20:30:10 +0000 (20:30 +0000)]
Remove useless and unused CrashRecoveryContext::getBacktrace(). This function always returned an empty string.

llvm-svn: 264458

8 years ago[InstSimplify] regenerate checks using a script
Sanjay Patel [Fri, 25 Mar 2016 20:12:25 +0000 (20:12 +0000)]
[InstSimplify] regenerate checks using a script

I didn't notice any significant changes in the actual checks here;
all of these tests already used FileCheck, so a script can batch
update them in one shot.

This commit is just to show the value of automating this process:
We have uniform formatting as opposed to a mish-mash of check
structure that changes based on individual prefs and the current
fashion. This makes it simpler to update when we find a bug or
make an enhancement.

llvm-svn: 264457

8 years ago[RS4GC] Lower calls to @llvm.experimental.deoptimize
Sanjoy Das [Fri, 25 Mar 2016 20:12:13 +0000 (20:12 +0000)]
[RS4GC] Lower calls to @llvm.experimental.deoptimize

This changes RS4GC to lower calls to ``@llvm.experimental.deoptimize``
to gc.statepoints wrapping ``__llvm_deoptimize``, and changes
``callsGCLeafFunction`` to recognize ``@llvm.experimental.deoptimize``
as a non GC leaf function.

I've had to hard code the ``"__llvm_deoptimize"`` name in
RewriteStatepointsForGC; since ``TargetLibraryInfo`` is available only
during codegen.  This isn't without precedent in the codebase, so I'm
not overtly concerned.

llvm-svn: 264456

8 years agoCodeGen: Don't iterate over operands after we've erased an MI
Justin Bogner [Fri, 25 Mar 2016 20:03:28 +0000 (20:03 +0000)]
CodeGen: Don't iterate over operands after we've erased an MI

This fixes a use-after-free introduced 3 years ago, in r182872 ;)

The code more or less worked because the memory that CopyMI was
pointing to happened to still be valid, but lots of tests would crash
if you ran under ASAN with the recycling allocator changes from
llvm.org/PR26808

llvm-svn: 264455

8 years agoARM: maintain BB ordering when expanding WIN__DBZCHK
Saleem Abdulrasool [Fri, 25 Mar 2016 19:48:06 +0000 (19:48 +0000)]
ARM: maintain BB ordering when expanding WIN__DBZCHK

It is possible to have a fallthrough MBB prior to MBB placement.  The original
addition of the BB would result in reordering the BB as not preceding the
successor.  Because of the fallthrough nature of the BB, we could end up
executing incorrect code or even a constant pool island!  Insert the spliced BB
into the same location to avoid that.

Thanks to Tim Northover for invaluable hints and Fiora for the discussion on
what may have been occurring!

llvm-svn: 264454

8 years ago[ASTMatchers] Don't use brace-init lists.
Samuel Benzaquen [Fri, 25 Mar 2016 19:41:32 +0000 (19:41 +0000)]
[ASTMatchers] Don't use brace-init lists.

They are not supported everywhere yet.
This fixes the MSVC build.

llvm-svn: 264453

8 years agoUpdate to isl-0.16.1-145-g243bf7c
Tobias Grosser [Fri, 25 Mar 2016 19:38:18 +0000 (19:38 +0000)]
Update to isl-0.16.1-145-g243bf7c

Just an import to keep track with the latest version of isl. We are not looking
for specific features.

llvm-svn: 264452

8 years ago[sanitizer] Add memset, memmove, and memcpy to the common interceptors
Derek Bruening [Fri, 25 Mar 2016 19:33:45 +0000 (19:33 +0000)]
[sanitizer] Add memset, memmove, and memcpy to the common interceptors

Summary:
Currently, sanitizer_common_interceptors.inc has an implicit, undocumented
assumption that the sanitizer including it has previously declared
interceptors for memset and memmove.  Since the memset, memmove, and memcpy
routines require interception by many sanitizers, we add them to the
set of common interceptions, both to address the undocumented assumption
and to speed future tool development.  They are intercepted under a new
flag intercept_intrin.

The tsan interceptors are removed in favor of the new common versions.  The
asan and msan interceptors for these are more complex (they incur extra
interception steps and their function bodies are exposed to the compiler)
so they opt out of the common versions and keep their own.

Reviewers: vitalybuka

Subscribers: zhaoqin, llvm-commits, kcc

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

llvm-svn: 264451

8 years ago[SetVector] Add erase() method
Jun Bum Lim [Fri, 25 Mar 2016 19:28:08 +0000 (19:28 +0000)]
[SetVector] Add erase() method

This is a recommit of r264414 after fixing the buildbot failure caused by
incompatible use of std::vector.erase().

The original message:

Add erase() which returns an iterator pointing to the next element after the
erased one. This makes it possible to erase selected elements while iterating
over the SetVector :
  while (I != E)
    if (test(*I))
      I = SetVector.erase(I);
    else
      ++I;

Reviewers: qcolombet, mcrosier, MatzeB, dblaikie

Subscribers: dberlin, dblaikie, mcrosier, llvm-commits

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

llvm-svn: 264450

8 years agoFix now-ambiguous references to Error.
Lang Hames [Fri, 25 Mar 2016 19:27:24 +0000 (19:27 +0000)]
Fix now-ambiguous references to Error.

llvm-svn: 264449

8 years agoAdd title above the release notes
Tobias Grosser [Fri, 25 Mar 2016 19:23:54 +0000 (19:23 +0000)]
Add title above the release notes

llvm-svn: 264448

8 years agodocs: Show two levels of content in index:
Tobias Grosser [Fri, 25 Mar 2016 19:23:52 +0000 (19:23 +0000)]
docs: Show two levels of content in index:

llvm-svn: 264447

8 years agodocs: Describe Polly in the LLVM pass pipeline
Tobias Grosser [Fri, 25 Mar 2016 19:23:44 +0000 (19:23 +0000)]
docs: Describe Polly in the LLVM pass pipeline

llvm-svn: 264446

8 years ago[ThinLTO] Rename edges() to calls() for clarity (NFC)
Teresa Johnson [Fri, 25 Mar 2016 18:59:13 +0000 (18:59 +0000)]
[ThinLTO] Rename edges() to calls() for clarity (NFC)

Helps distinguish from refs() which iterates over non-call references.

llvm-svn: 264445

8 years ago[ObjCXX] Warn undeclared identifiers.
Manman Ren [Fri, 25 Mar 2016 18:43:46 +0000 (18:43 +0000)]
[ObjCXX] Warn undeclared identifiers.

Instantiation dependence were not being handled correctly for OpqaueValueExpr
AST nodes. As a result, if an undeclared identifier was used in a CXXNewExpr
that is assigned to a ObjC property, there would be no error during parsing, and
there would be a crash during code gen. This patch makes sure that an error
will be issued during parsing in this case.

Before the fix, if CXXNewExpr has a typo, its InstantiationDependent will be
set to true, but if it is wrapped in a OpaqueValueExpr, the OpaqueValueExpr will
not be instantiation dependent, causing the TypoExpr not be to resolved. The fix
propagates InstantiationDependent to OpaqueValueExpr from its SourceExpr. It
also propagates the other instantiation bits.

rdar://24975562

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

llvm-svn: 264444

8 years agoCodeGen: Fix a use-after-free in TII
Justin Bogner [Fri, 25 Mar 2016 18:38:48 +0000 (18:38 +0000)]
CodeGen: Fix a use-after-free in TII

Found by ASAN with the recycling allocator changes from PR26808.

llvm-svn: 264443

8 years agoAMDGPU: Fix a use-after free and a missing break
Justin Bogner [Fri, 25 Mar 2016 18:33:16 +0000 (18:33 +0000)]
AMDGPU: Fix a use-after free and a missing break

We're erasing MI here, but then immediately using it again inside the
`if`. This moves the erase after we're done using it.

Doing that reveals a second problem though - this case is missing a
break, so we fall through to the default and dereference MI again.
This is obviously a bug, though I don't know how to write a test that
triggers it - all we do in the error case is print some extra debug
output.

Both of these issue crash on lots of tests under ASAN with the
recycling allocator changes from PR26808 applied.

llvm-svn: 264442

8 years agoRemove declaration of SymbolTable::codegen, this method was deleted in r264091
Reid Kleckner [Fri, 25 Mar 2016 18:20:33 +0000 (18:20 +0000)]
Remove declaration of SymbolTable::codegen, this method was deleted in r264091

llvm-svn: 264441

8 years ago[X86] Use "and $0" and "orl $-1" to store 0 and -1 when optimizing for minsize
Hans Wennborg [Fri, 25 Mar 2016 18:11:31 +0000 (18:11 +0000)]
[X86] Use "and $0" and "orl $-1" to store 0 and -1 when optimizing for minsize

64-bit, 32-bit and 16-bit move-immediate instructions are 7, 6, and 5 bytes,
respectively, whereas and/or with 8-bit immediate is only three bytes.

Since these instructions imply an additional memory read (which the CPU could
elide, but we don't think it does), restrict these patterns to minsize functions.

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

llvm-svn: 264440

8 years ago[coff] Accept and ignore another link.exe flag for compatibility
Reid Kleckner [Fri, 25 Mar 2016 18:09:29 +0000 (18:09 +0000)]
[coff] Accept and ignore another link.exe flag for compatibility

This flag disables link.exe's crash handler so that normal windows error
reporting and crash dumping occurs. For now it is reasonable for LLD to
ignore the flag.

Chromium is currently using this flag to collect minidumps of link.exe
crashing, and it breaks the LLD build.

llvm-svn: 264439

8 years ago[InstCombine] use FileCheck for better checking
Sanjay Patel [Fri, 25 Mar 2016 18:03:40 +0000 (18:03 +0000)]
[InstCombine] use FileCheck for better checking

(testing script for autogeneration of check lines)

llvm-svn: 264438

8 years ago[InstCombine] use FileCheck for better checking
Sanjay Patel [Fri, 25 Mar 2016 18:03:17 +0000 (18:03 +0000)]
[InstCombine] use FileCheck for better checking

(testing script for autogeneration of check lines)

llvm-svn: 264437

8 years ago[Object] Remove empty private section from BinaryError.
Lang Hames [Fri, 25 Mar 2016 18:03:08 +0000 (18:03 +0000)]
[Object] Remove empty private section from BinaryError.

llvm-svn: 264436

8 years ago[InstCombine] use FileCheck for better checking
Sanjay Patel [Fri, 25 Mar 2016 18:03:01 +0000 (18:03 +0000)]
[InstCombine] use FileCheck for better checking

(testing script for autogeneration of check lines)

llvm-svn: 264435

8 years ago[InstCombine] use FileCheck for better checking
Sanjay Patel [Fri, 25 Mar 2016 18:02:14 +0000 (18:02 +0000)]
[InstCombine] use FileCheck for better checking

(testing script for autogeneration of check lines)

llvm-svn: 264434

8 years ago[InstCombine] use FileCheck for better checking
Sanjay Patel [Fri, 25 Mar 2016 18:01:55 +0000 (18:01 +0000)]
[InstCombine] use FileCheck for better checking

(testing script for autogeneration of check lines)

llvm-svn: 264433

8 years ago[InstCombine] use FileCheck for better checking
Sanjay Patel [Fri, 25 Mar 2016 18:01:37 +0000 (18:01 +0000)]
[InstCombine] use FileCheck for better checking

(testing script for autogeneration of check lines)

llvm-svn: 264432

8 years ago[InstCombine] use FileCheck for better checking
Sanjay Patel [Fri, 25 Mar 2016 18:01:23 +0000 (18:01 +0000)]
[InstCombine] use FileCheck for better checking

(testing script for autogeneration of check lines)

llvm-svn: 264431

8 years ago[InstCombine] use FileCheck for better checking
Sanjay Patel [Fri, 25 Mar 2016 18:01:04 +0000 (18:01 +0000)]
[InstCombine] use FileCheck for better checking

(testing script for autogeneration of check lines)

llvm-svn: 264430

8 years agoConsider regmasks when computing register-based DBG_VALUE live ranges
Reid Kleckner [Fri, 25 Mar 2016 17:54:46 +0000 (17:54 +0000)]
Consider regmasks when computing register-based DBG_VALUE live ranges

Now register parameters that aren't saved to the stack or CSRs are
considered dead after the first call. Previously the debugger would show
whatever was in the register.

Fixes PR26589

Reviewers: aprantl

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

llvm-svn: 264429

8 years ago[ASTMatchers] Fix build for VariadicFunction.
Samuel Benzaquen [Fri, 25 Mar 2016 17:46:02 +0000 (17:46 +0000)]
[ASTMatchers] Fix build for VariadicFunction.

Under some conditions the implicit conversion from array to ArrayRef<>
is not working.
Fix the build by making it explicit.

llvm-svn: 264428

8 years ago[Kaleidoscope] Rename Error -> LogError in Chapters 2-5.
Lang Hames [Fri, 25 Mar 2016 17:41:26 +0000 (17:41 +0000)]
[Kaleidoscope] Rename Error -> LogError in Chapters 2-5.

This keeps the naming consistent with Chapters 6-8, where Error was renamed to
LogError in r264426 to avoid clashes with the new Error class in libSupport.

llvm-svn: 264427

8 years ago[Kaleidoscope] Fix 'Error' name clashes.
Lang Hames [Fri, 25 Mar 2016 17:33:32 +0000 (17:33 +0000)]
[Kaleidoscope] Fix 'Error' name clashes.

llvm-svn: 264426

8 years ago[Object] Start threading Error through MachOObjectFile construction.
Lang Hames [Fri, 25 Mar 2016 17:25:34 +0000 (17:25 +0000)]
[Object] Start threading Error through MachOObjectFile construction.

llvm-svn: 264425

8 years ago[InstCombine] consolidate regression tests of the ancients (2002)
Sanjay Patel [Fri, 25 Mar 2016 17:16:32 +0000 (17:16 +0000)]
[InstCombine] consolidate regression tests of the ancients (2002)

Testing out the check-generator-script that's now in the utils folder.

llvm-svn: 264424

8 years ago[index] Remove redundancy between symbol kind and language
Ben Langmuir [Fri, 25 Mar 2016 17:01:59 +0000 (17:01 +0000)]
[index] Remove redundancy between symbol kind and language

Condense the ObjCKIND and CXXKIND options into just KIND, since the
language was already specified on a per-symbol basis and this
information was redundant. This only changes the internal
representation; naturally the libclang interface remains the same.

llvm-svn: 264423

8 years agofix IR function name regex to allow hyphens
Sanjay Patel [Fri, 25 Mar 2016 17:00:12 +0000 (17:00 +0000)]
fix IR function name regex to allow hyphens

llvm-svn: 264422

8 years agoDocument the purpose of this testcase.
Adrian Prantl [Fri, 25 Mar 2016 16:49:57 +0000 (16:49 +0000)]
Document the purpose of this testcase.

llvm-svn: 264421

8 years agoRevert "[SetVector] Add erase() method"
Jun Bum Lim [Fri, 25 Mar 2016 16:49:16 +0000 (16:49 +0000)]
Revert "[SetVector] Add erase() method"

This reverts commit r264414.

llvm-svn: 264420

8 years agoFix Narrowing conversion warning introduced by r264415
Hemant Kulkarni [Fri, 25 Mar 2016 16:37:03 +0000 (16:37 +0000)]
Fix Narrowing conversion warning introduced by r264415

llvm-svn: 264419

8 years agoImprove StringMap unittests: reintroduce move count, but shield against std::pair...
Mehdi Amini [Fri, 25 Mar 2016 16:36:00 +0000 (16:36 +0000)]
Improve StringMap unittests: reintroduce move count, but shield against std::pair internals

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

8 years ago[ASTMatchers] Add own version of VariadicFunction.
Samuel Benzaquen [Fri, 25 Mar 2016 16:29:30 +0000 (16:29 +0000)]
[ASTMatchers] Add own version of VariadicFunction.

Summary:
llvm::VariadicFunction is only being used by ASTMatchers.
Having our own copy here allows us to remove the other one from llvm/ADT.
Also, we can extend the API to meet our needs without modifying the common
implementation.

Reviewers: alexfh

Subscribers: klimek, cfe-commits

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

llvm-svn: 264417

8 years agoEnsure that the StringMap does not grow during the test for pre-allocation/reserve
Mehdi Amini [Fri, 25 Mar 2016 16:09:34 +0000 (16:09 +0000)]
Ensure that the StringMap does not grow during the test for pre-allocation/reserve

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

8 years ago[llvm-readobj] Impl GNU style program headers print
Hemant Kulkarni [Fri, 25 Mar 2016 16:04:48 +0000 (16:04 +0000)]
[llvm-readobj] Impl GNU style program headers print

readelf -lW

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

llvm-svn: 264415

8 years ago[SetVector] Add erase() method
Jun Bum Lim [Fri, 25 Mar 2016 16:04:43 +0000 (16:04 +0000)]
[SetVector] Add erase() method

Summary:
Add erase() which returns an iterator pointing to the next element after the
erased one. This makes it possible to erase selected elements while iterating
over the SetVector :
  while (I != E)
    if (test(*I))
      I = SetVector.erase(I);
    else
      ++I;

Reviewers: qcolombet, mcrosier, MatzeB, dblaikie

Subscribers: dberlin, dblaikie, mcrosier, llvm-commits

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

llvm-svn: 264414

8 years agoImplement is_always_lock_free
JF Bastien [Fri, 25 Mar 2016 15:48:21 +0000 (15:48 +0000)]
Implement is_always_lock_free

Summary:

This was voted into C++17 at the Jacksonville meeting. The final P0152R1
paper will be in the upcoming post-Jacksonville mailing, and is also
available here:

  http://jfbastien.github.io/papers/P0152R1.html

Reviewers: mclow.lists, rsmith

Subscribers: cfe-commits

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

llvm-svn: 264413

8 years agoDisable counting the number of move in the unittest, it seems to rely on move-constru...
Mehdi Amini [Fri, 25 Mar 2016 15:46:14 +0000 (15:46 +0000)]
Disable counting the number of move in the unittest, it seems to rely on move-construction elision

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

8 years ago[SystemZ] Remove isBranch and isTerminator flags on BRCT and BRCTG.
Jonas Paulsson [Fri, 25 Mar 2016 15:42:30 +0000 (15:42 +0000)]
[SystemZ] Remove isBranch and isTerminator flags on BRCT and BRCTG.

The BranchUnaryRI instruction class already sets these flags.

Reviewed by Ulrich Weigand.

llvm-svn: 264411

8 years agoRevert "Bitcode: Collect all MDString records into a single blob"
Duncan P. N. Exon Smith [Fri, 25 Mar 2016 15:22:27 +0000 (15:22 +0000)]
Revert "Bitcode: Collect all MDString records into a single blob"

This reverts commit r264409 since it failed to bootstrap:
http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto_build/8302/

llvm-svn: 264410

8 years agoBitcode: Collect all MDString records into a single blob
Duncan P. N. Exon Smith [Fri, 25 Mar 2016 14:40:18 +0000 (14:40 +0000)]
Bitcode: Collect all MDString records into a single blob

Optimize output of MDStrings in bitcode.  This emits them in big blocks
(currently 1024) in a pair of records:
  - BULK_STRING_SIZES: the sizes of the strings in the block, and
  - BULK_STRING_DATA: a single blob, which is the concatenation of all
    the strings.

Inspired by Mehdi's similar patch, http://reviews.llvm.org/D18342, this
should (a) slightly reduce bitcode size, since there is less record
overhead, and (b) greatly improve reading speed, since blobs are super
cheap to deserialize.

I needed to add support for blobs to streaming input to get the test
suite passing.
  - StreamingMemoryObject::getPointer reads ahead and returns the
    address of the blob.
  - To avoid a possible reallocation of StreamingMemoryObject::Bytes,
    BitstreamCursor::readRecord needs to move the call to JumpToEnd
    forward so that getPointer is the last bitstream operation.

llvm-svn: 264409

8 years ago[AArch64] Fix typo. NFC.
Chad Rosier [Fri, 25 Mar 2016 14:37:43 +0000 (14:37 +0000)]
[AArch64] Fix typo. NFC.

llvm-svn: 264408

8 years agoEnable non-power-of-2 #pragma unroll counts.
David L Kreitzer [Fri, 25 Mar 2016 14:24:52 +0000 (14:24 +0000)]
Enable non-power-of-2 #pragma unroll counts.

Patch by Evgeny Stupachenko.

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

llvm-svn: 264407

8 years agodocs: Clearify that our release note describe the upcoming release of Polly
Tobias Grosser [Fri, 25 Mar 2016 14:22:53 +0000 (14:22 +0000)]
docs: Clearify that our release note describe the upcoming release of Polly

llvm-svn: 264406

8 years agowww: Directly link to our new SPHINX documentation
Tobias Grosser [Fri, 25 Mar 2016 14:19:34 +0000 (14:19 +0000)]
www: Directly link to our new SPHINX documentation

llvm-svn: 264405

8 years agodocs: Add links to the old documentation
Tobias Grosser [Fri, 25 Mar 2016 14:18:42 +0000 (14:18 +0000)]
docs: Add links to the old documentation

llvm-svn: 264404

8 years ago[X86][SSE] Don't duplicate Lower256IntArith functionality in LowerShift. NFC.
Simon Pilgrim [Fri, 25 Mar 2016 14:17:54 +0000 (14:17 +0000)]
[X86][SSE] Don't duplicate Lower256IntArith functionality in LowerShift. NFC.

LowerShift was using the same code as Lower256IntArith to split 256-bit vectors into 2 x 128-bit vectors, so now we just call Lower256IntArith.

llvm-svn: 264403