platform/upstream/llvm.git
9 years agoDebugInfo: Use MDType in DITypeIdentifierMap
Duncan P. N. Exon Smith [Tue, 21 Apr 2015 19:17:20 +0000 (19:17 +0000)]
DebugInfo: Use MDType in DITypeIdentifierMap

Use `MDType*` instead of `MDNode*` in `DITypeIdentifierMap`, since all
the members should be types.

llvm-svn: 235407

9 years agoMove IDF Calculation to a separate file, expose an interface to it.
Daniel Berlin [Tue, 21 Apr 2015 19:13:02 +0000 (19:13 +0000)]
Move IDF Calculation to a separate file, expose an interface to it.

Summary:
MemorySSA uses this algorithm as well, and this enables us to reuse the code in both places.

There are no actual algorithm or datastructure changes in here, just code movement.

Reviewers: qcolombet, chandlerc

Subscribers: llvm-commits

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

llvm-svn: 235406

9 years agoDebugInfo: Prune unnecessary forward declarations
Duncan P. N. Exon Smith [Tue, 21 Apr 2015 19:00:26 +0000 (19:00 +0000)]
DebugInfo: Prune unnecessary forward declarations

Probably these forward declarations were once useful, but they certainly
don't belong here now.

llvm-svn: 235405

9 years agoDebugInfo: Drop rest of DIDescriptor subclasses
Duncan P. N. Exon Smith [Tue, 21 Apr 2015 18:44:06 +0000 (18:44 +0000)]
DebugInfo: Drop rest of DIDescriptor subclasses

Delete the remaining subclasses of (the already deleted) `DIDescriptor`.
Part of PR23080.

llvm-svn: 235404

9 years agoDebugInfo: Prepare for deletion of DIDescriptor subclasses
Duncan P. N. Exon Smith [Tue, 21 Apr 2015 18:43:54 +0000 (18:43 +0000)]
DebugInfo: Prepare for deletion of DIDescriptor subclasses

An upcoming LLVM commit will delete all the remaining subclasses of (the
already deleted) `DIDescriptor`.  Stop using them.

llvm-svn: 235403

9 years agoRecommend to use CMake on the Clang Getting Started page.
Alexey Samsonov [Tue, 21 Apr 2015 18:38:31 +0000 (18:38 +0000)]
Recommend to use CMake on the Clang Getting Started page.

llvm-svn: 235402

9 years agoRevert r235398 "[cuda] Added support for CUDA built-in variables."
Artem Belevich [Tue, 21 Apr 2015 18:36:42 +0000 (18:36 +0000)]
Revert r235398 "[cuda] Added support for CUDA built-in variables."

r235398 was causing buildbot break due to missing Makefile changes.

llvm-svn: 235401

9 years agoDebugInfo: Assert dbg.declare/value insts are valid
Duncan P. N. Exon Smith [Tue, 21 Apr 2015 18:24:23 +0000 (18:24 +0000)]
DebugInfo: Assert dbg.declare/value insts are valid

Remove early returns for when `getVariable()` is null, and just assert
that it never happens.  The Verifier already confirms that there's a
valid variable on these intrinsics, so we should assume the debug info
isn't broken.  I also updated a check for a `!dbg` attachment, which the
Verifier similarly guarantees.

llvm-svn: 235400

9 years agoRe-land r235154-r235156 under the existing -sehprepare flag
Reid Kleckner [Tue, 21 Apr 2015 18:23:57 +0000 (18:23 +0000)]
Re-land r235154-r235156 under the existing -sehprepare flag

Keep the old SEH fan-in lowering on by default for now, since projects
rely on it.  This will make it easy to test this change with a simple
flag flip.

llvm-svn: 235399

9 years ago[cuda] Added support for CUDA built-in variables.
Artem Belevich [Tue, 21 Apr 2015 17:39:06 +0000 (17:39 +0000)]
[cuda] Added support for CUDA built-in variables.

Added cuda_builtin_vars.h which implements built-in CUDA variables
using __declattr(property).

Fields of built-in variables (except for warpSize) are implemented
using __declattr(property) which replaces read/write of a member field
with a call to a getter/setter member function, in this case with
appropriate NVPTX builtin.

Added a test case to check diagnostics on attempt to construct or
improperly access a built-in variable.

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

llvm-svn: 235398

9 years agoImplement target-specific __attribute__((aligned)) value
Ulrich Weigand [Tue, 21 Apr 2015 17:29:35 +0000 (17:29 +0000)]
Implement target-specific __attribute__((aligned)) value

The GCC construct __attribute__((aligned)) is defined to set alignment
to "the default alignment for the target architecture" according to
the GCC documentation:

  The default alignment is sufficient for all scalar types, but may not be
  enough for all vector types on a target that supports vector operations.
  The default alignment is fixed for a particular target ABI.

clang currently hard-coded an alignment of 16 bytes for that construct,
which is correct on some platforms (including X86), but wrong on others
(including SystemZ).  Since this value is ABI-relevant, it is important
to get correct for compatibility purposes.

This patch adds a new TargetInfo member "DefaultAlignForAttributeAligned"
that targets can set to the appropriate default __attribute__((aligned))
value.

Note that I'm deliberately *not* using the existing "SuitableAlign"
value, which is used to set the pre-defined macro __BIGGEST_ALIGNMENT__,
since those two values may not be the same on all platforms.  In fact,
on X86, __attribute__((aligned)) always uses 16-byte alignment, while
__BIGGEST_ALIGNMENT__ may be larger if AVX-2 or AVX-512 are supported.
(This is actually not yet correctly implemented in clang either.)

The patch provides a value for DefaultAlignForAttributeAligned only for
SystemZ, and leaves the default for all other targets at 16, which means
no visible change in behavior on all other targets.  (The value is still
wrong for some other targets, but I'd prefer to leave it to the target
maintainers for those platforms to fix.)

llvm-svn: 235397

9 years agoProvide alignment info on LLVM external symbols
Ulrich Weigand [Tue, 21 Apr 2015 17:27:59 +0000 (17:27 +0000)]
Provide alignment info on LLVM external symbols

