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

16830 Commits

Author SHA1 Message Date
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
Bill Wendling
86964736b6 Put simple c'tors inline.
llvm-svn: 166008
2012-10-16 05:22:28 +00:00
Andrew Trick
af9fb59623 misched: Added handleMove support for updating all kill flags, not just for allocatable regs.
This is a medium term workaround until we have a more robust solution
in the form of a register liveness utility for postRA passes.

llvm-svn: 166001
2012-10-16 00:22:51 +00:00
Jakob Stoklund Olesen
c808be0c56 Remove RegisterClassInfo::isReserved() and isAllocatable().
Clients can use the equivalent functions in MRI.

llvm-svn: 165990
2012-10-15 22:41:03 +00:00
Jakob Stoklund Olesen
bde4d183c1 Remove LIS::isAllocatable() and isReserved() helpers.
All callers can simply use the corresponding MRI functions.

llvm-svn: 165985
2012-10-15 22:14:34 +00:00
Owen Anderson
e678a60cc8 Add range-based set()/reset() to BitVector. These allow fast setting/resetting of ranges of bits, particularly useful when dealing with very large BitVector's.
llvm-svn: 165984
2012-10-15 22:05:27 +00:00
Jakob Stoklund Olesen
56bb584754 Switch most getReservedRegs() clients to the MRI equivalent.
Using the cached bit vector in MRI avoids comstantly allocating and
recomputing the reserved register bit vector.

llvm-svn: 165983
2012-10-15 21:57:41 +00:00
Jakob Stoklund Olesen
677503ea4e Freeze the reserved registers as soon as isel is complete.
Also provide an MRI::getReservedRegs() function to access the frozen
register set, and isReserved() and isAllocatable() methods to test
individual registers.

The various implementations of TRI::getReservedRegs() are quite
complicated, and many passes need to look at the reserved register set.
This patch makes it possible for these passes to use the cached copy in
MRI, avoiding a lot of malloc traffic and repeated calculations.

llvm-svn: 165982
2012-10-15 21:33:06 +00:00
Bill Wendling
7a89835ee4 Move the Attributes::Builder outside of the Attributes class and into its own class named AttrBuilder. No functionality change.
llvm-svn: 165960
2012-10-15 20:35:56 +00:00
Bill Wendling
ab9bf1a83b Add comments.
llvm-svn: 165958
2012-10-15 19:58:25 +00:00
Andrew Trick
a5e2aeb12b misched: ILP scheduler for experimental heuristics.
llvm-svn: 165950
2012-10-15 18:02:27 +00:00
Chad Rosier
77614bbd0e [ms-inline asm] Add a few new APIs to the AsmParser class in support of MS-Style
inline assembly.  For the time being, these will be called directly by clang.
However, in the near future I expect these to be sunk back into the MC layer
and more basic APIs (e.g., getClobbers(), getConstraints(), etc.) will be called
by clang.

llvm-svn: 165946
2012-10-15 17:19:13 +00:00
Micah Villmow
272663afc2 Resubmit the changes to llvm core to update the functions to support different pointer sizes on a per address space basis.
llvm-svn: 165941
2012-10-15 16:24:29 +00:00
Adhemerval Zanella
ad392b0f93 PowerPC: add EmitTCEntry class for TOC creation
This patch replaces the EmitRawText by a EmitTCEntry class (specialized for
each Streamer) in PowerPC64 TOC entry creation.

llvm-svn: 165940
2012-10-15 15:43:14 +00:00
Kostya Serebryany
a6cd7ad8f2 [asan] make AddressSanitizer to be a FunctionPass instead of ModulePass. This will simplify chaining other FunctionPasses with asan. Also some minor cleanup
llvm-svn: 165936
2012-10-15 14:20:06 +00:00
Bill Wendling
f2fff93263 Add an enum for the return and function indexes into the AttrListPtr object. This gets rid of some magic numbers.
llvm-svn: 165924
2012-10-15 07:29:08 +00:00
Bill Wendling
5fb56f15bd Use a ::get method to create the attribute from Attributes::AttrVals instead of a constructor.
llvm-svn: 165923
2012-10-15 06:53:28 +00:00
Bill Wendling
71e3fa6c01 Supply a default 'operator=' method.
llvm-svn: 165922
2012-10-15 06:34:18 +00:00
Bill Wendling
213dd167bc Move the AttributesImpl header file into the VMCore directory so that it can be opaque.
llvm-svn: 165920
2012-10-15 05:40:12 +00:00
Bill Wendling
a77399599d Attributes Rewrite
Convert the internal representation of the Attributes class into a pointer to an
opaque object that's uniqued by and stored in the LLVMContext object. The
Attributes class then becomes a thin wrapper around this opaque
object. Eventually, the internal representation will be expanded to include
attributes that represent code generation options, etc.

llvm-svn: 165917
2012-10-15 04:46:55 +00:00
Benjamin Kramer
25522ac16c Fix a typo that made ImmutableMap::getMaxElement() useless.
Add a basic unit test for ImmutableMap. Found by inspection.

llvm-svn: 165907
2012-10-14 15:56:39 +00:00
Bill Wendling
3ce41738d8 Remove dead methods.
llvm-svn: 165902
2012-10-14 09:21:44 +00:00
Bill Wendling
ea777202df Remove operator cast method in favor of querying with the correct method.
llvm-svn: 165899
2012-10-14 08:54:26 +00:00
Bill Wendling
7005388897 Remove the bitwise AND operators from the Attributes class. Replace it with the equivalent from the builder class.
llvm-svn: 165896
2012-10-14 07:52:48 +00:00
Bill Wendling
03d1b8ef4c Remove the bitwise assignment OR operator from the Attributes class. Replace it with the equivalent from the builder class.
llvm-svn: 165895
2012-10-14 07:35:59 +00:00
Bill Wendling
c04d329902 Remove the bitwise OR operator from the Attributes class. Replace it with the equivalent from the builder class.
llvm-svn: 165894
2012-10-14 07:17:34 +00:00
Bill Wendling
ea1286d8bf Remove the bitwise XOR operator from the Attributes class. Replace it with the equivalent from the builder class.
llvm-svn: 165893
2012-10-14 06:56:13 +00:00
Bill Wendling
1dc6f7739b Remove the bitwise NOT operator from the Attributes class. Replace it with the equivalent from the builder class.
llvm-svn: 165892
2012-10-14 06:39:53 +00:00
Bill Wendling
2a54428ca9 Decode the LLVM attributes from bitcode using the attributes builder.
llvm-svn: 165891
2012-10-14 04:10:01 +00:00
Bill Wendling
5eda1106ff Use builder to create alignment attributes. Remove dead function.
llvm-svn: 165890
2012-10-14 03:58:29 +00:00
Bill Wendling
0bbe1f34e1 Remove dead method.
llvm-svn: 165889
2012-10-14 03:28:43 +00:00
Meador Inge
0d4d368820 Implement new LibCallSimplifier class
This patch implements the new LibCallSimplifier class as outlined in [1].
In addition to providing the new base library simplification infrastructure,
all the fortified library call simplifications were moved over to the new
infrastructure.  The rest of the library simplification optimizations will
be moved over with follow up patches.

