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

16664 Commits

Author SHA1 Message Date
Michael J. Spencer
c9419b777a [Support/StringSet] Fix memory leak when inserted key already exists.
llvm-svn: 166517
2012-10-23 22:55:54 +00:00
Kevin Enderby
e40fcf611d Make branch heavy code for generating marked up disassembly simpler
and easier to read by adding a couple helper functions.  Suggestion by
Chandler Carruth and seconded by Meador Inge!

llvm-svn: 166515
2012-10-23 22:52:52 +00:00
Pete Cooper
eda7d99a58 Change DenseMap to use a power of 2 growth if one is given instead of the next power of 2. This was causing DenseMaps to grow 4x instead of 2x. I'll keep an eye on the buildbots as this could impact performance
llvm-svn: 166493
2012-10-23 19:34:36 +00:00
Pete Cooper
ccb3ee0d18 Fixed bug in SmallDenseMap where it wouldn't leave enough space for an empty bucket if the number of values was exactly equal to the small capacity. This led to an infinite loop when finding a non-existent element
llvm-svn: 166492
2012-10-23 18:47:35 +00:00
Chad Rosier
143dbdd411 [ms-inline asm] Add an implementation of the offset operator. This is a follow
on patch to r166433.
rdar://12470317

llvm-svn: 166488
2012-10-23 17:43:43 +00:00
Lang Hames
c5bf7a5f94 Use ilist rather than std::list for Node and Edge lists in the PBQP graph. This
should fix an issue (described at http://stackoverflow.com/questions/10065384/instantiation-of-a-list-with-an-incomplete-type-in-a-typedef)
that was preventing LLVMCodeGen from building with libc++ in C++11 mode.

llvm-svn: 166484
2012-10-23 17:10:51 +00:00
Eli Friedman
65c919ee7c [ms-inline-asm] Implement _emit directive (which is roughly equivalent to .byte).
<rdar://problem/12470345>.

llvm-svn: 166451
2012-10-22 23:58:19 +00:00
Kevin Enderby
0f6b703b72 Add support for annotated disassembly output for X86 and arm.
Per the October 12, 2012 Proposal for annotated disassembly output sent out by
Jim Grosbach this set of changes implements this for X86 and arm.  The llvm-mc
tool now has a -mdis option to produced the marked up disassembly and a couple
of small example test cases have been added.

rdar://11764962

llvm-svn: 166445
2012-10-22 22:31:46 +00:00
Chad Rosier
3e9878ca07 [ms-inline asm] Add the isOffsetOf() function.
Part of rdar://12470317

llvm-svn: 166436
2012-10-22 19:50:35 +00:00
Nadav Rotem
afca83738d Add the "ForceSizeOpt" attribute.
Patch by Quentin Colombet <qcolombet@apple.com>

Original description:
"""
The attached patch is the first step to have a better control on Oz related optimizations.
The Oz optimization level focuses on code size, thus I propose to add an attribute called ForceSizeOpt.
"""

llvm-svn: 166422
2012-10-22 17:33:31 +00:00
Benjamin Kramer
7808f22a33 Symbol hygiene: Make sure declarations and definitions match, make helper functions static.
llvm-svn: 166376
2012-10-20 12:53:26 +00:00
Shuxin Yang
d8a190a17c 1. Remove noreturn attribute from __builtin_debugtrap().
(The change at Clang side was committed in r166345)

2. Cosmetic change in order to conform to coding standards. 

llvm-svn: 166350
2012-10-19 23:00:20 +00:00
Eric Christopher
42faa398e7 Grammar-o.
llvm-svn: 166343
2012-10-19 22:10:54 +00:00
Nadav Rotem
13a468b929 revert r166264 because the LTO build is still failing
llvm-svn: 166340
2012-10-19 21:28:43 +00:00
Chad Rosier
b2e9c0e226 [ms-inline asm] Have the TargetParser callback to Sema to determine the size of
a memory operand.  Retain this information and then add the sizing directives
to the IR.  This allows the backend to do proper instruction selection.

llvm-svn: 166316
2012-10-19 20:57:14 +00:00
Michael Liao
432bf8dcf1 Add 'IntrNoReturn' for longjmp intrinsics
llvm-svn: 166314
2012-10-19 20:43:54 +00:00
Chad Rosier
9de7b4647d [ms-inline asm] Add a MCAsmParserSemaCallback to the TargetAsmParser.
llvm-svn: 166308
2012-10-19 20:35:42 +00:00
Shuxin Yang
3ad15929e7 This patch is to fix radar://8426430. It is about llvm support of __builtin_debugtrap()
which is supposed to consistently raise SIGTRAP across all systems. In contrast,
__builtin_trap() behave differently on different systems. e.g. it raises SIGTRAP on ARM, and
SIGILL on X86. The purpose of __builtin_debugtrap() is to consistently provide "trap"
functionality, in the mean time preserve the compatibility with on gcc on __builtin_trap().

  The X86 backend is already able to handle debugtrap(). This patch is to:
  1) make front-end recognize "__builtin_debugtrap()" (emboddied in the one-line change to Clang).
  2) In DAG legalization phase, by default, "debugtrap" will be replaced with "trap", which
     make the __builtin_debugtrap() "available" to all existing ports without the hassle of
     changing their code.
  3) If trap-function is specified (via -trap-func=xyz to llc), both __builtin_debugtrap() and
     __builtin_trap() will be expanded into the function call of the specified trap function.
    This behavior may need change in the future.

  The provided testing-case is to make sure 2) and 3) are working for ARM port, and we
