platform/upstream/llvm.git
9 years ago[x86] add 2 bit to ObjCOrBuiltinID and new intrinsics
Asaf Badouh [Tue, 14 Jul 2015 14:02:45 +0000 (14:02 +0000)]
[x86] add 2 bit to ObjCOrBuiltinID and new intrinsics

add 2 bit to ObjCOrBuiltinID (changed from 11bits to 13bits), see discussion in
Add new intrinsics support that already covered by the BE.
All the intrinsics are covered by tests

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

llvm-svn: 242144

9 years agoFix LLDB Xcode build broken in r242137
Ewan Crawford [Tue, 14 Jul 2015 13:29:03 +0000 (13:29 +0000)]
Fix LLDB Xcode build broken in r242137

llvm-svn: 242143

9 years ago[ELF/AArch64] Fix export TLS dynamic symbol
Adhemerval Zanella [Tue, 14 Jul 2015 13:25:32 +0000 (13:25 +0000)]
[ELF/AArch64] Fix export TLS dynamic symbol

This patch fixes the TLS dynamic variable exportation from .got.plt segments,
created by General-dynamic relocations (TLSDESC).  Current code only export
symbols in dynamic table from .got sections.

llvm-svn: 242142

9 years ago-Added API for retrieving the default FPU of a CPU from TargetParser.
Alexandros Lamprineas [Tue, 14 Jul 2015 13:20:48 +0000 (13:20 +0000)]
-Added API for retrieving the default FPU of a CPU from TargetParser.
-Implemented as a table lookup.

Change-Id: Ibf7217f6bd2769e9c06835a5aede3d072dee6757
Phabricator: http://reviews.llvm.org/D11100
llvm-svn: 242141

9 years ago[Analyzer] Move FindSuperCallVisitor into an anonymous namespace.
Benjamin Kramer [Tue, 14 Jul 2015 12:37:59 +0000 (12:37 +0000)]
[Analyzer] Move FindSuperCallVisitor into an anonymous namespace.

No functionality change.

llvm-svn: 242140

9 years ago[mips] Fix li/la differences between IAS and GAS.
Daniel Sanders [Tue, 14 Jul 2015 12:24:22 +0000 (12:24 +0000)]
[mips] Fix li/la differences between IAS and GAS.

Summary:
- Signed 16-bit should have priority over unsigned.
- For la, unsigned 16-bit must use ori+addu rather than directly use ori.
- Correct tests on 32-bit immediates with 64-bit predicates by
  sign-extending the immediate beforehand. For example, isInt<16>(0xffff8000)
  should be true and use addiu.

Also split li/la testing into separate files due to their size.

Reviewers: vkalintiris

Subscribers: llvm-commits

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

llvm-svn: 242139

9 years agoclang-format: Fix formatting of multiple lambdas in initializers.
Daniel Jasper [Tue, 14 Jul 2015 11:26:14 +0000 (11:26 +0000)]
clang-format: Fix formatting of multiple lambdas in initializers.

Before:
  SomeFunction({[&] {
    // comment
  },
                [&] {
                  // comment
                }});

After:
  SomeFunction({[&] {
                  // comment
                },
                [&] {
                  // comment
                }});

llvm-svn: 242138

9 years agoExpression evaluation, a new ThreadPlanCallFunctionUsingABI for executing a function...
Ewan Crawford [Tue, 14 Jul 2015 10:56:58 +0000 (10:56 +0000)]
Expression evaluation, a new ThreadPlanCallFunctionUsingABI for executing a function call on target via register manipulation

For Hexagon we want to be able to call functions during debugging, however currently lldb only supports this when there is JIT support.
Although emulation using IR interpretation is an alternative, it is currently limited in that it can't make function calls.

In this patch we have extended the IR interpreter so that it can execute a function call on the target using register manipulation.
To do this we need to handle the Call IR instruction, passing arguments to a new thread plan and collecting any return values to pass back into the IR interpreter.

The new thread plan is needed to call an alternative ABI interface of "ABI::PerpareTrivialCall()", allowing more detailed information about arguments and return values.

Reviewers: jingham, spyffe

Subscribers: emaste, lldb-commits, ted, ADodds, deepak2427

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

llvm-svn: 242137

9 years agoMark a couple of items as completed
Tobias Grosser [Tue, 14 Jul 2015 10:52:58 +0000 (10:52 +0000)]
Mark a couple of items as completed

llvm-svn: 242136

9 years agoDrop outdated video
Tobias Grosser [Tue, 14 Jul 2015 10:45:03 +0000 (10:45 +0000)]
Drop outdated video

llvm-svn: 242135

9 years agowww: Add link to llvm.org
Tobias Grosser [Tue, 14 Jul 2015 10:44:06 +0000 (10:44 +0000)]
www: Add link to llvm.org

llvm-svn: 242134

9 years ago[OPENMP] Drop type qualifiers from private variables.
Alexey Bataev [Tue, 14 Jul 2015 10:32:29 +0000 (10:32 +0000)]
[OPENMP] Drop type qualifiers from private variables.

If the variable is marked as private in OpenMP construct, the reference to this variable should not keep type qualifiers for the original variable. Private copy is not volatile or constant, so we can use unqualified type for private copy.

llvm-svn: 242133

9 years agoClasses inside lambdas are local not nested.
Serge Pavlov [Tue, 14 Jul 2015 10:02:10 +0000 (10:02 +0000)]
Classes inside lambdas are local not nested.

If a lambda used as default argument in a method declaration contained
a local class, that class was incorrectly recognized as nested class.
In this case compiler tried to postpone parsing of this class until
the enclosing class is finished, which caused crashes in some cases.

This change fixes PR13987.

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

llvm-svn: 242132