NOTE: The original fortified library call simplifier located in the
SimplifyFortifiedLibCalls class was not removed because it is still
used by CodeGenPrepare.  This class will eventually go away too.

[1] http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-August/052283.html

llvm-svn: 165873
2012-10-13 16:45:24 +00:00
Chad Rosier
2627b4fea7 [ms-inline asm] Remove the MatchInstruction() function. Previously, this was
the interface between the front-end and the MC layer when parsing inline
assembly.  Unfortunately, this is too deep into the parsing stack. Specifically,
we're unable to handle target-independent assembly (i.e., assembly directives,
labels, etc.).  Note the MatchAndEmitInstruction() isn't the correct
abstraction either.  I'll be exposing target-independent hooks shortly, so this
is really just a cleanup.

llvm-svn: 165858
2012-10-13 00:26:04 +00:00
Chad Rosier
89e118ccda [ms-inline asm] Capitalize per coding standard.
llvm-svn: 165847
2012-10-12 23:09:25 +00:00
Chad Rosier
c8a0d67b5d [ms-inline asm] Use the new API introduced in r165830 in lieu of the
MapAndConstraints vector.  Also remove the unused Kind argument.

llvm-svn: 165833
2012-10-12 22:53:36 +00:00
Chad Rosier
00eb544d1c [ms-inline asm] Add a few data members and member functions to the
MCParsedAsmOperand class in support of ms-style inline assembly.

llvm-svn: 165830
2012-10-12 22:15:11 +00:00
Andrew Kaylor
090420fd2a Correcting enum values mentioned in comments.
Patch by Ashok Thirumurthi.

llvm-svn: 165827
2012-10-12 21:47:49 +00:00
Duncan Sands
fe6c41af6b Add powerpc-ibm-aix to Triple. Patch by Kai.
llvm-svn: 165792
2012-10-12 11:08:57 +00:00
Nick Lewycky
f5276c5683 Shuffle the virtual destructor down to the base. This should actually pacify
-Wnon-virtual-dtor for real.

llvm-svn: 165787
2012-10-12 04:28:25 +00:00
Nick Lewycky
8e62457a23 Give this class full of virtual functions a virtual destructor. Classes love
virtual destructors.

llvm-svn: 165786
2012-10-12 04:13:25 +00:00
Sean Silva
2174f713f4 Remove unnecessary classof()'s
isa<> et al. automatically infer when the cast is an upcast (including a
self-cast), so these are no longer necessary.

llvm-svn: 165767
2012-10-11 23:30:49 +00:00
Sean Silva
356281d8ad Casting.h: Automatically handle isa<Base>(Derived).
Additionally, all such cases are handled with no dynamic check.

All `classof()` of the form

    class Foo {
      [...]
      static bool classof(const Bar *) { return true; }
      [...]
    }

where Foo is an ancestor of Bar are no longer necessary.
Don't write them!

Note: The exact test is `is_base_of<Foo, Bar>`, which is non-strict, so
that Foo is considered an ancestor of itself.

This leads to the following rule of thumb for LLVM-style RTTI:

    The argument type of `classof()` should be a strict ancestor.

For more information about implementing LLVM-style RTTI, see
docs/HowToSetUpLLVMStyleRTTI.rst

llvm-svn: 165765
2012-10-11 23:30:40 +00:00
Chad Rosier
4d2473edae Remove extra semicolon.
llvm-svn: 165758
2012-10-11 22:26:44 +00:00
Micah Villmow
4eb108750d Revert 165732 for further review.
llvm-svn: 165747
2012-10-11 21:27:41 +00:00
Jan Wen Voung
fc87609127 Change encoding of instruction operands in bitcode binaries to be relative
to the instruction position.  The old encoding would give an absolute
ID which counts up within a function, and only resets at the next function.

I.e., Instead of having:

... = icmp eq i32 n-1, n-2
br i1 ..., label %bb1, label %bb2

it will now be roughly:

... = icmp eq i32 1, 2
br i1 1, label %bb1, label %bb2

This makes it so that ids remain relatively small and can be encoded
in fewer bits.

With this encoding, forward reference operands will be given
negative-valued IDs.  Use signed VBRs for the most common case
of forward references, which is phi instructions.

To retain backward compatibility we bump the bitcode version
from 0 to 1 to distinguish between the different encodings.

llvm-svn: 165739
2012-10-11 20:20:40 +00:00
Micah Villmow
d8b76fdc50 Add in the first iteration of support for llvm/clang/lldb to allow variable per address space pointer sizes to be optimized correctly.
llvm-svn: 165726
2012-10-11 17:21:41 +00:00
NAKAMURA Takumi
40d5b6690e llvm/Analysis/Passes.h: Fix copypasto in createDependenceAnalysisPass().
llvm-svn: 165709
2012-10-11 08:26:52 +00:00
Sebastian Pop
952bb51433 dependence analysis
Patch from Preston Briggs <preston.briggs@gmail.com>.

This is an updated version of the dependence-analysis patch, including an MIV
test based on Banerjee's inequalities.

It's a fairly complete implementation of the paper

    Practical Dependence Testing
    Gina Goff, Ken Kennedy, and Chau-Wen Tseng
    PLDI 1991

It cannot yet propagate constraints between coupled RDIV subscripts (discussed
in Section 5.3.2 of the paper).

It's organized as a FunctionPass with a single entry point that supports testing
for dependence between two instructions in a function. If there's no dependence,
it returns null. If there's a dependence, it returns a pointer to a Dependence
which can be queried about details (what kind of dependence, is it loop
independent, direction and distance vector entries, etc). I haven't included
every imaginable feature, but there's a good selection that should be adequate
for supporting many loop transformations. Of course, it can be extended as
necessary.

Included in the patch file are many test cases, commented with C code showing
the loops and array references.

