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

7352 Commits

Author SHA1 Message Date
Nick Lewycky
7d6a6f4509 Fix build on GCC 4.3.
llvm-svn: 54870
2008-08-17 06:40:16 +00:00
Chris Lattner
4e4a482a41 remove a dead APInt ctor.
llvm-svn: 54869
2008-08-17 04:58:58 +00:00
Chris Lattner
dab4a64423 add support for a cout/cerr analog (outs()/errs()) as well as
a simple adaptor class to give raw output capabilities to 
something that wants to write to an ostream.

llvm-svn: 54865
2008-08-17 04:13:37 +00:00
Chris Lattner
eef022091c rename OutputData to 'write' to match ostream.
llvm-svn: 54857
2008-08-17 01:46:05 +00:00
Chris Lattner
fd2dd46dcd remove accidental comment.
llvm-svn: 54856
2008-08-17 01:35:54 +00:00
Chris Lattner
312d8de59b add a new raw_ostream class which is an extremely high performance ostream that
can *only* output data (no seeking, reading, etc).  This is adapted from the
clang "-E outputter", and is roughly 10% faster than stdio on darwin and 30%
(or more) faster than std::ostream.

llvm-svn: 54855
2008-08-17 01:35:29 +00:00
Anton Korobeynikov
d51454bfa6 Add interface for section override. Use this for Sparc, since it should use named BSS section.
llvm-svn: 54844
2008-08-16 12:58:12 +00:00
Anton Korobeynikov
436f708112 Move SLEB/ULEB size calculation routines from AsmPrinter to TargetAsmInfo. This makes JIT asmprinter-free.
llvm-svn: 54843
2008-08-16 12:57:46 +00:00
Anton Korobeynikov
767865a3d1 Reduce heap trashing due to std::string construction / concatenation via caching of section flags string representations
llvm-svn: 54842
2008-08-16 12:57:07 +00:00
Owen Anderson
13498aa150 Remove GCSE, ValueNumbering, and LoadValueNumbering. These have been deprecated for almost a year; it's finally time for them to go away.
llvm-svn: 54822
2008-08-15 21:31:02 +00:00
Owen Anderson
b307df554d Add a value_type typedef to SmallVector, to make it more compatible with STL adapters.
llvm-svn: 54819
2008-08-15 18:45:51 +00:00
Chris Lattner
f991487f21 Inline the fastpath of PATypeHolder::get(). This is a small speedup in
instcombine among other things.

llvm-svn: 54814
2008-08-15 15:16:50 +00:00
Owen Anderson
fd1d9b5c38 Move MachineInstr::getOpcode inline.
llvm-svn: 54807
2008-08-14 23:25:30 +00:00
Owen Anderson
600a8ca0d5 Convert uses of std::vector in TargetInstrInfo to SmallVector. This change had to be propoagated down into all the targets and up into all clients of this API.
llvm-svn: 54802
2008-08-14 22:49:33 +00:00
Dan Gohman
6b146d5ec3 Make FastISel's constructor protected, and give it a destructor.
llvm-svn: 54793
2008-08-14 21:51:29 +00:00
Ted Kremenek
7bc723b79f Removed redundant ctor.
llvm-svn: 54789
2008-08-14 21:17:07 +00:00
Dan Gohman
027326ba3e Use empty() instead of begin() == end().
llvm-svn: 54780
2008-08-14 18:13:49 +00:00
Owen Anderson
de29970fc6 Expunge the last uses of std::map from LiveIntervals.
llvm-svn: 54766
2008-08-13 22:28:50 +00:00
Owen Anderson
550fc15832 Move r2iMap_ over to DenseMap from std::map.
llvm-svn: 54765
2008-08-13 22:08:30 +00:00
Owen Anderson
28f2e658f1 Make the allocation of LiveIntervals explicit, rather than holding them in the r2iMap_ by value. This will prevent references to them from being invalidated
if the map is changed.

llvm-svn: 54763
2008-08-13 21:49:13 +00:00
Owen Anderson
612fc9babc Switch this from std::map to DenseMap.
llvm-svn: 54761
2008-08-13 21:24:24 +00:00
Daniel Dunbar
e249d30421 Add default constructor to APSInt
- Creates uninitialized APInt. 
 - Prevents need for embedding arbitrary constants when used as an out
   parameter, for example.

llvm-svn: 54757
2008-08-13 20:53:17 +00:00
Dan Gohman
4b1b033f89 Initial checkin of the new "fast" instruction selection support. See
the comments in FastISelEmitter.cpp for details on what this is.
This is currently experimental and unusable.

llvm-svn: 54751
2008-08-13 20:19:35 +00:00
Dan Gohman
9e27bed4f0 Rename SelectionDAGISel's FastISel to Fast, to begin to make
room for the new FastISel instruction selection code.

llvm-svn: 54749
2008-08-13 19:47:40 +00:00
Duncan Sands
77e09ca5d0 Rename this, in case people think that NullFolder
has something to do with folding null values.

llvm-svn: 54725
2008-08-13 08:56:48 +00:00
Duncan Sands
0f1ba9dee5 Add a NullFolder class that doesn't fold constants.
This may be used as the second IRBuilder template
parameter, the idea being that people learning LLVM
may find it helpful (several people asked on IRC
if it was possible to turn off constant folding
because it made it hard for them to see what was
going on).  Compiles, but otherwise completely
untested.

llvm-svn: 54698
2008-08-12 20:39:27 +00:00
Devang Patel
d0aabe5ce6 Use SmallVector instead of std::vector
llvm-svn: 54685
2008-08-12 15:44:31 +00:00
Duncan Sands
ceacf7d17b Point people to ConstantExpr and ConstantFolding,
in case they get the wrong idea.  Fit in 80 columns.

llvm-svn: 54676
2008-08-12 09:43:15 +00:00
Devang Patel
670f3a9e03 Use DenseMap to keep track of last users.
Use inversed map for faster queries.

llvm-svn: 54662
2008-08-12 00:26:16 +00:00
Chris Lattner
0e03352a9f add a helper method to sys::Path for clang, patch by
Kovarththanan Rajaratnam!

llvm-svn: 54655
2008-08-11 23:39:47 +00:00
Devang Patel
404762f720 Keep track of analysis usage information for passes. Avoid invoking
getAnalysisUsage() repeatedly.

llvm-svn: 54650
2008-08-11 21:13:39 +00:00
Duncan Sands
cac74d2a10 Make it possible to use different constant
folding policies with IRBuilder.  The default,
provided by ConstantFolder, is to do minimal
folding like now: what ConstantExpr provides.
An alternative is to use TargetFolder, which
uses target information to fold constants more.

llvm-svn: 54640
2008-08-11 15:29:30 +00:00
Chris Lattner
89120a8e63 "This patch adds a virtual call to AbstractLatticeFunction to derive a
type lattice value for an Argument*, giving clients the opportunity to
use something other than Top for it if they choose to."

