platform/upstream/llvm.git
8 years agoAdd test case missing from r259357 (NFC)
Matthew Simpson [Mon, 1 Feb 2016 19:09:24 +0000 (19:09 +0000)]
Add test case missing from r259357 (NFC)

llvm-svn: 259385

8 years ago[AArch64] Simplify prolog/epilog callee save/restore. NFC.
Geoff Berry [Mon, 1 Feb 2016 19:07:06 +0000 (19:07 +0000)]
[AArch64] Simplify prolog/epilog callee save/restore. NFC.

Summary:
Factor out common code for callee-save register pair calculation.  This
is intended to simplify follow-on changes that reduce the number of
registers saved/restored.

Depends on D16732

Reviewers: mcrosier, jmolloy, t.p.northover

Subscribers: aemerson, rengolin, mcrosier, llvm-commits

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

llvm-svn: 259384

8 years agoFix attribute((mode([word|unwind_word]))) for x32
Reid Kleckner [Mon, 1 Feb 2016 18:58:24 +0000 (18:58 +0000)]
Fix attribute((mode([word|unwind_word]))) for x32

Patch by H.J. Lu

```
typedef unsigned int gcc_word __attribute__((mode(word)));
```
and

```
typedef unsigned int gcc_unwind_word __attribute__((mode(unwind_word)));
```
define the largest unsigned integer types which can be stored in a
general purpose register, which may not be the pointer type.  For x32,
they aren't pointer nor unsigned long.  We should

1. Make getUnwindWordWidth and getRegisterWidth virtual,
2. Override them for x32, similar to hasInt128Type.
3. Use getRegisterWidth for __attribute__((mode(word)));

This fixes PR 24706.

Reviewers: rnk

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

llvm-svn: 259383

8 years agodocs: Clarify that cfi-unrelated-cast is based on lifetime.
Peter Collingbourne [Mon, 1 Feb 2016 18:55:50 +0000 (18:55 +0000)]
docs: Clarify that cfi-unrelated-cast is based on lifetime.

Also restore Makefile.sphinx which is needed to build the documentation.

llvm-svn: 259382

8 years ago[SystemZ] Fix wrong-code generation for certain always-false conditions
Ulrich Weigand [Mon, 1 Feb 2016 18:31:19 +0000 (18:31 +0000)]
[SystemZ] Fix wrong-code generation for certain always-false conditions

We've found another bug in the code generation logic conditions for a
certain class of always-false conditions, those of the form
   if ((a & 1) < 0)

These only reach the back end when compiling without optimization.

The bug was introduced by the choice of using TEST UNDER MASK
to implement a check for
   if ((a & MASK) < VAL)
as
   if ((a & MASK) == 0)

where VAL is less than the the lowest bit of MASK.  This is correct
in all cases except for VAL == 0, in which case the original
condition is always false, but the replacement isn't.

Fixed by excluding that particular case.

llvm-svn: 259381

8 years ago[NFC] Referencing manual for reason why subregbit is checked
Colin LeMahieu [Mon, 1 Feb 2016 18:15:39 +0000 (18:15 +0000)]
[NFC] Referencing manual for reason why subregbit is checked

llvm-svn: 259380

8 years agoAlways write the session file in UTF-8.
Zachary Turner [Mon, 1 Feb 2016 18:12:59 +0000 (18:12 +0000)]
Always write the session file in UTF-8.

This patch attempts to solve the Python 2 / Python 3 incompatibilities by
introducing a new `encoded_file` abstraction that we use instead of
`io.open()`.  The problem with the builtin implementation of `io.open` is
that `read` and `write` accept and return `unicode` objects, which are not
always convenient to work with in Python 2.  We solve this by making
`encoded_file.open()` return the same object returned by `io.open()` but
with hooked `read()` and `write()` methods.  These hooked methods will
accept binary or text data, and conditionally convert what it gets to a
`unicode` object using the correct encoding.  When calling `read()` it
also does any conversion necessary to convert the output back into the
native `string` type of the running python version.

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

llvm-svn: 259379

8 years agoFix misnamed variable in TestProcessAPI.py
Zachary Turner [Mon, 1 Feb 2016 18:12:54 +0000 (18:12 +0000)]
Fix misnamed variable in TestProcessAPI.py

llvm-svn: 259378

8 years agofix broken check lines
Sanjay Patel [Mon, 1 Feb 2016 17:46:18 +0000 (17:46 +0000)]
fix broken check lines

Without the colon, it doesn't mean anything!

llvm-svn: 259377

8 years agoMove LocInfoType from Sema to AST.
Benjamin Kramer [Mon, 1 Feb 2016 17:42:01 +0000 (17:42 +0000)]
Move LocInfoType from Sema to AST.

While transient and only used during parsing, LocInfoTypes are still used
from ASTDumper and are part of the AST.

llvm-svn: 259376

8 years ago[InstCombine] Don't transform (X+INT_MAX)>=(Y+INT_MAX) -> (X<=Y)
David Majnemer [Mon, 1 Feb 2016 17:37:56 +0000 (17:37 +0000)]
[InstCombine] Don't transform (X+INT_MAX)>=(Y+INT_MAX) -> (X<=Y)

This miscompile came about because we tried to use a transform which was
only appropriate for xor operators when addition was present.