Code in CodeGenModule::GetOrCreateLLVMGlobal that sets up GlobalValue
object for LLVM external symbols has this comment:

    // FIXME: This code is overly simple and should be merged with other global
    // handling.

One part does seems to be "overly simple" currently is that this code
never sets any alignment info on the GlobalValue, so that the emitted
IR does not have any align attribute on external globals.  This can
lead to unnecessarily inefficient code generation.

This patch adds a GV->setAlignment call to set alignment info.

llvm-svn: 235396

9 years agoFix __alignof__ of global variables on SystemZ
Ulrich Weigand [Tue, 21 Apr 2015 17:26:18 +0000 (17:26 +0000)]
Fix __alignof__ of global variables on SystemZ

SystemZ prefers to align all global variables to two bytes, which is
implemented by setting the TargetInfo member MinGlobalAlign.

However, for compatibility with existing compilers this should *not*
change the ABI alignment value as retrieved via __alignof__, which
it currently does.

This patch fixes the issue by having ASTContext::getDeclAlign ignore
the MinGlobalAlign setting in the ForAlignof case.

Since SystemZ is the only platform setting MinGlobalAlign, this should
cause no change for any other target.

llvm-svn: 235395

9 years agoX86: Match for X86ISD nodes in LowerBUILD_VECTOR instead of BUILD_VECTORCombine
Matthias Braun [Tue, 21 Apr 2015 17:21:36 +0000 (17:21 +0000)]
X86: Match for X86ISD nodes in LowerBUILD_VECTOR instead of BUILD_VECTORCombine

There doesn't seem to be a reason to perform this target ISD node matching
in an DAGCombine, moving it to lowering fixes PR23296.

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

llvm-svn: 235394

9 years ago[ELF] Change return type of the OutputSection::flags() method
Simon Atanasyan [Tue, 21 Apr 2015 17:02:49 +0000 (17:02 +0000)]
[ELF] Change return type of the OutputSection::flags() method

This method returns _flags field which has `uint64_t` type. Now the
field's type and the method's return type are consistent.

llvm-svn: 235393

9 years ago[ELF] Narrow down the type of OutputSection::_sections container
Simon Atanasyan [Tue, 21 Apr 2015 17:02:42 +0000 (17:02 +0000)]
[ELF] Narrow down the type of OutputSection::_sections container

The `OutputSection::appendSection()` method always gets a pointer
to the `Section` class descendants. So it is not necessary to keep them
in the vector of `Chunk` pointers.

No functional changes.

llvm-svn: 235392

9 years ago[Mips] Write .reginfo section into the separate PT_MIPS_REGINFO segment
Simon Atanasyan [Tue, 21 Apr 2015 17:02:35 +0000 (17:02 +0000)]
[Mips] Write .reginfo section into the separate PT_MIPS_REGINFO segment

llvm-svn: 235391

9 years ago[ELF] Simplify class memeber function declaration
Simon Atanasyan [Tue, 21 Apr 2015 17:02:27 +0000 (17:02 +0000)]
[ELF] Simplify class memeber function declaration

No functional changes.

llvm-svn: 235390

9 years agoMinor edits to the llvm-cov documentation.
Bob Wilson [Tue, 21 Apr 2015 16:32:02 +0000 (16:32 +0000)]
Minor edits to the llvm-cov documentation.

This just changes a few places to use a slightly more formal style.

llvm-svn: 235389

9 years agoPlacate clang. lldb can build on FreeBSD with -Werror again.
Davide Italiano [Tue, 21 Apr 2015 16:06:17 +0000 (16:06 +0000)]
Placate clang. lldb can build on FreeBSD with -Werror again.

llvm-svn: 235387

9 years agos/NULL/nullptr/ in OrcTestCommon.h to silence -Wsentinel in clang-cl
Reid Kleckner [Tue, 21 Apr 2015 15:56:21 +0000 (15:56 +0000)]
s/NULL/nullptr/ in OrcTestCommon.h to silence -Wsentinel in clang-cl

llvm-svn: 235386

9 years agoAVX-512: Added VPMOVx2M instructions for SKX,
Elena Demikhovsky [Tue, 21 Apr 2015 14:38:31 +0000 (14:38 +0000)]
AVX-512: Added VPMOVx2M instructions for SKX,
fixed encoding of VPMOVM2x.

llvm-svn: 235385

9 years agoRemove target triples from test cases
Tobias Grosser [Tue, 21 Apr 2015 14:28:02 +0000 (14:28 +0000)]
Remove target triples from test cases

I just learned that target triples prevent test cases to be run on other
architectures. Polly test cases are until now sufficiently target independent
to not require any target triples. Hence, we drop them.

llvm-svn: 235384

9 years agoAVX-512: Added VPTESTM and VPTESTNM instructions for SKX
Elena Demikhovsky [Tue, 21 Apr 2015 13:13:46 +0000 (13:13 +0000)]
AVX-512: Added VPTESTM and VPTESTNM instructions for SKX

llvm-svn: 235383

9 years ago[mips] [IAS] Implement the .asciiz directive.
Toma Tabacu [Tue, 21 Apr 2015 11:50:52 +0000 (11:50 +0000)]
[mips] [IAS] Implement the .asciiz directive.

Summary:
This directive is exactly the same as .asciz, except it's only used by MIPS.
It is used to store null terminated strings in object files.

Reviewers: rafael, dsanders, echristo

Reviewed By: dsanders, echristo

Subscribers: echristo, llvm-commits

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

llvm-svn: 235382

9 years agoFix some formatting issues
Tobias Grosser [Tue, 21 Apr 2015 11:42:01 +0000 (11:42 +0000)]
Fix some formatting issues

llvm-svn: 235381

9 years agoRename 'scattering' to 'schedule'
Tobias Grosser [Tue, 21 Apr 2015 11:37:25 +0000 (11:37 +0000)]
Rename 'scattering' to 'schedule'

