platform/upstream/llvm.git
8 years agoRemove autotools build system
Michael Kruse [Thu, 28 Jan 2016 12:00:33 +0000 (12:00 +0000)]
Remove autotools build system

The autotools build system is based on and requires LLVM's autotools
build system to work, which has been depricated and finally removed in
r258861. Consequently we also remove the autotools build system from
Polly.

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

llvm-svn: 259041

8 years agoUnbreak the wasm backend again after r259035.
Benjamin Kramer [Thu, 28 Jan 2016 11:26:34 +0000 (11:26 +0000)]
Unbreak the wasm backend again after r259035.

llvm-svn: 259040

8 years ago[mips][microMIPS] Disable FastISel for microMIPS
Zoran Jovanovic [Thu, 28 Jan 2016 11:08:03 +0000 (11:08 +0000)]
[mips][microMIPS] Disable FastISel for microMIPS

Author: milena.vujosevic.janicic
Reviewers: dsanders

FastIsel is not supported for microMIPS, thus it needs to be disabled.
Test micromips-zero-mat-uses.ll is deleted since the tested sequence of instructions is not generated for microMIPS without FastISel.
Differential Revision: http://reviews.llvm.org/D15892

llvm-svn: 259039

8 years ago[OMPT] Add support for ompt_event_task_dependences and ompt_event_task_dependence_pair
Jonas Hahnfeld [Thu, 28 Jan 2016 10:39:52 +0000 (10:39 +0000)]
[OMPT] Add support for ompt_event_task_dependences and ompt_event_task_dependence_pair

The attached patch adds support for ompt_event_task_dependences and
ompt_event_task_dependence_pair events from the OMPT specification [1]. These
events only apply to OpenMP 4.0 and 4.1 (aka 4.5) because task dependencies
were introduced in 4.0.

With respect to the changes:

ompt_event_task_dependences
According to the specification, this event is raised after the task has been
created, thefore this event needs to be raised after ompt_event_task_begin
(in __kmp_task_start). However, the dependencies are known at
__kmpc_omp_task_with_deps which occurs before __kmp_task_start. My modifications
extend the ompt_task_info_t struct in order to store the dependencies of the
task when _kmpc_omp_task_with_deps occurs and then they are emitted in
__kmp_task_start just after raising the ompt_event_task_begin. The deps field
is allocated and valid until the event is raised and it is freed and set
to null afterwards.

