platform/upstream/llvm.git
8 years agoCorrectly type-check the default arguments of local functions
John McCall [Fri, 11 Dec 2015 01:56:36 +0000 (01:56 +0000)]
Correctly type-check the default arguments of local functions
when eagerly instantiating them.

rdar://23721638

llvm-svn: 255325

8 years agoRevert "[Modules] Fix regression when an elaborated-type-specifier mentions a hidden...
Ben Langmuir [Fri, 11 Dec 2015 01:44:43 +0000 (01:44 +0000)]
Revert "[Modules] Fix regression when an elaborated-type-specifier mentions a hidden tag"

This is causing assertion failures; reverting until I can fix.

This reverts commit r255267

llvm-svn: 255324

8 years agoAdd some more tests for initializer lists related to CWG1591
Faisal Vali [Fri, 11 Dec 2015 01:04:30 +0000 (01:04 +0000)]
Add some more tests for initializer lists related to CWG1591

llvm-svn: 255323

8 years agoFix build after r255319.
Hans Wennborg [Fri, 11 Dec 2015 00:58:32 +0000 (00:58 +0000)]
Fix build after r255319.

llvm-svn: 255322

8 years agoFix a spurious if.
Eric Christopher [Fri, 11 Dec 2015 00:51:59 +0000 (00:51 +0000)]
Fix a spurious if.

llvm-svn: 255321

8 years ago[LazyValueInfo] Stop inserting overdefined values into ValueCache to
Akira Hatanaka [Fri, 11 Dec 2015 00:49:47 +0000 (00:49 +0000)]
[LazyValueInfo] Stop inserting overdefined values into ValueCache to
reduce memory usage.

Previously, LazyValueInfoCache inserted overdefined lattice values into
both ValueCache and OverDefinedCache. This wasn't necessary and was
causing LazyValueInfo to use an excessive amount of memory in some cases.

This patch changes LazyValueInfoCache to insert overdefined values only
into OverDefinedCache. The memory usage decreases by 70 to 75% when one
of the files in llvm is compiled.

rdar://problem/11388615

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

llvm-svn: 255320

8 years ago[PPC]: Peephole optimize small accesss to aligned globals.
Kyle Butt [Fri, 11 Dec 2015 00:47:36 +0000 (00:47 +0000)]
[PPC]: Peephole optimize small accesss to aligned globals.

Access to aligned globals gives us a chance to peephole optimize nonzero
offsets. If a struct is 4 byte aligned, then accesses to bytes 0-3 won't
overflow the available displacement. For example:
        addis 3, 2, b4v@toc@ha
        addi 4, 3, b4v@toc@l
        lbz 5, b4v@toc@l(3) ; This is the result of the current peephole
        lbz 6, 1(4)         ; optimizer
        lbz 7, 2(4)
        lbz 8, 3(4)
If b4v is 4-byte aligned, we can skip using register 4 because we know
that b4v@toc@l+{1,2,3} won't overflow 32K, and instead generate:
        addis 3, 2, b4v@toc@ha
        lbz 4, b4v@toc@l(3)
        lbz 5, b4v@toc@l+1(3)
        lbz 6, b4v@toc@l+2(3)
        lbz 7, b4v@toc@l+3(3)
Saving a register and an addition.
Larger alignments allow larger structures/arrays to be optimized.

llvm-svn: 255319

8 years agoCheck in the script for building Win snapshots
Hans Wennborg [Fri, 11 Dec 2015 00:43:42 +0000 (00:43 +0000)]
Check in the script for building Win snapshots

llvm-svn: 255318

8 years ago[ProfileData] clang-format TextInstrProfReader::hasFormat. NFC.
Vedant Kumar [Fri, 11 Dec 2015 00:40:05 +0000 (00:40 +0000)]
[ProfileData] clang-format TextInstrProfReader::hasFormat. NFC.

llvm-svn: 255317

8 years ago[X86][SSE] Update the cost table for integer-integer conversions on SSE2/SSE4.1.
Cong Hou [Fri, 11 Dec 2015 00:31:39 +0000 (00:31 +0000)]
[X86][SSE] Update the cost table for integer-integer conversions on SSE2/SSE4.1.

Previously in the conversion cost table there are no entries for integer-integer
conversions on SSE2. This will result in imprecise costs for certain vectorized
operations. This patch adds those entries for SSE2 and SSE4.1. The cost numbers
are counted from the result of running llc on the new test case in this patch.

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

llvm-svn: 255315

8 years agoClean ExprConstant/CGExprConstant up a bit. NFC.
George Burgess IV [Fri, 11 Dec 2015 00:23:35 +0000 (00:23 +0000)]
Clean ExprConstant/CGExprConstant up a bit. NFC.

llvm-svn: 255314

8 years agoFormat fix (NFC)
Xinliang David Li [Thu, 10 Dec 2015 23:48:05 +0000 (23:48 +0000)]
Format fix (NFC)

