oota-llvm.git
11 years agoChanged SmallPtrSet.count guard + SmallPtrSet.insert to just SmallPtrSet.insert.
Michael Gottesman [Mon, 14 Jan 2013 19:18:39 +0000 (19:18 +0000)]
Changed SmallPtrSet.count guard + SmallPtrSet.insert to just SmallPtrSet.insert.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172452 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMove CheckForValidSection to the MCAsmParser interface.
Eli Bendersky [Mon, 14 Jan 2013 19:15:01 +0000 (19:15 +0000)]
Move CheckForValidSection to the MCAsmParser interface.

Now that it behaves itself in terms of streamer independence (r172450), this
method can be moved to MCAsmParser to be available to all extensions,
overriding, etc.

-- -This line, and those below, will be ignored--

M    lib/MC/MCParser/AsmParser.cpp
M    include/llvm/MC/MCParser/MCAsmParser.h

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172451 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoExpose an InitToTextSection through MCStreamer.
Eli Bendersky [Mon, 14 Jan 2013 19:04:57 +0000 (19:04 +0000)]
Expose an InitToTextSection through MCStreamer.

The aim of this patch is to fix the following piece of code in the
platform-independent AsmParser:

void AsmParser::CheckForValidSection() {
  if (!ParsingInlineAsm && !getStreamer().getCurrentSection()) {
    TokError("expected section directive before assembly directive");
    Out.SwitchSection(Ctx.getMachOSection(
                        "__TEXT", "__text",
                        MCSectionMachO::S_ATTR_PURE_INSTRUCTIONS,
                        0, SectionKind::getText()));
  }
}

This was added for the "-n" option of llvm-mc.

The proposed fix adds another virtual method to MCStreamer, called
InitToTextSection. Conceptually, it's similar to the existing
InitSections which initializes all common sections and switches to
text. The new method is implemented by each platform streamer in a way
that it sees fit. So AsmParser can now do this:

void AsmParser::CheckForValidSection() {
  if (!ParsingInlineAsm && !getStreamer().getCurrentSection()) {
    TokError("expected section directive before assembly directive");
    Out.InitToTextSection();
  }
}

Which is much more reasonable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172450 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMove ParseMacroArgument to the MCAsmParser interfance.
Eli Bendersky [Mon, 14 Jan 2013 19:00:26 +0000 (19:00 +0000)]
Move ParseMacroArgument to the MCAsmParser interfance.

Since it's used by extensions. One further step to fully decoupling
GenericAsmParser from an intimate knowledge of the internals of AsmParser,
pointing it to the MCASmParser interface instead (like all other parser
extensions do).

Since this change moves the MacroArgument type to the interface header, it's
renamed to be a bit more descriptive in a general context.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172449 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoEncapsulate the MacroEnabled flag in AsmParser behind accessor methods.
Eli Bendersky [Mon, 14 Jan 2013 18:08:41 +0000 (18:08 +0000)]
Encapsulate the MacroEnabled flag in AsmParser behind accessor methods.

