platform/upstream/llvm.git
8 years ago[sancov] using md5 for anchors in attempt to reduce file size.
Mike Aizatsky [Fri, 11 Mar 2016 23:28:28 +0000 (23:28 +0000)]
[sancov] using md5 for anchors in attempt to reduce file size.

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

llvm-svn: 263308

8 years agoDon't crash sancov if file is unreadable.
Mike Aizatsky [Fri, 11 Mar 2016 23:26:41 +0000 (23:26 +0000)]
Don't crash sancov if file is unreadable.

Summary:
Caller can provides the list of .so files where some files are
unreadable (e.g linux-vdso.so.1). It's more convenient to handler this in
sancov with warning then making all callers to check files.

Reviewers: aizatsky

Subscribers: llvm-commits

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

llvm-svn: 263307

8 years agoExtend test-suite docs to describe how to run test-suite with cmake+lit
Chris Matthews [Fri, 11 Mar 2016 22:33:36 +0000 (22:33 +0000)]
Extend test-suite docs to describe how to run test-suite with cmake+lit

llvm-svn: 263305

8 years agoMinor cleanup and documentation to IRMover (NFC)
Mehdi Amini [Fri, 11 Mar 2016 22:19:06 +0000 (22:19 +0000)]
Minor cleanup and documentation to IRMover (NFC)

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

8 years ago[X86][SSE] Simplify vector LOAD + EXTEND on pre-SSE41 hardware
Simon Pilgrim [Fri, 11 Mar 2016 22:18:05 +0000 (22:18 +0000)]
[X86][SSE] Simplify vector LOAD + EXTEND on pre-SSE41 hardware

Improve vector extension of vectors on hardware without dedicated VSEXT/VZEXT instructions.

We already convert these to SIGN_EXTEND_VECTOR_INREG/ZERO_EXTEND_VECTOR_INREG but can further improve this by using the legalizer instead of prematurely splitting into legal vectors in the combine as this only properly helps for lowering to VSEXT/VZEXT.

Removes a lot of unnecessary any_extend + mask pattern - (Fix for PR25718).

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

llvm-svn: 263303

8 years agoMake functions in altivec.h be __inline__. As they are all also marked
Daniel Jasper [Fri, 11 Mar 2016 22:13:28 +0000 (22:13 +0000)]
Make functions in altivec.h be __inline__. As they are all also marked
__always_inline__, this has likely been meant from the start.

Review: http://reviews.llvm.org/D18015
llvm-svn: 263302

8 years ago[AArch64] Don't blindly lower f16/f128 FCCMPs.
Ahmed Bougacha [Fri, 11 Mar 2016 22:02:58 +0000 (22:02 +0000)]
[AArch64] Don't blindly lower f16/f128 FCCMPs.

Instead, extend f16 (like we do when lowering a standalone SETCC),
and let f128 be legalized to the RT calls.

Fixes PR26803.

llvm-svn: 263301

8 years agoFix Clang-tidy modernize-use-nullptr warnings in some files in source/Core; other...
Eugene Zelenko [Fri, 11 Mar 2016 21:55:47 +0000 (21:55 +0000)]
Fix Clang-tidy modernize-use-nullptr warnings in some files in source/Core; other minor fixes.

llvm-svn: 263300

8 years agoAdd fix-it for format-security warnings.
Bob Wilson [Fri, 11 Mar 2016 21:55:37 +0000 (21:55 +0000)]
Add fix-it for format-security warnings.

llvm-svn: 263299

8 years agoInitialize CalleeInfo to fix bot after r263275
Teresa Johnson [Fri, 11 Mar 2016 21:34:45 +0000 (21:34 +0000)]
Initialize CalleeInfo to fix bot after r263275

Hopefully will fix garbage output in
http://lab.llvm.org:8011/builders/clang-x86-win2008-selfhost/builds/6901

llvm-svn: 263297

8 years agoUpdate Polly for the removal of PreserveNames from IRBuilder stuff
David Blaikie [Fri, 11 Mar 2016 21:33:58 +0000 (21:33 +0000)]
Update Polly for the removal of PreserveNames from IRBuilder stuff

llvm-svn: 263296

8 years agoFix ObjCMethodDecl::findPropertyDecl for class properties.
Jordan Rose [Fri, 11 Mar 2016 21:14:40 +0000 (21:14 +0000)]
Fix ObjCMethodDecl::findPropertyDecl for class properties.

This affects code completion and a few other things; hopefully the code completion
test is sufficient to catch regressions.

llvm-svn: 263295

8 years agoFix order of arguments to fputs
Reid Kleckner [Fri, 11 Mar 2016 21:07:48 +0000 (21:07 +0000)]
Fix order of arguments to fputs

This time actually tested on Linux, where the test is not XFAILed.

llvm-svn: 263294

8 years agoSwitch to fputs stderr to try to fix output buffering issues
Reid Kleckner [Fri, 11 Mar 2016 20:54:14 +0000 (20:54 +0000)]
Switch to fputs stderr to try to fix output buffering issues