Patch by John McCall!

llvm-svn: 54589
2008-08-09 17:23:35 +00:00
Duncan Sands
310343bae7 Unbreak the llvm-gcc build: recent changes to
IRBuilder are not expecting null names.

llvm-svn: 54581
2008-08-09 15:14:59 +00:00
Chris Lattner
270ee0cb58 Make 'Insert' set the name for Loads, instead of passing the name into the
LoadInst ctor, which causes std::string thrashing.

llvm-svn: 54577
2008-08-09 06:26:23 +00:00
Chris Lattner
64e06e8dac comment update
llvm-svn: 54576
2008-08-09 06:25:46 +00:00
Gordon Henriksen
78a53c516d Delete a redundant binding, LLVMHasInitializer.
Please use !LLVMIsDeclaration instead.

llvm-svn: 54572
2008-08-09 02:13:58 +00:00
Gordon Henriksen
b0ee2172b0 Fix the LLVMCreateJITCompiler C binding.
Evan broke it in r54523 by adding a parameter in the implementation without
updating the header correspondingly.

llvm-svn: 54555
2008-08-08 20:49:28 +00:00
Eric Christopher
dcd4752642 Have IRBuilder take a template argument on whether or not to preserve
names. This can save a lot of allocations if you aren't going to be
looking at the output.

llvm-svn: 54546
2008-08-08 19:39:37 +00:00
Anton Korobeynikov
8d77445753 Handle visibility printing with all generality. Remove bunch of duplicate code.
llvm-svn: 54540
2008-08-08 18:25:07 +00:00
Evan Cheng
804e157031 Undo most of r54519.
llvm-svn: 54534
2008-08-08 17:56:50 +00:00
Chris Lattner
a4e876cf8a Don't call getAnalysisUsage unless -debug-pass is enabled. This speeds
up the passmgr by avoiding useless work.

llvm-svn: 54528
2008-08-08 15:14:09 +00:00
Evan Cheng
054bbb0dd8 Add new parameter Fast to createJIT to enable the fast codegen path.
llvm-svn: 54523
2008-08-08 08:11:34 +00:00
Evan Cheng
4708df4776 It's not legal to output a GV in a coalesced section if it's used in an ARM PIC relative constantpool.
llvm-svn: 54519
2008-08-08 06:56:16 +00:00
Chris Lattner
c1ca63307d Speed up the passmgr by avoiding heap thrashing on vectors.
llvm-svn: 54515
2008-08-08 05:33:04 +00:00
Bruno Cardoso Lopes
2284374fcc Add the remaining fp_round libcalls:
FPROUND_F80_F32, FPROUND_PPCF128_F32, 
FPROUND_F80_F64, FPROUND_PPCF128_F64

Support for soften float fp_round operands is added, Mips 
needs this to round f64->f32.

Also added support to soften float FABS result, Mips doesn't 
support double fabs results while in 'single float only' mode.

llvm-svn: 54484
2008-08-07 19:01:24 +00:00
Matthijs Kooijman
2ba1b80c7f Silence a warning.
llvm-svn: 54462
2008-08-07 13:36:30 +00:00
Anton Korobeynikov
d3009663dd Provide convenient helpers
llvm-svn: 54451
2008-08-07 09:51:54 +00:00
Anton Korobeynikov
ebd773939c Add hook for constant pool section selection for darwin.
llvm-svn: 54449
2008-08-07 09:51:02 +00:00
Anton Korobeynikov
d37daa2aeb Select section for constant pool entries
llvm-svn: 54448
2008-08-07 09:50:34 +00:00
Matthijs Kooijman
7f69239612 Remove trailing spaces.
llvm-svn: 54447
2008-08-07 09:00:46 +00:00
Evan Cheng
f8a801a9b8 Factor code that finalize PHI nodes, jump tables, etc. out of SelectBasicBlock. No functionality changes.
llvm-svn: 54438
2008-08-07 00:43:25 +00:00
Dan Gohman
680de089b7 Clarify "node" vs. "value" in some comments.
llvm-svn: 54409
2008-08-06 15:18:10 +00:00
Dan Gohman
7323b8d744 Correct an assertion string.
llvm-svn: 54348
2008-08-05 14:42:28 +00:00
Owen Anderson
32ae9380f1 This option doesn't need to be a target option. It can be in SDISel instead.
llvm-svn: 54336
2008-08-05 00:27:28 +00:00
Owen Anderson
84fbc312d4 - Fix SelectionDAG to generate correct CFGs.
- Add a basic machine-level dead block eliminator.

These two have to go together, since many other parts of the code generator are unable to handle the unreachable blocks otherwise created.

llvm-svn: 54333
2008-08-04 23:54:43 +00:00
Bill Wendling
5aaf075b29 Removed unused parameters.
llvm-svn: 54262
2008-08-01 05:50:13 +00:00
Dale Johannesen
f669e7c14f Add a flag to disable jump table generation (all
switches use the binary search algorithm) for
environments that don't support it.  PPC64 JIT
is such an environment; turn the flag on for that.

llvm-svn: 54248
2008-07-31 18:13:12 +00:00
Dan Gohman
926a91d664 Move SelectionDAG::viewGraph() out of line; as an inline function
it isn't always visible to gdb.

llvm-svn: 54228
2008-07-30 18:48:53 +00:00
Matthijs Kooijman
782943a0ec Document BasicBlock::Create.
llvm-svn: 54210
2008-07-30 12:53:14 +00:00
Mon P Wang
fb483982f5 Added support for overloading intrinsics (atomics) based on pointers
to different address spaces.  This alters the naming scheme for those
intrinsics, e.g., atomic.load.add.i32 => atomic.load.add.i32.p0i32

llvm-svn: 54195
2008-07-30 04:36:53 +00:00
Matthijs Kooijman
6ef5a25c7f Add a GetElementPtrInst::getIndexedType that accepts uint64_t's instead of just Value*'s.
llvm-svn: 54157
2008-07-29 08:46:11 +00:00
Dan Gohman
ebe629a4b2 Revert 54147.
llvm-svn: 54148
2008-07-29 01:02:18 +00:00
Dan Gohman
1816900fd1 Add x86 isel patterns to match what would be a ZERO_EXTEND_INREG operation,
which is represented in codegen as an 'and' operation. This matches them
with movz instructions, instead of leaving them to be matched by and
instructions with an immediate field.

llvm-svn: 54147
2008-07-28 22:18:25 +00:00
Dan Gohman
9653b21dc2 Fold the useful features of alist and alist_node into ilist, and
a new ilist_node class, and remove them. Unlike alist_node,
ilist_node doesn't attempt to manage storage itself, so it avoids
the associated problems, including being opaque in gdb.

