Commit Graph

39483 Commits

Author SHA1 Message Date
Chris Lattner 54bb810997 Refactor the decl printer, patch by Mike Stump!
llvm-svn: 45497
2008-01-02 21:04:16 +00:00
Bill Wendling f0b37780ca Remove dead code.
llvm-svn: 45496
2008-01-02 20:47:37 +00:00
Chris Lattner 5d998c5712 verify that aligned common support doesn't break.
llvm-svn: 45495
2008-01-02 19:48:24 +00:00
Chris Lattner cce79c67ca darwin9 and above support aligned common symbols.
llvm-svn: 45494
2008-01-02 19:44:55 +00:00
Chris Lattner dcbc0f3029 leopard and above support alignment for common symbols.
llvm-svn: 45493
2008-01-02 19:35:16 +00:00
Bill Wendling 5da1945cdd Use the new architecture to get the containing machine basic block for a machine
instruction. Also, use "splice" to move the new instruction instead of
remove/insert (where it was leaking memory anyway).

llvm-svn: 45492
2008-01-02 19:32:43 +00:00
Fariborz Jahanian 056e3a4e90 Issue diagnostic when objective-c's @interface is preceeded by a type specifier.
llvm-svn: 45491
2008-01-02 19:17:38 +00:00
Ted Kremenek 796b64337b Added/fixed some comments.
llvm-svn: 45490
2008-01-02 18:31:49 +00:00
Fariborz Jahanian 5e57e1890d Prevent crash on incorrect objc messaging expression.
llvm-svn: 45489
2008-01-02 18:09:46 +00:00
Ted Kremenek dc8ebe5022 Sprinkled 'typename' and fixed a few typos and type declaration errors to
make these headers compile.

llvm-svn: 45488
2008-01-02 17:45:00 +00:00
Ted Kremenek 2290828271 Added fixme.
llvm-svn: 45487
2008-01-02 17:05:47 +00:00
Ted Kremenek 032cb4433e Allocate vertices using a BumpPtrAllocator.
llvm-svn: 45486
2008-01-02 17:00:32 +00:00
Nick Lewycky d1200b00dc Don't be rude, emit debugging info where asked to.
llvm-svn: 45485
2008-01-02 02:49:20 +00:00
Owen Anderson eee14601b1 Move some more instruction creation methods from RegisterInfo into InstrInfo.
llvm-svn: 45484
2008-01-01 21:11:32 +00:00
Chris Lattner caaf8aae4d Make MachineRegisterInfo::getVRegDef more efficient by aiming the keep the def of the vreg at the start of the list, so the list doesn't need to be traversed.
llvm-svn: 45483
2008-01-01 21:08:22 +00:00
Chris Lattner 0cb9dd7aa2 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 097102c32a Adding C bindings for SwitchInst::addCase.
Patch by Bryan O'Sullivan!

llvm-svn: 45481
2008-01-01 05:50:53 +00:00
Chris Lattner 39204d76c5 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 8a497053a7 add efficient iteration support for register use/def's
within a machine function.

llvm-svn: 45479
2008-01-01 02:55:32 +00:00
Bill Wendling 6f8c9a8372 Update this testcase. The output needs to be disabled to pass.
llvm-svn: 45478
2008-01-01 01:34:36 +00:00
Chris Lattner 961e7427ea 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 b0fb17fd34 Fix a bug in my previous patch: refer to the impl not the pure virtual version. It's unclear why gcc would ever compile this...
llvm-svn: 45476
2008-01-01 01:05:34 +00:00
Chris Lattner 25568e4cef 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
Chris Lattner c23e6351de Factor out makefile dependency generation better.
Don't include system headers in the .d files.
Don't use $@ in the makefile rules, as there are two possible targets it could resolve to: use the one that we need explicitly.

llvm-svn: 45473
2007-12-31 23:58:31 +00:00
Duncan Sands 57a60f0466 Fix PR1833 - eh.exception and eh.selector return two
values, which means doing extra legalization work.
It would be easier to get this kind of thing right if
there was some documentation...

