oota-llvm.git
18 years agoWe actually don't have spiff anymore
Chris Lattner [Tue, 13 Apr 2004 20:59:47 +0000 (20:59 +0000)]
We actually don't have spiff anymore

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

18 years agoOut with spiff, in with fpcmp
Chris Lattner [Tue, 13 Apr 2004 20:59:24 +0000 (20:59 +0000)]
Out with spiff, in with fpcmp

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

18 years agoRemove spiff. Though it looked good, it was not really as spiffy as it seemed
Chris Lattner [Tue, 13 Apr 2004 20:58:42 +0000 (20:58 +0000)]
Remove spiff.  Though it looked good, it was not really as spiffy as it seemed

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

18 years agoOkay, spiff is completely incapable of handling files of nontrivial size.
Chris Lattner [Tue, 13 Apr 2004 20:55:49 +0000 (20:55 +0000)]
Okay, spiff is completely incapable of handling files of nontrivial size.
Here is a simple minimal program that does what we want.  Instead of taking
minutes to compare mesa's output, and crashing on binary files (like spiff
does), this take < .02s in the common case and doesn't crash.

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

18 years agoAdd a note
Chris Lattner [Tue, 13 Apr 2004 19:48:55 +0000 (19:48 +0000)]
Add a note

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

18 years agoAdd SCCP support for constant folding calls, implementing:
Chris Lattner [Tue, 13 Apr 2004 19:43:54 +0000 (19:43 +0000)]
Add SCCP support for constant folding calls, implementing:
test/Regression/Transforms/SCCP/calltest.ll

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

18 years agoNew testcase
Chris Lattner [Tue, 13 Apr 2004 19:43:33 +0000 (19:43 +0000)]
New testcase

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

18 years agoAdd a simple call constant propagation interface.
Chris Lattner [Tue, 13 Apr 2004 19:28:52 +0000 (19:28 +0000)]
Add a simple call constant propagation interface.

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

18 years agoAdd new interfaces
Chris Lattner [Tue, 13 Apr 2004 19:28:32 +0000 (19:28 +0000)]
Add new interfaces

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

18 years agoConstant propagation should remove the dead instructions
Chris Lattner [Tue, 13 Apr 2004 19:28:20 +0000 (19:28 +0000)]
Constant propagation should remove the dead instructions

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

18 years agoNew testcase
Chris Lattner [Tue, 13 Apr 2004 19:28:09 +0000 (19:28 +0000)]
New testcase

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

18 years agoRegenerated using autoconf-2.57.
Brian Gaeke [Tue, 13 Apr 2004 19:03:49 +0000 (19:03 +0000)]
Regenerated using autoconf-2.57.

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

18 years agoRewrite POV-Ray check as per PR301
Brian Gaeke [Tue, 13 Apr 2004 19:02:51 +0000 (19:02 +0000)]
Rewrite POV-Ray check as per PR301

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

18 years agoIncrease buffer size again. *sigh*
Chris Lattner [Tue, 13 Apr 2004 18:43:18 +0000 (18:43 +0000)]
Increase buffer size again. *sigh*

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

18 years agoDon't index spiff. It should not count as lines of LLVM code
Chris Lattner [Tue, 13 Apr 2004 18:37:51 +0000 (18:37 +0000)]
Don't index spiff.  It should not count as lines of LLVM code

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

18 years agoFixed sized limits are bad... duh.
Chris Lattner [Tue, 13 Apr 2004 18:34:16 +0000 (18:34 +0000)]
Fixed sized limits are bad... duh.

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

18 years agoReally spiff, don't chatter :)
Chris Lattner [Tue, 13 Apr 2004 18:33:21 +0000 (18:33 +0000)]
Really spiff, don't chatter :)

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

18 years agoI don't think we have to have 4 extra allocated (but unused) bytes on the stack.
Brian Gaeke [Tue, 13 Apr 2004 18:28:37 +0000 (18:28 +0000)]
I don't think we have to have 4 extra allocated (but unused) bytes on the stack.

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

18 years agoI started working on casts, but I don't have anything compilable yet.
Brian Gaeke [Tue, 13 Apr 2004 18:27:46 +0000 (18:27 +0000)]
I started working on casts, but I don't have anything compilable yet.

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

