platform/upstream/llvm.git
9 years agoList Alexey Bataev as code owner for Clang's OpenMP support, as discussed offline.
Richard Smith [Tue, 12 May 2015 20:29:41 +0000 (20:29 +0000)]
List Alexey Bataev as code owner for Clang's OpenMP support, as discussed offline.

Thanks for all your hard work getting us OpenMP feature-complete, Alexey!

llvm-svn: 237171

9 years ago[PATCH] [HEXAGON] Add a test program to verify calling convention
Sundeep Kushwaha [Tue, 12 May 2015 20:13:10 +0000 (20:13 +0000)]
[PATCH] [HEXAGON] Add a test program to verify calling convention
for large struct return by value.

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

llvm-svn: 237170

9 years agoConvert PHI getIncomingValue() to foreach over incoming_values(). NFC.
Pete Cooper [Tue, 12 May 2015 20:05:31 +0000 (20:05 +0000)]
Convert PHI getIncomingValue() to foreach over incoming_values().  NFC.

We already had a method to iterate over all the incoming values of a PHI.  This just changes all eligible code to use it.

Ineligible code included anything which cared about the index, or was also trying to get the i'th incoming BB.

llvm-svn: 237169

9 years agoAdd a const method to iterator over PHI incoming values.
Pete Cooper [Tue, 12 May 2015 20:05:23 +0000 (20:05 +0000)]
Add a const method to iterator over PHI incoming values.

This will be used in the next commit which converts code to use incoming_values().

llvm-svn: 237168

9 years agoConstify method. NFC
Pete Cooper [Tue, 12 May 2015 20:05:20 +0000 (20:05 +0000)]
Constify method.  NFC

llvm-svn: 237167

9 years ago[Statepoints] Split the calling convention and statepoint flags operand to STATEPOINT...
Pat Gavlin [Tue, 12 May 2015 19:50:19 +0000 (19:50 +0000)]
[Statepoints] Split the calling convention and statepoint flags operand to STATEPOINT into two separate operands.

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

llvm-svn: 237166

9 years agoStrip trailing whitespace. NFC
Douglas Katzman [Tue, 12 May 2015 19:42:31 +0000 (19:42 +0000)]
Strip trailing whitespace. NFC

llvm-svn: 237165

9 years agoR600/SI: Fix bug in VGPR spilling
Tom Stellard [Tue, 12 May 2015 18:59:17 +0000 (18:59 +0000)]
R600/SI: Fix bug in VGPR spilling

AMDGPU::SI_SPILL_V96_RESTORE was missing from a switch statement, which
caused the srsrc and soffset register to not be set correctly.

This commit replaces the switch statement with a SITargetInfo query
to make sure all spill instructions are covered.

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

llvm-svn: 237164

9 years ago[lib/Fuzzer] guess the right number of workers if -jobs=N is given but -workers=M...
Kostya Serebryany [Tue, 12 May 2015 18:51:57 +0000 (18:51 +0000)]
[lib/Fuzzer] guess the right number of workers if -jobs=N is given but -workers=M is not. Update the docs.

llvm-svn: 237163

9 years agoWindows: fix bug in getcwd() and add chdir().
Ted Woodward [Tue, 12 May 2015 18:47:33 +0000 (18:47 +0000)]
Windows: fix bug in getcwd() and add chdir().

Summary:
GetCurrentDirectory() returns the number of characters copied; 0 is a failure, not a success.

Add implementation for chdir().

Reviewers: zturner

Reviewed By: zturner

Subscribers: lldb-commits

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

llvm-svn: 237162

9 years ago[Builtins] Implement half-precision conversions.
Ahmed Bougacha [Tue, 12 May 2015 18:33:42 +0000 (18:33 +0000)]
[Builtins] Implement half-precision conversions.

Mostly uninteresting, except:
- in __extendXfYf2, when checking if the number is normal, the old
  code relied on the unsignedness of src_rep_t, which is a problem
  when sizeof(src_rep_t) < sizeof(int): the result gets promoted to
  int, the signedness of which breaks the comparison.
  I added an explicit cast; it shouldn't affect other types.