The methods are also exposed via the MCAsmParser interface, which allows more
than one client to control them. Previously, GenericAsmParser was playing with
a member var in AsmParser directly (by virtue of being its friend).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172440 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRevert r171829 "Split changeset_ty using iterators instead of loops" as it breaks...
Timur Iskhodzhanov [Mon, 14 Jan 2013 14:13:06 +0000 (14:13 +0000)]
Revert r171829 "Split changeset_ty using iterators instead of loops" as it breaks the VS2008 build

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172411 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSimplify nested strconcats in X86 td files since strconcat can take more than 2 argum...
Craig Topper [Mon, 14 Jan 2013 07:46:34 +0000 (07:46 +0000)]
Simplify nested strconcats in X86 td files since strconcat can take more than 2 arguments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172379 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoCreate a single multiclass for SSE and AVX version of MOVL/MOVH. Prevents needing...
Craig Topper [Mon, 14 Jan 2013 07:26:58 +0000 (07:26 +0000)]
Create a single multiclass for SSE and AVX version of MOVL/MOVH. Prevents needing to specify everything twice. No functional change intended

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172378 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFixed some 80+ violations.
Michael Gottesman [Mon, 14 Jan 2013 01:47:53 +0000 (01:47 +0000)]
Fixed some 80+ violations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172374 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUpdated the documentation in ObjCARC.cpp to fit the style guide better (i.e. use...
Michael Gottesman [Mon, 14 Jan 2013 00:35:14 +0000 (00:35 +0000)]
Updated the documentation in ObjCARC.cpp to fit the style guide better (i.e. use doxygen). Still some work to do though.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172371 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdded bugzilla PR number to test case.
Michael Gottesman [Sun, 13 Jan 2013 22:17:22 +0000 (22:17 +0000)]
Added bugzilla PR number to test case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172369 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFixed an infinite loop in the block escape in analysis in ObjCARC caused by 2x blocks...
Michael Gottesman [Sun, 13 Jan 2013 22:12:06 +0000 (22:12 +0000)]
Fixed an infinite loop in the block escape in analysis in ObjCARC caused by 2x blocks each assigned a value via a phi-node causing each to depend on the other.

A test case is provided as well.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172368 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix typo in comment.
Nick Lewycky [Sun, 13 Jan 2013 19:03:55 +0000 (19:03 +0000)]
Fix typo in comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172364 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agofix compile-time regression report by Joerg Sonnenberger:
Nuno Lopes [Sun, 13 Jan 2013 18:02:57 +0000 (18:02 +0000)]
fix compile-time regression report by Joerg Sonnenberger:
cache result of Size/OffsetVisitor to speedup analysis of PHI nodes

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172363 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoDocumentation: use monospaced font for intrinsics' names
Dmitri Gribenko [Sun, 13 Jan 2013 16:07:49 +0000 (16:07 +0000)]
Documentation: use monospaced font for intrinsics' names

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172360 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix broken link to LangRef
Dmitri Gribenko [Sun, 13 Jan 2013 16:06:11 +0000 (16:06 +0000)]
Fix broken link to LangRef

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172359 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove redundant 'llvm::' qualifications
Dmitri Gribenko [Sun, 13 Jan 2013 16:01:15 +0000 (16:01 +0000)]
Remove redundant 'llvm::' qualifications

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172358 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUpdate links to "Itanium C++ ABI: Exception Handling" document
Dmitri Gribenko [Sun, 13 Jan 2013 15:53:09 +0000 (15:53 +0000)]
Update links to "Itanium C++ ABI: Exception Handling" document

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172356 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoX86: Add patterns for X86ISD::VSEXT in registers.
Benjamin Kramer [Sun, 13 Jan 2013 11:37:04 +0000 (11:37 +0000)]
X86: Add patterns for X86ISD::VSEXT in registers.

Those can occur when something between the sextload and the store is on the same
chain and blocks isel. Fixes PR14887.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172353 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix PR14547. Handle induction variables of small sizes smaller than i32 (i8 and i16).
Nadav Rotem [Sun, 13 Jan 2013 07:56:29 +0000 (07:56 +0000)]
Fix PR14547. Handle induction variables of small sizes smaller than i32 (i8 and i16).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172348 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[ObjCARC] Even more debug messages!
Michael Gottesman [Sun, 13 Jan 2013 07:47:32 +0000 (07:47 +0000)]
[ObjCARC] Even more debug messages!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172347 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[ObjCARC] More debug messages.
Michael Gottesman [Sun, 13 Jan 2013 07:00:51 +0000 (07:00 +0000)]
[ObjCARC] More debug messages.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172346 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix an editor goof in r171738 that Bill spotted. He may even have a test
Chandler Carruth [Sat, 12 Jan 2013 23:46:04 +0000 (23:46 +0000)]
Fix an editor goof in r171738 that Bill spotted. He may even have a test
case, but looking at the diff this was an obviously unintended change.

Thanks for the careful review Bill! =]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172336 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUse more canonical exception-handling link in docs.
Tim Northover [Sat, 12 Jan 2013 19:54:21 +0000 (19:54 +0000)]
Use more canonical exception-handling link in docs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172325 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoWhen lowering an inreg sext first shift left, then right arithmetically.
Benjamin Kramer [Sat, 12 Jan 2013 19:06:44 +0000 (19:06 +0000)]
When lowering an inreg sext first shift left, then right arithmetically.

