Commit Graph

1700 Commits

Author SHA1 Message Date
Reid Spencer 697f1104e7 Two improvements:
1. Allow -- as well as - options (Bill Wendling)
2. Pass unrecognized options to opt and let it handle the errors, if any
   (Chris Lattner).

llvm-svn: 33798
2007-02-02 21:49:27 +00:00
Reid Spencer 583c90d4c2 For PR1152:
Step 2: Make plug compatible shell script to replace gccas binary.

llvm-svn: 33787
2007-02-02 15:50:58 +00:00
Reid Spencer 22dbfb626f For PR1152:
Step 1: Copy gccas functionality to opt. This endows opt with a new
-std-compile-opts option to get the set of optimization passes that
gccas used. It also adds -disable-inlining and -disable-opt which
both apply only if -std-compile-opts is given. The -strip-debug option
was also removed. It just makes sure that "-strip" gets done early and
is mostly there for compatibility with gccas. Finally, a new
-verify-each option will cause the verify pass to be run after each pass.

llvm-svn: 33786
2007-02-02 14:46:29 +00:00
Reid Spencer 2341c22ec7 Changes to support making the shift instructions be true BinaryOperators.
This feature is needed in order to support shifts of more than 255 bits
on large integer types.  This changes the syntax for llvm assembly to
make shl, ashr and lshr instructions look like a binary operator:
   shl i32 %X, 1
instead of
   shl i32 %X, i8 1
Additionally, this should help a few passes perform additional optimizations.

llvm-svn: 33776
2007-02-02 02:16:23 +00:00
Devang Patel df4e992af8 Add printVersion(). Linker can use it to print LLVM version number.
llvm-svn: 33738
2007-02-01 01:46:06 +00:00
Devang Patel ea0568392e Include Makefile.config before testing OS.
llvm-svn: 33735
2007-02-01 01:18:57 +00:00
Chris Lattner adb4954d9c shutdown the app when done.
llvm-svn: 33716
2007-01-31 20:10:54 +00:00
Chris Lattner d700d9dde4 shutdown at end of run
llvm-svn: 33697
2007-01-31 04:45:28 +00:00
Reid Spencer 5301e7c605 For PR1136: Rename GlobalVariable::isExternal as isDeclaration to avoid
confusion with external linkage types.

llvm-svn: 33663
2007-01-30 20:08:39 +00:00
Reid Spencer bae85637c7 Regenerate.
llvm-svn: 33624
2007-01-29 19:08:46 +00:00
Reid Spencer e87c917a69 For PR1142:
When an unresolved definition is found, check to see if it is only unresolved
because the csretcc was upgraded to the sret param attribute. Such changes
change the function type and lead to unresolved definitions. In such cases, just
cast the function to the type expected by the CallInst. That is, cast to the
version of the function that has the sret param attribute.

llvm-svn: 33623
2007-01-29 19:07:18 +00:00
Reid Spencer c3eba3fc93 Regenerate.
llvm-svn: 33615
2007-01-29 05:41:34 +00:00
Reid Spencer 8714f0025c Upgrade old csret calling convention into sret parameter attribute.
llvm-svn: 33614
2007-01-29 05:41:09 +00:00
Nick Lewycky eba26e463a Drop CSRET from here too.
llvm-svn: 33604
2007-01-28 15:51:15 +00:00
Anton Korobeynikov 15f3028ba1 Merge error at my side. Fixed.
llvm-svn: 33601
2007-01-28 15:25:24 +00:00
Anton Korobeynikov 75e8a144d4 Regenerate
llvm-svn: 33599
2007-01-28 13:37:39 +00:00
Anton Korobeynikov 4bca4d157f Drop CSRET CC
llvm-svn: 33598
2007-01-28 13:36:18 +00:00
Anton Korobeynikov 037c867b54 Propagate changes from my local tree. This patch includes:
1. New parameter attribute called 'inreg'. It has meaning "place this
parameter in registers, if possible". This is some generalization of
gcc's regparm(n) attribute. It's currently used only in X86-32 backend.
2. Completely rewritten CC handling/lowering code inside X86 backend.
Merged stdcall + c CCs and fastcall + fast CC.
3. Dropped CSRET CC. We cannot add struct return variant for each
target-specific CC (e.g. stdcall + csretcc and so on).
4. Instead of CSRET CC introduced 'sret' parameter attribute. Setting in
on first attribute has meaning 'This is hidden pointer to structure
return. Handle it gently'.
5. Fixed small bug in llvm-extract + add new feature to
FunctionExtraction pass, which relinks all internal-linkaged callees
from deleted function to external linkage. This will allow further
linking everything together.

