Commit Graph

3761 Commits

Author SHA1 Message Date
Misha Brukman
dd6cb6a43b Occurrence' has no a' and the `r' is doubled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7140 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-10 16:49:51 +00:00
Misha Brukman
ac25de3bf0 Some beautification changes (tabs to spaces, removed extra blank lines);
no functionality changed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7138 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-09 17:33:50 +00:00
John Criswell
cf6d7b0353 Removed size_t from the parameter list of the malloc() prototype in generated C
code.  This prevents a compiler warning on Sparc that causes the tests to fail.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7125 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-08 14:52:09 +00:00
Misha Brukman
2988612f1b Elaborated assembly syntax of instructions in the comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7120 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-07 22:18:42 +00:00
Misha Brukman
35f19cc7b2 Removed unnecessary assignment (it was taken care by a superclass) and clarified
some comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7119 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-07 22:18:06 +00:00
Brian Gaeke
b44210d768 Insert workaround for GAS bug in assembling FLD/FSTP XWORD PTR [...]
instructions, by outputting them as bytes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7115 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-07 18:34:20 +00:00
Misha Brukman
de11f2d038 Moved RegClassIDs enum to be next to the RegTypes enum.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7114 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-07 16:52:39 +00:00
Vikram S. Adve
9c570ee129 Correction to last fix: Pointer types do not return true in Type::IsIntegral().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7113 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-06 22:50:31 +00:00
Vikram S. Adve
97539fc4b6 Choose register instead of immediate for ConstantExpr in ChooseRegOrImmed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7112 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-06 20:33:21 +00:00
Vikram S. Adve
786833ad34 Major bug fix though it happened rarely (only on a compare after an
integer overflow):
We need to use %icc and not %xcc for comparisons on 32-bit or smaller
integer values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7111 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-06 20:13:59 +00:00
Vikram S. Adve
46d3f8e34c Make the RegClassID values public -- there is no other way to get them.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7109 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-06 19:53:59 +00:00
Misha Brukman
9cedd433eb Apparently, the "regType" and "regClass" used in the Sparc backend are not both
correct: empirically, "regType" is wrong for a number of registers. Thus, one
can only rely on the "regClass" to figure out what kind of register one is
dealing with.

This change switches to using only "regClass" and adds a few extra DEBUG() print
statements and a few clean-ups in comments and code, mostly minor.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7103 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-03 18:36:47 +00:00
Chris Lattner
5bfccb9def Reuse the values if they are constants: this is important so that we index into the right structure field
This fixes bug: BasicAA/2003-07-03-BasicAACrash.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7093 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-03 06:42:38 +00:00
Chris Lattner
85cfe01a5e Remove globals more aggressively from graphs.
Fix a bug where we removed nodes that were marked U.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7090 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-03 02:03:53 +00:00
Chris Lattner
7079386e02 INCLUDE_PARENT_GRAPH is required!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7088 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 23:57:05 +00:00
Chris Lattner
10c45d6cd5 Disable incorrect mustalias code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7087 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 23:56:51 +00:00
Chris Lattner
61691c5d85 Remove space at end of line
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7084 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 23:44:15 +00:00
Chris Lattner
6c87461fe6 Fix how we are handling unreachable functions. This DRAMATICALLY improves efficiency
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7082 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 23:42:48 +00:00
Chris Lattner
d391d70361 Keep track of how many inlinings are performed
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7076 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 20:24:42 +00:00
Chris Lattner
47030f8a72 Try using trivially dead deletion
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7075 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 19:49:11 +00:00
Misha Brukman
ce14ec3901 * Force all "don't care" bits to 0 so that there are absolutely no unset bits in
the TableGen descriptions; all unset bits are thus errors.
* As a result, found and fixed instructions where some operands were not
  actually assigned into the right portion of the instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7074 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 19:37:48 +00:00
Misha Brukman
bd272999dd The classes F4_3 and F4_4 have an `rd' operand that needs to be set.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7073 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 18:27:47 +00:00
Misha Brukman
a8fcdd8d04 Properly fix instruction syntax in comments, using `imm' for instructions that
use an immediate value instead of a register.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7072 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 18:15:43 +00:00
Misha Brukman
69bf93081f Fixed instruction syntax in the comments (specifies how instr is used).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7071 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 18:02:58 +00:00
Misha Brukman
82742916f3 * If compiling on X86 or Sparc, automagically enable the JIT for that arch
* Setting ENABLE_X86_JIT or ENABLE_SPARC_JIT on the `make' command-line will
  force the inclusion of that JIT on a different architecture