llvm-svn: 263293

8 years agoELF: Implement --build-id.
Rui Ueyama [Fri, 11 Mar 2016 20:51:53 +0000 (20:51 +0000)]
ELF: Implement --build-id.

This patch implements --build-id. After the linker creates an output file
in the memory buffer, it computes the FNV1 hash of the resulting file
and set the hash to the .note section as a build-id.

GNU ld and gold have the same feature, but their default choice of the
hash function is different. Their default is SHA1.

We made a deliberate choice to not use a secure hash function for the
sake of performance. Computing a secure hash is slow -- for example,
MD5 throughput is usually 400 MB/s or so. SHA1 is slower than that.

As a result, if you pass --build-id to gold, then the linker becomes about
10% slower than that without the option. We observed a similar degradation
in an experimental implementation of build-id for LLD. On the other hand,
we observed only 1-2% performance degradation with the FNV hash.

Since build-id is not for digital certificate or anything, we think that
a very small probability of collision is acceptable.

We considered using other signals such as using input file timestamps as
inputs to a secure hash function. But such signals would have an issue
with build reproducibility (if you build a binary from the same source
tree using the same toolchain, the build id should become the same.)

GNU linkers accepts --build-id=<style> option where style is one of
"MD5", "SHA1", or an arbitrary hex string. That option is out of scope
of this patch.

http://reviews.llvm.org/D18091

llvm-svn: 263292

8 years ago[STATS] change TASK_execution name to OMP_task
Jonathan Peyton [Fri, 11 Mar 2016 20:23:05 +0000 (20:23 +0000)]
[STATS] change TASK_execution name to OMP_task

llvm-svn: 263291

8 years ago[STATS] Add a total statistics count
Jonathan Peyton [Fri, 11 Mar 2016 20:20:49 +0000 (20:20 +0000)]
[STATS] Add a total statistics count

This change removes synthesized stats and instead has all timers print out a
total which is the aggregate statistics across threads. This is displayed as
"Total_foo" at the end of program. The stats_flags_e::synthesized flag is
removed and the printStats() function is split into two separate functions:
printTimerStats() which can display the aggregate total and printCounterStats().

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

llvm-svn: 263290

8 years agoFix Clang-tidy modernize-use-nullptr warnings in some files in source/Core; other...
Eugene Zelenko [Fri, 11 Mar 2016 20:20:38 +0000 (20:20 +0000)]
Fix Clang-tidy modernize-use-nullptr warnings in some files in source/Core; other minor fixes.

llvm-svn: 263289

8 years agoDefine NT_GNU_BUILD_ID constant.
Rui Ueyama [Fri, 11 Mar 2016 20:20:25 +0000 (20:20 +0000)]
Define NT_GNU_BUILD_ID constant.

llvm-svn: 263288

8 years ago[WebAssembly] Add `final` keywords to a few more subclasses, for consistency.
Dan Gohman [Fri, 11 Mar 2016 19:45:37 +0000 (19:45 +0000)]
[WebAssembly] Add `final` keywords to a few more subclasses, for consistency.

llvm-svn: 263287

8 years ago[MemorySSA] Make a return type reflect reality. NFC.
George Burgess IV [Fri, 11 Mar 2016 19:34:03 +0000 (19:34 +0000)]
[MemorySSA] Make a return type reflect reality. NFC.

llvm-svn: 263286

8 years agoAdd missing triple to instantiate-sizeof.cpp test
Reid Kleckner [Fri, 11 Mar 2016 19:17:53 +0000 (19:17 +0000)]
Add missing triple to instantiate-sizeof.cpp test

llvm-svn: 263285

8 years agoRemove the skip if Darwin since I fixed the crash.
Jim Ingham [Fri, 11 Mar 2016 19:15:03 +0000 (19:15 +0000)]
Remove the skip if Darwin since I fixed the crash.

llvm-svn: 263283

8 years agoMake printf-4 more robust to strlen interception after r263177
Reid Kleckner [Fri, 11 Mar 2016 19:11:15 +0000 (19:11 +0000)]
Make printf-4 more robust to strlen interception after r263177

The CHECK line was matching stack-buffer-overflow from puts calling
strlen, which is not the bug the test is trying to catch.

llvm-svn: 263282

8 years agoIntroduce @llvm.experimental.deoptimize
Sanjoy Das [Fri, 11 Mar 2016 19:08:34 +0000 (19:08 +0000)]
Introduce @llvm.experimental.deoptimize

Summary:
This intrinsic, together with deoptimization operand bundles, allow
frontends to express transfer of control and frame-local state from
one (typically more specialized, hence faster) version of a function
into another (typically more generic, hence slower) version.

In languages with a fully integrated managed runtime this intrinsic can
be used to implement "uncommon trap" like functionality.  In unmanaged
languages like C and C++, this intrinsic can be used to represent the
slow paths of specialized functions.

Note: this change does not address how `@llvm.experimental_deoptimize`
is lowered.  That will be done in a later change.

