oota-llvm.git
18 years agoturns out, demotion and invokes and critical edges don't mix
Andrew Lenharth [Tue, 22 Nov 2005 21:45:19 +0000 (21:45 +0000)]
turns out, demotion and invokes and critical edges don't mix

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

18 years agoFix warning, the better way. Really, this is what this instruction is for, so use it
Andrew Lenharth [Tue, 22 Nov 2005 20:59:00 +0000 (20:59 +0000)]
Fix warning, the better way.  Really, this is what this instruction is for, so use it

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

18 years agoFix warning
Andrew Lenharth [Tue, 22 Nov 2005 20:56:05 +0000 (20:56 +0000)]
Fix warning

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

18 years agoCheck in code to scalarize arbitrarily wide packed types for some simple
Nate Begeman [Tue, 22 Nov 2005 18:16:00 +0000 (18:16 +0000)]
Check in code to scalarize arbitrarily wide packed types for some simple
vector operations (load, add, sub, mul).

This allows us to codegen:
void %foo(<4 x float> * %a) {
entry:
  %tmp1 = load <4 x float> * %a;
  %tmp2 = add <4 x float> %tmp1, %tmp1
  store <4 x float> %tmp2, <4 x float> *%a
  ret void
}

on ppc as:
_foo:
        lfs f0, 12(r3)
        lfs f1, 8(r3)
        lfs f2, 4(r3)
        lfs f3, 0(r3)
        fadds f0, f0, f0
        fadds f1, f1, f1
        fadds f2, f2, f2
        fadds f3, f3, f3
        stfs f0, 12(r3)
        stfs f1, 8(r3)
        stfs f2, 4(r3)
        stfs f3, 0(r3)
        blr

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

18 years agomassive DAGISel patch. lots and lots more stuff compiles now
Andrew Lenharth [Tue, 22 Nov 2005 04:20:06 +0000 (04:20 +0000)]
massive DAGISel patch.  lots and lots more stuff compiles now

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

18 years agoRather than attempting to legalize 1 x float, make sure the SD ISel never
Nate Begeman [Tue, 22 Nov 2005 01:29:36 +0000 (01:29 +0000)]
Rather than attempting to legalize 1 x float, make sure the SD ISel never
generates it.  Make MVT::Vector expand-only, and remove the code in
Legalize that attempts to legalize it.

The plan for supporting N x Type is to continually epxand it in ExpandOp
until it gets down to 2 x Type, where it will be scalarized into a pair of
scalars.

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

18 years agoUse HasDotTypeDotSizeDirective instead of forELF
Chris Lattner [Mon, 21 Nov 2005 23:06:54 +0000 (23:06 +0000)]
Use HasDotTypeDotSizeDirective instead of forELF

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

18 years agoAdd a new flag
Chris Lattner [Mon, 21 Nov 2005 23:06:08 +0000 (23:06 +0000)]
Add a new flag

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

18 years agoRemove a level of indentation by using a continue.
Chris Lattner [Mon, 21 Nov 2005 22:48:18 +0000 (22:48 +0000)]
Remove a level of indentation by using a continue.

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

18 years agoSimplify the subtarget info, allow the asmwriter to do some target sensing
Chris Lattner [Mon, 21 Nov 2005 22:43:58 +0000 (22:43 +0000)]
Simplify the subtarget info, allow the asmwriter to do some target sensing
based on TargetType.

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

18 years agoUse subtarget information computed by X86Subtarget instead of rolling our own.
Chris Lattner [Mon, 21 Nov 2005 22:39:40 +0000 (22:39 +0000)]
Use subtarget information computed by X86Subtarget instead of rolling our own.

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

18 years agoMake the X86 subtarget compute the basic target type: ELF, Cygwin, Darwin,
Chris Lattner [Mon, 21 Nov 2005 22:31:58 +0000 (22:31 +0000)]
Make the X86 subtarget compute the basic target type: ELF, Cygwin, Darwin,
or native Win32

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

18 years agoAdd a forELF flag, allowing the removal of forCygwin and simplification of
Chris Lattner [Mon, 21 Nov 2005 22:19:48 +0000 (22:19 +0000)]
Add a forELF flag, allowing the removal of forCygwin and simplification of
conditionals.

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

18 years agoAdd some more directives
Chris Lattner [Mon, 21 Nov 2005 19:51:51 +0000 (19:51 +0000)]
Add some more directives

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

18 years agosimplify and genericize this code
Chris Lattner [Mon, 21 Nov 2005 19:50:31 +0000 (19:50 +0000)]
simplify and genericize this code

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