* If neither JIT is enabled (e.g., compiling on a different architecture), the
  -march option will not be available to LLI.
* As a side effect of the $ARCH variable, the Sparc LLI can now link just a bit
  faster by not including the x86 library.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7070 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 17:53:19 +00:00
Vikram S. Adve
ea28dd3392 Force fixed-size but large alloca objects to the dynamically allocated
area to avoid using up precious stack space within the 4095 offset limit
from %fp.  Such objects that would themselves live at a large offset
were being put there already so this is a simple change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7066 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 06:59:22 +00:00
Chris Lattner
44cfdf9b9a Remove dead Nodes list
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7065 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 06:06:34 +00:00
Chris Lattner
a8da51bf51 Complete rewrite of td pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7064 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 04:39:44 +00:00
Chris Lattner
63899fab93 Print collapsed to match the paper
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7063 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 04:39:27 +00:00
Chris Lattner
9cd0484251 Reduce amount of work we do calculating mustaliases if the arg is a global
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7062 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 04:39:13 +00:00
Chris Lattner
58f98d0bf0 Add support for ParentGraph only when building in debug mode
Minor cleanups, reenable folding of call nodes to external functions


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7061 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 04:38:49 +00:00
Chris Lattner
f07804b923 Add some functions to the blacklist
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7060 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 04:38:00 +00:00
Chris Lattner
744f93996e Make the BU closure keep track of which actual calls happen
Minor cleanups


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7059 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 04:37:48 +00:00
Chris Lattner
3051419036 Make local pass print out its progress
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7058 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 04:37:26 +00:00
Vikram S. Adve
65b2f401af Minor beautification: fold a couple of lines of code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7054 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 01:24:00 +00:00
Vikram S. Adve
799ffeede1 (1) Major bug fix: DecomposeArrayRef() replaces its argument instr. and
deletes it, but we were merrily trying to fix the operands of that
    instruction anyway!  Instead, fix the replacement instruction.

(2) An Improvement: Check for and extract global values in all operands,
    not just in known pointer operands.  For example, they can occur in
    call arguments, and probably other unforeseeable places as well.
    This also eliminates the special-case handling of Load and Store.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7053 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 01:23:15 +00:00
Vikram S. Adve
74d15d36f5 A def. operand of a machine instruction may be an ordinary Value*,
not just an Instruction*, at least in one unfortunate case:
the first operand to the va_arg instruction.
Modify ValueToDefVecMap to map from Value*, not Instruction*.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7052 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 01:16:01 +00:00
Vikram S. Adve
784a18b8ba Bug/case fixes:
(1) select: Ok to convert a pointer to a float or double.
(2) regalloc: Some MachineInstr* for caller-saving code before a call
    were being inserted before and after the call!
(3) Don't insert the caller-saving instructions in the
    MachineCodeForInstruction for the Call instruction.
    *All* instructions generated by register allocation need to be
    recorded in those maps, but it needs to be done uniformly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7051 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-02 01:13:57 +00:00