Adjust the Recycler class so that it doesn't depend on alist_node.
Also, change it to use explicit Size and Align parameters, allowing
it to work when the largest-sized node doesn't have the greatest
alignment requirement.

Change MachineInstr's MachineMemOperand list from a pool-backed
alist to a std::list for now.

llvm-svn: 54146
2008-07-28 21:51:04 +00:00
Dan Gohman
f8f44b4837 Reword a comment to be less ambiguous.
llvm-svn: 54135
2008-07-28 18:42:57 +00:00
Dan Gohman
7ae5bf35a2 Don't use reinterpret_cast when it isn't needed.
llvm-svn: 54130
2008-07-27 23:12:19 +00:00
Dan Gohman
9742f7772d Rename SDOperand to SDValue.
llvm-svn: 54128
2008-07-27 21:46:04 +00:00
Dan Gohman
47c5cdbc34 Tidy SDNode::use_iterator, and complete the transition to have it
parallel its analogue, Value::value_use_iterator. The operator* method
now returns the user, rather than the use.

llvm-svn: 54127
2008-07-27 20:43:25 +00:00
Dan Gohman
2a0bc8f6e1 Rename isOnlyUseOf to isOnlyUserOf.
llvm-svn: 54124
2008-07-27 18:06:42 +00:00
Dan Gohman
bdbaf4d128 Improve comments for SDNode use-count methods. No functionality change.
llvm-svn: 54123
2008-07-27 17:44:52 +00:00
Dan Gohman
c28f2265a4 Rename the version of CreateRet that's a convenience method for creating
multiple-valued return values, so that the name CreateRet is just for
creating plain ret statements.

llvm-svn: 54053
2008-07-25 20:36:15 +00:00
Duncan Sands
46a694af35 Fix error: ‘std::ostream’ has not been declared
when compiling with gcc 4.3.

llvm-svn: 54041
2008-07-25 19:29:14 +00:00
Nate Begeman
a6cdff50b0 Remove unnecessary implicit argument
llvm-svn: 54031
2008-07-25 17:56:27 +00:00
Nate Begeman
ce064348d9 Fix minor issues with VICmp/VFCmp constant expressions
llvm-svn: 54030
2008-07-25 17:35:37 +00:00
Nate Begeman
8757bedd41 Add predicate for GhostLinkage, used by the JIT
llvm-svn: 54027
2008-07-25 17:26:48 +00:00
Dan Gohman
1c8549fd7f Add a #include for the uses of uint64_t.
llvm-svn: 54016
2008-07-25 15:39:12 +00:00
Dan Gohman
3ede9e57a2 Add a #include <cassert>, since this file use assert.
llvm-svn: 54003
2008-07-25 00:44:19 +00:00
Dan Gohman
11a4531b1b Apply a patch from Mahadevan R, with minor formatting changes, to
workaround a GCC 3.3 bug observed on OpenBSD.

llvm-svn: 54002
2008-07-25 00:36:05 +00:00
Dan Gohman
680e1bd958 Enable rematerialization of constants using AliasAnalysis::pointsToConstantMemory,
and knowledge of PseudoSourceValues. This unfortunately isn't sufficient to allow
constants to be rematerialized in PIC mode -- the extra indirection is a
complication.

llvm-svn: 54000
2008-07-25 00:02:30 +00:00
Evan Cheng
e91c8c4508 Rename instance variables, parameter argument names to eliminate a bunch of compilation warnings with -Wshadow.
llvm-svn: 53970
2008-07-24 00:08:56 +00:00
Chris Lattner
e92598ef91 Make CreateBinOp/CreateNeg/CreateNot do constant folding.
llvm-svn: 53950
2008-07-23 06:58:10 +00:00
Dan Gohman
6564581be0 Enable first-class aggregates support.
Remove the GetResultInst instruction. It is still accepted in LLVM assembly
and bitcode, where it is now auto-upgraded to ExtractValueInst. Also, remove
support for return instructions with multiple values. These are auto-upgraded
to use InsertValueInst instructions.

The IRBuilder still accepts multiple-value returns, and auto-upgrades them
to InsertValueInst instructions.

llvm-svn: 53941
2008-07-23 00:34:11 +00:00
Owen Anderson
7b8947cc31 Change the heuristics used in the coalescer, register allocator, and within
live intervals itself to use an instruction count approximation that is 
not affected by inserting empty indices.

llvm-svn: 53937
2008-07-22 22:46:49 +00:00
Dan Gohman
b7d67aaa88 Add insertvalue and extractvalue folding support in IRBuilder.
llvm-svn: 53931
2008-07-22 20:19:25 +00:00
Dan Gohman
12c36eae69 IRBuilder support for insertvalue and extractvalue.
llvm-svn: 53926
2008-07-22 18:25:25 +00:00
Dan Gohman
7c7d8f931d Assert that the DAG root value is a chain value.
llvm-svn: 53925
2008-07-22 18:04:23 +00:00
Anton Korobeynikov
090eca95ab Tie small stuff to non-small by default on ELF platforms
llvm-svn: 53919
2008-07-22 17:09:41 +00:00
Bruno Cardoso Lopes
96ab649026 Basic support for small sections
llvm-svn: 53907
2008-07-22 15:26:53 +00:00
Bill Wendling
01f491daa7 Removing tabs.
llvm-svn: 53902
2008-07-22 07:14:12 +00:00
Dan Gohman
634b43862d Correct the name of MachineMemOperand's include guard.
llvm-svn: 53895
2008-07-22 00:52:54 +00:00
Dan Gohman
183bd17a66 InsertValue and ExtractValue constant expressions are always
folded. Remove code that handled the case where they aren't
folded, and remove bitcode reader/writer support for them.

llvm-svn: 53887
2008-07-21 23:30:30 +00:00
Dan Gohman
b024b0eedd Enhance the GraphWriter support for edge destinations, and teach the
SelectionDAG graph writer to make use of them. Now, nodes with multiple
values are displayed as such, with incoming edges pointing to the
specific value they use.

llvm-svn: 53875
2008-07-21 21:06:55 +00:00
Dan Gohman
b91bef08a7 Add titles to the various SelectionDAG viewGraph calls
that include useful information like the name of the
block being viewed and the current phase of compilation.

llvm-svn: 53872
2008-07-21 20:00:07 +00:00
Dan Gohman
8762ce04fd Make the GraphWriter be more consistent about the string
used for the graph "title" and the graph "label", as there
are differences in interpretation of these strings
between viewers.

llvm-svn: 53871
2008-07-21 19:57:57 +00:00
Duncan Sands
6e31474e71 Add VerifyNode, a place to put sanity checks on
generic SDNode's (nodes with their own constructors
should do sanity checking in the constructor).  Add
sanity checks for BUILD_VECTOR and fix all the places
that were producing bogus BUILD_VECTORs, as found by
"make check".  My favorite is the BUILD_VECTOR with
only two operands that was being used to build a
vector with four elements!