llvm-svn: 165708
2012-10-11 07:32:34 +00:00
Bill Wendling
d56ce45fd5 Add the LLVM context to this c'tor. It will be needed in the future.
llvm-svn: 165687
2012-10-11 01:10:00 +00:00
Bill Wendling
205a5f682c Support a common idiom on how to build an Attributes class with a single attribute.
llvm-svn: 165686
2012-10-11 01:05:52 +00:00
Evan Cheng
b84fe4f16a Change MachineInstrBuilder::addDisp to copy over target flags by default.
llvm-svn: 165677
2012-10-11 00:15:48 +00:00
Eric Christopher
bcad0ec829 Formatting and 80-col.
llvm-svn: 165668
2012-10-10 22:37:01 +00:00
Nadav Rotem
b82a3821f7 Add a new interface to allow IR-level passes to access codegen-specific information.
llvm-svn: 165665
2012-10-10 22:04:55 +00:00
Sean Silva
3c3997388f tblgen: Put dyn_cast<> machinery in place for Init hierarchy.
llvm-svn: 165645
2012-10-10 20:24:40 +00:00
Bill Wendling
70fcb183a9 Remove unused argument.
llvm-svn: 165636
2012-10-10 18:02:57 +00:00
Stepan Dyatkovskiy
5182bb8695 Issue description:
SchedulerDAGInstrs::buildSchedGraph ignores dependencies between FixedStack
objects and byval parameters. So loading byval parameters from stack may be
inserted *before* it will be stored, since these operations are treated as
independent.

Fix:
Currently ARMTargetLowering::LowerFormalArguments saves byval registers with
FixedStack MachinePointerInfo. To fix the problem we need to store byval
registers with MachinePointerInfo referenced to first the "byval" parameter.

Also commit adds two new fields to the InputArg structure: Function's argument
index and InputArg's part offset in bytes relative to the start position of
Function's argument. E.g.: If function's argument is 128 bit width and it was
splitted onto 32 bit regs, then we got 4 InputArg structs with same arg index,
but different offset values. 

llvm-svn: 165616
2012-10-10 11:37:36 +00:00
Bill Wendling
196ccddf1b Cleanup. Get rid of now dead code.
llvm-svn: 165613
2012-10-10 08:03:34 +00:00
Bill Wendling
f3c4f64b79 Remove the final bits of Attributes being declared in the Attribute
namespace. Use the attribute's enum value instead. No functionality change
intended.

llvm-svn: 165610
2012-10-10 07:36:45 +00:00
Bill Wendling
a55d5af923 Pass into the AttributeWithIndex::get method an ArrayRef of attribute
enums. These are then created via the correct Attributes creation method.

llvm-svn: 165607
2012-10-10 06:13:42 +00:00
Andrew Trick
79d929fd43 TODO comment
llvm-svn: 165605
2012-10-10 05:43:16 +00:00
Andrew Trick
4ca94d939c misched: Use the TargetSchedModel interface wherever possible.
Allows the new machine model to be used for NumMicroOps and OutputLatency.

Allows the HazardRecognizer to be disabled along with itineraries.

llvm-svn: 165603
2012-10-10 05:43:09 +00:00
Andrew Trick
13b4f59560 misched: Generate IsBuffered flag for machine resources.
llvm-svn: 165602
2012-10-10 05:43:04 +00:00
Bill Wendling
5f457b4ddd Have 'addFnAttr' take the attribute enum value. Then have it build the attribute object and add it appropriately. No functionality change.
llvm-svn: 165595
2012-10-10 03:12:49 +00:00
Andrew Kaylor
b850da774b This patch adds new functions to the SectionRef and ObjectFile interfaces to determine whether or not a section is meant to be read-only. These functions will be used by the MCJIT RuntimeDyld to give hints to the memory manager during the object loading process in a future patch.
Patch by Ashok Thirumurthi.

llvm-svn: 165586
2012-10-10 01:41:33 +00:00
Andrew Trick
6ef4c5cf64 misched: Add computeInstrLatency to TargetSchedModel.
llvm-svn: 165566
2012-10-09 23:44:32 +00:00
Andrew Trick
31edb399c2 misched: Doxument the TargetSchedule API.
llvm-svn: 165565
2012-10-09 23:44:29 +00:00
Andrew Trick
0a8af76cb4 misched: Allow flags to disable hasInstrSchedModel/hasInstrItineraries for external users of TargetSchedule.
llvm-svn: 165564
2012-10-09 23:44:26 +00:00
Andrew Trick
54d088900c misched: Remove LoopDependencies heuristic.
This wasn't contributing anything significant to postRA heuristics except compile time (by my measurements) and will be replaced by a more general heuristic for cross-region dependencies within the scheduler itself.

llvm-svn: 165563
2012-10-09 23:44:23 +00:00
Bill Wendling
df45e1b495 Use the attribute builder to add attributes to call/invoke instruction. No functionality change intended.
llvm-svn: 165562
2012-10-09 23:40:31 +00:00
Douglas Gregor
ecabb8b6ff Add count() method to MapVector
llvm-svn: 165559
2012-10-09 23:02:47 +00:00
Micah Villmow
65c57bffdb Add in some interfaces that will allow easier access to the pointer address space.
llvm-svn: 165554
2012-10-09 22:27:29 +00:00
Bill Wendling
12999bb1df Use the attribute enums to query if a function has an attribute.
llvm-svn: 165551
2012-10-09 21:49:51 +00:00
Bill Wendling
04e6cf2045 Use the attribute enums to query if a parameter has an attribute.
llvm-svn: 165550
2012-10-09 21:38:14 +00:00
Bill Wendling
9abaefde08 Remove this now unused variable macro.
llvm-svn: 165543
2012-10-09 20:35:11 +00:00
Bill Wendling
fee7179aa9 Use appropriate method calls to get the alignment value.
llvm-svn: 165541
2012-10-09 20:28:54 +00:00
Bill Wendling
31ae26f466 Inline the checks for mutually exclusive attributes since they're used in only one module.
llvm-svn: 165539
2012-10-09 20:11:19 +00:00
Rafael Espindola
8e5adfa32c Enable response files in all tools. Patch by Liu, Yaxun (Sam). I have simplified
the test.

llvm-svn: 165535
2012-10-09 19:52:10 +00:00
Bill Wendling
ce3fe97e0d Move the 'FunctionOnly' attributes thingy inside of the Attributes class.
llvm-svn: 165530
2012-10-09 19:01:18 +00:00
Douglas Gregor
97b9fac1c3 Not everyone uses C++11, apparently
llvm-svn: 165517
2012-10-09 17:51:56 +00:00
Douglas Gregor
703f076085 Allow MapVector clients to specify the map and vector types, and add a
clear() method.

llvm-svn: 165514
2012-10-09 17:49:42 +00:00
Michael Ilseman
e025196817 More descriptive, doxygen-ed comments
llvm-svn: 165512
2012-10-09 17:05:59 +00:00
Michael Ilseman
e2a233d237 New value_op_iterator for User. This allows other code to iterate over the User's operands directly as values, which can be convenient.
llvm-svn: 165508
2012-10-09 16:55:14 +00:00
Micah Villmow
54aac8803f Add in the first step of the multiple pointer support. This adds in support to the data layout for specifying a per address space pointer size.
The next step is to update the optimizers to allow them to optimize the different address spaces with this information.