18 years agoDon't underline diffs
Brian Gaeke [Tue, 13 Apr 2004 18:24:01 +0000 (18:24 +0000)]
Don't underline diffs

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

18 years agoEmit the immediate form of in/out when possible.
Chris Lattner [Tue, 13 Apr 2004 17:20:37 +0000 (17:20 +0000)]
Emit the immediate form of in/out when possible.
Fix several bugs in the intrinsics:
  1. Make sure to copy the input registers before the instructions that use them
  2. Make sure to copy the value returned by 'in' out of EAX into the register
     it is supposed to be in.

This fixes assertions when using in/out and linear scan.

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

18 years agoAdd immediate forms of in/out. Use let to shorten lines
Chris Lattner [Tue, 13 Apr 2004 17:19:31 +0000 (17:19 +0000)]
Add immediate forms of in/out.  Use let to shorten lines

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

18 years agoAdd support for new instruction type
Chris Lattner [Tue, 13 Apr 2004 17:18:51 +0000 (17:18 +0000)]
Add support for new instruction type

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

18 years agoAdd support for the printImplicitDefsBefore flag
Chris Lattner [Tue, 13 Apr 2004 17:18:39 +0000 (17:18 +0000)]
Add support for the printImplicitDefsBefore flag

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

18 years agoMake the testcase more challenging
Chris Lattner [Tue, 13 Apr 2004 17:18:07 +0000 (17:18 +0000)]
Make the testcase more challenging

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

18 years agoReenable library now that the loopsimplify bug is fixed
Chris Lattner [Tue, 13 Apr 2004 16:24:53 +0000 (16:24 +0000)]
Reenable library now that the loopsimplify bug is fixed

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

18 years agoFix LoopSimplify/2004-04-13-LoopSimplifyUpdateDomFrontier.ll
Chris Lattner [Tue, 13 Apr 2004 16:23:25 +0000 (16:23 +0000)]
Fix LoopSimplify/2004-04-13-LoopSimplifyUpdateDomFrontier.ll

LoopSimplify was not updating dominator frontiers correctly in some cases.

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

18 years agoNew testcase where loop simplify is not updating domfrontiers correctly
Chris Lattner [Tue, 13 Apr 2004 16:22:04 +0000 (16:22 +0000)]
New testcase where loop simplify is not updating domfrontiers correctly

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

18 years agoRefactor code a bit to make it simpler and eliminate the goto
Chris Lattner [Tue, 13 Apr 2004 15:21:18 +0000 (15:21 +0000)]
Refactor code a bit to make it simpler and eliminate the goto

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

18 years agoAdd notes about some of the code quality improvements that have gone in
Chris Lattner [Tue, 13 Apr 2004 14:43:35 +0000 (14:43 +0000)]
Add notes about some of the code quality improvements that have gone in

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

18 years agoTemporary hack to get the nightly tester running
Chris Lattner [Tue, 13 Apr 2004 13:57:29 +0000 (13:57 +0000)]
Temporary hack to get the nightly tester running

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

18 years agoAdded Spiff.
John Criswell [Tue, 13 Apr 2004 13:42:38 +0000 (13:42 +0000)]
Added Spiff.

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

18 years agoThis patch addresses PR35: Loop simplify should reconstruct nested loops.
Chris Lattner [Tue, 13 Apr 2004 05:05:33 +0000 (05:05 +0000)]
This patch addresses PR35: Loop simplify should reconstruct nested loops.
This is fairly straight-forward, but was a real nightmare to get just
perfect.  aarg.  :)

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

18 years agoClean up the Spiff code so that it emits fewer warnings. This
Brian Gaeke [Tue, 13 Apr 2004 03:24:45 +0000 (03:24 +0000)]
Clean up the Spiff code so that it emits fewer warnings.  This
consists mostly of changing sloppy K&R C code to slightly more
disciplined K&R C code, and doing the usual things to shut gcc up.

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

18 years agoBuild Spiff directory
Brian Gaeke [Mon, 12 Apr 2004 22:53:51 +0000 (22:53 +0000)]
Build Spiff directory

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

18 years agoAdd the Spiff fp-aware diff utility from Bellcore
Brian Gaeke [Mon, 12 Apr 2004 22:53:24 +0000 (22:53 +0000)]
Add the Spiff fp-aware diff utility from Bellcore

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