9 years agoTweak clang/test/PCH/chain-openmp-threadprivate.cpp to satisfy i686-win32.
NAKAMURA Takumi [Tue, 14 Jul 2015 09:45:28 +0000 (09:45 +0000)]
Tweak clang/test/PCH/chain-openmp-threadprivate.cpp to satisfy i686-win32.

llvm-svn: 242131

9 years agoUse schedule trees to represent execution order of statements
Tobias Grosser [Tue, 14 Jul 2015 09:33:13 +0000 (09:33 +0000)]
Use schedule trees to represent execution order of statements

Instead of flat schedules, we now use so-called schedule trees to represent the
execution order of the statements in a SCoP. Schedule trees make it a lot easier
to analyze, understand and modify properties of a schedule, as specific nodes
in the tree can be choosen and possibly replaced.

This patch does not yet fully move our DependenceInfo pass to schedule trees,
as some additional performance analysis is needed here. (In general schedule
trees should be faster in compile-time, as the more structured representation
is generally easier to analyze and work with). We also can not yet perform the
reduction analysis on schedule trees.

For more information regarding schedule trees, please see Section 6 of
https://lirias.kuleuven.be/handle/123456789/497238

llvm-svn: 242130

9 years ago[PM/AA] Reformat GlobalsModRef so that subsequent patches I make here
Chandler Carruth [Tue, 14 Jul 2015 08:42:39 +0000 (08:42 +0000)]
[PM/AA] Reformat GlobalsModRef so that subsequent patches I make here
don't continually introduce formatting deltas. NFC

llvm-svn: 242129

9 years agoFix comment typo
Petr Pavlu [Tue, 14 Jul 2015 08:00:34 +0000 (08:00 +0000)]
Fix comment typo

Test commit access.

llvm-svn: 242128

9 years agoFix for clang memcpyizer bugs 23911 and 23924 (patch by Denis Zobnin)
Alexey Bataev [Tue, 14 Jul 2015 07:55:48 +0000 (07:55 +0000)]
Fix for clang memcpyizer bugs 23911 and 23924 (patch by Denis Zobnin)

The fix is to remove duplicate copy-initialization of the only memcpy-able struct member and to correct the address of aggregately initialized members in destructors' calls during stack unwinding (in order to obtain address of struct member by using GEP instead of 'bitcast').
Differential Revision: http://reviews.llvm.org/D10990

llvm-svn: 242127

9 years ago[SROA] Don't de-atomic volatile loads and stores
David Majnemer [Tue, 14 Jul 2015 06:19:58 +0000 (06:19 +0000)]
[SROA] Don't de-atomic volatile loads and stores

Volatile loads and stores are made visible in global state regardless of
what memory is involved.  It is not correct to disregard the ordering
and synchronization scope because it is possible to synchronize with
memory operations performed by hardware.

This partially addresses PR23737.

llvm-svn: 242126

9 years agoFix test for Visual C++ link.exe.
Yaron Keren [Tue, 14 Jul 2015 06:01:14 +0000 (06:01 +0000)]
Fix test for Visual C++ link.exe.

llvm-svn: 242125

9 years agoFix test for Visual C++.
Yaron Keren [Tue, 14 Jul 2015 05:58:56 +0000 (05:58 +0000)]
Fix test for Visual C++.

llvm-svn: 242124

9 years agoGenerate correct asm info for mingw and cygwin ARM targets.
Yaron Keren [Tue, 14 Jul 2015 05:51:05 +0000 (05:51 +0000)]
Generate correct asm info for mingw and cygwin ARM targets.

http://reviews.llvm.org/D11075

Patch by Martell Malone
Reviewed by Reid Kleckner

llvm-svn: 242123

9 years agoFixed line wrapping for the "long help" content in LLDB commands. Content is now...
Kate Stone [Tue, 14 Jul 2015 05:48:36 +0000 (05:48 +0000)]
Fixed line wrapping for the "long help" content in LLDB commands.  Content is now dynamically wrapped for the column width of the current terminal.  Lines that begin with whitespace will be indented identically on subsequent lines to maintain formatting.

Existing commands supplying this type of help content have been reworked to take advantage of the changes.  In addition to formatting changes, content was changes for accuracy and clarity purposes.

<rdar://problem/21269977>

llvm-svn: 242122

9 years agoAdd support for -fuse-ld= in the mingw toolchain driver.
Yaron Keren [Tue, 14 Jul 2015 05:23:34 +0000 (05:23 +0000)]
Add support for -fuse-ld= in the mingw toolchain driver.
We will still default to ld until such a time lld become a
stable release. lld supports arm NT under the machine name "thumb2pe".

http://reviews.llvm.org/D11088

Patch by Martell Malone
Reviewed by Reid Kleckner

llvm-svn: 242121

9 years ago[CMake] Unbreak add_llvm_external_project when external projects are specified.
NAKAMURA Takumi [Tue, 14 Jul 2015 05:12:53 +0000 (05:12 +0000)]
[CMake] Unbreak add_llvm_external_project when external projects are specified.

LLVM_EXTERNAL_*_SOURCE_DIR is reset as PATH with set(CACHE PATH).
Then the CACHE PATH variable, LLVM_EXTERNAL_*_SOURCE_DIR, is normalized as
${CMAKE_SOURCE_DIR}/${path_var} if ${path_var} is relative.

llvm-svn: 242120

9 years agoFix off-by-one error in the packet decompression routine
Jason Molenda [Tue, 14 Jul 2015 04:51:05 +0000 (04:51 +0000)]
Fix off-by-one error in the packet decompression routine
that would not pass through empty ("unsupported packet") replies
correctly.

llvm-svn: 242119

9 years agoRevert ELF port. Posting to mailing list.
Michael J. Spencer [Tue, 14 Jul 2015 04:49:48 +0000 (04:49 +0000)]
Revert ELF port. Posting to mailing list.

llvm-svn: 242118

