platform/upstream/llvm.git
8 years agoUse TinyPtrVector<Ty *> instead of SmallVector<Ty *, 1>.
Rui Ueyama [Tue, 23 Feb 2016 03:34:37 +0000 (03:34 +0000)]
Use TinyPtrVector<Ty *> instead of SmallVector<Ty *, 1>.

Thanks to Sean Silva for the suggestion.

llvm-svn: 261606

8 years agoCodeGen: TII: Take MachineInstr& in predicate API, NFC
Duncan P. N. Exon Smith [Tue, 23 Feb 2016 02:46:52 +0000 (02:46 +0000)]
CodeGen: TII: Take MachineInstr& in predicate API, NFC

Change TargetInstrInfo API to take `MachineInstr&` instead of
`MachineInstr*` in the functions related to predicated instructions
(I'll try to come back later and get some of the rest).  All of these
functions require non-null parameters already, so references are more
clear.  As a bonus, this happens to factor away a host of implicit
iterator => pointer conversions.

No functionality change intended.

llvm-svn: 261605

8 years agoRevert "Add prefix based function layout when profile is available."
Duncan P. N. Exon Smith [Tue, 23 Feb 2016 02:28:40 +0000 (02:28 +0000)]
Revert "Add prefix based function layout when profile is available."

This reverts commit r261582, since this bot has been broken for four
hours:
http://lab.llvm.org:8080/green/job/clang-stage1-cmake-RA-incremental_check/19399/

llvm-svn: 261604

8 years ago[tests] Remove "supported-target" in favor of "target-arch" lit features.
Alexey Samsonov [Tue, 23 Feb 2016 01:58:56 +0000 (01:58 +0000)]
[tests] Remove "supported-target" in favor of "target-arch" lit features.

Test cases definitely should not care about the complete set of architectures
supported by compiler-rt - they should only care about current
architecture that the test suite was configured for.

Introduce new lit feature to reflect this, and convert tests to use it.

llvm-svn: 261603

8 years agoFix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in some files...
Eugene Zelenko [Tue, 23 Feb 2016 01:43:44 +0000 (01:43 +0000)]
Fix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in some files in source/Commands; other minor fixes.

llvm-svn: 261602

8 years ago[tests] Always specify correct config.target_arch when configuring test suite.
Alexey Samsonov [Tue, 23 Feb 2016 01:34:17 +0000 (01:34 +0000)]
[tests] Always specify correct config.target_arch when configuring test suite.

llvm-svn: 261601

8 years agoFollow up for r261597: Add the * to the auto.
Michael Zolotukhin [Tue, 23 Feb 2016 00:57:48 +0000 (00:57 +0000)]
Follow up for r261597: Add the * to the auto.

llvm-svn: 261600

8 years agoActually commit the test for r261598.
Sean Callanan [Tue, 23 Feb 2016 00:52:34 +0000 (00:52 +0000)]
Actually commit the test for r261598.

llvm-svn: 261599

8 years agoFixed a problem where the DWARF for inline functions was mis-parsed.
Sean Callanan [Tue, 23 Feb 2016 00:51:52 +0000 (00:51 +0000)]
Fixed a problem where the DWARF for inline functions was mis-parsed.

Inline functions in DWARF have AT_abstract_origin set, but we only handled that
if the functions were C++ methods.  Inline functions -- C or C++ -- have this
also, and as a result they got one FunctionDecl for each inlined instance.  When
going to construct the locals, this meant that the arguments (which did properly
have their abstract origins handled) would get associated with the master
FunctionDecl, and the inlined FunctionDecls would all appear to have no locals.

This manifested as not being able to look up local variables when stopped in an
inline fuunction.  We should have had a test for this, but somewhere along the
line the relevant test case lost its .py file (or it never had one).

This patch fixes this problem and restores the .py file.

<rdar://problem/24712434>

llvm-svn: 261598

8 years agoFollow-up for r261595: use range loop.
Michael Zolotukhin [Tue, 23 Feb 2016 00:48:44 +0000 (00:48 +0000)]
Follow-up for r261595: use range loop.

llvm-svn: 261597

8 years agoLex: Return "" when HeaderMap::lookupFilename fails
Duncan P. N. Exon Smith [Tue, 23 Feb 2016 00:48:16 +0000 (00:48 +0000)]
Lex: Return "" when HeaderMap::lookupFilename fails

Change getString() to return Optional<StringRef>, and change
lookupFilename() to return an empty string if either one of the prefix
and suffix can't be found.

This is a more robust follow-up to r261461, but it's still not entirely
satisfactory.  Ideally we'd report that the header map is corrupt;
perhaps something for a follow-up.

llvm-svn: 261596

8 years ago[LoopUnroll] Avoid unnecessary DT recomputation.
Michael Zolotukhin [Tue, 23 Feb 2016 00:30:50 +0000 (00:30 +0000)]
[LoopUnroll] Avoid unnecessary DT recomputation.

Summary:
When we completely unroll a loop, it's pretty easy to update DT in-place and
thus avoid rebuilding it. DT recalculation is one of the most time-consuming
tasks in loop-unroll, so avoiding it at least in case of full unroll should be
beneficial.

On some extreme (but still real-world) tests this patch improves compile time by
~2x.

Reviewers: escha, jmolloy, hfinkel, sanjoy, chandlerc

Subscribers: joker.eph, sanjoy, llvm-commits

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

llvm-svn: 261595

8 years ago[PM] Improve the API and comments around the analysis manager proxies.
Chandler Carruth [Tue, 23 Feb 2016 00:05:00 +0000 (00:05 +0000)]
[PM] Improve the API and comments around the analysis manager proxies.

These are really handles that ensure the analyses get cleared at
appropriate places, and as such copying doesn't really make sense.
Instead, they should look more like unique ownership objects. Make that
the case.

Relatedly, if you create a temporary of one and move out of it
its destructor shouldn't actually clear anything. I don't think there is
any code that can trigger this currently, but it seems like a more
robust implementation.

If folks want, I can add a unittest that forces this to be exercised,
but that seems somewhat pointless -- whether a temporary is ever created
in the innards of AnalysisManager is not really something we should be
adding a reliance on, but I didn't want to leave a timebomb in the code
here.

If anyone has a cleaner way to represent this, I'm all ears, but
I wanted to assure myself that this wasn't in fact responsible for
another bug I'm chasing down (it wasn't) and figured I'd commit that.