This fixes PR26407.

llvm-svn: 259375

8 years ago[ValueTracking] Improve isKnownNonZero for PHI of non-zero constants
Jun Bum Lim [Mon, 1 Feb 2016 17:03:07 +0000 (17:03 +0000)]
[ValueTracking] Improve isKnownNonZero for PHI of non-zero constants

It is clear that a PHI is a non-zero if all incoming values are non-zero constants.

llvm-svn: 259370

8 years ago[InstCombine] simplify masked load intrinsics with all ones or zeros masks
Sanjay Patel [Mon, 1 Feb 2016 17:00:10 +0000 (17:00 +0000)]
[InstCombine] simplify masked load intrinsics with all ones or zeros masks

A masked load with a zero mask means there's no load.
A masked load with an allOnes mask means it's a normal vector load.

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

llvm-svn: 259369

8 years agoRemove flaky annotation for TestCallWithTimeout on linux
Pavel Labath [Mon, 1 Feb 2016 16:50:28 +0000 (16:50 +0000)]
Remove flaky annotation for TestCallWithTimeout on linux

The test has passed last 100 runs of the buildbot.

llvm-svn: 259368

8 years ago[PrologEpilogInserter] Add some debug output for callee-save frame object allocation
Geoff Berry [Mon, 1 Feb 2016 16:47:51 +0000 (16:47 +0000)]
[PrologEpilogInserter] Add some debug output for callee-save frame object allocation

Reviewers: mcrosier

Subscribers: mcrosier, llvm-commits

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

llvm-svn: 259367

8 years ago[OpenMP] Prevent nesting of target constructs within target code execution regions.
Arpith Chacko Jacob [Mon, 1 Feb 2016 16:32:47 +0000 (16:32 +0000)]
[OpenMP] Prevent nesting of target constructs within target code execution regions.

Summary:
This patch enhances Sema to check for the following restriction:

OpenMP 4.5 [2.17 Nesting of Regions]
If a target, target update, target data, target enter data, or
target exit data construct is encountered during execution of a
target region, the behavior is unspecified.

Reviewers: ABataev

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

llvm-svn: 259366

8 years ago[AArch64] Simplify callee-save register save/restore. NFC.
Geoff Berry [Mon, 1 Feb 2016 16:29:19 +0000 (16:29 +0000)]
[AArch64] Simplify callee-save register save/restore. NFC.

Summary:
Simplify callee-save register save/restore code generation by
remembering the size of the callee-save area when it is computed so we
don't have to scan the prologue/epilogue instructions again later to
reconstruct it.

This is intended to simplify follow-on changes that reduce the number of
registers saved/restored.

Reviewers: mcrosier, jmolloy, t.p.northover

Subscribers: aemerson, rengolin, mcrosier, llvm-commits

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

llvm-svn: 259365

8 years ago[LV] Rename RdxPHIsToFix to PHIsToFix (NFC)
Matthew Simpson [Mon, 1 Feb 2016 16:07:01 +0000 (16:07 +0000)]
[LV] Rename RdxPHIsToFix to PHIsToFix (NFC)

In the future, we will vectorize recurrences other than reductions. This patch
renames a few variables and updates their associated comments to enable them to
be reused for non-reduction PHI nodes.

This change was requested in the review for D16197.

llvm-svn: 259364

8 years ago[X86][AVX512VBMI] add encoding and intrinsics for Multishift
Asaf Badouh [Mon, 1 Feb 2016 15:48:21 +0000 (15:48 +0000)]
[X86][AVX512VBMI] add encoding and intrinsics for Multishift

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

llvm-svn: 259363

8 years agoAdd a new check, readability-redundant-control-flow, that check for some forms of...
Aaron Ballman [Mon, 1 Feb 2016 15:31:15 +0000 (15:31 +0000)]
Add a new check, readability-redundant-control-flow, that check for some forms of redundant control flow statements. Currently checks for return statements at the end of a function with a void return type and continue statements at the end of looping statements.

Patch by Richard Thomson.

llvm-svn: 259362

8 years ago[mips] Split large test file into 3 smaller ones.
Vasileios Kalintiris [Mon, 1 Feb 2016 15:19:35 +0000 (15:19 +0000)]
[mips] Split large test file into 3 smaller ones.

Remove the old select.ll file and use select-int.ll, select-flt.ll,
select-dbl.ll for testing selects on integers, floats & doubles respectivelly.

llvm-svn: 259361

8 years ago[mips] Range check uimm16 and fix several bugs this revealed.
Daniel Sanders [Mon, 1 Feb 2016 15:13:31 +0000 (15:13 +0000)]
[mips] Range check uimm16 and fix several bugs this revealed.

Summary:
The bugs were:
* teq and similar take 4-bit unsigned immediates on microMIPS.
* teqi and similar have side-effects like teq do.
* shll_s.w and shra_r.w take 5-bit unsigned immediates.
* The various DSP ext* instructions take a 5-bit immediate.
* repl.qh takes an 8-bit unsigned immediate.
* repl.ph takes a 10-bit unsigned immediate.
* rddsp/wrdsp take a 10-bit unsigned immediate.
* teqi and similar take signed 16-bit immediates (10-bit for microMIPS).
* Out-of-range immediate macros for or/xor take a simm32/simm64 depending
  on architecture. I'll fix the simm64 case properly when I reach simm32.