Chris Lattner
5fd60913da Fix bug: Regression/Other/2002-03-11-ExprAssertion.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7046 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-01 21:08:52 +00:00
Chris Lattner
18f07a11b9 Rework TD pass to work with the precise call graph constructed by the BU phase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7031 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-01 16:28:11 +00:00
Chris Lattner
b6734b281b Do not treat global variables as functions! (and assert failing)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7030 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-01 16:27:53 +00:00
Chris Lattner
d9dad2cf61 Dont' print scalar nodes for ConstantPointerRefs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7029 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-01 16:27:32 +00:00
Chris Lattner
5d5b6d6a5c Minor cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7027 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-01 16:04:18 +00:00
John Criswell
7a73b80b90 Merged in autoconf branch. This provides configuration via the autoconf
system.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7014 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 21:59:07 +00:00
Chris Lattner
eb093fbf6f Setjmp should always return zero if we don't implement longjmp. This avoids
leaving trash in the register, fixing anagram


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7013 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 19:35:54 +00:00
Brian Gaeke
02c26b681e Get rid of the duplicate '0x' in debug mode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7012 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 18:06:20 +00:00
Chris Lattner
6681e98b13 Use the getFunctionNames method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7008 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 05:57:39 +00:00
Chris Lattner
a9d6566e36 Add new method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7007 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 05:57:30 +00:00
Chris Lattner
2b4c8dfdd5 Split CallSiteIterator out into DSCallSiteIterator.h, and generalize it a bit
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7006 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 05:27:53 +00:00
Chris Lattner
9f93055253 Be more const-correct
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7005 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 05:27:18 +00:00
Chris Lattner
7b1ceaa40b Fix bug in last checkin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7003 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 05:18:26 +00:00
Chris Lattner
0eea61863b Reimplement the BU closure to collapse all SCC graphs into a single graph.
Look at all of the code that gets deleted!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7001 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 05:09:58 +00:00
Chris Lattner
2cb9acd785 Handle the case where OldNodeMap == &ScalarMap correctly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7000 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 05:09:29 +00:00
Chris Lattner
acbc8c6768 Remove dead method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6999 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 04:53:39 +00:00
Chris Lattner
81d924d804 Do not delete the same graph multiple times when freeing memory if graphs are sharing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6998 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 04:53:27 +00:00
Chris Lattner
3d162907e3 Do not multiply delete graphs if functions are sharing graphs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6997 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 04:53:08 +00:00
Chris Lattner
8d32767da4 Move usages of explicit hash_* datastructures to use typedefs
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6996 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 03:36:09 +00:00
Chris Lattner
5a54063303 Revamp DSGraphs so that they can support multiple functions in the same
DSGraph at one time


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6994 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 03:15:25 +00:00
Chris Lattner
a321b04d60 Adjust for new DSGraph API
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6993 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 03:14:54 +00:00
Chris Lattner
8bc95a176a Eliminate using declarations, adjust for new DSGraph API
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6992 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-30 03:14:44 +00:00
Chris Lattner
dea8146787 Abstract out the predicate which decides whether a function gets complete
arguments or not...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6987 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-29 22:37:07 +00:00
Chris Lattner
06e24c8447 Fix minor bug in previous checkin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6986 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-29 22:36:31 +00:00
Chris Lattner
919ffbf977 Add support for ensuring that nodes are not incomplete
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6985 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-29 22:36:15 +00:00
Chris Lattner
5c5b10f46a Add support for "physical subtyping", which fixes:
DSGraph/2003-06-29-NodeCollapsing2.ll & DSGraph/PhysicalSubtyping.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6982 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-29 20:27:45 +00:00
Chris Lattner
889fb9de96 Add print method to not get silly warning from analyze
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6981 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-29 20:27:16 +00:00
Chris Lattner
5100dbb9e7 New pass which is useful for writing regression tests
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6979 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-29 18:17:07 +00:00
Chris Lattner
c151e4f415 Until there is a setjmp/longjmp transformation pass, codegen setjmp as a noop
and longjmp as an abort!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6977 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-29 16:42:32 +00:00
Chris Lattner
5c70dc0456 Expose must alias information for global variables, implementing: DSGraph/mustalias.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6973 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-29 00:54:08 +00:00
Chris Lattner
aed2c6d2cb If the alias analysis algorithm we are using can provide MUST alias information,
expose it directly as value numbering information


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6972 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-29 00:53:34 +00:00
Chris Lattner
1842a90e0b Count operands to instructions as well as just results. This allows for global variables to be checked as well
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6970 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-29 00:07:11 +00:00
Chris Lattner
312edd330f Propagate globals graph from the local to bu to td globals graphs. This
fixes bug: DSGraph/buglobals.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6947 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-28 22:14:55 +00:00
Chris Lattner
5e459dbc52 Drop references to globals who do exist in the globals graph, but are never
read or written to.  Keep track of how many times this happens.  This should
be good for deleting things like references to type information in C++ classes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6946 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-28 22:10:58 +00:00
Chris Lattner
72d50a090f Avoid double negatives
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6945 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-28 21:58:28 +00:00
Chris Lattner
934fe856b5 New pass to perform DSA based optimizations. Initially we just support turning
globals into constants if we can prove it's safe


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6941 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-28 21:54:55 +00:00
Chris Lattner
e9a64ea38e Avoid printing out huge structures or arrays if they are just filled with zeros
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6938 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-28 20:08:24 +00:00
Chris Lattner
f460048771 Add support for a new zeroinitializer token which can be used to get rid of
huge arrays of zero initialized values


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6937 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-28 20:01:34 +00:00
Chris Lattner
2fa42a816d jmp_buf is really a pointer type that is passed around...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6935 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-28 19:29:34 +00:00
Chris Lattner
9bda5f52bd Add support for the Invoke instruction!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6934 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-28 17:53:05 +00:00
Chris Lattner
4148819f0f Preserve compatibility with non-gcc compilers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6932 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-28 17:15:12 +00:00
Chris Lattner
76d9f1b467 Fix bug: CBackend/2003-06-28-LinkOnceGlobalVars.llx
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6931 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-28 17:08:36 +00:00
Chris Lattner
cf6bac3b56 Allow the inlining limit to be controlled from the command line!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6929 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-28 15:57:04 +00:00
Chris Lattner
d2a6fc397e Add support for 'unsigned' command line arguments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6928 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-28 15:47:20 +00:00
Brian Gaeke
d7908f679e Nice tasty llc fixes. These should fix LLC for x86 for everything in
SingleSource except oopack and Oscar.  (Sorry, Oscar.)