- we can't pass __fp16, so src_t and src_rep_t are the same.
- the gnu_*_ieee symbols are simply duplicated definitions, as aliases
  are problematic on mach-o (where only weak aliases are supported;
  that's not what we want).

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

llvm-svn: 237161

9 years agoRevert r237157, "YAML: Fix typos. NFC".
Alex Lorenz [Tue, 12 May 2015 17:44:32 +0000 (17:44 +0000)]
Revert r237157, "YAML: Fix typos. NFC".

'Iff' isn't a typo, it's a shorthand for 'if and only if'.

llvm-svn: 237160

9 years agoFixed double-free in case of module loading error.
Artem Belevich [Tue, 12 May 2015 17:44:15 +0000 (17:44 +0000)]
Fixed double-free in case of module loading error.

GetOutputStream() owns the stream it returns pointer to and the
pointer should never be freed by us. When we fail to load and exit
early, unique_ptr still holds the pointer and frees it which leads to
compiler crash when CompilerInstance attempts to free it again.

Added regression test for failed bitcode linking.

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

llvm-svn: 237159

9 years ago[mips][microMIPSr6] Implement SELEQZ and SELNEZ instructions
Jozef Kolek [Tue, 12 May 2015 17:39:32 +0000 (17:39 +0000)]
[mips][microMIPSr6] Implement SELEQZ and SELNEZ instructions

This patch implements SELEQZ and SELNEZ instructions using mapping.

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

llvm-svn: 237158

9 years agoYAML: Fix typos. NFC.
Alex Lorenz [Tue, 12 May 2015 17:31:17 +0000 (17:31 +0000)]
YAML: Fix typos. NFC.

llvm-svn: 237157

9 years agoReimplement heuristic for estimating complete-unroll optimization effects.
Michael Zolotukhin [Tue, 12 May 2015 17:20:03 +0000 (17:20 +0000)]
Reimplement heuristic for estimating complete-unroll optimization effects.

Summary:
This patch reimplements heuristic that tries to estimate optimization beneftis
from complete loop unrolling.

In this patch I kept the minimal changes - e.g. I removed code handling
branches and folding compares. That's a promising area, but now there
are too many questions to discuss before we can enable it.

Test Plan: Tests are included in the patch.

Reviewers: hfinkel, chandlerc

Subscribers: llvm-commits

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

llvm-svn: 237156

9 years agoImplement sin for double types
Tom Stellard [Tue, 12 May 2015 17:18:47 +0000 (17:18 +0000)]
Implement sin for double types

This implementation was ported from the AMD builtin library
and has been tested with piglit, OpenCV, and the ocl conformance tests.

llvm-svn: 237155

9 years agoImplement cos for double types
Tom Stellard [Tue, 12 May 2015 17:18:46 +0000 (17:18 +0000)]
Implement cos for double types

This implementation was ported from the AMD builtin library
and has been tested with piglit, OpenCV, and the ocl conformance tests.

llvm-svn: 237154

9 years ago[Mips] Return false for isFPCloseToIncomingSP()
Petar Jovanovic [Tue, 12 May 2015 17:14:05 +0000 (17:14 +0000)]
[Mips] Return false for isFPCloseToIncomingSP()

On Mips, frame pointer points to the same side of the frame as the stack
pointer. This function is used to decide where to put register scavenging
spill slot. So far, it was put on the wrong side of the frame, and thus it
was too far away from $fp when frame was larger than 2^15 bytes.

Patch by Vladimir Radosavljevic.

http://reviews.llvm.org/D8895

llvm-svn: 237153

9 years agoR600/SI: add pass to mark CF live ranges as non-spillable
Tom Stellard [Tue, 12 May 2015 17:13:02 +0000 (17:13 +0000)]
R600/SI: add pass to mark CF live ranges as non-spillable

Spilling can insert instructions almost anywhere, and this can mess
up control flow lowering in a multitude of ways, due to instruction
reordering. Let's sort this out the easy way: never spill registers
involved with control flow, i.e. saved EXEC masks.

Unfortunately, this does not work at all with optimizations disabled,
as the register allocator ignores spill weights. This should be
addressed in a future commit.

The test was reduced from the "stacks" shader of [1]. Some issues
trigger the machine verifier while another one is checked manually.

[1] http://madebyevan.com/webgl-path-tracing/

v2: only insert pass with optimizations enabled, merge test runs.

Patch by: Grigori Goronzy

llvm-svn: 237152

9 years agoChanged renaming of local symbols by inserting a dot vefore the numeric suffix
Sunil Srivastava [Tue, 12 May 2015 16:48:43 +0000 (16:48 +0000)]
Changed renaming of local symbols by inserting a dot vefore the numeric suffix
details in http://reviews.llvm.org/D9483
goes with llvm checkin r237150

llvm-svn: 237151

9 years agoChanged renaming of local symbols by inserting a dot vefore the numeric suffix.
Sunil Srivastava [Tue, 12 May 2015 16:47:30 +0000 (16:47 +0000)]
Changed renaming of local symbols by inserting a dot vefore the numeric suffix.
One code change and several test changes to match that
details in http://reviews.llvm.org/D9481

llvm-svn: 237150

9 years ago[sanitizer] Update "sancov.py missing" to allow __sanitizer_cov_with_check().
Sergey Matveev [Tue, 12 May 2015 16:46:54 +0000 (16:46 +0000)]
[sanitizer] Update "sancov.py missing" to allow __sanitizer_cov_with_check().

llvm-svn: 237149

9 years agoDelete dead code. NFC
Jonathan Roelofs [Tue, 12 May 2015 16:45:53 +0000 (16:45 +0000)]
Delete dead code. NFC

llvm-svn: 237148

9 years ago[sanitizer] Override pipefail in coverage-missing test.
Sergey Matveev [Tue, 12 May 2015 16:32:41 +0000 (16:32 +0000)]
[sanitizer] Override pipefail in coverage-missing test.

This should finally fix it.

llvm-svn: 237147

9 years agoComment disambiguation.
Douglas Katzman [Tue, 12 May 2015 15:45:56 +0000 (15:45 +0000)]
Comment disambiguation.

llvm-svn: 237146

9 years ago[DWARF] Add CIE header fields address_size and segment_size when generating dwarf-4
Keith Walker [Tue, 12 May 2015 15:25:08 +0000 (15:25 +0000)]
[DWARF] Add CIE header fields address_size and segment_size when generating dwarf-4

The DWARF-4 specification added 2 new fields in the CIE header called
address_size and segment_size.
Create these 2 new fields when generating dwarf-4 CIE entries, print out
the new fields when dumping the CIE and update tests

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

llvm-svn: 237145

9 years agouse 'auto' to improve readability; NFC
Sanjay Patel [Tue, 12 May 2015 15:15:55 +0000 (15:15 +0000)]
use 'auto' to improve readability; NFC

llvm-svn: 237144

9 years agoR600/SI: Update tablegen defs to avoid restoring spilled sgprs to m0
Tom Stellard [Tue, 12 May 2015 15:00:53 +0000 (15:00 +0000)]
R600/SI: Update tablegen defs to avoid restoring spilled sgprs to m0

We had code to do this in SIRegisterInfo::eliminateFrameIndex(), but
it is easier to just change the definition of SI_SPILL_S32_RESTORE to
only allow numbered sgprs.

llvm-svn: 237143

9 years agoR600/SI: Remove M0Reg register class
Tom Stellard [Tue, 12 May 2015 15:00:52 +0000 (15:00 +0000)]
R600/SI: Remove M0Reg register class

It is no longer used.

llvm-svn: 237142

9 years agoR600/SI: Remove explicit m0 operand from DS instructions
Tom Stellard [Tue, 12 May 2015 15:00:49 +0000 (15:00 +0000)]
R600/SI: Remove explicit m0 operand from DS instructions

Instead add m0 as an implicit operand.  This helps avoid spills
of the m0 register in some cases.

llvm-svn: 237141

9 years agoR600/SI: Remove explicit m0 operand from v_interp instructions
Tom Stellard [Tue, 12 May 2015 15:00:46 +0000 (15:00 +0000)]
R600/SI: Remove explicit m0 operand from v_interp instructions

Instead add m0 as an implicit operand.  This helps avoid spills
of the m0 register in some cases.

llvm-svn: 237140

9 years agofix typos, grammar; NFC
Sanjay Patel [Tue, 12 May 2015 14:52:42 +0000 (14:52 +0000)]
fix typos, grammar; NFC

llvm-svn: 237139

9 years agoImplement atan2pi builtin
Tom Stellard [Tue, 12 May 2015 14:48:26 +0000 (14:48 +0000)]
Implement atan2pi builtin

This implementation was ported from the AMD builtin library
and has been tested with piglit, OpenCV, and the ocl conformance tests.

llvm-svn: 237138

9 years ago[sanitizer] Re-enable a broken test with debug output.
Sergey Matveev [Tue, 12 May 2015 14:43:31 +0000 (14:43 +0000)]
[sanitizer] Re-enable a broken test with debug output.

llvm-svn: 237137

9 years agoFix clang-format build from the solution; the underlying path has changed to include...
Manuel Klimek [Tue, 12 May 2015 14:41:39 +0000 (14:41 +0000)]
Fix clang-format build from the solution; the underlying path has changed to include the VS directory structure.

llvm-svn: 237136

9 years agoXFAIL and Skip flaky test case on linux
Tamas Berghammer [Tue, 12 May 2015 14:25:43 +0000 (14:25 +0000)]
XFAIL and Skip flaky test case on linux

llvm-svn: 237135

9 years agoR600/SI: Make sendmsg test more strict
Tom Stellard [Tue, 12 May 2015 14:18:16 +0000 (14:18 +0000)]
R600/SI: Make sendmsg test more strict

We want to make sure that the m0 copies are being cse'd.

llvm-svn: 237134

9 years agoR600/SI: Remove explicit m0 operand from s_sendmsg
Tom Stellard [Tue, 12 May 2015 14:18:14 +0000 (14:18 +0000)]
R600/SI: Remove explicit m0 operand from s_sendmsg

Instead add m0 as an implicit operand.  This allows us to avoid using
the M0Reg register class and eliminates a number of unnecessary spills
when using s_sendmsg instructions.  This impacts one shader in the
shader-db:

SGPRS: 48 -> 40 (-16.67 %)
VGPRS: 112 -> 108 (-3.57 %)
Code Size: 40132 -> 38796 (-3.33 %) bytes
LDS: 0 -> 0 (0.00 %) blocks
Scratch: 2048 -> 0 (-100.00 %) bytes per wave

llvm-svn: 237133

9 years agoR600/SI: Replace TRI->getRegClass(Reg) with TRI->getPhysRegClass(Reg)
Tom Stellard [Tue, 12 May 2015 14:18:11 +0000 (14:18 +0000)]
R600/SI: Replace TRI->getRegClass(Reg) with TRI->getPhysRegClass(Reg)

TRI->getRegClass() takes a register class ID, not a register.  We were
using this incorrectly in a few places.

llvm-svn: 237132

9 years agoImplement atan2 for doubles
Tom Stellard [Tue, 12 May 2015 13:48:51 +0000 (13:48 +0000)]
Implement atan2 for doubles

This implementation was ported from the AMD builtin library
and has been tested with piglit, OpenCV, and the ocl conformance tests.

llvm-svn: 237131

9 years agopatch to allow lib name at configure time (from C.Bergstrom)
Andrey Churbanov [Tue, 12 May 2015 13:31:57 +0000 (13:31 +0000)]
patch to allow lib name at configure time (from C.Bergstrom)

llvm-svn: 237130

9 years agoAVX-512, X86: Added lowering for shift operations for SKX.
Elena Demikhovsky [Tue, 12 May 2015 13:25:46 +0000 (13:25 +0000)]
AVX-512, X86: Added lowering for shift operations for SKX.
The other changes in the LowerShift() are not functional,
just to make the code more convenient.
So, the functional changes for SKX only.

llvm-svn: 237129

9 years agoCall remote platform GetSupportedArchitectureAtIndex if connected to remote.
Robert Flack [Tue, 12 May 2015 13:22:37 +0000 (13:22 +0000)]
Call remote platform GetSupportedArchitectureAtIndex if connected to remote.

Updated PlatformLinux::GetSupportedArchitectureAtIndex to call the
PlatformRemoteGdbServer::GetSupportedArchitectureAtIndex if connected remotely.
This should return the correct thing for android (to fix those failing tests),
and is also working for mac to linux.

Test Plan:
./dotest.py $DOTEST_OPTS -t -p TestCallStdStringFunction.py
The above still passes when running mac->linux indicating it successfully
identified PlatformLinux as the target platform and converted the mmap options
correctly.

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

llvm-svn: 237128

9 years ago[ARM] Use AEABI aligned function variants
John Brawn [Tue, 12 May 2015 13:13:38 +0000 (13:13 +0000)]
[ARM] Use AEABI aligned function variants

AEABI defines aligned variants of memcpy etc. that can be faster than
the default version due to not having to do alignment checks. When
emitting target code for these functions make use of these aligned
variants if possible. Also convert memset to memclr if possible.

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

llvm-svn: 237127

9 years agoReverse ordering of base and derived pointer during safepoint lowering.
Igor Laevsky [Tue, 12 May 2015 13:12:14 +0000 (13:12 +0000)]
Reverse ordering of base and derived pointer during safepoint lowering.

According to the documentation in StackMap section for the safepoint we should have:
"The first Location in each pair describes the base pointer for the object. The second is the derived pointer actually being relocated."
But before this change we emitted them in reverse order - derived pointer first, base pointer second.

llvm-svn: 237126

9 years agoMissing file runtime/src/include/41/ompt.h.var added; fixed build to optionally use...
Andrey Churbanov [Tue, 12 May 2015 13:10:54 +0000 (13:10 +0000)]
Missing file runtime/src/include/41/ompt.h.var added; fixed build to optionally use added file.

llvm-svn: 237125

9 years agoD9576: Updates documentation to include all possible architecture builds, synchronize...
Andrey Churbanov [Tue, 12 May 2015 12:52:43 +0000 (12:52 +0000)]
D9576: Updates documentation to include all possible architecture builds, synchronizes runtime/README.txt and www/README.txt, updates the building-with-CMake documentation.  This change also changes references of Intel(R) OpenMP Library to LLVM OpenMP Library.

llvm-svn: 237124

9 years agoRemove superfluous SmallString cast.
Yaron Keren [Tue, 12 May 2015 12:47:05 +0000 (12:47 +0000)]
Remove superfluous SmallString cast.

llvm-svn: 237123

9 years ago[X86] Remove useless target specific combine on TRUNCATE dag nodes.
Andrea Di Biagio [Tue, 12 May 2015 12:34:22 +0000 (12:34 +0000)]
[X86] Remove useless target specific combine on TRUNCATE dag nodes.

Before revision 171146, function 'PerformTruncateCombine' used to perform
a premature lowering of TRUNCATE dag nodes.
Revision 171146 then moved all the logic implemented by PerformTruncateCombine
to a custom lowering hook. However, that revision forgot to delete
function PerformTruncateCombine from the code.

This patch removes function 'PerformTruncateCombine' since it has no effect
on the SelectionDAG. No functional change intended.

llvm-svn: 237122

9 years ago[mips][FastISel] Handle calls with non legal types i8 and i16.
Vasileios Kalintiris [Tue, 12 May 2015 12:29:17 +0000 (12:29 +0000)]
[mips][FastISel] Handle calls with non legal types i8 and i16.

Summary: Allow calls with non legal integer types based on i8 and i16 to be processed by mips fast-isel.

Based on a patch by Reed Kotler.

Test Plan:
"Make check" test forthcoming.
Test-suite passes at O0/O2 and with mips32 r1/r2

Reviewers: rkotler, dsanders

Subscribers: llvm-commits, rfuhler

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

llvm-svn: 237121

9 years ago[clang-tidy] Treat all types with non-trivial destructors as RAII.
Alexander Kornienko [Tue, 12 May 2015 12:17:20 +0000 (12:17 +0000)]
[clang-tidy] Treat all types with non-trivial destructors as RAII.

This solves some false negatives at a cost of adding some false positives that
can be fixed easily and (almost) automatically.

llvm-svn: 237120

9 years ago[mips][FastISel] Simplify callabi.ll by using multiple check prefixes.
Vasileios Kalintiris [Tue, 12 May 2015 12:17:11 +0000 (12:17 +0000)]
[mips][FastISel] Simplify callabi.ll by using multiple check prefixes.

Reviewers: dsanders

Subscribers: llvm-commits

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

llvm-svn: 237119

9 years agoDisable GCC optimizations for builtin functions in lldb tests
Ilia K [Tue, 12 May 2015 12:13:12 +0000 (12:13 +0000)]
Disable GCC optimizations for builtin functions in lldb tests

This patch adds new default flag -fno-builtin which forces gcc to not optimize builtin functions.
For example, without this flag GCC replaces printf("hello\n") -> puts("hello") even if -O0 was specified

Also this patch fixes the MiDataTestCase.test_lldbmi_data_disassemble test on Linux/gcc.

llvm-svn: 237118

9 years ago[mips][FastISel] Allow computation of addresses from constant expressions.
Vasileios Kalintiris [Tue, 12 May 2015 12:08:31 +0000 (12:08 +0000)]
[mips][FastISel] Allow computation of addresses from constant expressions.

Summary:
Try to compute addresses when the offset from a memory location is a constant
expression.

Based on a patch by Reed Kotler.

Test Plan:
Passes test-suite for -O0/O2 and mips 32 r1/r2

Reviewers: rkotler, dsanders

Subscribers: llvm-commits, aemerson, rfuhler

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

llvm-svn: 237117

9 years agoFix misleading parameter name for PPCallbacks::FileSkipped.
Nikola Smiljanic [Tue, 12 May 2015 11:48:21 +0000 (11:48 +0000)]
Fix misleading parameter name for PPCallbacks::FileSkipped.

Patch thanks to Vladimir Voskresensky.

llvm-svn: 237116

9 years agoFix misleading parameter name for PPCallbacks::FileSkipped.
Nikola Smiljanic [Tue, 12 May 2015 11:48:05 +0000 (11:48 +0000)]
Fix misleading parameter name for PPCallbacks::FileSkipped.

Patch thanks to Vladimir Voskresensky.

llvm-svn: 237115

9 years agoclang-format: Make member introduced in r237108 const.
Daniel Jasper [Tue, 12 May 2015 11:14:06 +0000 (11:14 +0000)]
clang-format: Make member introduced in r237108 const.

llvm-svn: 237114

9 years agoChange TargetParser enum names to avoid macro conflicts (clang)
Renato Golin [Tue, 12 May 2015 10:34:10 +0000 (10:34 +0000)]
Change TargetParser enum names to avoid macro conflicts (clang)

sys/time.h on Solaris (and possibly other systems) defines "SEC" as "1"
using a cpp macro.  The result is that this fails to compile.

Fixes https://llvm.org/PR23482

llvm-svn: 237113

9 years agoChange TargetParser enum names to avoid macro conflicts (llvm)
Renato Golin [Tue, 12 May 2015 10:33:58 +0000 (10:33 +0000)]
Change TargetParser enum names to avoid macro conflicts (llvm)

sys/time.h on Solaris (and possibly other systems) defines "SEC" as "1"
using a cpp macro.  The result is that this fails to compile.

Fixes https://llvm.org/PR23482

llvm-svn: 237112

9 years agoReturn the correct user register count for arm from NativeRegisterContext
Tamas Berghammer [Tue, 12 May 2015 10:27:45 +0000 (10:27 +0000)]
Return the correct user register count for arm from NativeRegisterContext

The defult implementation falls back to GetRegisterCount what
includes the debug registers also what shouldn't be displayed to
the user.

llvm-svn: 237111

9 years agoclang-format: Fix */& detection for lambdas in macros.
Daniel Jasper [Tue, 12 May 2015 10:20:32 +0000 (10:20 +0000)]
clang-format: Fix */& detection for lambdas in macros.

Before:
  #define MACRO() [](A * a) { return 1; }

After:
  #define MACRO() [](A *a) { return 1; }

llvm-svn: 237109

9 years agoclang-format: Fix hanging nested blocks in macros.
Daniel Jasper [Tue, 12 May 2015 10:16:02 +0000 (10:16 +0000)]
clang-format: Fix hanging nested blocks in macros.

Before:
  #define MACRO()                     \
    Debug(aaa, /* force line break */ \
          {                           \
      int i;                          \
      int j;                          \
          })

After:
  #define MACRO()                     \
    Debug(aaa, /* force line break */ \
          {                           \
            int i;                    \
            int j;                    \
          })

llvm-svn: 237108

9 years agoAVX-512: asm parser errors check
Elena Demikhovsky [Tue, 12 May 2015 09:47:23 +0000 (09:47 +0000)]
AVX-512: asm parser errors check
I reverted the error check that was removed in 236416.
I put the it in a separate file.

llvm-svn: 237107

9 years agoAVX-512: select operation for i1 vectors
Elena Demikhovsky [Tue, 12 May 2015 09:36:52 +0000 (09:36 +0000)]
AVX-512: select operation for i1 vectors
like: select i1 %cond, <16 x i1> %a, <16 x i1> %b.
I added pseudo-CMOV patterns to resolve the "select".
Added tests for KNL and SKX.

llvm-svn: 237106

9 years agoFix MiDataTestCase.test_lldbmi_data_disassemble test on Linux (bug 23489)
Ilia K [Tue, 12 May 2015 09:24:24 +0000 (09:24 +0000)]
Fix MiDataTestCase.test_lldbmi_data_disassemble test on Linux (bug 23489)

llvm-svn: 237105

9 years agoRefactor clang-format's formatter.
Manuel Klimek [Tue, 12 May 2015 09:23:57 +0000 (09:23 +0000)]
Refactor clang-format's formatter.

Summary:
a) Pull out a class LevelIndentTracker whose responsibility is to keep track
   of the indent of levels across multiple annotated lines.
