platform/upstream/llvm.git
8 years agoEnabling TSan tests, they should work now.
Kuba Brecka [Tue, 5 Apr 2016 13:59:45 +0000 (13:59 +0000)]
Enabling TSan tests, they should work now.

llvm-svn: 265396

8 years agoFix ThreadSanitizer test cases to work on OS X 10.10 and older.
Kuba Brecka [Tue, 5 Apr 2016 13:57:42 +0000 (13:57 +0000)]
Fix ThreadSanitizer test cases to work on OS X 10.10 and older.

llvm-svn: 265395

8 years ago[llvm-c] Expose LLVM{Get,Set}ModuleIdentifier
Peter Zotov [Tue, 5 Apr 2016 13:56:59 +0000 (13:56 +0000)]
[llvm-c] Expose LLVM{Get,Set}ModuleIdentifier

Patch by Nicole Mazzuca <npmazzuca@gmail.com>.

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

llvm-svn: 265394

8 years ago[FIX] Ensure SAI objects for exit PHIs
Johannes Doerfert [Tue, 5 Apr 2016 13:44:21 +0000 (13:44 +0000)]
[FIX] Ensure SAI objects for exit PHIs

  If all exiting blocks of a SCoP are error blocks and therefor not
  represented we will not generate accesses and consequently no SAI
  objects for exit PHIs. However, they are needed in the code generation
  to generate the merge PHIs between the original and optimized region.
  With this patch we enusre that the SAI objects for exit PHIs exist
  even if all exiting blocks turn out to be eror blocks.

  This fixes the crash reported in PR27207.

llvm-svn: 265393

8 years agoFix TestPlatformProcessConnect after rL265357
Tamas Berghammer [Tue, 5 Apr 2016 13:18:08 +0000 (13:18 +0000)]
Fix TestPlatformProcessConnect after rL265357

llvm-svn: 265392

8 years agoFix a bug in linux core file handling
Pavel Labath [Tue, 5 Apr 2016 13:07:16 +0000 (13:07 +0000)]
Fix a bug in linux core file handling

Summary:
There was a bug in linux core file handling, where if there was a running process with the same
process id as the id in the core file, the core file debugging would fail, as we would pull some
pieces of information (ProcessInfo structure) from the running process instead of the core file.
I fix this by routing the ProcessInfo requests through the Process class and overriding it in
ProcessElfCore to return correct data.

A (slightly convoluted) test is included.

Reviewers: clayborg, zturner

Subscribers: lldb-commits

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

llvm-svn: 265391

8 years ago[mips] MIPSR6 Compact jump support
Simon Dardis [Tue, 5 Apr 2016 12:50:29 +0000 (12:50 +0000)]
[mips] MIPSR6 Compact jump support

This patch adds support for compact jumps similiar to the previous compact
branch support for MIPSR6. Unlike compact branches, compact jumps do not
have a forbidden slot.

As MipsInstrInfo::getEquivalentCompactForm can determine the correct
expansion for jumps and branches for both microMIPS and MIPSR6, remove the
unnecessary distinction in the delay slot filler.

Reviewers: vkalintiris

Subscribers: llvm-commits, dsanders
llvm-svn: 265390

8 years ago[NVPTX] Handle ldg created from sign-/zero-extended load
Justin Holewinski [Tue, 5 Apr 2016 12:38:01 +0000 (12:38 +0000)]
[NVPTX] Handle ldg created from sign-/zero-extended load

Reviewers: jingyue

Subscribers: jholewinski

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

llvm-svn: 265389

8 years agoAdds the ability to use an epilog remainder loop during loop unrolling and makes
David L Kreitzer [Tue, 5 Apr 2016 12:19:35 +0000 (12:19 +0000)]
Adds the ability to use an epilog remainder loop during loop unrolling and makes
this the default behavior.

Patch by Evgeny Stupachenko (evstupac@gmail.com).

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

llvm-svn: 265388

8 years agoSet the thumb flag for thumb symbols coming from an ELF file
Tamas Berghammer [Tue, 5 Apr 2016 12:11:40 +0000 (12:11 +0000)]
Set the thumb flag for thumb symbols coming from an ELF file

Without setting the flag there is no way to determine if a symbol
points to an arm or to a thumb function as the LSB of the address
masked out in all getter function.

Note: Currently the thumb flag is only used for MachO files so
adding a test to this change is not possible. It will be used
by the upcoming fix for llvm-objdump for disassembling thumb
functions what is easily testable.

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

llvm-svn: 265387

8 years agoRemove redundant argument. NFC.
Rafael Espindola [Tue, 5 Apr 2016 11:47:46 +0000 (11:47 +0000)]
Remove redundant argument. NFC.

llvm-svn: 265386

8 years agoclang-format: Fix cast detection on "this".
Daniel Jasper [Tue, 5 Apr 2016 11:46:06 +0000 (11:46 +0000)]
clang-format: Fix cast detection on "this".

Before:
  auto x = (X) this;

After:
  auto x = (X)this;

This fixes llvm.org/PR27198.

llvm-svn: 265385

8 years ago[clang-tidy] Add a check to detect static definitions in anonymous namespace.
Haojian Wu [Tue, 5 Apr 2016 11:42:08 +0000 (11:42 +0000)]
[clang-tidy] Add a check to detect static definitions in anonymous namespace.

Summary: Fixes PR26595

Reviewers: alexfh

Subscribers: cfe-commits

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

llvm-svn: 265384

8 years agoAdd parentheses around `&&` within `||` to avoid compiler warning message.
Haojian Wu [Tue, 5 Apr 2016 09:07:47 +0000 (09:07 +0000)]
Add parentheses around `&&` within `||` to avoid compiler warning message.

