1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 04:22:57 +02:00
Commit Graph

11550 Commits

Author SHA1 Message Date
Chris Lattner
e34dde1e83 move three lowering hooks from MAI to TLOF and make one of them
semantic instead of syntactic.  This completes MCization of
darwin/x86[-64]!

llvm-svn: 98145
2010-03-10 07:20:42 +00:00
Chris Lattner
ed0b8d36e4 set the temporary bit on MCSymbols correctly.
llvm-svn: 98124
2010-03-10 02:25:11 +00:00
Chris Lattner
554f323da8 eliminate MCContext::CreateSymbol and CreateTemporarySymbol.
Add a new GetOrCreateTemporarySymbol method and a version that
takes a twine.

llvm-svn: 98118
2010-03-10 01:29:27 +00:00
Jakob Stoklund Olesen
189a55cc16 Try to keep the cached inliner costs around for a bit longer for big functions.
The Caller cost info would be reset everytime a callee was inlined. If the
caller has lots of calls and there is some mutual recursion going on, the
caller cost info could be calculated many times.

This patch reduces inliner runtime from 240s to 0.5s for a function with 20000
small function calls.

This is a more conservative version of r98089 that doesn't break the clang
test CodeGenCXX/temp-order.cpp. That test relies on rather extreme inlining
for constant folding.

llvm-svn: 98099
2010-03-09 23:02:17 +00:00
Jakob Stoklund Olesen
24bdfeee51 Revert r98089, it was breaking a clang test.
llvm-svn: 98094
2010-03-09 22:43:37 +00:00
Jakob Stoklund Olesen
0e8f00292c Try to keep the cached inliner costs around for a bit longer for big functions.
The Caller cost info would be reset everytime a callee was inlined. If the
caller has lots of calls and there is some mutual recursion going on, the
caller cost info could be calculated many times.

This patch reduces inliner runtime from 240s to 0.5s for a function with 20000
small function calls.

llvm-svn: 98089
2010-03-09 22:17:11 +00:00
Jim Grosbach
f328c5334f Change the Value argument to eliminateFrameIndex to a type-tagged value. This
is preparatory to having PEI's scavenged frame index value reuse logic
properly distinguish types of frame values (e.g., whether the value is
stack-pointer relative or frame-pointer relative).

No functionality change.

llvm-svn: 98086
2010-03-09 21:45:49 +00:00
Chris Lattner
d51f1bdc58 reapply r98035:
Now that setStartLabel takes an MCSymbol, we can de-ID'ize
beginScope and RecordSourceLine.

llvm-svn: 98047
2010-03-09 04:54:43 +00:00
Eric Christopher
8875eba06a Speculatively revert r98035. It appears to have caused a set of buildbot
failures.

llvm-svn: 98039
2010-03-09 02:36:31 +00:00
Chris Lattner
c4a74bf48b Now that setStartLabel takes an MCSymbol, we can de-ID'ize
beginScope and RecordSourceLine.

llvm-svn: 98035
2010-03-09 02:08:02 +00:00
Chris Lattner
d4ce7a73e8 strength reduce MMI::MappedLabel to MMI::isLabelDeleted,
and add a FIXME about how we are eventually going to zap this
lookup table once mc world domination is complete.

llvm-svn: 98031
2010-03-09 01:51:43 +00:00
Chris Lattner
73de790f59 inline RemapLabel into its only caller and simplify.
llvm-svn: 98029
2010-03-09 01:29:59 +00:00
Devang Patel
4995bb0450 Start using DIFile. See updated SourceLevelDebugging.html for more information.
This patch updates LLVMDebugVersion to 8.
Debug info descriptors encoded using LLVMDebugVersion 7 is supported.

Corresponding llvmgcc and clang FE commits are required.

llvm-svn: 98020
2010-03-09 00:44:10 +00:00
Chris Lattner
8147c144d9 add a EmitSymbolValue convenience method to MCStreamer.
llvm-svn: 98017
2010-03-09 00:39:24 +00:00
Chris Lattner
99ca33d324 move .set generation out of DwarfPrinter into AsmPrinter and
MCize it.

llvm-svn: 98010
2010-03-08 23:58:37 +00:00
Devang Patel
a7387f4ecc Introduce DIFile. This will be used to represent header files and source file(s) in debug info.
llvm-svn: 97994
2010-03-08 22:27:22 +00:00
Devang Patel
ea239f6e0a Derive DIType from DIScope. This simplifies getContext() where for members the context is a type. This also eliminates need of CompileUnitMaps maintained by dwarf writer.
llvm-svn: 97990
2010-03-08 22:02:50 +00:00
Devang Patel
21633192f3 Remove DbgNode checks in constructor. Debug descriptors are intended to be light weight wrappers.
llvm-svn: 97988
2010-03-08 21:32:10 +00:00
Devang Patel
a975a7e590 isNull() is not used any more.
llvm-svn: 97979
2010-03-08 21:00:27 +00:00
Devang Patel
176dc29a62 Avoid using DIDescriptor.isNull().
This is a first step towards eliminating checks in Descriptor constructors.

llvm-svn: 97975
2010-03-08 20:52:55 +00:00
Andrew Lenharth
4f4af9d95c Iterator traits and swap. closes PR6548 and PR6549
llvm-svn: 97974
2010-03-08 20:45:52 +00:00
Devang Patel
a716e313d6 Revert r97947.
llvm-svn: 97963
2010-03-08 19:20:38 +00:00
Devang Patel
1527b2657b Avoid using DIDescriptor.isNull().
This is a first step towards eliminating unncessary constructor checks in light weight DIDescriptor wrappers.

