1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 04:22:57 +02:00
Commit Graph

12734 Commits

Author SHA1 Message Date
Chris Lattner
899754747c more mumbling
llvm-svn: 25826
2006-01-31 00:45:37 +00:00
Chris Lattner
76a85bd047 add some notes
llvm-svn: 25825
2006-01-31 00:20:38 +00:00
Evan Cheng
38aacb5f09 Don't generate complex sequence for SETOLE, SETOLT, SETULT, and SETUGT. Flip
the order of the compare operands and generate SETOGT, SETOGE, SETUGE, and
SETULE instead.

llvm-svn: 25824
2006-01-30 23:41:35 +00:00
Chris Lattner
ce37ba3417 Print the most trivial inline asms.
llvm-svn: 25822
2006-01-30 23:00:08 +00:00
Chris Lattner
e24c6ef1f9 Fix a bug in my legalizer reworking that caused the X86 backend to not get
a chance to custom legalize setcc, which broke a bunch of C++ Codes.
Testcase here: CodeGen/X86/2006-01-30-LongSetcc.ll

llvm-svn: 25821
2006-01-30 22:43:50 +00:00
Chris Lattner
3ae06dac75 Fix FP constants, and the SparcV8/2006-01-22-BitConvertLegalize.ll failure from last night
llvm-svn: 25819
2006-01-30 22:20:49 +00:00
Evan Cheng
8ea651a9a4 i64 -> f32, f32 -> i64 and some clean up.
llvm-svn: 25818
2006-01-30 22:13:22 +00:00
Evan Cheng
d2d96373dc Always use FP stack instructions to perform i64 to f64 as well as f64 to i64
conversions. SSE does not have instructions to handle these tasks.

llvm-svn: 25817
2006-01-30 08:02:57 +00:00
Chris Lattner
baa47e9a6e Revamp the ICC/FCC reading instructions to be parameterized in terms of the
SPARC condition codes, not in terms of the DAG condcodes.  This allows us to
write nice clean patterns for cmovs/branches.

llvm-svn: 25815
2006-01-30 07:43:04 +00:00
Chris Lattner
7925da8b3b Compile:
uint %test(uint %X) {
        %Y = call uint %llvm.ctpop.i32(uint %X)
        ret uint %Y
}

to:

test:
        save -96, %o6, %o6
        sll %i0, 0, %l0
        popc %l0, %i0
        restore %g0, %g0, %g0
        retl
        nop

instead of to 40 logical ops.  Note the shift-by-zero that clears the top
part of the 64-bit V9 register.

Testcase here: CodeGen/SparcV8/ctpop.ll

llvm-svn: 25814
2006-01-30 06:14:02 +00:00
Chris Lattner
0c7df7e9d1 If the target has V9 instructions, this pass is a noop, don't bother
running it.

llvm-svn: 25811
2006-01-30 05:51:14 +00:00
Chris Lattner
69658ab9a8 When in v9 mode, emit fabsd/fnegd/fmovd
llvm-svn: 25810
2006-01-30 05:48:37 +00:00
Chris Lattner
98667e5f6a First step towards V9 instructions in the V8 backend, two conditional move
patterns.  This allows emission of this code:

t1:
        save -96, %o6, %o6
        subcc %i0, %i1, %l0
        move %icc, %i0, %i2
        or %g0, %i2, %i0
        restore %g0, %g0, %g0
        retl
        nop

instead of this:

t1:
        save -96, %o6, %o6
        subcc %i0, %i1, %l0
        be .LBBt1_2     !
        nop
.LBBt1_1:       !
        or %g0, %i2, %i0
.LBBt1_2:       !
        restore %g0, %g0, %g0
        retl
        nop

for this:

int %t1(int %a, int %b, int %c) {
        %tmp.2 = seteq int %a, %b
        %tmp3 = select bool %tmp.2, int %a, int %c
        ret int %tmp3
}

llvm-svn: 25809
2006-01-30 05:35:57 +00:00
Chris Lattner
8b5958a832 Two changes:
1. Default to having V9 instructions, instead of just V8.
2. unless -enable-sparc-v9-insts is passed, disable V9 (for use with llcbeta)

llvm-svn: 25807
2006-01-30 04:57:43 +00:00
Chris Lattner
f0ea60bc01 When lowering SELECT_CC, see if the input is a lowered SETCC. If so, fold
the two operations together.  This allows us to compile this:

void %two(int %a, int* %b) {
        %tmp.2 = seteq int %a, 0
        %tmp.0.0 = select bool %tmp.2, int 10, int 20
        store int %tmp.0.0, int* %b
        ret void
}

into:

two:
        save -96, %o6, %o6
        or %g0, 20, %l0
        or %g0, 10, %l1
        subcc %i0, 0, %l2
        be .LBBtwo_2    ! entry
        nop
.LBBtwo_1:      ! entry
        or %g0, %l0, %l1
.LBBtwo_2:      ! entry
        st %l1, [%i1]
        restore %g0, %g0, %g0
        retl
        nop

instead of:

two:
        save -96, %o6, %o6
        sethi 0, %l0
        or %g0, 1, %l1
        or %g0, 20, %l2
        or %g0, 10, %l3
        subcc %i0, 0, %l4
        be .LBBtwo_2    ! entry
        nop
.LBBtwo_1:      ! entry
        or %g0, %l0, %l1
.LBBtwo_2:      ! entry
        subcc %l1, 0, %l0
        bne .LBBtwo_4   ! entry
        nop
.LBBtwo_3:      ! entry
        or %g0, %l2, %l3
.LBBtwo_4:      ! entry
        st %l3, [%i1]
        restore %g0, %g0, %g0
        retl
        nop

llvm-svn: 25806
2006-01-30 04:34:44 +00:00
Jeff Cohen
d80b0d7375 Add AddSymbol() method to DynamicLibrary to work around Windows limitation
of being unable to search for symbols in an EXE.  It will also allow other
existing hacks to be improved.