In Polly we used both the term 'scattering' and the term 'schedule' to describe
the execution order of a statement without actually distinguishing between them.
We now uniformly use the term 'schedule' for the execution order.  This
corresponds to the terminology of isl.

History: CLooG introduced the term scattering as the generated code can be used
as a sequential execution order (schedule) or as a parallel dimension
enumerating different threads of execution (placement). In Polly and/or isl the
term placement was never used, but we uniformly refer to an execution order as a
schedule and only later introduce parallelism. When doing so we do not talk
about about specific placement dimensions.

llvm-svn: 235380

9 years ago[mips][microMIPSr6] Implement CACHE and PREF instructions
Jozef Kolek [Tue, 21 Apr 2015 11:17:25 +0000 (11:17 +0000)]
[mips][microMIPSr6] Implement CACHE and PREF instructions

Implement CACHE and PREF instructions using mapping.

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

llvm-svn: 235379

9 years agoPass an actual schedule to the isl_union_access [NFC]
Tobias Grosser [Tue, 21 Apr 2015 11:01:34 +0000 (11:01 +0000)]
Pass an actual schedule to the isl_union_access [NFC]

This change is a step towards using a single isl_schedule object throughout
Polly. At the moment the schedule is just constructed from the flat
isl_union_map that defines the schedule. Later we will obtain it directly
from the scop and potentially obtain a schedule with a non-trivial internal
structure that will allow faster dependence analysis.

llvm-svn: 235378

9 years ago[mips] Cleanup old floating-point flag conditions definitions. NFC.
Vasileios Kalintiris [Tue, 21 Apr 2015 10:53:57 +0000 (10:53 +0000)]
[mips] Cleanup old floating-point flag conditions definitions. NFC.

Reviewers: dsanders

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

llvm-svn: 235377

9 years ago[mips] Optimize code generation for 64-bit variable shift instructions.
Vasileios Kalintiris [Tue, 21 Apr 2015 10:49:03 +0000 (10:49 +0000)]
[mips] Optimize code generation for 64-bit variable shift instructions.

Summary:
The 64-bit version of the variable shift instructions uses the
shift_rotate_reg class which uses a GPR32Opnd to specify the variable
shift amount. With this patch we avoid the generation of a redundant
SLL instruction for the variable shift instructions in 64-bit targets.

Reviewers: dsanders

Subscribers: llvm-commits

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

llvm-svn: 235376

9 years agoAVX-512: Added logical and arithmetic instructions for SKX
Elena Demikhovsky [Tue, 21 Apr 2015 10:27:40 +0000 (10:27 +0000)]
AVX-512: Added logical and arithmetic instructions for SKX
by Asaf Badouh (asaf.badouh@intel.com)

llvm-svn: 235375

9 years agoDrop unneccessary -basicaa passes in DependenceInfo test cases
Tobias Grosser [Tue, 21 Apr 2015 09:17:52 +0000 (09:17 +0000)]
Drop unneccessary -basicaa passes in DependenceInfo test cases

llvm-svn: 235374

9 years agoMove to isl's new dependence analysis interface [NFC]
Tobias Grosser [Tue, 21 Apr 2015 08:47:29 +0000 (08:47 +0000)]
Move to isl's new dependence analysis interface [NFC]

isl_union_map_compute_flow() has been replaced by
isl_union_access_info_compute_flow(). This change does not intend to
change funcitonality, yet. However, it will allow us to pass in subsequent
changes schedule trees to the dependence analysis instead of flat schedules.
This should speed up dependence analysis for important cases significantly.

llvm-svn: 235373

9 years ago[X86][SSE] Provide execution domains for scalar floating point operations
Simon Pilgrim [Tue, 21 Apr 2015 08:40:22 +0000 (08:40 +0000)]
[X86][SSE] Provide execution domains for scalar floating point operations

This is an updated version of Chandler's patch D7402 that got accepted but never committed, and has bit-rotted a bit since.

I've updated the execution domain declarations to match the approach of the packed templates and also added some extra scalar unary tests.

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

llvm-svn: 235372

9 years agoCONCAT_VECTOR of BUILD_VECTOR - minor fix
Simon Pilgrim [Tue, 21 Apr 2015 08:05:43 +0000 (08:05 +0000)]
CONCAT_VECTOR of BUILD_VECTOR - minor fix

Fixed issue with the combine of CONCAT_VECTOR of 2 BUILD_VECTOR nodes - the optimisation wasn't ensuring that the scalar operands of both nodes were the same type/size for implicit truncation.

Test case spotted by Patrik Hagglund

llvm-svn: 235371

9 years agoFix generic shift expansion when shift amount is 0
Pawel Bylica [Tue, 21 Apr 2015 06:28:36 +0000 (06:28 +0000)]
Fix generic shift expansion when shift amount is 0

Summary:
This fixes http://llvm.org/bugs/show_bug.cgi?id=16439.

This is one possible way to approach this. The other would be to split InL>>(nbits-Amt) into (InL>>(nbits-1-Amt))>>1, which is also valid since since we only need to care about Amt up nbits-1. It's hard to tell which one is better since the shift might be expensive if this stage of expansion is not yet a legal machine integer, whereas comparisons with zero are relatively cheap at all sizes, but more expensive than a shift if the shift is on a legal machine type.

Patch by Keno Fischer!

Test Plan: regression test from http://reviews.llvm.org/D7752

Reviewers: chfast, resistor

Reviewed By: chfast, resistor

Subscribers: sanjoy, resistor, chfast, llvm-commits

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

llvm-svn: 235370

9 years agoEnhanced vim support.
Matthias Braun [Tue, 21 Apr 2015 01:35:42 +0000 (01:35 +0000)]
Enhanced vim support.

This brings the utils/vim folder into a more vim-like format by moving
the syntax hightlighting files into a syntax subdirectory. It adds
some minimal settings that everyone should agree on to ftdetect/ftplugin and
features a new indentation plugin for .ll files.

llvm-svn: 235369

