platform/upstream/llvm.git
9 years agoAMDGPU: Use getAsInteger instead of atoi
Matt Arsenault [Tue, 23 Jun 2015 02:05:55 +0000 (02:05 +0000)]
AMDGPU: Use getAsInteger instead of atoi

llvm-svn: 240365

9 years ago[FaultMaps] Move FaultMapParser to Object/
Sanjoy Das [Tue, 23 Jun 2015 01:05:26 +0000 (01:05 +0000)]
[FaultMaps] Move FaultMapParser to Object/

Summary:
That way llvm-objdump can rely on it without adding an extra dependency
on CodeGen.

This change duplicates the FaultKind enum and the code that serializes
it to a string.  I could not figure out a way to get around this without
adding a new dependency to Object

Reviewers: rafael, ab

Subscribers: llvm-commits

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

llvm-svn: 240364

9 years agoFix a typo in a comment in FaultMaps.h. NFC.
Sanjoy Das [Tue, 23 Jun 2015 01:05:21 +0000 (01:05 +0000)]
Fix a typo in a comment in FaultMaps.h. NFC.

llvm-svn: 240363

9 years agollvm/tools/llvm-objdump/CMakeLists.txt: Update libdeps to fix r240304.
NAKAMURA Takumi [Tue, 23 Jun 2015 00:59:12 +0000 (00:59 +0000)]
llvm/tools/llvm-objdump/CMakeLists.txt: Update libdeps to fix r240304.

llvm-svn: 240362

9 years ago[x86] generalize reassociation optimization in machine combiner to 2 instructions
Sanjay Patel [Tue, 23 Jun 2015 00:39:40 +0000 (00:39 +0000)]
[x86] generalize reassociation optimization in machine combiner to 2 instructions