llvm-svn: 25805
2006-01-30 04:33:51 +00:00
Chris Lattner
4ba0e38a7a don't insert an and node if it isn't needed here, this can prevent folding
of lowered target nodes.

llvm-svn: 25804
2006-01-30 04:22:28 +00:00
Chris Lattner
a44182300b Move MaskedValueIsZero from the DAGCombiner to the TargetLowering interface,making isMaskedValueZeroForTargetNode simpler, and useable from other partsof the compiler.
llvm-svn: 25803
2006-01-30 04:09:27 +00:00
Chris Lattner
354340b1b1 Implement isMaskedValueZeroForTargetNode for the various v8 selectcc nodes,
allowing redundant and's to be eliminated by the dag combiner.

llvm-svn: 25800
2006-01-30 03:51:45 +00:00
Chris Lattner
26589d32e6 pass the address of MaskedValueIsZero into isMaskedValueZeroForTargetNode,
to permit recursion

llvm-svn: 25799
2006-01-30 03:49:37 +00:00
Chris Lattner
754bc1f46c adjust prototype
llvm-svn: 25798
2006-01-30 03:49:07 +00:00
Jeff Cohen
f8d118706f Fix indentation.
llvm-svn: 25795
2006-01-29 22:02:52 +00:00
Chris Lattner
414a73d6f6 Fix RET of promoted values on targets that custom expand RET to a target node.
llvm-svn: 25794
2006-01-29 21:02:23 +00:00
Chris Lattner
2ab7f21d20 Functions that are lazily streamed in from the .bc file are *not* external.
This fixes llvm-test/SingleSource/UnitTests/2006-01-29-SimpleIndirectCall.c
and PR704

llvm-svn: 25793
2006-01-29 20:49:17 +00:00
Chris Lattner
9bb580ac23 add another note
llvm-svn: 25789
2006-01-29 09:46:06 +00:00
Chris Lattner
7ec490d6d6 add some performance notes from looking at sgefa
llvm-svn: 25788
2006-01-29 09:42:20 +00:00
Chris Lattner
7a775bff1e add a high-priority SSE issue from sgefa
llvm-svn: 25787
2006-01-29 09:14:47 +00:00
Chris Lattner
7048df99cd add a missed optimization
llvm-svn: 25786
2006-01-29 09:08:15 +00:00
Chris Lattner
497157db4d cleanups to the ValueTypeActions interface
llvm-svn: 25785
2006-01-29 08:42:06 +00:00
Chris Lattner
4c6384a412 Now that OpActions is big enough, we can specify actions for vector types
llvm-svn: 25784
2006-01-29 08:41:37 +00:00
Chris Lattner
81edad23a6 clean up interface to ValueTypeActions
llvm-svn: 25783
2006-01-29 08:41:12 +00:00
Chris Lattner
3cddcf86e0 Remove some special case hacks for CALLSEQ_*, using UpdateNodeOperands
instead.

llvm-svn: 25780
2006-01-29 07:58:15 +00:00
Chris Lattner
00e9ba5526 disable this for now
llvm-svn: 25778
2006-01-29 07:31:33 +00:00
Reid Spencer
2669d4cb81 Add a note about lowering llvm.memset, llvm.memcpy, and llvm.memmove to a
few stores under certain conditions.

llvm-svn: 25777
2006-01-29 06:48:25 +00:00
Chris Lattner
73262d78b8 remove now-dead code, the legalizer takes care of this for us
llvm-svn: 25776
2006-01-29 06:45:31 +00:00
Chris Lattner
b66484069a The FP stack doesn't support UNDEF, ask the legalizer to legalize it
instead of lying and saying we have it.

llvm-svn: 25775
2006-01-29 06:44:22 +00:00
Chris Lattner
94e9677374 Allow custom expansion of ConstantVec nodes. PPC will use this in the future.
llvm-svn: 25774
2006-01-29 06:34:16 +00:00
Chris Lattner
6c4173145e Request expansion of ConstantVec nodes.
llvm-svn: 25773
2006-01-29 06:32:58 +00:00
Chris Lattner
3f97b9cfa3 Legalize ConstantFP into TargetConstantFP when the target allows. Implement
custom expansion of ConstantFP nodes.

llvm-svn: 25772
2006-01-29 06:26:56 +00:00
Chris Lattner
5f0a3df176 Targets all now request ConstantFP to be legalized into TargetConstantFP.
'fpimm' in .td files is now TargetConstantFP.

llvm-svn: 25771
2006-01-29 06:26:08 +00:00
Chris Lattner
ca5c2d7a4c Update alpha to reflect recent constantfp legalize changes. It's not clear
why all this code isn't autogenerated. :(

llvm-svn: 25770
2006-01-29 06:25:22 +00:00
Chris Lattner
82b23c2f5c eliminate uses of SelectionDAG::getBR2Way_CC
llvm-svn: 25767
2006-01-29 06:00:45 +00:00
Chris Lattner
7a06abe72b cmovle != cmovlt
llvm-svn: 25761
2006-01-29 03:47:30 +00:00
Jeff Cohen
28a7bd94c9 Fix typo.
llvm-svn: 25760
2006-01-29 03:45:35 +00:00
Jeff Cohen
3ef56b005a Flesh out AMD family/models.
llvm-svn: 25755
2006-01-28 20:30:18 +00:00
Jeff Cohen
08656fa2a6 Correctly determine CPU vendor.
llvm-svn: 25754
2006-01-28 19:48:34 +00:00
Jeff Cohen
057816014c Use union instead of reinterpret_cast.
llvm-svn: 25751
2006-01-28 18:47:32 +00:00
Jeff Cohen
6d330738c1 Fix recognition of Intel CPUs.
llvm-svn: 25750
2006-01-28 18:38:20 +00:00
Chris Lattner
e5bf55bf7b Is64Bit reflects the capability of the chip, not an aspect of the target os
llvm-svn: 25749
2006-01-28 18:23:48 +00:00
Chris Lattner
0256ca3257 Fix a bunch of JIT failures with the new isel
llvm-svn: 25748
2006-01-28 18:19:37 +00:00
Jeff Cohen
4d971bdfa7 Improve X86 subtarget support for Windows and AMD.
llvm-svn: 25747
2006-01-28 18:09:06 +00:00
Chris Lattner
40973347bf Use the new "UpdateNodeOperands" method to simplify LegalizeDAG and make it
faster.  This cuts about 120 lines of code out of the legalizer (mostly code
checking to see if operands have changed).

