platform/upstream/llvm.git
11 years ago[analyzer] Tighten up safety in the use of lazy bindings.
Jordan Rose [Thu, 21 Feb 2013 01:34:51 +0000 (01:34 +0000)]
[analyzer] Tighten up safety in the use of lazy bindings.

- When deciding if we can reuse a lazy binding, make sure to check if there
  are additional bindings in the sub-region.
- When reading from a lazy binding, don't accidentally strip off casts or
  base object regions. This slows down lazy binding reading a bit but is
  necessary for type sanity when treating one class as another.

A bit of minor refactoring allowed these two checks to be unified in a nice
early-return-using helper function.

<rdar://problem/13239840>

llvm-svn: 175703

11 years agoIf you say
Enrico Granata [Thu, 21 Feb 2013 01:29:04 +0000 (01:29 +0000)]
If you say
(lldb) frame variable
without first launching the inferior, you get:
error: invalid frame

this is misleading and should probably hint that there is no process. Adding this flag makes sure that we get:
error: invalid process

The difference between eFlagRequiresProcess and eFlagProcessMustBeLaunched is an open question.

llvm-svn: 175702

11 years agoStrip 'llvm' from 'llvm::Optional' uses.
Ted Kremenek [Thu, 21 Feb 2013 01:29:01 +0000 (01:29 +0000)]
Strip 'llvm' from 'llvm::Optional' uses.

llvm-svn: 175701

11 years agoFixed a bug where certain vector code didn't
Sean Callanan [Thu, 21 Feb 2013 01:04:23 +0000 (01:04 +0000)]
Fixed a bug where certain vector code didn't
work on i386.  Now we let the JIT emit SSE/SSE2
instructions on i386.

<rdar://problem/13240476>

llvm-svn: 175700

11 years agoRemove commented out code.
Richard Trieu [Thu, 21 Feb 2013 00:50:43 +0000 (00:50 +0000)]
Remove commented out code.

llvm-svn: 175699

11 years agoobjective-C arc IR-gen. Retaining of strong
Fariborz Jahanian [Thu, 21 Feb 2013 00:40:10 +0000 (00:40 +0000)]
objective-C arc IR-gen. Retaining of strong
arguments in function prologue is done
with objc_StoreStrong to pair it with
similar objc_StoreStrong for release in function
epilogue. This is done with -O0 only.
// rdar://13145317

llvm-svn: 175698

11 years agoPPCDAGToDAGISel::PostprocessISelDAG()
Bill Schmidt [Thu, 21 Feb 2013 00:38:25 +0000 (00:38 +0000)]
PPCDAGToDAGISel::PostprocessISelDAG()

This patch implements the PPCDAGToDAGISel::PostprocessISelDAG virtual
method to perform post-selection peephole optimizations on the DAG
representation.

One optimization is implemented here:  folds to clean up complex
addressing expressions for thread-local storage and medium code
model.  It will also be useful for large code model sequences when
those are added later.  I originally thought about doing this on the
MI representation prior to register assignment, but it's difficult to
do effective global dead code elimination at that point.  DCE is
trivial on the DAG representation.

A typical example of a candidate code sequence in assembly:

   addis 3, 2, globalvar@toc@ha
   addi  3, 3, globalvar@toc@l
   lwz   5, 0(3)

When the final instruction is a load or store with an immediate offset
of zero, the offset from the add-immediate can replace the zero,
provided the relocation information is carried along:

   addis 3, 2, globalvar@toc@ha
   lwz   5, globalvar@toc@l(3)

Since the addi can in general have multiple uses, we need to only
delete the instruction when the last use is removed.

llvm-svn: 175697

11 years agoProvide a "None" value for convenience when using Optional<T>()
David Blaikie [Thu, 21 Feb 2013 00:27:28 +0000 (00:27 +0000)]
Provide a "None" value for convenience when using Optional<T>()

This implementation of NoneType/None does have some holes but I haven't
found one that doesn't - open to improvement.

llvm-svn: 175696

11 years agoMark unimplemented function with LLVM_DELETED_FUNCTION
David Blaikie [Thu, 21 Feb 2013 00:26:17 +0000 (00:26 +0000)]
Mark unimplemented function with LLVM_DELETED_FUNCTION

llvm-svn: 175695

11 years agoDoxycomment SVal's getAs/castAs.
David Blaikie [Thu, 21 Feb 2013 00:26:14 +0000 (00:26 +0000)]
Doxycomment SVal's getAs/castAs.

Also document TypeLoc's operations similarly, since it's a good idea.

Post-commit CR feedback from Anna Zaks regarding r175594.

llvm-svn: 175694