llvm-svn: 255313

8 years ago[VFS] Fix status() of opened redirected file
Ben Langmuir [Thu, 10 Dec 2015 23:41:39 +0000 (23:41 +0000)]
[VFS] Fix status() of opened redirected file

Make RedirectedFileSystem::openFilForRead(path)->status() the same as
RedirectedFileSystem::status(path). Previously we would just get the
status of the underlying real file, which would not have the IsVFSMapped
bit set.

This fixes rebuilding a module that has an include that is relative to
the includer where we will lookup the real path of that file before we
lookup the VFS location.

rdar://problem/23640339

llvm-svn: 255312

8 years agoIn Objective-C, ignore attempts to redefine the ARC/GC qualifier macros.
John McCall [Thu, 10 Dec 2015 23:31:01 +0000 (23:31 +0000)]
In Objective-C, ignore attempts to redefine the ARC/GC qualifier macros.

This works around existing system headers which unconditionally
redefine these macros.

This is reasonably safe to do because we used to warn about it anyway
(outside of system headers).  Continue to warn if the redefinition
would have changed the expansion.  Still permit redefinition if the
macro is explicitly #undef'ed first.

rdar://23788307

llvm-svn: 255311

8 years agotest result details now print module.class.test_name in verbose mode.
Todd Fiala [Thu, 10 Dec 2015 23:14:24 +0000 (23:14 +0000)]
test result details now print module.class.test_name in verbose mode.

And, turns off verbose mode by default.  This must have been switched
on as the default when somebody was testing.

llvm-svn: 255310

8 years agoObjective-C properties: merge attributes when redeclaring 'readonly' as 'readwrite...
Douglas Gregor [Thu, 10 Dec 2015 23:02:09 +0000 (23:02 +0000)]
Objective-C properties: merge attributes when redeclaring 'readonly' as 'readwrite' in an extension.

r251874 stopped back-patching the AST when an Objective-C 'readonly'
property is redeclared in a class extension as 'readwrite'. However,
it did not properly handle merging of Objective-C property attributes
(e.g., getter name, ownership, atomicity) to the redeclaration,
leading to bad metadata. Merge (and check!) those property attributes
so we get the right metadata and reasonable ASTs. Fixes
rdar://problem/23823989.

llvm-svn: 255309

8 years agoAdd NetBSD support in the buildDriver and buildLibrary routines
Kamil Rytarowski [Thu, 10 Dec 2015 22:56:56 +0000 (22:56 +0000)]
Add NetBSD support in the buildDriver and buildLibrary routines

Summary: NetBSD is like FreeBSD and Linux in these routines.

Reviewers: clay.chang, tfiala, emaste, joerg

Subscribers: lldb-commits, emaste

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

llvm-svn: 255308

8 years agoFix alignment computation for copy relocs.
Rafael Espindola [Thu, 10 Dec 2015 22:53:24 +0000 (22:53 +0000)]
Fix alignment computation for copy relocs.

Fixes PR25798.

Thanks to Ed Maste for the bug report and suggested fix.

llvm-svn: 255307

8 years agos/need/needs
Eric Christopher [Thu, 10 Dec 2015 22:29:26 +0000 (22:29 +0000)]
s/need/needs

llvm-svn: 255306

