platform/upstream/llvm.git
11 years ago[sanitizer] Fix handling of edge cases in mbstowcs-like interceptors.
Evgeniy Stepanov [Wed, 10 Jul 2013 14:01:51 +0000 (14:01 +0000)]
[sanitizer] Fix handling of edge cases in mbstowcs-like interceptors.

llvm-svn: 186002

11 years agoReverting commit r185999 due to buildboot failure.
Vladimir Medic [Wed, 10 Jul 2013 12:27:25 +0000 (12:27 +0000)]
Reverting commit r185999 due to buildboot failure.

llvm-svn: 186001

11 years agoReverting commit r185999 due to buildboot failure.
Vladimir Medic [Wed, 10 Jul 2013 12:26:26 +0000 (12:26 +0000)]
Reverting commit r185999 due to buildboot failure.

llvm-svn: 186000

11 years agoAdd support for Mips break and syscall insructions. The corresponding test cases...
Vladimir Medic [Wed, 10 Jul 2013 10:18:10 +0000 (10:18 +0000)]
Add support for Mips break and syscall insructions. The corresponding test cases are added.

llvm-svn: 185999

11 years agoFix a bug in the readdir_r interceptor: when we reach the end of the
Chandler Carruth [Wed, 10 Jul 2013 09:50:29 +0000 (09:50 +0000)]
Fix a bug in the readdir_r interceptor: when we reach the end of the
directory stream, the entry is not written to, instead *result is set to
NULL and the entry is not written to at all.