11 years agoRelocation enablement for PPC DAG postprocessing pass
Bill Schmidt [Thu, 21 Feb 2013 00:05:29 +0000 (00:05 +0000)]
Relocation enablement for PPC DAG postprocessing pass

llvm-svn: 175693

11 years agoFormatting.
Chad Rosier [Wed, 20 Feb 2013 23:57:30 +0000 (23:57 +0000)]
Formatting.

llvm-svn: 175692

11 years ago*ahem* Enrico.
Jason Molenda [Wed, 20 Feb 2013 23:51:13 +0000 (23:51 +0000)]
*ahem* Enrico.

llvm-svn: 175691

11 years agoDon't allocate memory in LiveInterval::join().
Jakob Stoklund Olesen [Wed, 20 Feb 2013 23:51:10 +0000 (23:51 +0000)]
Don't allocate memory in LiveInterval::join().

Rewrite value numbers directly in the 'Other' LiveInterval which is
moribund anyway. This avoids allocating the OtherAssignments vector.

llvm-svn: 175690

11 years agoMention "return" -> "thread return"
Jim Ingham [Wed, 20 Feb 2013 23:38:37 +0000 (23:38 +0000)]
Mention "return" -> "thread return"

llvm-svn: 175689

11 years agoKill of TransferDeadFlag - Dead copies and subreg-to-reg instructions should
Lang Hames [Wed, 20 Feb 2013 23:36:57 +0000 (23:36 +0000)]
Kill of TransferDeadFlag - Dead copies and subreg-to-reg instructions should
just be turned into kills on the spot.

llvm-svn: 175688

11 years agoas the allocator is reset zero out the number of bytes allocated, this was just
Pedro Artigas [Wed, 20 Feb 2013 23:30:56 +0000 (23:30 +0000)]
as the allocator is reset zero out the number of bytes allocated, this was just
missed before but probably what was intended.

llvm-svn: 175687

11 years agoELF symbol table field st_other support,
Jack Carter [Wed, 20 Feb 2013 23:11:17 +0000 (23:11 +0000)]
ELF symbol table field st_other support,
excluding visibility bits.

Mips specific standalone assembler directive "set at".

This directive changes the general purpose register
that the assembler will use when given the symbolic
register name $at.

This does not include negative testing. That will come
in a future patch.

A side affect of this patch recognizes the different
GPR register names for temporaries between old abi
and new abi so a test case for that is included.

Contributer: Vladimir Medic
llvm-svn: 175686

11 years agoCopy single reaching defs directly into the LiveInterval.
Jakob Stoklund Olesen [Wed, 20 Feb 2013 23:08:26 +0000 (23:08 +0000)]
Copy single reaching defs directly into the LiveInterval.

When findReachingDefs() finds that only one value can reach the basic
block, just copy the work list of visited blocks directly into the live
interval.

Sort the block list and use a LiveRangeUpdater to make the bulk add
fast.

When multiple reaching defs are found, transfer the work list to the
updateSSA() work list as before. Also use LiveRangeUpdater in
updateLiveIns() following updateSSA().

This makes live interval analysis more than 3x faster on one huge test
case.

llvm-svn: 175685

11 years agoAdd and remove the attribute from the correct slot.
Bill Wendling [Wed, 20 Feb 2013 23:04:11 +0000 (23:04 +0000)]
Add and remove the attribute from the correct slot.

The slot that we're adding/removing the attribute from may not be the same as
the attribute coming in. Make sure that they match up before we try to
add/remove them.
PR15313

llvm-svn: 175684

11 years agoStabilize vec_constants.ll
Bill Schmidt [Wed, 20 Feb 2013 22:43:03 +0000 (22:43 +0000)]
Stabilize vec_constants.ll

llvm-svn: 175683

11 years agoFix accidental concatenation for "outputuntil" in the -debug-buffer-size option descr...
Erik Verbruggen [Wed, 20 Feb 2013 22:33:46 +0000 (22:33 +0000)]
Fix accidental concatenation for "outputuntil" in the -debug-buffer-size option description.

llvm-svn: 175682

11 years agoRevert "intmax_t is long long on Darwin, not long."
Jordan Rose [Wed, 20 Feb 2013 22:28:41 +0000 (22:28 +0000)]
Revert "intmax_t is long long on Darwin, not long."

'long' and 'long long' are different for the purposes of mangling.
This caused <rdar://problem/13254874>.

This reverts commit c2f994d31ec85e9af811af38eb1b28709aef0b2c.

llvm-svn: 175681

11 years agoMCParser: Update method names per coding guidelines.
Jim Grosbach [Wed, 20 Feb 2013 22:25:15 +0000 (22:25 +0000)]
MCParser: Update method names per coding guidelines.

s/ParseMSInlineAsm/parseMSInlineAsm/

llvm-svn: 175680

