platform/upstream/llvm.git
9 years agoDo s/_context/_ctx/ to Resolver.cpp.
Rui Ueyama [Fri, 27 Feb 2015 23:40:00 +0000 (23:40 +0000)]
Do s/_context/_ctx/ to Resolver.cpp.

llvm-svn: 230814

9 years agoRemove a varaible that's used only once. NFC.
Rui Ueyama [Fri, 27 Feb 2015 23:36:05 +0000 (23:36 +0000)]
Remove a varaible that's used only once. NFC.

llvm-svn: 230813

9 years agoDiscourage in-source autoconf builds (as we already do for the cmake build)
Jonathan Roelofs [Fri, 27 Feb 2015 23:35:47 +0000 (23:35 +0000)]
Discourage in-source autoconf builds (as we already do for the cmake build)

http://reviews.llvm.org/D7961

llvm-svn: 230812

9 years agoRegenerated test case from pr 230801 for change in LLVM IR syntax
Bill Schmidt [Fri, 27 Feb 2015 23:29:57 +0000 (23:29 +0000)]
Regenerated test case from pr 230801 for change in LLVM IR syntax

llvm-svn: 230811

9 years agoUpdate SystemZ/Large test generators to handle new gep IR syntax
David Blaikie [Fri, 27 Feb 2015 23:29:39 +0000 (23:29 +0000)]
Update SystemZ/Large test generators to handle new gep IR syntax

llvm-svn: 230810

9 years agoUpdate SystemZ/Large test generators to handle new load IR syntax
David Blaikie [Fri, 27 Feb 2015 23:29:33 +0000 (23:29 +0000)]
Update SystemZ/Large test generators to handle new load IR syntax

llvm-svn: 230809

9 years agoCall File::beforeLink hook even if the file is in an archive.
Rui Ueyama [Fri, 27 Feb 2015 23:15:11 +0000 (23:15 +0000)]
Call File::beforeLink hook even if the file is in an archive.

Previously we didn't call the hook on a file in an archive, which
let the PE/COFF port fail to link files in archives. It was a
simple mistake. Added a call to the hook and also added a test to
catch that error.

const_cast is an unfortunate hack. Files in the resolver are usually
const, but they are not actually const objects, since they are
mutated if either a file is taken from an archive (an archive file
does never return the same file twice) or the beforeLink hook is
called. Maybe we should just remove const from there -- because they
are not const.

llvm-svn: 230808

9 years ago[new docs] Performance Tips for Frontend Authors
Philip Reames [Fri, 27 Feb 2015 23:14:50 +0000 (23:14 +0000)]
[new docs] Performance Tips for Frontend Authors

As mentioned on llvm-dev, this is a new documentation page intended to collect tips for frontend authors on how to generate IR that LLVM is able to optimize well. These types of things come up repeated in review threads and it would be good to have a place to save them.

I added a small handful to start us off, but I mostly want to get the framework in place. Once the docs are here, we can add to them incrementally.  If you know of something appropriate for this page, please add it!

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

llvm-svn: 230807

9 years agoMachineDominators: Move applySplitCriticalEdges into the cpp file.
Benjamin Kramer [Fri, 27 Feb 2015 23:13:13 +0000 (23:13 +0000)]
MachineDominators: Move applySplitCriticalEdges into the cpp file.

It's too big for inlining anyways. Also clean it up slightly. No functionality
change intended.

llvm-svn: 230806

9 years ago[modules] When writing out a list of specializations for a template, if we have
Richard Smith [Fri, 27 Feb 2015 23:05:10 +0000 (23:05 +0000)]
[modules] When writing out a list of specializations for a template, if we have
undeserialized specializations (because we merged an imported declaration of
the same template since we last added one), don't bother reading in the
specializations themselves just so we can write out their IDs again.

llvm-svn: 230805

9 years agollvm-vtabledump: Update field with a better name
David Majnemer [Fri, 27 Feb 2015 22:35:25 +0000 (22:35 +0000)]
llvm-vtabledump: Update field with a better name

llvm-svn: 230804

9 years agoRevert test case until it can be fixed
Bill Schmidt [Fri, 27 Feb 2015 22:31:14 +0000 (22:31 +0000)]
Revert test case until it can be fixed

llvm-svn: 230803

9 years agoAdd .eh_frame_hdr search to Linux unwinder.
Dan Albert [Fri, 27 Feb 2015 22:21:07 +0000 (22:21 +0000)]
Add .eh_frame_hdr search to Linux unwinder.

This improves the performance of unwinding on DWARF based targets. The
32-bit x86 support for scanning the full eh_frame
(CFI_Parser::findFDE) apparently does not work (at least not on
Linux). Since the eh_frame_hdr code delegates to that, this still
doesn't work for x86 Linux, but it has been tested on x86_64 Linux and
aarch64 Android.

llvm-svn: 230802

9 years ago[PowerPC] Fix PR22711 - Misaligned .toc section
Bill Schmidt [Fri, 27 Feb 2015 22:14:10 +0000 (22:14 +0000)]
[PowerPC] Fix PR22711 - Misaligned .toc section

Straightforward patch to emit an alignment directive when emitting a
TOC entry.  The test case was generated from the test in PR22711 that
demonstrated a misaligned .toc section.  The object code is run
through llvm-readobj to verify that the correct alignment has been
applied to the .toc section.

Thanks to Ulrich Weigand for running down where the fix was needed.