I'm still somewhat suspicious of the correct instrumention here --
I feel like it should be marking the written range as the pointer in
*result and the length (*result)->d_reclen in case the implementation
decides not to use the passed-in entry (if that's even allowed).
Finally, the definition of 'struct dirent' analog used in the
interceptor is wrong in 32-bit mode with _FILE_OFFSET_BITS=64 as it hard
codes the use of a pointer-sized offset.

I've added a somewhat goofy test for the bug I fixed via ASan --
suggestions on how to better test the interceptor logic itself welcome.

llvm-svn: 185998

11 years agoFixed comment of Sema::FindInstantiatedDecl.
Serge Pavlov [Wed, 10 Jul 2013 04:59:14 +0000 (04:59 +0000)]
Fixed comment of Sema::FindInstantiatedDecl.

llvm-svn: 185997

11 years agoCall xmlFree on the node contents returned by xmlNodeGetContent, as the docs say...
Jim Ingham [Wed, 10 Jul 2013 02:21:57 +0000 (02:21 +0000)]
Call xmlFree on the node contents returned by xmlNodeGetContent, as the docs say to do.

<rdar://problem/14391836>

llvm-svn: 185996

11 years agoFix typo
Stephen Lin [Wed, 10 Jul 2013 01:57:39 +0000 (01:57 +0000)]
Fix typo

llvm-svn: 185995

11 years agoExplicitly define ARMISelLowering::isFMAFasterThanFMulAndFAdd. No functionality change.
Stephen Lin [Wed, 10 Jul 2013 01:54:24 +0000 (01:54 +0000)]
Explicitly define ARMISelLowering::isFMAFasterThanFMulAndFAdd. No functionality change.

Currently ARM is the only backend that supports FMA instructions (for at least some subtargets) but does not implement this virtual, so FMAs are never generated except from explicit fma intrinsic calls. Apparently this is due to the fact that it supports both fused (one rounding step) and unfused (two rounding step) multiply + add instructions. This patch clarifies that this the case without changing behavior by implementing the virtual function to simply return false, as the default TargetLoweringBase version does.

It is possible that some cpus perform the fused version faster than the unfused version and vice-versa, so the function implementation should be revisited if hard data is found.

llvm-svn: 185994

11 years agoUn-break the buildbot by tweaking the indirection flag.
Adrian Prantl [Wed, 10 Jul 2013 01:53:37 +0000 (01:53 +0000)]
Un-break the buildbot by tweaking the indirection flag.
Pulled in a testcase from the debuginfo-test suite.

llvm-svn: 185993

11 years agoDocument a known limitation of the status quo.
Adrian Prantl [Wed, 10 Jul 2013 01:53:30 +0000 (01:53 +0000)]
Document a known limitation of the status quo.

llvm-svn: 185992

11 years agoFinish off mangling locals in block literals.
Eli Friedman [Wed, 10 Jul 2013 01:33:19 +0000 (01:33 +0000)]
Finish off mangling locals in block literals.

Specifically, handle the case where the block is in a default argument
in a class method.  The mangling here follows what we do for lambdas.

llvm-svn: 185991

11 years agoCleanup on the unified section list changes. Main changes are:
Greg Clayton [Wed, 10 Jul 2013 01:23:25 +0000 (01:23 +0000)]
Cleanup on the unified section list changes. Main changes are:
- ObjectFile::GetSymtab() and ObjectFile::ClearSymtab() no longer takes any flags
- Module coordinates with the object files and contain a unified section list so that object file and symbol file can share sections when they need to, yet contain their own sections.

Other cleanups:
- Fixed Symbol::GetByteSize() to not have the symbol table compute the byte sizes on the fly
- Modified the ObjectFileMachO class to compute symbol sizes all at once efficiently
- Modified the Symtab class to store a file address lookup table for more efficient lookups
- Removed Section::Finalize() and SectionList::Finalize() as they did nothing
- Improved performance of the detection of symbol files that have debug maps by excluding stripped files and core files, debug files, object files and stubs
- Added the ability to tell if an ObjectFile has been stripped with ObjectFile::IsStripped() (used this for the above performance improvement)

llvm-svn: 185990

11 years agoGet rid of dead/useless code for block mangling.
Eli Friedman [Wed, 10 Jul 2013 01:13:27 +0000 (01:13 +0000)]
Get rid of dead/useless code for block mangling.

llvm-svn: 185989

11 years agoFixed the CommunicationKDP::SendRequestAndGetReply() to correctly be able to deal...
Greg Clayton [Wed, 10 Jul 2013 01:05:05 +0000 (01:05 +0000)]
Fixed the CommunicationKDP::SendRequestAndGetReply() to correctly be able to deal with getting a reply from a previous packet without resending the packet again.

llvm-svn: 185988

11 years agoCorrect comment.
Duncan Sands [Wed, 10 Jul 2013 00:52:41 +0000 (00:52 +0000)]
Correct comment.

llvm-svn: 185987

11 years agoMore local mangling fixes.
Eli Friedman [Wed, 10 Jul 2013 00:30:46 +0000 (00:30 +0000)]
More local mangling fixes.

Compute mangling numbers for externally visible local variables and tags.
Change the mangler to consistently use discriminators where necessary.
Tweak the scheme we use to number decls which are not externally visible
to avoid unnecessary discriminators in common cases now that we request
them more consistently.

Fixes <rdar://problem/14204721>.

llvm-svn: 185986

11 years agoobjc migrator: More refinment of property
Fariborz Jahanian [Wed, 10 Jul 2013 00:20:11 +0000 (00:20 +0000)]
objc migrator: More refinment of property
attributes in migration. Specialli use of
'copy' attribute for retainable object types.

llvm-svn: 185985

11 years agoFix comment.
Eric Christopher [Tue, 9 Jul 2013 23:48:45 +0000 (23:48 +0000)]
Fix comment.

llvm-svn: 185984

11 years agoAdd silent option to command source.
Michael Sartain [Tue, 9 Jul 2013 23:22:53 +0000 (23:22 +0000)]
Add silent option to command source.
Patch from Matthew Sorrels

llvm-svn: 185983

11 years agoARM: Fix incorrect pack pattern for thumb2
Jim Grosbach [Tue, 9 Jul 2013 22:59:22 +0000 (22:59 +0000)]
ARM: Fix incorrect pack pattern for thumb2

Propagate the fix from r185712 to Thumb2 codegen as well. Original
commit message applies here as well:

A "pkhtb x, x, y asr #num" uses the lower 16 bits of "y asr #num" and
packs them in the bottom half of "x". An arithmetic and logic shift are
only equivalent in this context if the shift amount is 16. We would be
shifting in ones into the bottom 16bits instead of zeros if "y" is
negative.

rdar://14338767

llvm-svn: 185982

11 years agoReverting ProcessMonitor shared pointer changes
Andrew Kaylor [Tue, 9 Jul 2013 22:36:48 +0000 (22:36 +0000)]
Reverting ProcessMonitor shared pointer changes

llvm-svn: 185981

11 years ago[asan] Update blacklists to use categories.
Peter Collingbourne [Tue, 9 Jul 2013 22:04:28 +0000 (22:04 +0000)]
[asan] Update blacklists to use categories.

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

llvm-svn: 185980

11 years agoApply BlackList -> SpecialCaseList rename in Clang.
Peter Collingbourne [Tue, 9 Jul 2013 22:03:30 +0000 (22:03 +0000)]
Apply BlackList -> SpecialCaseList rename in Clang.

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

llvm-svn: 185979

11 years agoImplement categories for special case lists.
Peter Collingbourne [Tue, 9 Jul 2013 22:03:17 +0000 (22:03 +0000)]
Implement categories for special case lists.

A special case list can now specify categories for specific globals,
which can be used to instruct an instrumentation pass to treat certain
functions or global variables in a specific way, such as by omitting
certain aspects of instrumentation while keeping others, or informing
the instrumentation pass that a specific uninstrumentable function
has certain semantics, thus allowing the pass to instrument callers
according to those semantics.

For example, AddressSanitizer now uses the "init" category instead of
global-init prefixes for globals whose initializers should not be
instrumented, but which in all other respects should be instrumented.

The motivating use case is DataFlowSanitizer, which will have a
number of different categories for uninstrumentable functions, such
as "functional" which specifies that a function has pure functional
semantics, or "discard" which indicates that a function's return
value should not be labelled.

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

llvm-svn: 185978

11 years agoAdd some SpecialCaseList unit tests.
Peter Collingbourne [Tue, 9 Jul 2013 22:03:12 +0000 (22:03 +0000)]
Add some SpecialCaseList unit tests.

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

llvm-svn: 185977

11 years agoIntroduce a SpecialCaseList ctor which takes a MemoryBuffer to make
Peter Collingbourne [Tue, 9 Jul 2013 22:03:09 +0000 (22:03 +0000)]
Introduce a SpecialCaseList ctor which takes a MemoryBuffer to make
it more unit testable, and fix memory leak in the other ctor.

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

llvm-svn: 185976

11 years agoRename BlackList class to SpecialCaseList and move it to Transforms/Utils.
Peter Collingbourne [Tue, 9 Jul 2013 22:02:49 +0000 (22:02 +0000)]
Rename BlackList class to SpecialCaseList and move it to Transforms/Utils.

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

llvm-svn: 185975

11 years agoObjective-C: merge objc_requires_super attribute of
Fariborz Jahanian [Tue, 9 Jul 2013 22:02:20 +0000 (22:02 +0000)]
Objective-C: merge objc_requires_super attribute of
method declaration into its implementation to
prevent a bogus warning about mismatched attributes.
then make sure the warning about missing call to super comes out
of the method implementation. // rdar://14251387

llvm-svn: 185974

11 years agoInstSimplify: X >> X -> 0
David Majnemer [Tue, 9 Jul 2013 22:01:22 +0000 (22:01 +0000)]
InstSimplify: X >> X -> 0

llvm-svn: 185973

11 years agomove test into the appropriate subdir.
Adrian Prantl [Tue, 9 Jul 2013 21:44:11 +0000 (21:44 +0000)]
move test into the appropriate subdir.

llvm-svn: 185972

11 years agoTypo.
Adrian Prantl [Tue, 9 Jul 2013 21:44:06 +0000 (21:44 +0000)]
Typo.

llvm-svn: 185971

11 years agoFix PR16571, which is a bug in the code that checks that all of the types in the...
Nadav Rotem [Tue, 9 Jul 2013 21:38:08 +0000 (21:38 +0000)]
Fix PR16571, which is a bug in the code that checks that all of the types in the bundle are uniform.

llvm-svn: 185970

11 years agomove __save_flags from <random> to <ios> in preparation for reuse; no functionality...
Marshall Clow [Tue, 9 Jul 2013 20:34:14 +0000 (20:34 +0000)]
move __save_flags from <random> to <ios> in preparation for reuse; no functionality change

llvm-svn: 185968

11 years agoReapply an improved version of r180816/180817.
Adrian Prantl [Tue, 9 Jul 2013 20:29:03 +0000 (20:29 +0000)]
Reapply an improved version of r180816/180817.

Do not generate VLAs as complex variables any more, as they are now
correctly represented as breg+0 locations in the backend.

(Paired commit with LLVM: r185966)

rdar://problem/13658587

llvm-svn: 185967

11 years agoReapply an improved version of r180816/180817.
Adrian Prantl [Tue, 9 Jul 2013 20:28:37 +0000 (20:28 +0000)]
Reapply an improved version of r180816/180817.

Change the informal convention of DBG_VALUE machine instructions so that
we can express a register-indirect address with an offset of 0.
The old convention was that a DBG_VALUE is a register-indirect value if
the offset (operand 1) is nonzero. The new convention is that a DBG_VALUE
is register-indirect if the first operand is a register and the second
operand is an immediate. For plain register values the combination reg,
reg is used. MachineInstrBuilder::BuildMI knows how to build the new
DBG_VALUES.

rdar://problem/13658587

llvm-svn: 185966

11 years agoSecond attempt at getting the PyCallable changes in trunk
Enrico Granata [Tue, 9 Jul 2013 20:14:26 +0000 (20:14 +0000)]
Second attempt at getting the PyCallable changes in trunk

Thanks to Daniel Malea for helping test this patch for Linux happiness!

llvm-svn: 185965

11 years agoFixed up the comments in FastISel.h so that they conform to the LLVM style guide.
Michael Gottesman [Tue, 9 Jul 2013 20:08:46 +0000 (20:08 +0000)]
Fixed up the comments in FastISel.h so that they conform to the LLVM style guide.

llvm-svn: 185964

11 years agoAdded "mode: c++" to FastISel.h header.
Michael Gottesman [Tue, 9 Jul 2013 20:00:25 +0000 (20:00 +0000)]
Added "mode: c++" to FastISel.h header.

llvm-svn: 185963

11 years agoAppease buildbots after r185956: just set -mcpu explicitly, as it should have been...
Stephen Lin [Tue, 9 Jul 2013 19:27:10 +0000 (19:27 +0000)]
Appease buildbots after r185956: just set -mcpu explicitly, as it should have been from the beginning.

llvm-svn: 185962

11 years agoAppease Atom buildbot after r185956 (explicitly turn on AVX)
Stephen Lin [Tue, 9 Jul 2013 18:55:52 +0000 (18:55 +0000)]
Appease Atom buildbot after r185956 (explicitly turn on AVX)

llvm-svn: 185961

11 years agoWidenVecRes_BUILD_VECTOR must use the first operand's type
Hal Finkel [Tue, 9 Jul 2013 18:55:10 +0000 (18:55 +0000)]
WidenVecRes_BUILD_VECTOR must use the first operand's type

Because integer BUILD_VECTOR operands may have a larger type than the result's
vector element type, and all operands must have the same type, when widening a
BUILD_VECTOR node by adding UNDEFs, we cannot use the vector element type, but
rather must use the type of the existing operands.

Another bug found by llvm-stress.

llvm-svn: 185960

11 years ago[PowerPC] Better fix for PR16556.
Bill Schmidt [Tue, 9 Jul 2013 18:50:20 +0000 (18:50 +0000)]
[PowerPC] Better fix for PR16556.

A more complete example of the bug in PR16556 was recently provided,
showing that the previous fix was not sufficient.  The previous fix is
reverted herein.

The real problem is that ReplaceNodeResults() uses LowerFP_TO_INT as
custom lowering for FP_TO_SINT during type legalization, without
checking whether the input type is handled by that routine.
LowerFP_TO_INT requires the input to be f32 or f64, so we fail when
the input is ppcf128.

I'm leaving the test case from the initial fix (r185821) in place, and
adding the new test as another crash-only check.

llvm-svn: 185959

11 years agoAttempt to appease buildbot after r185956 by explicitly turning setting -fma,-fma4...
Stephen Lin [Tue, 9 Jul 2013 18:41:43 +0000 (18:41 +0000)]
Attempt to appease buildbot after r185956 by explicitly turning setting -fma,-fma4 attrs (I'm assuming they're set because the bot is running on machine that has one or the other.)

llvm-svn: 185958

11 years agoAArch64/PowerPC/SystemZ/X86: This patch fixes the interface, usage, and all
Stephen Lin [Tue, 9 Jul 2013 18:16:56 +0000 (18:16 +0000)]
AArch64/PowerPC/SystemZ/X86: This patch fixes the interface, usage, and all
in-tree implementations of TargetLoweringBase::isFMAFasterThanMulAndAdd in
order to resolve the following issues with fmuladd (i.e. optional FMA)
intrinsics:

1. On X86(-64) targets, ISD::FMA nodes are formed when lowering fmuladd
intrinsics even if the subtarget does not support FMA instructions, leading
to laughably bad code generation in some situations.

2. On AArch64 targets, ISD::FMA nodes are formed for operations on fp128,
resulting in a call to a software fp128 FMA implementation.

3. On PowerPC targets, FMAs are not generated from fmuladd intrinsics on types
like v2f32, v8f32, v4f64, etc., even though they promote, split, scalarize,
etc. to types that support hardware FMAs.

The function has also been slightly renamed for consistency and to force a
merge/build conflict for any out-of-tree target implementing it. To resolve,
see comments and fixed in-tree examples.

llvm-svn: 185956

11 years agoDon't crash in SE dealing with ashr x, -1
Hal Finkel [Tue, 9 Jul 2013 18:16:16 +0000 (18:16 +0000)]
Don't crash in SE dealing with ashr x, -1

ScalarEvolution::getSignedRange uses ComputeNumSignBits from ValueTracking on
ashr instructions. ComputeNumSignBits can return zero, but this case was not
handled correctly by the code in getSignedRange which was calling:
  APInt::getSignedMinValue(BitWidth).ashr(NS - 1)
with NS = 0, resulting in an assertion failure in APInt::ashr.

Now, we just return the conservative result (as with NS == 1).

Another bug found by llvm-stress.

llvm-svn: 185955

11 years agoValueTracking: Fix bugs in isKnownToBeAPowerOfTwo
David Majnemer [Tue, 9 Jul 2013 18:11:10 +0000 (18:11 +0000)]
ValueTracking: Fix bugs in isKnownToBeAPowerOfTwo

(add nsw x, (and x, y)) isn't a power of two if x is zero, it's zero
(add nsw x, (xor x, y)) isn't a power of two if y has bits set that aren't set in x

llvm-svn: 185954

11 years agoSet the default insert point to the first instruction, and not to end()
Nadav Rotem [Tue, 9 Jul 2013 17:55:36 +0000 (17:55 +0000)]
Set the default insert point to the first instruction, and not to end()

llvm-svn: 185953

11 years agoIRBuilder: add an assertion that checks if we try to get a debug loc from ->end();
Nadav Rotem [Tue, 9 Jul 2013 17:54:22 +0000 (17:54 +0000)]
IRBuilder: add an assertion that checks if we try to get a debug loc from ->end();

llvm-svn: 185952

11 years agoCleanup in TestConcurrentEvents.py
Daniel Malea [Tue, 9 Jul 2013 17:36:18 +0000 (17:36 +0000)]
Cleanup in TestConcurrentEvents.py
- re-enable tests fixed by Matt's commit this morning (addressed llvm.org/pr16567)
- disabled tests affected by new bug llvm.org/pr16575
- removed some commented out code in inferior

llvm-svn: 185951

11 years agoBill Fisher: This patch fixes a bug where regex_iterator doesn't indicate when it...
Howard Hinnant [Tue, 9 Jul 2013 17:29:09 +0000 (17:29 +0000)]
Bill Fisher: This patch fixes a bug where regex_iterator doesn't indicate when it's restarting in the middle of a string. This bug causes /^a/ to match in the middle of the string "aaaaaaa", during iteration.

My patch uses  to communicate when  is false.

llvm-svn: 185950

11 years agoDAGCombine tryFoldToZero cannot create illegal types after type legalization
Hal Finkel [Tue, 9 Jul 2013 17:02:45 +0000 (17:02 +0000)]
DAGCombine tryFoldToZero cannot create illegal types after type legalization

When folding sub x, x (and other similar constructs), where x is a vector, the
result is a vector of zeros. After type legalization, make sure that the input
zero elements have a legal type. This type may be larger than the result's
vector element type.

This was another bug found by llvm-stress.

llvm-svn: 185949

11 years agoObjC migrator: Add -objcmt-migrate-property to do property
Fariborz Jahanian [Tue, 9 Jul 2013 16:59:14 +0000 (16:59 +0000)]
ObjC migrator: Add -objcmt-migrate-property to do property
migration. Also, fixes an old bug where older migration
flags were not being checked for properly.

llvm-svn: 185948

11 years agoChange TestRegisters.py attach case to attach to a.out and enable that test case
Andrew Kaylor [Tue, 9 Jul 2013 16:48:30 +0000 (16:48 +0000)]
Change TestRegisters.py attach case to attach to a.out and enable that test case

llvm-svn: 185947

11 years agoUse shared pointers to hold the process in ProcessMonitor
Andrew Kaylor [Tue, 9 Jul 2013 16:44:27 +0000 (16:44 +0000)]
Use shared pointers to hold the process in ProcessMonitor

llvm-svn: 185946

11 years ago[PowerPC] Revert r185476 and fix up TLS variant kinds
Ulrich Weigand [Tue, 9 Jul 2013 16:41:09 +0000 (16:41 +0000)]
[PowerPC] Revert r185476 and fix up TLS variant kinds

In the commit message to r185476 I wrote:

>The PowerPC-specific modifiers VK_PPC_TLSGD and VK_PPC_TLSLD
>correspond exactly to the generic modifiers VK_TLSGD and VK_TLSLD.
>This causes some confusion with the asm parser, since VK_PPC_TLSGD
>is output as @tlsgd, which is then read back in as VK_TLSGD.
>
>To avoid this confusion, this patch removes the PowerPC-specific
>modifiers and uses the generic modifiers throughout.  (The only
>drawback is that the generic modifiers are printed in upper case
>while the usual convention on PowerPC is to use lower-case modifiers.
>But this is just a cosmetic issue.)

This was unfortunately incorrect, there is is fact another,
serious drawback to using the default VK_TLSLD/VK_TLSGD
variant kinds: using these causes ELFObjectWriter::RelocNeedsGOT
to return true, which in turn causes the ELFObjectWriter to emit
an undefined reference to _GLOBAL_OFFSET_TABLE_.

This is a problem on powerpc64, because it uses the TOC instead
of the GOT, and the linker does not provide _GLOBAL_OFFSET_TABLE_,
so the symbol remains undefined.  This means shared libraries
using TLS built with the integrated assembler are currently
broken.

While the whole RelocNeedsGOT / _GLOBAL_OFFSET_TABLE_ situation
probably ought to be properly fixed at some point, for now I'm
simply reverting the r185476 commit.  Now this in turn exposes
the breakage of handling @tlsgd/@tlsld in the asm parser that
this check-in was originally intended to fix.

To avoid this regression, I'm also adding a different fix for
this problem: while common code now parses @tlsgd as VK_TLSGD,
a special hack in the asm parser translates this code to the
platform-specific VK_PPC_TLSGD that the back-end now expects.
While this is not really pretty, it's self-contained and
shouldn't hurt anything else for now.  One the underlying
problem is fixed, this hack can be reverted again.

llvm-svn: 185945

11 years agoFix signal handling for POSIX (only tested on Linux) processes in multi-threaded...
Matt Kopec [Tue, 9 Jul 2013 15:09:45 +0000 (15:09 +0000)]
Fix signal handling for POSIX (only tested on Linux) processes in multi-threaded programs.
Also fix a related issue where if a thread exits after a thread continue, lldb would hang.

llvm-svn: 185944

11 years agoR600: Do not predicated basic block with multiple alu clause
Vincent Lejeune [Tue, 9 Jul 2013 15:03:33 +0000 (15:03 +0000)]
R600: Do not predicated basic block with multiple alu clause

Test is not included as it is several 1000 lines long.
To test this functionnality, a test case must generate at least 2 ALU clauses,
where an ALU clause is ~110 instructions long.

NOTE: This is a candidate for the stable branch.
llvm-svn: 185943

11 years agoR600: Fix a rare bug where swizzle optimization returns wrong values
Vincent Lejeune [Tue, 9 Jul 2013 15:03:25 +0000 (15:03 +0000)]
R600: Fix a rare bug where swizzle optimization returns wrong values

llvm-svn: 185942

11 years agoR600: Fix wrong export reswizzling
Vincent Lejeune [Tue, 9 Jul 2013 15:03:19 +0000 (15:03 +0000)]
R600: Fix wrong export reswizzling

llvm-svn: 185941

11 years agoR600: Use DAG lowering pass to handle fcos/fsin
Vincent Lejeune [Tue, 9 Jul 2013 15:03:11 +0000 (15:03 +0000)]
R600: Use DAG lowering pass to handle fcos/fsin

NOTE: This is a candidate for the stable branch.
llvm-svn: 185940

11 years agoR600: Print Export Swizzle
Vincent Lejeune [Tue, 9 Jul 2013 15:03:03 +0000 (15:03 +0000)]
R600: Print Export Swizzle

llvm-svn: 185939

11 years agoInitial support for formatting trailing return types.
Daniel Jasper [Tue, 9 Jul 2013 14:36:48 +0000 (14:36 +0000)]
Initial support for formatting trailing return types.

This fixes llvm.org/PR15170.

For now, the basic formatting rules are (based on the C++11 standard):
* Surround the "->" with spaces.
* Break before "->".

Also fix typo.

llvm-svn: 185938

11 years agoAdd missing getters. They will be used in llvm-ar.
Rafael Espindola [Tue, 9 Jul 2013 12:49:24 +0000 (12:49 +0000)]
Add missing getters. They will be used in llvm-ar.

llvm-svn: 185937

11 years agoArchive members cannot be larger than 4GB. Return a uint32_t.
Rafael Espindola [Tue, 9 Jul 2013 12:45:11 +0000 (12:45 +0000)]
Archive members cannot be larger than 4GB. Return a uint32_t.

llvm-svn: 185936

11 years ago[sanitizer] Update glob64 interceptor to handle GLOB_ALTDIRFUNC as well.
Evgeniy Stepanov [Tue, 9 Jul 2013 12:34:25 +0000 (12:34 +0000)]
[sanitizer] Update glob64 interceptor to handle GLOB_ALTDIRFUNC as well.

llvm-svn: 185935

11 years agoWe never compare iterators from two archives. Assert that.
Rafael Espindola [Tue, 9 Jul 2013 12:30:10 +0000 (12:30 +0000)]
We never compare iterators from two archives. Assert that.

llvm-svn: 185934

11 years agoAdd getHeader helper and move ToHeader to the cpp file.
Rafael Espindola [Tue, 9 Jul 2013 12:22:05 +0000 (12:22 +0000)]
Add getHeader helper and move ToHeader to the cpp file.

llvm-svn: 185933

11 years ago[sanitizer] Support GLOB_ALTDIRFUNC in glob interceptor.
Evgeniy Stepanov [Tue, 9 Jul 2013 12:07:59 +0000 (12:07 +0000)]
[sanitizer] Support GLOB_ALTDIRFUNC in glob interceptor.

llvm-svn: 185932

11 years agoArrayRef'ize Sema::FinalizeDeclaratorGroup, Sema::BuildDeclaratorGroup and
Rafael Espindola [Tue, 9 Jul 2013 12:05:01 +0000 (12:05 +0000)]
ArrayRef'ize Sema::FinalizeDeclaratorGroup, Sema::BuildDeclaratorGroup and
Sema::ActOnDocumentableDecls.

Patch by Robert Wilhelm.

llvm-svn: 185931

11 years agoAvoid confusing indentations for chained function calls.
Daniel Jasper [Tue, 9 Jul 2013 11:57:27 +0000 (11:57 +0000)]
Avoid confusing indentations for chained function calls.

Basically treat a function with a trailing call similar to a function
with multiple parameters.

Before:
  aaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
      aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa))
      .aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa();