It also fixes an ugly performance issue, where the legalizer cloned the entire
graph after any change.  Now the "UpdateNodeOperands" method gives it a chance
to reuse nodes if the operands of a node change but not its opcode or valuetypes.

This speeds up instruction selection time on kimwitu++ by about 8.2% with a
release build.

llvm-svn: 25746
2006-01-28 10:58:55 +00:00
Chris Lattner
744d9a40f0 silence a warning
llvm-svn: 25745
2006-01-28 10:34:47 +00:00
Chris Lattner
8768eb7532 add another method variant
llvm-svn: 25744
2006-01-28 10:09:25 +00:00
Chris Lattner
63f7e84632 add some methods for updating nodes
llvm-svn: 25742
2006-01-28 09:32:45 +00:00
Chris Lattner
99bdf26410 minor tweaks
llvm-svn: 25740
2006-01-28 08:31:04 +00:00
Chris Lattner
94ab3cee71 move a bunch of code, no other change.
llvm-svn: 25739
2006-01-28 08:25:58 +00:00
Chris Lattner
9633d61b5b remove a couple more now-extraneous legalizeop's
llvm-svn: 25738
2006-01-28 08:22:56 +00:00
Chris Lattner
4bc3abc3d0 fix a bug
llvm-svn: 25737
2006-01-28 07:42:08 +00:00
Chris Lattner
8eed1b6bda Several major changes:
1. Pull out the expand cases for BSWAP and CT* into a separate function,
   reducing the size of LegalizeOp.
2. Fix a bug where expand(bswap i64) was wrong when i64 is legal.
3. Changed LegalizeOp/PromoteOp so that the legalizer never needs to be
   iterative.  It now operates in a single pass over the nodes.
4. Simplify a LOT of code, with a net reduction of ~280 lines.

llvm-svn: 25736
2006-01-28 07:39:30 +00:00
Chris Lattner
d2eb15f467 Fix a bug in my elimination of ISD::CALL this morning. PPC now has to
provide the expansion for i64 calls itself

llvm-svn: 25735
2006-01-28 07:33:03 +00:00
Chris Lattner
686a1203f0 make this work on non-native hosts
llvm-svn: 25734
2006-01-28 06:05:41 +00:00
Chris Lattner
170727421b add a note about how we should implement this FIXME from the legalizer:
// FIXME: revisit this when we have some kind of mechanism by which targets
    // can decided legality of vector constants, of which there may be very
    // many.

llvm-svn: 25733
2006-01-28 05:40:47 +00:00
Chris Lattner
84086fd689 Eliminate the need for ExpandOp to set 'needsanotheriteration', as it already
relegalizes the stuff it returns.

Add the ability to custom expand ADD/SUB, so that targets don't need to deal
with ADD_PARTS/SUB_PARTS if they don't want.

Fix some obscure potential bugs and simplify code.

llvm-svn: 25732
2006-01-28 05:07:51 +00:00
Chris Lattner
3b5a984065 Instead of making callers of ExpandLibCall legalize the result, make
ExpandLibCall do it itself.

llvm-svn: 25731
2006-01-28 04:28:26 +00:00
Chris Lattner
045a778e63 Eliminate the need to do another iteration of the legalizer after inserting
a libcall.

llvm-svn: 25730
2006-01-28 04:23:12 +00:00
Chris Lattner
d6d4bcc419 remove method I just added
llvm-svn: 25728
2006-01-28 03:43:09 +00:00
Chris Lattner
063c13029b add a new callback
llvm-svn: 25727
2006-01-28 03:37:03 +00:00
Nate Begeman
87c2c0e66b Implement Promote for VAARG, and allow it to be custom promoted for people
who don't want the default behavior (Alpha).

llvm-svn: 25726
2006-01-28 03:14:31 +00:00
Nate Begeman
a46156da35 Add a couple more things to the readme.
llvm-svn: 25724
2006-01-28 01:22:10 +00:00
Nate Begeman
dc3fba6b6b Add a missing case to the dag combiner.
llvm-svn: 25723
2006-01-28 01:06:30 +00:00
Chris Lattner
e7428f436a Remove the ISD::CALL and ISD::TAILCALL nodes
llvm-svn: 25721
2006-01-28 00:18:58 +00:00
Chris Lattner
d467a681e9 Remove some dead code
llvm-svn: 25719
2006-01-28 00:02:51 +00:00
Chris Lattner
2d4f83eaaf Switch to AlphaISD::CALL instead of ISD::CALL
llvm-svn: 25718
2006-01-27 23:39:00 +00:00
Chris Lattner
6a5d2450a3 Use PPCISD::CALL instead of ISD::CALL
llvm-svn: 25717
2006-01-27 23:34:02 +00:00
Chris Lattner
ab3ad7d4ef Use V8ISD::CALL instead of ISD::CALL
llvm-svn: 25716
2006-01-27 23:30:03 +00:00
Evan Cheng
442713efd7 A bit of wisdom from Chris on the last entry.
llvm-svn: 25715
2006-01-27 22:54:32 +00:00
Evan Cheng
03aaa82992 AT&T assembly convention: registers are in lower case.
llvm-svn: 25714
2006-01-27 22:53:29 +00:00
Chris Lattner
c245c32022 initialize member vars
llvm-svn: 25712
2006-01-27 22:38:36 +00:00
Chris Lattner
35d325e8aa initialize all instance vars
llvm-svn: 25711
2006-01-27 22:37:09 +00:00
Chris Lattner
59a4f3f637 Make llvm.frame/returnaddr not crash on ppc
llvm-svn: 25710
2006-01-27 22:25:06 +00:00
Evan Cheng
51c1d32061 Added notes about a x86 isel deficiency.
llvm-svn: 25706
2006-01-27 22:11:01 +00:00
Evan Cheng
5c1d0d40dc Added a temporary option -enable-x86-sse to enable sse support. It is used by
llc-beta.