Shifting right two times will only yield zero. Should fix
SingleSource/UnitTests/SignlessTypes/factor.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172322 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMipsDisassembler.cpp: Prune DecodeHWRegs64RegisterClass() to suppress a warning....
NAKAMURA Takumi [Sat, 12 Jan 2013 15:37:00 +0000 (15:37 +0000)]
MipsDisassembler.cpp: Prune DecodeHWRegs64RegisterClass() to suppress a warning. [-Wunused-function]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172319 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoGlobalOpt: Avoid jump on uninitialized value.
Benjamin Kramer [Sat, 12 Jan 2013 15:34:31 +0000 (15:34 +0000)]
GlobalOpt: Avoid jump on uninitialized value.

Found by valgrind.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172318 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMipsAsmParser: Try to unbreak tests to add extra check.
NAKAMURA Takumi [Sat, 12 Jan 2013 15:19:10 +0000 (15:19 +0000)]
MipsAsmParser: Try to unbreak tests to add extra check.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172315 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd a unit test to verifies that attribute uniquing works so it doesn't break again.
Benjamin Kramer [Sat, 12 Jan 2013 14:13:45 +0000 (14:13 +0000)]
Add a unit test to verifies that attribute uniquing works so it doesn't break again.

The folding set details can be subtle and broke twice in the last couple of weeks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172313 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix broken links around Itanium C++ ABI in documentation.
Tim Northover [Sat, 12 Jan 2013 12:38:54 +0000 (12:38 +0000)]
Fix broken links around Itanium C++ ABI in documentation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172312 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFixed debug message in ObjCARC.
Michael Gottesman [Sat, 12 Jan 2013 03:45:49 +0000 (03:45 +0000)]
Fixed debug message in ObjCARC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172299 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFixed a few debug messages in ObjCARC and added one.
Michael Gottesman [Sat, 12 Jan 2013 02:57:16 +0000 (02:57 +0000)]
Fixed a few debug messages in ObjCARC and added one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172298 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix quoting problems from my previous change. <rdar://problem/13001651>
Bob Wilson [Sat, 12 Jan 2013 02:31:42 +0000 (02:31 +0000)]
Fix quoting problems from my previous change. <rdar://problem/13001651>

I give up trying to get all of the settings into COMMON_MAKEFLAGS, so just
do the easy thing and repeat the ones with interesting quoting issues
in each make command.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172296 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFixed bug in ObjCARC where we were changing a call from objc_autoreleaseRV => objc_au...
Michael Gottesman [Sat, 12 Jan 2013 01:25:19 +0000 (01:25 +0000)]
Fixed bug in ObjCARC where we were changing a call from objc_autoreleaseRV => objc_autorelease but were not updating the InstructionClass to IC_Autorelease.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172288 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFixed a bug where we were tail calling objc_autorelease causing an object to not...
Michael Gottesman [Sat, 12 Jan 2013 01:25:15 +0000 (01:25 +0000)]
Fixed a bug where we were tail calling objc_autorelease causing an object to not be placed into an autorelease pool.

The reason that this occurs is that tail calling objc_autorelease eventually
tail calls -[NSObject autorelease] which supports fast autorelease. This can
cause us to violate the semantic gaurantees of __autoreleasing variables that
assignment to an __autoreleasing variables always yields an object that is
placed into the innermost autorelease pool.

The fix included in this patch works by:

1. In the peephole optimization function OptimizeIndividualFunctions, always
remove tail call from objc_autorelease.
2. Whenever we convert to/from an objc_autorelease, set/unset the tail call
keyword as appropriate.

*NOTE* I also handled the case where objc_autorelease is converted in
OptimizeReturns to an autoreleaseRV which still violates the ARC semantics. I
will be removing that in a later patch and I wanted to make sure that the tree
is in a consistent state vis-a-vis ARC always.

Additionally some test cases are provided and all tests that have tail call marked
objc_autorelease keywords have been modified so that tail call has been removed.

*NOTE* One test fails due to a separate bug that I am going to commit soon. Thus
I marked the check line TMP: instead of CHECK: so make check does not fail.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172287 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoThis patch tackles the problem of parsing Mips
Jack Carter [Sat, 12 Jan 2013 01:03:14 +0000 (01:03 +0000)]
This patch tackles the problem of parsing Mips
register names in the standalone assembler llvm-mc.

Registers such as $A1 can represent either a 32 or
64 bit register based on the instruction using it.
In addition, based on the abi, $T0 can represent different
32 bit registers.