lui is a bit more lenient than GAS and accepts signed immediates in addition
to unsigned. This is because MipsMCExpr can produce signed values when
constant folding and it currently lacks a way of knowing it should fold to
an unsigned value.

Reviewers: vkalintiris

Subscribers: dsanders, llvm-commits

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

llvm-svn: 259360

8 years agoReapply r259210 with a fix for RegistryTest.cpp.
Aaron Ballman [Mon, 1 Feb 2016 14:11:47 +0000 (14:11 +0000)]
Reapply r259210 with a fix for RegistryTest.cpp.

Patch by Richard Thomson.

llvm-svn: 259359

8 years agoImproved macro emission in dwarf.
Amjad Aboud [Mon, 1 Feb 2016 14:09:41 +0000 (14:09 +0000)]
Improved macro emission in dwarf.
Changed emitting offset of macinfo entry into compiler unit DIE to use "addSectionLabel" method rather than explicitly calculating size/offset of macro entry.

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

llvm-svn: 259358

8 years agoReapply commit r258404 with fix.
Matthew Simpson [Mon, 1 Feb 2016 13:38:29 +0000 (13:38 +0000)]
Reapply commit r258404 with fix.

The previous patch caused PR26364. The fix is to ensure that we don't enter a
cycle when iterating over use-def chains.

llvm-svn: 259357

8 years agoRemove Timer::Initialize routine
Pavel Labath [Mon, 1 Feb 2016 13:29:41 +0000 (13:29 +0000)]
Remove Timer::Initialize routine

Summary:
I've run into an issue when running unit tests, where the underlying problem turned out to be
that we were creating Timer objects (through several layers of indirection) without calling
Timer::Initialize. Since Timer's thread-local storage was not properly initialized, we were
overwriting gtest's own thread-local storage, causing test failures.

Instead of requiring that every test calls Timer::Initialize(), I remove the function altogether:
The thread-local storage can be initialized on-demand, and the g_file variable initialized to
stdout and never changed, so I have simply removed it.

Reviewers: clayborg, zturner, tberghammer

Subscribers: lldb-commits

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

llvm-svn: 259356

8 years agoRemove the egregious PCHContainer layering hack that doesn't seem to be necessary...
Benjamin Kramer [Mon, 1 Feb 2016 13:22:39 +0000 (13:22 +0000)]
Remove the egregious PCHContainer layering hack that doesn't seem to be necessary anymore.

llvm-svn: 259355

8 years agoScopInfo: Correct schedule construction
Tobias Grosser [Mon, 1 Feb 2016 11:54:13 +0000 (11:54 +0000)]
ScopInfo: Correct schedule construction

For schedule generation we assumed that the reverse post order traversal used by
the domain generation is sufficient, however it is not. Once a loop is
discovered, we have to completely traverse it, before we can generate the
schedule for any block/region that is only reachable through a loop exiting
block.

To this end, we add a "loop stack" that will keep track of loops we
discovered during the traversal but have not yet traversed completely.
We will never visit a basic block (or region) outside the most recent
(thus smallest) loop in the loop stack but instead queue such blocks
(or regions) in a waiting list. If the waiting list is not empty and
(might) contain blocks from the most recent loop in the loop stack the
next block/region to visit is drawn from there, otherwise from the
reverse post order iterator.

We exploit the new property of loops being always completed before additional
loops are processed, by removing the LoopSchedules map and instead keep all
information in LoopStack. This clarifies that we indeed always only keep a
stack of in-process loops, but will never keep incomplete schedules for an
arbitrary set of loops. As a result, we can simplify some of the existing code.

This patch also adds some more documentation about how our schedule construction
works.

This fixes http://llvm.org/PR25879

This patch is an modified version of Johannes Doerfert's initial fix.

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

llvm-svn: 259354

8 years agoclang-format: Fix incorrect pointer detection in lambdas in constructor
Daniel Jasper [Mon, 1 Feb 2016 11:21:07 +0000 (11:21 +0000)]
clang-format: Fix incorrect pointer detection in lambdas in constructor
initializers.

Before:
  Constructor() : member([](A *a, B * b) {}) {}

After:
  Constructor() : member([](A *a, B *b) {}) {}

llvm-svn: 259353

8 years agoclang-format: Add option to disable string literal formatting.
Daniel Jasper [Mon, 1 Feb 2016 11:21:02 +0000 (11:21 +0000)]
clang-format: Add option to disable string literal formatting.

llvm-svn: 259352

8 years agoclang-format: Fix alignment of trailing multiline columns.
Daniel Jasper [Mon, 1 Feb 2016 11:20:55 +0000 (11:20 +0000)]
clang-format: Fix alignment of trailing multiline columns.

llvm-svn: 259351

8 years agoclang-format: [JS] Treat "in" as a proper operator.
Daniel Jasper [Mon, 1 Feb 2016 11:20:47 +0000 (11:20 +0000)]
clang-format: [JS] Treat "in" as a proper operator.

llvm-svn: 259350

8 years agoWebAssembly NFC: simplify control flow
JF Bastien [Mon, 1 Feb 2016 10:46:16 +0000 (10:46 +0000)]
WebAssembly NFC: simplify control flow

This should now be easier to read.

