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

16 years agoNoting and enforcing that GC intrinsics are valid only within a
Gordon Henriksen [Tue, 25 Dec 2007 02:31:26 +0000 (02:31 +0000)]
Noting and enforcing that GC intrinsics are valid only within a
function with GC.

This will catch the error when the inliner inlines a function with
GC into a caller with no GC.

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

16 years agoAdjusting verification of "llvm.gc*" intrinsic prototypes to match
Gordon Henriksen [Tue, 25 Dec 2007 02:02:10 +0000 (02:02 +0000)]
Adjusting verification of "llvm.gc*" intrinsic prototypes to match
LangRef.

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

16 years agoFlesh out the Briggs implementation a little bit more, fix a few FIXMEs.
Owen Anderson [Mon, 24 Dec 2007 22:12:23 +0000 (22:12 +0000)]
Flesh out the Briggs implementation a little bit more, fix a few FIXMEs.

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

16 years agoadd a -backedge-hack llc-beta option to codegenprepare.
Chris Lattner [Mon, 24 Dec 2007 19:32:55 +0000 (19:32 +0000)]
add a -backedge-hack llc-beta option to codegenprepare.
When specified, don't split backedges of single-bb loops.
This helps address PR1877

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

16 years agoadd a simple hack
Chris Lattner [Mon, 24 Dec 2007 19:27:46 +0000 (19:27 +0000)]
add a simple hack

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

16 years agoCygwin defines uint32_t as unsigned long. Unbreak call to std::min in this case
Anton Korobeynikov [Mon, 24 Dec 2007 11:16:47 +0000 (11:16 +0000)]
Cygwin defines uint32_t as unsigned long. Unbreak call to std::min in this case

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

16 years agoAdded special support for stripping CRLF characters that may appear in the
Ted Kremenek [Mon, 24 Dec 2007 08:04:39 +0000 (08:04 +0000)]
Added special support for stripping CRLF characters that may appear in the
output of nm.

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

16 years agoSetting GlobalDirective in TargetAsmInfo by default rather than
Gordon Henriksen [Sun, 23 Dec 2007 20:58:16 +0000 (20:58 +0000)]
Setting GlobalDirective in TargetAsmInfo by default rather than
providing a misleading facility. It's used once in the MIPS backend
and hardcoded as "\t.globl\t" everywhere else.

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

16 years agoGet rid of an unneeded #include.
Owen Anderson [Sun, 23 Dec 2007 20:34:06 +0000 (20:34 +0000)]
Get rid of an unneeded #include.

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

16 years agoFix some Ocaml GC errors noticed upon review.
Gordon Henriksen [Sun, 23 Dec 2007 17:10:23 +0000 (17:10 +0000)]
Fix some Ocaml GC errors noticed upon review.

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

16 years agoC and Ocaml bindings for ExecutionEngine (i.e., the JIT compiler).
Gordon Henriksen [Sun, 23 Dec 2007 16:59:28 +0000 (16:59 +0000)]
C and Ocaml bindings for ExecutionEngine (i.e., the JIT compiler).

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

16 years agoSketch out an implementation of Briggs' copy placement algorithm.
Owen Anderson [Sun, 23 Dec 2007 15:37:26 +0000 (15:37 +0000)]
Sketch out an implementation of Briggs' copy placement algorithm.

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

16 years agoAdd GraphTraits specializations for machine dominators.
Owen Anderson [Sun, 23 Dec 2007 15:16:46 +0000 (15:16 +0000)]
Add GraphTraits specializations for machine dominators.

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

16 years agoUndo a wrong bit in that last patch.
Gordon Henriksen [Sat, 22 Dec 2007 23:34:26 +0000 (23:34 +0000)]
Undo a wrong bit in that last patch.

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

16 years agoDocument a more robust implementation of performCustomLowering.
Gordon Henriksen [Sat, 22 Dec 2007 23:32:32 +0000 (23:32 +0000)]
Document a more robust implementation of performCustomLowering.

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

16 years agofix some warnings. This code needs to be de-tabified :(
Chris Lattner [Sat, 22 Dec 2007 22:47:03 +0000 (22:47 +0000)]
fix some warnings.  This code needs to be de-tabified :(

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

16 years agofix strict-aliasing violation
Chris Lattner [Sat, 22 Dec 2007 22:45:38 +0000 (22:45 +0000)]
fix strict-aliasing violation

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

16 years agoinitial code for forming an FGETSIGN node. This is disabled until
Chris Lattner [Sat, 22 Dec 2007 21:35:38 +0000 (21:35 +0000)]
initial code for forming an FGETSIGN node. This is disabled until
legalizer support goes in.

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

16 years agoimprove support for fgetsign
Chris Lattner [Sat, 22 Dec 2007 21:26:52 +0000 (21:26 +0000)]
improve support for fgetsign

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

16 years agoTell TargetLoweringOpt whether it is running before
Chris Lattner [Sat, 22 Dec 2007 20:56:36 +0000 (20:56 +0000)]
Tell TargetLoweringOpt whether it is running before
or after legalize.

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

16 years agoAdd a new FGETSIGN operation, which defaults to expand on all
Chris Lattner [Sat, 22 Dec 2007 20:47:56 +0000 (20:47 +0000)]
Add a new FGETSIGN operation, which defaults to expand on all
targets.

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

16 years agoErm, really disable :)
Anton Korobeynikov [Sat, 22 Dec 2007 20:46:24 +0000 (20:46 +0000)]
Erm, really disable :)

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

16 years agoDisable, until we'll really need it
Anton Korobeynikov [Sat, 22 Dec 2007 20:41:12 +0000 (20:41 +0000)]
Disable, until we'll really need it

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

16 years agoFix a partial application typo.
Gordon Henriksen [Sat, 22 Dec 2007 19:41:30 +0000 (19:41 +0000)]
Fix a partial application typo.

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

16 years agoUse getIntrinsicID instead of looking up intrinsic prototypes. Also
Gordon Henriksen [Sat, 22 Dec 2007 17:27:01 +0000 (17:27 +0000)]
Use getIntrinsicID instead of looking up intrinsic prototypes. Also
fixes a bug with indirect calls. (Test case will be included with
ocaml collector patch.)

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

16 years agoUnbreak build on gcc 3.x
Anton Korobeynikov [Sat, 22 Dec 2007 14:27:49 +0000 (14:27 +0000)]
Unbreak build on gcc 3.x

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