ompt_event_task_dependence_pair
The processing of the dependences (i.e. checking whenever a dependence is
already satisfied) is done within __kmp_process_deps. That function checks
every dependence and calls the __kmp_track_dependence routine which gives some
support for graphical output. I used that routine to emit the dependence pair
but I also needed to know the sink_task. Despite the fact that the code within
KMP_SUPPORT_GRAPH_OUTPUT refers to task_sink it may be null because
sink->dn.task (there's a comment regarding this) and in fact it does not point
to a proper pointer value because the value is set in node->dn.task = task;
after the __kmp_process_deps calls in __kmp_check_deps. I have extended the
__kmp_process_deps and __kmp_track_dependence parameter list to receive the
sink_task.

[1] https://github.com/OpenMPToolsInterface/OMPT-Technical-Report/blob/target/ompt-tr.pdf

Patch by Harald Servat
Differential Revision: http://reviews.llvm.org/D14746

llvm-svn: 259038

8 years ago[OMPT] Avoid SEGV when a worker thread needs its parallel id behind the barrier
Jonas Hahnfeld [Thu, 28 Jan 2016 10:39:45 +0000 (10:39 +0000)]
[OMPT] Avoid SEGV when a worker thread needs its parallel id behind the barrier

When the code behind the barrier is executed, the master thread may have
already resumed execution. That's why we cannot safely assume that *pteam
is not yet freed.

This has been introduced by r258866.

llvm-svn: 259037

8 years agoAdd backend dignostic printer for unsupported features
Oliver Stannard [Thu, 28 Jan 2016 10:07:34 +0000 (10:07 +0000)]
Add backend dignostic printer for unsupported features

Re-commit of r258950 after fixing layering violation.

Add backend dignostic printer for unsupported features

The related LLVM patch adds a backend diagnostic type for reporting
unsupported features, this adds a printer for them to clang.

In the case where debug location information is not available, I've
changed the printer to report the location as the first line of the
function, rather than the closing brace, as the latter does not give the
user any information. This also affects optimisation remarks.

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

llvm-svn: 259036

8 years agoAdd backend dignostic printer for unsupported features
Oliver Stannard [Thu, 28 Jan 2016 10:07:27 +0000 (10:07 +0000)]
Add backend dignostic printer for unsupported features

Re-commit of r258951 after fixing layering violation.

The related LLVM patch adds a backend diagnostic type for reporting
unsupported features, this adds a printer for them to clang.

In the case where debug location information is not available, I've
changed the printer to report the location as the first line of the
function, rather than the closing brace, as the latter does not give the
user any information. This also affects optimisation remarks.

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

llvm-svn: 259035

8 years ago[X86][SSE] Move setTargetShuffleZeroElements closer to getTargetShuffleMask. NFCI.
Simon Pilgrim [Thu, 28 Jan 2016 09:45:01 +0000 (09:45 +0000)]
[X86][SSE] Move setTargetShuffleZeroElements closer to getTargetShuffleMask. NFCI.

Keep target shuffle mask helper functions closer together.

llvm-svn: 259034

8 years agoMinor code cleanups. NFC.
Junmo Park [Thu, 28 Jan 2016 09:42:39 +0000 (09:42 +0000)]
Minor code cleanups. NFC.

llvm-svn: 259033

8 years agoFix isBeforeInTranslationUnit to not abort on macros defined in cmdline.
Yury Gribov [Thu, 28 Jan 2016 09:28:18 +0000 (09:28 +0000)]
Fix isBeforeInTranslationUnit to not abort on macros defined in cmdline.

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

llvm-svn: 259031

8 years agoSmall refactor in isBeforeInTranslationUnit.
Yury Gribov [Thu, 28 Jan 2016 09:27:46 +0000 (09:27 +0000)]
Small refactor in isBeforeInTranslationUnit.

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

llvm-svn: 259030

8 years ago[X86][AVX512] small fix in ptestm intrinsics
Asaf Badouh [Thu, 28 Jan 2016 08:33:22 +0000 (08:33 +0000)]
[X86][AVX512] small fix in ptestm intrinsics
move ptestm{q|d} intrinsics from patterns form (in td file) to the intrinsics table

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

llvm-svn: 259029

8 years agofixed Xcode gtest build failure
Todd Fiala [Thu, 28 Jan 2016 08:16:18 +0000 (08:16 +0000)]
fixed Xcode gtest build failure

llvm-svn: 259028

8 years agomodify Xcode build to use cmake/ninja for internal llvm/clang
Todd Fiala [Thu, 28 Jan 2016 07:36:44 +0000 (07:36 +0000)]
modify Xcode build to use cmake/ninja for internal llvm/clang

This change restores the Xcode build to working after Makefile support
was stripped from LLVM and clang recently.

With this change, the Xcode build now requires cmake (2.8.12.2+).
The cmake must either be on the path that Xcode sees, or it must
exist in one of the following locations:

* /usr/local/bin/cmake
* /opt/local/bin/cmake
* $HOME/bin/cmake

If the ninja build tool is present on the path, it will be used.
If not, ninja will be cloned (via git), bootstrap-built, and
used for the llvm/clang build.

LLDB now requires a minimum deployment target of OS X 10.9.  Prior
to this, it was 10.8.  The llvm/clang cmake build will not run
with Xcode 7.2 or Xcode 7.3 beta's compiler with the minimum
deployment target set to anything lower than 10.9.  This is
related to #include <atomic>.

When llvm or clang source code does not exist in the lldb tree,
it will be cloned via git using http://llvm.org/git/{project}.git.
Previously it used SVN.  If this causes any heartache, we can
make this smarter, autodetect an embedded svn and use svn instead.
(And/or use SVN if a git command is not available).

This change also fixes an lldb-mi linkage failure (needed
libncurses) as exposed by one of the LLVM libs.

llvm-svn: 259027

8 years ago[OMPT] Workaround clang failing with 'declare target'
Jonas Hahnfeld [Thu, 28 Jan 2016 07:14:44 +0000 (07:14 +0000)]
[OMPT] Workaround clang failing with 'declare target'

Current clang trunk reports _OPENMP to be 201307 = OpenMP 4.0. It doesn't
recognize '#pragma omp declare target' though (patch still pending) and
therefore fails compilation.

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

llvm-svn: 259026

8 years agoValueTracking: Use fixed array for assumption exclude set in Query.
Matthias Braun [Thu, 28 Jan 2016 06:29:33 +0000 (06:29 +0000)]
ValueTracking: Use fixed array for assumption exclude set in Query.

The Query structure is constructed often and is relevant for compiletime
performance. We can replace the SmallPtrSet for assumption exclusions in
this structure with a fixed size array because we know the maximum
number of elements.  This improves typical clang -O3 -emit-llvm compiletime
by 1.2% in my measurements.

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

llvm-svn: 259025

8 years ago[DAGCombiner] Don't add volatile or indexed stores to ChainedStores
Junmo Park [Thu, 28 Jan 2016 06:23:33 +0000 (06:23 +0000)]
[DAGCombiner] Don't add volatile or indexed stores to ChainedStores

Summary:
findBetterNeighborChains does not handle volatile or indexed stores.
However, it did not check when adding stores to ChainedStores.

Reviewers: arsenm

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

llvm-svn: 259024

8 years ago[libcxx] Remove pragmas that were needed to suppress warnings produced
Akira Hatanaka [Thu, 28 Jan 2016 06:13:36 +0000 (06:13 +0000)]
[libcxx] Remove pragmas that were needed to suppress warnings produced
by -Wpadded.

We don't need these pragmas anymore because -Wpadded was removed from
buildit in r258900.

llvm-svn: 259023

8 years ago[Lex] Share some common code between decimal and octal parsing in NumericLiteralParser.
Craig Topper [Thu, 28 Jan 2016 05:22:54 +0000 (05:22 +0000)]
[Lex] Share some common code between decimal and octal parsing in NumericLiteralParser.

There were a couple slight variations between the two copies that I don't believe were intentional. For example, only one of the paths checked for digit separations proceeding a '.', but I think the lexer itself splits the token if a digit separator proceeds a period.

llvm-svn: 259022

8 years agoSmallPtrSet: Add missing include
Matthias Braun [Thu, 28 Jan 2016 05:09:01 +0000 (05:09 +0000)]
SmallPtrSet: Add missing include

llvm-svn: 259021

8 years agoWebAssembly: fix build
JF Bastien [Thu, 28 Jan 2016 05:05:17 +0000 (05:05 +0000)]
WebAssembly: fix build

r259016 didn't also revert r258957 which broken the WebAssembly build.

llvm-svn: 259020

8 years agoSmallPtrSet: Make destructor available for inlining
Matthias Braun [Thu, 28 Jan 2016 04:49:14 +0000 (04:49 +0000)]
SmallPtrSet: Make destructor available for inlining

llvm-svn: 259019

8 years agoSmallPtrSet: Share some code between copy/move constructor/assignment operator
Matthias Braun [Thu, 28 Jan 2016 04:49:11 +0000 (04:49 +0000)]
SmallPtrSet: Share some code between copy/move constructor/assignment operator

llvm-svn: 259018

8 years agoSmallPtrSet: Remove trailing whitespace, fix indentation
Matthias Braun [Thu, 28 Jan 2016 04:49:07 +0000 (04:49 +0000)]
SmallPtrSet: Remove trailing whitespace, fix indentation

llvm-svn: 259017

8 years agoRevert r258951 (and r258950), "Refactor backend diagnostics for unsupported features"
NAKAMURA Takumi [Thu, 28 Jan 2016 04:41:32 +0000 (04:41 +0000)]
Revert r258951 (and r258950), "Refactor backend diagnostics for unsupported features"

It broke layering violation in LLVMIR.

clang r258950 "Add backend dignostic printer for unsupported features"
llvm  r258951 "Refactor backend diagnostics for unsupported features"

llvm-svn: 259016

8 years agoLeft a file out of r259014
Marshall Clow [Thu, 28 Jan 2016 04:15:35 +0000 (04:15 +0000)]
Left a file out of r259014

llvm-svn: 259015

8 years agoimplement ostream_joiner. Reviewed as http://reviews.llvm.org/D16605
Marshall Clow [Thu, 28 Jan 2016 04:14:56 +0000 (04:14 +0000)]
implement ostream_joiner. Reviewed as reviews.llvm.org/D16605

llvm-svn: 259014

8 years ago[WebAssembly] Don't stackify a register def past a get_local use in the same tree.
Dan Gohman [Thu, 28 Jan 2016 03:59:09 +0000 (03:59 +0000)]
[WebAssembly] Don't stackify a register def past a get_local use in the same tree.

llvm-svn: 259013

8 years agoputting requires on one line - ppc still executes my tests.
Mike Aizatsky [Thu, 28 Jan 2016 02:24:35 +0000 (02:24 +0000)]
putting requires on one line - ppc still executes my tests.

llvm-svn: 259012

8 years ago[Sema] Make extended vectors of `bool` an error.
George Burgess IV [Thu, 28 Jan 2016 01:38:18 +0000 (01:38 +0000)]
[Sema] Make extended vectors of `bool` an error.

In OpenCL, `bool` vectors are a reserved type, and are therefore
illegal.

Outside of OpenCL, if we try to make an extended vector of N `bool`s,
Clang will lower it to an `[N x i1]`. LLVM has no ABI for bitvectors, so
lots of operations on such vectors are thoroughly broken. As a result,
this patch makes them illegal in everything else, as well. :)

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