NOTEs: 1. Documentation will be updated soon.
       2. llvm-upgrade should be improved to translate csret => sret.
          Before this, there will be some unexpected test fails.
llvm-svn: 33597
2007-01-28 13:31:35 +00:00
Reid Spencer 07af391927 Regenerate.
llvm-svn: 33595
2007-01-28 00:52:05 +00:00
Reid Spencer dfa78fba8e For PR1137:
When a value is found to have the same name as another, try harder to
disambiguate when its a type plane collapse issue and when it isn't. We
traverse the type to see if it contains an integer. If it does not then
we issue the error because it can't be resulting from integer type planes
collapsing. Otherwise we just rename it, even if that's a bit of overkill.

llvm-svn: 33594
2007-01-28 00:51:40 +00:00
Reid Spencer 9f4cdd5d18 Regenerate.
llvm-svn: 33547
2007-01-26 20:31:18 +00:00
Reid Spencer 62b741dc4c Make sure that an upgraded index is also inserted into the VIndices
otherwise it gets ignored.

This fixes test/CodeGen/X86/2006-05-11-InstrSched.ll

Thanks to Evan Cheng for noticing this.

llvm-svn: 33546
2007-01-26 20:29:52 +00:00
Reid Spencer 41210fb2dc Regenerate.
llvm-svn: 33545
2007-01-26 19:59:25 +00:00
Reid Spencer 0bad131b17 Ensure that gep_upgrade zext instructions we insert have unique names.
llvm-svn: 33544
2007-01-26 19:58:59 +00:00
Reid Spencer aecf935dc9 Remove extraneous ; to make some versions of bison happy.
llvm-svn: 33541
2007-01-26 18:26:23 +00:00
Devang Patel a426fcd681 Order createSimplifyLibCallsPass() after a set of function level passes
so that these function passes are managed by CallGraphPassManager.

llvm-svn: 33540
2007-01-26 18:17:59 +00:00
Reid Spencer 697ba1a507 Remove the SignedType class and other dead code. Improve comments.
llvm-svn: 33538
2007-01-26 17:13:53 +00:00
Reid Spencer 4f95f1ab08 Regenerate.
llvm-svn: 33532
2007-01-26 08:19:09 +00:00
Reid Spencer 00a7c7f85a For All These Bugs:
PR645
PR761
PR1082
PR1122

Completely rewrite llvm-upgrade. This should be its final design. Any future
changes will use this same design.  The changes involve the following:

1. Make this work very much like the 1.9 AsmParser
2. Retain old upgrades dating back to release 1.2 time frame.
3. Merge in some of the upgrades between 1.9 and 2.0 (e.g. icmp/fcmp).
4. Attach a Signedness value (Signless, Unsigned, Signed) to every type,
   Value, Constant, Instruction, and list of those things in the Parser.
   Use these to make signedness decisions for instruction upgrades.
5. Implement unique name upgrade for function values and global values.
6. Identify rename cases that might cause problems and warn about them.
   For example: renaming a global variable with external linkage.
7. Generate a 2.0 IR using VMCore. This is necessary for numerous
   reasons and has the advantage that it never goes out of date.
8. Use the AsmPrinter to make the output nice.
9. Clean up error and warning messages from 1.9 form.

llvm-svn: 33531
2007-01-26 08:18:34 +00:00
Jeff Cohen e977757ca9 Fix a bunch of missing semicolon parse errors from bison.
llvm-svn: 33426
2007-01-21 19:30:52 +00:00
Reid Spencer fd3085bc3f Run GenLibDeps.pl with the configured PERL path to handle different install
locations for Perl on different systems.

llvm-svn: 33424
2007-01-21 15:53:18 +00:00
Chris Lattner 19bb6b996b default to emiting an uncompressed .bc file
llvm-svn: 33420
2007-01-21 06:34:18 +00:00
Chris Lattner faa060878b Run an instcombine pass after inlining but before scalarrepl. This allows
instcombine to clean up the code, which makes more code suitable for SRoA.
This helps C++ code in particular, e.g. speeding up tramp3d by 31%.