Reviewers: chandlerc, rnk, atrick, reames

Subscribers: llvm-commits, kmod, mjacob, maksfb, mcrosier, JosephTremoulet

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

llvm-svn: 263281

8 years agoRemove obsolete comment.
Rui Ueyama [Fri, 11 Mar 2016 19:04:56 +0000 (19:04 +0000)]
Remove obsolete comment.

llvm-svn: 263280

8 years agoAllow sizeof(UnrelatedClass::field) in C++11 class template methods
Reid Kleckner [Fri, 11 Mar 2016 18:59:12 +0000 (18:59 +0000)]
Allow sizeof(UnrelatedClass::field) in C++11 class template methods

This feature works outside of templates by forming a DeclRefExpr to a
FieldDecl instead of a MemberExpr, which requires a base object in
addition to the FieldDecl.

Previously, while building up the template AST before instantiation, we
formed a CXXDependentScopeMemberExpr, which always instantiates to a
MemberExpr. Now, in unevaluated contexts we form a
DependentScopeDeclRefExpr, which is a more flexible node that can
instantiate to either a MemberExpr or a DeclRefExpr depending on lookup
results.

Fixes PR26893.

llvm-svn: 263279

8 years ago[PGO] Skip value profile instrumentation of inline asm
Vedant Kumar [Fri, 11 Mar 2016 18:57:48 +0000 (18:57 +0000)]
[PGO] Skip value profile instrumentation of inline asm

Value profile instrumentation treats inline asm calls like they are
indirect calls. This causes problems when the 'Callee' is passed to a
ptrtoint cast -- the verifier rightly claims that this is bogus and
crashes opt.

llvm-svn: 263278

8 years agoFix MSVC build.
Rui Ueyama [Fri, 11 Mar 2016 18:56:05 +0000 (18:56 +0000)]
Fix MSVC build.

llvm-svn: 263277

8 years agoUpdate test case for llvm summary format changes in D17592.
Teresa Johnson [Fri, 11 Mar 2016 18:52:42 +0000 (18:52 +0000)]
Update test case for llvm summary format changes in D17592.

llvm-svn: 263276

8 years ago[ThinLTO] Support for reference graph in per-module and combined summary.
Teresa Johnson [Fri, 11 Mar 2016 18:52:24 +0000 (18:52 +0000)]
[ThinLTO] Support for reference graph in per-module and combined summary.

Summary:
This patch adds support for including a full reference graph including
call graph edges and other GV references in the summary.

The reference graph edges can be used to make importing decisions
without materializing any source modules, can be used in the plugin
to make file staging decisions for distributed build systems, and is
expected to have other uses.

The call graph edges are recorded in each function summary in the
bitcode via a list of <CalleeValueIds, StaticCount> tuples when no PGO
data exists, or <CalleeValueId, StaticCount, ProfileCount> pairs when
there is PGO, where the ValueId can be mapped to the function GUID via
the ValueSymbolTable. In the function index in memory, the call graph
edges reference the target via the CalleeGUID instead of the
CalleeValueId.

The reference graph edges are recorded in each summary record with a
list of referenced value IDs, which can be mapped to value GUID via the
ValueSymbolTable.

Addtionally, a new summary record type is added to record references
from global variable initializers. A number of bitcode records and data
structures have been renamed to reflect the newly expanded scope of the
summary beyond functions. More cleanup will follow.

Reviewers: joker.eph, davidxl

Subscribers: joker.eph, llvm-commits

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

llvm-svn: 263275

8 years agoCheck for a NULL input filehandle before referencing it.
Jim Ingham [Fri, 11 Mar 2016 18:49:38 +0000 (18:49 +0000)]
Check for a NULL input filehandle before referencing it.

<rdar://problem/25105824>

llvm-svn: 263274

8 years agoFix clang crash: when CodeGenAction is initialized without a context, use the member...
Mehdi Amini [Fri, 11 Mar 2016 18:48:02 +0000 (18:48 +0000)]
Fix clang crash: when CodeGenAction is initialized without a context, use the member and not the parameter

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

8 years agoRevert r263252: "[ELF] - Change all messages to lowercase to be consistent."
Rui Ueyama [Fri, 11 Mar 2016 18:46:51 +0000 (18:46 +0000)]
Revert r263252: "[ELF] - Change all messages to lowercase to be consistent."

This reverts commit r263252 because the change contained unrelated changes.

llvm-svn: 263272

8 years agoNow that it is trivial, fix pr26878.
Rafael Espindola [Fri, 11 Mar 2016 18:33:48 +0000 (18:33 +0000)]
Now that it is trivial, fix pr26878.

llvm-svn: 263271

8 years agoType correct Visual Studio native visualization for PointerUnions
Mike Spertus [Fri, 11 Mar 2016 18:26:47 +0000 (18:26 +0000)]
Type correct Visual Studio native visualization for PointerUnions

Visualize pointer unions by their actual type rather than as void *.

llvm-svn: 263270