llvm-svn: 259011

8 years agoMinor code formatting cleanup. NFC.
Junmo Park [Thu, 28 Jan 2016 01:23:18 +0000 (01:23 +0000)]
Minor code formatting cleanup. NFC.

llvm-svn: 259010

8 years ago[WebAssembly] Enhanced register stackification
Dan Gohman [Thu, 28 Jan 2016 01:22:44 +0000 (01:22 +0000)]
[WebAssembly] Enhanced register stackification

This patch revamps the RegStackifier pass with a new tree traversal mechanism,
enabling three major new features:

 - Stackification of values with multiple uses, using the result value of set_local
 - More aggressive stackification of instructions with side effects
 - Reordering operands in commutative instructions to enable more stackification.

llvm-svn: 259009

8 years agoMinor style cleanup of CFLAA. NFC.
George Burgess IV [Thu, 28 Jan 2016 00:54:01 +0000 (00:54 +0000)]
Minor style cleanup of CFLAA. NFC.

llvm-svn: 259008

8 years ago[cfi] Fix recovery from out-of-bounds vtable error.
Evgeniy Stepanov [Thu, 28 Jan 2016 00:37:54 +0000 (00:37 +0000)]
[cfi] Fix recovery from out-of-bounds vtable error.

llvm-svn: 259007