9 years agoXFAIL tests that are failed on linux with gcc-4.9.2
Ying Chen [Tue, 21 Apr 2015 01:15:47 +0000 (01:15 +0000)]
XFAIL tests that are failed on linux with gcc-4.9.2

Summary:
- add decorator functions to xfail and skip test on specific os, architecture and version of comipler
- xfail failing test with gcc-4.9.2 on linux
- add one usage of skipIf function

Test Plan:
Run tests with different archs, and version of compilers to verify decorator function working as expected
Run tests with gcc-4.9.2 and no failure reported

Reviewers: sivachandra, ovyalov, vharron, chaoren

Subscribers: lldb-commits

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

llvm-svn: 235368

9 years agoX86: Do not select X86 custom vector nodes if operand types don't match
Matthias Braun [Tue, 21 Apr 2015 01:13:41 +0000 (01:13 +0000)]
X86: Do not select X86 custom vector nodes if operand types don't match

X86ISD::ADDSUB, X86ISD::(F)HADD, X86ISD::(F)HSUB should not be selected
if the operand types do not match the result type because vector type
legalization cannot deal with this for custom nodes.

Testcase X86ISD::ADDSUB is attached. I could not create a testcase for
the FHADD/FHSUB cases because of: https://llvm.org/bugs/show_bug.cgi?id=23296

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

llvm-svn: 235367

9 years agoTighten bundling section alignment test.
Derek Schuff [Tue, 21 Apr 2015 00:17:59 +0000 (00:17 +0000)]
Tighten bundling section alignment test.

Leftover comment from http://reviews.llvm.org/D9131

llvm-svn: 235366

9 years ago[MC] When using bundle aligment, align sections to bundle size
Derek Schuff [Tue, 21 Apr 2015 00:14:25 +0000 (00:14 +0000)]
[MC] When using bundle aligment, align sections to bundle size

Summary:
Bundle aligment requires that the functions always start at an aligned address.
Usually this is ensured by the compiler, but assembly code does not always
begin with a .align directive.

This change ensures that sections get the correct alignment if they contain
any instructions and bundling is enabled. (It also makes LLVM match the
behavior of GNU as).

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

llvm-svn: 235365

9 years agoInstCombine: fold (sitofp (zext x)) to (uitofp x)
Fiona Glaser [Tue, 21 Apr 2015 00:05:41 +0000 (00:05 +0000)]
InstCombine: fold (sitofp (zext x)) to (uitofp x)

This is okay because the zext guarantees the high bit is zero,
and so the value is unsigned.

llvm-svn: 235364

9 years agoFix flakiness in fp16-promote.ll
Pirama Arumuga Nainar [Mon, 20 Apr 2015 23:54:41 +0000 (23:54 +0000)]
Fix flakiness in fp16-promote.ll

Summary:
In the f16-promote test, make the checks for native conversion instructions
similar to the libcall checks:
- Remove hard coded register names
- Do not check exact instruction sequences.

This fixes test flakiness due to non-determinism in instruction
scheduling and register allocation.  I also fixed a few minor things in
the CHECK-LIBCALL checks.

I'll try to find a way to check that unnecessary loads, stores, or
conversions don't happen.

Reviewers: mzolotukhin, srhines, ab

Subscribers: llvm-commits

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

llvm-svn: 235363

9 years agobugpoint Enhancement.
JF Bastien [Mon, 20 Apr 2015 23:42:22 +0000 (23:42 +0000)]
bugpoint Enhancement.

Summary:
This patch adds two flags to `bugpoint`: "-replace-funcs-with-null" and "-disable-pass-list-reduction".

When "-replace-funcs-with-null" is specified, bugpoint will, instead of simply deleting function bodies, replace all uses of functions and then will delete functions completely from the test module, correctly handling aliasing and @llvm.used && @llvm.compiler.used. This part was conceived while trying to debug the PNaCl IR simplification passes, which don't allow undefined functions (ie no declarations).

With "-disable-pass-list-reduction", bugpoint won't try to reduce the set of passes causing the "crash". This is needed in cases where one is trying to debug an issue inside the PNaCl IR simplification passes which is causing an PNaCl ABI verification error, for example.

Reviewers: jfb

Reviewed By: jfb

Subscribers: jfb, llvm-commits

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

llvm-svn: 235362

9 years agouse update_llc_test_checks.py to tighten checking
Sanjay Patel [Mon, 20 Apr 2015 23:31:53 +0000 (23:31 +0000)]
use update_llc_test_checks.py to tighten checking

Also, replace win and linux runs with a generic run because that
makes no difference in what this test is checking.

llvm-svn: 235361

9 years agoAdd myself as the Constant Folder owner.
David Majnemer [Mon, 20 Apr 2015 23:19:10 +0000 (23:19 +0000)]
Add myself as the Constant Folder owner.

llvm-svn: 235360

9 years ago--discard-locals should be --discard-all here.
Davide Italiano [Mon, 20 Apr 2015 22:54:50 +0000 (22:54 +0000)]
--discard-locals should be --discard-all here.

Sorry for the mistake/confusion.

llvm-svn: 235359

9 years ago[WinEH] Fix problem with landing pad return values used in PHI nodes during outlining.
Andrew Kaylor [Mon, 20 Apr 2015 22:53:42 +0000 (22:53 +0000)]
[WinEH] Fix problem with landing pad return values used in PHI nodes during outlining.

llvm-svn: 235358

9 years ago[GNU/ELF] Add support for -X/--discard-locals.
Davide Italiano [Mon, 20 Apr 2015 22:52:56 +0000 (22:52 +0000)]
[GNU/ELF] Add support for -X/--discard-locals.

There's (almost) never need to keep .L symbols around for production
builds. In fact, the FreeBSD kernel explicitly specify -X beacuse the
size impact (and the subsequent performance impact) might be significant,
because we keep symbols in memory.
I was tempted to make this the default, but I haven't (yet).

PR: 23232
llvm-svn: 235357

9 years agoDebugInfo: Delete subclasses of DIScope
Duncan P. N. Exon Smith [Mon, 20 Apr 2015 22:10:08 +0000 (22:10 +0000)]
DebugInfo: Delete subclasses of DIScope