already have a testing case for x86. 

llvm-svn: 166300
2012-10-19 20:11:16 +00:00
Chad Rosier
2f344f2453 [ms-inline asm] Add the isParsingInlineAsm() function to the MCAsmTargetParser.
llvm-svn: 166292
2012-10-19 17:57:49 +00:00
Evgeniy Stepanov
3628bf2d69 Move SplitBlockAndInsertIfThen to BasicBlockUtils.
llvm-svn: 166278
2012-10-19 10:48:31 +00:00
Nick Lewycky
c111dcf2c1 Pacify -Wnon-virtual-dtor.
llvm-svn: 166270
2012-10-19 07:00:09 +00:00
Nadav Rotem
ac33a84388 recommit the patch that makes LSR and LowerInvoke use the TargetTransform interface.
llvm-svn: 166264
2012-10-19 04:27:49 +00:00
Nadav Rotem
3cce3abf28 Reapply the TargerTransformInfo changes, minus the changes to LSR and Lowerinvoke.
llvm-svn: 166248
2012-10-18 23:22:48 +00:00
Jordan Rose
2d1d4bb52f Fix case for include of Compiler.h.
llvm-svn: 166243
2012-10-18 22:36:01 +00:00
Jordan Rose
254e676432 Add move constructors for OwningPtr and OwningArrayPtr.
While LLVM itself is still C++03, there's no reason why tools built on
top of it can't use C++11 features.

llvm-svn: 166242
2012-10-18 22:22:58 +00:00
Jordan Rose
8f3fa09912 Add a T&& constructor to llvm::Optional.
This allows llvm::Optional to be used with movable-but-not-copyable types.
While LLVM itself is still C++03, there's no reason why tools built on
top of it can't use C++11 features.

llvm-svn: 166241
2012-10-18 22:22:55 +00:00
Chad Rosier
2a7f9576bc [ms-inline asm] Add a size argument to the LookupInlineAsmIdentifier() callback,
which will be used by the asm matcher in the near future.

llvm-svn: 166222
2012-10-18 20:27:15 +00:00
Sebastian Pop
23cbb6a693 Change MachineFrameInfo::StackObject::Alloca from Value* to AllocaInst*
This more accurately reflects what is actually being stored in the
field.

No functionality change intended.