llvm-svn: 165505
2012-10-09 16:06:12 +00:00
Bill Wendling
42dfeb2f05 Move the 'ParameterOnly' variable inside of the Attributes class and make it a method.
llvm-svn: 165497
2012-10-09 09:51:10 +00:00
Bill Wendling
793576783f Remove the now dead VarArgsIncompatible variable.
llvm-svn: 165496
2012-10-09 09:33:01 +00:00
Bill Wendling
35d132644f Use the enum value of the attributes when removing them from the attributes builder.
llvm-svn: 165495
2012-10-09 09:17:28 +00:00
Bill Wendling
7d6ddcc8e3 Use the enum value of the attributes when adding them to the attributes builder.
llvm-svn: 165494
2012-10-09 09:11:20 +00:00
Alexey Samsonov
561aa02d50 Fix PR14016.
DeadArgumentElimination pass can replace one LLVM function with another,
invalidating a pointer stored in debug info metadata entry for this function.
To fix this, we collect debug info descriptors for functions before
running a DeadArgumentElimination pass and "patch" pointers in metadata nodes
if we replace a function.

llvm-svn: 165490
2012-10-09 08:13:15 +00:00
Bill Wendling
b53357de39 Create enums for the different attributes.
We use the enums to query whether an Attributes object has that attribute. The
opaque layer is responsible for knowing where that specific attribute is stored.

llvm-svn: 165488
2012-10-09 07:45:08 +00:00
Bill Wendling
8fd2232878 Remove some dead methods.
llvm-svn: 165485
2012-10-09 05:54:39 +00:00
Bill Wendling
9d44569e18 Remove ifdef'd code.
llvm-svn: 165484
2012-10-09 05:36:15 +00:00
Nadav Rotem
a8c4b4b426 whitespace
llvm-svn: 165475
2012-10-09 01:56:07 +00:00
Sean Silva
00f72940dd Move misplaced comment.
llvm-svn: 165474
2012-10-09 01:47:16 +00:00
Bill Wendling
08940a9caf Remove a couple more 'hasAttrSomewhere' calls.
llvm-svn: 165470
2012-10-09 01:03:48 +00:00
Bill Wendling
4fa0f48d90 Remove more uses of the attribute enums by supplying appropriate query methods for them.
No functionality change intended.

llvm-svn: 165466
2012-10-09 00:28:54 +00:00
Bill Wendling
c00f4a514d Convert to using the Attributes::Builder interface.
llvm-svn: 165465
2012-10-09 00:01:21 +00:00
Bill Wendling
049a2c0fba Update comment.
llvm-svn: 165461
2012-10-08 23:51:19 +00:00
Bill Wendling
a95eee725b Use the Attributes::Builder to build the attributes in the parser.
llvm-svn: 165458
2012-10-08 23:27:46 +00:00
Nadav Rotem
e05c974426 Use DataTypes.h
llvm-svn: 165457
2012-10-08 23:14:28 +00:00
Nadav Rotem
c94270cb4d Refactor the AddrMode class out of TLI to its own header file.
This class is used by LSR and a number of places in the codegen.
This is the first step in de-coupling LSR from TLI, and creating
a new interface in between them.

llvm-svn: 165455
2012-10-08 23:06:34 +00:00
Bill Wendling
12b21caa9a Convert the LLVM parser over to using the new Attributes::Builder to build its
attributes objects.

llvm-svn: 165436
2012-10-08 22:20:14 +00:00
Nick Lewycky
7708f19f82 Give CaptureTracker::shouldExplore a base implementation. Most users want to do
the same thing. No functionality change.

llvm-svn: 165435
2012-10-08 22:12:48 +00:00
Bill Wendling
8f296ad68b Begin the transition to using the AttributesImpl object for the Attributes ivar.
Start using the AttributesImpl object to hold the value of the attributes. All
queries go through the interfaces now.

This has one unfortunate consequence. I needed to move the AttributesImpl.h file
into include/llvm. But this is only temporary! Otherwise, the changes needed to
support this would be too large.

llvm-svn: 165433
2012-10-08 21:47:17 +00:00
Eric Christopher
ab7c040025 Update comment.
llvm-svn: 165431
2012-10-08 21:41:18 +00:00
Andrew Trick
957ebf0670 misched: remove the unused getSpecialAddressLatency hook.
llvm-svn: 165418
2012-10-08 18:54:00 +00:00
Andrew Trick
e4aeb46966 misched: remove forceUnitLatencies. Defaults are handled by the default SchedModel
llvm-svn: 165417
2012-10-08 18:53:57 +00:00
Micah Villmow
bb1a25cd67 Move TargetData to DataLayout.
llvm-svn: 165402
2012-10-08 16:38:25 +00:00
Craig Topper
c95931d8e9 Remove unused MachineInstr constructors that don't take a DebugLoc argument.
llvm-svn: 165382
2012-10-07 23:03:22 +00:00
Bill Wendling
1b73a3d774 Move more methods out-of-line. This is in preparation for changing the internal
contents of the Attributes class over to an AttributesImpl.

llvm-svn: 165373
2012-10-07 08:55:05 +00:00
Chad Rosier
dfe52bb6c3 [ms-inline asm] Add a comment describing the MapAndConstraints.
llvm-svn: 165326
2012-10-05 19:00:51 +00:00
Chad Rosier
179f50da7a [ms-inline asm] Add a few typedefs to simplify future changes.
llvm-svn: 165324
2012-10-05 18:41:14 +00:00
Chad Rosier
71c792faf5 Remove extraneous semicolon.
llvm-svn: 165319
2012-10-05 17:15:19 +00:00
Micah Villmow
6c3051ff09 Implement TargetData with the DataLayout class, this will allow LLVM projects to transition to DataLayout without loosing functionality.
llvm-svn: 165318
2012-10-05 17:02:14 +00:00
Hemant Kulkarni
a4682fd467 Add ELF program header.
llvm-svn: 165316
2012-10-05 15:16:53 +00:00
Adhemerval Zanella
6636dee46e Add PowerPC64 definitions for ELF.h
llvm-svn: 165314
2012-10-05 14:32:46 +00:00
Bill Wendling
2101754de0 Move methods out-of-line.
The internal representation of the Attributes class will be opaque. All of the
query methods will need to query the opaque class. Therefore, these methods need
to be out-of-line.
No functionality change intended.

llvm-svn: 165305
2012-10-05 06:44:41 +00:00
Sean Silva
37c527811e tblgen: Use appropriate LLVM-style RTTI functions.
Use isa<> or cast<> when semantically that is what is happening. Also
some trivial "style" cleanups at fix sites.

