platform/upstream/llvm.git
9 years ago[Modules] Be consistent about finding a module for framework headers
Ben Langmuir [Thu, 2 Jul 2015 13:19:48 +0000 (13:19 +0000)]
[Modules] Be consistent about finding a module for framework headers

We use findModuleForHeader() in several places, but in header search we
were not calling it when a framework module didn't show up with the
expected name, which would then lead to unexpected non-modular includes.
Now we will find the module unconditionally for frameworks.  For regular
frameworks, we use the spelling of the module name from the module map
file, and for inferred ones we use the canonical directory name.

In the future we might want to lock down framework modules sufficiently
that these name mismatches cannot happen.

rdar://problem/20465870

llvm-svn: 241258

9 years agoclang-format: [JS] Fix character counting in template strings.
Daniel Jasper [Thu, 2 Jul 2015 13:08:28 +0000 (13:08 +0000)]
clang-format: [JS] Fix character counting in template strings.

Some counts were off, we don't need to take the leading newlines of the
first ` into account and some tests were just wrong.

llvm-svn: 241257

9 years agoImplement an AST matcher for C++ exception catch handlers that can catch any exceptio...
Aaron Ballman [Thu, 2 Jul 2015 12:53:22 +0000 (12:53 +0000)]
Implement an AST matcher for C++ exception catch handlers that can catch any exception type (...).

llvm-svn: 241256

9 years agoImprove error message.
Rafael Espindola [Thu, 2 Jul 2015 11:48:48 +0000 (11:48 +0000)]
Improve error message.

Thanks to Sean Silva for the suggestion.

llvm-svn: 241255

9 years agoReapply r240291: Fix shl folding in DAG combiner.
Pawel Bylica [Thu, 2 Jul 2015 11:44:54 +0000 (11:44 +0000)]
Reapply r240291: Fix shl folding in DAG combiner.

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.

It has been reverted previously because of some problems with comparing APInt with raw uint64_t. That has been fixed/changed with r241204.

llvm-svn: 241254

9 years ago[OPENMP 4.0] Initial support for 'omp cancel' construct.
Alexey Bataev [Thu, 2 Jul 2015 11:25:17 +0000 (11:25 +0000)]
[OPENMP 4.0] Initial support for 'omp cancel' construct.

Implemented parsing/sema analysis + (de)serialization.

llvm-svn: 241253

9 years agoAdd new bugreport command to lldb
Tamas Berghammer [Thu, 2 Jul 2015 10:03:37 +0000 (10:03 +0000)]
Add new bugreport command to lldb

The new command add functionality to print out domain specific
information for reporting a bug. Currently the only supported
domain is stack unwinding (with "bugreport unwind") but adding
new domains is fairly easy.

Differential revision: http://reviews.llvm.org/D10868

llvm-svn: 241252

9 years ago[MS ABI] nullptr data member ptrs are mangled differently for classes vs fns
David Majnemer [Thu, 2 Jul 2015 09:43:11 +0000 (09:43 +0000)]
[MS ABI] nullptr data member ptrs are mangled differently for classes vs fns

It turns out that nullptr pointers to data members act differently in
function templates vs class templates.  Class templates use a variable
width representation proportional to the number of fields needed to
materialize it.  Function templates always use a single '0' template
parameter.  However, using '0' all the time is problematic if the class
uses single or multiple inheritance.  In those cases, use -1.

llvm-svn: 241251

9 years ago[GraphWriter] Don't wait on xdg-open when not on Apple.
Charlie Turner [Thu, 2 Jul 2015 09:32:07 +0000 (09:32 +0000)]
[GraphWriter] Don't wait on xdg-open when not on Apple.

By default, the GraphWriter code assumes that the generic file open
program (`open` on Apple, `xdg-open` on other systems) can wait on the
forked proces to complete. When the fork ends, the code would delete
the temporary dot files created, and return.

On GNU/Linux, the xdg-open program does not have a "wait for your fork
to complete before dying" option. So the behaviour was that xdg-open
would launch a process, quickly die itself, and then the GraphWriter
code would think its OK to quickly delete all the temporary files.
Once the temporary files were deleted, the dot viewers would get very
upset, and often give you weird errors.

This change only waits on the generic open program on Apple platforms.
Elsewhere, we don't wait on the process, and hence we don't try and
clean up the temporary files.

llvm-svn: 241250

9 years ago[NFC] Minor editorial fixes to the CodeGen docs.
Charlie Turner [Thu, 2 Jul 2015 09:32:01 +0000 (09:32 +0000)]
[NFC] Minor editorial fixes to the CodeGen docs.

llvm-svn: 241249

9 years agoSpecify --target, hopefully fixing non-x86 bots.
Peter Collingbourne [Thu, 2 Jul 2015 09:10:31 +0000 (09:10 +0000)]
Specify --target, hopefully fixing non-x86 bots.

llvm-svn: 241248

9 years agoUpdate isl to isl-0.15-35-ga1e44f0
Tobias Grosser [Thu, 2 Jul 2015 07:59:21 +0000 (07:59 +0000)]
Update isl to isl-0.15-35-ga1e44f0

This fixes a memory leak with in the sioimath backend.

llvm-svn: 241247

9 years agoRemove versions from README and add update instructions
Tobias Grosser [Thu, 2 Jul 2015 07:59:16 +0000 (07:59 +0000)]
Remove versions from README and add update instructions

llvm-svn: 241246

9 years ago[clang-tidy] Enhance clang-tidy misc-macro-repeated-side-effects...
Daniel Marjamaki [Thu, 2 Jul 2015 07:49:55 +0000 (07:49 +0000)]
[clang-tidy] Enhance clang-tidy misc-macro-repeated-side-effects...

Enhance clang-tidy misc-macro-repeated-side-effects to handle ? and : better.

When ? is used in a macro, there are 2 possible control flow paths through the macro.
These paths are tracked separately so problems can be detected properly.

http://reviews.llvm.org/D10653

llvm-svn: 241245

9 years agoRevert 241171, 241187, 241199 (32-bit SEH).
Nico Weber [Thu, 2 Jul 2015 06:10:53 +0000 (06:10 +0000)]
Revert 241171, 241187, 241199 (32-bit SEH).

It still doesn't produce quite the right code, test binaries built with this
enabled fail some tests.

llvm-svn: 241244

9 years agoParse 'technical term' format specifier.
Ted Kremenek [Thu, 2 Jul 2015 05:39:16 +0000 (05:39 +0000)]
Parse 'technical term' format specifier.

Objective-C format strings now support modifier flags
that can be attached to a '@' conversion.  Currently
the only one supported, as of iOS 9 and OS X 10.11,
is the new "technical term", denoted by the flag "tt",
for example:

  %[tt]@

instead of just:

  %@

The 'tt' stands for "technical term", which is used
by the string-localization facilities on Darwin to
add the appropriate spacing or quotation depending
the language locale.

Implements <rdar://problem/20374720>.

llvm-svn: 241243

9 years agoChange OptionalFlag::setPosition() to set the flag as well.
Ted Kremenek [Thu, 2 Jul 2015 05:39:10 +0000 (05:39 +0000)]
Change OptionalFlag::setPosition() to set the flag as well.

This change reduces some unnecessary boilerplate
since all calls to 'setPosition' are currently paired
with setting the flag of OptionalFlag.

No functionality change.

llvm-svn: 241242

9 years agoSupport mingw-w64 and mingw.org toolchains at any install location.
Yaron Keren [Thu, 2 Jul 2015 04:45:27 +0000 (04:45 +0000)]
Support mingw-w64 and mingw.org toolchains at any install location.

No more hardcoded paths: clang will use -sysroot as gcc root location if
provided. Otherwise, it will search for gcc on the path. If not found it
will use the driver installed location.

 http://reviews.llvm.org/D5268

Patch by Ruben Van Boxem, Martell Malone, Yaron Keren.
Reviewed by Reid Kleckner.

llvm-svn: 241241

9 years ago[OPENMP 4.0] Fixed test for 'cancellation point' directive.
Alexey Bataev [Thu, 2 Jul 2015 04:36:13 +0000 (04:36 +0000)]
[OPENMP 4.0] Fixed test for 'cancellation point' directive.

Added explicit target to pch test

llvm-svn: 241240

9 years ago[OPENMP 4.0] Codegen for 'cancellation point' directive.
Alexey Bataev [Thu, 2 Jul 2015 04:17:07 +0000 (04:17 +0000)]
[OPENMP 4.0] Codegen for 'cancellation point' directive.

The next code is generated for this construct:
```
if (__kmpc_cancellationpoint(ident_t *loc, kmp_int32 global_tid, kmp_int32 cncl_kind) != 0)
  <exit from outer innermost construct>;
