platform/upstream/llvm.git
10 years agoRemove BitcodeReader::setBufferOwned.
Rafael Espindola [Wed, 18 Jun 2014 18:55:41 +0000 (18:55 +0000)]
Remove BitcodeReader::setBufferOwned.

We do have use cases for the bitcode reader owning the buffer or not, but we
always know which one we have when we construct it.

It might be possible to simplify this further, but this is a step in the
right direction.

llvm-svn: 211205

10 years agoSimply test for available locations in optimization remarks.
Diego Novillo [Wed, 18 Jun 2014 18:46:58 +0000 (18:46 +0000)]
Simply test for available locations in optimization remarks.

When emitting optimization remarks, we test for the presence of
instruction locations by testing for a valid llvm.dbg.cu annotation.
This is slightly inefficient because we can simply ask whether the
debug location we have is known or not.

Additionally, if my current plan works, I will need to remove the
llvm.dbg.cu annotation from the IL (or prevent it from being generated)
when -Rpass is used without -g.  In those cases, we'll want to generate
line tables but we will want to prevent code generation from emitting
DWARF code for them.

Tested on x86_64.

llvm-svn: 211204

10 years ago[PowerPC] Remove unnecessary load of r12 in indirect call
Ulrich Weigand [Wed, 18 Jun 2014 18:33:36 +0000 (18:33 +0000)]
[PowerPC] Remove unnecessary load of r12 in indirect call

When looking at the 64-bit SVR4 indirect call sequence, I noticed
an unnecessary load of r12.  And indeed the code says:

  // R12 must contain the address of an indirect callee.

But this is not correct; in the 64-bit SVR4 (ELFv1) ABI, there is
no need to load r12 at this point.  It seems this code and comment
is a remnant of code originally shared with the Darwin ABI ...

This patch simply removes the unnecessary load.

llvm-svn: 211203

10 years agoUpdate to the latest registered ELF e_machine names and values.
Rafael Espindola [Wed, 18 Jun 2014 18:30:15 +0000 (18:30 +0000)]
Update to the latest registered ELF e_machine names and values.

Patch by John Wolf!

llvm-svn: 211202

10 years agoRun clang-format in a small chunk of code I am about to change.
Rafael Espindola [Wed, 18 Jun 2014 18:26:53 +0000 (18:26 +0000)]
Run clang-format in a small chunk of code I am about to change.

llvm-svn: 211201

10 years agoAdd an option for debugserver to propagate its environment to programs it launches...
Greg Clayton [Wed, 18 Jun 2014 18:26:50 +0000 (18:26 +0000)]
Add an option for debugserver to propagate its environment to programs it launches using the --forward-env or -F:

% ./debugserver --forward-env localhost:1234 -- /bin/ls
% ./debugserver -F localhost:1234 -- /bin/ls

Also allow new environment variables to be set using the "--env" or "-e":

% ./debugserver --env FOO=1 --env BAR=2 localhost:1234 -- /bin/ls
% ./debugserver -e FOO=1 -e BAR=2 localhost:1234 -- /bin/ls

<rdar://problem/17350654>

llvm-svn: 211200

10 years agoProfileData: Fix copy-paste type in RawInstrProfReader
Justin Bogner [Wed, 18 Jun 2014 18:20:44 +0000 (18:20 +0000)]
ProfileData: Fix copy-paste type in RawInstrProfReader

These deleted definitions had the wrong types.

Patch by Alex L!

llvm-svn: 211199

10 years ago[ARM] [MC] Refactor the constant pool classes
Weiming Zhao [Wed, 18 Jun 2014 18:17:25 +0000 (18:17 +0000)]
[ARM] [MC] Refactor the constant pool classes

ARMTargetStreamer implements ConstantPool and AssmeblerConstantPools
to keep track of assembler-generated constant pools that are used for
ldr-pseudo.

When implementing ldr-pseudo for AArch64, these two classes can be reused.
So this patch factors them out from ARM target to the general MC lib.

llvm-svn: 211198

10 years agoObjective-C. Try to fix the test in buildbot in my last patch.
Fariborz Jahanian [Wed, 18 Jun 2014 18:16:37 +0000 (18:16 +0000)]
Objective-C. Try to fix the test in buildbot in my last patch.

llvm-svn: 211197

10 years agoADT: correct typo in comment
Ed Maste [Wed, 18 Jun 2014 18:08:55 +0000 (18:08 +0000)]
ADT: correct typo in comment

llvm-svn: 211196

10 years agoObjective-C. Attributes on class declarations carry over
Fariborz Jahanian [Wed, 18 Jun 2014 17:58:27 +0000 (17:58 +0000)]
Objective-C. Attributes on class declarations carry over
to forward class declarations for diagnosis.
// rdar://16681279

llvm-svn: 211195

10 years agoR600: Expand vector fceil
Jan Vesely [Wed, 18 Jun 2014 17:57:29 +0000 (17:57 +0000)]
R600: Expand vector fceil

Move fp64 fceil tests to fceil64.ll

v2: rebase

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 211194

10 years ago[PowerPC] Simplify and improve loading into TOC register
Ulrich Weigand [Wed, 18 Jun 2014 17:52:49 +0000 (17:52 +0000)]
[PowerPC] Simplify and improve loading into TOC register