9 years agoPrune trailing whitespaces and CRs.
NAKAMURA Takumi [Tue, 14 Jul 2015 04:03:49 +0000 (04:03 +0000)]
Prune trailing whitespaces and CRs.

llvm-svn: 242117

9 years agoMark clang/test/PCH/chain-openmp-threadprivate.cpp as REQUIRES:tls.
NAKAMURA Takumi [Tue, 14 Jul 2015 04:00:18 +0000 (04:00 +0000)]
Mark clang/test/PCH/chain-openmp-threadprivate.cpp as REQUIRES:tls.

llvm-svn: 242116

9 years agoclang/test/lit.cfg: Introduce the feature "tls", for targeting cygwin.
NAKAMURA Takumi [Tue, 14 Jul 2015 03:57:11 +0000 (03:57 +0000)]
clang/test/lit.cfg: Introduce the feature "tls", for targeting cygwin.

Thread local storage is not implemented for targeting cygwin.

llvm-svn: 242115

9 years agoFix debugserver build breakage on Mavericks after lldb commit svn 240728
Dawn Perchik [Tue, 14 Jul 2015 03:50:10 +0000 (03:50 +0000)]
Fix debugserver build breakage on Mavericks after lldb commit svn 240728

vm_kernel_page_size appears to not be defined on OSX Mavericks, so the
build fails.  This patch fixes the build by calculating the pagesize if
_VM_PAGE_SIZE_H_ is not defined.

llvm-svn: 242114

9 years agoFix FreeBSD build.
Chaoren Lin [Tue, 14 Jul 2015 03:18:23 +0000 (03:18 +0000)]
Fix FreeBSD build.

llvm-svn: 242113

9 years agoRevert "Make COFF linker work when it's built by clang again."
Rui Ueyama [Tue, 14 Jul 2015 03:09:59 +0000 (03:09 +0000)]
Revert "Make COFF linker work when it's built by clang again."

This reverts commit r242006. The original issue in Clang was fixed in r242009,
so we can now safely use std::atomic_flag.

llvm-svn: 242112

9 years agoGive an explicit triple to llvm/test/CodeGen/X86/pr13577.ll.
NAKAMURA Takumi [Tue, 14 Jul 2015 03:07:06 +0000 (03:07 +0000)]
Give an explicit triple to llvm/test/CodeGen/X86/pr13577.ll.

llvm-svn: 242111

9 years agoCOFF: Fix entry name inference for x86.
Rui Ueyama [Tue, 14 Jul 2015 02:58:13 +0000 (02:58 +0000)]
COFF: Fix entry name inference for x86.

Entry name selection rule is already complicated on x64, but it's more
complicated on x86 because of the underscore name mangling scheme.

If one of _main, _main@<number> (a C function) or ?main@@... (a C++ function)
is defined, entry name is _mainCRTStartup. If _wmain, _wmain@<number or
?wmain@@... is defined, entry name is _wmainCRTStartup. And so on.

llvm-svn: 242110

9 years agoAdd file missed from r242105.
Richard Smith [Tue, 14 Jul 2015 02:40:33 +0000 (02:40 +0000)]
Add file missed from r242105.

llvm-svn: 242109

9 years agoRevert "LegalizeDAG: Fix and improve FCOPYSIGN/FABS legalization"
Matthias Braun [Tue, 14 Jul 2015 02:09:57 +0000 (02:09 +0000)]
Revert "LegalizeDAG: Fix and improve FCOPYSIGN/FABS legalization"

Accidental commit, needs review first.

This reverts commit r242107.

llvm-svn: 242108

9 years agoLegalizeDAG: Fix and improve FCOPYSIGN/FABS legalization
Matthias Braun [Tue, 14 Jul 2015 02:08:26 +0000 (02:08 +0000)]
LegalizeDAG: Fix and improve FCOPYSIGN/FABS legalization

- Factor out code to query and modify the sign bit of a floatingpoint
  value as an integer. This also works if none of the targets integer
  types is big enough to hold all bits of the floatingpoint value.

- Legalize FABS(x) as FCOPYSIGN(x, 0.0) if FCOPYSIGN is available,
  otherwise perform bit manipulation on the sign bit. The previous code
  used "x >u 0 ? x : -x" which is incorrect for x being -0.0! It also
  takes 34 instructions on ARM Cortex-M4. With this patch we only
  require 5:
    vldr d0, LCPI0_0
    vmov r2, r3, d0
    lsrs r2, r3, #31
    bfi r1, r2, #31, #1
    bx lr
  (This could be further improved if the compiler would recognize that
   r2, r3 is zero).

- Only lower FCOPYSIGN(x, y) = sign(x) ? -FABS(x) : FABS(x) if FABS is
  available otherwise perform bit manipulation on the sign bit.

- Perform the sign(x) test by masking out the sign bit and comparing
  with 0 rather than shifting the sign bit to the highest position and
  testing for "<s 0". For x86 copysignl (on 80bit values) this gets us:
    testl $32768, %eax
  rather than:
    shlq $48, %rax
    sets %al
    testb %al, %al

llvm-svn: 242107

9 years agoX86: Check output of x86 copysignl testcase.
Matthias Braun [Tue, 14 Jul 2015 02:08:23 +0000 (02:08 +0000)]
X86: Check output of x86 copysignl testcase.

This makes the changes in an upcoming patch visible.

llvm-svn: 242106

9 years ago[modules] When diagnosing errors in module map files found by 'extern module' declara...
Richard Smith [Tue, 14 Jul 2015 02:06:01 +0000 (02:06 +0000)]
[modules] When diagnosing errors in module map files found by 'extern module' declarations, show how we got to that module map file.

llvm-svn: 242105

9 years agoAdd capability to get and set the personalitty function from the C API
Andrew Wilkins [Tue, 14 Jul 2015 01:23:06 +0000 (01:23 +0000)]
Add capability to get and set the personalitty function from the C API

