1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-24 05:23:45 +02:00
Commit Graph

6821 Commits

Author SHA1 Message Date
Brian Gaeke
026c333f07 Fix typo in call to isUnresolvableFunc, which was breaking the build.
llvm-svn: 7194
2003-07-17 19:07:46 +00:00
John Criswell
dbaf5f719c Dinakar and I fixed a bug where we were trying to get the initializer of
an external constant.  Since external constants don't have initializers, we
were failing on an assert() call in llvm/GlobalVariable.h.

llvm-svn: 7193
2003-07-17 19:06:55 +00:00
Brian Gaeke
593160bf03 Added bits about MachineFunctionPass
llvm-svn: 7192
2003-07-17 18:53:20 +00:00
Vikram S. Adve
d8c1b1911c Tests for globals with different kinds of behavior in DS Analysis.
llvm-svn: 7191
2003-07-16 21:48:38 +00:00
Vikram S. Adve
2d617afa1a (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 those in the current graph.
(2) Added DSGraph::updateFromGlobalGraph() to rematerialize nodes from the
    globals graph into the current graph in both BU and TD passes.
(3) Added hash_set<const GlobalValue*> InlinedGlobals: a set of globals to
    track which globals have been inlined into the current graph from
    callers or callees.  In the TD pass, such globals are up-to-date and
    do not need to be rematerialized from the GlobalsGraph.
(4) Added StripIncompleteBit/KeepIncompleteBit to remove incomplete bit
    when cloning nodes into the globals graph.

llvm-svn: 7190
2003-07-16 21:45:15 +00:00
Vikram S. Adve
96abba3e01 Rematerialize nodes from the globals graph into the current graph
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).

llvm-svn: 7189
2003-07-16 21:42:03 +00:00
Vikram S. Adve
e2993f34ed (1) Rematerialize nodes from the globals graph into the current graph
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.

llvm-svn: 7188
2003-07-16 21:40:28 +00:00
Vikram S. Adve
d1a85b7860 Implement 2 important changes: (1) rematerialization from the globals graph,
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.

llvm-svn: 7187
2003-07-16 21:36:31 +00:00
Vikram S. Adve
0ce80bfa82 Factor out the test for unresolvable external functions into
isUnresolvableFunc() (I thought I needed this externally.
I don't, but it's still nicer this way.)

llvm-svn: 7186
2003-07-16 21:25:17 +00:00
Misha Brukman
8c9be85d5d Fixed the number translation scheme for the integer condition code registers: it
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.

