Owen Anderson
6c7beb1748
Didn't mean to commit this.
...
llvm-svn: 45607
2008-01-05 00:43:37 +00:00
Owen Anderson
4cce45354c
Didn't mean to commit this.
...
llvm-svn: 45606
2008-01-05 00:42:45 +00:00
Owen Anderson
2adf8c5533
Move some more functionality from MRegisterInfo to TargetInstrInfo.
...
llvm-svn: 45603
2008-01-04 23:57:37 +00:00
Bill Wendling
93556af6c4
Don't recalculate the loop info and loop dominators analyses if they're
...
preserved.
llvm-svn: 45596
2008-01-04 20:54:55 +00:00
Wojciech Matyjewicz
2502769cf3
fix typo
...
llvm-svn: 45595
2008-01-04 20:04:08 +00:00
Evan Cheng
7322e4dec4
X86 PIC JIT support fixes: encoding bugs, add lazy pointer stubs support.
...
llvm-svn: 45575
2008-01-04 10:46:51 +00:00
Chris Lattner
f4972fa569
Add a really quick hack at a machine code sinking pass, enabled with --enable-sinking.
...
It is missing validity checks, so it is known broken. However, it is powerful enough
to compile this contrived code:
void test1(int C, double A, double B, double *P) {
double Tmp = A*A+B*B;
*P = C ? Tmp : A;
}
into:
_test1:
movsd 8(%esp), %xmm0
cmpl $0, 4(%esp)
je LBB1_2 # entry
LBB1_1: # entry
movsd 16(%esp), %xmm1
mulsd %xmm1, %xmm1
mulsd %xmm0, %xmm0
addsd %xmm1, %xmm0
LBB1_2: # entry
movl 24(%esp), %eax
movsd %xmm0, (%eax)
ret
instead of:
_test1:
movsd 16(%esp), %xmm0
mulsd %xmm0, %xmm0
movsd 8(%esp), %xmm1
movapd %xmm1, %xmm2
mulsd %xmm2, %xmm2
addsd %xmm0, %xmm2
cmpl $0, 4(%esp)
je LBB1_2 # entry
LBB1_1: # entry
movapd %xmm2, %xmm1
LBB1_2: # entry
movl 24(%esp), %eax
movsd %xmm1, (%eax)
ret
woo.
llvm-svn: 45570
2008-01-04 07:36:53 +00:00
Gordon Henriksen
8e4ae9a345
Trying that again.
...
llvm-svn: 45529
2008-01-03 03:32:33 +00:00
Evan Cheng
fb2bc4fc95
Change MachineRelocation::DoesntNeedFnStub to NeedStub. This fields will be used
...
for non-function GV relocations that require function address stubs (e.g. Mac OS X in non-static mode).
llvm-svn: 45527
2008-01-03 02:56:28 +00:00
Chris Lattner
6c74a2cbcb
don't access element zero of an array of size zero.
...
llvm-svn: 45526
2008-01-03 01:25:31 +00:00
Chris Lattner
e54252e6e1
Don't create a new ParamAttrsList (which copies the vector) just to
...
get a profile.
llvm-svn: 45524
2008-01-03 00:29:27 +00:00
Chris Lattner
e14d4d026e
move some code out of line, rearrange a bit.
...
llvm-svn: 45519
2008-01-03 00:10:22 +00:00
Chris Lattner
8634e197c3
Disallow copying explicitly.
...
llvm-svn: 45518
2008-01-03 00:09:47 +00:00
Chris Lattner
9ec341b120
Split param attr implementation out from Function.cpp into its
...
own file. Don't #include ParameterAttributes.h into any major
public header files: just move methods out of line as appropriate.
llvm-svn: 45517
2008-01-02 23:42:30 +00:00
Ted Kremenek
08801d9556
Inverted argument order for ImmutableMap::Profile.
...
llvm-svn: 45507
2008-01-02 22:18:33 +00:00
Ted Kremenek
a44206f579
Added iterator and profiling (i.e. FoldingSetNodeID) support to ImmutableMap.
...
llvm-svn: 45503
2008-01-02 21:31:48 +00:00
Owen Anderson
e6856128ab
Move some more instruction creation methods from RegisterInfo into InstrInfo.
...
llvm-svn: 45484
2008-01-01 21:11:32 +00:00
Chris Lattner
490a9681cb
switch the register iterator to act more like hte LLVM value iterator: dereferencing
...
it now returns the machineinstr of the use. To get the operand, use I.getOperand().
Add a new MachineRegisterInfo::replaceRegWith, which is basically like
Value::replaceAllUsesWith.
llvm-svn: 45482
2008-01-01 20:36:19 +00:00
Gordon Henriksen
d2485b2cec
Adding C bindings for SwitchInst::addCase.
...
Patch by Bryan O'Sullivan!
llvm-svn: 45481
2008-01-01 05:50:53 +00:00
Chris Lattner
7091807c2d
Add a trivial but handy function to efficiently return the machine
...
instruction that defines the specified vreg. Crazy.
llvm-svn: 45480
2008-01-01 03:07:29 +00:00
Chris Lattner
73f957d96f
add efficient iteration support for register use/def's
...
within a machine function.
llvm-svn: 45479
2008-01-01 02:55:32 +00:00
Chris Lattner
39b56ec51b
Implement automatically updated def/use lists for all MachineInstr register
...
operands. The lists are currently kept in MachineRegisterInfo, but it does
not yet provide an iterator interface to them.
llvm-svn: 45477
2008-01-01 01:12:31 +00:00
Chris Lattner
1285ec2ae7
Fix a problem where lib/Target/TargetInstrInfo.h would include and use
...
a header file from libcodegen. This violates a layering order: codegen
depends on target, not the other way around. The fix to this is to
split TII into two classes, TII and TargetInstrInfoImpl, which defines
stuff that depends on libcodegen. It is defined in libcodegen, where
the base is not.
llvm-svn: 45475
2008-01-01 01:03:04 +00:00
Owen Anderson
ae7e2c1e03
Move copyRegToReg from MRegisterInfo to TargetInstrInfo. This is part of the
...
Machine-level API cleanup instigated by Chris.
llvm-svn: 45470
2007-12-31 06:32:00 +00:00
Chris Lattner
d8b7ecd871
properly encapsulate the parent field of MBB and MI with get/set accessors.
...
llvm-svn: 45469
2007-12-31 04:56:33 +00:00
Chris Lattner
96167aa93c
Rename SSARegMap -> MachineRegisterInfo in keeping with the idea
...
that "machine" classes are used to represent the current state of
the code being compiled. Given this expanded name, we can start
moving other stuff into it. For now, move the UsedPhysRegs and
LiveIn/LoveOuts vectors from MachineFunction into it.
Update all the clients to match.
This also reduces some needless #includes, such as MachineModuleInfo
from MachineFunction.
llvm-svn: 45467
2007-12-31 04:13:23 +00:00
Chris Lattner
4a7a91b128
slightly simplify and document SSARegMap.
...
llvm-svn: 45465
2007-12-30 23:40:31 +00:00
Chris Lattner
9e5cc35593
Add new shorter predicates for testing machine operands for various types:
...
e.g. MO.isMBB() instead of MO.isMachineBasicBlock(). I don't plan on
switching everything over, so new clients should just start using the
shorter names.
Remove old long accessors, switching everything over to use the short
accessor: getMachineBasicBlock() -> getMBB(),
getConstantPoolIndex() -> getIndex(), setMachineBasicBlock -> setMBB(), etc.
llvm-svn: 45464
2007-12-30 23:10:15 +00:00
Chris Lattner
3343642406
- rename opType -> OpKind and contents -> Contents.
...
- eliminate the auxInfo union, merging it into the contents union. This shaves
4 bytes off MachineOperand on a 32-bit machine.
- Use accessors in ctor methods.
- Add comments.
llvm-svn: 45462
2007-12-30 22:24:06 +00:00
Chris Lattner
7504adbd72
More cleanups for MachineOperand:
...
- Eliminate the static "print" method for operands, moving it
into MachineOperand::print.
- Change various set* methods for register flags to take a bool
for the value to set it to. Remove unset* methods.
- Group methods more logically by operand flavor in MachineOperand.h
llvm-svn: 45461
2007-12-30 21:56:09 +00:00
Chris Lattner
7d47b6c164
MachineOperand:
...
- Add getParent() accessors.
- Move SubReg out of the AuxInfo union, to make way for future changes.
- Remove the getImmedValue/setImmedValue methods.
- in some MachineOperand::Create* methods, stop initializing fields that are dead.
MachineInstr:
- Delete one copy of the MachineInstr printing code, now there is only one dump
format and one copy of the code.
- Make MachineOperand use the parent field to get info about preg register names if
no target info is otherwise available.
- Move def/use/kill/dead flag printing to the machineoperand printer, so they are
always printed for an operand.
llvm-svn: 45460
2007-12-30 21:31:53 +00:00
Gordon Henriksen
8082358f86
Add some doxygen comments to llvm-c/Core.h.
...
llvm-svn: 45450
2007-12-30 17:46:33 +00:00
Chris Lattner
d6051f028d
make machine operands fatter: give each one an up-pointer to the
...
machineinstr that owns it.
llvm-svn: 45449
2007-12-30 06:11:04 +00:00
Chris Lattner
9a820ae865
split machineoperand out into its own header file.
...
llvm-svn: 45445
2007-12-30 04:40:25 +00:00
Chris Lattner
ed584991ba
remove unneeded #includes.
...
llvm-svn: 45439
2007-12-30 01:11:43 +00:00
Chris Lattner
0331a3297f
remove a bunch of now-dead methods.
...
llvm-svn: 45438
2007-12-30 01:04:05 +00:00
Chris Lattner
171f5ea6c4
make offset operand optional.
...
llvm-svn: 45434
2007-12-30 00:50:55 +00:00
Chris Lattner
4d0361fbf2
Shrinkify the machine operand creation method names.
...
llvm-svn: 45433
2007-12-30 00:45:46 +00:00
Chris Lattner
6d4b58a29a
switch MIBuilder over to use the simplified operand addition methods.
...
llvm-svn: 45431
2007-12-30 00:35:18 +00:00
Chris Lattner
8b6d0b0fab
1. Make a static MachineOperand::create* method for every
...
operand type.
2. Move these create methods below the accessors.
3. Simplify all the MachineInstr::add* methods to use these.
llvm-svn: 45430
2007-12-30 00:29:19 +00:00
Chris Lattner
e868c77f16
simplify some code by factoring operand construction better.
...
llvm-svn: 45428
2007-12-30 00:12:25 +00:00
Chris Lattner
7a9b0bf0eb
remove attribution from a variety of miscellaneous files.
...
llvm-svn: 45425
2007-12-29 22:59:10 +00:00
Gordon Henriksen
36da9ea958
Bindings for instruction calling conventions.
...
llvm-svn: 45422
2007-12-29 20:45:00 +00:00
Chris Lattner
e0b1ee937a
Don't attribute in file headers anymore. See llvmdev for the
...
discussion of this change. Boy are my fingers tired. ;-)
llvm-svn: 45411
2007-12-29 19:59:42 +00:00
Gordon Henriksen
86e98275ff
Adding bindings for target triple and data layout.
...
llvm-svn: 45369
2007-12-27 20:13:47 +00:00
Gordon Henriksen
d96b3222e5
Switch the bindings to use LLVMFoldingBuilder.
...
llvm-svn: 45367
2007-12-27 18:25:59 +00:00
Owen Anderson
7133e76b12
Get rid of an unneeded #include.
...
llvm-svn: 45337
2007-12-23 20:34:06 +00:00
Gordon Henriksen
606ac32019
C and Ocaml bindings for ExecutionEngine (i.e., the JIT compiler).
...
llvm-svn: 45335
2007-12-23 16:59:28 +00:00
Owen Anderson
5db3336e50
Add GraphTraits specializations for machine dominators.
...
llvm-svn: 45333
2007-12-23 15:16:46 +00:00
Chris Lattner
a8f6fac7a3
Tell TargetLoweringOpt whether it is running before
...
or after legalize.
llvm-svn: 45321
2007-12-22 20:56:36 +00:00