18 years agoWe don't need to insert TargetData into the PassManager here.
Brian Gaeke [Mon, 12 Apr 2004 21:46:31 +0000 (21:46 +0000)]
We don't need to insert TargetData into the PassManager here.

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

18 years agonew testcase
Chris Lattner [Mon, 12 Apr 2004 20:59:07 +0000 (20:59 +0000)]
new testcase

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

18 years agoFix bug introduced in previous commit.
Alkis Evlogimenos [Mon, 12 Apr 2004 20:26:39 +0000 (20:26 +0000)]
Fix bug introduced in previous commit.

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

18 years agoAdd some methods that are useful for updating loop information.
Chris Lattner [Mon, 12 Apr 2004 20:26:17 +0000 (20:26 +0000)]
Add some methods that are useful for updating loop information.

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

18 years agoUpdate testcase to illustrate the coalescing problem. The previous one did not work...
Alkis Evlogimenos [Mon, 12 Apr 2004 19:04:22 +0000 (19:04 +0000)]
Update testcase to illustrate the coalescing problem. The previous one did not work because of a fix in the x86 instruction selector.

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

18 years agoCorrectly compute spill weights
Alkis Evlogimenos [Mon, 12 Apr 2004 17:39:20 +0000 (17:39 +0000)]
Correctly compute spill weights

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

18 years agoAdded testcase for the llvm.readport and llvm.writeport intrinsics.
John Criswell [Mon, 12 Apr 2004 16:42:43 +0000 (16:42 +0000)]
Added testcase for the llvm.readport and llvm.writeport intrinsics.

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

18 years agoCorrected the descriptions of the llvm.writeport and llvm.writeio
John Criswell [Mon, 12 Apr 2004 16:33:19 +0000 (16:33 +0000)]
Corrected the descriptions of the llvm.writeport and llvm.writeio
intrinsics.

Modified llvm.readio and llvm.writeio to use pointers to memory instead
of integers.  This should take care of problems such as different pointer
sizes, casting integers to pointers, weird architectural pointer types, etc.

Re-worded the description of llvm.readio and llvm.writeio so that it should
be more clear as to why they should be used over regular loads/stores for
I/O.

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

18 years agoPrint def lists a bit more compactly
Alkis Evlogimenos [Mon, 12 Apr 2004 15:57:58 +0000 (15:57 +0000)]
Print def lists a bit more compactly

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

18 years agoAdd same value coalescing testcase
Alkis Evlogimenos [Mon, 12 Apr 2004 15:40:25 +0000 (15:40 +0000)]
Add same value coalescing testcase

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

18 years agoAdded initial design for the llvm.readio and llvm.writeio intrinsics.
John Criswell [Mon, 12 Apr 2004 15:02:16 +0000 (15:02 +0000)]
Added initial design for the llvm.readio and llvm.writeio intrinsics.

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

18 years agoAdd a couple more IPO's
Chris Lattner [Mon, 12 Apr 2004 05:38:15 +0000 (05:38 +0000)]
Add a couple more IPO's

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

18 years agofinegrainify namespacification
Chris Lattner [Mon, 12 Apr 2004 05:38:01 +0000 (05:38 +0000)]
finegrainify namespacification

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

18 years agoActually update the call graph as the inliner changes it. This allows us to
Chris Lattner [Mon, 12 Apr 2004 05:37:29 +0000 (05:37 +0000)]
Actually update the call graph as the inliner changes it.  This allows us to
execute other CallGraphSCCPasses after the inliner without crashing.

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

18 years agoChange the call graph class to have TWO external nodes, making call graph
Chris Lattner [Mon, 12 Apr 2004 05:36:32 +0000 (05:36 +0000)]
Change the call graph class to have TWO external nodes, making call graph
SCC passes much more useful.  In particular, this should fix the incredibly
stupid missed inlining opportunities that the inliner suffered from.

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

18 years agoHrm, operator new and new[] do not belong here. We should not CSE them! :)
Chris Lattner [Mon, 12 Apr 2004 05:16:42 +0000 (05:16 +0000)]
Hrm, operator new and new[] do not belong here.  We should not CSE them!  :)

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

18 years agoAdd support for removing invoke instructions
Chris Lattner [Mon, 12 Apr 2004 05:15:13 +0000 (05:15 +0000)]
Add support for removing invoke instructions

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