include/llvm/Target/TargetInstrInfo.h: Remove virtual print method. Add
 accessors for ImplicitUses/Defs.
lib/Target/TargetInstrInfo.cpp: Remove virtual print method. If you
 really wanted this, just use MI->print(O, TM); instead...
lib/Target/X86:
FloatingPoint.cpp: ...like this.
X86InstrInfo.h: Remove virtual print method. Define the PrintImplUses
 target-specific flag bit.
X86InstrInfo.def: Add the PrintImplUses flag to all the instructions
 which implicitly use CL, because the assembler needs to see the CL in
 order to generate the right instruction.
Printer.cpp: Ditch fnIndex at Chris's request. Now we use CurrentFnName
  to name constants in the constant pool for each function instead. This
  avoids keeping state between runOnMachineFunction() invocations, which
  is a no-no. Having MangledGlobals be global is a bogon I'd like to get
  rid of too, but making it a static member of Printer causes link errors
  (why???).
 Make NumberForBB into a member of Printer instead of a global, too.
 Make printOp and printMemReference into methods of Printer.
 X86InstrInfo::print is now Printer::printMachineInstruction, because
  TargetInstrInfo::print is history. (Because of this, we have to qualify
  the names of some TargetInstrInfo methods we call.)
 Print out the ImplicitUses field of any instruction we print that has
  the PrintImplUses bit set.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6924 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-27 00:00:48 +00:00