Delete subclasses of (the already defunct) `DIScope`, updating users to
use the raw pointers from the `Metadata` hierarchy directly.

llvm-svn: 235356

9 years agoDebugInfo: Prepare for deletion of subclasses of DIScope
Duncan P. N. Exon Smith [Mon, 20 Apr 2015 22:09:57 +0000 (22:09 +0000)]
DebugInfo: Prepare for deletion of subclasses of DIScope

Prepare for the deletion in LLVM of the subclasses of (the already
deleted) `DIScope` by using the raw pointers they were wrapping
directly.

llvm-svn: 235355

9 years ago[WinEH] Fix problem with mapping shared empty handler blocks.
Andrew Kaylor [Mon, 20 Apr 2015 22:04:09 +0000 (22:04 +0000)]
[WinEH] Fix problem with mapping shared empty handler blocks.

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

llvm-svn: 235354

9 years agoDebugInfo: Fix Kaleidoscope Ch. 8 after r235327
Duncan P. N. Exon Smith [Mon, 20 Apr 2015 21:29:44 +0000 (21:29 +0000)]
DebugInfo: Fix Kaleidoscope Ch. 8 after r235327

Pretty sure the build was broken by r235327 (I updated it there, but
apparently didn't check if it compiled).

llvm-svn: 235353

9 years agoDebugInfo: Delete old subclasses of DIType
Duncan P. N. Exon Smith [Mon, 20 Apr 2015 21:17:32 +0000 (21:17 +0000)]
DebugInfo: Delete old subclasses of DIType

Delete subclasses of (the already deleted) `DIType` in favour of
directly using pointers from the `Metadata` hierarchy.

While `DICompositeType` wraps `MDCompositeTypeBase` and `DIDerivedType`
wraps `MDDerivedTypeBase`, most uses of each really meant the more
specific `MDCompositeType` and `MDDerivedType`.

llvm-svn: 235351

9 years agoDebugInfo: Prepare for deletion of subclasses of DIType
Duncan P. N. Exon Smith [Mon, 20 Apr 2015 21:17:26 +0000 (21:17 +0000)]
DebugInfo: Prepare for deletion of subclasses of DIType

Subclasses of (the already deleted) `DIType` will be deleted by an
upcoming LLVM commit.  Remove references.

While `DICompositeType` wraps `MDCompositeTypeBase` and `DIDerivedType`
wraps `MDDerivedTypeBase`, most uses of each really meant the more
specific `MDCompositeType` and `MDDerivedType`.  I updated accordingly.

llvm-svn: 235350

9 years agoDwarfUnit: Split MDSubroutineType version of constructTypeDIE()
Duncan P. N. Exon Smith [Mon, 20 Apr 2015 21:04:33 +0000 (21:04 +0000)]
DwarfUnit: Split MDSubroutineType version of constructTypeDIE()

The version of `constructTypeDIE()` for `MDSubroutineType` is unrelated
to (and has different callers than) the `MDCompositeType`.  Split the
two in half.

This simplifies an upcoming patch to delete `DICompositeType`.  There
shouldn't be any real functionality change here.  `createTypeDIE()` is
`cast<>`'ing where it didn't need to before, but that function in turn
is only called for true `MDCompositeType`s.

llvm-svn: 235349

9 years agoAdd conversionDecl matcher for node CXXConversionDecl.
Samuel Benzaquen [Mon, 20 Apr 2015 20:58:50 +0000 (20:58 +0000)]
Add conversionDecl matcher for node CXXConversionDecl.

llvm-svn: 235348

9 years ago[Orc] Make the makeStub function propagate argument attributes onto the call to
Lang Hames [Mon, 20 Apr 2015 20:41:45 +0000 (20:41 +0000)]
[Orc] Make the makeStub function propagate argument attributes onto the call to
the function body.

This is necessary for correctness when lazily compiling.

Also, flesh out the Orc unit test infrastructure slightly, and add a unit test
for this.

llvm-svn: 235347

9 years agoAdd Makefile for typedef_array
Ying Chen [Mon, 20 Apr 2015 20:34:31 +0000 (20:34 +0000)]
Add Makefile for typedef_array

-Makefile was deleted by r235313 causing test failure of TestTypedefArray.py, add it back

Summary: -Makefile was deleted by r235313 causing test failure of TestTypedefArray.py, add it back

Test Plan: Run lldb test locally with change, TestTypedefArray.py passed and no regression observed.

Reviewers: chaoren, sivachandra, vharron

Subscribers: lldb-commits

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

llvm-svn: 235346

9 years agoDwarfUnit: Cleanup comments
Duncan P. N. Exon Smith [Mon, 20 Apr 2015 20:29:51 +0000 (20:29 +0000)]
DwarfUnit: Cleanup comments

Update comment style in `DwarfUnit`.

  - Drop duplicated comments at definition, and update the comments at
    the declaration where the definition comments looked newer or more
    complete.
  - Drop the `functionName -` prefix.
  - Add `\brief` in a few places.
  - Remove a few comments entirely that weren't adding value (just
    turned the function name and arguments into a sentence).

llvm-svn: 235345

9 years agoRefactoring and enhancement to FMA combine.
Olivier Sallenave [Mon, 20 Apr 2015 20:29:40 +0000 (20:29 +0000)]
Refactoring and enhancement to FMA combine.

llvm-svn: 235344

9 years agoFix polly build after LLVM r235327
Duncan P. N. Exon Smith [Mon, 20 Apr 2015 20:28:43 +0000 (20:28 +0000)]
Fix polly build after LLVM r235327

llvm-svn: 235343

9 years agoFixing line endings
Andrew Kaylor [Mon, 20 Apr 2015 20:27:28 +0000 (20:27 +0000)]
Fixing line endings

llvm-svn: 235342

9 years ago[MIPS] OperationAction for FP_TO_FP16, FP16_TO_FP
Pirama Arumuga Nainar [Mon, 20 Apr 2015 20:15:36 +0000 (20:15 +0000)]
[MIPS] OperationAction for FP_TO_FP16, FP16_TO_FP

