platform/upstream/llvm.git
11 years agoObjectiveC migrator. Start annotating CF functions
Fariborz Jahanian [Thu, 15 Aug 2013 21:44:38 +0000 (21:44 +0000)]
ObjectiveC migrator. Start annotating CF functions
with CF_RETURNS_RETAINED/CF_RETURNS_NOT_RETAINED as
appropriate.

llvm-svn: 188493

11 years agoDebugInfo: Make CGDebugInfo::getStaticDataMemberDeclaration's argument type match...
David Blaikie [Thu, 15 Aug 2013 21:42:43 +0000 (21:42 +0000)]
DebugInfo: Make CGDebugInfo::getStaticDataMemberDeclaration's argument type match the semantics

Rather than having a cast immediately inside the function, push that
type requirement out to the callers.

llvm-svn: 188492

11 years agoDebugInfo: Add a FIXME, remove a FIXME.
David Blaikie [Thu, 15 Aug 2013 21:21:19 +0000 (21:21 +0000)]
DebugInfo: Add a FIXME, remove a FIXME.

(the removed FIXME no longer applies since we made this debug info
optimization not apply to C)

llvm-svn: 188491

11 years ago[dfsan] Initial set of custom functions and interceptors for libc.
Peter Collingbourne [Thu, 15 Aug 2013 21:18:53 +0000 (21:18 +0000)]
[dfsan] Initial set of custom functions and interceptors for libc.

Differential Revision: http://llvm-reviews.chandlerc.com/D1397

llvm-svn: 188490

11 years agoFixing a corner-case bug in strchr and strrchr lib call optimizations where
Yunzhong Gao [Thu, 15 Aug 2013 20:58:59 +0000 (20:58 +0000)]
Fixing a corner-case bug in strchr and strrchr lib call optimizations where
the input character is not converted to char before comparing with zero.

The patch was discussed in this thread:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20130812/184069.html

llvm-svn: 188489

11 years agomake arm-use-movt available for all ARM
Renato Golin [Thu, 15 Aug 2013 20:54:45 +0000 (20:54 +0000)]
make arm-use-movt available for all ARM

This updates clang according to a pending patch for llvm to
rename of the -arm-darwin-use-movt to arm-use-movt to make
it available for all of ARM.

note: please apply this close to the llvm change.

Patch by Jeroen Hofstee.

llvm-svn: 188488

11 years agomake arm-use-movt available for all ARM
Renato Golin [Thu, 15 Aug 2013 20:54:38 +0000 (20:54 +0000)]
make arm-use-movt available for all ARM

Before this patch this flag is IOS specific, but is also
useful for bare project like bootloaders / kernels etc,
since movw / movt prevents simple relocation. Therefore
make this flag more commonly available.

note: this patch depends on a similiar rename in clang

Patch by Jeroen Hofstee.

llvm-svn: 188487

11 years agoDebugInfo: Unify & optimize the lazy addition of record types
David Blaikie [Thu, 15 Aug 2013 20:49:17 +0000 (20:49 +0000)]
DebugInfo: Unify & optimize the lazy addition of record types

Rather than going through the whole getOrCreateType machinery to
manifest a type, cut straight to the implementation because we know we
have to do work.

While the previous implementation was sufficient for the two cases
(completeness and required completeness) we have already (the general
machinery could inspect the type for those attributes & go down the full
definition path), a pending change (to emit info for types when we emit
their vtables) won't have that luxury & we'll need to force the creation
rather than relying on the general purpose routine.

llvm-svn: 188486

11 years agomake arm-reserve-r9 available for all ARM
Renato Golin [Thu, 15 Aug 2013 20:45:13 +0000 (20:45 +0000)]
make arm-reserve-r9 available for all ARM

r9 is defined as a platform-specific register in the ARM EABI.
It can be reserved for a special purpose or be used as a general
purpose register. Add support for reserving r9 for all ARM, while
leaving the IOS usage unchanged.

Patch by Jeroen Hofstee.

llvm-svn: 188485

11 years agoMake a few more things const.
Bill Wendling [Thu, 15 Aug 2013 20:25:44 +0000 (20:25 +0000)]
Make a few more things const.

llvm-svn: 188484

11 years agoUse a reference instead of making an unnecessary copy. Also use 'const'.
Bill Wendling [Thu, 15 Aug 2013 20:21:49 +0000 (20:21 +0000)]
Use a reference instead of making an unnecessary copy. Also use 'const'.

llvm-svn: 188483

11 years agoDebugInfo: Revert change to the return type of createRecordFwdDecl
David Blaikie [Thu, 15 Aug 2013 20:17:25 +0000 (20:17 +0000)]
DebugInfo: Revert change to the return type of createRecordFwdDecl

It still does only return DICompositeType, but I've no need to make that
change right now.

llvm-svn: 188482

11 years agoCodeGen: __uuidof should work even with an incomplete _GUID type
David Majnemer [Thu, 15 Aug 2013 19:59:14 +0000 (19:59 +0000)]
CodeGen: __uuidof should work even with an incomplete _GUID type

Summary:
We would crash in CodeGen::CodeGenModule::EmitUuidofInitializer
because our attempt to enter CodeGen::CodeGenModule::EmitConstantValue
will be foiled: the type of the constant value is incomplete.