Brian Gaeke
5e00157c5a Number constants from constant pool as CPIf_i where f is the function index
and i is the constant pool index.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6920 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-26 18:02:30 +00:00
Chris Lattner
b12b75365a Add support to globaldce for deleting dead function prototypes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6918 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-26 05:41:18 +00:00
Chris Lattner
81d4e14449 When internalizing global ctor/dtor list, also mark it constant. This is gross, but
until DSA is working all of the time and is totally reliable, we do this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6917 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-26 05:30:40 +00:00
Chris Lattner
6a2a60aaf3 Implement more aggressive folding of constant GEP instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6913 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-26 05:22:45 +00:00
Chris Lattner
833b8a4181 Add support for elimination of load instruction from global constants
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6912 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-26 05:06:25 +00:00
Brian Gaeke
bc601fe3e7 Integrate the C writer's name mangler.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6908 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-25 22:00:39 +00:00
Brian Gaeke
01d79ff86d First draft of X86 LLC backend. This should be OK for small programs like
Shootout, but it has some issues with bigger programs. Work in progress.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6907 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-25 18:01:07 +00:00
Chris Lattner
0af1fab019 Instcombine: X * -1 -> -X
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6904 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-25 17:09:20 +00:00
Chris Lattner
5db61fdc8a Fix bug: LevelRaise/2003-06-25-ExprAnalysis.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6903 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-25 17:09:03 +00:00
Chris Lattner
83c39d2edb Fix bug: Mem2Reg/2003-06-26-IterativePromote.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6901 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-25 14:58:56 +00:00
Joel Stanley
54f6032dae - Fixed name mangling conditions to handle 'linkonce' linkage type. In
particular, name mangling for GlobalValues only occurs when the linkage type is
internal or when the name must be mangled to avoid a collision.  See comments in
CWriter::getValueName for more information.

- 'inline' keyword is now emitted for functions with 'linkonce' linkage type.

- Fixed typos.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6898 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-25 04:52:09 +00:00
Chris Lattner
9b2a14b6f1 Add argument to DAE to allow operation on non-internal functions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6895 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-25 04:12:49 +00:00
Brian Gaeke
e99f4cf4ac It seems likely that floats would need a cast too, because they are
ordinarily promoted to doubles.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6894 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-25 03:05:33 +00:00
Chris Lattner
837e42ccef Fix bug: ADCE/2003-06-24-BadSuccessor.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6891 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-24 23:02:45 +00:00
Chris Lattner
a89ab2c355 Make assertion more descriptive
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6889 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-24 22:20:19 +00:00
Chris Lattner
99c91e021a Do not mark ALL terminators live if any instruciton in the block is live. We only
want to mark it live if it is an unconditional branch.  This fixes bug:
ADCE/2002-05-28-Crash.ll and makes this pass _much_ more useful.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6887 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-24 21:49:45 +00:00
Chris Lattner
38b5ae4b48 Fix bug: SCCP/2003-06-24-OverdefinedPHIValue.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6883 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-24 20:29:52 +00:00
Chris Lattner
fcd74e2e31 Fix bug: TailDup/2003-06-24-Simpleloop.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6881 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-24 19:48:06 +00:00
Chris Lattner
79d35b3f8b Implement new transforms:
Replace (cast (sub A, B) to bool) -> (setne A, B)
  Replace (cast (add A, B) to bool) -> (setne A, -B)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6873 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-23 21:59:52 +00:00