b) Put all responsibility for merging lines into the LineJoiner; make the
   LineJoiner iterate over the lines so we never operate on a line that might
   be merged later; this makes the interface safer to use.
c) Move formatting of the end-of-file whitespace into formatFirstToken.

Fix bugs that became obvious after the refactoring:
1. We would not format lines with offsets correctly inside nested blocks if
   only the outer expression was affected:
   int x = s({ // clang-format only this line
     class X {
       public:
    // ^ this starts at the non-modified indnent level; previously we would
    //   not fix this, now we correctly outdent it.
       void f();
     };
   });
2. We would incorrectly align comments across lines that do not have comments
   for lines with nested blocks:
   int expression; // with comment
   int x = s({
     int y; // comment
     int z; // we would incorrectly align this comment with the comment on
            // 'expression'
   });

llvm-svn: 237104

9 years agoRemove handling of eStateStopped from NativeProcessLinux::Resume
Pavel Labath [Tue, 12 May 2015 09:03:18 +0000 (09:03 +0000)]
Remove handling of eStateStopped from NativeProcessLinux::Resume

Summary:
NPL::Resume attempted to handle eStateStopped as a resume action. However:
- GDBRemoteCommunicationServerLLGS (the only user of NPL) never sets this action
- it could set this action in response to a vCont:t packet, but LLDB never produces this packet
- gdb-remote protocol documentation says vCont:t packet is used only in non-stop mode, but LLDB
  does not support non-stop mode
