platform/upstream/llvm.git
8 years agoAdd GUID/getGlobalIdentifier() non-static API to global value
Mehdi Amini [Fri, 25 Mar 2016 05:57:41 +0000 (05:57 +0000)]
Add GUID/getGlobalIdentifier() non-static API to global value

Summary:
These are just helpers calling their static counter part to
simplify client code.

Reviewers: tejohnson

Subscribers: llvm-commits

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

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

8 years agoBitcode: Use std::stable_partition for reproducible builds
Duncan P. N. Exon Smith [Fri, 25 Mar 2016 02:20:28 +0000 (02:20 +0000)]
Bitcode: Use std::stable_partition for reproducible builds

Caught by inspection while working on partitioning metadata.  It's nice
to produce the same bitcode if you run the compiler twice.

llvm-svn: 264381

8 years agoAdd the same host logging that I added to PlatformRemoteiOS a few
Jason Molenda [Fri, 25 Mar 2016 02:17:27 +0000 (02:17 +0000)]
Add the same host logging that I added to PlatformRemoteiOS a few
months back to PlatformRemoteAppleTV and PlatformRemoteAppleWatch
to help understand what's happening when lldb can't find binaries
that it should be finding.

llvm-svn: 264380

8 years agoUse Clang's FixItHints to correct expressions with "trivial" mistakes (e.g. "." for...
Jim Ingham [Fri, 25 Mar 2016 01:57:14 +0000 (01:57 +0000)]
Use Clang's FixItHints to correct expressions with "trivial" mistakes (e.g. "." for "->".)
This feature is controlled by an expression command option, a target property and the
SBExpressionOptions setting.  FixIt's are only applied to UserExpressions, not UtilityFunctions,
those you have to get right when you make them.

This is just a first stage.  At present the fixits are applied silently.  The next step
is to tell the user about the applied fixit.

<rdar://problem/25351938>

llvm-svn: 264379

8 years agoBitcode: Stop using MODULE_CODE_METADATA_VALUES
Duncan P. N. Exon Smith [Fri, 25 Mar 2016 01:29:50 +0000 (01:29 +0000)]
Bitcode: Stop using MODULE_CODE_METADATA_VALUES

The motivation for MODULE_CODE_METADATA_VALUES was to enable an
-flto=thin scheme where:

 1. First, one function is cherry-picked from a bitcode file.
 2. Later, another function is cherry-picked.
 3. Later, ...
 4. Finally, the metadata needed by all the previous functions is
    loaded.

This was abandoned in favour of:

 1. Calculate the superset of functions needed from a Module.
 2. Link all functions at once.

Delayed metadata reading no longer serves a purpose.  It also adds
a few complication, since we can't count on metadata being properly
parsed when exiting the BitcodeReader.  After discussing with Teresa, we
agreed to remove it.

The code that depended on this was removed/updated in r264326.

llvm-svn: 264378

8 years ago[modules] Store a local offset to DeclContext lexical and visible contents. Saves...
Richard Smith [Fri, 25 Mar 2016 01:17:43 +0000 (01:17 +0000)]
[modules] Store a local offset to DeclContext lexical and visible contents. Saves a few bytes for each primary DeclContext.

llvm-svn: 264377

8 years agoAMDGPU: Cost model for basic integer operations
Matt Arsenault [Fri, 25 Mar 2016 01:16:40 +0000 (01:16 +0000)]
AMDGPU: Cost model for basic integer operations

This resolves bug 21148 by preventing promotion to
i64 induction variables.

llvm-svn: 264376

8 years agoX86: Use push-pop for materializing 8-bit immediates for minsize (take 2)
Hans Wennborg [Fri, 25 Mar 2016 01:10:56 +0000 (01:10 +0000)]
X86: Use push-pop for materializing 8-bit immediates for minsize (take 2)

This is the same as r255936, with added logic for avoiding clobbering of the
red zone (PR26023).

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

llvm-svn: 264375

8 years agoAMDGPU: Partially implement getArithmeticInstrCost for FP ops
Matt Arsenault [Fri, 25 Mar 2016 01:00:32 +0000 (01:00 +0000)]
AMDGPU: Partially implement getArithmeticInstrCost for FP ops

llvm-svn: 264374

8 years agoIR: Stop upgrading !llvm.loop attachments via MDString
Duncan P. N. Exon Smith [Fri, 25 Mar 2016 00:56:13 +0000 (00:56 +0000)]
IR: Stop upgrading !llvm.loop attachments via MDString

Remove logic to upgrade !llvm.loop by changing the MDString tag
directly.  This old logic would check (and change) arbitrary strings
that had nothing to do with loop metadata.  Instead, check !llvm.loop
attachments directly, and change which strings get attached.

Rather than updating the assembly-based upgrade, drop it entirely.  It
has been quite a while since we supported upgrading textual IR.

llvm-svn: 264373

8 years agoCGLoopInfo: Use the MD_loop metadata kind from r264371, NFC
Duncan P. N. Exon Smith [Fri, 25 Mar 2016 00:38:14 +0000 (00:38 +0000)]
CGLoopInfo: Use the MD_loop metadata kind from r264371, NFC

Besides a small compile-time speedup, there should be no real
functionality change here.

llvm-svn: 264372