Summary: The assert code is introduced by r265370.

Reviewers: bkramer

Subscribers: tejohnson

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

llvm-svn: 265383

8 years ago[IFUNC] Use GlobalIndirectSymbol when aliases and ifuncs have something similar
Dmitry Polukhin [Tue, 5 Apr 2016 08:47:51 +0000 (08:47 +0000)]
[IFUNC] Use GlobalIndirectSymbol when aliases and ifuncs have something similar

Second part extracted from http://reviews.llvm.org/D15525

Use GlobalIndirectSymbol in all cases when aliases and ifuncs have
something in common.

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

llvm-svn: 265382

8 years agoConsolidate and improve the handling of built-in feature-like macros
Andy Gibbs [Tue, 5 Apr 2016 08:36:47 +0000 (08:36 +0000)]
Consolidate and improve the handling of built-in feature-like macros

Summary:
The parsing logic has been separated out from the macro implementation logic, leading to a number of improvements:

* Gracefully handle unexpected/invalid tokens, too few, too many and nested parameters
* Provide consistent behaviour between all built-in feature-like macros
* Simplify the implementation of macro logic
* Fix __is_identifier to correctly return '0' for non-identifiers

Reviewers: doug.gregor, rsmith

Subscribers: rsmith, cfe-commits

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

llvm-svn: 265381

8 years agoScopInfo: Check for possibly nested GEP in fixed-size delin
Tobias Grosser [Tue, 5 Apr 2016 06:23:45 +0000 (06:23 +0000)]
ScopInfo: Check for possibly nested GEP in fixed-size delin

We currently only consider the first GEP when delinearizing access functions,
which makes us loose information about additional index expression offsets,
which results in our SCoP model to be incorrect. With this patch we now
compare the base pointers used to ensure we do not miss any additional offsets.
This fixes llvm.org/PR27195.

We may consider supporting nested GEP in our delinearization heuristics in
the future.

llvm-svn: 265379

8 years ago[tsan] Fix freebsd build.
Yabin Cui [Tue, 5 Apr 2016 05:37:48 +0000 (05:37 +0000)]
[tsan] Fix freebsd build.

Summary:
Freebsd doesn't have <sys/personality.h>, so call personality() only in
SANITIZER_LINUX.

Reviewers: llvm-commits, dvyukov, zatrazz, rengolin, beanz

Subscribers: beanz, emaste

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

llvm-svn: 265378

8 years agoConsolidate the knowledge of what arm cores are always executing
Jason Molenda [Tue, 5 Apr 2016 05:01:30 +0000 (05:01 +0000)]
Consolidate the knowledge of what arm cores are always executing
in thumb mode into one method in ArchSpec, replace checks for
specific cores in the disassembler with calls to this.  Also call
this from the arm instruction emulation code.

The determination of whether a given ArchSpec is thumb-only is still
a bit of a hack, but at least the hack is consolidated into a single
place.  In my original version of this patch http://reviews.llvm.org/D13578
I was calling into llvm's feature arm feature tables to make this
determination, like

#include "llvm/Support/TargetRegistry.h"
#include "llvm/MC/MCSubtargetInfo.h"
#include "llvm/../../lib/Target/ARM/ARMGenRegisterInfo.inc"
#include "llvm/../../lib/Target/ARM/ARMFeatures.h"

[...]

        std::string triple (GetTriple().getTriple());
        const char *cpu = "";
        const char *features_str = "";
        const llvm::Target *curr_target = llvm::TargetRegistry::lookupTarget(triple.c_str(), Error);
        std::unique_ptr<llvm::MCSubtargetInfo> subtarget_info_up (curr_target->createMCSubtargetInfo(triple.c_str(), cpu, features_str));
        if (subtarget_info_up->getFeatureBits()[llvm::ARM::FeatureNoARM])
        {
            return true;
        }

but those tables are post-llvm-build generated and linking against them
for all of our different build system methods was a big hiccup that I
haven't had time to revisit convincingly.

I'll keep that reviews.llvm.org patch around to remind myself that I
need to take another run at linking against the necessary tables
again in llvm.

<rdar://problem/23022803>

llvm-svn: 265377

8 years ago[Support] Fix an invalid character escaping in string literal (unittest).
Etienne Bergeron [Tue, 5 Apr 2016 01:46:26 +0000 (01:46 +0000)]
[Support] Fix an invalid character escaping in string literal (unittest).

Summary:
A character within a string literal is not escaped correctly.
In this case, there is no semantic change because the invalid character turn out to be NUL anyway.

note: "\0x12" is equivalent to {0, 'x', '1', '2'} and not { 12 }.

This issue was found by clang-tidy.

Reviewers: rnk

Subscribers: cfe-commits

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

llvm-svn: 265376

8 years ago[clang-tidy] Fix documentation of misc-suspicious-missing-comma
Etienne Bergeron [Tue, 5 Apr 2016 01:41:02 +0000 (01:41 +0000)]
[clang-tidy] Fix documentation of misc-suspicious-missing-comma

Summary:
The clang-tidy documentation generation was broken since commit : http://reviews.llvm.org/D18457

I ran locally the documentation generation and I fixed errors related to that specific check.

Reviewers: alexfh

Subscribers: cfe-commits

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

llvm-svn: 265375

8 years agoFix another case of propagating IsUsedRegularObj.
Rafael Espindola [Tue, 5 Apr 2016 01:38:43 +0000 (01:38 +0000)]
Fix another case of propagating IsUsedRegularObj.

I have an idea on how to clean this up, but lets get the tests passing
first.

llvm-svn: 265374