During an indirect function call sequence on the 64-bit SVR4 ABI,
generate code must load and then restore the TOC register.

This does not use a regular LOAD instruction since the TOC
register r2 is marked as reserved.  Instead, the are two
special instruction patterns:

 let RST = 2, DS = 2 in
 def LDinto_toc: DSForm_1a<58, 0, (outs), (ins g8rc:$reg),
                     "ld 2, 8($reg)", IIC_LdStLD,
                     [(PPCload_toc i64:$reg)]>, isPPC64;

 let RST = 2, DS = 10, RA = 1 in
 def LDtoc_restore : DSForm_1a<58, 0, (outs), (ins),
                     "ld 2, 40(1)", IIC_LdStLD,
                     [(PPCtoc_restore)]>, isPPC64;

Note that these not only restrict the destination of the
load to r2, but they also restrict the *source* of the
load to particular address combinations.  The latter is
a problem when we want to support the ELFv2 ABI, since
there the TOC save slot is no longer at 40(1).

This patch replaces those two instructions with a single
instruction pattern that only hard-codes r2 as destination,
but supports generic addresses as source.  This will allow
supporting the ELFv2 ABI, and also helps generate more
efficient code for calls to absolute addresses (allowing
simplification of the ppc64-calls.ll test case).

llvm-svn: 211193

10 years agoWork around ridiculous warning.
Matt Arsenault [Wed, 18 Jun 2014 17:45:58 +0000 (17:45 +0000)]
Work around ridiculous warning.

Apparently C++ doesn't really have hex floating point constants.

llvm-svn: 211192

10 years agoFormatting improvements in the <string_view> synopsis suggested by RSmith. No functio...
Marshall Clow [Wed, 18 Jun 2014 17:44:04 +0000 (17:44 +0000)]
Formatting improvements in the <string_view> synopsis suggested by RSmith. No functionality change.

llvm-svn: 211191

10 years ago[PowerPC] Add back test case for absolute calls (removed in r211174)
Ulrich Weigand [Wed, 18 Jun 2014 17:28:56 +0000 (17:28 +0000)]
[PowerPC] Add back test case for absolute calls (removed in r211174)

As requested by Hal Finkel, this adds back a test for calls to
a known-constant function pointer value, and verifies that the
64-bit SVR4 indirect function call sequence is used.

llvm-svn: 211190

10 years agoMake clang-cl accept .lib inputs (PR20065)
Hans Wennborg [Wed, 18 Jun 2014 17:21:50 +0000 (17:21 +0000)]
Make clang-cl accept .lib inputs (PR20065)

Patch by Ehsan Akhgari!

(Tiny tweak by me: renamed PathSegment to LibDir.)

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

llvm-svn: 211189

10 years agoAdd a triple so that right syntax is choosen on mac osx systems
Arnold Schwaighofer [Wed, 18 Jun 2014 17:20:49 +0000 (17:20 +0000)]
Add a triple so that right syntax is choosen on mac osx systems

llvm-svn: 211188

10 years agoR600/SI: Add intrinsics for brev instructions
Matt Arsenault [Wed, 18 Jun 2014 17:13:57 +0000 (17:13 +0000)]
R600/SI: Add intrinsics for brev instructions

llvm-svn: 211187

10 years agoR600/SI: Prettier operand printing for 64-bit ops.
Matt Arsenault [Wed, 18 Jun 2014 17:13:51 +0000 (17:13 +0000)]
R600/SI: Prettier operand printing for 64-bit ops.

Copy what is done for 32-bit already so the order is about the same.

llvm-svn: 211186

10 years ago[mips] SYNC $stype instruction was added in Mips32
Matheus Almeida [Wed, 18 Jun 2014 17:10:30 +0000 (17:10 +0000)]
[mips] SYNC $stype instruction was added in Mips32
but SYNC with an implied operand ($stype = 0) is valid since Mips2.

llvm-svn: 211185

10 years agoFix a memory leak in the error path.
Rafael Espindola [Wed, 18 Jun 2014 17:07:15 +0000 (17:07 +0000)]
Fix a memory leak in the error path.

llvm-svn: 211184

10 years agoR600: Implement f64 ftrunc, ffloor and fceil.
Matt Arsenault [Wed, 18 Jun 2014 17:05:30 +0000 (17:05 +0000)]
R600: Implement f64 ftrunc, ffloor and fceil.

CI has instructions for these, so this fixes them for older hardware.

llvm-svn: 211183

10 years agoR600: Custom lower f64 frint for pre-CI
Matt Arsenault [Wed, 18 Jun 2014 17:05:26 +0000 (17:05 +0000)]
R600: Custom lower f64 frint for pre-CI

llvm-svn: 211182

10 years agoR600/SI: Temporary fix for f64 fneg
Matt Arsenault [Wed, 18 Jun 2014 17:05:22 +0000 (17:05 +0000)]
R600/SI: Temporary fix for f64 fneg

This should be a source modifier, but this unblocks
most of my math patches.

llvm-svn: 211181

10 years agoR600/SI: Comparisons set vcc.
Matt Arsenault [Wed, 18 Jun 2014 16:53:48 +0000 (16:53 +0000)]
R600/SI: Comparisons set vcc.

llvm-svn: 211178

10 years agoDriver: correct the backend option spelling
Saleem Abdulrasool [Wed, 18 Jun 2014 16:52:24 +0000 (16:52 +0000)]
Driver: correct the backend option spelling