8 years agoIR: Reserve an MDKind for !llvm.loop; NFC
Duncan P. N. Exon Smith [Fri, 25 Mar 2016 00:35:38 +0000 (00:35 +0000)]
IR: Reserve an MDKind for !llvm.loop; NFC

This reserves an MDKind for !llvm.loop, which allows callers to avoid a
string-based lookup.  I'm not sure why it was missing.

There should be no functionality change here, just a small compile-time
speedup.

llvm-svn: 264371

8 years agoARM: fix optimised division on WoA
Saleem Abdulrasool [Fri, 25 Mar 2016 00:34:11 +0000 (00:34 +0000)]
ARM: fix optimised division on WoA

We did not have an explicit branch to the continuation BB.  When the check was
hoisted, this could permit control follow to fall through into the division
trap.  Add the explicit branch to the continuation basic block to ensure that
code execution is correct.

llvm-svn: 264370

8 years agoTTI: Report 0 cost for free addrspacecasts
Matt Arsenault [Fri, 25 Mar 2016 00:26:29 +0000 (00:26 +0000)]
TTI: Report 0 cost for free addrspacecasts

llvm-svn: 264369

8 years agoTTI: Use 0 for cost of fabs if free
Matt Arsenault [Fri, 25 Mar 2016 00:26:22 +0000 (00:26 +0000)]
TTI: Use 0 for cost of fabs if free

Ideally this would also happen for fneg, but that
isn't a distinct operation in the IR.

llvm-svn: 264368

8 years ago3rd attempt of fixup with -std=c++11
NAKAMURA Takumi [Fri, 25 Mar 2016 00:24:35 +0000 (00:24 +0000)]
3rd attempt of fixup with -std=c++11

llvm-svn: 264367

8 years agoDebug Info: Add a testcase for the bug introduced by r259975.
Adrian Prantl [Fri, 25 Mar 2016 00:20:35 +0000 (00:20 +0000)]
Debug Info: Add a testcase for the bug introduced by r259975.
In r259975 we rauw'ed the scope of enum declarations without taking into
account that DIBuilder strips out scope references that point to the
DICompileUnit to facilitate type uniquing.

This testcase guards against making the same mistake again.
<rdar://problem/25078246>

llvm-svn: 264366

8 years agoFixup -- "-target x86_64-unknown -fno-ms-compatibility" didn't work as expected.
NAKAMURA Takumi [Fri, 25 Mar 2016 00:16:13 +0000 (00:16 +0000)]
Fixup -- "-target x86_64-unknown -fno-ms-compatibility" didn't work as expected.

llvm-svn: 264365

8 years agoAMDGPU: TTI: Make insertelement free.
Matt Arsenault [Fri, 25 Mar 2016 00:14:11 +0000 (00:14 +0000)]
AMDGPU: TTI: Make insertelement free.

We don't want to have a cost to scalarizing operations.

llvm-svn: 264364

8 years agoFix nondeterminism in computation of builtin operator overload sets.
Richard Smith [Fri, 25 Mar 2016 00:08:53 +0000 (00:08 +0000)]
Fix nondeterminism in computation of builtin operator overload sets.

llvm-svn: 264363

8 years agoclang-tools-extra/test/clang-tidy/readability-redundant-string-cstr.cpp: Appease...
NAKAMURA Takumi [Fri, 25 Mar 2016 00:05:33 +0000 (00:05 +0000)]
clang-tools-extra/test/clang-tidy/readability-redundant-string-cstr.cpp: Appease MS targets with -fno-ms-compatibility.

FIXME: Add a test with  -fms-compatibility.
llvm-svn: 264362

8 years agoIgnore global constructor warning in clang.
Greg Clayton [Thu, 24 Mar 2016 23:50:03 +0000 (23:50 +0000)]
Ignore global constructor warning in clang.

llvm-svn: 264361

8 years agoTry to fix ODR violation of ErrorInfo::ID
Reid Kleckner [Thu, 24 Mar 2016 23:49:34 +0000 (23:49 +0000)]
Try to fix ODR violation of ErrorInfo::ID

This implements my suggestion to Lang.

llvm-svn: 264360

8 years ago[modules] Store offset to LOCAL_REDECLARATIONS record relative to the current
Richard Smith [Thu, 24 Mar 2016 23:41:14 +0000 (23:41 +0000)]
[modules] Store offset to LOCAL_REDECLARATIONS record relative to the current
record rather than relative to the start of the bitcode file. Saves a couple of
bytes per LOCAL_REDECLARATIONS record (also makes diffs of llvm-bcanalyzer
output more useful when tracking down nondeterminism...).

llvm-svn: 264359

8 years agoCXX TLS: collect return blocks after SelectAllBasicBlocks.
Manman Ren [Thu, 24 Mar 2016 23:21:29 +0000 (23:21 +0000)]
CXX TLS: collect return blocks after SelectAllBasicBlocks.

It is incorrect to get the corresponding MBB for a ReturnInst before
SelectAllBasicBlocks since SelectAllBasicBlocks can change the
correspondence between a ReturnInst and the MBB it is in.

PR27062

llvm-svn: 264358

8 years agoAdd utility script to generate checks for opt or llc regression tests
Sanjay Patel [Thu, 24 Mar 2016 23:19:26 +0000 (23:19 +0000)]
Add utility script to generate checks for opt or llc regression tests