llvm-svn: 97947
2010-03-08 18:25:48 +00:00
Douglas Gregor
c52fc8f922 Revert r97917, which was causing Clang Debug self-host failures.
llvm-svn: 97932
2010-03-08 02:58:37 +00:00
Jeffrey Yasskin
82f0356671 Roll back r97918 again. Just configuring against llvm-gcc wasn't enough to run
the FrontendC* tests. :(

llvm-svn: 97921
2010-03-07 19:26:40 +00:00
Jeffrey Yasskin
daae74ff0d Reapply r97788 to free MDNodes when the LLVMContext is destroyed. It
bootstraps llvm-gcc this time.

llvm-svn: 97918
2010-03-07 18:46:57 +00:00
Jeffrey Yasskin
2c23c1d1a1 Roll r97906 forward again, without double-deleting CompileUnit::IndexTyDie.
llvm-svn: 97917
2010-03-07 17:10:13 +00:00
Tobias Grosser
3d040891b0 Add findNearestCommonDominator() for PostDominators.
Add a missing interface to be able to call findNearestCommonDominator
for a PostDominanceTree. The function itself is already implemented in
DominatorTreeBase. The interface however was only added to the
DominatorTree class, but not the PostDominatorClass.

llvm-svn: 97915
2010-03-07 11:15:04 +00:00
Chris Lattner
f3ee582f23 Use Other as a sentinel instead of iAny.
llvm-svn: 97914
2010-03-07 07:45:08 +00:00
Jeffrey Yasskin
c68dc05867 _2_ gcc crashes, ah, ah, ah...
(Rolling back r97906.)

llvm-svn: 97909
2010-03-07 07:16:49 +00:00
Jeffrey Yasskin
c0123f0033 Avoid leaking CompileUnits and DbgScopes from DwarfDebug. Leaks found by Valgrind!
llvm-svn: 97906
2010-03-07 06:55:35 +00:00
Chris Lattner
a446775fd5 make APFloat::toString be const.
llvm-svn: 97883
2010-03-06 19:20:13 +00:00
Rafael Espindola
59d5d39e8d Add static methods to handle Linkage Types.
llvm-svn: 97871
2010-03-06 07:22:39 +00:00
Erick Tryzelaar
a71d3b252d Add a LLVMWriteBitcodeToFD that exposes the raw_fd_ostream options.
llvm-svn: 97858
2010-03-06 00:30:06 +00:00
Dale Johannesen
f0c8e76a85 Add some new bits of debug info handling. No
functional change yet.

llvm-svn: 97855
2010-03-06 00:03:23 +00:00
Eric Christopher
dfb465a816 Move SimplifyLibCalls's LibCall builders to a separate file so they
can be used in more places.  Add an argument for the TargetData that
most of them need. Update for the getInt8PtrTy() change.  Should be
no functionality change.

llvm-svn: 97844
2010-03-05 22:25:30 +00:00
Eric Christopher
1e4aafa273 Add support for an i8* type accessor.
llvm-svn: 97841
2010-03-05 22:21:58 +00:00
Eric Christopher
3e3c445c81 Move GetStringLength and helper from SimplifyLibCalls to ValueTracking.
No functionality change.

llvm-svn: 97793
2010-03-05 06:58:57 +00:00
Jeffrey Yasskin
ec7d47ec83 Revert r97788 because it broke test/FrontendC/2010-02-16-DbgVarScope.c.
llvm-svn: 97792
2010-03-05 06:43:49 +00:00
Jeffrey Yasskin
a526081ebf Free MDNodes when the LLVMContext is destroyed. Leak found by Valgrind.
llvm-svn: 97788
2010-03-05 05:47:09 +00:00
Mikhail Glushenkov
67cac93b81 Make it not an error to specify -O* options several times.
As in 'llvmc -O2 -O2 test.c'.

llvm-svn: 97787
2010-03-05 04:46:39 +00:00
Chris Lattner
19007009c8 inline CannotYetSelectIntrinsic into CannotYetSelect and simplify.
llvm-svn: 97690
2010-03-04 00:21:16 +00:00
Erick Tryzelaar
2825c880af Expose alignment and stack alignment attributes to llvm-c and ocaml.
llvm-svn: 97682
2010-03-03 23:51:25 +00:00
Evan Cheng
8c608dffd5 Move MachineInstrExpressionTrait::getHashValue() out of line so it can skip over only virtual register defs. This matches what isEqual() is doing.
llvm-svn: 97680
2010-03-03 23:37:30 +00:00
Evan Cheng
36a7a94029 Re-apply r97667 but with a little bit of thought put into the patch. This implements a special DenseMapInfo trait for DenseMap<MachineInstr*> that compare the value of the MachineInstr rather than the pointer value. Since the hashing and equality test functions ignore defs it's useful for doing CSE kind optimization.
llvm-svn: 97678
2010-03-03 23:27:36 +00:00
Dan Gohman
fe6b41169a Revert 97667. It broke a bunch of tests.
llvm-svn: 97673
2010-03-03 22:40:03 +00:00
Evan Cheng
338c7aed4c Move DenseMapInfo for MachineInstr* to MachineInstr.h
llvm-svn: 97667
2010-03-03 21:47:16 +00:00
Evan Cheng
810a26689e Add MachineRegisterInfo::hasOneUse and hasOneNonDBGUse.
llvm-svn: 97663
2010-03-03 21:18:38 +00:00
Chris Lattner
acb553060b don't use always_inline with gcc 3.4, it has some unimplemented features
and is too old to really care about the performance of the generated 
compiler.

llvm-svn: 97662
2010-03-03 20:47:12 +00:00
Evan Cheng
a139c6cb44 TopLevelMap[] reference is a pointer.
llvm-svn: 97661
2010-03-03 20:46:48 +00:00
Chris Lattner
9889ed8c45 speed up scope node processing: if the first element of a scope
entry we're about to process is obviously going to fail, don't
bother pushing a scope only to have it immediately be popped.
This avoids a lot of scope stack traffic in common cases.

Unfortunately, this requires duplicating some of the predicate
dispatch.  To avoid duplicating the actual logic I pulled each
predicate out to its own static function which gets used in
both places.

llvm-svn: 97651
2010-03-03 07:31:15 +00:00
Chris Lattner
92a814205f introduce a new SwitchTypeMatcher node (which is analogous to
SwitchOpcodeMatcher) and have DAGISelMatcherOpt form it.  This
speeds up selection, particularly for X86 which has lots of 
variants of instructions with only type differences.

llvm-svn: 97645
2010-03-03 06:28:15 +00:00
Evan Cheng
70b7ecdef9 - Change MachineInstr::isIdenticalTo to take a new option that determines whether it should skip checking defs or at least virtual register defs. This subsumes part of the TargetInstrInfo::isIdentical functionality.
- Eliminate TargetInstrInfo::isIdentical and replace it with produceSameValue. In the default case, produceSameValue just checks whether two machine instructions are identical (except for virtual register defs). But targets may override it to check for unusual cases (e.g. ARM pic loads from constant pools).

llvm-svn: 97628
2010-03-03 01:44:33 +00:00
Evan Cheng
3f08373243 Ordering forward declarations.
llvm-svn: 97626
2010-03-03 01:37:50 +00:00
Erick Tryzelaar
66bf49241f Add Module functions in place of module providers.
llvm-svn: 97608
2010-03-02 23:58:54 +00:00
Chris Lattner
f781ca5fcb remove 300 lines of code that is now dead in the MSP430 backend
now that isel handles chains more aggressively.  This also
allows us to make isLegalToFold non-virtual.

llvm-svn: 97597
2010-03-02 22:30:08 +00:00
Chris Lattner
9c9c1158cb Fix some issues in WalkChainUsers dealing with
CopyToReg/CopyFromReg/INLINEASM.  These are annoying because
they have the same opcode before an after isel.  Fix this by
setting their NodeID to -1 to indicate that they are selected,
just like what automatically happens when selecting things that
end up being machine nodes.

With that done, give IsLegalToFold a new flag that causes it to
ignore chains.  This lets the HandleMergeInputChains routine be
the one place that validates chains after a match is successful,
enabling the new hotness in chain processing.  This smarter
chain processing eliminates the need for "PreprocessRMW" in the
X86 and MSP430 backends and enables MSP to start matching it's
multiple mem operand instructions more aggressively.

I currently #if out the dead code in the X86 backend and MSP 
backend, I'll remove it for real in a follow-on patch.

The testcase changes are:
  test/CodeGen/X86/sse3.ll: we generate better code
  test/CodeGen/X86/store_op_load_fold2.ll: PreprocessRMW was 
      miscompiling this before, we now generate correct code
      Convert it to filecheck while I'm at it.
  test/CodeGen/MSP430/Inst16mm.ll: Add a testcase for mem/mem
      folding to make anton happy. :)

llvm-svn: 97596
2010-03-02 22:20:06 +00:00
Evan Cheng
90979fa639 Allow specialization of ScopedHashTable of non-default DenseMapInfo.
llvm-svn: 97594
2010-03-02 22:10:24 +00:00
Erick Tryzelaar
0d0b778d8b Rename LLVMUseIteratorRef to LLVMUseRef since we don't refer to iterators in llvm-c.
llvm-svn: 97585
2010-03-02 20:32:28 +00:00
Evan Cheng
a93cb01841 Swap parameters of isSafeToMove and isSafeToReMat for consistency.
llvm-svn: 97578
2010-03-02 19:03:01 +00:00
Chris Lattner
2019e2922f Fix the xfail I added a couple of patches back. The issue
was that we weren't properly handling the case when interior
nodes of a matched pattern become dead after updating chain
and flag uses.  Now we handle this explicitly in 
UpdateChainsAndFlags.