Summary:
Set operation action for FP16 conversion opcodes, so the Op legalizer
can choose the gnu_* libcalls for Mips.

Set LoadExtAction and TruncStoreAction for f16 scalars and vectors to
prevent (fpext (load )) and (store (fptrunc)) from getting combined into
unsupported operations.

Added test cases to test that these operations are handled correctly
for f16 scalars and vectors.  This patch depends on
http://reviews.llvm.org/D8755.

Reviewers: srhines

Subscribers: llvm-commits, ab

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

llvm-svn: 235341

9 years agoPut statement expression decls in the enclosing code DeclContext
Reid Kleckner [Mon, 20 Apr 2015 20:00:49 +0000 (20:00 +0000)]
Put statement expression decls in the enclosing code DeclContext

We already check that statement expressions are in a function or block,
but we didn't do anything with that information. Now we use that
DeclContext for the duration of the statement expression. Otherwise,
we'd treat statement expression locals as static data members and go
into the weeds.

llvm-svn: 235335

9 years agoDAGCombine: Remove redundant NaN checks around ISD::FSQRT
Tom Stellard [Mon, 20 Apr 2015 19:38:27 +0000 (19:38 +0000)]
DAGCombine: Remove redundant NaN checks around ISD::FSQRT

This folds:

(select (setcc x, -0.0, *lt), NaN, (fsqrt x)) -> ( fsqrt x)

llvm-svn: 235333

9 years agoIR: Add ConstantFP::getNaN()
Tom Stellard [Mon, 20 Apr 2015 19:38:24 +0000 (19:38 +0000)]
IR: Add ConstantFP::getNaN()

This is a wrapper around APFloat::getNaN().

llvm-svn: 235332

9 years agoDebugInfo: Remove DIType
Duncan P. N. Exon Smith [Mon, 20 Apr 2015 18:52:06 +0000 (18:52 +0000)]
DebugInfo: Remove DIType

This is the last major parent class, so I'll probably start deleting
classes in batches now.  Looks like many of the references to the DI*
hierarchy were updated organically along the way.

llvm-svn: 235331

9 years agoDebugInfo: Prepare for deletion of DIType
Duncan P. N. Exon Smith [Mon, 20 Apr 2015 18:51:48 +0000 (18:51 +0000)]
DebugInfo: Prepare for deletion of DIType

`DIType` is going to be deleted by an upcoming LLVM commit, so replace
uses with `MDType*`.

llvm-svn: 235330

9 years agoconfigure: Add --enable-runtime-subnormal option
Tom Stellard [Mon, 20 Apr 2015 18:49:50 +0000 (18:49 +0000)]
configure: Add --enable-runtime-subnormal option

This makes it possible for runtime implementations to disable
subnormal handling at runtime.

When this flag is enabled, decisions about how to handle subnormals
in the library will be controlled by an external variable called
__CLC_SUBNORMAL_DISABLE.

Function implementations should use these new helpers for querying subnormal
support:
__clc_fp16_subnormals_supported();
__clc_fp32_subnormals_supported();
__clc_fp64_subnormals_supported();

In order for the library to link correctly with this feature,
users will be required to either:

1. Insert this variable into the module (if using the LLVM/Clang C++/C APIs).

2. Pass either subnormal_disable.bc or subnormal_use_default.bc to the
linker.  These files are distributed with liblclc and installed to
$(installdir).  e.g.:

llvm-link -o kernel-out.bc kernel.bc builtins-nosubnormal.bc subnormal_disable.bc

or

llvm-link -o kernel-out.bc kernel.bc builtins-nosubnormal.bc subnormal_use_default.bc

If you do not supply the --enable-runtime-subnormal then the library
behaves the same as it did before this commit.

In addition to these changes, the patch adds helper functions that
should be used when implementing library functions that need
special handling for denormals:

__clc_fp16_subnormals_supported();
__clc_fp32_subnormals_supported();
__clc_fp64_subnormals_supported();

llvm-svn: 235329

9 years ago[WinEH] Fix memory leak with catch-all mapping.
Andrew Kaylor [Mon, 20 Apr 2015 18:48:45 +0000 (18:48 +0000)]
[WinEH] Fix memory leak with catch-all mapping.

llvm-svn: 235328

9 years agoDebugInfo: Remove DIScope
Duncan P. N. Exon Smith [Mon, 20 Apr 2015 18:32:29 +0000 (18:32 +0000)]
DebugInfo: Remove DIScope

Replace uses of `DIScope` with `MDScope*`.  There was one spot where
I've left an `MDScope*` uninitialized (where `DIScope` would have been
default-initialized to `nullptr`) -- this is intentional, since the
if/else that follows should unconditional assign it to a value.

llvm-svn: 235327

9 years agoDebugInfo: Prepare for deletion of DIScope
Duncan P. N. Exon Smith [Mon, 20 Apr 2015 18:32:15 +0000 (18:32 +0000)]
DebugInfo: Prepare for deletion of DIScope

An upcoming LLVM commit will delete `DIScope`, so update users to
`MDScope*`.

llvm-svn: 235326

9 years ago[Orc] Use the 64-bit versions of FXSAVE/FXRSTOR for JIT reentry.
Lang Hames [Mon, 20 Apr 2015 18:25:44 +0000 (18:25 +0000)]
[Orc] Use the 64-bit versions of FXSAVE/FXRSTOR for JIT reentry.

llvm-svn: 235325

9 years agoAdd targets to cmake for specific target components.
Pete Cooper [Mon, 20 Apr 2015 18:22:05 +0000 (18:22 +0000)]
Add targets to cmake for specific target components.

This adds the following targets to cmake.  These can be used to build and link only specific parts of a backend, instead of having to link the whole backend.

- AllTargetsAsmPrinters, AllTargetsAsmParsers, AllTargetsDescs, AllTargetsDisassemblers, AllTargetsInfos

A typical use for these is instead of linking ${LLVM_TARGETS_TO_BUILD}.  This commit changes llvm-mc to show how to use the new targets.