llvm-svn: 45472
2007-12-31 18:35:50 +00:00
Owen Anderson 7a73ae9a86 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 574e7166e0 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 21ec2b4769 update a couple of references to SSARegMap.
llvm-svn: 45468
2007-12-31 04:16:08 +00:00
Chris Lattner a10fff51d9 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
Gordon Henriksen 1f35454e99 Removing obsolete files from the Xcode project.
llvm-svn: 45466
2007-12-31 01:45:55 +00:00
Chris Lattner 5a1d88e91b slightly simplify and document SSARegMap.
llvm-svn: 45465
2007-12-30 23:40:31 +00:00
Chris Lattner a5bb370aa4 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
Gordon Henriksen 1862b6daa0 Another backwards compatibility fix.
llvm-svn: 45463
2007-12-30 22:48:58 +00:00
Chris Lattner db64f04ac6 - 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 6005589faf 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 c98c0e57eb 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
Chris Lattner 96317d2412 fix typo duncan noticed!
llvm-svn: 45459
2007-12-30 21:21:10 +00:00
Chris Lattner 35fececec9 simpilfy some register printing code.
llvm-svn: 45458
2007-12-30 21:08:36 +00:00
Chris Lattner 383a873a9a eliminate a copy of the machineoperand printing stuff. Keep the copy that
knows how to print offsets.

llvm-svn: 45457
2007-12-30 21:03:30 +00:00
Chris Lattner 49bd29daa0 Simplify and clean up some machine operand/instr printing/dumping stuff.
llvm-svn: 45456
2007-12-30 21:01:27 +00:00
Chris Lattner 0dad74d252 two register machineoperands are not identical unless their subregs match.
llvm-svn: 45455
2007-12-30 20:55:08 +00:00
Chris Lattner 81798417dc MachineOperand::getImmedValue -> MachineOperand::getImm
llvm-svn: 45454
2007-12-30 20:50:28 +00:00
Chris Lattner 5c4637816e Use MachineOperand::getImm instead of MachineOperand::getImmedValue. Likewise setImmedValue -> setImm
llvm-svn: 45453
2007-12-30 20:49:49 +00:00
Gordon Henriksen 86427bb2a9 Trying r45451 again, but this time warning-free on 3.10.x.
llvm-svn: 45452
2007-12-30 18:12:41 +00:00
Gordon Henriksen 8100a225c0 Remove some lines that are nonportable to Ocaml 3.06.
llvm-svn: 45451
2007-12-30 17:48:11 +00:00
Gordon Henriksen 4a4d73519e Add some doxygen comments to llvm-c/Core.h.
llvm-svn: 45450
2007-12-30 17:46:33 +00:00
Chris Lattner 3c6ce5b43c 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
Gordon Henriksen 12c53c8c84 Strengthening this test so it fails in release mode.
llvm-svn: 45446
2007-12-30 05:45:49 +00:00
Chris Lattner ad0c83d65e split machineoperand out into its own header file.
llvm-svn: 45445
2007-12-30 04:40:25 +00:00
Bill Wendling 7749a9014b If we have a load of a global address that's not modified during the
function, then go ahead and hoist it out of the loop. This is the result:

$ cat a.c
volatile int G;

int A(int N) {
  for (; N > 0; --N)
    G++;
}
$ llc -o - -relocation-model=pic
_A:
...
LBB1_2: # bb
        movl    L_G$non_lazy_ptr-"L1$pb"(%eax), %esi
        incl    (%esi)
        incl    %edx
        cmpl    %ecx, %edx
        jne     LBB1_2  # bb
...
$ llc -o - -relocation-model=pic -machine-licm
_A:
...
        movl    L_G$non_lazy_ptr-"L1$pb"(%eax), %eax
LBB1_2: # bb
        incl    (%eax)
        incl    %edx
        cmpl    %ecx, %edx
        jne     LBB1_2  # bb
...

I'm limiting this to the MOV32rm x86 instruction for now.

llvm-svn: 45444
2007-12-30 03:18:58 +00:00