Dan Gohman
dfa422fe9e
In -view-sunit-dags, display "special" chain dependencies as cyan
...
instead of blue to distinguish them from regular dependencies.
llvm-svn: 49696
2008-04-14 23:15:07 +00:00
Dan Gohman
14dce3e51c
Teach AliasSetTracker about VAArgInst.
...
llvm-svn: 49674
2008-04-14 18:34:50 +00:00
Dan Gohman
8d46278998
Fix const-correctness issues with the SrcValue handling in the
...
memory intrinsic expansion code.
llvm-svn: 49666
2008-04-14 17:55:48 +00:00
Dale Johannesen
edcba1161f
Reverse sense of unwind-tables option. This means
...
stack tracebacks on Darwin x86-64 won't work by default;
nevertheless, everybody but me thinks this is a good idea.
llvm-svn: 49663
2008-04-14 17:54:17 +00:00
Dan Gohman
237a69b49c
Clean up some comments.
...
llvm-svn: 49661
2008-04-14 17:45:20 +00:00
Chris Lattner
f63bdaf0b5
add a new CallGraphNode::removeCallEdgeFor method, tidy some comments.
...
llvm-svn: 49617
2008-04-13 19:41:25 +00:00
Chris Lattner
f5e5f92891
Add support for equality comparison of CallSite's.
...
llvm-svn: 49616
2008-04-13 19:40:26 +00:00
Nicolas Geoffray
ad5556e8ba
Add a divided flag for the first piece of an argument divided into mulitple parts. Fixes PR1643
...
llvm-svn: 49611
2008-04-13 13:40:22 +00:00
Duncan Sands
c5f548f784
Merge LLVMBuilder and FoldingBuilder, calling
...
the result IRBuilder. Patch by Dominic Hamon.
llvm-svn: 49604
2008-04-13 06:22:09 +00:00
Dan Gohman
15edbf989f
Drop ISD::MEMSET, ISD::MEMMOVE, and ISD::MEMCPY, which are not Legal
...
on any current target and aren't optimized in DAGCombiner. Instead
of using intermediate nodes, expand the operations, choosing between
simple loads/stores, target-specific code, and library calls,
immediately.
Previously, the code to emit optimized code for these operations
was only used at initial SelectionDAG construction time; now it is
used at all times. This fixes some cases where rep;movs was being
used for small copies where simple loads/stores would be better.
This also cleans up code that checks for alignments less than 4;
let the targets make that decision instead of doing it in
target-independent code. This allows x86 to use rep;movs in
low-alignment cases.
Also, this fixes a bug that resulted in the use of rep;stos for
memsets of 0 with non-constant memory size when the alignment was
at least 4. It's better to use the library in this case, which
can be significantly faster when the size is large.
This also preserves more SourceValue information when memory
intrinsics are lowered into simple loads/stores.
llvm-svn: 49572
2008-04-12 04:36:06 +00:00
Evan Cheng
b389b78462
Use of implicit_def is not part of live interval. Create empty intervals for the uses when the live interval is being spilled.
...
llvm-svn: 49542
2008-04-11 17:53:36 +00:00
Chris Lattner
01e31663c8
improvements for IntrusiveRefCntPtr, patch by Mikhail Glushenkov
...
llvm-svn: 49538
2008-04-11 16:42:06 +00:00
Evan Cheng
52208a738f
Allow registers defined by implicit_def to be clobbered.
...
llvm-svn: 49512
2008-04-10 23:47:53 +00:00
Dan Gohman
aa52f1c5b0
Fix a typo in a comment.
...
llvm-svn: 49502
2008-04-10 22:27:06 +00:00
Dan Gohman
b3a511b236
Make isVectorClearMaskLegal's operand list const.
...
llvm-svn: 49446
2008-04-09 20:09:42 +00:00
Dan Gohman
b05ea92f80
Fix some minor errors in comments.
...
llvm-svn: 49445
2008-04-09 20:08:06 +00:00
Dan Gohman
0586403622
Add const qualifiers.
...
llvm-svn: 49443
2008-04-09 18:31:41 +00:00
Dan Gohman
f03c4d87c0
Update comments to use 2.0 syntax type names.
...
llvm-svn: 49442
2008-04-09 18:24:25 +00:00
Chris Lattner
02cc33d0ad
ConstantFP::get should be static.
...
llvm-svn: 49434
2008-04-09 17:16:28 +00:00
Owen Anderson
ca7e0e21f3
Factor a bunch of functionality related to memcpy and memset transforms out of
...
GVN and into its own pass.
llvm-svn: 49419
2008-04-09 08:23:16 +00:00
Evan Cheng
94983505c5
Unbreak teh build.
...
llvm-svn: 49417
2008-04-09 07:06:01 +00:00
Chris Lattner
9d4d2f566e
add a version of ConstantFP::get that doesn't take a redundant Type* value,
...
start migrating code over to use it.
llvm-svn: 49413
2008-04-09 00:45:01 +00:00
Chris Lattner
6e11e1a381
make ConstantFP::isExactlyValue work for long double as well.
...
llvm-svn: 49410
2008-04-09 00:03:58 +00:00
Devang Patel
f08f0a6de6
Add CreateGetResult()
...
llvm-svn: 49398
2008-04-08 20:41:22 +00:00
Devang Patel
dd9f2ea01f
Add multiple value return instruction constructor.
...
llvm-svn: 49374
2008-04-08 07:30:13 +00:00
Duncan Sands
f86399a00f
Convenience method for setting the nounwind
...
attribute for a function.
llvm-svn: 49373
2008-04-08 07:23:58 +00:00
Dale Johannesen
ec0fe04044
Implement new llc flag -disable-required-unwind-tables.
...
Corresponds to -fno-unwind-tables (usually default in gcc).
llvm-svn: 49361
2008-04-08 00:10:24 +00:00
Ted Kremenek
be2279d470
Make getDirnameSep a static method (not part of Path's interface).
...
llvm-svn: 49354
2008-04-07 22:01:32 +00:00
Ted Kremenek
82b7e8d306
Added method Path::getDirname().
...
llvm-svn: 49352
2008-04-07 21:53:57 +00:00
Sam Bishop
41916aad58
Added support for Create() calls that take an argument besides the
...
deserializer.
llvm-svn: 49350
2008-04-07 21:36:46 +00:00
Dan Gohman
d7301ea935
Rename MemOperand to MachineMemOperand. This was suggested by
...
review feedback from Chris quite a while ago. No functionality
change.
llvm-svn: 49348
2008-04-07 19:35:22 +00:00
Owen Anderson
4ad5a5201c
Add operator= implementations to SparseBitVector, allowing it to be used in GVN. This results
...
in both time and memory savings for GVN. For example, one testcase went from 10.5s to 6s with
this patch.
llvm-svn: 49345
2008-04-07 17:38:23 +00:00
Roman Levenstein
b40d332929
Re-commit of the r48822, where the infinite looping problem discovered
...
by Dan Gohman is fixed.
llvm-svn: 49330
2008-04-07 10:06:32 +00:00
Owen Anderson
93ab00f1d9
Make GVN more memory efficient, particularly on code that contains a large number of
...
allocations, which GVN can't optimize anyways.
llvm-svn: 49329
2008-04-07 09:59:07 +00:00
Gabor Greif
6c6b8a57f3
API changes for class Use size reduction, wave 1.
...
Specifically, introduction of XXX::Create methods
for Users that have a potentially variable number of
Uses.
llvm-svn: 49277
2008-04-06 20:25:17 +00:00
Evan Cheng
9045e3dd2f
Forgot this.
...
llvm-svn: 49247
2008-04-05 02:17:58 +00:00
Duncan Sands
9931451472
If a value is cast to its own type, then the cast
...
is not needed.
llvm-svn: 49210
2008-04-04 08:28:13 +00:00
Chris Lattner
0891662a49
Make ExecutionEngine::updateGlobalMapping return the old mapping.
...
llvm-svn: 49206
2008-04-04 04:47:41 +00:00
Ted Kremenek
2184f6cc1d
Add member template version of SerializeTrait<T>::Create that also accepts
...
an optional argument for us by T's Create method.
llvm-svn: 49169
2008-04-03 16:44:37 +00:00
Evan Cheng
ff9c1655de
Special handling of zero-sized live intervals.
...
llvm-svn: 49167
2008-04-03 16:40:27 +00:00
Evan Cheng
6250bfbd3e
- Treat a live range defined by an implicit_def as a zero-sized one.
...
- Eliminate an implicit_def when it's being spilled.
llvm-svn: 49166
2008-04-03 16:39:43 +00:00
Evan Cheng
53c8db51dd
Start of a series of patches related to implicit_def.
...
There is no point in creating a long live range defined by an implicit_def. Scheduler now duplicates implicit_def instruction for each of its uses. Therefore, if an implicit_def node has multiple uses, it will become a number of very short live ranges, rather than a long one. This will make coalescer's job easier.
llvm-svn: 49164
2008-04-03 16:36:07 +00:00
Evan Cheng
497c607fae
Backing out 48222 temporarily.
...
llvm-svn: 49124
2008-04-03 03:13:16 +00:00
David Greene
0ca05878fe
Iterators folloring a SmallVector erased element are invalidated so
...
don't access cached iterators from after the erased element.
Re-apply 49056 with SmallVector support.
llvm-svn: 49106
2008-04-02 18:24:46 +00:00
Evan Cheng
748a0c9215
Now that I am told MachineRegisterInfo also tracks physical register uses / defs, I can do away with the horribleness I introduced a while back. It's impossible to detect if there is any use of a physical register below an instruction (and before any def of the register) with some cheap book keeping.
...
llvm-svn: 49105
2008-04-02 18:04:08 +00:00
Evan Cheng
4e841d67ed
Remove #include<map> from LiveVariables.h. Not referenced.
...
llvm-svn: 49099
2008-04-02 17:23:50 +00:00
Torok Edwin
b96b953a5c
Add new file Support/DataFlow.h.
...
It allows Use-Def and Def-Use relations to be treated as graphs.
llvm-svn: 49088
2008-04-02 14:57:52 +00:00
Anton Korobeynikov
d3330dfbf6
Add new CC lowering rule: provide a list of registers, which can be 'shadowed',
...
when some another register is used for argument passing.
Currently is used on Win64.
llvm-svn: 49079
2008-04-02 05:23:57 +00:00
Dale Johannesen
79633a914f
Recommitting EH patch; this should answer most of the
...
review feedback.
-enable-eh is still accepted but doesn't do anything.
EH intrinsics use Dwarf EH if the target supports that,
and are handled by LowerInvoke otherwise.
The separation of the EH table and frame move data is,
I think, logically figured out, but either one still
causes full EH info to be generated (not sure how to
split the metadata correctly).
MachineModuleInfo::needsFrameInfo is no longer used and
is removed.
llvm-svn: 49064
2008-04-02 00:25:04 +00:00
Chris Lattner
d141d16ed7
Change the MemoryBuffer::getFile* methods to take just a pointer to the
...
start of a filename, not a filename+length. All clients can produce a
null terminated name, and the system api's require null terminated
strings anyway.
llvm-svn: 49041
2008-04-01 18:04:03 +00:00
Chris Lattner
4614369b45
MappedFile is dead, remove it.
...
llvm-svn: 49035
2008-04-01 06:20:44 +00:00
Chris Lattner
2e3d2c6ec8
Stub out some sys::Path::MapInFilePages/UnMapFilePages methods.
...
llvm-svn: 49030
2008-04-01 06:00:12 +00:00
Chris Lattner
5ba3ea7b4c
change the archive stuff to use MemoryBuffer instead of mappedfile.
...
MemoryBuffer is higher level and more closely matches the model
needed.
llvm-svn: 49029
2008-04-01 04:26:46 +00:00
Chris Lattner
a638713d10
prune unneeded #includes
...
llvm-svn: 49028
2008-04-01 04:00:45 +00:00
Chris Lattner
9f1dcb3372
rewrite SourceFile to be in terms of MemoryBuffer, not MappedFile.
...
llvm-svn: 49027
2008-04-01 03:59:34 +00:00
Chris Lattner
0ee9b20a1b
Make MappedFile::map return a const correct pointer, don't leak address space on Unix platforms.
...
llvm-svn: 49026
2008-04-01 03:49:38 +00:00
Chris Lattner
b29e4e90bc
Remove the MappedFile::charBase member, rename base -> getBase() and
...
make getBase() return a const-correct pointer.
llvm-svn: 49025
2008-04-01 03:40:53 +00:00
Chris Lattner
50d56e0f2b
add an accessor.
...
llvm-svn: 49023
2008-04-01 03:20:31 +00:00
Chris Lattner
f2309c208a
Remove MappedFile support for mapping files for write and exec
...
and shared. This complicates the design, is not used, and probably
doesn't even work.
llvm-svn: 49022
2008-04-01 03:10:22 +00:00
Chris Lattner
b04ab612bf
remove extraneous #include
...
llvm-svn: 49021
2008-04-01 03:01:15 +00:00
Chris Lattner
c7cc29f2a9
update comment.
...
llvm-svn: 49010
2008-04-01 00:54:39 +00:00
Chris Lattner
c3d03d3f10
cleanup the MappedFile API and comments. This removes and updates
...
tons of out of date comments (really nothing throws here!) and fixes
some other fairly glaring issues: "size" used to return the size of
the file *and* change it, depending on how you called it.
llvm-svn: 49009
2008-04-01 00:53:25 +00:00
Chris Lattner
a0b425c6bc
remove DEFINING_FILE_FOR for MappedFile.h
...
llvm-svn: 49008
2008-04-01 00:35:55 +00:00
Evan Cheng
38a755499d
Move reMaterialize() from TargetRegisterInfo to TargetInstrInfo.
...
llvm-svn: 48995
2008-03-31 20:40:39 +00:00
Torok Edwin
348c0b39a0
test commit
...
llvm-svn: 48984
2008-03-31 17:09:58 +00:00
Erick Tryzelaar
847ee3e279
Expose Function::viewCFG and Function::viewCFGOnly to bindings.
...
llvm-svn: 48982
2008-03-31 16:22:09 +00:00
Chris Lattner
49e9edd6f6
Fix "Control reaches the end of non-void function" warnings,
...
patch by David Chisnall.
llvm-svn: 48963
2008-03-30 18:22:13 +00:00
Evan Cheng
4d86275d23
Cosmetic change.
...
llvm-svn: 48935
2008-03-29 01:04:05 +00:00
Duncan Sands
80f14df923
Rename getAnyLoad to getLoad is suggested by Evan.
...
llvm-svn: 48914
2008-03-28 09:45:24 +00:00
Duncan Sands
3d613421f1
Implement LegalizeTypes support for softfloat LOAD.
...
In order to handle indexed nodes I had to introduce
a new constructor, and since I was there I factorized
the code in the various load constructors.
llvm-svn: 48894
2008-03-27 20:23:40 +00:00
Dan Gohman
199ab29337
Avoid creating chain dependencies from CopyToReg nodes to load and store
...
nodes. This doesn't currently have much impact the generated code, but it
does produce simpler-looking SelectionDAGs, and consequently
simpler-looking ScheduleDAGs, because there are fewer spurious
dependencies.
In particular, CopyValueToVirtualRegister now uses the entry node as the
input chain dependency for new CopyToReg nodes instead of calling getRoot
and depending on the most recent memory reference.
Also, rename UnorderedChains to PendingExports and pull it up from being
a local variable in SelectionDAGISel::BuildSelectionDAG to being a
member variable of SelectionDAGISel, so that it doesn't have to be
passed around to all the places that need it.
llvm-svn: 48893
2008-03-27 19:56:19 +00:00
Chris Lattner
7f9e824685
when a node is removed from an ilist, set its next/prev pointers to
...
null. This means that uses of invalidated iterators will explode violently
with:
ilist:143: failed assertion `NodePtr && "++'d off the end of an ilist!"'
instead of happening to work "most of the time".
llvm-svn: 48859
2008-03-27 02:43:03 +00:00
Erick Tryzelaar
0efea4df76
Expose ExecutionEngine::getTargetData() to c and ocaml bindings.
...
llvm-svn: 48851
2008-03-27 00:27:14 +00:00
Dale Johannesen
4524d3a1d1
Fix a bug in Darwin EH: FDE->CIE pointer must
...
be relocatable. Describe why .set is needed better.
llvm-svn: 48848
2008-03-26 23:31:39 +00:00
Roman Levenstein
55b8822511
Use a linked data structure for the uses lists of an SDNode, just like
...
LLVM Value/Use does and MachineRegisterInfo/MachineOperand does.
This allows constant time for all uses list maintenance operations.
The idea was suggested by Chris. Reviewed by Evan and Dan.
Patch is tested and approved by Dan.
On normal use-cases compilation speed is not affected. On very big basic
blocks there are compilation speedups in the range of 15-20% or even better.
llvm-svn: 48822
2008-03-26 12:39:26 +00:00
Dan Gohman
2b96ce84aa
Add explicit keywords.
...
llvm-svn: 48801
2008-03-25 22:06:05 +00:00
Dan Gohman
22002efa15
A quick nm audit turned up several fixed tables and objects that were
...
marked read-write. Use const so that they can be allocated in a
read-only segment.
llvm-svn: 48800
2008-03-25 21:45:14 +00:00
Devang Patel
71f3156ea3
Add optimize-for-size knob.
...
llvm-svn: 48793
2008-03-25 21:02:35 +00:00
Bill Wendling
d098d38269
De-constify the input to the "operator >>" method as it is modified.
...
Patch by dekruijf@cs.wisc.edu !
llvm-svn: 48782
2008-03-25 18:16:52 +00:00
Sam Bishop
752e0f8fad
Make a note of the fact that EmitOwnedPtr() has nothing to do with the
...
OwningPtr<> class.
llvm-svn: 48763
2008-03-25 04:41:18 +00:00
Owen Anderson
e540be453a
Revert r48676. I had plans for using it, but now it's just dead code.
...
llvm-svn: 48743
2008-03-24 21:29:58 +00:00
Dan Gohman
a55da994b0
Remove an unnecessary #include.
...
llvm-svn: 48729
2008-03-24 16:58:44 +00:00
Dan Gohman
fec60bb357
Shrink the size of AllocationInst by using its SubclassData
...
field to store the alignment value instead of haing a
separate field.
llvm-svn: 48727
2008-03-24 16:55:58 +00:00
Evan Cheng
d01a2a18f8
Increasing the inline limit from (overly conservative) 200 to 300. Given each BB costs 20 and each instruction costs 5, 200 means a 4 BB function + 24 instructions (actually less because caller's size also contributes to it).
...
Furthermore, double the limit when more than 10% of the callee instructions are vector instructions. Multimedia kernels tend to love inlining.
llvm-svn: 48725
2008-03-24 06:37:48 +00:00
Gordon Henriksen
52f3a08237
Objective Caml bindings for basic block, function, global, and arg iterators.
...
llvm-svn: 48711
2008-03-23 22:21:29 +00:00
Anton Korobeynikov
bd6711c1c9
Use C-style comments :)
...
llvm-svn: 48705
2008-03-23 13:44:17 +00:00
Anton Korobeynikov
261bddcbeb
Add first proof-of-concept universal compiler driver framework based
...
on ideas mentioned in PR686.
Written by Mikhail Glushenkov and contributed by Codedgers, Inc.
Old llvmc will be removed soon after new one will have all its properties.
llvm-svn: 48699
2008-03-23 08:57:20 +00:00
Anton Korobeynikov
f858d272a8
Typo fixes
...
llvm-svn: 48681
2008-03-22 07:48:08 +00:00
Owen Anderson
de2d3aca1b
Add a comment, and fix a bug where AllocateRW recurred to AllocateRWX instead of itself.
...
llvm-svn: 48677
2008-03-22 02:59:54 +00:00
Owen Anderson
5654dda62c
Add an AllocateRW to match AllocateRWX.
...
llvm-svn: 48676
2008-03-22 02:33:53 +00:00
Evan Cheng
874aee2eec
Teach DAG combiner to commute commutable binary nodes in order to achieve sdisel CSE.
...
llvm-svn: 48673
2008-03-22 01:55:50 +00:00
Dan Gohman
a363ba510c
Don't include <map> in Pass.h, which doesn't need it. This requires
...
adding <map> to many files that actually do need it.
llvm-svn: 48667
2008-03-21 23:51:57 +00:00
Dan Gohman
479c8ef76d
Specialize FORCE_DEFINING_FILE_TO_BE_LINKED using a GCC trick
...
to avoid using constructor calls for static objects. This reduces
the number of objects requiring static constructors in a typical
LLVM build by around 20%.
llvm-svn: 48665
2008-03-21 23:38:23 +00:00
Andrew Lenharth
2ff2bcbde8
FunctionExtractorPass has been superceded by GVExtractorPass
...
llvm-svn: 48648
2008-03-21 16:46:53 +00:00
Duncan Sands
a53967843f
Make it possible to get an empty struct using
...
the new StructType::get method. The second NULL
is to pacify the gcc warning mechanism. This
patch compiles but is otherwise untested.
llvm-svn: 48645
2008-03-21 15:53:17 +00:00
Duncan Sands
4153fc30c9
Introduce a new node for holding call argument
...
flags. This is needed by the new legalize types
infrastructure which wants to expand the 64 bit
constants previously used to hold the flags on
32 bit machines. There are two functional changes:
(1) in LowerArguments, if a parameter has the zext
attribute set then that is marked in the flags;
before it was being ignored; (2) PPC had some bogus
code for handling two word arguments when using the
ELF 32 ABI, which was hard to convert because of
the bogusness. As suggested by the original author
(Nicolas Geoffray), I've disabled it for the moment.
Tested with "make check" and the Ada ACATS testsuite.
llvm-svn: 48640
2008-03-21 09:14:45 +00:00
Evan Cheng
4ae9fee64c
Undo 48570. Correctly match mmx shift instructions with an immediate operand.
...
llvm-svn: 48627
2008-03-21 00:40:09 +00:00
Gordon Henriksen
dca0a5c5dc
C and Objective Caml bindings for mem2reg and reg2mem.
...
Patch by Erick Tryzelaar.
llvm-svn: 48602
2008-03-20 17:16:03 +00:00
Nick Lewycky
3903f2f24e
ubyte and sbyte? what are those?
...
llvm-svn: 48585
2008-03-20 06:19:51 +00:00
Evan Cheng
6f729b2820
Add intrinsics to match mmx shift builtin's with immediate operand.
...
llvm-svn: 48569
2008-03-19 23:38:52 +00:00
Devang Patel
5e8cbbea65
PassInfo keep tracks whether a pass is an analysis pass or not.
...
llvm-svn: 48554
2008-03-19 21:56:59 +00:00
Duncan Sands
486fdbb67f
Fix comment.
...
llvm-svn: 48543
2008-03-19 10:59:59 +00:00
Chris Lattner
1642451cf7
add some convenience methods for creating GEP instructions and
...
struct types. Patch by David Chisnall, with some tweaks.
llvm-svn: 48531
2008-03-19 05:06:05 +00:00
Gordon Henriksen
e4b3339de8
C bindings for Module-, Function-, and BasicBlock::iterator.
...
llvm-svn: 48528
2008-03-19 03:47:18 +00:00
Gordon Henriksen
15006d5da0
C and Objective Caml bindings for the various getParent methods of the IR.
...
Based on Erick Tryzelaar's patch.
llvm-svn: 48523
2008-03-19 01:11:35 +00:00
Evan Cheng
3d9309c11d
Fix live variables issues:
...
1. If part of a register is re-defined, an implicit kill and an implicit def are added to denote read / mod / write. However, this should only be necessary if the register is actually read later. This is a performance issue.
2. If a sub-register is being defined, and it doesn't have a previous use, do not add a implicit kill to the last use of a super-register:
= EAX, AX<imp-use,kill>
...
AX =
In this case, EAX is live but AX is killed, this is wrong and will cause the coalescer to do bad things.
llvm-svn: 48521
2008-03-19 00:52:20 +00:00
Devang Patel
38f181fa8c
Do not use virtual function to identify an analysis pass.
...
llvm-svn: 48520
2008-03-19 00:48:41 +00:00
Scott Michel
889ee011f7
Dial down gcc's warnings: don't use 0UL when 0U suffices (and when the
...
variables and methods themselves only use unsigned.)
llvm-svn: 48492
2008-03-18 16:55:06 +00:00
Dale Johannesen
4d0221c45b
Get rid of compilation warnings. Per Devang.
...
llvm-svn: 48478
2008-03-18 01:52:17 +00:00
Devang Patel
811ca3ddba
Identify Analysis pass.
...
Do not run analysis pass again if analysis info is still available.
This fixes PR1441.
llvm-svn: 48476
2008-03-18 00:39:19 +00:00
Nate Begeman
f50ef51ded
__builtin_ia32_movntdqa reads memory
...
llvm-svn: 48431
2008-03-16 21:15:47 +00:00
Gordon Henriksen
04a60ddcd2
C and Objective Caml bindings for the TargetData class.
...
llvm-svn: 48422
2008-03-16 20:08:03 +00:00
Gordon Henriksen
8c33afc50c
C and Objective Caml bindings for several scalar transforms.
...
Patch originally by Erick Tryzelaar, but has been modified somewhat.
llvm-svn: 48419
2008-03-16 16:32:40 +00:00
Gordon Henriksen
b7259e6e65
Remove unnecessary includes.
...
llvm-svn: 48418
2008-03-16 15:55:43 +00:00
Gordon Henriksen
caeafc4911
C and Objective Caml bindings for PassManagers.
...
llvm-svn: 48413
2008-03-16 04:20:44 +00:00
Christopher Lamb
b4f4b41048
Make insert_subreg a two-address instruction, vastly simplifying LowerSubregs pass. Add a new TII, subreg_to_reg, which is like insert_subreg except that it takes an immediate implicit value to insert into rather than a register.
...
llvm-svn: 48412
2008-03-16 03:12:01 +00:00
Evan Cheng
9af68f56c5
Remove isImplicitDef TargetInstrDesc flag.
...
llvm-svn: 48381
2008-03-15 00:19:36 +00:00
Evan Cheng
11d2c09adc
Replace all target specific implicit def instructions with a target independent one: TargetInstrInfo::IMPLICIT_DEF.
...
llvm-svn: 48380
2008-03-15 00:03:38 +00:00
Gordon Henriksen
7ebaba8579
Expose Module::dump via C and Ocaml.
...
Patch by Erick Tryzelaar.
llvm-svn: 48379
2008-03-14 23:58:56 +00:00
Gabor Greif
6ff874e81c
move the Use destructor where it belongs to
...
llvm-svn: 48376
2008-03-14 22:03:02 +00:00
Evan Cheng
b49600c090
Back out r48353. Not needed.
...
llvm-svn: 48375
2008-03-14 22:01:01 +00:00
Chris Lattner
b549d83ca6
Restore this member, which is used on win32.
...
llvm-svn: 48372
2008-03-14 21:17:54 +00:00
Dan Gohman
37a26f973f
Update comments; getPassName no longer uses RTTI.
...
llvm-svn: 48369
2008-03-14 18:27:04 +00:00
Dan Gohman
9ca724cee0
Move the PMStack class out of Pass.h and into PassManagers.h.
...
llvm-svn: 48367
2008-03-14 18:14:29 +00:00
Evan Cheng
98eaed9fbc
Add an MO_Undef MachineOperandType, intended for INSERT_SUBREG. Next up MO_Undead.
...
llvm-svn: 48353
2008-03-14 01:47:49 +00:00
Evan Cheng
d466e7a521
Forgot this.
...
llvm-svn: 48349
2008-03-14 00:17:29 +00:00
Dan Gohman
89e8681ac5
Fix a typo in a comment.
...
llvm-svn: 48345
2008-03-13 23:04:27 +00:00
Devang Patel
2c38efe128
Remove unused GetAddressOfSymbol()
...
Thanks Daniel Dunbar!
llvm-svn: 48340
2008-03-13 16:55:34 +00:00
Christopher Lamb
0f1c32eb63
Get rid of a pseudo instruction and replace it with subreg based operation on real instructions, ridding the asm printers of the hack used to do this previously. In the process, update LowerSubregs to be careful about eliminating copies that have side affects.
...
Note: the coalescer will have to be careful about this too, when it starts coalescing insert_subreg nodes.
llvm-svn: 48329
2008-03-13 05:47:01 +00:00
Chris Lattner
a14cdebdd9
move a bunch of trivial methods to be inline.
...
llvm-svn: 48326
2008-03-13 05:00:21 +00:00
Chris Lattner
d4a9aafc3f
Various improvements suggested by Duncan
...
llvm-svn: 48325
2008-03-13 04:33:03 +00:00
Evan Cheng
a3b56a661c
Improve VarInfo::removeKill() by using std::find instead of linear search.
...
llvm-svn: 48321
2008-03-13 02:42:55 +00:00
Dan Gohman
abf6c9aa1d
Change PMTopLevelManager's PassManagers vector element type from
...
Pass* to PMDataManager*. PMDataManager is more specific than Pass,
so this more accurately describes the objects that are being stored.
This eliminates the need for several dynamic_casts to PMDataManager*.
It does introduce one dynamic_cast though, in dumpPasses(). Give
this one a comment describing why a dynamic_cast is being used.
llvm-svn: 48315
2008-03-13 01:48:32 +00:00
Dan Gohman
70f4b55e3f
Change PMStack::push to accept a PMDataManager* instead of
...
a Pass*. PMDataManager* is what it actually holds, so this
makes it clearer.
llvm-svn: 48314
2008-03-13 01:21:31 +00:00
Dan Gohman
6c18f26790
Fix a typo in a comment.
...
llvm-svn: 48313
2008-03-13 01:08:50 +00:00
Dan Gohman
339b887ff6
No need for typedefs with enums in C++.
...
llvm-svn: 48312
2008-03-13 01:07:53 +00:00
Evan Cheng
b9fc5d6d07
Refactor some code out of MachineSink into a MachineInstr query.
...
llvm-svn: 48311
2008-03-13 00:44:09 +00:00
Evan Cheng
620fd19798
Experimental scheduler change to schedule / coalesce the copies added for function livein's. Take 2008-03-10-RegAllocInfLoop.ll, the schedule looks like this after these copies are inserted:
...
entry: 0x12049d0, LLVM BB @0x1201fd0, ID#0:
Live Ins: %EAX %EDX %ECX
%reg1031<def> = MOVPC32r 0
%reg1032<def> = ADD32ri %reg1031, <es:_GLOBAL_OFFSET_TABLE_>, %EFLAGS<imp-def>
%reg1028<def> = MOV32rr %EAX
%reg1029<def> = MOV32rr %EDX
%reg1030<def> = MOV32rr %ECX
%reg1027<def> = MOV8rm %reg0, 1, %reg0, 0, Mem:LD(1,1) [0x1201910 + 0]
%reg1025<def> = MOV32rr %reg1029
%reg1026<def> = MOV32rr %reg1030
%reg1024<def> = MOV32rr %reg1028
The copies unnecessarily increase register pressure and it will end up requiring a physical register to be spilled.
With -schedule-livein-copies:
entry: 0x12049d0, LLVM BB @0x1201fa0, ID#0:
Live Ins: %EAX %EDX %ECX
%reg1031<def> = MOVPC32r 0
%reg1032<def> = ADD32ri %reg1031, <es:_GLOBAL_OFFSET_TABLE_>, %EFLAGS<imp-def>
%reg1024<def> = MOV32rr %EAX
%reg1025<def> = MOV32rr %EDX
%reg1026<def> = MOV32rr %ECX
%reg1027<def> = MOV8rm %reg0, 1, %reg0, 0, Mem:LD(1,1) [0x12018e0 + 0]
Much better!
llvm-svn: 48307
2008-03-12 22:19:41 +00:00
Duncan Sands
05eb212b2d
Don't try to extract an i32 from an f64. This
...
getCopyToParts problem was noticed by the new
LegalizeTypes infrastructure. In order to avoid
this kind of thing in the future I've added a
check that EXTRACT_ELEMENT is only used with
integers. Once LegalizeTypes is up and running
most likely BUILD_PAIR and EXTRACT_ELEMENT can
be removed, in favour of using apints instead.
llvm-svn: 48294
2008-03-12 20:30:08 +00:00
Chris Lattner
7925cc72c0
Reimplement the parameter attributes support, phase #1 . hilights:
...
1. There is now a "PAListPtr" class, which is a smart pointer around
the underlying uniqued parameter attribute list object, and manages
its refcount. It is now impossible to mess up the refcount.
2. PAListPtr is now the main interface to the underlying object, and
the underlying object is now completely opaque.
3. Implementation details like SmallVector and FoldingSet are now no
longer part of the interface.
4. You can create a PAListPtr with an arbitrary sequence of
ParamAttrsWithIndex's, no need to make a SmallVector of a specific
size (you can just use an array or scalar or vector if you wish).
5. All the client code that had to check for a null pointer before
dereferencing the pointer is simplified to just access the
PAListPtr directly.
6. The interfaces for adding attrs to a list and removing them is a
bit simpler.
Phase #2 will rename some stuff (e.g. PAListPtr) and do other less
invasive changes.
llvm-svn: 48289
2008-03-12 17:45:29 +00:00
Evan Cheng
59831b0358
Document an implementation detail about EXTRACT_SUBREG and INSERT_SUBREG sub-register operand.
...
llvm-svn: 48283
2008-03-12 07:52:15 +00:00
Dan Gohman
8e3c88c4e9
Use PassManagerBase instead of FunctionPassManager for functions
...
that merely add passes. This allows them to be used with either
FunctionPassManager or PassManager, or even with a custom new
kind of pass manager.
llvm-svn: 48256
2008-03-11 22:29:46 +00:00
Anton Korobeynikov
38bc6e43f7
Add helper for ultimate aliasee resoltion
...
llvm-svn: 48255
2008-03-11 22:28:56 +00:00
Devang Patel
5f5912ba27
Fix getOperand() for ReturnInst.
...
llvm-svn: 48229
2008-03-11 17:35:03 +00:00
Dan Gohman
2b0112a65a
Give PassManager and FunctionPassManager a common base class, with
...
add(Pass *) as a pure virtual member function. This will allow all
the various addPassesTo* functions in LLVM to avoid hard-coding what
type of PassManager is used.
llvm-svn: 48226
2008-03-11 16:41:42 +00:00
Evan Cheng
af1c76846d
When the register allocator runs out of registers, spill a physical register around the def's and use's of the interval being allocated to make it possible for the interval to target a register and spill it right away and restore a register for uses. This likely generates terrible code but is before than aborting.
...
llvm-svn: 48218
2008-03-11 07:19:34 +00:00
Dan Gohman
67aed9bbb0
Implement more support for fp-to-i128 and i128-to-fp conversions.
...
llvm-svn: 48189
2008-03-10 23:03:31 +00:00
Evan Cheng
067ecbc341
Revert 48125, 48126, and 48130 for now to unbreak some x86-64 tests.
...
llvm-svn: 48167
2008-03-10 19:31:26 +00:00
Dale Johannesen
2bbe0d95cf
Use uint64_t not unsigned long long.
...
llvm-svn: 48154
2008-03-10 17:05:01 +00:00
Scott Michel
bb8e8fca47
Give TargetLowering::getSetCCResultType() a parameter so that ISD::SETCC's
...
return ValueType can depend its operands' ValueType.
This is a cosmetic change, no functionality impacted.
llvm-svn: 48145
2008-03-10 15:42:14 +00:00
Christopher Lamb
32e5ce3d96
Allow insert_subreg into implicit, target-specific values.
...
Change insert/extract subreg instructions to be able to be used in TableGen patterns.
Use the above features to reimplement an x86-64 pseudo instruction as a pattern.
llvm-svn: 48130
2008-03-10 06:12:08 +00:00
Dale Johannesen
e6b0009792
Increase ISD::ParamFlags to 64 bits. Increase the ByValSize
...
field to 32 bits, thus enabling correct handling of ByVal
structs bigger than 0x1ffff. Abstract interface a bit.
Fixes gcc.c-torture/execute/pr23135.c and
gcc.c-torture/execute/pr28982b.c in gcc testsuite (were ICE'ing
on ppc32, quietly producing wrong code on x86-32.)
llvm-svn: 48122
2008-03-10 02:17:22 +00:00
Nick Lewycky
50c8d20ca2
Update the block cloner which fixes bugpoint on code using unwind_to (phew!)
...
and also update the cloning interface's major user, the loop optimizations.
llvm-svn: 48088
2008-03-09 05:24:34 +00:00
Nick Lewycky
c64eb33c52
Two things. Preserve the unwind_to when splitting a BB.
...
Add the ability to remove just one instance of a BB from a phi node. This fixes
the compile error in the tree now.
llvm-svn: 48085
2008-03-09 05:04:48 +00:00
Nick Lewycky
e13db2c263
Not all users of a BB are Instructions any more.
...
llvm-svn: 48047
2008-03-08 07:48:41 +00:00
Dan Gohman
8ff072e188
Remove unused runPass methods.
...
llvm-svn: 48044
2008-03-08 01:43:56 +00:00
Evan Cheng
dba1dfe962
Implement x86 support for @llvm.prefetch. It corresponds to prefetcht{0|1|2} and prefetchnta instructions.
...
llvm-svn: 48042
2008-03-08 00:58:38 +00:00
Dan Gohman
e2d3f86306
There is no killUse.
...
llvm-svn: 48034
2008-03-07 22:24:41 +00:00
Devang Patel
494c61fd20
Add new sretpromotion pass.
...
llvm-svn: 48032
2008-03-07 21:07:34 +00:00
Devang Patel
a96cf89c33
RetVal is not used when there are more then one return operands.
...
llvm-svn: 48022
2008-03-07 20:08:07 +00:00
Andrew Lenharth
6c788376e9
add a pass that can extract all kinds of global values, not just functions. Update llvm-extract to use it and optionally extract a global variable if you want it too
...
llvm-svn: 48015
2008-03-07 19:51:57 +00:00
Gordon Henriksen
5da39fa644
Cleanup some comments in the OCaml bindings.
...
Patch by Erick Tryzelaar.
llvm-svn: 48014
2008-03-07 19:13:06 +00:00
Bill Wendling
b33eee09d2
When setting the "unused" info, take into account something like this:
...
%r3<def> = OR %x3<kill>, %x3
We don't want to mark the %r3 as unused even though it's a sub-register of %x3.
llvm-svn: 48003
2008-03-06 23:22:43 +00:00
Gabor Greif
d746841e93
fix typos
...
llvm-svn: 47994
2008-03-06 10:36:00 +00:00
Nick Lewycky
5f274047bd
Treat BBs that use BBs as proper predecessors and successors in the CFG.
...
llvm-svn: 47989
2008-03-06 06:54:53 +00:00
Dale Johannesen
8322b6fb70
Clarify that CALLSEQ_START..END may not be nested,
...
and add some protection against creating such.
llvm-svn: 47957
2008-03-05 19:14:03 +00:00
Evan Cheng
e0b3c221ab
Add a target lowering hook to control whether it's worthwhile to compress fp constant.
...
For x86, if sse2 is available, it's not a good idea since cvtss2sd is slower than a movsd load and it prevents load folding. On x87, it's important to shrink fp constant since fldt is very expensive.
llvm-svn: 47931
2008-03-05 01:30:59 +00:00
Dan Gohman
b987fe16e4
Codegen support for i128 SINT_TO_FP.
...
llvm-svn: 47928
2008-03-05 01:08:17 +00:00
Evan Cheng
18064ddb5b
Refactor code. Remove duplicated functions that basically do the same thing as
...
findRegisterUseOperandIdx, findRegisterDefOperandIndx. Fix some naming inconsistencies.
llvm-svn: 47927
2008-03-05 00:59:57 +00:00
Devang Patel
26d0fac377
Revert SmallVector ctor variants.
...
llvm-svn: 47908
2008-03-04 21:54:56 +00:00
Devang Patel
27426dedc0
Add FunctionType ctor variant that takes SmallVector params.
...
llvm-svn: 47895
2008-03-04 18:57:05 +00:00
Evan Cheng
acb7d77409
Fix 80 column violations.
...
llvm-svn: 47877
2008-03-04 03:19:19 +00:00
Evan Cheng
b5b16810ac
Rename isOperand() to isOperandOf() (and other similar methods). It always confuses me.
...
llvm-svn: 47872
2008-03-04 00:41:45 +00:00
Bill Wendling
8d64999daf
This is the initial check-in for adding register scavenging to PPC. (Currently,
...
PPC-64 doesn't work.) This also lowers the spilling of the CR registers so that
it uses a register other than the default R0 register (the scavenger scrounges
for one). A significant part of this patch fixes how kill information is
handled.
llvm-svn: 47863
2008-03-03 22:19:16 +00:00
Devang Patel
d0d7028a2b
s/isReturnStruct()/hasStructRetAttr()/g
...
llvm-svn: 47857
2008-03-03 21:46:28 +00:00
Chris Lattner
5b84600196
Stub out a Path::GetMainExecutable call to find the path to the
...
main executable of a program. This needs to be implemented on windows.
llvm-svn: 47835
2008-03-03 02:55:43 +00:00
Chris Lattner
d1fc75add0
make operand accessors const-correct
...
llvm-svn: 47814
2008-03-02 05:32:05 +00:00
Chris Lattner
ffde7a642a
Add a new ShuffleVectorInst::getMaskValue method.
...
llvm-svn: 47813
2008-03-02 05:28:33 +00:00
Nick Lewycky
b02fe64d8b
Add an unwind_to field to basic blocks, making them Users instead of Values.
...
This is the first checkin for PR1269, the new EH infrastructure.
llvm-svn: 47802
2008-03-02 02:48:09 +00:00
Dale Johannesen
cfd005f2ea
Add MVT::is128BitVector and is64BitVector. Shrink
...
unaligned load/store code using them. Per review
of unaligned load/store vector patch.
llvm-svn: 47782
2008-03-01 03:40:57 +00:00
Devang Patel
cb72d92471
Add pass to promote sret.
...
This pass transforms
%struct._Point = type { i32, i32, i32, i32, i32, i32 }
define internal void @foo(%struct._Point* sret %agg.result)
into
%struct._Point = type { i32, i32, i32, i32, i32, i32 }
define internal %struct._Point @foo()
This pass updates foo() clients appropriately to use
getresult instruction to extract return values.
This pass is not yet ready for prime time.
llvm-svn: 47776
2008-02-29 23:34:08 +00:00
Anton Korobeynikov
875da2420a
Use enumeration for preffered EH dwarf encoding reason
...
llvm-svn: 47770
2008-02-29 22:09:08 +00:00
Evan Cheng
5beb036eab
Don't fill eh frames even though these are text sections.
...
llvm-svn: 47765
2008-02-29 19:36:59 +00:00
Dan Gohman
2b8022a8c6
Add support to APInt for shift and rotate operations with APInt
...
instead of uint32_t for the shift/rotate count operand type.
llvm-svn: 47741
2008-02-29 01:40:47 +00:00
Dan Gohman
45a26a462f
Add a method to APFloat to convert directly from APInt.
...
llvm-svn: 47738
2008-02-29 01:26:11 +00:00
Dale Johannesen
310201ba32
Interface of getByValTypeAlignment differed between
...
generic & x86 versions; change generic to follow x86
and improve comments. Add PPC version (not right
for non-Darwin.)
llvm-svn: 47734
2008-02-28 22:31:51 +00:00
Duncan Sands
6a4acca399
Document that the shuffle mask may contain undef
...
values.
llvm-svn: 47719
2008-02-28 17:12:11 +00:00
Evan Cheng
f8b1257d2e
Add a quick and dirty "loop aligner pass". x86 uses it to align its loops to 16-byte boundaries.
...
llvm-svn: 47703
2008-02-28 00:43:03 +00:00
Devang Patel
351830e819
Remove dead code.
...
llvm-svn: 47700
2008-02-27 23:33:51 +00:00
Anton Korobeynikov
7bd4b77e30
Preparation step for some cleanup/generalization in EH information emission:
...
provide TAI hook for selection of EH data emission format. Currently unused.
llvm-svn: 47699
2008-02-27 23:33:50 +00:00
Anton Korobeynikov
ecfe55a801
Assert on invalid PHINode::addIncoming() arguments. Patch by Erick Tryzelaar!
...
llvm-svn: 47697
2008-02-27 22:37:28 +00:00
Nick Kledzik
f32192eb76
fixes from review of first commit
...
llvm-svn: 47695
2008-02-27 22:25:36 +00:00
Evan Cheng
da92e34fe3
Fix a bug in dead spill slot elimination.
...
llvm-svn: 47687
2008-02-27 19:57:11 +00:00
Dan Gohman
0cfccf801d
Add -analyze support to postdomtree.
...
llvm-svn: 47680
2008-02-27 18:38:29 +00:00
Duncan Sands
cadfe810f3
LegalizeTypes support for INSERT_VECTOR_ELT.
...
llvm-svn: 47669
2008-02-27 10:18:23 +00:00
Evan Cheng
295ae42ede
Don't track max alignment during stack object allocations since they can be deleted later. Let PEI compute it.
...
llvm-svn: 47668
2008-02-27 10:04:56 +00:00
Bill Wendling
2cae66e28b
Final de-tabification.
...
llvm-svn: 47663
2008-02-27 06:33:05 +00:00
Chris Lattner
d2a01e1994
Add path separator support, patch by Sam Bishop.
...
llvm-svn: 47662
2008-02-27 06:17:10 +00:00
Evan Cheng
7553230e3a
Spiller now remove unused spill slots.
...
llvm-svn: 47657
2008-02-27 03:04:06 +00:00
Dan Gohman
938e74654b
Convert the last remaining users of the non-APInt form of
...
ComputeMaskedBits to use the APInt form, and remove the
non-APInt form.
llvm-svn: 47654
2008-02-27 01:23:58 +00:00