Commit Graph

39267 Commits

Author SHA1 Message Date
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
Nate Begeman 330aaa79e0 Allow implicit casts during arithmetic for OCUVector operations
Add codegen support and test for said casts.

llvm-svn: 45443
2007-12-30 02:59:45 +00:00
Nate Begeman 627daba0fd Allow splat casts for OCU vector assignments & add some comments.
llvm-svn: 45442
2007-12-30 01:45:55 +00:00
Nate Begeman 16a3a9d5f9 Rename stats to print-stats to avoid conflicting with llvm's
stats statistic when clang is built as a dylib.

llvm-svn: 45441
2007-12-30 01:38:50 +00:00
Nate Begeman 628028bd27 Allow codegen of vector fdiv
llvm-svn: 45440
2007-12-30 01:28:16 +00:00
Chris Lattner add4b3f9ab remove unneeded #includes.
llvm-svn: 45439
2007-12-30 01:11:43 +00:00
Chris Lattner 79f6f6c87a remove a bunch of now-dead methods.
llvm-svn: 45438
2007-12-30 01:04:05 +00:00
Chris Lattner b3fd2d7b63 use simplified operand addition methods.
llvm-svn: 45437
2007-12-30 01:01:54 +00:00
Chris Lattner 20421fe936 use simplified operand addition methods.
llvm-svn: 45436
2007-12-30 00:57:42 +00:00
Chris Lattner bbbae8e1ce use simplified operand addition methods.
llvm-svn: 45435
2007-12-30 00:51:11 +00:00
Chris Lattner b65293a075 make offset operand optional.
llvm-svn: 45434
2007-12-30 00:50:55 +00:00
Chris Lattner 4b762496a9 Shrinkify the machine operand creation method names.
llvm-svn: 45433
2007-12-30 00:45:46 +00:00
Chris Lattner e35dfb827f Start using the simplified methods for adding operands.
llvm-svn: 45432
2007-12-30 00:41:17 +00:00
Chris Lattner c002be7fdd switch MIBuilder over to use the simplified operand addition methods.
llvm-svn: 45431
2007-12-30 00:35:18 +00:00
Chris Lattner d948c2d244 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 dc3c9050f8 tblgen shouldn't include headers from llvm codegen.
llvm-svn: 45429
2007-12-30 00:25:23 +00:00
Chris Lattner c288ff1d78 simplify some code by factoring operand construction better.
llvm-svn: 45428
2007-12-30 00:12:25 +00:00