Reviewed by Chris Bieneman.

llvm-svn: 235324

9 years agoDebugInfo: Remove typedefs for DITypeRef, etc.
Duncan P. N. Exon Smith [Mon, 20 Apr 2015 18:20:03 +0000 (18:20 +0000)]
DebugInfo: Remove typedefs for DITypeRef, etc.

Remove typedefs for type refs:

  - DITypeRef => MDTypeRef
  - DIScopeRef => MDScopeRef
  - DIDescriptorRef => DebugNodeRef

llvm-svn: 235323

9 years agoConnectionFileDescriptor::BytesAvailable reading too many command bytes
Vince Harron [Mon, 20 Apr 2015 18:15:33 +0000 (18:15 +0000)]
ConnectionFileDescriptor::BytesAvailable reading too many command bytes

ConnectionFileDescriptor::BytesAvailable was reading multiple command
bytes from the command pipe but only processing the first. This
change only allows one byte to be read at a time, ensuring that all
get handled.

This isn't known to cause any bugs, but it might cause current/future
bugs.

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

llvm-svn: 235322

9 years ago[mips][microMIPSr6] Implement BITSWAP instruction
Jozef Kolek [Mon, 20 Apr 2015 18:14:59 +0000 (18:14 +0000)]
[mips][microMIPSr6] Implement BITSWAP instruction

Implement BITSWAP instruction using mapping.

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

llvm-svn: 235321

9 years agoAllow specifying tool path/prefix for tests with CROSS_COMPILE.
Robert Flack [Mon, 20 Apr 2015 18:07:55 +0000 (18:07 +0000)]
Allow specifying tool path/prefix for tests with CROSS_COMPILE.

CROSS_COMPILE environment variable is a common convention to specify the path
and/or prefix to cross compilation tools (e.g. ar, objcopy).

Test Plan:
dotest.py $DOTEST_OPTS -t -p 'TestBSDArchives.py|TestBreakpointCommandsFromPython.py|TestFormats.py|TestObjCDynamicValue.py'
All of these tests now compile successfully and pass running macosx -> linux
using a cross compilation toolchain prefixed by CROSS_COMPILE without requiring
changing your PATH. They still pass when run locally on macosx.

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

llvm-svn: 235320

9 years ago[AArch64] LORID_EL1 register must be treated as read-only
Vladimir Sukharev [Mon, 20 Apr 2015 16:54:37 +0000 (16:54 +0000)]
[AArch64] LORID_EL1 register must be treated as read-only

Patch by: John Brawn

Reviewers: jmolloy

Subscribers: llvm-commits

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

llvm-svn: 235314

9 years agoThis patch implements several improvements to the
Sean Callanan [Mon, 20 Apr 2015 16:31:29 +0000 (16:31 +0000)]
This patch implements several improvements to the
module-loading support for the expression parser.

- It adds support for auto-loading modules referred
  to by a compile unit.  These references are
  currently in the form of empty translation units.
  This functionality is gated by the setting

  target.auto-import-clang-modules (boolean) = false

- It improves and corrects support for loading
  macros from modules, currently by textually
  pasting all #defines into the user's expression.
  The improvements center around including only those
  modules that are relevant to the current context -
  hand-loaded modules and the modules that are imported
  from the current compile unit.

- It adds an "opt-in" mechanism for all of this
  functionality.  Modules have to be explicitly
  imported (via @import) or auto-loaded (by enabling
  the above setting) to enable any of this
  functionality.

It also adds support to the compile unit and symbol
file code to deal with empty translation units that
indicate module imports, and plumbs this through to
the CompileUnit interface.

Finally, it makes the following changes to the test
suite:

- It adds a testcase that verifies that modules are
  automatically loaded when the appropriate setting
  is enabled (lang/objc/modules-auto-import); and

- It modifies lanb/objc/modules-incomplete to test
  the case where a module #undefs something that is
  #defined in another module.

<rdar://problem/20299554>

llvm-svn: 235313

9 years ago[InlineFunction] Don't add lifetime markers for zero-sized allocas.
Akira Hatanaka [Mon, 20 Apr 2015 16:11:05 +0000 (16:11 +0000)]
[InlineFunction] Don't add lifetime markers for zero-sized allocas.

This commit fixes the code which adds lifetime markers in InlineFunction to skip
zero-sized allocas instead of asserting on them.

rdar://problem/20531155

llvm-svn: 235312

9 years agoRecognize n/1 in the SCEV divide function
Brendon Cahoon [Mon, 20 Apr 2015 16:03:28 +0000 (16:03 +0000)]
Recognize n/1 in the SCEV divide function

n/1 generates a quotient equal to n and a remainder of 0.
If this case is not recognized, then the SCEV divide() function
can return a remainder that is greater than or equal to the
denominator, which means the delinearized subscripts for the
test case will be incorrect.

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

llvm-svn: 235311

9 years ago[PowerPC] Flow oversized lines for r235309
Bill Schmidt [Mon, 20 Apr 2015 15:58:46 +0000 (15:58 +0000)]
[PowerPC] Flow oversized lines for r235309

llvm-svn: 235310

9 years ago[PowerPC] Add future work for vector insert/extract to README_ALTIVEC.txt
Bill Schmidt [Mon, 20 Apr 2015 15:54:26 +0000 (15:54 +0000)]
[PowerPC] Add future work for vector insert/extract to README_ALTIVEC.txt

llvm-svn: 235309

9 years ago[mips][microMIPSr6] Implement disassembler support
Jozef Kolek [Mon, 20 Apr 2015 14:40:38 +0000 (14:40 +0000)]
[mips][microMIPSr6] Implement disassembler support

Implement disassembler support for microMIPS32r6.

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

llvm-svn: 235307

9 years agoFreeBSD/arm core file support
Ed Maste [Mon, 20 Apr 2015 13:58:19 +0000 (13:58 +0000)]
FreeBSD/arm core file support

Patch by Andrew Turner, with minor edits. XCode changes are mine; please
update if necessary.