llvm-svn: 53850
2008-07-21 10:20:31 +00:00
Anton Korobeynikov
5c0eb7e991 Use generic ELFTargetAsmInfo and DarwinTargetAsmInfo for X86 code
llvm-svn: 53788
2008-07-19 13:15:21 +00:00
Anton Korobeynikov
5298428cff Add TargetAsmInfo stuff for all darwin-based targets
llvm-svn: 53787
2008-07-19 13:14:46 +00:00
Anton Korobeynikov
3724600253 Add TargetAsmInfo for all ELF-based targets
llvm-svn: 53786
2008-07-19 13:14:11 +00:00
Anton Korobeynikov
583ed0eb6e Remove bogus assertion. This unbreaks mingw, where ConstantSDNode
has alignment 8 and LoadSDNode (used as LargestT template) - 4.

llvm-svn: 53782
2008-07-19 05:52:44 +00:00
Dan Gohman
f38f99ccc5 Re-introduce LeakDetector support for MachineInstrs and MachineBasicBlocks.
Fix a leak that this turned up in LowerSubregs.cpp.
And, comment a leak in LiveIntervalAnalysis.cpp.

llvm-svn: 53746
2008-07-17 23:49:46 +00:00
Owen Anderson
cb787a2004 Make MergeBlockIntoPredecessor more aggressive when the same successor appears
more than once.

llvm-svn: 53731
2008-07-17 19:42:29 +00:00
Dan Gohman
8981962672 Add a new function, ReplaceAllUsesOfValuesWith, which handles bulk
replacement of multiple values. This is slightly more efficient
than doing multiple ReplaceAllUsesOfValueWith calls, and theoretically
could be optimized even further. However, an important property of this
new function is that it handles the case where the source value set and
destination value set overlap. This makes it feasible for isel to use
SelectNodeTo in many very common cases, which is advantageous because
SelectNodeTo avoids a temporary node and it doesn't require CSEMap
updates for users of values that don't change position.

Revamp MorphNodeTo, which is what does all the work of SelectNodeTo, to
handle operand lists more efficiently, and to correctly handle a number
of corner cases to which its new wider use exposes it.

This commit also includes a change to the encoding of post-isel opcodes
in SDNodes; now instead of being sandwiched between the target-independent
pre-isel opcodes and the target-dependent pre-isel opcodes, post-isel
opcodes are now represented as negative values. This makes it possible
to test if an opcode is pre-isel or post-isel without having to know
the size of the current target's post-isel instruction set.

These changes speed up llc overall by 3% and reduce memory usage by 10%
on the InstructionCombining.cpp testcase with -fast and -regalloc=local.

llvm-svn: 53728
2008-07-17 19:10:17 +00:00
Evan Cheng
d57da4e81f Indentation.
llvm-svn: 53727
2008-07-17 18:41:20 +00:00
Nate Begeman
af01bfff99 SSE codegen for vsetcc nodes
llvm-svn: 53719
2008-07-17 16:51:19 +00:00
Duncan Sands
41aeb22c1d Factorize some code for determining which libcall to use.
llvm-svn: 53713
2008-07-17 02:36:29 +00:00
Owen Anderson
7fb36c8bba Factor MergeBlockIntoPredecessor out into BasicBlockUtils.
llvm-svn: 53705
2008-07-17 00:01:40 +00:00
Devang Patel
a6c5ff690a Mark function used by asm block as used, otherwise optimizer may not see the use and may delete the function.
llvm-svn: 53692
2008-07-16 17:54:34 +00:00
Dan Gohman
7e1e10f7d2 Fix the name of BreakCriticalMachineEdge.h's include guard
llvm-svn: 53686
2008-07-16 16:04:07 +00:00
Dan Gohman
9f52e3890f Correct a top-level comment.
llvm-svn: 53685
2008-07-16 16:03:31 +00:00
Dan Gohman
dd8c0b17bf Clarify the comments here, to make slightly more clear the
difference in purpose of TargetInstrInfo and TargetInstrDesc,
which isn't immediately obvious from the name.

llvm-svn: 53683
2008-07-16 16:02:59 +00:00
Dan Gohman
2cd7961ade Tidy a doxygen comment.
llvm-svn: 53682
2008-07-16 15:59:56 +00:00
Dan Gohman
c4400b8618 SelectionDAG::AssignNodeIds is unused.
llvm-svn: 53636
2008-07-15 18:29:32 +00:00
Dan Gohman
e76fd33ee5 Reapply 53476 and 53480, with a fix so that it properly updates
the BB member to the current basic block after emitting
instructions.

llvm-svn: 53567
2008-07-14 18:19:29 +00:00
Chris Lattner
8a9725bffe Reapply r53540, now with the matching header!
llvm-svn: 53557
2008-07-14 17:32:59 +00:00
Chris Lattner
58fe3dee5a whitespace fix.
llvm-svn: 53537
2008-07-14 00:28:45 +00:00
Chris Lattner
f5c321c7fc doxygenate comments and wrap to 80 cols.
llvm-svn: 53536
2008-07-14 00:27:31 +00:00
Ted Kremenek
6efe7adf98 Inline typedef for alist_iterator::pointer to work with MSVC++.
llvm-svn: 53517
2008-07-12 18:28:46 +00:00
Nick Lewycky
0dae6f90bb operator[] is not defined for list::iterator. Overload it in ilist::iterator
to prevent silly things from happening accidentally. PR2171

llvm-svn: 53507
2008-07-12 07:00:52 +00:00
Evan Cheng
ebf7ff4531 Back out 53476 and 53480 for now. Somehow they cause llc to miscompile 179.art.
llvm-svn: 53502
2008-07-12 01:38:51 +00:00
Dan Gohman
bf47a27643 Add a utility function to MachineInstr for testing whether an instruction
has exactly one MachineMemOperand, and change some X86 lowering code to
make use of it.

llvm-svn: 53498
2008-07-12 00:10:52 +00:00
Dan Gohman
fee8b04935 Fix spelling of "hierarchy" in comments.
llvm-svn: 53489
2008-07-11 22:51:32 +00:00
Dan Gohman
0abdafa4f9 Fix typos in comments.
llvm-svn: 53487
2008-07-11 22:48:20 +00:00
Dan Gohman
4c18394001 Include a frame index in the "fixed stack" pseudo source value
instead of using the frame index for the SVOffset, which was
inconsistent.

llvm-svn: 53486
2008-07-11 22:44:52 +00:00
Ted Kremenek
d6dcdf8802 Minor tweaks to the ImmutableList iterator interface.
Added partial specialization of DenseMapInfo<T> for ImmutableList.