llvm-svn: 261594

8 years agoFix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in source...
Eugene Zelenko [Mon, 22 Feb 2016 23:46:47 +0000 (23:46 +0000)]
Fix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in source/Commands/CommandObjectCommands.cpp; other minor fixes.

llvm-svn: 261593

8 years agoAMDGPU: Add failing testcase for register coalescer
Matt Arsenault [Mon, 22 Feb 2016 23:45:42 +0000 (23:45 +0000)]
AMDGPU: Add failing testcase for register coalescer

llvm-svn: 261592

8 years agoHandle a weak undefined tls to archive member.
Rafael Espindola [Mon, 22 Feb 2016 23:19:29 +0000 (23:19 +0000)]
Handle a weak undefined tls to archive member.

A weak undefined should not fetch archive members, so we have to keep
the Lazy symbol.

That means the lazy symbol has to encode information about the original
weak undef.

Fixes pr25762.

llvm-svn: 261591

8 years agoRemove a trivial getter.
Rafael Espindola [Mon, 22 Feb 2016 23:16:05 +0000 (23:16 +0000)]
Remove a trivial getter.

llvm-svn: 261590

8 years agoMore detailed dependence test between volatile and non-volatile accesses
Krzysztof Parzyszek [Mon, 22 Feb 2016 23:07:43 +0000 (23:07 +0000)]
More detailed dependence test between volatile and non-volatile accesses

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

llvm-svn: 261589

8 years agoInclude ProfileData as CodeGen's required library.
Dehao Chen [Mon, 22 Feb 2016 22:54:14 +0000 (22:54 +0000)]
Include ProfileData as CodeGen's required library.

Summary: Fixing buildbot failure introduced by http://reviews.llvm.org/D17460

Reviewers: davidxl, hans

Subscribers: llvm-commits

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

llvm-svn: 261588

8 years agoSet function entry count as 0 if sample profile is not found for the function.
Dehao Chen [Mon, 22 Feb 2016 22:46:21 +0000 (22:46 +0000)]
Set function entry count as 0 if sample profile is not found for the function.

Summary: This change makes the sample profile's behavior consistent with instr profile.

Reviewers: davidxl, eraman, dnovillo

Subscribers: llvm-commits

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

llvm-svn: 261587

8 years agoLex: Check for 0 buckets on header map construction
Duncan P. N. Exon Smith [Mon, 22 Feb 2016 22:24:22 +0000 (22:24 +0000)]
Lex: Check for 0 buckets on header map construction

Switch to using `isPowerOf2_32()` to check whether the buckets are a
power of two, and as a side benefit reject loading a header map with no
buckets.  This is a follow-up to r261448.

llvm-svn: 261585

8 years ago[X86] Create mergeable constant pool entries for AVX
David Majnemer [Mon, 22 Feb 2016 22:23:11 +0000 (22:23 +0000)]
[X86] Create mergeable constant pool entries for AVX

We supported creating mergeable constant pool entries for smaller
constants but not for 32-byte AVX constants.

llvm-svn: 261584

8 years agoFix Visual Studio build after r261574
Hans Wennborg [Mon, 22 Feb 2016 22:21:58 +0000 (22:21 +0000)]
Fix Visual Studio build after r261574

llvm-svn: 261583

8 years agoAdd prefix based function layout when profile is available.
Dehao Chen [Mon, 22 Feb 2016 22:14:14 +0000 (22:14 +0000)]
Add prefix based function layout when profile is available.

Summary: If a function is hot, put it in text.hot section.

Reviewers: davidxl

Subscribers: eraman, mcrosier, llvm-commits

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

llvm-svn: 261582

8 years agoFix __is_referenceable to work with vector types. Fixes PR#26654 and 26656. Thanks...
Marshall Clow [Mon, 22 Feb 2016 22:13:03 +0000 (22:13 +0000)]
Fix __is_referenceable to work with vector types. Fixes PR#26654 and 26656. Thanks to Evgeniy for the reports, and to Eric for the suggestion on how to fix it.

llvm-svn: 261581

8 years agoSelectionDAG: Use correct addrspace when lowering memcpy
Matt Arsenault [Mon, 22 Feb 2016 22:01:42 +0000 (22:01 +0000)]
SelectionDAG: Use correct addrspace when lowering memcpy

This was causing assertions later from using the wrong pointer
size with LDS operations. getOptimalMemOpType should also have
address space arguments later.

This avoids assertions in existing tests exposed by
a future commit.

llvm-svn: 261580

8 years ago[WebAssembly] Fix writeback of stack pointer with dynamic alloca
Derek Schuff [Mon, 22 Feb 2016 21:57:17 +0000 (21:57 +0000)]
[WebAssembly] Fix writeback of stack pointer with dynamic alloca