18 years agoStop printing Function*
Chris Lattner [Mon, 12 Apr 2004 04:06:56 +0000 (04:06 +0000)]
Stop printing Function*

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

18 years agoSimplify code a bit, and be sure to mark the external node as potentially throwing
Chris Lattner [Mon, 12 Apr 2004 04:06:38 +0000 (04:06 +0000)]
Simplify code a bit, and be sure to mark the external node as potentially throwing

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

18 years agoFix issues that the local allocator has dealing with instructions that implicitly...
Chris Lattner [Mon, 12 Apr 2004 03:02:48 +0000 (03:02 +0000)]
Fix issues that the local allocator has dealing with instructions that implicitly use ST(0)

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

18 years agoNo really, fix printing for LLC. I gotta get a way for CVS to whine at me if
Chris Lattner [Mon, 12 Apr 2004 01:52:04 +0000 (01:52 +0000)]
No really, fix printing for LLC.  I gotta get a way for CVS to whine at me if
I have unsaved emacs buffers, geeze...

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

18 years agoCorrect printing for LLC and the encoding for the JIT
Chris Lattner [Mon, 12 Apr 2004 01:50:04 +0000 (01:50 +0000)]
Correct printing for LLC and the encoding for the JIT

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

18 years agoUse the fucomi[p] instructions to perform floating point comparisons instead
Chris Lattner [Mon, 12 Apr 2004 01:43:36 +0000 (01:43 +0000)]
Use the fucomi[p] instructions to perform floating point comparisons instead
of the fucom[p][p] instructions.  This allows us to code generate this function

bool %test(double %X, double %Y) {
        %C = setlt double %Y, %X
        ret bool %C
}

... into:

test:
        fld QWORD PTR [%ESP + 4]
        fld QWORD PTR [%ESP + 12]
        fucomip %ST(1)
        fstp %ST(0)
        setb %AL
        movsx %EAX, %AL
        ret

where before we generated:

test:
        fld QWORD PTR [%ESP + 4]
        fld QWORD PTR [%ESP + 12]
        fucompp
**      fnstsw
**      sahf
        setb %AL
        movsx %EAX, %AL
        ret

The two marked instructions (which are the ones eliminated) are very bad,
because they serialize execution of the processor.  These instructions are
available on the PPRO and later, but since we already use cmov's we aren't
losing any portability.

I retained the old code for the day when we decide we want to support back
to the 386.

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

18 years agoAdd support for the FUCOMIr instruction
Chris Lattner [Mon, 12 Apr 2004 01:39:15 +0000 (01:39 +0000)]
Add support for the FUCOMIr instruction

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

18 years agoAdd two new instructions
Chris Lattner [Mon, 12 Apr 2004 01:38:55 +0000 (01:38 +0000)]
Add two new instructions

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

18 years agoFix a bug in my load/cast folding patch.
Chris Lattner [Mon, 12 Apr 2004 00:23:04 +0000 (00:23 +0000)]
Fix a bug in my load/cast folding patch.

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

18 years agoAdjust some comments, fix a bug in my previous patch
Chris Lattner [Mon, 12 Apr 2004 00:12:04 +0000 (00:12 +0000)]
Adjust some comments, fix a bug in my previous patch

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

18 years agoDisambiguate symbols after loop extraction so that we can diagnose a code
Chris Lattner [Sun, 11 Apr 2004 23:52:35 +0000 (23:52 +0000)]
Disambiguate symbols after loop extraction so that we can diagnose a code
generator bug if multiple loops are extracted from a function.

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

18 years agoOn X86, casting an integer to floating point requires going through memory.
Chris Lattner [Sun, 11 Apr 2004 23:21:26 +0000 (23:21 +0000)]
On X86, casting an integer to floating point requires going through memory.
If the source of the cast is a load, we can just use the source memory location,
without having to create a temporary stack slot entry.

Before we code generated this:

double %int(int* %P) {
        %V = load int* %P
        %V2 = cast int %V to double
        ret double %V2
}

into:

int:
        sub %ESP, 4
        mov %EAX, DWORD PTR [%ESP + 8]
        mov %EAX, DWORD PTR [%EAX]
        mov DWORD PTR [%ESP], %EAX
        fild DWORD PTR [%ESP]
        add %ESP, 4
        ret

