Commit Graph

10893 Commits

Author SHA1 Message Date
Reid Spencer
0f9beca707 Change the names of member variables per Chris' instructions, and document
them more clearly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23118 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-27 19:09:02 +00:00
Reid Spencer
68a24bdba4 Implement PR614:
These changes modify the makefiles so that the output of flex and bison are
placed in the SRC directory, not the OBJ directory. It is intended that they
be checked in as any other LLVM source so that platforms without convenient
access to flex/bison can be compiled. From now on, if you change a .y or
.l file you *must* also commit the generated .cpp and .h files.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23115 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-27 18:50:39 +00:00
Chris Lattner
88b9c15912 Disable this code, which broke many tests last night
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23114 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-27 16:16:51 +00:00
Chris Lattner
620c93cca1 fix PHI node emission for basic blocks that have select_cc's in them on ppc32
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23113 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-27 00:58:02 +00:00
Chris Lattner
e3f1c97734 The condition register being branched on may not be cr0, as such, print it.
This fixes: UnitTests/2005-07-17-INT-To-FP.c


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23112 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 23:42:05 +00:00
Chris Lattner
f48e83ded0 Propagate cr# from COND_BRANCH to the actual branch instruction as appropriate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23111 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 23:41:27 +00:00
Chris Lattner
eb150d7d1f Nate noticed that Andrew never did this. This fixes PR600
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23110 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 22:50:40 +00:00
Chris Lattner
9d3a483a38 Don't copy regs that are only used in the entry block into a vreg. This
changes the code generated for:

short %test(short %A) {
  %B = xor short %A, -32768
  ret short %B
}

to:

_test:
        xori r2, r3, 32768
        xoris r2, r2, 65535
        extsh r3, r2
        blr

instead of:

_test:
        rlwinm r2, r3, 0, 16, 31
        xori r2, r3, 32768
        xoris r2, r2, 65535
        extsh r3, r2
        blr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23109 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 22:49:59 +00:00
Chris Lattner
ed461e0faf Make this code safe for when loadRegFromStackSlot inserts multiple instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23108 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 22:18:32 +00:00
Chris Lattner
28b9cc2d13 allow code using mtcrf to assemble
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23107 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 22:05:54 +00:00
Nate Begeman
a0df5d8da5 Remove operand type 'crbit', since it is no longer used
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23106 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 22:04:17 +00:00
Chris Lattner
82972705df teach getClass what a condition reg is
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23105 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 21:51:29 +00:00
Chris Lattner
5087daac23 Minor cleanups:
* avoid calling getClass() multiple times (it is relatively expensive)
  * Allow -disable-fp-elim to turn of frame pointer elimination.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23104 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 21:49:18 +00:00
Chris Lattner
579cfabdad Checking types here is not safe, because multiple types can map to the same
register class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23103 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 21:39:15 +00:00
Chris Lattner
8a2d3ca7df implement SELECT_CC fully for the DAG->DAG isel!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23101 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 21:23:58 +00:00
Chris Lattner
e3cbf823f0 spell this right
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23099 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 20:55:40 +00:00
Chris Lattner
025c39bf36 Call the InsertAtEndOfBasicBlock hook if the usesCustomDAGSchedInserter
flag is set on an instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23098 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 20:54:47 +00:00
Chris Lattner
0efa0f9ee9 Add a flag
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23092 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 20:29:01 +00:00
Chris Lattner
0bbea95433 Make fsel emission work with both the pattern and dag-dag selectors, by
giving it a non-instruction opcode.  The dag->dag selector used to not
select the operands of the fsel, because it thought that whole tree was
already selected.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23091 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 20:25:03 +00:00
Chris Lattner
13794f5d01 implement the fold for:
bool %test(int %X, int %Y) {
        %C = setne int %X, 0
        ret bool %C
}

to:

_test:
        addic r2, r3, -1
        subfe r3, r2, r3
        blr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23089 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 18:46:49 +00:00