- even if LLDB supported non-stop mode, this implementation of eStateStopped does something
  different from what the spec says it should (according to spec, it should stop the specified
  thread, but this seems to want to stop all threads).

Given the facts above, I believe we should remove this unused and untested code, as it probably
doesn't even work and removing it makes the rest of the code noticably simpler.

Reviewers: ovyalov, chaoren

Subscribers: lldb-commits

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

llvm-svn: 237103

9 years ago[OPENMP] Allow using of threadprivate variables as loop-control variables in lop...
Alexey Bataev [Tue, 12 May 2015 09:02:07 +0000 (09:02 +0000)]
[OPENMP] Allow using of threadprivate variables as loop-control variables in lop based directives.

llvm-svn: 237102

9 years ago[NativeProcessLinux] Remove event mutex and clean functions using it
Pavel Labath [Tue, 12 May 2015 08:35:33 +0000 (08:35 +0000)]
[NativeProcessLinux] Remove event mutex and clean functions using it

Summary:
Since the former-TSC events are now processed synchronously, there is no need for to protect them
with a separate mutex - all the actions are now guarded by the big m_threads_mutex.

With the mutex gone, the following functions, no longer have any purpose and were removed:
NotifyThreadCreate: replaced by direct calls to ThreadWasCreated
NotifyThreadStop: replaced by direct calls to ThreadDidStop
NotifyThreadDeath: folded into StopTrackingThread
ResetForExec: inlined as it consisted of a single line of code
RequestThreadResume(AsNeeded): replaced by direct calls to ResumeThread
StopThreads: removed, as it was never called