Now we produce this:

int:
        mov %EAX, DWORD PTR [%ESP + 4]
        fild DWORD PTR [%EAX]
        ret

... which is nicer.

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

18 years agoNew testcase
Chris Lattner [Sun, 11 Apr 2004 23:18:30 +0000 (23:18 +0000)]
New testcase

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

18 years agoImplement folding of loads into floating point operations. This implements:
Chris Lattner [Sun, 11 Apr 2004 22:05:45 +0000 (22:05 +0000)]
Implement folding of loads into floating point operations.  This implements:
test/Regression/CodeGen/X86/fp_load_fold.llx

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

18 years agoNew testcase
Chris Lattner [Sun, 11 Apr 2004 22:05:16 +0000 (22:05 +0000)]
New testcase

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

18 years agoUnify all of the code for floating point +,-,*,/ into one function
Chris Lattner [Sun, 11 Apr 2004 21:23:56 +0000 (21:23 +0000)]
Unify all of the code for floating point +,-,*,/ into one function

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

18 years agoThis implements folding of constant operands into floating point operations
Chris Lattner [Sun, 11 Apr 2004 21:09:14 +0000 (21:09 +0000)]
This implements folding of constant operands into floating point operations
for mul and div.

Instead of generating this:

test_divr:
        fld QWORD PTR [%ESP + 4]
        fld QWORD PTR [.CPItest_divr_0]
        fdivrp %ST(1)
        ret

We now generate this:

test_divr:
        fld QWORD PTR [%ESP + 4]
        fdivr QWORD PTR [.CPItest_divr_0]
        ret

This code desperately needs refactoring, which will come in the next
patch.

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

18 years agoRestructure the mul/div/rem handling code to follow the pattern the other
Chris Lattner [Sun, 11 Apr 2004 20:56:28 +0000 (20:56 +0000)]
Restructure the mul/div/rem handling code to follow the pattern the other
instructions use.  This doesn't change any functionality except that long
constant expressions of these operations will now magically start working.

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

18 years agoCodegen FP adds and subtracts with a constant more efficiently, generating:
Chris Lattner [Sun, 11 Apr 2004 20:26:20 +0000 (20:26 +0000)]
Codegen FP adds and subtracts with a constant more efficiently, generating:

        fld QWORD PTR [%ESP + 4]
        fadd QWORD PTR [.CPItest_add_0]

instead of:

        fld QWORD PTR [%ESP + 4]
        fld QWORD PTR [.CPItest_add_0]
        faddp %ST(1)

I also intend to do this for mul & div, but it appears that I have to
refactor a bit of code before I can do so.

This is tested by: test/Regression/CodeGen/X86/fp_constant_op.llx

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

18 years agoAdd some new instructions
Chris Lattner [Sun, 11 Apr 2004 20:24:15 +0000 (20:24 +0000)]
Add some new instructions

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

18 years agoNew testcase
Chris Lattner [Sun, 11 Apr 2004 20:24:01 +0000 (20:24 +0000)]
New testcase

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

18 years agoRelax assertion to make this function work with a broader class of instructions
Chris Lattner [Sun, 11 Apr 2004 20:21:06 +0000 (20:21 +0000)]
Relax assertion to make this function work with a broader class of instructions

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

18 years agoTwo changes:
Chris Lattner [Sun, 11 Apr 2004 19:21:59 +0000 (19:21 +0000)]
Two changes:
  1. If an incoming argument is dead, don't load it from the stack
  2. Do not code gen noop copies at all (ie, cast int -> uint), not even to
     a move.  This should reduce register pressure for allocators that are
     unable to coallesce away these copies in some cases.

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

18 years agoAdd another variant of the testcase
Chris Lattner [Sun, 11 Apr 2004 19:01:35 +0000 (19:01 +0000)]
Add another variant of the testcase

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

18 years agooperator new & operator new[] do not kill any legal memory locations.
Chris Lattner [Sun, 11 Apr 2004 18:16:34 +0000 (18:16 +0000)]
operator new & operator new[] do not kill any legal memory locations.

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

18 years agonew testcase
Chris Lattner [Sun, 11 Apr 2004 16:47:15 +0000 (16:47 +0000)]
new testcase

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

