platform/upstream/llvm.git
8 years agoPR27104: Add -mllvm option
Sean Silva [Sat, 2 Apr 2016 01:39:56 +0000 (01:39 +0000)]
PR27104: Add -mllvm option

The argv[0] is based on the analogous thing in clang.

llvm-svn: 265206

8 years ago[Clang-tidy] Improve checks documentation consistency.
Eugene Zelenko [Sat, 2 Apr 2016 01:07:18 +0000 (01:07 +0000)]
[Clang-tidy] Improve checks documentation consistency.

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

llvm-svn: 265205

8 years agoFix -Wpedantic warning about extra semi-colon
Hans Wennborg [Sat, 2 Apr 2016 01:03:41 +0000 (01:03 +0000)]
Fix -Wpedantic warning about extra semi-colon

llvm-svn: 265204

8 years agoDon't create a plt when LD access is optimized.
Rafael Espindola [Sat, 2 Apr 2016 00:19:22 +0000 (00:19 +0000)]
Don't create a plt when LD access is optimized.

llvm-svn: 265203

8 years agoDon't create a PLT when we optimize out the plt use.
Rafael Espindola [Fri, 1 Apr 2016 23:36:56 +0000 (23:36 +0000)]
Don't create a PLT when we optimize out the plt use.

llvm-svn: 265202

8 years ago[Objective-C] Introduce objc_runtime_visible attribute.
Douglas Gregor [Fri, 1 Apr 2016 23:23:52 +0000 (23:23 +0000)]
[Objective-C] Introduce objc_runtime_visible attribute.

The objc_runtime_visible attribute deals with an odd corner case where
a particular Objective-C class is known to the Objective-C runtime
(and, therefore, accessible by name) but its symbol has been hidden
for some reason. For such classes, teach CodeGen to use
objc_lookUpClass to retrieve the Class object, rather than referencing
the class symbol directly.

Classes annotated with objc_runtime_visible have two major limitations
that fall out from places where Objective-C metadata needs to refer to
the class (or metaclass) symbol directly:

* One cannot implement a subclass of an objc_runtime_visible class.
* One cannot implement a category on an objc_runtime_visible class.

Implements rdar://problem/25494092.

llvm-svn: 265201

8 years agoAdd some unit tests for ClangASTContext.
Zachary Turner [Fri, 1 Apr 2016 23:20:35 +0000 (23:20 +0000)]
Add some unit tests for ClangASTContext.

In doing so, two bugs were uncovered (and fixed).  The first bug
is that ClangASTContext::RemoveFastQualifiers() was broken, and
was not removing fast qualifiers (or doing anything else for that
matter).  The second bug is that UnifyAccessSpecifiers treated
AS_None asymmetrically, which is probably an edge case, but seems
like a bug nonetheless.

llvm-svn: 265200

8 years ago[PGO] Use a helper function to find all indirect call-sites
Rong Xu [Fri, 1 Apr 2016 23:16:44 +0000 (23:16 +0000)]
[PGO] Use a helper function to find all indirect call-sites

Use a helper function to find all the direct-calls-sites in a function.
Also split the code into a separated file as this will be use by
indirect-call-promotion transformation.

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

llvm-svn: 265199

8 years agoAArch64: avoid clobbering SP for dead MOVimm pseudos.
Tim Northover [Fri, 1 Apr 2016 23:14:52 +0000 (23:14 +0000)]
AArch64: avoid clobbering SP for dead MOVimm pseudos.

We were producing ORR, which actually defines a GPR32sp rather than a GPR32.

Should fix PR23209.

llvm-svn: 265198

8 years ago[CodeGen] Emit lifetime.end intrinsic after objects are destructed in
Akira Hatanaka [Fri, 1 Apr 2016 22:58:55 +0000 (22:58 +0000)]
[CodeGen] Emit lifetime.end intrinsic after objects are destructed in
landing pads.

Previously, lifetime.end intrinsics were inserted only on normal control
flows. This prevented StackColoring from merging stack slots for objects
that were destroyed on the exception handling control flow since it
couldn't tell their lifetime ranges were disjoint. This patch fixes
code-gen to emit the intrinsic on both control flows.

rdar://problem/22181976

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

llvm-svn: 265197

8 years agoFixed an issue where if we have DWARF in an executable that has multiple languages...
Greg Clayton [Fri, 1 Apr 2016 22:57:22 +0000 (22:57 +0000)]
Fixed an issue where if we have DWARF in an executable that has multiple languages where these languages use different type systems, you can end up trying to find the actualy definition for a forward declaration for a type, you will call:

TypeSP SymbolFileDWARF::FindDefinitionTypeForDWARFDeclContext (const DWARFDeclContext &dwarf_decl_ctx);

The problem was we might be looking for a type "Foo", and find one from another langauge. Then the DWARFASTParserClang would try to make an AST type using a CompilerType that might return an empty.

This fix makes sure that when we create a DWARFDeclContext from a DWARFDIE that the DWARFDeclContext we set the language of the DIE. Then when we go to find matches for DWARFDeclContext, we end up with bunch of DIEs. We check each DWARFDIE that we found by asking it for its language and making sure the language is compatible with the type system that we want to use. This keeps us from using the wrong types to resolve forward declarations.