llvm-svn: 25701
2006-01-27 21:49:34 +00:00
Evan Cheng
746086dc97 Bye bye Pattern ISel, hello DAG ISel.
llvm-svn: 25700
2006-01-27 21:26:54 +00:00
Nate Begeman
d2c6fbef4a Remove TLI.LowerReturnTo, and just let targets custom lower ISD::RET for
the same functionality.  This addresses another piece of bug 680.  Next,
on to fixing Alpha VAARG, which I broke last time.

llvm-svn: 25696
2006-01-27 21:09:22 +00:00
Jim Laskey
c8759505c4 Using bit size of integers instead of ambiguous "long" et all.
llvm-svn: 25694
2006-01-27 20:31:25 +00:00
Evan Cheng
577ea086c4 A better workaround
llvm-svn: 25692
2006-01-27 19:30:30 +00:00
Jim Laskey
2221ac79d5 Sorry - really folowing convention.
llvm-svn: 25691
2006-01-27 18:32:41 +00:00
Chris Lattner
932260bb64 force sse/3dnow off until they work. This fixes all the x86 failures last night
llvm-svn: 25690
2006-01-27 18:30:50 +00:00
Jim Laskey
479abc37ff Following convention.
llvm-svn: 25689
2006-01-27 18:28:31 +00:00
Chris Lattner
e1f4b9e384 Unbreak the JIT with SSE
llvm-svn: 25688
2006-01-27 18:27:18 +00:00
Andrew Lenharth
67e53709df fix build
llvm-svn: 25687
2006-01-27 18:16:17 +00:00
Chris Lattner
e4128dc8dc Fix build error that is apparently only a warning with some compilers.
llvm-svn: 25686
2006-01-27 17:31:30 +00:00
Jim Laskey
5ed7bc82cc Forgot the version number.
llvm-svn: 25685
2006-01-27 15:46:54 +00:00
Jim Laskey
89492c12bb Improve visibility/correctness of operand indices in "llvm.db" objects.
Handle 64 in DIEs.

llvm-svn: 25684
2006-01-27 15:20:54 +00:00
Reid Spencer
bd79be19a2 Fix auto-upgrade of intrinsics to work properly with both assembly and
bytecode reading. This code is crufty, the result of much hacking to get things
working correctly. Cleanup patches will follow.

llvm-svn: 25682
2006-01-27 11:49:27 +00:00
Evan Cheng
5891f49c47 x86 CPU detection and proper subtarget support
llvm-svn: 25679
2006-01-27 08:10:46 +00:00
Evan Cheng
77885c204d Subtarget feature can now set any variable to any value
llvm-svn: 25678
2006-01-27 08:09:42 +00:00
Chris Lattner
09d8aa244e Stub out a method
llvm-svn: 25676
2006-01-27 02:10:10 +00:00
Chris Lattner
20d4194a0d PHI and INLINEASM are now built-in instructions provided by Target.td
llvm-svn: 25674
2006-01-27 01:46:15 +00:00
Chris Lattner
8cef15a908 Add a default NoItinerary class for targets to use.
llvm-svn: 25670
2006-01-27 01:41:38 +00:00
Chris Lattner
a1769576f0 Teach the scheduler to emit the appropriate INLINEASM MachineInstr for an
ISD::INLINEASM node.

llvm-svn: 25668
2006-01-26 23:28:04 +00:00
Chris Lattner
b2771c7fcb initial selectiondag support for new INLINEASM node. Note that inline asms
with outputs or inputs are not supported yet. :)

llvm-svn: 25664
2006-01-26 22:24:51 +00:00
Jim Laskey
df47d0df3e Use global information to fill out Dwarf compile units.
llvm-svn: 25662
2006-01-26 21:22:49 +00:00
Jeff Cohen
f329a41a66 Improve compatibility with VC2005, patch by Morten Ofstad!
llvm-svn: 25661
2006-01-26 20:41:32 +00:00
Chris Lattner
800999ca4b Implement a method for inline asm support
llvm-svn: 25660
2006-01-26 20:37:03 +00:00
Jim Laskey
583aae3110 Set up MachineDebugInfo to scan for debug information form "llvm.db"g globals.
Global Variable information is now pulled from "llvm.dbg.globals"

llvm-svn: 25655
2006-01-26 20:21:46 +00:00
Chris Lattner
bfd5404cbf Improve compatibility with VC2005, patch by Morten Ofstad!
llvm-svn: 25653
2006-01-26 19:55:20 +00:00
Andrew Lenharth
a2054ac660 dynamically allocate plugin space as needed
llvm-svn: 25652
2006-01-26 19:38:58 +00:00
Andrew Lenharth
c2973ea159 Remember plugins should someone like bugpoint want to know them.
llvm-svn: 25649
2006-01-26 18:36:50 +00:00
Evan Cheng
670dc80530 Added preliminary x86 subtarget support.
llvm-svn: 25645
2006-01-26 09:53:06 +00:00
Duraid Madina
f868d1777b fix stack corruption! Previously, 16-byte whole-FP-register stores were
being treated as needing only 8 bytes (though they were 16 byte aligned.)

This should fix a bunch of tests - anyone have any comments, though?

  - in Target.td , SpillSize and SpillAlignment seem dead - is this what
    Size and Alignment do now?
  - in CodeGenRegisters.h/CodeGenTarget.cpp , DeclaredSpillSize and
    DeclaredSpillAlignment seem dead.
  - there are a bunch of comments here and there that don't clearly
    distinguish between 'size' and 'spillsize' etc. hmm.

