platform/upstream/llvm.git
8 years ago[WebAssembly] Remove check for FrameIndex operands in WebAssemblyPeephole
Derek Schuff [Tue, 26 Jan 2016 21:08:27 +0000 (21:08 +0000)]
[WebAssembly] Remove check for FrameIndex operands in WebAssemblyPeephole

This pass runs after FrameIndex elimination, so it should never see FI
operands. NFC

llvm-svn: 258860

8 years ago[cfi] Hide runtime implementation in a namespace.
Evgeniy Stepanov [Tue, 26 Jan 2016 21:06:26 +0000 (21:06 +0000)]
[cfi] Hide runtime implementation in a namespace.

Move all internal stuff into namespace __cfi.
Remove the double underscore prefix from anything that's now inside
the namespace.

llvm-svn: 258859

8 years ago[x86] add materializeVectorConstant() helper function; NFC
Sanjay Patel [Tue, 26 Jan 2016 21:05:00 +0000 (21:05 +0000)]
[x86] add materializeVectorConstant() helper function; NFC

LowerBUILD_VECTOR is still over 300 lines long, but it's a start...

llvm-svn: 258858

8 years ago[cfi] Support for dlopen and dlclose.
Evgeniy Stepanov [Tue, 26 Jan 2016 20:53:09 +0000 (20:53 +0000)]
[cfi] Support for dlopen and dlclose.

Add dlopen/dlclose interceptors to update CFI shadow for loaded/unloaded libraries.

llvm-svn: 258857

8 years agoFix comparison warning (r258845)
Hemant Kulkarni [Tue, 26 Jan 2016 20:38:15 +0000 (20:38 +0000)]
Fix comparison warning (r258845)

llvm-svn: 258856

8 years agoRemove dead code missed in r258852.
Eric Fiselier [Tue, 26 Jan 2016 20:31:01 +0000 (20:31 +0000)]
Remove dead code missed in r258852.

llvm-svn: 258855

8 years agoFixes build break introduced by r258845
Hemant Kulkarni [Tue, 26 Jan 2016 20:28:15 +0000 (20:28 +0000)]
Fixes build break introduced by r258845

llvm-svn: 258854

8 years agoWebAssembly NFC: update error message
JF Bastien [Tue, 26 Jan 2016 20:24:51 +0000 (20:24 +0000)]
WebAssembly NFC: update error message

I forgot to update this one in my previous patch.

llvm-svn: 258853

8 years agoFix PR26103 - Error calling is_convertible with incomplete type. Patch from Michael...
Eric Fiselier [Tue, 26 Jan 2016 20:24:30 +0000 (20:24 +0000)]
Fix PR26103 - Error calling is_convertible with incomplete type. Patch from Michael Daniels.

llvm-svn: 258852

8 years agoWebAssembly: don't optimize memcpy/memmove/memcpy to frame index
JF Bastien [Tue, 26 Jan 2016 20:22:42 +0000 (20:22 +0000)]
WebAssembly: don't optimize memcpy/memmove/memcpy to frame index

r258781 optimized memcpy/memmove/memcpy so the intrinsic call can return its first argument, but missed the frame index case. Teach it to ignore that case so C code doesn't assert out in these cases.

llvm-svn: 258851

8 years agoDo not define GXX_RTTI macro for C.
Yunzhong Gao [Tue, 26 Jan 2016 20:15:02 +0000 (20:15 +0000)]
Do not define GXX_RTTI macro for C.
This is same as GCC behavior (tested with GCC 4.8.2).

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

llvm-svn: 258850

8 years ago[sanitizers] extracted process management functions
Mike Aizatsky [Tue, 26 Jan 2016 20:10:01 +0000 (20:10 +0000)]
[sanitizers] extracted process management functions

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

llvm-svn: 258849

8 years agoAdd a missing test case for r258847.
Cong Hou [Tue, 26 Jan 2016 20:09:38 +0000 (20:09 +0000)]
Add a missing test case for r258847.

llvm-svn: 258848

8 years agoAllow X86::COND_NE_OR_P and X86::COND_NP_OR_E to be reversed.
Cong Hou [Tue, 26 Jan 2016 20:08:01 +0000 (20:08 +0000)]
Allow X86::COND_NE_OR_P and X86::COND_NP_OR_E to be reversed.

