1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-19 11:02:59 +02:00
Commit Graph

58614 Commits

Author SHA1 Message Date
Eli Bendersky
abe1a77c03 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.

llvm-svn: 172450
2013-01-14 19:04:57 +00:00
Eli Bendersky
38501d372e 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.

llvm-svn: 172449
2013-01-14 19:00:26 +00:00
Eli Bendersky
0b7c192145 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).

llvm-svn: 172440
2013-01-14 18:08:41 +00:00
Timur Iskhodzhanov
b7cea77676 Revert r171829 "Split changeset_ty using iterators instead of loops" as it breaks the VS2008 build
llvm-svn: 172411
2013-01-14 14:13:06 +00:00
Craig Topper
58b9662000 Simplify nested strconcats in X86 td files since strconcat can take more than 2 arguments.
llvm-svn: 172379
2013-01-14 07:46:34 +00:00
Craig Topper
7dac5e7e3d Create a single multiclass for SSE and AVX version of MOVL/MOVH. Prevents needing to specify everything twice. No functional change intended
llvm-svn: 172378
2013-01-14 07:26:58 +00:00
Michael Gottesman
aabad66a3a Fixed some 80+ violations.
llvm-svn: 172374
2013-01-14 01:47:53 +00:00
Michael Gottesman
0ff0eb0f71 Updated the documentation in ObjCARC.cpp to fit the style guide better (i.e. use doxygen). Still some work to do though.
llvm-svn: 172371
2013-01-14 00:35:14 +00:00
Michael Gottesman
c6a7902080 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.

llvm-svn: 172368
2013-01-13 22:12:06 +00:00
Nick Lewycky
07a4cc5052 Fix typo in comment.
llvm-svn: 172364
2013-01-13 19:03:55 +00:00
Nuno Lopes
4acd175397 fix compile-time regression report by Joerg Sonnenberger:
cache result of Size/OffsetVisitor to speedup analysis of PHI nodes

llvm-svn: 172363
2013-01-13 18:02:57 +00:00
Dmitri Gribenko
1584888148 Remove redundant 'llvm::' qualifications
llvm-svn: 172358
2013-01-13 16:01:15 +00:00
Benjamin Kramer
26eae94ea6 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.

llvm-svn: 172353
2013-01-13 11:37:04 +00:00
Nadav Rotem
c6cce40085 Fix PR14547. Handle induction variables of small sizes smaller than i32 (i8 and i16).
llvm-svn: 172348
2013-01-13 07:56:29 +00:00
Michael Gottesman
1f32fece1e [ObjCARC] Even more debug messages!
llvm-svn: 172347
2013-01-13 07:47:32 +00:00
Michael Gottesman
ffdbdc6957 [ObjCARC] More debug messages.
llvm-svn: 172346
2013-01-13 07:00:51 +00:00
Chandler Carruth
a094848fcc 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! =]

llvm-svn: 172336
2013-01-12 23:46:04 +00:00
Benjamin Kramer
17f2252b33 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.

llvm-svn: 172322
2013-01-12 19:06:44 +00:00
NAKAMURA Takumi
3769319e91 MipsDisassembler.cpp: Prune DecodeHWRegs64RegisterClass() to suppress a warning. [-Wunused-function]
llvm-svn: 172319
2013-01-12 15:37:00 +00:00
Benjamin Kramer
00cee3c019 GlobalOpt: Avoid jump on uninitialized value.
Found by valgrind.

llvm-svn: 172318
2013-01-12 15:34:31 +00:00
NAKAMURA Takumi
4018aaf2df MipsAsmParser: Try to unbreak tests to add extra check.
llvm-svn: 172315
2013-01-12 15:19:10 +00:00
Michael Gottesman
ea2af5c74a Fixed debug message in ObjCARC.
llvm-svn: 172299
2013-01-12 03:45:49 +00:00
Michael Gottesman
a00a81d4cc Fixed a few debug messages in ObjCARC and added one.
llvm-svn: 172298
2013-01-12 02:57:16 +00:00
Michael Gottesman
822cc01174 Fixed bug in ObjCARC where we were changing a call from objc_autoreleaseRV => objc_autorelease but were not updating the InstructionClass to IC_Autorelease.
llvm-svn: 172288
2013-01-12 01:25:19 +00:00
Michael Gottesman
c59f1a814a 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.