llvm-svn: 25644
2006-01-26 09:45:03 +00:00
Duraid Madina
13335846a8 some hoovering
llvm-svn: 25643
2006-01-26 09:08:31 +00:00
Chris Lattner
0204d70798 Rest of subtarget support, remove references to ppc
llvm-svn: 25642
2006-01-26 07:22:22 +00:00
Chris Lattner
eb424bfbca Add trivial subtarget support
llvm-svn: 25641
2006-01-26 06:51:21 +00:00
Andrew Lenharth
23afe2f288 minor renaming
llvm-svn: 25640
2006-01-26 03:24:15 +00:00
Andrew Lenharth
ad88ba7c98 allow R28 to be used for frame calculations without entirely removing it from circulation
llvm-svn: 25639
2006-01-26 03:22:07 +00:00
Evan Cheng
7a77e3f80c Work around some x86 Darwin assembler bugs
llvm-svn: 25638
2006-01-26 02:27:43 +00:00
Chris Lattner
c88610d074 add method for constraint parsing
llvm-svn: 25637
2006-01-26 02:21:59 +00:00
Evan Cheng
bf29b90240 When trying to fold X86::SETCC into a Select, make a copy if it has more than
one use. This allows more CMOV instructions.

llvm-svn: 25634
2006-01-26 02:13:10 +00:00
Chris Lattner
66f10c8957 teach the cloner to handle inline asms
llvm-svn: 25633
2006-01-26 01:55:22 +00:00
Chris Lattner
a0c517622a parse and verify the constraint string.
llvm-svn: 25631
2006-01-26 00:48:33 +00:00
Evan Cheng
fcd2a73349 Clean up some code; improve efficiency; and fixed a potential bug involving
chain successors.

llvm-svn: 25630
2006-01-26 00:30:29 +00:00
Evan Cheng
224e14daa1 Remove the uses of STATUS flag register. Rely on node property SDNPInFlag,
SDNPOutFlag, and SDNPOptInFlag instead.

llvm-svn: 25629
2006-01-26 00:29:36 +00:00
Chris Lattner
e930f6bafb Make sure the only user of InlineAsm's are direct calls.
llvm-svn: 25626
2006-01-26 00:08:45 +00:00
Andrew Lenharth
084c16fe59 oops
llvm-svn: 25623
2006-01-25 23:33:32 +00:00
Chris Lattner
db805c3206 add bc reader/writer support for inline asm
llvm-svn: 25621
2006-01-25 23:08:15 +00:00
Andrew Lenharth
01e5b9e862 forgot one
llvm-svn: 25620
2006-01-25 22:28:07 +00:00
Chris Lattner
a4f17ed13e regenerate
llvm-svn: 25619
2006-01-25 22:27:16 +00:00
Chris Lattner
ac76b3c549 Parse inline asm objects
llvm-svn: 25618
2006-01-25 22:26:43 +00:00
Chris Lattner
b31becf499 Print InlineAsm objects
llvm-svn: 25617
2006-01-25 22:26:05 +00:00
Andrew Lenharth
d932b627f7 make things compile again
llvm-svn: 25614
2006-01-25 21:54:38 +00:00
Reid Spencer
f45272f413 Don't break the optimized build (by incorrect placement of #endif)
llvm-svn: 25613
2006-01-25 21:49:13 +00:00
Chris Lattner
d36993d81d Change inline asms to be uniqued like constants, not embedded in a Module.
llvm-svn: 25610
2006-01-25 18:57:27 +00:00
Chris Lattner
91a347233d initialize an instance var, apparently I forgot to commit this long ago
llvm-svn: 25609
2006-01-25 18:57:15 +00:00
Evan Cheng
168b8c5b29 No need to keep track of top and bottom nodes in a group since the vector is
already in order. Thanks Jim for pointing it out.

llvm-svn: 25608
2006-01-25 18:54:24 +00:00
Evan Cheng
7da6daadc7 Set SchedulingForLatency to be the default scheduling preference for all.
llvm-svn: 25607
2006-01-25 18:52:42 +00:00
Nate Begeman
c29fac7fce First part of bug 680:
Remove TLI.LowerVA* and replace it with SDNodes that are lowered the same
way as everything else.

llvm-svn: 25606
2006-01-25 18:21:52 +00:00
Jeff Cohen
fdbce069c5 Make it even more portable.
llvm-svn: 25605
2006-01-25 17:18:50 +00:00
Jeff Cohen
7d0e421a42 Fix VC++ compilation error.
llvm-svn: 25604
2006-01-25 17:17:49 +00:00
Evan Cheng
c368fb710f Default scheduling preference is SchedulingForLatency.
llvm-svn: 25603
2006-01-25 09:15:54 +00:00
Evan Cheng
46f85ddd84 X86 prefer scheduling for reduced register pressure.
llvm-svn: 25602
2006-01-25 09:15:17 +00:00
Evan Cheng
0296933dbe Bottom up register usage reducing list scheduler.
llvm-svn: 25601
2006-01-25 09:14:32 +00:00
Evan Cheng
d95c4530e7 Keep track of bottom / top element of a set of flagged nodes.
llvm-svn: 25600
2006-01-25 09:13:41 +00:00
Evan Cheng
69d30b1c55 If scheduler choice is the default (-sched=default), use target scheduling
preference to determine which scheduler to use. SchedulingForLatency ==
Breadth first; SchedulingForRegPressure == bottom up register reduction list
scheduler.