<rdar://problem/25276165>

llvm-svn: 265196

8 years ago[modules] Start moving the code for encoding AST records out of ASTWriter into
Richard Smith [Fri, 1 Apr 2016 22:52:03 +0000 (22:52 +0000)]
[modules] Start moving the code for encoding AST records out of ASTWriter into
a separate class. The goal is for this class to have a separate lifetime from
the AST writer so that it can meaningfully track pending statement nodes and
context for more compact encoding of various types.

llvm-svn: 265195

8 years agoRename a few variables. NFC.
Rui Ueyama [Fri, 1 Apr 2016 22:42:04 +0000 (22:42 +0000)]
Rename a few variables. NFC.

We had Phdr, PHdr and Phdrs in one line. That was a bit confusing.

llvm-svn: 265194

8 years agoMake DIASession work if msdia*.dll isn't registered.
Nico Weber [Fri, 1 Apr 2016 22:21:51 +0000 (22:21 +0000)]
Make DIASession work if msdia*.dll isn't registered.

This fixes various symbolization test failures for me when I build with a
hermetic VS2015 without having run the 2015 installer.

http://reviews.llvm.org/D18707

llvm-svn: 265193

8 years agoAdd missing emissionKind flags to the DICompileUnits of several old testcases.
Adrian Prantl [Fri, 1 Apr 2016 22:18:43 +0000 (22:18 +0000)]
Add missing emissionKind flags to the DICompileUnits of several old testcases.

llvm-svn: 265192

8 years agoThinLTO: special handling for LinkOnce functions
Mehdi Amini [Fri, 1 Apr 2016 21:53:50 +0000 (21:53 +0000)]
ThinLTO: special handling for LinkOnce functions

These function can be dropped by the compiler if they are no longer
referenced in the current module. However there is a change that
another module is still referencing them because of the import.

Multiple solutions can be used:

- Always import LinkOnce when a caller is imported. This ensure that
  every module with a call to a LinkOnce has the definition and will
  be able to emit it if it emits the call.
- Turn the LinkOnce into Weak, so that it is always emitted.
- Turn all LinkOnce into available_externally and come back after all
  modules are codegen'ed to emit only one copy of the linkonce, when
  there is still a reference to it.

This patch implement the second option, with am optimization that
only *one* module will turn the LinkOnce into Weak, while the others
will turn it into available_externally, so that there is exactly one
copy emitted for the whole compilation.

http://reviews.llvm.org/D18346

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

8 years agoSwift Calling Convention: add swifterror attribute.
Manman Ren [Fri, 1 Apr 2016 21:41:15 +0000 (21:41 +0000)]
Swift Calling Convention: add swifterror attribute.

A ``swifterror`` attribute can be applied to a function parameter or an
AllocaInst.

This commit does not include any target-specific change. The target-specific
optimization will come as a follow-up patch.

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

llvm-svn: 265189

8 years agoskip and xfail two std::list-related libcxx tests that fail on OS X with TOT libcxx
Todd Fiala [Fri, 1 Apr 2016 21:36:58 +0000 (21:36 +0000)]
skip and xfail two std::list-related libcxx tests that fail on OS X with TOT libcxx

Enrico has a bug on him to make this work across older libcxx list
and newer libcxx list simultaneously.  Needed in preparation of
getting the OS X public CI to run the TSAN tests.

tracked by:
rdar://25499635

llvm-svn: 265188

8 years agoClean up a couple more preprocessor tests to use match-full-lines.
James Y Knight [Fri, 1 Apr 2016 21:33:20 +0000 (21:33 +0000)]
Clean up a couple more preprocessor tests to use match-full-lines.

llvm-svn: 265187

8 years ago[X86][SSE] Regenerated vector float tests - fabs / floor(etc.) / fneg / float2double
Simon Pilgrim [Fri, 1 Apr 2016 21:30:48 +0000 (21:30 +0000)]
[X86][SSE] Regenerated vector float tests - fabs / floor(etc.) / fneg / float2double

llvm-svn: 265186

8 years ago[X86][SSE] Vector i64 load tests
Simon Pilgrim [Fri, 1 Apr 2016 21:06:17 +0000 (21:06 +0000)]
[X86][SSE] Vector i64 load tests

llvm-svn: 265185

8 years ago[X86][SSE] Regenerated comparison mask and float immediate tests
Simon Pilgrim [Fri, 1 Apr 2016 21:00:00 +0000 (21:00 +0000)]
[X86][SSE] Regenerated comparison mask and float immediate tests

llvm-svn: 265184

8 years ago[X86][SSE] Regenerated the vec_extract tests.
Simon Pilgrim [Fri, 1 Apr 2016 20:55:19 +0000 (20:55 +0000)]
[X86][SSE] Regenerated the vec_extract tests.

llvm-svn: 265183

8 years agoUpdate owners to reflect recent changes
David Blaikie [Fri, 1 Apr 2016 20:40:49 +0000 (20:40 +0000)]
Update owners to reflect recent changes