8 years agoAdd triple to llvm-mc command line. Should fix Windows bot.
Peter Collingbourne [Tue, 5 Apr 2016 01:05:42 +0000 (01:05 +0000)]
Add triple to llvm-mc command line. Should fix Windows bot.

llvm-svn: 265373

8 years agoELF: Make SymbolBody::compare a non-template function.
Peter Collingbourne [Tue, 5 Apr 2016 00:47:58 +0000 (00:47 +0000)]
ELF: Make SymbolBody::compare a non-template function.

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

llvm-svn: 265372

8 years agoELF: Preserve MustBeInDynSym for bitcode symbols.
Peter Collingbourne [Tue, 5 Apr 2016 00:47:55 +0000 (00:47 +0000)]
ELF: Preserve MustBeInDynSym for bitcode symbols.

Make sure to copy the MustBeInDynSym field when replacing shared symbols with
bitcode symbols, and when replacing bitcode symbols with regular symbols
in addCombinedLtoObject. Fixes interposition of DSO symbols with bitcode
symbols in the main executable.

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

llvm-svn: 265371

8 years ago[ThinLTO] Refactor some common code into getGlobalValueInfo method (NFC)
Teresa Johnson [Tue, 5 Apr 2016 00:40:16 +0000 (00:40 +0000)]
[ThinLTO] Refactor some common code into getGlobalValueInfo method (NFC)

Refactor common code that queries the ModuleSummaryIndex for a value's
GlobalValueInfo struct into getGlobalValueInfo helper methods, which
will also be used by D18763.

llvm-svn: 265370

8 years agoDocs: dampen story time for atomics
JF Bastien [Tue, 5 Apr 2016 00:31:25 +0000 (00:31 +0000)]
Docs: dampen story time for atomics

Story time was nice a few years ago, but by now it's nice to state how things are, rather than explain the diff from ye olden atomic history. These were dark times.

llvm-svn: 265369

8 years agoLanai: fix -Wsign-compare warning
JF Bastien [Tue, 5 Apr 2016 00:20:27 +0000 (00:20 +0000)]
Lanai: fix -Wsign-compare warning

llvm-svn: 265368

8 years agoDon't fold double constant to an integer if dest type not integral
Teresa Johnson [Mon, 4 Apr 2016 23:50:46 +0000 (23:50 +0000)]
Don't fold double constant to an integer if dest type not integral

Summary:
I encountered this issue when constant folding during inlining tried to
fold away a bitcast of a double to an x86_mmx, which is not an integral
type. The test case exposes the same issue with a smaller code snippet
during early CSE.

Subscribers: llvm-commits

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

llvm-svn: 265367

8 years ago[tsan] Disable randomized address space on aarch64 linux.
Yabin Cui [Mon, 4 Apr 2016 23:48:25 +0000 (23:48 +0000)]
[tsan] Disable randomized address space on aarch64 linux.

Summary:
After patch https://lkml.org/lkml/2015/12/21/340 is introduced in
linux kernel, the random gap between stack and heap is increased
from 128M to 36G on 39-bit aarch64. And it is almost impossible
to cover this big range. So we need to disable randomized virtual
space on aarch64 linux.

Reviewers: llvm-commits, zatrazz, dvyukov, rengolin

Subscribers: aemerson, rengolin, tberghammer, danalbert, srhines

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

llvm-svn: 265366

8 years agoLanai: fix -Wpedantic warnings
JF Bastien [Mon, 4 Apr 2016 23:47:30 +0000 (23:47 +0000)]
Lanai: fix -Wpedantic warnings

Extra semicolon.

llvm-svn: 265365

8 years agoMove local helper class into anonymous namespace.
Richard Smith [Mon, 4 Apr 2016 23:29:43 +0000 (23:29 +0000)]
Move local helper class into anonymous namespace.

llvm-svn: 265364

8 years agoRemove unused internal routines. No functional change
Marshall Clow [Mon, 4 Apr 2016 23:23:35 +0000 (23:23 +0000)]
Remove unused internal routines. No functional change

llvm-svn: 265363

8 years agoFix test failure from r265361
Reid Kleckner [Mon, 4 Apr 2016 23:14:14 +0000 (23:14 +0000)]
Fix test failure from r265361

llvm-svn: 265362

8 years agoFix non-determinism in order of LLVM attributes
Reid Kleckner [Mon, 4 Apr 2016 23:06:05 +0000 (23:06 +0000)]
Fix non-determinism in order of LLVM attributes

We were using array_pod_sort on an array of type 'Attribute', which
wraps a pointer to AttributeImpl. For the most part this didn't matter
because the printing code prints enum attributes in a defined order, but
integer attributes such as 'align' and 'dereferenceable' were not
ordered.

Furthermore, AttributeImpl::operator< was broken for integer attributes.
An integer attribute is a kind and an integer value, and both pieces
need to be compared.

By fixing the comparison operator, we can go back to std::sort, and
things look good now.  This should fix clang arm-swiftcall.c test
failures on Windows.

llvm-svn: 265361

8 years agouse range loop; NFCI
Sanjay Patel [Mon, 4 Apr 2016 23:05:06 +0000 (23:05 +0000)]
use range loop; NFCI

llvm-svn: 265360

8 years agoSet the default C standard to C99 when targeting the PS4.
Sunil Srivastava [Mon, 4 Apr 2016 22:56:05 +0000 (22:56 +0000)]
Set the default C standard to C99 when targeting the PS4.

Patch by Douglas Yung!

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

llvm-svn: 265359

8 years agoPut back the undefs that Richard removed. Boost won't build w/o these; specifically...
Marshall Clow [Mon, 4 Apr 2016 22:49:20 +0000 (22:49 +0000)]
Put back the undefs that Richard removed. Boost won't build w/o these; specifically the file 'bytes_methods.h' in Apple's python framework defines these.

