summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAge
* Remove redundant const qualifierChris Lattner2003-07-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7254 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove redundant const qualifiers from cast<> expressionsChris Lattner2003-07-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7253 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify code by using ConstantInt::getRawValue instead of checking to seeChris Lattner2003-07-23
| | | | | | | whether the constant is signed or unsigned, then casting git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7252 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove unnecessary castsChris Lattner2003-07-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7250 91177308-0d34-0410-b5e6-96231b3b80d8
* Fit code into 80 columnsChris Lattner2003-07-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7249 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminate old-style castChris Lattner2003-07-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7248 91177308-0d34-0410-b5e6-96231b3b80d8
* Random cleanupsChris Lattner2003-07-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7247 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove using declChris Lattner2003-07-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7246 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove explicit const qualifiersChris Lattner2003-07-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7245 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix bug: TailDup/2003-07-22-InfiniteLoop.llChris Lattner2003-07-23
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7243 91177308-0d34-0410-b5e6-96231b3b80d8
* - InstCombine (cast (xor A, B) to bool) ==> (setne A, B)Chris Lattner2003-07-22
| | | | | | | - InstCombine (cast (and X, (1 << size(X)-1)) to bool) ==> x < 0 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7241 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix comment.Vikram S. Adve2003-07-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7227 91177308-0d34-0410-b5e6-96231b3b80d8
* Simplify code a bitChris Lattner2003-07-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7217 91177308-0d34-0410-b5e6-96231b3b80d8
* Added code that checks to see if a global variable is external before replacingJohn Criswell2003-07-21
| | | | | | | a load of the global variable with the variable's constant value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7216 91177308-0d34-0410-b5e6-96231b3b80d8
* Eliminated dead code.Misha Brukman2003-07-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7209 91177308-0d34-0410-b5e6-96231b3b80d8
* Added special consideration for instrumentation strategyAnand Shukla2003-07-20
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7208 91177308-0d34-0410-b5e6-96231b3b80d8
* Added check for inlinable functionAnand Shukla2003-07-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7206 91177308-0d34-0410-b5e6-96231b3b80d8
* Please, save your applause^H^H^H^H^H^H^H^Hflames for the end...Brian Gaeke2003-07-18
| | | | | | | | | | | | | | | | | Avoid a fall-through in the (stubby) treatment of the longjmp intrinsic call which causes llc & lli to core-dump. Add a sort-of treatment of cast double to ulong. I am not really sure what a user should expect to see upon casting a negative FP value to unsigned long long. But with what is given here, I was able to write a program that could cast -123.456 to ulong and back and get -123.0, which seems like a step in the right direction. GCC seems to give you 0. I don't know if I'd consider that useful. These cases were coming up in GNU coreutils-5.0. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7205 91177308-0d34-0410-b5e6-96231b3b80d8
* Cleaned up the code which chooses the appropriate value for the file descriptorMisha Brukman2003-07-18
| | | | | | | | to pass to dlsym() -- Linux/x86 wants 0 while Sparc/Solaris wants RTLD_SELF, which is not zero. Thanks to Chris for the suggestion. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7204 91177308-0d34-0410-b5e6-96231b3b80d8
* A pass to combine multiple backedges that go to same targetAnand Shukla2003-07-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7201 91177308-0d34-0410-b5e6-96231b3b80d8
* Use getClassB for load and store; we don't want to abort when weBrian Gaeke2003-07-17
| | | | | | | try to load or store through a bool*. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7195 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix typo in call to isUnresolvableFunc, which was breaking the build.Brian Gaeke2003-07-17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7194 91177308-0d34-0410-b5e6-96231b3b80d8
* Dinakar and I fixed a bug where we were trying to get the initializer ofJohn Criswell2003-07-17
| | | | | | | | an external constant. Since external constants don't have initializers, we were failing on an assert() call in llvm/GlobalVariable.h. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7193 91177308-0d34-0410-b5e6-96231b3b80d8
* Rematerialize nodes from the globals graph into the current graphVikram S. Adve2003-07-16
| | | | | | | | | | | after all callees are inlined into the current graph. NOTE: There's also a major bug fix for the BU pass in DataStructure.cpp, which ensures that resolvable indirect calls are not moved out to the globals graph, so that they are eventually inlined (if possible). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7189 91177308-0d34-0410-b5e6-96231b3b80d8
* (1) Rematerialize nodes from the globals graph into the current graphVikram S. Adve2003-07-16
| | | | | | | | | | | | | after all callers are inlined into the current graph. (2) Optimize the way a graph is inlined into its callees in the TD phase: (a) Use DSGraph::cloneReachableSubgraph to clone only a subgraph at each call site, for faster inlining. (b) Clone separately for the same callee at different call sites, since only the reachable subgraph is being cloned, not the entire caller graph. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7188 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement 2 important changes: (1) rematerialization from the globals graph,Vikram S. Adve2003-07-16
| | | | | | | | | | | | | | | | | | | | | | | | and (2) faster inlining by cloning only reachable nodes. In particular: (1) Added DSGraph::cloneReachableSubgraph and DSGraph::cloneReachableNodes to clone the subgraph reachable from a set of root nodes, into the current graph, merging the global nodes into thos in the current graph. The TD pass now uses this for faster inlining, and so does the next function. (2) Added DSGraph::updateFromGlobalGraph() to rematerialize nodes from the globals graph into the current graph in both BU and TD passes. (3) `I' flags are removed from all nodes in the globals graph, because they are difficult to maintain correctly and are not needed anyway. (4) Aux. function calls are only removed to the globals graph if they will never be resovled. (This is what fixed gap.) The immediate reason is that if we took these out of a function (and moved them to the globals graph) we would need to rematerialize these nodes into the function graph for every function in the BU pass. The longer term problem is that we would need to find a way to remove them from the globals graph iff they have been resolved on all paths through the call graph. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7187 91177308-0d34-0410-b5e6-96231b3b80d8
* Factor out the test for unresolvable external functions intoVikram S. Adve2003-07-16
| | | | | | | | isUnresolvableFunc() (I thought I needed this externally. I don't, but it's still nicer this way.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7186 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed the number translation scheme for the integer condition code registers: itMisha Brukman2003-07-16
| | | | | | | | | | | now works in instructions which require a 2-bit or 3-bit INTcc code. Incidentally, that means that the representation of INTcc registers is now the same in both integer and FP instructions. Thus, code became much simpler and cleaner. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7185 91177308-0d34-0410-b5e6-96231b3b80d8
* The name should really be `simm11' to follow the naming convention, but this hasMisha Brukman2003-07-16
| | | | | | | no change in functionality. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7184 91177308-0d34-0410-b5e6-96231b3b80d8
* No need for a second immediate field if the class already inherits one.Misha Brukman2003-07-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7182 91177308-0d34-0410-b5e6-96231b3b80d8
* Encode predict = 1 by default, because the Sparc assembler does this.Misha Brukman2003-07-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7181 91177308-0d34-0410-b5e6-96231b3b80d8
* Correctly handle calls to functions which are further away than 2**32 bits willMisha Brukman2003-07-15
| | | | | | | | | | | | | allow, i.e. make a sequence of instructions to enable an indirect call using jump-and-link and 2 temporary registers (which we save and ultimately restore). Warning: if the delay slot of a function call is used to do meaningful work and not just a NOP, this behavior is incorrect. However, the Sparc backend does not yet utilize the delay slots effectively, so it is not necessary to make an overly complicated algorithm for something that's not used. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7178 91177308-0d34-0410-b5e6-96231b3b80d8
* Clean up my last checkin: code is easier to read and explains the differences inMisha Brukman2003-07-15
| | | | | | | usage of the special file handle RTLD_SELF on Sparc/Solaris vs. 0 on Linux/x86. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7177 91177308-0d34-0410-b5e6-96231b3b80d8
* On Sparc/Solaris, the special handle RTLD_SELF is used as a handle referring toMisha Brukman2003-07-15
| | | | | | | | the program's executing image, not 0 as it is on Linux/x86 and possibly other systems. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7176 91177308-0d34-0410-b5e6-96231b3b80d8
* * Added support for the %ccr registerMisha Brukman2003-07-14
| | | | | | | | | * FP double registers are now coded correctly * Removed function which converted registers based on register types, it was broken (because regTypes are broken) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7175 91177308-0d34-0410-b5e6-96231b3b80d8
* The word `separate' only has one `e'.Misha Brukman2003-07-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7174 91177308-0d34-0410-b5e6-96231b3b80d8
* The word `separate' only has one `e'.Misha Brukman2003-07-14
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7173 91177308-0d34-0410-b5e6-96231b3b80d8
* Trace loads and stores as they happen (stores were beingVikram S. Adve2003-07-11
| | | | | | | | | | | | remembered in valuesStoredInFunction, but never traced at function return, and that's too late to be finding the error anyway). Stores trace both the value and the address being stored to, but after some experience I think only values should be traced. The pointer hash table just fills up far too quickly if every store address were traced. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7169 91177308-0d34-0410-b5e6-96231b3b80d8
* If we have a constant pointer reference to a function, we were printingBrian Gaeke2003-07-11
| | | | | | | | | out the entire llvm disassembly for the function at global constant-output time, which caused the assembler to barf in 164.gzip. This fixes that particular problem (though 164.gzip has other problems with X86 llc.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7168 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix some serious floating-point bugs (fixes test cases such as Oscar,Brian Gaeke2003-07-11
| | | | | | | | | | | | | | | Fhourstones, McCat-vor, and many others...) Printer.cpp: Print implicit uses for AddRegFrm instructions. Break gas bug workarounds up into separate stanzas of code for each bug. Add new workarounds for fild and fistp. X86InstrInfo.def: Add O_ST0 implicit uses for more FP instrs where they obviously apply. Also add PrintImplUses flags for FP instrs where they are necessary for gas to understand the output. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7165 91177308-0d34-0410-b5e6-96231b3b80d8
* Added functionality to instrmentation passAnand Shukla2003-07-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7161 91177308-0d34-0410-b5e6-96231b3b80d8
* Fixed grammatical error.Misha Brukman2003-07-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7160 91177308-0d34-0410-b5e6-96231b3b80d8
* Several important bug fixes:Vikram S. Adve2003-07-10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (1) Cannot use ANDN(ot), ORN, and XORN for boolean ops, only bitwise ops. (2) Conditional move instructions must distinguish signed and unsigned condition codes, e.g., MOVLE vs. MOVLEU. (3) Conditional-move-on-register was using the cond-move-on-cc opcodes, which produces a valid-looking instruction with bogus registers! (4) Here's a really cute one: dividing-by-2^k for negative numbers needs to add 2^k-1 before shifting, not add 1 after shifting. Sadly, these are the same when k=0 so our poor test case worked fine. (5) Casting between signed and unsigned values was not correct: completely reimplemented. (6) Zero-extension on unsigned values was bogus: I was only doing the SRL and not the SLLX before it. Don't know WHAT I was thinking! (7) And the most important class of changes: Sign-extensions on signed values. Signed values are not sign-extended after ordinary operations, so they must be sign-extended before the following cases: -- passing to an external or unknown function -- returning from a function -- using as operand 2 of DIV or REM -- using as either operand of condition-code setting operation (currently only SUBCC), with smaller than 32-bit operands Also, a couple of improvements: (1) Fold cast-to-bool into Not(bool). Need to do this for And, Or, XOR also. (2) Convert SetCC-Const into a conditional-move-on-register (case 41) if the constant is 0. This was only being done for branch-on-SetCC-Const when the branch is folded with the SetCC-Const. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7159 91177308-0d34-0410-b5e6-96231b3b80d8
* Bug fix in creating constants: need 1U << 31, not 1 << 31.Vikram S. Adve2003-07-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7158 91177308-0d34-0410-b5e6-96231b3b80d8
* Fold cast-to-bool into not. Later, this should also be folded into otherVikram S. Adve2003-07-10
| | | | | | | boolean operations: AND, OR, XOR. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7157 91177308-0d34-0410-b5e6-96231b3b80d8
* Values stored in CallArgsDescriptor cannot be const.Vikram S. Adve2003-07-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7156 91177308-0d34-0410-b5e6-96231b3b80d8
* isMarkedForSpill() should be const.Vikram S. Adve2003-07-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7155 91177308-0d34-0410-b5e6-96231b3b80d8
* Change interface to MachineInstr::substituteValue to specify more preciselyVikram S. Adve2003-07-10
| | | | | | | which args can be substituted: defsOnly, defsAndUses or usesOnly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7154 91177308-0d34-0410-b5e6-96231b3b80d8
* Print out all neighbors in interference graph, not just higher-numbered ones.Vikram S. Adve2003-07-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7153 91177308-0d34-0410-b5e6-96231b3b80d8
* Several fixes to handling of int CC register:Vikram S. Adve2003-07-10
| | | | | | | | | | | | | | | | | | | | | | (1) An int CC live range must be spilled if there are any interferences, even if no other "neighbour" in the interf. graph has been allocated that reg. yet. This is actually true of any class with only one reg! (2) SparcIntCCRegClass::colorIGNode sets the color even if the LR must be spilled so that the machine-independent spill code doesn't have to make the machine-dependent decision of which CC name to use based on operand type: %xcc or %icc. (These are two halves of the same register.) (3) LR->isMarkedForSpill() is no longer the same as LR->hasColor(). These should never have been the same, and this is necessary now for #2. (4) All RDCCR and WRCCR instructions are directly generated with the phony number for %ccr so that EmitAssembly/EmitBinary doesn't have to deal with this. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7152 91177308-0d34-0410-b5e6-96231b3b80d8