11 years agoInclude llvm::Optional in clang/Basic/LLVM.h
David Blaikie [Wed, 20 Feb 2013 22:23:23 +0000 (22:23 +0000)]
Include llvm::Optional in clang/Basic/LLVM.h

Post-commit CR feedback from Jordan Rose regarding r175594.

llvm-svn: 175679

11 years agoRemove redundant Optional type in favor of llvm::Optional
David Blaikie [Wed, 20 Feb 2013 22:23:03 +0000 (22:23 +0000)]
Remove redundant Optional type in favor of llvm::Optional

llvm-svn: 175678

11 years agoUse op-> directly rather than via Optional<T>::getPointer.
David Blaikie [Wed, 20 Feb 2013 22:23:01 +0000 (22:23 +0000)]
Use op-> directly rather than via Optional<T>::getPointer.

Post-commit CR feedback from Jordan Rose regarding r175594.

llvm-svn: 175677

11 years agoRename SVal::isType functions to SVal::isKind
David Blaikie [Wed, 20 Feb 2013 22:22:59 +0000 (22:22 +0000)]
Rename SVal::isType functions to SVal::isKind

Post-commit CR feedback from Jordan Rose regarding r175594.

llvm-svn: 175676

11 years agoMCParser: Update method names per coding guidelines.
Jim Grosbach [Wed, 20 Feb 2013 22:21:35 +0000 (22:21 +0000)]
MCParser: Update method names per coding guidelines.

s/AddDirectiveHandler/addDirectiveHandler/
s/ParseMSInlineAsm/parseMSInlineAsm/
s/ParseIdentifier/parseIdentifier/
s/ParseStringToEndOfStatement/parseStringToEndOfStatement/
s/ParseEscapedString/parseEscapedString/
s/EatToEndOfStatement/eatToEndOfStatement/
s/ParseExpression/parseExpression/
s/ParseParenExpression/parseParenExpression/
s/ParseAbsoluteExpression/parseAbsoluteExpression/
s/CheckForValidSection/checkForValidSection/

http://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly

No functional change intended.

llvm-svn: 175675

11 years agoOnly use LiveIntervals in TwoAddressInstructionPass, not a mix of Liveintervals
Cameron Zwarich [Wed, 20 Feb 2013 22:10:02 +0000 (22:10 +0000)]
Only use LiveIntervals in TwoAddressInstructionPass, not a mix of Liveintervals
and SlotIndexes.

llvm-svn: 175674

11 years agoFind anchoring end points for repairIntervalsInRange and repairIndexesInRange
Cameron Zwarich [Wed, 20 Feb 2013 22:10:00 +0000 (22:10 +0000)]
Find anchoring end points for repairIntervalsInRange and repairIndexesInRange
automatically.

llvm-svn: 175673

11 years agoMake repairIntervalsInRange() more robust. There are now no longer any liveness-
Cameron Zwarich [Wed, 20 Feb 2013 22:09:57 +0000 (22:09 +0000)]
Make repairIntervalsInRange() more robust. There are now no longer any liveness-
related failures when running 'make check' without LiveVariables with the
verifier enabled. Some of the remaining failures elsewhere may still be fallout
from incorrect updating of LiveIntervals or the few missing cases left in the
two-address pass.

llvm-svn: 175672

11 years agoChange ELF relocation model to static
Andrew Kaylor [Wed, 20 Feb 2013 21:39:02 +0000 (21:39 +0000)]
Change ELF relocation model to static

llvm-svn: 175671

11 years agoDAGCombiner: Fold pointless truncate, bitcast, buildvector series
Arnold Schwaighofer [Wed, 20 Feb 2013 21:33:32 +0000 (21:33 +0000)]
DAGCombiner: Fold pointless truncate, bitcast, buildvector series

(2xi32) (truncate ((2xi64) bitcast (buildvector i32 a, i32 x, i32 b, i32 y)))
can be folded into a (2xi32) (buildvector i32 a, i32 b).

Such a DAG would cause uneccessary vdup instructions followed by vmovn
instructions.

We generate this code on ARM NEON for a setcc olt, 2xf64, 2xf64. For example, in
the vectorized version of the code below.

double A[N];
double B[N];

void test_double_compare_to_double() {
  int i;
  for(i=0;i<N;i++)
    A[i] = (double)(A[i] < B[i]);
}

radar://13191881

Fixes bug 15283.

llvm-svn: 175670

11 years agoAdd logging of which test cases are run (through dosep) to help diagnose any hangs...
Daniel Malea [Wed, 20 Feb 2013 21:31:47 +0000 (21:31 +0000)]
Add logging of which test cases are run (through dosep) to help diagnose any hangs/crashes in the buildbots.

llvm-svn: 175669