18 years agoadd support for div/rem to the dag->dag isel. yay.
Duraid Madina [Mon, 21 Nov 2005 14:14:54 +0000 (14:14 +0000)]
add support for div/rem to the dag->dag isel. yay.

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

18 years agoI think I know what you meant here, but just to be safe I'll let you
Duraid Madina [Mon, 21 Nov 2005 14:09:40 +0000 (14:09 +0000)]
I think I know what you meant here, but just to be safe I'll let you
do it. :)

    <_sabre_> excuses excuses

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

18 years agoEliminate unneeded intermediate class. Move doFinalizeMethod to bottom of
Chris Lattner [Mon, 21 Nov 2005 08:40:17 +0000 (08:40 +0000)]
Eliminate unneeded intermediate class.  Move doFinalizeMethod to bottom of
file.

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

18 years agoStart using shared asmprinter Constant Pool emitter, use shorter cpi names.
Chris Lattner [Mon, 21 Nov 2005 08:38:26 +0000 (08:38 +0000)]
Start using shared asmprinter Constant Pool emitter, use shorter cpi names.

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

18 years agoprune #include
Chris Lattner [Mon, 21 Nov 2005 08:33:17 +0000 (08:33 +0000)]
prune #include

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

18 years agoSwitch to using the shared constant pool printer, along with using shorter
Chris Lattner [Mon, 21 Nov 2005 08:32:23 +0000 (08:32 +0000)]
Switch to using the shared constant pool printer, along with using shorter
CPI ids

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

18 years agoSwitch to using the generic constant pool emitter impl, use shorter
Chris Lattner [Mon, 21 Nov 2005 08:29:17 +0000 (08:29 +0000)]
Switch to using the generic constant pool emitter impl, use shorter
CPI names

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

18 years agoUse generic constant pool emission code in the AsmPrinter class.
Chris Lattner [Mon, 21 Nov 2005 08:26:15 +0000 (08:26 +0000)]
Use generic constant pool emission code in the AsmPrinter class.

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

18 years agoAllow target to customize directive used to switch to arbitrary section in SwitchSection,
Chris Lattner [Mon, 21 Nov 2005 08:25:09 +0000 (08:25 +0000)]
Allow target to customize directive used to switch to arbitrary section in SwitchSection,
add generic constant pool emitter

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

18 years agoadd two more config directives, add method for printing constant pool
Chris Lattner [Mon, 21 Nov 2005 08:24:11 +0000 (08:24 +0000)]
add two more config directives, add method for printing constant pool

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

18 years agoUse the FunctionNumber provided by the AsmPrinter class
Chris Lattner [Mon, 21 Nov 2005 08:14:07 +0000 (08:14 +0000)]
Use the FunctionNumber provided by the AsmPrinter class

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

18 years agoincrement the function number in SetupMachineFunction
Chris Lattner [Mon, 21 Nov 2005 08:13:27 +0000 (08:13 +0000)]
increment the function number in SetupMachineFunction

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

18 years agoMake the AsmPrinter keep track of the notion of a function number.
Chris Lattner [Mon, 21 Nov 2005 08:12:47 +0000 (08:12 +0000)]
Make the AsmPrinter keep track of the notion of a function number.

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

18 years agoUse CommentString where possible, fix a bug where aix mode wouldn't assemble
Chris Lattner [Mon, 21 Nov 2005 08:02:41 +0000 (08:02 +0000)]
Use CommentString where possible, fix a bug where aix mode wouldn't assemble
due to basic blocks being misnamed.

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

18 years agounify the darwin and aix constant pool printers
Chris Lattner [Mon, 21 Nov 2005 07:57:37 +0000 (07:57 +0000)]
unify the darwin and aix constant pool printers

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

18 years agoAdjust to capitalized asmprinter method names
Chris Lattner [Mon, 21 Nov 2005 07:51:36 +0000 (07:51 +0000)]
Adjust to capitalized asmprinter method names

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

18 years agoAdjust to capitalized AsmPrinter method names
Chris Lattner [Mon, 21 Nov 2005 07:51:23 +0000 (07:51 +0000)]
Adjust to capitalized AsmPrinter method names

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

18 years agoCapitalize methods for better consistency
Chris Lattner [Mon, 21 Nov 2005 07:51:06 +0000 (07:51 +0000)]
Capitalize methods for better consistency

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