After:
  aaaaaaaaaaaaaaaaaaaa(aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa(
                           aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa))
      .aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa();

Also fix typo.

llvm-svn: 185930

11 years agoAdd MC assembly/disassembly support for VRINT{A, N, P, M} to V8FP.
Joey Gouly [Tue, 9 Jul 2013 11:26:18 +0000 (11:26 +0000)]
Add MC assembly/disassembly support for VRINT{A, N, P, M} to V8FP.

llvm-svn: 185929

11 years agoc-index-test/CMakeLists.txt: Suggest -isystem to include libxml2 with include_directo...
NAKAMURA Takumi [Tue, 9 Jul 2013 11:14:30 +0000 (11:14 +0000)]
c-index-test/CMakeLists.txt: Suggest -isystem to include libxml2 with include_directories(SYSTEM).

llvm-svn: 185928

11 years agoc-index-test/Makefile: Use -isystem instead of -I on $(LIBXML2_INC) with -Wdocumentation.
NAKAMURA Takumi [Tue, 9 Jul 2013 11:14:24 +0000 (11:14 +0000)]
c-index-test/Makefile: Use -isystem instead of -I on $(LIBXML2_INC) with -Wdocumentation.

-Wdocumentation won't seek -isystem. LIBXML2's headers in a certain distro might be incompatible to -Wdocumentation.

