oota-llvm.git
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

16 years agoadd a note
Chris Lattner [Sat, 29 Dec 2007 05:51:58 +0000 (05:51 +0000)]
add a note

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

16 years agoexpand note.
Chris Lattner [Sat, 29 Dec 2007 01:05:01 +0000 (01:05 +0000)]
expand note.

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

16 years agodead calls to llvm.stacksave can be deleted, even though they
Chris Lattner [Sat, 29 Dec 2007 00:59:12 +0000 (00:59 +0000)]
dead calls to llvm.stacksave can be deleted, even though they
have potential side-effects.

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

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

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

16 years agoTest -simplifycfg only.
Devang Patel [Fri, 28 Dec 2007 22:59:48 +0000 (22:59 +0000)]
Test -simplifycfg only.

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

16 years agoadd a note.
Chris Lattner [Fri, 28 Dec 2007 22:30:05 +0000 (22:30 +0000)]
add a note.

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

16 years agoadd a note.
Chris Lattner [Fri, 28 Dec 2007 21:50:40 +0000 (21:50 +0000)]
add a note.

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

16 years agoAdd a testcase for my recent InstCombine fix, written by Nicholas.
Owen Anderson [Fri, 28 Dec 2007 21:08:43 +0000 (21:08 +0000)]
Add a testcase for my recent InstCombine fix, written by Nicholas.

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

16 years agoRepair a transform that Chris noticed a bug in. Thanks to Nicholas for pointing...
Owen Anderson [Fri, 28 Dec 2007 07:42:12 +0000 (07:42 +0000)]
Repair a transform that Chris noticed a bug in.  Thanks to Nicholas for pointing out my stupid mistakes when writing this patch. :-)

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

16 years agodisable this instcombine xform, it miscompiles:
Chris Lattner [Fri, 28 Dec 2007 06:24:31 +0000 (06:24 +0000)]
disable this instcombine xform, it miscompiles:

define i32 @main() {
entry:
%z = alloca i32 ; <i32*> [#uses=2]
store i32 0, i32* %z
%tmp = load i32* %z ; <i32> [#uses=1]
%sub = sub i32 %tmp, 1 ; <i32> [#uses=1]
%cmp = icmp ult i32 %sub, 0 ; <i1> [#uses=1]
%retval = select i1 %cmp, i32 1, i32 0 ; <i32> [#uses=1]
ret i32 %retval
}

into ret 1, instead of ret 0.

Christopher, please investigate.

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

16 years agoadd a note
Chris Lattner [Fri, 28 Dec 2007 04:42:05 +0000 (04:42 +0000)]
add a note

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

16 years agoIgnore functions with internal linkages during linking. This snipped mimics the
Anton Korobeynikov [Thu, 27 Dec 2007 23:21:57 +0000 (23:21 +0000)]
Ignore functions with internal linkages during linking. This snipped mimics the
behaviour of LinkGlobals() function.

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

16 years agoAdding bindings for target triple and data layout.
Gordon Henriksen [Thu, 27 Dec 2007 20:13:47 +0000 (20:13 +0000)]
Adding bindings for target triple and data layout.

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

16 years agoSwitch the bindings to use LLVMFoldingBuilder.
Gordon Henriksen [Thu, 27 Dec 2007 18:25:59 +0000 (18:25 +0000)]
Switch the bindings to use LLVMFoldingBuilder.

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

16 years agoAdding an uninitialized builder constructor to the Ocaml bindings.
Gordon Henriksen [Wed, 26 Dec 2007 21:21:51 +0000 (21:21 +0000)]
Adding an uninitialized builder constructor to the Ocaml bindings.

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

16 years agoone fewer uncond branch with my codegenprepare hack for single-mbb backedges.
Chris Lattner [Wed, 26 Dec 2007 17:23:47 +0000 (17:23 +0000)]
one fewer uncond branch with my codegenprepare hack for single-mbb backedges.

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

16 years agoTests for changes made in r45356, where IPO optimizations would drop
Gordon Henriksen [Wed, 26 Dec 2007 02:47:37 +0000 (02:47 +0000)]
Tests for changes made in r45356, where IPO optimizations would drop
collector algorithms.

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

16 years agoFixing several transforms which would drop the collector attribute
Gordon Henriksen [Tue, 25 Dec 2007 22:16:06 +0000 (22:16 +0000)]
Fixing several transforms which would drop the collector attribute
when copying functions.

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

16 years agoupdate to llvm 2.0 syntax.
Chris Lattner [Tue, 25 Dec 2007 20:34:52 +0000 (20:34 +0000)]
update to llvm 2.0 syntax.

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

16 years agoDon't break critical edges for single-bb loops, this helps with PR1877, though
Chris Lattner [Tue, 25 Dec 2007 19:06:45 +0000 (19:06 +0000)]
Don't break critical edges for single-bb loops, this helps with PR1877, though
it is only a partial fix.  This change is noise for most programs, but
speeds up Shootout-C++/matrix by 20%, Ptrdist/ks by 24%, smg2000 by 8%,
hexxagon by 9%, bzip2 by 9% (not sure I trust this), ackerman by 13%, etc.

OTOH, it slows down Shootout/fib2 by 40% (I'll update PR1877 with this info).

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

16 years agoActually parse q operation in llvm-ar
Seo Sanghyeon [Tue, 25 Dec 2007 13:53:47 +0000 (13:53 +0000)]
Actually parse q operation in llvm-ar

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

16 years agoDisabling -g for ocaml builds; it's not downwards compatible.
Gordon Henriksen [Tue, 25 Dec 2007 08:37:43 +0000 (08:37 +0000)]
Disabling -g for ocaml builds; it's not downwards compatible.

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

16 years agoGC poses hazards to the inliner. Consider:
Gordon Henriksen [Tue, 25 Dec 2007 03:10:07 +0000 (03:10 +0000)]
GC poses hazards to the inliner. Consider:

    define void @f() {
            ...
            call i32 @g()
            ...
    }

    define void @g() {
            ...
    }

The hazards are:

  - @f and @g have GC, but they differ GC. Inlining is invalid. This
    may never occur.
  - @f has no GC, but @g does. g's GC must be propagated to @f.

The other scenarios are safe:

  - @f and @g have the same GC.
  - @f and @g have no GC.
  - @g has no GC.

This patch adds inliner checks for the former two scenarios.

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