llvm-svn: 230801

9 years ago[Fix] Two tests that broke during the last changes
Johannes Doerfert [Fri, 27 Feb 2015 21:58:26 +0000 (21:58 +0000)]
[Fix] Two tests that broke during the last changes

llvm-svn: 230800

9 years agoConvert TestWatchLocation to use C++11 library instead of pthread.
Chaoren Lin [Fri, 27 Feb 2015 21:45:51 +0000 (21:45 +0000)]
Convert TestWatchLocation to use C++11 library instead of pthread.

Reviewers: clayborg, zturner, ki.stfu, abidh

Subscribers: lldb-commits

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

llvm-svn: 230799

9 years agoReduce double set lookups.
Benjamin Kramer [Fri, 27 Feb 2015 21:43:14 +0000 (21:43 +0000)]
Reduce double set lookups.

llvm-svn: 230798

9 years agoFix test I missed
David Blaikie [Fri, 27 Feb 2015 21:31:00 +0000 (21:31 +0000)]
Fix test I missed

This was & is failing at ToT, but now it's failing for the original
reason, not because the IR can't be parsed.

llvm-svn: 230797

9 years agoUpdate Polly tests to handle explicitly typed load changes in LLVM.
David Blaikie [Fri, 27 Feb 2015 21:22:50 +0000 (21:22 +0000)]
Update Polly tests to handle explicitly typed load changes in LLVM.

llvm-svn: 230796

9 years agoUpdate Clang tests to handle explicitly typed load changes in LLVM.
David Blaikie [Fri, 27 Feb 2015 21:19:58 +0000 (21:19 +0000)]
Update Clang tests to handle explicitly typed load changes in LLVM.

llvm-svn: 230795

9 years ago[opaque pointer type] Add textual IR support for explicit type parameter to load...
David Blaikie [Fri, 27 Feb 2015 21:17:42 +0000 (21:17 +0000)]
[opaque pointer type] Add textual IR support for explicit type parameter to load instruction

Essentially the same as the GEP change in r230786.

A similar migration script can be used to update test cases, though a few more
test case improvements/changes were required this time around: (r229269-r229278)

import fileinput
import sys
import re

pat = re.compile(r"((?:=|:|^)\s*load (?:atomic )?(?:volatile )?(.*?))(| addrspace\(\d+\) *)\*($| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$)")

for line in sys.stdin:
  sys.stdout.write(re.sub(pat, r"\1, \2\3*\4", line))

Reviewers: rafael, dexonsmith, grosser

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

llvm-svn: 230794

9 years agoTarget/X86: Never use the redzone for Win64 ABI functions.
Charles Davis [Fri, 27 Feb 2015 21:11:16 +0000 (21:11 +0000)]
Target/X86: Never use the redzone for Win64 ABI functions.

Summary:
Until now, we did this (among other things) based on whether or not the
target was Windows. This is clearly wrong, not just for Win64 ABI functions
on non-Windows, but for System V ABI functions on Windows, too. In this
change, we make this decision based on the ABI the calling convention
specifies instead.

Reviewers: rnk

Subscribers: llvm-commits

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

llvm-svn: 230793

9 years agoUpdate one test I missed when updating for the opaque pointer gep changes to LLVM.
David Blaikie [Fri, 27 Feb 2015 20:43:19 +0000 (20:43 +0000)]
Update one test I missed when updating for the opaque pointer gep changes to LLVM.

llvm-svn: 230792

9 years agoPECOFF: Move a call of WinLinkDriver::parse from FileCOFF::doParse to FileCOFF::befor...
Rui Ueyama [Fri, 27 Feb 2015 20:39:20 +0000 (20:39 +0000)]
PECOFF: Move a call of WinLinkDriver::parse from FileCOFF::doParse to FileCOFF::beforeLink

In doParse, we shouldn't do anything that has side effects. That function may be
called speculatively and possibly in parallel.

We called WinLinkDriver::parse from doParse to parse a command line in a .drectve
section. The parse function updates a linking context object, so it has many side
effects. It was not safe to call that function from doParse. beforeLink is a
function for a File object to do something that has side effects. Moving a call
of WinLinkDriver::parse to there.

llvm-svn: 230791

9 years agoDo some preparation even with scalar and phi modeling enabled
Johannes Doerfert [Fri, 27 Feb 2015 20:38:51 +0000 (20:38 +0000)]
Do some preparation even with scalar and phi modeling enabled

llvm-svn: 230790

9 years ago[modules] Avoid the possibility of a redeclaration chain not being marked 'up
Richard Smith [Fri, 27 Feb 2015 20:14:19 +0000 (20:14 +0000)]
[modules] Avoid the possibility of a redeclaration chain not being marked 'up
to date' after it gets updated.

llvm-svn: 230789

9 years ago[PowerPC] Use vector types for memcpy and friends (sometimes)
Hal Finkel [Fri, 27 Feb 2015 19:58:28 +0000 (19:58 +0000)]
[PowerPC] Use vector types for memcpy and friends (sometimes)

When using Altivec, we can use vector loads and stores for aligned memcpy and
friends. Starting with the P7 and VXS, we have reasonable unaligned vector
stores. Starting with the P8, we have fast unaligned loads too.

For QPX, we use vector loads are stores, but only for aligned memory accesses.

llvm-svn: 230788