Currently ( D10321, http://reviews.llvm.org/rL239486 ), we can use the machine combiner pass
to reassociate the following sequence to reduce the critical path:

A = ? op ?
B = A op X
C = B op Y
-->
A = ? op ?
B = X op Y
C = A op B

'op' is currently limited to x86 AVX scalar FP adds (with fast-math on), but in theory, it could
be any associative math/logic op (see TODO in code comment).

This patch generalizes the pattern match to ignore the instruction that defines 'A'. So instead of
a sequence of 3 adds, we now only need to find 2 dependent adds and decide if it's worth
reassociating them.

This generalization has a compile-time cost because we can now match more instruction sequences
and we rely more heavily on the machine combiner to discard sequences where reassociation doesn't
improve the critical path.

For example, in the new test case:

A = M div N
B = A add X
C = B add Y

We'll match 2 reassociation patterns, but this transform doesn't reduce the critical path:

A = M div N
B = A add Y
C = B add X

We need the combiner to reject that pattern but select this:

A = M div N
B = X add Y
C = B add A

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

llvm-svn: 240361

9 years agoRe-apply "InstrProf: When reading, copy the data instead of taking a reference. NFC"
Justin Bogner [Mon, 22 Jun 2015 23:58:05 +0000 (23:58 +0000)]
Re-apply "InstrProf: When reading, copy the data instead of taking a reference. NFC"

This version fixes a missing include that MSVC noticed and
clarifies the ownership of the counter buffer that's passed to
InstrProfRecord.

This restores r240206, which was reverted in r240208.

Patch by Betul Buyukkurt.

llvm-svn: 240360

9 years agoInstrProf: Add a test for multiple copies of the same with different hashes
Justin Bogner [Mon, 22 Jun 2015 23:56:53 +0000 (23:56 +0000)]
InstrProf: Add a test for multiple copies of the same with different hashes

This functionality wasn't being tested.

Patch by Betul Buyukkurt.

llvm-svn: 240359

9 years agoCreate Value.def helper. NFC.
Pete Cooper [Mon, 22 Jun 2015 23:48:35 +0000 (23:48 +0000)]
Create Value.def helper.  NFC.

This is similar to Metadata.def and Instructions.def but for Value's.

It will be used in upcoming commits to devirtualize the Value class.

Reviewed by Duncan Exon Smith.

llvm-svn: 240358

9 years agoFix PR23914.
Evgeniy Stepanov [Mon, 22 Jun 2015 23:36:03 +0000 (23:36 +0000)]
Fix PR23914.

r226830 moved the declaration of Buf to a nested scope, resulting
in a dangling reference (in StringRef Name), and a use-after-free.

llvm-svn: 240357

9 years ago[CMake] Respect the value of -mmacosx-version-min flag.
Alexey Samsonov [Mon, 22 Jun 2015 23:30:28 +0000 (23:30 +0000)]
[CMake] Respect the value of -mmacosx-version-min flag.

Make sure that sanitizer runtimes target OS X version provided in
-mmacosx-version-min= flag. Enforce that it should be at least 10.7.

llvm-svn: 240356

9 years agoCode cleanup: Remove std::move() around xvalue (NFC)
Logan Chien [Mon, 22 Jun 2015 23:16:02 +0000 (23:16 +0000)]
Code cleanup: Remove std::move() around xvalue (NFC)

Remove std::move() around xvalue so that copy elision is eligible.
In case that copy elision is not appliable, the c++ standard also
guarantees the move semantics on xvalue.  Thus, it is not necessary
to wrap Args with std::move.

This also silence a warning since r240345.

llvm-svn: 240355

9 years agoReduced packet counts to the remote GDB server where possible.
Greg Clayton [Mon, 22 Jun 2015 23:12:45 +0000 (23:12 +0000)]
Reduced packet counts to the remote GDB server where possible.

We have been working on reducing the packet count that is sent between LLDB and the debugserver on MacOSX and iOS. Our approach to this was to reduce the packets required when debugging multiple threads. We currently make one qThreadStopInfoXXXX call (where XXXX is the thread ID in hex) per thread except the thread that stopped with a stop reply packet. In order to implement multiple thread infos in a single reply, we need to use structured data, which means JSON. The new jThreadsInfo packet will attempt to retrieve all thread infos in a single packet. The data is very similar to the stop reply packets, but packaged in JSON and uses JSON arrays where applicable. The JSON output looks like:

[
  { "tid":1580681,
    "metype":6,
    "medata":[2,0],
    "reason":"exception",
    "qaddr":140735118423168,
    "registers": {
      "0":"8000000000000000",
      "1":"0000000000000000",
      "2":"20fabf5fff7f0000",
      "3":"e8f8bf5fff7f0000",
      "4":"0100000000000000",
      "5":"d8f8bf5fff7f0000",
      "6":"b0f8bf5fff7f0000",
      "7":"20f4bf5fff7f0000",
      "8":"8000000000000000",
      "9":"61a8db78a61500db",
      "10":"3200000000000000",
      "11":"4602000000000000",
      "12":"0000000000000000",
      "13":"0000000000000000",
      "14":"0000000000000000",
      "15":"0000000000000000",
      "16":"960b000001000000",
      "17":"0202000000000000",
      "18":"2b00000000000000",
      "19":"0000000000000000",
      "20":"0000000000000000"},
    "memory":[
      {"address":140734799804592,"bytes":"c8f8bf5fff7f0000c9a59e8cff7f0000"},
      {"address":140734799804616,"bytes":"00000000000000000100000000000000"}
    ]
  }
]

It contains an array of dicitionaries with all of the key value pairs that are normally in the stop reply packet. Including the expedited registers. Notice that is also contains expedited memory in the "memory" key. Any values in this memory will get included in a new L1 cache in lldb_private::Process where if a memory read request is made and that memory request fits into one of the L1 memory cache blocks, it will use that memory data. If a memory request fails in the L1 cache, it will fall back to the L2 cache which is the same block sized caching we were using before these changes. This allows a process to expedite memory that you are likely to use and it reduces packet count. On MacOSX with debugserver, we expedite the frame pointer backchain for a thread (up to 256 entries) by reading 2 pointers worth of bytes at the frame pointer (for the previous FP and PC), and follow the backchain. Most backtraces on MacOSX and iOS now don't require us to read any memory!

We will try these packets out and if successful, we should port these to lldb-server in the near future.

<rdar://problem/21494354>

llvm-svn: 240354

9 years agoRevert r240270 ("Fixed/added namespace ending comments using clang-tidy").
Alexander Kornienko [Mon, 22 Jun 2015 23:07:51 +0000 (23:07 +0000)]
Revert r240270 ("Fixed/added namespace ending comments using clang-tidy").

llvm-svn: 240353

9 years ago[LoopDist] Improve variable names and comments in LoopVersioning class, NFC
Adam Nemet [Mon, 22 Jun 2015 22:59:40 +0000 (22:59 +0000)]
[LoopDist] Improve variable names and comments in LoopVersioning class, NFC

As with the previous patch, the goal is to turn the class into a general
loop-versioning class.  This patch removes any references to loop
distribution.

llvm-svn: 240352

9 years agoFix a crasher on the MacOSX test suite for Objective C.
Greg Clayton [Mon, 22 Jun 2015 22:35:07 +0000 (22:35 +0000)]
Fix a crasher on the MacOSX test suite for Objective C.

llvm-svn: 240351

9 years ago[modules] When building a module, if there are multiple matches for a header
Richard Smith [Mon, 22 Jun 2015 22:20:47 +0000 (22:20 +0000)]
[modules] When building a module, if there are multiple matches for a header
file in the loaded module maps and one of them is from the current module,
that's the right match.

llvm-svn: 240350

9 years agoUpdate for LLVM API change to return by InputArgList directly (rather than by pointer...
David Blaikie [Mon, 22 Jun 2015 22:07:27 +0000 (22:07 +0000)]
Update for LLVM API change to return by InputArgList directly (rather than by pointer) from ParseArgs

llvm-svn: 240349

9 years agoUpdate for LLVM API change to return by InputArgList directly (rather than by pointer...
David Blaikie [Mon, 22 Jun 2015 22:06:58 +0000 (22:06 +0000)]
Update for LLVM API change to return by InputArgList directly (rather than by pointer) from ParseArgs

llvm-svn: 240348

9 years agoUpdate for LLVM API change to return by InputArgList directly (rather than by pointer...
David Blaikie [Mon, 22 Jun 2015 22:06:52 +0000 (22:06 +0000)]
Update for LLVM API change to return by InputArgList directly (rather than by pointer) from ParseArgs

llvm-svn: 240347

9 years agoFix missed formatting in prior commit (mostly 80 cols violation and some whitespace...
David Blaikie [Mon, 22 Jun 2015 22:06:48 +0000 (22:06 +0000)]
Fix missed formatting in prior commit (mostly 80 cols violation and some whitespace around *)

llvm-svn: 240346

9 years agoModify ParseArgs to return the InputArgList by value - there's no need for dynamic...
David Blaikie [Mon, 22 Jun 2015 22:06:37 +0000 (22:06 +0000)]
Modify ParseArgs to return the InputArgList by value - there's no need for dynamic allocation/ownership here

The one caller that does anything other than keep this variable on the
stack is the single use of DerivedArgList in Clang, which is a bit more
interesting but can probably be cleaned up/simplified a bit further
(have DerivedArgList take ownership of the InputArgList rather than
needing to reference its Args indirectly) which I'll try to after this.

llvm-svn: 240345

9 years ago[CMake] Treating LLVM_INCLUDE_TOOLS, which is a bool, as a string to change behaviors...
Chris Bieneman [Mon, 22 Jun 2015 21:58:02 +0000 (21:58 +0000)]
[CMake] Treating LLVM_INCLUDE_TOOLS, which is a bool, as a string to change behaviors of the build is a dirty hack. We shouldn't do it.

Summary: I don't think anyone is relying on this behavior for bootstrapping (because I don't think it works), but if you do need it, speak now or forever hold your peace.

Reviewers: chapuni, samsonov

Reviewed By: samsonov

Subscribers: llvm-commits

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

llvm-svn: 240344

9 years agoRevert r240291: causes problems in self-hosted builds.
Pawel Bylica [Mon, 22 Jun 2015 21:54:07 +0000 (21:54 +0000)]
Revert r240291: causes problems in self-hosted builds.

llvm-svn: 240343

9 years ago[X86][FMA4] FMA4 ops can perform unaligned folded loads.
Simon Pilgrim [Mon, 22 Jun 2015 21:49:41 +0000 (21:49 +0000)]
[X86][FMA4] FMA4 ops can perform unaligned folded loads.

llvm-svn: 240342

9 years agoLinker: Do not expect comdat to exist in source module.
Peter Collingbourne [Mon, 22 Jun 2015 21:46:51 +0000 (21:46 +0000)]
Linker: Do not expect comdat to exist in source module.

llvm-svn: 240341

9 years agoFix line endings (NFC)
Joseph Tremoulet [Mon, 22 Jun 2015 21:37:34 +0000 (21:37 +0000)]
Fix line endings (NFC)

I inadvertently checked these in with Windows-style line
endings in r240288.

llvm-svn: 240340

9 years ago[Object] Search for architecures by name in MachOUniversalBinary::getObjectForArch()
Frederic Riss [Mon, 22 Jun 2015 21:33:24 +0000 (21:33 +0000)]
[Object] Search for architecures by name in MachOUniversalBinary::getObjectForArch()

The reason we need to search by name rather than by Triple::ArchType
is to handle subarchitecture correclty. There is no different ArchType
for the x86_64h architecture (it identifies itself as x86_64), or for
the various ARM subarches. The only way to get to the subarch slice
in an universal binary is to search by name.

This issue led to hard to debug and transient symbolication failures
in Asan tests (it mostly works, because the files are very similar).

This also affects the Profiling infrastucture as it is the other user
of that API.

Reviewers: samsonov, bogner

Subscribers: llvm-commits

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

llvm-svn: 240339

9 years ago[CodeGen] Teach X86_64ABIInfo about AVX512.
Ahmed Bougacha [Mon, 22 Jun 2015 21:31:43 +0000 (21:31 +0000)]
[CodeGen] Teach X86_64ABIInfo about AVX512.

As specified in the SysV AVX512 ABI drafts. It follows the same scheme
as AVX2:

    Arguments of type __m512 are split into eight eightbyte chunks.
    The least significant one belongs to class SSE and all the others
    to class SSEUP.

This also means we change the OpenMP SIMD default alignment on AVX512.

Based on r240337.
Differential Revision: http://reviews.llvm.org/D9894

llvm-svn: 240338

9 years ago[CodeGen] Use enum for AVX level in X86*TargetCodeGenInfo. NFCI.
Ahmed Bougacha [Mon, 22 Jun 2015 21:30:39 +0000 (21:30 +0000)]
[CodeGen] Use enum for AVX level in X86*TargetCodeGenInfo. NFCI.

Follow-up to r237989: expressing the AVX level as an enum makes it
simple to extend it with AVX512.

llvm-svn: 240337

9 years agoSet missing x86 arch in a CodeGen regression test.
Pawel Bylica [Mon, 22 Jun 2015 21:18:10 +0000 (21:18 +0000)]
Set missing x86 arch in a CodeGen regression test.

Fixes the regression test added in r240291.

llvm-svn: 240336

9 years ago[modules] Add a flag to disable the feature that permits conflicting redefinitions...
Richard Smith [Mon, 22 Jun 2015 21:15:01 +0000 (21:15 +0000)]
[modules] Add a flag to disable the feature that permits conflicting redefinitions of internal-linkage symbols that are not visible.

Such conflicts are an accident waiting to happen, and this feature conflicts
with the desire to include existing headers into multiple modules and merge the
results. (In an ideal world, it should not be possible to export internal
linkage symbols from a module, but sadly the glibc and libstdc++ headers
provide 'static inline' functions in a few cases.)

llvm-svn: 240335

9 years agotest-release.sh: Minor fixes.
Hans Wennborg [Mon, 22 Jun 2015 21:13:30 +0000 (21:13 +0000)]
test-release.sh: Minor fixes.

llvm-svn: 240334

9 years ago[X86][AVX2] Added missing stack folding tests for vpshufhw/vpshuflw
Simon Pilgrim [Mon, 22 Jun 2015 21:10:42 +0000 (21:10 +0000)]
[X86][AVX2] Added missing stack folding tests for vpshufhw/vpshuflw

llvm-svn: 240332

9 years agoR600/SI: Use ELF64 format instead of ELF32
Tom Stellard [Mon, 22 Jun 2015 21:03:54 +0000 (21:03 +0000)]
R600/SI: Use ELF64 format instead of ELF32

Reviewers: arsenm, rafael

Subscribers: llvm-commits

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

llvm-svn: 240331

9 years agoR600: Use EM_AMDGPU for the ELF Machine type
Tom Stellard [Mon, 22 Jun 2015 21:03:52 +0000 (21:03 +0000)]
R600: Use EM_AMDGPU for the ELF Machine type

Reviewers: arsenm, rafael

Subscribers: llvm-commits

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

llvm-svn: 240330

9 years agoSupport/ELF: Add EM_AMDGPU
Tom Stellard [Mon, 22 Jun 2015 21:03:47 +0000 (21:03 +0000)]
Support/ELF: Add EM_AMDGPU

Summary: This will be used by the R600 backend.

Reviewers: chandlerc, rafael

Subscribers: llvm-commits

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

llvm-svn: 240329

9 years agoAdd comment about the importance of being adjacent. NFC
Douglas Katzman [Mon, 22 Jun 2015 20:55:31 +0000 (20:55 +0000)]
Add comment about the importance of being adjacent. NFC

llvm-svn: 240328

9 years agoAdding some more flakey tests to the XFAIL list
Vince Harron [Mon, 22 Jun 2015 20:54:14 +0000 (20:54 +0000)]
Adding some more flakey tests to the XFAIL list

llvm-svn: 240327

9 years ago[X86] Teach load folding to accept scalar _Int users of MOVSS/MOVSD.
Ahmed Bougacha [Mon, 22 Jun 2015 20:51:51 +0000 (20:51 +0000)]
[X86] Teach load folding to accept scalar _Int users of MOVSS/MOVSD.

The _Int instructions are special, in that they operate on the full
VR128 instead of FR32.  The load folding then looks at MOVSS, at the
user, and bails out when it sees a size mismatch.

What we really know is that the rm_Int instructions don't load the
higher lanes, so folding is fine.

This happens for the straightforward intrinsic code, e.g.:

    _mm_add_ss(a, _mm_load_ss(p));

Fixes PR23349.

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

llvm-svn: 240326

9 years agoEnhance lldb-mi arguments test (MI)
Dawn Perchik [Mon, 22 Jun 2015 20:41:57 +0000 (20:41 +0000)]
Enhance lldb-mi arguments test (MI)

SUMMARY:
Add additional arguments to lldb-mi args tests to make sure arguments with quotes are handled correctly.

Reviewers: ki.stfu
Subscribers: lldb-commits
Test Plan:
    ./dotest.py --executable lldb -f MiInterpreterExecTestCase.test_lldbmi_settings_set_target_run_args_before
    ./dotest.py --executable lldb -f MiInterpreterExecTestCase.test_lldbmi_settings_set_target_run_args_after
Differential Revision: http://reviews.llvm.org/D10523

llvm-svn: 240325

9 years agoMIR Serialization: Introduce a lexer for machine instructions.
Alex Lorenz [Mon, 22 Jun 2015 20:37:46 +0000 (20:37 +0000)]
MIR Serialization: Introduce a lexer for machine instructions.

This commit adds a function that tokenizes the string containing
the machine instruction. This commit also adds a struct called
'MIToken' which is used to represent the lexer's tokens.

Reviewers: Sean Silva

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

llvm-svn: 240323

9 years agoUse C99 to compile ISL
Michael Kruse [Mon, 22 Jun 2015 20:31:16 +0000 (20:31 +0000)]
Use C99 to compile ISL

ISL with small integer optimization requires C99 to compile. gcc < 5.0
still uses C89 as default, so we need to enable the options to compile
in C99 mode.

This patch is preparing the actual activation of small integer
optimization.

Differential version: http://reviews.llvm.org/D10610

Reviewers: grosser
llvm-svn: 240322

9 years agoSafeStack: Create the unsafe stack pointer on demand.
Peter Collingbourne [Mon, 22 Jun 2015 20:26:54 +0000 (20:26 +0000)]
SafeStack: Create the unsafe stack pointer on demand.

This avoids creating an unnecessary undefined reference on targets such as
NVPTX that require such references to be declared in asm output.

llvm-svn: 240321

9 years agoMove MCSymbol Value in to the union of Offset and CommonSize.
Pete Cooper [Mon, 22 Jun 2015 19:57:33 +0000 (19:57 +0000)]
Move MCSymbol Value in to the union of Offset and CommonSize.

This is a reapplication of r239440 which was reverted in r239441.
There are no changes to this patch from then, but this had instead exposed
a bug in .thumb_set which was fixed in r240318.  Having fixed that bug, it
is now safe to re-apply this code.

Original commit message below:

It wasn't possible to have a variable Symbol with offset or 'isCommon' so
this just enables better packing of the MCSymbol class.

Reviewed by Rafael Espindola.

llvm-svn: 240320

9 years agoCOFF: Separate DefinedCOMDAT from DefinedRegular symbol type. NFC.
Rui Ueyama [Mon, 22 Jun 2015 19:56:01 +0000 (19:56 +0000)]
COFF: Separate DefinedCOMDAT from DefinedRegular symbol type. NFC.

Before this change, you got to cast a symbol to DefinedRegular and then
call isCOMDAT() to determine if a given symbol is a COMDAT symbol.
Now you can just use isa<DefinedCOMDAT>().

As to the class definition of DefinedCOMDAT, I could remove duplicate
code from DefinedRegular and DefinedCOMDAT by introducing another base
class for them, but I chose to not do that to keep the class hierarchy
shallow. This amount of code duplication doesn't worth to define a new
class.

llvm-svn: 240319

9 years agoChange .thumb_set to have the same error checks as .set.
Pete Cooper [Mon, 22 Jun 2015 19:35:57 +0000 (19:35 +0000)]
Change .thumb_set to have the same error checks as .set.

According to the documentation, .thumb_set is 'the equivalent of a .set directive'.

We didn't have equivalent behaviour in terms of all the errors we could throw, for
example, when a symbol is redefined.

This change refactors parseAssignment so that it can be used by .set and .thumb_set
and implements tests for .thumb_set for all the errors thrown by that method.

Reviewed by Rafael Espíndola.

llvm-svn: 240318

9 years agoRemove "const" from the MachineFunction reference in VLIWPacketizerList
Krzysztof Parzyszek [Mon, 22 Jun 2015 18:59:44 +0000 (18:59 +0000)]
Remove "const" from the MachineFunction reference in VLIWPacketizerList

llvm-svn: 240317

9 years agodocs: Update allowed values for LLVM_USE_SANITIZER
Justin Bogner [Mon, 22 Jun 2015 18:55:46 +0000 (18:55 +0000)]
docs: Update allowed values for LLVM_USE_SANITIZER

"Thread" and combinations of "Address" and "Undefined" have been
accepted for a while now.

llvm-svn: 240316

9 years agoMake CMake generate isl/stdint.h
Michael Kruse [Mon, 22 Jun 2015 18:47:39 +0000 (18:47 +0000)]
Make CMake generate isl/stdint.h

ISL's ./configure examines the system for the stdint.h to include and
creates a header file that points to it. On C99-compatible system

    #include <stdint.h>

is always valid such there no need for system introspection. This should
unbreak the build bots.

llvm-svn: 240315

9 years agotest: Set lit features appropriately when using asan and ubsan together
Justin Bogner [Mon, 22 Jun 2015 18:47:10 +0000 (18:47 +0000)]
test: Set lit features appropriately when using asan and ubsan together

The asan/not_asan and ubsan/not_ubsan features weren't being set
correctly when LLVM_USE_SANITIZER is set to 'Address;Undefined'. Fix
this by doing substring instead of exact matching. Also simplify the
msan check for consistency.

llvm-svn: 240314

9 years ago[modules] Include merged definition information in AST dumps.
Richard Smith [Mon, 22 Jun 2015 18:47:01 +0000 (18:47 +0000)]
[modules] Include merged definition information in AST dumps.

llvm-svn: 240313

9 years agoHandle zero-element ArrayRefs in CUDA run-time debug builder
Tobias Grosser [Mon, 22 Jun 2015 18:45:23 +0000 (18:45 +0000)]
Handle zero-element ArrayRefs in CUDA run-time debug builder

llvm-svn: 240312

9 years ago[x86] set default reciprocal (division and square root) codegen to match GCC
Sanjay Patel [Mon, 22 Jun 2015 18:29:44 +0000 (18:29 +0000)]
[x86] set default reciprocal (division and square root) codegen to match GCC

D8982 ( checked in at http://reviews.llvm.org/rL239001 ) added command-line
options to allow reciprocal estimate instructions to be used in place of
divisions and square roots.

This patch changes the default settings for x86 targets to allow that recip
codegen (except for scalar division because that breaks too much code) when
using -ffast-math or its equivalent.

This matches GCC behavior for this kind of codegen.

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

llvm-svn: 240310

9 years agoFix MSVC build (again!).
Sanjoy Das [Mon, 22 Jun 2015 18:24:50 +0000 (18:24 +0000)]
Fix MSVC build (again!).

Remove two `typename`s that I should have removed in r240307 but left in
by mistake.

llvm-svn: 240309

9 years agoDo not pass -allow-shlib-undefined to the Solaris linker.
Rafael Espindola [Mon, 22 Jun 2015 18:24:01 +0000 (18:24 +0000)]
Do not pass -allow-shlib-undefined to the Solaris linker.

Patch by Xan López.

llvm-svn: 240308

9 years agoFix MSVC build.
Sanjoy Das [Mon, 22 Jun 2015 18:20:10 +0000 (18:20 +0000)]
Fix MSVC build.

I had some unnecessary `typename`s left in after addressing review.
This compiled successfully with clang++ but MSVC reported an error.  Fix
the build error by removing the redundant `typename`s.

llvm-svn: 240307

9 years agoReplace repository version of ISL by 'make dist' output
Michael Kruse [Mon, 22 Jun 2015 18:07:42 +0000 (18:07 +0000)]
Replace repository version of ISL by 'make dist' output

The 'make dist' archive is not dependent on ./configure output and
contains a GIT_HEAD_ID file that identifies the version of ISL used.

None of the files added or removed are used part of Polly's build
process (except of GIT_HEAD_ID since the previous revision r240301). No
functional change intended.

llvm-svn: 240306

9 years agoRemove the IsStreamed member variable.
Rafael Espindola [Mon, 22 Jun 2015 18:06:15 +0000 (18:06 +0000)]
Remove the IsStreamed member variable.

Having different code paths for streamed and regular bitcode reading was a
source of bugs in the past and this defines them away.

It has a small but noticeable impact on performance. I timed running
"opt -disable-output -disable-verify" on a ltoed clang. It goes from

14.752845231 seconds time elapsed   ( +-  0.16% )

to

15.012463721 seconds time elapsed   ( +-  0.11% )

Extracted from a patch by Karl Schimpf.

llvm-svn: 240305

9 years ago[FaultMaps] Add a parser for the __llvm__faultmaps section.
Sanjoy Das [Mon, 22 Jun 2015 18:03:02 +0000 (18:03 +0000)]
[FaultMaps] Add a parser for the __llvm__faultmaps section.

Summary:
The parser is exercised by llvm-objdump using -print-fault-maps.  As is
probably obvious, the code itself was "heavily inspired" by
http://reviews.llvm.org/D10434.

Reviewers: reames, atrick, JosephTremoulet

Subscribers: llvm-commits

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

llvm-svn: 240304

9 years ago[NFC] Capitalization in documentation.
Sanjoy Das [Mon, 22 Jun 2015 18:02:55 +0000 (18:02 +0000)]
[NFC] Capitalization in documentation.

llvm-svn: 240303

9 years agoBring r240130 back.
Rafael Espindola [Mon, 22 Jun 2015 17:52:52 +0000 (17:52 +0000)]
Bring r240130 back.

Now that pr23900 is fixed, we can bring it back with no changes.

Original message:

Make all temporary symbols unnamed.

What this does is make all symbols that would otherwise start with a .L
(or L on MachO) unnamed.

Some of these symbols still show up in the symbol table, but we can just
make them unnamed.

In order to make sure we produce identical results when going thought assembly,
all .L (not just the compiler produced ones), are now unnamed.

Running llc on llvm-as.opt.bc, the peak memory usage goes from 208.24MB to
205.57MB.

llvm-svn: 240302

9 years agoPrepare replacing ISL by its 'make dist' files
Michael Kruse [Mon, 22 Jun 2015 17:52:33 +0000 (17:52 +0000)]
Prepare replacing ISL by its 'make dist' files

Currently the Polly repository contains the ISL sources with bogus
isl_config.h and gitversion.h. This is problematic. In this state a
 macro

    #define __attribute__(x)

becomes active in the source, leading to various problems e.g. when
included before system header files. This patch will instead generate
the two files specific to the host system at configure-time.

For CMake, we replicate the tests that ISL's configure performs using
try_compile(). In autotools build, we just invoke ISL's configure to
generate the two files. This consequently required regenerating
autoconf/configure.

'make dist' distributions of ISL contain a file GIT_HEAD_ID which
contains the version the distribution is derived from. The repository
files themselves do not contain such a hint. In a later commit we will
replace the isl directory by the contents of such a .tar.gz. It does
not contain the files imdrover.c iprime.c pi.c and rsamath.c currently
compiled into Polly, but not used and therefore are removed by this
patch.

In the long term we plan to generate a dedicated library for ISL instead
of adding its files to Polly.

This also does not yet include the switch to small-integer optimized ISL
nor enabling C99 mode required for the former. Those will come as well
in separate patches.

Differential version: http://reviews.llvm.org/D10603

Reviewers: grosser
llvm-svn: 240301

9 years agoAvoid a Symbol -> Name -> Symbol conversion.
Rafael Espindola [Mon, 22 Jun 2015 17:46:53 +0000 (17:46 +0000)]
Avoid a Symbol -> Name -> Symbol conversion.

Before this we were producing a TargetExternalSymbol from a MCSymbol.
That meant extracting the symbol name and fetching the symbol again
down the pipeline.

This patch adds a DAG.getMCSymbol that lets the MCSymbol pass unchanged on the
DAG.

Doing so removes the need for MO_NOPREFIX and fixes the root cause of pr23900,
allowing r240130 to be committed again.

llvm-svn: 240300

9 years agoCleanup the code a bit to make it more readable.
Greg Clayton [Mon, 22 Jun 2015 17:38:30 +0000 (17:38 +0000)]
Cleanup the code a bit to make it more readable.

Add some if/then to avoid calling a function to get dynamic/synthetic types if we know we aren't going to need to call it.

Avoid calling a function that returns a shared pointer twice: once for testing it and once for assigning it (even though that shared pointer is cached inside the value object), it just makes the code a bit clearer.

llvm-svn: 240299

9 years agoFix typo.
Rui Ueyama [Mon, 22 Jun 2015 17:26:27 +0000 (17:26 +0000)]
Fix typo.

llvm-svn: 240298

9 years agoMisc. cleanups suggested by Aaron Ballman
Douglas Gregor [Mon, 22 Jun 2015 17:19:03 +0000 (17:19 +0000)]
Misc. cleanups suggested by Aaron Ballman

llvm-svn: 240297

9 years agoDocument the nullability attributes.
Douglas Gregor [Mon, 22 Jun 2015 17:06:56 +0000 (17:06 +0000)]
Document the nullability attributes.

llvm-svn: 240296

9 years agoMIR Serialization: Serialize machine instruction names.
Alex Lorenz [Mon, 22 Jun 2015 17:02:30 +0000 (17:02 +0000)]
MIR Serialization: Serialize machine instruction names.

This commit implements initial machine instruction serialization. It
serializes machine instruction names. The instructions are represented
using a YAML sequence of string literals and are a part of machine
basic block YAML mapping.

This commit introduces a class called 'MIParser' which will be used to
parse the machine instructions and operands.

Reviewers: Duncan P. N. Exon Smith

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

llvm-svn: 240295

9 years agoAllow machine hierarchy expansion
Jonathan Peyton [Mon, 22 Jun 2015 15:59:18 +0000 (15:59 +0000)]
Allow machine hierarchy expansion

This fix allows the machine hierarchy to be expanded in case it needs to handle
more threads. It adds a resize function to accomplish this.

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

llvm-svn: 240292

9 years agoFix shl folding in DAG combiner.
Pawel Bylica [Mon, 22 Jun 2015 15:58:11 +0000 (15:58 +0000)]
Fix shl folding in DAG combiner.

Summary: The code responsible for shl folding in the DAGCombiner was assuming incorrectly that all constants are less than 64 bits. This patch simply changes the way values are compared.

Test Plan: A regression test included.

Reviewers: andreadb

Reviewed By: andreadb

Subscribers: andreadb, test, llvm-commits

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

llvm-svn: 240291

9 years agoRe-enable Visual Studio Builds.
Jonathan Peyton [Mon, 22 Jun 2015 15:53:50 +0000 (15:53 +0000)]
Re-enable Visual Studio Builds.

I tried to compile with Visual Studio using CMake and found these two sections of code
causing problems for Visual Studio.  The first one removes the use of variable length
arrays by instead using KMP_ALLOCA().  The second part eliminates a redundant cpuid
assembly call by using the already existing __kmp_x86_cpuid() call instead.

llvm-svn: 240290

9 years agoAdd a triple to the test to fix it on some hosts.
Rafael Espindola [Mon, 22 Jun 2015 15:44:20 +0000 (15:44 +0000)]
Add a triple to the test to fix it on some hosts.

The slp vectorizer doesn't optimize this case in 32 bits.

Fixes PR23453.

llvm-svn: 240289

9 years ago[ORC] Add NullResolver
Joseph Tremoulet [Mon, 22 Jun 2015 15:27:58 +0000 (15:27 +0000)]
[ORC] Add NullResolver

Summary:
This is an implementation of RuntimeDyld::SymbolResolver that simply
rejects all resolution requests; useful for clients that do not have any
cross-object symbol references.

Reviewers: lhames

Reviewed By: lhames

Subscribers: llvm-commits

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

llvm-svn: 240288

9 years agoSupport Solaris unused sections' gc link syntax.
Rafael Espindola [Mon, 22 Jun 2015 15:06:17 +0000 (15:06 +0000)]
Support Solaris unused sections' gc link syntax.

It is not clear if this would work or not with LLVM_NO_DEAD_STRIP
binaries, so be conservative for now.

Patch by Xan López.

llvm-svn: 240287

9 years agoMake seeking on an ostream that has eofbit set work correctly. Fixes PR#21361
Marshall Clow [Mon, 22 Jun 2015 15:01:21 +0000 (15:01 +0000)]
Make seeking on an ostream that has eofbit set work correctly. Fixes PR#21361

llvm-svn: 240286

9 years agoTest Commit
Jaydeep Patil [Mon, 22 Jun 2015 13:58:30 +0000 (13:58 +0000)]
Test Commit

llvm-svn: 240280

9 years agoDon't use &* when get() will suffice; NFC.
Aaron Ballman [Mon, 22 Jun 2015 13:28:21 +0000 (13:28 +0000)]
Don't use &* when get() will suffice; NFC.

llvm-svn: 240279

9 years ago[mips] [IAS] Add support for LAReg with identical source and destination register...
Toma Tabacu [Mon, 22 Jun 2015 13:10:23 +0000 (13:10 +0000)]
[mips] [IAS] Add support for LAReg with identical source and destination register operands.

Summary: In this case, we're supposed to load the immediate in AT and then ADDu it with the source register and put it in the destination register.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 240278

9 years agoAVX-512: added VPSHUFB instruction - all SKX forms
Elena Demikhovsky [Mon, 22 Jun 2015 13:00:42 +0000 (13:00 +0000)]
AVX-512: added VPSHUFB instruction - all SKX forms
Added intrinsics and encoding tests.

llvm-svn: 240277

9 years agoDo not pass optimization flags to Solaris' linker.
Rafael Espindola [Mon, 22 Jun 2015 12:41:52 +0000 (12:41 +0000)]
Do not pass optimization flags to Solaris' linker.

It is not supported.

Patch by Xan López.

llvm-svn: 240276

9 years agoUse right syntax to pass version script to Solaris' ld.
Rafael Espindola [Mon, 22 Jun 2015 12:34:54 +0000 (12:34 +0000)]
Use right syntax to pass version script to Solaris' ld.

Patch by Xan Lopez!

llvm-svn: 240275

9 years ago[mips] [IAS] Add support for LASym with identical source and destination register...
Toma Tabacu [Mon, 22 Jun 2015 12:08:39 +0000 (12:08 +0000)]
[mips] [IAS] Add support for LASym with identical source and destination register operands.

Summary:
In this case, we're supposed to load the address of the symbol in AT and then ADDu it with the source register and
put it in the destination register.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 240273

9 years agoAVX-512: All forms of VCOPMRESS VEXPAND instructions,
Elena Demikhovsky [Mon, 22 Jun 2015 11:16:30 +0000 (11:16 +0000)]
AVX-512: All forms of VCOPMRESS VEXPAND instructions,
encoding tests.

llvm-svn: 240272

9 years agoFixed/added namespace ending comments using clang-tidy. NFC
Alexander Kornienko [Mon, 22 Jun 2015 09:57:54 +0000 (09:57 +0000)]
Fixed/added namespace ending comments using clang-tidy. NFC

A few more files that were fixed while preparing r240270.

llvm-svn: 240271

9 years agoFixed/added namespace ending comments using clang-tidy. NFC
Alexander Kornienko [Mon, 22 Jun 2015 09:47:44 +0000 (09:47 +0000)]
Fixed/added namespace ending comments using clang-tidy. NFC

The patch is generated using this command:

  $ tools/extra/clang-tidy/tool/run-clang-tidy.py -fix \
      -checks=-*,llvm-namespace-comment -header-filter='llvm/.*|clang/.*' \
      work/llvm/tools/clang

To reduce churn, not touching namespaces spanning less than 10 lines.

llvm-svn: 240270

9 years agoRemoving empty directories.
Alexander Kornienko [Mon, 22 Jun 2015 09:34:18 +0000 (09:34 +0000)]
Removing empty directories.

llvm-svn: 240269

9 years ago[Mips] Support R_MICROMIPS_HI0_LO16 relocation handling
Simon Atanasyan [Mon, 22 Jun 2015 09:27:05 +0000 (09:27 +0000)]
[Mips] Support R_MICROMIPS_HI0_LO16 relocation handling

llvm-svn: 240268

9 years ago[Mips] Support R_MICROMIPS_LITERAL relocation handling
Simon Atanasyan [Mon, 22 Jun 2015 09:26:57 +0000 (09:26 +0000)]
[Mips] Support R_MICROMIPS_LITERAL relocation handling

llvm-svn: 240267

9 years ago[Mips] Support R_MIPS_LITERAL relocation handling
Simon Atanasyan [Mon, 22 Jun 2015 09:26:48 +0000 (09:26 +0000)]
[Mips] Support R_MIPS_LITERAL relocation handling

llvm-svn: 240266

9 years ago[Mips] Support R_MICROMIPS_SUB relocation handling
Simon Atanasyan [Mon, 22 Jun 2015 09:26:41 +0000 (09:26 +0000)]
[Mips] Support R_MICROMIPS_SUB relocation handling

llvm-svn: 240265

9 years ago[Mips] Reject R_MIPS_GPREL32 against external symbols
Simon Atanasyan [Mon, 22 Jun 2015 09:26:33 +0000 (09:26 +0000)]
[Mips] Reject R_MIPS_GPREL32 against external symbols

llvm-svn: 240264

9 years ago[Mips] Fix test case - do not use R_MIPS_GPREL32 against external symbols
Simon Atanasyan [Mon, 22 Jun 2015 09:26:25 +0000 (09:26 +0000)]
[Mips] Fix test case - do not use R_MIPS_GPREL32 against external symbols

No functional changes.

llvm-svn: 240263

9 years ago[Mips] Reject position-dependent relocations in case of shared library linking
Simon Atanasyan [Mon, 22 Jun 2015 09:26:20 +0000 (09:26 +0000)]
[Mips] Reject position-dependent relocations in case of shared library linking

llvm-svn: 240262

9 years ago[Mips] Fix test case - do not use R_MIPS_HI16 for shared library linking
Simon Atanasyan [Mon, 22 Jun 2015 09:26:12 +0000 (09:26 +0000)]
[Mips] Fix test case - do not use R_MIPS_HI16 for shared library linking

No functional changes.

llvm-svn: 240261

9 years ago[Mips] Support R_MICROMIPS_HIGHER / R_MICROMIPS_HIGHEST relocations handling
Simon Atanasyan [Mon, 22 Jun 2015 09:26:05 +0000 (09:26 +0000)]
[Mips] Support R_MICROMIPS_HIGHER / R_MICROMIPS_HIGHEST relocations handling

llvm-svn: 240260

9 years ago[Mips] Support R_MIPS_HIGHER / R_MIPS_HIGHEST relocations handling
Simon Atanasyan [Mon, 22 Jun 2015 09:25:57 +0000 (09:25 +0000)]
[Mips] Support R_MIPS_HIGHER / R_MIPS_HIGHEST relocations handling

llvm-svn: 240259

9 years agoReverted AVX-512 vector shuffle
Elena Demikhovsky [Mon, 22 Jun 2015 09:01:15 +0000 (09:01 +0000)]
Reverted AVX-512 vector shuffle

llvm-svn: 240258

9 years ago[X86] Allow more call sequences to use push instructions for argument passing
Michael Kuperstein [Mon, 22 Jun 2015 08:31:22 +0000 (08:31 +0000)]
[X86] Allow more call sequences to use push instructions for argument passing

This allows more call sequences to use pushes instead of movs when optimizing for size.
In particular, calling conventions that pass some parameters in registers (e.g. thiscall) are now supported.

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

llvm-svn: 240257

9 years agoAVX-512: Added intrinsics for VPERMT2W/D/Q/PS/PD and
Elena Demikhovsky [Mon, 22 Jun 2015 06:45:48 +0000 (06:45 +0000)]
AVX-512: Added intrinsics for VPERMT2W/D/Q/PS/PD and
VPERMI2W/D/Q/PS/PD instructions.
Added tests.

llvm-svn: 240256

9 years ago[PM/AA] Hoist the AliasResult enum out of the AliasAnalysis class.
Chandler Carruth [Mon, 22 Jun 2015 02:16:51 +0000 (02:16 +0000)]
[PM/AA] Hoist the AliasResult enum out of the AliasAnalysis class.

This will allow classes to implement the AA interface without deriving
from the class or referencing an internal enum of some other class as
their return types.

Also, to a pretty fundamental extent, concepts such as 'NoAlias',
'MayAlias', and 'MustAlias' are first class concepts in LLVM and we
aren't saving anything by scoping them heavily.

My mild preference would have been to use a scoped enum, but that
feature is essentially completely broken AFAICT. I'm extremely
disappointed. For example, we cannot through any reasonable[1] means
construct an enum class (or analog) which has scoped names but converts
to a boolean in order to test for the possibility of aliasing.

[1]: Richard Smith came up with a "solution", but it requires class
templates, and lots of boilerplate setting up the enumeration multiple
times. Something like Boost.PP could potentially bundle this up, but
even that would be quite painful and it doesn't seem realistically worth
it. The enum class solution would probably work without the need for
a bool conversion.

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

llvm-svn: 240255