Commit Graph

6793 Commits

Author SHA1 Message Date
Chris Lattner
4446617ae2 Update to use more modern graph checker
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7332 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 21:09:20 +00:00
Chris Lattner
6235b2a7db New testcase, an automatized version of Vikrams ggcollapse.c file
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7331 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 21:09:11 +00:00
Vikram S. Adve
e9a567cc77 1. Fix a case that was marking the invalid reg. num. (-1) as used,
causing a nasty array bound error later.
2. Fix silly typo causing logical shift of unsigned long to use
   SRL instead of SRLX.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7330 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 21:08:58 +00:00
Vikram S. Adve
bc001b24a1 (1) Change the way unused regs. are marked and found to consider regType
info (since multiple reg types may share the same reg class).
(2) Remove machine-specific regalloc. methods that are no longer needed.
    In particular, arguments and return value from a call do not need
    machine-specific code for allocation.
(3) Rename TargetRegInfo::getRegType variants to avoid unintentional
    overloading when an include file is omitted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7329 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 21:06:09 +00:00
Vikram S. Adve
523eb3f768 Change the way unused regs. are marked and found to consider regType
info (since multiple reg types may share the same reg class).
Remove machine-specific regalloc. methods that are no longer needed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7328 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 21:01:43 +00:00
Vikram S. Adve
34a856749f Remove unused field. Change the way unused regs. are marked and
found to consider regType info (since multiple reg types may share
the same reg class, e.g., single and double on Sparc).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7327 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 21:00:13 +00:00
Vikram S. Adve
b1e6f05110 Add an assertion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7326 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 20:58:57 +00:00
Chris Lattner
1e4bed7a41 Remove testcase which has been automatized
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7325 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 20:55:08 +00:00
Chris Lattner
e41fb36b26 Checkin of Vikram's ggfuncptr.c test adapted for automatic checking
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7324 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 20:53:58 +00:00
Chris Lattner
e7e221ad24 Dont' try to parse the colon
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7323 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 20:49:29 +00:00
Chris Lattner
f2d0134118 Add a more general check-flags which can be used to ensure arbitrary flags are set
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7322 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 20:45:40 +00:00
Brian Gaeke
6b902dcd5d Include llvm/Support/Mangler.h first. Don't include <iostream>, <set>,
<string>, or llvm/Value.h.  Move up the inclusion of llvm/Support/Mangler.h.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7321 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 20:21:20 +00:00
Brian Gaeke
49a178b9fd Don't include llvm/SlotCalculator.h, or <set>.
Move up the inclusion of llvm/Support/Mangler.h.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7320 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 20:21:06 +00:00
Brian Gaeke
00fee61672 Forward-declare class Module to make the header file self-contained.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7319 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 20:20:53 +00:00
Chris Lattner
2e99791a1e More cassert inclusion for GCC 3.3
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7318 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 18:06:53 +00:00
Chris Lattner
a7313078ae Change reference to assert.h to mention cassert
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7317 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 18:05:51 +00:00
Chris Lattner
09cea35a36 Brian implemented the static compiler, take it off the list
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7316 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 18:05:38 +00:00
Chris Lattner
be67780f31 #include <cassert> as necessary...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7315 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 17:58:41 +00:00
Chris Lattner
02a31a5af6 Fix another accessibility problem illuminated by GCC 3.3
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7314 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 17:49:28 +00:00
Chris Lattner
d091d85c15 Fix visibility problem exposed by GCC 3.3
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7313 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 17:46:25 +00:00
Chris Lattner
0192e36cc7 Remove inline declarations that GCC 3.3 doesn't like without a body
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7312 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 17:39:33 +00:00
Chris Lattner
ceef97a535 Regardless of whether C provides assert.h, C++ source can always include
<cassert>, making this header unneeded.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7311 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 17:35:03 +00:00
Chris Lattner
d957518b51 Use the C++ <cassert> header, not the C <assert.h> header
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7310 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 17:34:17 +00:00
Chris Lattner
b1512d2a7a This header works with GCC 3.3
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7309 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 17:33:45 +00:00
Chris Lattner
b5b3c6fc01 Use C++ headers, not C headers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7308 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 17:32:51 +00:00
Chris Lattner
a44a4cd055 Add includes of assert
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7307 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 17:23:27 +00:00
Chris Lattner
32862da7c7 Fix accessibility problems GCC 3.3
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7306 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 17:23:13 +00:00
Chris Lattner
ab63bd15f5 Add assert.h include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7305 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 16:47:07 +00:00
Chris Lattner
9c37f9c7f2 Convert to C++ style comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7304 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 15:08:08 +00:00
Vikram S. Adve
7f90b520b4 Include vector into these two files to ensure that specializations like
stl_bvector.h are correctly included into *anything* that includes hash_map
or hash_set.  ext/hash_map includes stl_vector.h directly and leaves
out the specializations, causing truly nasty bugs due to inconsistent
versions of vector<> being used for vector<bool> in different files.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7303 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-25 14:06:13 +00:00
Misha Brukman
a259c9be2a Made a bunch of cleanups, as per Chris' recommendations:
* Removed unused global and member variables
* Fixed comments (CodeGeneratorBug.cpp)
* Check for possibly failing GCC::create() and CBE::create()
* Remove generated files after diffing the output (e.g., shared object)
* Instead of using std::for_each, use explicit loops as std::for_each may
  duplicate the functor, and ours carries state