11 years agoR600: Update for name changes from r175667.
Jim Grosbach [Wed, 20 Feb 2013 21:31:28 +0000 (21:31 +0000)]
R600: Update for name changes from r175667.

llvm-svn: 175668

11 years agoUpdate TargetLowering ivars for name policy.
Jim Grosbach [Wed, 20 Feb 2013 21:13:59 +0000 (21:13 +0000)]
Update TargetLowering ivars for name policy.

http://llvm.org/docs/CodingStandards.html#name-types-functions-variables-and-enumerators-properly

ivars should be camel-case and start with an upper-case letter. A few in
TargetLowering were starting with a lower-case letter.

No functional change intended.

llvm-svn: 175667

11 years agoFix invalid TestBitfields case (thanks Filipe!), and xfail one case due to GCC compil...
Daniel Malea [Wed, 20 Feb 2013 21:11:20 +0000 (21:11 +0000)]
Fix invalid TestBitfields case (thanks Filipe!), and xfail one case due to GCC compiler bug.

Turns out unnamed bit fields should not be accessed ever in C (C99 section 4.7.8) or C++
(C++11 section 9.6).

Unrelated to the above, this commit marks TestBitfields as expected-to-fail with GCC as 4.7
has problems with padding... the size of the struct with a uint32_t member is reported as 12
when GCC is used. Clang emits correct code.

Parts of this patch prepared by Filipe Cabecinhas!

llvm-svn: 175666

11 years agoSkip TestCompletion case that fails on linux (with gcc) because the input prompt...
Daniel Malea [Wed, 20 Feb 2013 20:58:20 +0000 (20:58 +0000)]
Skip TestCompletion case that fails on linux (with gcc) because the input prompt is not displayed (llvm.org/pr14637)

llvm-svn: 175665

11 years agoFix TestPublicAPIHeaders test on Linux.
Matt Kopec [Wed, 20 Feb 2013 20:54:10 +0000 (20:54 +0000)]
Fix TestPublicAPIHeaders test on Linux.
 -Change the build_dir variable name to lib_dir
 -Set lib_dir to the correct location on Linux
 -Set LD_EXTRAS to the actual lldb library

llvm-svn: 175664

11 years agoAdditional fixes for bug 15155.
Bill Schmidt [Wed, 20 Feb 2013 20:41:42 +0000 (20:41 +0000)]
Additional fixes for bug 15155.

This handles the cases where the 6-bit splat element is odd, converting
to a three-instruction sequence to add or subtract two splats.  With this
fix, the XFAIL in test/CodeGen/PowerPC/vec_constants.ll is removed.

llvm-svn: 175663

11 years agoHandle the case where the runtime uses class_getMethodImplementation for both scalar...
Jim Ingham [Wed, 20 Feb 2013 20:35:38 +0000 (20:35 +0000)]
Handle the case where the runtime uses class_getMethodImplementation for both scalar and structure
return methods.

rdar://problem/13238168

llvm-svn: 175662

11 years ago[Sanitizer] Try to fix infinite loop in frame pointer unwinder
Reid Kleckner [Wed, 20 Feb 2013 20:29:48 +0000 (20:29 +0000)]
[Sanitizer] Try to fix infinite loop in frame pointer unwinder

Using > instead of >= ensures that each frame deref makes progress and
that we eventually terminate.

Issue: https://code.google.com/p/address-sanitizer/issues/detail?id=162
llvm-svn: 175661

11 years agoPR15311: Finish implementation of the suggested resolution of core issue 1488,
Richard Smith [Wed, 20 Feb 2013 20:19:27 +0000 (20:19 +0000)]
PR15311: Finish implementation of the suggested resolution of core issue 1488,
which allows grouping parens in an abstract-pack-declarator. This was already
mostly implemented, but missed some cases. Add an ExtWarn for use of this
extension until CWG ratifies it.

llvm-svn: 175660

11 years ago[objdump] Print the PT_INTERP and PT_DYNAMIC correcctly.
Michael J. Spencer [Wed, 20 Feb 2013 20:18:10 +0000 (20:18 +0000)]
[objdump] Print the PT_INTERP and PT_DYNAMIC correcctly.

llvm-svn: 175659

11 years agoUpdate a comment that looks to have been accidentally deleted many moons ago.
Chad Rosier [Wed, 20 Feb 2013 20:15:55 +0000 (20:15 +0000)]
Update a comment that looks to have been accidentally deleted many moons ago.

llvm-svn: 175658

11 years ago[ELF][Writer] Add .interp section.
Michael J. Spencer [Wed, 20 Feb 2013 20:13:47 +0000 (20:13 +0000)]
[ELF][Writer] Add .interp section.

llvm-svn: 175657