8 years ago[SEH] Remove nounwind/noinline from outlined finally funclets
Reid Kleckner [Fri, 11 Mar 2016 17:36:16 +0000 (17:36 +0000)]
[SEH] Remove nounwind/noinline from outlined finally funclets

With the new EH representation this is no longer necessary.

llvm-svn: 263269

8 years agoUpdate test case to appease bots after 263255.
Chad Rosier [Fri, 11 Mar 2016 17:33:36 +0000 (17:33 +0000)]
Update test case to appease bots after 263255.

I'll follow up with Matt to confirm this is the correct fix.

llvm-svn: 263268

8 years agoFix build: use -> with pointers and not .
Mehdi Amini [Fri, 11 Mar 2016 17:32:58 +0000 (17:32 +0000)]
Fix build: use -> with pointers and not .

Silly typo.

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

8 years agoFix spelling.
Simon Pilgrim [Fri, 11 Mar 2016 17:31:43 +0000 (17:31 +0000)]
Fix spelling.

llvm-svn: 263266

8 years ago[IRTranslator] Translate unconditional branches.
Quentin Colombet [Fri, 11 Mar 2016 17:28:03 +0000 (17:28 +0000)]
[IRTranslator] Translate unconditional branches.

llvm-svn: 263265

8 years ago[MachineIRBuilder] Rework buildInstr API to maximize code reuse.
Quentin Colombet [Fri, 11 Mar 2016 17:27:58 +0000 (17:27 +0000)]
[MachineIRBuilder] Rework buildInstr API to maximize code reuse.

llvm-svn: 263264

8 years ago[IRTranslator] Update getOrCreateVReg API to use references.
Quentin Colombet [Fri, 11 Mar 2016 17:27:54 +0000 (17:27 +0000)]
[IRTranslator] Update getOrCreateVReg API to use references.
A value that we want to keep in a virtual register cannot be null.
Reflect that in the API.

llvm-svn: 263263

8 years ago[MachineIRBuilder] Rename the setter of MF for consistency with the getter.
Quentin Colombet [Fri, 11 Mar 2016 17:27:51 +0000 (17:27 +0000)]
[MachineIRBuilder] Rename the setter of MF for consistency with the getter.

llvm-svn: 263262

8 years ago[MachineIRBuilder] Rename the setter for MBB for consistency with the getter.
Quentin Colombet [Fri, 11 Mar 2016 17:27:47 +0000 (17:27 +0000)]
[MachineIRBuilder] Rename the setter for MBB for consistency with the getter.

llvm-svn: 263261

8 years ago[IRTranslator] Update getOrCreateBB API to use references.
Quentin Colombet [Fri, 11 Mar 2016 17:27:43 +0000 (17:27 +0000)]
[IRTranslator] Update getOrCreateBB API to use references.
A null basic block is invalid, so just pass a reference.

llvm-svn: 263260

8 years ago[GlobalISel][Target] Add an opcode for unconditional branch.
Quentin Colombet [Fri, 11 Mar 2016 17:27:38 +0000 (17:27 +0000)]
[GlobalISel][Target] Add an opcode for unconditional branch.

llvm-svn: 263259

8 years agoRemove PreserveNames template parameter from IRBuilder
Mehdi Amini [Fri, 11 Mar 2016 17:15:50 +0000 (17:15 +0000)]
Remove PreserveNames template parameter from IRBuilder

Summary:
Following r263086, we are now relying on a flag on the Context to
discard Value names in release builds.

Reviewers: chandlerc

Subscribers: mzolotukhin, llvm-commits

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

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

8 years agoRemove compile time PreserveName switch based on NDEBUG
Mehdi Amini [Fri, 11 Mar 2016 17:15:44 +0000 (17:15 +0000)]
Remove compile time PreserveName switch based on NDEBUG

Summary:
Following r263086, we are now relying on a flag on the Context to
discard Value names in release builds.

Reviewers: chandlerc

Subscribers: cfe-commits

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

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

8 years agoDo not specialize IRBuilder to strip names in SROA
Mehdi Amini [Fri, 11 Mar 2016 17:15:34 +0000 (17:15 +0000)]
Do not specialize IRBuilder to strip names in SROA

Summary:
Following r263086, we are replacing this by a runtime check.
More cleanup will follow on the IRBuilder itself, but I submitted
this patch separately as SROA has a fancy "prefixInserter" class
that needs extra-love.

Reviewers: chandlerc

Subscribers: llvm-commits

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

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

8 years ago[misched] Fix a truncation issue from r263021.
Chad Rosier [Fri, 11 Mar 2016 16:54:07 +0000 (16:54 +0000)]
[misched] Fix a truncation issue from r263021.

The truncation was causing the sorting algorithm to behave oddly when comparing
positive and negative offsets.  Fortunately, this doesn't currently happen in
practice and was exposed by a WIP.  Thus, I can't test this change now, but the
follow on patch will.

llvm-svn: 263255