18 years agoUse PrivateGlobalPrefix for basic block labels. This allows the x86 darwin
Chris Lattner [Mon, 21 Nov 2005 07:43:59 +0000 (07:43 +0000)]
Use PrivateGlobalPrefix for basic block labels.  This allows the x86 darwin
port to properly use L for the bb prefix instead of .

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

18 years agouse PrivateGlobalPrefix for basic blocks
Chris Lattner [Mon, 21 Nov 2005 07:41:05 +0000 (07:41 +0000)]
use PrivateGlobalPrefix for basic blocks

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

18 years agoUse PrivateGlobalPrefix for basic block labels
Chris Lattner [Mon, 21 Nov 2005 07:39:22 +0000 (07:39 +0000)]
Use PrivateGlobalPrefix for basic block labels

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

18 years agoUse PrivateGlobalPrefix for basic blocks
Chris Lattner [Mon, 21 Nov 2005 07:38:08 +0000 (07:38 +0000)]
Use PrivateGlobalPrefix for basic blocks

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

18 years agoSwitch to the new shared SwitchSection
Chris Lattner [Mon, 21 Nov 2005 07:30:28 +0000 (07:30 +0000)]
Switch to the new shared SwitchSection

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

18 years agoStart using SwitchSection, allowing globals and functions to be emitted
Chris Lattner [Mon, 21 Nov 2005 07:26:04 +0000 (07:26 +0000)]
Start using SwitchSection, allowing globals and functions to be emitted
to specific sections.  Delete some dead functions copied from the X86 backend.

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

18 years agoconvert the rest of this over to use SwitchSection
Chris Lattner [Mon, 21 Nov 2005 07:16:34 +0000 (07:16 +0000)]
convert the rest of this over to use SwitchSection

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

18 years agoStart using the AsmPrinter shared SwitchSection code. This allows the X86
Chris Lattner [Mon, 21 Nov 2005 07:11:11 +0000 (07:11 +0000)]
Start using the AsmPrinter shared SwitchSection code.  This allows the X86
backend to implement global variables in sections.

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

18 years agoThis is now implemented in common codegen code
Chris Lattner [Mon, 21 Nov 2005 07:06:58 +0000 (07:06 +0000)]
This is now implemented in common codegen code

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

18 years agoAdd section switching to common code generator code. Add a couple of
Chris Lattner [Mon, 21 Nov 2005 07:06:27 +0000 (07:06 +0000)]
Add section switching to common code generator code.  Add a couple of
asserts.

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

18 years agoAdd section switching to to common AsmPrinter code.
Chris Lattner [Mon, 21 Nov 2005 07:05:42 +0000 (07:05 +0000)]
Add section switching to to common AsmPrinter code.

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

18 years agoRename SwitchSection -> switchSection to avoid conflicting with a future
Chris Lattner [Mon, 21 Nov 2005 06:55:27 +0000 (06:55 +0000)]
Rename SwitchSection -> switchSection to avoid conflicting with a future
change.

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

18 years agoStart using PrivateGlobalPrefix correctly
Chris Lattner [Mon, 21 Nov 2005 06:51:52 +0000 (06:51 +0000)]
Start using PrivateGlobalPrefix correctly

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

18 years agoset PrivateGlobalPrefix on darwin, use it when printing out CP references
Chris Lattner [Mon, 21 Nov 2005 06:47:58 +0000 (06:47 +0000)]
set PrivateGlobalPrefix on darwin, use it when printing out CP references

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

18 years agoNaturally align doubles in the constant pool, set PrivateGlobalPrefix on
Chris Lattner [Mon, 21 Nov 2005 06:46:22 +0000 (06:46 +0000)]
Naturally align doubles in the constant pool, set PrivateGlobalPrefix on
darwin, use it when printing the constant pool indices so the labels are
appropriately private, emit cp entries to .const instead of .data on darwin
and only emit a single .section for the constant pool, not one for each
entry.

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

18 years agoAdd a new option.
Chris Lattner [Mon, 21 Nov 2005 06:41:08 +0000 (06:41 +0000)]
Add a new option.

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

18 years agoLower READCYCLECOUNTER correctly, preserving the chain result
Chris Lattner [Sun, 20 Nov 2005 22:57:19 +0000 (22:57 +0000)]
Lower READCYCLECOUNTER correctly, preserving the chain result

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

18 years agoLegalize MERGE_VALUES, expand READCYCLECOUNTER correctly, so it doesn't
Chris Lattner [Sun, 20 Nov 2005 22:56:56 +0000 (22:56 +0000)]
Legalize MERGE_VALUES, expand READCYCLECOUNTER correctly, so it doesn't
break control dependence.

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