11 years agoFix a bug that causes dotest.py to exit with a passing exit-code, even if some tests...
Daniel Malea [Wed, 20 Feb 2013 20:12:11 +0000 (20:12 +0000)]
Fix a bug that causes dotest.py to exit with a passing exit-code, even if some tests fail
- occurs when multiple compilers/architectures are tested (via -C or -A flags)

llvm-svn: 175656

11 years ago[ASan] revert part of r175631 that looks like accidental commit
Alexey Samsonov [Wed, 20 Feb 2013 19:55:47 +0000 (19:55 +0000)]
[ASan] revert part of r175631 that looks like accidental commit

llvm-svn: 175655

11 years ago[ELF][Writer] Add dynamic table.
Michael J. Spencer [Wed, 20 Feb 2013 19:46:12 +0000 (19:46 +0000)]
[ELF][Writer] Add dynamic table.

llvm-svn: 175654

11 years agoFix a problem with the const_variables test case (another lldb bug remains)
Daniel Malea [Wed, 20 Feb 2013 19:41:49 +0000 (19:41 +0000)]
Fix a problem with the const_variables test case (another lldb bug remains)
- make the test case step past the location where 'index' is initialized, otherwise its value cannot be printed (verified gcc 4.6/4.7 and recent clang)
- "Couldn't materialize struct" error from LLDB still prevents this test case from passing

llvm-svn: 175653

11 years agoAttempt to clean up tests for non-X86 platforms.
Bill Wendling [Wed, 20 Feb 2013 19:30:01 +0000 (19:30 +0000)]
Attempt to clean up tests for non-X86 platforms.

llvm-svn: 175652

11 years agoRewrite comments.
Dan Gohman [Wed, 20 Feb 2013 19:28:46 +0000 (19:28 +0000)]
Rewrite comments.

llvm-svn: 175651

11 years agoAdd comment in Memory.inc explaining r175646.
Krzysztof Parzyszek [Wed, 20 Feb 2013 19:25:09 +0000 (19:25 +0000)]
Add comment in Memory.inc explaining r175646.

llvm-svn: 175650

11 years agoProcess and handle attributes on conditions and for loop variables. Process and
Richard Smith [Wed, 20 Feb 2013 19:22:51 +0000 (19:22 +0000)]
Process and handle attributes on conditions and for loop variables. Process and
diagnose attributes on alias declarations, using directives, and attribute
declarations.

llvm-svn: 175649

11 years agoSIGQUIT is a "kill" signal, rather than an "int" signal, in this context.
Dan Gohman [Wed, 20 Feb 2013 19:15:01 +0000 (19:15 +0000)]
SIGQUIT is a "kill" signal, rather than an "int" signal, in this context.

llvm-svn: 175648

11 years agoFormatting, grammar
Andrew Kaylor [Wed, 20 Feb 2013 18:24:34 +0000 (18:24 +0000)]
Formatting, grammar

llvm-svn: 175647

11 years agoOn PowerPC, the cache-flush instructions dcbf and icbi are treated as
Krzysztof Parzyszek [Wed, 20 Feb 2013 18:24:30 +0000 (18:24 +0000)]
On PowerPC, the cache-flush instructions dcbf and icbi are treated as
loads. On FreeBSD, add PROT_READ page protection flag before flushing
cache.

llvm-svn: 175646

11 years agoUse LiveRangeUpdater instead of mergeIntervalRanges.
Jakob Stoklund Olesen [Wed, 20 Feb 2013 18:18:15 +0000 (18:18 +0000)]
Use LiveRangeUpdater instead of mergeIntervalRanges.

Performance is the same, but LiveRangeUpdater has a more flexible
interface.

llvm-svn: 175645

11 years agoAdd a LiveRangeUpdater class.
Jakob Stoklund Olesen [Wed, 20 Feb 2013 18:18:12 +0000 (18:18 +0000)]
Add a LiveRangeUpdater class.

Adding new segments to large LiveIntervals can be expensive because the
LiveRange objects after the insertion point may need to be moved left or
right. This can cause quadratic behavior when adding a large number of
segments to a live range.

The LiveRangeUpdater class allows the LIveInterval to be in a temporary
invalid state while segments are being added. It maintains an internal
gap in the LiveInterval when it is shrinking, and it has a spill area
for new segments when the LiveInterval is growing.

The behavior is similar to the existing mergeIntervalRanges() function,
except it allocates less memory for the spill area, and the algorithm is
turned inside out so the loop is driven by the clients.

llvm-svn: 175644

11 years agoAdding support for absolute relocations. This occurs in ELF files when a relocation...
Andrew Kaylor [Wed, 20 Feb 2013 18:09:21 +0000 (18:09 +0000)]
Adding support for absolute relocations.  This occurs in ELF files when a relocation is given with no name and an undefined section.  The relocation is applied with an address of zero.