llvm-svn: 235305

9 years agoNativeProcessLinux: Merge operation and monitor threads
Pavel Labath [Mon, 20 Apr 2015 13:53:49 +0000 (13:53 +0000)]
NativeProcessLinux: Merge operation and monitor threads

Summary:
This commit moves the functionality of the operation thread into the new monitor thread. This is
required to avoid a kernel race between the two threads and I believe it actually makes the code
cleaner.

Test Plan: Ran the test suite a couple of times, no regressions.

Reviewers: ovyalov, tberghammer, vharron

Subscribers: tberghammer, lldb-commits

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

llvm-svn: 235304

9 years agoDon't allow pwrite to resize a stream.
Rafael Espindola [Mon, 20 Apr 2015 13:04:30 +0000 (13:04 +0000)]
Don't allow pwrite to resize a stream.

The current implementations could exhibit some behavior differences:

raw_fd_ostream: Whatever the underlying fd does with seek+write. In a normal
file, the write position would be back to the old offset.

raw_svector_ostream: The write position is always the end of the stream, so
after pwrite the write position would be the new end. This matches what OS_X
(all BSD?) do with a pwrite in a O_APPEND fd.

Given that we don't need that feature and don't use O_APPEND a lot in LLVM,
just disallow it.

I am open to suggestions on renaming pwrite to something else, but this fixes
the issue for now.

Thanks to Yaron Keren for reporting it.

llvm-svn: 235303

9 years ago[mips][microMIPSr6] Implement BALC and BC instructions
Jozef Kolek [Mon, 20 Apr 2015 13:04:14 +0000 (13:04 +0000)]
[mips][microMIPSr6] Implement BALC and BC instructions

This patch implements BALC and BC instructions using mapping.

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

llvm-svn: 235302

9 years agoclang-format: Fix incorrect multi-var declstmt detection.
Daniel Jasper [Mon, 20 Apr 2015 12:54:29 +0000 (12:54 +0000)]
clang-format: Fix incorrect multi-var declstmt detection.

This is now obvious as the pointer alignment behavior was changed.

Before (even with pointer alignment "Left"):
  MACRO Constructor(const int &i) : a(a), b(b) {}

After:
  MACRO Constructor(const int& i) : a(a), b(b) {}

llvm-svn: 235301

9 years agoLook past locals in comdats.
Rafael Espindola [Mon, 20 Apr 2015 12:44:06 +0000 (12:44 +0000)]
Look past locals in comdats.

We have to avoid converting a reference to a global into a reference to a local,
but it is fine to look past a local.

Patch by Vasileios Kalintiris.

I just moved the comment and added thet test.

llvm-svn: 235300

9 years ago[mips] Support building compiler-rt with gcc.
Daniel Sanders [Mon, 20 Apr 2015 12:44:01 +0000 (12:44 +0000)]
[mips] Support building compiler-rt with gcc.

Summary:
This will allow us to enable it on the buildbot (and then enable a
sanitizer buildbot).

The problem is that gcc for Mips does not accept -m32/-m64 like clang does.
We therefore need to use the nearest equivalent -mips32r2/-mips64r2. We must
also specify -mabi=64 in the -mips64r2 case since gcc's default ABI has
traditionally been N32 whereas clang's is N64.

Reviewers: sagar

Reviewed By: sagar

Subscribers: llvm-commits, samsonov, kcc, mohit.bhakkad, Anand.Takale, sagar

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

llvm-svn: 235299

9 years ago[mips][microMIPSr6] Implement initial mapping support
Jozef Kolek [Mon, 20 Apr 2015 12:42:08 +0000 (12:42 +0000)]
[mips][microMIPSr6] Implement initial mapping support

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

llvm-svn: 235298

9 years ago[Asan] Link lit tests shared libraries with -Wl,z,origin on FreeBSD
Viktor Kutuzov [Mon, 20 Apr 2015 12:25:11 +0000 (12:25 +0000)]
[Asan] Link lit tests shared libraries with -Wl,z,origin on FreeBSD
Differential Revision: http://reviews.llvm.org/D8834

llvm-svn: 235297

9 years ago[mips][microMIPSr6] Implement initial subtarget support
Jozef Kolek [Mon, 20 Apr 2015 12:23:06 +0000 (12:23 +0000)]
[mips][microMIPSr6] Implement initial subtarget support

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

llvm-svn: 235296

9 years ago[X86][FastIsel] Fix assertion failure when selecting int-to-double conversion (PR23273).
Andrea Di Biagio [Mon, 20 Apr 2015 11:56:59 +0000 (11:56 +0000)]
[X86][FastIsel] Fix assertion failure when selecting int-to-double conversion (PR23273).

This fixes a regression introduced at revision 231243.
The target-independent selection algorithm in FastISel knows how to select
a SINT_TO_FP if the target is SSE but not AVX. That is because on X86, the
tablegen'd 'fastEmit' functions know how to select CVTSI2SSrr and CVTSI2SDrr.

Method X86FastISel::X86SelectSIToFP was therefore working under the
wrong assumption that the target was AVX. That assumption was incorrect since
we can have a target that is neither AVX nor SSE.

So, rather than asserting for the presence of AVX, we should have had an
early exit from 'X86SelectSIToFP' if the target was not AVX.
This patch fixes the issue replacing the invalid assertion with an early exit.

Thanks to Dimitry Andric for reporting this problem and for providing a small
reproducible testcase. Added test pr23273.ll.

llvm-svn: 235295

9 years agotsan: deflake a test
Dmitry Vyukov [Mon, 20 Apr 2015 10:35:21 +0000 (10:35 +0000)]
tsan: deflake a test

llvm-svn: 235294

9 years agotsan: fix handling of pthread_detach
Dmitry Vyukov [Mon, 20 Apr 2015 10:35:10 +0000 (10:35 +0000)]
tsan: fix handling of pthread_detach

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

If pthread_create is followed by pthread_detach,
the new thread may not acquire synchronize with
the parent thread.

llvm-svn: 235293