This is an enhancement of the existing update_llc_test_checks.py script.
It adds some of the functionality from the script used in D17999 to make
the IR checking more flexible.

The bad news:
This actually is 'My First Python Program'. Thus, it's likely that I have
violated all best practices of Python programming if I've made a functional
change from the original program. If you see anything that's obviously
wrong, please let me know or feel free to fix it. I didn't even read any
documentation...

The good news:
I tested this on ~10 existing opt/llc regression tests, and it does what
I hoped for. It produces exact checking for IR regression tests and doesn't
signficantly change the existing llc-with-x86-target asm checking. The opt
tests that were modified in r263667, r263668, r263674, and r263679 are
examples of the expected results, except that this version of the script
puts the check lines ahead of the IR to follow the existing llc/asm
behavior.

If there are no complaints/fallout, we should be able to remove the
original script. Extending this script to be used for non-x86 and clang
regression tests would be the expected follow-up steps.

llvm-svn: 264357

8 years agoMake it possible for language plugins to provide additional custom help for 'type...
Enrico Granata [Thu, 24 Mar 2016 23:06:42 +0000 (23:06 +0000)]
Make it possible for language plugins to provide additional custom help for 'type lookup'

llvm-svn: 264356

8 years agoReduce code duplication by extracting out a helper function; NFC
Sanjoy Das [Thu, 24 Mar 2016 22:51:49 +0000 (22:51 +0000)]
Reduce code duplication by extracting out a helper function; NFC

llvm-svn: 264355

8 years agoLower varargs correctly in deopt bundle lowering
Sanjoy Das [Thu, 24 Mar 2016 22:37:52 +0000 (22:37 +0000)]
Lower varargs correctly in deopt bundle lowering

Earlier we were ignoring varargs in LowerCallSiteWithDeoptBundle because
populateCallLoweringInfo does not set CallLoweringInfo::IsVarArg.

llvm-svn: 264354

8 years agoUpdate the INFOPLIST_FILE setting in the xcode project file
Jason Molenda [Thu, 24 Mar 2016 22:27:52 +0000 (22:27 +0000)]
Update the INFOPLIST_FILE setting in the xcode project file
so that the lldb command line binary's version #'s are updated
correctly.
<rdar://problem/25346711>

llvm-svn: 264353

8 years agoFix typo: XDS -> XDG
Sean Silva [Thu, 24 Mar 2016 22:27:27 +0000 (22:27 +0000)]
Fix typo: XDS -> XDG

Patch by Robert Ma <bob1211@gmail.com>!

llvm-svn: 264352

8 years agoMake File option flags consistent for Python API
Stephane Sezer [Thu, 24 Mar 2016 22:22:20 +0000 (22:22 +0000)]
Make File option flags consistent for Python API

Summary:
Fixes SBCommandReturnObject::SetImmediateOutputFile() and
SBCommandReturnObject::SetImmediateOutputFile() for files opened
with "a" or "a+" by resolving inconsistencies between File and
our Python parsing of file objects.

Reviewers: granata.enrico, Eugene.Zelenko, jingham, clayborg

Subscribers: lldb-commits, sas

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

Change by Francis Ricci <fjricci@fb.com>

llvm-svn: 264351

8 years agollvm-dwp: Coalesce code for reading the CU's DW_AT_GNU_dwo_id and DW_AT_name
David Blaikie [Thu, 24 Mar 2016 22:17:08 +0000 (22:17 +0000)]
llvm-dwp: Coalesce code for reading the CU's DW_AT_GNU_dwo_id and DW_AT_name

Going to be reading the DW_AT_GNU_dwo_name shortly as well, and there
was already enough duplication here that it was worth refactoring
rather than adding even more.

llvm-svn: 264350

8 years ago[sancov] renaming statistics fields.
Mike Aizatsky [Thu, 24 Mar 2016 21:49:55 +0000 (21:49 +0000)]
[sancov] renaming statistics fields.

llvm-svn: 264349

8 years agoGet rid of a global constructor and also make this code safe to use after the global...
Greg Clayton [Thu, 24 Mar 2016 21:49:22 +0000 (21:49 +0000)]
Get rid of a global constructor and also make this code safe to use after the global destructor chain has been run on the main thread.

llvm-svn: 264348

8 years agoGet rid of two global constructors by making things static variables in the only...
Greg Clayton [Thu, 24 Mar 2016 21:48:10 +0000 (21:48 +0000)]
Get rid of two global constructors by making things static variables in the only function that uses these variables.

llvm-svn: 264347

8 years agoGet rid of a global constructor that was causing a warning on MacOSX and make the...
Greg Clayton [Thu, 24 Mar 2016 21:46:47 +0000 (21:46 +0000)]
Get rid of a global constructor that was causing a warning on MacOSX and make the Timer safe to use after the main threads global destructor chain is called.

llvm-svn: 264346

8 years agoLiveInterval: Fix Distribute() failing on liveranges with unused VNInfos
Matthias Braun [Thu, 24 Mar 2016 21:41:38 +0000 (21:41 +0000)]
LiveInterval: Fix Distribute() failing on liveranges with unused VNInfos

This fixes http://llvm.org/PR26991