llvm-svn: 175643

11 years agoFix PR15267
Michael Liao [Wed, 20 Feb 2013 18:04:21 +0000 (18:04 +0000)]
Fix PR15267

- When extloading from a vector with non-byte-addressable element, e.g.
  <4 x i1>, the current logic breaks. Extend the current logic to
  fix the case where the element type is not byte-addressable by loading
  all bytes, bit-extracting/packing each element.

llvm-svn: 175642

11 years ago[ms-inline asm] Make the comment a bit more verbose.
Chad Rosier [Wed, 20 Feb 2013 18:03:44 +0000 (18:03 +0000)]
[ms-inline asm] Make the comment a bit more verbose.

llvm-svn: 175641

11 years agoAdd a default constructor for LiveRange.
Jakob Stoklund Olesen [Wed, 20 Feb 2013 17:46:51 +0000 (17:46 +0000)]
Add a default constructor for LiveRange.

It is useful to be able to create temporary LiveRange object whose
members are filled in later.

llvm-svn: 175639

11 years agorename fixupAddend to relocAddend
Shankar Easwaran [Wed, 20 Feb 2013 17:42:00 +0000 (17:42 +0000)]
rename fixupAddend to relocAddend

llvm-svn: 175638

11 years ago[ms-inline asm] Remove this test while I investigate why eax isn't being clobbered.
Chad Rosier [Wed, 20 Feb 2013 17:39:31 +0000 (17:39 +0000)]
[ms-inline asm] Remove this test while I investigate why eax isn't being clobbered.

llvm-svn: 175637

11 years agofunctionality to handle global atoms in Merge sections
Shankar Easwaran [Wed, 20 Feb 2013 17:38:37 +0000 (17:38 +0000)]
functionality to handle global atoms in Merge sections

llvm-svn: 175636

11 years agoFix bug 14779 for passing anonymous aggregates [patch by Kai Nacke].
Bill Schmidt [Wed, 20 Feb 2013 17:31:41 +0000 (17:31 +0000)]
Fix bug 14779 for passing anonymous aggregates [patch by Kai Nacke].

The PPC backend doesn't handle these correctly.  This patch uses logic
similar to that in the X86 and ARM backends to track these arguments
properly.

llvm-svn: 175635

11 years agoHexagon: Move HexagonMCInst.h to MCTargetDesc/HexagonMCInst.h.
Jyotsna Verma [Wed, 20 Feb 2013 16:13:27 +0000 (16:13 +0000)]
Hexagon: Move HexagonMCInst.h to MCTargetDesc/HexagonMCInst.h.
Add HexagonMCInst class which adds various Hexagon VLIW annotations.
In addition, this class also includes some APIs related to the
constant extenders.

llvm-svn: 175634

11 years agoRevert r175626, "ADT/Optional.h: Appease msvc."
NAKAMURA Takumi [Wed, 20 Feb 2013 15:52:44 +0000 (15:52 +0000)]
Revert r175626, "ADT/Optional.h: Appease msvc."

Sorry, I didn't cover +Asserts, by accident. :(

llvm-svn: 175633

11 years agoFix PR15155: lost vadd/vsplat optimization.
Bill Schmidt [Wed, 20 Feb 2013 15:50:31 +0000 (15:50 +0000)]
Fix PR15155: lost vadd/vsplat optimization.

During lowering of a BUILD_VECTOR, we look for opportunities to use a
vector splat.  When the splatted value fits in 5 signed bits, a single
splat does the job.  When it doesn't fit in 5 bits but does fit in 6,
and is an even value, we can splat on half the value and add the result
to itself.

This last optimization hasn't been working recently because of improved
constant folding.  To circumvent this, create a pseudo VADD_SPLAT that
can be expanded during instruction selection.

llvm-svn: 175632

11 years ago[ASan] Delete asan/dynamic dir and temporarily move the interposers declarations...
Alexander Potapenko [Wed, 20 Feb 2013 15:46:02 +0000 (15:46 +0000)]
[ASan] Delete asan/dynamic dir and temporarily move the interposers declarations to asan_intercepted_functions.h
Now that we have only one dependency on asan_intercepted_functions.h, we can unite that code with the interceptors declarations in asan_interceptors.cc and get rid of asan_intercepted_functions.h

llvm-svn: 175631

11 years agoFix regression in string literal alignment.
Manuel Klimek [Wed, 20 Feb 2013 15:32:58 +0000 (15:32 +0000)]
Fix regression in string literal alignment.

Now correctly indents (again):
a = a + "a"
        "a"
        "a";

llvm-svn: 175630