llvm-svn: 259349

8 years agoDWARF RenderScript vendor extension
Ewan Crawford [Mon, 1 Feb 2016 10:39:24 +0000 (10:39 +0000)]
DWARF RenderScript vendor extension

Patch adds a DWARF language vendor extension for RenderScript.
We are already using this identifier in LLDB with a hard coded value, so it's preferable to use a LLVM generated enum instead.
The language is intended to be added to the next version of the standard.
See http://www.dwarfstd.org/ShowIssue.php?issue=150331.1

Reviewers:  dexonsmith, echristo
Subscribers: probinson domipheus, srhines, llvm-commits
Differential Revision: http://reviews.llvm.org/D16409

llvm-svn: 259348

8 years agoScopInfo: Drop dead code in schedule description
Tobias Grosser [Mon, 1 Feb 2016 10:07:43 +0000 (10:07 +0000)]
ScopInfo: Drop dead code in schedule description

In https://llvm.org/svn/llvm-project/polly/trunk@251870 code was committed to
avoid a failure in the presence of infinite loops, but the test case committed
along with this change passes without the actual change. I looked back into the
code and also checked with the original committer (Johannes), but could not find
the reason why the code is needed. The introduction of LoopStacks for
buildSchedule in one of the next commits will make it even more clear that this
code is not needed, but I remove this ahead of time to facilitate bisecting in
case I missed something.

llvm-svn: 259347

8 years agoAVX512: fix mask handling for gather/scatter/prefetch intrinsics.
Igor Breger [Mon, 1 Feb 2016 09:57:15 +0000 (09:57 +0000)]
AVX512: fix mask handling for gather/scatter/prefetch intrinsics.

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

llvm-svn: 259346

8 years ago[analyzer] Use a wider integer type for an array index.
Artem Dergachev [Mon, 1 Feb 2016 09:29:17 +0000 (09:29 +0000)]
[analyzer] Use a wider integer type for an array index.

Avoids unexpected overflows while performing pointer arithmetics in 64-bit code.
Moreover, neither PointerDiffType nor 'int' can be used as a common array index
type because arrays may have size (and indexes) more than PTRDIFF_MAX but less
than SIZE_MAX.

Patch by Aleksei Sidorin!

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

llvm-svn: 259345

8 years agoSet correct ThreadStopInfo in case of trace event
Abhishek Aggarwal [Mon, 1 Feb 2016 09:01:42 +0000 (09:01 +0000)]
Set correct ThreadStopInfo in case of trace event

Summary:
 - The patch solves Bug 23478 and Bug 19311. Resolving
   Bug 23478 also resolves Bug 23039.
      Correct ThreadStopInfo is set for Linux and FreeBSD
      platforms.

 - Summary:
      When a trace event is reported, we need to check
      whether the trace event lands at a breakpoint site.

      If it lands at a breakpoint site then set the thread's
      StopInfo with the reason 'breakpoint'. Else, set the reason
      to be 'Trace'.

Change-Id: I0af9765e782fd74bc0cead41548486009f8abb87
Signed-off-by: Abhishek Aggarwal <abhishek.a.aggarwal@intel.com>
Reviewers: jingham, emaste, lldb-commits, clayborg, ovyalov

Subscribers: emaste

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

llvm-svn: 259344

8 years ago[X86][SSE] Find source of the inserted element of INSERTPS
Simon Pilgrim [Mon, 1 Feb 2016 08:59:30 +0000 (08:59 +0000)]
[X86][SSE] Find source of the inserted element of INSERTPS

Minor patch to trace back through target shuffles to the source of the inserted element in a (V)INSERTPS shuffle.

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

llvm-svn: 259343

8 years agoAVX512 : Fix SETCCE lowering for KNL 32 bit.
Igor Breger [Mon, 1 Feb 2016 07:56:09 +0000 (07:56 +0000)]
AVX512 : Fix SETCCE lowering for KNL 32 bit.

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

llvm-svn: 259342

8 years ago[dsymutil] Skip mach-o paired relocations
Frederic Riss [Mon, 1 Feb 2016 04:43:14 +0000 (04:43 +0000)]
[dsymutil] Skip mach-o paired relocations

Noticed while working on scattered relocations.
I do not think these relocs can actually happen in the debug_info section,
but if they happen the code would mishandle them. Explicitely skip them
and warn if we encounter one.

llvm-svn: 259341

8 years ago[X86] Cleanup the WinEHState pass
David Majnemer [Mon, 1 Feb 2016 04:28:59 +0000 (04:28 +0000)]
[X86] Cleanup the WinEHState pass

Remove unnecessary includes and class state.

No functional change intended.

llvm-svn: 259340

8 years ago[dsymutil] Support scattered relocs.
Frederic Riss [Mon, 1 Feb 2016 03:44:22 +0000 (03:44 +0000)]
[dsymutil] Support scattered relocs.