8 years agoFix (bitcast (fabs x)), (bitcast (fneg x)) and (bitcast (fcopysign cst,
Eric Christopher [Thu, 10 Dec 2015 22:09:06 +0000 (22:09 +0000)]
Fix (bitcast (fabs x)), (bitcast (fneg x)) and (bitcast (fcopysign cst,
x)) combines for ppc_fp128, since signbit computation is more
complicated.

Discussion thread:
http://lists.llvm.org/pipermail/llvm-dev/2015-November/092863.html

Patch by Tim Shen!

llvm-svn: 255305

8 years agoAttempt to fix the ReST compilation to html of the C API docs.
Eric Christopher [Thu, 10 Dec 2015 22:04:11 +0000 (22:04 +0000)]
Attempt to fix the ReST compilation to html of the C API docs.

llvm-svn: 255304

8 years agoMore non-ascii quote characters.
Eric Christopher [Thu, 10 Dec 2015 21:47:38 +0000 (21:47 +0000)]
More non-ascii quote characters.

llvm-svn: 255303

8 years agoClarify some of the wording on adding a new subcomponent to the
Eric Christopher [Thu, 10 Dec 2015 21:46:24 +0000 (21:46 +0000)]
Clarify some of the wording on adding a new subcomponent to the
C API.

llvm-svn: 255302

8 years agoFix non-ascii quotes.
Eric Christopher [Thu, 10 Dec 2015 21:38:56 +0000 (21:38 +0000)]
Fix non-ascii quotes.

llvm-svn: 255301

8 years agoAdd C API guidelines to the developer policy to match discussions
Eric Christopher [Thu, 10 Dec 2015 21:33:53 +0000 (21:33 +0000)]
Add C API guidelines to the developer policy to match discussions
on the llvm mailing lists.

llvm-svn: 255300

8 years agoPPC: Teach FMA mutate to respect register classes.
Kyle Butt [Thu, 10 Dec 2015 21:28:40 +0000 (21:28 +0000)]
PPC: Teach FMA mutate to respect register classes.

This was causing bad code gen and assembly that won't assemble, as
mixed altivec and vsx code would end up with a vsx high register
assigned to an altivec instruction, which won't work. Constraining the
classes allows the optimization to proceed.

llvm-svn: 255299

8 years ago[CMake] Add LLVM_BUILD_INSTRUMENTED option to enable building with -fprofile-instr...
Chris Bieneman [Thu, 10 Dec 2015 21:19:07 +0000 (21:19 +0000)]
[CMake] Add LLVM_BUILD_INSTRUMENTED option to enable building with -fprofile-instr-generate

This is the first step in supporting PGO data generation via CMake. I've marked the option as advanced and experimental until it is fleshed out further.

llvm-svn: 255298

8 years agowww: Mention -DGCC_INSTALL_PREFIX instead of --with-gcc-toolchain
Justin Bogner [Thu, 10 Dec 2015 20:52:59 +0000 (20:52 +0000)]
www: Mention -DGCC_INSTALL_PREFIX instead of --with-gcc-toolchain

Since the instructions use cmake, we should probably refer to the
cmake flags and not the configure ones.

llvm-svn: 255297

8 years ago[LibFuzzer] Introducing FUZZER_FLAG_UNSIGNED and using it for seeding.
Mike Aizatsky [Thu, 10 Dec 2015 20:41:53 +0000 (20:41 +0000)]
[LibFuzzer] Introducing FUZZER_FLAG_UNSIGNED and using it for seeding.

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

done

llvm-svn: 255296

8 years agoEarlyCSE: add tests
JF Bastien [Thu, 10 Dec 2015 20:24:34 +0000 (20:24 +0000)]
EarlyCSE: add tests

Summary: As a follow-up to rL255054 I wasn't able to convince myself that the code did what I thought, so I wrote more tests.

Reviewers: reames

Subscribers: llvm-commits

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

llvm-svn: 255295

8 years ago[PGO] Split value profiling runtime into its own file
Xinliang David Li [Thu, 10 Dec 2015 20:24:09 +0000 (20:24 +0000)]
[PGO] Split value profiling runtime into its own file

Value profile runtime depends on libc which breaks
buffer API implemenation with current file organization.

Test case is also updated to check more symbols.

llvm-svn: 255294

8 years agoSync up with master
Xinliang David Li [Thu, 10 Dec 2015 20:14:13 +0000 (20:14 +0000)]
Sync up with master

llvm-svn: 255293

8 years agoAdd a forward declaration (NFC)
Xinliang David Li [Thu, 10 Dec 2015 20:13:41 +0000 (20:13 +0000)]
Add a forward declaration (NFC)

llvm-svn: 255292

8 years agoDelete a duplicate branch in IfConversion.cpp. NFC.
Cong Hou [Thu, 10 Dec 2015 19:57:22 +0000 (19:57 +0000)]
Delete a duplicate branch in IfConversion.cpp. NFC.

llvm-svn: 255291

8 years ago[PGO] Move impl specific decl to InstrProfilingInternal.h (NFC)
Xinliang David Li [Thu, 10 Dec 2015 19:50:04 +0000 (19:50 +0000)]
[PGO] Move impl specific decl to InstrProfilingInternal.h (NFC)

llvm-svn: 255290

8 years ago[DAGCombiner] Fix PR25763 - vector comparison constant folding + sign-extension
Simon Pilgrim [Thu, 10 Dec 2015 19:47:06 +0000 (19:47 +0000)]
[DAGCombiner] Fix PR25763 - vector comparison constant folding + sign-extension

PR25763 demonstrated an issue with D14683 - vector comparison constant folding only works for i1 results, so we need to split off the sign-extension of the result to the required type. Luckily this can be done with the existing type legalization code.

llvm-svn: 255289

8 years ago[Sema] Replace pointer-to-map with a map. NFC.
George Burgess IV [Thu, 10 Dec 2015 19:25:21 +0000 (19:25 +0000)]
[Sema] Replace pointer-to-map with a map. NFC.

llvm-svn: 255288

8 years ago[TSan] Try harder to avoid compiler-generated memcpy calls.
Alexey Samsonov [Thu, 10 Dec 2015 19:24:27 +0000 (19:24 +0000)]
[TSan] Try harder to avoid compiler-generated memcpy calls.

check_memcpy test added in r254959 fails on some configurations due to
memcpy() calls inserted by Clang. Try harder to avoid them by using
internal_memcpy() where applicable.

llvm-svn: 255287

8 years ago[DSE] Disable non-local DSE to see if the bots go green.
Chad Rosier [Thu, 10 Dec 2015 19:23:02 +0000 (19:23 +0000)]
[DSE] Disable non-local DSE to see if the bots go green.

I see a few bots timing out, so I'm speculatively disabling r255247.

llvm-svn: 255286

8 years ago[PGO] Move target-dependent macro to InstrProfilingPort.h (NFC)
Xinliang David Li [Thu, 10 Dec 2015 19:20:25 +0000 (19:20 +0000)]
[PGO] Move target-dependent macro to InstrProfilingPort.h (NFC)

llvm-svn: 255285

8 years agoSimplify. NFC.
Rui Ueyama [Thu, 10 Dec 2015 19:19:04 +0000 (19:19 +0000)]
Simplify. NFC.

llvm-svn: 255284

8 years agoMake commands printed by llvm-lit include the build path in lit.cfg.
Pete Cooper [Thu, 10 Dec 2015 19:17:35 +0000 (19:17 +0000)]
Make commands printed by llvm-lit include the build path in lit.cfg.

When llvm-lit prints a failure, you'll see something like 'lld *command*' However, you can't then take this, paste it in to a terminal and run it, because it's not got the absolute path of lld.

llvm and clang's lit.cfg files contain lists of commands to look for which are substituted by their full paths. So now you'd see something like '*build dir*/bin/lld *command*'.

This patch adds the same capability to lld's lit.cfg

Reviewed by Rafael EspĂ­ndola

llvm-svn: 255283

8 years agoSimplify an expression. NFC.
Rui Ueyama [Thu, 10 Dec 2015 19:13:08 +0000 (19:13 +0000)]
Simplify an expression. NFC.

llvm-svn: 255282

8 years agoDo not generate DW_TAG_imported_module for anonymous namespaces (even nested) for...
Ekaterina Romanova [Thu, 10 Dec 2015 18:52:50 +0000 (18:52 +0000)]
Do not generate DW_TAG_imported_module for anonymous namespaces (even nested) for all the platforms except PS4.
For PS4, generate explicit import for anonymous namespaces and mark it by DW_AT_artificial attribute.

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

llvm-svn: 255281

8 years agoRemove the -y option from dotest.py.
Zachary Turner [Thu, 10 Dec 2015 18:52:09 +0000 (18:52 +0000)]
Remove the -y option from dotest.py.

llvm-svn: 255280

8 years agoRemove the -x option from dotest.py.
Zachary Turner [Thu, 10 Dec 2015 18:51:40 +0000 (18:51 +0000)]
Remove the -x option from dotest.py.

llvm-svn: 255279

8 years agoRemove deprecated command line options from dotest.py
Zachary Turner [Thu, 10 Dec 2015 18:51:21 +0000 (18:51 +0000)]
Remove deprecated command line options from dotest.py

llvm-svn: 255278

8 years agoRemove the --output-on-success command line argument from dotest.
Zachary Turner [Thu, 10 Dec 2015 18:51:02 +0000 (18:51 +0000)]
Remove the --output-on-success command line argument from dotest.

llvm-svn: 255277

8 years agoRemove the -T option from dotest.py.
Zachary Turner [Thu, 10 Dec 2015 18:50:49 +0000 (18:50 +0000)]
Remove the -T option from dotest.py.

llvm-svn: 255276

8 years agoRemove -w option from dotest.py.
Zachary Turner [Thu, 10 Dec 2015 18:50:32 +0000 (18:50 +0000)]
Remove -w option from dotest.py.

llvm-svn: 255275

8 years agoVerify that macho-o delta64 relocs have the same offset.
Pete Cooper [Thu, 10 Dec 2015 18:48:52 +0000 (18:48 +0000)]
Verify that macho-o delta64 relocs have the same offset.

The delta64 relocation is represented as the pair ARM64_RELOC_SUBTRACTOR and ARM64_RELOC_UNSIGNED.

Those should always have the same offset, so this adds a check and tests to ensure this is the case.

Also updated the error printing in this case to shows both relocs when erroring on pair.

llvm-svn: 255274

8 years agolibclang: expose dllexport, dllimport attributes
Saleem Abdulrasool [Thu, 10 Dec 2015 18:45:18 +0000 (18:45 +0000)]
libclang: expose dllexport, dllimport attributes

These attributes were previously unexposed.  Expose them through the libclang
interfaces.  Add tests that cover both the MSVC spelling and the GNU spelling.

llvm-svn: 255273

8 years agoFix another case where the linkage was not set.
Rafael Espindola [Thu, 10 Dec 2015 18:44:26 +0000 (18:44 +0000)]
Fix another case where the linkage was not set.

llvm-svn: 255272

8 years ago[PGO] Use %t as the temporary profdata filename in the test cases.
Rong Xu [Thu, 10 Dec 2015 18:24:44 +0000 (18:24 +0000)]
[PGO] Use %t as the temporary profdata filename in the test cases.

Using %t rather %T/<specific_name> as the temporary profdata filename.

llvm-svn: 255271

8 years ago[PGO] Header file cleanup (NFC)
Xinliang David Li [Thu, 10 Dec 2015 18:17:01 +0000 (18:17 +0000)]
[PGO] Header file cleanup (NFC)

InstrProfiling.h file declares profile runtime public APIs.
It has become a dumping place for many different things, which
needs cleanups. In this change, core type declarations and
portability macros are moved to a new file InstrProfilingPort.h.

llvm-svn: 255270

8 years agoVerifier: Avoid quadratic checking of aggregates for bad bitcasts
Duncan P. N. Exon Smith [Thu, 10 Dec 2015 17:56:06 +0000 (17:56 +0000)]
Verifier: Avoid quadratic checking of aggregates for bad bitcasts

Avoid O(N^2) behaviour when checking for bad bitcasts in `ConstantExpr`s
buried inside of aggregate initializers to `GlobalVariable`s.  I've:
- centralized the "visited" set for recursing through `ConstantExpr`s so
  that expressions are only visited once per Verifier run,
- removed the duplicate logic for the stack visit, and
- avoided recursing into other `GlobalValue`s.

This recovers roughly a 100x time difference in clang compiles of a
particular input file (filled with large cross-referencing tables) that
depends on whether `-disable-llvm-verifier` is on.  This slowdown was
caused by r187506, which introduced these checks.

Now, avoiding `-disable-llvm-verifier` only causes a 2x slowdown for
this case.

(Interestingly, dumping the textual IR for this file starts at least
50GB of global variable initializers (I don't know the total, since I
killed the dump)...)

llvm-svn: 255269

8 years agoAdd Hexagon ABI to System Initialization
Ted Woodward [Thu, 10 Dec 2015 17:53:07 +0000 (17:53 +0000)]
Add Hexagon ABI to System Initialization

Summary: When the Hexagon ABI was added, it was inadvertently left out of initialization/termination. This patch adds it.

Reviewers: clayborg

Subscribers: lldb-commits

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

llvm-svn: 255268

8 years ago[Modules] Fix regression when an elaborated-type-specifier mentions a hidden tag
Ben Langmuir [Thu, 10 Dec 2015 17:28:51 +0000 (17:28 +0000)]
[Modules] Fix regression when an elaborated-type-specifier mentions a hidden tag

This makes non-C++ languages find the same decl as C++ does to
workaround a regression introduced in r252960.

rdar://problem/23784203

llvm-svn: 255267

8 years ago[PGO] use COMPILER_RT_HAS_ATOMTICS macro
Xinliang David Li [Thu, 10 Dec 2015 17:27:53 +0000 (17:27 +0000)]
[PGO] use COMPILER_RT_HAS_ATOMTICS macro

llvm-svn: 255266

8 years ago[DeadStoreElimination] Use range-based loops. NFC.
Chad Rosier [Thu, 10 Dec 2015 17:27:18 +0000 (17:27 +0000)]
[DeadStoreElimination] Use range-based loops. NFC.

llvm-svn: 255265

8 years ago[ProfileData] Add unit test infrastructure for sample profile reader/writer
Nathan Slingerland [Thu, 10 Dec 2015 17:21:42 +0000 (17:21 +0000)]
[ProfileData] Add unit test infrastructure for sample profile reader/writer

Summary:
Adds support for in-memory round-trip of sample profile data along with basic
round trip unit tests. This will also make it easier to include unit tests for
future changes to sample profiling.

Reviewers: davidxl, dnovillo, silvas

Subscribers: llvm-commits

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

llvm-svn: 255264

8 years agoFix fptosi, fptoui from f16 vectors to i8, i16 vectors
Pirama Arumuga Nainar [Thu, 10 Dec 2015 17:16:49 +0000 (17:16 +0000)]
Fix fptosi, fptoui from f16 vectors to i8, i16 vectors

Summary:
Convert f16 vectors to corresponding f32 vectors before doing the
conversion to int.

Add tests for v4f16, v8f16.

Reviewers: ab, jmolloy

Subscribers: llvm-commits, srhines

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

llvm-svn: 255263

8 years ago[power] Fix test case target checks
Bill Seurer [Thu, 10 Dec 2015 17:09:53 +0000 (17:09 +0000)]
[power] Fix test case target checks

Several test cases that used to fail on both power LE and BE
now run correctly on LE.

llvm-svn: 255262

8 years ago[InstCombine] fold bitcasts around an extractelement (3rd try)
Sanjay Patel [Thu, 10 Dec 2015 17:09:28 +0000 (17:09 +0000)]
[InstCombine] fold bitcasts around an extractelement (3rd try)

This is a redo of r255137 (reverted at r255227) which was a redo of
r255124 (reverted at r255126) with a fixed check for a scalar source
type and an added test for the failure that caused the revert.

Original commit message:

Example:
  bitcast (extractelement (bitcast <2 x float> %X to <2 x i32>), 1) to float
    --->
  extractelement <2 x float> %X, i32 1

This is part of fixing PR25543:
https://llvm.org/bugs/show_bug.cgi?id=25543

The next step will be to generalize this fold:
trunc ( lshr ( bitcast X) ) -> extractelement (X)

Ie, I'm hoping to replace the existing transform of:
bitcast ( trunc ( lshr ( bitcast X)))
added by:
http://reviews.llvm.org/rL112232

with 2 less specific transforms to catch the case in the bug report.

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

llvm-svn: 255261

8 years agoAdd modules downloaded by ModuleCache to the global ModuleList
Tamas Berghammer [Thu, 10 Dec 2015 17:08:23 +0000 (17:08 +0000)]
Add modules downloaded by ModuleCache to the global ModuleList

Adding the modules to the global module list eleminate issues in the
case when a module is unloaded from the target but some object (e.g.
breakpoint) still referencing them with weak pointers. It also speeds
up the case when we load, unload, load the same shared library because
the global module cache will keep the parsed debug info around between
the 2 load (this scenario happens for some code on android).

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

llvm-svn: 255260

8 years ago[ThinLTO] Debug message cleanup (NFC)
Teresa Johnson [Thu, 10 Dec 2015 16:39:07 +0000 (16:39 +0000)]
[ThinLTO] Debug message cleanup (NFC)

Added some missing spaces between the module identifier and the start of
the debug message. Also added a ":" after the module identifier to make
this look a little nicer.

llvm-svn: 255259

8 years agoAvoid undefined behavior when vector is empty.
Rafael Espindola [Thu, 10 Dec 2015 16:35:06 +0000 (16:35 +0000)]
Avoid undefined behavior when vector is empty.

Found by ubsan.

llvm-svn: 255258

8 years agoremove duplicated comments and don't repeat function names in comments; NFC
Sanjay Patel [Thu, 10 Dec 2015 16:34:21 +0000 (16:34 +0000)]
remove duplicated comments and don't repeat function names in comments; NFC

llvm-svn: 255257

8 years ago[ThinLTO] Release files in gold plugin during combined index (take 2)
Teresa Johnson [Thu, 10 Dec 2015 16:11:23 +0000 (16:11 +0000)]
[ThinLTO] Release files in gold plugin during combined index (take 2)

Ensure we release the files even when they don't hold a function index
summary section, by restructuring the control flow a little bit.

llvm-svn: 255256

8 years ago[WebAssembly] Tighten up several CHECK tests.
Dan Gohman [Thu, 10 Dec 2015 14:52:34 +0000 (14:52 +0000)]
[WebAssembly] Tighten up several CHECK tests.

llvm-svn: 255255

8 years agoSlit lib/Linker in two.
Rafael Espindola [Thu, 10 Dec 2015 14:19:35 +0000 (14:19 +0000)]
Slit lib/Linker in two.

A linker normally has two stages: symbol resolution and "moving stuff".

In lib/Linker there is the complication of lazy linking some globals,
but it was still far more mixed than it needed to.

This splits the linker into a lower level IRMover and the linker proper.
The IRMover just takes a list of globals to move and a callback that
lets the user control what is lazy linked.

The main motivation is that now tools/gold (and soon lld) can use their
own symbol resolution to instruct IRMover what to do.

llvm-svn: 255254

8 years ago[WebAssembly] Make WebAssemblyStoreResults only return true when it has a change.
Dan Gohman [Thu, 10 Dec 2015 14:17:36 +0000 (14:17 +0000)]
[WebAssembly] Make WebAssemblyStoreResults only return true when it has a change.

llvm-svn: 255253

8 years ago[WebAssembly] Fix WebAssemblyPeephole to set Changed to true when making changes.
Dan Gohman [Thu, 10 Dec 2015 14:16:34 +0000 (14:16 +0000)]
[WebAssembly] Fix WebAssemblyPeephole to set Changed to true when making changes.

llvm-svn: 255252

8 years ago[WebAssembly] Declare that WebAssemblyPeephole does not modify the CFG.
Dan Gohman [Thu, 10 Dec 2015 14:12:04 +0000 (14:12 +0000)]
[WebAssembly] Declare that WebAssemblyPeephole does not modify the CFG.

llvm-svn: 255251

8 years ago[WebAssembly] Remove an unneeded getAnalysisUsage override.
Dan Gohman [Thu, 10 Dec 2015 14:10:04 +0000 (14:10 +0000)]
[WebAssembly] Remove an unneeded getAnalysisUsage override.

llvm-svn: 255250

8 years agoAdd --version-script= alias for --version-script
Ed Maste [Thu, 10 Dec 2015 14:08:45 +0000 (14:08 +0000)]
Add --version-script= alias for --version-script

llvm-svn: 255249

8 years agoAdd a license clarification for use of links and titles of CERT secure coding guidelines.
Aaron Ballman [Thu, 10 Dec 2015 13:53:36 +0000 (13:53 +0000)]
Add a license clarification for use of links and titles of CERT secure coding guidelines.

llvm-svn: 255248

8 years ago[DeadStoreElimination] Add support for non-local DSE.
Chad Rosier [Thu, 10 Dec 2015 13:51:43 +0000 (13:51 +0000)]
[DeadStoreElimination] Add support for non-local DSE.

We extend the search for redundant stores to predecessor blocks that
unconditionally lead to the block BB with the current store instruction.  That
also includes single-block loops that unconditionally lead to BB, and
if-then-else blocks where then- and else-blocks unconditionally lead to BB.

http://reviews.llvm.org/D13363
Patch by Ivan Baev <ibaev@codeaurora.org>!

llvm-svn: 255247

8 years agoBitcasts between FP and INT values using direct moves
Nemanja Ivanovic [Thu, 10 Dec 2015 13:35:28 +0000 (13:35 +0000)]
Bitcasts between FP and INT values using direct moves

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

LLVM IR frequently contains bitcast operations between floating point and
integer values of the same width. Doing this through memory operations is
quite expensive on PPC. This patch allows the use of direct register moves
between FPRs and GPRs for lowering bitcasts.

llvm-svn: 255246

8 years agoMacro debug info support in LLVM IR
Amjad Aboud [Thu, 10 Dec 2015 12:56:35 +0000 (12:56 +0000)]
Macro debug info support in LLVM IR
Introduced DIMacro and DIMacroFile debug info metadata in the LLVM IR to support macros.

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

llvm-svn: 255245

8 years ago[NFC] Improve a comment from my previous commit (r255221)
Faisal Vali [Thu, 10 Dec 2015 12:29:11 +0000 (12:29 +0000)]
[NFC] Improve a comment from my previous commit (r255221)

llvm-svn: 255244

8 years ago[clang-tidy] Sort includes case-sensitively.
Alexander Kornienko [Thu, 10 Dec 2015 12:24:19 +0000 (12:24 +0000)]
[clang-tidy] Sort includes case-sensitively.

The motivation is:
  1. consistency with clang-format, vim :sort etc.
  2. we don't want the tools to depend on the current locale to do the include
     sorting

llvm-svn: 255243

8 years ago[asan] Use atomic_uintptr_t instead of atomic_uint64_t in SuppressErrorReport.
Yury Gribov [Thu, 10 Dec 2015 11:07:19 +0000 (11:07 +0000)]
[asan] Use atomic_uintptr_t instead of atomic_uint64_t in SuppressErrorReport.

Some targets (e.g. Mips) don't have 64-bit atomics, so using atomic_uint64_t
leads to build failures. Use atomic_uintptr_t to avoid such errors.

Patch by Max Ostapenko.

llvm-svn: 255242

8 years ago[LLE] Use the PredicatedScalarEvolution interface to query SCEVs for dependences
Silviu Baranga [Thu, 10 Dec 2015 11:07:18 +0000 (11:07 +0000)]
[LLE] Use the PredicatedScalarEvolution interface to query SCEVs for dependences

Summary:
LAA uses the PredicatedScalarEvolution interface, so it can produce
forward/backward dependences having SCEVs that are AddRecExprs only after being
transformed by PredicatedScalarEvolution.

Use PredicatedScalarEvolution to get the expected expressions.

Reviewers: anemet

Subscribers: llvm-commits, sanjoy

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

llvm-svn: 255241

8 years agoSwitch to gold linker on android x86, x86_64, arm
Tamas Berghammer [Thu, 10 Dec 2015 11:02:51 +0000 (11:02 +0000)]
Switch to gold linker on android x86, x86_64, arm

These architectures already using the gold linker for the android
framework and switching to gold gives us the opportunity to enable ICF.

Safe ICF (identical code folding) reduces the size of an optimized and
striped binary by ~5%.

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

llvm-svn: 255240

8 years ago[RenderScript] Refactor condition deciding when to JIT RS runtime
Ewan Crawford [Thu, 10 Dec 2015 10:20:39 +0000 (10:20 +0000)]
[RenderScript] Refactor condition deciding when to JIT RS runtime

Patch creates a member function that decides when to JIT all the details about an allocation.
By checking for zero pointers we can avoid the situation where we store uninitialised data from previously inspecting the allocation during creation.

llvm-svn: 255238

8 years agoDifferential Revision: http://reviews.llvm.org/D15333
Aidan Dodds [Thu, 10 Dec 2015 10:11:49 +0000 (10:11 +0000)]
Differential Revision: reviews.llvm.org/D15333

llvm-svn: 255237

8 years ago[analyzer] Fix symbolic element index lifetime.
Artem Dergachev [Thu, 10 Dec 2015 09:28:06 +0000 (09:28 +0000)]
[analyzer] Fix symbolic element index lifetime.

SymbolReaper was destroying the symbol too early when it was referenced only
from an index SVal of a live ElementRegion.

In order to test certain aspects of this patch, extend the debug.ExprInspection
checker to allow testing SymbolReaper in a direct manner.

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

llvm-svn: 255236

8 years ago[ELF] - Implemented --print-gc-sections command line argument.
George Rimar [Thu, 10 Dec 2015 09:12:18 +0000 (09:12 +0000)]
[ELF] - Implemented --print-gc-sections command line argument.

List all sections removed by garbage collection. This option is only effective if garbage collection has been enabled via the `--gc-sections' option.

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

llvm-svn: 255235

8 years ago[PostRA scheduling] Allow a target to do scheduling when it wants post RA.
Jonas Paulsson [Thu, 10 Dec 2015 09:10:07 +0000 (09:10 +0000)]
[PostRA scheduling] Allow a target to do scheduling when it wants post RA.

SystemZ needs to do its scheduling after branch relaxation, which can
only happen after block placement, and therefore the standard
PostRAScheduler point in the pass sequence is too early.

TargetMachine::targetSchedulesPostRAScheduling() is a new method that
signals on returning true that target will insert the final scheduling
pass on its own.

Reviewed by Hal Finkel

llvm-svn: 255234

8 years ago[ELF] - Resolve R_386_PLT32 statically in some cases.
George Rimar [Thu, 10 Dec 2015 09:03:39 +0000 (09:03 +0000)]
[ELF] - Resolve R_386_PLT32 statically in some cases.

If R_386_PLT32 relocation is applied against symbol that can not be preempted then it can be resolved statically.
Patch implements it for x86 target.

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

llvm-svn: 255233

8 years ago[Sema] Use UnaryOperatorKind and BinaryOperatorKind in parameter lists instead of...
Craig Topper [Thu, 10 Dec 2015 08:51:49 +0000 (08:51 +0000)]
[Sema] Use UnaryOperatorKind and BinaryOperatorKind in parameter lists instead of just unsigned. Removes a few explicit casts. NFC

llvm-svn: 255232

8 years agoAdd parentheses to suppress a -Wparentheses warning.
Craig Topper [Thu, 10 Dec 2015 08:49:55 +0000 (08:49 +0000)]
Add parentheses to suppress a -Wparentheses warning.

llvm-svn: 255231

8 years ago[asan] Move halt_on_error_suppress_equal_pcs.cc to Posix directory.
Yury Gribov [Thu, 10 Dec 2015 08:34:28 +0000 (08:34 +0000)]
[asan] Move halt_on_error_suppress_equal_pcs.cc to Posix directory.

Patch by Max Ostapenko.

llvm-svn: 255230

8 years ago[OPENMP] Fixed processing of predetermined data-sharing attributes
Alexey Bataev [Thu, 10 Dec 2015 08:20:58 +0000 (08:20 +0000)]
[OPENMP] Fixed processing of predetermined data-sharing attributes
Predetermined data-shared attributes for local variables are now considered as implicit. Also, patch prohibits changin of DSA for static memebers of classes.

llvm-svn: 255229

8 years ago[asan] Suppress duplicated errors in ASan recovery mode.
Yury Gribov [Thu, 10 Dec 2015 08:08:53 +0000 (08:08 +0000)]
[asan] Suppress duplicated errors in ASan recovery mode.

Patch by Max Ostapenko.

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

llvm-svn: 255228

8 years agoRevert r255137.
Akira Hatanaka [Thu, 10 Dec 2015 08:00:52 +0000 (08:00 +0000)]
Revert r255137.

This commit broke apple's internal bot.

llvm-svn: 255227

8 years agoAdd arg_begin() and arg_end() to CallInst and InvokeInst; NFCI
Sanjoy Das [Thu, 10 Dec 2015 06:39:02 +0000 (06:39 +0000)]
Add arg_begin() and arg_end() to CallInst and InvokeInst; NFCI

 - This simplifies the CallSite class, arg_begin / arg_end are now
   simple wrapper getters.

 - In several places, we were creating CallSite instances solely to call
   arg_begin and arg_end.  With this change, that's no longer required.

llvm-svn: 255226

8 years agolibclang: correct inverted logic
Saleem Abdulrasool [Thu, 10 Dec 2015 06:30:23 +0000 (06:30 +0000)]
libclang: correct inverted logic

The complete dtor is only emitted when there is a virtual destructor.  The test
itself was incorrect, so the issue in the code was not noticed.

llvm-svn: 255225

8 years ago[X86] Fix a couple cases were bitwise and logical operations were being mixed. NFC
Craig Topper [Thu, 10 Dec 2015 06:09:41 +0000 (06:09 +0000)]
[X86] Fix a couple cases were bitwise and logical operations were being mixed. NFC

llvm-svn: 255224