Summary:
The capability was lost with D10429 where the personality function was set at function level rather than landing pad level. Now there is no way to get/set the personality function from the C API. That is a problem.

Note that the whole thing could be avoided by improving the C API testing, as started by D10725

Reviewers: chandlerc, bogner, majnemer, andrew.w.kaylor, rafael, rnk, axw

Subscribers: rafael, llvm-commits

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

llvm-svn: 242104

9 years ago[CMake] Forgot to quote the first part of STREQUAL.
Chris Bieneman [Tue, 14 Jul 2015 01:19:07 +0000 (01:19 +0000)]
[CMake] Forgot to quote the first part of STREQUAL.

llvm-svn: 242103

9 years ago[CMake] We shouldn't be storing values in the cache unless they actually need CMake...
Chris Bieneman [Tue, 14 Jul 2015 01:17:43 +0000 (01:17 +0000)]
[CMake] We shouldn't be storing values in the cache unless they actually need CMake cache behavior.

add_llvm_external_project puts LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR into the cache even if it is just the in-tree default path. This causes all sorts of oddness, and makes it so that I can't change the behavior of this variable.

This patch never puts LLVM_EXTERNAL_${nameUPPER}_SOURCE_DIR into the cache. It will only end up in the cache if it is specified on the command line, which is the correct behavior.

There is also a temporary change to remove non-default values from the cache if they are already present. This should have the impact of cleaning out unncecissary values from the caches on the buildbots and people's local build directories. This part of the change is marked with a TODO and can be removed in a few days.

llvm-svn: 242102

9 years agoRefactor Unix signals.
Chaoren Lin [Tue, 14 Jul 2015 01:09:28 +0000 (01:09 +0000)]
Refactor Unix signals.

Summary:
- Consolidate Unix signals selection in UnixSignals.
- Make Unix signals available from platform.
- Add jSignalsInfo packet to retrieve Unix signals from remote platform.
- Get a copy of the platform signal for each remote process.
- Update SB API for signals.
- Update signal utility in test suite.

Reviewers: ovyalov, clayborg

Subscribers: chaoren, jingham, labath, emaste, tberghammer, lldb-commits

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

llvm-svn: 242101

9 years agoAdd a herper function. NFC.
Rafael Espindola [Tue, 14 Jul 2015 01:06:16 +0000 (01:06 +0000)]
Add a herper function. NFC.

llvm-svn: 242100

9 years agoRemove a completely redundant initialization of llvm::TimePassesIsEnabled,
Adrian Prantl [Tue, 14 Jul 2015 01:04:40 +0000 (01:04 +0000)]
Remove a completely redundant initialization of llvm::TimePassesIsEnabled,
which is actually the variable backing up the llvm -time-passes command
line argument.
llvm::TimePassesIsEnabled is actually being initialized in CodeGenAction.

llvm-svn: 242099

9 years agoFix warnings.
Michael J. Spencer [Tue, 14 Jul 2015 01:02:37 +0000 (01:02 +0000)]
Fix warnings.

llvm-svn: 242098

9 years agoBasic code generation for MSan use-after-dtor.
Evgeniy Stepanov [Tue, 14 Jul 2015 00:34:50 +0000 (00:34 +0000)]
Basic code generation for MSan use-after-dtor.

Under the -fsanitize-memory-use-after-dtor (disabled by default) insert
an MSan runtime library call at the end of every destructor.

Patch by Naomi Musgrave.

llvm-svn: 242097

9 years ago[LinkerScript] Don't create unnecessarily large segments
Rafael Auler [Tue, 14 Jul 2015 00:34:43 +0000 (00:34 +0000)]
[LinkerScript] Don't create unnecessarily large segments

When using a linker script expression to change the address of a section, even
if the new address is more than a page of distance from the old address, lld
may put everything in the same segment, forcing it to be unnecessarily large.
This patch changes the logic in Segment::assignVirtualAddress() and
Segment::assignFileOffsets() to allow the segment to be sliced into two or more
if it detects a linker script expression that changes a section address.

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

llvm-svn: 242096

9 years agoMIR Serialization: Serialize the variable sized stack objects.
Alex Lorenz [Tue, 14 Jul 2015 00:26:26 +0000 (00:26 +0000)]
MIR Serialization: Serialize the variable sized stack objects.

llvm-svn: 242095

9 years agoExtend -ftime-report to give more information about time spent reading module files.
Richard Smith [Tue, 14 Jul 2015 00:26:00 +0000 (00:26 +0000)]
Extend -ftime-report to give more information about time spent reading module files.

llvm-svn: 242094

9 years agoPut explicit template instantiations in the correct namespace.
Michael J. Spencer [Tue, 14 Jul 2015 00:22:00 +0000 (00:22 +0000)]
Put explicit template instantiations in the correct namespace.

llvm-svn: 242093

9 years agoRemove commented out code.
Michael J. Spencer [Tue, 14 Jul 2015 00:11:38 +0000 (00:11 +0000)]
Remove commented out code.

llvm-svn: 242092

9 years agoUpdate enforceKnownAlignment after the isWeakForLinker semantic change
Reid Kleckner [Tue, 14 Jul 2015 00:11:08 +0000 (00:11 +0000)]
Update enforceKnownAlignment after the isWeakForLinker semantic change

Previously we would refrain from attempting to increase the linkage of
available_externally globals because they were considered weak for the
linker. Now they are treated more like a declaration instead of a weak
definition.

This was causing SSE alignment faults in Chromuim, when some code
assumed it could increase the alignment of a dllimported global that it
didn't control.  http://crbug.com/509256

llvm-svn: 242091