11 years ago[ASan] Make isoc99_*scanf intercepted on Linux only. Those are unavailable on Darwin.
Alexander Potapenko [Wed, 20 Feb 2013 15:27:58 +0000 (15:27 +0000)]
[ASan] Make isoc99_*scanf intercepted on Linux only. Those are unavailable on Darwin.

llvm-svn: 175629

11 years agoFixes bug in string literal alignment.
Manuel Klimek [Wed, 20 Feb 2013 15:25:48 +0000 (15:25 +0000)]
Fixes bug in string literal alignment.

We now indent the following correctly:
1. some + "literal" /* comment */
          "literal";
2. breaking string literals after which we have another string literal.

llvm-svn: 175628

11 years agoWhitespace.
NAKAMURA Takumi [Wed, 20 Feb 2013 15:12:32 +0000 (15:12 +0000)]
Whitespace.

llvm-svn: 175627

11 years agoADT/Optional.h: Appease msvc.
NAKAMURA Takumi [Wed, 20 Feb 2013 15:12:24 +0000 (15:12 +0000)]
ADT/Optional.h: Appease msvc.

llvm-svn: 175626

11 years ago[asan] move preinit_test to Linux since on Mac __asan_init is called from ld-preload...
Kostya Serebryany [Wed, 20 Feb 2013 15:10:22 +0000 (15:10 +0000)]
[asan] move preinit_test to Linux since on Mac __asan_init is called from ld-preload-ed runtime

llvm-svn: 175625

11 years agoTweaks and fixes to cpp11-migrate generated tests
Edwin Vane [Wed, 20 Feb 2013 14:35:53 +0000 (14:35 +0000)]
Tweaks and fixes to cpp11-migrate generated tests

* Fixed a comment typo
* Changed 'autogen' to 'generated-tests'
* Made the clean target not fail if the 'generated-tests' directory
  doesn't already exist.

llvm-svn: 175624

11 years ago[asan] on linux, run __asan_init from .preinit_array (even earlier than before)
Kostya Serebryany [Wed, 20 Feb 2013 14:28:08 +0000 (14:28 +0000)]
[asan] on linux, run __asan_init from .preinit_array (even earlier than before)

llvm-svn: 175623

11 years ago[Sanitizer] use raw syscall instead of _exit() function on Linux
Alexey Samsonov [Wed, 20 Feb 2013 13:54:32 +0000 (13:54 +0000)]
[Sanitizer] use raw syscall instead of _exit() function on Linux

llvm-svn: 175622

11 years agoMove the SplatByte helper to APInt and generalize it a bit.
Benjamin Kramer [Wed, 20 Feb 2013 13:00:06 +0000 (13:00 +0000)]
Move the SplatByte helper to APInt and generalize it a bit.

llvm-svn: 175621

11 years agoDon't remove blank lines within unwrapped lines.
Daniel Jasper [Wed, 20 Feb 2013 12:56:39 +0000 (12:56 +0000)]
Don't remove blank lines within unwrapped lines.

If the code author decides to put empty lines anywhere into the code we
should treat them equally, i.e. reduce them to the configured
MaxEmptyLinesToKeep.

With this change, we e.g. keep the newline in:
SomeType ST = {
  // First value
  a,

  // Second value
  b
};

llvm-svn: 175620

11 years agoI optimized the following patterns:
Elena Demikhovsky [Wed, 20 Feb 2013 12:42:54 +0000 (12:42 +0000)]
I optimized the following patterns:
 sext <4 x i1> to <4 x i64>
 sext <4 x i8> to <4 x i64>
 sext <4 x i16> to <4 x i64>

I'm running Combine on SIGN_EXTEND_IN_REG and revert SEXT patterns:
 (sext_in_reg (v4i64 anyext (v4i32 x )), ExtraVT) -> (v4i64 sext (v4i32 sext_in_reg (v4i32 x , ExtraVT)))

 The sext_in_reg (v4i32 x) may be lowered to shl+sar operations.
 The "sar" does not exist on 64-bit operation, so lowering sext_in_reg (v4i64 x) has no vector solution.

I also added a cost of this operations to the AVX costs table.

llvm-svn: 175619

11 years ago[asan] add a lit test for invoke-with-no-return instrumentation
Kostya Serebryany [Wed, 20 Feb 2013 12:37:22 +0000 (12:37 +0000)]
[asan] add a lit test for invoke-with-no-return instrumentation

llvm-svn: 175618

11 years ago[asan] instrument invoke insns with noreturn attribute (as well as call insns)
Kostya Serebryany [Wed, 20 Feb 2013 12:35:15 +0000 (12:35 +0000)]
[asan] instrument invoke insns with noreturn attribute (as well as call insns)

llvm-svn: 175617