llvm-svn: 25599
2006-01-25 09:12:57 +00:00
Evan Cheng
b463e81b83 Fix a selectcc lowering bug. Make a copy of X86ISD::CMP when folding it.
llvm-svn: 25596
2006-01-25 09:05:09 +00:00
Chris Lattner
8ddb0c3df8 Loosen up these checks to allow direct uses of ESP
llvm-svn: 25595
2006-01-25 08:00:36 +00:00
Jeff Cohen
3218a69301 Portably cast a pointer to an integer.
llvm-svn: 25594
2006-01-25 02:40:10 +00:00
Duraid Madina
7d51a9b8e3 add bundling! well not really, for now it's just stop-insertion.
llvm-svn: 25593
2006-01-25 02:23:38 +00:00
Andrew Lenharth
3b1babbf44 maintaining stackpointer alignment. Perhaps it doesn't matter
llvm-svn: 25592
2006-01-25 01:51:08 +00:00
Andrew Lenharth
0940295a7a fix build on 64 bit hosts
llvm-svn: 25591
2006-01-24 21:26:43 +00:00
Chris Lattner
84f2acfaa0 Fix Regression/Transforms/ScalarRepl/2006-01-24-IllegalUnionPromoteCrash.ll
llvm-svn: 25587
2006-01-24 19:36:27 +00:00
Chris Lattner
f2a2d62f48 use ESP directly, not a copy of ESP into some other register for fastcc calls
llvm-svn: 25584
2006-01-24 06:14:44 +00:00
Chris Lattner
cfb7a75ce9 Fix an infinite loop I caused by making sure to legalize the flag operand
of CALLSEQ_* nodes

llvm-svn: 25582
2006-01-24 05:48:21 +00:00
Chris Lattner
c078165ea6 Emit the copies out of call return registers *after* the ISD::CALLSEQ_END
node, fixing fastcc and the case where a function has a frame pointer due
to dynamic allocas.

llvm-svn: 25580
2006-01-24 05:17:12 +00:00
Chris Lattner
2873307819 Allow jit-beta to work
llvm-svn: 25578
2006-01-24 04:50:48 +00:00
Jeff Cohen
ed41a16e5f Fix VC++ compilation error.
llvm-svn: 25577
2006-01-24 04:43:17 +00:00
Jeff Cohen
7c5aa59551 Remove unused variables.
llvm-svn: 25576
2006-01-24 04:42:53 +00:00
Chris Lattner
d09c95f83c rename method
llvm-svn: 25572
2006-01-24 04:16:34 +00:00
Chris Lattner
2cbee3afee Rename method
llvm-svn: 25571
2006-01-24 04:14:29 +00:00
Chris Lattner
50ba79e71b Initial checkin of the InlineAsm class
llvm-svn: 25570
2006-01-24 04:13:11 +00:00
Jim Laskey
18ba7ce7b3 Crude Dwarf global variable debugging.
llvm-svn: 25569
2006-01-24 00:49:18 +00:00
Chris Lattner
c53f8ef744 Pretty print file-scope asm blocks.
llvm-svn: 25568
2006-01-24 00:45:30 +00:00
Chris Lattner
239ebe1535 syntax change
llvm-svn: 25567
2006-01-24 00:40:17 +00:00
Chris Lattner
ba1b666382 Print file-scope inline asm blocks at the start of the output file.
llvm-svn: 25565
2006-01-23 23:47:53 +00:00
Chris Lattner
8f3a1256b7 Add support for reading/writing inline asm
llvm-svn: 25564
2006-01-23 23:43:17 +00:00
Chris Lattner
0af0dbcfa5 Add support for linking inline asm
llvm-svn: 25560
2006-01-23 23:08:37 +00:00
Chris Lattner
c06c8d8c06 When cloning a module, clone the inline asm.
llvm-svn: 25559
2006-01-23 23:06:28 +00:00
Chris Lattner
17eded3dea regenerate
llvm-svn: 25558
2006-01-23 23:05:42 +00:00
Chris Lattner
1f9d99295e Add support for parsing global asm blocks
llvm-svn: 25557
2006-01-23 23:05:15 +00:00
Chris Lattner
597ab252ea Print out inline asm strings
llvm-svn: 25556
2006-01-23 23:03:36 +00:00
Andrew Lenharth
757829acec bye bye Pattern ISEL
llvm-svn: 25553
2006-01-23 21:56:07 +00:00
Andrew Lenharth
f7d549848c added stores to lsmark
llvm-svn: 25552
2006-01-23 21:51:33 +00:00
Andrew Lenharth
35efa9c2d9 another couple selects
llvm-svn: 25551
2006-01-23 21:51:14 +00:00
Andrew Lenharth
85b5ef30e5 fix up more lsmark stuff
llvm-svn: 25550
2006-01-23 21:23:26 +00:00
Andrew Lenharth
b7a4322232 yea, lowering this stuff will basically work
llvm-svn: 25549
2006-01-23 20:59:50 +00:00
Andrew Lenharth
28a8d211f6 another selectto
llvm-svn: 25548
2006-01-23 20:59:12 +00:00
Jim Laskey
e4ff0868a1 Typo.
llvm-svn: 25545
2006-01-23 13:34:04 +00:00
Evan Cheng
f622869383 Skeleton of the list schedule.
llvm-svn: 25544
2006-01-23 08:26:10 +00:00
Evan Cheng
8cae3b8cdb Minor clean up.
llvm-svn: 25543
2006-01-23 08:25:34 +00:00
Reid Spencer
8469bdf93a Revert last patch because it messes up the JIT, amongst other things.
llvm-svn: 25541
2006-01-23 08:11:03 +00:00
Reid Spencer
f45b85c023 For PR411:
No functionality changes, just improve the code by a) providing better
function names, b) eliminating a call to get_suffix and c) tightening up
a function elimination test to reduce further checking.

llvm-svn: 25540
2006-01-23 07:42:30 +00:00
Reid Spencer
766d1975a9 For PR411:
Don't try to be smart about fixing intrinsic functions when they're read
in, just fix them after the module is read when all names are resolved.

llvm-svn: 25539
2006-01-23 07:39:03 +00:00
Chris Lattner
3b0a29a694 Fix Regression/CodeGen/SparcV8/2006-01-22-BitConvertLegalize.ll by making
sure that the result of expanding a BIT_CONVERT node is itself legalized.

