Chris Lattner [Sun, 5 Feb 2006 08:30:45 +0000 (08:30 +0000)]
SparcV8 -> Sparc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26008
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 5 Feb 2006 08:26:16 +0000 (08:26 +0000)]
This xform isn't safe
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26007
91177308-0d34-0410-b5e6-
96231b3b80d8
Nate Begeman [Sun, 5 Feb 2006 08:23:00 +0000 (08:23 +0000)]
Back out previous commit, it isn't safe.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26006
91177308-0d34-0410-b5e6-
96231b3b80d8
Nate Begeman [Sun, 5 Feb 2006 08:07:24 +0000 (08:07 +0000)]
fold c1 << (x + c2) into (c1 << c2) << x. fix a warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26005
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 5 Feb 2006 07:54:37 +0000 (07:54 +0000)]
some stuff is done
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26004
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 5 Feb 2006 07:54:04 +0000 (07:54 +0000)]
Turn A % (C << N), where C is 2^k, into A & ((C << N)-1) [urem only].
Turn A / (C1 << N), where C1 is "1<<C2" into A >> (N+C2) [udiv only].
Tested with: rem.ll:test5, div.ll:test10
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26003
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 5 Feb 2006 07:52:47 +0000 (07:52 +0000)]
new testcases
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26002
91177308-0d34-0410-b5e6-
96231b3b80d8
Nate Begeman [Sun, 5 Feb 2006 07:36:48 +0000 (07:36 +0000)]
Handle urem by shifted powers of 2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26001
91177308-0d34-0410-b5e6-
96231b3b80d8
Nate Begeman [Sun, 5 Feb 2006 07:20:23 +0000 (07:20 +0000)]
handle combining A / (B << N) into A >>u (log2(B)+N) when B is a power of 2
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26000
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Sun, 5 Feb 2006 06:51:51 +0000 (06:51 +0000)]
Use SelectRoot() as the entry to any tblgen based isel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25998
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Sun, 5 Feb 2006 06:46:41 +0000 (06:46 +0000)]
Use SelectRoot() as entry of any tblgen based isel.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25997
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 5 Feb 2006 06:44:17 +0000 (06:44 +0000)]
Encourage use of the V8 ABI over the V9 ABI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25996
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Sun, 5 Feb 2006 06:43:12 +0000 (06:43 +0000)]
Allow more loads to be folded which were previously prevented from happening
due to ordering issue. i.e. they were selected for chain use first.
Now at load select time, check if it is being selected for a chain use and if
it has only a single real use. If so, return a HANDLENODE (with the load as
its operand) in its place and record it.
When it is folded or the load is selected for a real use, the isel records it
as the replacement for the HANDLENODE. The replacement is done when all nodes
are selected.
This scheme exposed a couple of problems where cycles can happen. (See comments
in EmitMatchCode() for descriptions of the problems and their workaround /
solutions.) These problems have been resolved with a small compile time
penality.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25995
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 5 Feb 2006 06:40:12 +0000 (06:40 +0000)]
This document is out of date. :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25994
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 5 Feb 2006 06:39:36 +0000 (06:39 +0000)]
V8 -> Sparc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25993
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 5 Feb 2006 06:33:29 +0000 (06:33 +0000)]
Remove the SparcV8 backend. It has been renamed to be the Sparc backend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25992
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 5 Feb 2006 06:32:59 +0000 (06:32 +0000)]
remove V8 reference
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25991
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Sun, 5 Feb 2006 06:29:23 +0000 (06:29 +0000)]
* Added SDNode::isOnlyUse().
* Fix hasNUsesOfValue(), it should be const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25990
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 5 Feb 2006 06:26:43 +0000 (06:26 +0000)]
SparcV8 -> Sparc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25989
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 5 Feb 2006 05:56:51 +0000 (05:56 +0000)]
SparcV8 -> Sparc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25988
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 5 Feb 2006 05:53:48 +0000 (05:53 +0000)]
These were moved to ../SPARC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25987
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 5 Feb 2006 05:52:55 +0000 (05:52 +0000)]
move V8 testcases here
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25986
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 5 Feb 2006 05:50:24 +0000 (05:50 +0000)]
Rename SPARC V8 target to be the LLVM SPARC target.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25985
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 5 Feb 2006 05:27:35 +0000 (05:27 +0000)]
add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25984
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Sun, 5 Feb 2006 05:25:07 +0000 (05:25 +0000)]
Re-commit the last bit of change that was backed out.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25983
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Sun, 5 Feb 2006 05:22:18 +0000 (05:22 +0000)]
Re-committing the last bit of change. It shouldn't break PPC this time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25982
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 5 Feb 2006 01:46:49 +0000 (01:46 +0000)]
make sure that global doubles are aligned to 8 bytes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25981
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 5 Feb 2006 01:45:04 +0000 (01:45 +0000)]
Use getPreferredAlignmentLog.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25980
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 5 Feb 2006 01:30:45 +0000 (01:30 +0000)]
Use the asmprinter to find out what the preferred alignment of a global is.
This patch speeds up 172.mgrid from 31.81s to 11.39s on darwin/ppc.
Many many thanks to Nate for tracking down the root cause of the issue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25979
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 5 Feb 2006 01:29:18 +0000 (01:29 +0000)]
Implement the AsmPrinter::getPreferredAlignmentLog method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25978
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sun, 5 Feb 2006 01:24:06 +0000 (01:24 +0000)]
add a new method, getPreferredAlignmentLog.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25977
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Lenharth [Sat, 4 Feb 2006 19:13:09 +0000 (19:13 +0000)]
linkage fix for weak functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25976
91177308-0d34-0410-b5e6-
96231b3b80d8
Jeff Cohen [Sat, 4 Feb 2006 16:20:31 +0000 (16:20 +0000)]
Fix VC++ warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25975
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 4 Feb 2006 09:52:43 +0000 (09:52 +0000)]
Use SCEVExpander::InsertCastOfTo instead of our own code. This reduces
#LLVM LOC, and auto-cse's cast instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25974
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 4 Feb 2006 09:51:53 +0000 (09:51 +0000)]
Pull the InsertCastOfTo out of the header, implement CSE'ing of arguments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25973
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 4 Feb 2006 09:51:33 +0000 (09:51 +0000)]
Refactor a bunch of code into a non-inlined method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25972
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 4 Feb 2006 09:24:16 +0000 (09:24 +0000)]
Temporarily revert this patch, which probably breaks with the
tblgen patch reverted.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25971
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 4 Feb 2006 09:23:06 +0000 (09:23 +0000)]
Temporarily revert the last change, which breaks PPC and other targets that
DO select things.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25970
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 4 Feb 2006 09:15:29 +0000 (09:15 +0000)]
Value# select instructions, allowing -gcse to remove duplicates
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25969
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Sat, 4 Feb 2006 08:50:49 +0000 (08:50 +0000)]
Complex pattern's custom matcher should not call Select() on any operands.
Select them afterwards if it returns true.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25968
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 4 Feb 2006 08:31:30 +0000 (08:31 +0000)]
Custom lower VAARG for the case when we are doing vaarg(double). In this
case, the double being loaded may not be 8-byte aligned, so we have to use
our standard bit_convert game.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25967
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 4 Feb 2006 08:04:21 +0000 (08:04 +0000)]
Fix a nasty typo that broke functions with big stack frames.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25966
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 4 Feb 2006 07:48:46 +0000 (07:48 +0000)]
fix a bug in my last checkin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25965
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 4 Feb 2006 07:36:50 +0000 (07:36 +0000)]
Fix two significant bugs in LSR:
1. When rewriting code in outer loops, sometimes we would insert code into
inner loops that is invariant in that loop.
2. Notice that 4*(2+x) is 8+4*x and use that to simplify expressions.
This is a performance neutral change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25964
91177308-0d34-0410-b5e6-
96231b3b80d8
Nate Begeman [Sat, 4 Feb 2006 07:29:35 +0000 (07:29 +0000)]
Remove some stuff that now works
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25963
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 4 Feb 2006 07:07:31 +0000 (07:07 +0000)]
add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25962
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 4 Feb 2006 06:58:46 +0000 (06:58 +0000)]
Two changes:
1. Treat FMOVD as a copy instruction, to help with coallescing in V9 mode
2. When in V9 mode, insert FMOVD instead of FpMOVD instructions, as we don't
ever rewrite FpMOVD instructions into FMOVS instructions, thus we just end
up with commented out copies!
This should fix a bunch of failures in V9 mode on sparc.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25961
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Sat, 4 Feb 2006 06:49:00 +0000 (06:49 +0000)]
Get rid of some memory leaks identified by Valgrind
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25960
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 4 Feb 2006 05:49:01 +0000 (05:49 +0000)]
add a method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25959
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 4 Feb 2006 05:02:27 +0000 (05:02 +0000)]
Let bugpoint work on sparc with v9 instructions enabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25958
91177308-0d34-0410-b5e6-
96231b3b80d8
Jeff Cohen [Sat, 4 Feb 2006 03:27:39 +0000 (03:27 +0000)]
Fix VC++ warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25957
91177308-0d34-0410-b5e6-
96231b3b80d8
Jeff Cohen [Sat, 4 Feb 2006 03:27:04 +0000 (03:27 +0000)]
Keep Visual Studio informed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25956
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 4 Feb 2006 02:26:14 +0000 (02:26 +0000)]
Add initial support for immediates. This allows us to compile this:
int %rlwnm(int %A, int %B) {
%C = call int asm "rlwnm $0, $1, $2, $3, $4", "=r,r,r,n,n"(int %A, int %B, int 4, int 17)
ret int %C
}
into:
_rlwnm:
or r2, r3, r3
or r3, r4, r4
rlwnm r2, r2, r3, 4, 17 ;; note the immediates :)
or r3, r2, r2
blr
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25955
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Sat, 4 Feb 2006 02:23:01 +0000 (02:23 +0000)]
Remove an unnecessary predicate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25954
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Sat, 4 Feb 2006 02:20:30 +0000 (02:20 +0000)]
Separate FILD and FILD_FLAG, the later is only used for SSE2. It produces a
flag so it can be flagged to a FST.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25953
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 4 Feb 2006 02:16:44 +0000 (02:16 +0000)]
Initial early support for non-register operands, like immediates
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25952
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 4 Feb 2006 02:13:02 +0000 (02:13 +0000)]
implementation of some methods for inlineasm
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25951
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Sat, 4 Feb 2006 02:12:09 +0000 (02:12 +0000)]
Add some methods for inline asm support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25950
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 3 Feb 2006 23:50:46 +0000 (23:50 +0000)]
Handle another case exposed on X86.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25949
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 3 Feb 2006 23:28:46 +0000 (23:28 +0000)]
Fix a nasty problem on two-address machines in the following situation:
store EAX -> [ss#0]
[ss#0] += 1
...
use(EAX)
In this case, it is not valid to rewrite this as:
store EAX -> [ss#0]
EAX += 1
store EAX -> [ss#0] ;;; this would also delete the store above
...
use(EAX)
... because EAX is not a dead at that point. Keep track of which registers
we are allowed to clobber, and which ones we aren't, and don't clobber the
ones we're not supposed to. :)
This should resolve the issues on X86 last night.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25948
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 3 Feb 2006 23:13:58 +0000 (23:13 +0000)]
significantly simplify the VirtRegMap code by pulling the SpillSlotsAvailable
and PhysRegsAvailable maps out into a new AvailableSpills struct. No
functionality change.
This paves the way for a bugfix, coming up next.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25947
91177308-0d34-0410-b5e6-
96231b3b80d8
Nate Begeman [Fri, 3 Feb 2006 22:38:07 +0000 (22:38 +0000)]
Implement some feedback from sabre
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25946
91177308-0d34-0410-b5e6-
96231b3b80d8
Nate Begeman [Fri, 3 Feb 2006 22:24:05 +0000 (22:24 +0000)]
Add a framework for eliminating instructions that produces undemanded bits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25945
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 3 Feb 2006 22:06:45 +0000 (22:06 +0000)]
add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25944
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 3 Feb 2006 22:05:41 +0000 (22:05 +0000)]
another case Nate came up with
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25943
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 3 Feb 2006 21:25:23 +0000 (21:25 +0000)]
add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25942
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 3 Feb 2006 20:13:59 +0000 (20:13 +0000)]
remove some #ifdef'd out code, which should properly be in the dag combiner anyway.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25941
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 3 Feb 2006 18:59:39 +0000 (18:59 +0000)]
remove an old comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25940
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 3 Feb 2006 18:54:24 +0000 (18:54 +0000)]
Remove the X86PeepholeOptimizerPass, a truly horrible old hack that is now
obsolete. yaay :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25939
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 3 Feb 2006 18:20:04 +0000 (18:20 +0000)]
When rewriting frame instructions, emit the appropriate small-immediate
instruction when possible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25938
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 3 Feb 2006 18:06:02 +0000 (18:06 +0000)]
node predicates add to the complexity of a pattern. This ensures that the
X86 backend attempts to match small-immediate versions of instructions before
the full size immediate versions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25937
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 3 Feb 2006 07:06:25 +0000 (07:06 +0000)]
Teach sparc to fold loads/stores into copies.
Remove the dead getRegClassForType method
minor formating changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25936
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 3 Feb 2006 06:51:34 +0000 (06:51 +0000)]
remove dead fn
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25935
91177308-0d34-0410-b5e6-
96231b3b80d8
Nate Begeman [Fri, 3 Feb 2006 06:46:56 +0000 (06:46 +0000)]
Add common code for reassociating ops in the dag combiner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25934
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Fri, 3 Feb 2006 06:46:41 +0000 (06:46 +0000)]
Added a (store (op (load ...) ...) ...) folding test case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25933
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 3 Feb 2006 06:44:54 +0000 (06:44 +0000)]
Implement isLoadFromStackSlot and isStoreToStackSlot
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25932
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Fri, 3 Feb 2006 06:22:41 +0000 (06:22 +0000)]
(store (op (load ...))) folding problem. In the generated matching code,
Chain is initially set to the chain operand of store node, when it reaches
load, if it matches the load then Chain is set to the chain operand of the
load.
However, if the matching code that follows this fails, isel moves on to the
next pattern but it does not restore Chain to the chain operand of the store.
So when it tries to match the next store / op / load pattern it would fail on
the Chain == load.getOperand(0) test.
The solution is for each chain operand to get a unique name. e.g. Chain10.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25931
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 3 Feb 2006 06:22:11 +0000 (06:22 +0000)]
remove some target-indep and implemented notes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25930
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 3 Feb 2006 06:21:43 +0000 (06:21 +0000)]
target independent notes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25929
91177308-0d34-0410-b5e6-
96231b3b80d8
Nate Begeman [Fri, 3 Feb 2006 05:17:06 +0000 (05:17 +0000)]
Flesh out a couple of the items in the README
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25928
91177308-0d34-0410-b5e6-
96231b3b80d8
Jeff Cohen [Fri, 3 Feb 2006 03:48:54 +0000 (03:48 +0000)]
Fix VC++ compilation error caused by using a std::map iterator variable to receive
a std::multimap iterator value. For some reason, GCC doesn't have a problem with this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25927
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 3 Feb 2006 03:16:14 +0000 (03:16 +0000)]
Remove move copies and dead stuff by not clobbering the result reg of a noop copy.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25926
91177308-0d34-0410-b5e6-
96231b3b80d8
Andrew Lenharth [Fri, 3 Feb 2006 03:07:37 +0000 (03:07 +0000)]
isStoreToStackSlot
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25925
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 3 Feb 2006 03:06:49 +0000 (03:06 +0000)]
Simplify some code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25924
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 3 Feb 2006 02:59:58 +0000 (02:59 +0000)]
the X86 backend no longer needs to delete its own noop copies
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25923
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 3 Feb 2006 02:02:59 +0000 (02:02 +0000)]
Add code that checks for noop copies, which triggers when either:
1. a target doesn't know how to fold load/stores into copies, or
2. the spiller rewrites the input to a copy to the same register as the dest
instead of to the reloaded reg.
This will be moved/improved in the near future, but allows elimination of
some ancient x86 hacks. This eliminates 92 copies from SMG2000 on X86 and
163 copies from 252.eon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25922
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 3 Feb 2006 01:49:49 +0000 (01:49 +0000)]
Add a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25921
91177308-0d34-0410-b5e6-
96231b3b80d8
Evan Cheng [Fri, 3 Feb 2006 01:33:01 +0000 (01:33 +0000)]
Added case HANDLENODE to getOperationName().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25920
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Fri, 3 Feb 2006 00:36:31 +0000 (00:36 +0000)]
Physregs may hold multiple stack slot values at the same time. Keep track
of this, and use it to our advantage (bwahahah). This allows us to eliminate another
60 instructions from smg2000 on PPC (probably significantly more on X86). A common
old-new diff looks like this:
stw r2, 3304(r1)
- lwz r2, 3192(r1)
stw r2, 3300(r1)
- lwz r2, 3192(r1)
stw r2, 3296(r1)
- lwz r2, 3192(r1)
stw r2, 3200(r1)
- lwz r2, 3192(r1)
stw r2, 3196(r1)
- lwz r2, 3192(r1)
+ or r2, r2, r2
stw r2, 3188(r1)
and
- lwz r31, 604(r1)
- lwz r13, 604(r1)
- lwz r14, 604(r1)
- lwz r15, 604(r1)
- lwz r16, 604(r1)
- lwz r30, 604(r1)
+ or r31, r30, r30
+ or r13, r30, r30
+ or r14, r30, r30
+ or r15, r30, r30
+ or r16, r30, r30
+ or r30, r30, r30
Removal of the R = R copies is coming next...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25919
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 2 Feb 2006 23:50:22 +0000 (23:50 +0000)]
update a note
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25918
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 2 Feb 2006 23:29:36 +0000 (23:29 +0000)]
Fix a deficiency in the spiller that Evan noticed. In particular, consider
this code:
store [stack slot #0], R10
= add R14, [stack slot #0]
The spiller didn't know that the store made the value of [stackslot#0] available
in R10 *IF* the store came from a copy instruction with the store folded into it.
This patch teaches VirtRegMap to look at these stores and recognize the values
they make available. In one case Evan provided, this code:
divsd %XMM0, %XMM1
movsd %XMM1, QWORD PTR [%ESP + 40]
1) movsd QWORD PTR [%ESP + 48], %XMM1
2) movsd %XMM1, QWORD PTR [%ESP + 48]
addsd %XMM1, %XMM0
3) movsd QWORD PTR [%ESP + 48], %XMM1
movsd QWORD PTR [%ESP + 4], %XMM0
turns into:
divsd %XMM0, %XMM1
movsd %XMM1, QWORD PTR [%ESP + 40]
addsd %XMM1, %XMM0
3) movsd QWORD PTR [%ESP + 48], %XMM1
movsd QWORD PTR [%ESP + 4], %XMM0
In this case, instruction #2 was removed because of the value made
available by #1, and inst #1 was later deleted because it is now
never used before the stack slot is redefined by #3.
This occurs here and there in a lot of code with high spilling, on PPC
most of the removed loads/stores are LSU-reject-causing loads, which is
nice.
On X86, things are much better (because it spills more), where we nuke
about 1% of the instructions from SMG2000 and several hundred from eon.
More improvements to come...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25917
91177308-0d34-0410-b5e6-
96231b3b80d8
Nate Begeman [Thu, 2 Feb 2006 21:07:50 +0000 (21:07 +0000)]
add 64b gpr store to the possible list of isStoreToStackSlot opcodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25916
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 2 Feb 2006 20:38:12 +0000 (20:38 +0000)]
fix operand numbers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25915
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 2 Feb 2006 20:16:12 +0000 (20:16 +0000)]
implement isStoreToStackSlot for PPC
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25914
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 2 Feb 2006 20:12:32 +0000 (20:12 +0000)]
Move isLoadFrom/StoreToStackSlot from MRegisterInfo to TargetInstrInfo,a far more logical place. Other methods should also be moved if anyoneis interested. :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25913
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 2 Feb 2006 20:11:55 +0000 (20:11 +0000)]
Move isLoadFrom/StoreToStackSlot from MRegisterInfo to TargetInstrInfo,
a far more logical place. Other methods should also be moved if anyone
is interested. :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25912
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 2 Feb 2006 20:00:41 +0000 (20:00 +0000)]
implement isStoreToStackSlot
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25911
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 2 Feb 2006 19:57:16 +0000 (19:57 +0000)]
add a method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25910
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 2 Feb 2006 19:55:29 +0000 (19:55 +0000)]
add a new isStoreToStackSlot method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25909
91177308-0d34-0410-b5e6-
96231b3b80d8
Chris Lattner [Thu, 2 Feb 2006 19:43:28 +0000 (19:43 +0000)]
more notes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25908
91177308-0d34-0410-b5e6-
96231b3b80d8