9 years ago[OpenMP] Add REQUIRES pragma to threadprivate regression tests.
Samuel Antao [Tue, 14 Jul 2015 00:09:50 +0000 (00:09 +0000)]
[OpenMP] Add REQUIRES pragma to threadprivate regression tests.

llvm-svn: 242090

9 years ago[LinkerScript] Fix bug in Segment::assignVirtualAddress()
Rafael Auler [Mon, 13 Jul 2015 23:52:58 +0000 (23:52 +0000)]
[LinkerScript] Fix bug in Segment::assignVirtualAddress()

When calculating the start address and size of a segment, lld mistakenly
attributed the start address of the last segment slice to the whole segment
when it should consider the start address of the first slice. In this case, in a
multi-slice segment, Segment::assignVirtualAddress() will return a wrong
segment start address to TargetLayout::assignVirtualAddress(). The effect of
this miscalculation is to allocate some program headers in unnecessarily far
away addresses. This commit fixes this.

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

llvm-svn: 242089

9 years agoInitial ELF port.
Michael J. Spencer [Mon, 13 Jul 2015 23:48:06 +0000 (23:48 +0000)]
Initial ELF port.

This is a direct port of the new PE/COFF linker to ELF.

It can take a single object file and generate a valid executable that executes at the first byte in the text section.

llvm-svn: 242088

9 years ago[Intrin.h] Use __ATOMIC_SEQ_CST instead of '5'
David Majnemer [Mon, 13 Jul 2015 23:39:37 +0000 (23:39 +0000)]
[Intrin.h] Use __ATOMIC_SEQ_CST instead of '5'

No functionality change is intended.

llvm-svn: 242087

9 years ago[Intrin.h] Make the variable names more consistent
David Majnemer [Mon, 13 Jul 2015 23:38:56 +0000 (23:38 +0000)]
[Intrin.h] Make the variable names more consistent

No functionality change intended.

llvm-svn: 242086

9 years ago[cuda] Driver changes to compile and stitch together host and device-side CUDA code.
Artem Belevich [Mon, 13 Jul 2015 23:27:56 +0000 (23:27 +0000)]
[cuda] Driver changes to compile and stitch together host and device-side CUDA code.

  NOTE: reverts r242077 to reinstate r242058, r242065, 242067
        and includes fix for OS X test failures.

  - Changed driver pipeline to compile host and device side of CUDA
    files and incorporate results of device-side compilation into host
    object file.

  - Added a test for cuda pipeline creation in clang driver.

  New clang options:
  --cuda-host-only   - Do host-side compilation only.
  --cuda-device-only - Do device-side compilation only.

  --cuda-gpu-arch=<ARCH> - specify GPU architecture for device-side
    compilation. E.g. sm_35, sm_30. Default is sm_20. May be used more
    than once in which case one device-compilation will be done per
    unique specified GPU architecture.

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

llvm-svn: 242085

9 years agoMIR Serialization: Serialize the sub register indices.
Alex Lorenz [Mon, 13 Jul 2015 23:24:34 +0000 (23:24 +0000)]
MIR Serialization: Serialize the sub register indices.

This commit serializes the sub register indices from the register machine
operands.

Reviewers: Duncan P. N. Exon Smith
llvm-svn: 242084

9 years agoAdd missing file.
Rafael Espindola [Mon, 13 Jul 2015 23:14:26 +0000 (23:14 +0000)]
Add missing file.

Sorry about that.

llvm-svn: 242083

9 years agoFix reading archive members with / in the name.
Rafael Espindola [Mon, 13 Jul 2015 23:07:05 +0000 (23:07 +0000)]
Fix reading archive members with / in the name.

This is important for thin archives.

llvm-svn: 242082

9 years ago[PPC64LE] More improvements to VSX swap optimization
Bill Schmidt [Mon, 13 Jul 2015 22:58:19 +0000 (22:58 +0000)]
[PPC64LE] More improvements to VSX swap optimization

This patch allows VSX swap optimization to succeed more frequently.
Specifically, it is concerned with common code sequences that occur
when copying a scalar floating-point value to a vector register.  This
patch currently handles cases where the floating-point value is
already in a register, but does not yet handle loads (such as via an
LXSDX scalar floating-point VSX load).  That will be dealt with later.

A typical case is when a scalar value comes in as a floating-point
parameter.  The value is copied into a virtual VSFRC register, and
then a sequence of SUBREG_TO_REG and/or COPY operations will convert
it to a full vector register of the class required by the context.  If
this vector register is then used as part of a lane-permuted
computation, the original scalar value will be in the wrong lane.  We
can fix this by adding a swap operation following any widening
SUBREG_TO_REG operation.  Additional COPY operations may be needed
around the swap operation in order to keep register assignment happy,
but these are pro forma operations that will be removed by coalescing.

If a scalar value is otherwise directly referenced in a computation
(such as by one of the many XS* vector-scalar operations), we
currently disable swap optimization.  These operations are
lane-sensitive by definition.  A MentionsPartialVR flag is added for
use in each swap table entry that mentions a scalar floating-point
register without having special handling defined.

A common idiom for PPC64LE is to convert a double-precision scalar to
a vector by performing a splat operation.  This ensures that the value
can be referenced as V[0], as it would be for big endian, whereas just
converting the scalar to a vector with a SUBREG_TO_REG operation
leaves this value only in V[1].  A doubleword splat operation is one
form of an XXPERMDI instruction, which takes one doubleword from a
first operand and another doubleword from a second operand, with a
two-bit selector operand indicating which doublewords are chosen.  In
the general case, an XXPERMDI can be permitted in a lane-swapped
region provided that it is properly transformed to select the
corresponding swapped values.  This transformation is to reverse the
order of the two input operands, and to reverse and complement the
bits of the selector operand (derivation left as an exercise to the
reader ;).

