1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Commit Graph

177 Commits

Author SHA1 Message Date
Reid Spencer
a5cbe5f4e5 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
802b61596b Regenerate.
llvm-svn: 33180
2007-01-13 04:40:16 +00:00
Reid Spencer
d8f39d1fb3 Can't generate "bool" any more. Change to i1
llvm-svn: 33179
2007-01-13 04:39:47 +00:00
Reid Spencer
5323d61918 Regenerate.
llvm-svn: 33172
2007-01-13 00:23:06 +00:00
Reid Spencer
7db973e85f 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
db6bf82482 Regenerate.
llvm-svn: 33169
2007-01-13 00:13:49 +00:00
Reid Spencer
d64e8bc8ac Regenerate.
llvm-svn: 33165
2007-01-13 00:03:30 +00:00
Reid Spencer
f9c112d36d 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
4eea43e6ce Regenerate.
llvm-svn: 33140
2007-01-12 20:10:51 +00:00
Reid Spencer
64620485d0 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
291062988d Fix persistent conflict madness by removing these from cvs.
llvm-svn: 33111
2007-01-12 05:35:13 +00:00
Zhou Sheng
23d24526b2 For PR1043:
Merge ConstantIntegral and ConstantBool into ConstantInt.
Remove ConstantIntegral and ConstantBool from LLVM.

llvm-svn: 33073
2007-01-11 12:24:14 +00:00
Reid Spencer
a56e79c32d Regenerate.
llvm-svn: 32987
2007-01-07 08:07:39 +00:00
Reid Spencer
5c270b3d20 Upgrade the llvm.isunordered intrinsics to "fcmp uno" instruction.
llvm-svn: 32986
2007-01-07 08:07:10 +00:00
Reid Spencer
86cc7756cd Regenerate.
llvm-svn: 32955
2007-01-06 06:04:32 +00:00
Reid Spencer
5676c4009d For PR1082:
Solve several related problems by making variable names more unique and
dealing with recursive phi nodes. Unfortunately, this doesn't solve the
main issue reported in the PR, but its a step in that direction.

llvm-svn: 32953
2007-01-06 06:03:09 +00:00
Reid Spencer
227f5ff545 Regenerate
llvm-svn: 32944
2007-01-06 00:23:53 +00:00
Reid Spencer
1c20034d33 For PR1080:
Emit the correct syntax for icmp and fcmp constant expressions. The
predicate goes outside the parentheses not inside. This was a change made
in the assembler without the corresponding change made in llvm-upgrade.

llvm-svn: 32942
2007-01-06 00:12:05 +00:00
Reid Spencer
bed19cee73 Fix dependencies. The lexer depends on the grammar for the UpgradeParser.h
file so make it depend on the .y file as well. This ensures that in
parallel builds the lexer is built after bison runs.

llvm-svn: 32937
2007-01-05 22:03:42 +00:00
Reid Spencer
a8a4cdc2cb Regenerate
llvm-svn: 32908
2007-01-05 17:20:02 +00:00
Reid Spencer
b5198c9e06 Adjust to new header file name.
llvm-svn: 32907
2007-01-05 17:19:32 +00:00
Reid Spencer
e1e9aa99ae Major update of llvm-upgrade:
1. Completely revise the type system so that types are handled as const
   objects and not created multiple times, cloned, or otherwise copied.
   This gets around memory issues, saves memory, and also emulates LLVM's
   no-two-types-of-the-same-shape-created semantics.
2. Adjust the handling of global names. Basically, we cannot rename them
   for a variety of reasons: linking, forward references, etc.
3. Detect global names that have name conflicts as the result of collapsed
   type planes or redefinitions that llvm-as no longer accepts. These will
   produce warnings on stderr and one of the globals will be renamed.
4. Rename ParserInternals.h as UpgradeInternals.h so it doesn't conflict
   in the debugger with ParserInternals.h from lib/AsmParser.
5. Move the guts of the TypeInfo class into the grammar so we aren't
   implementing large functions in a header file. This also helps with
   debugging a bit.

llvm-svn: 32906
2007-01-05 17:18:58 +00:00
Chris Lattner
6ef6a513f8 regenerate
llvm-svn: 32880
2007-01-04 18:46:42 +00:00
Chris Lattner
b3c4e9aa67 If we hit a parse error, emit something bad to the output stream. This ensures that
llvm-upgrade < foo | llvm-as | llvm-dis

will fail if llvm-upgrade fails.

llvm-svn: 32879
2007-01-04 18:45:51 +00:00
Reid Spencer
016eed41fd Regenerate.
llvm-svn: 32848
2007-01-03 23:45:42 +00:00
Reid Spencer
05b5eea728 Implement many new type features including upreferences, proper retention
of structure contents, counts of packed and array types, etc.

llvm-svn: 32847
2007-01-03 23:45:17 +00:00
Reid Spencer
82042de44e Finish implementation of variable renaming to handle collapsed type planes
by correctly handling up references and enumerated types. Previously there
was some confusion of these two. Thanks to Chris Lattner for demistifying
llvm up references.