8 years agoYet more MSVC fixes.
Rafael Espindola [Fri, 11 Mar 2016 16:41:23 +0000 (16:41 +0000)]
Yet more MSVC fixes.

llvm-svn: 263253

8 years ago[ELF] - Change all messages to lowercase to be consistent.
George Rimar [Fri, 11 Mar 2016 16:40:55 +0000 (16:40 +0000)]
[ELF] - Change all messages to lowercase to be consistent.

That is directly opposite to http://reviews.llvm.org/D18045,
which was reverted.

This patch changes all messages to start from lowercase letter if
they were not before.

That is done to be consistent with clang.

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

llvm-svn: 263252

8 years agoMore MSVC fixes.
Rafael Espindola [Fri, 11 Mar 2016 16:32:46 +0000 (16:32 +0000)]
More MSVC fixes.

llvm-svn: 263251

8 years ago[PM] Sink the "Expression" type for GVN into the class as a private
Chandler Carruth [Fri, 11 Mar 2016 16:25:19 +0000 (16:25 +0000)]
[PM] Sink the "Expression" type for GVN into the class as a private
member type.

Because of how this type is used by the ValueTable, it cannot actually
have hidden visibility. GCC actually nicely warns about this but Clang
just silently ... I don't even know. =/ We should do a better job either
way though.

This should resolve a bunch of the GCC warnings about visibility that
the port of GVN triggered and make the visibility story a bit more
correct.

llvm-svn: 263250

8 years agoTrying to fix the MSVC build.
Rafael Espindola [Fri, 11 Mar 2016 16:23:45 +0000 (16:23 +0000)]
Trying to fix the MSVC build.

llvm-svn: 263249

8 years agoAvoid calling getNamedValue.
Rafael Espindola [Fri, 11 Mar 2016 16:11:47 +0000 (16:11 +0000)]
Avoid calling getNamedValue.

In lld we usually avoid hash lookups. In addition to that, IR names are
not fully mangled, so it is best to avoid using them whenever possible.

llvm-svn: 263248

8 years agoMore UTF string conversion wrappers
Marianne Mailhot-Sarrasin [Fri, 11 Mar 2016 15:59:32 +0000 (15:59 +0000)]
More UTF string conversion wrappers

Added new string conversion wrappers that convert between `std::string` (of UTF-8 bytes) and `std::wstring`, which is particularly useful for Win32 interop. Also fixed a missing string conversion for `getenv` on Win32, using these new wrappers.
The motivation behind this is to provide the support functions required for LLDB to work properly on Windows with non-ASCII data; however, the functions are not LLDB specific.

Patch by cameron314

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

llvm-svn: 263247

8 years agoRevert r263036, it's ABI-breaking.
Nico Weber [Fri, 11 Mar 2016 15:26:06 +0000 (15:26 +0000)]
Revert r263036, it's ABI-breaking.

llvm-svn: 263246

8 years agoAdd tests for ARM Cortex-R8
Alexandros Lamprineas [Fri, 11 Mar 2016 15:03:40 +0000 (15:03 +0000)]
Add tests for ARM Cortex-R8

Add command-line tests for ARM Cortex-R8 checking that the driver calls
clang -cc1 with the correct little-endian/big-endian, and ARM/Thumb triple.

Patch by Pablo Barrio <pablo.barrio@arm.com>

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

llvm-svn: 263245

8 years agoDon't invent names for STT_SECTION symbols.
Rafael Espindola [Fri, 11 Mar 2016 14:57:33 +0000 (14:57 +0000)]
Don't invent names for STT_SECTION symbols.

We should just copy the symbol names with -r.

llvm-svn: 263244

8 years agoSimplify test.
Rafael Espindola [Fri, 11 Mar 2016 14:54:03 +0000 (14:54 +0000)]
Simplify test.

We only need one run of llmv-readobj.

llvm-svn: 263243

8 years ago[AMDGPU] Fix VOPC instruction operand namings
Valery Pykhtin [Fri, 11 Mar 2016 14:53:28 +0000 (14:53 +0000)]
[AMDGPU] Fix VOPC instruction operand namings

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

llvm-svn: 263242

8 years agoSimplify test. NFC.
Rafael Espindola [Fri, 11 Mar 2016 14:46:41 +0000 (14:46 +0000)]
Simplify test. NFC.

llvm-svn: 263241

8 years agoThis reverts the r263125
George Rimar [Fri, 11 Mar 2016 14:43:02 +0000 (14:43 +0000)]
This reverts the r263125
It was discussed to make all messages be
lowercase to be consistent with clang.
(also reverts the r263128 which fixed
build bot fail after r263125)

Original commit message:
[ELF] - Consistent spelling for error/warning messages

Previously error and warnings were not consistent in lld.
Some of them started from lowercase letter, others from
uppercase. Also there was one or two which had a dot at the end.
This patch changes all messages to start from uppercase letter if
they were not before.

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

llvm-svn: 263240