FIXME: Could autoconf detect clang or availability of -isystem?
llvm-svn: 185927

11 years agoAdd MC assembly/disassembly support for VRINT{Z, X, R} to V8FP.
Joey Gouly [Tue, 9 Jul 2013 11:03:21 +0000 (11:03 +0000)]
Add MC assembly/disassembly support for VRINT{Z, X, R} to V8FP.

llvm-svn: 185926

11 years agoDocument LLVM_USE_SANITIZER CMake option
Alexey Samsonov [Tue, 9 Jul 2013 10:56:13 +0000 (10:56 +0000)]
Document LLVM_USE_SANITIZER CMake option

llvm-svn: 185925

11 years ago[PowerPC] Support ".machine any"
Ulrich Weigand [Tue, 9 Jul 2013 10:00:34 +0000 (10:00 +0000)]
[PowerPC] Support ".machine any"

The PowerPC assembler is supposed to provide a directive .machine
that allows switching the supported CPU instruction set on the fly.
Since we do not yet check CPU feature sets at all and always accept
any available instruction, this is not really useful at this point.

However, it makes sense to accept (and ignore) ".machine any" to
avoid spuriously rejecting existing assembler files that use this.

llvm-svn: 185924

11 years agoRevert r185872 - "Stop emitting weak symbols into the "coal" sections"
Alexander Potapenko [Tue, 9 Jul 2013 10:00:16 +0000 (10:00 +0000)]
Revert r185872 - "Stop emitting weak symbols into the "coal" sections"