Test Plan: tests continue to pass

Reviewers: ovyalov, chaoren

Subscribers: lldb-commits

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

llvm-svn: 237101

9 years ago[OPENMP] Fixed support for 'schedule' clause with non-constant chunk size.
Alexey Bataev [Tue, 12 May 2015 08:35:28 +0000 (08:35 +0000)]
[OPENMP] Fixed support for 'schedule' clause with non-constant chunk size.

'schedule' clause for combined directives requires additional processing. Special helper variable is generated, that is captured in the outlined parallel region for 'parallel for' region. This captured variable is used to store chunk expression from the 'schedule' clause in this 'parallel for' region.

llvm-svn: 237100

9 years agoRename IslCodeGeneration to CodeGeneration
Tobias Grosser [Tue, 12 May 2015 07:45:52 +0000 (07:45 +0000)]
Rename IslCodeGeneration to CodeGeneration

Besides class, function and file names, we also change the command line option
from -polly-codegen-isl to just -polly-codegen. The isl postfix is a leftover
from the times when we still had the CLooG based -polly-codegen. Today it is
just redundant and we drop it.

llvm-svn: 237099

9 years agoSkip MiDataTestCase.test_lldbmi_data_disassemble test to get Linux build green
Ilia K [Tue, 12 May 2015 07:35:06 +0000 (07:35 +0000)]
Skip MiDataTestCase.test_lldbmi_data_disassemble test to get Linux build green