8 years ago[X86][AVX] Fixed issue where a long chain of shuffles could attempt to combine to...
Simon Pilgrim [Fri, 11 Mar 2016 14:39:10 +0000 (14:39 +0000)]
[X86][AVX] Fixed issue where a long chain of shuffles could attempt to combine to a single (illegal) PSHUFB instruction.

Its not enough that we test for SSSE3 - that's only OK for 128-bit vectors - we also need to test for AVX2 / AVX512BW for 256/512 bit vector cases.

llvm-svn: 263239

8 years agoRun dos2unix. NFC.
Rafael Espindola [Fri, 11 Mar 2016 14:34:44 +0000 (14:34 +0000)]
Run dos2unix. NFC.

llvm-svn: 263238

8 years agoRepresent local symbols with DefinedRegular.
Rafael Espindola [Fri, 11 Mar 2016 14:21:37 +0000 (14:21 +0000)]
Represent local symbols with DefinedRegular.

llvm-svn: 263237

8 years ago[ELF][MIPS] Update comment about creation local GOT entries for non-local symbols...
Simon Atanasyan [Fri, 11 Mar 2016 13:57:53 +0000 (13:57 +0000)]
[ELF][MIPS] Update comment about creation local GOT entries for non-local symbols. NFC.

llvm-svn: 263236

8 years ago[AA] Make BasicAA just require domtree.
Chandler Carruth [Fri, 11 Mar 2016 13:53:18 +0000 (13:53 +0000)]
[AA] Make BasicAA just require domtree.

This doesn't change how many times we construct domtrees in the normal
pipeline, and it removes fragility and instability where basic-aa may
not be run in time to see domtrees because they happen to be constructed
afterward.

This isn't quite as clean as the change to memdep because there is
a mode where basic-aa specifically runs without domtrees -- in the
hacking version used by function-attrs with the legacy pass manager.

llvm-svn: 263234

8 years agoFixed MemoryCache L1 cache flush
Marianne Mailhot-Sarrasin [Fri, 11 Mar 2016 13:50:10 +0000 (13:50 +0000)]
Fixed MemoryCache L1 cache flush

Use the same method to find the cache line as in Read().

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

llvm-svn: 263233

8 years ago[memdep] Just require domtree for memdep.
Chandler Carruth [Fri, 11 Mar 2016 13:46:00 +0000 (13:46 +0000)]
[memdep] Just require domtree for memdep.

This doesn't cause us to construct dominator trees any more often in the
normal pipeline, and removes an entire mode of memdep that needed to be
reasoned about and maintained. Perhaps more importantly, it removes the
ability for the results of memdep to be different because of accidental
pass scheduling goofs or the order of evaluation of 'getResult' calls.

Essentially, 'getCachedResult', unless across IR-unit boundaries, is
extremely dangerous. We need to work much harder to avoid it (or its
analog in the old pass manager).

llvm-svn: 263232

8 years ago[PM] The order of evaluation of these analyses is actually significant,
Chandler Carruth [Fri, 11 Mar 2016 13:26:47 +0000 (13:26 +0000)]
[PM] The order of evaluation of these analyses is actually significant,
much to my horror, so use variables to fix it in place.

This terrifies me. Both basic-aa and memdep will provide more precise
information when the domtree and/or the loop info is available. Because
of this, if your pass (like GVN) requires domtree, and then queries
memdep or basic-aa, it will get more precise results. If it does this in
the other order, it gets less precise results.

All of the ideas I have for fixing this are, essentially, terrible. Here
I've just caused us to stop having unspecified behavior as different
implementations evaluate the order of these arguments differently. I'm
actually rather glad that they do, or the fragility of memdep and
basic-aa would have gone on unnoticed. I've left comments so we don't
immediately break this again. This should fix bots whose host compilers
evaluate the order of arguments differently from Clang.

llvm-svn: 263231

8 years agoRemove a redundant cast.
Rafael Espindola [Fri, 11 Mar 2016 13:17:15 +0000 (13:17 +0000)]
Remove a redundant cast.

llvm-svn: 263230

8 years ago[mips] MIPSR6 Instruction itineraries
Vasileios Kalintiris [Fri, 11 Mar 2016 13:05:06 +0000 (13:05 +0000)]
[mips] MIPSR6 Instruction itineraries

Summary: Defines instruction itineraries for common MIPSR6 instructions.

Patch by Simon Dardis.

Reviewers: vkalintiris

Subscribers: MatzeB, dsanders, llvm-commits

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

llvm-svn: 263229

8 years agoSimplify now that local symbols can use getVA.
Rafael Espindola [Fri, 11 Mar 2016 13:04:28 +0000 (13:04 +0000)]
Simplify now that local symbols can use getVA.

It is really odd that Mips differentiates symbols that are born local
and those that become local because of hidden visibility. I don't know
enough mips to known if this is a bug or not.

llvm-svn: 263228

8 years ago[ELF] - Early continue in InputSectionBase<ELFT>::relocate(). NFC.
George Rimar [Fri, 11 Mar 2016 12:57:52 +0000 (12:57 +0000)]
[ELF] - Early continue in InputSectionBase<ELFT>::relocate(). NFC.