llvm-svn: 265182

8 years agoRemove more of the code-running ObjC data formatter support
Enrico Granata [Fri, 1 Apr 2016 20:33:22 +0000 (20:33 +0000)]
Remove more of the code-running ObjC data formatter support

llvm-svn: 265181

8 years agoFix buildbot lldb-amd64-ninja-netbsd7 failure
Rong Xu [Fri, 1 Apr 2016 20:15:04 +0000 (20:15 +0000)]
Fix buildbot lldb-amd64-ninja-netbsd7 failure

llvm-svn: 265180

8 years ago[X86][SSE] Regenerated the vec_insert tests.
Simon Pilgrim [Fri, 1 Apr 2016 19:42:23 +0000 (19:42 +0000)]
[X86][SSE] Regenerated the vec_insert tests.

llvm-svn: 265179

8 years agoRemove useless check for ThreadModel==Single in ARMISelLowering. NFC.
James Y Knight [Fri, 1 Apr 2016 19:33:19 +0000 (19:33 +0000)]
Remove useless check for ThreadModel==Single in ARMISelLowering. NFC.

ThreadModel::Single is already handled already by ARMPassConfig adding
LowerAtomicPass to the pass list, which lowers all atomics to non-atomic
ops and deletes fences.

So by the time we get to ISel, there's no atomic fences left, so they
don't need special handling.

llvm-svn: 265178

8 years agoDiagnose missing macro argument following charize operator.
Andy Gibbs [Fri, 1 Apr 2016 19:02:20 +0000 (19:02 +0000)]
Diagnose missing macro argument following charize operator.

For completeness, add a test-case for the equivalent stringize operator
diagnostic too.

llvm-svn: 265177

8 years agoLowerBitSets: Move declarations to separate namespace.
Peter Collingbourne [Fri, 1 Apr 2016 18:46:50 +0000 (18:46 +0000)]
LowerBitSets: Move declarations to separate namespace.

Should fix modules build.

llvm-svn: 265176

8 years agomark TestCallWithTimeout.py XFAIL on macosx.
Todd Fiala [Fri, 1 Apr 2016 18:42:45 +0000 (18:42 +0000)]
mark TestCallWithTimeout.py XFAIL on macosx.

This test is failing on the CI but not locally for me.  Needs
investigation.

tracked by:
https://llvm.org/bugs/show_bug.cgi?id=27182

llvm-svn: 265175

8 years ago[libfuzzer] adding license headers to cpp files
Mike Aizatsky [Fri, 1 Apr 2016 18:38:58 +0000 (18:38 +0000)]
[libfuzzer] adding license headers to cpp files

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

llvm-svn: 265174

8 years ago[X86][SSE] Regenerated vec_partial tests.
Simon Pilgrim [Fri, 1 Apr 2016 18:30:29 +0000 (18:30 +0000)]
[X86][SSE] Regenerated vec_partial tests.

llvm-svn: 265173

8 years ago[x86] add an SSE2 + fast-unaligned accesses run for memset nonzero tests
Sanjay Patel [Fri, 1 Apr 2016 18:29:25 +0000 (18:29 +0000)]
[x86] add an SSE2 + fast-unaligned accesses run for memset nonzero tests