Author:    Matthew Curtis <mcurtis@codeaurora.org>
llvm-svn: 166215
2012-10-18 19:53:45 +00:00
Chad Rosier
5c17ae1754 [ms-inline asm] Have the LookupInlineAsmIdentifier() callback function return a
*NamedDecl.  In turn, build the expressions after we're finished parsing the
asm.  This avoids a crasher if the lookup fails.

llvm-svn: 166212
2012-10-18 19:39:30 +00:00
Chad Rosier
72377848a3 [ms-inline asm] Move most of the AsmParsing logic in clang back into the MC
layer.  Add the ParseMSInlineAsm() function, which is the new interface to 
clang.  Also expose the new MCAsmParserSemaCallback interface, which is used
by the back-end to do name lookup in Sema.  Finally, remove the now defunct
APIs introduced in r165946.

llvm-svn: 166183
2012-10-18 15:49:34 +00:00
Chandler Carruth
7bfc26a7b4 Introduce a BarrierNoop pass, a hack designed to allow *some* control
over the implicitly-formed-and-nesting CGSCC pass manager and function
pass managers, especially when using them on the opt commandline or
using extension points in the module builder. The '-barrier' opt flag
(or the pass itself) will create a no-op module pass in the pipeline,
resetting the pass manager stack, and allowing the creation of a new
pipeline of function passes or CGSCC passes to be created that is
independent from any previous pipelines.

For example, this can be used to test running two CGSCC passes in
independent CGSCC pass managers as opposed to in the same CGSCC pass
manager. It also allows us to introduce a further hack into the
PassManagerBuilder to separate the O0 pipeline extension passes from the
always-inliner's CGSCC pass manager, which they likely do not want to
participate in... At the very least none of the Sanitizer passes want
this behavior.

This fixes a bug with ASan at O0 currently, and I'll commit the ASan
test which covers this pass. I'm happy to add a test case that this pass
exists and works, but not sure how much time folks would like me to
spend adding test cases for the details of its behavior of partition
pass managers.... The whole thing is just vile, and mostly intended to
unblock ASan, so I'm hoping to rip this all out in a brave new pass
manager world.

llvm-svn: 166172
2012-10-18 08:05:46 +00:00
Bob Wilson
b6adb70bdd Temporarily revert the TargetTransform changes.
The TargetTransform changes are breaking LTO bootstraps of clang.  I am
working with Nadav to figure out the problem, but I am reverting it for now
to get our buildbots working.

This reverts svn commits: 165665 165669 165670 165786 165787 165997
and I have also reverted clang svn 165741

llvm-svn: 166168
2012-10-18 05:43:52 +00:00
Jakob Stoklund Olesen
1eec126712 Switch MRI::UsedPhysRegs to a register unit bit vector.
This is a more compact, less redundant representation, and it avoids
scanning long lists of aliases for ARM D-registers, for example.

llvm-svn: 166124
2012-10-17 20:26:33 +00:00
Evan Cheng
b5e95007fe Add a really faster pre-RA scheduler (-pre-RA-sched=linearize). It doesn't use
any scheduling heuristics nor does it build up any scheduling data structure
that other heuristics use. It essentially linearize by doing a DFA walk but
it does handle glues correctly.

IMPORTANT: it probably can't handle all the physical register dependencies so
it's not suitable for x86. It also doesn't deal with dbg_value nodes right now
so it's definitely is still WIP.

rdar://12474515

llvm-svn: 166122
2012-10-17 19:39:36 +00:00
Jakob Stoklund Olesen
19bfbc3745 Merge MRI::isPhysRegOrOverlapUsed() into isPhysRegUsed().
All callers of these functions really want the isPhysRegOrOverlapUsed()
functionality which also checks aliases. For historical reasons, targets
without register aliases were calling isPhysRegUsed() instead.

Change isPhysRegUsed() to also check aliases, and switch all
isPhysRegOrOverlapUsed() callers to isPhysRegUsed().

