platform/upstream/llvm.git
9 years agoCorrect failure decorator in test_fd_leak_multitarget
Ed Maste [Mon, 29 Jun 2015 15:26:45 +0000 (15:26 +0000)]
Correct failure decorator in test_fd_leak_multitarget

The random module in Python 2.7.8 and later leaks /dev/[u]random into
children. The test is expected to fail, not be flakey.

This will be fixed in Python 2.7.10 for some operating systems, but not
all e.g. OS X 10.4.

llvm.org/pr23983
bugs.freebsd.org/197376
bugs.python.org/issue23458

llvm-svn: 240958

9 years agoclang-format: Adjust Mozilla style defaults
Birunthan Mohanathas [Mon, 29 Jun 2015 15:18:58 +0000 (15:18 +0000)]
clang-format: Adjust Mozilla style defaults

Summary: This makes the Mozilla style defaults more compliant with the Mozilla style guide. A few options were removed in order to use the LLVM style defaults.

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

llvm-svn: 240957

9 years agoUpgrade JIT listeners for changes in the libObject API.
Benjamin Kramer [Mon, 29 Jun 2015 15:18:48 +0000 (15:18 +0000)]
Upgrade JIT listeners for changes in the libObject API.

llvm-svn: 240956

9 years agoAdd first support to delinearize A[t%2][i][j]
Tobias Grosser [Mon, 29 Jun 2015 14:44:22 +0000 (14:44 +0000)]
Add first support to delinearize A[t%2][i][j]

This is very preliminary support, but it seems to work for the most common case.
When observing more/different test cases, we can work on generalizing this.

llvm-svn: 240955

9 years agoFix delinearization after it's move to ScalarEvoltion
Tobias Grosser [Mon, 29 Jun 2015 14:44:17 +0000 (14:44 +0000)]
Fix delinearization after it's move to ScalarEvoltion

llvm-svn: 240954

9 years agoCOFF: Handle mangled entry symbol name.
Rui Ueyama [Mon, 29 Jun 2015 14:43:07 +0000 (14:43 +0000)]
COFF: Handle mangled entry symbol name.

Compilers recognize "main" function and don't mangle its name.
But if you use a different function as a user-defined entry name,
and if you didn't define that function with extern C, your entry
point function name is mangled. And the linker has to be able to
find that. This is relatively rare but can happen.

llvm-svn: 240953

9 years agoMove delinearization from SCEVAddRecExpr to ScalarEvolution
Tobias Grosser [Mon, 29 Jun 2015 14:42:48 +0000 (14:42 +0000)]
Move delinearization from SCEVAddRecExpr to ScalarEvolution

The expressions we delinearize do not necessarily have to have a SCEVAddRecExpr
at the outermost level. At this moment, the additional flexibility  is not
exploited in LLVM itself, but in Polly we will soon soonish use this
functionality. For LLVM, this change should not affect existing functionality
(which is covered by test/Analysis/Delinearization/)

llvm-svn: 240952

9 years agoUpdate for llvm api change.
Rafael Espindola [Mon, 29 Jun 2015 14:39:30 +0000 (14:39 +0000)]
Update for llvm api change.

llvm-svn: 240951

9 years agoFactor out the checking of string tables.
Rafael Espindola [Mon, 29 Jun 2015 14:39:25 +0000 (14:39 +0000)]
Factor out the checking of string tables.

This moves the error checking for string tables to getStringTable which returns
an ErrorOr<StringRef>.

This improves error checking, makes it uniform across all string tables and
makes it possible to check them once instead of once per name.

llvm-svn: 240950

9 years agotsan: implement suppressions for top frame only
Dmitry Vyukov [Mon, 29 Jun 2015 14:38:31 +0000 (14:38 +0000)]
tsan: implement suppressions for top frame only

The new suppression type is called "race_top" and is matched only against top frame in report stacks.
This is required for situations when we want to suppress a race in a "thread pool" or "event loop" implementation.
If we simply use "race:ThreadPool::Execute" suppression, that can suppress everything in the program.

Reviewed in http://reviews.llvm.org/D10686

llvm-svn: 240949

9 years agoCOFF: Create an empty file for /pdb.
Rui Ueyama [Mon, 29 Jun 2015 14:27:12 +0000 (14:27 +0000)]
COFF: Create an empty file for /pdb.

Most build system depends on existence or time stamp of a file.
This patch is to create an empty file for /pdb:<filename> option
just to satisfy some build rules.

llvm-svn: 240948

9 years agoCOFF: Fix /export.
Rui Ueyama [Mon, 29 Jun 2015 14:27:10 +0000 (14:27 +0000)]
COFF: Fix /export.

Mangled dllexported symbols may be defined in a library.
If that's the case, we have to read a member file from the library.

llvm-svn: 240947

9 years agodosep.py: Add ability to set default test timout based on target
Pavel Labath [Mon, 29 Jun 2015 14:16:51 +0000 (14:16 +0000)]
dosep.py: Add ability to set default test timout based on target

Summary:
Current default is 10 minutes, which causes the test suite to run very long in
case of test timeouts. On local linux, each test completes in under 90 seconds in the
slowest configuration (debug build of lldb, using debug clang to build
inferiors). I am changing the default to 4m on local targets, while retaining
the 10m timeout for remote ones.

Reviewers: sivachandra, vharron

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 240946