llvm-svn: 53485
2008-07-11 22:43:07 +00:00
Dan Gohman
6ee2195ab1 Add support for putting NamedRegionTimers in TimerGroups, and
use a timer group for the timers in SelectionDAGISel. Also,
Split scheduling out from emitting, to give each their own
timer.

llvm-svn: 53476
2008-07-11 21:54:34 +00:00
Dan Gohman
d1342570f2 Use find instead of lower_bound.
llvm-svn: 53474
2008-07-11 20:58:19 +00:00
Dan Gohman
d7a32ecde2 Trim unnecessary #includes.
llvm-svn: 53471
2008-07-11 20:38:31 +00:00
Duncan Sands
1e3fe05638 It is pointless to turn a UINT_TO_FP into an
SINT_TO_FP libcall plus additional operations:
it might as well be a direct UINT_TO_FP libcall.
So only turn it into an SINT_TO_FP if the target
has special handling for SINT_TO_FP.

llvm-svn: 53461
2008-07-11 17:00:14 +00:00
Duncan Sands
58130a26f4 Add two missing SINT_TO_FP libcalls.
llvm-svn: 53460
2008-07-11 16:57:02 +00:00
Duncan Sands
669d4d6909 Add support for 128 bit shifts and 32 bit shifts
on 16 bit machines.

llvm-svn: 53458
2008-07-11 16:52:29 +00:00
Ted Kremenek
4e5efc791c Make typedef public to make MSVC++ happy.
llvm-svn: 53433
2008-07-10 23:24:20 +00:00
Ted Kremenek
d2eef72ae9 Make some typedefs public to make MSVC++ happy.
llvm-svn: 53432
2008-07-10 23:09:45 +00:00
Ted Kremenek
9bd15119cd Make typedefs in ilist public (Visual C++ errors out when they are private).
llvm-svn: 53431
2008-07-10 22:58:10 +00:00
Bill Wendling
7e2acf0dc9 Pull r53428 from Gaz into mainline:
Remove warnings about unused/shadowed variables.

llvm-svn: 53430
2008-07-10 22:57:49 +00:00
Ted Kremenek
91171c5406 Added ImmutableMap constructor that accepts a const TreeTy*.
llvm-svn: 53429
2008-07-10 22:57:10 +00:00
Dan Gohman
c3f346dc55 Tidy up #includes.
llvm-svn: 53426
2008-07-10 22:26:19 +00:00
Dan Gohman
83d9009473 Add a SubclassData field to SDNode, similar to what's done
in Value, to make use of some otherwise unused space. Use this
field to shrink LoadSDNode and StoreSDNode by moving the
addressing mode and ext/trunc fields there.

llvm-svn: 53422
2008-07-10 21:44:59 +00:00
Dan Gohman
157e75d975 Fix a copy+pasto in an assertion string.
llvm-svn: 53419
2008-07-10 19:58:23 +00:00
Dan Gohman
b379840cf7 Stack objects have nonnegative indices, not just positive indices.
llvm-svn: 53418
2008-07-10 19:57:25 +00:00
Dan Gohman
bb0847c84c Escape the graph name. This unbreaks -view-cfg.
llvm-svn: 53417
2008-07-10 19:55:54 +00:00
Dan Gohman
2b9dccb286 Remove this file; the code that it went with is no longer
in the repository.

llvm-svn: 53416
2008-07-10 19:55:04 +00:00
Duncan Sands
a6c09579f0 Add support for 128 bit multiplicative operations.
Lack of these caused a bootstrap failure with Fortran
on x86-64 with LegalizeTypes turned on.  While there,
be nice to 16 bit machines and support expansion of
i32 too.

llvm-svn: 53408
2008-07-10 15:35:05 +00:00
Duncan Sands
90a916539d Add a mysteriously missing libcall, FPTOSINT_F80_I32.
Be nice to 16 bit machines by supporting FP_TO_XINT
expansion for these.

llvm-svn: 53407
2008-07-10 15:33:02 +00:00
Duncan Sands
e667a05fcb Correct a comment.
llvm-svn: 53401
2008-07-10 11:21:59 +00:00
Evan Cheng
3ec3113431 - Change the horrible N^2 isRegReDefinedByTwoAddr. Now callers must supply the operand index of def machineoperand and at most one full scan of non-implicit operands is needed.
- Change local register allocator to use the new isRegReDefinedByTwoAddr instead of reinventing the wheel.

llvm-svn: 53394
2008-07-10 07:35:43 +00:00
Chris Lattner
cd6afe938b add a helper method for code that wants to handle vector
constants by element without caring how they are formed.

llvm-svn: 53382
2008-07-10 00:28:34 +00:00
Evan Cheng
80f6966c7f - Replace use of std::map<std::string, ..> with StringMap. Replace use of std::map with DenseMap, std::set with SmallPtrSet. This results in minor speed up.
- Some code clean up.

llvm-svn: 53379
2008-07-10 00:04:23 +00:00
Dan Gohman
e10fc737ca Simplify hasNUsesOfValue and hasAnyUsesOfValue even more. This
makes their special-case checks of use_size() less beneficial,
so remove them. This eliminates all but one use of use_size(),
which is in AssignTopologicalOrder, which uses it only once for
each node, and so can reasonably afford to recompute it, as
this allows the UsesSize field of SDNode to be removed
altogether.

llvm-svn: 53377
2008-07-09 23:03:14 +00:00
Dan Gohman
679872b05f Move MemoryVT out of LSBaseNode into MemSDNode, allowing the
getMemOperand function to be moved into the base class as well
and made non-virtual.

llvm-svn: 53372
2008-07-09 22:08:04 +00:00
Dan Gohman
f6e651fcf2 Move the IsVolatile and SVOffset fields into the MemSDNode base
class, and store IsVolatile and Alignment in a more compact form.
This makes AtomicSDNode slightly larger, but it shrinks LoadSDNode
and StoreSDNode, which are much more common and are the largest of
the SDNode subclasses. Also, this lets the isVolatile() and
getAlignment() accessors be non-virtual.