Previously the stack pointer was only written back to memory in the
prolog. But this is wrong for dynamic allocas, for which
target-independent codegen handles SP updates after the prolog (and
possibly even in another BB). Instead update the SP global in
ADJCALLSTACKDOWN which is generated after the SP update sequence.
This will have further refinements when we add red zone support.

llvm-svn: 261579

8 years ago[LoopDataPrefetch] Make it testable with opt
Adam Nemet [Mon, 22 Feb 2016 21:41:22 +0000 (21:41 +0000)]
[LoopDataPrefetch] Make it testable with opt

Summary:
Since this is an IR pass it's nice to be able to write tests without
llc.  This is the counterpart of the llc test under
CodeGen/PowerPC/loop-data-prefetch.ll.

Reviewers: hfinkel

Subscribers: llvm-commits

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

llvm-svn: 261578

8 years agoCodeGen: Bring back MachineBasicBlock::iterator::getInstrIterator()...
Duncan P. N. Exon Smith [Mon, 22 Feb 2016 21:30:15 +0000 (21:30 +0000)]
CodeGen: Bring back MachineBasicBlock::iterator::getInstrIterator()...

This is a little embarrassing.

When I reverted r261504 (getIterator() => getInstrIterator()) in
r261567, I did a `git grep` to see if there were new calls to
`getInstrIterator()` that I needed to migrate.  There were 10-20 hits,
and I blindly did a `sed ...` before calling `ninja check`.

However, these were `MachineInstrBundleIterator::getInstrIterator()`,
which predated r261567.  Perhaps coincidentally, these had an identical
name and return type.

This commit undoes my careless sed and restores
`MachineBasicBlock::iterator::getInstrIterator()`.

llvm-svn: 261577

8 years agoDon't create copy relocs in shared libraries.
Rafael Espindola [Mon, 22 Feb 2016 21:23:29 +0000 (21:23 +0000)]
Don't create copy relocs in shared libraries.

This fixes PR26699.

llvm-svn: 261576

8 years ago[LoopUnrolling] Fix a bug introduced in r259869 (PR26688).
Michael Zolotukhin [Mon, 22 Feb 2016 21:21:45 +0000 (21:21 +0000)]
[LoopUnrolling] Fix a bug introduced in r259869 (PR26688).

The issue was that we only required LCSSA rebuilding if the immediate
parent-loop had values used outside of it. The fix is to enaable the
same logic for all outer loops, not only immediate parent.

llvm-svn: 261575

8 years ago[ASTMatchers] Add matcher hasAnyName.
Samuel Benzaquen [Mon, 22 Feb 2016 21:13:02 +0000 (21:13 +0000)]
[ASTMatchers] Add matcher hasAnyName.

Summary: Add matcher hasAnyName as an optimization over anyOf(hasName(),...)

Reviewers: alexfh

Subscribers: klimek, cfe-commits

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

llvm-svn: 261574

8 years ago[X86ISelLowering] Consolidate duplicated code in a single place.
Davide Italiano [Mon, 22 Feb 2016 21:06:46 +0000 (21:06 +0000)]
[X86ISelLowering] Consolidate duplicated code in a single place.

llvm-svn: 261573

8 years agoAMDGPU: Fix alignments in test
Matt Arsenault [Mon, 22 Feb 2016 21:04:23 +0000 (21:04 +0000)]
AMDGPU: Fix alignments in test

I don't think this test was intending to test unaligned load/store.
Change it to use the natural alignment to avoid regressing.

Also adds missing SI checks.

llvm-svn: 261571

8 years agoAMDGPU/R600: Implement allowsMisalignedMemoryAccess
Matt Arsenault [Mon, 22 Feb 2016 21:04:16 +0000 (21:04 +0000)]
AMDGPU/R600: Implement allowsMisalignedMemoryAccess

This avoids some test regressions in a future commit
when unaligned operations are expanded when they
have custom lowering.

llvm-svn: 261570

8 years ago[RS4GC] "Constant fold" the rs4gc-split-vector-values flag
Philip Reames [Mon, 22 Feb 2016 21:01:28 +0000 (21:01 +0000)]
[RS4GC] "Constant fold" the rs4gc-split-vector-values flag

This flag was part of a migration to a new means of handling vectors-of-points which was described in the llvm-dev thread "FYI: Relocating vector of pointers".  The old code path has been off by default for a while without complaints, so time to cleanup.

llvm-svn: 261569

8 years agoARM: sink atomic release barrier as far as possible into cmpxchg.
Tim Northover [Mon, 22 Feb 2016 20:55:50 +0000 (20:55 +0000)]
ARM: sink atomic release barrier as far as possible into cmpxchg.

DMB instructions can be expensive, so it's best to avoid them if possible. In
atomicrmw operations there will always be an attempted store so a release
barrier is always needed, but in the cmpxchg case we can delay the DMB until we
know we'll definitely try to perform a store (and so need release semantics).

In the strong cmpxchg case this isn't quite free: we must duplicate the LDREX
instructions to skip the barrier on subsequent iterations. The basic outline
becomes:

        ldrex rOld, [rAddr]
        cmp rOld, rDesired
        bne Ldone
        dmb
    Lloop:
        strex rRes, rNew, [rAddr]
        cbz rRes Ldone
        ldrex rOld, [rAddr]
        cmp rOld, rDesired
        beq Lloop
    Ldone:

So we'll skip this version for strong operations in "minsize" functions.

llvm-svn: 261568

8 years agoRevert "CodeGen: MachineInstr::getIterator() => getInstrIterator(), NFC"
Duncan P. N. Exon Smith [Mon, 22 Feb 2016 20:49:58 +0000 (20:49 +0000)]
Revert "CodeGen: MachineInstr::getIterator() => getInstrIterator(), NFC"