9 years agoFix FileSpec::GetPath to return null-terminated strings
Ilia K [Fri, 27 Feb 2015 19:43:08 +0000 (19:43 +0000)]
Fix FileSpec::GetPath to return null-terminated strings

Summary:
Before this fix the FileSpec::GetPath() returned string which might be without '\0' at the end.
It could have happened if the size of buffer for path was less than actual path.

Test case:
```
FileSpec test("/path/to/file", false);
char buf[]="!!!!!!";
test.GetPath(buf, 3);
```

Before fix:
```
   233          FileSpec test("/path/to/file", false);
   234          char buf[]="!!!!!!";
   235          test.GetPath(buf, 3);
   236
-> 237          if (core_file)
   238          {
   239              if (!core_file.Exists())
   240              {
(lldb) print buf
(char [7]) $0 = "/pa!!!"
```

After fix:
```
   233          FileSpec test("/path/to/file", false);
   234          char buf[]="!!!!!!";
   235          test.GetPath(buf, 3);
   236
-> 237          if (core_file)
   238          {
   239              if (!core_file.Exists())
   240              {
(lldb) print buf
(char [7]) $0 = "/p"
```

Reviewers: zturner, abidh, clayborg

Reviewed By: abidh, clayborg

Subscribers: tberghammer, vharron, lldb-commits, clayborg, zturner, abidh

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

llvm-svn: 230787

9 years ago[opaque pointer type] Add textual IR support for explicit type parameter to getelemen...
David Blaikie [Fri, 27 Feb 2015 19:29:02 +0000 (19:29 +0000)]
[opaque pointer type] Add textual IR support for explicit type parameter to getelementptr instruction

One of several parallel first steps to remove the target type of pointers,
replacing them with a single opaque pointer type.

This adds an explicit type parameter to the gep instruction so that when the
first parameter becomes an opaque pointer type, the type to gep through is
still available to the instructions.

* This doesn't modify gep operators, only instructions (operators will be
  handled separately)

* Textual IR changes only. Bitcode (including upgrade) and changing the
  in-memory representation will be in separate changes.

* geps of vectors are transformed as:
    getelementptr <4 x float*> %x, ...
  ->getelementptr float, <4 x float*> %x, ...
  Then, once the opaque pointer type is introduced, this will ultimately look
  like:
    getelementptr float, <4 x ptr> %x
  with the unambiguous interpretation that it is a vector of pointers to float.

* address spaces remain on the pointer, not the type:
    getelementptr float addrspace(1)* %x
  ->getelementptr float, float addrspace(1)* %x
  Then, eventually:
    getelementptr float, ptr addrspace(1) %x

Importantly, the massive amount of test case churn has been automated by
same crappy python code. I had to manually update a few test cases that
wouldn't fit the script's model (r228970,r229196,r229197,r229198). The
python script just massages stdin and writes the result to stdout, I
then wrapped that in a shell script to handle replacing files, then
using the usual find+xargs to migrate all the files.

update.py:
import fileinput
import sys
import re

ibrep = re.compile(r"(^.*?[^%\w]getelementptr inbounds )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))")
normrep = re.compile(       r"(^.*?[^%\w]getelementptr )(((?:<\d* x )?)(.*?)(| addrspace\(\d\)) *\*(|>)(?:$| *(?:%|@|null|undef|blockaddress|getelementptr|addrspacecast|bitcast|inttoptr|\[\[[a-zA-Z]|\{\{).*$))")

def conv(match, line):
  if not match:
    return line
  line = match.groups()[0]
  if len(match.groups()[5]) == 0:
    line += match.groups()[2]
  line += match.groups()[3]
  line += ", "
  line += match.groups()[1]
  line += "\n"
  return line

for line in sys.stdin:
  if line.find("getelementptr ") == line.find("getelementptr inbounds"):
    if line.find("getelementptr inbounds") != line.find("getelementptr inbounds ("):
      line = conv(re.match(ibrep, line), line)
  elif line.find("getelementptr ") != line.find("getelementptr ("):
    line = conv(re.match(normrep, line), line)
  sys.stdout.write(line)

apply.sh:
for name in "$@"
do
  python3 `dirname "$0"`/update.py < "$name" > "$name.tmp" && mv "$name.tmp" "$name"
  rm -f "$name.tmp"
done

The actual commands:
From llvm/src:
find test/ -name *.ll | xargs ./apply.sh
From llvm/src/tools/clang:
find test/ -name *.mm -o -name *.m -o -name *.cpp -o -name *.c | xargs -I '{}' ../../apply.sh "{}"
From llvm/src/tools/polly:
find test/ -name *.ll | xargs ./apply.sh

After that, check-all (with llvm, clang, clang-tools-extra, lld,
compiler-rt, and polly all checked out).

The extra 'rm' in the apply.sh script is due to a few files in clang's test
suite using interesting unicode stuff that my python script was throwing
exceptions on. None of those files needed to be migrated, so it seemed
sufficient to ignore those cases.

Reviewers: rafael, dexonsmith, grosser

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

llvm-svn: 230786

9 years agoUpdate Polly tests to handle explicitly typed gep changes in LLVM
David Blaikie [Fri, 27 Feb 2015 19:20:19 +0000 (19:20 +0000)]
Update Polly tests to handle explicitly typed gep changes in LLVM

llvm-svn: 230784

9 years agoUpdate Clang tests to handle explicitly typed gep changes in LLVM.
David Blaikie [Fri, 27 Feb 2015 19:18:17 +0000 (19:18 +0000)]
Update Clang tests to handle explicitly typed gep changes in LLVM.