llvm-svn: 97561
2010-03-02 07:50:03 +00:00
Chris Lattner
bd1d913a9d factor node morphing out to its own helper method.
llvm-svn: 97558
2010-03-02 06:55:04 +00:00
Chris Lattner
3cfdaec84a eliminate CodeGen/DAGISelHeader.h, it is empty now.
llvm-svn: 97556
2010-03-02 06:36:28 +00:00
Chris Lattner
1707a88a2c Sink InstructionSelect() out of each target into SDISel, and rename it
DoInstructionSelection.  Inline "SelectRoot" into it from DAGISelHeader.
Sink some other stuff out of DAGISelHeader into SDISel.

Eliminate the various 'Indent' stuff from various targets, which dates
to when isel was recursive.

 17 files changed, 114 insertions(+), 430 deletions(-)

llvm-svn: 97555
2010-03-02 06:34:30 +00:00
Chris Lattner
ecfbebb9c1 move some code out of DAGISelHeader up to SelectionDAGISel.h where it
is shared by all targets.

llvm-svn: 97553
2010-03-02 06:04:12 +00:00
Evan Cheng
291c815b10 Add skeleton of a machine level cse pass.
llvm-svn: 97543
2010-03-02 02:38:24 +00:00
Evan Cheng
ab92cd0412 Add count() and lookup() to ScopedHashTable. It might be useful to get information out of the hash table.
llvm-svn: 97542
2010-03-02 02:37:33 +00:00
Chris Lattner
0b41a42411 Rewrite chain handling validation and input TokenFactor handling
stuff now that we don't care about emulating the old broken 
behavior of the old isel.  This eliminates the 
'CheckChainCompatible' check (along with IsChainCompatible) which
did an incorrect and inefficient scan *up* the chain nodes which
happened as the pattern was being formed and does the validation
at the end in HandleMergeInputChains when it forms a structural 
pattern.  This scans "down" the graph, which means that it is
quickly bounded by nodes already selected.  This also handles
token factors that get "trapped" in the dag.

Removing the CheckChainCompatible nodes also shrinks the 
generated tables by about 6K for X86 (down to 83K).

There are two pieces remaining before I can nuke PreprocessRMW:
1. I xfailed a test because we're now producing worse code in a 
   case that has nothing to do with the change: it turns out that
   our use of MorphNodeTo will leave dead nodes in the graph
   which (depending on how the graph is walked) end up causing
   bogus uses of chains and blocking matches.  This is really 
   bad for other reasons, so I'll fix this in a follow-up patch.

2. CheckFoldableChainNode needs to be improved to handle the TF.

llvm-svn: 97539
2010-03-02 02:22:10 +00:00
Bill Wendling
5990930d72 Remove dead parameter passing.
llvm-svn: 97536
2010-03-02 01:55:18 +00:00
Chris Lattner
35a2fb376d remove some functions that were only used by the
old isel generated code.

llvm-svn: 97522
2010-03-01 23:40:33 +00:00
Chris Lattner
4ecd0eb275 remove all but one version of SelectionDAG::MorphNodeTo
(the most general) the others are dead.

llvm-svn: 97511
2010-03-01 22:20:05 +00:00
Jakob Stoklund Olesen
fe3fae23e4 Use methods to determine if a LiveInterval is spillable.
Don't accidentally produce unspillable intervals for deeply nested loops.

llvm-svn: 97496
2010-03-01 20:59:38 +00:00
Chris Lattner
ebb4fbf691 remove anders-aa from mainline, it isn't maintained and is
tantalyzing enough that people keep trying to use it.

llvm-svn: 97483
2010-03-01 19:24:17 +00:00
Chris Lattner
b65ac4a796 Accelerate isel dispatch for tables that start with a top-level
OPC_SwitchOpcode to use a table lookup instead of having to go
through the interpreter for this.

llvm-svn: 97469
2010-03-01 18:47:11 +00:00
Dan Gohman
c08c48c9f3 Spelling fixes.
llvm-svn: 97453
2010-03-01 17:49:51 +00:00
Dan Gohman
296af95bf9 Whitespace cleanups.
llvm-svn: 97452
2010-03-01 17:47:21 +00:00
Dan Gohman
5cffef564c Use Doxygen comment syntax.
llvm-svn: 97451
2010-03-01 17:45:15 +00:00
Chris Lattner
cdfa80eaaf eliminate the CheckMultiOpcodeMatcher code and have each
ComplexPattern at the root be generated multiple times, once
for each opcode they are part of.  This encourages factoring
because the opcode checks get treated just like everything
else in the matcher.

llvm-svn: 97439
2010-03-01 07:17:40 +00:00
Chris Lattner
8529ea0237 add a new OPC_SwitchOpcode which is semantically equivalent
to a scope where every child starts with a CheckOpcode, but
executes more efficiently.  Enhance DAGISelMatcherOpt to 
form it.

This also fixes a bug in CheckOpcode: apparently the SDNodeInfo
objects are not pointer comparable, we have to compare the
enum name.