* Changed member var from cl::opt<std::string> to just std::string
* Fixed doxygen comments
* Fixed string comparisons to use [ str.empty() ] instead of [ str == "" ]
* Cache instances of CBE and GCC in BugDriver across compilations and executions
  while testing tools.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7302 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-24 21:59:10 +00:00
Brian Gaeke
4166445b7c Cleanups:
Mangler.cpp: Constify parameter to makeNameProper, and use const_iterator.
 Make Count an unsigned int, and use utostr().
 Don't name parameters things that start with underscore.
Mangler.h: All of the above, and also: Add Emacs mode-line.  Include <set>.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7301 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-24 21:37:57 +00:00
Brian Gaeke
b198ca304b Factor out name-mangling from X86/Printer, which is derived from CWriter,
into this new support class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7300 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-24 20:20:58 +00:00
Brian Gaeke
d9fb37ac98 Use unified CWriter-X86/Printer name mangler. Do not bother using
SlotCalculator in CWriter.  (Unfortunately, all this means a lot of
X86/Printer's methods have to be de-constified again.  Oh well.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7299 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-24 20:20:44 +00:00
Chris Lattner
12642fda09 More testcases, which I'll implement later
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7298 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-24 19:44:51 +00:00
Chris Lattner
d2a0896832 Modernize testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7297 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-24 19:42:28 +00:00
Chris Lattner
b5874f1499 New testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7296 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-24 19:31:08 +00:00
Chris Lattner
943c713c65 Instcombine: (A >> c1) << c2 for signed integers
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7295 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-24 18:38:56 +00:00
Chris Lattner
709ad40dc8 New testcases for signed shifts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7294 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-24 18:38:09 +00:00
Misha Brukman
5073336cd4 Major addition to bugpoint: ability to debug code generators (LLC and LLI).
The C backend is assumed correct and is used to generate shared objects to be
loaded by the other two code generators.

LLC debugging should be functional now, LLI needs a few more additions to work,
the major one is renaming of external functions to call the JIT lazy function
resolver.

Bugpoint now has a command-line switch -mode with options 'compile' and
'codegen' to debug appropriate portions of tools.

ExecutionDriver.cpp: Added implementations of AbstractInterpreter for LLC and
GCC, broke out common code within other tools, and added ability to generate C
code with CBE individually, without executing the program, and the GCC tool can
generate executables shared objects or executables.

If no reference output is specified to Bugpoint, it will be generated with CBE,
because it is already assumed to be correct for the purposes of debugging using
this method. As a result, many functions now accept as an optional parameter a
shared object to be loaded in, if specified.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7293 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-24 18:17:43 +00:00
Chris Lattner
08fd7abb42 Reorganization of code, no functional changes.
Now it shoudl be a bit more efficient


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7292 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-24 17:52:58 +00:00
Brian Gaeke
3d8d9f7e72 It doesn't appear that we need to #include these.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7291 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-24 17:48:53 +00:00
Chris Lattner
24c8e38455 Allow folding several instructions into casts, which can simplify a lot
of codes.  For example,
short kernel (short t1) {
  t1 >>= 8; t1 <<= 8;
  return t1;
}

became:

short %kernel(short %t1.1) {
        %tmp.3 = shr short %t1.1, ubyte 8               ; <short> [#uses=1]
        %tmp.5 = cast short %tmp.3 to int               ; <int> [#uses=1]
        %tmp.7 = shl int %tmp.5, ubyte 8                ; <int> [#uses=1]
        %tmp.8 = cast int %tmp.7 to short               ; <short> [#uses=1]
        ret short %tmp.8
}

before, now it becomes:
short %kernel(short %t1.1) {
        %tmp.3 = shr short %t1.1, ubyte 8               ; <short> [#uses=1]
        %tmp.8 = shl short %tmp.3, ubyte 8              ; <short> [#uses=1]
        ret short %tmp.8
}

which will become:
short %kernel(short %t1.1) {
        %tmp.3 = and short %t1.1, 0xFF00
        ret short %tmp.3
}

This implements cast-set.ll:test4 and test5


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7290 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-24 17:35:25 +00:00
Chris Lattner
8baa92ef0b Minor cleanups
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7289 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-24 17:31:56 +00:00
Brian Gaeke
b3011a01b5 Constify most methods. We could have constified doInitialization and
doFinalization too except that would have made them shadow, not override,
the parent class :-P.

Allow *any* constant cast expression between pointers and longs,
or vice-versa, or any widening (not just same-size) conversion that
isLosslesslyConvertibleTo approves. This fixes oopack.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7288 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-24 17:30:45 +00:00
Chris Lattner
c3c1d32043 Disable sample project until it works
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7287 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-23 23:28:57 +00:00
Chris Lattner
84f644aacf Add new tests, make existing tests more difficult
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7286 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-23 23:21:08 +00:00
Chris Lattner
1078d11854 Fix bug: FunctionResolve/2003-07-23-CPR-Reference.ll
This fixes a long time annoyance which caused prototypes for bzero, bcopy,
bcmp, fputs, and fputs_unlocked to never get deleted.  Grr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7285 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-23 22:03:18 +00:00
Chris Lattner
a99d4f2975 New testcase
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7284 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-23 22:02:39 +00:00
Chris Lattner
2cd9196e87 Add comments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7283 91177308-0d34-0410-b5e6-96231b3b80d8
2003-07-23 21:41:57 +00:00