llvm-svn: 237098

9 years ago[X86] DAGCombine should not assume arbitrary vector types are simple
Michael Kuperstein [Tue, 12 May 2015 07:33:07 +0000 (07:33 +0000)]
[X86] DAGCombine should not assume arbitrary vector types are simple

The X86-specific DAGCombine for stores should not assume vector types are always simple.
This fixes PR23476.

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

llvm-svn: 237097

9 years agoImprove MiStartupOptionsTestCase.test_lldbmi_executable_option_file test (MI)
Ilia K [Tue, 12 May 2015 06:49:49 +0000 (06:49 +0000)]
Improve MiStartupOptionsTestCase.test_lldbmi_executable_option_file test (MI)

llvm-svn: 237096

9 years agoDriver: Fix a -Wshadow issue from r237091
Justin Bogner [Tue, 12 May 2015 06:30:48 +0000 (06:30 +0000)]
Driver: Fix a -Wshadow issue from r237091

The MachO toolchain has an isTargetIOSBased method, but it isn't
virtual so it isn't very meaningful to call it. After thinking about
this, I guess that putting this logic in the MachO class is a bit of a
layering violation anyway. Do this more like how we handle
AddLinkRuntimeLibArgs instead.

llvm-svn: 237095

9 years agoShow error message from failed evaluation when doing -var-create
Ilia K [Tue, 12 May 2015 06:15:16 +0000 (06:15 +0000)]
Show error message from failed evaluation when doing -var-create