llvm-svn: 97438
2010-03-01 06:59:22 +00:00
Chris Lattner
afa7d2eacc hoist the new isel interpreter out of DAGISelHeader.h
(which gets #included into the middle of each 
target's DAGISel class) into a .cpp file where it is
only compiled once.

llvm-svn: 97425
2010-02-28 22:37:22 +00:00
Chris Lattner
d49712e905 change a few opcodes to use VBRs instead of embedding
immediate sizes into the opcode.

llvm-svn: 97423
2010-02-28 22:14:32 +00:00
Chris Lattner
34440d39ab move all the opcodes out of DAGISelHeader.h (which gets
#included into the middle of each isel class) into a real 
header.

llvm-svn: 97421
2010-02-28 21:58:42 +00:00
Chris Lattner
f571d51b6a resolve a fixme by using hte new flag.
llvm-svn: 97420
2010-02-28 21:56:16 +00:00
Chris Lattner
6f5b656bbf enhance the EmitNode/MorphNodeTo operands to take a bit that
specifies whether there is an output flag or not.  Use this
instead of redundantly encoding the chain/flag results in the
output vtlist.

llvm-svn: 97419
2010-02-28 21:53:42 +00:00
Chris Lattner
61a0c6674e enhance the new isel to handle the 'node already exists'
case of MorphNodeTo directly.

llvm-svn: 97417
2010-02-28 21:36:14 +00:00
Chris Lattner
2cda94eb86 use MorphNodeTo instead of SelectNodeTo. SelectNodeTo
is just a silly wrapper around MorphNodeTo.

llvm-svn: 97416
2010-02-28 20:55:18 +00:00
Chris Lattner
9599b6a5e9 enhance the new isel to use SelectNodeTo for most patterns,
even some the old isel didn't.  There are several parts of
this that make me feel dirty, but it's no worse than the
old isel.  I'll clean up the parts I can do without ripping
out the old one next.

llvm-svn: 97415
2010-02-28 20:49:53 +00:00
John McCall
b6e6dd63ad Add an override to StringRef::getAsInteger which parses into an APInt.
It gets its own implementation totally divorced from the (presumably
performance-sensitive) routines which parse into a uint64_t.

Add APInt::operator|=(uint64_t), which is situationally much better than
using a full APInt.

llvm-svn: 97381
2010-02-28 09:55:58 +00:00
Erick Tryzelaar
c6e78e3503 Add support for global variables in an address space for llvm-c and ocaml.
llvm-svn: 97377
2010-02-28 09:46:13 +00:00
Erick Tryzelaar
08d9f8e8fe Add indirect br support to llvm-c and ocaml.
llvm-svn: 97376
2010-02-28 09:46:06 +00:00
Erick Tryzelaar
9401ea01cc Add metadata functions to llvm-c and ocaml.
llvm-svn: 97375
2010-02-28 09:45:59 +00:00
Erick Tryzelaar
f7bbb83b17 Add the new builder arthmetic instructions to llvm-c and ocaml.
llvm-svn: 97372
2010-02-28 05:51:43 +00:00
Erick Tryzelaar
9c6bd15491 Add the new union arthmetic instructions to llvm-c and ocaml.
llvm-svn: 97371
2010-02-28 05:51:33 +00:00
Erick Tryzelaar
b405437c48 Add generic binary op and cast builder functions.
llvm-svn: 97370
2010-02-28 05:51:27 +00:00
Bob Wilson
6d8360b3d8 Revert r97245 which seems to be causing performance problems.
llvm-svn: 97366
2010-02-28 05:34:05 +00:00
John McCall
69bc985550 Teach APFloat how to create both QNaNs and SNaNs and with arbitrary-width
payloads.  APFloat's internal folding routines always make QNaNs now,
instead of sometimes making QNaNs and sometimes SNaNs depending on the
type.

llvm-svn: 97364
2010-02-28 02:51:25 +00:00
Dan Gohman
4b0dac5a8d Add a flag to addPassesToEmit* to disable the Verifier pass run
after LSR, so that clients can opt in.

llvm-svn: 97357
2010-02-28 00:41:59 +00:00
Dan Gohman
99c6bcbc13 The mayHaveSideEffects flag is no longer used.
llvm-svn: 97348
2010-02-27 23:47:46 +00:00
Dale Johannesen
23f606aa91 Further constify MDNode* references.
llvm-svn: 97252
2010-02-26 19:39:56 +00:00
Bob Wilson
139fdbd4d2 Move the EnableFullLoadPRE flag from a separate command-line option to an
argument of createGVNPass and set it automatically for -O3.

llvm-svn: 97245
2010-02-26 19:09:47 +00:00
Bob Wilson
cf20a07501 Remove unused "NoPRE" parameter in GVN and createGVNPass().
llvm-svn: 97235
2010-02-26 18:35:19 +00:00
Chris Lattner
01f5df01bf fix the matcher in the presence of multiple scopes: we need to save
and restore the entire matcher stack by value.  This is because children
we're testing could do moveparent or other things besides just 
scribbling on additions to the stack.

llvm-svn: 97212
2010-02-26 07:28:20 +00:00
Chris Lattner
e4b5559cf8 change the scope node to include a list of children to be checked
instead of to have a chained series of scope nodes.  This makes
the generated table smaller, improves the efficiency of the
interpreter, and make the factoring optimization much more 
reasonable to implement.

llvm-svn: 97160
2010-02-25 19:00:39 +00:00
Chris Lattner
f179abcb3a remove a dead PatLeaf, I previously changed all uses to use -1 instead.
llvm-svn: 97148
2010-02-25 17:39:34 +00:00
Dan Gohman
014104bcee Add more information to the getSizeOf comment.
llvm-svn: 97140
2010-02-25 15:55:28 +00:00
Dan Gohman
084112437d Revert r97064. Duncan pointed out that bitcasts are defined in
terms of store and load, which means bitcasting between scalar
integer and vector has endian-specific results, which undermines
this whole approach.

llvm-svn: 97137
2010-02-25 15:20:39 +00:00
Chris Lattner
43351d1bfd rename PushMatcherNode -> ScopeMatcherNode to more accurately
reflect what it does.  Switch the sense of the Next and the Check
arms to be more logical.  No functionality change.

llvm-svn: 97093
2010-02-25 01:56:48 +00:00
Chris Lattner
2b5db10d6e fix a bug I introduced by checking the wrong node's VT in OPC_CheckChildXType
llvm-svn: 97074
2010-02-24 22:52:52 +00:00
Dan Gohman
424e8f22d0 Make getTypeSizeInBits work correctly for array types; it should return
the number of value bits, not the number of bits of allocation for in-memory
storage.

Make getTypeStoreSize and getTypeAllocSize work consistently for arrays and
vectors.

Fix several places in CodeGen which compute offsets into in-memory vectors
to use TargetData information.

This fixes PR1784.

llvm-svn: 97064
2010-02-24 22:05:23 +00:00
Chris Lattner
071ecfc919 contract movechild+checktype into a new checkchild node, shrinking the
x86 table by 1200 bytes.

llvm-svn: 97053
2010-02-24 20:15:25 +00:00
Dan Gohman
6aacf4728c Convert a few more backedge-taken count functions to use BackedgeTakenInfo.
llvm-svn: 97042
2010-02-24 17:31:30 +00:00
Daniel Dunbar
8adb7774dc Reapply r97010, the speculative revert failed.
llvm-svn: 97036
2010-02-24 08:48:04 +00:00
Chris Lattner
dbdbb30a7c implement a simple proof-of-concept optimization for
the new isel: fold movechild+record+moveparent into a
single recordchild N node.  This shrinks the X86 table
from 125443 to 117502 bytes.

llvm-svn: 97031
2010-02-24 07:31:45 +00:00
Daniel Dunbar
8b33ce41d0 Speculatively revert r97010, "Add an argument to PHITranslateValue to specify
the DominatorTree. ...", in hopes of restoring poor old PPC bootstrap.

llvm-svn: 97027
2010-02-24 06:55:22 +00:00
Dan Gohman
c0c6077fed When forming SSE min and max nodes for UGE and ULE comparisons, it's
necessary to swap the operands to handle NaN and negative zero properly.

Also, reintroduce logic for checking for NaN conditions when forming
SSE min and max instructions, fixed to take into consideration NaNs and
negative zeros. This allows forming min and max instructions in more
cases.

llvm-svn: 97025
2010-02-24 06:52:40 +00:00
Chris Lattner
7878da5c39 The new isel was not properly handling patterns that covered
internal nodes with flag results.  Record these with a new 
OPC_MarkFlagResults opcode and use this to update the interior
nodes' flag results properly.  This fixes CodeGen/X86/i256-add.ll
with the new isel.

llvm-svn: 97021
2010-02-24 05:33:42 +00:00
Bob Wilson
437d85dd57 Add an argument to PHITranslateValue to specify the DominatorTree. If this
argument is non-null, pass it along to PHITranslateSubExpr so that it can
prefer using existing values that dominate the PredBB, instead of just
blindly picking the first equivalent value that it finds on a uselist.
Also when the DominatorTree is specified, have PHITranslateValue filter
out any result that does not dominate the PredBB.  This is basically just
refactoring the check that used to be in GetAvailablePHITranslatedSubExpr
and also in GVN.

Despite my initial expectations, this change does not affect the results
of GVN for any testcases that I could find, but it should help compile time.
Before this change, if PHITranslateSubExpr picked a value that does not
dominate, PHITranslateWithInsertion would then insert a new value, which GVN
would later determine to be redundant and would replace.  By picking a good
value to begin with, we save GVN the extra work of inserting and then
replacing a new value.

llvm-svn: 97010
2010-02-24 01:39:00 +00:00
Chris Lattner
b71f95b05e fix X86/uint_to_fp-2.ll, only fold loads when they have a
single use.

llvm-svn: 97003
2010-02-23 23:47:34 +00:00
Jakob Stoklund Olesen
cf29251712 Keep track of phi join registers explicitly in LiveVariables.
Previously, LiveIntervalAnalysis would infer phi joins by looking for multiply
defined registers. That doesn't work if the phi join is implicitly defined in
all but one of the predecessors.

llvm-svn: 96994
2010-02-23 22:43:58 +00:00
Wesley Peck
94cdac52e5 Adding the MicroBlaze backend.
The MicroBlaze is a highly configurable 32-bit soft-microprocessor for
use on Xilinx FPGAs. For more information see:
http://www.xilinx.com/tools/microblaze.htm
http://en.wikipedia.org/wiki/MicroBlaze

The current LLVM MicroBlaze backend generates assembly which can be
compiled using the an appropriate binutils assembler.

llvm-svn: 96969
2010-02-23 19:15:24 +00:00
Kevin Enderby
c11390f758 This is the first patch to put the needed bits in place to eventually allow code
to be aligned with optimal nops.  This patch does not change any functionality
and when the compiler is changed to use EmitCodeAlignment() it should also not
change the resulting output.  Once the compiler change is made and everything
looks good the next patch with the table of optimal X86 nops will be added to
WriteNopData() changing the output.  There are many FIXMEs in this patch which
will be removed when we have better target hooks (coming soon I hear).

llvm-svn: 96963
2010-02-23 18:26:34 +00:00
Mikhail Glushenkov
232ae779ee Correct option forwarding: initial implementation.
Does not work, but the infrastructure changes are in place.

llvm-svn: 96920
2010-02-23 09:04:44 +00:00
Mikhail Glushenkov
d030cced3d New experimental/undocumented feature: 'works_on_empty'.
For now, just enough support to make -filelist work.

llvm-svn: 96918
2010-02-23 09:04:28 +00:00
Mikhail Glushenkov
947daddd81 Add a way to enable '-opt=foo' forwarding.
llvm-svn: 96916
2010-02-23 09:04:13 +00:00
Chris Lattner
ac4672fba5 fix an off-by-one error.
llvm-svn: 96844
2010-02-23 01:07:09 +00:00
Chris Lattner
68fd68d9ff switch the value# in OPC_CompleteMatch and OPC_EmitNode to use a
VBR encoding for the insanity being perpetrated by the spu backend. 

llvm-svn: 96843
2010-02-23 00:59:59 +00:00
Chris Lattner
49ec9f853e add a new Push2 opcode for targets (like cellspu) which have
ridiculously ginormous patterns and need more than one byte
of displacement for encodings.  This fixes CellSPU/fdiv.ll.
SPU is still doing something else ridiculous though.

llvm-svn: 96833
2010-02-22 23:55:39 +00:00
Jim Grosbach
c4ab116a90 Updated version of r96634 (which was reverted due to failing 176.gcc and
126.gcc nightly tests. These failures uncovered latent bugs that machine DCE
could remove one half of a stack adjust down/up pair, causing PEI to assert.
This update fixes that, and the tests now pass.

llvm-svn: 96822
2010-02-22 23:10:38 +00:00
Chris Lattner
e4d3e9772a expand my hack to work with nodes that have flags but no chains and the
isel doesn't know the correct # results.  This fixes 8 codegen tests,
down to 22 failures.

llvm-svn: 96815
2010-02-22 22:37:11 +00:00
Chris Lattner
1613c59dbe add a new CheckMultiOpcode opcode for checking that a node
has one of the list of acceptable opcodes for a complex 
pattern.  This fixes 4 regtest failures.

llvm-svn: 96814
2010-02-22 22:30:37 +00:00
Chris Lattner
b9f6931c4a add some debug hooks for tracking the behavior of the isel.
llvm-svn: 96812
2010-02-22 22:15:39 +00:00
Dan Gohman
835086ef52 Fix various doxygen warnings.
llvm-svn: 96779
2010-02-22 04:10:52 +00:00
Dan Gohman
7804dbce6e Rename a variable to avoid a -Wshadow warning.
llvm-svn: 96776
2010-02-22 04:04:24 +00:00
Chris Lattner
8b7f191696 enhance my hack for flags handling, this allows us to pass
CodeGen/X86/pr2182.ll.  Down to 13 x86 failures out of ~1100

llvm-svn: 96770
2010-02-22 00:47:38 +00:00
Chris Lattner
85fa3173ff fix most of the failures in the x86 suite by handling multiple
result nodes correctly.  Note that this includes a horrible hack
in DAGISelHeader which cannot be fixed reasonably without 
eliminating (parallel) from input patterns.  That, in turn,
can't be done until we support writing multiple result patterns
for the X86and_flag and related multiple-result nodes.

llvm-svn: 96767
2010-02-21 23:54:05 +00:00
Daniel Dunbar
b6b58bff88 MC: Sketch registry support for target specific assembler backends.
llvm-svn: 96762
2010-02-21 21:53:53 +00:00
Daniel Dunbar
518e9cbe46 Formatting tweaks (trailing whitespace, ordering, comments).
llvm-svn: 96761
2010-02-21 21:53:37 +00:00
Chris Lattner
1918d5b0aa fix an odd thinko in an assertion, all arm tests pass now.
llvm-svn: 96758
2010-02-21 20:57:28 +00:00
Anton Korobeynikov
0b402e1a61 It turned out that we failed to emit proper symbol stubs on non-x86/darwin for ages (we emitted a reference to a stub, but no stub was emitted). The code inside x86-32/macho target objfile lowering should actually be the generic one - move it there.
This (I really, really hope) should fix EH issues on ppc/darwin
and arm/darwin.

llvm-svn: 96755
2010-02-21 20:28:15 +00:00
Chris Lattner
4473066b55 speculatively teach OPC_CheckValueType and OPC_EmitNode to handle
MVT::iPTR.

llvm-svn: 96753
2010-02-21 20:15:25 +00:00
Chris Lattner
11ea2e1578 teach OPC_CheckType to handle MVT::iPTR, down to 2 ppc failures.
llvm-svn: 96752
2010-02-21 20:10:43 +00:00
Chris Lattner
26215565bf make this check a bit more generous, it may be outliving its
utility.  Down to 6 ppc failures.

llvm-svn: 96751
2010-02-21 20:02:15 +00:00
Chris Lattner
3d7cc59f2c Relax an assertion a bit. We allow replacing things like
<4 x i32> with <4 x float> values if they end up the same
register class.  This gets us up to 231 passes on the ppc
tests (only 7 fails).

llvm-svn: 96750
2010-02-21 19:35:07 +00:00
Chris Lattner
c7fac8c8b2 when a match fails and we have to rollback, make sure to keep 'N' in
sync with the top of stack.  This fixes a bunch of failures on larger
testcases.

llvm-svn: 96732
2010-02-21 07:55:48 +00:00
Chris Lattner
e8842eb260 handle optional in flags that aren't present.
llvm-svn: 96731
2010-02-21 07:19:06 +00:00
Chris Lattner
8a969fb824 fix two bugs in OPC_EmitRegister, which makes ppc happier.
llvm-svn: 96728
2010-02-21 06:58:27 +00:00
Chris Lattner
0164635dad implement the last known missing feature: updating uses of results
of the matched pattern to use the newly created node results.  Onto
the "making it actually work" phase!

llvm-svn: 96724
2010-02-21 06:03:07 +00:00
Charles Davis
9dbf8d7899 Reduce size of 'StackAlignment' field from 5 to 3 bits. Seriously, who needs a
2GB-aligned stack anyway? 256 bytes is plenty. Requested by Chris.

llvm-svn: 96718
2010-02-21 04:26:06 +00:00
Chris Lattner
8983077c87 Lots of improvements to the new dagisel emitter. This gets it to
the point where it is to the 95% feature complete mark, it just
needs result updating to be done (then testing, optimization 
etc).

More specificallly, this adds support for chain and flag handling
on the result nodes, support for sdnodexforms, support for variadic
nodes, memrefs, pinned physreg inputs, and probably lots of other
stuff.

In the old DAGISelEmitter, this deletes the dead code related to
OperatorMap, cleans up a variety of dead stuff handling "implicit
remapping" from things like globaladdr -> targetglobaladdr (which
is no longer used because globaladdr always needs to be legalized),
and some minor formatting fixes.

llvm-svn: 96716
2010-02-21 03:22:59 +00:00
Chris Lattner
bb364c9b46 add a hook so that the new isel can run SDNodeXForms.
llvm-svn: 96714
2010-02-21 03:15:11 +00:00
Chris Lattner
ad9fa2075b Eliminate some uses of immAllOnes, just use -1, it does
the same thing and is more efficient for the matcher.

llvm-svn: 96713
2010-02-21 03:13:10 +00:00
Bob Wilson
df432a30b2 Revert 96634. It causes assertion failures for 126.gcc and 176.gcc in
the armv6 nightly tests.

llvm-svn: 96691
2010-02-19 18:59:53 +00:00
Bob Wilson
c03fbf812d Revert Anton's most recent EH patch (r96637), since it breaks a lot of
ARM and Thumb tests.

llvm-svn: 96680
2010-02-19 17:10:59 +00:00
Duncan Sands
88c859c900 Correct LastPrimitiveTyID: MetadataType is a primitive type.
This change probably has no functional effect.

llvm-svn: 96669
2010-02-19 09:18:53 +00:00
Chris Lattner
e6302b3565 add emitter support for integer constants and simple physreg references.
llvm-svn: 96663
2010-02-19 07:49:56 +00:00
Dale Johannesen
0f58c73229 recommit 96626, evidence that it broke things appears
to be spurious

llvm-svn: 96662
2010-02-19 07:14:22 +00:00
Dale Johannesen
d73b81bf12 Revert 96626, which causes build failure on ppc Darwin.
llvm-svn: 96653
2010-02-19 01:54:37 +00:00
Anton Korobeynikov
8aaa04a614 Use the same encoding for EH stuff uniformly on all MachO targets.
This hopefulyl should unbreak EH on PPC/Darwin.

llvm-svn: 96637
2010-02-19 00:29:36 +00:00
Jim Grosbach
53ef05fa82 Radar 7636153. In the presence of large call frames, it's not sufficient
for ARM to just check if a function has a FP to determine if it's safe
to simplify the stack adjustment pseudo ops prior to eliminating frame
indices. Allow targets to override the default behavior and does so for ARM
and Thumb2.

llvm-svn: 96634
2010-02-19 00:16:24 +00:00
Dan Gohman
2f0615ee5e Indvars needs to explicitly notify ScalarEvolution when it is replacing
a loop exit value, so that if a loop gets deleted, ScalarEvolution
isn't stick holding on to dangling SCEVAddRecExprs for that loop. This
fixes PR6339.

llvm-svn: 96626
2010-02-18 23:26:33 +00:00
Mon P Wang
64cd1a8d7f getSplatIndex assumes that the first element of the mask contains the splat index
which is not always true if the mask contains undefs. Modified it to return
the first non undef value.

llvm-svn: 96621
2010-02-18 22:33:18 +00:00
Chris Lattner
4cfdecc52b add support for referencing registers and immediates,
building the tree to represent them but not emitting 
table entries for them yet.

llvm-svn: 96617
2010-02-18 22:03:03 +00:00
Jakob Stoklund Olesen
5b9d14b55e Always normalize spill weights, also for intervals created by spilling.
Moderate the weight given to very small intervals.

The spill weight given to new intervals created when spilling was not
normalized in the same way as the original spill weights calculated by
CalcSpillWeights. That meant that restored registers would tend to hang around
because they had a much higher spill weight that unspilled registers.

This improves the runtime of a few tests by up to 10%, and there are no
significant regressions.

llvm-svn: 96613
2010-02-18 21:33:05 +00:00
Devang Patel
823a78e1f8 Fix comments.
llvm-svn: 96610
2010-02-18 21:03:36 +00:00
Devang Patel
5c67cb332e Destroy MDNodes gracefully while deleting llvm context.
llvm-svn: 96609
2010-02-18 20:53:16 +00:00
Duncan Sands
ca05b607b7 Refer to -help instead of --help since this is what tools themselves say.
Also, have tools output -help-hidden rather than refer to --help-hidden,
for consistency, and likewise adjust documentation.  This doesn't change
every mention of --help, only those which seemed clearly safe.

llvm-svn: 96578
2010-02-18 14:08:13 +00:00
Eric Christopher
88fe6775de Fix a few unused parameter warnings.
llvm-svn: 96533
2010-02-17 23:55:26 +00:00
David Greene
d93fb1f15d Make the non-temporal bit "significant" in MemSDNodes so they aren't
CSE'd or otherwise combined with temporal MemSDNodes.

llvm-svn: 96505
2010-02-17 20:21:42 +00:00
Daniel Dunbar
92e99d82a2 Add Regex::sub, for doing regular expression substitution with backreferences.
llvm-svn: 96503
2010-02-17 20:08:42 +00:00
Daniel Dunbar
27247dd1e8 Fix comment.
llvm-svn: 96498
2010-02-17 19:26:45 +00:00
Chris Lattner
2ec1f1a54a move isOnlyReachableByFallthrough out of MachineBasicBlock into AsmPrinter,
and add a sparc implementation that knows about delay slots.  Patch by
Nathan Keynes!

llvm-svn: 96492
2010-02-17 18:52:56 +00:00
Chris Lattner
4f86feb7ab add missing method, PR6284
llvm-svn: 96489
2010-02-17 18:39:56 +00:00
Chris Lattner
8f3afbc621 Emulate the current isel's "IsChainCompatible" logic for now.
I'd like to eventually rip it out, but for now producing the
same selections as the old matcher is more important.

llvm-svn: 96458
2010-02-17 06:23:39 +00:00
Chris Lattner
abb5e906a7 simplify IsChainCompatible codegen, add comments. no
functionality change.

llvm-svn: 96453
2010-02-17 05:35:28 +00:00
Chris Lattner
9625fb062a make the new isel's interpreter loop call the generated
CheckComplexPattern function.  Though it is logically const,
I don't have the fortitude to clean up all the targets now,
and it not being const doesn't block anything.

llvm-svn: 96426
2010-02-17 00:41:34 +00:00
Devang Patel
bebe8e55dc Use line and column number to distinguish two lexical blocks at the same level.
llvm-svn: 96395
2010-02-16 21:39:34 +00:00
Bob Wilson
86dded571f Rename SuccessorNumber to GetSuccessorNumber.
llvm-svn: 96387
2010-02-16 21:06:42 +00:00
Bob Wilson
a866c660db Split critical edges as needed for load PRE.
llvm-svn: 96378
2010-02-16 19:51:59 +00:00
Bob Wilson
1115365fcf Refactor to share code to find the position of a basic block successor in the
terminator's list of successors.

llvm-svn: 96377
2010-02-16 19:49:17 +00:00
Chris Lattner
ebcd505b14 convert the new matcher to check intermediate nodes for a single
use and only call IsProfitableToFold/IsLegalToFold on the load
being folded, like the old dagiselemitter does.  This 
substantially simplifies the code and improves opportunities for
sharing.

llvm-svn: 96368
2010-02-16 19:15:55 +00:00
Duncan Sands
e9a13a3c60 Introduce isOpaqueTy and use it rather than isa<OpaqueType>. Also, move some
methods to try to have the type predicates be more logically positioned.

llvm-svn: 96349
2010-02-16 14:50:09 +00:00
Duncan Sands
1b33dd3c83 There are two ways of checking for a given type, for example isa<PointerType>(T)
and T->isPointerTy().  Convert most instances of the first form to the second form.
Requested by Chris.

llvm-svn: 96344
2010-02-16 11:11:14 +00:00
Chris Lattner
a9550b6d27 generate code for node and pattern predicates. Note that this won't
build if enabled, it will fail with constness issues. I'll resolve 
these next.

llvm-svn: 96336
2010-02-16 07:21:10 +00:00
Chris Lattner
104828612b add support for the new isel matcher to generate
(isprofitable|islegal)tofold checks.

llvm-svn: 96331
2010-02-16 06:10:58 +00:00
Erick Tryzelaar
f4ca539af4 Fix a typo in an LLVMOpcode enum. LLVMTrunk -> LLVMTrunc.
llvm-svn: 96324
2010-02-16 03:45:23 +00:00
Anton Korobeynikov
ef1862e256 Move TLOF implementations to libCodegen to resolve layering violation.
llvm-svn: 96288
2010-02-15 22:37:53 +00:00
Anton Korobeynikov
dccd240998 Preliminary patch to improve dwarf EH generation - Hooks to return Personality / FDE / LSDA / TType encoding depending on target / options (e.g. code model / relocation model) - MCIzation of Dwarf EH printer to use encoding information - Stub generation for ELF target (needed for indirect references) - Some other small changes here and there
llvm-svn: 96285
2010-02-15 22:35:59 +00:00
Bill Wendling
bbf95aae9f Remove c++ style comments from c header.
llvm-svn: 96266
2010-02-15 20:53:17 +00:00
Bill Wendling
8ed10ca345 Renumber Instruction enums in llvm-c.
llvm-svn: 96264
2010-02-15 20:50:51 +00:00
Evan Cheng
b5fe25544c Split SelectionDAGISel::IsLegalAndProfitableToFold to
IsLegalToFold and IsProfitableToFold. The generic version of the later simply checks whether the folding candidate has a single use.

This allows the target isel routines more flexibility in deciding whether folding makes sense. The specific case we are interested in is folding constant pool loads with multiple uses.

llvm-svn: 96255
2010-02-15 19:41:07 +00:00
Chris Lattner
ab9dc2e37b comment fix.
llvm-svn: 96248
2010-02-15 18:55:04 +00:00
David Greene
4f983d569c Add non-temporal flags and remove an assumption of default arguments.
llvm-svn: 96240
2010-02-15 17:00:31 +00:00
David Greene
0ed0396052 Add non-temporal flags to MachineMemOperand.
llvm-svn: 96226
2010-02-15 16:48:31 +00:00
Duncan Sands
2acaf3609c Uniformize the names of type predicates: rather than having isFloatTy and
isInteger, we now have isFloatTy and isIntegerTy.  Requested by Chris!

llvm-svn: 96223
2010-02-15 16:12:20 +00:00
Chris Lattner
bc3bc62709 Check in the first big step of rewriting DAGISelEmitter to
produce a table based matcher instead of gobs of C++ Code.

Though it's not done yet, the shrinkage seems promising,
the table for the X86 ISel is 75K and still has a lot of 
optimization to come (compare to the ~1.5M of .o generated
the old way, much of which will go away).

The code is currently disabled by default (the #if 0 in
DAGISelEmitter.cpp).  When enabled it generates a dead
SelectCode2 function in the DAGISel Header which will
eventually replace SelectCode.

There is still a lot of stuff left to do, which are
documented with a trail of FIXMEs.

llvm-svn: 96215
2010-02-15 08:04:42 +00:00
Chris Lattner
8e8498ea02 give SDValue an operator->, allowing V->isTargetOpcode() and
many other natural things.

llvm-svn: 96214
2010-02-15 07:11:34 +00:00
Chris Lattner
2b00dd86ae don't make insanely large node numbers for no reason,
packing somewhat densely is better than not.

llvm-svn: 96213
2010-02-15 06:39:31 +00:00
Chris Lattner
eeadc240f2 make PadToColumn return the stream so you can use:
OS.PadToColumn(42) << "foo";

llvm-svn: 96208
2010-02-15 02:17:50 +00:00
Dan Gohman
6c0fdcea5e When restoring a saved insert location, check to see if the saved
insert location has become an "inserted" instruction since the time
it was saved. If so, advance to the first non-"inserted" instruction.

llvm-svn: 96203
2010-02-15 00:21:43 +00:00
Dan Gohman
4d5f3b74e4 In rememberInstruction, if the value being remembered is the
current insertion point, advance the current insertion point.
This avoids a use-before-def situation in a testcase extracted
from clang which is difficult to reduce to a reasonable-sized
regression test.

llvm-svn: 96151
2010-02-14 03:12:47 +00:00
Dan Gohman
8985140f3e Remove a 'protected' keyword, now that SCEVExpander is no longer
intended to be subclassed.

llvm-svn: 96149
2010-02-14 02:47:26 +00:00
Daniel Dunbar
7a1fd21459 MCAssembler: Switch MCAsmFixup to storing MCFixupKind instead of just a size.
llvm-svn: 96094
2010-02-13 09:28:54 +00:00
Daniel Dunbar
8e9044353a MCAssembler: Sink fixup list into MCDataFragment.
llvm-svn: 96093
2010-02-13 09:28:43 +00:00
Daniel Dunbar
95ae012b0e MCAssembler: Switch MCFillFragment to only taking constant values. Symbolic expressions can always be emitted as data + fixups.
llvm-svn: 96092
2010-02-13 09:28:32 +00:00
Daniel Dunbar
481e926468 MCAssembler: Start applying fixups in the data section.
llvm-svn: 96090
2010-02-13 09:28:15 +00:00
Daniel Dunbar
a699e834fb MCAssembler: Add assorted dump() methods.
llvm-svn: 96089
2010-02-13 09:28:03 +00:00
Evan Cheng
6eb7ff5bbf Teach MachineFrameInfo to track maximum alignment while stack objects are being
created. This ensures it's updated at all time. It means targets which perform
dynamic stack alignment would know whether it is required and whether frame
pointer register cannot be made available register allocation.
This is a fix for rdar://7625239. Sorry, I can't create a reasonably sized test
case.

llvm-svn: 96069
2010-02-13 01:56:41 +00:00
Dan Gohman
1e93b1c022 Override dominates and properlyDominates for SCEVAddRecExpr, as a
SCEVAddRecExpr doesn't necessarily dominate blocks merely dominated
by all of its operands. This fixes an abort compiling 403.gcc.

llvm-svn: 96056
2010-02-13 00:19:39 +00:00
Chris Lattner
946403d05f give MCCodeEmitters access to the current MCContext.
llvm-svn: 96038
2010-02-12 23:12:47 +00:00
Bob Wilson
881d06c0b9 Fix a comment typo.
llvm-svn: 96027
2010-02-12 22:34:54 +00:00
Chris Lattner
2a0d9140f5 doxygenize some comments, patch by Peter Collingbourne!
llvm-svn: 96018
2010-02-12 21:54:28 +00:00
Chris Lattner
2265d6280b Add support for a union type in LLVM IR. Patch by Talin!
llvm-svn: 96011
2010-02-12 20:49:41 +00:00
Anton Korobeynikov
7073515c86 Cleanup stdcall / fastcall name mangling.
This should fix alot of problems we saw so far, e.g. PRs 5851 & 2936

llvm-svn: 95980
2010-02-12 15:28:40 +00:00
Dan Gohman
c40eb525ad Reapply the new LoopStrengthReduction code, with compile time and
bug fixes, and with improved heuristics for analyzing foreign-loop
addrecs.

This change also flattens IVUsers, eliminating the stride-oriented
groupings, which makes it easier to work with.

llvm-svn: 95975
2010-02-12 10:34:29 +00:00
Bob Wilson
2fd80c3d94 Add a new pass on machine instructions to optimize away PHI cycles that
reduce down to a single value.  InstCombine already does this transformation
but DAG legalization may introduce new opportunities.  This has turned out to
be important for ARM where 64-bit values are split up during type legalization:
InstCombine is not able to remove the PHI cycles on the 64-bit values but
the separate 32-bit values can be optimized.  I measured the compile time 
impact of this (running llc on 176.gcc) and it was not significant.

llvm-svn: 95951
2010-02-12 01:30:21 +00:00
Charles Davis
d69c12ecc6 Add a new function attribute, 'alignstack'. It will indicate (when the backends
implement support for it) that the stack should be forcibly realigned in the
prologue (and the process reversed in the epilogue).

llvm-svn: 95945
2010-02-12 00:31:15 +00:00
Chris Lattner
144a1b7a24 add a new MCInstPrinter::getOpcodeName interface, when it is
implemented, llvm-mc --show-inst now uses it to print the
instruction opcode as well as the number.

llvm-svn: 95929
2010-02-11 22:39:10 +00:00
Daniel Dunbar
3ee9e4a9a5 MC: Move assembler-backend's fixup list into the fragment.
llvm-svn: 95926
2010-02-11 21:29:46 +00:00
Daniel Dunbar
fa324dd09b MC: Move MCSectionData::Fixup out to MCAsmFixup.
llvm-svn: 95925
2010-02-11 21:29:29 +00:00
Chris Lattner
b82b965968 make getFixupKindInfo return a const reference, allowing
the tables to be const.  Teach MCCodeEmitter to handle
the target-indep kinds so that we don't crash on them.

llvm-svn: 95924
2010-02-11 21:27:18 +00:00
Chris Lattner
63870006bf refactor x86 conditional branches to use a multipattern
that generates the 1-byte and 4-byte immediate versions
from one definition.

llvm-svn: 95902
2010-02-11 19:31:22 +00:00
Jeffrey Yasskin
ad23983452 Fix some of the memcheck errors found in the JIT unittests.
llvm-svn: 95856
2010-02-11 06:41:30 +00:00
Mon P Wang
c17e781f35 The previous fix of widening divides that trap was too fragile as it depends on custom
lowering and requires that certain types exist in ValueTypes.h.  Modified widening to
check if an op can trap and if so, the widening algorithm will apply only the op on
the defined elements.  It is safer to do this in widening because the optimizer can't
guarantee removing unused ops in some cases.

llvm-svn: 95823
2010-02-10 23:37:45 +00:00
Dale Johannesen
98ed32c3d7 Allow isDebug inquiry on any MO.
llvm-svn: 95818
2010-02-10 23:03:20 +00:00
Chris Lattner
5f5bb8b16d add a virtual dtor to MCTargetExpr, hopefully silencing some warnings.
llvm-svn: 95810
2010-02-10 21:37:31 +00:00
Dan Gohman
f2323826d2 Add a hook to AssemblyAnnotationWriter to allow custom info comments
to be printed, in place of the familiar "uses=" comments.

llvm-svn: 95798
2010-02-10 20:41:46 +00:00
Dan Gohman
ec527fddf4 Use doxygen comment syntax.
llvm-svn: 95797
2010-02-10 20:23:33 +00:00
Dan Gohman
efb42fa7c7 Fix several comments which had previously been "the the" where a
different word was intended.

llvm-svn: 95795
2010-02-10 20:04:19 +00:00
Dan Gohman
92b6122204 Fix "the the" and similar typos.
llvm-svn: 95781
2010-02-10 16:03:48 +00:00
Dan Gohman
fd8f55bc9e Minor code simplification.
llvm-svn: 95780
2010-02-10 15:54:22 +00:00
Dan Gohman
2dd0d36f14 Implement operators |=, &=, and ^= for SmallBitVector, and remove the
restriction in BitVector for |= and ^= that the operand must be the
same length.

llvm-svn: 95768
2010-02-10 05:54:04 +00:00
Daniel Dunbar
d2035fb242 MC: Switch MCFixup to just hold an MCExpr pointer instead of index into the
MCInst it came from.

llvm-svn: 95767
2010-02-10 04:47:08 +00:00
Daniel Dunbar
50b2609956 Fix a signed comparison warning.
llvm-svn: 95766
2010-02-10 04:46:51 +00:00
Chris Lattner
aed1ea28cf "fixup" a comment.
llvm-svn: 95754
2010-02-10 01:46:47 +00:00
Daniel Dunbar
75df429af0 llvm-mc: Remove --show-fixups and always show as part of --show-encoding.
Also, fix a silly memory leak.

llvm-svn: 95752
2010-02-10 01:41:14 +00:00
Chris Lattner
72156036b9 fix a layering violation: VirtRegRewriter.cpp shouldn't use AsmPrinter.h.
llvm-svn: 95748
2010-02-10 01:23:18 +00:00
Chris Lattner
70fd490fa2 Stop MachineInstr.h from #including AsmPrinter.h
llvm-svn: 95741
2010-02-10 01:04:16 +00:00
Chris Lattner
db4b4d819d Move verbose asm instruction comments to using MCStreamer.
The major win of this is that the code is simpler and they 
print on the same line as the instruction again:

        movl    %eax, 96(%esp)          ## 4-byte Spill
        movl    96(%esp), %eax          ## 4-byte Reload
        cmpl    92(%esp), %eax          ## 4-byte Folded Reload
        jl      LBB7_86

llvm-svn: 95738
2010-02-10 00:47:53 +00:00
Dale Johannesen
da728faa59 more comment updates
llvm-svn: 95736
2010-02-10 00:44:23 +00:00
Dale Johannesen
59679b7966 Add isDebug argument to ChangeToRegister; this prevents
the field from being used uninitialized later in some cases.

llvm-svn: 95735
2010-02-10 00:41:49 +00:00
Chris Lattner
ca01d26903 Add ability for MCInstPrinters to add comments for instructions.
Enhance the x86 backend to show the hex values of immediates in
comments when they are large.  For example:

        movl    $1072693248, 4(%esp)    ## imm = 0x3FF00000

llvm-svn: 95728
2010-02-10 00:10:18 +00:00
Daniel Dunbar
1b050afd4e llvm-mc: Add --show-fixups option, for displaying the instruction fixup information in the asm comments.
llvm-svn: 95710
2010-02-09 23:00:14 +00:00
Daniel Dunbar
ddfda89472 MC: First cut at MCFixup, for getting fixup/relocation information out of an MCCodeEmitter.
llvm-svn: 95708
2010-02-09 22:59:55 +00:00
Chris Lattner
7acf9be6c4 move target-independent opcodes out of TargetInstrInfo
into TargetOpcodes.h.  #include the new TargetOpcodes.h
into MachineInstr.  Add new inline accessors (like isPHI())
to MachineInstr, and start using them throughout the 
codebase.

llvm-svn: 95687
2010-02-09 19:54:29 +00:00
Jeffrey Yasskin
42bf811d65 Add support for TypeBuilder<const/volatile void*, false>.
Thanks to Jochen Wilhelmy for the suggestion!

llvm-svn: 95677
2010-02-09 19:07:19 +00:00
Eric Christopher
871cf7bce2 Pull these back out, they're a little too aggressive and time
consuming for a simple optimization.

llvm-svn: 95671
2010-02-09 17:29:18 +00:00
Dan Gohman
4346bb14f7 Mention IndVarSimplify in the comment by getSmallConstantTripCount, as
is done for getTripCount.

llvm-svn: 95666
2010-02-09 17:00:40 +00:00
Dan Gohman
3e13fc968d Mention vAny and iPTRAny in a comment.
llvm-svn: 95665
2010-02-09 16:59:14 +00:00
Dale Johannesen
3f7ce68506 Debug operands should not be def or kill.
llvm-svn: 95632
2010-02-09 00:42:08 +00:00
Lang Hames
91b4cae53c Changed the definition of an "invalid" slot to include the empty & tombstone values, but not zero.
llvm-svn: 95631
2010-02-09 00:41:23 +00:00