llvm-svn: 33235
2007-01-15 07:41:51 +00:00
Reid Spencer 6eb2990810 Regenerate.
llvm-svn: 33227
2007-01-15 02:41:46 +00:00
Reid Spencer 8307a54baa For PR1113:
Increment the counter after the second use, not after the first use. This
fixes PR1113.

Also, rename some classes for simplicity and to more naturally be
reminscient of LLVM 1.9. This in preparation for additional classes that
will provide a scaled down model of the LLVM 1.9 IR.

llvm-svn: 33226
2007-01-15 02:40:33 +00:00
Chris Lattner 03c4953cdd rename Type::isIntegral to Type::isInteger, eliminating the old Type::isInteger.
rename Type::getIntegralTypeMask to Type::getIntegerTypeMask.

This makes naming much more consistent.  For example, there are now no longer any
instances of IntegerType that are not considered isInteger! :)

llvm-svn: 33225
2007-01-15 02:27:26 +00:00
Reid Spencer 7ef3e49193 Regenerate
llvm-svn: 33212
2007-01-15 00:26:18 +00:00
Reid Spencer 04a03f2075 Reorganize things a bit in preparation for rewrite. Although this looks
like a lot, its really only two changes:

1. Move stuff that should be private to .y out of the .h file.
2. Make all semantic values pointers.

This cleans up the silly destroy methods and changes them to delete. It
also moves the TypeInfo and ValueInfo classes into the .y where we can
modify them more readily because they have no clients any more.

This shouldn't result in any functional changes in llvm-upgrade.

llvm-svn: 33211
2007-01-15 00:25:53 +00:00
Reid Spencer d18708fce0 Regenerate.
llvm-svn: 33180
2007-01-13 04:40:16 +00:00
Reid Spencer 876bc59822 Can't generate "bool" any more. Change to i1
llvm-svn: 33179
2007-01-13 04:39:47 +00:00
Reid Spencer eb30497472 Regenerate.
llvm-svn: 33172
2007-01-13 00:23:06 +00:00
Reid Spencer 316ffe33fd Don't attempt to upgrade argument to va.start and va.end if there are none.
llvm-svn: 33171
2007-01-13 00:22:40 +00:00
Reid Spencer 93ef7ee4d1 Regenerate.
llvm-svn: 33169
2007-01-13 00:13:49 +00:00
Reid Spencer ae7e9c5b35 Regenerate.
llvm-svn: 33165
2007-01-13 00:03:30 +00:00
Reid Spencer 15f159b00d For PR1093:
Implement upgrading of the varargs intrinsics. These must now have i8*
arguments. This patch bitcasts arguments to i8* and fixes the prototypes.

llvm-svn: 33163
2007-01-13 00:02:00 +00:00
Reid Spencer 4d06a85487 Regenerate.
llvm-svn: 33140
2007-01-12 20:10:51 +00:00
Reid Spencer 2dd0c0b27f Remove support for upgrading NOT. The llvm-upgrade lexer didn't recognize
it either. NOT is just plain illegal now.

llvm-svn: 33139
2007-01-12 20:09:48 +00:00
Chris Lattner d99bff4ef6 unbreak i1 constants with the cpp writer, eliminate special case.
llvm-svn: 33133
2007-01-12 18:37:29 +00:00
Reid Spencer 7a9c62baa6 For PR1064:
Implement the arbitrary bit-width integer feature. The feature allows
integers of any bitwidth (up to 64) to be defined instead of just 1, 8,
16, 32, and 64 bit integers.

This change does several things:
1. Introduces a new Derived Type, IntegerType, to represent the number of
   bits in an integer. The Type classes SubclassData field is used to
   store the number of bits. This allows 2^23 bits in an integer type.
2. Removes the five integer Type::TypeID values for the 1, 8, 16, 32 and
   64-bit integers. These are replaced with just IntegerType which is not
   a primitive any more.
3. Adjust the rest of LLVM to account for this change.

Note that while this incremental change lays the foundation for arbitrary
bit-width integers, LLVM has not yet been converted to actually deal with
them in any significant way. Most optimization passes, for example, will
still only deal with the byte-width integer types.  Future increments
will rectify this situation.

llvm-svn: 33113
2007-01-12 07:05:14 +00:00
Chris Lattner 899a89b11b Fix persistent conflict madness by removing these from cvs.
llvm-svn: 33111
2007-01-12 05:35:13 +00:00