Summary:
When -var-create fails, we will now show the error message from the failed evaluation if it is available.

Patch from chuckr@microsoft.com

Test Plan: I fixed the MiVarTestCase.test_lldbmi_eval test to expect the new error string. All MI tests passing on OS X.

Reviewers: abidh, ChuckR

Subscribers: greggm, lldb-commits, paulmaybee

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

llvm-svn: 237094

9 years agoRemove unnecessary forward declaration.
Craig Topper [Tue, 12 May 2015 06:09:57 +0000 (06:09 +0000)]
Remove unnecessary forward declaration.

llvm-svn: 237093

9 years agoEscape strings in disassembly comments.
Ilia K [Tue, 12 May 2015 05:55:23 +0000 (05:55 +0000)]
Escape strings in disassembly comments.

Summary: Patch from chuckr@microsoft.com

Reviewers: abidh, ChuckR

Subscribers: paulmaybee, lldb-commits

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

llvm-svn: 237092

9 years agoRe-apply "Driver: Make profiling flags work with -nostdlib on Darwin"
Justin Bogner [Tue, 12 May 2015 05:44:36 +0000 (05:44 +0000)]
Re-apply "Driver: Make profiling flags work with -nostdlib on Darwin"

This time without a stray "true" in an argument list.

This reverts r237077, restoring r237074.

llvm-svn: 237091

9 years agoRemove unnecessary variables by folding calls into for loop header. NFC.
Craig Topper [Tue, 12 May 2015 05:25:10 +0000 (05:25 +0000)]
Remove unnecessary variables by folding calls into for loop header. NFC.

llvm-svn: 237090

9 years agoTestPublicAPIHeaders.py - Changed expectedFailureDarwin to skipIfDarwin
Vince Harron [Tue, 12 May 2015 05:18:06 +0000 (05:18 +0000)]
TestPublicAPIHeaders.py - Changed expectedFailureDarwin to skipIfDarwin

expectedFailure doesn't work if the failure is in a teardown step.

llvm-svn: 237089

9 years agorevert r237081 -- bad idea (-lcrypt may not be present)
Kostya Serebryany [Tue, 12 May 2015 03:10:42 +0000 (03:10 +0000)]
revert r237081 -- bad idea (-lcrypt may not be present)

llvm-svn: 237086

9 years agoWorking on getting the OSX build green
Vince Harron [Tue, 12 May 2015 02:20:27 +0000 (02:20 +0000)]
Working on getting the OSX build green

Added missing SBLanguageRuntime.h to lldb.xcodeproj, set to Public (fixed compile error in TestPublicAPIHeaders)
Removed reference to (temporarily) missing gtest.xcodeproj
Fixed TestDeadStrip compile error
XFAIL TestPublicAPIHeaders - test passes but teardown command 'settings remove target.env-vars DYLD_LIBRARY_PATH' fails
XFAIL TestCModules - use of undeclared identifier 'MIN'
XFAIL TestModulesAutoImport - clang: error: unknown argument: '-gmodules'
XFAIL TestObjCNewSyntax - expr -- @((char*)"Hello world" + 6) cannot box a string value because NSString has not been declared

http://reviews.llvm.org/D9643

llvm-svn: 237085

9 years agoApply LLDB_API modifier to SBPlatform and SBPlatformShellCommand.
Oleksiy Vyalov [Tue, 12 May 2015 02:04:26 +0000 (02:04 +0000)]
Apply LLDB_API modifier to SBPlatform and SBPlatformShellCommand.

llvm-svn: 237084

9 years ago[lib/Fuzzer] remove the -dfsan=1 flag, just use -use_traces=1 (w/ or w/o dfsan)
Kostya Serebryany [Tue, 12 May 2015 01:58:34 +0000 (01:58 +0000)]
[lib/Fuzzer] remove the -dfsan=1 flag, just use -use_traces=1 (w/ or w/o dfsan)

llvm-svn: 237083

9 years ago[lib/Fuzzer] detach the pulse thread instad of joining it
Kostya Serebryany [Tue, 12 May 2015 01:43:20 +0000 (01:43 +0000)]
[lib/Fuzzer] detach the pulse thread instad of joining it

llvm-svn: 237082

9 years agoadd -lcrypto to clang and clang-format fuzzers (lib/Fuzzer will soon require it)
Kostya Serebryany [Tue, 12 May 2015 01:29:04 +0000 (01:29 +0000)]
add -lcrypto to clang and clang-format fuzzers (lib/Fuzzer will soon require it)

llvm-svn: 237081