llvm-svn: 166117
2012-10-17 18:44:18 +00:00
Nadav Rotem
8303c909c7 Add a loop vectorizer.
llvm-svn: 166112
2012-10-17 18:25:06 +00:00
Andrew Trick
9422ce72bc misched: Better handling of invalid latencies in the machine model
llvm-svn: 166107
2012-10-17 17:27:10 +00:00
Craig Topper
7e08ec038e Remove LLVM_DELETED_FUNCTION from destructors that override non-deleted base class destructors. This isn't legal by the C++11 standard and clang now checks for it. Curiously gcc didn't catch this, possibly because of the template usage.
llvm-svn: 166089
2012-10-17 05:15:58 +00:00
Jakob Stoklund Olesen
bd6db6eeb9 Use a SparseSet instead of a BitVector for UsedInInstr in RAFast.
This is just as fast, and it makes it possible to avoid leaking the
UsedPhysRegs BitVector implementation through
MachineRegisterInfo::addPhysRegsUsed().

llvm-svn: 166083
2012-10-17 01:37:59 +00:00
Eric Christopher
7eb11f8437 Spacing.
llvm-svn: 166074
2012-10-16 23:46:19 +00:00
Chad Rosier
d87fb99e77 [ms-inline asm] Add the helper function, isParseringInlineAsm(). To be used in a future commit.
llvm-svn: 166054
2012-10-16 20:16:20 +00:00
Bill Wendling
235be85221 And now we can call the other 'get' method from this one and not duplicate the code.
llvm-svn: 166037
2012-10-16 18:20:09 +00:00
Bill Wendling
da7701b08b Use the appropriate Attributes::get method to create an Attributes object.
llvm-svn: 166035
2012-10-16 18:06:06 +00:00
Owen Anderson
38e04ae4a0 Speculative fix the mask constants to be of type uintptr_t. I don't know of any case where the old form was incorrect, but I'm more confident that such cases don't exist in this version.
llvm-svn: 166031
2012-10-16 17:10:33 +00:00
Dmitri Gribenko
bb0cd8940f Fix function parameter spelling in comments. Caught by -Wdocumentation.
llvm-svn: 166024
2012-10-16 15:37:50 +00:00
Stepan Dyatkovskiy
09c6b0a273 Issue:
Stack is formed improperly for long structures passed as byval arguments for
EABI mode.

If we took AAPCS reference, we can found the next statements:

A: "If the argument requires double-word alignment (8-byte), the NCRN (Next
Core Register Number) is rounded up to the next even register number." (5.5
Parameter Passing, Stage C, C.3).

B: "The alignment of an aggregate shall be the alignment of its most-aligned
component." (4.3 Composite Types, 4.3.1 Aggregates).

So if we have structure with doubles (9 double fields) and 3 Core unused
registers (r1, r2, r3): caller should use r2 and r3 registers only.
Currently r1,r2,r3 set is used, but it is invalid.

Callee VA routine should also use r2 and r3 regs only. All is ok here. This
behaviour is guessed by rounding up SP address with ADD+BFC operations.

Fix:
Main fix is in ARMTargetLowering::HandleByVal. If we detected AAPCS mode and
8 byte alignment, we waste odd registers then.

P.S.:
I also improved LDRB_POST_IMM regression test. Since ldrb instruction will
not generated by current regression test after this patch. 

llvm-svn: 166018
2012-10-16 07:16:47 +00:00
Bill Wendling
b8253baeba Cleanup whitespace.
llvm-svn: 166016
2012-10-16 06:10:45 +00:00
Owen Anderson
cb8d1f6815 Fix a bug in the set(I,E)/reset(I,E) methods that I recently added. The boundary condition for checking if I and E were in the same word were incorrect, and, beyond that, the mask computation was not using a wide enough constant.
llvm-svn: 166015
2012-10-16 06:04:27 +00:00
Bill Wendling
bd68badfdd Have AttrBuilder defriend the Attributes class.
llvm-svn: 166011
2012-10-16 05:55:09 +00:00
Bill Wendling
17275364ed Use the Attributes::get method which takes an AttrVal value directly to simplify the code a bit. No functionality change.
llvm-svn: 166009
2012-10-16 05:23:31 +00:00