A new test case that exercises the scalar-to-vector and generalized
XXPERMDI transformations is added as CodeGen/PowerPC/swaps-le-5.ll.
The patch also requires a change to CodeGen/PowerPC/swaps-le-3.ll to
use CHECK-DAG instead of CHECK for two independent instructions that
now appear in reverse order.

There are two small unrelated changes that are added with this patch.
First, the XXSLDWI instruction was incorrectly omitted from the list
of lane-sensitive instructions; this is now fixed.  Second, I observed
that the same webs were being rejected over and over again for
different reasons.  Since it's sufficient to reject a web only once, I
added a check for this to speed up the compilation time slightly.

llvm-svn: 242081

9 years ago[OpenMP] Add TLS-based implementation for threadprivate directive.
Samuel Antao [Mon, 13 Jul 2015 22:54:53 +0000 (22:54 +0000)]
[OpenMP] Add TLS-based implementation for threadprivate directive.

llvm-svn: 242080

9 years agoFix Windows build break related to MainLoop.
Adrian McCarthy [Mon, 13 Jul 2015 22:35:44 +0000 (22:35 +0000)]
Fix Windows build break related to MainLoop.

llvm-svn: 242079

9 years agoCOFF: Fix x86 delay-load helper function name.
Rui Ueyama [Mon, 13 Jul 2015 22:31:45 +0000 (22:31 +0000)]
COFF: Fix x86 delay-load helper function name.

If /delayload option is given, we have to resolve __delayLoadHelper2
since the function is the dynamic loader to delay-load DLLs.
The function name is mangled in x86 as ___delayLoadHelper2@8.

llvm-svn: 242078

9 years agoThis reverts commit r242058, r242065, r242067.
Rafael Espindola [Mon, 13 Jul 2015 22:26:30 +0000 (22:26 +0000)]
This reverts commit r242058,  r242065,  r242067.

The tests were failing on OS X.

Revert "[cuda] Driver changes to compile and stitch together host and device-side CUDA code."
Revert "Fixed regex to properly match '64' in the test case."
Revert "clang/test/Driver/cuda-options.cu REQUIRES clang-driver, at least."

llvm-svn: 242077

9 years agoDon't crash if we are unable to get the member type.
Greg Clayton [Mon, 13 Jul 2015 22:08:16 +0000 (22:08 +0000)]
Don't crash if we are unable to get the member type.

<rdar://problem/21624447>

llvm-svn: 242076

9 years agoCOFF: Inline Defined::getRVA because it's very hot.
Rui Ueyama [Mon, 13 Jul 2015 22:01:27 +0000 (22:01 +0000)]
COFF: Inline Defined::getRVA because it's very hot.

llvm-svn: 242075

9 years agoUse std::make_tuple to reduce code duplication.
Rafael Espindola [Mon, 13 Jul 2015 22:01:02 +0000 (22:01 +0000)]
Use std::make_tuple to reduce code duplication.

Thanks to David Blaikie for the suggestion.

llvm-svn: 242074

9 years agoRemove unnecessary lines from the test in r242068.
Pete Cooper [Mon, 13 Jul 2015 21:50:35 +0000 (21:50 +0000)]
Remove unnecessary lines from the test in r242068.

This test case was breaking the hexagon elf bot.  The failing lines
were actually unnecessary as checking that the store still reads the
correct value demonstrates that everything is working fine now.

llvm-svn: 242073

9 years agoReduce memory usage of ComputeEditDistance() by (almost) 50%
Nico Weber [Mon, 13 Jul 2015 21:33:21 +0000 (21:33 +0000)]
Reduce memory usage of ComputeEditDistance() by (almost) 50%

ComputeEditDistance() currently keeps two rows of the edit distance matrix in
memory.  That's unnecessary, one row plus one additional element are sufficient.
With this change, strings up to 64 chars can be processed without going to the
heap, compared to 32 chars previously.  (But the main motivation is that the
code gets a bit simpler.)

No intended behavior change.

llvm-svn: 242069

9 years agoLoop idiom recognizer was replacing too many uses of popcount.
Pete Cooper [Mon, 13 Jul 2015 21:25:33 +0000 (21:25 +0000)]
Loop idiom recognizer was replacing too many uses of popcount.

When spotting that a loop can use ctpop, we were incorrectly replacing all uses of a value with a value derived from ctpop.

The bug here was exposed because we were replacing a use prior to the ctpop with the ctpop value and so we have a use before def, i.e., we changed

 %tobool.5 = icmp ne i32 %num, 0
 store i1 %tobool.5, i1* %ptr
 br i1 %tobool.5, label %for.body.lr.ph, label %for.end

to

 store i1 %1, i1* %ptr
 %0 = call i32 @llvm.ctpop.i32(i32 %num)
 %1 = icmp ne i32 %0, 0
 br i1 %1, label %for.body.lr.ph, label %for.end

Even if we inserted the ctpop so that it dominates the store here, that would still be incorrect.  The store doesn’t want the result of ctpop.

The fix is very simple, and involves replacing only the branch condition with the ctpop instead of all uses.

Reviewed by Hal Finkel.

llvm-svn: 242068

9 years agoclang/test/Driver/cuda-options.cu REQUIRES clang-driver, at least.
NAKAMURA Takumi [Mon, 13 Jul 2015 21:18:53 +0000 (21:18 +0000)]
clang/test/Driver/cuda-options.cu REQUIRES clang-driver, at least.

llvm-svn: 242067

9 years agoCOFF: Split createSymbolAndSymbolTable to small functions. NFC.
Rui Ueyama [Mon, 13 Jul 2015 20:56:31 +0000 (20:56 +0000)]
COFF: Split createSymbolAndSymbolTable to small functions. NFC.

llvm-svn: 242066

9 years agoFixed regex to properly match '64' in the test case.
Artem Belevich [Mon, 13 Jul 2015 20:49:50 +0000 (20:49 +0000)]
Fixed regex to properly match '64' in the test case.