llvm-svn: 165292
2012-10-05 03:32:00 +00:00
Sean Silva
f8b271827e tblgen: Replace uses of dynamic_cast<XXXRecTy> with dyn_cast<>.
This is a mechanical change of dynamic_cast<> to dyn_cast<>. A number of
these uses are actually more like isa<> or cast<>, and will be changed
to the semanticaly appropriate one in a future patch.

llvm-svn: 165291
2012-10-05 03:31:58 +00:00
Sean Silva
91f8ba7b59 tblgen: Put dyn_cast<> infrastructure in place for RecTy hierarchy.
llvm-svn: 165290
2012-10-05 03:31:56 +00:00
Eli Friedman
cf7d009911 Make sure to generate the right kind of MDNode for enum forward declarations.
PR14029, LLVM part.

llvm-svn: 165288
2012-10-05 01:49:14 +00:00
Micah Villmow
3570de6384 Rename the Target specific passes in the DataLayout class to be Target agnostic.
llvm-svn: 165270
2012-10-04 23:01:22 +00:00
Micah Villmow
1afd9d1e32 Resubmit the copying of TargetData to DataLayout without any changes to the files, this should fix the problems and the changes to rename to DataLayout will come next.
llvm-svn: 165262
2012-10-04 22:08:14 +00:00
Preston Gurd
0256511b5d This patch corrects commit 165126 by using an integer bit width instead of
a pointer to a type, in order to remove the uses of getGlobalContext().

Patch by Tyler Nowicki.

llvm-svn: 165255
2012-10-04 21:33:40 +00:00
Micah Villmow
f89fff64e1 Backing out my changes, something screwed up from my patches, starting over.
llvm-svn: 165253
2012-10-04 21:08:50 +00:00
Micah Villmow
46585fd8f6 Create the DataLayout class, as a direct copy of TargetData.
llvm-svn: 165249
2012-10-04 20:44:22 +00:00
Micah Villmow
7416d8cd69 Accidently checked in the files, only wanted to copy them.
llvm-svn: 165244
2012-10-04 20:08:28 +00:00
Micah Villmow
20f5058e9d (no commit message)
llvm-svn: 165242
2012-10-04 20:05:12 +00:00
Jakub Staszak
9580482ec0 Fix doxygen comment to match parameters' names.
llvm-svn: 165239
2012-10-04 19:10:44 +00:00
Jakob Stoklund Olesen
6555de9442 Switch MachineTraceMetrics to the new TargetSchedModel interface.
llvm-svn: 165235
2012-10-04 17:30:40 +00:00
Benjamin Kramer
7fab511b16 Hoist some grossly duplicated code from the COFF/ELF/MachO streamers into MCObjectStreamer.
llvm-svn: 165225
2012-10-04 13:12:43 +00:00
Duncan Sands
722d22dbb6 Fix wrong name in comment.
llvm-svn: 165224
2012-10-04 13:07:26 +00:00
Bill Wendling
06dd3904ad Add method to query for NoCapture attribute.
llvm-svn: 165212
2012-10-04 07:18:12 +00:00
Bill Wendling
f8bfab0dde Use attribute query methods.
llvm-svn: 165210
2012-10-04 07:08:30 +00:00
Bill Wendling
f6649b4e9a Add method to query for 'NoAlias' attribute on call/invoke instructions.
llvm-svn: 165208
2012-10-04 06:52:09 +00:00
Andrew Trick
d6d5b63b3b Added instregex support to TableGen subtarget emitter.
This allows the processor-specific machine model to override selected
base opcodes without any fanciness.
e.g. InstRW<[CoreXWriteVANDP], (instregex "VANDP")>.

llvm-svn: 165180
2012-10-03 23:06:32 +00:00
Sean Silva
b3025c6bf1 tblgen: Remove last traces of old TableGenMain API.
llvm-svn: 165168
2012-10-03 21:31:08 +00:00
Sean Silva
60e882ca52 tblgen: Put new TableGenMain API in place.
In order to avoid rev-lock with Clang when moving to the new API, also
preserve the current API temporarily and insert a shim to implement the
new API in terms of the old.

llvm-svn: 165165
2012-10-03 21:29:18 +00:00
Bill Wendling
1c72ca83da Add function to return return attributes.
llvm-svn: 165164
2012-10-03 21:19:35 +00:00
Bill Wendling
3b8e120816 No need to call functions which do the same thing as the default.
llvm-svn: 165135
2012-10-03 18:10:49 +00:00
Bill Wendling
8755cdde9e Remove assert that's too restrictive.
llvm-svn: 165134
2012-10-03 18:08:57 +00:00
Bill Wendling
2553bfdd2b Add methods which query for the specific attribute instead of using the
enums. This allows for better encapsulation of the Attributes class.

llvm-svn: 165132
2012-10-03 17:54:26 +00:00
Eric Christopher
fcbfbbf732 Revert 165051-165049 while looking into the foreach.m failure in
more detail.

llvm-svn: 165099
2012-10-03 08:10:01 +00:00
Craig Topper
15c4f34e4a Remove unused function that used to get itineraries from SubTargetFeatures. This is done from MCSubTargetInfo these days.
llvm-svn: 165092
2012-10-03 06:26:11 +00:00
Chandler Carruth
e189a098e8 Third try at fixing this. ;] Go back to using std::remove_if, which has
most of the behavior we want, but wrap the predicate in one which erases
elements from the set if they pass the predicate. Oh what I wouldn't
give for a lambda here.

Let me know if the predicate wrapping is too much magic. ;]

llvm-svn: 165076
2012-10-03 01:04:07 +00:00
Chandler Carruth
f28a5b80a4 Switch the SetVector::remove_if implementation to use partition which
preserves the values of the relocated entries, unlikely remove_if. This
allows walking them and erasing them.

Also flesh out the predicate we are using for this to support the
various constraints actually imposed on a UnaryPredicate -- without this
we can't compose it with std::not1.

Thanks to Sean Silva for the review here and noticing the issue with
std::remove_if.

llvm-svn: 165073
2012-10-03 00:03:00 +00:00
Chad Rosier
6bc8eb2a5f Revert 165057, per Jim's request. This requires further discussion.
llvm-svn: 165069
2012-10-02 23:38:50 +00:00
Chandler Carruth
72359007f5 Teach the new SROA to handle cases where an alloca that has already been
scheduled for processing on the worklist eventually gets deleted while
we are processing another alloca, fixing the original test case in
PR13990.

To facilitate this, add a remove_if helper to the SetVector abstraction.
It's not easy to use the standard abstractions for this because of the
specifics of SetVectors types and implementation.

Finally, a nice small test case is included. Thanks to Benjamin for the
fantastic reduced test case here! All I had to do was delete some empty
basic blocks!

llvm-svn: 165065
2012-10-02 22:46:45 +00:00
Chandler Carruth
04822c8467 Clean up these doxygen comments to follow the proposed new style. This
also makes it more consistent with Clang and several passes' doxygen
style.

