Eli Bendersky [Tue, 15 Jan 2013 23:22:09 +0000 (23:22 +0000)]
Optimize the memory usage of MC bundling, by creating a new type of fragment
into which we can emit single instructions without fixups (which is most
instructions). This is an optimization required because MCDataFragment
is prety large (240 bytes on x64), with no change in functionality.
For large programs, this reduces memory usage overhead required for bundling
by 40%.
To make the code as palatable as possible, the MCEncodedFragment interface was
further fragmented (no pun intended) and MCEncodedFragmentWithFixups is used
as the interface to work against when the user expects fixups. MCDataFragment
and MCRelaxableFragment implement this interface, while the new
MCCompactEncodedInstFragment implements MCEncodeFragment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172572
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Tue, 15 Jan 2013 23:07:53 +0000 (23:07 +0000)]
[ms-inline asm] Address the FIXME in AsmParser.cpp.
// FIXME: Constraints are hard coded to 'm', but we need an 'r'
// constraint for addressof. This needs to be cleaned up!
Test cases are already in place. Specifically,
clang/test/CodeGen/ms-inline-asm.c t15(), t16(), and t24().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172569
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Bendersky [Tue, 15 Jan 2013 22:59:42 +0000 (22:59 +0000)]
Refactor generic Asm directive parsing.
After discussing the refactoring with Jim and Daniel, the following changes were
made:
* All generic directive parsing is now done by AsmParser itself. The previous
division between it and GenericAsmParser did not have clear boundaries and
just produced unnatural code of GenericAsmParser juggling the internals of
AsmParser through an interface.
The division of responsibilities is now clear: target-specific directives,
other extensions (used by platform-specific parseres), and generic directives.
* Priority for directive parsing was reshuffled to ask extensions first and
check the generic directives later.
No change in functionality.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172568
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Tue, 15 Jan 2013 22:00:16 +0000 (22:00 +0000)]
[Object][ELF] Fix -Wenum-compare.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172556
91177308-0d34-0410-b5e6-
96231b3b80d8
Shuxin Yang [Tue, 15 Jan 2013 21:09:32 +0000 (21:09 +0000)]
1. Hoist minus sign as high as possible in an attempt to reveal
some optimization opportunities (in the enclosing supper-expressions).
rule 1. (-0.0 - X ) * Y => -0.0 - (X * Y)
if expression "-0.0 - X" has only one reference.
rule 2. (0.0 - X ) * Y => -0.0 - (X * Y)
if expression "0.0 - X" has only one reference, and
the instruction is marked "noSignedZero".
2. Eliminate negation (The compiler was already able to handle these
opt if the 0.0s are replaced with -0.0.)
rule 3: (0.0 - X) * (0.0 - Y) => X * Y
rule 4: (0.0 - X) * C => X * -C
if the expr is flagged "noSignedZero".
3.
Rule 5: (X*Y) * X => (X*X) * Y
if X!=Y and the expression is flagged with "UnsafeAlgebra".
The purpose of this transformation is two-fold:
a) to form a power expression (of X).
b) potentially shorten the critical path: After transformation, the
latency of the instruction Y is amortized by the expression of X*X,
and therefore Y is in a "less critical" position compared to what it
was before the transformation.
4. Remove the InstCombine code about simplifiying "X * select".
The reasons are following:
a) The "select" is somewhat architecture-dependent, therefore the
higher level optimizers are not able to precisely predict if
the simplification really yields any performance improvement
or not.
b) The "select" operator is bit complicate, and tends to obscure
optimization opportunities. It is btter to keep it as low as
possible in expr tree, and let CodeGen to tackle the optimization.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172551
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Tue, 15 Jan 2013 20:52:09 +0000 (20:52 +0000)]
[Linker] Drop asserts that are embedded in cast<> and now checked by the verifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172550
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Tue, 15 Jan 2013 20:52:06 +0000 (20:52 +0000)]
[IR] Add verification for module flags with the "require" behavior.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172549
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Tue, 15 Jan 2013 18:25:16 +0000 (18:25 +0000)]
LoopVectorizer cost model. Honor the user command line flag that selects the vectorization factor even if the target machine does not have any vector registers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172544
91177308-0d34-0410-b5e6-
96231b3b80d8
David Greene [Tue, 15 Jan 2013 18:21:15 +0000 (18:21 +0000)]
Disable Uninitialized Use Warnings for Broken gcc Versions
Some versions of gcc accept unsupported -W flags and run just fine if
there are no warnings, but die with an unsupported flag error if a
warning is encountered. gcc 4.3 and gcc 4.4 both exhibit this
behavior for -Wno-maybe-uninitialized. Therefore, if the flag check
for -Wno-maybe-uninitialized succeeds, only use
-Wno-maybe-uninitialized if we are using gcc version 4.7 or greater.
Use -Wno-uninitialized otherwise.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172543
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Tue, 15 Jan 2013 17:12:04 +0000 (17:12 +0000)]
[msan] Temporarily remove ICmpEQ tests.
They are failing on the bots.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172540
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Tue, 15 Jan 2013 16:44:52 +0000 (16:44 +0000)]
[msan] Fix handling of equality comparison of pointer vectors.
Also improve test coveration of the handling of relational comparisons.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172539
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Tue, 15 Jan 2013 16:43:00 +0000 (16:43 +0000)]
Allow vectors in CreatePointerCast.
Both underlying IR operations support vectors of pointers already.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172538
91177308-0d34-0410-b5e6-
96231b3b80d8
Evgeniy Stepanov [Tue, 15 Jan 2013 15:30:33 +0000 (15:30 +0000)]
Fix operand type conditions in one of ICmpInst constructors.
It was out of sync with the conditions in the other two constructors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172535
91177308-0d34-0410-b5e6-
96231b3b80d8
Renato Golin [Tue, 15 Jan 2013 15:22:45 +0000 (15:22 +0000)]
Pattern-matched variables in post-inc-icmpzero.ll
Test was failing for clang-native-arm-cortex-a9 build-bot configuration.
The reason for the failure was the test was using hardcoded names.
The attached patch fixes this failure by replacing the hard-coded variables
names with pattern-matched variable names.
Patch by Manish Verma, ARM
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172534
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Tue, 15 Jan 2013 09:37:45 +0000 (09:37 +0000)]
Update CODE_OWNERS.TXT.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172525
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Tue, 15 Jan 2013 07:44:25 +0000 (07:44 +0000)]
[Object][ELF] Simplify ELFObjectFile by using ELFType.
This simplifies the usage and implementation of ELFObjectFile by using ELFType
to replace:
<endianness target_endianness, std::size_t max_alignment, bool is64Bits>
This does complicate the base ELF types as they must now use template template
parameters to partially specialize for the 32 and 64bit cases. However these
are only defined once.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172515
91177308-0d34-0410-b5e6-
96231b3b80d8
Michael J. Spencer [Tue, 15 Jan 2013 05:01:39 +0000 (05:01 +0000)]
[Support] Add LLVM_CONSTEXPR.
Marks a decl as constexpr if the compiler supports it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172508
91177308-0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Tue, 15 Jan 2013 01:58:45 +0000 (01:58 +0000)]
[ADT/StringMap] Follow-up to r172455, use the correct constructor for setting the InitialSize,
previously it was calling the "StringMapImpl(unsigned itemSize)" constructor.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172500
91177308-0d34-0410-b5e6-
96231b3b80d8
Nadav Rotem [Tue, 15 Jan 2013 01:53:57 +0000 (01:53 +0000)]
LTO: Also init TTI for codegen passes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172499
91177308-0d34-0410-b5e6-
96231b3b80d8
Daniel Dunbar [Tue, 15 Jan 2013 01:22:53 +0000 (01:22 +0000)]
[IR] Add verifier support for llvm.module.flags.
- Also, update the LangRef documentation on module flags to match the
implementation.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172498
91177308-0d34-0410-b5e6-
96231b3b80d8
Jack Carter [Tue, 15 Jan 2013 01:08:02 +0000 (01:08 +0000)]
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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172496
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Bendersky [Mon, 14 Jan 2013 23:43:18 +0000 (23:43 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172491
91177308-0d34-0410-b5e6-
96231b3b80d8
Eli Bendersky [Mon, 14 Jan 2013 23:22:36 +0000 (23:22 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172490
91177308-0d34-0410-b5e6-
96231b3b80d8
Jakub Staszak [Mon, 14 Jan 2013 23:16:36 +0000 (23:16 +0000)]
Remove trailing spaces.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172489
91177308-0d34-0410-b5e6-
96231b3b80d8
Shuxin Yang [Mon, 14 Jan 2013 22:48:41 +0000 (22:48 +0000)]
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)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172488
91177308-0d34-0410-b5e6-
96231b3b80d8
Chad Rosier [Mon, 14 Jan 2013 22:31:35 +0000 (22:31 +0000)]
[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
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172484
91177308-0d34-0410-b5e6-
96231b3b80d8
Dmitri Gribenko [Mon, 14 Jan 2013 22:18:18 +0000 (22:18 +0000)]
Improve r172468: const_cast is not needed here
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172483
91177308-0d34-0410-b5e6-
96231b3b80d8
Dmitri Gribenko [Mon, 14 Jan 2013 22:08:37 +0000 (22:08 +0000)]
Improve r172471: avoid all those extra casts on the lines nearby
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172481
91177308-0d34-0410-b5e6-
96231b3b80d8
Bill Schmidt [Mon, 14 Jan 2013 22:04:38 +0000 (22:04 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172480
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Mon, 14 Jan 2013 21:34:09 +0000 (21:34 +0000)]
Follow up of commit r172472.
Refactor the big if/else sequence into one string switch for ARM subtype selection.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172475
91177308-0d34-0410-b5e6-
96231b3b80d8
Dmitri Gribenko [Mon, 14 Jan 2013 21:23:37 +0000 (21:23 +0000)]
Improve r172464: const_cast is not needed if the variable is not const
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172474
91177308-0d34-0410-b5e6-
96231b3b80d8
Quentin Colombet [Mon, 14 Jan 2013 21:07:43 +0000 (21:07 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172472
91177308-0d34-0410-b5e6-
96231b3b80d8
David Greene [Mon, 14 Jan 2013 21:04:47 +0000 (21:04 +0000)]
Fix Casting
Fix a casting-away-const compiler warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172471
91177308-0d34-0410-b5e6-
96231b3b80d8
David Greene [Mon, 14 Jan 2013 21:04:45 +0000 (21:04 +0000)]
Fix Casting
Do proper casting to eliminate a const-away-cast compiler warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172470
91177308-0d34-0410-b5e6-
96231b3b80d8
David Greene [Mon, 14 Jan 2013 21:04:44 +0000 (21:04 +0000)]
Fix More Casts
Properly cast some more code that triggered cast-away-const errors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172469
91177308-0d34-0410-b5e6-
96231b3b80d8
David Greene [Mon, 14 Jan 2013 21:04:42 +0000 (21:04 +0000)]
Fix Another Cast
Properly cast code to eliminate cast-away-const errors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172468
91177308-0d34-0410-b5e6-
96231b3b80d8
David Greene [Mon, 14 Jan 2013 21:04:40 +0000 (21:04 +0000)]
Fix Casting Bug
Add a const version of getFpValPtr to avoid a cast-away-const warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172467
91177308-0d34-0410-b5e6-
96231b3b80d8
David Greene [Mon, 14 Jan 2013 21:04:38 +0000 (21:04 +0000)]
Fix More Casts
Fix another cast-away-const cast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172466
91177308-0d34-0410-b5e6-
96231b3b80d8
David Greene [Mon, 14 Jan 2013 21:04:37 +0000 (21:04 +0000)]
Fix Casting
Stop a gcc warning about casting away const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172465
91177308-0d34-0410-b5e6-
96231b3b80d8
David Greene [Mon, 14 Jan 2013 21:04:35 +0000 (21:04 +0000)]
Fix Casts
Use const_cast<> to avoid cast-away-const errors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172464
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Trick [Mon, 14 Jan 2013 21:00:37 +0000 (21:00 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172462
91177308-0d34-0410-b5e6-
96231b3b80d8
Nick Lewycky [Mon, 14 Jan 2013 20:56:10 +0000 (20:56 +0000)]
Fix typo in comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172460
91177308-0d34-0410-b5e6-
96231b3b80d8
Argyrios Kyrtzidis [Mon, 14 Jan 2013 19:41:09 +0000 (19:41 +0000)]
[ADT/StringMap] Add a constructor in StringMap that accepts both an
initial size and an allocator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172455
91177308-0d34-0410-b5e6-
96231b3b80d8
Joe Groff [Mon, 14 Jan 2013 19:37:42 +0000 (19:37 +0000)]
Fix DenseMap when LLVM_HAS_RVALUE_REFERENCES is defined but equals 0.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172454
91177308-0d34-0410-b5e6-
96231b3b80d8
Joe Groff [Mon, 14 Jan 2013 19:24:15 +0000 (19:24 +0000)]
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172453
91177308-0d34-0410-b5e6-
96231b3b80d8
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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