llvm-svn: 25538
2006-01-23 07:30:46 +00:00
Evan Cheng
b6bc5af6c8 Remove a couple of unnecessary #include's
llvm-svn: 25535
2006-01-23 07:21:01 +00:00
Chris Lattner
39bdbf2ad2 remove the V8 simple isel
llvm-svn: 25534
2006-01-23 07:20:15 +00:00
Evan Cheng
37c62244a6 Factor out more instruction scheduler code to the base class.
llvm-svn: 25532
2006-01-23 07:01:07 +00:00
Chris Lattner
6e1f262158 add a bunch more optimizations for unary double math functions
llvm-svn: 25530
2006-01-23 06:24:46 +00:00
Duraid Madina
fa9095ff95 die, die!! r15, you are not callee-saved
llvm-svn: 25527
2006-01-23 06:11:45 +00:00
Duraid Madina
43e8616515 fix register corruption! (my god.) r15 is a scratch reg, using that as
a frame pointer is a pretty doofus thing to do. use r5 instead, and
mark it callee-saved, coz that's what it is!

llvm-svn: 25526
2006-01-23 06:08:46 +00:00
Chris Lattner
22fa9eeac1 Refactor/genericize this, no functionality change
llvm-svn: 25525
2006-01-23 05:57:36 +00:00
Chris Lattner
adb63115bc Fix bugs lowering stackrestore, fixing 2004-08-12-InlinerAndAllocas.c on
PPC.

llvm-svn: 25522
2006-01-23 05:22:07 +00:00
Chris Lattner
ff2ce95673 Speedup and simplify pass registration by the observation that there is
exactly one PassInfo object per RegisterPass object and that their lifetimes
are the same.  As such, there is no reason for the RegisterPass object to
dynamically allocate the PassInfo object at compiler startup time: just inline
the object by-value.  This should reduce codesize, heap size, and startup time. Yaay.

llvm-svn: 25521
2006-01-23 01:01:04 +00:00
Chris Lattner
201586783d Add #include of <iostream>
llvm-svn: 25516
2006-01-22 23:41:42 +00:00
Chris Lattner
aafc339b4e Add explicit #includes of <iostream>
llvm-svn: 25515
2006-01-22 23:41:00 +00:00
Chris Lattner
2588f0eb8f Make iostream #inclusion explicit
llvm-svn: 25514
2006-01-22 23:32:06 +00:00
Chris Lattner
15ec384b49 Add explicit iostream #includes
llvm-svn: 25513
2006-01-22 23:19:18 +00:00
Chris Lattner
0dbef6ec71 Make this more efficient in the following ways:
1. Do not statically construct a map when the program starts up, this
   is expensive and cannot be optimized.  Instead, create a list.
2. Do not insert entries for all function in the module into a hashmap
   that lives the full life of the compiler.

llvm-svn: 25512
2006-01-22 23:10:26 +00:00
Chris Lattner
adff158fbd Add explicit #includes of <iostream>
llvm-svn: 25509
2006-01-22 22:53:01 +00:00
Chris Lattner
305fee5118 Several non-functionality changing changes:
1. Use the varargs version of getOrInsertFunction to simplify code.
2. remove #include
3. Reduce the number of #ifdef's.
4. remove extraneous vertical whitespace.

llvm-svn: 25508
2006-01-22 22:35:08 +00:00
Chris Lattner
a7ff02319f Fix a bug in a recent refactor that caused a bunch of programs to miscompile
or the compiler to crash.

llvm-svn: 25503
2006-01-21 19:12:11 +00:00
Duraid Madina
019bfb760c insignificant, but next up is proper stack frame layout!
llvm-svn: 25497
2006-01-21 14:27:19 +00:00
Chris Lattner
9f233fa260 Fix CodeGen/PowerPC/2006-01-20-ShiftPartsCrash.ll
llvm-svn: 25496
2006-01-21 04:27:00 +00:00
Evan Cheng
2e4479d4a8 Rename fcmovae to fcmovnb and fcmova to fcmovnbe (following Intel manual).
Some assemblers can't recognize the aliases.

llvm-svn: 25494
2006-01-21 02:55:41 +00:00
Evan Cheng
4a57a7551f Do some code refactoring on Jim's scheduler in preparation of the new list
scheduler.

llvm-svn: 25493
2006-01-21 02:32:06 +00:00
Chris Lattner
1ecabc5a6f trivial formatting improvement: don't insert extra blank lines between .comm
vars.

llvm-svn: 25492
2006-01-21 01:35:26 +00:00
Jim Laskey
75adb3d269 Simplify search for abbreviations.
llvm-svn: 25491
2006-01-21 01:13:18 +00:00
Jim Laskey
08d15fdc02 Correct some simple errors.
llvm-svn: 25490
2006-01-21 00:59:54 +00:00
Jim Laskey
946caff856 Right size integer values before emitting.
llvm-svn: 25489
2006-01-20 21:02:36 +00:00
Robert Bocchino
2fd552ac25 Make the C writer work with packed types. printContainedStructs is
still not quite right and will be fixed later.

llvm-svn: 25488
2006-01-20 20:43:57 +00:00
Jim Laskey
b2abea6ab6 Reworked how Dwarf debug info entries and abbreviations are handled. Added
pubnames and debuy str sections.

llvm-svn: 25487
2006-01-20 20:34:06 +00:00
Duraid Madina
2715941e86 remove RET hack, add proper support for rets (watching out for ret voids)
llvm-svn: 25486
2006-01-20 20:24:31 +00:00
Chris Lattner
38de8a67d5 Simplify CWriter::printContainedStructs, also allowing it to work with
PackedTypes as a side-effect.

llvm-svn: 25485
2006-01-20 18:57:03 +00:00
Chris Lattner
eacfe56de8 LowerReturn now doesn't have to handle f32 returns.
llvm-svn: 25484
2006-01-20 18:41:25 +00:00
Chris Lattner
a348dc9195 remove some unintentionally committed code
llvm-svn: 25483
2006-01-20 18:40:10 +00:00
Chris Lattner
737a8dab41 If the target doesn't support f32 natively, insert the FP_EXTEND in target-indep
code, so that the LowerReturn code doesn't have to handle it.