llvm-svn: 242065

9 years agoMove class into an anonymous namespace. NFC.
Benjamin Kramer [Mon, 13 Jul 2015 20:42:13 +0000 (20:42 +0000)]
Move class into an anonymous namespace. NFC.

llvm-svn: 242064

9 years ago[WinEH] Emit the LSDA even if no lpads remain but outlining occurred
Reid Kleckner [Mon, 13 Jul 2015 20:41:46 +0000 (20:41 +0000)]
[WinEH] Emit the LSDA even if no lpads remain but outlining occurred

The outlined funclets call intrinsics which reference labels from the
LSDA. This situation can easily arise in small functions with a single
cleanup at -O0, where Clang marks a definition as nounwind, and then
WinEHPrepare "discovers" that the landingpad is dead by accident and
deletes it.

We now need to ask the LLVM IR Function for it's personality directly,
rather than going through MachineModuleInfo.

Fixes PR23892.

llvm-svn: 242063

9 years ago[Hexagon] Move BitTracker into the llvm namespace and remove redundant qualifications
Benjamin Kramer [Mon, 13 Jul 2015 20:38:16 +0000 (20:38 +0000)]
[Hexagon] Move BitTracker into the llvm namespace and remove redundant qualifications

No functional change intended.

llvm-svn: 242062

9 years agoAdd support deterministic output in llvm-ar and make it the default.
Rafael Espindola [Mon, 13 Jul 2015 20:38:09 +0000 (20:38 +0000)]
Add support deterministic output in llvm-ar and make it the default.

llvm-svn: 242061

9 years agoRevert "[CMake] Cleanup tools/CMakeLists.txt to take advantage of the auto-registrati...
Chris Bieneman [Mon, 13 Jul 2015 20:30:58 +0000 (20:30 +0000)]
Revert "[CMake] Cleanup tools/CMakeLists.txt to take advantage of the auto-registration that was already partially working."

Reverting r242059 because it broke some bots. I'm attempting to reproduce the failures now.

llvm-svn: 242060

9 years ago[CMake] Cleanup tools/CMakeLists.txt to take advantage of the auto-registration that...
Chris Bieneman [Mon, 13 Jul 2015 20:23:15 +0000 (20:23 +0000)]
[CMake] Cleanup tools/CMakeLists.txt to take advantage of the auto-registration that was already partially working.

Summary:
This change re-lands r241621, with an additional fix that was required to allow tool sources to live outside the llvm checkout. It also no longer renames LLVM_EXTERNAL_*_SOURCE_DIR. This change was reverted in r241663, because it renamed several variables of the format LLVM_EXTERNAL_*_* to LLVM_TOOL_*_*.

Original Summary:
The tools CMakeLists file already had implicit tool registration, but there were a few things off about it that needed to be altered to make it work. This change addresses all that. The changes in this patch are:

* factored out canonicalizing tool names from paths to CMake variables * removed the LLVM_IMPLICIT_PROJECT_IGNORE mechanism in favor of LLVM_EXTERNAL_${nameUPPER}_BUILD which I renamed to LLVM_TOOL_${nameUPPER}_BUILD because it applies to internal and external tools
* removed ignore_llvm_tool_subdirectory() in favor of just setting LLVM_TOOL_${nameUPPER}_BUILD to Off
* Added create_llvm_tool_options() to resolve a bug in add_llvm_external_project() - the old LLVM_EXTERNAL_${nameUPPER}_BUILD would not work on a clean CMake directory because the option could be created after it was set in code.
* Removed all but the minimum required calls to add_llvm_external_project from tools/CMakeLists.txt

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

llvm-svn: 242059

9 years ago[cuda] Driver changes to compile and stitch together host and device-side CUDA code.
Artem Belevich [Mon, 13 Jul 2015 20:21:06 +0000 (20:21 +0000)]
[cuda] Driver changes to compile and stitch together host and device-side CUDA code.

  - Changed driver pipeline to compile host and device side of CUDA
    files and incorporate results of device-side compilation into host
    object file.

  - Added a test for cuda pipeline creation in clang driver.

  New clang options:
  --cuda-host-only   - Do host-side compilation only.
  --cuda-device-only - Do device-side compilation only.

  --cuda-gpu-arch=<ARCH> - specify GPU architecture for device-side
    compilation. E.g. sm_35, sm_30. Default is sm_20. May be used more
    than once in which case one device-compilation will be done per
    unique specified GPU architecture.

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

llvm-svn: 242058

9 years ago[lldb-mi] Add const qualifier to vMITextLine in InterpretCommandThisDriver.
Dawn Perchik [Mon, 13 Jul 2015 20:16:13 +0000 (20:16 +0000)]
[lldb-mi] Add const qualifier to vMITextLine in InterpretCommandThisDriver.

llvm-svn: 242057

9 years agoImplement the first part of N4258: 'Cleaning up noexcept in the Library'. This patch...
Marshall Clow [Mon, 13 Jul 2015 20:04:56 +0000 (20:04 +0000)]
Implement the first part of N4258: 'Cleaning up noexcept in the Library'. This patch deals with swapping containers, and implements a more strict noexcept specification (a conforming extension) than the standard mandates.

llvm-svn: 242056

9 years ago[Modules] Allow missing header before a missing requirement
Ben Langmuir [Mon, 13 Jul 2015 19:48:52 +0000 (19:48 +0000)]
[Modules] Allow missing header before a missing requirement

And make the module unavailable without breaking any parent modules.

If there's a missing requirement after we've already seen a missing
header, still update the IsMissingRequiement bit correctly.  Also,
diagnose missing requirements before missing headers, since the
existence of the header is moot if there are missing requirements.

llvm-svn: 242055