llvm-svn: 172287
2013-01-12 01:25:15 +00:00
Jack Carter
d66ed8368e 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
llvm-svn: 172284
2013-01-12 01:03:14 +00:00
Jakob Stoklund Olesen
7b54416641 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.

llvm-svn: 172281
2013-01-12 00:57:44 +00:00
Jakob Stoklund Olesen
9f70ce8254 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.

llvm-svn: 172280
2013-01-12 00:54:59 +00:00
Eli Bendersky
3857c4275f Stop hiding the interface-exposed EatToEndOfStatement (see r172276).
llvm-svn: 172277
2013-01-12 00:23:24 +00:00
Eli Bendersky
326f4b5f48 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.

llvm-svn: 172276
2013-01-12 00:05:00 +00:00
Michael Gottesman
7b3794a302 Fixed whitespace.
llvm-svn: 172271
2013-01-11 23:08:52 +00:00
Nadav Rotem
7a3f564b06 PPC: Implement efficient lowering of sign_extend_inreg.
llvm-svn: 172269
2013-01-11 22:57:48 +00:00
Eli Bendersky
70f1007034 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.

llvm-svn: 172268
2013-01-11 22:55:28 +00:00
Preston Gurd
7affdf3bdd 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.

llvm-svn: 172258
2013-01-11 22:06:56 +00:00
Benjamin Kramer
ddfd61f44f Remove some accidentaly duplicated code. This needs urgent cleanup :(
llvm-svn: 172248
2013-01-11 20:11:33 +00:00
Michael Gottesman
d268958bcc 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.

llvm-svn: 172247
2013-01-11 20:07:53 +00:00
Benjamin Kramer
7097792a88 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.

llvm-svn: 172246
2013-01-11 20:05:37 +00:00
Nadav Rotem
c79f1aa3f4 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.

llvm-svn: 172245
2013-01-11 19:54:13 +00:00
Eric Christopher
319d407a21 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

llvm-svn: 172228
2013-01-11 18:12:39 +00:00
Andrew Trick
6032a0aa54 Follow-up typo correction from building the wrong branch.
llvm-svn: 172224
2013-01-11 17:51:16 +00:00
Andrew Trick
d350ea52f4 Fix typo from r170452. Affects -enable-misched heuristics.
llvm-svn: 172223
2013-01-11 17:46:50 +00:00
Andrew Trick
f1af8d2a6e Update CMakeLists for CallPrinter.cpp.
llvm-svn: 172222
2013-01-11 17:34:05 +00:00
Andrew Trick
6c45ac6ed1 Added -view-callgraph module pass.
-dot-callgraph similarly follows a standard module pass pattern.

Patch by Speziale Ettore!

llvm-svn: 172220
2013-01-11 17:28:14 +00:00
Eli Bendersky
30fd822f06 Fix bug in exception table allocation (PR13678)
Patch by Michael Muller.

llvm-svn: 172214
2013-01-11 16:33:30 +00:00
Tim Northover
978c012c2a Simplify writing floating types to assembly.
This removes previous special cases for each floating-point type in favour of a
shared codepath.

llvm-svn: 172189
2013-01-11 10:36:13 +00:00
Nadav Rotem
008741a0e0 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.

llvm-svn: 172178
2013-01-11 07:11:59 +00:00
NAKAMURA Takumi
1a798ac8dc 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.

llvm-svn: 172166
2013-01-11 02:50:09 +00:00
Jordan Rose
0d7f7a8ee4 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.

llvm-svn: 172164
2013-01-11 02:37:55 +00:00
Michael Ilseman
d8715c1e7a Support for half intrinsics. Pushes MMX into slower encoding path.
llvm-svn: 172159
2013-01-11 01:45:05 +00:00
NAKAMURA Takumi
da4d0cbcc1 X86AsmParser.cpp: Fix up r172148, to add initializer in another CreateMem().
llvm-svn: 172157
2013-01-11 01:13:54 +00:00