llvm-svn: 32846
2007-01-03 23:43:55 +00:00
Reid Spencer
b053ee57b0 Regenerate.
llvm-svn: 32817
2007-01-02 06:34:08 +00:00
Reid Spencer
740121454a Permit signed and unsigned integer constants to be used with either signed
or unsigned integer types.

llvm-svn: 32816
2007-01-02 06:33:02 +00:00
Reid Spencer
58e33da5ec Regenerate.
llvm-svn: 32811
2007-01-02 05:45:11 +00:00
Reid Spencer
538a40d6b8 For PR1070:
Revise the upgrade parser to keep track of types more faithfully and use
this information to resolve name conflicts resulting from collapsed type
planes. The type planes have collapsed because the integer types are now
signless so that uint and int became i32. Where two planes existed for uint
and int, only i32 exists. Any variable names depending on the type planes
to pmake the identifier unique would cause a conflict. This patch resolves
that conflict for many but not all cases.

Situations involving the integer types and pointers to them are handled
by this patch.  However, there are corner cases that are not handled
well, such as:

%t1 = type { uint, int }
%t2 = type { int, uint }

void %myfunc(%t1* one, %t2* two) {
  %var = load %t1* one
  %var = load %t2* two
}

In the scenario above, %t1 and %t2 are really the same type: { i32, i32 }
Consequently attempting to name %var twice will yield a redefinition error
when assembled.

While this patch is sufficien to allow the llvm/test suite to pass, More
work needs to be to complete the handling of these corner cases.

llvm-svn: 32810
2007-01-02 05:44:33 +00:00
Reid Spencer
be379ce176 Regenerate.
llvm-svn: 32805
2007-01-01 01:20:41 +00:00
Reid Spencer
9bd62917ea For PR1070:
Remove useless bitcasts by commenting them out.

llvm-svn: 32804
2007-01-01 01:20:16 +00:00
Reid Spencer
6678d20ec9 For PR950:
Convert signed integer types to signless.

llvm-svn: 32790
2006-12-31 06:02:26 +00:00
Reid Spencer
1ed4f1e97d For PR950:
Don't attempt to parse both the old and new grammars. It is near impossible
to get it right. Remove support for the new define keyword and don't
attempt to insert parameter attributes because there isn't enough
contextual information for it.

llvm-svn: 32784
2006-12-31 05:45:57 +00:00
Reid Spencer
0c70732d9d Regenerate.
llvm-svn: 32772
2006-12-29 20:35:03 +00:00
Reid Spencer
5520923eb5 For PR950:
Fix several bugs and update for new assembly syntax. Changes made include:
1. Fixing rules for icmp/fcmp instructions to not require a closing paren
   at the end. This was a cut-and-paste error from a previous commit.
2. Changing things like Out << " " to Out << ' '
3. Adding the "define" keyword for function definitions
4. Adding support for packed structures

llvm-svn: 32771
2006-12-29 20:33:37 +00:00
Reid Spencer
4428c3483b For PR950:
This patch removes the SetCC instructions and replaces them with the ICmp
and FCmp instructions. The SetCondInst instruction has been removed and
been replaced with ICmpInst and FCmpInst.

llvm-svn: 32751
2006-12-23 06:05:41 +00:00
Reid Spencer
6957f0edcf Regenerate.
llvm-svn: 32405
2006-12-09 19:41:25 +00:00
Reid Spencer
2f57ee5361 Fix test/Regression/Assembler/2006-12-09-Cast-To-Bool.ll
Do not upgrade casts of bool to bool.

llvm-svn: 32404
2006-12-09 19:40:41 +00:00
Reid Spencer
0c2c4241c5 Regenerate.
llvm-svn: 32400
2006-12-09 16:57:22 +00:00
Reid Spencer
cc5dff3e5d When upgrading cast to bool to a setne, generate icmp ne instead.
llvm-svn: 32399
2006-12-09 16:56:55 +00:00
Reid Spencer
c495569ff4 Regenerate.
llvm-svn: 32303
2006-12-07 04:23:03 +00:00
Reid Spencer
a11c3316a3 Create an option to turn off generation of fcmp instructions while still
allowing integer setxx instructions to be converted to icmp.

llvm-svn: 32302
2006-12-07 04:22:23 +00:00
Bill Wendling
a3246c4272 Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, are
now cerr, cout, and NullStream resp.