Was there really no other way to splat a byte in SSE2?
    punpcklbw {{.*#+}} xmm0 = xmm0[0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7]
    pshuflw {{.*#+}} xmm0 = xmm0[0,0,0,0,4,5,6,7]
    pshufd {{.*#+}} xmm0 = xmm0[0,0,1,1]

llvm-svn: 265172

8 years ago[X86][SSE] Regenerated vec_logical tests.
Simon Pilgrim [Fri, 1 Apr 2016 18:28:23 +0000 (18:28 +0000)]
[X86][SSE] Regenerated vec_logical tests.

llvm-svn: 265171

8 years agoAMDGPU: Implement {BUFFER,FLAT}_ATOMIC_CMPSWAP{,_X2}
Tom Stellard [Fri, 1 Apr 2016 18:27:37 +0000 (18:27 +0000)]
AMDGPU: Implement {BUFFER,FLAT}_ATOMIC_CMPSWAP{,_X2}

Summary:
Implement BUFFER_ATOMIC_CMPSWAP{,_X2} instructions on all GCN targets, and FLAT_ATOMIC_CMPSWAP{,_X2} on CI+.

32-bit instruction variants tested manually on Kabini and Bonaire. Tests and parts of code provided by Jan Veselý.

Patch by: Vedran Miletić

Reviewers: arsenm, tstellarAMD, nhaehnle

Subscribers: jvesely, scchan, kanarayan, arsenm

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

llvm-svn: 265170

8 years ago[X86][SSE] Regenerated vector sdiv to shifts tests
Simon Pilgrim [Fri, 1 Apr 2016 18:18:40 +0000 (18:18 +0000)]
[X86][SSE] Regenerated vector sdiv to shifts tests

Added SSE + AVX1 tests as well as AVX2

llvm-svn: 265169

8 years ago[sancov] save entry block from pruning (it is always full dominator)
Mike Aizatsky [Fri, 1 Apr 2016 18:13:19 +0000 (18:13 +0000)]
[sancov] save entry block from pruning (it is always full dominator)

llvm-svn: 265168

8 years ago[x86] add an SSE1 run for these tests
Sanjay Patel [Fri, 1 Apr 2016 18:11:30 +0000 (18:11 +0000)]
[x86] add an SSE1 run for these tests

Note however that this is identical to the existing SSE2 run.
What we really want is yet another run for an SSE2 machine that
also has fast unaligned 16-byte accesses.

llvm-svn: 265167

8 years agoSimplify if. NFC.
Rafael Espindola [Fri, 1 Apr 2016 18:04:21 +0000 (18:04 +0000)]
Simplify if. NFC.

llvm-svn: 265166

8 years agoGuard xunit result test class and test method name access to prevent testbot breakage
Todd Fiala [Fri, 1 Apr 2016 17:59:51 +0000 (17:59 +0000)]
Guard xunit result test class and test method name access to prevent testbot breakage

http://llvm.org/bugs/show_bug.cgi?id=27179

llvm-svn: 265165

8 years ago[X86][SSE] Regenerated vec_setcc tests.
Simon Pilgrim [Fri, 1 Apr 2016 17:55:02 +0000 (17:55 +0000)]
[X86][SSE] Regenerated vec_setcc tests.

llvm-svn: 265164

8 years ago[X86][SSE] Regenerated the vec_set tests.
Simon Pilgrim [Fri, 1 Apr 2016 17:40:25 +0000 (17:40 +0000)]
[X86][SSE] Regenerated the vec_set tests.

Replaced lots of dodgy greps with actual codegen

llvm-svn: 265163

8 years ago[CrashReproducer] Add -fmodule-cache-path to reproducer script
Bruno Cardoso Lopes [Fri, 1 Apr 2016 17:39:08 +0000 (17:39 +0000)]
[CrashReproducer] Add -fmodule-cache-path to reproducer script

The cc1 invocation in the reproducer script should contain a valid path in
-fmodule-cache-path; for that reuse "<name>.cache/module" dir we already
use to dump the vfs and modules.

llvm-svn: 265162

8 years ago[x86] avoid intermediate splat for non-zero memsets (PR27100)
Sanjay Patel [Fri, 1 Apr 2016 17:36:45 +0000 (17:36 +0000)]
[x86] avoid intermediate splat for non-zero memsets (PR27100)

Follow-up to http://reviews.llvm.org/D18566 and http://reviews.llvm.org/D18676 -
where we noticed that an intermediate splat was being generated for memsets of
non-zero chars.

That was because we told getMemsetStores() to use a 32-bit vector element type,
and it happily obliged by producing that constant using an integer multiply.

The 16-byte test that was added in D18566 is now equivalent for AVX1 and AVX2
(no splats, just a vector load), but we have PR27141 to track that splat difference.

Note that the SSE1 path is not changed in this patch. That can be a follow-up.
This patch should resolve PR27100.

llvm-svn: 265161

8 years ago[AArch64] Fix a typo. NFC.
Chad Rosier [Fri, 1 Apr 2016 17:34:38 +0000 (17:34 +0000)]
[AArch64] Fix a typo. NFC.

llvm-svn: 265160

8 years ago[ELF] - Split Writer::assignAddresses(): extract code for initializing dummies sections
George Rimar [Fri, 1 Apr 2016 17:30:52 +0000 (17:30 +0000)]
[ELF] - Split Writer::assignAddresses(): extract code for initializing dummies sections

Extracts code for initializing dummies sections
to avoid possible duplication in following patches.

Differential review: http://reviews.llvm.org/D18691

llvm-svn: 265159

8 years ago[InstCombine] Don't sink an instr after a catchswitch
David Majnemer [Fri, 1 Apr 2016 17:28:17 +0000 (17:28 +0000)]
[InstCombine] Don't sink an instr after a catchswitch

A catchswitch is a terminator, instructions cannot be inserted after it.

llvm-svn: 265158

8 years ago[SLPVectorizer] Don't insert an extractelement before a catchswitch
David Majnemer [Fri, 1 Apr 2016 17:28:15 +0000 (17:28 +0000)]
[SLPVectorizer] Don't insert an extractelement before a catchswitch

A catchswitch cannot be preceded by another instruction in the same
basic block (other than a PHI node).

Instead, insert the extract element right after the materialization of
the vectorized value.  This isn't optimal but is a reasonable compromise
given the constraints of WinEH.

This fixes PR27163.

llvm-svn: 265157

8 years agoMake error handling consistent.
Rui Ueyama [Fri, 1 Apr 2016 17:24:19 +0000 (17:24 +0000)]
Make error handling consistent.

Some functions in Writer reports error using HasError, and some reports
their return values. This patch makes them to consistently use HasError.

llvm-svn: 265156

8 years agoRemove dead code.
Rui Ueyama [Fri, 1 Apr 2016 17:17:14 +0000 (17:17 +0000)]
Remove dead code.

Thanks to George Rimor for pointing it out.

llvm-svn: 265155

8 years agoDon't do extra work if -r is given.
Rui Ueyama [Fri, 1 Apr 2016 17:11:42 +0000 (17:11 +0000)]
Don't do extra work if -r is given.

fixAbsoluteSymbols fixes linker-created symbol addresses. Since we don't
create such symbols for relocatable output, we don't need to call this
function.

llvm-svn: 265154

8 years agoFix warnings uncovered by building with clang-cl
Reid Kleckner [Fri, 1 Apr 2016 17:09:12 +0000 (17:09 +0000)]
Fix warnings uncovered by building with clang-cl

Move ifdefs to avoid unused static helpers. Move alignment attribute so
that it is respected in GCC and MSVC.

llvm-svn: 265153

8 years agoFix a load of -Wunknown-pragma warnings from clang-cl
Reid Kleckner [Fri, 1 Apr 2016 17:09:08 +0000 (17:09 +0000)]
Fix a load of -Wunknown-pragma warnings from clang-cl

llvm-svn: 265152

8 years agoTidy up address and file offset assignments in the Writer.
Rui Ueyama [Fri, 1 Apr 2016 17:07:17 +0000 (17:07 +0000)]
Tidy up address and file offset assignments in the Writer.

assignAddressesRelocatable function did not set addresses to sections
despite its name. What it actually did is to set file offsets to sections.
assignAddresses function assigned addresses and file offsets to sections.
So there was a confusion what they were doing, and they had duplicate code.

This patch separates file offset assignments from address assignments.
A new function, assignFileOffsets assign file offsets. assignAddresses
do not care about file offsets anymore.

llvm-svn: 265151

8 years agoBring r264761 back with an extra fix.
Rafael Espindola [Fri, 1 Apr 2016 17:00:36 +0000 (17:00 +0000)]
Bring r264761 back with an extra fix.

The extra fix is to note that it still requires copy relocations.

Original message:

Change how we handle R_MIPS_LO16.

Mips aligns PT_LOAD to 16 bits (0x10000). That means that the lower 16
bits are always the same, so we can, effectively, say that the
relocation is relative.

P.S.: Suggestions for a better name for the predicate are welcome :-)

llvm-svn: 265150

8 years ago[PGO] Refactor PGOFuncName meta data code to be used in clang
Rong Xu [Fri, 1 Apr 2016 16:43:30 +0000 (16:43 +0000)]
[PGO] Refactor PGOFuncName meta data code to be used in clang

Refactor the code that gets and creates PGOFuncName meta data so that it can be
used in clang's value profile annotation.

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

llvm-svn: 265149

8 years ago[x86] avoid intermediate splat for non-zero memsets (PR27100)
Sanjay Patel [Fri, 1 Apr 2016 16:27:14 +0000 (16:27 +0000)]
[x86] avoid intermediate splat for non-zero memsets (PR27100)

Follow-up to D18566 - where we noticed that an intermediate splat was being
generated for memsets of non-zero chars.

That was because we told getMemsetStores() to use a 32-bit vector element type,
and it happily obliged by producing that constant using an integer multiply.

The tests that were added in the last patch are now equivalent for AVX1 and AVX2
(no splats, just a vector load), but we have PR27141 to track that splat difference.
In the new tests, the splat via shuffling looks ok to me, but there might be some
room for improvement depending on uarch there.

Note that the SSE1/2 paths are not changed in this patch. That can be a follow-up.
This patch should resolve PR27100.

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

llvm-svn: 265148

8 years agoDon't apply a recolation that the dynamic linker will rewrite.
Rafael Espindola [Fri, 1 Apr 2016 16:21:09 +0000 (16:21 +0000)]
Don't apply a recolation that the dynamic linker will rewrite.

This matches the behavior of both bfd and gold. Looks like we just got
here for mips because of a bad ordering of an if else chain.

llvm-svn: 265147

8 years ago[OpenCL] Moved nosvm attribute handling in Sema to other OpenCL attrs
Anastasia Stulova [Fri, 1 Apr 2016 16:05:09 +0000 (16:05 +0000)]
[OpenCL] Moved nosvm attribute handling in Sema to other OpenCL attrs

llvm-svn: 265146

8 years ago[ADT] Make StringMap's tombstone aligned.
Benjamin Kramer [Fri, 1 Apr 2016 15:51:51 +0000 (15:51 +0000)]
[ADT] Make StringMap's tombstone aligned.

This avoids undefined behavior when casting pointers to it. Also make
sure that we don't cast to a derived StringMapEntry before checking for
tombstone, as that may have different alignment requirements.

llvm-svn: 265145

8 years ago[PGOProfile] Rename a test to make it more reusable, NFC
Vedant Kumar [Fri, 1 Apr 2016 15:45:33 +0000 (15:45 +0000)]
[PGOProfile] Rename a test to make it more reusable, NFC

llvm-svn: 265144

8 years agoPass a const pointer to getImplicitAddend. NFC.
Rafael Espindola [Fri, 1 Apr 2016 14:36:09 +0000 (14:36 +0000)]
Pass a const pointer to getImplicitAddend. NFC.

llvm-svn: 265143

8 years agoRefactor duplicated code.
Rafael Espindola [Fri, 1 Apr 2016 14:14:48 +0000 (14:14 +0000)]
Refactor duplicated code.

We had almost identical code to handle creating a plt entry in two
places.

llvm-svn: 265142

8 years ago[AMDGPU] fix MADAK/MADMK instructions operand namings to match encoding fields.
Valery Pykhtin [Fri, 1 Apr 2016 13:13:12 +0000 (13:13 +0000)]
[AMDGPU] fix MADAK/MADMK instructions operand namings to match encoding fields.

$vsrc1 -> $src1, $k -> $imm

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

llvm-svn: 265141

8 years agoFix clean rule for a makefile
Pavel Labath [Fri, 1 Apr 2016 12:59:37 +0000 (12:59 +0000)]
Fix clean rule for a makefile

The test was failing on windows because the clean rule (which is executed even if the test is
skipped) returned an error there.

llvm-svn: 265140

8 years agoAvoid creating duplicated relocations.
Rafael Espindola [Fri, 1 Apr 2016 12:54:27 +0000 (12:54 +0000)]
Avoid creating duplicated relocations.

llvm-svn: 265139

8 years ago[x86] Remove redundant call to setTargetDAGCombine for BUILD_VECTOR node type.
Andrea Di Biagio [Fri, 1 Apr 2016 12:25:44 +0000 (12:25 +0000)]
[x86] Remove redundant call to setTargetDAGCombine for BUILD_VECTOR node type.

Since revision 235394, we no longer perform target specific combines on
build_vector nodes. No functional change intended.

llvm-svn: 265138

8 years agoFix linux buildbot after r265136
George Rimar [Fri, 1 Apr 2016 12:24:28 +0000 (12:24 +0000)]
Fix linux buildbot after r265136

http://lab.llvm.org:8011/builders/lld-x86_64-darwin13/builds/20138

Fix: Move method above class that uses it.
Works fine with MSVS.

llvm-svn: 265137

8 years agoMake dummySectionsNum() to be not a member of writer. NFC.
George Rimar [Fri, 1 Apr 2016 11:59:32 +0000 (11:59 +0000)]
Make dummySectionsNum() to be not a member of writer. NFC.

llvm-svn: 265136

8 years ago[X86][AVX512] Regenerated intrinsics tests
Simon Pilgrim [Fri, 1 Apr 2016 11:57:51 +0000 (11:57 +0000)]
[X86][AVX512] Regenerated intrinsics tests

llvm-svn: 265135

8 years ago[MIPS][LLVM-MC] Fix JR encoding for MIPSR6 ISA
Sagar Thakur [Fri, 1 Apr 2016 11:55:33 +0000 (11:55 +0000)]
[MIPS][LLVM-MC] Fix JR encoding for MIPSR6 ISA

Summary: The assembler was picking the wrong JR variant because the pre-R6 one was still enabled at R6.

Author: nitesh.jain
Reviewers: vkalintiris, dsanders
Subscribers: dsanders, llvm-commits, mohit.bhakkad, sagar, bhushan, jaydeep
Differential: D18387
llvm-svn: 265134

8 years ago[ThinLTO] Fix uninitialized flags.
Benjamin Kramer [Fri, 1 Apr 2016 11:49:59 +0000 (11:49 +0000)]
[ThinLTO] Fix uninitialized flags.

Found by msan. Patch by Adrian Kuegel!

llvm-svn: 265133

8 years ago[FIX] Adjust the insert point for non-affine region PHIs
Johannes Doerfert [Fri, 1 Apr 2016 11:25:47 +0000 (11:25 +0000)]
[FIX] Adjust the insert point for non-affine region PHIs

  If a non-affine region PHI is generated we should not move the insert
  point prior to the synthezised value in the same block as we might
  split that block at the insert point later on. Only if the incoming
  value should be placed in a different block we should change the
  insertion point.

llvm-svn: 265132

8 years agoSplit Writer::assignAddresses(): extract common code to fixFileOff(). NFC.
George Rimar [Fri, 1 Apr 2016 11:04:47 +0000 (11:04 +0000)]
Split Writer::assignAddresses(): extract common code to fixFileOff(). NFC.

llvm-svn: 265131

8 years agoSplit Writer::assignAddresses(): extract assignPhdrs(). NFC.
George Rimar [Fri, 1 Apr 2016 10:49:14 +0000 (10:49 +0000)]
Split Writer::assignAddresses(): extract assignPhdrs(). NFC.

llvm-svn: 265130

8 years ago[ELF] - Move calculation of _end to fixAbsoluteSymbols()
George Rimar [Fri, 1 Apr 2016 10:23:32 +0000 (10:23 +0000)]
[ELF] - Move calculation of _end to fixAbsoluteSymbols()

That is consistent with other symbols: _edata, _etext
and can help to avoid duplicate code.

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

llvm-svn: 265129

8 years ago[X86] Introduce Lakemont CPU.
Andrey Turetskiy [Fri, 1 Apr 2016 10:16:15 +0000 (10:16 +0000)]
[X86] Introduce Lakemont CPU.

Add a new Intel MCU CPU Lakemont, which doesn't support X87.

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

llvm-svn: 265128

8 years ago[OPENMP] Fixed documentation category for 'declare simd' attribute, NFC.
Alexey Bataev [Fri, 1 Apr 2016 10:12:06 +0000 (10:12 +0000)]
[OPENMP] Fixed documentation category for 'declare simd' attribute, NFC.

llvm-svn: 265127

8 years ago[Lexer] Let the compiler infer string lengths. No functionality change intended.
Benjamin Kramer [Fri, 1 Apr 2016 10:04:07 +0000 (10:04 +0000)]
[Lexer] Let the compiler infer string lengths. No functionality change intended.

llvm-svn: 265126

8 years ago[Lexer] Don't read out of bounds if a conflict marker is at the end of a file
Benjamin Kramer [Fri, 1 Apr 2016 09:58:45 +0000 (09:58 +0000)]
[Lexer] Don't read out of bounds if a conflict marker is at the end of a file

This can happen as we look for '<<<<' while scanning tokens but then expect
'<<<<\n' to tell apart perforce from diff3 conflict markers. Just harden
the pointer arithmetic.

Found by libfuzzer + asan!

llvm-svn: 265125

8 years agoChange a recently added assert into lldbassert
Pavel Labath [Fri, 1 Apr 2016 09:57:30 +0000 (09:57 +0000)]
Change a recently added assert into lldbassert

llvm-svn: 265124

8 years ago[OPENMP] Avoid useless recursive calls in getDSA if it is called in a loop, NFC
Dmitry Polukhin [Fri, 1 Apr 2016 09:52:30 +0000 (09:52 +0000)]
[OPENMP] Avoid useless recursive calls in getDSA if it is called in a loop, NFC

llvm-svn: 265123

8 years agoFix for pr24346: arm asm label calculation error in sub
James Molloy [Fri, 1 Apr 2016 09:40:47 +0000 (09:40 +0000)]
Fix for pr24346: arm asm label calculation error in sub

Some ARM instructions encode 32-bit immediates as a 8-bit integer (0-255)
and a 4-bit rotation (0-30, even) in its least significant 12 bits. The
original fixup, FK_Data_4, patches the instruction by the value bit-to-bit,
regardless of the encoding. For example, assuming the label L1 and L2 are
0x0 and 0x104 respectively, the following instruction:

  add r0, r0, #(L2 - L1) ; expects 0x104, i.e., 260

would be assembled to the following, which adds 1 to r0, instead of 260:

  e2800104 add r0, r0, #4, 2 ; equivalently 1

The new fixup kind fixup_arm_mod_imm takes care of the encoding:

  e2800f41 add r0, r0, #260

Patch by Ting-Yuan Huang!

llvm-svn: 265122

8 years ago[OPENMP 4.5] Allow data members as loop counters in loop-based
Alexey Bataev [Fri, 1 Apr 2016 09:23:34 +0000 (09:23 +0000)]
[OPENMP 4.5] Allow data members as loop counters in loop-based
directives.

OpenMP 4.5 allows privatization of non-static data members in non-static
member functions. Patch allows to use and implicit privatization of data
members used as counters in loop-based directives.

llvm-svn: 265121

8 years ago[AArch64] Better errors for out-of-range fixups
Oliver Stannard [Fri, 1 Apr 2016 09:14:50 +0000 (09:14 +0000)]
[AArch64] Better errors for out-of-range fixups

When a fixup that can be resolved by the assembler is out of range, we should
report an error in the source, rather than crashing.

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

llvm-svn: 265120

8 years agoRevert "[OPENMP] Allow skip expression after comma in clauses with lists."
Alexey Bataev [Fri, 1 Apr 2016 08:43:42 +0000 (08:43 +0000)]
Revert "[OPENMP] Allow skip expression after comma in clauses with lists."

This reverts commit http://reviews.llvm.org/rL265003. After some
thoughts decided to emit errors here.

llvm-svn: 265119

8 years agoThinLTO: move ObjCARCContractPass in the CodeGen pipeline
Mehdi Amini [Fri, 1 Apr 2016 08:22:59 +0000 (08:22 +0000)]
ThinLTO: move ObjCARCContractPass in the CodeGen pipeline

This is to be coherent with Full LTO.

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

8 years ago[clang-tidy] Don't delete unused parameter in class override method in anonymous...
Haojian Wu [Fri, 1 Apr 2016 07:57:30 +0000 (07:57 +0000)]
[clang-tidy] Don't delete unused parameter in class override method in anonymous namespace.

Summary: Fixes PR26740.

Reviewers: alexfh

Subscribers: cfe-commits

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

llvm-svn: 265117

8 years ago[OCaml] Use LLVMCreateMessage with constant strings when calling llvm_raise
Jeroen Ketema [Fri, 1 Apr 2016 07:56:17 +0000 (07:56 +0000)]
[OCaml] Use LLVMCreateMessage with constant strings when calling llvm_raise

The llvm_string_of_message function, called by llvm_raise, calls
LLVMDisposeMessage, which expects the message to be dynamically
allocated; it fails freeing the message otherwise. So always
dynamically allocate with LLVMCreateMessage.

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

llvm-svn: 265116

8 years ago[OCaml] Reinstate data_layout
Jeroen Ketema [Fri, 1 Apr 2016 07:54:24 +0000 (07:54 +0000)]
[OCaml] Reinstate data_layout

Expose LLVMCreateTargetMachineData as data_layout.

As r263530 did for go. From that commit: "LLVMGetTargetDataLayout was
removed from the C API, and then TargetMachine.TargetData was removed.
Later, LLVMCreateTargetMachineData was added to the C API"

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

llvm-svn: 265115

8 years agoScoPDetection: Obtain a known free diagnostic ID
Tobias Grosser [Fri, 1 Apr 2016 07:15:19 +0000 (07:15 +0000)]
ScoPDetection: Obtain a known free diagnostic ID

... instead of hardcoding something that has been free at some point. This fixes
a crash triggered by r265084, where the diagnostic IDs have been shifted in a
way that resulted our hardcode ID to not be assigned any implementation.  Our ID
was likely already wrong earlier on, but this time we really crashed nicely.

llvm-svn: 265114

8 years agoAdd a libLTO API to stop/restart ThinLTO between optimizations and CodeGen
Mehdi Amini [Fri, 1 Apr 2016 06:47:02 +0000 (06:47 +0000)]
Add a libLTO API to stop/restart ThinLTO between optimizations and CodeGen

This allows the linker to instruct ThinLTO to perform only the
optimization part or only the codegen part of the process.

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

8 years ago[PPC64] Bug fix: when enabling sibling-call-opt and shrink-wrapping, the tail call...
Chuang-Yu Cheng [Fri, 1 Apr 2016 06:44:32 +0000 (06:44 +0000)]
[PPC64] Bug fix: when enabling sibling-call-opt and shrink-wrapping, the tail call branch instruction might disappear

Bug Pattern:
    # BB#0:                                 # %entry
    cmpldi  3, 0
    beq-  0, .LBB0_2
    # BB#1:                                 # %exit
    lwz 4, 0(3)
    #TC_RETURNd8 LVComputationKind 0
    .LBB0_2:                                # %cond.false
    mflr 0
    std 0, 16(1)
    stdu 1, -96(1)
    .Ltmp0:
    .cfi_def_cfa_offset 96
    .Ltmp1:
    .cfi_offset lr, 16
    bl __assert_fail
    nop

The branch instruction for tail call return is not generated, because the
shrink-wrapping pass choosing a new Restore Point: %cond.false, so %exit
block is not sent to emitEpilogue, that's why the branch is not generated.

Thanks Kit's opinions!
Reviewers: nemanjai hfinkel tjablin kbarton

http://reviews.llvm.org/D17606

llvm-svn: 265112

8 years agoAdd a module Hash in the bitcode and the combined index, implementing a kind of ...
Mehdi Amini [Fri, 1 Apr 2016 05:33:11 +0000 (05:33 +0000)]
Add a module Hash in the bitcode and the combined index, implementing a kind of "build-id"

This is intended to be used for ThinLTO incremental build.

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

This is a recommit of r265095 after fixing the Windows issues.

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

8 years agoFix MSVC warning "comparison of integers of different signs" (NFC)
Mehdi Amini [Fri, 1 Apr 2016 05:19:14 +0000 (05:19 +0000)]
Fix MSVC warning "comparison of integers of different signs" (NFC)

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

8 years agoFix S390 big endian detection
Mehdi Amini [Fri, 1 Apr 2016 05:12:24 +0000 (05:12 +0000)]
Fix S390 big endian detection

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

8 years agoConst correctness in raw_sha1_ostream (NFC)
Mehdi Amini [Fri, 1 Apr 2016 05:12:18 +0000 (05:12 +0000)]
Const correctness in raw_sha1_ostream (NFC)

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

8 years agoAdd support for computing SHA1 in LLVM
Mehdi Amini [Fri, 1 Apr 2016 04:30:16 +0000 (04:30 +0000)]
Add support for computing SHA1 in LLVM

Provide a class to generate a SHA1 from a sequence of bytes, and
a convenience raw_ostream adaptor.
This will be used to provide a "build-id" by hashing the Module
block when writing bitcode. ThinLTO will use this information for
incremental build.

Reapply r265094 which was reverted in r265102 because it broke
MSVC bots (constexpr is not supported).

http://reviews.llvm.org/D16325

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

8 years agoImprove CHECK-NOT robustness of dllexport tests
Sean Silva [Fri, 1 Apr 2016 03:54:03 +0000 (03:54 +0000)]
Improve CHECK-NOT robustness of dllexport tests

This changes some dllexport tests, to verify that some symbols that
should not be exported are not, in a way that improves the robustness
of CHECK-SAME interaction with CHECK-NOT.

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

Patch by Warren Ristow!

llvm-svn: 265106