This patch broke `make check-asan` on Mac, causing ld warnings like the following one:

ld: warning: direct access in __GLOBAL__I_a to global weak symbol
___asan_mapping_scale means the weak symbol cannot be overridden at
runtime. This was likely caused by different translation units being
compiled with different visibility settings.

The resulting test binaries crashed with incorrect ASan warnings.

llvm-svn: 185923

11 years agoAdd MC assembly/disassembly support for VCVT{A, N, P, M} to V8FP.
Joey Gouly [Tue, 9 Jul 2013 09:59:04 +0000 (09:59 +0000)]
Add MC assembly/disassembly support for VCVT{A, N, P, M} to V8FP.

llvm-svn: 185922

11 years ago[sanitizer] Intercept realpath and canonicalize_file_name.
Evgeniy Stepanov [Tue, 9 Jul 2013 09:53:37 +0000 (09:53 +0000)]
[sanitizer] Intercept realpath and canonicalize_file_name.

Handle realpath(path, NULL) form.

llvm-svn: 185921

11 years ago[sanitizer] Wrap lines >80 chars.
Evgeniy Stepanov [Tue, 9 Jul 2013 09:47:36 +0000 (09:47 +0000)]
[sanitizer] Wrap lines >80 chars.

llvm-svn: 185920

11 years ago[SystemZ] Use MVC for simple load/store pairs
Richard Sandiford [Tue, 9 Jul 2013 09:46:39 +0000 (09:46 +0000)]
[SystemZ] Use MVC for simple load/store pairs