Instead, create an unnamed type with the proper layout on all platforms.
Punt the problem of wrongly defined struct _GUID types to the user.
(It's impossible because the TU may never get to see the type and thus
we can't verify that it is suitable.)

This fixes PR16856.

Reviewers: rsmith, rnk, thakis

Reviewed By: rnk

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1375

llvm-svn: 188481

11 years agoAdd another test to my last patch (NS_OPTION vs. NS_ENUM)
Fariborz Jahanian [Thu, 15 Aug 2013 19:27:42 +0000 (19:27 +0000)]
Add another test to my last patch (NS_OPTION vs. NS_ENUM)
ObjectiveC migration.

llvm-svn: 188480

11 years ago[autotools->cmake] Added variable CLANG_VENDOR_UTI.
Michael Gottesman [Thu, 15 Aug 2013 19:22:36 +0000 (19:22 +0000)]
[autotools->cmake] Added variable CLANG_VENDOR_UTI.

llvm-svn: 188479

11 years ago[autotools->cmake] Added CMake support for the preprocessor variable CLANG_REPOSITORY...
Michael Gottesman [Thu, 15 Aug 2013 19:22:33 +0000 (19:22 +0000)]
[autotools->cmake] Added CMake support for the preprocessor variable CLANG_REPOSITORY_STRING.

This is a patch in a longer series of patches to add
capabilities/definitions that are present in the Autotools build chain
and not in the CMake build chain to the CMake build chain.

*NOTE* I am hacking on this in my free time. I will annotate each commit
with the [autotools->cmake] header.

llvm-svn: 188478

11 years agoAdd rhadd builtin
Aaron Watry [Thu, 15 Aug 2013 19:21:10 +0000 (19:21 +0000)]
Add rhadd builtin

rhadd = (x+y+1)>>1

Implemented as:
(x>>1) + (y>>1) + ((x&1)|(y&1))

This prevents us having to do assembly addition and overflow detection

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 188477

11 years agoAdd hadd builtin
Aaron Watry [Thu, 15 Aug 2013 19:21:07 +0000 (19:21 +0000)]
Add hadd builtin

(x + y) >> 1 gets changed to:
(x>>1) + (y>>1) + (x&y&1)

Saves us having to do any llvm assembly and overflow checking in the addition.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
llvm-svn: 188476

11 years agoDebugInfo: remove unnecessary type registration
David Blaikie [Thu, 15 Aug 2013 18:59:44 +0000 (18:59 +0000)]
DebugInfo: remove unnecessary type registration

This happens in the caller a few frames up anyway.

llvm-svn: 188475

11 years agoDebugInfo: Don't create duplicate forward declaration metadata unnecessarily.
David Blaikie [Thu, 15 Aug 2013 18:59:40 +0000 (18:59 +0000)]
DebugInfo: Don't create duplicate forward declaration metadata unnecessarily.

No functionality change, at best a slight (questionable) optimization,
but necessary for correctness of future work.

llvm-svn: 188474

11 years agoFixes a gross conditional in my last patch.
Fariborz Jahanian [Thu, 15 Aug 2013 18:58:00 +0000 (18:58 +0000)]
Fixes a gross conditional in my last patch.
- This line, and those below, will be ignored--

M    lib/ARCMigrate/ObjCMT.cpp

llvm-svn: 188473

11 years agoDataFlowSanitizer: Add a debugging feature to help us track nonzero labels.
Peter Collingbourne [Thu, 15 Aug 2013 18:51:12 +0000 (18:51 +0000)]
DataFlowSanitizer: Add a debugging feature to help us track nonzero labels.

Summary:
When the -dfsan-debug-nonzero-labels parameter is supplied, the code
is instrumented such that when a call parameter, return value or load
produces a nonzero label, the function __dfsan_nonzero_label is called.
The idea is that a debugger breakpoint can be set on this function
in a nominally label-free program to help identify any bugs in the
instrumentation pass causing labels to be introduced.

Reviewers: eugenis

CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1405

llvm-svn: 188472

11 years ago[dfsan] Runtime support for -dfsan-debug-nonzero-labels feature.
Peter Collingbourne [Thu, 15 Aug 2013 18:51:07 +0000 (18:51 +0000)]
[dfsan] Runtime support for -dfsan-debug-nonzero-labels feature.

Reviewers: eugenis

CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1406

llvm-svn: 188471

11 years agoObjectiveC migrator: In deciding NS_OPTION over
Fariborz Jahanian [Thu, 15 Aug 2013 18:46:37 +0000 (18:46 +0000)]
ObjectiveC migrator: In deciding NS_OPTION over
NS_ENUM, at least one power of 2 enumerator
must be greater than two.

llvm-svn: 188470

11 years agoConstify the function parameters.
Bill Wendling [Thu, 15 Aug 2013 18:46:14 +0000 (18:46 +0000)]
Constify the function parameters.

llvm-svn: 188469

11 years ago[analyzer] If realloc fails on an escaped region, that region doesn't leak.
Jordan Rose [Thu, 15 Aug 2013 17:22:06 +0000 (17:22 +0000)]
[analyzer] If realloc fails on an escaped region, that region doesn't leak.

When a region is realloc()ed, MallocChecker records whether it was known
to be allocated or not. If it is, and the reallocation fails, the original
region has to be freed. Previously, when an allocated region escaped,
MallocChecker completely stopped tracking it, so a failed reallocation
still (correctly) wouldn't require freeing the original region. Recently,
however, MallocChecker started tracking escaped symbols, so that if it were
freed we could check that the deallocator matched the allocator. This
broke the reallocation model for whether or not a symbol was allocated.

Now, MallocChecker will actually check if a symbol is owned, and only
require freeing after a failed reallocation if it was owned before.

PR16730

llvm-svn: 188468

11 years agoDrive-by fix for a doxygen comment in MachineInstr.h.
Joey Gouly [Thu, 15 Aug 2013 16:02:44 +0000 (16:02 +0000)]
Drive-by fix for a doxygen comment in MachineInstr.h.

llvm-svn: 188467

11 years agoThis fixes three issues related to Thumb literal loads:
Mihai Popa [Thu, 15 Aug 2013 15:43:06 +0000 (15:43 +0000)]
This fixes three issues related to Thumb literal loads:

1. The offset range for Thumb1 PC relative loads is [0..1020] and not [-1024..1020]
2. Thumb2 PC relative loads may define the PC, so the restriction placed on target register is removed
3. Removes unneeded alias between "ldr.n" and t1LDRpci. ".n" is actually stripped by both tablegen
and the ASM parser, so this alias rule really does nothing

llvm-svn: 188466

11 years agoThread safety analysis: move warnings within lock/unlock functions out of beta.
DeLesley Hutchins [Thu, 15 Aug 2013 15:31:25 +0000 (15:31 +0000)]
Thread safety analysis: move warnings within lock/unlock functions out of beta.

llvm-svn: 188465

11 years ago[Mips][msa] Add support for half
Jack Carter [Thu, 15 Aug 2013 15:16:57 +0000 (15:16 +0000)]
[Mips][msa] Add support for half

Add support for half (a.k.a. __fp16) in builtin descriptions.
The second argument to BUILTIN() now accepts 'h' to represent half.

Patch by Daniel Sanders

llvm-svn: 188464

11 years agoBuild unwind tables by default on NetBSD.
Joerg Sonnenberger [Thu, 15 Aug 2013 15:08:33 +0000 (15:08 +0000)]
Build unwind tables by default on NetBSD.

llvm-svn: 188463

11 years agoUse the integrated assembler on NetBSD/powerpc by default.
Joerg Sonnenberger [Thu, 15 Aug 2013 15:04:56 +0000 (15:04 +0000)]
Use the integrated assembler on NetBSD/powerpc by default.

llvm-svn: 188462

11 years ago[Mips][msa] Added most builtins from add.a to xori
Jack Carter [Thu, 15 Aug 2013 14:47:02 +0000 (14:47 +0000)]
[Mips][msa] Added most builtins from add.a to xori

Includes:
add.a, adds_a, adds_s, adds_u, addv, addvi, andi.b, asub_[su], ave_[su],
aver_[su], bclr, bclri, bins[lr], bins[lr]i, bmnzi, bmzi, bneg, bnegi, bset,
bseti, c(eq|ne), c(eq|ne)i, cl[et]_[su], cl[et]i_[su], copy_[su].[bhw],
div_[su], dotp_[su], dpadd_[su], dpsub_[su], fadd, fceq, fclass, fcl[et], fcne,
fdiv, fexp2, ffint_[su], ffql, ffqr, fill, flog2, fmadd, fmax, fmax_a, fmin,
fmin_a, fmsub, fmul, frint, fseq, fsle, fslt, fsne, fsqr, fsub, ftint_[su],
ftq, ilvev, ilvl, ilvod, ilvr, ldi, frcp, frsqrt, madd_q, maddr_q, maddv,
max_[asu], maxi_[su], min_[asu], mini_[su], mod_[su], msub_q, msubr_q, msubv,
mul_q, mulr_q, mulv, nloc, nlzc, nori, ori, pckev, pckod, pcnt, sat_[su], shf,
sld, sldi, sll, slli, splat, splati, sr[al], sr[al]i, subs_[su], subv, subvi,
xori

Patch by Daniel Sanders

llvm-svn: 188461

11 years ago[Mips][msa] Added the simple builtins (madd_q to xori)
Jack Carter [Thu, 15 Aug 2013 14:22:07 +0000 (14:22 +0000)]
[Mips][msa] Added the simple builtins (madd_q to xori)

Includes:
madd_q, maddr_q, maddv, max_[asu], maxi_[su], min_[asu], mini_[su], mod_[su],
msub_q, msubr_q, msubv, mul_q, mulr_q, mulv, nloc, nlzc, nori, ori, pckev,
pckod, pcnt, sat_[su], shf, sld, sldi, sll, slli, splat, splati, sr[al],
sr[al]i, subs_[su], subss_u, subus_s, subv, subvi, vshf, xori

Patch by Daniel Sanders

llvm-svn: 188460

11 years agoUpdate sanitizer attribute documentation to match behaviour change in r187967.
Evgeniy Stepanov [Thu, 15 Aug 2013 13:57:11 +0000 (13:57 +0000)]
Update sanitizer attribute documentation to match behaviour change in r187967.

llvm-svn: 188459

11 years ago[Mips][msa] Added the simple builtins (fadd to ftq)
Jack Carter [Thu, 15 Aug 2013 13:45:36 +0000 (13:45 +0000)]
[Mips][msa] Added the simple builtins (fadd to ftq)

Includes:
fadd, fceq, fcg[et], fclass, fcl[et], fcne, fcun, fdiv, fexdo, fexp2,
fexup[lr], ffint_[su], ffql, ffqr, fill, flog2, fmadd, fmax, fmax_a, fmin,
fmin_a, fmsub, fmul, frint, frcp, frsqrt, fseq, fsge, fsgt, fsle, fslt,
fsne, fsqr, fsub, ftint_s, ftq

Patch by Daniel Sanders

llvm-svn: 188458

11 years ago[Mips][msa] Added the simple builtins (add_a to dpsub[su], ilvev to ldi)
Jack Carter [Thu, 15 Aug 2013 12:24:57 +0000 (12:24 +0000)]
[Mips][msa] Added the simple builtins (add_a to dpsub[su], ilvev to ldi)

Includes:
add_a, adds_[asu], addv, addvi, andi.b, asub_[su].[bhwd], aver?_[su]_[bhwd],
bclr, bclri, bins[lr], bins[lr]i, bmnzi, bmzi, bneg, bnegi, bseli, bset, bseti,
c(eq|ne), c(eq|ne)i, cl[et]_[su], cl[et]i_[su], copy_[su].[bhw], div_[su],
dotp_[su], dpadd_[su], dpsub_[su], ilvev, ilvl, ilvod, ilvr, insv, insve,
ldi

Patch by Daniel Sanders

llvm-svn: 188457

11 years agoFix the build failure of Realease version
Hao Liu [Thu, 15 Aug 2013 11:38:54 +0000 (11:38 +0000)]
Fix the build failure of Realease version

llvm-svn: 188456

11 years ago[sanitizer] Add missing include.
Evgeniy Stepanov [Thu, 15 Aug 2013 10:20:30 +0000 (10:20 +0000)]
[sanitizer] Add missing include.

llvm-svn: 188455

11 years agoRevert r188449 as it turns out we're just missing the instructions that need the...
Craig Topper [Thu, 15 Aug 2013 08:38:25 +0000 (08:38 +0000)]
Revert r188449 as it turns out we're just missing the instructions that need the v16i32/v16f32 matching.

llvm-svn: 188454

11 years agoAdd back a test that was removed in r188450
David Majnemer [Thu, 15 Aug 2013 08:34:07 +0000 (08:34 +0000)]
Add back a test that was removed in r188450

llvm-svn: 188453

11 years agoClang and AArch64 backend patches to support shll/shl and vmovl instructions and...
Hao Liu [Thu, 15 Aug 2013 08:26:30 +0000 (08:26 +0000)]
Clang and AArch64 backend patches to support shll/shl and vmovl instructions and ACLE functions

llvm-svn: 188452

11 years agoClang and AArch64 backend patches to support shll/shl and vmovl instructions and...
Hao Liu [Thu, 15 Aug 2013 08:26:11 +0000 (08:26 +0000)]
Clang and AArch64 backend patches to support shll/shl and vmovl instructions and ACLE functions

llvm-svn: 188451

11 years ago[-cxx-abi microsoft] Mangle member pointers better
David Majnemer [Thu, 15 Aug 2013 08:13:23 +0000 (08:13 +0000)]
[-cxx-abi microsoft] Mangle member pointers better

Summary:
There were several things going wrong:
- We mangled in useless qualifiers like "volatile void" return types.
- We didn't propagate 64-bit pointer markers sufficiently.
- We mangled qualifiers belonging to the pointee incorrectly.

This fixes PR16844 and PR16848.

Reviewers: rnk, whunt

Reviewed By: rnk

CC: cfe-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D1353

llvm-svn: 188450

11 years agoDon't let isPermImmMask handle v16i32 since VPERMI doesn't match on that type. Remove...
Craig Topper [Thu, 15 Aug 2013 07:30:51 +0000 (07:30 +0000)]
Don't let isPermImmMask handle v16i32 since VPERMI doesn't match on that type. Remove 128-bit vector handling from isPermImmMask too, it's covered by isPSHUFDMask.

llvm-svn: 188449

11 years agoTentative fix for global-buffer-overflow caused by r188426. Found by AddressSanitizer
Alexey Samsonov [Thu, 15 Aug 2013 07:11:34 +0000 (07:11 +0000)]
Tentative fix for global-buffer-overflow caused by r188426. Found by AddressSanitizer

llvm-svn: 188448

11 years agoCHECK-LABEL-ify some code gen tests to improve diagnostic experience when tests fail.
Stephen Lin [Thu, 15 Aug 2013 06:47:53 +0000 (06:47 +0000)]
CHECK-LABEL-ify some code gen tests to improve diagnostic experience when tests fail.

llvm-svn: 188447

11 years agoUse MVT instead of EVT in X86ISelDAGToDAG since all the types should be legal.
Craig Topper [Thu, 15 Aug 2013 05:57:07 +0000 (05:57 +0000)]
Use MVT instead of EVT in X86ISelDAGToDAG since all the types should be legal.

llvm-svn: 188446

11 years agoUse MVT in place of EVT in more X86 operation lowering functions.
Craig Topper [Thu, 15 Aug 2013 05:33:45 +0000 (05:33 +0000)]
Use MVT in place of EVT in more X86 operation lowering functions.

llvm-svn: 188445

11 years agoFixed typo in CMakeLists.txt.
Michael Gottesman [Thu, 15 Aug 2013 04:16:12 +0000 (04:16 +0000)]
Fixed typo in CMakeLists.txt.

We were marking both LLVMBUILDOUTPUT and LLVMBUILDERRORS as
ERROR_VARIABLES when clearly LLVMBUILDOUTPUT should be marked as
OUTPUT_VARIABLE.

llvm-svn: 188444

11 years agoA new test case which adds a dSYM to an executable mid-debug session
Jason Molenda [Thu, 15 Aug 2013 02:49:16 +0000 (02:49 +0000)]
A new test case which adds a dSYM to an executable mid-debug session
where the executable has been slid.  This detects the regression fixed in
r188289.

llvm-svn: 188443

11 years agoReplace getValueType().getSimpleVT() with getSimpleValueType().
Craig Topper [Thu, 15 Aug 2013 02:44:19 +0000 (02:44 +0000)]
Replace getValueType().getSimpleVT() with getSimpleValueType().

llvm-svn: 188442

11 years agoReplace getValueType().getSimpleVT() with getSimpleValueType(). Also remove one weird...
Craig Topper [Thu, 15 Aug 2013 02:33:50 +0000 (02:33 +0000)]
Replace getValueType().getSimpleVT() with getSimpleValueType(). Also remove one weird cast from MVT->EVT just to call getSimpleVT().

llvm-svn: 188441

11 years agoAdd a bit of explanation for FrontendActionFactory.
Stefanus Du Toit [Thu, 15 Aug 2013 00:35:46 +0000 (00:35 +0000)]
Add a bit of explanation for FrontendActionFactory.

Also use the more common "derive from" in place of "extend" in another
comment.

llvm-svn: 188440

11 years agoAdd ctorInitializer to the dynamic AST Matcher registry.
Stefanus Du Toit [Thu, 15 Aug 2013 00:33:08 +0000 (00:33 +0000)]
Add ctorInitializer to the dynamic AST Matcher registry.

llvm-svn: 188439

11 years agoObjectiveC [Sema]. This patch makes sure that all inherited
Fariborz Jahanian [Wed, 14 Aug 2013 23:58:55 +0000 (23:58 +0000)]
ObjectiveC [Sema]. This patch makes sure that all inherited
properties (direct or indirect) setter/getter (or declared
methods as well) are seen by the method implementation type
matching logic before declaration of method in super class
is seen. This fixes the warning coming out of that method mismatch.
// rdar://14650159

llvm-svn: 188438

11 years agoAuto-compute live intervals on demand.
Mark Lacey [Wed, 14 Aug 2013 23:50:16 +0000 (23:50 +0000)]
Auto-compute live intervals on demand.

When new virtual registers are created during splitting/spilling, defer
creation of the live interval until we need to use the live interval.

Along with the recent commits to notify LiveRangeEdit when new virtual
registers are created, this makes it possible for functions like
TargetInstrInfo::loadRegFromStackSlot() and
TargetInstrInfo::storeRegToStackSlot() to create multiple virtual
registers as part of the process of generating loads/stores for
different register classes, and then have the live intervals for those
new registers computed when they are needed.

llvm-svn: 188437

11 years agoAdd the MachineInstrSpan class.
Mark Lacey [Wed, 14 Aug 2013 23:50:11 +0000 (23:50 +0000)]
Add the MachineInstrSpan class.

MachineInstrSpan is initialized with a MachineBasicBlock::iterator,
and is intended to track which instructions are inserted before/after
that instruction from the time the MachineInstrSpan is created.

It provides a begin()/end() interface to walk the range of
instructions inserted around the initial instruction (including that
initial instruction).

It also provides a getInitial() interface to return the initial
iterator.

llvm-svn: 188436

11 years agoNotify LiveRangeEdit of new virtual registers.
Mark Lacey [Wed, 14 Aug 2013 23:50:09 +0000 (23:50 +0000)]
Notify LiveRangeEdit of new virtual registers.

Add a delegate class to MachineRegisterInfo with a single virtual
function, MRI_NoteNewVirtualRegister(). Update LiveRangeEdit to inherit
from this delegate class and override the definition of the callback
with an implementation that tracks the newly created virtual registers.

llvm-svn: 188435

11 years agoTrack new virtual registers by register number.
Mark Lacey [Wed, 14 Aug 2013 23:50:04 +0000 (23:50 +0000)]
Track new virtual registers by register number.

Track new virtual registers by register number, rather than by the live
interval created for them. This is the first step in separating the
creation of new virtual registers and new live intervals.  Eventually
live intervals will be created and populated on demand after the virtual
registers have been created and used in instructions.

llvm-svn: 188434

11 years ago[static analyzer] add a simple "CallEffects" API to query the retain count semantics...
Ted Kremenek [Wed, 14 Aug 2013 23:41:49 +0000 (23:41 +0000)]
[static analyzer] add a simple "CallEffects" API to query the retain count semantics of a method.

This is intended to be a simplified API, whose internals are
deliberately less efficient for the purpose of a simplified interface,
for use with clients that want to query the analyzer's heuristics for
determining retain count semantics.

There are no immediate clients, but it is intended to be used
by the ObjC modernizer.

llvm-svn: 188433

11 years ago[static analyzer] Factor out ArgEffect and RetEffect into public header file.
Ted Kremenek [Wed, 14 Aug 2013 23:41:46 +0000 (23:41 +0000)]
[static analyzer] Factor out ArgEffect and RetEffect into public header file.

This is a WIP change to allow other clients to query the retain count
heuristics of the static analyzer.

llvm-svn: 188432

11 years agoR600/SI: Improve legalization of vector operations
Tom Stellard [Wed, 14 Aug 2013 23:25:00 +0000 (23:25 +0000)]
R600/SI: Improve legalization of vector operations

This should fix hangs in the OpenCL piglit tests.

llvm-svn: 188431

11 years agoR600/SI: Replace v1i32 type with i32 in imageload and sample intrinsics
Tom Stellard [Wed, 14 Aug 2013 23:24:53 +0000 (23:24 +0000)]
R600/SI: Replace v1i32 type with i32 in imageload and sample intrinsics

llvm-svn: 188430

11 years agoR600/SI: Convert v16i8 resource descriptors to i128
Tom Stellard [Wed, 14 Aug 2013 23:24:45 +0000 (23:24 +0000)]
R600/SI: Convert v16i8 resource descriptors to i128

Now that compute support is better on SI, we can't continue using v16i8
for descriptors since this is also a legal type in OpenCL.

This patch fixes numerous hangs with the piglit OpenCL test and since
we now use a target specific DAG node for LOAD_CONSTANT with the
correct MemOperandFlags, this should also fix:

https://bugs.freedesktop.org/show_bug.cgi?id=66805

llvm-svn: 188429

11 years agoR600/SI: Use i8 types for resource descriptors in tests
Tom Stellard [Wed, 14 Aug 2013 23:24:37 +0000 (23:24 +0000)]
R600/SI: Use i8 types for resource descriptors in tests

We switched from i32 to i8 types a while ago and the tests were never
updated.

llvm-svn: 188428

11 years agoR600/SI: Lower BUILD_VECTOR to REG_SEQUENCE v2
Tom Stellard [Wed, 14 Aug 2013 23:24:32 +0000 (23:24 +0000)]
R600/SI: Lower BUILD_VECTOR to REG_SEQUENCE v2

Using REG_SEQUENCE for BUILD_VECTOR rather than a series of INSERT_SUBREG
instructions should make it easier for the register allocator to coalasce
unnecessary copies.

v2:
  - Use an SGPR register class if all the operands of BUILD_VECTOR are
    SGPRs.

llvm-svn: 188427

11 years agoR600/SI: Choose the correct MOV instruction for copying immediates
Tom Stellard [Wed, 14 Aug 2013 23:24:24 +0000 (23:24 +0000)]
R600/SI: Choose the correct MOV instruction for copying immediates

The instruction selector will now try to infer the destination register
so it can decided whether to use V_MOV_B32 or S_MOV_B32 when copying
immediates.

llvm-svn: 188426

11 years agoR600/SI: Assign a register class to the $vaddr operand for MIMG instructions
Tom Stellard [Wed, 14 Aug 2013 23:24:17 +0000 (23:24 +0000)]
R600/SI: Assign a register class to the $vaddr operand for MIMG instructions

The previous code declared the operand as unknown:$vaddr, which made
it possible for scalar registers to be used instead of vector registers.

llvm-svn: 188425

11 years ago[llvm-build] Make Py3 compatible.
Daniel Dunbar [Wed, 14 Aug 2013 23:15:39 +0000 (23:15 +0000)]
[llvm-build] Make Py3 compatible.

llvm-svn: 188424

11 years agoDataFlowSanitizer: move abilist input file to Inputs.
Peter Collingbourne [Wed, 14 Aug 2013 22:28:36 +0000 (22:28 +0000)]
DataFlowSanitizer: move abilist input file to Inputs.

llvm-svn: 188423

11 years agoDebugInfo: Prefer references over pointers, pass by const reference for a type that...
David Blaikie [Wed, 14 Aug 2013 22:23:05 +0000 (22:23 +0000)]
DebugInfo: Prefer references over pointers, pass by const reference for a type that will grow in the future

llvm-svn: 188422

11 years agoR600/SI: Handle MSAA texture targets
Tom Stellard [Wed, 14 Aug 2013 22:22:14 +0000 (22:22 +0000)]
R600/SI: Handle MSAA texture targets

Patch by: Marek Olšák

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
llvm-svn: 188421

11 years agoR600/SI: Allow conversion between v32i8 and v8i32
Tom Stellard [Wed, 14 Aug 2013 22:22:09 +0000 (22:22 +0000)]
R600/SI: Allow conversion between v32i8 and v8i32

Patch by: Marek Olšák

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
llvm-svn: 188420

11 years agoR600/SI: Fix an obvious typo
Tom Stellard [Wed, 14 Aug 2013 22:22:03 +0000 (22:22 +0000)]
R600/SI: Fix an obvious typo

Patch by: Marek Olšák

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
llvm-svn: 188419

11 years agoR600/SI: Add pattern for fp_to_uint
Tom Stellard [Wed, 14 Aug 2013 22:21:57 +0000 (22:21 +0000)]
R600/SI: Add pattern for fp_to_uint

This fixes the F2U opcode for the Mesa driver.

Patch by: Marek Olšák

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
llvm-svn: 188418

11 years ago[lit] Add test coverage of gtest format.
Daniel Dunbar [Wed, 14 Aug 2013 22:21:11 +0000 (22:21 +0000)]
[lit] Add test coverage of gtest format.

llvm-svn: 188417

11 years ago[lit] Ensure test output is converted to strings where possible.
Daniel Dunbar [Wed, 14 Aug 2013 22:21:01 +0000 (22:21 +0000)]
[lit] Ensure test output is converted to strings where possible.

 - This cleans up the text output of failing tests when run under PY3.

llvm-svn: 188416

11 years agoFix small typo: s/succ/Succ/
Mark Lacey [Wed, 14 Aug 2013 22:11:42 +0000 (22:11 +0000)]
Fix small typo: s/succ/Succ/

llvm-svn: 188415

11 years agoRelax testcase for r188400 to not test for forward-slashes as path separators.
Adrian Prantl [Wed, 14 Aug 2013 22:10:17 +0000 (22:10 +0000)]
Relax testcase for r188400 to not test for forward-slashes as path separators.

llvm-svn: 188414

11 years agoRelax complete-type check for functions and function pointers to allow void return...
Howard Hinnant [Wed, 14 Aug 2013 21:28:31 +0000 (21:28 +0000)]
Relax complete-type check for functions and function pointers to allow void return type.  This bug was exposed by Eli Friedman's commit to clang r188324.  Anywhere this version of clang ships, this libc++ fix must follow.  However this fix is compatible with previous clangs, and so this libc++ doesn't need to wait for this clang.

llvm-svn: 188413

11 years agoDataFlowSanitizer: Instrumentation for memset.
Peter Collingbourne [Wed, 14 Aug 2013 20:51:38 +0000 (20:51 +0000)]
DataFlowSanitizer: Instrumentation for memset.

Differential Revision: http://llvm-reviews.chandlerc.com/D1395

llvm-svn: 188412

11 years ago[dfsan] New __dfsan_set_label runtime function.
Peter Collingbourne [Wed, 14 Aug 2013 20:51:33 +0000 (20:51 +0000)]
[dfsan] New __dfsan_set_label runtime function.

Differential Revision: http://llvm-reviews.chandlerc.com/D1396

llvm-svn: 188411

11 years agoPR16875: The return type of a dependent function type is visible when it's
Richard Smith [Wed, 14 Aug 2013 20:16:31 +0000 (20:16 +0000)]
PR16875: The return type of a dependent function type is visible when it's
referenced as a member of the current instantiation. In that case, deduce the
type of the function to a dependent type rather than exposing an undeduced auto
type to the rest of the current instantiation.

The standard doesn't really say that the type is dependent in this case; I'll
bring this up with CWG.

llvm-svn: 188410

11 years agoBug fix: note diagnosis on expression narrowing should say "variable template" instea...
Larisse Voufo [Wed, 14 Aug 2013 20:15:02 +0000 (20:15 +0000)]
Bug fix: note diagnosis on expression narrowing should say "variable template" instead of "static data member" when appropriate

llvm-svn: 188409

11 years agoFix grammar mistake.
Shuxin Yang [Wed, 14 Aug 2013 20:07:23 +0000 (20:07 +0000)]
Fix grammar mistake.

Thank Richard Smith for figuring out this problem.

llvm-svn: 188408

11 years agoActually fix PPC64 64-bit GPR inline asm constraint matching
Hal Finkel [Wed, 14 Aug 2013 20:05:04 +0000 (20:05 +0000)]
Actually fix PPC64 64-bit GPR inline asm constraint matching

This is a follow-up to r187693, correcting that code to request the correct
register class. The previous version, with the wrong register class, was not
really correcting the constraints, but rather was removing them. Coincidentally,
this fixed the failing test case in r187693, but obviously created other
problems.

llvm-svn: 188407

11 years agoDo no use -emit-llvm for -flto.
Shuxin Yang [Wed, 14 Aug 2013 19:45:49 +0000 (19:45 +0000)]
Do no use -emit-llvm for -flto.

Tested on multiple OSes.

llvm-svn: 188406

11 years agoTestcase for r188400.
Benjamin Kramer [Wed, 14 Aug 2013 19:45:27 +0000 (19:45 +0000)]
Testcase for r188400.

llvm-svn: 188405

11 years agocpp11-migrate: Remove mention of 'headers' from serialization code
Edwin Vane [Wed, 14 Aug 2013 19:02:28 +0000 (19:02 +0000)]
cpp11-migrate: Remove mention of 'headers' from serialization code

* HeaderChangeDocument -> MigratorDocument
* HeaderFileName -> TargetFile
* SourceFileName -> MainSourceFile
* Removed TransformID
* Comments updated, at least with respect to serialization
* Unit tests updated.

Differential Revision: http://llvm-reviews.chandlerc.com/D1403

llvm-svn: 188404

11 years agoAdd support for -fsanitize-blacklist and default blacklists for DFSan.
Peter Collingbourne [Wed, 14 Aug 2013 18:54:18 +0000 (18:54 +0000)]
Add support for -fsanitize-blacklist and default blacklists for DFSan.
Also add some documentation.

Differential Revision: http://llvm-reviews.chandlerc.com/D1346

llvm-svn: 188403

11 years agoDataFlowSanitizer: greylist is now ABI list.
Peter Collingbourne [Wed, 14 Aug 2013 18:54:12 +0000 (18:54 +0000)]
DataFlowSanitizer: greylist is now ABI list.

This replaces the old incomplete greylist functionality with an ABI
list, which can provide more detailed information about the ABI and
semantics of specific functions.  The pass treats every function in
the "uninstrumented" category in the ABI list file as conforming to
the "native" (i.e. unsanitized) ABI.  Unless the ABI list contains
additional categories for those functions, a call to one of those
functions will produce a warning message, as the labelling behaviour
of the function is unknown.  The other supported categories are
"functional", "discard" and "custom".

- "discard" -- This function does not write to (user-accessible) memory,
  and its return value is unlabelled.
- "functional" -- This function does not write to (user-accessible)
  memory, and the label of its return value is the union of the label of
  its arguments.
- "custom" -- Instead of calling the function, a custom wrapper __dfsw_F
  is called, where F is the name of the function.  This function may wrap
  the original function or provide its own implementation.

Differential Revision: http://llvm-reviews.chandlerc.com/D1345

llvm-svn: 188402

11 years ago[dfsan] Runtime support for ABI list functionality; can now run integration tests...
Peter Collingbourne [Wed, 14 Aug 2013 18:54:06 +0000 (18:54 +0000)]
[dfsan] Runtime support for ABI list functionality; can now run integration tests with args ABI.

Differential Revision: http://llvm-reviews.chandlerc.com/D1351

llvm-svn: 188401

11 years agoEnhance the clang -v gcc debug printing to skip obviously bad and duplicate paths.
Benjamin Kramer [Wed, 14 Aug 2013 18:38:51 +0000 (18:38 +0000)]
Enhance the clang -v gcc debug printing to skip obviously bad and duplicate paths.

Otherwise it lists all files (e.g. shared libraries) that happen to be in the
same paths the GCC installations usually reside in.

On a x86_64 Debian 7 system with i386 multilibs.
before: clang -v 2>&1|wc -l
        3059
after:  clang -v 2>&1|wc -l
        10

llvm-svn: 188400

11 years ago[lit] Support parsing scripts with inconsistent or invalid encodings.
Daniel Dunbar [Wed, 14 Aug 2013 18:22:41 +0000 (18:22 +0000)]
[lit] Support parsing scripts with inconsistent or invalid encodings.

 - For whatever reason, we have a lot of test files with bogus unicode
   characters. This patch allows those scripts to still be parsed on Python3 by
   changing the parsing logic to work on binary files, and only require the
   actual script commands to be convertible to ascii.

 - This patch has been tweaked to now ensure that the command strings are not of
   unicode type on Python 2.6-7.

llvm-svn: 188398

11 years agoUse the MSVC __cpuid intrinsic instead of inline asm
Reid Kleckner [Wed, 14 Aug 2013 18:21:51 +0000 (18:21 +0000)]
Use the MSVC __cpuid intrinsic instead of inline asm

This works around PR16830 in LLVM when self-hosting clang on Windows.

llvm-svn: 188397

11 years agoXing Xue: port to IBM XLC++/AIX.
Howard Hinnant [Wed, 14 Aug 2013 18:00:20 +0000 (18:00 +0000)]
Xing Xue:  port to IBM XLC++/AIX.

llvm-svn: 188396

11 years agoFix signed/unsigned warnings when building libc++ in C++14 mode
Marshall Clow [Wed, 14 Aug 2013 17:53:31 +0000 (17:53 +0000)]
Fix signed/unsigned warnings when building libc++ in C++14 mode

llvm-svn: 188395

11 years agocpp11-migrate: Fixing doxygen warnings
Tareq A. Siraj [Wed, 14 Aug 2013 17:47:39 +0000 (17:47 +0000)]
cpp11-migrate: Fixing doxygen warnings

For some reason doxygen doesn't seem to like the using namespace
clang::tooling in the source file and complaints about missing class
members.

Also fixed missing parameter documentation for TransformName in
SourceOverrides::applyReplacements().

Differential Revision: http://llvm-reviews.chandlerc.com/D1400

llvm-svn: 188394

11 years agoRemove unnecessary parameter to RenumberValues.
Jakob Stoklund Olesen [Wed, 14 Aug 2013 17:28:52 +0000 (17:28 +0000)]
Remove unnecessary parameter to RenumberValues.

Patch by Matthias Braun!

llvm-svn: 188393