llvm-svn: 53361
2008-07-09 21:23:02 +00:00
Anton Korobeynikov
80f0406385 Silence a warning
llvm-svn: 53326
2008-07-09 13:56:43 +00:00
Anton Korobeynikov
7b144cc108 Drop enum and use constants for SectionFlags
llvm-svn: 53325
2008-07-09 13:41:07 +00:00
Anton Korobeynikov
03614f247c First sketch of special section objects
llvm-svn: 53320
2008-07-09 13:28:49 +00:00
Anton Korobeynikov
3399dc61e5 Unbreak
llvm-svn: 53317
2008-07-09 13:27:37 +00:00
Anton Korobeynikov
1f697cd97b Another bunch of hacks for named sections support
llvm-svn: 53315
2008-07-09 13:26:52 +00:00
Anton Korobeynikov
933bf0ecc4 Add hacky way to distinguish named and named sections. This will be generalized in the future.
llvm-svn: 53311
2008-07-09 13:25:26 +00:00
Anton Korobeynikov
751cfda7dd Handle ELF mergeable sections
llvm-svn: 53306
2008-07-09 13:23:37 +00:00
Anton Korobeynikov
f42d75201a Provide general hook for section name calculation
llvm-svn: 53304
2008-07-09 13:22:46 +00:00
Anton Korobeynikov
c421fcddb4 Print entity size for mergeable sections
llvm-svn: 53303
2008-07-09 13:22:17 +00:00
Anton Korobeynikov
059999d321 Move flag decoding stuff into special hook
llvm-svn: 53297
2008-07-09 13:20:07 +00:00
Anton Korobeynikov
ca271dd426 Properly handle linkonce stuff
llvm-svn: 53296
2008-07-09 13:19:38 +00:00
Anton Korobeynikov
782a69505d Provide skeletone code for calculation of section, where global should be emitted into
llvm-svn: 53295
2008-07-09 13:19:08 +00:00
Anton Korobeynikov
c150d11dbd Make hooks virtual
llvm-svn: 53293
2008-07-09 13:18:21 +00:00
Anton Korobeynikov
5bc572ad96 Add default section name resolution routine
llvm-svn: 53292
2008-07-09 13:18:02 +00:00
Anton Korobeynikov
552675bb0f Constify
llvm-svn: 53291
2008-07-09 13:17:36 +00:00
Anton Korobeynikov
651865851c Add code for default section falgs computation
llvm-svn: 53290
2008-07-09 13:16:59 +00:00
Chris Lattner
b650adae49 Add a little wrapper header that is put around bc files when emitting
bc files for modules with a target triple that indicates they are for
darwin.  The reader unconditionally handles this, and the writer could
turn this on for more targets if we care.

This change has two benefits for darwin:

1) it allows us to encode the cpu type of the file in an easy to read
   place that doesn't require decoding the bc file.
2) it works around a bug (IMO) in darwin's AR where it is incapable of
   handling files that are not a multiple of 8 bytes long.  BC files
   are only guaranteed to be multiples of 4 bytes long.

llvm-svn: 53275
2008-07-09 05:14:23 +00:00
Nick Lewycky
86adf455bd Remove getValueRange from SCEV. It wasn't doing anything there anyways, and a
more complete version is now available from the LoopVR pass.

llvm-svn: 53269
2008-07-09 03:21:51 +00:00
Dan Gohman
2e23cd5a18 const-ify SelectionDAG::getNodeValueTypes.
llvm-svn: 53264
2008-07-09 00:00:42 +00:00
Dan Gohman
5b24b3baef Factor out the code for computing an alignment value, and make it
available to getAtomic in addition to just getLoad and getStore,
to prevent MachineMemOperands with 0 alignment.

llvm-svn: 53261
2008-07-08 23:46:32 +00:00
Dan Gohman
e2169bec88 The graph name really does matter for configurations that use gv.
llvm-svn: 53259
2008-07-08 23:33:46 +00:00
Evan Cheng
6af015292e Unbreak C++ tests on x86 Darwin.
llvm-svn: 53237
2008-07-08 16:40:43 +00:00
Duncan Sands
65028bf60d Add some helpers for manipulating function
parameter attributes.

llvm-svn: 53228
2008-07-08 09:41:30 +00:00
Matthijs Kooijman
4cf0a68307 Add CallSite::getArgumentNo() to be able to translate an operand number into a
argument number.

llvm-svn: 53225
2008-07-08 08:51:47 +00:00
Matthijs Kooijman
8aaa85f108 Add CallSite::getArgumentOffset() to hide the differences in operands betwen
Call and Invoke in a single method instead of having it hardcoded in multiple
places.

llvm-svn: 53224
2008-07-08 08:50:32 +00:00
Duncan Sands
b854603cb5 Add some convenience methods for manipulating
call attributes.

llvm-svn: 53223
2008-07-08 08:38:44 +00:00
Nick Lewycky
9cecc07bec Expand SCEVUDiv of power of 2 to a lshr instruction.
llvm-svn: 53217
2008-07-08 05:05:37 +00:00
Evan Cheng
5be1103646 Avoid unnecessary string construction during asm printing.
llvm-svn: 53215
2008-07-08 00:55:58 +00:00
Dan Gohman
cd25487258 Pool-allocation for MachineInstrs, MachineBasicBlocks, and
MachineMemOperands. The pools are owned by MachineFunctions.

This drastically reduces the number of calls to malloc/free made
during the "Emit" phase of scheduling, as well as later phases
in CodeGen. Combined with other changes, this speeds up the
"instruction selection" phase of CodeGen by 10% in some cases.

llvm-svn: 53212
2008-07-07 23:14:23 +00:00
Dan Gohman
93e0208361 Pool-allocation for SDNodes. The pool is allocated once for each function,
and reused across SelectionDAGs.

This drastically reduces the number of calls to malloc/free made during
instruction selection, and improves memory locality.

llvm-svn: 53211
2008-07-07 23:02:41 +00:00
Dan Gohman
60e964b34c Add some basic Pool-allocation infrastructure. This adds a Recycler class,
for handling bookkeeping for deleted objects, as well as the alist class
template, for keeping lists of objects allocated from Recyclers, and some
related utilities.

llvm-svn: 53210
2008-07-07 22:58:06 +00:00
Bill Wendling
d7da49634d Use StringMap for greater justice!
llvm-svn: 53202
2008-07-07 20:59:31 +00:00
Dan Gohman
d787dcfa3d Fix SDNode::MorphNodeTo (a function used by by SelectNodeTo) to
properly track dead nodes that are on the original SDNode's operand
list but not the new one, and have no other uses.

llvm-svn: 53201
2008-07-07 20:57:48 +00:00
Dan Gohman
255eb1d296 Move MachineMemOperand's constructor out of line, to avoid a
#include dependency on Support/MathExtras.h in the header file.

llvm-svn: 53200
2008-07-07 20:32:02 +00:00
Dan Gohman
f2b95cb24f Shrink MachineMemOperand by storing the alignment in log form
and rearranging the fields.

