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

6587 Commits

Author SHA1 Message Date
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