The backend option does not have an '-enable' prefix.

llvm-svn: 211177

10 years ago[X86] AVX512: Add non-temporal stores
Adam Nemet [Wed, 18 Jun 2014 16:51:10 +0000 (16:51 +0000)]
[X86] AVX512: Add non-temporal stores

Note that I followed the AVX2 convention here and didn't add LLVM intrinsics
for stores.  These can be generated with the nontemporal hint on LLVM IR
stores (see new test). The GCC builtins are lowered directly into nontemporal
stores.

<rdar://problem/17082571>

llvm-svn: 211176

10 years ago[X86] AVX512: Specify compressed displacement for vmovntdqa
Adam Nemet [Wed, 18 Jun 2014 16:51:07 +0000 (16:51 +0000)]
[X86] AVX512: Specify compressed displacement for vmovntdqa

Use the max 64-bit element size with EVEX_CD8.  This should work since element
size is ignored for a full-vector access (FVM).

llvm-svn: 211175

10 years ago[PowerPC] Do not use BLA with the 64-bit SVR4 ABI
Ulrich Weigand [Wed, 18 Jun 2014 16:14:04 +0000 (16:14 +0000)]
[PowerPC] Do not use BLA with the 64-bit SVR4 ABI

The PowerPC back-end uses BLA to implement calls to functions at
known-constant addresses, which is apparently used for certain
system routines on Darwin.

However, with the 64-bit SVR4 ABI, this is actually incorrect.
An immediate function pointer value on this platform is not
directly usable as a target address for BLA:
- in the ELFv1 ABI, the function pointer value refers to the
  *function descriptor*, not the code address
- in the ELFv2 ABI, the function pointer value refers to the
  global entry point, but BL(A) would only be correct when
  calling the *local* entry point

This bug didn't show up since using immediate function pointer
values is not usually done in the 64-bit SVR4 ABI in the first
place.  However, I ran into this issue with a certain use case
of LLVM as JIT, where immediate function pointer values were
uses to implement callbacks from JITted code to helpers in
statically compiled code.

Fixed by simply not using BLA with the 64-bit SVR4 ABI.

llvm-svn: 211174

10 years agoInherit dll attributes to static locals
Hans Wennborg [Wed, 18 Jun 2014 15:55:13 +0000 (15:55 +0000)]
Inherit dll attributes to static locals

This makes us handle static locals in exported/imported functions correctly.

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

llvm-svn: 211173

10 years agoDo not XFAIL test/tools/llvm-cov tests on powerpc64le
Ulrich Weigand [Wed, 18 Jun 2014 15:52:18 +0000 (15:52 +0000)]
Do not XFAIL test/tools/llvm-cov tests on powerpc64le

All tests in test/tools/llvm-cov fail on big-endian targets and are
supposed to be XFAILed there.  However, including "powerpc64" in the
XFAIL line is now incorrect, since that matches both powerpc64- and
powerpc64le- targets, and the tests pass on the latter.

Update the XFAIL lines to use powerpc64- instead (like mips64-).

llvm-svn: 211172

10 years ago[PowerPC] Fix emitting instruction pairs on LE
Ulrich Weigand [Wed, 18 Jun 2014 15:37:07 +0000 (15:37 +0000)]
[PowerPC] Fix emitting instruction pairs on LE

My patch r204634 to emit instructions in little-endian format failed to
handle those special cases where we emit a pair of instructions from a
single LLVM MC instructions (like the bl; nop pairs used to implement
the call sequence).

In those cases, we still need to emit the "first" instruction (the one
in the more significant word) first, on both big and little endian,
and not swap them.

llvm-svn: 211171

10 years agoSupport LE in RelocVisitor::visitELF_PPC64_*
Ulrich Weigand [Wed, 18 Jun 2014 15:15:49 +0000 (15:15 +0000)]
Support LE in RelocVisitor::visitELF_PPC64_*

Since we now support both LE and BE PPC64 variants, use of getAddend64BE
is no longer correct.  Use the generic getELFRelocationAddend instead,
as was already done for Mips.

llvm-svn: 211170

10 years ago[mips] Fix expansion of memory operation if destination register is not a GPR.
Matheus Almeida [Wed, 18 Jun 2014 14:49:56 +0000 (14:49 +0000)]
[mips] Fix expansion of memory operation if destination register is not a GPR.

Summary:
The assembler tries to reuse the destination register for memory operations whenever
it can but it's not possible to do so if the destination register is not a GPR.

Example:
  ldc1 $f0, sym
should expand to:
  lui $at, %hi(sym)
  ldc1 $f0, %lo(sym)($at)

It's entirely wrong to expand to:
  lui $f0, %hi(sym)
  ldc1 $f0, %lo(sym)($f0)

Reviewers: dsanders

Reviewed By: dsanders

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

llvm-svn: 211169

10 years ago[mips] Report correct location when "erroring" about the use of $at when it's not...
Matheus Almeida [Wed, 18 Jun 2014 14:46:05 +0000 (14:46 +0000)]
[mips] Report correct location when "erroring" about the use of $at when it's not available.

Summary: This removes the FIXMEs from test/MC/Mips/mips-noat.s.

Reviewers: dsanders

Reviewed By: dsanders

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