Look for patterns of the form (store (load ...), ...) in which the two
locations are known not to partially overlap.  (Identical locations are OK.)
These sequences are better implemented by MVC unless either the load or
the store could use RELATIVE LONG instructions.

The testcase showed that we weren't using LHRL and LGHRL for extload16,
only sextloadi16.  The patch fixes that too.

llvm-svn: 185919

11 years ago[SystemZ] Use "STC;MVC" for memset
Richard Sandiford [Tue, 9 Jul 2013 09:32:42 +0000 (09:32 +0000)]
[SystemZ] Use "STC;MVC" for memset

Use "STC;MVC" for memsets that are too big for two STCs or MV...Is yet
small enough for a single MVC.  As with memcpy, I'm leaving longer cases
till later.

The number of tests might seem excessive, but f33 & f34 from memset-04.ll
failed the first cut because I'd not added the "?:" on the calculation
of Size1.

llvm-svn: 185918

11 years ago[asan] Fix windows build.
Evgeniy Stepanov [Tue, 9 Jul 2013 09:29:19 +0000 (09:29 +0000)]
[asan] Fix windows build.

llvm-svn: 185917

11 years agoInstCombine: Fix typo in comment for visitICmpInstWithInstAndIntCst
David Majnemer [Tue, 9 Jul 2013 09:24:35 +0000 (09:24 +0000)]
InstCombine: Fix typo in comment for visitICmpInstWithInstAndIntCst