llvm-svn: 265358

8 years agoImprove the way LLDB escapes arguments before passing them to the shell
Enrico Granata [Mon, 4 Apr 2016 22:46:38 +0000 (22:46 +0000)]
Improve the way LLDB escapes arguments before passing them to the shell

Teach LLDB that different shells have different characters they are sensitive to, and use that knowledge to do shell-aware escaping

This helps solve a class of problems on OS X where LLDB would try to launch via sh, and run into problems if the command line being passed to the inferior contained such special markers (hint: the shell would error out and we'd fail to launch)
This makes those launch scenarios work transparently via shell expansion

Slightly improve the error message when this kind of failure occurs to at least suggest that the user try going through 'process launch' directly

Fixes rdar://problem/22749408

llvm-svn: 265357

8 years agofix typos; NFC
Sanjay Patel [Mon, 4 Apr 2016 22:45:56 +0000 (22:45 +0000)]
fix typos; NFC

llvm-svn: 265356

8 years agoFix "suggest parentheses" warning.
James Y Knight [Mon, 4 Apr 2016 22:35:56 +0000 (22:35 +0000)]
Fix "suggest parentheses" warning.

llvm-svn: 265355

8 years agoELF: Create dynamic symbols for symbol aliases of copy relocations.
Peter Collingbourne [Mon, 4 Apr 2016 22:29:24 +0000 (22:29 +0000)]
ELF: Create dynamic symbols for symbol aliases of copy relocations.

For each copy relocation that we create, look through the DSO's symbol table
for aliases and create a dynamic symbol for each one. This causes the copy
relocation to correctly interpose any aliases.

Copy relocations are relatively uncommon (on my machine, 56% of binaries in
/usr/bin have no copy relocations probably due to being PIEs, 97% of them
have <10, and the binary with the largest number of them has 97) so it's
probably fine to do this in a relatively inefficient way.

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

llvm-svn: 265354

8 years agoStyle update in Core.h/Core.cpp . NFC
Amaury Sechet [Mon, 4 Apr 2016 22:00:25 +0000 (22:00 +0000)]
Style update in Core.h/Core.cpp . NFC

llvm-svn: 265353

8 years agoRevert "CodeGen: Remove dead code in TailDuplicate"
Justin Bogner [Mon, 4 Apr 2016 21:41:54 +0000 (21:41 +0000)]
Revert "CodeGen: Remove dead code in TailDuplicate"

It seems this is reachable after all. It hit on 7zip-benchmark in lnt
on ppc64:

  http://lab.llvm.org:8011/builders/clang-ppc64be-linux-lnt/builds/2317

This reverts r265347.

llvm-svn: 265352

8 years agoMachineScheduler: Ignore COPYs with undef/dead op in CopyConstrain mutation.
Matthias Braun [Mon, 4 Apr 2016 21:23:46 +0000 (21:23 +0000)]
MachineScheduler: Ignore COPYs with undef/dead op in CopyConstrain mutation.

There is no problem with the code today, but the fix will avoid a crash
in test/CodeGen/AMDGPU/subreg-coalescer-undef-use.ll once the
DetectDeadLanes pass is added.

llvm-svn: 265351

8 years agotest: Always treat .mir files as tests even outside of CodeGen/MIR
Matthias Braun [Mon, 4 Apr 2016 21:23:44 +0000 (21:23 +0000)]
test: Always treat .mir files as tests even outside of CodeGen/MIR

We missed a handful of .mir tests that existed outside the
test/CodeGen/MIR directory.

Also fix the three powerpc .mir tests that nobody noticed were broken.

llvm-svn: 265350

8 years agoImplement `target modules dump objfile`
Adrian McCarthy [Mon, 4 Apr 2016 21:21:49 +0000 (21:21 +0000)]
Implement `target modules dump objfile`

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

llvm-svn: 265349

8 years agoClean up calls to WriteBitcodeToFile (NFC)
Teresa Johnson [Mon, 4 Apr 2016 21:19:31 +0000 (21:19 +0000)]
Clean up calls to WriteBitcodeToFile (NFC)

Remove a default parameter value being passed unnecessarily, which
also reduces the changes required when this parameter is changed in
D18763.

Document the remaining non-default bool value passed for another
parameter.

llvm-svn: 265348

8 years agoCodeGen: Remove dead code in TailDuplicate
Justin Bogner [Mon, 4 Apr 2016 21:11:40 +0000 (21:11 +0000)]
CodeGen: Remove dead code in TailDuplicate

I noticed that this isn't covered by our existing tests and spent some
time trying to come up with an example it actually hits. I tried hand
rolling something based on the explanation in the comment, but couldn't
get anything that didn't abort tail duplication earlier for one reason
or another.

Then, I tried cranking tail-dup-size cranked up so this would fire
more and ran a bootstrap of clang and the nightly test suite - those
don't hit this either.

This reverts r132816 and replaces it with an assert.

llvm-svn: 265347

8 years agoclang-format llvm-as.cpp (NFC)
Teresa Johnson [Mon, 4 Apr 2016 21:06:17 +0000 (21:06 +0000)]
clang-format llvm-as.cpp (NFC)

This reduces unrelated changes in other patches (such as D18763) when
changes to this file are clang formatted.

llvm-svn: 265346

8 years agoRe-commit r265039 "[X86] Merge adjacent stack adjustments in eliminateCallFramePseudo...
Hans Wennborg [Mon, 4 Apr 2016 21:02:46 +0000 (21:02 +0000)]
Re-commit r265039 "[X86] Merge adjacent stack adjustments in eliminateCallFramePseudoInstr (PR27140)"

The original commit miscompiled things on 32-bit Windows, e.g. a Clang
boostrap. It turns out that mergeSPUpdates() was a bit too generous in
what it interpreted as a stack adjustment, causing the following code:

        addl    $12, %esp
        leal    -4(%ebp), %esp

To be "optimized" into simply:

        addl    $8, %esp

This commit tightens up mergeSPUpdates() and includes a new test
(test14 in movtopush.ll) for this situation.

llvm-svn: 265345

8 years agoFix an unused-variable warning by using the variable in the place
John McCall [Mon, 4 Apr 2016 20:39:50 +0000 (20:39 +0000)]
Fix an unused-variable warning by using the variable in the place
it was supposed to have been used.

llvm-svn: 265344

8 years ago[CrashReproducer] Pass -I, -F and -resource-dir to the reproducer script when using...
Bruno Cardoso Lopes [Mon, 4 Apr 2016 20:26:57 +0000 (20:26 +0000)]
[CrashReproducer] Pass -I, -F and -resource-dir to the reproducer script when using modules/vfs

The reproducer should use -I/-F/-resource-dir in the same way as the
original command. The VFS already collects the right headers but without
these flags the reproducer will fail to do the right thing.

llvm-svn: 265343

8 years agodisabled TSAN tests until the author can help track down CI failures
Todd Fiala [Mon, 4 Apr 2016 19:58:24 +0000 (19:58 +0000)]
disabled TSAN tests until the author can help track down CI failures

These tests run fine locally for me but are failing on the Green Dragon
OS X CI.

llvm-svn: 265342

8 years ago[Sema] Delete FIXME that has been fixed. NFC.
George Burgess IV [Mon, 4 Apr 2016 19:44:16 +0000 (19:44 +0000)]
[Sema] Delete FIXME that has been fixed. NFC.

llvm-svn: 265341

8 years agoXcode: run gtests when building the lldb-gtest target
Todd Fiala [Mon, 4 Apr 2016 19:40:29 +0000 (19:40 +0000)]
Xcode: run gtests when building the lldb-gtest target

This addresses the following task:
https://llvm.org/bugs/show_bug.cgi?id=27181 Xcode gtests: ensure they run, not just build, on Xcode target

llvm-svn: 265340

8 years agoOMP_WAIT_POLICY changes
Jonathan Peyton [Mon, 4 Apr 2016 19:38:32 +0000 (19:38 +0000)]
OMP_WAIT_POLICY changes

This change has OMP_WAIT_POLICY=active to mean that threads will busy-wait in
spin loops and virtually never go to sleep. OMP_WAIT_POLICY=passive now means
that threads will immediately go to sleep inside a spin loop. KMP_BLOCKTIME was
the previous mechanism to specify this behavior via KMP_BLOCKTIME=0 or
KMP_BLOCKTIME=infinite, but the standard OpenMP environment variable should
also be able to specify this behavior.

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

llvm-svn: 265339

8 years agoFix redundant "typename typename T" in Visual Studio Native Visualizer
Mike Spertus [Mon, 4 Apr 2016 19:36:48 +0000 (19:36 +0000)]
Fix redundant "typename typename T" in Visual Studio Native Visualizer

Also, a little minor cleanup

llvm-svn: 265338

8 years agoEnable unroll for constant bound loops when TripCount is not modulo of unroll factor...
Zia Ansari [Mon, 4 Apr 2016 19:24:46 +0000 (19:24 +0000)]
Enable unroll for constant bound loops when TripCount is not modulo of unroll factor, reducing it to maximum power-of-2 that satisfies threshold limit.

Commit for Evgeny Stupachenko (evstupac@gmail.com)

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

llvm-svn: 265337

8 years agoRevert unintentional change.
Rafael Espindola [Mon, 4 Apr 2016 19:22:51 +0000 (19:22 +0000)]
Revert unintentional change.

resolve can remain private.

Thanks to Rui for noticing it.

llvm-svn: 265336

8 years agoPut these options in sorted order.
Sean Silva [Mon, 4 Apr 2016 19:21:52 +0000 (19:21 +0000)]
Put these options in sorted order.

Feedback from Davide on r265206.

llvm-svn: 265335

8 years agoFix bot errors from r265327, exact GUID which depends on path
Teresa Johnson [Mon, 4 Apr 2016 19:11:00 +0000 (19:11 +0000)]
Fix bot errors from r265327, exact GUID which depends on path

E.g. http://bb.pgr.jp/builders/ninja-x64-msvc-RA-centos6/builds/21919

The source file path name will affect exact GUID, don't try to match
exact value.

llvm-svn: 265334

8 years agoBeef up some dllexport tests.
Sean Silva [Mon, 4 Apr 2016 19:10:55 +0000 (19:10 +0000)]
Beef up some dllexport tests.

Adds some dllexport tests to verify that:
  - Variables in bss are exported appropriately
  - Non-dllexport symbols aliased to dllexport symbols are not exported
  - Symbols declared as dllexport but are not defined are not exported

We plan to enable dllimport/dllexport support for the PS4, and these
additional tests are for points we noticed in our internal testing.

Patch by Warren Ristow!

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

llvm-svn: 265333

8 years agoRename Other -> StOther.
Rui Ueyama [Mon, 4 Apr 2016 19:09:08 +0000 (19:09 +0000)]
Rename Other -> StOther.

"Other" as a name is too generic, so name it StOther.

llvm-svn: 265332

8 years agoRevert r263460: [SpillPlacement] Fix a quadratic behavior in spill placement.
Chandler Carruth [Mon, 4 Apr 2016 18:57:50 +0000 (18:57 +0000)]
Revert r263460: [SpillPlacement] Fix a quadratic behavior in spill placement.

That commit looks wonderful and awesome. Sadly, it greatly exacerbates
PR17409 and effectively regresses build time for a lot of (very large)
code when compiled with ASan or MSan.

We thought this could be fixed forward by landing D15302 which at last
fixes that PR, but some issues were discovered and it looks like that
got reverted, so reverting this as well temporarily. As soon as the fix
for PR17409 lands and sticks, we should re-land this patch as it won't
trigger more significant test cases hitting that bug.

Many thanks to Quentin and Wei here as they're doing all the awesome
hard work!!!

llvm-svn: 265331

8 years ago[PGO] Avoid instrumenting direct callee's at value sites.
Betul Buyukkurt [Mon, 4 Apr 2016 18:56:36 +0000 (18:56 +0000)]
[PGO] Avoid instrumenting direct callee's at value sites.

Direct callees' that are cast to other function prototypes,
show up in the Call/Invoke instructions as ConstantExpr's.
Currently llvm::CallSite's getCalledFunction() fails
to return the callees in such expressions as direct calls.
Value profiling should avoid instrumenting such cases. Mostly NFC.

llvm-svn: 265330

8 years agoARM, AArch64, X86: Check preserved registers for tail calls.
Matthias Braun [Mon, 4 Apr 2016 18:56:13 +0000 (18:56 +0000)]
ARM, AArch64, X86: Check preserved registers for tail calls.

We can only perform a tail call to a callee that preserves all the
registers that the caller needs to preserve.

This situation happens with calling conventions like preserver_mostcc or
cxx_fast_tls. It was explicitely handled for fast_tls and failing for
preserve_most. This patch generalizes the check to any calling
convention.

Related to rdar://24207743

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

llvm-svn: 265329

8 years agoAssignment operators should return by reference.
John McCall [Mon, 4 Apr 2016 18:53:01 +0000 (18:53 +0000)]
Assignment operators should return by reference.

Thanks to Sean Silva for pointing this out.

llvm-svn: 265328

8 years ago[ThinLTO] Add option to dump value name to GUID mapping
Teresa Johnson [Mon, 4 Apr 2016 18:52:58 +0000 (18:52 +0000)]
[ThinLTO] Add option to dump value name to GUID mapping

Summary:
Useful for debugging since we lose this correlation after the permodule
summary/VST is read and until we later materialize source modules in the
function importer.

Reviewers: joker.eph

Subscribers: llvm-commits, joker.eph

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

llvm-svn: 265327

8 years ago[ThinLTO] Augment FunctionImport dump with value name to GUID map
Teresa Johnson [Mon, 4 Apr 2016 18:52:23 +0000 (18:52 +0000)]
[ThinLTO] Augment FunctionImport dump with value name to GUID map

Summary:
To aid in debugging, dump out the correlation between value names and
GUID for each source module when it is materialized. This will make it
easier to comprehend the earlier summary-based function importing debug
trace which only has access to and prints the GUIDs.

Reviewers: joker.eph

Subscribers: llvm-commits, joker.eph

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

llvm-svn: 265326

8 years agoAdd copyright notice to the modulemap file.
Yunzhong Gao [Mon, 4 Apr 2016 18:46:09 +0000 (18:46 +0000)]
Add copyright notice to the modulemap file.

The module.modulemap file in the lib/Headers directory was missing the LLVM
copyright notice. This patch adds the copyright notice just like the rest of
the files in this directory.

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

llvm-svn: 265325

8 years agoIRGen-level lowering for the Swift calling convention.
John McCall [Mon, 4 Apr 2016 18:33:08 +0000 (18:33 +0000)]
IRGen-level lowering for the Swift calling convention.

llvm-svn: 265324

8 years agoAdd a couple of convenience operations to CharUnits.
John McCall [Mon, 4 Apr 2016 18:33:00 +0000 (18:33 +0000)]
Add a couple of convenience operations to CharUnits.

llvm-svn: 265323

8 years agoApply suggestion from HJ Lu to avoid misaligned stack in test
Reid Kleckner [Mon, 4 Apr 2016 18:27:32 +0000 (18:27 +0000)]
Apply suggestion from HJ Lu to avoid misaligned stack in test

Fixes PR27191

llvm-svn: 265322

8 years agofix documentation comments; NFC
Sanjay Patel [Mon, 4 Apr 2016 18:25:06 +0000 (18:25 +0000)]
fix documentation comments; NFC

llvm-svn: 265321

8 years agoAdd comments.
Rui Ueyama [Mon, 4 Apr 2016 18:15:38 +0000 (18:15 +0000)]
Add comments.

llvm-svn: 265320

8 years ago[DependenceAnalysis] Check if result of getConstantPart is null
Brendon Cahoon [Mon, 4 Apr 2016 18:13:18 +0000 (18:13 +0000)]
[DependenceAnalysis] Check if result of getConstantPart is null

A seg-fault occurs due to a reference of a null pointer, which is
the value returned by getConstantPart. This function returns
null if the constant part is not found. The code that calls this
function needs to check for the null return value.

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

llvm-svn: 265319

8 years agoReplace MachineRegisterInfo::isSSA() with a MachineFunctionProperty
Derek Schuff [Mon, 4 Apr 2016 18:03:29 +0000 (18:03 +0000)]
Replace MachineRegisterInfo::isSSA() with a MachineFunctionProperty

Use the MachineFunctionProperty mechanism to indicate whether a MachineFunction
is in SSA form instead of a custom method on MachineRegisterInfo. NFC

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

llvm-svn: 265318

8 years agoRevert r265309 and r265312 because they caused some errors I need to investigate.
Wei Mi [Mon, 4 Apr 2016 17:45:03 +0000 (17:45 +0000)]
Revert r265309 and r265312 because they caused some errors I need to investigate.

llvm-svn: 265317

8 years agoFix -disable-verify test.
Rui Ueyama [Mon, 4 Apr 2016 17:42:01 +0000 (17:42 +0000)]
Fix -disable-verify test.

This test didn't actually test the functionality. The new test
verifies that "-verify" is passed if and only if -disable-verify
is not given.

llvm-svn: 265316

8 years agoXcode: modify lldb-python-test-suite target to build inferiors with $(LLDB_PYTHON_TES...
Todd Fiala [Mon, 4 Apr 2016 17:15:57 +0000 (17:15 +0000)]
Xcode: modify lldb-python-test-suite target to build inferiors with $(LLDB_PYTHON_TESTSUITE_CC)

$(LLDB_PYTHON_TESTSUITE_CC) defaults to the just-built clang.  Together
with changes to the zorg repo, this enables the Green Dragon LLDB OS X
Xcode-based builder to run the new TSAN LLDB tests.

llvm-svn: 265315

8 years agoDocument standard substitutions defined by lit.
Paul Robinson [Mon, 4 Apr 2016 17:14:45 +0000 (17:14 +0000)]
Document standard substitutions defined by lit.

Patch by Guilherme Bufolo!

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

llvm-svn: 265314

8 years agoAdd MachineFunctionProperty checks for AllVRegsAllocated for target passes
Derek Schuff [Mon, 4 Apr 2016 17:09:25 +0000 (17:09 +0000)]
Add MachineFunctionProperty checks for AllVRegsAllocated for target passes

Summary:
This adds the same checks that were added in r264593 to all
target-specific passes that run after register allocation.

Reviewers: qcolombet

Subscribers: jyknight, dsanders, llvm-commits

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

llvm-svn: 265313

8 years agoFix unused var warning caused by r265309.
Wei Mi [Mon, 4 Apr 2016 17:03:58 +0000 (17:03 +0000)]
Fix unused var warning caused by r265309.

llvm-svn: 265312

8 years agoFix test which failed Error migration on Windows bots.
Pete Cooper [Mon, 4 Apr 2016 16:56:09 +0000 (16:56 +0000)]
Fix test which failed Error migration on Windows bots.

Note, this is https://llvm.org/bugs/show_bug.cgi?id=27187.

The problem here was that just converting an error to a bool doesn't
always set the checked bit.  We only set that bit if the Error didn't
actually contain an error.  Otherwise we'd end potentially up silently
dropping it.

Instead just use the consumeError method which is designed to allow us
to drop an error.

llvm-svn: 265311

8 years ago[ELF][MIPS] Extend test case to check LA25 stubs creation for STO_MIPS_PIC symbols...
Simon Atanasyan [Mon, 4 Apr 2016 16:47:31 +0000 (16:47 +0000)]
[ELF][MIPS] Extend test case to check LA25 stubs creation for STO_MIPS_PIC symbols. NFC.

The only way to get an object file with symbols marked by the STO_MIPS_PIC
flag is to link PIC and non-PIC object files and generate a relocatable
output using '-r' command line option. Now LLD is able to generate a relocatable
output but does not mark PIC symbols by the STO_MIPS_PIC flag. So I have
to use binary input mips-sto-pic.o generated by GNU BFD linker.

llvm-svn: 265310

8 years agoReplace analyzeSiblingValues with new algorithm to fix its compile
Wei Mi [Mon, 4 Apr 2016 16:42:40 +0000 (16:42 +0000)]
Replace analyzeSiblingValues with new algorithm to fix its compile
time issue. The patch is to solve PR17409 and its duplicates.

analyzeSiblingValues is a N x N complexity algorithm where N is
the number of siblings generated by reg splitting. Although it
causes siginificant compile time issue when N is large, it is also
important for performance since it removes redundent spills and
enables rematerialization.

To solve the compile time issue, the patch removes analyzeSiblingValues
and replaces it with lower cost alternatives containing two parts. The
first part creates a new spill hoisting method in postOptimization of
register allocation. It does spill hoisting at once after all the spills
are generated instead of inside every instance of selectOrSplit. The
second part queries the define expr of the original register for
rematerializaiton and keep it always available during register allocation
even if it is already dead. It deletes those dead instructions only in
postOptimization. With the two parts in the patch, it can remove
analyzeSiblingValues without sacrificing performance.

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

llvm-svn: 265309

8 years agoSet the architecture type from minidump more precisely. Differentiate i686 v i386...
Adrian McCarthy [Mon, 4 Apr 2016 16:41:16 +0000 (16:41 +0000)]
Set the architecture type from minidump more precisely.  Differentiate i686 v i386 when possible.

llvm-svn: 265308

8 years agoFix for Bug #27193; 'std::acos on complex does not agree with C'. Tests need work...
Marshall Clow [Mon, 4 Apr 2016 16:08:54 +0000 (16:08 +0000)]
Fix for Bug #27193; 'std::acos on complex does not agree with C'. Tests need work; so the bug will stay open.

llvm-svn: 265306

8 years agoRegenerate test file.
Rafael Espindola [Mon, 4 Apr 2016 16:02:39 +0000 (16:02 +0000)]
Regenerate test file.

It had been created with a lld version that was producing an invalid
sh_info.

llvm-svn: 265305

8 years ago[OPENMP] Codegen for teams directive for NVPTX
Carlo Bertolli [Mon, 4 Apr 2016 15:55:02 +0000 (15:55 +0000)]
[OPENMP] Codegen for teams directive for NVPTX

This patch implements the teams directive for the NVPTX backend. It is different from the host code generation path as it:

Does not call kmpc_fork_teams. All necessary teams and threads are started upon touching the target region, when launching a CUDA kernel, and their execution is coordinated through sequential and parallel regions within the target region.
Does not call kmpc_push_num_teams even if a num_teams of thread_limit clause is present. Setting the number of teams and the thread limit is implemented by the nvptx-related runtime.
Please note that I am now passing a Clang Expr * to emitPushNumTeams instead of the originally chosen llvm::Value * type. The reason for that is that I want to avoid emitting expressions for num_teams and thread_limit if they are not needed in the target region.

http://reviews.llvm.org/D17963

llvm-svn: 265304

8 years ago[clang-tidy] Reduce false-positive ratio in misc-suspicious-missing-comma check.
Etienne Bergeron [Mon, 4 Apr 2016 15:46:38 +0000 (15:46 +0000)]
[clang-tidy] Reduce false-positive ratio in misc-suspicious-missing-comma check.

Summary:
This patch is adding detection of common string literal patterns
that should not trigger warnings.

  [*] Add a limit on the number of concatenated token,
  [*] Add support for parenthese sequence of tokens,
  [*] Add detection of valid indentation.

As an example, this code will no longer trigger a warning:
```
const char* Array[] = {
  "first literal"
    "indented literal"
    "indented literal",
  "second literal",
  [...]
```

Reviewers: alexfh

Subscribers: cfe-commits

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

llvm-svn: 265303

8 years ago[mips] Range check simm32 and fold MIPS16's imm32 into simm32.
Daniel Sanders [Mon, 4 Apr 2016 15:32:49 +0000 (15:32 +0000)]
[mips] Range check simm32 and fold MIPS16's imm32 into simm32.

Summary:
At this point we should be able to enable IAS by default for O32 without
breaking check-all, or recursion.

Reviewers: vkalintiris

Subscribers: dsanders, llvm-commits

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

llvm-svn: 265302

8 years agoAnnotateFunctions: Tweak for mingw.
NAKAMURA Takumi [Mon, 4 Apr 2016 15:30:44 +0000 (15:30 +0000)]
AnnotateFunctions: Tweak for mingw.

  - Externalize the registry.
  - Update libdeps.

llvm-svn: 265301

8 years ago[asan,tsan] Make Darwin-specific tests more stable (use ignore_interceptors_accesses...
Kuba Brecka [Mon, 4 Apr 2016 14:54:05 +0000 (14:54 +0000)]
[asan,tsan] Make Darwin-specific tests more stable (use ignore_interceptors_accesses=1 for GCD tests and printf instead of NSLog).

llvm-svn: 265300

8 years agoMake FileSpec handling platform-independent
Pavel Labath [Mon, 4 Apr 2016 14:39:12 +0000 (14:39 +0000)]
Make FileSpec handling platform-independent

Summary:
Even though FileSpec attempted to handle both kinds of path syntaxes (posix and windows) on both
platforms, it relied on the llvm path library to do its work, whose behavior differed on
different platforms. This led to subtle differences in FileSpec behavior between platforms. This
replaces the pieces of the llvm library with our own implementations. The functions are simply
copied from llvm, with #ifdefs replaced by runtime checks for ePathSyntaxWindows.

Reviewers: zturner

Subscribers: lldb-commits

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

llvm-svn: 265299

8 years ago[clang-tidy] fix a couple of modernize-use-override bugs
Alexander Kornienko [Mon, 4 Apr 2016 14:31:36 +0000 (14:31 +0000)]
[clang-tidy] fix a couple of modernize-use-override bugs

Fix for __declspec attributes and const=0 without space

This patch is to address 2 problems I found with Clang-tidy:modernize-use-override.

1: missing spaces on pure function decls.

Orig:
void pure() const=0
Problem:
void pure() constoverride =0
Fixed:
void pure() const override =0

2: This is ms-extension specific, but possibly applies to other attribute types. The override is placed before the attribute which doesn’t work well with declspec as this attribute can be inherited or placed before the method identifier.

Orig:
class __declspec(dllexport) X : public Y

{
void p();
};
Problem:
class override __declspec(dllexport) class X : public Y

{
void p();
};
Fixed:
class __declspec(dllexport) class X : public Y

{
void p() override;
};

Patch by Robert Bolter!

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

llvm-svn: 265298

8 years agoTry to fix the windows build.
Rafael Espindola [Mon, 4 Apr 2016 14:31:20 +0000 (14:31 +0000)]
Try to fix the windows build.

MSVC doesn't want StringRef in an union.

llvm-svn: 265297

8 years ago[SystemZ] Add compare-and-branch instructions to MC
Ulrich Weigand [Mon, 4 Apr 2016 14:26:43 +0000 (14:26 +0000)]
[SystemZ] Add compare-and-branch instructions to MC

This adds MC support for fused compare + indirect branch instructions,
ie. CRB, CGRB, CLRB, CLGRB, CIB, CGIB, CLIB, CLGIB. They aren't actually
generated yet -- this is preparation for their use for conditional
returns in the next iteration of D17339.

Author: koriakin
Differential Revision: http://reviews.llvm.org/D18742

llvm-svn: 265296

8 years agoAdd a PragmaHandler Registry for plugins to add PragmaHandlers to
John Brawn [Mon, 4 Apr 2016 14:22:58 +0000 (14:22 +0000)]
Add a PragmaHandler Registry for plugins to add PragmaHandlers to

This allows plugins which add AST passes to also define pragmas to do things
like only enable certain behaviour of the AST pass in files where a certain
pragma is used.

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

llvm-svn: 265295