llvm-svn: 53195
2008-07-07 20:05:04 +00:00
Dan Gohman
1834981eb0 Make ilist noncopyable too.
llvm-svn: 53190
2008-07-07 18:43:32 +00:00
Dan Gohman
fca9922b1b Don't use std::advance just to increment or decrement by one.
llvm-svn: 53189
2008-07-07 18:39:33 +00:00
Dan Gohman
ddcc08e98f Make BumpPtrAllocator noncopyable.
llvm-svn: 53188
2008-07-07 18:38:14 +00:00
Dan Gohman
68abfdf98d Add a space between * and /* to help simple-minded lexers.
llvm-svn: 53187
2008-07-07 18:34:27 +00:00
Dan Gohman
d263602463 Remove most of the uses of SDOperandPtr, usually replacing it with a
simple const SDOperand*, which is what's usually needed.

For AddNodeIDOperands, which is small, just duplicate the function to
accept an SDUse*.

For SelectionDAG::getNode - Add an overload that accepts SDUse* that
copies the operands into a temporary SDOperand array, but also has
special-case checks for 0 through 3 operands to avoid the copy in
the common cases.

llvm-svn: 53183
2008-07-07 18:26:29 +00:00
Dan Gohman
dd9c91e583 Remove uses of "llvm/Support/Debug.h" from LLVM include files, which
all happened be unnecessary.

llvm-svn: 53182
2008-07-07 18:14:29 +00:00
Dan Gohman
3755664b6d Remove unnecessary static_casts.
llvm-svn: 53181
2008-07-07 18:08:20 +00:00
Dan Gohman
9112a5463e Remove an unnecessary reinterpret_cast.
llvm-svn: 53180
2008-07-07 18:07:36 +00:00
Dan Gohman
955fdc7a4c Add explicit keywords.
llvm-svn: 53179
2008-07-07 18:00:37 +00:00
Dan Gohman
c97817aac3 Make DenseMap's insert return a pair, to more closely resemble std::map.
llvm-svn: 53177
2008-07-07 17:46:23 +00:00
Ted Kremenek
1d321b8875 Removed ImmutableMap::SlimFind and replaced it with ImmutableMap::lookup. The new method does the same thing, except that it returns a pointer to the mapped data type, and not to an internal tree node.
llvm-svn: 53171
2008-07-07 16:20:55 +00:00
Duncan Sands
0caf597378 LegalizeTypes soft-float support for stores of a
float value.

llvm-svn: 53165
2008-07-07 00:08:12 +00:00
Anton Korobeynikov
47e1a76977 Add convenient helper for checking whether global is weak in linker sense
having weak or linkonce or common or extweak LLVM linkage.

llvm-svn: 53158
2008-07-05 23:48:30 +00:00
Nick Lewycky
e85e0b1bbc 80col
llvm-svn: 53153
2008-07-05 22:41:37 +00:00
Mon P Wang
a43d6758ac Fixed generating incorrect aligned stores that I backout of r53031
that fixed problems in EmitStackConvert where the source and target type
have different alignment by creating a stack slot with the max
alignment of source and target type.

llvm-svn: 53150
2008-07-05 20:40:31 +00:00
Duncan Sands
3ea6f15708 Rather than having a different custom legalization
hook for each way in which a result type can be
legalized (promotion, expansion, softening etc),
just use one: ReplaceNodeResults, which returns
a node with exactly the same result types as the
node passed to it, but presumably with a bunch of
custom code behind the scenes.  No change if the
new LegalizeTypes infrastructure is not turned on.

llvm-svn: 53137
2008-07-04 11:47:58 +00:00
Duncan Sands
aac5c915ed Linux also does not require exception handling
moves in order to get correct debug info.  Since
I can't imagine how any target could possibly
be any different, I've just stripped out the
option: now all the world's like Darwin!

llvm-svn: 53134
2008-07-04 09:55:48 +00:00
Bill Wendling
e3ad6f2249 Don't return std::vector by value, but pass it in by reference to be filled.
llvm-svn: 53123
2008-07-03 23:13:02 +00:00
Bill Wendling
2c9a84d788 Revert my previous check-in that split up MachineModuleInfo. It turns out to
slow the compiler down at -O0 some 30% or more. Ooops.

llvm-svn: 53120
2008-07-03 22:53:42 +00:00
Devang Patel
af72f3b02e Provide a hook to set the code generation debug options to investigate lto failures.
llvm-svn: 53119
2008-07-03 22:53:14 +00:00
Evan Cheng
01e53a3406 Backed out 53031.
llvm-svn: 53110
2008-07-03 18:20:14 +00:00
Evan Cheng
1f6148a84c - Remove calls to copyKillDeadInfo which is an N^2 function. Instead, propagate kill / dead markers as new instructions are constructed in foldMemoryOperand, convertToThressAddress, etc.
- Also remove LiveVariables::instructionChanged, etc. Replace all calls with cheaper calls which update VarInfo kill list.

llvm-svn: 53097
2008-07-03 09:09:37 +00:00
Dan Gohman
9c78662057 Use operator new instead of new char[].
llvm-svn: 53067
2008-07-03 00:59:36 +00:00
Evan Cheng
7c3920e692 - Add LiveVariables::replaceKillInstruction. This does a subset of instructionChanged. That is, it only update the VarInfo.kills if the new instruction is known to have the correct dead and kill markers.
- CommuteInstruction copies kill / dead markers over to new instruction. So use replaceKillInstruction instead.

llvm-svn: 53061
2008-07-03 00:07:19 +00:00
Owen Anderson
604f9f722d Make LiveVariables even more optional, by making it optional in the call to TargetInstrInfo::convertToThreeAddressInstruction
Also, if LV isn't around, then TwoAddr doesn't need to be updating flags, since they won't have been set in the first place.

llvm-svn: 53058
2008-07-02 23:41:07 +00:00
Dan Gohman
741cda0ac8 Replace a few uses of SelectionDAG::getTargetNode with
SelectionDAG::SelectNodeTo in the instruction selector. This
updates existing nodes in place instead of creating new ones.

Go back to selecting ISD::DBG_LABEL nodes into
TargetInstrInfo::DBG_LABEL nodes instead of leaving them
unselected, now that SelectNodeTo allows us to update them
in place.

llvm-svn: 53057
2008-07-02 23:23:19 +00:00
Eric Christopher
4c3e39e220 Add a couple more helper functions to deal with
creating global constant strings and pointers
to global constant strings.

llvm-svn: 53051
2008-07-02 22:57:59 +00:00
Mon P Wang
f8524c5deb Make the default min align of CreateStackTemporary to be 1
llvm-svn: 53036
2008-07-02 17:50:10 +00:00
Duncan Sands
21e2a711e3 Add a new getMergeValues method that does not need
to be passed the list of value types, and use this
where appropriate.  Inappropriate places are where
the value type list is already known and may be
long, in which case the existing method is more
efficient.

llvm-svn: 53035
2008-07-02 17:40:58 +00:00
Owen Anderson
dd29406f31 Have DenseSet::insert return a bool indicating whether the insertion succeeded or not.
llvm-svn: 53033
2008-07-02 17:29:59 +00:00
Mon P Wang
55f4371807 Fixed problem in EmitStackConvert where the source and target type
have different alignment by creating a stack slot with the max
alignment of source and target type.

llvm-svn: 53031
2008-07-02 17:07:12 +00:00
Chris Lattner
441571cc05 optimize StringMap::clear
llvm-svn: 53009
2008-07-02 05:30:45 +00:00
Chris Lattner
06545d1c4a Add a new (simple) StringMap::clear method, patch by Pratik
Solanki!

llvm-svn: 53008
2008-07-02 05:26:32 +00:00
Bill Wendling
aa45e38a17 Sorry. I couldn't sleep at night knowing I put these ugly casts into the source tree.
llvm-svn: 53001
2008-07-02 00:35:47 +00:00
Ted Kremenek
41502657f7 Implemented operator!= for the ImmutableList iterator.
llvm-svn: 52998
2008-07-02 00:06:55 +00:00
Owen Anderson
1530481dd3 Add a version of AddString that takes a const char* so we can avoid extraneous
conversions to std::string.

llvm-svn: 52995
2008-07-01 23:49:59 +00:00
Bill Wendling
27c38cee90 Darwin doesn't need exception handling information for the "move" info when
debug information is being output, because it's leet!

llvm-svn: 52994
2008-07-01 23:34:48 +00:00
Evan Cheng
5389352c98 Avoid creating expensive comment string if it's not going to be printed.
llvm-svn: 52992
2008-07-01 23:18:29 +00:00
Ted Kremenek
0b662363f9 Added partial specialization of FoldingSetTrait for pointers.
llvm-svn: 52989
2008-07-01 22:30:13 +00:00
Bill Wendling
c695823456 - Update comments.
- Don't use GlobalVariable::LinkageTypes when unsigned works.

llvm-svn: 52987
2008-07-01 22:08:01 +00:00
Devang Patel
51aec7ffb8 Fix dom tree compare. Don't forget to compare children!
llvm-svn: 52984
2008-07-01 21:41:00 +00:00
Owen Anderson
8564cd9dfe Add a version of AsmPrinter::EOL that takes a const char* so that we don't have to do as many implicit std::string constructions.
Unfortunately, this doesn't appear to translate to a real speedup in practice.

llvm-svn: 52981
2008-07-01 21:16:27 +00:00
Devang Patel
0fc2badc38 Fix typos in comments.
Thanks for the feedback!

llvm-svn: 52978
2008-07-01 19:50:56 +00:00
Evan Cheng
915253ddda DAGSize should not be public.
llvm-svn: 52977
2008-07-01 18:49:06 +00:00
Dan Gohman
83c1b4cede Prune a few dependencies on MachineFunction.h.
llvm-svn: 52976
2008-07-01 18:15:35 +00:00
Dan Gohman
ca864de95a Make ilist_traits<MachineBasicBlock>'s Parent member private.
llvm-svn: 52974
2008-07-01 18:13:58 +00:00
Dan Gohman
9d5c1f8b60 Fix apostrophes in a comment.
llvm-svn: 52972
2008-07-01 18:12:31 +00:00
Evan Cheng
67ce381ffe Do not use computationally expensive scheduling heuristics with -fast.
llvm-svn: 52971
2008-07-01 18:05:03 +00:00
Devang Patel
1e1f4a0bdd Add dom info verifier.
llvm-svn: 52967
2008-07-01 17:44:24 +00:00
Owen Anderson
fe73cb09c8 Make the subregister hashtable output more readable by wrapping the lines,
and mark it const along with the associated changes to TargetRegisterInfo.

llvm-svn: 52966
2008-07-01 17:34:38 +00:00
Owen Anderson
9e88ac84bf Implement suggestions from Chris:
- Use a more accurate heuristic for the size of the hashtable.
  - Use bitwise and instead of modulo since the size is a power of two.
  - Use new[] instead of malloc().

llvm-svn: 52951
2008-07-01 07:02:30 +00:00
Seo Sanghyeon
0b4c1205fb Compilation fix
llvm-svn: 52950
2008-07-01 05:27:28 +00:00
Owen Anderson
059d64938b Replace the dynamically computed std::set lookup method for subregisters with a hashtable-based
version that is computed by tblgen at the time LLVM is compiled.

llvm-svn: 52945
2008-07-01 00:18:52 +00:00
Dan Gohman
c8097f8c8c Split ISD::LABEL into ISD::DBG_LABEL and ISD::EH_LABEL, eliminating
the need for a flavor operand, and add a new SDNode subclass,
LabelSDNode, for use with them to eliminate the need for a label id
operand.

Change instruction selection to let these label nodes through
unmodified instead of creating copies of them. Teach the MachineInstr
emitter how to emit a MachineInstr directly from an ISD label node.

This avoids the need for allocating SDNodes for the label id and
flavor value, as well as SDNodes for each of the post-isel label,
label id, and label flavor.

llvm-svn: 52943
2008-07-01 00:05:16 +00:00
Dan Gohman
081848d881 Make SmallVector's grow use memcpy in common cases
instead of std::uninitialized_copy, which uses memmove.

llvm-svn: 52928
2008-06-30 21:45:13 +00:00
Dan Gohman
06ca992a01 Use plain operator new instead of new char[].
llvm-svn: 52927
2008-06-30 21:33:02 +00:00
Dan Gohman
e58f07e5d6 Update comments to new-style syntax.
llvm-svn: 52925
2008-06-30 21:00:56 +00:00
Dan Gohman
6cc648891b Rename ISD::LOCATION to ISD::DBG_STOPPOINT to better reflect its
purpose, and give it a custom SDNode subclass so that it doesn't
need to have line number, column number, filename string, and
directory string, all existing as individual SDNodes to be the
operands.

This was the only user of ISD::STRING, StringSDNode, etc., so
remove those and some associated code.

This makes stop-points considerably easier to read in
-view-legalize-dags output, and reduces overhead (creating new
nodes and copying std::strings into them) on code containing
debugging information.

llvm-svn: 52924
2008-06-30 20:59:49 +00:00
Evan Cheng
3f664b6fd3 Split scheduling from instruction selection.
llvm-svn: 52923
2008-06-30 20:45:06 +00:00
Ted Kremenek
834afcfdcd Added some comments and some cleanups.
llvm-svn: 52922
2008-06-30 20:41:22 +00:00
Dan Gohman
a44757308c Reorder the fields in TargetLowering to require less padding.
llvm-svn: 52919
2008-06-30 20:36:26 +00:00
Dan Gohman
7c7639816b Change bools to 1-bit bitfields to shrink ArgListEntry slightly.
llvm-svn: 52918
2008-06-30 20:33:57 +00:00
Dan Gohman
295abfe228 Replace some std::vectors that showed up in heap profiling with
SmallVectors. Change the signature of TargetLowering::LowerArguments
to avoid returning a vector by value, and update the two targets
which still use this directly, Sparc and IA64, accordingly.

llvm-svn: 52917
2008-06-30 20:31:15 +00:00
Owen Anderson
8d6d17cd2c Add an isReachableFromEntry method.
llvm-svn: 52916
2008-06-30 20:28:02 +00:00