```

llvm-svn: 241239

9 years agoCOFF: Merge SymbolTable::find{,Symbol}. NFC
Rui Ueyama [Thu, 2 Jul 2015 03:59:04 +0000 (03:59 +0000)]
COFF: Merge SymbolTable::find{,Symbol}. NFC

llvm-svn: 241238

9 years ago[OPENMP] Introduced type trait "__builtin_omp_required_simd_align" for default simd...
Alexey Bataev [Thu, 2 Jul 2015 03:40:19 +0000 (03:40 +0000)]
[OPENMP] Introduced type trait "__builtin_omp_required_simd_align" for default simd alignment.

Adds type trait "__builtin_omp_required_simd_align" after discussions here http://reviews.llvm.org/D9894
Differential Revision: http://reviews.llvm.org/D10597

llvm-svn: 241237

9 years agoCOFF: Infer entry point as early as possible, but not too early.
Rui Ueyama [Thu, 2 Jul 2015 03:15:15 +0000 (03:15 +0000)]
COFF: Infer entry point as early as possible, but not too early.

On Windows, we have four different main functions, {w,}{main,WinMain}.
The linker has to choose a corresponding entry point function among
{w,}{main,WinMain}CRTStartup. These entry point functions are defined
in the standard library. The linker resolves one of them by looking at
which main function is defined and adding a corresponding undefined
symbol to the symbol table.

Object files containing entry point functions conflicts each other.
For example, we cannot resolve both mainCRTStartup and WinMainCRTStartup
because other symbols defined in the files conflict.

Previously, we inferred CRT function name at the very end of name
resolution. I found that that is sometimes too late. If the linker
already linked one of these four archive member objects, it's too late
to change the decision.

The right thing to do here is to infer entry point name after adding
all symbols from command line files and before adding any other files
(which are specified by directive sections). This patch does that.

llvm-svn: 241236

9 years ago[NFC] Make the Statepoint class more like CallSite
Sanjoy Das [Thu, 2 Jul 2015 02:53:45 +0000 (02:53 +0000)]
[NFC] Make the Statepoint class more like CallSite

Summary: Rename some methods to make Statepoint look more like CallSite.

Subscribers: llvm-commits

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

llvm-svn: 241235

9 years ago[Statepoints][NFC] Constify accessors on Statepoint.
Sanjoy Das [Thu, 2 Jul 2015 02:53:41 +0000 (02:53 +0000)]
[Statepoints][NFC] Constify accessors on Statepoint.

Subscribers: llvm-commits

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

llvm-svn: 241234

9 years ago[Statepoints][NFC] Rename variables to llvm style.
Sanjoy Das [Thu, 2 Jul 2015 02:53:39 +0000 (02:53 +0000)]
[Statepoints][NFC] Rename variables to llvm style.

Summary:
(I don't think this change needs review, this was uploaded to
phabricator to provide context for later dependent changes.)

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

llvm-svn: 241233

9 years ago[Statepoints][NFC] Add Statepoint::operator bool()
Sanjoy Das [Thu, 2 Jul 2015 02:53:36 +0000 (02:53 +0000)]
[Statepoints][NFC] Add Statepoint::operator bool()

Summary:
This allows the "if (Statepoint SP = Statepoint(I))" idiom.

(I don't think this change needs review, this was uploaded to
phabricator to provide context for later dependent changes.)

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

llvm-svn: 241232

9 years ago[Statepoints][NFC] Add Statepoint::getGCResult.
Sanjoy Das [Thu, 2 Jul 2015 02:53:34 +0000 (02:53 +0000)]
[Statepoints][NFC] Add Statepoint::getGCResult.

Summary:
Introduce a simple accessor to get the gc_result hanging off of a
statepoint.

(I don't think this change needs review, this was uploaded to
phabricator to provide context for later dependent changes.)

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

llvm-svn: 241231

9 years agoCOFF: Resolve AlternateNames using weak aliases.
Rui Ueyama [Thu, 2 Jul 2015 02:38:59 +0000 (02:38 +0000)]
COFF: Resolve AlternateNames using weak aliases.

Previously, we use SymbolTable::rename to resolve AlternateName symbols.
This patch is to merge that mechanism with weak aliases, so that we
remove that function.

llvm-svn: 241230

9 years agoSpecify -arch:IA32. Should fix hexagon bot.
Peter Collingbourne [Thu, 2 Jul 2015 02:14:50 +0000 (02:14 +0000)]
Specify -arch:IA32. Should fix hexagon bot.

llvm-svn: 241229

9 years agoMake getArchNameForCompilerRTLib return the right thing on 32-bit Windows. Fixes...
Peter Collingbourne [Thu, 2 Jul 2015 02:07:43 +0000 (02:07 +0000)]
Make getArchNameForCompilerRTLib return the right thing on 32-bit Windows. Fixes the tests there.

llvm-svn: 241228

9 years agoAdd declaration of _ReadWriteBarrier. Fixes build of asan tests on Windows.
Peter Collingbourne [Thu, 2 Jul 2015 02:06:59 +0000 (02:06 +0000)]
Add declaration of _ReadWriteBarrier. Fixes build of asan tests on Windows.

llvm-svn: 241227

9 years ago[LazyCallGraph] Port test case from r240039 to LCG.
Sanjoy Das [Thu, 2 Jul 2015 02:03:58 +0000 (02:03 +0000)]
[LazyCallGraph] Port test case from r240039 to LCG.

Summary:
r240039 adds a test case to check that CallGraph does the right thing
with respect to non-leaf intrinsics like statepoint and patchpoint.
This ports the same test case to LazyCallGraph.  LazyCallGraph already
does the right thing with respect to escaping function pointers so there
is no need to change any code.

Reviewers: chandlerc

Subscribers: llvm-commits

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

llvm-svn: 241226

9 years agoDriver: add support for linking the UBSan runtime library on Windows.
Peter Collingbourne [Thu, 2 Jul 2015 01:48:12 +0000 (01:48 +0000)]
Driver: add support for linking the UBSan runtime library on Windows.

On Windows the user may invoke the linker directly, so we might not have an
opportunity to add runtime library flags to the linker command line. Instead,
instruct the code generator to embed linker directive in the object file
that cause the required runtime libraries to be linked.

We might also want to do something similar for ASan, but it seems to have
its own special complexities which may make this infeasible.

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

llvm-svn: 241225

9 years agoRe-apply r241217 with build fixes:
Peter Collingbourne [Thu, 2 Jul 2015 01:44:34 +0000 (01:44 +0000)]
Re-apply r241217 with build fixes:

- Disable building of the interceptor library on 64-bit Windows.
- Mangle names in /alternatename directive for 32-bit Windows.

llvm-svn: 241224

9 years agoMake an X86 specific directory and put the recent X86 tti specific
Eric Christopher [Thu, 2 Jul 2015 01:36:31 +0000 (01:36 +0000)]
Make an X86 specific directory and put the recent X86 tti specific
inlining test into it.

llvm-svn: 241223

9 years agoChange executable name to a.out.
Chaoren Lin [Thu, 2 Jul 2015 01:26:39 +0000 (01:26 +0000)]
Change executable name to a.out.

Summary: The long name causes problems with some shells.

Reviewers: sivachandra

Subscribers: lldb-commits

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

llvm-svn: 241222

9 years agoImplement TargetTransformInfo::hasCompatibleFunctionAttributes for X86.
Eric Christopher [Thu, 2 Jul 2015 01:11:50 +0000 (01:11 +0000)]
Implement TargetTransformInfo::hasCompatibleFunctionAttributes for X86.

This checks subtarget feature compatibility for inlining by verifying
that the callee is a strict subset of the caller's features. This includes
the cpu as part of the subtarget we can get via the incoming functions as
the backend takes CPUs as feature sets.

This allows us to inline things like:

int foo() { return baz(); }

int __attribute__((target("sse4.2"))) bar() {
  return foo();
}

so that generic code can be inlined into specialized functions.

llvm-svn: 241221

9 years agoAdd a routine to TargetTransformInfo that will allow targets to look
Eric Christopher [Thu, 2 Jul 2015 01:11:47 +0000 (01:11 +0000)]
Add a routine to TargetTransformInfo that will allow targets to look
at the attributes on a function to determine whether or not to allow
inlining.

llvm-svn: 241220

9 years agoRevert r241217, it breaks the build on Windows.
Nico Weber [Thu, 2 Jul 2015 01:10:03 +0000 (01:10 +0000)]
Revert r241217, it breaks the build on Windows.

llvm-svn: 241219

9 years agoInstrProf: Pack the coverage mapping structs that we write out
Justin Bogner [Thu, 2 Jul 2015 00:42:32 +0000 (00:42 +0000)]
InstrProf: Pack the coverage mapping structs that we write out

When we read this data we treat it as unaligned and packed, so we
should really be explicit about that when we write it.

llvm-svn: 241218

9 years agoubsan: Port runtime library to (32- and 64-bit) Windows.
Peter Collingbourne [Thu, 2 Jul 2015 00:35:47 +0000 (00:35 +0000)]
ubsan: Port runtime library to (32- and 64-bit) Windows.

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

llvm-svn: 241217

9 years agoAnother slightly less goofy example of scripted steps.
Jim Ingham [Thu, 2 Jul 2015 00:24:17 +0000 (00:24 +0000)]
Another slightly less goofy example of scripted steps.

llvm-svn: 241216

9 years agoCOFF: Rename getReplacement -> repl.
Rui Ueyama [Thu, 2 Jul 2015 00:21:11 +0000 (00:21 +0000)]
COFF: Rename getReplacement -> repl.

The previous name was too long to my taste.

llvm-svn: 241215

9 years agoCOFF: Change GCRoot member type from StringRef to Undefined. NFC.
Rui Ueyama [Thu, 2 Jul 2015 00:21:08 +0000 (00:21 +0000)]
COFF: Change GCRoot member type from StringRef to Undefined. NFC.

I think Undefined symbols are a bit more convenient than StringRefs
since SymbolBodies are handles for symbols. You can get resolved
symbols for undefined symbols just by calling getReplacmenet without
looking up the symbol table.

llvm-svn: 241214

9 years agoCOFF: Simplify and rename findMangle. NFC.
Rui Ueyama [Thu, 2 Jul 2015 00:04:14 +0000 (00:04 +0000)]
COFF: Simplify and rename findMangle. NFC.

Occasionally we have to resolve an undefined symbol to its
mangled symbol. Previously, we did that on calling side of
findMangle by explicitly updating SymbolBody.
In this patch, mangled symbols are handled as weak aliases
for undefined symbols.

llvm-svn: 241213

9 years agoReversed r238363, because the message is inconsistent
Sean Callanan [Wed, 1 Jul 2015 23:56:30 +0000 (23:56 +0000)]
Reversed r238363, because the message is inconsistent
with all the other assertion messages.

llvm-svn: 241212

9 years agoWebAssembly: start instructions
JF Bastien [Wed, 1 Jul 2015 23:41:25 +0000 (23:41 +0000)]
WebAssembly: start instructions

Summary:
* Add 64-bit address space feature.
* Rename SIMD feature to SIMD128.
* Handle single-thread model with an IR pass (same way ARM does).
* Rename generic processor to MVP, to follow design's lead.
* Add bleeding-edge processors, with all features included.
* Fix a few DEBUG_TYPE to match other backends.

Test Plan: ninja check

Reviewers: sunfish

Subscribers: jfb, llvm-commits

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

llvm-svn: 241211

9 years agoCheck to make sure we have a valid N_GSYM symbol name before we use it for anything.
Greg Clayton [Wed, 1 Jul 2015 23:29:06 +0000 (23:29 +0000)]
Check to make sure we have a valid N_GSYM symbol name before we use it for anything.

llvm-svn: 241210

9 years agoFix indentation.
Greg Clayton [Wed, 1 Jul 2015 23:28:31 +0000 (23:28 +0000)]
Fix indentation.

llvm-svn: 241209

9 years ago[Python] Allow PyLong values in integer lists (when converting to C lists)
Siva Chandra [Wed, 1 Jul 2015 23:27:32 +0000 (23:27 +0000)]
[Python] Allow PyLong values in integer lists (when converting to C lists)

Test Plan: dotest.py -p TestSBData

Reviewers: clayborg, granata.enrico

Reviewed By: clayborg, granata.enrico

Subscribers: lldb-commits

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

llvm-svn: 241208

9 years ago[modules] Merging support for specializations of a function template. This very
Richard Smith [Wed, 1 Jul 2015 23:19:58 +0000 (23:19 +0000)]
[modules] Merging support for specializations of a function template. This very
rarely matters, but can affect whether two dependent types are canonically
equivalent.

llvm-svn: 241207

9 years ago[TwoAddressInstructionPass] Try 3 Addr Conversion After Commuting.
Quentin Colombet [Wed, 1 Jul 2015 23:12:13 +0000 (23:12 +0000)]
[TwoAddressInstructionPass] Try 3 Addr Conversion After Commuting.

TwoAddressInstructionPass stops after a successful commuting but 3 Addr
conversion might be good for some cases.

Consider:

int foo(int a, int b) {
  return a + b;
}

Before this commit, we emit:

addl %esi, %edi
movl %edi, %eax
ret

After this commit, we try 3 Addr conversion:

leal (%rsi,%rdi), %eax
ret

Patch by Volkan Keles <vkeles@apple.com>!

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

llvm-svn: 241206

9 years ago[modules] Remove some out-of-date (fixed) FIXMEs.
Richard Smith [Wed, 1 Jul 2015 23:10:03 +0000 (23:10 +0000)]
[modules] Remove some out-of-date (fixed) FIXMEs.

llvm-svn: 241205

9 years agoChange APInt comparison with uint64_t.
Pawel Bylica [Wed, 1 Jul 2015 22:56:43 +0000 (22:56 +0000)]
Change APInt comparison with uint64_t.

Summary:
This patch changes the way APInt is compared with a value of type uint64_t.
Before the uint64_t value was truncated to the size of APInt before comparison.
Now the comparison takes into account full 64-bit precision.

Test Plan: Unit tests added. No regressions. Self-hosted check-all done as well.

Reviewers: chandlerc, dexonsmith

Subscribers: llvm-commits

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

llvm-svn: 241204

9 years agoMark test_sb_api_listener_event_process_state as flakey
Ying Chen [Wed, 1 Jul 2015 22:50:28 +0000 (22:50 +0000)]
Mark test_sb_api_listener_event_process_state as flakey

llvm-svn: 241203

9 years agoRun teardown and setup before retry for expectedFlakey tests
Ying Chen [Wed, 1 Jul 2015 22:44:27 +0000 (22:44 +0000)]
Run teardown and setup before retry for expectedFlakey tests

Summary:
If test is decorated with expectedFlakey*, run teardown and setup before retry
Don't run retry if the test is already decorated with xfail or skip

Test Plan:
Mark TestMultithreaded.test_sb_api_listener_event_process_state as expectedFlakey
Run ./dotest.py -p TestMultithreaded.py -A x86_64 -C gcc4.9.2

Reviewers: vharron, tberghammer

Subscribers: lldb-commits

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

llvm-svn: 241202

9 years ago[analyzer] Prevent ccc/c++-analyzer from hanging on Windows.
Anton Yartsev [Wed, 1 Jul 2015 22:35:29 +0000 (22:35 +0000)]
[analyzer] Prevent ccc/c++-analyzer from hanging on Windows.

'fork'+'exec' combination made scan-build and ccc-analyzer hang under Windows. The patch replaces 'fork'+'exec' with more reliable 'system' (ccc-analyzer) and piped 'open' (scan-build). See http://reviews.llvm.org/D8774 and http://reviews.llvm.org/D9357 for more details.

llvm-svn: 241201

9 years agoTest for specific output in lit test
Matthias Braun [Wed, 1 Jul 2015 22:34:59 +0000 (22:34 +0000)]
Test for specific output in lit test

llvm-svn: 241200

9 years ago[SEH] Update EmitCapturedLocals to match r241187
Reid Kleckner [Wed, 1 Jul 2015 22:33:45 +0000 (22:33 +0000)]
[SEH] Update EmitCapturedLocals to match r241187

It was still using frameaddress(1) to get the parent FP, even though it
had the value it wanted as a parameter.

llvm-svn: 241199

9 years agoCOFF: Chagne weak alias' type from SymbolBody** to SymbolBody*. NFC.
Rui Ueyama [Wed, 1 Jul 2015 22:32:23 +0000 (22:32 +0000)]
COFF: Chagne weak alias' type from SymbolBody** to SymbolBody*. NFC.

llvm-svn: 241198

9 years ago[LoopVectorize] Use ReplaceInstWithInst() helper where appropriate.
Alexey Samsonov [Wed, 1 Jul 2015 22:18:30 +0000 (22:18 +0000)]
[LoopVectorize] Use ReplaceInstWithInst() helper where appropriate.

This is mostly an NFC, which increases code readability (instead of
saving old terminator, generating new one in front of old, and deleting
old, we just call a function). However, it would additionaly copy
the debug location from old instruction to replacement, which
would help PR23837.

llvm-svn: 241197

9 years agoPack MCSymbol::Flags in to the bitfield with other members. NFC.
Pete Cooper [Wed, 1 Jul 2015 21:57:51 +0000 (21:57 +0000)]
Pack MCSymbol::Flags in to the bitfield with other members.  NFC.

All file formats only needed 16-bits right now which is enough to fit
in to the padding with other fields.

This reduces the size of MCSymbol to 24-bytes on a 64-bit system.  The
layout is now

   0 | class llvm::MCSymbol
   0 |   class llvm::PointerIntPair SectionOrFragmentAndHasName
   0 |     intptr_t Value
     |   [sizeof=8, dsize=8, align=8
     |    nvsize=8, nvalign=8]

   8 |   unsigned int IsTemporary
   8 |   unsigned int IsRedefinable
   8 |   unsigned int IsUsed
   8 |   _Bool IsRegistered
   8 |   unsigned int IsExternal
   8 |   unsigned int IsPrivateExtern
   8 |   unsigned int Kind
   9 |   unsigned int IsUsedInReloc
   9 |   unsigned int SymbolContents
   9 |   unsigned int CommonAlignLog2
  10 |   uint32_t Flags
  12 |   uint32_t Index
  16 |   union
  16 |     uint64_t Offset
  16 |     uint64_t CommonSize
  16 |     const class llvm::MCExpr * Value
     |   [sizeof=8, dsize=8, align=8
     |    nvsize=8, nvalign=8]

     | [sizeof=24, dsize=24, align=8
     |  nvsize=24, nvalign=8]

llvm-svn: 241196

9 years ago[Sema] Range-loopify InititializationSequence destructor. NFC intended.
Davide Italiano [Wed, 1 Jul 2015 21:51:58 +0000 (21:51 +0000)]
[Sema] Range-loopify InititializationSequence destructor. NFC intended.

llvm-svn: 241195

9 years ago[ELF] Make OutputSection::memSize `const` member function. NFC
Simon Atanasyan [Wed, 1 Jul 2015 21:44:55 +0000 (21:44 +0000)]
[ELF] Make OutputSection::memSize `const` member function. NFC

llvm-svn: 241194

9 years ago[WebAssembly] Define separate Target instances for 32-bit and 64-bit.
Dan Gohman [Wed, 1 Jul 2015 21:42:34 +0000 (21:42 +0000)]
[WebAssembly] Define separate Target instances for 32-bit and 64-bit.

llvm-svn: 241193

9 years ago[ELF/AArch64] Initial General-dynamic TLS support
Adhemerval Zanella [Wed, 1 Jul 2015 21:35:39 +0000 (21:35 +0000)]
[ELF/AArch64] Initial General-dynamic TLS support

This patch adds initial general-dynamic TLS support for AArch64.  Currently
no optimization is done to realx for more performance-wise models (initial-exec
or local-exec).  This patch also only currently handles correctly executable
generation, although priliminary DSO support through PLT specific creation
is also added.

With this change clang/llvm bootstrap with lld is possible in static configuration
(some DSO creation fails due missing Linker script support, not AArch64 specific),
although make check also shows some issues.

llvm-svn: 241192

9 years ago[NVPTX] expand extload/truncstore for vectors of floats
Jingyue Wu [Wed, 1 Jul 2015 21:32:42 +0000 (21:32 +0000)]
[NVPTX] expand extload/truncstore for vectors of floats

Summary:
According to PTX ISA:

For convenience, ld, st, and cvt instructions permit source and destination data operands to be wider than the instruction-type size, so that narrow values may be loaded, stored, and converted using regular-width registers. For example, 8-bit or 16-bit values may be held directly in 32-bit or 64-bit registers when being loaded, stored, or converted to other types and sizes. The operand type checking rules are relaxed for bit-size and integer (signed and unsigned) instruction types; floating-point instruction types still require that the operand type-size matches exactly, unless the operand is of bit-size type.

So, the ISA does not support load with extending/store with truncatation for floating numbers. This is reflected in setting the loadext/truncstore actions to expand in the code for floating numbers, but vectors of floating numbers are not taken care of.

As a result, loading a vector of floats followed by a fp_extend may be combined by DAGCombiner to a extload, and the extload may be lowered to NVPTXISD::LoadV2 with extending information. However, NVPTXISD::LoadV2 does not perform extending, and no extending instructions are inserted. Finally, PTX instructions with mismatched types are generated, like
ld.v2.f32 {%fd3, %fd4}, [%rd2]

This patch adds the correct actions for vectors of floats, so DAGCombiner would not create loads with extending, and correct code is generated.

Patched by Gang Hu.

Test Plan: Test case attached.

Reviewers: jingyue

Reviewed By: jingyue

Subscribers: llvm-commits, jholewinski

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

llvm-svn: 241191

9 years agoNoticed that std::allocator<const T> was missing the definition for is_always_equal...
Marshall Clow [Wed, 1 Jul 2015 21:23:40 +0000 (21:23 +0000)]
Noticed that std::allocator<const T> was missing the definition for is_always_equal. Fixed this, and added a test for it.

llvm-svn: 241190

9 years agoEncode MCSymbol alignment as log2(align).
Pete Cooper [Wed, 1 Jul 2015 21:07:03 +0000 (21:07 +0000)]
Encode MCSymbol alignment as log2(align).

Given that alignments are always powers of 2, just encode it this way.

This matches how we encode alignment on IR GlobalValue's for example.

This compresses the CommonAlign member down to 5 bits which allows it
to pack better with the surrounding fields.

Reviewed by Duncan Exon Smith.

llvm-svn: 241189

9 years agoclang-format: Support member function reference qualifiers with
Daniel Jasper [Wed, 1 Jul 2015 21:02:24 +0000 (21:02 +0000)]
clang-format: Support member function reference qualifiers with
trailing return types.

Before:
  template <typename T>
      auto x() & -> int {}

After:
  template <typename T>
  auto x() & -> int {}

llvm-svn: 241188

9 years ago[SEH] Delete the 32-bit IR lowering for __finally blocks and use x64
Reid Kleckner [Wed, 1 Jul 2015 21:00:00 +0000 (21:00 +0000)]
[SEH] Delete the 32-bit IR lowering for __finally blocks and use x64

32-bit finally funclets are intended to be called both directly from the
parent function and indirectly from the EH runtime. Because we aren't
contorting LLVM's X86 prologue to match MSVC's, calling the finally
block directly passes in a different value of EBP than the one that the
runtime provides. We need an adapter thunk to adjust EBP to the expected
value. However, WinEHPrepare already has to solve this problem when
cleanups are not pre-outlined, so we can go ahead and rely on it rather
than duplicating work.

Now we only do the llvm.x86.seh.recoverfp dance for 32-bit SEH filter
functions.

llvm-svn: 241187

9 years ago[WinEH] Use llvm.x86.seh.recoverfp in WinEHPrepare
Reid Kleckner [Wed, 1 Jul 2015 20:59:25 +0000 (20:59 +0000)]
[WinEH] Use llvm.x86.seh.recoverfp in WinEHPrepare

Don't pattern match for frontend outlined finally calls on non-x64
platforms. The 32-bit runtime uses a different funclet prototype.  Now,
the frontend is pre-outlining the finally bodies so that it ends up
doing most of the heavy lifting for variable capturing. We're just
outlining the callsite, and adapting the frameaddress(0) call to line up
the frame pointer recovery.

llvm-svn: 241186

9 years ago[NVPTX] Move NVPTXPeephole after NVPTXPrologEpilogPass
Jingyue Wu [Wed, 1 Jul 2015 20:08:06 +0000 (20:08 +0000)]
[NVPTX] Move NVPTXPeephole after NVPTXPrologEpilogPass

Summary:
Offset of frame index is calculated by NVPTXPrologEpilogPass. Before
that the correct offset of stack objects cannot be obtained, which
leads to wrong offset if there are more than 2 frame objects. This patch
move NVPTXPeephole after NVPTXPrologEpilogPass. Because the frame index
is already replaced by %VRFrame in NVPTXPrologEpilogPass, we check
VRFrame register instead, and try to remove the VRFrame if there
is no usage after NVPTXPeephole pass.

Patched by Xuetian Weng.

Test Plan:
Strengthened test/CodeGen/NVPTX/local-stack-frame.ll to check the
offset calculation based on SP and SPL.

Reviewers: jholewinski, jingyue

Reviewed By: jingyue

Subscribers: jholewinski, llvm-commits

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

llvm-svn: 241185

9 years agoWhen I introduced hard-coded formatters, I made them non-cacheable
Enrico Granata [Wed, 1 Jul 2015 20:06:40 +0000 (20:06 +0000)]
When I introduced hard-coded formatters, I made them non-cacheable

This is because - in theory - the formatter could match on not just the type, but also other properties of a ValueObject, so a per-type caching would not be a good thing
On the other hand, that is not always true - sometimes the matching truly is per-type

So, introduce a non-cacheable attribute on formatters that decides whether a formatter should or should not be cached. That way, the few formatters that don't want themselves cached can do so, but most formatters (including most hard-coded ones) can cache themselves just fine

llvm-svn: 241184

9 years ago[PPC64LE] Enable missing lxvdsx optimization, and related swap optimization
Bill Schmidt [Wed, 1 Jul 2015 19:40:07 +0000 (19:40 +0000)]
[PPC64LE] Enable missing lxvdsx optimization, and related swap optimization

When adding little-endian vector support for PowerPC last year, I
inadvertently disabled an optimization that recognizes a load-splat
idiom and generates the lxvdsx instruction.  This patch moves the
offending logic so lxvdsx is once again generated.

This pattern is frequently generated by the vectorizer for scalar
loads of an effective constant.  Previously the lxvdsx instruction was
wrongly listed as lane-sensitive for the VSX swap optimization (since
both doublewords are identical, swaps are safe).  This patch fixes
this as well, so that vectorized code using lxvdsx can now have swaps
removed from the computation.

There is an existing test (@test50) in test/CodeGen/PowerPC/vsx.ll
that checks for the missing optimization.  However, vsx.ll was only
being tested for POWER7 with big-endian code generation.  I've added
a little-endian RUN statement and expected LE code generation for all
the tests in vsx.ll to give us a bit better VSX coverage, including
what's needed for this patch.

llvm-svn: 241183

9 years ago[modules] Don't make out-of-line member specializations of an instantiated
Richard Smith [Wed, 1 Jul 2015 19:32:54 +0000 (19:32 +0000)]
[modules] Don't make out-of-line member specializations of an instantiated
class template specialization visible just because the class template
specialization's definition is visible.

llvm-svn: 241182

9 years agoAdd a missing space.
Jim Ingham [Wed, 1 Jul 2015 19:27:08 +0000 (19:27 +0000)]
Add a missing space.

llvm-svn: 241181

9 years ago[modules] Skip trailing attributes when skipping a class definition during parse...
Richard Smith [Wed, 1 Jul 2015 18:56:50 +0000 (18:56 +0000)]
[modules] Skip trailing attributes when skipping a class definition during parse-merging.

llvm-svn: 241180

9 years agoadd a cl::opt override for TargetLoweringBase's JumpIsExpensive
Sanjay Patel [Wed, 1 Jul 2015 18:10:20 +0000 (18:10 +0000)]
add a cl::opt override for TargetLoweringBase's JumpIsExpensive

This patch is not intended to change existing codegen behavior for any target.
It just exposes the JumpIsExpensive setting on the command-line to allow for
easier testing and emergency overrides.

Also, change the existing regression test to use FileCheck, explicitly specify
the jump-is-expensive option, and use more precise checks.

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

llvm-svn: 241179

9 years agoDisallow in-source builds (as we already do for the cmake build).
Jonathan Roelofs [Wed, 1 Jul 2015 18:09:21 +0000 (18:09 +0000)]
Disallow in-source builds (as we already do for the cmake build).

http://reviews.llvm.org/D10614

llvm-svn: 241178

9 years agoRevert "[DebugInfo] Fix debug info generation for function static variables, typedefs...
David Blaikie [Wed, 1 Jul 2015 18:07:22 +0000 (18:07 +0000)]
Revert "[DebugInfo] Fix debug info generation for function static variables, typedefs, and records"

Caused PR24008.

This reverts commit r241154.

llvm-svn: 241177

9 years agoRevert "[DWARF] Fix debug info generation for function static variables, typedefs...
David Blaikie [Wed, 1 Jul 2015 18:07:16 +0000 (18:07 +0000)]
Revert "[DWARF] Fix debug info generation for function static variables, typedefs, and records"

Caused PR24008

This reverts commit 37cb5f1c2db9f42d29f26b215585f56bb64ae4f5.

llvm-svn: 241176

9 years agofix formatting; NFC
Sanjay Patel [Wed, 1 Jul 2015 17:58:53 +0000 (17:58 +0000)]
fix formatting; NFC

llvm-svn: 241175

9 years agofix typos in comment; NFC
Sanjay Patel [Wed, 1 Jul 2015 17:55:07 +0000 (17:55 +0000)]
fix typos in comment; NFC

llvm-svn: 241174

9 years agoFix typo in comment.
Dawn Perchik [Wed, 1 Jul 2015 17:41:02 +0000 (17:41 +0000)]
Fix typo in comment.

llvm-svn: 241173

9 years agoLivePhysRegs: Add support to add pristine registers when populating with live-in...
Matthias Braun [Wed, 1 Jul 2015 17:17:17 +0000 (17:17 +0000)]
LivePhysRegs: Add support to add pristine registers when populating with live-in/live-out registers.

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

llvm-svn: 241172

9 years ago[SEH] Add 32-bit lowering for SEH __try
Reid Kleckner [Wed, 1 Jul 2015 17:10:10 +0000 (17:10 +0000)]
[SEH] Add 32-bit lowering for SEH __try

This re-lands r236052 and adds support for __exception_code().

In 32-bit SEH, the exception code is not available in eax. It is only
available in the filter function, and now we arrange to load it and
store it into an escaped variable in the parent frame.

As a consequence, we have to disable the "catch i8* null" optimization
on 32-bit and always generate a filter function. We can re-enable the
optimization if we detect an __except block that doesn't use the
exception code, but this probably isn't worth optimizing.

Reviewers: majnemer

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

llvm-svn: 241171

9 years ago[SEH] Don't assert if the parent function lacks a personality
Reid Kleckner [Wed, 1 Jul 2015 16:45:47 +0000 (16:45 +0000)]
[SEH] Don't assert if the parent function lacks a personality

The EH code might have been deleted as unreachable and the personality
pruned while the filter is still present.  Currently I'm hitting this at
-O0 due to the clang bug PR24009.

llvm-svn: 241170

9 years ago[AsmPrinter] Hide implementation details
Benjamin Kramer [Wed, 1 Jul 2015 16:18:16 +0000 (16:18 +0000)]
[AsmPrinter] Hide implementation details

NFC.

llvm-svn: 241169

9 years agoFix OMPT event_barrer_end
Jonathan Peyton [Wed, 1 Jul 2015 15:16:04 +0000 (15:16 +0000)]
Fix OMPT event_barrer_end

The OMPT status is never equal to ompt_status_track. ompt_status_track = 0x2
and ompt_status_track_callback = 0x6 just share a bit, so that we can check
for traceing and callbacks with the same status.

Patch by Tim Cramer

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

llvm-svn: 241167

9 years ago[AArch64] Implement add/adds/sub/subs/cmp/cmn with negative immediate aliases
Arnaud A. de Grandmaison [Wed, 1 Jul 2015 15:05:58 +0000 (15:05 +0000)]
[AArch64] Implement add/adds/sub/subs/cmp/cmn with negative immediate aliases

This patch teaches the AsmParser to accept add/adds/sub/subs/cmp/cmn
with a negative immediate operand and convert them as shown:

  add  Rd, Rn, -imm -> sub  Rd, Rn, imm
  sub  Rd, Rn, -imm -> add  Rd, Rn, imm
  adds Rd, Rn, -imm -> subs Rd, Rn, imm
  subs Rd, Rn, -imm -> adds Rd, Rn, imm
  cmp  Rn, -imm     -> cmn  Rn, imm
  cmn  Rn, -imm     -> cmp  Rn, imm

Those instructions are an alternate syntax available to assembly coders,
and are needed in order to support code already compiling with some other
assemblers (gas). They are documented in the "ARMv8 Instruction Set
Overview", in the "Arithmetic (immediate)" section. This makes llvm-mc
a programmer-friendly assembler !

This also fixes PR20978: "Assembly handling of adding negative numbers
not as smart as gas".

llvm-svn: 241166

9 years ago[SDAG] Give InstrEmitter hidden visibility
Benjamin Kramer [Wed, 1 Jul 2015 14:55:10 +0000 (14:55 +0000)]
[SDAG] Give InstrEmitter hidden visibility

NFC.

llvm-svn: 241165

9 years ago[CodeGen] Reduce visibility of implementation details
Benjamin Kramer [Wed, 1 Jul 2015 14:47:39 +0000 (14:47 +0000)]
[CodeGen] Reduce visibility of implementation details

NFC.

llvm-svn: 241164

9 years ago[Sparc] Rearrange SparcInstrInfo, no change.
James Y Knight [Wed, 1 Jul 2015 14:38:07 +0000 (14:38 +0000)]
[Sparc] Rearrange SparcInstrInfo, no change.

Move some instructions into order of sections in the spec, as the rest
already were.

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

llvm-svn: 241163

9 years agoTest committed in r241153 is more target-specific than I thought.
Michael Kuperstein [Wed, 1 Jul 2015 13:45:25 +0000 (13:45 +0000)]
Test committed in r241153 is more target-specific than I thought.
Moving the (original, x86-only) test to the X86 directory.

llvm-svn: 241162

9 years agoExpand Phabricator docs slightly
Scott Douglass [Wed, 1 Jul 2015 13:41:18 +0000 (13:41 +0000)]
Expand Phabricator docs slightly

llvm-svn: 241161

9 years ago[clang-tidy] minor coding style tweak. make functions static.
Daniel Marjamaki [Wed, 1 Jul 2015 13:29:27 +0000 (13:29 +0000)]
[clang-tidy] minor coding style tweak. make functions static.

llvm-svn: 241160

9 years agoAVX-512: Implemented missing encoding for FMA scalar instructions
Igor Breger [Wed, 1 Jul 2015 13:24:28 +0000 (13:24 +0000)]
AVX-512: Implemented missing encoding for FMA scalar instructions
Added tests for encoding

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

llvm-svn: 241159

9 years agoFix non-target-specific test not to use the x86 triple.
Michael Kuperstein [Wed, 1 Jul 2015 13:05:57 +0000 (13:05 +0000)]
Fix non-target-specific test not to use the x86 triple.

llvm-svn: 241158