1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
Commit Graph

88333 Commits

Author SHA1 Message Date
Jack Carter
f7f756715f This patch fixes a Mips specific bug where
we need to generate a N64 compound relocation
R_MIPS_GPREL_32/R_MIPS_64/R_MIPS_NONE.

The bug was exposed by the SingleSourcetest case 
DuffsDevice.c.

Contributer: Jack Carter
llvm-svn: 172496
2013-01-15 01:08:02 +00:00
Eli Bendersky
44d6a7cbd6 Now GenericAsmParser and AsmParser are no longer friends, GenericAsmParser can
simply use the getParser method from MCAsmParserExtension, working through the
MCAsmParser interface. There's no longer a need to overload that method to
cast it to the concrete AsmParser.

llvm-svn: 172491
2013-01-14 23:43:18 +00:00
Eli Bendersky
d065fef2d9 Properly encapsulate additional methods and data from AsmParser.
This finally allows AsmParser to no longer list GenericAsmParser as a friend.
All member vars directly accessed by GenericAsmParser have been properly
encapsulated and exposed through the MCAsmParser interface. This reduces the
coupling between AsmParser and GenericAsmParser.

llvm-svn: 172490
2013-01-14 23:22:36 +00:00
Jakub Staszak
24a461467e Remove trailing spaces.
llvm-svn: 172489
2013-01-14 23:16:36 +00:00
Shuxin Yang
974390c4aa This change is to implement following rules under the condition C_A and/or C_R
---------------------------------------------------------------------------
 C_A: reassociation is allowed
 C_R: reciprocal of a constant C is appropriate, which means 
    - 1/C is exact, or 
    - reciprocal is allowed and 1/C is neither a special value nor a denormal.
 -----------------------------------------------------------------------------

 rule1:  (X/C1) / C2 => X / (C2*C1)  (if C_A)
                     => X * (1/(C2*C1))  (if C_A && C_R)
 rule 2:  X*C1 / C2 => X * (C1/C2)  if C_A
 rule 3: (X/Y)/Z = > X/(Y*Z)  (if C_A && at least one of Y and Z is symbolic value)
 rule 4: Z/(X/Y) = > (Z*Y)/X  (similar to rule3)

 rule 5: C1/(X*C2) => (C1/C2) / X (if C_A)
 rule 6: C1/(X/C2) => (C1*C2) / X (if C_A)
 rule 7: C1/(C2/X) => (C1/C2) * X (if C_A)

llvm-svn: 172488
2013-01-14 22:48:41 +00:00
Chad Rosier
1f23c079a7 [ms-inline asm] Extend support for parsing Intel bracketed memory operands that
have an arbitrary ordering of the base register, index register and displacement.
rdar://12527141

llvm-svn: 172484
2013-01-14 22:31:35 +00:00
Dmitri Gribenko
fa2aa38684 Improve r172468: const_cast is not needed here
llvm-svn: 172483
2013-01-14 22:18:18 +00:00
Dmitri Gribenko
3cc6bf1104 Improve r172471: avoid all those extra casts on the lines nearby
llvm-svn: 172481
2013-01-14 22:08:37 +00:00
Bill Schmidt
ae8a966ad7 This patch addresses an incorrect transformation in the DAG combiner.
The included test case is derived from one of the GCC compatibility tests.
The problem arises after the selection DAG has been converted to type-legalized
form.  The combiner first sees a 64-bit load that can be converted into a
pre-increment form.  The original load feeds into a SRL that isolates the
upper 32 bits of the loaded doubleword.  This looks like an opportunity for
DAGCombiner::ReduceLoadWidth() to replace the 64-bit load with a 32-bit load.

However, this transformation is not valid, as the replacement load is not
a pre-increment load.  The pre-increment load produces an extra result,
which feeds a subsequent add instruction.  The replacement load only has
one result value, and this value is propagated to all uses of the pre-
increment load, including the add.  Because the add is looking for the
second result value as its operand, it ends up attempting to add a constant
to a token chain, resulting in a crash.

So the patch simply disables this transformation for any load with more than
two result values.

llvm-svn: 172480
2013-01-14 22:04:38 +00:00
Quentin Colombet
9d0092a360 Follow up of commit r172472.
Refactor the big if/else sequence into one string switch for ARM subtype selection.