llvm-svn: 230783

9 years agoSkip LaunchInTerminalTestCase test on remote systems
Ilia K [Fri, 27 Feb 2015 19:14:12 +0000 (19:14 +0000)]
Skip LaunchInTerminalTestCase test on remote systems

Summary:
This ability was added by @jasonmolenda in [[ http://reviews.llvm.org/rL225748 | r225748 ]] but it was commented out because he hadn't test it.
I tested it on OS X and now we can enable it legally.

This change is made by @chying request.

Reviewers: jasonmolenda, chying, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits, chying, jasonmolenda, clayborg

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

llvm-svn: 230782

9 years agoRefer users looking for the release notes to 3.6.
Benjamin Kramer [Fri, 27 Feb 2015 19:06:26 +0000 (19:06 +0000)]
Refer users looking for the release notes to 3.6.

llvm-svn: 230781

9 years agoRemove the Forward Control Flow Integrity pass and its dependencies.
Eric Christopher [Fri, 27 Feb 2015 19:03:38 +0000 (19:03 +0000)]
Remove the Forward Control Flow Integrity pass and its dependencies.

This work is currently being rethought along different lines and
if this work is needed it can be resurrected out of svn. Remove it
for now as no current work in ongoing on it and it's unused. Verified
with the authors before removal.

llvm-svn: 230780

9 years agoObject: Test for reading kext bundles
Justin Bogner [Fri, 27 Feb 2015 18:58:23 +0000 (18:58 +0000)]
Object: Test for reading kext bundles

In the review for r230567, it was pointed out we should really test
the lib/Object part of that change. This does so using llvm-readobj.

llvm-svn: 230779

9 years agoDelete LLVM_DELETED_FUNCTION from coding standards
Reid Kleckner [Fri, 27 Feb 2015 18:34:16 +0000 (18:34 +0000)]
Delete LLVM_DELETED_FUNCTION from coding standards

It didn't seem worth leaving behind a guideline to use '= delete' to
make a class uncopyable. That's a well known C++ design pattern.

Reported on the mailing list and in PR22724.

llvm-svn: 230776

9 years agoChange the fast-isel-abort option from bool to int to enable "levels"
Mehdi Amini [Fri, 27 Feb 2015 18:32:11 +0000 (18:32 +0000)]
Change the fast-isel-abort option from bool to int to enable "levels"

Summary:
Currently fast-isel-abort will only abort for regular instructions,
and just warn for function calls, terminators, function arguments.
There is already fast-isel-abort-args but nothing for calls and
terminators.

This change turns the fast-isel-abort options into an integer option,
so that multiple levels of strictness can be defined.
This will help no being surprised when the "abort" option indeed does
not abort, and enables the possibility to write test that verifies
that no intrinsics are forgotten by fast-isel.

Reviewers: resistor, echristo

Subscribers: jfb, llvm-commits

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

From: Mehdi Amini <mehdi.amini@apple.com>
llvm-svn: 230775

9 years ago[FIX] Teach RegionGenerator to respect and update dominance
Johannes Doerfert [Fri, 27 Feb 2015 18:29:04 +0000 (18:29 +0000)]
[FIX] Teach RegionGenerator to respect and update dominance

  When we generate code for a whole region we have to respect dominance
  and update it too.
  The first is achieved with multiple "BBMap"s. Each copied block in the
  region gets its own map. It is initialized only with values mapped in
  the immediate dominator block, if this block is in the region and was
  therefor already copied. This way no values defined in a block that
  doesn't dominate the current one will be used.
  To update dominance information we check if the immediate dominator of
  the original block we want to copy is in the region. If so we set the
  immediate dominator of the current block to the copy of the immediate
  dominator of the original block.

llvm-svn: 230774

9 years agoMinor follow-ups to r229720 suggested on llvmdev
Reid Kleckner [Fri, 27 Feb 2015 18:22:46 +0000 (18:22 +0000)]
Minor follow-ups to r229720 suggested on llvmdev

"svn" patch by Sedat Dilek plus trimming whitespace added in r229720.

llvm-svn: 230773

9 years agoCentralize handling of the eh_begin and eh_end labels.
Rafael Espindola [Fri, 27 Feb 2015 18:18:39 +0000 (18:18 +0000)]
Centralize handling of the eh_begin and eh_end labels.

This removes a bit of duplicated code and more importantly, remembers the
labels so that they don't need to be looked up by name.

This in turn allows for any name to be used and avoids a crash if the name
we wanted was already taken.

llvm-svn: 230772

9 years agoremove function names from comments; NFC
Sanjay Patel [Fri, 27 Feb 2015 18:07:41 +0000 (18:07 +0000)]
remove function names from comments; NFC

llvm-svn: 230771

9 years agoPECOFF: Use StringRef::find_first_of instead of a hand-written loop.
Rui Ueyama [Fri, 27 Feb 2015 18:06:41 +0000 (18:06 +0000)]
PECOFF: Use StringRef::find_first_of instead of a hand-written loop.

llvm-svn: 230770

9 years agoSwitch a std::map to a DenseMap in CodeGenRegisters.
Owen Anderson [Fri, 27 Feb 2015 17:57:01 +0000 (17:57 +0000)]
Switch a std::map to a DenseMap in CodeGenRegisters.

The keys of the map are unique by pointer address, so there's no need
to use the llvm::less comparator. This allows us to use DenseMap
instead, which reduces tblgen time by 20% on my stress test.

llvm-svn: 230769

9 years agoAdd 'let' to the help message.
Samuel Benzaquen [Fri, 27 Feb 2015 17:53:23 +0000 (17:53 +0000)]
Add 'let' to the help message.

Summary: Add 'let' to the help message.

Reviewers: alexfh

Subscribers: cfe-commits

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

llvm-svn: 230768

9 years agoAdd verifier to the IslCodeGeneration
Johannes Doerfert [Fri, 27 Feb 2015 17:37:05 +0000 (17:37 +0000)]
Add verifier to the IslCodeGeneration

  After a function was created we will verify it for Debug builds. If
  errors are found and debug-type equals "polly-codegen-isl" the SCoP,
  the isl AST, the function as well as the errors will be printed.

llvm-svn: 230767

9 years agoremove function names from comments; NFC
Sanjay Patel [Fri, 27 Feb 2015 17:27:15 +0000 (17:27 +0000)]
remove function names from comments; NFC

llvm-svn: 230766

9 years ago[clang-tidy] Various improvements in misc-use-override
Alexander Kornienko [Fri, 27 Feb 2015 16:50:32 +0000 (16:50 +0000)]
[clang-tidy] Various improvements in misc-use-override

  * Better error message when more than one of 'virtual', 'override' and 'final'
    is present ("X is/are redundant since the function is already declared Y").
  * Convert the messages to the style used in Clang diagnostics: lower case
    initial letter, no trailing period.
  * Don't run the check for files compiled in pre-C++11 mode
    (http://llvm.org/PR22638).

llvm-svn: 230765

9 years agoReland __leave tests (r230717 and r230720, reverted in r230740).
Nico Weber [Fri, 27 Feb 2015 16:40:43 +0000 (16:40 +0000)]
Reland __leave tests (r230717 and r230720, reverted in r230740).

The only change is that line 266 changed from
    // CHECK:  br label %[[except]]
to
    // CHECK:  br label %[[except:[^ ]*]]

llvm-svn: 230764

9 years agoAdd __ARM_DWARF_EH__ to signify the use of Itanium ABI for unwind instructions.
Renato Golin [Fri, 27 Feb 2015 16:35:48 +0000 (16:35 +0000)]
Add __ARM_DWARF_EH__ to signify the use of Itanium ABI for unwind instructions.

Equally to NetBSD, Bitrig will be using .eh_frame unwinding on ARM.

Patch by Patrick Wildt.

llvm-svn: 230763

9 years agoEqually to NetBSD, Bitrig/ARM uses the Itanium-ABI.
Renato Golin [Fri, 27 Feb 2015 16:35:27 +0000 (16:35 +0000)]
Equally to NetBSD, Bitrig/ARM uses the Itanium-ABI.

Patch by Patrick Wildt.

llvm-svn: 230762

9 years agoAMDGCN: Define cl_khr_fp64 when compiling OpenCL programs
Tom Stellard [Fri, 27 Feb 2015 15:10:19 +0000 (15:10 +0000)]
AMDGCN: Define cl_khr_fp64 when compiling OpenCL programs

llvm-svn: 230761

9 years ago[mips][microMIPS] Change register class for GP register
Zoran Jovanovic [Fri, 27 Feb 2015 15:03:50 +0000 (15:03 +0000)]
[mips][microMIPS] Change register class for GP register
Differential Revision: http://reviews.llvm.org/D7934

llvm-svn: 230760

9 years agoR600/SI: Add missing mubuf instructions
Tom Stellard [Fri, 27 Feb 2015 14:59:46 +0000 (14:59 +0000)]
R600/SI: Add missing mubuf instructions

llvm-svn: 230759

9 years agoR600/SI: Consistently put soffset before the offset operand for mubuf instructions
Tom Stellard [Fri, 27 Feb 2015 14:59:44 +0000 (14:59 +0000)]
R600/SI: Consistently put soffset before the offset operand for mubuf instructions

This matches the assembly syntax.

llvm-svn: 230758

9 years agoR600/SI: Add slc, glc, and tfe to non-atomic _ADDR64 instructions
Tom Stellard [Fri, 27 Feb 2015 14:59:41 +0000 (14:59 +0000)]
R600/SI: Add slc, glc, and tfe to non-atomic _ADDR64 instructions

llvm-svn: 230757

9 years agoPass correct -mtriple for krait-cpu-div-attribute.ll
Petar Jovanovic [Fri, 27 Feb 2015 14:46:41 +0000 (14:46 +0000)]
Pass correct -mtriple for krait-cpu-div-attribute.ll

Not passing mtriple for one of the tests caused a regression failure
on MIPS buildbot. The issue was introduced by r230651.

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

llvm-svn: 230756

9 years ago[ASan/Win] Update test expectations after r230724
Timur Iskhodzhanov [Fri, 27 Feb 2015 14:29:53 +0000 (14:29 +0000)]
[ASan/Win] Update test expectations after r230724

llvm-svn: 230755

9 years agoSilence an MSVC warning about not all control paths returning a value; NFC.
Aaron Ballman [Fri, 27 Feb 2015 13:55:58 +0000 (13:55 +0000)]
Silence an MSVC warning about not all control paths returning a value; NFC.

llvm-svn: 230754

9 years ago[x86] Run most of the rest of the shuffle combining over non-128-bit
Chandler Carruth [Fri, 27 Feb 2015 12:13:14 +0000 (12:13 +0000)]
[x86] Run most of the rest of the shuffle combining over non-128-bit
vectors. This lets us fix the rest of the v16 lowering problems when
pshufb is clearly better.

We might still be able to improve some of the lowerings by enabling the
other combine-based rewriting to fire for non-128-bit vectors, but this
at least should remove any regressions from using the fancy v16i16
lowering strategy.

llvm-svn: 230753

9 years ago[x86] Teach a bunch of the x86-specific shuffle combining to work with
Chandler Carruth [Fri, 27 Feb 2015 11:45:13 +0000 (11:45 +0000)]
[x86] Teach a bunch of the x86-specific shuffle combining to work with
256-bit vectors as well as 128-bit vectors. Fixes some of the redundant
shuffles for v16i16.

llvm-svn: 230752

9 years ago[x86] Make the v8i16 clever single-input shuffle lowering usable for
Chandler Carruth [Fri, 27 Feb 2015 11:33:46 +0000 (11:33 +0000)]
[x86] Make the v8i16 clever single-input shuffle lowering usable for
repeated 128-bit lane shuffles of wider vector types and use it to lower
256-bit v16i16 vector shuffles where applicable.

This should let us perfectly lowering the pattern of pshuflw and pshufhw
even for AVX2 256-bit patterns.

I've not added AVX-512 support, but it should be trivial for someone
working on that to wire up.

Note that currently this generates bad, long shuffle chains because we
don't combine 256-bit target shuffles. The subsequent patches will fix
that.

llvm-svn: 230751

9 years ago[x86] Add a bunch more tests for v16i16 shuffles. All of these are taken
Chandler Carruth [Fri, 27 Feb 2015 11:25:10 +0000 (11:25 +0000)]
[x86] Add a bunch more tests for v16i16 shuffles. All of these are taken
by mirroring v8i16 test cases across both 128-bit lanes. This should
highlight problems where we aren't correctly using 128-bit shuffles to
implement things.

llvm-svn: 230750

9 years ago[compiler-rt] Symbolizer refactoring: Abstract SymbolizerProcess better
Kuba Brecka [Fri, 27 Feb 2015 11:11:05 +0000 (11:11 +0000)]
[compiler-rt] Symbolizer refactoring: Abstract SymbolizerProcess better

Reviewed at http://reviews.llvm.org/D7889

llvm-svn: 230749

9 years ago[mips] Remove redundant periods from -mattr=help descriptions for MIPS.
Toma Tabacu [Fri, 27 Feb 2015 10:44:02 +0000 (10:44 +0000)]
[mips] Remove redundant periods from -mattr=help descriptions for MIPS.

Summary: Also fixes an infringement of the 80-column limit rule.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 230748

9 years ago[llvm-pdbdump] Fix member initialization order warnings.
Zachary Turner [Fri, 27 Feb 2015 09:53:55 +0000 (09:53 +0000)]
[llvm-pdbdump] Fix member initialization order warnings.

llvm-svn: 230747

9 years ago[llvm-pdbdump] Colorize output.
Zachary Turner [Fri, 27 Feb 2015 09:15:59 +0000 (09:15 +0000)]
[llvm-pdbdump] Colorize output.

llvm-svn: 230746

9 years ago[llvm-pdbdump] Fix warnings found by clang-cl self host.
Zachary Turner [Fri, 27 Feb 2015 09:15:31 +0000 (09:15 +0000)]
[llvm-pdbdump] Fix warnings found by clang-cl self host.

llvm-svn: 230745

9 years ago[llvm-pdbdump] Add support for dumping global variables.
Zachary Turner [Fri, 27 Feb 2015 09:15:18 +0000 (09:15 +0000)]
[llvm-pdbdump] Add support for dumping global variables.

llvm-svn: 230744

9 years ago[x86] Make the single-input v8i16 lowering directly recurse rather than
Chandler Carruth [Fri, 27 Feb 2015 09:11:38 +0000 (09:11 +0000)]
[x86] Make the single-input v8i16 lowering directly recurse rather than
going back through the entire vector shuffle lowering.

This is an important step to being able to re-use this logic.

llvm-svn: 230743

9 years ago[mips] Account for constant-zero operands in ADDE nodes.
Vasileios Kalintiris [Fri, 27 Feb 2015 09:01:39 +0000 (09:01 +0000)]
[mips] Account for constant-zero operands in ADDE nodes.

Summary:
We identify the cases where the operand to an ADDE node is a constant
zero. In such cases, we can avoid generating an extra ADDu instruction
disguised as an identity move alias (ie. addu $r, $r, 0 --> move $r, $r).

Reviewers: dsanders

Subscribers: llvm-commits

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

llvm-svn: 230742

9 years agoclang-format: Make trailing commas in array inits force one per line.
Daniel Jasper [Fri, 27 Feb 2015 08:41:05 +0000 (08:41 +0000)]
clang-format: Make trailing commas in array inits force one per line.

Before:
  NSArray *array = @[ @"a", @"a", ];

After:
  NSArray *array = @[
    @"a",
    @"a",
  ];

llvm-svn: 230741

9 years agoRevert r230717 (and subsequent r230720).
Daniel Jasper [Fri, 27 Feb 2015 08:16:32 +0000 (08:16 +0000)]
Revert r230717 (and subsequent r230720).

The tests keeps failing on build bots:
http://lab.llvm.org:8080/green/job/clang-stage2-configure-Rlto_check/2355/testReport/junit/Clang/CodeGen/exceptions_seh_leave_c/

llvm-svn: 230740

9 years agoFixes http://reviews.llvm.org/rL230691
Chaoren Lin [Fri, 27 Feb 2015 07:48:07 +0000 (07:48 +0000)]
Fixes http://reviews.llvm.org/rL230691

Summary: OS X doesn't implement pthread barriers, using a simple atomic flag instead.

Reviewers: ki.stfu

Subscribers: lldb-commits

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

llvm-svn: 230739

9 years ago[X86] Remove pblendw and pblendd builtins that aren't being used by the intrinsic...
Craig Topper [Fri, 27 Feb 2015 06:54:25 +0000 (06:54 +0000)]
[X86] Remove pblendw and pblendd builtins that aren't being used by the intrinsic headers.

llvm-svn: 230738

9 years ago[ELF] Set up initial live symbol(s) to avoid incorrect reclaim of atoms.
Davide Italiano [Fri, 27 Feb 2015 06:41:46 +0000 (06:41 +0000)]
[ELF] Set up initial live symbol(s) to avoid incorrect reclaim of atoms.

If no initial live symbols are set up, and deadStrip() == true,
the Resolver ends up reclaiming all the symbols that aren't absolute. This is wrong.
This patch fixes the issue by setting entrySymbolName() as live, and this allows
us to self-host lld when --gc-sections is enabled. There are still quite a few problems
with --gc-sections (test failures), so the option can't be enabled by default.

Differential Revision: D7926
Reviewed by: ruiu, shankarke

llvm-svn: 230737

9 years ago[OPENMP] Codegen for "#pragma omp atomic write"
Alexey Bataev [Fri, 27 Feb 2015 06:33:30 +0000 (06:33 +0000)]
[OPENMP] Codegen for "#pragma omp atomic write"
For global reg lvalue - use regular store through global register.
For simple lvalue - use simple atomic store.
For bitfields, vector element, extended vector elements - the original value of the whole storage (for vector elements) or of some aligned value (for bitfields) is atomically read, the part of this value for the given lvalue is modified and then use atomic compare-and-exchange operation to try to atomically write modified value (if it was not modified).
Also, changes in this patch fix the bug for '#pragma omp atomic read' applied to extended vector elements.
Differential Revision: http://reviews.llvm.org/D7369

llvm-svn: 230736

9 years agoTemporarily disable FileArchive::preload().
Rui Ueyama [Fri, 27 Feb 2015 05:26:05 +0000 (05:26 +0000)]
Temporarily disable FileArchive::preload().

It is observed that the function throws std::future_error on a few buildbots.
That cannot be easily reproducible on local machines. Kill the feature
temporarily to see if this is going to fix the buildbot issue.

llvm-svn: 230735

9 years agoPartially revert "PECOFF: Do not add layout-after edges."
Rui Ueyama [Fri, 27 Feb 2015 05:22:19 +0000 (05:22 +0000)]
Partially revert "PECOFF: Do not add layout-after edges."

This reverts commit r230732.

sectionSize() in lib/Core/SymbolTable.cpp still depends on the layout-
after edges, so we couldn't remove them yet.

llvm-svn: 230734

9 years ago[ELF] Remove includes that are not used
Shankar Easwaran [Fri, 27 Feb 2015 05:12:30 +0000 (05:12 +0000)]
[ELF] Remove includes that are not used

This remove(s) include of the filename twice.

llvm-svn: 230733

9 years agoPECOFF: Do not add layout-after edges.
Rui Ueyama [Fri, 27 Feb 2015 05:05:38 +0000 (05:05 +0000)]
PECOFF: Do not add layout-after edges.

Previously we needed to create atoms as a doubly-linked link, but it's
no longer needed. Also we don't use layout-after edges in PE/COFF.
Creating such edges is just waste.

llvm-svn: 230732

9 years ago[CMake] Cleanup
Shankar Easwaran [Fri, 27 Feb 2015 04:39:16 +0000 (04:39 +0000)]
[CMake] Cleanup

llvm-svn: 230731

9 years agoTwine should be used within a statement.
Rui Ueyama [Fri, 27 Feb 2015 04:23:23 +0000 (04:23 +0000)]
Twine should be used within a statement.

llvm-svn: 230730

9 years agoUpdate comments, fix typos.
Rui Ueyama [Fri, 27 Feb 2015 04:23:21 +0000 (04:23 +0000)]
Update comments, fix typos.

llvm-svn: 230729

9 years agoUse read{le,be}{16,32}. NFC.
Rui Ueyama [Fri, 27 Feb 2015 04:21:40 +0000 (04:21 +0000)]
Use read{le,be}{16,32}. NFC.

llvm-svn: 230728

9 years ago[modules] Don't write out name lookup table entries merely because the module
Richard Smith [Fri, 27 Feb 2015 03:40:09 +0000 (03:40 +0000)]
[modules] Don't write out name lookup table entries merely because the module
happened to query them; only write them out if something new was added.

llvm-svn: 230727

9 years agoRemove unused #includes.
Rui Ueyama [Fri, 27 Feb 2015 03:23:52 +0000 (03:23 +0000)]
Remove unused #includes.

llvm-svn: 230726

9 years agoAdd {read,write}{16,32,64}{le,be} functions.
Rui Ueyama [Fri, 27 Feb 2015 03:18:46 +0000 (03:18 +0000)]
Add {read,write}{16,32,64}{le,be} functions.

Nothing wrong with reinterpret_cast<llvm::support::ulittle32_t *>(loc),
but that's redundant and not great from readability point of view.
The new functions are wrappers for that kind of reinterpet_casts.

Surprisingly or unsurprisingly, there was no use of big endian read
and write. {read,write}{16,32,64}be have no user. But I think they
still worth to be there in the header for completeness.

http://reviews.llvm.org/D7927

llvm-svn: 230725

9 years ago[asan] Skip promotable allocas to improve performance at -O0
Anna Zaks [Fri, 27 Feb 2015 03:12:36 +0000 (03:12 +0000)]
[asan] Skip promotable allocas to improve performance at -O0

Currently, the ASan executables built with -O0 are unnecessarily slow.
The main reason is that ASan instrumentation pass inserts redundant
checks around promotable allocas. These allocas do not get instrumented
under -O1 because they get converted to virtual registered by mem2reg.
With this patch, ASan instrumentation pass will only instrument non
promotable allocas, giving us a speedup of 39% on a collection of
benchmarks with -O0. (There is no measurable speedup at -O1.)

llvm-svn: 230724

9 years ago[compiler-rt] Allow suppression file to be relative to the location of the executable
Anna Zaks [Fri, 27 Feb 2015 03:12:19 +0000 (03:12 +0000)]
[compiler-rt] Allow suppression file to be relative to the location of the executable

The ASanified executable could be launched from different locations. When we
cannot find the suppression file relative to the current directory, try to
see if the specified path is relative to the location of the executable.

llvm-svn: 230723

9 years agoMS ABI: Simplify the code which performs base adjustments
David Majnemer [Fri, 27 Feb 2015 02:38:02 +0000 (02:38 +0000)]
MS ABI: Simplify the code which performs base adjustments

llvm-svn: 230722

9 years ago[Sanitizer] Print column number in SUMMARY line if it's available.
Alexey Samsonov [Fri, 27 Feb 2015 02:29:25 +0000 (02:29 +0000)]
[Sanitizer] Print column number in SUMMARY line if it's available.

llvm-svn: 230721

9 years agoAdd last missing __leave test.
Nico Weber [Fri, 27 Feb 2015 02:26:14 +0000 (02:26 +0000)]
Add last missing __leave test.

llvm-svn: 230720

9 years agoDon't modify the DenseMap being iterated over from within the loop
Sanjoy Das [Fri, 27 Feb 2015 02:24:16 +0000 (02:24 +0000)]
Don't modify the DenseMap being iterated over from within the loop
that is iterating over it

Inserting elements into a `DenseMap` invalidated iterators pointing
into the `DenseMap` instance.

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

llvm-svn: 230719

9 years agoFix a use-iterator-after-invalidate error
Sanjoy Das [Fri, 27 Feb 2015 02:19:11 +0000 (02:19 +0000)]
Fix a use-iterator-after-invalidate error

AnalysisResult::getResultImpl reuses an iterator into a DenseMap after
inserting elements into it. This change adds code to recompute the
iterator before the second use.

llvm-svn: 230718

9 years agoAdd another __leave test.
Nico Weber [Fri, 27 Feb 2015 01:58:08 +0000 (01:58 +0000)]
Add another __leave test.

llvm-svn: 230717

9 years ago[modules] For an inheriting constructor, the inherited constructor is stored in
Richard Smith [Fri, 27 Feb 2015 01:57:00 +0000 (01:57 +0000)]
[modules] For an inheriting constructor, the inherited constructor is stored in
a map keyed off the canonical declaration. Don't try to set it if we're loading
some non-canonical merged declaration.

llvm-svn: 230716

9 years agoTarget/X86: Save Win64 non-volatile registers in a Win64 ABI function.
Charles Davis [Fri, 27 Feb 2015 00:57:01 +0000 (00:57 +0000)]
Target/X86: Save Win64 non-volatile registers in a Win64 ABI function.

Summary:
This change causes us to actually save non-volatile registers in a Win64
ABI function that calls a System V ABI function, and vice-versa.

Reviewers: rnk

Subscribers: llvm-commits

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

llvm-svn: 230714

9 years agollvm-vtabledump: Dump catch/throw exception structures for MS ABI
David Majnemer [Fri, 27 Feb 2015 00:43:58 +0000 (00:43 +0000)]
llvm-vtabledump: Dump catch/throw exception structures for MS ABI

llvm-svn: 230713

9 years ago[modules] When loading in multiple canonical definitions of a template,
Richard Smith [Fri, 27 Feb 2015 00:25:58 +0000 (00:25 +0000)]
[modules] When loading in multiple canonical definitions of a template,
accumulate the set of specializations rather than overwriting one list
with another.

llvm-svn: 230712

9 years agoFixed an infinite recursion bug that could happen when using python operating system...
Greg Clayton [Fri, 27 Feb 2015 00:12:22 +0000 (00:12 +0000)]
Fixed an infinite recursion bug that could happen when using python operating system plug-ins where we would ask the operating system plug-in to update its threads and this would cause the plugin to run an expression which would eventually run IRForTarget::CreateResultVariable() which would try to get the selected thread and cause re-entrant bug.

<rdar://problem/19924734>

llvm-svn: 230711