llvm-svn: 211168

10 years ago[mips][mips64r6] Add BLTC and BLTUC instructions
Zoran Jovanovic [Wed, 18 Jun 2014 14:36:00 +0000 (14:36 +0000)]
[mips][mips64r6] Add BLTC and BLTUC instructions
Differential Revision: http://reviews.llvm.org/D3923

llvm-svn: 211167

10 years ago[sanitizer] Intercept pthread_*attr_get*.
Evgeniy Stepanov [Wed, 18 Jun 2014 14:16:41 +0000 (14:16 +0000)]
[sanitizer] Intercept pthread_*attr_get*.

llvm-svn: 211166

10 years ago[mips] Access $at only if necessary.
Matheus Almeida [Wed, 18 Jun 2014 14:15:42 +0000 (14:15 +0000)]
[mips] Access $at only if necessary.

Summary:
This patch doesn't really change the logic behind expandMemInst but it allows
us to assemble .S files that use .set noat with some macros. For example:

.set noat
lw $k0, offset($k1)

Can expand to:
lui $k0, %hi(offset)
addu $k0, $k0, $k1
lw $k0, %lo(offset)($k0)

with no need to access $at.

Reviewers: dsanders, vmedic

Reviewed By: dsanders, vmedic

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

llvm-svn: 211165

10 years agoAdd pattern for unsigned v4i32->v4f64 convert on AVX512.
Cameron McInally [Wed, 18 Jun 2014 14:04:37 +0000 (14:04 +0000)]
Add pattern for unsigned v4i32->v4f64 convert on AVX512.

llvm-svn: 211164

10 years ago[mips] Update MipsAsmParser so that it's possible to handle immediates that start...
Matheus Almeida [Wed, 18 Jun 2014 13:55:18 +0000 (13:55 +0000)]
[mips] Update MipsAsmParser so that it's possible to handle immediates that start with the binary operator NOT (~).

Reviewers: dsanders

Reviewed By: dsanders

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

llvm-svn: 211163

10 years ago[msan] Intercept __getdelim.
Evgeniy Stepanov [Wed, 18 Jun 2014 13:35:13 +0000 (13:35 +0000)]
[msan] Intercept __getdelim.

llvm-svn: 211162

10 years ago[mips] Implement alias for 'and' and 'or' instructions for all ISAs.
Matheus Almeida [Wed, 18 Jun 2014 13:30:57 +0000 (13:30 +0000)]
[mips] Implement alias for 'and' and 'or' instructions for all ISAs.

Summary:
Examples:
and $2, 4 <=> andi $2, $2, 4
or $2, 4 <=> ori $2, $2, 4

Reviewers: dsanders

Reviewed By: dsanders

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

llvm-svn: 211161

10 years ago[mips] Remove the last usage of parseRegister from MipsAsmParser.
Matheus Almeida [Wed, 18 Jun 2014 13:08:59 +0000 (13:08 +0000)]
[mips] Remove the last usage of parseRegister from MipsAsmParser.

Summary:
Added negative test case so that we can be sure we handle erroneous situations
while parsing the .cpsetup directive.

Reviewers: dsanders

Reviewed By: dsanders

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

llvm-svn: 211160

10 years agoR600: Implement 64bit SRA
Jan Vesely [Wed, 18 Jun 2014 12:27:17 +0000 (12:27 +0000)]
R600: Implement 64bit SRA

v2: Use capitalized variable name

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 211159

10 years agoR600: Implement 64bit SRL
Jan Vesely [Wed, 18 Jun 2014 12:27:15 +0000 (12:27 +0000)]
R600: Implement 64bit SRL

v2: use C++ style comment

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 211158

10 years agoR600: Implement 64bit SHL
Jan Vesely [Wed, 18 Jun 2014 12:27:13 +0000 (12:27 +0000)]
R600: Implement 64bit SHL

v2: Use c++ style comment

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
llvm-svn: 211157

10 years ago[msan] Handle X86 *.psad.* and *.pmadd.* intrinsics.
Evgeniy Stepanov [Wed, 18 Jun 2014 12:02:29 +0000 (12:02 +0000)]
[msan] Handle X86 *.psad.* and *.pmadd.* intrinsics.

llvm-svn: 211156

10 years agoDAG: move sret demotion into most basic LowerCallTo implementation.
Tim Northover [Wed, 18 Jun 2014 11:52:44 +0000 (11:52 +0000)]
DAG: move sret demotion into most basic LowerCallTo implementation.

It looks like there are two versions of LowerCallTo here: the
SelectionDAGBuilder one is designed to operate on LLVM IR, and the
TargetLowering one in the case where everything is at DAG level.

Previously, only the SelectionDAGBuilder variant could handle demoting
an impossible return to sret semantics (before delegating to the
TargetLowering version), but this functionality is also useful for
certain libcalls (e.g. 128-bit operations on 32-bit x86).  So this
commit moves the sret handling down a level.

rdar://problem/17242889

llvm-svn: 211155

10 years agoMove google-explicit-constructor check to a separate source file.
Alexander Kornienko [Wed, 18 Jun 2014 09:33:46 +0000 (09:33 +0000)]
Move google-explicit-constructor check to a separate source file.

Summary: No functional changes.

Reviewers: djasper

Reviewed By: djasper

Subscribers: cfe-commits

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