llvm-svn: 172475
2013-01-14 21:34:09 +00:00
Dmitri Gribenko
521181bcca Improve r172464: const_cast is not needed if the variable is not const
llvm-svn: 172474
2013-01-14 21:23:37 +00:00
Quentin Colombet
508f7bf868 Complete the existing support of ARM v6m, v7m, and v7em, i.e., respectively cortex-m0, cortex-m3, and cortex-m4 on the backend side.
Adds new subtype values for the MachO format and use them when the related triple are set.

llvm-svn: 172472
2013-01-14 21:07:43 +00:00
David Greene
1c40faafb9 Fix Casting
Fix a casting-away-const compiler warning.

llvm-svn: 172471
2013-01-14 21:04:47 +00:00
David Greene
7eac17ccce Fix Casting
Do proper casting to eliminate a const-away-cast compiler warning.

llvm-svn: 172470
2013-01-14 21:04:45 +00:00
David Greene
6830c63fcd Fix More Casts
Properly cast some more code that triggered cast-away-const errors.

llvm-svn: 172469
2013-01-14 21:04:44 +00:00
David Greene
1365ed4c63 Fix Another Cast
Properly cast code to eliminate cast-away-const errors.

llvm-svn: 172468
2013-01-14 21:04:42 +00:00
David Greene
a7b1d4d895 Fix Casting Bug
Add a const version of getFpValPtr to avoid a cast-away-const warning.

llvm-svn: 172467
2013-01-14 21:04:40 +00:00
David Greene
0f0e064b65 Fix More Casts
Fix another cast-away-const cast.

llvm-svn: 172466
2013-01-14 21:04:38 +00:00
David Greene
6637296080 Fix Casting
Stop a gcc warning about casting away const.

llvm-svn: 172465
2013-01-14 21:04:37 +00:00
David Greene
6d59c943e8 Fix Casts
Use const_cast<> to avoid cast-away-const errors.

llvm-svn: 172464
2013-01-14 21:04:35 +00:00
Andrew Trick
841ad0f303 SCEVExpander fix. RAUW needs to update the InsertedExpressions cache.
Note that this bug is only exposed because LTO fails to use TTI.

Fixes self-LTO of clang. rdar://13007381.

llvm-svn: 172462
2013-01-14 21:00:37 +00:00
Nick Lewycky
8ca069daaa Fix typo in comment.
llvm-svn: 172460
2013-01-14 20:56:10 +00:00
Argyrios Kyrtzidis
4c74fb34b5 [ADT/StringMap] Add a constructor in StringMap that accepts both an
initial size and an allocator.

llvm-svn: 172455
2013-01-14 19:41:09 +00:00
Joe Groff
fc0dc613ce Fix DenseMap when LLVM_HAS_RVALUE_REFERENCES is defined but equals 0.
llvm-svn: 172454
2013-01-14 19:37:42 +00:00
Joe Groff
1c6b8da11e Add DenseMap::insert(value_type&&) method.
Use the existing move implementation of the internal DenseMap::InsertIntoBucket
method to provide a user-facing move insert method.

llvm-svn: 172453
2013-01-14 19:24:15 +00:00
Michael Gottesman
58db6d1cd7 Changed SmallPtrSet.count guard + SmallPtrSet.insert to just SmallPtrSet.insert.
llvm-svn: 172452
2013-01-14 19:18:39 +00:00
Eli Bendersky
87b2978a18 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

llvm-svn: 172451
2013-01-14 19:15:01 +00:00
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
39de946871 Added bugzilla PR number to test case.
llvm-svn: 172369
2013-01-13 22:17:22 +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
9f4a160b9c Documentation: use monospaced font for intrinsics' names
llvm-svn: 172360
2013-01-13 16:07:49 +00:00
Dmitri Gribenko
4c0bfb8b5f Fix broken link to LangRef
llvm-svn: 172359
2013-01-13 16:06:11 +00:00
Dmitri Gribenko
1584888148 Remove redundant 'llvm::' qualifications
llvm-svn: 172358
2013-01-13 16:01:15 +00:00
Dmitri Gribenko
cf73a60f87 Update links to "Itanium C++ ABI: Exception Handling" document
llvm-svn: 172356
2013-01-13 15:53:09 +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
Tim Northover
d703dd5f40 Use more canonical exception-handling link in docs.
llvm-svn: 172325
2013-01-12 19:54:21 +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