Currently, AnalyzeBranch() fails non-equality comparison between floating points
on X86 (see https://llvm.org/bugs/show_bug.cgi?id=23875). This is because this
function can modify the branch by reversing the conditional jump and removing
unconditional jump if there is a proper fall-through. However, in the case of
non-equality comparison between floating points, this can turn the branch
"unanalyzable". Consider the following case:

jne.BB1
jp.BB1
jmp.BB2
.BB1:
...
.BB2:
...

AnalyzeBranch() will reverse "jp .BB1" to "jnp .BB2" and then "jmp .BB2" will be
removed:

jne.BB1
jnp.BB2
.BB1:
...
.BB2:
...

However, AnalyzeBranch() cannot analyze this branch anymore as there are two
conditional jumps with different targets. This may disable some optimizations
like block-placement: in this case the fall-through behavior is enforced even if
the fall-through block is very cold, which is suboptimal.

Actually this optimization is also done in block-placement pass, which means we
can remove this optimization from AnalyzeBranch(). However, currently
X86::COND_NE_OR_P and X86::COND_NP_OR_E are not reversible: there is no defined
negation conditions for them.

In order to reverse them, this patch defines two new CondCode X86::COND_E_AND_NP
and X86::COND_P_AND_NE. It also defines how to synthesize instructions for them.
Here only the second conditional jump is reversed. This is valid as we only need
them to do this "unconditional jump removal" optimization.

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

llvm-svn: 258847

8 years ago[llvm-nm] Roll several conditions into a single if. NFCI.
Davide Italiano [Tue, 26 Jan 2016 19:57:42 +0000 (19:57 +0000)]
[llvm-nm] Roll several conditions into a single if.  NFCI.

llvm-svn: 258846

8 years ago[llvm-readobj] Add -elf-section-groups option
Hemant Kulkarni [Tue, 26 Jan 2016 19:46:39 +0000 (19:46 +0000)]
[llvm-readobj] Add -elf-section-groups option

Adds a way to inspect SHT_GROUP sections in ELF objects.
Displays signature, member sections of these sections.

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

llvm-svn: 258845

8 years agoBypass Perl modules in build system
Jonathan Peyton [Tue, 26 Jan 2016 19:44:31 +0000 (19:44 +0000)]
Bypass Perl modules in build system

This change fixes the bug: https://llvm.org/bugs/show_bug.cgi?id=25975
by bypassing the perl module files which try to deduce system information.
These perl modules files don't offer useful information and are from the
original build system. They can be removed after this change.

llvm-svn: 258843

8 years ago[ScheduleDAGInstrs] Simplify logic to improve readability. NFC.
Chad Rosier [Tue, 26 Jan 2016 19:33:57 +0000 (19:33 +0000)]
[ScheduleDAGInstrs] Simplify logic to improve readability. NFC.

The call to isInvariantLoad() already returns false for non-load instructions.

llvm-svn: 258841

8 years ago[MS ABI] Allow a member pointers' converted type to change
David Majnemer [Tue, 26 Jan 2016 19:30:26 +0000 (19:30 +0000)]
[MS ABI] Allow a member pointers' converted type to change

Member pointers in the MS ABI are tricky for a variety of reasons.
The size of a member pointer is indeterminate until the program reaches
a point where the representation is required to be known.  However,
*pointers* to member pointers may exist without knowing the pointee
type's representation.  In these cases, we synthesize an opaque LLVM
type for the pointee type.

However, we can be in a situation where the underlying member pointer's
representation became known mid-way through the program.  To account for
this, we attempted to manicure CodeGen's type-cache so that we can
replace the opaque member pointer type with the real deal while leaving
the pointer types unperturbed.  This, unfortunately, is a problematic
approach to take as we will violate CodeGen's invariants.

These violations are mostly harmless but let's do the right thing
instead: invalidate the type-cache if a member pointer's LLVM
representation changes.

This fixes PR26313.

llvm-svn: 258839

8 years agotidy up; NFC
Sanjay Patel [Tue, 26 Jan 2016 19:30:14 +0000 (19:30 +0000)]
tidy up; NFC

llvm-svn: 258838

8 years ago[llvm-nm] Simplify. No functional changes intended.
Davide Italiano [Tue, 26 Jan 2016 19:28:51 +0000 (19:28 +0000)]
[llvm-nm] Simplify. No functional changes intended.

llvm-svn: 258837

8 years agoFix Clang-tidy modernize-use-nullptr warnings; other minor fixes.
Eugene Zelenko [Tue, 26 Jan 2016 19:01:06 +0000 (19:01 +0000)]
Fix Clang-tidy modernize-use-nullptr warnings; other minor fixes.

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

llvm-svn: 258836

8 years agoTest commit. Fix typo in comment.
Jonathan Coe [Tue, 26 Jan 2016 18:55:55 +0000 (18:55 +0000)]
Test commit. Fix typo in comment.

llvm-svn: 258835

8 years agoClass Property: parse property attribute (class).
Manman Ren [Tue, 26 Jan 2016 18:52:43 +0000 (18:52 +0000)]
Class Property: parse property attribute (class).

This is the third patch in a series of patches to support class properties
in addition to instance properties in objective-c.

rdar://23891898

llvm-svn: 258834

8 years ago[x86] simplify getOnesVector() ; NFCI
Sanjay Patel [Tue, 26 Jan 2016 18:49:36 +0000 (18:49 +0000)]
[x86] simplify getOnesVector() ; NFCI

Let DAG.getConstant() handle the splatting; there's no need
to repeat that logic here.

llvm-svn: 258833

8 years ago[OpenMP] Parsing + sema for target parallel directive.
Arpith Chacko Jacob [Tue, 26 Jan 2016 18:48:41 +0000 (18:48 +0000)]
[OpenMP] Parsing + sema for target parallel directive.

Summary:
This patch adds parsing + sema for the target parallel directive and its clauses along with testcases.

Reviewers: ABataev

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

Rebased to current trunk and updated test cases.

llvm-svn: 258832

8 years agoFix Clang-tidy modernize-use-nullptr and modernize-use-override warnings; other minor...
Eugene Zelenko [Tue, 26 Jan 2016 18:48:36 +0000 (18:48 +0000)]
Fix Clang-tidy modernize-use-nullptr and modernize-use-override warnings; other minor fixes.

Differential revision: reviews.llvm.org/D16568

llvm-svn: 258831

8 years agoReassociate: Reprocess RedoInsts after each inst
Aditya Nandakumar [Tue, 26 Jan 2016 18:42:36 +0000 (18:42 +0000)]
Reassociate: Reprocess RedoInsts after each inst

Previously the RedoInsts was processed at the end of the block.
However it was possible that it left behind some instructions that
were not canonicalized.
This should guarantee that any previous instruction in the basic
block is canonicalized before we process a new instruction.

llvm-svn: 258830

8 years agoFix Clang-tidy modernize-use-nullptr warnings in include/lld/Core/range.h; other...
Eugene Zelenko [Tue, 26 Jan 2016 18:27:37 +0000 (18:27 +0000)]
Fix Clang-tidy modernize-use-nullptr warnings in include/lld/Core/range.h; other minor fixes.

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

llvm-svn: 258829

8 years ago[x86, AVX] tighten checks
Sanjay Patel [Tue, 26 Jan 2016 18:22:50 +0000 (18:22 +0000)]
[x86, AVX] tighten checks

llvm-svn: 258828

8 years agoUpdate wasm target for r258819.
Benjamin Kramer [Tue, 26 Jan 2016 18:21:38 +0000 (18:21 +0000)]
Update wasm target for r258819.

llvm-svn: 258827

8 years agoUpdate the comments for the macho-invalid-zero-ncmds test and fix
Kevin Enderby [Tue, 26 Jan 2016 18:20:49 +0000 (18:20 +0000)]
Update the comments for the macho-invalid-zero-ncmds test and fix
llvm-objdump when printing the Mach Header to print the unknown
cputype and cpusubtype fields as decimal instead of not printing
them at all.  And change the test to check for that.

llvm-svn: 258826

8 years agofix formatting; NFC
Sanjay Patel [Tue, 26 Jan 2016 18:14:37 +0000 (18:14 +0000)]
fix formatting; NFC

llvm-svn: 258825

8 years agoUse instance_properties instead of properties. NFC.
Manman Ren [Tue, 26 Jan 2016 18:05:23 +0000 (18:05 +0000)]
Use instance_properties instead of properties. NFC.

All current properties are instance properties.

This is the second patch in a series of patches to support class properties
in addition to instance properties in objective-c.

rdar://23891898

llvm-svn: 258824

8 years ago[CUDA] Add -fcuda-allow-variadic-functions.
Justin Lebar [Tue, 26 Jan 2016 17:47:20 +0000 (17:47 +0000)]
[CUDA] Add -fcuda-allow-variadic-functions.

Summary:
Turns out the variadic function checking added in r258643 was too strict
for some existing users; give them an escape valve.  When
-fcuda-allow-variadic-functions is passed, the front-end makes no
attempt to disallow C-style variadic functions.  Calls to va_arg are
still not allowed.

Reviewers: tra

Subscribers: cfe-commits, jhen, echristo, bkramer

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

llvm-svn: 258822

8 years agoRevert r258546.
Saleem Abdulrasool [Tue, 26 Jan 2016 17:43:48 +0000 (17:43 +0000)]
Revert r258546.

Seems that the patch was rebased on top of another change which obsoleted the
change but wasnt caught.

Thanks to nbjoerg for pointing this out!

llvm-svn: 258821

8 years agodon't repeat names in documentation comments; NFC
Sanjay Patel [Tue, 26 Jan 2016 17:06:13 +0000 (17:06 +0000)]
don't repeat names in documentation comments; NFC

llvm-svn: 258820

8 years agoUpdate for LLVM change
Benjamin Kramer [Tue, 26 Jan 2016 16:45:00 +0000 (16:45 +0000)]
Update for LLVM change

llvm-svn: 258819

8 years agoReflect the MC/MCDisassembler split on the include/ level.
Benjamin Kramer [Tue, 26 Jan 2016 16:44:37 +0000 (16:44 +0000)]
Reflect the MC/MCDisassembler split on the include/ level.

No functional change, just moving code around.

llvm-svn: 258818

8 years ago[OpenMP] Parsing + sema for defaultmap clause.
Arpith Chacko Jacob [Tue, 26 Jan 2016 16:37:23 +0000 (16:37 +0000)]
[OpenMP] Parsing + sema for defaultmap clause.

Summary:
This patch adds parsing + sema for the defaultmap clause associated with the target directive (among others).

Reviewers: ABataev

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

llvm-svn: 258817

8 years ago[LibCallSimplifier] fold memset(malloc(x), 0, x) --> calloc(1, x)
Sanjay Patel [Tue, 26 Jan 2016 16:17:24 +0000 (16:17 +0000)]
[LibCallSimplifier] fold memset(malloc(x), 0, x) --> calloc(1, x)

This is a step towards solving PR25892:
https://llvm.org/bugs/show_bug.cgi?id=25892

It won't handle the reported case. As noted by the 'TODO' comments in the patch,
we need to relax the hasOneUse() constraint and also match patterns that include
memset_chk() and the llvm.memset() intrinsic in addition to memset().

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

llvm-svn: 258816

8 years agoRevert "[Driver] Make sure -fno-math-builtin option is being passed by the driver."
Chad Rosier [Tue, 26 Jan 2016 16:16:53 +0000 (16:16 +0000)]
Revert "[Driver] Make sure -fno-math-builtin option is being passed by the driver."

This reverts commit r258814.

llvm-svn: 258815

8 years ago[Driver] Make sure -fno-math-builtin option is being passed by the driver.
Chad Rosier [Tue, 26 Jan 2016 15:52:05 +0000 (15:52 +0000)]
[Driver] Make sure -fno-math-builtin option is being passed by the driver.

Support for the -fno-math-builtin option was added in r186899.  The codegen side
is being tested in test/CodeGen/nomathbuiltin.c.  The missing part was just
passing the option through the driver.

PR26317

llvm-svn: 258814

8 years ago[Driver] Update FIXME comment now that PR4941 has been addressed.
Chad Rosier [Tue, 26 Jan 2016 15:46:29 +0000 (15:46 +0000)]
[Driver] Update FIXME comment now that PR4941 has been addressed.

The actual fix should be addressed by someone who can test on Darwin.

llvm-svn: 258813

8 years agoRevert "Reapply commit r258404 with fix"
Matthew Simpson [Tue, 26 Jan 2016 15:45:49 +0000 (15:45 +0000)]
Revert "Reapply commit r258404 with fix"

This commit exposes a crash in computeKnownBits on the Chromium buildbots.
Reverting to investigate.

Reference: https://llvm.org/bugs/show_bug.cgi?id=26307
llvm-svn: 258812

8 years agoRe-submit r256008 "Improve DWARFDebugFrame::parse to also handle __eh_frame."
Igor Laevsky [Tue, 26 Jan 2016 15:09:42 +0000 (15:09 +0000)]
Re-submit r256008 "Improve DWARFDebugFrame::parse to also handle __eh_frame."

Originally this change was causing failures on windows buildbots.
But those problems were fixed in r258806.

llvm-svn: 258811

8 years ago[WebAssembly] Fix a typo in a comment.
Dan Gohman [Tue, 26 Jan 2016 14:55:17 +0000 (14:55 +0000)]
[WebAssembly] Fix a typo in a comment.

llvm-svn: 258810

8 years agoUnique phi write accesses
Michael Kruse [Tue, 26 Jan 2016 13:33:27 +0000 (13:33 +0000)]
Unique phi write accesses

Ensure that there is at most one phi write access per PHINode and
ScopStmt. In particular, this would be possible for non-affine
subregions with multiple exiting blocks. We replace multiple MAY_WRITE
accesses by one MUST_WRITE access. The written value is constructed
using a PHINode of all exiting blocks. The interpretation of the PHI
WRITE's "accessed value" changed from the incoming value to the PHI like
for PHI READs since there is no unique incoming value.

Because region simplification shuffles around PHI nodes -- particularly
with exit node PHIs -- the PHINodes at analysis time does not always
exist anymore in the code generation pass. We instead remember the
incoming block/value pair in the MemoryAccess.

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

llvm-svn: 258809

8 years agoUnique value read accesses
Michael Kruse [Tue, 26 Jan 2016 13:33:15 +0000 (13:33 +0000)]
Unique value read accesses

Keep at most one value read MemoryAccess per value and statement;
multiple generated loads do not have any additional effect. As one such
MemoryAccess can cater multiple uses within the statement, the
AccessInstruction property is not unique any more and set to nullptr.

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

llvm-svn: 258808

8 years agoUnique value write accesses
Michael Kruse [Tue, 26 Jan 2016 13:33:10 +0000 (13:33 +0000)]
Unique value write accesses

Ensure there is at most one write access per definition of an
llvm::Value. Keep track of already created value write access by using
a (dense) map.

Replace addValueWriteAccess by ensureValueStore which can be uses more
liberally without worrying to add redundant accesses. It will be used,
e.g. in a logical correspondant for value reads -- ensureValueReload --
to ensure that the expected definition has been written when loading it.

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

llvm-svn: 258807

8 years ago[DebugInfo] Fix DWARFDebugFrame instruction operand ordering
Igor Laevsky [Tue, 26 Jan 2016 13:31:11 +0000 (13:31 +0000)]
[DebugInfo] Fix DWARFDebugFrame instruction operand ordering

We can't rely on the evalution order of function arguments.

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

llvm-svn: 258806

8 years ago[OPENMP 4.5] Allow arrays in 'reduction' clause.
Alexey Bataev [Tue, 26 Jan 2016 12:20:39 +0000 (12:20 +0000)]
[OPENMP 4.5] Allow arrays in 'reduction' clause.
OpenMP 4.5, alogn with array sections, allows to use variables of array type in reductions.

llvm-svn: 258804

8 years ago[FIX] Domain generation error due to loops in non-affine regions
Johannes Doerfert [Tue, 26 Jan 2016 11:03:25 +0000 (11:03 +0000)]
[FIX] Domain generation error due to loops in non-affine regions

llvm-svn: 258803

8 years ago[FIX] Build correct domain for non-affine region SCoPs
Johannes Doerfert [Tue, 26 Jan 2016 11:01:41 +0000 (11:01 +0000)]
[FIX] Build correct domain for non-affine region SCoPs

llvm-svn: 258802

8 years agoFix crashing on user-defined conversion.
Alexander Kornienko [Tue, 26 Jan 2016 10:56:27 +0000 (10:56 +0000)]
Fix crashing on user-defined conversion.

Summary: Fix the assertion failure for the user-defined conversion method. e.g.: operator bool()

Reviewers: alexfh, aaron.ballman

Subscribers: aaron.ballman, cfe-commits

Patch by Cong Liu!

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

llvm-svn: 258801

8 years ago[RenderScript] Provide option to specify a single allocation to print
Ewan Crawford [Tue, 26 Jan 2016 10:41:08 +0000 (10:41 +0000)]
[RenderScript] Provide option to specify a single allocation to print

Patch replaces the 'renderscript allocation list' command flag --refresh, with a new option --id <ID>.
This new option only prints the details of a single allocation with a given id, rather than printing all the allocations.
Functionality from the removed '--refresh' flag will be moved into its own command in a subsequent commit.

llvm-svn: 258800

8 years agoBlockGenerators: Replace getNewScalarValue with getNewValue
Tobias Grosser [Tue, 26 Jan 2016 10:01:35 +0000 (10:01 +0000)]
BlockGenerators: Replace getNewScalarValue with getNewValue

Both functions implement the same functionality, with the difference that
getNewScalarValue assumes that globals and out-of-scop scalars can be directly
reused without loading them from their corresponding stack slot. This is correct
for sequential code generation, but causes issues with outlining code e.g. for
OpenMP code generation. getNewValue handles such cases correctly.

Hence, we can replace getNewScalarValue with getNewValue. This is not only more
future proof, but also eliminates a bunch of code.

The only functionality that was available in getNewScalarValue that is lost
is the on-demand creation of scalar values. However, this is not necessary any
more as scalars are always loaded at the beginning of each basic block and will
consequently always be available when scalar stores are generated. As this was
not the case in older versions of Polly, it seems the on-demand loading is just
some older code that has not yet been removed.

Finally, generateScalarLoads also generated loads for values that are loop
invariant, available in GlobalMap and which are preferred over the ones loaded
in generateScalarLoads. Hence, we can just skip the code generation of such
scalar values, avoiding the generation of dead code.

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

llvm-svn: 258799

8 years ago[X86][SSE] Add zero element and general 64-bit VZEXT_LOAD support to EltsFromConsecut...
Simon Pilgrim [Tue, 26 Jan 2016 09:30:08 +0000 (09:30 +0000)]
[X86][SSE] Add zero element and general 64-bit VZEXT_LOAD support to EltsFromConsecutiveLoads

This patch adds support for trailing zero elements to VZEXT_LOAD loads (and checks that no zero elts occur within the consecutive load).

It also generalizes the 64-bit VZEXT_LOAD load matching to work for loads other than 2x32-bit loads.

After this patch it will also be easier to add support for other basic load patterns like 32-bit VZEXT_LOAD loads, PMOVZX and subvector load insertion.

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

llvm-svn: 258798

8 years agoFix compilations with msvc's /Zc:strictStrings
Ismail Donmez [Tue, 26 Jan 2016 08:24:57 +0000 (08:24 +0000)]
Fix compilations with msvc's /Zc:strictStrings

llvm-svn: 258797

8 years agoSimplify. NFC.
Rui Ueyama [Tue, 26 Jan 2016 07:17:29 +0000 (07:17 +0000)]
Simplify. NFC.

llvm-svn: 258796

8 years agoSimplify. NFC.
Rui Ueyama [Tue, 26 Jan 2016 07:17:27 +0000 (07:17 +0000)]
Simplify. NFC.

llvm-svn: 258795

8 years agoAMDGPU: Add amdgcn cube builtins
Matt Arsenault [Tue, 26 Jan 2016 06:37:54 +0000 (06:37 +0000)]
AMDGPU: Add amdgcn cube builtins

llvm-svn: 258794

8 years ago[X86] Mark LDS/LES as not being allowed in 64-bit mode.
Craig Topper [Tue, 26 Jan 2016 06:10:15 +0000 (06:10 +0000)]
[X86] Mark LDS/LES as not being allowed in 64-bit mode.

Their opcodes are used as part of the VEX prefix in 64-bit mode. Clearly the disassembler implicitly decoded them as AVX instructions in 64-bit mode, but I think the AsmParser would have encoded them.

llvm-svn: 258793

8 years agoSimplify. NFC.
Rui Ueyama [Tue, 26 Jan 2016 04:58:58 +0000 (04:58 +0000)]
Simplify. NFC.

This new code should be logically equivalent to the previous code.

llvm-svn: 258792

8 years agoReverting r258759 as it is breaking the OSX build
Enrico Granata [Tue, 26 Jan 2016 04:53:10 +0000 (04:53 +0000)]
Reverting r258759 as it is breaking the OSX build

llvm-svn: 258791

8 years agoAMDGPU: Move AMDGPU intrinsics only used by R600
Matt Arsenault [Tue, 26 Jan 2016 04:49:24 +0000 (04:49 +0000)]
AMDGPU: Move AMDGPU intrinsics only used by R600

llvm-svn: 258790

8 years agoAMDGPU: Tidy minor td file issues
Matt Arsenault [Tue, 26 Jan 2016 04:49:22 +0000 (04:49 +0000)]
AMDGPU: Tidy minor td file issues

Make comments and indentation more consistent.

Rearrange a few things to be in a more consistent order,
such as organizing subtarget features from those describing
an actual device property, and those used as options.

llvm-svn: 258789

8 years agoAMDGPU: Make v32i8/v64i8 illegal types
Matt Arsenault [Tue, 26 Jan 2016 04:43:48 +0000 (04:43 +0000)]
AMDGPU: Make v32i8/v64i8 illegal types

Old intrinsics were forcing these, but they have now all
been removed. This fixes large i8 vector operations generally
being broken.

llvm-svn: 258788

8 years agoAMDGPU: Remove old sample intrinsics
Matt Arsenault [Tue, 26 Jan 2016 04:38:08 +0000 (04:38 +0000)]
AMDGPU: Remove old sample intrinsics

I did my best to try to update all the uses in tests that
just happened to use the old ones to the newer intrinsics.

I'm not sure I got all of the immediate operand conversions
correct, since the value seems to have been ignored by the
old pattern but I don't think it really matters.

llvm-svn: 258787

8 years agoAMDGPU: Add new amdgcn intrinsics for cube instructions
Matt Arsenault [Tue, 26 Jan 2016 04:29:56 +0000 (04:29 +0000)]
AMDGPU: Add new amdgcn intrinsics for cube instructions

More cleanup to try to get all intrinsics using the correct
amdgcn prefix that are as close to the instruction as possible.

llvm-svn: 258786

8 years agoAMDGPU: Implement read_register and write_register intrinsics
Matt Arsenault [Tue, 26 Jan 2016 04:29:24 +0000 (04:29 +0000)]
AMDGPU: Implement read_register and write_register intrinsics

Some of the special intrinsics now that now correspond to a instruction
also have special setting of some registers, e.g. llvm.SI.sendmsg sets
m0 as well as use s_sendmsg. Using these explicit register intrinsics
may be a better option.

Reading the exec mask and others may be useful for debugging. For this
I'm not sure this is entirely correct because we would want this to
be convergent, although it's possible this is already treated
sufficently conservatively.

llvm-svn: 258785

8 years agoAMDGPU: Note mesa version in release notes
Matt Arsenault [Tue, 26 Jan 2016 04:29:15 +0000 (04:29 +0000)]
AMDGPU: Note mesa version in release notes

llvm-svn: 258784

8 years agoAMDGPU: Restore AMDGPU prefixed rsq intrinsic for now
Matt Arsenault [Tue, 26 Jan 2016 04:14:16 +0000 (04:14 +0000)]
AMDGPU: Restore AMDGPU prefixed rsq intrinsic for now

Also move into backend intrinsics to discourage use of the old name.

llvm-svn: 258783

8 years agoRecommit: R258773 [OpenCL] Pipe builtin functions
Xiuli Pan [Tue, 26 Jan 2016 04:03:48 +0000 (04:03 +0000)]
Recommit: R258773 [OpenCL] Pipe builtin functions
Fix arc patch fuzz error.
Summary:
Support for the pipe built-in functions for OpenCL 2.0.
The pipe builtin functions may have infinite kinds of element types, one approach
would be to just generate calls that would always use generic types such as void*.
This patch is based on bader's opencl support patch on SPIR-V branch.

Reviewers: Anastasia, pekka.jaaskelainen

Subscribers: keryell, bader, cfe-commits

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

llvm-svn: 258782

8 years ago[WebAssembly] Optimize memcpy/memmove/memcpy calls.
Dan Gohman [Tue, 26 Jan 2016 04:01:11 +0000 (04:01 +0000)]
[WebAssembly] Optimize memcpy/memmove/memcpy calls.

These calls return their first argument, but because LLVM uses an intrinsic
with a void return type, they can't use the returned attribute. Generalize
the store results pass to optimize these calls too.

llvm-svn: 258781

8 years ago[WebAssembly] Remove a completed entry from the README.txt.
Dan Gohman [Tue, 26 Jan 2016 03:43:48 +0000 (03:43 +0000)]
[WebAssembly] Remove a completed entry from the README.txt.

llvm-svn: 258780

8 years ago[WebAssembly] Implement unaligned loads and stores.
Dan Gohman [Tue, 26 Jan 2016 03:39:31 +0000 (03:39 +0000)]
[WebAssembly] Implement unaligned loads and stores.

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

llvm-svn: 258779

8 years agoFix -Wnull-conversion for long macros.
Richard Trieu [Tue, 26 Jan 2016 02:51:55 +0000 (02:51 +0000)]
Fix -Wnull-conversion for long macros.

Move the function to get a macro name from DiagnosticRenderer.cpp to Lexer.cpp
so that other files can use it.  Lexer now has two functions to get the
immediate macro name, the newly added one is better for diagnostic purposes.
Make -Wnull-conversion use this function for better NULL macro detection.

llvm-svn: 258778

8 years ago[LIR] Add support for structs and hand unrolled loops
Haicheng Wu [Tue, 26 Jan 2016 02:27:47 +0000 (02:27 +0000)]
[LIR] Add support for structs and hand unrolled loops

This is a recommit of r258620 which causes PR26293.

The original message:

Now LIR can turn following codes into memset:

typedef struct foo {
  int a;
  int b;
} foo_t;

void bar(foo_t *f, unsigned n) {
  for (unsigned i = 0; i < n; ++i) {
    f[i].a = 0;
    f[i].b = 0;
  }
}

void test(foo_t *f, unsigned n) {
  for (unsigned i = 0; i < n; i += 2) {
    f[i] = 0;
    f[i+1] = 0;
  }
}

llvm-svn: 258777

8 years agoRecommit the test for r258720 using -###
Ehsan Akhgari [Tue, 26 Jan 2016 02:23:05 +0000 (02:23 +0000)]
Recommit the test for r258720 using -###

llvm-svn: 258776

8 years agoRevert "[OpenCL] Pipe builtin functions"
David Majnemer [Tue, 26 Jan 2016 02:22:31 +0000 (02:22 +0000)]
Revert "[OpenCL] Pipe builtin functions"

This reverts commit r258773, it broke the build bots:
http://bb.pgr.jp/builders/cmake-clang-x86_64-linux/builds/43853

llvm-svn: 258775

8 years agoUse binary search for intrinsic ID lookups
Reid Kleckner [Tue, 26 Jan 2016 02:06:41 +0000 (02:06 +0000)]
Use binary search for intrinsic ID lookups

This improves compile time of Function.cpp from 57s to 37s for me
locally.  Intrinsic IDs are cached on the Function object, so this
shouldn't regress performance.

llvm-svn: 258774

8 years ago[OpenCL] Pipe builtin functions
Xiuli Pan [Tue, 26 Jan 2016 02:06:04 +0000 (02:06 +0000)]
[OpenCL] Pipe builtin functions

Summary:
Support for the pipe built-in functions for OpenCL 2.0.
The pipe builtin functions may have infinite kinds of element types, one approach
would be to just generate calls that would always use generic types such as void*.
This patch is based on bader's opencl support patch on SPIR-V branch.

Reviewers: Anastasia, pekka.jaaskelainen

Subscribers: keryell, bader, cfe-commits

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

llvm-svn: 258773

8 years agoRevert the test for r258720 temporarily
Ehsan Akhgari [Tue, 26 Jan 2016 01:51:47 +0000 (01:51 +0000)]
Revert the test for r258720 temporarily

This test is failing on a bot for reasons that are unclear to me.
Reverting for now...

llvm-svn: 258772

8 years agoLiveIntervalAnalysis: Improve some comments
Matthias Braun [Tue, 26 Jan 2016 01:40:48 +0000 (01:40 +0000)]
LiveIntervalAnalysis: Improve some comments

As recommended by Justin.

llvm-svn: 258771

8 years ago[Sema] Remove stray semicolons.
David Majnemer [Tue, 26 Jan 2016 01:39:17 +0000 (01:39 +0000)]
[Sema] Remove stray semicolons.

No functional change is intended.

llvm-svn: 258769

8 years ago[Sema] Incomplete types are OK for covariant returns
David Majnemer [Tue, 26 Jan 2016 01:37:01 +0000 (01:37 +0000)]
[Sema] Incomplete types are OK for covariant returns

Per C++14 [class.virtual]p8, it is OK for the return type's class type
to be incomplete so long as the return type is the same between the base
and complete classes.

This fixes PR26297.

llvm-svn: 258768

8 years agoAdd missing template instantiations.
Rui Ueyama [Tue, 26 Jan 2016 01:32:00 +0000 (01:32 +0000)]
Add missing template instantiations.

llvm-svn: 258767

8 years agoFix MSVC build.
Rafael Espindola [Tue, 26 Jan 2016 01:30:07 +0000 (01:30 +0000)]
Fix MSVC build.

llvm-svn: 258766

8 years agoFix TestRerun.py on Windows.
Zachary Turner [Tue, 26 Jan 2016 01:19:50 +0000 (01:19 +0000)]
Fix TestRerun.py on Windows.

This is another example of a test that was looking for the thread
at index 0 instead of requesting the thread that was stopped at
the created breakpoint.  This assumption isn't true on Windows 10.

llvm-svn: 258764

8 years agoFix the lldbinline tests so they make well-formed Makefiles.
Sean Callanan [Tue, 26 Jan 2016 01:15:57 +0000 (01:15 +0000)]
Fix the lldbinline tests so they make well-formed Makefiles.

lldbinline tests previously did not run correctly unless there was already a
Makefile for them.  This was because the syntax of the emitted Makefile made the
default make rule be the "cleanup" rule, which is pretty unhelpful.  Now the
default rule is the one included from Makefile.rules, which is much better.

llvm-svn: 258763

8 years ago[MS Compat] Don't crash if __GetExceptionInfo is in global scope
David Majnemer [Tue, 26 Jan 2016 01:12:17 +0000 (01:12 +0000)]
[MS Compat] Don't crash if __GetExceptionInfo is in global scope

__GetExceptionInfo triggered Sema::LazilyCreateBuiltin which tries to
create a non-templated function decl.  This is unnecessary and
ill-advised, there is no need for us to create a declaration for such a
builtin.

This fixes PR26298.

llvm-svn: 258762

8 years agoRemove XFAIL Windows from a test that was fixed by r258758.
Zachary Turner [Tue, 26 Jan 2016 01:09:38 +0000 (01:09 +0000)]
Remove XFAIL Windows from a test that was fixed by r258758.

llvm-svn: 258761

8 years agoMove code to create RELATIVE reloc for TLS_IE to one place.
Rui Ueyama [Tue, 26 Jan 2016 01:03:21 +0000 (01:03 +0000)]
Move code to create RELATIVE reloc for TLS_IE to one place.

llvm-svn: 258760

8 years agoWrite the session log file in UTF-8.
Zachary Turner [Tue, 26 Jan 2016 00:59:42 +0000 (00:59 +0000)]
Write the session log file in UTF-8.

Previously we were writing in the default encoding, which depends
on the operating system and is not guaranteed to be unicode aware.
On Python 3, this would lead to a situation where writing unicode
text to the log file generates an exception.  The fix here is to
write session logs using the proper encoding, which incidentally
fixes another test, so xfail is removed from that.

llvm-svn: 258759

8 years agoSet symbol types for function symbols loaded from PE/COFF
Adrian McCarthy [Tue, 26 Jan 2016 00:58:09 +0000 (00:58 +0000)]
Set symbol types for function symbols loaded from PE/COFF

This fixes the regression of several tests on Windows after rL258621.

The root problem is that ObjectFilePECOFF was not setting type information for the symbols, and the new CL rejects symbols without type information, breaking functionality like thread step-over.

The fix sets the type information for functions (and creates a TODO for other types).

Along the way, I fixed some typos and formatting that made the code I was debugging harder to understand.

In the long run, we should consider replacing most of ObjectFilePECOFF with the COFF parsing code from LLVM.

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

llvm-svn: 258758

8 years agoSort intrinsics by LLVM intrinsic name, rather than tablegen def name
Reid Kleckner [Tue, 26 Jan 2016 00:55:00 +0000 (00:55 +0000)]
Sort intrinsics by LLVM intrinsic name, rather than tablegen def name

Step one towards using a simple binary search to lookup intrinsic IDs
instead of our crazy table generated switch+memcmp+startswith code that
makes Function.cpp take about a minute to compile.  See PR24785 and
PR11951 for why we should do this.

The X86 backend contains tables that need to be sorted on intrinsic ID,
so reorder those.

llvm-svn: 258757

8 years agoLiveIntervalAnalysis: Cleanup handleMove{Down|Up}() functions, NFC
Matthias Braun [Tue, 26 Jan 2016 00:43:50 +0000 (00:43 +0000)]
LiveIntervalAnalysis: Cleanup handleMove{Down|Up}() functions, NFC

These two functions are hard to reason about. This commit makes the code
more comprehensible:

- Use four distinct variables (OldIdxIn, OldIdxOut, NewIdxIn, NewIdxOut)
  with a fixed value instead of a changing iterator I that points to
  different things during the function.
- Remove the early explanation before the function in favor of more
  detailed comments inside the function. Should have more/clearer comments now
  stating which conditions are tested and which invariants hold at
  different points in the functions.

The behaviour of the code was not changed.

I hope that this will make it easier to review the changes in
http://reviews.llvm.org/D9067 which I will adapt next.

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

llvm-svn: 258756

8 years agoFollowup to 258750; update more tests to use .p2align .
Dan Gohman [Tue, 26 Jan 2016 00:35:07 +0000 (00:35 +0000)]
Followup to 258750; update more tests to use .p2align .

llvm-svn: 258755

8 years agoFollowup to 258750; update all MC tests to use .p2align .
Dan Gohman [Tue, 26 Jan 2016 00:27:59 +0000 (00:27 +0000)]
Followup to 258750; update all MC tests to use .p2align .

llvm-svn: 258754