This reverts commit r261504, since it's not obvious the new name is
better:
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20160222/334298.html

I'll recommit if we get consensus that it's the right direction.

llvm-svn: 261567

8 years ago[WebAssembly] Re-enable the TailDuplicate pass.
Dan Gohman [Mon, 22 Feb 2016 20:47:12 +0000 (20:47 +0000)]
[WebAssembly] Re-enable the TailDuplicate pass.

llvm-svn: 261566

8 years ago[RS4GC] Revert optimization attempt due to memory corruption
Philip Reames [Mon, 22 Feb 2016 20:45:56 +0000 (20:45 +0000)]
[RS4GC] Revert optimization attempt due to memory corruption

This change reverts "246133 [RewriteStatepointsForGC] Reduce the number of new instructions for base pointers" and a follow on bugfix 12575.

As pointed out in pr25846, this code suffers from a memory corruption bug.  Since I'm (empirically) not going to get back to this any time soon, simply reverting the problematic change is the right answer.

llvm-svn: 261565

8 years agoWebAssembly: update expected failures
JF Bastien [Mon, 22 Feb 2016 20:37:34 +0000 (20:37 +0000)]
WebAssembly: update expected failures

clang r261557 lowers va_arg in clang.

llvm-svn: 261564

8 years agoclang-format: [JS] Add @return to the supported JSDoc pragmas in Google
Daniel Jasper [Mon, 22 Feb 2016 20:24:11 +0000 (20:24 +0000)]
clang-format: [JS] Add @return to the supported JSDoc pragmas in Google
style.

llvm-svn: 261563

8 years ago[WebAssembly] Teach address folding to fold bitwise-or nodes.
Dan Gohman [Mon, 22 Feb 2016 20:04:02 +0000 (20:04 +0000)]
[WebAssembly] Teach address folding to fold bitwise-or nodes.

LLVM converts adds into ors when it can prove that the operands don't share
any non-zero bits. Teach address folding to recognize or instructions with
constant operands with this property that can be folded into addresses as
if they were adds.

llvm-svn: 261562

8 years agoCorrectly handle two gd relocations to the same symbol.
Rafael Espindola [Mon, 22 Feb 2016 19:57:55 +0000 (19:57 +0000)]
Correctly handle two gd relocations to the same symbol.

Fixes PR26676.

llvm-svn: 261561

8 years ago[WebAssembly] Initial driver support for standard library paths.
Dan Gohman [Mon, 22 Feb 2016 19:26:15 +0000 (19:26 +0000)]
[WebAssembly] Initial driver support for standard library paths.

llvm-svn: 261560

8 years ago[AMDGPU][llvm-mc] Support for 32-bit inline literals
Tom Stellard [Mon, 22 Feb 2016 19:17:56 +0000 (19:17 +0000)]
[AMDGPU][llvm-mc] Support for 32-bit inline literals

Patch by: Artem Tamazov

Summary:
Note: Support for 64-bit inline literals TBD
Added: Support of abs/neg modifiers for literals (incomplete; parsing TBD).
Added: Some TODO comments.
Reworked/clarity: rename isInlineImm() to isInlinableImm()
Reworked/robustness: disallow BitsToFloat() with undefined value in isInlinableImm()
Reworked/reuse: isSSrc32/64(), isVSrc32/64()
Tests added.

Reviewers: tstellarAMD, arsenm

Subscribers: vpykhtin, nhaustov, SamWot, arsenm

Projects: #llvm-amdgpu-spb

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

llvm-svn: 261559

8 years ago[AMDGPU] [llvm-mc] [VI] Fix encoding of LDS/GDS instructions.
Tom Stellard [Mon, 22 Feb 2016 19:17:53 +0000 (19:17 +0000)]
[AMDGPU] [llvm-mc] [VI] Fix encoding of LDS/GDS instructions.

Patch by: Artem Tamazov

Summary: Tests added.

Reviewers: tstellarAMD, arsenm

Subscribers: vpykhtin, SamWot, #llvm-amdgpu-spb

Projects: #llvm-amdgpu-spb

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

llvm-svn: 261558

8 years ago[WebAssembly] Lower va_arg in clang.
Dan Gohman [Mon, 22 Feb 2016 19:17:40 +0000 (19:17 +0000)]
[WebAssembly] Lower va_arg in clang.

This uses the general emitVoidPtrVAArg lowering logic for everything, since
this supports all types, and we don't have any special requirements.

llvm-svn: 261557

8 years ago[VFS] Fix call to getVFSFromYAML in unittests
Bruno Cardoso Lopes [Mon, 22 Feb 2016 19:02:27 +0000 (19:02 +0000)]
[VFS] Fix call to getVFSFromYAML in unittests

Follow up from r261552

llvm-svn: 261556

8 years agoFix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in source...
Eugene Zelenko [Mon, 22 Feb 2016 19:02:01 +0000 (19:02 +0000)]
Fix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in source/Commands/CommandObjectPlatform.cpp; other minor fixes.

Add missing break for permissions-string case.

llvm-svn: 261555

8 years ago[Sanitizer] Introduce ListOfModules object and use it to replace GetListOfModules().
Alexey Samsonov [Mon, 22 Feb 2016 18:52:51 +0000 (18:52 +0000)]
[Sanitizer] Introduce ListOfModules object and use it to replace GetListOfModules().

Summary:
This removes the hard limit on the number of loaded modules (used to be
16K), and makes it easier to use LoadedModules w/o causing a memory
leak: ListOfModules owns the modules, and makes sure to properly clean
them in destructor.