llvm-svn: 165064
2012-10-02 22:46:40 +00:00
Chad Rosier
7d3ce8d6a6 [ms-inline asm] Add basic support for wildcard MCParsedAsmOperands. This type
of operand is specific to MS-style inline assembly and should not be generated
when parsing normal assembly.

The purpose of the wildcard operands are to allow the AsmParser to match
multiple instructions (i.e., MCInsts) to a given ms-style asm statement.  For
the time being the matcher just returns the first match.  This patch only
implements wildcard matches for memory operands.  Support for register
wildcards will be added in the near future.

llvm-svn: 165057
2012-10-02 21:49:07 +00:00
Andrew Kaylor
1cb3a832d4 Clean-up of memory buffer and object ownership model in MCJIT
llvm-svn: 165053
2012-10-02 21:18:39 +00:00
Eric Christopher
e8c7bf06b6 Remove the SavePoint infrastructure from fast isel, replace
with just an insert point from the MachineBasicBlock and let
the location be updated as we access it.

llvm-svn: 165049
2012-10-02 21:16:50 +00:00
Andrew Kaylor
0d06582cd5 Support for generating ELF objects on Windows.
This adds 'elf' as a recognized target triple environment value and overrides the default generated object format on Windows platforms if that value is present.  This patch also enables MCJIT tests on Windows using the new environment value.

llvm-svn: 165030
2012-10-02 18:38:34 +00:00
Chad Rosier
5e80eb4c86 [ms-inline asm] Add the convertToMapAndConstraints() function that is used to
map constraints and MCInst operands to inline asm operands.  This replaces the
getMCInstOperandNum() function.

The logic to determine the constraints are not in place, so we still default to
a register constraint (i.e., "r"). Also, we no longer build the MCInst but
rather return just the opcode to get the MCInstrDesc.

llvm-svn: 164979
2012-10-01 23:45:51 +00:00
Jim Grosbach
037348ce80 MachO: direct-to-object attribute for data-in-code markers.
The target backend can support data-in-code load commands even when
the assembler doesn't, or vice-versa. Allow targets to opt-in for
direct-to-object.

PR13973.

llvm-svn: 164974
2012-10-01 22:20:54 +00:00
Chad Rosier
b475e38fc8 [ms-inline asm] Expose the getReg() function in the base class.
llvm-svn: 164969
2012-10-01 20:53:03 +00:00
Micah Villmow
c2b360eb5b Add in support for SPIR to LLVM core. This adds a new target and two new calling conventions.
llvm-svn: 164948
2012-10-01 17:01:31 +00:00
Michael Liao
f2905fc76e Fix PR13899
- Update maximal stack alignment when stack arguments are prepared before a
  call.
- Test cases are enhanced to show it's not a Win32 specific issue but a generic
  one.

llvm-svn: 164946
2012-10-01 16:44:04 +00:00
Benjamin Kramer
56415ad3cd Provide a shortcut for MCObjectStreamer when emitting fills.
Reduces runtime of i386-large-relocations.s by 10x in Release builds, even more
in Debug+Asserts builds.

llvm-svn: 164945
2012-10-01 15:14:14 +00:00
Benjamin Kramer
41d567a2a7 TargetData: s/uint32_t/unsigned/ per Kuba's request.
llvm-svn: 164935
2012-10-01 11:56:16 +00:00
Bob Wilson
ee6a40c517 Add LLVM support for Swift.
llvm-svn: 164899
2012-09-29 21:43:49 +00:00
Benjamin Kramer
4a627eee1d Shrink TargetAlignElem a bit, we do a lot of searches on them.
llvm-svn: 164897
2012-09-29 19:57:14 +00:00
Craig Topper
d903ec6dc2 Remove more LLVM_DELETED_FUNCTIONs from destructors to fix -std=c++11 build on gcc 4.7.
llvm-svn: 164880
2012-09-29 02:25:34 +00:00
Bill Wendling
3072860a8f Remove unused methods.
llvm-svn: 164848
2012-09-28 21:22:24 +00:00
Andrew Kaylor
6b7788b0c5 Removing dependency on third party library for Intel JIT event support.
Patch committed on behalf of Kirill Uhanov

llvm-svn: 164831
2012-09-28 17:35:20 +00:00
Benjamin Kramer
bfbf4015c4 PackedVector: Make the BitVector implementation configurable.
llvm-svn: 164826
2012-09-28 16:40:29 +00:00
Benjamin Kramer
518ed57959 Provide malloc-free sentinels for the SparseBitVector internals.
llvm-svn: 164823
2012-09-28 15:36:41 +00:00
Benjamin Kramer
f358e32d89 Make backtraces work again with both the configure and cmake build.
llvm-svn: 164817
2012-09-28 10:10:46 +00:00
Craig Topper
a320f275b7 Remove a LLVM_DELETED_FUNCTION from destructor to fix -std=c++11 build on gcc 4.7.
llvm-svn: 164813
2012-09-28 07:17:01 +00:00
Sylvestre Ledru
b77340e506 Revert 'Fix a typo 'iff' => 'if''. iff is an abreviation of if and only if. See: http://en.wikipedia.org/wiki/If_and_only_if Commit 164767
llvm-svn: 164768
2012-09-27 10:14:43 +00:00
Sylvestre Ledru
1c5e7904de Fix a typo 'iff' => 'if'
llvm-svn: 164767
2012-09-27 09:59:43 +00:00
Bill Wendling
c8cda02cd8 Add constructors to the attribute builder.
llvm-svn: 164762
2012-09-27 07:22:30 +00:00
Nick Lewycky
95ec62ccf1 Add missing function CreateFPCast to the TargetFolder. It's there in the other
folders and not having it here fails to compile if you actually try to use it.

Also, CreatePointerCast was failing to do the part where it does TD-aware
constant folding. Granted there is exactly one case where that it will ever
do anything, but there's no reason to skip it. For reference, that case is a
subtraction between two constant offsets on the same global variable, eg.,
"&A[123] - &A[4].f".

llvm-svn: 164760
2012-09-27 06:33:40 +00:00
Bill Wendling
8a18a7b5f5 Buildbot Fix.
This method can be called with a '0' argument which checks the return
value. However, the method it calls doesn't expect '0' as a valid value. Call the
correct method when it's 0.