18 years agoadd a new node type
Chris Lattner [Sun, 20 Nov 2005 22:55:57 +0000 (22:55 +0000)]
add a new node type

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

18 years agoencode rdtsc correctly
Chris Lattner [Sun, 20 Nov 2005 22:13:18 +0000 (22:13 +0000)]
encode rdtsc correctly

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

18 years agouse chain operands to ensure the copies don't wander from the rdtsc instruction.
Chris Lattner [Sun, 20 Nov 2005 22:01:40 +0000 (22:01 +0000)]
use chain operands to ensure the copies don't wander from the rdtsc instruction.

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

18 years agoThis should not be dce'd
Chris Lattner [Sun, 20 Nov 2005 21:46:52 +0000 (21:46 +0000)]
This should not be dce'd

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

18 years agooops
Andrew Lenharth [Sun, 20 Nov 2005 21:42:49 +0000 (21:42 +0000)]
oops

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

18 years agocheck that rdtsc is generated from readcyclecounter
Andrew Lenharth [Sun, 20 Nov 2005 21:41:59 +0000 (21:41 +0000)]
check that rdtsc is generated from readcyclecounter

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

18 years agoThe second patch of X86 support for read cycle counter.
Andrew Lenharth [Sun, 20 Nov 2005 21:41:10 +0000 (21:41 +0000)]
The second patch of X86 support for read cycle counter.

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

18 years agoThe first patch of X86 support for read cycle counter
Andrew Lenharth [Sun, 20 Nov 2005 21:32:07 +0000 (21:32 +0000)]
The first patch of X86 support for read cycle counter

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

18 years agomore progress towards bug 291 being finished. Patch by Owen Anderson,
Chris Lattner [Sun, 20 Nov 2005 03:45:52 +0000 (03:45 +0000)]
more progress towards bug 291 being finished.  Patch by Owen Anderson,
HAVE_GV case fixed up by me.

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

18 years agoUnbreak codegen of bools. This should fix the llc/jit/llc-beta failures
Chris Lattner [Sat, 19 Nov 2005 18:40:42 +0000 (18:40 +0000)]
Unbreak codegen of bools.  This should fix the llc/jit/llc-beta failures
from last night.

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

18 years agoInitialize this variable on all paths, fixing a crasher in windows. Thanks
Chris Lattner [Sat, 19 Nov 2005 07:48:33 +0000 (07:48 +0000)]
Initialize this variable on all paths, fixing a crasher in windows.  Thanks
to JeffC for pointing this out.

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

18 years agoImprove Selection DAG printer portability. Patch by Owen Anderson!
Chris Lattner [Sat, 19 Nov 2005 07:44:09 +0000 (07:44 +0000)]
Improve Selection DAG printer portability.  Patch by Owen Anderson!

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

18 years agoTeach tblgen about instruction operands that have multiple MachineInstr
Chris Lattner [Sat, 19 Nov 2005 07:05:57 +0000 (07:05 +0000)]
Teach tblgen about instruction operands that have multiple MachineInstr
operands, digging into them to find register values (used on X86).  Patch
by Evan Cheng!

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

18 years agoTeach the x86 backend about the register constraints of its addressing mode.
Chris Lattner [Sat, 19 Nov 2005 07:01:30 +0000 (07:01 +0000)]
Teach the x86 backend about the register constraints of its addressing mode.
Patch by Evan Cheng

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

18 years agoCapture more operand info, patch by Evan Cheng
Chris Lattner [Sat, 19 Nov 2005 07:00:10 +0000 (07:00 +0000)]
Capture more operand info, patch by Evan Cheng

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

18 years agoTeach the graph viewer to handle register operands that are zero.
Chris Lattner [Sat, 19 Nov 2005 06:58:46 +0000 (06:58 +0000)]
Teach the graph viewer to handle register operands that are zero.

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

18 years agoSilence a bogus warning
Chris Lattner [Sat, 19 Nov 2005 05:51:46 +0000 (05:51 +0000)]
Silence a bogus warning

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

18 years agoAdd load and other support to the dag-dag isel. Patch contributed by Evan
Chris Lattner [Sat, 19 Nov 2005 02:11:08 +0000 (02:11 +0000)]
Add load and other support to the dag-dag isel.  Patch contributed by Evan
Cheng!

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