llvm-svn: 32298
2006-12-07 01:30:32 +00:00
Jim Laskey
4a11d12ea4 No need to update generated files.
llvm-svn: 32275
2006-12-06 11:03:10 +00:00
Jim Laskey
aa484b9305 Fix build for older versios of bison.
llvm-svn: 32274
2006-12-06 10:57:33 +00:00
Reid Spencer
6c5d0a9e1e Regenerate.
llvm-svn: 32269
2006-12-06 06:30:15 +00:00
Reid Spencer
1190eda624 Don't turn on SETCC upgrade yet!
llvm-svn: 32268
2006-12-06 06:29:36 +00:00
Reid Spencer
57550d241d Regenerate.
llvm-svn: 32267
2006-12-06 06:25:46 +00:00
Reid Spencer
649b2046eb Fix upgrade of setcc with bool operands.
llvm-svn: 32266
2006-12-06 06:25:22 +00:00
Chris Lattner
41c5ddb8cb make all llvm tools call llvm_shutdown when they exit, static'ify some stuff.
With this change, I can now move -stats to print when llvm_shutdown is called.

llvm-svn: 32250
2006-12-06 01:18:01 +00:00
Reid Spencer
4cd933d737 Regenerate.
llvm-svn: 32235
2006-12-05 19:21:25 +00:00
Reid Spencer
52be984fa1 For PR645:
Keep track of global constant and variable definitions for eventual use
in resolving conflicts between global and local symbol usage.

llvm-svn: 32234
2006-12-05 19:18:29 +00:00
Reid Spencer
5f8360b8a4 Regenerate.
llvm-svn: 32178
2006-12-04 15:41:36 +00:00
Reid Spencer
be32949823 Match the llvmAsmParser's handling of ICmp and FCmp instructions.
llvm-svn: 32153
2006-12-03 07:10:26 +00:00
Reid Spencer
6fa332c118 Regenerate.
llvm-svn: 32142
2006-12-03 03:16:48 +00:00
Reid Spencer
460a5c1421 Add a needed #include.
llvm-svn: 32141
2006-12-03 03:15:23 +00:00
Reid Spencer
0b2fca760d Regenerate.
llvm-svn: 32140
2006-12-02 22:14:11 +00:00
Reid Spencer
97cae19c07 Implement upgrade of setcc instruction to icmp/fcmp, but don't enable it
yet.

llvm-svn: 32139
2006-12-02 22:09:27 +00:00
Reid Spencer
f57b9b8461 Regenerate.
llvm-svn: 32128
2006-12-02 20:21:22 +00:00
Reid Spencer
e71c22e44a Support several new upgrades:
div -> fdiv/udiv/sdiv
  rem -> frem/urem/srem
  except -> unwind
  uninitialized -> external
as well as tracking the element type of pointers, packed, and array.

llvm-svn: 32127
2006-12-02 20:19:56 +00:00
Reid Spencer
87934cca95 Regenerate.
llvm-svn: 32122
2006-12-02 16:19:52 +00:00
Reid Spencer
e81f44521c Implement the GEP upgrade for non-constant unsigned indices
llvm-svn: 32121
2006-12-02 16:19:28 +00:00
Reid Spencer
b80f070688 Keep lists of values so they can be examined.
llvm-svn: 32120
2006-12-02 15:16:01 +00:00
Reid Spencer
9120a12f23 Add support for global types and type resolution. Fix several minor
formatting and spacing bugs. This is sufficient for llvm-upgrade to
correctly upgrade all of llvm/test.

llvm-svn: 32114
2006-12-02 04:11:07 +00:00
Reid Spencer
f6209db146 Handle upgrade of fp -> ptr cast with fp -> int -> ptr
llvm-svn: 32109
2006-12-01 23:40:53 +00:00
Reid Spencer
ea755fc9d2 Don't convert {} into []!
llvm-svn: 32106
2006-12-01 22:42:01 +00:00
Reid Spencer
404afdfaf5 Allow the new cast instructions.
llvm-svn: 32104
2006-12-01 22:34:43 +00:00
Reid Spencer
1fda3ddad9 Upgrade shr to ashr and lshr
llvm-svn: 32103
2006-12-01 22:26:37 +00:00
Reid Spencer
f20f7dacec Don't treat numeric (untyped) constants as a ConstInfo, just pass the
string and let ConstVal add the type.

llvm-svn: 32096
2006-12-01 21:52:30 +00:00
Reid Spencer
359a9d8247 First version of llvm-upgrade that can correctly upgrade all of
test/Feature

llvm-svn: 32092
2006-12-01 21:10:07 +00:00
Reid Spencer
0444ba7677 valgrind clean version of llvm-upgrade
llvm-svn: 32090
2006-12-01 20:36:40 +00:00
Reid Spencer
d98e9df87f First version of llvm-upgrade that can correctly upgrade a large test
case.

llvm-svn: 32089
2006-12-01 20:26:20 +00:00
Reid Spencer
6ba44b183b Allow llvm-upgrade to read from stdin. Configure the lexer for reading
from C++ std::istream.

llvm-svn: 32041
2006-11-30 16:50:26 +00:00
Reid Spencer
4b5f94e616 Ignore generated files.
llvm-svn: 32031
2006-11-30 06:37:43 +00:00
Reid Spencer
1eebd168fe Initial, non-functional, version of llvm-upgrade. This version just echos
its input. Committed for safekeeping purposes. Don't use this yet.

llvm-svn: 32030
2006-11-30 06:36:44 +00:00