9 years agoRemove the code that pulled soft float attributes out of the feature
Eric Christopher [Tue, 12 May 2015 01:26:21 +0000 (01:26 +0000)]
Remove the code that pulled soft float attributes out of the feature
strings and remove the setting of TargetOptions::UseSoftFloat to
match the code change in llvm r237079.

llvm-svn: 237080

9 years agoMigrate existing backends that care about software floating point
Eric Christopher [Tue, 12 May 2015 01:26:05 +0000 (01:26 +0000)]
Migrate existing backends that care about software floating point
to use the information in the module rather than TargetOptions.

We've had and clang has used the use-soft-float attribute for some
time now so have the backends set a subtarget feature based on
a particular function now that subtargets are created based on
functions and function attributes.

For the one middle end soft float check go ahead and create
an overloadable TargetLowering::useSoftFloat function that
just checks the TargetSubtargetInfo in all cases.

Also remove the command line option that hard codes whether or
not soft-float is set by using the attribute for all of the
target specific test cases - for the generic just go ahead and
add the attribute in the one case that showed up.

llvm-svn: 237079

9 years agoGet lldb-server building on android-9
Vince Harron [Tue, 12 May 2015 01:10:56 +0000 (01:10 +0000)]
Get lldb-server building on android-9

Build lldb-server with an android-9 sysroot.

llvm-svn: 237078

9 years agoRevert "Driver: Make profiling flags work with -nostdlib on Darwin"
Justin Bogner [Tue, 12 May 2015 01:04:33 +0000 (01:04 +0000)]
Revert "Driver: Make profiling flags work with -nostdlib on Darwin"

This revert r237074. These tests are failing all over the place.

llvm-svn: 237077

9 years agoChange session log filename pattern: test before arch
Vince Harron [Tue, 12 May 2015 00:50:54 +0000 (00:50 +0000)]
Change session log filename pattern: test before arch

This is a very minor change.

Just reshuffle the elements of the log filename so that the test name
comes before the arch/compiler

Before:
Failure-x86_64-clang-TestCModules.CModulesTestCase.test_expr_with_dwarf.log

After:
Failure-TestCModules.CModulesTestCase.test_expr_with_dwarf-x86_64-clang.log

This way, results are grouped by test name, not by arch. I think this
is much more useful.

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

llvm-svn: 237076

9 years agoRemove Triple Vendor check when creating FreeBSD Platform
Ed Maste [Tue, 12 May 2015 00:43:45 +0000 (00:43 +0000)]
Remove Triple Vendor check when creating FreeBSD Platform

This is equivalent to r237052 in PlatformLinux.cpp.

llvm-svn: 237075

9 years agoDriver: Make profiling flags work with -nostdlib on Darwin
Justin Bogner [Tue, 12 May 2015 00:31:33 +0000 (00:31 +0000)]
Driver: Make profiling flags work with -nostdlib on Darwin

Compiler-rt's Profiling library isn't part of the stdlib, so -nostdlib
shouldn't prevent it from being linked. This makes Darwin behave like
other toolchains, and link in the profile runtime irrespective of
-nostdlib, since the resulting program can't be run unless you link
this.

I've also added a test to show that other toolchains already behave
like this.

llvm-svn: 237074

9 years agoAllow empty assembly string literal with -fno-gnu-inline-asm
Steven Wu [Tue, 12 May 2015 00:16:37 +0000 (00:16 +0000)]
Allow empty assembly string literal with -fno-gnu-inline-asm

Empty assembly string will not introduce assembly code in the output
binary and it is often used as a trick in the header to disable
optimizations. It doesn't conflict with the purpose of the option so it
is allowed with -fno-gnu-inline-asm flag.

llvm-svn: 237073

9 years agoFixing memory leak
Andrew Kaylor [Tue, 12 May 2015 00:13:51 +0000 (00:13 +0000)]
Fixing memory leak

llvm-svn: 237072

9 years agoUpdate initialization of a class variable and comment.
Eric Christopher [Tue, 12 May 2015 00:04:20 +0000 (00:04 +0000)]
Update initialization of a class variable and comment.

llvm-svn: 237071

9 years agoRefactoring gc_relocate related code in CodeGenPrepare.cpp
Sanjoy Das [Mon, 11 May 2015 23:47:30 +0000 (23:47 +0000)]
Refactoring gc_relocate related code in CodeGenPrepare.cpp

Summary:
The original code inserted new instructions by following a
Create->Remove->ReInsert flow. This patch removes the unnecessary
Remove->ReInsert part by setting up the InsertPoint correctly at the
very beginning. This change does not introduce any functionality change.

Patch by Chen Li!

Reviewers: reames, AndyAyers, sanjoy

Reviewed By: sanjoy

Subscribers: llvm-commits

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

llvm-svn: 237070

9 years agoRename variables in gc_relocate related functions to follow LLVM's naming conventions.
Sanjoy Das [Mon, 11 May 2015 23:47:27 +0000 (23:47 +0000)]
Rename variables in gc_relocate related functions to follow LLVM's naming conventions.

Summary:
This patch is to rename some variables to CamelCase in gc_relocate
related functions. There is no functionality change.

Patch by Chen Li!

Reviewers: reames, AndyAyers, sanjoy

Reviewed By: sanjoy

Subscribers: llvm-commits

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

llvm-svn: 237069