Brian Gaeke
031a112747 Fix 2003-06-23-PromotedExprs.llx -- if we are adding two bytes we better
explicitly cast the result to be a byte, or C will gleefully promote it
to int.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6869 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-23 20:00:51 +00:00
Brian Gaeke
703379827f Include <cmath> instead of <math.h>
Remove isnan; it's too unportable to handle cleanly at this point.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6866 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-23 19:41:55 +00:00
Chris Lattner
1d5fc3f416 Add support for GCC 3.3
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6865 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-23 19:16:20 +00:00
Chris Lattner
8a334a4035 avoid dividing by zero when dealing with zero sized types (like [0 x double])
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6862 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-23 17:36:49 +00:00
Vikram S. Adve
80544444a3 Add the padding needed for variable-size alloca's, which should work now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6859 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-23 02:13:57 +00:00
Chris Lattner
037d258319 Fix bug: InstCombine/2003-06-22-ConstantExprCrash.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6857 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-22 20:48:30 +00:00
Chris Lattner
066ab6ac80 Add paranoia checking
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6856 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-22 20:46:00 +00:00
Chris Lattner
ea635cd072 Test change
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6852 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-22 20:25:27 +00:00
Chris Lattner
7a7bef4355 Initial checkin of Tail duplication pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6846 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-22 20:10:28 +00:00
Chris Lattner
7b52c036f4 Do not use the inefficient, fixed function, CBW, CDQ, ... instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6844 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-22 03:31:18 +00:00
Chris Lattner
3889a2cb05 Remove a ton of extraneous #includes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6842 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-22 03:08:05 +00:00
Chris Lattner
e0f4b98026 Remove support for the MultiObject flag, which was fundamentally broken
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6840 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-22 03:03:52 +00:00
Chris Lattner
797249bc13 Instcombine cast (getelementptr Ptr, 0, 0, 0) to ... into: cast Ptr to ...
This fixes type safety problems in a variety of benchmarks that were confusing
DSA.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6837 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-21 23:12:02 +00:00
Chris Lattner
034acf0a3d Minor simplification to 64-bit instsel
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6831 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-21 18:15:27 +00:00
Chris Lattner
0f1c461423 For 16 and 32-bit multiplies, use the IMUL instruction instead of the MUL instruction.
This allows us to not force the use of the EAX/AX registers!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6830 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-21 17:16:58 +00:00
Chris Lattner
a8cb100706 Add IMULr16 & IMULr32 instructions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6829 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-21 17:13:35 +00:00
Chris Lattner
f58544712b Generate code for LONG indexes to getelementptr instructions more efficiently
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6828 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-21 16:01:24 +00:00
Chris Lattner
c901e8bd9e Some preprocessors doen't support // comments and get confused
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6821 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-20 23:14:50 +00:00
Chris Lattner
1c6d6c996a Fix the build. :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6797 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-20 14:36:52 +00:00
Vikram S. Adve
ddafa49edc RDCCR defines arg. #1, not arg. #2.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6796 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-20 11:32:11 +00:00
Chris Lattner
31f612589f Changes to privatize NodeType
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6795 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-19 21:15:26 +00:00
Chris Lattner
bd92b73be7 * Changes to make NodeType be private to DSNode.
* Add new MultiObject flag to DSNode which keeps track of whether or not
  multiple objects have been merged into the node, allowing must-alias info
  to be tracked.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6794 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-19 21:15:11 +00:00
Brian Gaeke
3387e7f7a2 Fix output bug: Intel asm comment character is #, not ;.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6792 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-19 19:58:32 +00:00
Brian Gaeke
088fa1162d RECAPITALIZE all the names of pseudo-instructions, and add a comment explaining
the convention.

:-)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6791 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-19 19:41:13 +00:00
Brian Gaeke
96b07e54dd Rename many instructions to their Intel asm-compatible names. This
involves removing the [bwl] suffixes from instruction names, as well
as some other distinguishing marks (32/64/80 on fp insns, _i suffixes, etc.)

Lowercase all instr. names as well for consistency's sake.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6790 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-19 19:34:44 +00:00
Brian Gaeke
9e474c4ec8 Add Initialization and Finalization methods for the Printer pass,
to print various things on a module-by-module basis (currently, only the
former is used).

Don't print < > around names. The assembler can't take it.

Print pseudoinstructions only as comments. The poor little assembler can't
take that, either.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6789 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-19 19:32:32 +00:00
Chris Lattner
ed4775a3c1 Remove usage of sys/unistd.h
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6788 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-19 18:42:09 +00:00
Chris Lattner
9fe3886678 Implement the functionality of InstCombine/call.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6783 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-19 17:00:31 +00:00
Chris Lattner
a3df1ff807 Remove a bunch of complicated code. The functionality is implemented in instcombine instead
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6782 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-19 16:59:19 +00:00
Brian Gaeke
de3aa4f77f lib/Target/X86/X86TargetMachine.{cpp,h}: Add initial version
(non-working) of llc guts for X86, and add a prototype for it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6779 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-18 21:43:21 +00:00
Brian Gaeke
2e2f2dcd6a lib/Target/Sparc/Sparc.cpp:
Move LowerAllocations, PrintFunction, and SymbolStripping passes, and
  the corresponding -disable-strip and -d options, over here to the SPARC
  target-specific bits of llc. Rename -d to -dump-asm.