18 years agoAdd some method variants, patch by Evan Cheng
Chris Lattner [Sat, 19 Nov 2005 01:44:53 +0000 (01:44 +0000)]
Add some method variants, patch by Evan Cheng

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

18 years agoAdd two new construction methods, patch by Evan Cheng
Chris Lattner [Sat, 19 Nov 2005 01:42:10 +0000 (01:42 +0000)]
Add two new construction methods, patch by Evan Cheng

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

18 years agoTeach LLVM how to scalarize packed types. Currently, this only works on
Nate Begeman [Sat, 19 Nov 2005 00:36:38 +0000 (00:36 +0000)]
Teach LLVM how to scalarize packed types.  Currently, this only works on
packed types with an element count of 1, although more generic support is
coming.  This allows LLVM to turn the following code:

void %foo(<1 x float> * %a) {
entry:
  %tmp1 = load <1 x float> * %a;
  %tmp2 = add <1 x float> %tmp1, %tmp1
  store <1 x float> %tmp2, <1 x float> *%a
  ret void
}

Into:

_foo:
        lfs f0, 0(r3)
        fadds f0, f0, f0
        stfs f0, 0(r3)
        blr

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

18 years agotestcase for recent indvars patches
Chris Lattner [Fri, 18 Nov 2005 19:38:15 +0000 (19:38 +0000)]
testcase for recent indvars patches

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

18 years agoFix a crash building 176.gcc due to my recent patch, which only fixed
Chris Lattner [Fri, 18 Nov 2005 18:30:47 +0000 (18:30 +0000)]
Fix a crash building 176.gcc due to my recent patch, which only fixed
half the problem.

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

18 years agoprevent latent switch creation
Andrew Lenharth [Fri, 18 Nov 2005 13:57:03 +0000 (13:57 +0000)]
prevent latent switch creation

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

18 years agoSplit out the shift code from visitBinary.
Nate Begeman [Fri, 18 Nov 2005 07:42:56 +0000 (07:42 +0000)]
Split out the shift code from visitBinary.

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

18 years agoImplement a refinement to the mem2reg algorithm for cases where an alloca
Chris Lattner [Fri, 18 Nov 2005 07:31:42 +0000 (07:31 +0000)]
Implement a refinement to the mem2reg algorithm for cases where an alloca
has a single def.  In this case, look for uses that are dominated by the def
and attempt to rewrite them to directly use the stored value.

This speeds up mem2reg on these values and reduces the number of phi nodes
inserted.  This should address PR665.

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

18 years agoThis needs proper dominance
Chris Lattner [Fri, 18 Nov 2005 07:29:44 +0000 (07:29 +0000)]
This needs proper dominance

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

18 years agopost-dom-frontiers requires proper post-dominance
Chris Lattner [Fri, 18 Nov 2005 07:28:26 +0000 (07:28 +0000)]
post-dom-frontiers requires proper post-dominance

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

18 years agoThis requires proper dominance
Chris Lattner [Fri, 18 Nov 2005 07:27:53 +0000 (07:27 +0000)]
This requires proper dominance

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

18 years agoFix the dominates method to return true if the two nodes are the same. Add
Chris Lattner [Fri, 18 Nov 2005 07:27:33 +0000 (07:27 +0000)]
Fix the dominates method to return true if the two nodes are the same.  Add
a new properlyDominates method to do what the old one did.

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

18 years agoadd more patterns, patch by Evan Cheng.
Chris Lattner [Fri, 18 Nov 2005 01:04:42 +0000 (01:04 +0000)]
add more patterns, patch by Evan Cheng.

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

18 years agoAlso add the new vector value type here, for completeness.
Nate Begeman [Fri, 18 Nov 2005 00:53:32 +0000 (00:53 +0000)]
Also add the new vector value type here, for completeness.

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

18 years agoTeach the type lowering code about turning packed types into vector types.
Nate Begeman [Thu, 17 Nov 2005 21:44:42 +0000 (21:44 +0000)]
Teach the type lowering code about turning packed types into vector types.
Next step: generating vector dag nodes, and legalizing them into scalar
code.

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

18 years agoonly use dyld stubs if not in ppc-static mode. This completes support for
Chris Lattner [Thu, 17 Nov 2005 19:40:30 +0000 (19:40 +0000)]
only use dyld stubs if not in ppc-static mode.  This completes support for
non-static codegen.

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

18 years agoThis was checking the wrong GEP expression. Fixing this fixes a gccas crash
Chris Lattner [Thu, 17 Nov 2005 19:35:42 +0000 (19:35 +0000)]
This was checking the wrong GEP expression.  Fixing this fixes a gccas crash
compiling mysql reported by Ted Kremenek.

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

