aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Target
Commit message (Collapse)AuthorAgeFilesLines
...
* Better folding getelementptr operations with mixedVikram S. Adve2002-05-191-41/+61
| | | | | | | | | array and struct indexes. Update operand values in CallArgsDescriptor (a new class) when replacing constant values with immediates. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2645 91177308-0d34-0410-b5e6-96231b3b80d8
* cpValue2Value now needs a vector of MachineInstr to store return values.Vikram S. Adve2002-05-191-16/+20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2644 91177308-0d34-0410-b5e6-96231b3b80d8
* Annotation class for MachineInstr.Vikram S. Adve2002-05-191-0/+96
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2643 91177308-0d34-0410-b5e6-96231b3b80d8
* Numerous bug fixes:Vikram S. Adve2002-05-192-27/+58
| | | | | | | | | | | | | | | | | | | | -- passing FP arguments to functions with more than 6 arguments -- passing FP arguments to varargs functions -- passing FP arguments to functions with no prototypes -- incorrect coloring for CC registers (both int and FP): interferences were being completely ignored for int CC and were considered but no spills were marked for fp CC! Also some code improvements: -- better interface to generating machine instr for common cases (many places still need to be updated to use this interface) -- annotations on MachineInstr to communicate information from one codegen phase to another (now used to pass information about CALL/JMPLCALL operands from selection to register allocation) -- all sizes and offests in class TargetData are uint64_t instead of uint git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2642 91177308-0d34-0410-b5e6-96231b3b80d8
* Add integer register size field.Vikram S. Adve2002-05-191-27/+37
| | | | | | | | Make all sizes and offsets uint64_t instead of uint. Fixed GetIndexedOffset to handle mixed array and struct indices. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2641 91177308-0d34-0410-b5e6-96231b3b80d8
* Numerous bug fixes:Vikram S. Adve2002-05-198-887/+1004
| | | | | | | | | | | | | | | | | | | | | | | | | -- correct sign extensions for integer casts and for shift-by-constant instructions generated for integer multiply -- passing FP arguments to functions with more than 6 arguments -- passing FP arguments to varargs functions -- passing FP arguments to functions with no prototypes -- incorrect stack frame size when padding a section -- folding getelementptr operations with mixed array and struct indexes -- use uint64_t instead of uint for constant offsets in mem operands -- incorrect coloring for CC registers (both int and FP): interferences were being completely ignored for int CC and were considered but no spills were marked for fp CC! Also some code improvements: -- better interface to generating machine instr for common cases (many places still need to be updated to use this interface) -- annotations on MachineInstr to communicate information from one codegen phase to another (now used to pass information about CALL/JMPLCALL operands from selection to register allocation) -- all sizes and offests in class TargetData are uint64_t instead of uint git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2640 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix bug: test/Regression/CBackend/2002-05-16-NameCollide.ll by trackingChris Lattner2002-05-172-4/+48
| | | | | | | | which global variables would have name collisions if they were not mangled, and use this info to mangle them iff they would collide. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2639 91177308-0d34-0410-b5e6-96231b3b80d8
* Last minor cleanups, this code still does not work for all cases, but itChris Lattner2002-05-092-36/+20
| | | | | | | works much better than it used to. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2588 91177308-0d34-0410-b5e6-96231b3b80d8
* Two Cleanups to generated C code:Chris Lattner2002-05-092-70/+130
| | | | | | | | | | | | | | | 1. Avoid printing *(&globalvariable), instead print globalvariable alone as a special case. 2. Inline subexpressions into expressions as much as legal that preserves execution characteristics of expressions. Now we get nice (but over-parenthesized, oh well) things like: ltmp_428_7 = spec__putc(((unsigned char )((bsBuff) >> 24)), (bsStream)); instead of five seperate instructions (bsBuff & bsStream are globals). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2587 91177308-0d34-0410-b5e6-96231b3b80d8
* * Remove CInstPrintVisitor class, incorporating it into the CWriter classChris Lattner2002-05-092-688/+600
| | | | | | | * Reorder code in the file to make it more logically laid out. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2586 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove CLocalVars data structure entirely, instead of building stuff andChris Lattner2002-05-092-56/+6
| | | | | | | then printing it out, just print as we go. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2585 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify code by removing InstLocalVarsVisitor, replacing it with a simpleChris Lattner2002-05-092-124/+34
| | | | | | | inst_iterator. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2584 91177308-0d34-0410-b5e6-96231b3b80d8
* * Clean up how PHI nodes are handledChris Lattner2002-05-092-108/+146
| | | | | | | | | | | | | | | * Correct global variable references * Fix loads & stores with zero indices * Do not emit an else part of a branch if there is no code (no phi node and a fallthrough branch), makes code more readable to get: if (l2_cond240) { goto l13_bb10; } with no else{} branch git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2583 91177308-0d34-0410-b5e6-96231b3b80d8
* Emit:Chris Lattner2002-05-092-4/+26
| | | | | | | | | | | l3_reg109 = l81_this->field0; Instead of: l3_reg109 = l81_this[0u].field0; where possible git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2579 91177308-0d34-0410-b5e6-96231b3b80d8
* * Print structures types correctlyChris Lattner2002-05-092-84/+140
| | | | | | | | * Clean up generated code to not emit basic block labels and goto instructions if they are unneccesary (for example, fall throughs) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2578 91177308-0d34-0410-b5e6-96231b3b80d8
* * Continue cleanup of type printing codeChris Lattner2002-05-092-116/+90
| | | | | | | | | * Print a newline after a malloc instruction * Convert unprintable characters to x_ instead of _x so that we don't generate identifiers that start with underscores git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2577 91177308-0d34-0410-b5e6-96231b3b80d8
* Gut the type printing code so there is only one copy of it instead of 3Chris Lattner2002-05-092-592/+184
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2576 91177308-0d34-0410-b5e6-96231b3b80d8
* * Remove dead "constant printing" codeChris Lattner2002-05-092-96/+44
| | | | | | | | | | * Mangle names with only a prefix so that they are easier on the eyes. * Put spaces around binary operators with low precedence to make them easier to read * Don't prefix function names with &, although it's correct, it's unnecesary and easier to read without it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2575 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove gross "Operand" instance variableChris Lattner2002-05-092-82/+62
| | | | | | | Remove lots of unneccesary arguments to methods git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2574 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify and clean up function calls.Chris Lattner2002-05-092-98/+74
| | | | | | | Now indirect function calls work, except that function pointer types are not correct. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2573 91177308-0d34-0410-b5e6-96231b3b80d8
* * Remove dead functionChris Lattner2002-05-092-18/+40
| | | | | | | | * Print C strings correctly * Expand C escape sequences nicely (ie \n \t, etc get generated instead of hex escapes) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2572 91177308-0d34-0410-b5e6-96231b3b80d8
* Make Getelementptr, load & store all work the right way.Chris Lattner2002-05-092-224/+74
| | | | | | | Handle global variables correctly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2571 91177308-0d34-0410-b5e6-96231b3b80d8
* Many random fixes:Chris Lattner2002-05-092-224/+112
| | | | | | | | * Use binary operator logic for shifts instead of cloning code * Unary not is '~' not '!' git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2570 91177308-0d34-0410-b5e6-96231b3b80d8
* Incorporate and purge function before and after printing them so unnamed valuesChris Lattner2002-05-092-22/+32
| | | | | | | | | have some hope of working right. Function calls do not try to emit an lvalue if they return void. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2569 91177308-0d34-0410-b5e6-96231b3b80d8
* Factor out the code to print a value to ONE place.Chris Lattner2002-05-092-374/+202
| | | | | | | It turns out that unnamed values DO NOT work at all, that's next on the list. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2568 91177308-0d34-0410-b5e6-96231b3b80d8
* First wave of cleanups, looks like the first of many.Chris Lattner2002-05-092-584/+324
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2567 91177308-0d34-0410-b5e6-96231b3b80d8
* *** empty log message ***Sumant Kowshik2002-05-083-0/+2837
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2552 91177308-0d34-0410-b5e6-96231b3b80d8
* Extend TargetData::getIndexedOffset to support arrays and pointers!Chris Lattner2002-05-071-10/+13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2535 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace all usages of Type::isPointerType with isa<PointerType>Chris Lattner2002-05-064-46/+34
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2486 91177308-0d34-0410-b5e6-96231b3b80d8
* Add neccesary #includeChris Lattner2002-04-291-0/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2406 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate duplicate or unneccesary #include'sChris Lattner2002-04-2919-24/+7
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2397 91177308-0d34-0410-b5e6-96231b3b80d8
* Add new optional getPassName() virtual function that a Pass can overrideChris Lattner2002-04-296-0/+24
| | | | | | | to make debugging output a lot nicer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2395 91177308-0d34-0410-b5e6-96231b3b80d8
* Tighten up the AnalysisUsage of lots of passes, primarily to correctly ↵Chris Lattner2002-04-281-1/+9
| | | | | | indicate whether or not they invalidate the CFGA git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2386 91177308-0d34-0410-b5e6-96231b3b80d8
* Add #include that was removed from TargetMachine.hChris Lattner2002-04-282-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2381 91177308-0d34-0410-b5e6-96231b3b80d8
* Include appropriate fileChris Lattner2002-04-281-0/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2379 91177308-0d34-0410-b5e6-96231b3b80d8
* Split ConstantVals.h into Constant.h and Constants.hChris Lattner2002-04-286-10/+10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2378 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify and update code a bitChris Lattner2002-04-281-5/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2376 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate the cfg namespace, moving LoopInfo, Dominators, Interval* classesChris Lattner2002-04-281-6/+4
| | | | | | | to the global namespace git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2370 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove all contents of the cfg namespace to the global namespaceChris Lattner2002-04-281-4/+4
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2369 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify codeChris Lattner2002-04-281-15/+5
| | | | | | | Remove unneccesary getID variant for module's git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2353 91177308-0d34-0410-b5e6-96231b3b80d8
* s/Method/FunctionChris Lattner2002-04-278-35/+36
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2336 91177308-0d34-0410-b5e6-96231b3b80d8
* * Rename MethodPass class to FunctionPassChris Lattner2002-04-277-61/+53
| | | | | | | | | | | | | | | | - Rename runOnMethod to runOnFunction * Transform getAnalysisUsageInfo into getAnalysisUsage - Method is now const - It now takes one AnalysisUsage object to fill in instead of 3 vectors to fill in - Pass's now specify which other passes they _preserve_ not which ones they modify (be conservative!) - A pass can specify that it preserves all analyses (because it never modifies the underlying program) * s/Method/Function/g in other random places as well git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2333 91177308-0d34-0410-b5e6-96231b3b80d8
* Use the cast<> operator in favor of C style castsChris Lattner2002-04-271-3/+3
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2331 91177308-0d34-0410-b5e6-96231b3b80d8
* Change Constant::getNullConstant to Constant::getNullValueChris Lattner2002-04-271-3/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2323 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify code a bitChris Lattner2002-04-271-6/+5
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2322 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't record instructions for copying method arguments in theVikram S. Adve2002-04-251-0/+1
| | | | | | | | | AddedInstrns sets for the first machine instruction. It is hard to ensure that the right order is preserved, and sure enough, the order was broken. Instead, use a separate set for the function entry. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2318 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't pad spills and temp. stack areas for alignment.Vikram S. Adve2002-04-251-4/+5
| | | | | | | | Freeze auto vars and spill areas when their sizes are used for computing other offsets. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2317 91177308-0d34-0410-b5e6-96231b3b80d8
* Major changes to how int and FP arguments are handled. VarargsVikram S. Adve2002-04-251-189/+254
| | | | | | | | function calls were simply wrong; other functions were just not using all available registers. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2316 91177308-0d34-0410-b5e6-96231b3b80d8
* Added functions to compute which register, if any, to useVikram S. Adve2002-04-251-15/+20
| | | | | | | for a particular argument in a list of arguments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2315 91177308-0d34-0410-b5e6-96231b3b80d8
* Insert copy operations for FP arguments to a varargs function,Vikram S. Adve2002-04-251-31/+69
| | | | | | | | | to copy the FP arg. to an integer. Necessary so that the register allocator has two different live ranges for the FP value and the int. argument. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2314 91177308-0d34-0410-b5e6-96231b3b80d8