8 years ago[sancov] run sancov test on x86_64 linux only
Mike Aizatsky [Thu, 28 Jan 2016 00:35:17 +0000 (00:35 +0000)]
[sancov] run sancov test on x86_64 linux only

llvm-svn: 259006

8 years agoGetArgv returns null on widnows, do not crash
Mike Aizatsky [Thu, 28 Jan 2016 00:31:49 +0000 (00:31 +0000)]
GetArgv returns null on widnows, do not crash

llvm-svn: 259005

8 years ago[sancov] running sancov test on linux only
Mike Aizatsky [Thu, 28 Jan 2016 00:27:13 +0000 (00:27 +0000)]
[sancov] running sancov test on linux only

llvm-svn: 259004

8 years agoA while back in revison 244716 we added support for getting the host OS version info...
Greg Clayton [Thu, 28 Jan 2016 00:16:11 +0000 (00:16 +0000)]
A while back in revison 244716 we added support for getting the host OS version info from debugserver. We added keys to "qHostInfo" that were "osmajor", "osminor" and "ospatch", but no one ever parsed those, so I am removing them from debugserver. We accidentally also added a "version" key to qHostInfo instead of "os_version". So now we need to support both "version" and "os_version" in qHostInfo since we have debugserver binaries out in the wild that support this old packet type. I have updated debugserver ot use the correct "os_version" for future compatability or correctness.

<rdar://problem/24378699>

llvm-svn: 259003

8 years agoless indenting; NFCI
Sanjay Patel [Thu, 28 Jan 2016 00:03:16 +0000 (00:03 +0000)]
less indenting; NFCI

llvm-svn: 259002

8 years agousing /system/bin/sh on android in tests.
Mike Aizatsky [Wed, 27 Jan 2016 23:58:23 +0000 (23:58 +0000)]
using /system/bin/sh on android in tests.

Subscribers: tberghammer, danalbert, srhines

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

llvm-svn: 259001

8 years ago[sancov] sancov tool documentation
Mike Aizatsky [Wed, 27 Jan 2016 23:56:12 +0000 (23:56 +0000)]
[sancov] sancov tool documentation

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

llvm-svn: 259000

8 years ago[sanitizers] generating html report on coverage dump
Mike Aizatsky [Wed, 27 Jan 2016 23:51:36 +0000 (23:51 +0000)]
[sanitizers] generating html report on coverage dump

Subscribers: tberghammer, danalbert, srhines

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

llvm-svn: 258999

8 years agoScopInfo: Never add read accesses for synthesizable values
Michael Kruse [Wed, 27 Jan 2016 22:51:56 +0000 (22:51 +0000)]
ScopInfo: Never add read accesses for synthesizable values

Before adding a MK_Value READ MemoryAccess, check whether the read is
necessary or synthesizable. Synthesizable values are later generated by
the SCEVExpander and therefore do not need to be transferred
explicitly. This can happen because the check for synthesizability has
presumbly been forgotten in the case where a phi's incoming value has
been defined in a different statement.

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

llvm-svn: 258998

8 years agoStrengthen cfi-check-fail test.
Evgeniy Stepanov [Wed, 27 Jan 2016 22:28:56 +0000 (22:28 +0000)]
Strengthen cfi-check-fail test.

r258993 allows stricter testing for basic block labels by making
sure that they are always followed by ":". Use this to improve the
test.

llvm-svn: 258997

8 years agoDo not use return with a function whose return type is void.
Rui Ueyama [Wed, 27 Jan 2016 22:23:44 +0000 (22:23 +0000)]
Do not use return with a function whose return type is void.

Although it is syntactically correct, it is a bit confusing, and
not necessary here.

llvm-svn: 258996

8 years ago[TTI] Add getPrefetchDistance from PPCLoopDataPrefetch, NFC
Adam Nemet [Wed, 27 Jan 2016 22:21:25 +0000 (22:21 +0000)]
[TTI] Add getPrefetchDistance from PPCLoopDataPrefetch, NFC