llvm-svn: 211154

10 years ago[ASan] Fix https://code.google.com/p/address-sanitizer/issues/detail?id=321 for time...
Alexander Potapenko [Wed, 18 Jun 2014 09:27:40 +0000 (09:27 +0000)]
[ASan] Fix https://code.google.com/p/address-sanitizer/issues/detail?id=321 for time() and frexp()
Add a test for the frexp() interceptor.
Annotate the interceptors that may potentially corrupt stack IDs of freed buffers with FIXME comments.

llvm-svn: 211153

10 years ago[llvm-readobj] Fix member functions name style.
Simon Atanasyan [Wed, 18 Jun 2014 09:24:01 +0000 (09:24 +0000)]
[llvm-readobj] Fix member functions name style.

llvm-svn: 211152

10 years ago[llvm-readobj] Fix compile error.
Simon Atanasyan [Wed, 18 Jun 2014 09:23:55 +0000 (09:23 +0000)]
[llvm-readobj] Fix compile error.

llvm-svn: 211151

10 years ago[llvm-readobj][ELF] New `-mips-plt-got` command line option to output
Simon Atanasyan [Wed, 18 Jun 2014 08:47:09 +0000 (08:47 +0000)]
[llvm-readobj][ELF] New `-mips-plt-got` command line option to output
MIPS GOT section.

Patch reviewed by Rafael Espindola.

llvm-svn: 211150

10 years agoAArch64: re-enable tests that were looking for a non-existent backend.
Tim Northover [Wed, 18 Jun 2014 08:37:28 +0000 (08:37 +0000)]
AArch64: re-enable tests that were looking for a non-existent backend.

In the final phase of the merge, I managed to disable a bunch of Clang
tests accidentally. Fortunately none of them seem to have broken in
the interim.

llvm-svn: 211149

10 years ago[OPENMP] Reformatting and code improvement.
Alexey Bataev [Wed, 18 Jun 2014 07:08:49 +0000 (07:08 +0000)]
[OPENMP] Reformatting and code improvement.

llvm-svn: 211147

10 years agoRevert "Random Number Generator (llvm)"
JF Bastien [Wed, 18 Jun 2014 06:33:23 +0000 (06:33 +0000)]
Revert "Random Number Generator (llvm)"

This reverts commit cccba093090d127e0b6d17473b14c264c14c5259.

It causes build breakage.

llvm-svn: 211146

10 years agoRandom Number Generator (llvm)
JF Bastien [Wed, 18 Jun 2014 06:23:25 +0000 (06:23 +0000)]
Random Number Generator (llvm)

Summary:
Provides an abstraction for a random number generator (RNG) that produces a stream of pseudo-random numbers.
The current implementation uses C++11 facilities and is therefore not cryptographically secure.

The RNG is salted with the text of the current command line invocation.
In addition, a user may specify a seed (reproducible builds).

In clang, the seed can be set via
  -frandom-seed=X
In the back end, the seed can be set via
  -rng-seed=X

This is the llvm part of the patch.
clang part: D3391

Reviewers: ahomescu, rinon, nicholas, jfb

Reviewed By: jfb

Subscribers: jfb, perl

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

llvm-svn: 211145

10 years ago[AArch64] Fix a pattern match failure caused by creating improper CONCAT_VECTOR.
Kevin Qin [Wed, 18 Jun 2014 05:54:42 +0000 (05:54 +0000)]
[AArch64] Fix a pattern match failure caused by creating improper CONCAT_VECTOR.

ReconstructShuffle() may wrongly creat a CONCAT_VECTOR trying to
concat 2 of v2i32 into v4i16. This commit is to fix this issue and
try to generate UZP1 instead of lots of MOV and INS.
Patch is initalized by Kevin Qin, and refactored by Tim Northover.

llvm-svn: 211144

10 years agoReplace some assert(0)'s with llvm_unreachable.
Craig Topper [Wed, 18 Jun 2014 05:13:13 +0000 (05:13 +0000)]
Replace some assert(0)'s with llvm_unreachable.

llvm-svn: 211143

10 years agoConvert an llvm_unreachable in an 'else' block to a removal of the 'if' and an assert...
Craig Topper [Wed, 18 Jun 2014 05:13:11 +0000 (05:13 +0000)]
Convert an llvm_unreachable in an 'else' block to a removal of the 'if' and an assertion of its condition. Suggestion from David Blaikie.

llvm-svn: 211142

10 years agoReplace some assert(0)'s with llvm_unreachable.
Craig Topper [Wed, 18 Jun 2014 05:05:13 +0000 (05:05 +0000)]
Replace some assert(0)'s with llvm_unreachable.

llvm-svn: 211141

10 years ago[OPENMP] Initial support for '#pragma omp for' (fixed incompatibility with MSVC).
Alexey Bataev [Wed, 18 Jun 2014 04:14:57 +0000 (04:14 +0000)]
[OPENMP] Initial support for '#pragma omp for' (fixed incompatibility with MSVC).

llvm-svn: 211140

10 years agoReplace some assert(0)'s with llvm_unreachable.
Craig Topper [Wed, 18 Jun 2014 03:57:25 +0000 (03:57 +0000)]
Replace some assert(0)'s with llvm_unreachable.

llvm-svn: 211139