llvm-svn: 7185
2003-07-16 20:30:40 +00:00
Misha Brukman
5a52ebed46 The name should really be `simm11' to follow the naming convention, but this has
no change in functionality.

llvm-svn: 7184
2003-07-16 20:27:44 +00:00
John Criswell
75a7bcd904 Marked some of the phony targets are PHONY. This will hopefully speed
up builds a little bit since it will prevent GNU make from matching these
phony targets against implicit rules.

llvm-svn: 7183
2003-07-16 20:26:06 +00:00
Misha Brukman
10a63e248c No need for a second immediate field if the class already inherits one.
llvm-svn: 7182
2003-07-15 21:27:14 +00:00
Misha Brukman
250280cf79 Encode predict = 1 by default, because the Sparc assembler does this.
llvm-svn: 7181
2003-07-15 21:26:49 +00:00
Misha Brukman
d0f2196d2e Fixed a bug: outputting name of variable instead of its value.
Also, placed DEBUG() guards around debug information so that the generated file
is much smaller and hence should be faster to preprocess/compile.

llvm-svn: 7180
2003-07-15 21:26:09 +00:00
Misha Brukman
414c95141f This optimization greatly enhances efficiency of creating new instructions by
masking and shifting operands directly into their place in the instruction,
instead of the old-fashioned way of ORing in each bit separately.

llvm-svn: 7179
2003-07-15 21:00:32 +00:00
Misha Brukman
8cd8690ad5 Correctly handle calls to functions which are further away than 2**32 bits will
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.

llvm-svn: 7178
2003-07-15 19:09:43 +00:00
Misha Brukman
45dc28808e Clean up my last checkin: code is easier to read and explains the differences in
usage of the special file handle RTLD_SELF on Sparc/Solaris vs. 0 on Linux/x86.

llvm-svn: 7177
2003-07-15 15:58:26 +00:00
Misha Brukman
6a087a3a2f On Sparc/Solaris, the special handle RTLD_SELF is used as a handle referring to
the program's executing image, not 0 as it is on Linux/x86 and possibly other
systems.

llvm-svn: 7176
2003-07-15 15:55:32 +00:00
Misha Brukman
d594e21afa * Added support for the %ccr register
* FP double registers are now coded correctly
* Removed function which converted registers based on register types, it was
  broken (because regTypes are broken)

llvm-svn: 7175
2003-07-14 23:26:03 +00:00
Misha Brukman
0b5999cca1 The word separate' only has one e'.
llvm-svn: 7174
2003-07-14 17:26:34 +00:00
Misha Brukman
5de3e14206 The word separate' only has one e'.
llvm-svn: 7173
2003-07-14 17:20:40 +00:00
Misha Brukman
227f4d6f54 Fixed: </pre</p> => </pre></p>
llvm-svn: 7172
2003-07-14 17:05:20 +00:00
John Criswell
229141e1db Merged in changes from PRE101 in the prerelease branch.
Specifically, this updates libtool to version 1.5 and adds the following:
	- Added the -only-static option that we added in our previous libtool.
	- Modified the autoconf macros so that libtool uses the -G option when
	  linking on Solaris.  This allows libraries with global variables with
	  constructors to automatically run those constructors when the
	  library is dlopened().

llvm-svn: 7171
2003-07-14 16:52:07 +00:00
Vikram S. Adve
f6d22acc22 Use uint32_t for table index and size: table will never be > 4GB.
Also, make Pointer type depend on architecture.

llvm-svn: 7170
2003-07-11 22:02:28 +00:00
Vikram S. Adve
f5914c9bca Trace loads and stores as they happen (stores were being
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.

llvm-svn: 7169
2003-07-11 21:57:43 +00:00
Brian Gaeke
89ce6ca0a6 If we have a constant pointer reference to a function, we were printing
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.)

llvm-svn: 7168
2003-07-11 21:57:01 +00:00
Brian Gaeke
efd836df31 Fix some serious floating-point bugs (fixes test cases such as Oscar,
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.

llvm-svn: 7165
2003-07-11 18:18:35 +00:00
Anand Shukla
cb78ec5ada Added functionality to instrmentation pass
llvm-svn: 7161
2003-07-10 21:55:57 +00:00
Misha Brukman
74d17238cb Fixed grammatical error.
llvm-svn: 7160
2003-07-10 21:38:28 +00:00
Vikram S. Adve
83dc6ef841 Several important bug fixes:
(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.

llvm-svn: 7159
2003-07-10 20:07:54 +00:00
Vikram S. Adve
87e97308fd Bug fix in creating constants: need 1U << 31, not 1 << 31.
llvm-svn: 7158
2003-07-10 19:48:19 +00:00
Vikram S. Adve
989afdffd6 Fold cast-to-bool into not. Later, this should also be folded into other
boolean operations: AND, OR, XOR.

llvm-svn: 7157
2003-07-10 19:47:42 +00:00
Vikram S. Adve
d8b600cb85 Values stored in CallArgsDescriptor cannot be const.
llvm-svn: 7156
2003-07-10 19:46:15 +00:00
Vikram S. Adve
b1496585b6 isMarkedForSpill() should be const.
llvm-svn: 7155
2003-07-10 19:45:28 +00:00
Vikram S. Adve
6aa3abf7fa Change interface to MachineInstr::substituteValue to specify more precisely
which args can be substituted: defsOnly, defsAndUses or usesOnly.

llvm-svn: 7154
2003-07-10 19:45:07 +00:00
Vikram S. Adve
0b23c58179 Print out all neighbors in interference graph, not just higher-numbered ones.
llvm-svn: 7153
2003-07-10 19:43:33 +00:00
Vikram S. Adve
00f3778923 Several fixes to handling of int CC register:
(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.

llvm-svn: 7152
2003-07-10 19:42:55 +00:00
Vikram S. Adve
8d30b76da6 Several fixes to handling of int CC register:
(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.

llvm-svn: 7151
2003-07-10 19:42:11 +00:00
Vikram S. Adve
5e5a37f750 *** empty log message ***
llvm-svn: 7150
2003-07-10 19:32:38 +00:00
Vikram S. Adve
a80952c017 Just documentation.
llvm-svn: 7149
2003-07-10 19:31:26 +00:00
Vikram S. Adve
3737338edd Add phony target "bytecode" to ensure that it works in recursive makes.
llvm-svn: 7147
2003-07-10 19:25:29 +00:00
Misha Brukman
c12238543a Lowercase versions of `occurrence' need to be spelled correctly, too.
llvm-svn: 7142
2003-07-10 17:05:26 +00:00
Misha Brukman
cbaa8f3bfe Move the space separator to where it really belongs: in the print statement, not
in a variable assignment.

llvm-svn: 7141
2003-07-10 16:52:41 +00:00
Misha Brukman
14194dcdae Occurrence' has no a' and the `r' is doubled.
llvm-svn: 7140
2003-07-10 16:49:51 +00:00
Misha Brukman
6b2cd003d4 Converted tabs to spaces.
llvm-svn: 7139
2003-07-10 16:35:17 +00:00
Misha Brukman
c170ac78b6 Some beautification changes (tabs to spaces, removed extra blank lines);
no functionality changed.

llvm-svn: 7138
2003-07-09 17:33:50 +00:00
Vikram S. Adve
902d09bdef Simplified DOTRACING flag.
llvm-svn: 7135
2003-07-08 23:40:48 +00:00
John Criswell
f63cbeae8a Corrected the Table of Contents.
Corrected capitalization of subheadings.
Created a new subsection for compiling the C front end and moved all references
to it there.
Updated the disk space requirements to reflect the need for the binary C front
end and the optional C front end source.
Added information on unpacking the distribution to the summary section.
Moved autoconf environment variables to the autoconf section.
Changed make to gmake.
Removed some of the precise directions for unpacking the archives.
Fixed some formatting inconsistencies (headings that were not centered).

llvm-svn: 7132
2003-07-08 20:35:59 +00:00
Vikram S. Adve
a23754ed38 Pointer hash table reallocation code seems never to have been tested!
Unfortunately, reallocation also means that the pointer numbering will
change, so increase table size to try to avoid it.

llvm-svn: 7130
2003-07-08 18:42:44 +00:00