llvm-svn: 264345

8 years ago[LoopStrengthReduce] Don't hoist into a catchswitch
David Majnemer [Thu, 24 Mar 2016 21:40:22 +0000 (21:40 +0000)]
[LoopStrengthReduce] Don't hoist into a catchswitch

We try to hoist the insertion point as high as possible to encourage
sharing.  However, we must be careful not to hoist into a catchswitch as
it is both an EHPad and a terminator.

llvm-svn: 264344

8 years agoMake 'type lookup' print an error message instead of complete radio silence when...
Enrico Granata [Thu, 24 Mar 2016 21:32:39 +0000 (21:32 +0000)]
Make 'type lookup' print an error message instead of complete radio silence when it can't find a type matching user input

It would be fun to make it provide suggestions (e.g. 'can't find NString, did you mean NSString instead?'), but this worries me a little bit on the account of just how thorough of a type system scan it would have to do

llvm-svn: 264343

8 years agoAttach profile summary information to Module.
Easwaran Raman [Thu, 24 Mar 2016 21:32:25 +0000 (21:32 +0000)]
Attach profile summary information to Module.

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

llvm-svn: 264342

8 years ago[Support] Add ErrorInfo::ID static member definition.
Lang Hames [Thu, 24 Mar 2016 21:17:50 +0000 (21:17 +0000)]
[Support] Add ErrorInfo::ID static member definition.

Somehow this got dropped in an earlier patch.

llvm-svn: 264341

8 years agoFinish the incomplete 'd' inline asm constraint support for PPC by
Eric Christopher [Thu, 24 Mar 2016 21:04:52 +0000 (21:04 +0000)]
Finish the incomplete 'd' inline asm constraint support for PPC by
making sure we give it a register and mark it as a register constraint.

llvm-svn: 264340

8 years agoReorder check lines, comments in test and remove unnecessary IR.
Eric Christopher [Thu, 24 Mar 2016 21:04:47 +0000 (21:04 +0000)]
Reorder check lines, comments in test and remove unnecessary IR.

llvm-svn: 264339

8 years ago[libFuzzer] handle SIGTERM
Kostya Serebryany [Thu, 24 Mar 2016 21:03:58 +0000 (21:03 +0000)]
[libFuzzer] handle SIGTERM

llvm-svn: 264338

8 years agoMatch call and target calling conventions in test
Sanjoy Das [Thu, 24 Mar 2016 20:51:24 +0000 (20:51 +0000)]
Match call and target calling conventions in test

Fixes an issue in rL264329.

llvm-svn: 264337

8 years ago[sancov] adding leading zeros to coverage pct.
Mike Aizatsky [Thu, 24 Mar 2016 20:41:18 +0000 (20:41 +0000)]
[sancov] adding leading zeros to coverage pct.

Summary:
Using leading zeroes allows you to search for "000%" to find non-covered
items.

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

llvm-svn: 264336

8 years agoAdd <atomic> to ThreadPool.h, since std::atomic is used
Dimitry Andric [Thu, 24 Mar 2016 20:39:17 +0000 (20:39 +0000)]
Add <atomic> to ThreadPool.h, since std::atomic is used

Summary:
Apparently, when compiling with gcc 5.3.2 for powerpc64, the order of
headers is such that it gets an error about std::atomic<> use in
ThreadPool.h, since this header is not included explicitly.  See also:

https://llvm.org/bugs/show_bug.cgi?id=27058

Fix this by including <atomic>.  Patch by Bryan Drewery.

Reviewers: chandlerc, joker.eph

Subscribers: bdrewery, llvm-commits

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

llvm-svn: 264335

8 years agoRevert "Recommitted r263424 "Supporting all entities declared in lexical scope in...
Reid Kleckner [Thu, 24 Mar 2016 20:38:49 +0000 (20:38 +0000)]
Revert "Recommitted r263424 "Supporting all entities declared in lexical scope in LLVM debug info." After fixing PR26942 (the fix is included in this commit)."

This reverts commit r264280.

This broke building Chromium for iOS. We'll upload a reproducer to the
PR soon.

llvm-svn: 264334

8 years agoRevert "Recommitted r263425 "Supporting all entities declared in lexical scope in...
Reid Kleckner [Thu, 24 Mar 2016 20:38:43 +0000 (20:38 +0000)]
Revert "Recommitted r263425 "Supporting all entities declared in lexical scope in LLVM debug info." After fixing PR26942 (the fix is included in this commit)."

This reverts commit r264281.

This change breaks building Chromium for iOS. We'll upload a reproducer
to the PR soon.

llvm-svn: 264333

8 years agoFix for missing prompt on Windows
Ted Woodward [Thu, 24 Mar 2016 20:35:03 +0000 (20:35 +0000)]
Fix for missing prompt on Windows

Summary: On Windows (and possibly other hosts with LLDB_DISABLE_LIBEDIT defined), the (lldb) prompt won't print after async output, like from a breakpoint hit or a step. This patch forces the prompt to be printed out after async output.

Reviewers: zturner, clayborg

Subscribers: amccarth, lldb-commits

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

llvm-svn: 264332

8 years ago[Hexagon] Be sure to treat subregisters of a CSR as CSRs as well
Krzysztof Parzyszek [Thu, 24 Mar 2016 20:31:41 +0000 (20:31 +0000)]
[Hexagon] Be sure to treat subregisters of a CSR as CSRs as well

llvm-svn: 264331

8 years ago[ADT] C++11ify SmallVector::erase's arguments from iterator to const_iterator
David Blaikie [Thu, 24 Mar 2016 20:25:51 +0000 (20:25 +0000)]
[ADT] C++11ify SmallVector::erase's arguments from iterator to const_iterator

llvm-svn: 264330

8 years agoAdd lowering support for llvm.experimental.deoptimize
Sanjoy Das [Thu, 24 Mar 2016 20:23:29 +0000 (20:23 +0000)]
Add lowering support for llvm.experimental.deoptimize

Summary:
Only adds support for "naked" calls to llvm.experimental.deoptimize.
Support for round-tripping through RewriteStatepointsForGC will come
as a separate patch (should be simpler than this one).

Reviewers: reames

Subscribers: sanjoy, mcrosier, llvm-commits

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

llvm-svn: 264329

8 years ago[Hexagon] Add support for run-time stack overflow checking
Krzysztof Parzyszek [Thu, 24 Mar 2016 20:20:07 +0000 (20:20 +0000)]
[Hexagon] Add support for run-time stack overflow checking

Patch by Sundeep Kushwaha.

llvm-svn: 264328

8 years ago[asan] Intercept all Heap* related imports from ucrtbase.dll
Reid Kleckner [Thu, 24 Mar 2016 20:19:48 +0000 (20:19 +0000)]
[asan] Intercept all Heap* related imports from ucrtbase.dll

ucrtbase.dll appears to be built with some kind of cross-module
inlining, because there are calls to imported Heap* routines sprinkled
throughout the code. This inlining defeats our attempts to hotpatch
malloc, _malloc_base, and related functions. Failing to intercept an
allocation or deallocation results in a crash when the program attempts
to deallocate or reallocate memory with the wrong allocator.

This change patches the IAT of ucrtbase.dll to replace the addresses of
the imported Heap* functions with implementations provided by ASan.  We
don't globally intercept the win32 Heap* functions because they are
typically used by system DLLs that run before ASan initializes.
Eventually, we may want to intercept them, but for now I think this is
the minimal change that will keep ASan stable.

Reviewers: samsonov

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

llvm-svn: 264327

8 years ago[ThinLTO] Use bulk importing in llvm-link
Teresa Johnson [Thu, 24 Mar 2016 19:52:20 +0000 (19:52 +0000)]
[ThinLTO] Use bulk importing in llvm-link

Summary:
Use bulk importing so we can avoid the use of post-pass metadata
linking. Cloned the ModuleLazyLoaderCache from the FunctionImport pass
to facilitate this.

Reviewers: joker.eph

Subscribers: dexonsmith, llvm-commits, joker.eph

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

llvm-svn: 264326

8 years ago[clang-tidy] Add support for different char-types for the readability-redundant-strin...
Etienne Bergeron [Thu, 24 Mar 2016 19:42:36 +0000 (19:42 +0000)]
[clang-tidy] Add support for different char-types for the readability-redundant-string-cstr checker.

Summary:
The current checker is able to recognize std::string but does not recognize other string variants.
This patch is adding the support for any string defined with basic_string without considering the
the underlying char type.

The most common variant is: 'std::wstring' based on 'wchar_t'.

There are also other string variants added to the standard: u16string, u32string, etc...

Reviewers: alexfh

Subscribers: mamai, dblaikie, cfe-commits

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

llvm-svn: 264325

8 years ago[Hexagon] Generate PIC-specific versions of save/restore routines
Krzysztof Parzyszek [Thu, 24 Mar 2016 19:18:48 +0000 (19:18 +0000)]
[Hexagon] Generate PIC-specific versions of save/restore routines

In PIC mode, the registers R14, R15 and R28 are reserved for use by
the PLT handling code. This causes all functions to clobber these
registers. While this is not new for regular function calls, it does
also apply to save/restore functions, which do not follow the standard
ABI conventions with respect to the volatile/non-volatile registers.

Patch by Jyotsna Verma.

llvm-svn: 264324

8 years agoChange ADL to produce lookup results in a deterministic order. This fixes some
Richard Smith [Thu, 24 Mar 2016 19:12:22 +0000 (19:12 +0000)]
Change ADL to produce lookup results in a deterministic order. This fixes some
rare issues with nondeterministic diagnostic order, and some very common issues
with nondeterministic module builds.

llvm-svn: 264323

8 years agoSimplify AArch64 isRelRelative
Adhemerval Zanella [Thu, 24 Mar 2016 19:12:14 +0000 (19:12 +0000)]
Simplify AArch64 isRelRelative

This patch simplifies the isRelRelative for AArch64 and add the missing
ones for bootstrap and test-suite.  It also adds more testing for
shared object creation.

llvm-svn: 264322

8 years agoStop relying on mapped_iterator's function having a result_type. That facility
Richard Smith [Thu, 24 Mar 2016 19:10:58 +0000 (19:10 +0000)]
Stop relying on mapped_iterator's function having a result_type. That facility
is deprecated in modern C++ and unnecessary since decltype can be used to query
the relevant type.

llvm-svn: 264321

8 years ago[Statepoints] Fix yet another issue around gc pointer uniqueing
Sanjoy Das [Thu, 24 Mar 2016 18:57:39 +0000 (18:57 +0000)]
[Statepoints] Fix yet another issue around gc pointer uniqueing

Given that StatepointLowering now uniques derived pointers before
putting them in the per-statepoint spill map, we may end up with missing
entries for derived pointers when we visit a gc.relocate on a pointer
that was de-duplicated away.

Fix this by keeping two maps, one mapping gc pointers to their
de-duplicated values, and one mapping a de-duplicated value to the slot
it is spilled in.

llvm-svn: 264320

8 years agoMinor cosmestic changes (NFC)
Sanjoy Das [Thu, 24 Mar 2016 18:57:31 +0000 (18:57 +0000)]
Minor cosmestic changes (NFC)

 - Reflow comments
 - Rename function

llvm-svn: 264319

8 years ago[Docs] Updating CMake docs to include LLVM_OPTIMIZED_TABLEGEN
Chris Bieneman [Thu, 24 Mar 2016 18:46:43 +0000 (18:46 +0000)]
[Docs] Updating CMake docs to include LLVM_OPTIMIZED_TABLEGEN

This is based on feedback on llvm-commits from Sean Silvas.

llvm-svn: 264318

8 years ago[debuginfo] Include dwo_name in the split unit to improve dwp diagnostics
David Blaikie [Thu, 24 Mar 2016 18:37:08 +0000 (18:37 +0000)]
[debuginfo] Include dwo_name in the split unit to improve dwp diagnostics

When multiple DWP files are merged together and duplicate DWO IDs are
found it's currently difficult to give an actionable error message - the
DW_AT_name of the CU could be provided, but might be identical (if the
same source file is built into two different configurations), which
doesn't help the user identify the problem.

When no intermediate DWP files are generated, the path to the two DWO
files could be provided - but is lost once the DWOs are merged into a
DWP.

So, include the name of the DWO (dwo_name) in the split file so that
collissions involving a source CU from a DWP can be better diagnosed.

(improvements to llvm-dwp using this to come shortly)

llvm-svn: 264316

8 years agoFix a missing comma between two string literals.
Etienne Bergeron [Thu, 24 Mar 2016 18:29:24 +0000 (18:29 +0000)]
Fix a missing comma between two string literals.

Summary:
The two literals are currently appended.

I'm not sure what was broken by this. Please double check carefully.

Silly bug found by an on-going checker for clang-tidy.

Reviewers: alexfh, arsenm, rnk

Subscribers: cfe-commits

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

llvm-svn: 264315

8 years ago[docs] Clarify Error example in Programmer's Manual.
Lang Hames [Thu, 24 Mar 2016 18:05:21 +0000 (18:05 +0000)]
[docs] Clarify Error example in Programmer's Manual.

llvm-svn: 264314

8 years ago[LLE] Check for mismatching types between the store and the load earlier
Adam Nemet [Thu, 24 Mar 2016 17:59:26 +0000 (17:59 +0000)]
[LLE] Check for mismatching types between the store and the load earlier

isDependenceDistanceOfOne asserts that the store and the load access
through the same type.  This function is also used by
removeDependencesFromMultipleStores so we need to make sure we filter
out mismatching types before reaching this point.

Now we do this when the initial candidates are gathered.

This is a refinement of the fix made in r262267.

Fixes PR27048.

llvm-svn: 264313

8 years agoUse None to construct an empty ArrayRef. NFC.
Pete Cooper [Thu, 24 Mar 2016 17:39:34 +0000 (17:39 +0000)]
Use None to construct an empty ArrayRef.  NFC.

Suggested by David Blaikie in response to r264234.

llvm-svn: 264311

8 years agodon't hardcode the name of the llc checks script
Sanjay Patel [Thu, 24 Mar 2016 17:30:38 +0000 (17:30 +0000)]
don't hardcode the name of the llc checks script

We lose the 'utils' directory name in our advertising line with
this change. We could retain that, but I don't see the point.
This removes a dependency for making the script apply to more than
'llc'. Ie, we'll want to change the script name if it works with
opt/clang too.

llvm-svn: 264310

8 years ago[MC][mips] Add MipsMCInstrAnalysis class and register it as MC instruction analyzer
Simon Atanasyan [Thu, 24 Mar 2016 17:18:14 +0000 (17:18 +0000)]
[MC][mips] Add MipsMCInstrAnalysis class and register it as MC instruction analyzer

The `MipsMCInstrAnalysis` class overrides the `evaluateBranch` method
and calculates target addresses for branch and calls instructions.
That allows llvm-objdump to print functions' names in branch instructions
in the disassemble mode.

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

llvm-svn: 264309

8 years agoRemove unnecessary redirect from test
Sanjoy Das [Thu, 24 Mar 2016 17:18:00 +0000 (17:18 +0000)]
Remove unnecessary redirect from test

llvm-svn: 264308

8 years agoreorganize llc checks script to allow more flexibility, part 2; NFCI
Sanjay Patel [Thu, 24 Mar 2016 17:15:42 +0000 (17:15 +0000)]
reorganize llc checks script to allow more flexibility, part 2; NFCI

The goal is to enhance this script to be used with opt and clang:
Break 'main' into functions and change variable names to be more
generic because we want to handle more than x86 asm output.

llvm-svn: 264307

8 years agoFix gold tests for llvm-readobj format change.
Rafael Espindola [Thu, 24 Mar 2016 16:45:41 +0000 (16:45 +0000)]
Fix gold tests for llvm-readobj format change.

llvm-svn: 264306

8 years ago[X86][XOP] Fixed instruction postfixes to more closely match operands
Simon Pilgrim [Thu, 24 Mar 2016 16:31:30 +0000 (16:31 +0000)]
[X86][XOP] Fixed instruction postfixes to more closely match operands

Suggested by Sanjay in D18189 as the multiple folding options in XOP instructions can be tricky

llvm-svn: 264305

8 years ago[ELF] Follow-up to r264300. Update test case expectations to reflect recent changes...
Simon Atanasyan [Thu, 24 Mar 2016 16:30:20 +0000 (16:30 +0000)]
[ELF] Follow-up to r264300. Update test case expectations to reflect recent changes in llvm-readobj. NFC.

llvm-svn: 264304

8 years agoBitcodeWriter: Move abbreviation for GenericDINode; almost NFC
Duncan P. N. Exon Smith [Thu, 24 Mar 2016 16:30:18 +0000 (16:30 +0000)]
BitcodeWriter: Move abbreviation for GenericDINode; almost NFC

Simplify ValueEnumerator and WriteModuleMetadata by shifting the logic
for the METADATA_GENERIC_DEBUG abbreviation into WriteGenericDINode.
(This is just like r264302, but for GenericDINode.)

The only change is that the abbreviation is emitted later in the
bitcode, just before the first `GenericDINode` record.  This shouldn't
be observable though.

llvm-svn: 264303

8 years agoBitcodeWriter: Move abbreviation for DILocation; almost NFC
Duncan P. N. Exon Smith [Thu, 24 Mar 2016 16:25:51 +0000 (16:25 +0000)]
BitcodeWriter: Move abbreviation for DILocation; almost NFC

Simplify ValueEnumerator and WriteModuleMetadata by shifting the logic
for the METADATA_LOCATION abbreviation into WriteDILocation.

The only change is that the abbreviation is emitted later in the
bitcode, just before the first `DILocation` record.  This shouldn't be
observable though.

llvm-svn: 264302

8 years agoBitcodeWriter: Split out named metadata; almost NFC
Duncan P. N. Exon Smith [Thu, 24 Mar 2016 16:16:08 +0000 (16:16 +0000)]
BitcodeWriter: Split out named metadata; almost NFC

Split writeNamedMetadata out of WriteModuleMetadata to write named
metadata, and createNamedMetadataAbbrev for the abbreviation.

There should be no effective functionality change, although the layout
of the bitcode will change.  Previously, the abbreviation was emitted at
the top of the block, but now it is delayed until immediately before the
named metadata records are emitted.

llvm-svn: 264301

8 years ago[llvm-readobj] Decode st_other symbol's flags
Simon Atanasyan [Thu, 24 Mar 2016 16:10:37 +0000 (16:10 +0000)]
[llvm-readobj] Decode st_other symbol's flags

The patch supports common STV_xxx visibility flags and MIPS specific
STO_MIPS_xxx flags.

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

llvm-svn: 264300

8 years agoBitcode: Module* -> Module&, NFC
Duncan P. N. Exon Smith [Thu, 24 Mar 2016 16:01:46 +0000 (16:01 +0000)]
Bitcode: Module* -> Module&, NFC

llvm-svn: 264299

8 years agoAVX-512: Generate KTEST instead of TEST fir i1 vectors
Elena Demikhovsky [Thu, 24 Mar 2016 15:53:45 +0000 (15:53 +0000)]
AVX-512: Generate KTEST instead of TEST fir i1 vectors

KTEST instruction may be used instead of TEST in this case:

%int_sel3 = bitcast <8 x i1> %sel3 to i8
%res = icmp eq i8 %int_sel3, zeroinitializer
br i1 %res, label %L2, label %L1

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

llvm-svn: 264298

8 years agoErrorTest.cpp: Move instantiations out of anonymous namespace. gcc didn't complain.
NAKAMURA Takumi [Thu, 24 Mar 2016 15:40:46 +0000 (15:40 +0000)]
ErrorTest.cpp: Move instantiations out of anonymous namespace. gcc didn't complain.

llvm-svn: 264297

8 years agoCodeGen: extend RHS when splitting ATOMIC_CMP_SWAP_WITH_SUCCESS.
Tim Northover [Thu, 24 Mar 2016 15:38:38 +0000 (15:38 +0000)]
CodeGen: extend RHS when splitting ATOMIC_CMP_SWAP_WITH_SUCCESS.

If the operation's type has been promoted during type legalization, we
need to account for the fact that the high bits of the comparison
operand are likely unspecified.

The LHS is usually zero-extended, but MIPS sign extends it, so we have
to be slightly careful.

Patch by Simon Dardis.

llvm-svn: 264296

8 years agoAMDGPU/SI: Add Polaris support
Tom Stellard [Thu, 24 Mar 2016 15:31:05 +0000 (15:31 +0000)]
AMDGPU/SI: Add Polaris support

Patch By: Sonny Jiang

llvm-svn: 264295

8 years ago[X86][XOP] Merged 128/256 bit 4op instruction definitions. NFCI.
Simon Pilgrim [Thu, 24 Mar 2016 15:28:02 +0000 (15:28 +0000)]
[X86][XOP] Merged 128/256 bit 4op instruction definitions. NFCI.

llvm-svn: 264294

8 years agoDefine ErrorInfo::ID explicitly.
NAKAMURA Takumi [Thu, 24 Mar 2016 15:26:43 +0000 (15:26 +0000)]
Define ErrorInfo::ID explicitly.

llvm-svn: 264293

8 years agoFix another case where we were unconditionally linking linkonce GVs.
Rafael Espindola [Thu, 24 Mar 2016 15:23:01 +0000 (15:23 +0000)]
Fix another case where we were unconditionally linking linkonce GVs.

With this I think that now llvm-link,  lld and the gold plugin should
agree on which symbol is kept.

llvm-svn: 264292

8 years agoError.cpp: Fix a warning. [-Wpedantic]
NAKAMURA Takumi [Thu, 24 Mar 2016 15:19:39 +0000 (15:19 +0000)]
Error.cpp: Fix a warning. [-Wpedantic]

llvm-svn: 264291

8 years agoErrorTest.cpp: Fix an expression, possibly typo.
NAKAMURA Takumi [Thu, 24 Mar 2016 15:19:22 +0000 (15:19 +0000)]
ErrorTest.cpp: Fix an expression, possibly typo.

llvm-svn: 264290

8 years agoDsiable FormatStyle::GetStyleOfFile test case for mingw.
Eric Liu [Thu, 24 Mar 2016 14:59:39 +0000 (14:59 +0000)]
Dsiable FormatStyle::GetStyleOfFile test case for mingw.

llvm-svn: 264289

8 years agoFix resolution of linkonce symbols in comdats.
Rafael Espindola [Thu, 24 Mar 2016 14:58:44 +0000 (14:58 +0000)]
Fix resolution of linkonce symbols in comdats.

After comdat processing, the symbols still go through regular symbol
resolution.

We were not doing it for linkonce symbols since they are lazy linked.

This fixes pr27044.

llvm-svn: 264288

8 years ago[mips] Range check vsplat_simm5 and vsplat_simm10
Daniel Sanders [Thu, 24 Mar 2016 14:53:40 +0000 (14:53 +0000)]
[mips] Range check vsplat_simm5 and vsplat_simm10

Summary:

Reviewers: vkalintiris

Subscribers: llvm-commits, dsanders

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

llvm-svn: 264287

8 years ago[CMAKE] Try to find the correct globbing expression
Johannes Doerfert [Thu, 24 Mar 2016 14:31:49 +0000 (14:31 +0000)]
[CMAKE] Try to find the correct globbing expression

llvm-svn: 264286

8 years agoRemove unsafe AssertZext after promoting result of FP_TO_FP16
Pirama Arumuga Nainar [Thu, 24 Mar 2016 14:06:03 +0000 (14:06 +0000)]
Remove unsafe AssertZext after promoting result of FP_TO_FP16

Summary:
Some target lowerings of FP_TO_FP16, for instance ARM's vcvtb.f16.f32
instruction, do not guarantee that the top 16 bits are zeroed out.
Remove the unsafe AssertZext and add tests to exercise this.

Reviewers: jmolloy, sbaranga, kristof.beyls, aadg

Subscribers: llvm-commits, srhines, aemerson

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

llvm-svn: 264285

8 years ago[FIX] Handle accesses to "null" in MemIntrinsics
Johannes Doerfert [Thu, 24 Mar 2016 13:50:04 +0000 (13:50 +0000)]
[FIX] Handle accesses to "null" in MemIntrinsics

  This fixes PR27035. While we now exclude MemIntrinsics from the
  polyhedral model if they would access "null" we could exploit this
  even more, e.g., remove all parameter combinations that would lead to
  the execution of this statement from the context.

llvm-svn: 264284

8 years agoRestrict clang-format to lib/ [NFC]
Johannes Doerfert [Thu, 24 Mar 2016 13:49:39 +0000 (13:49 +0000)]
Restrict clang-format to lib/ [NFC]

llvm-svn: 264283

8 years ago[PowerPC] Disable direct moves for extractelement and bitcast in 32-bit mode
Nemanja Ivanovic [Thu, 24 Mar 2016 13:40:33 +0000 (13:40 +0000)]
[PowerPC] Disable direct moves for extractelement and bitcast in 32-bit mode

This patch corresponds to review:
http://reviews.llvm.org/D17711

It disables direct moves on these operations in 32-bit mode since the patterns
assume 64-bit registers. The final patch is slightly different from the
Phabricator review as the bitcast operations needed to be disabled in 32-bit
mode as well. This fixes PR26617.

llvm-svn: 264282

8 years agoRecommitted r263425 "Supporting all entities declared in lexical scope in LLVM debug...
Amjad Aboud [Thu, 24 Mar 2016 13:30:41 +0000 (13:30 +0000)]
Recommitted r263425 "Supporting all entities declared in lexical scope in LLVM debug info."
After fixing PR26942 (the fix is included in this commit).

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

llvm-svn: 264281