llvm-svn: 25482
2006-01-20 18:38:32 +00:00
Robert Bocchino
51e0be55e8 Fixed InitializeMemory to handle ConstantPacked.
llvm-svn: 25481
2006-01-20 18:18:40 +00:00
Chris Lattner
f4277eb311 Remove dead expression.
llvm-svn: 25480
2006-01-20 18:04:43 +00:00
Chris Lattner
01e9dbfd60 Don't use invalidated use_iterator's. This fixes a crash compiling povray
llvm-svn: 25479
2006-01-20 18:01:41 +00:00
Duraid Madina
94bace229d fix sext breakage: now we correctly deal with functions that return
int vs uint

llvm-svn: 25478
2006-01-20 16:10:05 +00:00
Duraid Madina
b18a42fd3a fix storing bools! eek!
llvm-svn: 25476
2006-01-20 03:40:25 +00:00
Evan Cheng
ffbc93d829 Stop doing that accidental commit.
llvm-svn: 25474
2006-01-20 01:14:05 +00:00
Evan Cheng
2b24240110 A few more SH{L|R}D peepholes.
llvm-svn: 25473
2006-01-20 01:13:30 +00:00
Robert Bocchino
40c6c91f56 ConstantFoldLoadThroughGEPConstantExpr wasn't handling pointers to
packed types correctly.

llvm-svn: 25470
2006-01-19 23:53:23 +00:00
Evan Cheng
d2c0ccedd3 Didn't mean to commit the last one.
llvm-svn: 25469
2006-01-19 23:27:08 +00:00
Evan Cheng
e0f6454c5e Added i16 SH{L|R}D patterns.
llvm-svn: 25468
2006-01-19 23:26:24 +00:00
Chris Lattner
3158146649 add support for ConstantPacked to the linker
llvm-svn: 25467
2006-01-19 23:15:58 +00:00
Andrew Lenharth
96520cb68d typo
llvm-svn: 25464
2006-01-19 21:10:38 +00:00
Andrew Lenharth
9abecccdcb nasty nasty patterns
llvm-svn: 25463
2006-01-19 20:49:37 +00:00
Duraid Madina
069b517767 fix boolean XOR (which fixes up comparisons..)
llvm-svn: 25462
2006-01-19 15:18:56 +00:00
Duraid Madina
4b75614c9c BOOM!
llvm-svn: 25460
2006-01-19 14:14:11 +00:00
Duraid Madina
08771721f9 click click
llvm-svn: 25459
2006-01-19 14:13:11 +00:00
Evan Cheng
680a8e070b Avoid generating a redundant setcc.
llvm-svn: 25457
2006-01-19 08:52:46 +00:00
Reid Spencer
585019f629 For PR696:
Don't do floor->floorf conversion if floorf is not available. This checks
the compiler's host, not its target, which is incorrect for cross-compilers
Not sure that's important as we don't build many cross-compilers.

llvm-svn: 25456
2006-01-19 08:36:56 +00:00
Duraid Madina
1946b2ff30 fix calls that return f32
llvm-svn: 25455
2006-01-19 08:31:51 +00:00
Chris Lattner
6e4d8741d5 Implement casts.ll:test26: a cast from float -> double -> integer, doesn't
need the float->double part.

llvm-svn: 25452
2006-01-19 07:40:22 +00:00
Chris Lattner
b15de45374 implement support for f32 arguments past the first 6 words
llvm-svn: 25450
2006-01-19 07:22:29 +00:00
Reid Spencer
f2454f5cd2 1. Identify bytecode modules that have upgraded intrinsics by setting a
boolean flag if we read a function prototype that needs upgrading.
2. Don't upgrade the CallInst instruction until after its been inserted
   into the basic block, and only if we know that we have seen an
   upgraded intrinsic function.

llvm-svn: 25448
2006-01-19 07:02:16 +00:00
Reid Spencer
ff84512a3f Don't forget about casting the result of an upgraded call to an intrinsic
in the case where it needs to cast back to a signed type.

llvm-svn: 25447
2006-01-19 07:00:29 +00:00
Reid Spencer
997e2d7b3c Add a flag to identify bytecode files that have intrinsic functions that
need to be upgraded.

llvm-svn: 25445
2006-01-19 06:57:58 +00:00
Evan Cheng
cfe9d47379 adc and sbb need an incoming flag to ensure it reads the carry flag
from add / sub.

llvm-svn: 25444
2006-01-19 06:53:20 +00:00
Reid Spencer
8fd4d8e166 Make get_suffix faster by using a switch on getTypeID rather than a series
of comparisons on the various type objects.

llvm-svn: 25441
2006-01-19 05:37:27 +00:00
Evan Cheng
3f6b496700 Another typo
llvm-svn: 25440
2006-01-19 04:54:52 +00:00
Chris Lattner
60bc56e930 add a note
llvm-svn: 25439
2006-01-19 02:09:38 +00:00
Evan Cheng
be2cf5f948 Two peepholes:
(or (x >> c) | (y << (32 - c))) ==> (shrd x, y, c)
(or (x << c) | (y >> (32 - c))) ==> (shld x, y, c)

llvm-svn: 25438
2006-01-19 01:56:29 +00:00
Evan Cheng
ddb170b73e Didn't mean to check that in.
llvm-svn: 25436
2006-01-19 01:52:56 +00:00
Evan Cheng
aebece2f7b A obvious typo
llvm-svn: 25435
2006-01-19 01:46:14 +00:00
Reid Spencer
fd0ae0047a Make sure intrinsic auto-upgrade is invoked correctly.
llvm-svn: 25434
2006-01-19 01:21:04 +00:00
Reid Spencer
e14cf26e04 Don't accept the ctpop, cttz, or ctlz intrinsics with signed arguments. The
interface requires unsigned arguments.

llvm-svn: 25433
2006-01-19 01:20:03 +00:00
Reid Spencer
7ee9a0016a Add a new interface function to AutoUpgrade for simultaneously upgrading
the Function and the CallInst: UpgradeCallsToIntrinsic(Function*). Also,
re-factor the AutoUpgrade implementation to eliminate some duplication of
code.

llvm-svn: 25432
2006-01-19 01:18:29 +00:00