The problem is resolved by the Mips specific AsmParser
td definitions changing to work together. Many cases of
RegisterClass parameters are now RegisterOperand.

Contributer: Vladimir Medic

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172284 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoLimit the search space in RAGreedy::tryEvict().
Jakob Stoklund Olesen [Sat, 12 Jan 2013 00:57:44 +0000 (00:57 +0000)]
Limit the search space in RAGreedy::tryEvict().

When tryEvict() is looking for a cheaper register in the allocation
order, skip the tail of too expensive registers when possible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172281 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoPrecompute some information about register costs.
Jakob Stoklund Olesen [Sat, 12 Jan 2013 00:54:59 +0000 (00:54 +0000)]
Precompute some information about register costs.

Remember the minimum cost of the registers in an allocation order and
the number of registers at the end of the allocation order that have the
same cost per use.

This information can be used to limit the search space for
RAGreedy::tryEvict() when looking for a cheaper register.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172280 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoStop hiding the interface-exposed EatToEndOfStatement (see r172276).
Eli Bendersky [Sat, 12 Jan 2013 00:23:24 +0000 (00:23 +0000)]
Stop hiding the interface-exposed EatToEndOfStatement (see r172276).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172277 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoMake ParseIdentifier a public method instead of private.
Eli Bendersky [Sat, 12 Jan 2013 00:05:00 +0000 (00:05 +0000)]
Make ParseIdentifier a public method instead of private.

The MCAsmParser interface defines ParseIdentifier is public. There's no reason
whatsoever for AsmParser (which implements the MCAsmParser interface) to hide
this method.

This is all part of a bigger scheme. Several asm parsing "extensions" use the
main parser properly through the MCAsmParser interface. However,
GenericAsmParser has much more exclusive access and uses implementation details
from the concrete implementation - AsmParser, in which it is also declared as
a friend. This makes for overly coupled code, and even makes it hard to split
GenericAsmParser into a separate file. There's no reason why GenericAsmParser
shouldn't be able to access AsmParser through an abstract interface, as long
as it's actually registered as an extension.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172276 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFixed whitespace.
Michael Gottesman [Fri, 11 Jan 2013 23:08:52 +0000 (23:08 +0000)]
Fixed whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172271 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoPPC: Implement efficient lowering of sign_extend_inreg.
Nadav Rotem [Fri, 11 Jan 2013 22:57:48 +0000 (22:57 +0000)]
PPC: Implement efficient lowering of sign_extend_inreg.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172269 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoProof of concept moving of generic directive parsing from AsmParser to the
Eli Bendersky [Fri, 11 Jan 2013 22:55:28 +0000 (22:55 +0000)]
Proof of concept moving of generic directive parsing from AsmParser to the
GenericAsmParser extension, where a lot of directives are already being parsed.
The end goal is having just a single place (and a single lookup table) for
all directive parsing.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172268 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUpdate patch for the pad short functions pass for Intel Atom (only).
Preston Gurd [Fri, 11 Jan 2013 22:06:56 +0000 (22:06 +0000)]
Update patch for the pad short functions pass for Intel Atom (only).

Adds a check for -Oz, changes the code to not re-visit BBs,
and skips over DBG_VALUE instrs.