llvm-svn: 263227

8 years ago[ELF] - Evaluate addend earlier and use it instead getAddend() calls. NFC.
George Rimar [Fri, 11 Mar 2016 12:53:17 +0000 (12:53 +0000)]
[ELF] - Evaluate addend earlier and use it instead getAddend() calls. NFC.

llvm-svn: 263226

8 years agoCompute value of local symbol with getVA.
Rafael Espindola [Fri, 11 Mar 2016 12:19:05 +0000 (12:19 +0000)]
Compute value of local symbol with getVA.

llvm-svn: 263225

8 years agoRemember the input section of locals.
Rafael Espindola [Fri, 11 Mar 2016 12:14:02 +0000 (12:14 +0000)]
Remember the input section of locals.

This is already a simplification, but will allow much more.

llvm-svn: 263224

8 years ago[PM] Update Kaleidoscope with the new header file.
Chandler Carruth [Fri, 11 Mar 2016 12:10:15 +0000 (12:10 +0000)]
[PM] Update Kaleidoscope with the new header file.

llvm-svn: 263223

8 years agoCreate a SymbolBody for locals.
Rafael Espindola [Fri, 11 Mar 2016 12:06:30 +0000 (12:06 +0000)]
Create a SymbolBody for locals.

pr26878 shows a case where locals have to be in the got.

llvm-svn: 263222

8 years ago[clang-tidy] Make 'modernize-use-nullptr' check ignores NULL marcos used in other...
Haojian Wu [Fri, 11 Mar 2016 11:40:08 +0000 (11:40 +0000)]
[clang-tidy] Make 'modernize-use-nullptr' check ignores NULL marcos used in other macros.

Reviewers: bkramer, alexfh

Subscribers: cfe-commits

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

llvm-svn: 263221

8 years ago[mips] Range check simm4.
Daniel Sanders [Fri, 11 Mar 2016 11:37:50 +0000 (11:37 +0000)]
[mips] Range check simm4.

Summary:

Reviewers: vkalintiris

Subscribers: dsanders, llvm-commits

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

llvm-svn: 263220

8 years ago[PM] Make the AnalysisManager parameter to run methods a reference.
Chandler Carruth [Fri, 11 Mar 2016 11:05:24 +0000 (11:05 +0000)]
[PM] Make the AnalysisManager parameter to run methods a reference.

This was originally a pointer to support pass managers which didn't use
AnalysisManagers. However, that doesn't realistically come up much and
the complexity of supporting it doesn't really make sense.

In fact, *many* parts of the pass manager were just assuming the pointer
was never null already. This at least makes it much more explicit and
clear.

llvm-svn: 263219

8 years ago[Sanitizer][MIPS] internal lstat and fstat for mips64
Mohit K. Bhakkad [Fri, 11 Mar 2016 10:51:03 +0000 (10:51 +0000)]
[Sanitizer][MIPS] internal lstat and fstat for mips64

Reviewers: dvyukov

Subscribers: jaydeep, sagar, llvm-commits

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

llvm-svn: 263218

8 years ago[PM] Rename the CRTP mixin base classes for the new pass manager to
Chandler Carruth [Fri, 11 Mar 2016 10:33:22 +0000 (10:33 +0000)]
[PM] Rename the CRTP mixin base classes for the new pass manager to
clarify their purpose.

Firstly, call them "...Mixin" types so it is clear that there is no
type hierarchy being formed here. Secondly, use the term 'Info' to
clarify that they aren't adding any interesting *semantics* to the
passes or analyses, just exposing APIs used by the management layer to
get information about the pass or analysis.

Thanks to Manuel for helping pin down the naming confusion here and come
up with effective names to address it.

In case you already have some out-of-tree stuff, the following should be
roughly what you want to update:

  perl -pi -e 's/\b(Pass|Analysis)Base\b/\1InfoMixin/g'

llvm-svn: 263217

8 years ago[PM] Implement the final conclusion as to how the analysis IDs should
Chandler Carruth [Fri, 11 Mar 2016 10:22:49 +0000 (10:22 +0000)]
[PM] Implement the final conclusion as to how the analysis IDs should
work in the face of the limitations of DLLs and templated static
variables.

This requires passes that use the AnalysisBase mixin provide a static
variable themselves. So as to keep their APIs clean, I've made these
private and befriended the CRTP base class (which is the common
practice).

I've added documentation to AnalysisBase for why this is necessary and
at what point we can go back to the much simpler system.

This is clearly a better pattern than the extern template as it caught
*numerous* places where the template magic hadn't been applied and
things were "just working" but would eventually have broken
mysteriously.

llvm-svn: 263216

8 years ago[InstCombine] Use Twines to generate names.
Benjamin Kramer [Fri, 11 Mar 2016 10:20:56 +0000 (10:20 +0000)]
[InstCombine] Use Twines to generate names.

