platform/upstream/llvm.git
8 years ago[PowerPC] Map max/minnum intrinsics and fmax/fmin to ISD nodes for CTR-based loop...
Hal Finkel [Sun, 27 Mar 2016 05:40:56 +0000 (05:40 +0000)]
[PowerPC] Map max/minnum intrinsics and fmax/fmin to ISD nodes for CTR-based loop legality

Intrinsic::maxnum and Intrinsic::minnum, along with the associated libc
function calls (fmax[f], etc.) generally map to function calls after lowering.
For some vector types with QPX at least, however, we can legally lower these,
and we don't need to prohibit CTR-based loops on their account.

It turned out, however, that the logic that checked the opcodes associated with
intrinsics was broken (it would set the Opcode variable, but that variable was
later checked only if set for some otherwise-external function call.

This fixes the latter problem and adds the FMAX/MINNUM mappings.

llvm-svn: 264532

8 years agoAdd clang-tools-extra release notes
Richard Thomson [Sun, 27 Mar 2016 05:06:57 +0000 (05:06 +0000)]
Add clang-tools-extra release notes

llvm-svn: 264531

8 years agoUse the correct alignment for uuid descriptors
David Majnemer [Sun, 27 Mar 2016 04:46:14 +0000 (04:46 +0000)]
Use the correct alignment for uuid descriptors

The _GUID_ descriptors emitted by MSVC have alignment 8 for 64-bit
builds: we should do the same if the linker picks the "wrong" COMDAT.

llvm-svn: 264530

8 years agoImprove the representation of CXXUuidofExpr
David Majnemer [Sun, 27 Mar 2016 04:46:07 +0000 (04:46 +0000)]
Improve the representation of CXXUuidofExpr

Keep a pointer to the UuidAttr that the CXXUuidofExpr corresponds to.
This makes translating from __uuidof to the underlying constant a lot
more straightforward.

llvm-svn: 264529

8 years ago[Verifier] Reject PHIs using defs from own block.
Michael Kruse [Sat, 26 Mar 2016 23:32:57 +0000 (23:32 +0000)]
[Verifier] Reject PHIs using defs from own block.

Reject the following IR as malformed (assuming that %entry, %next are
not in a loop):

    next:
      %y = phi i32 [ 0, %entry ]
      %x = phi i32 [ %y, %entry ]

Such PHI nodes came up in PR26718. While there was no consensus on
whether or not this is valid IR, most opinions on that bug and in a
discussion on the llvm-dev mailing list tended towards a
"strict interpretation" (term by Joseph Tremoulet) of PHI node uses.
Also, the language reference explicitly states that "the use of each
incoming value is deemed to occur on the edge from the corresponding
predecessor block to the current block" and
`DominatorTree::dominates(Instruction*, Use&)` uses this definition as
well.

For the code mentioned in PR15384, clang does not compile to such PHIs
(anymore?). The test case still hangs when replacing `%tmp6` with `%tmp`
in revisions before r176366 (where PR15384 has been fixed). The
occurrence of %tmp6 therefore was probably unintentional. Its value is
not used except in other PHIs.

Reviewers: majnemer, reames, JosephTremoulet, bkramer, grosser, jdoerfert, kparzysz, sanjoy

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

llvm-svn: 264528

8 years ago[SimplifyCFG] propagate branch metadata when creating select (PR26636)
Sanjay Patel [Sat, 26 Mar 2016 23:30:50 +0000 (23:30 +0000)]
[SimplifyCFG] propagate branch metadata when creating select (PR26636)

llvm-svn: 264527

8 years agominimize test cases
Sanjay Patel [Sat, 26 Mar 2016 23:09:25 +0000 (23:09 +0000)]
minimize test cases

These are tests for store transforms.
The loads, adds, and geps were irrelevant.

llvm-svn: 264526

8 years ago[NFC] Tweak diagnostic for template template arguments, to include template aliases.
Faisal Vali [Sat, 26 Mar 2016 20:46:45 +0000 (20:46 +0000)]
[NFC] Tweak diagnostic for template template arguments, to include template aliases.

The prior diagnostic (err_template_arg_not_class_template) would state that the template argument to a template template parameter can only be a class template, when it can also be a template alias.  The newly renamed diagnostic (err_template_arg_not_valid_template) mentions template aliases.

llvm-svn: 264522

8 years agoMake vp merge test more robust
Xinliang David Li [Sat, 26 Mar 2016 20:44:03 +0000 (20:44 +0000)]
Make vp merge test more robust

llvm-svn: 264521

8 years agollvm-dwp: Include the dwo name (if available) when diagnosing duplicate CU IDs from...
David Blaikie [Sat, 26 Mar 2016 20:32:14 +0000 (20:32 +0000)]
llvm-dwp: Include the dwo name (if available) when diagnosing duplicate CU IDs from dwp input files

If you're building dwps from other dwps, it can be hard to track down a
duplicate CU ID if it comes from two compilations of the same file in
different modes, etc. By including the .dwo path (which is hopefully
more unique than the file path) it can help track down where the
duplicates came from.

llvm-svn: 264520

8 years agoCheck if a path is already absolute before trying to make it so.
Bob Wilson [Sat, 26 Mar 2016 18:55:13 +0000 (18:55 +0000)]
Check if a path is already absolute before trying to make it so.

The FileSystem::makeAbsolute function has been calculating the current
working directory unconditionally, even when it is not needed. This calls
down to llvm::sys::fs::current_path, which is relatively expensive
because it stats two directories, regardless of whether those paths are
already in the stat cache. The net effect is that when using the
VFS, every stat during header search turns into three stats. With this
change, we get back to a single stat for absolute directory paths.

llvm-svn: 264519

8 years ago[ELF/LTO] Refactor to reduce indentation.
Davide Italiano [Sat, 26 Mar 2016 18:33:09 +0000 (18:33 +0000)]
[ELF/LTO] Refactor to reduce indentation.

Suggested by: Rui Ueyama.

llvm-svn: 264518

8 years ago[X86][AVX] Enabled SMUL_LOHI/UMUL_LOHI v8i32 vectors on AVX1 targets
Simon Pilgrim [Sat, 26 Mar 2016 18:32:13 +0000 (18:32 +0000)]
[X86][AVX] Enabled SMUL_LOHI/UMUL_LOHI v8i32 vectors on AVX1 targets

Correct splitting of v8i32 vectors into v4i32 vectors to prevent scalarization

llvm-svn: 264517

8 years agoRevert "NFC: static_assert instead of comment"
JF Bastien [Sat, 26 Mar 2016 18:20:02 +0000 (18:20 +0000)]
Revert "NFC: static_assert instead of comment"

This reverts commit fa36fcff16c7d4f78204d6296bf96c3558a4a672.

Causes the following Windows failure:

  C:\Buildbot\Slave\llvm-clang-lld-x86_64-scei-ps4-windows10pro-fast\llvm.src\lib\CodeGen\MachineInstr.cpp(762):
  error C2338: must be trivially copyable to memmove

llvm-svn: 264516

8 years agoNFC: static_assert instead of comment
JF Bastien [Sat, 26 Mar 2016 18:14:27 +0000 (18:14 +0000)]
NFC: static_assert instead of comment

Summary: isPodLike is as close as we have for is_trivially_copyable.

Subscribers: llvm-commits

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

llvm-svn: 264515

8 years agoGeneralize the domain complexity restrictions
Johannes Doerfert [Sat, 26 Mar 2016 16:17:00 +0000 (16:17 +0000)]
Generalize the domain complexity restrictions

  This patch applies the restrictions on the number of domain conjuncts
  also to the domain parts of piecewise affine expressions we generate.
  To this end the wording is change slightly. It was needed to support
  complex additions featuring zext-instructions but it also fixes PR27045.

  lnt profitable runs reports only little changes that might be noise:
  Compile Time:
    Polybench/[...]/2mm                     +4.34%
    SingleSource/[...]/stepanov_container   -2.43%
  Execution Time:
    External/[...]/186_crafty               -2.32%
    External/[...]/188_ammp                 -1.89%
    External/[...]/473_astar                -1.87%

llvm-svn: 264514

8 years ago[Cxx1z-constexpr-lambda-P0170R1] Support parsing of constexpr specifier (and its...
Faisal Vali [Sat, 26 Mar 2016 16:11:37 +0000 (16:11 +0000)]
[Cxx1z-constexpr-lambda-P0170R1]  Support parsing of constexpr specifier (and its inference) on lambda expressions

Support the constexpr specifier on lambda expressions - and support its inference from the lambda call operator's body.

i.e.
  auto L = [] () constexpr { return 5; };
  static_assert(L() == 5); // OK
  auto Implicit = [] (auto a) { return a; };
  static_assert(Implicit(5) == 5);

We do not support evaluation of lambda's within constant expressions just yet.

Implementation Strategy:
  - teach ParseLambdaExpressionAfterIntroducer to expect a constexpr specifier and mark the invented function call operator's declarator's decl-specifier with it; Have it emit fixits for multiple decl-specifiers (mutable or constexpr) in this location.
  - for cases where constexpr is not explicitly specified, have buildLambdaExpr check whether the invented function call operator satisfies the requirements of a constexpr function, by calling CheckConstexprFunctionDecl/Body.

Much obliged to Richard Smith for his patience and his care, in ensuring the code is clang-worthy.

llvm-svn: 264513

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