9 years agoAdd a testcase for an invalid file.
Rafael Espindola [Mon, 29 Jun 2015 14:12:14 +0000 (14:12 +0000)]
Add a testcase for an invalid file.

We were already checking this, but had no tests.

llvm-svn: 240945

9 years agoConvert an assert that can fail into error checking.
Rafael Espindola [Mon, 29 Jun 2015 14:02:24 +0000 (14:02 +0000)]
Convert an assert that can fail into error checking.

llvm-svn: 240944

9 years agotsan: fix flaky test
Dmitry Vyukov [Mon, 29 Jun 2015 13:56:31 +0000 (13:56 +0000)]
tsan: fix flaky test

See the comment for explanation.

llvm-svn: 240943

9 years agoIgnore the .svn directory when building swig wrappers (bug #23917)
Pavel Labath [Mon, 29 Jun 2015 13:51:49 +0000 (13:51 +0000)]
Ignore the .svn directory when building swig wrappers (bug #23917)

llvm-svn: 240942

9 years ago[x86][AVX512CD] Add conflict and lzcnt intrinsics in their 512bit versions
Asaf Badouh [Mon, 29 Jun 2015 12:51:53 +0000 (12:51 +0000)]
[x86][AVX512CD] Add conflict and lzcnt intrinsics in their 512bit versions
include tests

review
http://reviews.llvm.org/D10795

llvm-svn: 240941

9 years agoUpdate for llvm change.
Rafael Espindola [Mon, 29 Jun 2015 12:38:35 +0000 (12:38 +0000)]
Update for llvm change.

llvm-svn: 240940

9 years agoRemove Elf_Sym_Iter.
Rafael Espindola [Mon, 29 Jun 2015 12:38:31 +0000 (12:38 +0000)]
Remove Elf_Sym_Iter.

It was a fairly broken concept for an ELF only class.

An ELF file can have two symbol tables, but they have exactly the same
format. There is no concept of a dynamic or a static symbol. Storing this
on the iterator also makes us do more work per symbol than necessary. To fetch
a name we would:

* Find if we had a static or a dynamic symbol.
* Look at the corresponding symbol table and find the string table section.
* Look at the string table section to fetch its contents.
* Compute the name as a substring of the string table.

All but the last step can be done per symbol table instead of per symbol. This
is a step in that direction.

llvm-svn: 240939

9 years ago[clang-tidy] Fix false positives in the macro parentheses checker
Daniel Marjamaki [Mon, 29 Jun 2015 12:18:11 +0000 (12:18 +0000)]
[clang-tidy] Fix false positives in the macro parentheses checker

Summary:
There were false positives in C++ code where macro argument was a type.

Reviewers: alexfh

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

llvm-svn: 240938

9 years ago[X86][AVX512BW] Add more intrinsics support:
Asaf Badouh [Mon, 29 Jun 2015 12:16:40 +0000 (12:16 +0000)]
[X86][AVX512BW] Add more intrinsics support:
 Blend, abs, packs, adds, subs, avg, max, min, permute.
 all the intrinsics are covered by tests

review:
http://reviews.llvm.org/D10799

llvm-svn: 240937

9 years agoAVX-512: all forms of SCATTER instruction on SKX,
Elena Demikhovsky [Mon, 29 Jun 2015 12:14:24 +0000 (12:14 +0000)]
AVX-512: all forms of SCATTER instruction on SKX,
encoding, intrinsics and tests.

llvm-svn: 240936

9 years agoAdd Support for LLVM_INSTALL_TOOLCHAIN_ONLY (bug #23784)
Pavel Labath [Mon, 29 Jun 2015 11:03:21 +0000 (11:03 +0000)]
Add Support for LLVM_INSTALL_TOOLCHAIN_ONLY (bug #23784)

Support for LLVM_INSTALL_TOOLCHAIN_ONLY is modeled on same functionality
from LLVM and Clang CMake files.

Patch by: Eugene Zelenko

llvm-svn: 240935

9 years agoclang-format: Don't indent relative to unary operators (some more).
Daniel Jasper [Mon, 29 Jun 2015 10:42:59 +0000 (10:42 +0000)]
clang-format: Don't indent relative to unary operators (some more).

Before:
  long aaaaaaaa = !aaaa( // break
                      aaaaaa);
  long aaaaaaaa = !aa.aa( // break
      aaaaaa);

After:
  long aaaaaaaa = !aaaa( // break
      aaaaaa);
  long aaaaaaaa = !aa.aa( // break
      aaaaaa);

llvm-svn: 240934

9 years agofix lldb-server linking on RHEL 6 (bug #23774)
Pavel Labath [Mon, 29 Jun 2015 10:30:06 +0000 (10:30 +0000)]
fix lldb-server linking on RHEL 6 (bug #23774)

Patch by: Eugene Zelenko

llvm-svn: 240933

9 years ago[ARM]: Extend -mfpu options for half-precision and vfpv3xd
Javed Absar [Mon, 29 Jun 2015 09:53:33 +0000 (09:53 +0000)]
[ARM]: Extend -mfpu options for half-precision and vfpv3xd

removing default label in switch as it results.
This is part of earlier commit http://reviews.llvm.org/D1064

Subscribers: llvm-commits
llvm-svn: 240932

9 years agoThis is a comment-only change to test commit access
Igor Breger [Mon, 29 Jun 2015 09:48:56 +0000 (09:48 +0000)]
This is a comment-only change to test commit access

llvm-svn: 240931

9 years ago[ARM]: Extend -mfpu options for half-precision and vfpv3xd
Javed Absar [Mon, 29 Jun 2015 09:32:29 +0000 (09:32 +0000)]
[ARM]: Extend -mfpu options for half-precision and vfpv3xd

Some of the the permissible ARM -mfpu options, which are supported in GCC,
are currently not present in llvm/clang.This patch adds the options:
'neon-fp16', 'vfpv3-fp16', 'vfpv3-d16-fp16', 'vfpv3xd' and 'vfpv3xd-fp16.
These are related to half-precision floating-point and single precision.

Reviewers: rengolin, ranjeet.singh

Subscribers: llvm-commits

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

llvm-svn: 240930

9 years ago[ARM]: Extend -mfpu options for half-precision and vfpv3xd
Javed Absar [Mon, 29 Jun 2015 09:30:19 +0000 (09:30 +0000)]
[ARM]: Extend -mfpu options for half-precision and vfpv3xd

Some of the the permissible ARM -mfpu options, which are supported in GCC,
are currently not present in llvm/clang.This patch adds the options:
'neon-fp16', 'vfpv3-fp16', 'vfpv3-d16-fp16', 'vfpv3xd' and 'vfpv3xd-fp16.
These are related to half-precision floating-point and single precision.

Reviewers: rengolin, ranjeet.singh

Subscribers: llvm-commits

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

llvm-svn: 240929

9 years agoAVX-512: Implemented AVX-512 FMA intrinsics and tests.
Elena Demikhovsky [Mon, 29 Jun 2015 09:20:57 +0000 (09:20 +0000)]
AVX-512:  Implemented  AVX-512 FMA intrinsics and tests.

by Igor Breger

http://reviews.llvm.org/D10797

llvm-svn: 240928

9 years ago[linux] Use cmake to detect support process_vm_readv (bug #23918)
Pavel Labath [Mon, 29 Jun 2015 09:18:17 +0000 (09:18 +0000)]
[linux] Use cmake to detect support process_vm_readv (bug #23918)

Summary:
Some old linux versions do not have process_vm_readv function defined. Even older versions do not
have even the __NR_process_vm_readv syscall number. We use cmake to detect these situations and
fallback appropriately: in the first case, we can issue the syscall manually, while it the latter
case, we need to drop fast memory read support completely.

Test Plan: linux test suite passes

Reviewers: ovyalov, Eugene.Zelenko

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 240927

9 years agoAVX-512: Implemented missing encoding and intrinsics for FMA instructions
Igor Breger [Mon, 29 Jun 2015 09:10:00 +0000 (09:10 +0000)]
AVX-512: Implemented missing encoding and intrinsics for FMA instructions
Added tests for DAG lowering ,encoding and intrinsics

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

llvm-svn: 240926

9 years agoWhitespace.
NAKAMURA Takumi [Mon, 29 Jun 2015 04:50:09 +0000 (04:50 +0000)]
Whitespace.

llvm-svn: 240924

9 years agoDelete unused variables.
Frederic Riss [Mon, 29 Jun 2015 04:41:58 +0000 (04:41 +0000)]
Delete unused variables.

llvm-svn: 240923

9 years agoCOFF: Fix logic to find default entry name or subsystem.
Rui Ueyama [Mon, 29 Jun 2015 01:03:53 +0000 (01:03 +0000)]
COFF: Fix logic to find default entry name or subsystem.

The previous logic to find default entry name or subsystem does not
seem correct (i.e. was not compatible with MSVC linker). Previously,
default entry name was inferred from CRT functions and user-defined
entry functions. Subsystem was inferred from CRT functions.

Default entry name and subsystem are now inferred based on the
following table. Note that we no longer use CRT functions to infer
them.

               Entry name           Subsystem
  main         mainCRTStartup       console
  wmain        wmainCRTStartup      console
  WinMain      WinMainCRTStartup    windows
  wWinMain     wWinMainCRTStartup   windows

llvm-svn: 240922

9 years ago[MS ABI] Unify constant and non-constant member pointer conversion
David Majnemer [Mon, 29 Jun 2015 00:06:50 +0000 (00:06 +0000)]
[MS ABI] Unify constant and non-constant member pointer conversion

We had two separate paths for member pointer conversion: one which
takes a constant and another which takes an arbitrary value.  In the
latter case, we are permitted to construct arbitrary instructions.

It turns out that the bulk of the member pointer conversion is sharable
if we construct an artificial IRBuilder.

llvm-svn: 240921

9 years agoRevert r240872, "Suppress clang/test/CodeGen/builtins-ppc-p8vector.c for -Asserts...
NAKAMURA Takumi [Sun, 28 Jun 2015 23:14:35 +0000 (23:14 +0000)]
Revert r240872, "Suppress clang/test/CodeGen/builtins-ppc-p8vector.c for -Asserts for now. Will fix later."

This has been fixed since r240912.

llvm-svn: 240920

9 years agoCOFF: Allow mangled symbols as arguments for /export.
Rui Ueyama [Sun, 28 Jun 2015 22:16:41 +0000 (22:16 +0000)]
COFF: Allow mangled symbols as arguments for /export.

Usually dllexported symbols are defined with 'extern "C"',
so identifying them is easy. We can just do hash table lookup
to look up exported symbols.

However, C++ non-member functions are also allowed to be exported,
and they can be specified with unmangled name. So, if /export:foo
is given, we need to look up not only "foo" but also its all
mangled names. In MSVC mangling scheme, that means that we need to
look up any symbol which starts with "?foo@@Y".

In this patch, we scan the entire symbol table to search for
a mangled symbol. The symbol table is a DenseMap, and that doesn't
support table lookup by string prefix. This is of course very
inefficient. But that should be probably OK because the user
should always add 'extern "C"' to dllexported symbols.

llvm-svn: 240919

9 years agoCOFF: Fix flaky test.
Rui Ueyama [Sun, 28 Jun 2015 22:06:53 +0000 (22:06 +0000)]
COFF: Fix flaky test.

This test was flaky because stdout and stderr can be mixed.

llvm-svn: 240918

9 years agoCOFF: Undefined weak aliases are not fatal if /force is given.
Rui Ueyama [Sun, 28 Jun 2015 20:34:09 +0000 (20:34 +0000)]
COFF: Undefined weak aliases are not fatal if /force is given.

llvm-svn: 240917

9 years agoCOFF: Add a comment.
Rui Ueyama [Sun, 28 Jun 2015 20:07:08 +0000 (20:07 +0000)]
COFF: Add a comment.

llvm-svn: 240916

9 years agoCOFF: Add /noentry flag.
Rui Ueyama [Sun, 28 Jun 2015 19:56:30 +0000 (19:56 +0000)]
COFF: Add /noentry flag.

This option is sometimes used to create a resource-only DLL that
doesn't need any initialization.

llvm-svn: 240915

9 years agoFix broken test.
Rui Ueyama [Sun, 28 Jun 2015 19:38:10 +0000 (19:38 +0000)]
Fix broken test.

llvm-svn: 240914

9 years agoCOFF: Support /force flag.
Rui Ueyama [Sun, 28 Jun 2015 19:35:15 +0000 (19:35 +0000)]
COFF: Support /force flag.

This option is to ignore remaining undefined symbols and force
the linker to create an output file anyways.

The existing code assumes that there's no undefined symbol after
reportRemainingUndefines(). That assumption is legitimate.
I also don't want to mess up the existing code for this minor feature.
In order to keep it as is, remaining undefined symbols are replaced
with dummy defined symbols.

llvm-svn: 240913

9 years ago[PPC] fixes typos in builtins-ppc-p8vector.c
Jingyue Wu [Sun, 28 Jun 2015 18:30:36 +0000 (18:30 +0000)]
[PPC] fixes typos in builtins-ppc-p8vector.c

The extra ] causes %{{[0-9]]*}} to match only %<single digit> such as %1.

llvm-svn: 240912

9 years agoAMDGPU/SI: Fix extra space when printing v_div_fmas_*
Matt Arsenault [Sun, 28 Jun 2015 18:16:14 +0000 (18:16 +0000)]
AMDGPU/SI: Fix extra space when printing v_div_fmas_*

llvm-svn: 240911

9 years ago[SLSR] S's basis must have the same type as S
Jingyue Wu [Sun, 28 Jun 2015 17:45:05 +0000 (17:45 +0000)]
[SLSR] S's basis must have the same type as S

llvm-svn: 240910

9 years agoclang-format: Stop old options from overriding new options
Birunthan Mohanathas [Sun, 28 Jun 2015 14:52:34 +0000 (14:52 +0000)]
clang-format: Stop old options from overriding new options

Summary: Depends on D10785.

Reviewers: djasper

Reviewed By: djasper

Subscribers: klimek, cfe-commits

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

llvm-svn: 240909

9 years agoclang-format: Add missing members to FormatStyle::operator==
Birunthan Mohanathas [Sun, 28 Jun 2015 14:52:01 +0000 (14:52 +0000)]
clang-format: Add missing members to FormatStyle::operator==

Summary: Depends on D10784.

Reviewers: djasper

Reviewed By: djasper

Subscribers: dblaikie, klimek, cfe-commits

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

llvm-svn: 240908

9 years agoclang-format: Alphabetize FormatStyle members
Birunthan Mohanathas [Sun, 28 Jun 2015 14:51:17 +0000 (14:51 +0000)]
clang-format: Alphabetize FormatStyle members

Reviewers: djasper

Reviewed By: djasper

Subscribers: klimek, cfe-commits

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

llvm-svn: 240907

9 years ago[x86][AVX512]
Asaf Badouh [Sun, 28 Jun 2015 14:30:39 +0000 (14:30 +0000)]
[x86][AVX512]
Add vscalef support
include encoding and intrinsics

review:
http://reviews.llvm.org/D10730

llvm-svn: 240906

9 years agoAVX-512: Added all SKX forms of GATHER instructions.
Elena Demikhovsky [Sun, 28 Jun 2015 10:53:29 +0000 (10:53 +0000)]
AVX-512: Added all SKX forms of GATHER instructions.
Added intrinsics.
Added encoding and tests.

llvm-svn: 240905

9 years ago[Driver] x86-64 Windows is always PIC
David Majnemer [Sun, 28 Jun 2015 04:23:33 +0000 (04:23 +0000)]
[Driver] x86-64 Windows is always PIC

This fixes PR23963.

llvm-svn: 240902

9 years agoCOFF: Remove a function that doesn't do much itself. NFC.
Rui Ueyama [Sun, 28 Jun 2015 03:05:38 +0000 (03:05 +0000)]
COFF: Remove a function that doesn't do much itself. NFC.

llvm-svn: 240901

9 years agoCOFF: Handle LINK environment variable.
Rui Ueyama [Sun, 28 Jun 2015 02:35:31 +0000 (02:35 +0000)]
COFF: Handle LINK environment variable.

If LINK is defined and not empty, it's supposed to contain
command line options.

llvm-svn: 240900

9 years agoCOFF: Remove useless "explicit".
Rui Ueyama [Sun, 28 Jun 2015 02:00:33 +0000 (02:00 +0000)]
COFF: Remove useless "explicit".

llvm-svn: 240899

9 years agoCOFF: Make doICF non-recursive. NFC.
Rui Ueyama [Sun, 28 Jun 2015 01:35:59 +0000 (01:35 +0000)]
COFF: Make doICF non-recursive. NFC.

llvm-svn: 240898

9 years agoCOFF: Fix ICF correctness bug.
Rui Ueyama [Sun, 28 Jun 2015 01:30:54 +0000 (01:30 +0000)]
COFF: Fix ICF correctness bug.

When comparing two COMDAT sections, we need to take section values
and associative sections into account. This patch fixes that bug.
It fixes a crash bug of llvm-tblgen when linked with /opt:lldicf.

One thing I don't understand yet is that this logic seems to be
too strict. MSVC linker is able to create more compact executables
(which of course work correctly). With this ICF algorithm, LLD is
able to make executable smaller, but the outputs are larger than
MSVC's. There must be something I'm missing here.

llvm-svn: 240897

9 years agoclang-format: Support @autoreleasepool.
Nico Weber [Sun, 28 Jun 2015 01:06:16 +0000 (01:06 +0000)]
clang-format: Support @autoreleasepool.

Format @autoreleasepool properly for the Attach brace style
by recognizing @autoreleasepool as a block introducer.

Patch from Strager Neds!
http://reviews.llvm.org/D10372

llvm-svn: 240896

9 years agoReplace `rm -rf` with more portable implementation.
Chaoren Lin [Sat, 27 Jun 2015 23:11:34 +0000 (23:11 +0000)]
Replace `rm -rf` with more portable implementation.

Reviewers: clayborg, vharron

Subscribers: lldb-commits

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

llvm-svn: 240895

9 years agotimegm in LibcGlue needs to be extern, not static.
Chaoren Lin [Sat, 27 Jun 2015 23:11:32 +0000 (23:11 +0000)]
timegm in LibcGlue needs to be extern, not static.

Reviewers: vharron

Reviewed By: vharron

Subscribers: lldb-commits

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

llvm-svn: 240894

9 years agoRevert "Debug Info: One more bitfield bugfix. While yesterday's r240853 fixed"
Adrian Prantl [Sat, 27 Jun 2015 21:55:00 +0000 (21:55 +0000)]
Revert "Debug Info: One more bitfield bugfix. While yesterday's r240853 fixed"

This reverts commit 240890. Breaking the gdb buildbot.

llvm-svn: 240893

9 years agoDon't use %llc_dwarf for target-specific tests.
Benjamin Kramer [Sat, 27 Jun 2015 21:11:43 +0000 (21:11 +0000)]
Don't use %llc_dwarf for target-specific tests.

Should fix running them on windows.

llvm-svn: 240892

9 years ago[SDAG] Now that we have a way to communicate the exact bit on sdiv use it to simplify...
Benjamin Kramer [Sat, 27 Jun 2015 20:33:26 +0000 (20:33 +0000)]
[SDAG] Now that we have a way to communicate the exact bit on sdiv use it to simplify sdiv by a constant.

We had a hack in SDAGBuilder in place to work around this but now we
can avoid that. Call BuildExactSDIV from BuildSDIV so DAGCombiner can
perform this trick automatically.

The added check in DAGCombiner is necessary to prevent exact sdiv by pow2
from regressing as the target-specific pow2 lowering is not aware of
exact bits yet.

This is mostly covered by existing tests. One side effect is that we
get the better lowering for exact vector sdivs now too :)

llvm-svn: 240891

9 years agoDebug Info: One more bitfield bugfix. While yesterday's r240853 fixed
Adrian Prantl [Sat, 27 Jun 2015 20:12:43 +0000 (20:12 +0000)]
Debug Info: One more bitfield bugfix. While yesterday's r240853 fixed
the DW_AT_bit_offset computation, the byte offset is in fact also
endian-dependent as it needs to point to the storage unit containing the
most-significant bit of the the bitfield.
I'm so looking forward to emitting the endian-agnostic DWARF 3 version
instead.

llvm-svn: 240890

9 years ago[Sema] Unions cannot have virtual functions.
Davide Italiano [Sat, 27 Jun 2015 19:18:55 +0000 (19:18 +0000)]
[Sema] Unions cannot have virtual functions.

PR: PR23931
Differential Revision: http://reviews.llvm.org/D10752
Reviewed by:  rsmith

llvm-svn: 240889

9 years agoFix typo. NFC.
Alex Denisov [Sat, 27 Jun 2015 19:04:55 +0000 (19:04 +0000)]
Fix typo. NFC.

llvm-svn: 240888

9 years ago[mips] Fold duplicate big-endian disassembler tests together.
Daniel Sanders [Sat, 27 Jun 2015 17:56:44 +0000 (17:56 +0000)]
[mips] Fold duplicate big-endian disassembler tests together.

llvm-svn: 240887

9 years agoAdd ABI/SysV-mips(64) to Makefile build
Keno Fischer [Sat, 27 Jun 2015 17:31:28 +0000 (17:31 +0000)]
Add ABI/SysV-mips(64) to Makefile build

The Makefile build was broken without this.

llvm-svn: 240886

9 years ago[mips] Sort big-endian disassembler tests by opcode.
Daniel Sanders [Sat, 27 Jun 2015 16:13:59 +0000 (16:13 +0000)]
[mips] Sort big-endian disassembler tests by opcode.

llvm-svn: 240885

9 years ago[mips] Make little-endian disassembler test filenames consistent.
Daniel Sanders [Sat, 27 Jun 2015 15:42:25 +0000 (15:42 +0000)]
[mips] Make little-endian disassembler test filenames consistent.

Most are named *-el.txt. Renamed the three that were *-le.txt

llvm-svn: 240884

9 years ago[mips] Add COP0 register class and use it in M[FT]C0/DM[FT]C0.
Daniel Sanders [Sat, 27 Jun 2015 15:39:19 +0000 (15:39 +0000)]
[mips] Add COP0 register class and use it in M[FT]C0/DM[FT]C0.

Summary:
Previously it (incorrectly) used GPR's.

Patch by Simon Dardis. A couple small corrections by myself.

Reviewers: dsanders

Reviewed By: dsanders

Subscribers: llvm-commits

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

llvm-svn: 240883

9 years ago[OCaml] Bump ctypes dependency to 0.4.
Peter Zotov [Sat, 27 Jun 2015 14:32:30 +0000 (14:32 +0000)]
[OCaml] Bump ctypes dependency to 0.4.

ctypes 0.3 and earlier contains an interface-definig bug:
its ptr_of_raw_address accepts Int64 and not Nativeint. ctypes 0.4
was not released during the 3.6 cycle, and because of that, LLVM 3.6
was released with ctypes 0.3 as a dependency, which now breaks
the build on modern ctypes.

Unbreak.

llvm-svn: 240882

9 years agoProperly initialize Module pointer
Jeroen Ketema [Sat, 27 Jun 2015 12:35:54 +0000 (12:35 +0000)]
Properly initialize Module pointer

llvm-svn: 240881

9 years agoclang-format: Fix language of DisableFormat description
Birunthan Mohanathas [Sat, 27 Jun 2015 09:25:28 +0000 (09:25 +0000)]
clang-format: Fix language of DisableFormat description

This is a comment-only change to test commit access.

llvm-svn: 240879

9 years ago[msan] Fix infinite recursion when _Unwind_Backtrace calls memcpy
Jay Foad [Sat, 27 Jun 2015 08:39:12 +0000 (08:39 +0000)]
[msan] Fix infinite recursion when _Unwind_Backtrace calls memcpy

Summary:
On PPC64, half the msan tests fail with an infinite recursion through
GetStackTrace like this:

#0 __msan::GetStackTrace
#1 __msan_memcpy
#2 ?? () from /lib64/libgcc_s.so.1
#3 ?? () from /lib64/libgcc_s.so.1
#4 _Unwind_Backtrace
#5 __sanitizer::BufferedStackTrace::SlowUnwindStack
#6 __sanitizer::BufferedStackTrace::Unwind
#7 __msan::GetStackTrace
#8 __interceptor_calloc
#9 _dl_allocate_tls
#10 pthread_create@@GLIBC_2.17
#11 __interceptor_pthread_create
#12 main

The problem is that we call _Unwind_Backtrace to get a stack trace; but
_Unwind_Backtrace calls memcpy, which we intercept and try to get
another stack trace.

This patch fixes it in __msan_memcpy by skipping the stack trace if
IsInSymbolizer(). This works because GetStackTrace already creates a
SymbolizerScope to "block reports from our interceptors during
_Unwind_Backtrace".

Reviewers: samsonov, wschmidt, eugenis

Reviewed By: eugenis

Subscribers: llvm-commits

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

llvm-svn: 240878

9 years ago[LoopVectorize] Pointer indicies may be wider than the pointer
David Majnemer [Sat, 27 Jun 2015 08:38:17 +0000 (08:38 +0000)]
[LoopVectorize] Pointer indicies may be wider than the pointer

If we are dealing with a pointer induction variable, isInductionPHI
gives back a step value of Stride / size of pointer.  However, we might
be indexing with a legal type wider than the pointer width.
Handle this by inserting casts where appropriate instead of crashing.

This fixes PR23954.

llvm-svn: 240877

9 years ago[PruneEH] A naked, noinline function can return via InlineAsm
David Majnemer [Sat, 27 Jun 2015 07:52:53 +0000 (07:52 +0000)]
[PruneEH] A naked, noinline function can return via InlineAsm

The PruneEH pass tries to annotate functions as 'noreturn' if it doesn't
see a ReturnInst.  However, a naked function containing inline assembly
can contain control flow leaving the function.

This fixes PR23971.

llvm-svn: 240876

9 years ago[Stackmap] Pre-assemble the stackmap parser test case. (Fix builders).
Lang Hames [Sat, 27 Jun 2015 03:49:25 +0000 (03:49 +0000)]
[Stackmap] Pre-assemble the stackmap parser test case. (Fix builders).

This case had been failing on testers that didn't have x86 support. Rather
than XFAIL it on testers without x86 support, I've just assembled it and used
the raw object as the test input.

llvm-svn: 240875

9 years agollvm/test/CodeGen/X86/xor.ll: Appease Win32 targets since r240796.
NAKAMURA Takumi [Sat, 27 Jun 2015 03:46:58 +0000 (03:46 +0000)]
llvm/test/CodeGen/X86/xor.ll: Appease Win32 targets since r240796.

  %struct.ref_s = type { %union.v, i16, i16 }
  %union.v = type { i64 }

It seems %struct.ref_s is incompatible in tail padding.

llvm-svn: 240874

9 years ago[opt] Inline a trivial lookup function into the header.
Chandler Carruth [Sat, 27 Jun 2015 03:40:10 +0000 (03:40 +0000)]
[opt] Inline a trivial lookup function into the header.

This function is actually *very* hot. It is hard to see currently
because the call graph is very recursive, but I'm working to remove that
and when I do this function becomes significantly higher on the profile
(up to 5%!) and so worth avoiding the call overhead.

No specific perf gain I can measure yet (below the noise), but likely to
have more impact as we stop cluttering the call graph.

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

llvm-svn: 240873

9 years agoSuppress clang/test/CodeGen/builtins-ppc-p8vector.c for -Asserts for now. Will fix...
NAKAMURA Takumi [Sat, 27 Jun 2015 03:33:47 +0000 (03:33 +0000)]
Suppress clang/test/CodeGen/builtins-ppc-p8vector.c for -Asserts for now. Will fix later.

llvm-svn: 240872

9 years agoSwitch the new COFF linker's symbol table to use a DenseMap of
Chandler Carruth [Sat, 27 Jun 2015 02:05:40 +0000 (02:05 +0000)]
Switch the new COFF linker's symbol table to use a DenseMap of
StringRefs. This uses the LLVM hashing rather than the standard library
and a closed addressed hash table rather than chaining.

This improves the Windows self-link of LLD by 4.4% (averaged over 10
runs, with well under 1% of variance on each).

There is still some room to improve here. Two things I clearly see in
the profile:

1) This is one of the biggest stress tests for the LLVM hashing code. It
   actually consumes something like 3-4% of the link time after the
   change.
2) The way that StringRef keys are handled in the DenseMap interface is
   pretty suboptimal. We pay the price of checking for empty and
   tombstone keys when we could only possibly be looking for a normal
   key. But fixing this requires invasive API changes.

So there is still some headroom here.

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

llvm-svn: 240871

9 years ago[MC] Ensure that pending labels are flushed when -mc-relax-all flag is used
Petr Hosek [Sat, 27 Jun 2015 01:54:17 +0000 (01:54 +0000)]
[MC] Ensure that pending labels are flushed when -mc-relax-all flag is used

Summary:
The current implementation doesn't always flush all pending labels
beforeemitting data which can result in an incorrectly placed labels in
case when when instruction bundling is enabled and -mc-relax-all flag is
being used. To address this issue, we always flush pending labels before
emitting data.

The change was tested by running PNaCl toolchain trybots with
-mc-relax-all flag set.

Fixes https://code.google.com/p/nativeclient/issues/detail?id=4063

Test Plan: Regression test attached

Reviewers: mseaborn

Subscribers: jfb, llvm-commits

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

llvm-svn: 240870

9 years ago[MC] Align fragments when -mc-relax-all flag is used
Petr Hosek [Sat, 27 Jun 2015 01:49:53 +0000 (01:49 +0000)]
[MC] Align fragments when -mc-relax-all flag is used

Summary:
Ensure that fragments are bundle aligned when instruction bundling
is enabled and the -mc-relax-all flag is set. This is implicitly
assumed by the bundle padding implementation but this assumption
does not hold when custom alignment is being used.

The change was tested by running PNaCl toolchain trybots with
-mc-relax-all flag set.

Fixes https://code.google.com/p/nativeclient/issues/detail?id=4063

Test Plan: Regression test attached

Reviewers: mseaborn

Subscribers: jfb, llvm-commits

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

llvm-svn: 240869

9 years agoAsmPrinter: Document why DIEValueList uses a linked-list, NFC
Duncan P. N. Exon Smith [Sat, 27 Jun 2015 01:19:17 +0000 (01:19 +0000)]
AsmPrinter: Document why DIEValueList uses a linked-list, NFC

There are two main reasons why a linked-list makes sense for
`DIEValueList`.

 1. We want `DIE` to be on a `BumpPtrAllocator` to improve teardown
    efficiency.  Making `DIEValueList` array-based would make that much
    more complicated.
 2. The singly-linked list is fairly memory efficient.  The histogram
    [1] shows that most DIEs have relatively few values, so we often pay
    less than the 2/3-pointer static overhead of a vector.  Furthermore,
    we don't know ahead of time exactly how many values a `DIE` needs,
    so a vector-like scheme will on average over-allocate by ~50%.  As
    it happens, that's the same memory overhead as the linked list node.

[1]: http://lists.cs.uiuc.edu/pipermail/llvmdev/2015-May/085910.html

The comment I added to the code is a little more succinct, but I think
it's enough to give the idea.

llvm-svn: 240868

9 years agoIR: Expose ModuleSlotTracker in Value::print()
Duncan P. N. Exon Smith [Sat, 27 Jun 2015 00:38:26 +0000 (00:38 +0000)]
IR: Expose ModuleSlotTracker in Value::print()

Allow callers of `Value::print()` and `Metadata::print()` to pass in a
`ModuleSlotTracker`.  This allows them to pay only once for calculating
module-level slots (such as Metadata).

This is related to PR23865, where there was a huge cost for
`MachineFunction::print()`.  Although I don't have a *particular* user
in mind for this new code, I have hit big slowdowns before when running
`opt -debug`, and I think this will be useful.  Going forward, if
someone hits a big slowdown with `print()` statements, they can create a
`ModuleSlotTracker` and send it through.  Similarly, adding support to
`Value::dump()` and `Metadata::dump()` should be trivial.

I added unit tests to be sure the `print()` functions actually behave
the same way with and without the slot tracker.

llvm-svn: 240867

9 years agoLowerBitSets: Ignore bitset entries that do not directly refer to a global.
Peter Collingbourne [Sat, 27 Jun 2015 00:17:51 +0000 (00:17 +0000)]
LowerBitSets: Ignore bitset entries that do not directly refer to a global.

It is possible for a global to be substituted with another global of a
different type or a different kind (i.e. an alias) at IR link time. One
example of this scenario is when a Microsoft ABI vtable is substituted with
an alias referring to a larger vtable containing an RTTI reference.

This will cause the global to be RAUW'd with a possibly bitcasted reference
to the other global. This will of course also affect any references to the
global in bitset metadata.

The right way to handle such metadata is simply to ignore it. This is sound
because the linked module should contain another copy of the bitset entries as
applied to the new global.

llvm-svn: 240866

9 years agoPlug a leak introduced by r240848
Duncan P. N. Exon Smith [Sat, 27 Jun 2015 00:15:32 +0000 (00:15 +0000)]
Plug a leak introduced by r240848

Apparently this obvious leak was never exercised before, but r240848
exposed it.  Plug it.

http://lab.llvm.org:8011/builders/sanitizer-x86_64-linux-fast/builds/5075

llvm-svn: 240865

9 years agoFix some compiler warnings about not using override consistently.
Greg Clayton [Sat, 27 Jun 2015 00:12:59 +0000 (00:12 +0000)]
Fix some compiler warnings about not using override consistently.

llvm-svn: 240864

9 years agoAdd original source code to test case as suggested in review.
Adrian Prantl [Sat, 27 Jun 2015 00:01:33 +0000 (00:01 +0000)]
Add original source code to test case as suggested in review.

llvm-svn: 240863

9 years agoCOFF: Use vector::erase instead of reallocating entire vector. NFC.
Rui Ueyama [Fri, 26 Jun 2015 23:59:13 +0000 (23:59 +0000)]
COFF: Use vector::erase instead of reallocating entire vector. NFC.

llvm-svn: 240862

9 years agoAdd test for SBValue.GetNonSyntheticValue in presence of synth provider.
Siva Chandra [Fri, 26 Jun 2015 23:57:38 +0000 (23:57 +0000)]
Add test for SBValue.GetNonSyntheticValue in presence of synth provider.

Test Plan: dotest.py -p TestFormattersSBAPI

Reviewers: granata.enrico

Reviewed By: granata.enrico

Subscribers: lldb-commits

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

llvm-svn: 240861

9 years ago[StackMaps] Add a lightweight parser for stackmap version 1 sections.
Lang Hames [Fri, 26 Jun 2015 23:56:53 +0000 (23:56 +0000)]
[StackMaps] Add a lightweight parser for stackmap version 1 sections.

The parser provides a convenient interface for reading llvm stackmap v1 sections
in object files.

This patch also includes a new option for llvm-readobj, '-stackmap', which uses
the parser to pretty-print stackmap sections for debugging/testing purposes.

llvm-svn: 240860

9 years agoCOFF: Avoid vector reallocation. NFC.
Rui Ueyama [Fri, 26 Jun 2015 23:51:45 +0000 (23:51 +0000)]
COFF: Avoid vector reallocation. NFC.

llvm-svn: 240859

9 years ago[asan] Disable 3 tests on Android.
Evgeniy Stepanov [Fri, 26 Jun 2015 23:44:43 +0000 (23:44 +0000)]
[asan] Disable 3 tests on Android.

Different reasons for failing; see source file comments.

llvm-svn: 240858

9 years ago[asan] Add -pie to uninstrumented executables on interface_test.cc
Evgeniy Stepanov [Fri, 26 Jun 2015 23:43:03 +0000 (23:43 +0000)]
[asan] Add -pie to uninstrumented executables on interface_test.cc

This helps Android (which only support PIE) and does not hurt anything else.

llvm-svn: 240857

9 years ago[asan] Enable 2 tests on Android.
Evgeniy Stepanov [Fri, 26 Jun 2015 23:41:50 +0000 (23:41 +0000)]
[asan] Enable 2 tests on Android.

Due to bionic improvements and "recent" sized-delete changes in clang.

llvm-svn: 240856

9 years ago[asan] Disable -O1,-O2,-O3 in clang_gcc_abi.cc test.
Evgeniy Stepanov [Fri, 26 Jun 2015 23:40:27 +0000 (23:40 +0000)]
[asan] Disable -O1,-O2,-O3 in clang_gcc_abi.cc test.

A workaround for PR23971.
Fixes the test on Android.

llvm-svn: 240855