llvm-svn: 185916

11 years agoInstCombine: variations on 0xffffffff - x >= 4
David Majnemer [Tue, 9 Jul 2013 09:20:58 +0000 (09:20 +0000)]
InstCombine: variations on 0xffffffff - x >= 4

The following transforms are valid if -C is a power of 2:
(icmp ugt (xor X, C), ~C) -> (icmp ult X, C)
(icmp ult (xor X, C), -C) -> (icmp uge X, C)

These are nice, they get rid of the xor.

llvm-svn: 185915

11 years agoFix alignment of closing brace in braced initializers.
Daniel Jasper [Tue, 9 Jul 2013 09:06:29 +0000 (09:06 +0000)]
Fix alignment of closing brace in braced initializers.

Before:
someFunction(OtherParam, BracedList{
                           // comment 1 (Forcing intersting break)
                           param1, param2,
                           // comment 2
                           param3, param4
             });
After:
someFunction(OtherParam, BracedList{
                           // comment 1 (Forcing intersting break)
                           param1, param2,
                           // comment 2
                           param3, param4
                         });

To do so, the UnwrappedLineParser now stores the information about the
kind of brace in the FormatToken.

llvm-svn: 185914

11 years ago[sanitizer] Syscall handlers for clock_gettime and clock_getres.
Evgeniy Stepanov [Tue, 9 Jul 2013 08:54:59 +0000 (08:54 +0000)]
[sanitizer] Syscall handlers for clock_gettime and clock_getres.