10 years agoConvert assert(0) to llvm_unreachable to silence a warning about Addend being uniniti...
Craig Topper [Wed, 18 Jun 2014 03:13:41 +0000 (03:13 +0000)]
Convert assert(0) to llvm_unreachable to silence a warning about Addend being uninitialized in default case.

llvm-svn: 211138

10 years agoFix bug in code for avoiding dynamic initialization of dllimport globals
Hans Wennborg [Wed, 18 Jun 2014 01:21:33 +0000 (01:21 +0000)]
Fix bug in code for avoiding dynamic initialization of dllimport globals

When instantiating dllimport variables with dynamic initializers, don't
bail out of Sema::InstantiateVariableInitializer without calling
PopExpressionEvaluationContext().

This was causing a stale object to stay on the ExprEvalContexts stack,
causing subsequent calls to getCurrentMangleNumberContext() to fail,
resulting in incorrect numbering of static locals (and probably other
broken things).

llvm-svn: 211137

10 years agoAdd locking around the m_owners collection in the breakpoint site. If we are in...
Jim Ingham [Wed, 18 Jun 2014 01:04:40 +0000 (01:04 +0000)]
Add locking around the m_owners collection in the breakpoint site.  If we are in the middle of "BreakpointLocation::ShouldStop" we don't
want other commands (like "break disable") to mutate the owners of this breakpoint out from under us.

<rdar://problem/17255589>

llvm-svn: 211136

10 years agoDocumentation for #pragma clang loop directive and options vectorize and interleave.
Tyler Nowicki [Wed, 18 Jun 2014 00:51:32 +0000 (00:51 +0000)]
Documentation for #pragma clang loop directive and options vectorize and interleave.

Reviewed by: Aaron Ballman and Dmitri Gribenko

llvm-svn: 211135

10 years agoFix the caller of checkCorrectionVisibility too.
Kaelyn Takata [Tue, 17 Jun 2014 23:47:29 +0000 (23:47 +0000)]
Fix the caller of checkCorrectionVisibility too.

That's what I get for hurredly splitting the small change out of a much
bigger change that had moved where checkCorrectionVisibility was being
called.

llvm-svn: 211134

10 years agoRemove an unused argument from checkCorrectionVisibility.
Kaelyn Takata [Tue, 17 Jun 2014 23:41:33 +0000 (23:41 +0000)]
Remove an unused argument from checkCorrectionVisibility.

llvm-svn: 211133

10 years agoObjective-C ARC. Do not warn about properties with both
Fariborz Jahanian [Tue, 17 Jun 2014 23:35:13 +0000 (23:35 +0000)]
Objective-C ARC. Do not warn about properties with both
IBOutlet and weak attributes when accessed being
unpredictably set to nil because usage of such properties
are always single threaded and its ivar cannot be set
to nil asynchronously. // rdar://15885642

llvm-svn: 211132

10 years agoAdd the coverage cflags to the link step as well to make sure
Eric Christopher [Tue, 17 Jun 2014 23:27:32 +0000 (23:27 +0000)]
Add the coverage cflags to the link step as well to make sure
that we link in the support libraries.

llvm-svn: 211131

10 years agoAllow X86FastIsel to cope with 64 bit absolute relocations
Louis Gerbarg [Tue, 17 Jun 2014 23:22:41 +0000 (23:22 +0000)]
Allow X86FastIsel to cope with 64 bit absolute relocations

This patch is a follow up to r211040 & r211052. Rather than bailing out of fast
isel this patch will generate an alternate instruction (movabsq) instead of the
leaq. While this will always have enough room to handle the 64 bit displacment
it is generally over kill for internal symbols (most displacements will be
within 32 bits) but since we have no way of communicating the code model to the
the assmebler in order to avoid flagging an absolute leal/leaq as illegal when
using a symbolic displacement.

llvm-svn: 211130

10 years agoRetry building modules that were compiled by other instances and are out-of-date
Ben Langmuir [Tue, 17 Jun 2014 22:35:27 +0000 (22:35 +0000)]
Retry building modules that were compiled by other instances and are out-of-date

When another clang instance builds a module, it may still be considered
"out of date" for the current instance in a couple of cases*.  This
patch prevents us from giving spurious errors when compilers race to
build a module by allowing the module load to fail when the pcm was
built by a different compiler instance.

* Cases where a module can be out of date despite just having been
built:

1) There are different -I paths between invocations that result in
finding a different module map file for some dependent module. This is
not an error, and should never be diagnosed.

<rdar://problem/16843887>

2) There are file system races where the headers making up a module are
touched or moved. Although this can sometimes mean trouble, diagnosing
it only during a build-race is worse than useless and we cannot detect
this in general.  It is more robust to just rebuild.  This was causing
spurious issues in some setups where only the modtime of headers was
bumped during a build.

<rdar://problem/16157638>

llvm-svn: 211129

10 years agoAdded gdb-remote auxv test for chunked reads.
Todd Fiala [Tue, 17 Jun 2014 22:01:27 +0000 (22:01 +0000)]
Added gdb-remote auxv test for chunked reads.

Verifies that a sum of offset,length auxv reads
matches a single large read, and that the auxv data
extracted from them match.

llvm-svn: 211127

10 years ago[FastISel][X86] Optimize predicates and fold CMP instructions.
Juergen Ributzka [Tue, 17 Jun 2014 21:55:43 +0000 (21:55 +0000)]
[FastISel][X86] Optimize predicates and fold CMP instructions.