9 years ago[CMake] Add missing DebugInfo libraries to llvm-shlib
Keno Fischer [Mon, 13 Jul 2015 19:41:51 +0000 (19:41 +0000)]
[CMake] Add missing DebugInfo libraries to llvm-shlib

Reviewers: beanz

Subscribers: llvm-commits

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

llvm-svn: 242054

9 years agoAMDGPU: Minor cleanups to always inline pass
Matt Arsenault [Mon, 13 Jul 2015 19:08:36 +0000 (19:08 +0000)]
AMDGPU: Minor cleanups to always inline pass

llvm-svn: 242053

9 years agoFix some bugs in OMPT support
Jonathan Peyton [Mon, 13 Jul 2015 18:55:45 +0000 (18:55 +0000)]
Fix some bugs in OMPT support

1.) in kmp_csupport.c, move computation of parameters only needed for OMPT tracing
inside a conditional to reduce overhead if not receiving ompt_event_master_begin
callbacks.
2.) in kmp_gsupport.c, remove spurious reset of OMPT reenter_runtime_frame (which
is set in its caller, GOMP_parallel_start correct placement of #if OMP_TRACE so
that state is maintained even if tracing support not included.
3.) in z_Linux_util.c, add architecture independent support for OMPT by setting
and resetting OMPT's exit_frame_ptr before and after invoking a microtask.
4.) On the Intel MIC, the loader refuses to retain static symbols in the
libomp.so shared library, even though tools need them. The loader could not be
bullied into doing so. To accommodate this, I changed the visibility of OMPT
placeholder functions to public. This required additions in exports.so.txt,
adding extern "C" scoping in ompt-general.c so that the public placeholder
symbols won't be mangled.

Patch by John Mellor-Crummey

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

llvm-svn: 242052

9 years agoclang-cl: For files setting output names, mention which flags they belong to.
Nico Weber [Mon, 13 Jul 2015 18:54:56 +0000 (18:54 +0000)]
clang-cl: For files setting output names, mention which flags they belong to.

It always takes me a while to figure out how to say "preprocess to file
foo.txt" with clang-cl. With this, it might be easier.
http://reviews.llvm.org/D10890

llvm-svn: 242051

9 years ago[MC] Correctly escape .safeseh's symbol
David Majnemer [Mon, 13 Jul 2015 18:51:15 +0000 (18:51 +0000)]
[MC] Correctly escape .safeseh's symbol

This fixes PR24107.

llvm-svn: 242050

9 years agoEnable partial and runtime loop unrolling for NVPTX.
Mark Heffernan [Mon, 13 Jul 2015 18:33:21 +0000 (18:33 +0000)]
Enable partial and runtime loop unrolling for NVPTX.

Enable partial and runtime loop unrolling for NVPTX backend via
TTI::UnrollingPreferences with a small threshold. This partially unrolls
small loops which are often unrolled by the PTX to SASS compiler
and unrolling earlier can be beneficial.

llvm-svn: 242049

9 years agoUpdate documentation for unroll pragmas on loops with runtime trip counts.
Mark Heffernan [Mon, 13 Jul 2015 18:31:37 +0000 (18:31 +0000)]
Update documentation for unroll pragmas on loops with runtime trip counts.

This change updates the documentation for the loop unrolling pragma behavior
change in r242047. Specifically, with that change "#pragma unroll" will not
unroll loops with a runtime trip count.

llvm-svn: 242048

9 years agoEnable runtime unrolling with unroll pragma metadata
Mark Heffernan [Mon, 13 Jul 2015 18:26:27 +0000 (18:26 +0000)]
Enable runtime unrolling with unroll pragma metadata

Enable runtime unrolling for loops with unroll count metadata ("#pragma unroll N")
and a runtime trip count. Also, do not unroll loops with unroll full metadata if the
loop has a runtime loop count. Previously, such loops would be unrolled with a
very large threshold (pragma-unroll-threshold) if runtime unrolled happened to be
enabled resulting in a very large (and likely unwise) unroll factor.

llvm-svn: 242047

9 years agoService the doxygen comments in DwarfUnit and DwarfDebug.
Adrian Prantl [Mon, 13 Jul 2015 18:25:29 +0000 (18:25 +0000)]
Service the doxygen comments in DwarfUnit and DwarfDebug.

llvm-svn: 242046

9 years agoMIR Serialization: Serialize the fixed stack objects.
Alex Lorenz [Mon, 13 Jul 2015 18:07:26 +0000 (18:07 +0000)]
MIR Serialization: Serialize the fixed stack objects.

This commit serializes the fixed stack objects, including fixed spill slots.
The fixed stack objects are serialized using a YAML sequence of YAML inline
mappings. Each mapping has the object's ID, type, size, offset, and alignment.
The objects that aren't spill slots also serialize the isImmutable and isAliased
flags.

The fixed stack objects are a part of the machine function's YAML mapping.

Reviewers: Duncan P. N. Exon Smith
llvm-svn: 242045

9 years ago[WinEH] Strip the \01 character from the __CxxFrameHandler3 thunk name
Reid Kleckner [Mon, 13 Jul 2015 17:55:14 +0000 (17:55 +0000)]
[WinEH] Strip the \01 character from the __CxxFrameHandler3 thunk name

Add another C++ 32-bit EH table test.

llvm-svn: 242044

9 years agofixed typo in debug assertion reported by John Mellor-Crummey
Andrey Churbanov [Mon, 13 Jul 2015 17:52:41 +0000 (17:52 +0000)]
fixed typo in debug assertion reported by John Mellor-Crummey

llvm-svn: 242043

9 years agoRemove macro guards for extern template instantiations.
Benjamin Kramer [Mon, 13 Jul 2015 17:21:31 +0000 (17:21 +0000)]
Remove macro guards for extern template instantiations.

This is a C++11 feature that both GCC and MSVC have supported as ane extension
long before C++11 was approved.

llvm-svn: 242042