llvm-svn: 185913

11 years agoInstCombine: X & -C != -C -> X <= u ~C
David Majnemer [Tue, 9 Jul 2013 08:09:32 +0000 (08:09 +0000)]
InstCombine: X & -C != -C -> X <= u ~C

Tests were added in r185910 somehow.

llvm-svn: 185912

11 years ago[PowerPC] Support .llong and fix .word
Ulrich Weigand [Tue, 9 Jul 2013 07:59:25 +0000 (07:59 +0000)]
[PowerPC] Support .llong and fix .word

This adds support for the .llong PowerPC-specifc assembler directive.
In doing so, I notices that .word is currently incorrect: it is
supposed to define a 2-byte data element, not a 4-byte one.

llvm-svn: 185911

11 years agoCommit r185909 was a misapplied patch, fix it
David Majnemer [Tue, 9 Jul 2013 07:58:32 +0000 (07:58 +0000)]
Commit r185909 was a misapplied patch, fix it

llvm-svn: 185910

11 years agoInstCombine: add more transforms
David Majnemer [Tue, 9 Jul 2013 07:50:59 +0000 (07:50 +0000)]
InstCombine: add more transforms

C1-X <u C2 -> (X|(C2-1)) == C1
C1-X >u C2 -> (X|C2) == C1
X-C1 <u C2 -> (X & -C2) == C1
X-C1 >u C2 -> (X & ~C2) == C1

llvm-svn: 185909

11 years agoFormat overloaded operators like other functions.
Daniel Jasper [Tue, 9 Jul 2013 07:43:55 +0000 (07:43 +0000)]
Format overloaded operators like other functions.

This fixes llvm.org/PR16328 (at least partially).

Before:
SomeLoooooooooooooooooooooooooooooogType operator<<(
    const SomeLooooooooogType &a, const SomeLooooooooogType &b);

After:
SomeLoooooooooooooooooooooooooooooogType
operator<<(const SomeLooooooooogType &a, const SomeLooooooooogType &b);

llvm-svn: 185908

11 years agoPPC: Allocate RS spill slot for unaligned i64 load/store
Hal Finkel [Tue, 9 Jul 2013 06:34:51 +0000 (06:34 +0000)]
PPC: Allocate RS spill slot for unaligned i64 load/store

This fixes another bug found by llvm-stress!

If we happen to be doing an i64 load or store into a stack slot that has less
than a 4-byte alignment, then the frame-index elimination may need to use an
indexed load or store instruction (because the offset may not be a multiple of
4, a requirement of the STD/LD instructions). The extra register needed to hold
the offset comes from the register scavenger, and it is possible that the
scavenger will need to use an emergency spill slot. As a result, we need to
make sure that a spill slot is allocated when doing an i64 load/store into a
less-than-4-byte-aligned stack slot.

Because test cases for things like this tend to be fairly fragile, I've
concatenated a few small bugpoint-reduced test cases together to form the
regression test.

llvm-svn: 185907

11 years agoAdd the frame content dumper function call to one more place.
Jason Molenda [Tue, 9 Jul 2013 05:36:41 +0000 (05:36 +0000)]
Add the frame content dumper function call to one more place.

llvm-svn: 185906

11 years agoCompute the size of an archive member in the constructor.
Rafael Espindola [Tue, 9 Jul 2013 05:26:25 +0000 (05:26 +0000)]
Compute the size of an archive member in the constructor.

It is always computed the same way (by parsing the header). Doing it in the
constructor simplifies the callers a bit.

llvm-svn: 185905

11 years agoRemove declare but not implemented methods.
Rafael Espindola [Tue, 9 Jul 2013 05:09:08 +0000 (05:09 +0000)]
Remove declare but not implemented methods.

llvm-svn: 185904

11 years agoAdd new information gathering to the lldb & simple backtrace methods:
Jason Molenda [Tue, 9 Jul 2013 05:08:14 +0000 (05:08 +0000)]
Add new information gathering to the lldb & simple backtrace methods:
print five words of memory at the beginning of the stack frame so it's
easier to track where an incorrect saved-fp or saved-pc may have come from.

llvm-svn: 185903

11 years ago[PECOFF][Writer] Compute the size of a chunk each time it's added rather than all...
Rui Ueyama [Tue, 9 Jul 2013 04:44:18 +0000 (04:44 +0000)]
[PECOFF][Writer] Compute the size of a chunk each time it's added rather than all at once.

Contents of ".reloc" section depends on the addresses of other sections, so
the section cannot be created until all the other sections are created and get
their memory addresses (RVAs). That means that computation of section size
needs to be at least two pass.

Techynically there's no reason to compute it all at once, but instead we can
compute the address of a section as added to the output file. Doing so helps
us to create ".reloc" section.

llvm-svn: 185902

11 years agoMove some code out of line. No functionality change.
Rafael Espindola [Tue, 9 Jul 2013 03:39:35 +0000 (03:39 +0000)]
Move some code out of line. No functionality change.

llvm-svn: 185901