This optimizes predicates for certain compares, such as fcmp oeq %x, %x to
fcmp ord %x, %x. The latter one is more efficient to generate.

The same optimization is applied to conditional branches.

llvm-svn: 211126

10 years agoRemove more occurrences of the unused-mutex-parameter pattern.
Zachary Turner [Tue, 17 Jun 2014 21:54:18 +0000 (21:54 +0000)]
Remove more occurrences of the unused-mutex-parameter pattern.

This pattern loses some of its usefulness when the mutex type is
statically polymorphic as opposed to runtime polymorphic, as
swapping out the mutex type requires changing a significant number
of function parameters, and templatizing the function parameter
requires the methods to be defined in the headers.

Furthermore, if LLVM is compiled with threads disabled then there
may even be no mutex to acquire anyway, so it should not be up to
individual APIs to know whether or not acquiring a mutex is required
to use those APIs to begin with.  It should be up to the user of the
API.

llvm-svn: 211125

10 years agoThose were not the right defines for memory errors, and the right defines aren't
Jim Ingham [Tue, 17 Jun 2014 21:02:44 +0000 (21:02 +0000)]
Those were not the right defines for memory errors, and the right defines aren't
available.  So going back to a generic error instead.

<rdar://problem/17058708>

llvm-svn: 211124

10 years agoFix up lldb cmake linker flags for MacOSX.
Todd Fiala [Tue, 17 Jun 2014 20:54:56 +0000 (20:54 +0000)]
Fix up lldb cmake linker flags for MacOSX.

Change r210035 broke the Darwin cmake build.  The
initial change was intended to stop the --start-group/--end-group
linker flags from being passed to non-gcc/clang-looking compilers,
stopping MSVC from warning on linking.  That change, however,
caused MacOSX cmake-based builds to start using the --start-group/
--end-group flags, even though the MacOSX linker doesn't support
them.  That broke the MacOSX clang build.

The fix keeps the newer check for a gcc-compatible compiler, but
specifically excludes MacOSX.

llvm-svn: 211123

10 years agoRemove dead code.
Diego Novillo [Tue, 17 Jun 2014 20:01:51 +0000 (20:01 +0000)]
Remove dead code.

The parsing for -Rpass= had been factored into the function
GenerateOptimizationRemarkRegex, but at the time I forgot to remove
the original code that just handled OPT_Rpass_EQ.

llvm-svn: 211122

10 years agoChange libclang initialization to use std::call_once instead of
Zachary Turner [Tue, 17 Jun 2014 19:57:15 +0000 (19:57 +0000)]
Change libclang initialization to use std::call_once instead of
hand rolled once-initialization, and rename the mutex to be more
descriptive of its actual purpose.

llvm-svn: 211121

10 years agoR600/SI: Make sure target flags are set on pseudo VOP3 instructions
Tom Stellard [Tue, 17 Jun 2014 19:34:46 +0000 (19:34 +0000)]
R600/SI: Make sure target flags are set on pseudo VOP3 instructions

llvm-svn: 211120

10 years agolit: simplify population of the actual_inputs array
Hans Wennborg [Tue, 17 Jun 2014 18:17:46 +0000 (18:17 +0000)]
lit: simplify population of the actual_inputs array

Add all inputs to the array, except those starting with @, which
are treated as response files and expanded.

llvm-svn: 211119

10 years agoMerge lib/Support/WindowsError.cpp into ib/Support/ErrorHandling.cpp.
Rafael Espindola [Tue, 17 Jun 2014 18:06:45 +0000 (18:06 +0000)]
Merge lib/Support/WindowsError.cpp into ib/Support/ErrorHandling.cpp.

The OSX ranlib warns on files with no symbols, and lib/Support/WindowsError.cpp
was empty when building on non-windows.

llvm-svn: 211118

10 years agoAdd "-format darwin" to llvm-size to be like darwin's size(1) -m output, and
Kevin Enderby [Tue, 17 Jun 2014 17:54:13 +0000 (17:54 +0000)]
Add "-format darwin" to llvm-size to be like darwin's size(1) -m output, and
and the -l option for the long format.  Also when the object is a Mach-O
file and the format is berkeley produce output like darwin’s default size(1)
summary berkeley derived output.

Like System V format, there are also some small changes in how and where
the file names and archive member names are printed for darwin and
Mach-O.

Like the changes to llvm-nm these are the first steps in seeing if it is
possible to make llvm-size produce the same output as darwin's size(1).

llvm-svn: 211117

10 years agoR600/SI: Match cttz_zero_undef
Matt Arsenault [Tue, 17 Jun 2014 17:36:27 +0000 (17:36 +0000)]
R600/SI: Match cttz_zero_undef

llvm-svn: 211116

10 years agoR600/SI: Match ctlz_zero_undef
Matt Arsenault [Tue, 17 Jun 2014 17:36:24 +0000 (17:36 +0000)]
R600/SI: Match ctlz_zero_undef

llvm-svn: 211115

10 years agoSubject: [PATCH-v5] Detect and mark reduction like statements
Johannes Doerfert [Tue, 17 Jun 2014 17:31:36 +0000 (17:31 +0000)]
Subject: [PATCH-v5] Detect and mark reduction like statements