18 years agoAllow clients to be more efficient.
Chris Lattner [Sun, 11 Apr 2004 16:43:07 +0000 (16:43 +0000)]
Allow clients to be more efficient.

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

18 years agoMake comments above APIs reflect what they should do.
Chris Lattner [Sun, 11 Apr 2004 16:42:50 +0000 (16:42 +0000)]
Make comments above APIs reflect what they should do.

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

18 years agoNew method to allow more efficient clients
Chris Lattner [Sun, 11 Apr 2004 16:35:30 +0000 (16:35 +0000)]
New method to allow more efficient clients

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

18 years agoFix a bug in my select transformation
Chris Lattner [Sun, 11 Apr 2004 01:39:19 +0000 (01:39 +0000)]
Fix a bug in my select transformation

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

18 years agoAdd a missing break, which caused a crash in an obscure situation
Chris Lattner [Sun, 11 Apr 2004 01:29:30 +0000 (01:29 +0000)]
Add a missing break, which caused a crash in an obscure situation

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

18 years agoUpdate the value numbering interface.
Chris Lattner [Sat, 10 Apr 2004 22:33:34 +0000 (22:33 +0000)]
Update the value numbering interface.

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

18 years agoNote to self: SAVE FILES!
Chris Lattner [Sat, 10 Apr 2004 22:32:47 +0000 (22:32 +0000)]
Note to self: SAVE FILES!

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

18 years agoAdd an interface to update value numbering
Chris Lattner [Sat, 10 Apr 2004 22:32:09 +0000 (22:32 +0000)]
Add an interface to update value numbering

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

18 years agoImplement InstCombine/select.ll:test13*
Chris Lattner [Sat, 10 Apr 2004 22:21:27 +0000 (22:21 +0000)]
Implement InstCombine/select.ll:test13*

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

18 years agoNew testcases
Chris Lattner [Sat, 10 Apr 2004 22:21:14 +0000 (22:21 +0000)]
New testcases

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

18 years agoImplement InstCombine/add.ll:test20
Chris Lattner [Sat, 10 Apr 2004 22:01:55 +0000 (22:01 +0000)]
Implement InstCombine/add.ll:test20
Canonicalize add of sign bit constant into a xor

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

18 years agoNew testcase
Chris Lattner [Sat, 10 Apr 2004 22:01:27 +0000 (22:01 +0000)]
New testcase

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

18 years agoRewrite the GCSE pass to be *substantially* simpler, a bit more efficient,
Chris Lattner [Sat, 10 Apr 2004 21:11:11 +0000 (21:11 +0000)]
Rewrite the GCSE pass to be *substantially* simpler, a bit more efficient,
and a bit more powerful

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

18 years agoFix spurious warning in release mode
Chris Lattner [Sat, 10 Apr 2004 19:15:56 +0000 (19:15 +0000)]
Fix spurious warning in release mode

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

18 years agoSilence a spurious warning
Chris Lattner [Sat, 10 Apr 2004 18:32:01 +0000 (18:32 +0000)]
Silence a spurious warning

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

18 years agoSimplify code a bit, and fix a bug that was breaking perlbmk
Chris Lattner [Sat, 10 Apr 2004 18:06:21 +0000 (18:06 +0000)]
Simplify code a bit, and fix a bug that was breaking perlbmk

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

18 years agoFix a bug in my checkin last night that was breaking programs using invoke.
Chris Lattner [Sat, 10 Apr 2004 16:53:29 +0000 (16:53 +0000)]
Fix a bug in my checkin last night that was breaking programs using invoke.

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

18 years agoFix previous patch
Chris Lattner [Sat, 10 Apr 2004 07:27:48 +0000 (07:27 +0000)]
Fix previous patch

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

18 years agoCorrectly update counters
Chris Lattner [Sat, 10 Apr 2004 07:02:02 +0000 (07:02 +0000)]
Correctly update counters

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

18 years agoAdd note
Chris Lattner [Sat, 10 Apr 2004 06:56:53 +0000 (06:56 +0000)]
Add note

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

18 years agoAdd a couple of more functions that cannot access memory (the intrinsics) and
Chris Lattner [Sat, 10 Apr 2004 06:55:27 +0000 (06:55 +0000)]
Add a couple of more functions that cannot access memory (the intrinsics) and
don't write to memory

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