Patch by Andy Zhang.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172258 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove some accidentaly duplicated code. This needs urgent cleanup :(
Benjamin Kramer [Fri, 11 Jan 2013 20:11:33 +0000 (20:11 +0000)]
Remove some accidentaly duplicated code. This needs urgent cleanup :(

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172248 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdded debug messages to GlobalOpt.
Michael Gottesman [Fri, 11 Jan 2013 20:07:53 +0000 (20:07 +0000)]
Added debug messages to GlobalOpt.

Specifically:
1. Added a missing new line when we emit a debug message saying that we are marking a global variable as constant.
2. Added debug messages that describe what is occuring when GlobalOpt is evaluating a block/function.
3. Added a debug message that says what specific constructor is being evaluated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172247 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSplit TargetLowering into a CodeGen and a SelectionDAG part.
Benjamin Kramer [Fri, 11 Jan 2013 20:05:37 +0000 (20:05 +0000)]
Split TargetLowering into a CodeGen and a SelectionDAG part.

This fixes some of the cycles between libCodeGen and libSelectionDAG. It's still
a complete mess but as long as the edges consist of virtual call it doesn't
cause breakage. BasicTTI did static calls and thus broke some build
configurations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172246 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoARM Cost Model: Modify the target independent cost model to ask
Nadav Rotem [Fri, 11 Jan 2013 19:54:13 +0000 (19:54 +0000)]
ARM Cost Model: Modify the target independent cost model to ask
the target if it supports the different CAST types. We didn't do this
on X86 because of the different register sizes and types, but on ARM
this makes sense.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172245 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove PTX->NVPTX in CodeGenerator document and update its text.
Justin Holewinski [Fri, 11 Jan 2013 18:47:10 +0000 (18:47 +0000)]
Remove PTX->NVPTX in CodeGenerator document and update its text.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172235 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUpdate CodeGenerator document to add a "Not Applicable" category to the
Justin Holewinski [Fri, 11 Jan 2013 18:37:54 +0000 (18:37 +0000)]
Update CodeGenerator document to add a "Not Applicable" category to the
Target Feature Matrix, and update the PTX column with this new category.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172234 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFor inline asm:
Eric Christopher [Fri, 11 Jan 2013 18:12:39 +0000 (18:12 +0000)]
For inline asm:

- recognize string "{memory}" in the MI generation
- mark as mayload/maystore when there's a memory clobber constraint.

PR14859.

Patch by Krzysztof Parzyszek

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172228 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFollow-up typo correction from building the wrong branch.
Andrew Trick [Fri, 11 Jan 2013 17:51:16 +0000 (17:51 +0000)]
Follow-up typo correction from building the wrong branch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172224 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix typo from r170452. Affects -enable-misched heuristics.
Andrew Trick [Fri, 11 Jan 2013 17:46:50 +0000 (17:46 +0000)]
Fix typo from r170452. Affects -enable-misched heuristics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172223 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUpdate CMakeLists for CallPrinter.cpp.
Andrew Trick [Fri, 11 Jan 2013 17:34:05 +0000 (17:34 +0000)]
Update CMakeLists for CallPrinter.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172222 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdded -view-callgraph module pass.
Andrew Trick [Fri, 11 Jan 2013 17:28:14 +0000 (17:28 +0000)]
Added -view-callgraph module pass.

-dot-callgraph similarly follows a standard module pass pattern.

Patch by Speziale Ettore!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172220 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix bug in exception table allocation (PR13678)
Eli Bendersky [Fri, 11 Jan 2013 16:33:30 +0000 (16:33 +0000)]
Fix bug in exception table allocation (PR13678)

Patch by Michael Muller.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172214 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove lib/Target/PTX directory. It was empty and obsolete but apparently git-svn...
Justin Holewinski [Fri, 11 Jan 2013 13:14:17 +0000 (13:14 +0000)]
Remove lib/Target/PTX directory.  It was empty and obsolete but apparently git-svn does not remove empty directories.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172199 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSimplify writing floating types to assembly.
Tim Northover [Fri, 11 Jan 2013 10:36:13 +0000 (10:36 +0000)]
Simplify writing floating types to assembly.

This removes previous special cases for each floating-point type in favour of a
shared codepath.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172189 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agollvm-symbolizer: add DATA command that allows to symbolize global variables.
Dmitry Vyukov [Fri, 11 Jan 2013 07:16:20 +0000 (07:16 +0000)]
llvm-symbolizer: add DATA command that allows to symbolize global variables.
Example:
>DATA bin/clang 0x26e8e40
<llvm::SparcSubTypeKV
<40799808 416
The last line is address and size of the object.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172180 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoARM Cost Model: We need to detect the max bitwidth of types in the loop in order...
Nadav Rotem [Fri, 11 Jan 2013 07:11:59 +0000 (07:11 +0000)]
ARM Cost Model:  We need to detect the max bitwidth of types in the loop in order to select the max vectorization factor.
We don't have a detailed analysis on which values are vectorized and which stay scalars in the vectorized loop so we use
another method. We look at reduction variables, loads and stores, which are the only ways to get information in and out
of loop iterations. If the data types are extended and truncated then the cost model will catch the cost of the vector
zext/sext/trunc operations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172178 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoConverted test dont-tce-tail-marked-call.ll to use FileCheck.
Michael Gottesman [Fri, 11 Jan 2013 04:16:35 +0000 (04:16 +0000)]
Converted test dont-tce-tail-marked-call.ll to use FileCheck.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172172 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoThis commit is a 4x squash commit consisting of 4x functions converted to use FileChe...
Michael Gottesman [Fri, 11 Jan 2013 04:12:53 +0000 (04:12 +0000)]
This commit is a 4x squash commit consisting of 4x functions converted to use FileCheck instead of grep.

Messages:
Converted test case trivial_codegen_tailcall.ll to use FileCheck.
Converted test return_constant.ll to use FileCheck instead of grep.
Converted test reorder_load.ll to use FileCheck instead of grep.
Converted test intervening-inst.ll to use FileCheck instead of grep.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172171 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRevert r172153, "llvm/lib/MC/MCParser/AsmParser.cpp: [ms-inline-asm] Fix a couple...
NAKAMURA Takumi [Fri, 11 Jan 2013 02:50:09 +0000 (02:50 +0000)]
Revert r172153, "llvm/lib/MC/MCParser/AsmParser.cpp: [ms-inline-asm] Fix a couple of undefined behaviors. Operand->needAddressOf() is not initialized at !Operand->isReg()."

It has been redundant since r172157.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172166 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSMDiagnostic: don't emit ranges if there are /any/ multibyte characters.
Jordan Rose [Fri, 11 Jan 2013 02:37:55 +0000 (02:37 +0000)]
SMDiagnostic: don't emit ranges if there are /any/ multibyte characters.

Right now, only OS X has a way to determine the column width of a string
(PR14910). Until we have a good way to deal with this, we just won't
print carets, source ranges, or fixits for SMDiagnostic if the source line
has multibyte characters in it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172164 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agodocs: Fix long standing linking antipattern.
Sean Silva [Fri, 11 Jan 2013 02:28:08 +0000 (02:28 +0000)]
docs: Fix long standing linking antipattern.

Before we learned about :doc:, we used :ref: and put a dummy link at the
top of each page. Don't do that anymore.

This fixes PR14891 as a special case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172162 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agodocs: fix misleading description.
Sean Silva [Fri, 11 Jan 2013 01:54:16 +0000 (01:54 +0000)]
docs: fix misleading description.

PR14890

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172160 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoSupport for half intrinsics. Pushes MMX into slower encoding path.
Michael Ilseman [Fri, 11 Jan 2013 01:45:05 +0000 (01:45 +0000)]
Support for half intrinsics. Pushes MMX into slower encoding path.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172159 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoX86AsmParser.cpp: Fix up r172148, to add initializer in another CreateMem().
NAKAMURA Takumi [Fri, 11 Jan 2013 01:13:54 +0000 (01:13 +0000)]
X86AsmParser.cpp: Fix up r172148, to add initializer in another CreateMem().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172157 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd a new portability macro LLVM_FUNCTION_NAME, that expands to __func__, if
Dmitri Gribenko [Fri, 11 Jan 2013 01:13:51 +0000 (01:13 +0000)]
Add a new portability macro LLVM_FUNCTION_NAME, that expands to __func__, if
supported.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172156 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoLoopPass.h doesn't require Function.h. Remove unneeded #include.
Jakub Staszak [Fri, 11 Jan 2013 01:03:32 +0000 (01:03 +0000)]
LoopPass.h doesn't require Function.h. Remove unneeded #include.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172155 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agollvm/lib/MC/MCParser/AsmParser.cpp: [ms-inline-asm] Fix a couple of undefined behavio...
NAKAMURA Takumi [Fri, 11 Jan 2013 00:37:35 +0000 (00:37 +0000)]
llvm/lib/MC/MCParser/AsmParser.cpp: [ms-inline-asm] Fix a couple of undefined behaviors. Operand->needAddressOf() is not initialized at !Operand->isReg().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172153 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove heavy and unused #inclues from X86TargetObjectFile.cpp.
Jakub Staszak [Thu, 10 Jan 2013 23:43:56 +0000 (23:43 +0000)]
Remove heavy and unused #inclues from X86TargetObjectFile.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172151 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRename enumerations s/VK/DK/ to conform to naming convention
Eli Bendersky [Thu, 10 Jan 2013 23:40:56 +0000 (23:40 +0000)]
Rename enumerations s/VK/DK/ to conform to naming convention

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172149 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[ms-inline asm] Make sure we set a default value for AddressOf. Follow on to
Chad Rosier [Thu, 10 Jan 2013 23:39:07 +0000 (23:39 +0000)]
[ms-inline asm] Make sure we set a default value for AddressOf.  Follow on to
r172121.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172148 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agofix comments a bit
Eli Bendersky [Thu, 10 Jan 2013 23:32:57 +0000 (23:32 +0000)]
fix comments a bit

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172146 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoPR14904: Segmentation fault running pass 'Recognize loop idioms'
Shuxin Yang [Thu, 10 Jan 2013 23:32:01 +0000 (23:32 +0000)]
PR14904: Segmentation fault running pass 'Recognize loop idioms'

The root cause is mistakenly taking for granted that
    "dyn_cast<Instruction>(a-Value)"
return a non-NULL instruction.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172145 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoCastInst::castIsValid should return true if the dest type is the same as
Evan Cheng [Thu, 10 Jan 2013 23:22:53 +0000 (23:22 +0000)]
CastInst::castIsValid should return true if the dest type is the same as
Value's current type. The casting is trivial even for aggregate type.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172143 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agollvm/test/CodeGen/X86/ms-inline-asm.ll: Fixup; Globals doesn't have leading underscor...
NAKAMURA Takumi [Thu, 10 Jan 2013 23:02:48 +0000 (23:02 +0000)]
llvm/test/CodeGen/X86/ms-inline-asm.ll: Fixup; Globals doesn't have leading underscore in symbol on linux.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172139 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUpdate Apple's build script for llvmCore. <rdar://problem/12914321>
Bob Wilson [Thu, 10 Jan 2013 22:59:51 +0000 (22:59 +0000)]
Update Apple's build script for llvmCore. <rdar://problem/12914321>

This change is basically just copying changes that we've used for Apple's
clang builds to the script used for building llvmCore. Besides cleaning it
up to use xcrun to locate the proper versions of tools, especially for cross
compiling, it fixes the build to work with newer versions of clang that
honor SDKROOT settings in the environment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172138 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove a couple of if-else chains in parsing directives, replacing them by a
Eli Bendersky [Thu, 10 Jan 2013 22:44:57 +0000 (22:44 +0000)]
Remove a couple of if-else chains in parsing directives, replacing them by a
switch. Committed with Jim's and Chris's approval.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172136 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[llvm-objdump] Emit addresses with the correct number of leading 0's.
Michael J. Spencer [Thu, 10 Jan 2013 22:40:50 +0000 (22:40 +0000)]
[llvm-objdump] Emit addresses with the correct number of leading 0's.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172130 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[msan] Change va_start/va_copy shadow memset alignment to 8.
Peter Collingbourne [Thu, 10 Jan 2013 22:36:33 +0000 (22:36 +0000)]
[msan] Change va_start/va_copy shadow memset alignment to 8.

This fixes va_start/va_copy of a va_list field which happens to not
be laid out at a 16-byte boundary.

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172128 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove trailing spaces.
Jakub Staszak [Thu, 10 Jan 2013 22:14:33 +0000 (22:14 +0000)]
Remove trailing spaces.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172125 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoPR14896: Handle memcpy from constant string where the memcpy size is larger than...
Evan Cheng [Thu, 10 Jan 2013 22:13:27 +0000 (22:13 +0000)]
PR14896: Handle memcpy from constant string where the memcpy size is larger than the string size.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172124 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove unneeded includes from FunctionLoweringInfo.h.
Jakub Staszak [Thu, 10 Jan 2013 22:13:13 +0000 (22:13 +0000)]
Remove unneeded includes from FunctionLoweringInfo.h.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172123 91177308-0d34-0410-b5e6-96231b3b80d8

11 years ago[ms-inline asm] Add support for calling functions from inline assembly.
Chad Rosier [Thu, 10 Jan 2013 22:10:27 +0000 (22:10 +0000)]
[ms-inline asm] Add support for calling functions from inline assembly.
Part of rdar://12991541

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172121 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRemove unneeded #includes.
Jakub Staszak [Thu, 10 Jan 2013 22:07:29 +0000 (22:07 +0000)]
Remove unneeded #includes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172118 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTeach InstCombine to hoist FABS and FNEG through FPTRUNC instructions. The applicati...
Owen Anderson [Thu, 10 Jan 2013 22:06:52 +0000 (22:06 +0000)]
Teach InstCombine to hoist FABS and FNEG through FPTRUNC instructions.  The application of these operations commutes with the truncation, so we should prefer to do them in the smallest size we can, to save register space, use smaller constant pool entries, etc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172117 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix indent and remove unneeded #includes in MDBuilder.h.
Jakub Staszak [Thu, 10 Jan 2013 22:00:36 +0000 (22:00 +0000)]
Fix indent and remove unneeded #includes in MDBuilder.h.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172115 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix #includes after my last commit.
Jakub Staszak [Thu, 10 Jan 2013 21:56:40 +0000 (21:56 +0000)]
Fix #includes after my last commit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172114 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoRename LinkAllVMCore.h to LinkAllIR.h since VMCore directory was renamed to IR.
Jakub Staszak [Thu, 10 Jan 2013 21:55:02 +0000 (21:55 +0000)]
Rename LinkAllVMCore.h to LinkAllIR.h since VMCore directory was renamed to IR.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172112 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoremove the rest of the "written by" lines in the documentation. It is
Chris Lattner [Thu, 10 Jan 2013 21:24:04 +0000 (21:24 +0000)]
remove the rest of the "written by" lines in the documentation.  It is
against the developer policy to include this sort of thing as SVN blame
already captures this in a far more fine-grained way.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172109 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoReplace memcpys by a static_cast and an integral promotion.
Dmitri Gribenko [Thu, 10 Jan 2013 21:21:32 +0000 (21:21 +0000)]
Replace memcpys by a static_cast and an integral promotion.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172108 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix coding style
Dmitri Gribenko [Thu, 10 Jan 2013 21:10:44 +0000 (21:10 +0000)]
Fix coding style

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172107 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoUnbreak tests after regression from r172081.
Jakub Staszak [Thu, 10 Jan 2013 21:02:05 +0000 (21:02 +0000)]
Unbreak tests after regression from r172081.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172105 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAdd basic fix-its to SMDiagnostic.
Jordan Rose [Thu, 10 Jan 2013 18:50:15 +0000 (18:50 +0000)]
Add basic fix-its to SMDiagnostic.

Like Clang's FixItHint, SMFixIt represents an insertion, replacement, or
removal of source text. One or more fix-its can be emitted as part of
a diagnostic, and will be printed below the source range line to show the
user how they can fix their code.

Currently, the only client of SMFixIt is clang-tblgen; thus, the tests for
this behavior live in clang/test/TableGen/tg-fixits.td. If/when SMFixIt is
adopted within LLVM itself, those tests should be moved to the LLVM suite.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172086 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTableGen: Keep track of superclass reference ranges.
Jordan Rose [Thu, 10 Jan 2013 18:50:11 +0000 (18:50 +0000)]
TableGen: Keep track of superclass reference ranges.

def foo : bar;
          ~~~

This allows us to produce more precise diagnostics about a certain
superclass, and even provide fixits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172085 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoTableGen: record anonymous instantiations of classes.
Jordan Rose [Thu, 10 Jan 2013 18:50:05 +0000 (18:50 +0000)]
TableGen: record anonymous instantiations of classes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172084 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoAllow hasProperty() to be called on bundle-internal instructions.
Jakob Stoklund Olesen [Thu, 10 Jan 2013 18:42:44 +0000 (18:42 +0000)]
Allow hasProperty() to be called on bundle-internal instructions.

When calling hasProperty() on an instruction inside a bundle, it should
always behave as if IgnoreBundle was passed, and just return properties
for the current instruction.

Only attempt to aggregate bundle properties whan asked about the bundle
header.

The assertion fires on existing ARM test cases without this fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172082 91177308-0d34-0410-b5e6-96231b3b80d8

11 years agoFix Alias Bug
David Greene [Thu, 10 Jan 2013 18:17:54 +0000 (18:17 +0000)]
Fix Alias Bug

Use memcpy to do type punning instead of a cast.  A cast or similar
operation through a union breaks strict aliasing rules.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172081 91177308-0d34-0410-b5e6-96231b3b80d8