llvm-svn: 164735
2012-09-26 23:38:00 +00:00
Dan Gohman
28f428eb2b Add IRBuilder code for adding !tbaa.struct metadata tags to llvm.memcpy calls.
llvm-svn: 164728
2012-09-26 22:17:14 +00:00
Bill Wendling
511b13f148 Query the parameter attributes directly instead of using the Attribute symbols.
llvm-svn: 164727
2012-09-26 22:15:19 +00:00
Bill Wendling
92f3ab845d Remove the `hasFnAttr' method from Function.
The hasFnAttr method has been replaced by querying the Attributes explicitly. No
intended functionality change.

llvm-svn: 164725
2012-09-26 21:48:26 +00:00
Bill Wendling
814c41e2c5 Initial commit for the AttributesImpl class.
This opaque class will contain all of the attributes. All attribute queries will
go through this object. This object will also be uniqued in the LLVMContext.
Currently not used, so no implementation change.

llvm-svn: 164722
2012-09-26 21:07:29 +00:00
Hans Wennborg
e1a73f6ca3 Address Duncan's comments on r164684:
- Put statistics in alphabetical order
- Don't use getZextValue when building TableInt, just use APInts
- Introduce Create{Z,S}ExtOrTrunc in IRBuilder.

llvm-svn: 164696
2012-09-26 14:01:53 +00:00
Chandler Carruth
8d729fba5a Add some convenience methods to IRBuilder for constructing aligned loads
and stores. These will be used in subsequnet patches to SROA to more
systematically manage the alignment on loads and stores.

llvm-svn: 164688
2012-09-26 10:27:40 +00:00
Craig Topper
4d6b109da1 Revert r164663 due to buildbot failure.
llvm-svn: 164670
2012-09-26 07:43:06 +00:00
Craig Topper
a5ffb1123c Add is16BitVector and is32BitVector to MVT and call them from EVT. Matches other similar methods.
llvm-svn: 164668
2012-09-26 07:17:37 +00:00
Craig Topper
0cda5b9a3c Rename virtual table anchors from Anchor() to anchor() for consistency with the rest of the tree.
llvm-svn: 164666
2012-09-26 06:36:36 +00:00
Craig Topper
84c135d4bb Mark extended type querying methods as 'readonly' to reduce compile size.
llvm-svn: 164663
2012-09-26 06:28:26 +00:00
Michael Ilseman
3e79cb01e7 Expansions for u/srem, using the udiv expansion. More unit tests for udiv and u/srem.
Fixed issue with Release build.

llvm-svn: 164654
2012-09-26 01:55:01 +00:00
Bill Wendling
de1aa2d563 Move remaining methods inside the Attributes class. Merge the 'Attribute' namespaces.
llvm-svn: 164631
2012-09-25 20:57:48 +00:00
Bill Wendling
14c8072a79 Move Attribute::typeIncompatible inside of the Attributes class.
llvm-svn: 164629
2012-09-25 20:38:59 +00:00
Sebastian Pop
270e075dec TargetLowering interface to set/get minimum block entries for jump tables.
Provide interface in TargetLowering to set or get the minimum number of basic
blocks whereby jump tables are generated for switch statements rather than an
if sequence.

    getMinimumJumpTableEntries() defaults to 4.
    setMinimumJumpTableEntries() allows target configuration.

    This patch changes the default for the Hexagon architecture to 5
    as it improves performance on some benchmarks.

llvm-svn: 164628
2012-09-25 20:35:36 +00:00
Chad Rosier
28c95ff726 Revert r164614 to appease the buildbots.
llvm-svn: 164627
2012-09-25 19:57:20 +00:00
Michael Ilseman
16fda61fbf Expansions for u/srem, using the udiv expansion. More unit tests for udiv and u/srem.
llvm-svn: 164614
2012-09-25 17:56:47 +00:00
Chad Rosier
c1cc5aaace Typo.
llvm-svn: 164570
2012-09-24 23:04:25 +00:00
Chad Rosier
4c89e0343a Rather then have a wrapper function, have tblgen instantiate the implementation.
Also remove an unused argument.

llvm-svn: 164567
2012-09-24 22:57:55 +00:00
Craig Topper
36f4bfec12 Add LLVM_OVERRIDE to methods that override their base classes.
llvm-svn: 164471
2012-09-23 02:12:10 +00:00
Andrew Trick
7a73f9d7f4 Machine Model (-schedmodel only). Added SchedAliases.
Allow subtargets to tie SchedReadWrite types to processor specific
sequences or variants.

llvm-svn: 164451
2012-09-22 02:24:21 +00:00
Jordan Rose
322d2a4afc Add llvm::getOrdinalSuffix to get the appropriate -st, -nd, -rd, -th suffix.
Used by clang to print parameter indexes.

llvm-svn: 164440
2012-09-22 01:24:21 +00:00
Jordan Rose
f8bd27333f Casting: assert that pointer arguments to isa<> are non-null.
This silences several analyzer warnings within LLVM, and provides a slightly
nicer crash experience when someone calls isa<>, cast<>, or dyn_cast<> with
a null pointer.

llvm-svn: 164439
2012-09-22 01:24:18 +00:00
Jordan Rose
8632457a1a DenseMap: assert that we have found a bucket before we try to insert into it.
This silences literally dozens of analyzer warnings on LLVM (since DenseMap
is such a commonly-used class).

llvm-svn: 164438
2012-09-22 01:24:16 +00:00
Eric Christopher
8172c32318 Add an --enable-backtraces option to configure to determine
whether or not we want to print out backtrace information. Useful
for libraries that don't need backtrace information on a crash.

rdar://11844710

llvm-svn: 164426
2012-09-21 23:03:29 +00:00
Dan Gohman
d9c407a8be Add an MDBuilder utility for creating !tbaa.struct nodes.
llvm-svn: 164425
2012-09-21 23:00:37 +00:00
Chad Rosier
fd5e542cea [ms-inline asm] Expose the mnemonicIsValid() function in the AsmParser.
llvm-svn: 164420
2012-09-21 22:21:26 +00:00
Bill Wendling
be9626d5d1 Encapsulate the "construct*AlignmentFromInt" functions.
llvm-svn: 164373
2012-09-21 16:07:28 +00:00
Bill Wendling
38bffadcad Make the 'get*AlignmentFromAttr' functions into member functions within the Attributes class. Now with fix.
llvm-svn: 164370
2012-09-21 15:26:31 +00:00
Alexey Samsonov
ad52a8844e Fix SymbolRef::getAddress implementation for ELF. The 'value' field in symbol table entry should be treated differently for relocatable and relocated files. This patch fixes symbol addresses printed by llvm-nm for executables and shared objects.
llvm-svn: 164365
2012-09-21 07:08:08 +00:00
Jim Grosbach
135898ebe3 ARM: Use a dedicated intrinsic for vector bitwise select.
The expression based expansion too often results in IR level optimizations
splitting the intermediate values into separate basic blocks, preventing
the formation of the VBSL instruction as the code author intended. In
particular, LICM would often hoist part of the computation out of a loop.

rdar://11011471

llvm-svn: 164340
2012-09-21 00:18:20 +00:00
Bill Wendling
65a9731d9c Revert r164308 to fix buildbots.
llvm-svn: 164309
2012-09-20 16:59:57 +00:00
Bill Wendling
89e5c2d955 Make the 'get*AlignmentFromAttr' functions into member functions within the Attributes class.
llvm-svn: 164308
2012-09-20 16:27:05 +00:00
Bill Wendling
4eab333c69 Remove more bare uses of the different Attribute enums.
llvm-svn: 164307
2012-09-20 15:20:36 +00:00
Bill Wendling
84e637cf62 Make the 'getAsString' function a method of the Attributes class.
llvm-svn: 164305
2012-09-20 14:44:42 +00:00
Jim Grosbach
d3674f0b4e ARM: Tidy up IntrinsicsARM.td a bit.
Make the TargetPrefix setting one big setting instead of being spread out
everywhere. No functional change.

llvm-svn: 164265
2012-09-19 23:39:03 +00:00
Bill Wendling
a46e596d7c Add predicates for queries on whether an attribute exists.
llvm-svn: 164264
2012-09-19 23:35:21 +00:00
Micah Villmow
cb0e426061 Add in new data types that are used by AMDIL/ANL among others.
llvm-svn: 164261
2012-09-19 22:47:07 +00:00
Owen Anderson
46c3ebc1a6 Implement a correct copy constructor for Record. Now that we're using the ID number as a key in maps (for determinism), it is imperative that ID numbers be globally unique, even when we copy construct a Record.
This fixes some obscure failure cases involving registers defined inside multiclasses or foreach constructs that would not receive a unique ID, and would end up being omitted from the AsmMatcher tables.

llvm-svn: 164251
2012-09-19 21:34:18 +00:00
Andrew Kaylor
960981f691 This patch adds memory support functions which will later be used to implement section-specific protection handling in MCJIT.
llvm-svn: 164249
2012-09-19 20:46:12 +00:00
Preston Gurd
79d6f55f89 Add support for macro parameters/arguments delimited by spaces,
to improve compatibility with GNU as.

Based on a patch by PaX Team.

Fixed assertion failures on non-Darwin and added additional test cases.

llvm-svn: 164248
2012-09-19 20:36:12 +00:00
Duncan Sands
1dce9e098d Add support for accessing an MDNode's operands via the C binding. Patch by
Anthony Bryant.

llvm-svn: 164247
2012-09-19 20:29:39 +00:00
Michael Ilseman
462b51585f Document the interface for integer expansion, using doxygen-style comments
llvm-svn: 164231
2012-09-19 16:03:57 +00:00
Michael Ilseman
c064f031ff Forward declarations
llvm-svn: 164230
2012-09-19 15:55:03 +00:00
Will Dietz
6c3d864486 Fix minor typo in IntervalPartition.h
llvm-svn: 164222
2012-09-19 13:45:43 +00:00
Rafael Espindola
8926dd6aeb Make MapVector a bit more expensive but harder to misuse. We now only
provide insertion order iteration, instead of the old option of
DenseMap order iteration over keys and insertion order iteration over
values.
This is implemented by keeping two copies of each key.

llvm-svn: 164221
2012-09-19 13:42:51 +00:00
Benjamin Kramer
13bd00c244 InlineCost: Make TotalAllocaSizeRecursiveCaller unsigned to avoid sign-compare warnings.
It's a size, not a cost.

llvm-svn: 164219
2012-09-19 13:22:27 +00:00
Benjamin Kramer
96b6f5646b Remove unused and broken CloneFunction wrapper.
It converted the CodeInfo argument to bool implicitly.

llvm-svn: 164215
2012-09-19 13:03:01 +00:00
Nadav Rotem
f6de6e1e82 Prevent inlining of callees which allocate lots of memory into a recursive caller.
Example:

void foo() {
 ... foo();   // I'm recursive!

  bar();
}

bar() {  int a[1000];  // large stack size }

rdar://10853263

llvm-svn: 164207
2012-09-19 08:08:04 +00:00
Sean Silva
eedf4ffbcb Refactor Record* by-ID comparator to Record.h
This is a generally useful utility; there's no reason to have it hidden
in CodeGenDAGPatterns.cpp.

Also, rename it to fit the other comparators in Record.h

Review by Jakob.

llvm-svn: 164189
2012-09-19 01:47:00 +00:00
Michael Ilseman
2555741dad New utility for expanding integer division for targets that don't support it.
Implementation derived from compiler-rt's implementation of signed and unsigned integer division.

llvm-svn: 164173
2012-09-18 22:02:40 +00:00
Rafael Espindola
528ca88d0c Add a MapVector class. It provides a regular set iteration, but
also provides a insertion order iteration over the values.

llvm-svn: 164157
2012-09-18 18:43:21 +00:00
Roman Divacky
bb7740900c Avoid symbol name clash when filling TOC.
Patch by Adhemerval Zanella.

llvm-svn: 164141
2012-09-18 17:10:37 +00:00
Roman Divacky
1e332ec870 Add PowerPC64 relocation definitions. Patch by Adhemerval Zanella!
llvm-svn: 164137
2012-09-18 16:38:02 +00:00
Roman Divacky
e91b4521bf When creating MCAsmBackend pass the CPU string as well. In X86AsmBackend
store this and use it to not emit long nops when the CPU is geode which
doesnt support them.

Fixes PR11212.

llvm-svn: 164132
2012-09-18 16:08:49 +00:00
Tom Stellard
7839a3cf23 Make MachinePostDominatorTree::DT private
llvm-svn: 164125
2012-09-18 13:49:54 +00:00
Andrew Trick
6cba50cbb4 Replaced ReInitMCSubtargetInfo with InitMCProcessor.
Now where we used to call ReInitMCSubtargetInfo, we actually recompute
the same information as InitMCSubtargetInfo instead of only setting
the feature bits.

llvm-svn: 164105
2012-09-18 05:33:15 +00:00
Craig Topper
04a52acb1d Fix a typo. No functional change.
llvm-svn: 164100
2012-09-18 04:43:05 +00:00
Andrew Trick
1a1e7664ae Let NULL slip through again.
llvm-svn: 164099
2012-09-18 04:18:39 +00:00
Andrew Trick
e3e6fae309 TargetSchedModel API. Implement latency lookup, disabled.
llvm-svn: 164098
2012-09-18 04:03:34 +00:00
Andrew Trick
c2ee4420fd TableGen subtarget emitter. Remove unnecessary header dependence.
llvm-svn: 164094
2012-09-18 03:32:57 +00:00
Craig Topper
06c859569e Mark unimplemented operator new as LLVM_DELETED_FUNCTION.
llvm-svn: 164093
2012-09-18 03:25:49 +00:00
Andrew Trick
65c7aae93f TableGen subtarget emitter. Initialize MCSubtargetInfo with the new machine model.
llvm-svn: 164092
2012-09-18 03:18:56 +00:00