Although it seems like clang will never emit scattered relocations in
the debug information (at least I couldn't find a way), we have too
support them for the benefit of other compilers.
As clang doesn't generate them, the included testcase was produced
from hacked up assembly.

llvm-svn: 259339

8 years agoRevert r258580 and r258581.
David Majnemer [Mon, 1 Feb 2016 03:29:38 +0000 (03:29 +0000)]
Revert r258580 and r258581.

Those commits created an artificial edge from a cleanup to a synthesized
catchswitch in order to get the MSVC personality routine to execute
cleanups which don't cleanupret and are not wrapped by a catchswitch.

This worked well enough but is not a complete solution in situations
where there the cleanup infinite loops.

However, the real deal breaker behind this approach comes about from a
degenerate case where the cleanup is post-dominated by unreachable *and*
throws an exception.  This ends poorly because the catchswitch will
inadvertently catch the exception.

Because of this we should go back to our previous behavior of not
executing certain cleanups (identical behavior with the Itanium ABI
implementation in clang, GCC and ICC).

N.B. I think this could be salvaged by making the catchpad rethrow the
exception and properly transforming throwing calls in the cleanup into
invokes.

llvm-svn: 259338

8 years agoScopInfo: use std::distance to shorten code [NFC]
Tobias Grosser [Mon, 1 Feb 2016 01:55:08 +0000 (01:55 +0000)]
ScopInfo: use std::distance to shorten code [NFC]

llvm-svn: 259337

8 years ago[TableGen] Store result of getInstructionsByEnumValue in an ArrayRef instead of accid...
Craig Topper [Mon, 1 Feb 2016 01:33:42 +0000 (01:33 +0000)]
[TableGen] Store result of getInstructionsByEnumValue in an ArrayRef instead of accidentally copying to a vector.

llvm-svn: 259336

8 years agoMark DR1250 as implemented
David Majnemer [Mon, 1 Feb 2016 01:33:17 +0000 (01:33 +0000)]
Mark DR1250 as implemented

We implemented this DR back in r258768 but forgot to mark it as
implemented.

llvm-svn: 259335

8 years ago[MCDwarf] Fix encoding of line tables with weird custom parameters
Frederic Riss [Sun, 31 Jan 2016 22:06:35 +0000 (22:06 +0000)]
[MCDwarf] Fix encoding of line tables with weird custom parameters

With poorly chosen custom parameters, the line table encoding logic would
sometimes end up generating a special opcode bigger than 255, which is wrong.
The set of default parameters that LLVM uses isn't subject to this bug.

When carefully chosing the line table parameters, it's impossible to fall into the
corner case that this patch fixes. The standard however doesn't require that these
parameters be carefully chosen. And even if it did, we shouldn't generate broken
encoding.

Add a unittest for this specific encoding bug, and while at it, create some unit
tests for the encoding logic using different sets of parameters.

llvm-svn: 259334

8 years agoReplace utostr_32 use with utostr to match removal from llvm.
Craig Topper [Sun, 31 Jan 2016 20:36:20 +0000 (20:36 +0000)]
Replace utostr_32 use with utostr to match removal from llvm.

llvm-svn: 259333

8 years agocmake: Add additional libraries to fix the darwin shared library build
Tobias Grosser [Sun, 31 Jan 2016 20:25:46 +0000 (20:25 +0000)]
cmake: Add additional libraries to fix the darwin shared library build

darwin requires the additional linkages of...

LLVMBitReader
LLVMMCParser
LLVMObject
LLVMProfileData
LLVMTarget
LLVMVectorize

as the darwin requires all of the weak undefined symbols in a library to be
resolved when linking it against an executable (unless
-Wl,-undefined,dynamic_lookup is used to override the default behavior of
-Wl,-undefined,error).

Contributed-by: Jack Howarth
llvm-svn: 259332

8 years agoRemove utostr_32 as it has no uses anymore.
Craig Topper [Sun, 31 Jan 2016 20:00:26 +0000 (20:00 +0000)]
Remove utostr_32 as it has no uses anymore.

llvm-svn: 259331

8 years agoReplace usages of llvm::utostr_32 with just llvm::utostr. While this is less efficien...
Craig Topper [Sun, 31 Jan 2016 20:00:24 +0000 (20:00 +0000)]
Replace usages of llvm::utostr_32 with just llvm::utostr. While this is less efficient, its unclear the few places that were using the _32 version were doing so for efficiency.

llvm-svn: 259330

8 years agoMerge utohex_buffer into utohexstr, it's only caller. Also change utohexstr to use...
Craig Topper [Sun, 31 Jan 2016 20:00:22 +0000 (20:00 +0000)]
Merge utohex_buffer into utohexstr, it's only caller. Also change utohexstr to use the std::string constructor that takes a start and end pointer. This saves a call to strlen. NFC

llvm-svn: 259329

8 years agoadd helper function for minnum/maxnum ; NFC
Sanjay Patel [Sun, 31 Jan 2016 16:35:23 +0000 (16:35 +0000)]
add helper function for minnum/maxnum ; NFC

llvm-svn: 259326

8 years agouse range-based for loop; NFC
Sanjay Patel [Sun, 31 Jan 2016 16:34:48 +0000 (16:34 +0000)]
use range-based for loop; NFC

llvm-svn: 259325

8 years agofix formatting; NFC
Sanjay Patel [Sun, 31 Jan 2016 16:34:11 +0000 (16:34 +0000)]
fix formatting; NFC

llvm-svn: 259324

8 years agosimplify; NFC
Sanjay Patel [Sun, 31 Jan 2016 16:33:33 +0000 (16:33 +0000)]
simplify; NFC

llvm-svn: 259323

8 years agoclean up; NFC
Sanjay Patel [Sun, 31 Jan 2016 16:32:23 +0000 (16:32 +0000)]
clean up; NFC

function names, comments, formatting, typos

llvm-svn: 259322

8 years agoWebAssembly: more failures are gone
JF Bastien [Sun, 31 Jan 2016 08:19:40 +0000 (08:19 +0000)]
WebAssembly: more failures are gone

llvm-svn: 259321

8 years agoWebAssembly: update expected failures
JF Bastien [Sun, 31 Jan 2016 08:05:05 +0000 (08:05 +0000)]
WebAssembly: update expected failures

r259305 fixed a few assertions around FrameIndex, and I forgot to update these failures despite having run the torture tests.

llvm-svn: 259320

8 years ago[dsymutil] Fix FileCheck command.
Frederic Riss [Sun, 31 Jan 2016 04:39:16 +0000 (04:39 +0000)]
[dsymutil] Fix FileCheck command.

Damn case-insensitive filesystem...

llvm-svn: 259319

8 years ago[dsymutil] Fix handling of common symbols.
Frederic Riss [Sun, 31 Jan 2016 04:29:34 +0000 (04:29 +0000)]
[dsymutil] Fix handling of common symbols.

llvm-dsymutil was misinterpreting the value of common symbols as their
address when it actually contains their size. This didn't impact
llvm-dsymutil's ability to link the debug information for common symbols
because these are always found by name and not by address. Things could
however go wrong when the size of a common object matched the object
file address of another symbol. Depending on the link order of the symbols
the common object might incorrectly evict this other object from the
address to symbol mapping, and then link the evicted symbol with a wrong
binary address.

Use the new ability to have symbols without an object file address to fix
this.

llvm-svn: 259318

8 years ago[dsymutil] Allow debug map mappings with no object file address. NFC
Frederic Riss [Sun, 31 Jan 2016 04:29:22 +0000 (04:29 +0000)]
[dsymutil] Allow debug map mappings with no object file address. NFC

This change just changes the data structure that ties symbol names,
object file address and linked binary addresses to accept mappings
with no object file address. Such symbol mappings are not fed into
the debug map yet, so this patch is NFC.
A subsequent patch will make use of this functionality for common
symbols.

llvm-svn: 259317

8 years agoReplace usage of llvm::utostr_32 with just llvm::utostr. While this is less efficient...
Craig Topper [Sun, 31 Jan 2016 04:20:03 +0000 (04:20 +0000)]
Replace usage of llvm::utostr_32 with just llvm::utostr. While this is less efficient, its unclear that the one place using the _32 version was doing so for efficiency.

llvm-svn: 259316

8 years ago[SelectionDAG] Eliminate exponential behavior in WalkChainUsers
Tim Shen [Sun, 31 Jan 2016 03:59:34 +0000 (03:59 +0000)]
[SelectionDAG] Eliminate exponential behavior in WalkChainUsers

llvm-svn: 259315

8 years agoNo need to use utostr/utohexstr when writing into a raw_ostream. NFC
Craig Topper [Sun, 31 Jan 2016 01:55:15 +0000 (01:55 +0000)]
No need to use utostr/utohexstr when writing into a raw_ostream. NFC

llvm-svn: 259314

8 years agoShrink character buffer size in raw_ostream::write_hex to 16 characters intead of...
Craig Topper [Sun, 31 Jan 2016 01:12:38 +0000 (01:12 +0000)]
Shrink character buffer size in raw_ostream::write_hex to 16 characters intead of 20 as that's the largest string a 64-bit hex value can be.

llvm-svn: 259313

8 years agoUse std::end instead of repeating buffer sizes.
Craig Topper [Sun, 31 Jan 2016 01:12:35 +0000 (01:12 +0000)]
Use std::end instead of repeating buffer sizes.

llvm-svn: 259312

8 years ago[Parser] Update CachedTokens while parsing ObjectiveC template argument list
Bruno Cardoso Lopes [Sun, 31 Jan 2016 00:47:51 +0000 (00:47 +0000)]
[Parser] Update CachedTokens while parsing ObjectiveC template argument list

Consider the following ObjC++ snippet:

--
@protocol PA;
@protocol PB;

@class NSArray<ObjectType>;
typedef int some_t;

id<PA> FA(NSArray<id<PB>> *h, some_t group);
--

This would hit an assertion in the parser after generating an annotation token
while trying to update the token cache:

Assertion failed: (CachedTokens[CachedLexPos-1].getLastLoc() == Tok.getAnnotationEndLoc() && "The annotation should be until the most recent cached token")
...
7 clang::Preprocessor::AnnotatePreviousCachedTokens(clang::Token const&) + 494
8 clang::Parser::TryAnnotateTypeOrScopeTokenAfterScopeSpec(bool, bool, clang::CXXScopeSpec&, bool) + 1163
9 clang::Parser::TryAnnotateTypeOrScopeToken(bool, bool) + 361
10 clang::Parser::isCXXDeclarationSpecifier(clang::Parser::TPResult, bool*) + 598
...

The cached preprocessor token in this case is:

greatergreater '>>' Loc=<testcase.mm:7:24>

while the annotation ("NSArray<id<PB>>") ends at "testcase.mm:7:25", hence the
assertion.

Properly update the CachedTokens during template parsing to contain
two greater tokens instead of a greatergreater.

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

rdar://problem/23494277

llvm-svn: 259311

8 years agoNo need to use utostr when putting integers into a raw_ostream. NFC
Craig Topper [Sun, 31 Jan 2016 00:20:26 +0000 (00:20 +0000)]
No need to use utostr when putting integers into a raw_ostream. NFC

llvm-svn: 259310

8 years agoConvert an unsigned to Twine instead of using utostr since we're already building...
Craig Topper [Sun, 31 Jan 2016 00:20:24 +0000 (00:20 +0000)]
Convert an unsigned to Twine instead of using utostr since we're already building a Twine. NFC

llvm-svn: 259309

8 years agoConvert int to Twine instead of using utostr since it was already being added to...
Craig Topper [Sun, 31 Jan 2016 00:15:35 +0000 (00:15 +0000)]
Convert int to Twine instead of using utostr since it was already being added to a Twine. NFC

llvm-svn: 259308

8 years ago[doc] improve the doc for CUDA
Jingyue Wu [Sat, 30 Jan 2016 23:48:47 +0000 (23:48 +0000)]
[doc] improve the doc for CUDA

1. Mentioned that CUDA support works best with trunk.
2. Simplified the example by removing its dependency on the CUDA samples.
3. Explain the --cuda-gpu-arch flag.

llvm-svn: 259307

8 years ago[WebAssembly] Fix uses of FrameIndex as store values
Derek Schuff [Sat, 30 Jan 2016 21:43:08 +0000 (21:43 +0000)]
[WebAssembly] Fix uses of FrameIndex as store values

Previously the code assumed all uses of FI on loads and stores were as
addresses. This checks whether the use is the address or a value and
handles the latter case as it does for non-memory instructions.

llvm-svn: 259306

8 years agoWebAssembly: don't optimize frameindex store
JF Bastien [Sat, 30 Jan 2016 14:11:26 +0000 (14:11 +0000)]
WebAssembly: don't optimize frameindex store

The previous code was incorrect (can't getReg a frameindex). We could instead optimize it to reduce tree height, but I'm not sure that's worthwhile yet because we then try to eliminate the frameindex.

This patch also fixes frame index elimination for operations which may load or store: it used to assume the base was operand 2 and immediate offset operand 1. That's not true for stores, where they're 4 and 3.

llvm-svn: 259305

8 years ago[AST] Pull simple method inline.
Benjamin Kramer [Sat, 30 Jan 2016 12:16:23 +0000 (12:16 +0000)]
[AST] Pull simple method inline.

llvm-svn: 259304

8 years agoWebAssembly NFC: fix build warning
JF Bastien [Sat, 30 Jan 2016 11:19:26 +0000 (11:19 +0000)]
WebAssembly NFC: fix build warning

WebAssemblyFrameLowering.cpp:158:44: warning: enumeral and non-enumeral type in conditional expression [enabled by default]

llvm-svn: 259303

8 years agoassert(false) -> llvm_unreachable().
Davide Italiano [Sat, 30 Jan 2016 08:03:54 +0000 (08:03 +0000)]
assert(false) -> llvm_unreachable().

llvm-svn: 259302

8 years agoFix build with VS2015
Ismail Donmez [Sat, 30 Jan 2016 07:14:31 +0000 (07:14 +0000)]
Fix build with VS2015

llvm-svn: 259301

8 years ago[BasicAA] NFC - revised comment for function adjustToPointerSize()
Gerolf Hoflehner [Sat, 30 Jan 2016 05:58:38 +0000 (05:58 +0000)]
[BasicAA] NFC - revised comment for function adjustToPointerSize()

llvm-svn: 259300

8 years ago[BasicAA] Fix for missing must alias (D16343)
Gerolf Hoflehner [Sat, 30 Jan 2016 05:52:53 +0000 (05:52 +0000)]
[BasicAA] Fix for missing must alias (D16343)

llvm-svn: 259299

8 years ago[BasicAA] Update on r259290 - added missing cast
Gerolf Hoflehner [Sat, 30 Jan 2016 05:35:09 +0000 (05:35 +0000)]
[BasicAA] Update on r259290 - added missing cast

llvm-svn: 259298

8 years agoAMDGPU: Fix emitting invalid workitem intrinsics for HSA
Matt Arsenault [Sat, 30 Jan 2016 05:19:45 +0000 (05:19 +0000)]
AMDGPU: Fix emitting invalid workitem intrinsics for HSA

The AMDGPUPromoteAlloca pass was emitting the read.local.size
calls, which with HSA was incorrectly selected to reading from
the offset mesa uses off of the kernarg pointer.

Error on intrinsics which aren't supported by HSA, and start
emitting the correct IR to read the workgroup size
out of the dispatch pointer.

Also initialize the pass so it can be tested with opt, and
start moving towards not depending on the subtarget as an
argument.

Start emitting errors for the intrinsics not handled with HSA.

llvm-svn: 259297

8 years agoAMDGPU: Stop checking intrinsics not used by HSA for dispatch-ptr
Matt Arsenault [Sat, 30 Jan 2016 05:10:59 +0000 (05:10 +0000)]
AMDGPU: Stop checking intrinsics not used by HSA for dispatch-ptr

Only the dispatch.ptr intrinsic is supposed to be used now to get
the workgroup size, and the read.local.size intrinsics do not
work correctly.

llvm-svn: 259296

8 years agoInstCombine: fabs(x) * fabs(x) -> x * x
Matt Arsenault [Sat, 30 Jan 2016 05:02:00 +0000 (05:02 +0000)]
InstCombine: fabs(x) * fabs(x) -> x * x

llvm-svn: 259295

8 years ago[WebAssembly] Refine block placement to insert blocks between trees.
Dan Gohman [Sat, 30 Jan 2016 05:01:06 +0000 (05:01 +0000)]
[WebAssembly] Refine block placement to insert blocks between trees.

Refine the test for whether an instruction is in an expression tree so that
it detects when one tree ends and another begins, so we can place a block
at that point, rather than continuing to find the first instruction not in
a tree at all.

llvm-svn: 259294

8 years agoAMDGPU: Add new amdgcn workitem intrinsics
Matt Arsenault [Sat, 30 Jan 2016 04:25:19 +0000 (04:25 +0000)]
AMDGPU: Add new amdgcn workitem intrinsics

These use the correct prefix and follow the HSA naming convention
rather than the config register option names.

llvm-svn: 259293

8 years agoRemove references to *.h.in files and some autoconf hackery
Justin Bogner [Sat, 30 Jan 2016 04:15:33 +0000 (04:15 +0000)]
Remove references to *.h.in files and some autoconf hackery

Missed this stuff in r259291.

llvm-svn: 259292

8 years agoRemove *.h.in - these were only used by the autoconf build system
Justin Bogner [Sat, 30 Jan 2016 04:05:45 +0000 (04:05 +0000)]
Remove *.h.in - these were only used by the autoconf build system

llvm-svn: 259291

8 years ago[BasicAA] NFC - utility function for two's complement wrap-around
Gerolf Hoflehner [Sat, 30 Jan 2016 02:42:11 +0000 (02:42 +0000)]
[BasicAA] NFC - utility function for two's complement wrap-around

llvm-svn: 259290

8 years agotest/clang-tidy/performance-for-range-copy.cpp: Appease for targeting ms mode.
NAKAMURA Takumi [Sat, 30 Jan 2016 02:15:19 +0000 (02:15 +0000)]
test/clang-tidy/performance-for-range-copy.cpp: Appease for targeting ms mode.

llvm-svn: 259289

8 years ago[analyzer] Make suppression of macro defensive checks work with -analyzer-eagerly...
Devin Coughlin [Sat, 30 Jan 2016 01:59:33 +0000 (01:59 +0000)]
[analyzer] Make suppression of macro defensive checks work with -analyzer-eagerly-assume.

This is the default for the analyzer but the flag is added by the driver so
our suppression tests didn't cover this case.

llvm-svn: 259288

8 years ago[SemaCXX] Fix crash-on-invalid while trying to deduce return type of a lambda.
Argyrios Kyrtzidis [Sat, 30 Jan 2016 01:51:20 +0000 (01:51 +0000)]
[SemaCXX] Fix crash-on-invalid while trying to deduce return type of a lambda.

rdar://22032373

llvm-svn: 259287

8 years agoFurther reduce test time
Xinliang David Li [Sat, 30 Jan 2016 01:37:32 +0000 (01:37 +0000)]
Further reduce test time

llvm-svn: 259285

8 years agoAvoid overly large SmallPtrSet/SmallSet
Matthias Braun [Sat, 30 Jan 2016 01:27:06 +0000 (01:27 +0000)]
Avoid overly large SmallPtrSet/SmallSet

These sets perform linear searching in small mode so it is never a good
idea to use SmallSize/N bigger than 32.

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

llvm-svn: 259284

8 years agoAvoid overly large SmallPtrSet/SmallSet
Matthias Braun [Sat, 30 Jan 2016 01:24:31 +0000 (01:24 +0000)]
Avoid overly large SmallPtrSet/SmallSet

These sets perform linear searching in small mode so it is never a good
idea to use SmallSize/N bigger than 32.

llvm-svn: 259283

8 years agoUse Support/DataTypes.h instead of cstdint
Matthias Braun [Sat, 30 Jan 2016 01:14:01 +0000 (01:14 +0000)]
Use Support/DataTypes.h instead of cstdint

llvm-svn: 259282

8 years ago[docs] Remove references to autoconf build.
Alexey Samsonov [Sat, 30 Jan 2016 01:11:42 +0000 (01:11 +0000)]
[docs] Remove references to autoconf build.

llvm-svn: 259281

8 years ago[docs] Remove references to autotools build.
Alexey Samsonov [Sat, 30 Jan 2016 01:10:15 +0000 (01:10 +0000)]
[docs] Remove references to autotools build.

llvm-svn: 259280

8 years ago[CUDA] Die if we ask the NVPTX backend to emit a global ctor/dtor.
Justin Lebar [Sat, 30 Jan 2016 01:07:38 +0000 (01:07 +0000)]
[CUDA] Die if we ask the NVPTX backend to emit a global ctor/dtor.

Summary: Previously we'd just silently skip these.

Reviewers: tra, jholewinski

Subscribers: llvm-commits, jhen, echristo,

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

llvm-svn: 259279