+ Flag to indicate reduction like statements
+ Command line option to (dis)allow multiplicative reduction opcodes
+ Two simple positive test cases, one fp test case w and w/o fast math
+ One "negative" test case (only reduction like but no reduction)

llvm-svn: 211114

10 years agoRevert "[OPENMP] Initial support for '#pragma omp for'."
Rafael Espindola [Tue, 17 Jun 2014 17:20:53 +0000 (17:20 +0000)]
Revert "[OPENMP] Initial support for '#pragma omp for'."

This reverts commit r211096. Looks like it broke the msvc build:

SemaOpenMP.cpp(140) : error C4519: default template arguments are only allowed on a class template

llvm-svn: 211113

10 years agoFix the comment which was backwards.
Yaron Keren [Tue, 17 Jun 2014 17:09:24 +0000 (17:09 +0000)]
Fix the comment which was backwards.

llvm-svn: 211112

10 years agomark the old jit tests as unsupported for powerpc64 (for cmake)
Will Schmidt [Tue, 17 Jun 2014 17:04:42 +0000 (17:04 +0000)]
mark the old jit tests as unsupported for powerpc64 (for cmake)

mark the old JIT tests as unsupported for powerpc64 - CMake style.
This follows the style used for hexagon/arm64/aarch64.
The equivalent tests still run under the supported MCJIT/*

llvm-svn: 211111

10 years agoR600: Use LDS and vectors for private memory
Tom Stellard [Tue, 17 Jun 2014 16:53:14 +0000 (16:53 +0000)]
R600: Use LDS and vectors for private memory

llvm-svn: 211110

10 years agoR600/SI: Add a pattern for llvm.AMDGPU.barrier.global
Tom Stellard [Tue, 17 Jun 2014 16:53:09 +0000 (16:53 +0000)]
R600/SI: Add a pattern for llvm.AMDGPU.barrier.global

llvm-svn: 211109

10 years agoSelectionDAG: Expand i64 = FP_TO_SINT i32
Tom Stellard [Tue, 17 Jun 2014 16:53:07 +0000 (16:53 +0000)]
SelectionDAG: Expand i64 = FP_TO_SINT i32

llvm-svn: 211108

10 years agoR600/SI: Re-initialize the m0 register after using it for indirect addressing
Tom Stellard [Tue, 17 Jun 2014 16:53:04 +0000 (16:53 +0000)]
R600/SI: Re-initialize the m0 register after using it for indirect addressing

We need to store a value greater than or equal to the number of LDS
bytes allocated by the shader in the m0 register in order for LDS
instructions to work correctly.

We always initialize m0 at the beginning of a shader, but this register
is also used for indirect addressing offsets, so we need to
re-initialize it any time we use indirect addressing.

llvm-svn: 211107

10 years ago[PECOFF] Support COMDAT associative sections.
Rui Ueyama [Tue, 17 Jun 2014 16:19:33 +0000 (16:19 +0000)]
[PECOFF] Support COMDAT associative sections.

COFF supports a feature similar to ELF's section groups. This
patch implements it.

In ELF, section groups are identified by their names, and they are
treated somewhat differently from regular symbols. In COFF, the
feature is realized in a more straightforward way. A section can
have an annotation saying "if Nth section is linked, link this
section too."

I added a new reference type, kindAssociate. If a target atom is
coalesced away, the referring atom is removed by Resolver, so that
they are treated as a group.

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

llvm-svn: 211106

10 years agoAdded gdb-remote auxv tests.
Todd Fiala [Tue, 17 Jun 2014 16:04:45 +0000 (16:04 +0000)]
Added gdb-remote auxv tests.

First batch of auxv-related tests from llgs branch.

Includes helpers for unescaping gdb-remote binary-escaped
data, converting binary data from inferior endian-ness to
integral values, etc.

Tests on debugserver are expected to be skipped since it
doesn't support auxv and the tests are geared to be skipped
on platforms that don't broadcast support for the feature
in qSupported.  (llgs is listed as XFAIL since qSupported
support in llgs upstream is not there, so the support check
cannot work in upstream llgs.)

llvm-svn: 211105

10 years ago[FastISel][X86] Fix previous refactoring commit (r211077)
Juergen Ributzka [Tue, 17 Jun 2014 14:47:45 +0000 (14:47 +0000)]
[FastISel][X86] Fix previous refactoring commit (r211077)

Overlooked that fcmp_une uses an "or" instead of an "and" for combining the
flags.

llvm-svn: 211104

10 years agoFixed jump threading going to infinite loop.
Dinesh Dwivedi [Tue, 17 Jun 2014 14:34:19 +0000 (14:34 +0000)]
Fixed jump threading going to infinite loop.

This patch add code to remove unreachable blocks from function
as they may cause jump threading to stuck in infinite loop.

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

llvm-svn: 211103

10 years agoAvoid crashing on invalid or unreadable ELF core
Ed Maste [Tue, 17 Jun 2014 14:14:33 +0000 (14:14 +0000)]
Avoid crashing on invalid or unreadable ELF core

Issue discovered during the GSoC 2014 project implementing FreeBSD
kernel support.  The existing elf-core Process plugin crashed trying
to read from /dev/mem (the kernel memory device).

Patch by Mike Ma.

llvm-svn: 211102