tools/llc/Makefile:
 Reindent. Add x86 library so that llc compiles again.

tools/llc/llc.cpp:
 Remove support for running arbitrary optimization passes. Use opt instead.
 Remove LowerAllocations, PrintFunction, and SymbolStripping passes, as noted
  above.
 Allow user to select a backend (x86 or SPARC); default to guessing from
  the endianness/pointer size of the input bytecode file.
 Fix typos.
 Delete empty .s file and exit with error status if target does not support
  static compilation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6776 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-18 21:14:23 +00:00
Chris Lattner
893f025262 Detemplatize the PATypeHandle class, which was only really instantiated on 'Type'.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6774 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-18 19:22:36 +00:00
Chris Lattner
97f4b664cd Handle arguments passed in through the va_arg area
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6769 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-18 16:25:51 +00:00
Chris Lattner
c8621e6f28 These instructions really take three operands. This fixes some assertions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6765 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-18 15:09:02 +00:00
Brian Gaeke
b471a23a85 lib/CWriter/Writer.cpp: Copy AsmWriter's ConstantFP checking code here
into a new function FPCSafeToPrint(), and use it in printConstant()
and printFunction() to decide whether we should output ConstantFPs as
floating-point constants or as references to stack-allocated variables.

lib/VMCore/AsmWriter.cpp: Fix an apparent typo in the code mentioned above.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6762 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-17 23:55:35 +00:00
Brian Gaeke
4399a4982a Add #ifdef hack for MAP_ANONYMOUS being spelled MAP_ANON on some platforms.
(We're already talking about autoconf'ing this, so I'm assuming this hack
will be short-lived...I just don't want it to get lost in my working files.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6761 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-17 23:14:06 +00:00
Chris Lattner
08227e4f17 Initial checkin of DAE pass
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6759 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-17 22:21:05 +00:00
Brian Gaeke
5285270871 Use $(PLATFORMLIBDL) to selectively bring in -ldl only on those platforms where
it is needed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6753 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-17 20:09:18 +00:00
Brian Gaeke
1d0acacc63 Use std::isnan instead of isnan. Brought back to you from the
future, by the reconciliation of the C++ and C99 standards. Someday.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6751 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-17 19:59:17 +00:00
Brian Gaeke
8c63883f1f Put ifdefs around use of malloc.h/mallinfo, which isn't available on FreeBSD.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6750 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-17 19:54:00 +00:00
Chris Lattner
f25b7729c1 Life is too short. Link in too much stuff on Linux to make building on sun easier
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6748 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-17 19:14:59 +00:00
Chris Lattner
da601403d9 The never-ending odyssey trying to get sparc to link
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6747 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-17 18:19:52 +00:00
Chris Lattner
d562436355 Make sure to get the value of ARCH before we use it
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6746 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-17 17:53:35 +00:00
Chris Lattner
2bf4c61557 Do not link in the Sparc JIT when building on X86. Eventually the sparc will not
link in the X86 JIT either, but this makes testing easier.

For some reason, the sparc JIT was breaking the X86 JIT when it was linked in. :(


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6745 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-17 15:54:52 +00:00
Chris Lattner
de3209bfdb Apparently "sparc" is a macro on sparcs. Ugh. :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6744 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-17 15:54:02 +00:00
Chris Lattner
7a5500e2f6 Whoops, didn't mean to check that in :(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6743 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-17 15:46:34 +00:00
Chris Lattner
97ac14f33c Use more structured command line option processing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6742 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-17 15:43:13 +00:00
Chris Lattner
7aefa966cd #ifdef out code that only applies when the HOSTARCH = sparc
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6741 91177308-0d34-0410-b5e6-96231b3b80d8
2003-06-17 15:32:38 +00:00