11 years agoFix thumbv5e frame lowering assertion failure.
Logan Chien [Wed, 20 Feb 2013 12:21:33 +0000 (12:21 +0000)]
Fix thumbv5e frame lowering assertion failure.

It is possible that frame pointer is not found in the
callee saved info, thus FramePtrSpillFI may be incorrect
if we don't check the result of hasFP(MF).

Besides, if we enable the stack coloring algorithm, there
will be an assertion to ensure the slot is live.  But in
the test case, %var1 is not live in the prologue of the
function, and we will get the assertion failure.

Note: There is similar code in ARMFrameLowering.cpp.
llvm-svn: 175616

11 years ago[sanitizer] Fix lint.
Evgeniy Stepanov [Wed, 20 Feb 2013 11:06:07 +0000 (11:06 +0000)]
[sanitizer] Fix lint.

llvm-svn: 175615

11 years ago[asan] add test throw_call_test (broken with -static-libstdc++)
Kostya Serebryany [Wed, 20 Feb 2013 10:43:05 +0000 (10:43 +0000)]
[asan] add test throw_call_test (broken with -static-libstdc++)

llvm-svn: 175614

11 years agoImplements breaking of string literals if they stick out.
Manuel Klimek [Wed, 20 Feb 2013 10:15:13 +0000 (10:15 +0000)]
Implements breaking of string literals if they stick out.

An alternative strategy to calculating the break on demand when hitting
a token that would need to be broken would be to put all possible breaks
inside the token into the optimizer.

Currently only supports breaking at spaces; more break points to come.

llvm-svn: 175613

11 years agoRemove target-specific features.
Bill Wendling [Wed, 20 Feb 2013 08:01:34 +0000 (08:01 +0000)]
Remove target-specific features.

llvm-svn: 175610

11 years agoUse the attribute group reference instead of the attribute directly.
Bill Wendling [Wed, 20 Feb 2013 07:48:23 +0000 (07:48 +0000)]
Use the attribute group reference instead of the attribute directly.

llvm-svn: 175609

11 years agoFully qualify llvm::next to avoid ambiguity when building as C++11.
David Blaikie [Wed, 20 Feb 2013 07:39:20 +0000 (07:39 +0000)]
Fully qualify llvm::next to avoid ambiguity when building as C++11.

llvm-svn: 175608

11 years agoFix the (clang -Werror) build by removing an unused member variable.
David Blaikie [Wed, 20 Feb 2013 07:39:18 +0000 (07:39 +0000)]
Fix the (clang -Werror) build by removing an unused member variable.

llvm-svn: 175607

11 years agoModify the tests to use attribute group references instead of listing the
Bill Wendling [Wed, 20 Feb 2013 07:22:19 +0000 (07:22 +0000)]
Modify the tests to use attribute group references instead of listing the
function attributes.

llvm-svn: 175606

11 years agoModify the LLVM assembly output so that it uses references to represent function...
Bill Wendling [Wed, 20 Feb 2013 07:21:42 +0000 (07:21 +0000)]
Modify the LLVM assembly output so that it uses references to represent function attributes.

This makes the LLVM assembly look better. E.g.:

     define void @foo() #0 { ret void }
     attributes #0 = { nounwind noinline ssp }

llvm-svn: 175605

11 years agoAdd support to the two-address pass for updating LiveIntervals in many of the
Cameron Zwarich [Wed, 20 Feb 2013 06:46:48 +0000 (06:46 +0000)]
Add support to the two-address pass for updating LiveIntervals in many of the
common transformations. This includes updating repairIntervalsInRange() to
handle more cases.

llvm-svn: 175604

11 years agoMove the computation of the IsEarlyClobber flag into its own loop, since the
Cameron Zwarich [Wed, 20 Feb 2013 06:46:46 +0000 (06:46 +0000)]
Move the computation of the IsEarlyClobber flag into its own loop, since the
correct value is needed in every iteration of the loop for updating
LiveIntervals.

llvm-svn: 175603

11 years agoModify LiveInterval::addRange() to match the comment about what it returns.
Cameron Zwarich [Wed, 20 Feb 2013 06:46:44 +0000 (06:46 +0000)]
Modify LiveInterval::addRange() to match the comment about what it returns.

llvm-svn: 175602

11 years agoAdd SlotIndexes::repairIndexesInRange(), which repairs SlotIndexes after adding
Cameron Zwarich [Wed, 20 Feb 2013 06:46:41 +0000 (06:46 +0000)]
Add SlotIndexes::repairIndexesInRange(), which repairs SlotIndexes after adding
and removing instructions. The implementation seems more complicated than it
needs to be, but I couldn't find something simpler that dealt with all of the
corner cases.

Also add a call to repairIndexesInRange() from repairIntervalsInRange().

llvm-svn: 175601