This patch is part of the work to make PPCLoopDataPrefetch
target-independent
(http://thread.gmane.org/gmane.comp.compilers.llvm.devel/92758).

As it was discussed in the above thread, getPrefetchDistance is
currently using instruction count which may change in the future.

llvm-svn: 258995

8 years agoARMv7k: simplify logic for deciding sjlj-exceptions.
Tim Northover [Wed, 27 Jan 2016 22:14:02 +0000 (22:14 +0000)]
ARMv7k: simplify logic for deciding sjlj-exceptions.

Slight change of behaviour in the odd armv7+watchos case, which should match
the other runtime components.

llvm-svn: 258994

8 years agoTweak unnamed label syntax in textual IR for easier matching in tests.
Evgeniy Stepanov [Wed, 27 Jan 2016 21:53:08 +0000 (21:53 +0000)]
Tweak unnamed label syntax in textual IR for easier matching in tests.

Change the unnamed label comments like
  ; <label>:8  ; preds = %1
to
  ; <label>:8:  ; preds = %1

This way lit tests can match [[LABEL]]: in both asserts and no-asserts builds.

llvm-svn: 258993

8 years ago[cfi] Fix a warning in tests.
Evgeniy Stepanov [Wed, 27 Jan 2016 21:49:03 +0000 (21:49 +0000)]
[cfi] Fix a warning in tests.

test/cfi/cross-dso/dlopen.cpp:67:45: warning: GCC does not allow 'aligned' attribute in this position on a function definition [-Wgcc-compat]
extern "C" void do_nothing() __attribute__((aligned(4096))) {}

llvm-svn: 258992

8 years ago[CMake] Set llvm_tools_dir to LLVM_TOOLS_BINARY_DIR instead of LLVM_TOOLS_DIR
Alexey Samsonov [Wed, 27 Jan 2016 21:36:38 +0000 (21:36 +0000)]
[CMake] Set llvm_tools_dir to LLVM_TOOLS_BINARY_DIR instead of LLVM_TOOLS_DIR

In this way, it should work for both in-LLVM and standalone
compiler-rt build.

llvm-svn: 258991

8 years agoRestore th_current_task first as suggested by John Mellor-Crummey
Jonathan Peyton [Wed, 27 Jan 2016 21:20:26 +0000 (21:20 +0000)]
Restore th_current_task first as suggested by John Mellor-Crummey

If an asynchronous inquiry peers into the runtime system
it doesn't see the freed task as the current task.

llvm-svn: 258990

8 years ago[WebAssembly] Implement byval arguments
Derek Schuff [Wed, 27 Jan 2016 21:17:39 +0000 (21:17 +0000)]
[WebAssembly] Implement byval arguments

Summary:
Just does the simple allocation of a stack object and passes
a pointer to the callee.

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

llvm-svn: 258989

8 years ago[cfi] Disable vtable diagnostics when no cxxabi.
Evgeniy Stepanov [Wed, 27 Jan 2016 21:15:10 +0000 (21:15 +0000)]
[cfi] Disable vtable diagnostics when no cxxabi.

This should fix the build on Mac 10.8 and earlier.

llvm-svn: 258988

8 years ago[utils] Add windows support to update_llc_test_checks.py
Simon Pilgrim [Wed, 27 Jan 2016 21:13:18 +0000 (21:13 +0000)]
[utils] Add windows support to update_llc_test_checks.py

Strip dos line endings from llc generated files to allow the regex patterns to match them.

Ensure updated *.ll files are generated with unix style line endings.

llvm-svn: 258987

8 years agoFormatting fixes
Jonathan Peyton [Wed, 27 Jan 2016 21:02:04 +0000 (21:02 +0000)]
Formatting fixes

Removing extraneous { } bracket sections.  Unindenting blocks of
code as a result.  Also removing empty #ifdef KMP_STUB

llvm-svn: 258986

8 years agoFixing comments.
Jonathan Peyton [Wed, 27 Jan 2016 20:57:32 +0000 (20:57 +0000)]
Fixing comments.

Removing references to non-existent functions, fixing typos.

llvm-svn: 258985

8 years agoRemoving extra empty lines
Jonathan Peyton [Wed, 27 Jan 2016 20:44:49 +0000 (20:44 +0000)]
Removing extra empty lines

llvm-svn: 258984

8 years ago[sanitizers] using execv instead of execve with null env.
Mike Aizatsky [Wed, 27 Jan 2016 20:35:18 +0000 (20:35 +0000)]
[sanitizers] using execv instead of execve with null env.

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

llvm-svn: 258983

8 years ago[llvm-nm] Remove redundant check for file validity.
Davide Italiano [Wed, 27 Jan 2016 20:27:44 +0000 (20:27 +0000)]
[llvm-nm] Remove redundant check for file validity.

We already perform it at the beginning of the function so we can't
arrive here with an invalid object. Also, add a test so that bugs
won't sneak in the future.

llvm-svn: 258982

8 years agoclang-format: [Java] Remove unnecessary line break after complex annotations
Daniel Jasper [Wed, 27 Jan 2016 20:14:23 +0000 (20:14 +0000)]
clang-format: [Java] Remove unnecessary line break after complex annotations

Before:
  @Annotation("Some"
      + " text")
  List<Integer>
      list;

After:
  @Annotation("Some"
      + " text")
  List<Integer> list;

llvm-svn: 258981

8 years agoClass Property: create accessors (class methods) for class property.
Manman Ren [Wed, 27 Jan 2016 20:10:32 +0000 (20:10 +0000)]
Class Property: create accessors (class methods) for class property.

Change a few places where we assume property accessors can only be instance
methods.

rdar://23891898

llvm-svn: 258980

8 years agoClass Property: handle class properties.
Manman Ren [Wed, 27 Jan 2016 20:00:32 +0000 (20:00 +0000)]
Class Property: handle class properties.

At places where we handle instance properties, if necessary.

rdar://23891898

llvm-svn: 258979

8 years agoRevert "Resubmit r258759 with proper unicode handling."
Zachary Turner [Wed, 27 Jan 2016 19:47:28 +0000 (19:47 +0000)]
Revert "Resubmit r258759 with proper unicode handling."

This reverts commit 2c79d60214e146b13b233392a859b4f79340e90e.

llvm-svn: 258978

8 years ago[cfi] Fix gcc build.
Evgeniy Stepanov [Wed, 27 Jan 2016 19:33:00 +0000 (19:33 +0000)]
[cfi] Fix gcc build.

llvm-svn: 258977

8 years agoARMv7k: select ABI based on v7k Arch rather than watchos OS.
Tim Northover [Wed, 27 Jan 2016 19:32:40 +0000 (19:32 +0000)]
ARMv7k: select ABI based on v7k Arch rather than watchos OS.

Various bits we'd like to use the new ABI actually compile with "-arch armv7k
-miphoneos-version-min=9.0". Not ideal, but also not ridiculous given how
slices work.

llvm-svn: 258976

8 years agoARMv7k: base ABI decision on v7k Arch rather than watchos OS.
Tim Northover [Wed, 27 Jan 2016 19:32:29 +0000 (19:32 +0000)]
ARMv7k: base ABI decision on v7k Arch rather than watchos OS.

Various bits we want to use the new ABI actually compile with "-arch armv7k
-miphoneos-version-min=9.0". Not ideal, but also not ridiculous given how
slices work.

llvm-svn: 258975

8 years agoOne more batch of self-containing headers.
Benjamin Kramer [Wed, 27 Jan 2016 19:29:56 +0000 (19:29 +0000)]
One more batch of self-containing headers.

llvm-svn: 258974

8 years agoDon't put classes in headers into anonymous namespaces.
Benjamin Kramer [Wed, 27 Jan 2016 19:29:42 +0000 (19:29 +0000)]
Don't put classes in headers into anonymous namespaces.

You want ODR violations? That's how you get ODR violations.

llvm-svn: 258973

8 years ago[SimplifyCFG] limit recursion depth when speculating instructions (PR26308)
Sanjay Patel [Wed, 27 Jan 2016 19:22:45 +0000 (19:22 +0000)]
[SimplifyCFG] limit recursion depth when speculating instructions (PR26308)

This is a fix for:
https://llvm.org/bugs/show_bug.cgi?id=26308

With the switch to using the TTI cost model in:
http://reviews.llvm.org/rL228826
...it became possible to hit a zero-cost cycle of instructions (gep -> phi -> gep...),
so we need a cap for the recursion in DominatesMergePoint().

A recursion depth parameter was already added for a different reason in:
http://reviews.llvm.org/rL255660
...so we can just set a limit for it.

I pulled "10" out of the air and made it an independent parameter that we can play with.
It might be higher than it needs to be given the currently low default value of
PHINodeFoldingThreshold (2). That's the starting cost value that we enter the recursion
with, and most instructions have cost set to TCC_Basic (1), so I don't think we're going
to speculate more than 2 instructions with the current parameters.

As noted in the review and the TODO comment, we can do better than just limiting recursion
depth.

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

llvm-svn: 258971

8 years agoAdd support for objc_unsafeClaimAutoreleasedReturnValue to the
John McCall [Wed, 27 Jan 2016 19:05:08 +0000 (19:05 +0000)]
Add support for objc_unsafeClaimAutoreleasedReturnValue to the
ObjC ARC Optimizer.

The main implication of this is:

1. Ensuring that we treat it conservatively in terms of optimization.
2. We put the ASM marker on it so that the runtime can recognize
objc_unsafeClaimAutoreleasedReturnValue from releaseRV.

<rdar://problem/21567064>

Patch by Michael Gottesman!

llvm-svn: 258970

8 years agoResubmit r258759 with proper unicode handling.
Zachary Turner [Wed, 27 Jan 2016 19:00:51 +0000 (19:00 +0000)]
Resubmit r258759 with proper unicode handling.

Instead of opening the file in unicode mode, we need only encode
data which potentially has non-ASCII characters as UTF8 before
writing.  This should work across both Python versions, and is
also far simpler than anything else discussed.

llvm-svn: 258969

8 years agoFix some python 3 incompatibilities that went in overnight.
Zachary Turner [Wed, 27 Jan 2016 18:49:35 +0000 (18:49 +0000)]
Fix some python 3 incompatibilities that went in overnight.

* basestring is not a thing anymore.  Must use `six.string_types`.
* Must use from __future__ import print_function in every new test
  file.

llvm-svn: 258967

8 years agoRefactor some of the xfail / skip decorators to share logic.
Zachary Turner [Wed, 27 Jan 2016 18:49:31 +0000 (18:49 +0000)]
Refactor some of the xfail / skip decorators to share logic.

Previously the logic of skipIf and expectedFailure were 99%
the same, but they took different sets of arguments since they
were maintained separately, and had slightly differences in
their behavior.  This makes everything consistent, there is now
only one real implementation, and the previous ones are changed
to use the single master implementation.

llvm-svn: 258966

8 years agoDon't automtically try to import pexpect in lldbpexpect.
Zachary Turner [Wed, 27 Jan 2016 18:49:25 +0000 (18:49 +0000)]
Don't automtically try to import pexpect in lldbpexpect.

Since pexpect doesn't exist on Windows, tests which are xfail'ed
are not being run at all because they are failing when the file
is imported due to the `import pexpect`.  This puts the import
behind a conditional and makes an empty base class in the case
where pexpect is not present.

llvm-svn: 258965

8 years agoEmit calls to objc_unsafeClaimAutoreleasedReturnValue when
John McCall [Wed, 27 Jan 2016 18:32:30 +0000 (18:32 +0000)]
Emit calls to objc_unsafeClaimAutoreleasedReturnValue when
reclaiming a call result in order to ignore it or assign it
to an __unsafe_unretained variable.  This avoids adding
an unwanted retain/release pair when the return value is
not actually returned autoreleased (e.g. when it is returned
from a nonatomic getter or a typical collection accessor).

This runtime function is only available on the latest Apple
OS releases; the backwards-compatibility story is that you
don't get the optimization unless your deployment target is
recent enough.  Sorry.

rdar://20530049

llvm-svn: 258962

8 years agodocs/conf.py: update copyright year
Hans Wennborg [Wed, 27 Jan 2016 18:29:16 +0000 (18:29 +0000)]
docs/conf.py: update copyright year

llvm-svn: 258960

8 years agoRemove another case of almost duplicated code.
Rafael Espindola [Wed, 27 Jan 2016 18:04:26 +0000 (18:04 +0000)]
Remove another case of almost duplicated code.

Were had very similar code for deciding to keep a local symbol and for
actually writing it.

llvm-svn: 258958

8 years agoUnbreak wasm build after r258951.
Benjamin Kramer [Wed, 27 Jan 2016 18:03:40 +0000 (18:03 +0000)]
Unbreak wasm build after r258951.

llvm-svn: 258957

8 years agoMake more headers self-contained.
Benjamin Kramer [Wed, 27 Jan 2016 18:03:37 +0000 (18:03 +0000)]
Make more headers self-contained.

A lot of this comes from the new complete type requirement of DenseMap.

llvm-svn: 258956

8 years agogetting_started.rst: fix 'unknown target name' error
Hans Wennborg [Wed, 27 Jan 2016 17:54:35 +0000 (17:54 +0000)]
getting_started.rst: fix 'unknown target name' error

llvm-svn: 258953

8 years agoRefactor backend diagnostics for unsupported features
Oliver Stannard [Wed, 27 Jan 2016 17:30:33 +0000 (17:30 +0000)]
Refactor backend diagnostics for unsupported features

The BPF and WebAssembly backends had identical code for emitting errors
for unsupported features, and AMDGPU had very similar code. This merges
them all into one DiagnosticInfo subclass, that can be used by any
backend.

There should be minimal functional changes here, but some AMDGPU tests
have been updated for the new format of errors (it used a slightly
different format to BPF and WebAssembly). The AMDGPU error messages will
now benefit from having precise source locations when debug info is
available.

The implementation of DiagnosticInfoUnsupported::print must be in
lib/Codegen rather than in the existing file in lib/IR/ to avoid
introducing a dependency from IR to CodeGen.

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

llvm-svn: 258951

8 years agoAdd backend dignostic printer for unsupported features
Oliver Stannard [Wed, 27 Jan 2016 17:30:28 +0000 (17:30 +0000)]
Add backend dignostic printer for unsupported features

The related LLVM patch adds a backend diagnostic type for reporting
unsupported features, this adds a printer for them to clang.

In the case where debug location information is not available, I've
changed the printer to report the location as the first line of the
function, rather than the closing brace, as the latter does not give the
user any information. This also affects optimisation remarks.

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

llvm-svn: 258950

8 years agoHandle local symbols in discarded sections.
Rafael Espindola [Wed, 27 Jan 2016 17:09:37 +0000 (17:09 +0000)]
Handle local symbols in discarded sections.

We were reserving space for them but never writing them out.

llvm-svn: 258948

8 years agoIntroduce MemAccInst helper class; NFC
Michael Kruse [Wed, 27 Jan 2016 17:09:17 +0000 (17:09 +0000)]
Introduce MemAccInst helper class; NFC

MemAccInst wraps the common members of LoadInst and StoreInst. Also use
of this class in:
- ScopInfo::buildMemoryAccess
- BlockGenerator::generateLocationAccessed
- ScopInfo::addArrayAccess
- Scop::buildAliasGroups
- Replace every use of polly::getPointerOperand

Reviewers: jdoerfert, grosser

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

llvm-svn: 258947

8 years ago[IndVars] Hoist DataLayout load out of loop; NFC
Sanjoy Das [Wed, 27 Jan 2016 17:05:09 +0000 (17:05 +0000)]
[IndVars] Hoist DataLayout load out of loop; NFC

llvm-svn: 258946

8 years ago[IndVars] Use isSCEVable; NFC
Sanjoy Das [Wed, 27 Jan 2016 17:05:06 +0000 (17:05 +0000)]
[IndVars] Use isSCEVable; NFC

llvm-svn: 258945

8 years ago[IndVars] Use range-for; NFC
Sanjoy Das [Wed, 27 Jan 2016 17:05:03 +0000 (17:05 +0000)]
[IndVars] Use range-for; NFC

llvm-svn: 258944

8 years agoXFail TestCPPAuto on Windows until we can find the root problem.
Adrian McCarthy [Wed, 27 Jan 2016 17:03:25 +0000 (17:03 +0000)]
XFail TestCPPAuto on Windows until we can find the root problem.

llvm.org/pr26339

llvm-svn: 258943

8 years agoMove SafeStack to CodeGen.
Benjamin Kramer [Wed, 27 Jan 2016 16:53:42 +0000 (16:53 +0000)]
Move SafeStack to CodeGen.

It depends on the target machinery, that's not available for
instrumentation passes.

llvm-svn: 258942

8 years ago[X86][SSE] Test insertps instrinsic calls with masks that can't combine to something...
Simon Pilgrim [Wed, 27 Jan 2016 16:51:57 +0000 (16:51 +0000)]
[X86][SSE] Test insertps instrinsic calls with masks that can't combine to something simpler

For these basic tests of the intrinsic, make sure the mask can't simplify to movss, blend-with-zero or something else

llvm-svn: 258941

8 years agoRemove redundant variable.
Rafael Espindola [Wed, 27 Jan 2016 16:41:24 +0000 (16:41 +0000)]
Remove redundant variable.

llvm-svn: 258940

8 years agoRename TargetSelectionDAGInfo into SelectionDAGTargetInfo and move it to CodeGen/
Benjamin Kramer [Wed, 27 Jan 2016 16:32:26 +0000 (16:32 +0000)]
Rename TargetSelectionDAGInfo into SelectionDAGTargetInfo and move it to CodeGen/

It's a SelectionDAG thing, not a Target thing.

llvm-svn: 258939

8 years agoMove passes that live in lib/CodeGen out of Scalar.h
Benjamin Kramer [Wed, 27 Jan 2016 16:05:42 +0000 (16:05 +0000)]
Move passes that live in lib/CodeGen out of Scalar.h

llvm-svn: 258938

8 years agoMake some headers self-contained, remove unused includes that violate layering.
Benjamin Kramer [Wed, 27 Jan 2016 16:05:37 +0000 (16:05 +0000)]
Make some headers self-contained, remove unused includes that violate layering.

llvm-svn: 258937

8 years agoAMDGPU/SI: Fix commuting of 32-bit VOPC instructions
Tom Stellard [Wed, 27 Jan 2016 15:53:52 +0000 (15:53 +0000)]
AMDGPU/SI: Fix commuting of 32-bit VOPC instructions

Summary:
We didn't have entries in the commuting table for the 32-bit
instructions.  I don't think we hit this problem now, but we
will once uniform branching is enabled.  Tests will come in
a later commit.

Reviewers: arsenm

Subscribers: arsenm, llvm-commits

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

llvm-svn: 258936

8 years agoAdding back in a test that I inadvertently removed in r258862
Chris Bieneman [Wed, 27 Jan 2016 15:51:56 +0000 (15:51 +0000)]
Adding back in a test that I inadvertently removed in r258862

llvm-svn: 258935

8 years agoImplement modf math builtin
Tom Stellard [Wed, 27 Jan 2016 14:52:10 +0000 (14:52 +0000)]
Implement modf math builtin

V2: use the reference implementation as suggested by Matt Arsenault

Patch By: Pavel Ondračka

llvm-svn: 258933

8 years agoAdd _CLC_V_V_VP_VECTORIZE macro
Tom Stellard [Wed, 27 Jan 2016 14:52:07 +0000 (14:52 +0000)]
Add _CLC_V_V_VP_VECTORIZE macro

Patch by: Pavel Ondračka

llvm-svn: 258932

8 years ago[DebugInfo] Support zero-length CIE in the _eh_frame parser
Igor Laevsky [Wed, 27 Jan 2016 14:05:35 +0000 (14:05 +0000)]
[DebugInfo] Support zero-length CIE in the _eh_frame parser

MCJIT emits zero-length CIE at the end of the _eh_frame section. This change
ensures that parser inside DebugInfo will not crash and correctly record such cases.
We are now recording DW_EH_PE_omit as a default value for FDE and LSDA encodings.
Also Offset != EndAugmentationOffset assertion check will only happen if augmentation
string had 'z' letter in it.

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

llvm-svn: 258931

8 years agoDecorarte TestInferiorAssert xfails on AArch64 Linux
Omair Javaid [Wed, 27 Jan 2016 13:57:33 +0000 (13:57 +0000)]
Decorarte TestInferiorAssert xfails on AArch64 Linux

This patch decorates some of TestInferiorAssert test cases with expectedFailureLinux on AArch64.

llvm-svn: 258930