18 years agorefactor call operand handling to eliminate special cases from printOp.
Chris Lattner [Thu, 17 Nov 2005 19:25:59 +0000 (19:25 +0000)]
refactor call operand handling to eliminate special cases from printOp.

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

18 years agodisentangle call operands from branch operands a bit
Chris Lattner [Thu, 17 Nov 2005 19:16:08 +0000 (19:16 +0000)]
disentangle call operands from branch operands a bit

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

18 years agoadd an option to generate completely non-pic code, corresponding to what
Chris Lattner [Thu, 17 Nov 2005 18:55:48 +0000 (18:55 +0000)]
add an option to generate completely non-pic code, corresponding to what
gcc -static produces on PPC.  This is used for building kexts and other things.

With this, materializing the address of a global looks like:

        lis r2, ha16(L_H$non_lazy_ptr)
        la r3, lo16(L_H$non_lazy_ptr)(r2)

we're still emitting stubs for functions, which is wrong.  That is next.

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

18 years agoFix a bug that resistor on IRC hit where we tried to create token factor
Chris Lattner [Thu, 17 Nov 2005 18:30:17 +0000 (18:30 +0000)]
Fix a bug that resistor on IRC hit where we tried to create token factor
nodes of load results, not of their chain results.

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

18 years agoEnable global address legalization, fixing a todo and allowing the removal
Chris Lattner [Thu, 17 Nov 2005 18:26:56 +0000 (18:26 +0000)]
Enable global address legalization, fixing a todo and allowing the removal
of some code.  This exposes the implicit load from the stubs to the DAG, allowing
them to be optimized by the dag combiner.  It also moves darwin specific stuff
out of the isel into the legalizer, and allows more to be moved to the .td file.

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

18 years agoTeach the selector to fold lo(g) into load instruction immediate fields
Chris Lattner [Thu, 17 Nov 2005 18:02:16 +0000 (18:02 +0000)]
Teach the selector to fold lo(g) into load instruction immediate fields

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

18 years agoGenerate LA and ADDIS when possible.
Chris Lattner [Thu, 17 Nov 2005 17:52:01 +0000 (17:52 +0000)]
Generate LA and ADDIS when possible.

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

18 years agoUse the right accessor to create this node
Chris Lattner [Thu, 17 Nov 2005 17:51:38 +0000 (17:51 +0000)]
Use the right accessor to create this node

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

18 years agoValidate that the input to 'Pat' patterns is sane.
Chris Lattner [Thu, 17 Nov 2005 17:43:52 +0000 (17:43 +0000)]
Validate that the input to 'Pat' patterns is sane.

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

18 years agoAllow users to specify -Wl,-native* multiple times if they please
Chris Lattner [Thu, 17 Nov 2005 16:08:04 +0000 (16:08 +0000)]
Allow users to specify -Wl,-native* multiple times if they please

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

18 years agoteach tblgen to be smart enough to handle tglobaladdr nodes
Chris Lattner [Thu, 17 Nov 2005 07:39:45 +0000 (07:39 +0000)]
teach tblgen to be smart enough to handle tglobaladdr nodes

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

18 years agoAdd an initial hack at legalizing GlobalAddress into the appropriate nodes
Chris Lattner [Thu, 17 Nov 2005 07:30:41 +0000 (07:30 +0000)]
Add an initial hack at legalizing GlobalAddress into the appropriate nodes
on Darwin to remove smarts from the isel.  This is currently disabled by
default (uncomment setOperationAction(ISD::GlobalAddress to enable it).
tblgen needs to become smarter about tglobaladdr nodes and bigger patterns
needed to be added to the .td file.  However, we can currently emit stuff like
this:  :)

        li r2, lo16(L_x$non_lazy_ptr)
        lis r3, ha16(L_x$non_lazy_ptr)
        lwzx r2, r3, r2

The obvious improvements will follow.

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

18 years agoAdd globaladdress and targetglobaladdress nodes for dag patterns
Chris Lattner [Thu, 17 Nov 2005 07:20:15 +0000 (07:20 +0000)]
Add globaladdress and targetglobaladdress nodes for dag patterns

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

18 years agoLI could theoretically be used for the lo-part of a global address, just like
Chris Lattner [Thu, 17 Nov 2005 07:04:43 +0000 (07:04 +0000)]
LI could theoretically be used for the lo-part of a global address, just like
lis can be used for the high part.

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