summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAge
* Add SCCP support for constant folding calls, implementing:Chris Lattner2004-04-13
| | | | | | | test/Regression/Transforms/SCCP/calltest.ll git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12921 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a simple call constant propagation interface.Chris Lattner2004-04-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12919 91177308-0d34-0410-b5e6-96231b3b80d8
* Constant propagation should remove the dead instructionsChris Lattner2004-04-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12917 91177308-0d34-0410-b5e6-96231b3b80d8
* I don't think we have to have 4 extra allocated (but unused) bytes on the stack.Brian Gaeke2004-04-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12905 91177308-0d34-0410-b5e6-96231b3b80d8
* I started working on casts, but I don't have anything compilable yet.Brian Gaeke2004-04-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12903 91177308-0d34-0410-b5e6-96231b3b80d8
* Emit the immediate form of in/out when possible.Chris Lattner2004-04-13
| | | | | | | | | | | | 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
* Add immediate forms of in/out. Use let to shorten linesChris Lattner2004-04-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12895 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for new instruction typeChris Lattner2004-04-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12894 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for the printImplicitDefsBefore flagChris Lattner2004-04-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12893 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix LoopSimplify/2004-04-13-LoopSimplifyUpdateDomFrontier.llChris Lattner2004-04-13
| | | | | | | 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
* Refactor code a bit to make it simpler and eliminate the gotoChris Lattner2004-04-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12888 91177308-0d34-0410-b5e6-96231b3b80d8
* This patch addresses PR35: Loop simplify should reconstruct nested loops.Chris Lattner2004-04-13
| | | | | | | | 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
* We don't need to insert TargetData into the PassManager here.Brian Gaeke2004-04-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12874 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix bug introduced in previous commit.Alkis Evlogimenos2004-04-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12872 91177308-0d34-0410-b5e6-96231b3b80d8
* Add some methods that are useful for updating loop information.Chris Lattner2004-04-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12871 91177308-0d34-0410-b5e6-96231b3b80d8
* Correctly compute spill weightsAlkis Evlogimenos2004-04-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12869 91177308-0d34-0410-b5e6-96231b3b80d8
* Print def lists a bit more compactlyAlkis Evlogimenos2004-04-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12866 91177308-0d34-0410-b5e6-96231b3b80d8
* Actually update the call graph as the inliner changes it. This allows us toChris Lattner2004-04-12
| | | | | | | 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
* Change the call graph class to have TWO external nodes, making call graphChris Lattner2004-04-12
| | | | | | | | 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
* Hrm, operator new and new[] do not belong here. We should not CSE them! :)Chris Lattner2004-04-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12859 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for removing invoke instructionsChris Lattner2004-04-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12858 91177308-0d34-0410-b5e6-96231b3b80d8
* Stop printing Function*Chris Lattner2004-04-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12857 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify code a bit, and be sure to mark the external node as potentially ↵Chris Lattner2004-04-12
| | | | | | throwing git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12856 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix issues that the local allocator has dealing with instructions that ↵Chris Lattner2004-04-12
| | | | | | implicitly use ST(0) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12855 91177308-0d34-0410-b5e6-96231b3b80d8
* No really, fix printing for LLC. I gotta get a way for CVS to whine at me ifChris Lattner2004-04-12
| | | | | | | I have unsaved emacs buffers, geeze... git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12854 91177308-0d34-0410-b5e6-96231b3b80d8
* Correct printing for LLC and the encoding for the JITChris Lattner2004-04-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12853 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the fucomi[p] instructions to perform floating point comparisons insteadChris Lattner2004-04-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add support for the FUCOMIr instructionChris Lattner2004-04-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12851 91177308-0d34-0410-b5e6-96231b3b80d8
* Add two new instructionsChris Lattner2004-04-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12850 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug in my load/cast folding patch.Chris Lattner2004-04-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12849 91177308-0d34-0410-b5e6-96231b3b80d8
* Adjust some comments, fix a bug in my previous patchChris Lattner2004-04-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12848 91177308-0d34-0410-b5e6-96231b3b80d8
* On X86, casting an integer to floating point requires going through memory.Chris Lattner2004-04-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Implement folding of loads into floating point operations. This implements:Chris Lattner2004-04-11
| | | | | | | 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
* Unify all of the code for floating point +,-,*,/ into one functionChris Lattner2004-04-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12842 91177308-0d34-0410-b5e6-96231b3b80d8
* This implements folding of constant operands into floating point operationsChris Lattner2004-04-11
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* Restructure the mul/div/rem handling code to follow the pattern the otherChris Lattner2004-04-11
| | | | | | | | 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
* Codegen FP adds and subtracts with a constant more efficiently, generating:Chris Lattner2004-04-11
| | | | | | | | | | | | | | | | | | | 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
* Add some new instructionsChris Lattner2004-04-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12838 91177308-0d34-0410-b5e6-96231b3b80d8
* Relax assertion to make this function work with a broader class of instructionsChris Lattner2004-04-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12836 91177308-0d34-0410-b5e6-96231b3b80d8
* Two changes:Chris Lattner2004-04-11
| | | | | | | | | | 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
* operator new & operator new[] do not kill any legal memory locations.Chris Lattner2004-04-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12833 91177308-0d34-0410-b5e6-96231b3b80d8
* Allow clients to be more efficient.Chris Lattner2004-04-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12831 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a bug in my select transformationChris Lattner2004-04-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12826 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a missing break, which caused a crash in an obscure situationChris Lattner2004-04-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12825 91177308-0d34-0410-b5e6-96231b3b80d8
* Update the value numbering interface.Chris Lattner2004-04-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12824 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement InstCombine/select.ll:test13*Chris Lattner2004-04-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12821 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement InstCombine/add.ll:test20Chris Lattner2004-04-10
| | | | | | | 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
* Rewrite the GCSE pass to be *substantially* simpler, a bit more efficient,Chris Lattner2004-04-10
| | | | | | | and a bit more powerful git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12817 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix spurious warning in release modeChris Lattner2004-04-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12816 91177308-0d34-0410-b5e6-96231b3b80d8
* Silence a spurious warningChris Lattner2004-04-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12815 91177308-0d34-0410-b5e6-96231b3b80d8