Since the names are used in a loop this does more work in debug builds. In
release builds value names are generally discarded so we don't have to do
the concatenation at all. It's also simpler code, no functional change
intended.

llvm-svn: 263215

8 years ago[ELF] - Move initSymbols() to Driver.cpp. NFC.
George Rimar [Fri, 11 Mar 2016 10:07:18 +0000 (10:07 +0000)]
[ELF] - Move initSymbols() to Driver.cpp. NFC.

That is followup for http://reviews.llvm.org/D18047
patch. initSymbols() moved to Driver.cpp and made static.

llvm-svn: 263214

8 years agoFix linux build after r263190
Ismail Donmez [Fri, 11 Mar 2016 09:55:06 +0000 (09:55 +0000)]
Fix linux build after r263190

llvm-svn: 263213

8 years ago[AMDGPU] Assembler: change v_madmk operands to have same order as mad.
Nikolay Haustov [Fri, 11 Mar 2016 09:27:25 +0000 (09:27 +0000)]
[AMDGPU] Assembler: change v_madmk operands to have same order as mad.

The constant is now at source operand 1 (previously at 2).
This is also how it is in legacy AMD sp3 assembler.
Update tests.

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

llvm-svn: 263212

8 years ago[PM/AA] Teach the AAManager how to handle module analyses in addition to
Chandler Carruth [Fri, 11 Mar 2016 09:15:11 +0000 (09:15 +0000)]
[PM/AA] Teach the AAManager how to handle module analyses in addition to
function analyses, and use it to wire up globals-aa to the new pass
manager.

llvm-svn: 263211

8 years agoUpdate to include the new header file providing createGVNPass.
Chandler Carruth [Fri, 11 Mar 2016 09:02:43 +0000 (09:02 +0000)]
Update to include the new header file providing createGVNPass.

llvm-svn: 263210

8 years agoFix a bunch of signedness warnings in unittests
Pavel Labath [Fri, 11 Mar 2016 09:00:23 +0000 (09:00 +0000)]
Fix a bunch of signedness warnings in unittests

llvm-svn: 263209

8 years ago[PM] Port GVN to the new pass manager, wire it up, and teach a couple of
Chandler Carruth [Fri, 11 Mar 2016 08:50:55 +0000 (08:50 +0000)]
[PM] Port GVN to the new pass manager, wire it up, and teach a couple of
tests to run GVN in both modes.

This is mostly the boring refactoring just like SROA and other complex
transformation passes. There is some trickiness in that GVN's
ValueNumber class requires hand holding to get to compile cleanly. I'm
open to suggestions about a better pattern there, but I tried several
before settling on this. I was trying to balance my desire to sink as
much implementation detail into the source file as possible without
introducing overly many layers of abstraction.

Much like with SROA, the design of this system is made somewhat more
cumbersome by the need to support both pass managers without duplicating
the significant state and logic of the pass. The same compromise is
struck here.

I've also left a FIXME in a doxygen comment as the GVN pass seems to
have pretty woeful documentation within it. I'd like to submit this with
the FIXME and let those more deeply familiar backfill the information
here now that we have a nice place in an interface to put that kind of
documentaiton.

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

llvm-svn: 263208

8 years agoFix a couple of cornercases in FileSpec + tests
Pavel Labath [Fri, 11 Mar 2016 08:44:44 +0000 (08:44 +0000)]
Fix a couple of cornercases in FileSpec + tests

Summary:
This fixes a couple of corner cases in FileSpec, related to AppendPathComponent and
handling of root directory (/) file spec. I add a bunch of unit tests for the new behavior.

Summary of changes:
FileSpec("/bar").GetCString(): before "//bar", after "/bar".
FileSpec("/").CopyByAppendingPathComponent("bar").GetCString(): before "//bar", after "/bar".
FileSpec("C:", ePathSyntaxWindows).CopyByAppendingPathComponent("bar").GetCString(): before "C:/bar", after "C:\bar".

Reviewers: clayborg, zturner

Subscribers: lldb-commits

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

llvm-svn: 263207

8 years agoAMDGPU: Don't use InstVisitor for AMDGPUPromoteAlloca
Matt Arsenault [Fri, 11 Mar 2016 08:20:50 +0000 (08:20 +0000)]
AMDGPU: Don't use InstVisitor for AMDGPUPromoteAlloca

Frontend authors are strongly encouraged to keep allocas
in the entry block, so don't bother visiting every instruction
in the other blocks of the function.

llvm-svn: 263206

8 years agoskip newly segfaulting test on OS X public CI
Todd Fiala [Fri, 11 Mar 2016 08:12:36 +0000 (08:12 +0000)]
skip newly segfaulting test on OS X public CI

llvm-svn: 263205

8 years agoAMDGPU: R600 code splitting cleanup
Matt Arsenault [Fri, 11 Mar 2016 08:00:27 +0000 (08:00 +0000)]
AMDGPU: R600 code splitting cleanup

Move a few functions only used by R600 to R600 specific code,
fix header macros to stop using R600, mark classes as final.

llvm-svn: 263204