oota-llvm.git
16 years agoFix a compile error on Windows.
Gordon Henriksen [Thu, 3 Jan 2008 03:21:18 +0000 (03:21 +0000)]
Fix a compile error on Windows.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45528 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoChange MachineRelocation::DoesntNeedFnStub to NeedStub. This fields will be used
Evan Cheng [Thu, 3 Jan 2008 02:56:28 +0000 (02:56 +0000)]
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).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45527 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agodon't access element zero of an array of size zero.
Chris Lattner [Thu, 3 Jan 2008 01:25:31 +0000 (01:25 +0000)]
don't access element zero of an array of size zero.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45526 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRemove the function attr cache for intrinsics. This does not maintain the
Chris Lattner [Thu, 3 Jan 2008 01:20:12 +0000 (01:20 +0000)]
Remove the function attr cache for intrinsics.  This does not maintain the
refcount on these correctly, and can end up referring to deleted
attributes.  This fixes PR1881.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45525 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDon't create a new ParamAttrsList (which copies the vector) just to
Chris Lattner [Thu, 3 Jan 2008 00:29:27 +0000 (00:29 +0000)]
Don't create a new ParamAttrsList (which copies the vector) just to
get a profile.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45524 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAn example for which the TYPE_SIZE was being set from
Duncan Sands [Thu, 3 Jan 2008 00:26:42 +0000 (00:26 +0000)]
An example for which the TYPE_SIZE was being set from
the initial value, while the type fields were not (this
is a qualified union type, so not all fields are always
present).  This resulted in the size of the corresponding
LLVM type being larger than the gcc TYPE_SIZE.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45522 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoTest handling of records for which the fields are
Duncan Sands [Thu, 3 Jan 2008 00:17:02 +0000 (00:17 +0000)]
Test handling of records for which the fields are
not ordered by offset.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45520 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agomove some code out of line, rearrange a bit.
Chris Lattner [Thu, 3 Jan 2008 00:10:22 +0000 (00:10 +0000)]
move some code out of line, rearrange a bit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45519 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDisallow copying explicitly.
Chris Lattner [Thu, 3 Jan 2008 00:09:47 +0000 (00:09 +0000)]
Disallow copying explicitly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45518 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoSplit param attr implementation out from Function.cpp into its
Chris Lattner [Wed, 2 Jan 2008 23:42:30 +0000 (23:42 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45517 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoadd missing #include
Chris Lattner [Wed, 2 Jan 2008 23:41:05 +0000 (23:41 +0000)]
add missing #include

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45516 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoX86 PIC JIT bug fix: relocations for constantpool and jumptable.
Evan Cheng [Wed, 2 Jan 2008 23:38:59 +0000 (23:38 +0000)]
X86 PIC JIT bug fix: relocations for constantpool and jumptable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45515 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoremove blob of #if'd out code.
Chris Lattner [Wed, 2 Jan 2008 23:10:45 +0000 (23:10 +0000)]
remove blob of #if'd out code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45512 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agofix this to use a valid triple.
Chris Lattner [Wed, 2 Jan 2008 22:21:45 +0000 (22:21 +0000)]
fix this to use a valid triple.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45509 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoInverted argument order for ImmutableMap::Profile.
Ted Kremenek [Wed, 2 Jan 2008 22:18:33 +0000 (22:18 +0000)]
Inverted argument order for ImmutableMap::Profile.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45507 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix a build issue on cygwin
Chris Lattner [Wed, 2 Jan 2008 22:03:27 +0000 (22:03 +0000)]
Fix a build issue on cygwin

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45506 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdded iterator and profiling (i.e. FoldingSetNodeID) support to ImmutableMap.
Ted Kremenek [Wed, 2 Jan 2008 21:31:48 +0000 (21:31 +0000)]
Added iterator and profiling (i.e. FoldingSetNodeID) support to ImmutableMap.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45503 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix PR1888, patch by Wilhansen Li.
Chris Lattner [Wed, 2 Jan 2008 21:30:58 +0000 (21:30 +0000)]
Fix PR1888, patch by Wilhansen Li.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45501 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix a build problem with VC++ by not doing the target prefix
Chris Lattner [Wed, 2 Jan 2008 21:24:22 +0000 (21:24 +0000)]
Fix a build problem with VC++ by not doing the target prefix
comparison for every builtin.  This reduces the depth of
the if/elseif chain dramatically.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45500 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUse the correct MachineRegisterInfo object.
Bill Wendling [Wed, 2 Jan 2008 21:10:54 +0000 (21:10 +0000)]
Use the correct MachineRegisterInfo object.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45499 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMachine LICM will check that operands are defined outside of the loop. Also
Bill Wendling [Wed, 2 Jan 2008 21:10:40 +0000 (21:10 +0000)]
Machine LICM will check that operands are defined outside of the loop. Also
check that register isn't 0 before going further.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45498 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRemove dead code.
Bill Wendling [Wed, 2 Jan 2008 20:47:37 +0000 (20:47 +0000)]
Remove dead code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45496 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoverify that aligned common support doesn't break.
Chris Lattner [Wed, 2 Jan 2008 19:48:24 +0000 (19:48 +0000)]
verify that aligned common support doesn't break.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45495 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agodarwin9 and above support aligned common symbols.
Chris Lattner [Wed, 2 Jan 2008 19:44:55 +0000 (19:44 +0000)]
darwin9 and above support aligned common symbols.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45494 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoleopard and above support alignment for common symbols.
Chris Lattner [Wed, 2 Jan 2008 19:35:16 +0000 (19:35 +0000)]
leopard and above support alignment for common symbols.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45493 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUse the new architecture to get the containing machine basic block for a machine
Bill Wendling [Wed, 2 Jan 2008 19:32:43 +0000 (19:32 +0000)]
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).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45492 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDon't be rude, emit debugging info where asked to.
Nick Lewycky [Wed, 2 Jan 2008 02:49:20 +0000 (02:49 +0000)]
Don't be rude, emit debugging info where asked to.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45485 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMove some more instruction creation methods from RegisterInfo into InstrInfo.
Owen Anderson [Tue, 1 Jan 2008 21:11:32 +0000 (21:11 +0000)]
Move some more instruction creation methods from RegisterInfo into InstrInfo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45484 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMake MachineRegisterInfo::getVRegDef more efficient by aiming the keep the def of...
Chris Lattner [Tue, 1 Jan 2008 21:08:22 +0000 (21:08 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45483 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoswitch the register iterator to act more like hte LLVM value iterator: dereferencing
Chris Lattner [Tue, 1 Jan 2008 20:36:19 +0000 (20:36 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45482 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdding C bindings for SwitchInst::addCase.
Gordon Henriksen [Tue, 1 Jan 2008 05:50:53 +0000 (05:50 +0000)]
Adding C bindings for SwitchInst::addCase.

Patch by Bryan O'Sullivan!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45481 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd a trivial but handy function to efficiently return the machine
Chris Lattner [Tue, 1 Jan 2008 03:07:29 +0000 (03:07 +0000)]
Add a trivial but handy function to efficiently return the machine
instruction that defines the specified vreg.  Crazy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45480 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoadd efficient iteration support for register use/def's
Chris Lattner [Tue, 1 Jan 2008 02:55:32 +0000 (02:55 +0000)]
add efficient iteration support for register use/def's
within a machine function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45479 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUpdate this testcase. The output needs to be disabled to pass.
Bill Wendling [Tue, 1 Jan 2008 01:34:36 +0000 (01:34 +0000)]
Update this testcase. The output needs to be disabled to pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45478 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoImplement automatically updated def/use lists for all MachineInstr register
Chris Lattner [Tue, 1 Jan 2008 01:12:31 +0000 (01:12 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45477 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix a bug in my previous patch: refer to the impl not the pure virtual version. ...
Chris Lattner [Tue, 1 Jan 2008 01:05:34 +0000 (01:05 +0000)]
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...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45476 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix a problem where lib/Target/TargetInstrInfo.h would include and use
Chris Lattner [Tue, 1 Jan 2008 01:03:04 +0000 (01:03 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45475 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFactor out makefile dependency generation better.
Chris Lattner [Mon, 31 Dec 2007 23:58:31 +0000 (23:58 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45473 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFix PR1833 - eh.exception and eh.selector return two
Duncan Sands [Mon, 31 Dec 2007 18:35:50 +0000 (18:35 +0000)]
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...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45472 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMove copyRegToReg from MRegisterInfo to TargetInstrInfo. This is part of the
Owen Anderson [Mon, 31 Dec 2007 06:32:00 +0000 (06:32 +0000)]
Move copyRegToReg from MRegisterInfo to TargetInstrInfo.  This is part of the
Machine-level API cleanup instigated by Chris.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45470 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoproperly encapsulate the parent field of MBB and MI with get/set accessors.
Chris Lattner [Mon, 31 Dec 2007 04:56:33 +0000 (04:56 +0000)]
properly encapsulate the parent field of MBB and MI with get/set accessors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45469 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoupdate a couple of references to SSARegMap.
Chris Lattner [Mon, 31 Dec 2007 04:16:08 +0000 (04:16 +0000)]
update a couple of references to SSARegMap.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45468 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRename SSARegMap -> MachineRegisterInfo in keeping with the idea
Chris Lattner [Mon, 31 Dec 2007 04:13:23 +0000 (04:13 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45467 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRemoving obsolete files from the Xcode project.
Gordon Henriksen [Mon, 31 Dec 2007 01:45:55 +0000 (01:45 +0000)]
Removing obsolete files from the Xcode project.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45466 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoslightly simplify and document SSARegMap.
Chris Lattner [Sun, 30 Dec 2007 23:40:31 +0000 (23:40 +0000)]
slightly simplify and document SSARegMap.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45465 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd new shorter predicates for testing machine operands for various types:
Chris Lattner [Sun, 30 Dec 2007 23:10:15 +0000 (23:10 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45464 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAnother backwards compatibility fix.
Gordon Henriksen [Sun, 30 Dec 2007 22:48:58 +0000 (22:48 +0000)]
Another backwards compatibility fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45463 91177308-0d34-0410-b5e6-96231b3b80d8

16 years ago- rename opType -> OpKind and contents -> Contents.
Chris Lattner [Sun, 30 Dec 2007 22:24:06 +0000 (22:24 +0000)]
- 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45462 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMore cleanups for MachineOperand:
Chris Lattner [Sun, 30 Dec 2007 21:56:09 +0000 (21:56 +0000)]
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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45461 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMachineOperand:
Chris Lattner [Sun, 30 Dec 2007 21:31:53 +0000 (21:31 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45460 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agofix typo duncan noticed!
Chris Lattner [Sun, 30 Dec 2007 21:21:10 +0000 (21:21 +0000)]
fix typo duncan noticed!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45459 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agosimpilfy some register printing code.
Chris Lattner [Sun, 30 Dec 2007 21:08:36 +0000 (21:08 +0000)]
simpilfy some register printing code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45458 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoeliminate a copy of the machineoperand printing stuff. Keep the copy that
Chris Lattner [Sun, 30 Dec 2007 21:03:30 +0000 (21:03 +0000)]
eliminate a copy of the machineoperand printing stuff.  Keep the copy that
knows how to print offsets.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45457 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoSimplify and clean up some machine operand/instr printing/dumping stuff.
Chris Lattner [Sun, 30 Dec 2007 21:01:27 +0000 (21:01 +0000)]
Simplify and clean up some machine operand/instr printing/dumping stuff.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45456 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agotwo register machineoperands are not identical unless their subregs match.
Chris Lattner [Sun, 30 Dec 2007 20:55:08 +0000 (20:55 +0000)]
two register machineoperands are not identical unless their subregs match.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45455 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoMachineOperand::getImmedValue -> MachineOperand::getImm
Chris Lattner [Sun, 30 Dec 2007 20:50:28 +0000 (20:50 +0000)]
MachineOperand::getImmedValue -> MachineOperand::getImm

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45454 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoUse MachineOperand::getImm instead of MachineOperand::getImmedValue. Likewise setImm...
Chris Lattner [Sun, 30 Dec 2007 20:49:49 +0000 (20:49 +0000)]
Use MachineOperand::getImm instead of MachineOperand::getImmedValue.  Likewise setImmedValue -> setImm

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45453 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoTrying r45451 again, but this time warning-free on 3.10.x.
Gordon Henriksen [Sun, 30 Dec 2007 18:12:41 +0000 (18:12 +0000)]
Trying r45451 again, but this time warning-free on 3.10.x.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45452 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRemove some lines that are nonportable to Ocaml 3.06.
Gordon Henriksen [Sun, 30 Dec 2007 17:48:11 +0000 (17:48 +0000)]
Remove some lines that are nonportable to Ocaml 3.06.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45451 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoAdd some doxygen comments to llvm-c/Core.h.
Gordon Henriksen [Sun, 30 Dec 2007 17:46:33 +0000 (17:46 +0000)]
Add some doxygen comments to llvm-c/Core.h.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45450 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agomake machine operands fatter: give each one an up-pointer to the
Chris Lattner [Sun, 30 Dec 2007 06:11:04 +0000 (06:11 +0000)]
make machine operands fatter: give each one an up-pointer to the
machineinstr that owns it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45449 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoStrengthening this test so it fails in release mode.
Gordon Henriksen [Sun, 30 Dec 2007 05:45:49 +0000 (05:45 +0000)]
Strengthening this test so it fails in release mode.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45446 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agosplit machineoperand out into its own header file.
Chris Lattner [Sun, 30 Dec 2007 04:40:25 +0000 (04:40 +0000)]
split machineoperand out into its own header file.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45445 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoIf we have a load of a global address that's not modified during the
Bill Wendling [Sun, 30 Dec 2007 03:18:58 +0000 (03:18 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45444 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoremove unneeded #includes.
Chris Lattner [Sun, 30 Dec 2007 01:11:43 +0000 (01:11 +0000)]
remove unneeded #includes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45439 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoremove a bunch of now-dead methods.
Chris Lattner [Sun, 30 Dec 2007 01:04:05 +0000 (01:04 +0000)]
remove a bunch of now-dead methods.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45438 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agouse simplified operand addition methods.
Chris Lattner [Sun, 30 Dec 2007 01:01:54 +0000 (01:01 +0000)]
use simplified operand addition methods.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45437 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agouse simplified operand addition methods.
Chris Lattner [Sun, 30 Dec 2007 00:57:42 +0000 (00:57 +0000)]
use simplified operand addition methods.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45436 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agouse simplified operand addition methods.
Chris Lattner [Sun, 30 Dec 2007 00:51:11 +0000 (00:51 +0000)]
use simplified operand addition methods.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45435 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agomake offset operand optional.
Chris Lattner [Sun, 30 Dec 2007 00:50:55 +0000 (00:50 +0000)]
make offset operand optional.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45434 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoShrinkify the machine operand creation method names.
Chris Lattner [Sun, 30 Dec 2007 00:45:46 +0000 (00:45 +0000)]
Shrinkify the machine operand creation method names.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45433 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoStart using the simplified methods for adding operands.
Chris Lattner [Sun, 30 Dec 2007 00:41:17 +0000 (00:41 +0000)]
Start using the simplified methods for adding operands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45432 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoswitch MIBuilder over to use the simplified operand addition methods.
Chris Lattner [Sun, 30 Dec 2007 00:35:18 +0000 (00:35 +0000)]
switch MIBuilder over to use the simplified operand addition methods.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45431 91177308-0d34-0410-b5e6-96231b3b80d8

16 years ago1. Make a static MachineOperand::create* method for every
Chris Lattner [Sun, 30 Dec 2007 00:29:19 +0000 (00:29 +0000)]
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45430 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agotblgen shouldn't include headers from llvm codegen.
Chris Lattner [Sun, 30 Dec 2007 00:25:23 +0000 (00:25 +0000)]
tblgen shouldn't include headers from llvm codegen.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45429 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agosimplify some code by factoring operand construction better.
Chris Lattner [Sun, 30 Dec 2007 00:12:25 +0000 (00:12 +0000)]
simplify some code by factoring operand construction better.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45428 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoremove attribution from a variety of miscellaneous files.
Chris Lattner [Sat, 29 Dec 2007 22:59:10 +0000 (22:59 +0000)]
remove attribution from a variety of miscellaneous files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45425 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoregenerate
Chris Lattner [Sat, 29 Dec 2007 20:47:37 +0000 (20:47 +0000)]
regenerate

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45424 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoremove attributions
Chris Lattner [Sat, 29 Dec 2007 20:46:15 +0000 (20:46 +0000)]
remove attributions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45423 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoBindings for instruction calling conventions.
Gordon Henriksen [Sat, 29 Dec 2007 20:45:00 +0000 (20:45 +0000)]
Bindings for instruction calling conventions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45422 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoremove attributions from tools.
Chris Lattner [Sat, 29 Dec 2007 20:44:31 +0000 (20:44 +0000)]
remove attributions from tools.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45421 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoremove attributions from examples.
Chris Lattner [Sat, 29 Dec 2007 20:37:57 +0000 (20:37 +0000)]
remove attributions from examples.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45420 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoremove attributions from utils.
Chris Lattner [Sat, 29 Dec 2007 20:37:13 +0000 (20:37 +0000)]
remove attributions from utils.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45419 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoRemove attribution from file headers, per discussion on llvmdev.
Chris Lattner [Sat, 29 Dec 2007 20:36:04 +0000 (20:36 +0000)]
Remove attribution from file headers, per discussion on llvmdev.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45418 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoremove attributions from the rest of the llvm makefiles.
Chris Lattner [Sat, 29 Dec 2007 20:11:13 +0000 (20:11 +0000)]
remove attributions from the rest of the llvm makefiles.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45416 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoremove attribution from lib Makefiles.
Chris Lattner [Sat, 29 Dec 2007 20:09:26 +0000 (20:09 +0000)]
remove attribution from lib Makefiles.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45415 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoremove attributions from tools/utils makefiles.
Chris Lattner [Sat, 29 Dec 2007 20:07:17 +0000 (20:07 +0000)]
remove attributions from tools/utils makefiles.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45414 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDon't attribute in file headers anymore. See llvmdev for the
Chris Lattner [Sat, 29 Dec 2007 19:59:42 +0000 (19:59 +0000)]
Don't attribute in file headers anymore.  See llvmdev for the
discussion of this change.  Boy are my fingers tired. ;-)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45411 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDon't attribute in file headers anymore. See llvmdev for the
Chris Lattner [Sat, 29 Dec 2007 19:56:08 +0000 (19:56 +0000)]
Don't attribute in file headers anymore.  See llvmdev for the
discussion of this change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45409 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agothis is done.
Chris Lattner [Sat, 29 Dec 2007 19:38:02 +0000 (19:38 +0000)]
this is done.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45408 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoOne readme entry is done, one is really easy (Evan, want to investigate
Chris Lattner [Sat, 29 Dec 2007 19:31:47 +0000 (19:31 +0000)]
One readme entry is done, one is really easy (Evan, want to investigate
eliminating the llvm.x86.sse2.loadl.pd intrinsic?), one shuffle optzn
may be done (if shufps is better than pinsw, Evan, please review), and
we already know about LICM of simple instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45407 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoupgrade this test
Chris Lattner [Sat, 29 Dec 2007 19:24:06 +0000 (19:24 +0000)]
upgrade this test

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45406 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoFold comparisons against a constant nan, and optimize ORD/UNORD
Chris Lattner [Sat, 29 Dec 2007 08:37:08 +0000 (08:37 +0000)]
Fold comparisons against a constant nan, and optimize ORD/UNORD
comparisons with a constant.  This allows us to compile isnan to:

_foo:
fcmpu cr7, f1, f1
mfcr r2
rlwinm r3, r2, 0, 31, 31
blr

instead of:

LCPI1_0: ;  float
.space 4
_foo:
lis r2, ha16(LCPI1_0)
lfs f0, lo16(LCPI1_0)(r2)
fcmpu cr7, f1, f0
mfcr r2
rlwinm r3, r2, 0, 31, 31
blr

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45405 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agothis xform is implemented.
Chris Lattner [Sat, 29 Dec 2007 08:19:39 +0000 (08:19 +0000)]
this xform is implemented.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45404 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDisable null pointer folding transforms for non-generic address spaces. This should...
Christopher Lamb [Sat, 29 Dec 2007 07:56:53 +0000 (07:56 +0000)]
Disable null pointer folding transforms for non-generic address spaces. This should probably be a target-specific predicate based on address space. That way for targets where this isn't applicable the predicate can be optimized away.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45403 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agomake sure not to zap volatile stores, thanks a lot to Dale for noticing this!
Chris Lattner [Sat, 29 Dec 2007 07:15:45 +0000 (07:15 +0000)]
make sure not to zap volatile stores, thanks a lot to Dale for noticing this!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45402 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoCodegen:
Chris Lattner [Sat, 29 Dec 2007 06:57:38 +0000 (06:57 +0000)]
Codegen:

as:

_bar:
pushl %esi
subl $8, %esp
movl 16(%esp), %esi
call L_foo$stub
fstps (%esi)
addl $8, %esp
popl %esi
#FP_REG_KILL
ret

instead of:

_bar:
pushl %esi
subl $8, %esp
movl 16(%esp), %esi
call L_foo$stub
fstpl (%esi)
cvtsd2ss (%esi), %xmm0
movss %xmm0, (%esi)
addl $8, %esp
popl %esi
#FP_REG_KILL
ret

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45401 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agodon't fold fp_round(fp_extend(load)) -> fp_round(extload)
Chris Lattner [Sat, 29 Dec 2007 06:55:23 +0000 (06:55 +0000)]
don't fold fp_round(fp_extend(load)) -> fp_round(extload)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45400 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoavoid going through a stack slot to convert from fpstack to xmm reg
Chris Lattner [Sat, 29 Dec 2007 06:41:28 +0000 (06:41 +0000)]
avoid going through a stack slot to convert from fpstack to xmm reg
if we are just going to store it back anyway.  This improves things
like:
double foo();
void bar(double *P) { *P = foo(); }

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45399 91177308-0d34-0410-b5e6-96231b3b80d8

16 years agoDelete a store whose input is a load from the same pointer:
Chris Lattner [Sat, 29 Dec 2007 06:26:16 +0000 (06:26 +0000)]
Delete a store whose input is a load from the same pointer:
  x = load p
  store x -> p

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45398 91177308-0d34-0410-b5e6-96231b3b80d8