Chris Lattner
52987f4f65 Changes to adjust to new ReplaceAllUsesWith syntax. Change FP_EXTEND to
just return its input, instead of emitting an explicit copy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23088 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 18:37:23 +00:00
Chris Lattner
8b52f21f10 Revampt ReplaceAllUsesWith to be more efficient and easier to use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23087 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 18:36:28 +00:00
Nate Begeman
60675f7562 Remove some code made dead by the fsel patch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23085 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 17:45:06 +00:00
Chris Lattner
28b9be300c now that fsel is formed during legalization, this code is dead
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23084 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 17:40:39 +00:00
Chris Lattner
0b1e4e508b implement the other half of the select_cc -> fsel lowering, which handles
when the RHS of the comparison is 0.0.  Turn this on by default.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23083 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 17:36:52 +00:00
Chris Lattner
143b675393 Fix a bug in my previous checkin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23082 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 17:18:44 +00:00
Chris Lattner
5839bf2b3b Change ConstantPoolSDNode to actually hold the Constant itself instead of
putting it into the constant pool.  This allows the isel machinery to
create constants that it will end up deciding are not needed, without them
ending up in the resultant function constant pool.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23081 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 17:15:30 +00:00
Chris Lattner
95e0682a42 Fix some warnings in an optimized build
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23080 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 16:38:51 +00:00
Chris Lattner
2bb06cdf27 Fix a huge annoyance: SelectNodeTo took types before the opcode unlike
every other SD API.  Fix it to take the opcode before the types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23079 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 16:36:26 +00:00
Nate Begeman
6718f11feb Fix JIT encoding of conditional branches
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23076 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 04:11:42 +00:00
Chris Lattner
e4bc9ea0a5 add initial support for converting select_cc -> fsel in the legalizer
instead of in the backend.  This currently handles fsel cases with registers,
but doesn't have the 0.0 and -0.0 optimization enabled yet.

Once this is finished, special hack for fp immediates can go away.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23075 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 00:52:45 +00:00
Chris Lattner
d7050a9c50 the 5th operand is the 4th number
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23074 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 00:43:46 +00:00
Nate Begeman
bb22df31d9 SUBFIC produces two results, not one.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23073 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 00:34:06 +00:00
Nate Begeman
6660cd65cf Implement SHL_PARTS and SRL_PARTS
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23072 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 00:28:00 +00:00
Chris Lattner
23004e5f21 Add support for targets that want to custom expand select_cc in some cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23071 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 00:23:59 +00:00
Chris Lattner
07dffd6af6 Allow LowerOperation to return a null SDOperand in case it wants to lower
some things given to it, but not all.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23070 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 00:14:16 +00:00
Chris Lattner
f07d023dd9 Fix a nasty bug from a previous patch of mine
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23069 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-26 00:13:12 +00:00
Chris Lattner
b20c318df0 Emit the lo/hi parts in the right order :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23068 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-25 23:36:49 +00:00
Chris Lattner
a9317ed361 implement support for 64-bit add/sub, fix a broken assertion for 64-bit
return.  Allow the udiv breaker-upper to work with any non-zero constant
operand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23066 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-25 23:21:06 +00:00
Chris Lattner
801d5f56bb simplify the add/sub_parts code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23065 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-25 23:19:58 +00:00
Chris Lattner
047b952e29 Finish implementing SDIV/UDIV by copying over the majik constant code from
ISelPattern


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23062 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-25 22:04:30 +00:00
Chris Lattner
c70b4afce2 Simplify some code. It's not clear why the UDIV expanded sequence
doesn't work for large uint constants, but we'll keep the current behavior


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23061 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-25 22:03:50 +00:00
Chris Lattner
957fcfbd89 Implement setcc correctly for G5 and non-G5 systems
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23060 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-25 21:39:42 +00:00
Chris Lattner
64906a06b3 implement setcc on the G5. We're still missing the non-g5 specific bits, but
they will come later.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23059 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-25 20:08:18 +00:00
Nate Begeman
1999b4b974 New fold for SELECT_CC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23058 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-25 20:04:38 +00:00
Nate Begeman
c8e27db5c5 Remove option to make SetCC illegal on PowerPC after long discussion with
Chris.  This will be accomplished through correctly modeling CR's and
subregs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23056 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-25 20:01:10 +00:00
Chris Lattner
43247a157b Don't auto-cse nodes that return flags
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23055 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-25 19:12:10 +00:00
Chris Lattner
8064e8fbf4 add printer support for flag operands
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23054 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-25 17:59:23 +00:00
Chris Lattner
9d338cf3a3 simplify the code a bit using isOperationLegal
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23053 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-25 17:54:58 +00:00
Chris Lattner
8784a23075 Add support for sdiv by 2^k and -2^k. Producing code like:
_test:
        srawi r2, r3, 2
        addze r3, r2
        blr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23052 91177308-0d34-0410-b5e6-96231b3b80d8
2005-08-25 17:50:06 +00:00