Remove filtering functionality that is only needed in one place (LSan).

Reviewers: aizatsky

Subscribers: llvm-commits, kcc

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

llvm-svn: 261554

8 years ago[VFS] Add 'overlay-relative' field to YAML files
Bruno Cardoso Lopes [Mon, 22 Feb 2016 18:41:09 +0000 (18:41 +0000)]
[VFS] Add 'overlay-relative' field to YAML files

The VFS overlay mapping between virtual paths and real paths is done through
the 'external-contents' entries in YAML files, which contains hardcoded paths
to the real files.

When a module compilation crashes, headers are dumped into <name>.cache/vfs
directory and are mapped via the <name>.cache/vfs/vfs.yaml. The script
generated for reproduction uses -ivfsoverlay pointing to file to gather the
mapping between virtual paths and files inside <name>.cache/vfs. Currently, we
are only capable of reproducing such crashes in the same machine as they
happen, because of the hardcoded paths in 'external-contents'.

To be able to reproduce a crash in another machine, this patch introduces a new
option in the VFS yaml file called 'overlay-relative'. When it's equal to
'true' it means that the provided path to the YAML file through the
-ivfsoverlay option should also be used to prefix the final path for every
'external-contents'.

Example, given the invocation snippet "... -ivfsoverlay
<name>.cache/vfs/vfs.yaml" and the following entry in the yaml file:

"overlay-relative": "true",
"roots": [
...
  "type": "directory",
  "name": "/usr/include",
  "contents": [
    {
      "type": "file",
      "name": "stdio.h",
      "external-contents": "/usr/include/stdio.h"
    },
...

Here, a file manager request for virtual "/usr/include/stdio.h", that will map
into real path "/<absolute_path_to>/<name>.cache/vfs/usr/include/stdio.h.

This is a useful feature for debugging module crashes in machines other than
the one where the error happened.

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

rdar://problem/24499339

llvm-svn: 261552

8 years ago[VFS] Add support for handling path traversals
Bruno Cardoso Lopes [Mon, 22 Feb 2016 18:41:01 +0000 (18:41 +0000)]
[VFS] Add support for handling path traversals

Handle ".", ".." and "./" with trailing slashes while collecting files
to be dumped into the vfs overlay directory.

Include the support for symlinks into components. Given the path:

/install-dir/bin/../lib/clang/3.8.0/include/altivec.h, if "bin"
component is a symlink, it's not safe to use `path::remove_dots` here,
and `realpath` is used to get the right answer. Since `realpath`
is expensive, we only do it at collecting time (which only happens
during the crash reproducer) and cache the base directory for fast lookups.

Overall, this makes the input to the VFS YAML file to be canonicalized
to never contain traversal components.

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

rdar://problem/24499339

llvm-svn: 261551

8 years agodocs/AMDGPUUsage: Update assembly example
Tom Stellard [Mon, 22 Feb 2016 18:36:00 +0000 (18:36 +0000)]
docs/AMDGPUUsage: Update assembly example

Reviewers: arsenm, nhaustov

Subscribers: llvm-commits

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

llvm-svn: 261550

8 years agoRevert "[attrs] Handle convergent CallSites."
Justin Lebar [Mon, 22 Feb 2016 18:24:43 +0000 (18:24 +0000)]
Revert "[attrs] Handle convergent CallSites."

This reverts r261544, which was causing a test failure in
Transforms/FunctionAttrs/readattrs.ll.

llvm-svn: 261549

8 years agoAdd has_feature attribute_availability_with_strict.
Manman Ren [Mon, 22 Feb 2016 18:24:30 +0000 (18:24 +0000)]
Add has_feature attribute_availability_with_strict.

rdar://23791325

llvm-svn: 261548

8 years agoRevert "[ifcnv] Add comment explaining why it's OK to duplicate convergent MIs in...
Justin Lebar [Mon, 22 Feb 2016 18:17:27 +0000 (18:17 +0000)]
Revert "[ifcnv] Add comment explaining why it's OK to duplicate convergent MIs in ifcnv."

This reverts r261543.  Accidental commit (not LGTM'ed).

llvm-svn: 261547

8 years agoFix for PR26690 take 2
Nemanja Ivanovic [Mon, 22 Feb 2016 18:04:00 +0000 (18:04 +0000)]
Fix for PR26690 take 2

This is what was meant to be in the initial commit to fix this bug. The
parens were missing. This commit also adds a test case for the bug and
has undergone full testing on PPC and X86.

llvm-svn: 261546

8 years ago[analyzer] Detect duplicate [super dealloc] calls
Devin Coughlin [Mon, 22 Feb 2016 17:56:24 +0000 (17:56 +0000)]
[analyzer] Detect duplicate [super dealloc] calls

Add an alpha path checker that warns about duplicate calls to [super dealloc].
This will form the foundation of a checker that will detect uses of
'self' after calling [super dealloc].

Part of rdar://problem/6953275.

Based on a patch by David Kilzer!

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

llvm-svn: 261545

8 years ago[attrs] Handle convergent CallSites.
Justin Lebar [Mon, 22 Feb 2016 17:51:35 +0000 (17:51 +0000)]
[attrs] Handle convergent CallSites.

Summary:
Previously we had a notion of convergent functions but not of convergent
calls.  This is insufficient to correctly analyze calls where the target
is unknown, e.g. indirect calls.

Now a call is convergent if it targets a known-convergent function, or
if it's explicitly marked as convergent.  As usual, we can remove
convergent where we can prove that no convergent operations are
performed in the call.

Reviewers: chandlerc, jingyue

Subscribers: hfinkel, jhen, tra, llvm-commits

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

llvm-svn: 261544

8 years ago[ifcnv] Add comment explaining why it's OK to duplicate convergent MIs in ifcnv.
Justin Lebar [Mon, 22 Feb 2016 17:51:30 +0000 (17:51 +0000)]
[ifcnv] Add comment explaining why it's OK to duplicate convergent MIs in ifcnv.

Summary:
Also add a comment briefly explaining what ifcnv is.

No functional changes.

Reviewers: resistor

Subscribers: echristo, tra, llvm-commits

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

llvm-svn: 261543

8 years ago[ifcnv] Use unique_ptr in IfConversion. NFC
Justin Lebar [Mon, 22 Feb 2016 17:51:28 +0000 (17:51 +0000)]
[ifcnv] Use unique_ptr in IfConversion.  NFC

Reviewers: rnk

Subscribers: llvm-commits

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

llvm-svn: 261541

8 years agoDon't tail-duplicate blocks that contain convergent instructions.
Justin Lebar [Mon, 22 Feb 2016 17:50:52 +0000 (17:50 +0000)]
Don't tail-duplicate blocks that contain convergent instructions.

Summary:
Convergent instrs shouldn't be made control-dependent on other values,
but this is basically the whole point of tail duplication.  So just bail
if we see a convergent instruction.

Reviewers: iteratee

Subscribers: jholewinski, jhen, hfinkel, tra, jingyue, llvm-commits

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

llvm-svn: 261540

8 years ago[WebAssembly] Properly ignore llvm.dbg.value instructions.
Dan Gohman [Mon, 22 Feb 2016 17:45:20 +0000 (17:45 +0000)]
[WebAssembly] Properly ignore llvm.dbg.value instructions.

llvm-svn: 261538

8 years agoDon't enable /GX by default
David Majnemer [Mon, 22 Feb 2016 17:44:51 +0000 (17:44 +0000)]
Don't enable /GX by default

The /GX flag is disabled unless explicitly specified on the command
line.  This partially addresses PR26698.

llvm-svn: 261537

8 years agoRefactor GetSoftwareBreakpointTrapOpcode
Aidan Dodds [Mon, 22 Feb 2016 17:29:56 +0000 (17:29 +0000)]
Refactor GetSoftwareBreakpointTrapOpcode

This patch aims to reduce the code duplication among all of the platforms in GetSoftwareBreakpointTrapOpcode by pushing all common code into the Platform base class.

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

llvm-svn: 261536

8 years ago[MS ABI] Correctly handle dllimport'd explicit instantiation declaration w/ vbases
David Majnemer [Mon, 22 Feb 2016 17:22:08 +0000 (17:22 +0000)]
[MS ABI] Correctly handle dllimport'd explicit instantiation declaration w/ vbases

We gave a VBTable dllimport storage class and external linkage while
also providing an initializer.  An initializer is only valid if the
VBTable has available_externally linkage.  Fix this by setting the
linkage to available_externally in situ while generating the
initializer.

This fixes PR26686.

llvm-svn: 261535

8 years agoAdd a test for r261425.
David Majnemer [Mon, 22 Feb 2016 17:22:01 +0000 (17:22 +0000)]
Add a test for r261425.

llvm-svn: 261534

8 years agoAdd support for Android Vector calling convention for AArch64
Nirav Dave [Mon, 22 Feb 2016 16:48:42 +0000 (16:48 +0000)]
Add support for Android Vector calling convention for AArch64

This modification applies the following Android commit when we have an
Android environment. This is the sole non-renderscript in the Android repo

commit 9212d4fb30a3ca2f4ee966dd2748c35573d9682c
Author: Tim Murray <timmurray@google.com>
Date:   Fri Aug 15 16:00:15 2014 -0700

    Update vector calling convention for AArch64.

    bug 16846318

    Change-Id: I3cfd167758b4bd634d8480ee6ba6bb55d61f82a7

Reviewers: srhines, jyknight

Subscribers: mcrosier, aemerson, rengolin, tberghammer, danalbert, srhines

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

llvm-svn: 261533

8 years ago[ConstantRange] Rename a method and add more doc
Sanjoy Das [Mon, 22 Feb 2016 16:13:02 +0000 (16:13 +0000)]
[ConstantRange] Rename a method and add more doc

Rename makeNoWrapRegion to a more obvious makeGuaranteedNoWrapRegion,
and add a comment about the counter-intuitive aspects of the function.
This is to help prevent cases like PR26628.

llvm-svn: 261532

8 years agoAdd a new check, cert-env33-c, that diagnoses uses of system(), popen(), and _popen...
Aaron Ballman [Mon, 22 Feb 2016 16:01:06 +0000 (16:01 +0000)]
Add a new check, cert-env33-c, that diagnoses uses of system(), popen(), and _popen() to execute a command processor. This check corresponds to the CERT secure coding rule: https://securecoding.cert.org/confluence/pages/viewpage.action?pageId=2130132

llvm-svn: 261530

8 years ago[mips] added support for trunc macro
Zoran Jovanovic [Mon, 22 Feb 2016 16:00:23 +0000 (16:00 +0000)]
[mips] added support for trunc macro

Author: obucina
Reviewers: dsanders
Differential Revision: http://reviews.llvm.org/D15745

llvm-svn: 261529

8 years agoclang-format: [JS] treat forwardDeclare as an import/export statement.
Daniel Jasper [Mon, 22 Feb 2016 15:06:53 +0000 (15:06 +0000)]
clang-format: [JS] treat forwardDeclare as an import/export statement.

Patch by Martin Probst. Thank you.

llvm-svn: 261528

8 years agoRevert bad fix for PR26690.
Nemanja Ivanovic [Mon, 22 Feb 2016 15:06:32 +0000 (15:06 +0000)]
Revert bad fix for PR26690.

llvm-svn: 261527

8 years agoFix for PR26690
Nemanja Ivanovic [Mon, 22 Feb 2016 14:47:49 +0000 (14:47 +0000)]
Fix for PR26690

I mistook BitVector::empty() to mean BitVector::count() == 0 and it does
not. Corrected the issue with the fix for PR26500.

llvm-svn: 261525

8 years agoFix some abuse of auto flagged by clang's -Wrange-loop-analysis.
Benjamin Kramer [Mon, 22 Feb 2016 13:11:58 +0000 (13:11 +0000)]
Fix some abuse of auto flagged by clang's -Wrange-loop-analysis.

llvm-svn: 261524

8 years agoUse an anonymous hyperlink reference to eliminate Sphinx warnings.
Aaron Ballman [Mon, 22 Feb 2016 13:09:36 +0000 (13:09 +0000)]
Use an anonymous hyperlink reference to eliminate Sphinx warnings.

llvm-svn: 261523

8 years agoMake Sema::CheckFormatString a static function inside SemaChecking.cpp
Andy Gibbs [Mon, 22 Feb 2016 13:00:43 +0000 (13:00 +0000)]
Make Sema::CheckFormatString a static function inside SemaChecking.cpp

No functionality change.  Change at the request of Richard Trieu, see
http://reviews.llvm.org/D15636#357858.

llvm-svn: 261522

8 years agoAVX512F: Add assembler Intel syntax tests for knl, fix minor bugs.
Igor Breger [Mon, 22 Feb 2016 12:37:41 +0000 (12:37 +0000)]
AVX512F: Add assembler Intel syntax tests for knl, fix minor bugs.

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

llvm-svn: 261521

8 years agoAVX512: Fix scalar mem operands.
Igor Breger [Mon, 22 Feb 2016 11:48:27 +0000 (11:48 +0000)]
AVX512: Fix scalar mem operands.

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

llvm-svn: 261520

8 years agoMark TestMiBreak.test_lldbmi_break_insert_function_pending as flaky on linux
Pavel Labath [Mon, 22 Feb 2016 09:51:32 +0000 (09:51 +0000)]
Mark TestMiBreak.test_lldbmi_break_insert_function_pending as flaky on linux

Test has become flaky again. Attempts to investigate the triggering commit have failed, so I
suspect it was flaky all along..

llvm-svn: 261519

8 years ago[CLANG] [AVX512] [BUILTIN] Adding prol{d|q|w}{128|256|512} builtin to clang .
Michael Zuckerman [Mon, 22 Feb 2016 09:42:57 +0000 (09:42 +0000)]
[CLANG] [AVX512] [BUILTIN] Adding prol{d|q|w}{128|256|512} builtin to clang .

Fixing problem with the lib/include/avx512vlintrin.h file.
Adding one more _ to the prefix of _extension__ -> __extension__.

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

llvm-svn: 261518

8 years agoAllow setting MaxRerollIterations above 16
Elena Demikhovsky [Mon, 22 Feb 2016 09:38:28 +0000 (09:38 +0000)]
Allow setting MaxRerollIterations above 16
By Ayal Zaks.

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

llvm-svn: 261517

8 years ago[CLANG] [AVX512] [BUILTIN] Adding prol{d|q|w}{128|256|512} builtin to clang .
Michael Zuckerman [Mon, 22 Feb 2016 09:05:41 +0000 (09:05 +0000)]
[CLANG] [AVX512] [BUILTIN] Adding prol{d|q|w}{128|256|512} builtin to clang .

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

llvm-svn: 261516

8 years ago[X86] Minor formatting fix. NFC
Craig Topper [Mon, 22 Feb 2016 08:00:04 +0000 (08:00 +0000)]
[X86] Minor formatting fix. NFC

llvm-svn: 261515

8 years agoUse EXPECT_EQ in the unittests instead of plain assert
Tobias Grosser [Mon, 22 Feb 2016 07:20:40 +0000 (07:20 +0000)]
Use EXPECT_EQ in the unittests instead of plain assert

This addresses post-review comments from Duncan P. N. Exon Smith to r261485.

llvm-svn: 261514

8 years ago[MSan] Make unaligned load/store functions compatible for both endians
Mohit K. Bhakkad [Mon, 22 Feb 2016 06:16:28 +0000 (06:16 +0000)]
[MSan] Make unaligned load/store functions compatible for both endians

Reviewers: eugenis

Subscribers: jaydeep, sagar, llvm-commits

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

llvm-svn: 261513

8 years agoAddressing review comments for r261163.
Manman Ren [Mon, 22 Feb 2016 04:47:24 +0000 (04:47 +0000)]
Addressing review comments for r261163.

Use "strict" instead of "nopartial". Also make strictly not-introduced
share the same diagnostics as Obsolete and Unavailable.

rdar://23791325

llvm-svn: 261512

8 years agoReapply "CodeGen: Use references in MachineTraceMetrics::Trace, NFC"
Duncan P. N. Exon Smith [Mon, 22 Feb 2016 03:33:28 +0000 (03:33 +0000)]
Reapply "CodeGen: Use references in MachineTraceMetrics::Trace, NFC"

This reverts commit r261510, effectively reapplying r261509.  The
original commit missed a caller in AArch64ConditionalCompares.

Original commit message:

Pass non-null arguments by reference in MachineTraceMetrics::Trace,
simplifying future work to remove implicit iterator => pointer
conversions.

llvm-svn: 261511

8 years agoRevert "CodeGen: Use references in MachineTraceMetrics::Trace, NFC"
Duncan P. N. Exon Smith [Mon, 22 Feb 2016 03:12:42 +0000 (03:12 +0000)]
Revert "CodeGen: Use references in MachineTraceMetrics::Trace, NFC"

This reverts commit r261509.  I'm not sure how this compiled locally,
but something was out of whack.

llvm-svn: 261510

8 years agoCodeGen: Use references in MachineTraceMetrics::Trace, NFC
Duncan P. N. Exon Smith [Mon, 22 Feb 2016 03:07:49 +0000 (03:07 +0000)]
CodeGen: Use references in MachineTraceMetrics::Trace, NFC

Pass non-null arguments by reference in MachineTraceMetrics::Trace,
simplifying future work to remove implicit iterator => pointer
conversions.

llvm-svn: 261509

8 years agoCodeGen: Explicitly convert from iterator to pointer, NFC
Duncan P. N. Exon Smith [Mon, 22 Feb 2016 02:53:42 +0000 (02:53 +0000)]
CodeGen: Explicitly convert from iterator to pointer, NFC

llvm-svn: 261508

8 years agoDocument assumption in X86FrameLowering::inlineStackProbe()
Duncan P. N. Exon Smith [Mon, 22 Feb 2016 02:32:35 +0000 (02:32 +0000)]
Document assumption in X86FrameLowering::inlineStackProbe()

Resolve FIXME from r261504.  Apparently bundled instructions are illegal
here:
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20160215/334146.html

llvm-svn: 261507

8 years agoFix PR24473 : Teach clang to remember to substitute into member variable templates...
Faisal Vali [Mon, 22 Feb 2016 02:24:29 +0000 (02:24 +0000)]
Fix PR24473 : Teach clang to remember to substitute into member variable templates referred to within dependent qualified ids.

In passing also fix a semi-related bug that allows access to variable templates through member access notation.

llvm-svn: 261506

8 years ago[X86] More test updates to support fixup-byte-word-insts optimization
Kevin B. Smith [Mon, 22 Feb 2016 01:27:56 +0000 (01:27 +0000)]
[X86] More test updates to support fixup-byte-word-insts optimization
either on or off.
Differential Revisions: http://reviews.llvm.org/D17458

llvm-svn: 261505

8 years agoCodeGen: MachineInstr::getIterator() => getInstrIterator(), NFC
Duncan P. N. Exon Smith [Sun, 21 Feb 2016 22:58:35 +0000 (22:58 +0000)]
CodeGen: MachineInstr::getIterator() => getInstrIterator(), NFC

Delete MachineInstr::getIterator(), since the term "iterator" is
overloaded when talking about MachineInstr.

- Downcast to ilist_node in iplist::getNextNode() and getPrevNode() so
  that ilist_node::getIterator() is still available.
- Add it back as MachineInstr::getInstrIterator().  This matches the
  naming in MachineBasicBlock.
- Add MachineInstr::getBundleIterator().  This is explicitly called
  "bundle" (not matching MachineBasicBlock) to disintinguish it clearly
  from ilist_node::getIterator().
- Update all calls.  Some of these I switched to `auto` to remove
  boiler-plate, since the new name is clear about the type.

There was one call I updated that looked fishy, but it wasn't clear what
the right answer was.  This was in X86FrameLowering::inlineStackProbe(),
added in r252578 in lib/Target/X86/X86FrameLowering.cpp.  I opted to
leave the behaviour unchanged, but I'll reply to the original commit on
the list in a moment.

llvm-svn: 261504

8 years ago[Orc] Add stack-realignment code to the i386 resolver function.
Lang Hames [Sun, 21 Feb 2016 22:50:26 +0000 (22:50 +0000)]
[Orc] Add stack-realignment code to the i386 resolver function.

The resolver uses the fxsave/fxrstor instructions, which require 16-byte
alignment, to save SSE state to the stack. Since 16-byte alignment can't be
assumed on all OSes (and all i386 OSes share this function) - add code to
automatically bump the alignment to 16-bytes on entry to the function.

llvm-svn: 261503

8 years agoCodeGen: Split bundle_iterator into a separate file, NFC
Duncan P. N. Exon Smith [Sun, 21 Feb 2016 22:05:50 +0000 (22:05 +0000)]
CodeGen: Split bundle_iterator into a separate file, NFC

Split MachineBasicBlock::bundle_iterator into a separate file, and
rename the class to MachineBundleIterator.

This is a precursor to adding a `MachineInstr::getBundleIterator()`
accessor, which will eventually let us delete the final call to
getNodePtrUnchecked(), and then remove the UB from ilist_iterator.

As a drive-by, I removed an unnecessary second template parameter.

llvm-svn: 261502

8 years agoAdd test case for [FIX] commit r261474
Johannes Doerfert [Sun, 21 Feb 2016 21:53:39 +0000 (21:53 +0000)]
Add test case for [FIX] commit r261474

llvm-svn: 261501

8 years agoCodeGen: Add constructor for MIBuilder from a bundle_iterator, NFC
Duncan P. N. Exon Smith [Sun, 21 Feb 2016 21:15:37 +0000 (21:15 +0000)]
CodeGen: Add constructor for MIBuilder from a bundle_iterator, NFC

Don't require explicit conversions for creating a MachineInstrBuilder
from a bundle_iterator.

llvm-svn: 261500