Commit Graph

1961 Commits

Author SHA1 Message Date
Chris Lattner 216835d688 add an option for timing bc file reading.
llvm-svn: 33977
2007-02-07 04:39:35 +00:00
Reid Spencer 1241d6d5ab For PR411:
Adjust to changes in Module interface:
getMainFunction() -> getFunction("main")
getNamedFunction(X) -> getFunction(X)

llvm-svn: 33922
2007-02-05 21:19:13 +00:00
Reid Spencer 3c52e275ea For PR411:
Change getNamedFunction -> getFunction
Make llvm-extract run the StripDeadPrototypes pass.

llvm-svn: 33921
2007-02-05 21:17:53 +00:00
Reid Spencer 3aaaa0b2bd For PR411:
This patch replaces the SymbolTable class with ValueSymbolTable which does
not support types planes. This means that all symbol names in LLVM must now
be unique. The patch addresses the necessary changes to deal with this and
removes code no longer needed as a result. This completes the bulk of the
changes for this PR. Some cleanup patches will follow.

llvm-svn: 33918
2007-02-05 20:47:22 +00:00
Reid Spencer 7b4d83c252 Fix grammaro in output message.
llvm-svn: 33885
2007-02-04 22:08:16 +00:00
Reid Spencer bc7e614093 Regenerate.
llvm-svn: 33859
2007-02-04 01:12:11 +00:00
Reid Spencer d9f7298477 For PR1151:
Make llvm-upgrade valgrind clean. Deleting type instances is a really
nasty thing to do to LLVM. This was a hold-over from the re-write.
This fixes test/Assembler/2007-01-22-UpgradeTypeMapInvalidMemory.ll and
potentially many other bugs.

llvm-svn: 33858
2007-02-04 01:05:23 +00:00
Reid Spencer d751385a7a Make sure the gccas script is executable.
llvm-svn: 33851
2007-02-04 00:23:51 +00:00
Reid Spencer 8de97bba5a For PR1072:
Removing -raise has neglible positive or negative side effects so we are
opting to remove it. See the PR for comparison details.

llvm-svn: 33844
2007-02-03 23:15:56 +00:00
Chris Lattner 7ccf30bb17 add an instcombine pass to clean up after heavy-lifting IP passes
llvm-svn: 33843
2007-02-03 23:06:03 +00:00
Reid Spencer 5458e0e135 Clean this up a bit: hide command unless verbose output requested, echo
a useful comment line, add a clean target.

llvm-svn: 33834
2007-02-03 16:09:12 +00:00
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
Reid Spencer cddc9dfe97 Implement review feedback for the ConstantBool->ConstantInt merge. Chris
recommended that getBoolValue be replaced with getZExtValue and that
get(bool) be replaced by get(const Type*, uint64_t). This implements
those changes.

llvm-svn: 33110
2007-01-12 04:24:46 +00:00
Reid Spencer 542964f55b Rename BoolTy as Int1Ty. Patch by Sheng Zhou.
llvm-svn: 33076
2007-01-11 18:21:29 +00:00
Zhou Sheng 75b871fb1e 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
Chandler Carruth 15719d08cc Fixing a ">" redirect to be a ">>" redirect, so a sed command doesn't get clobbered.
llvm-svn: 33032
2007-01-09 02:38:29 +00:00
Devang Patel 73d40ac101 Modules are consumed when they are merged together by Linker.
Clear modules vector so that destructure does not try to
delete these modules again. Patch by Chandler Carruth.

llvm-svn: 33017
2007-01-08 18:42:27 +00:00
Chris Lattner e05182cd1e fix atexit. This is an overcomplex way of calling exit, but it is required,
as the jit intercepts exit calls to implement atexit handlers.  This
fixes SingleSource/UnitTests/2003-05-14-AtExit

llvm-svn: 33008
2007-01-08 07:36:34 +00:00
Chandler Carruth b2d4caaaa8 Build libLLVMlto on non-Darwin architectures. Resolves PR1055: http://llvm.org/PR1055
llvm-svn: 33006
2007-01-08 06:25:29 +00:00
Chris Lattner 7b864c0d9e relax type
llvm-svn: 32990
2007-01-07 08:13:39 +00:00
Reid Spencer 1d48a8b9fb Regenerate.
llvm-svn: 32987
2007-01-07 08:07:39 +00:00
Reid Spencer 2af5100b53 Upgrade the llvm.isunordered intrinsics to "fcmp uno" instruction.
llvm-svn: 32986
2007-01-07 08:07:10 +00:00
Chris Lattner bc3ffdda4c this is an overcomplex way to call exit :)
llvm-svn: 32978
2007-01-07 06:43:08 +00:00
Chris Lattner 7fab842b1f Add C wrappers for the LTO library (PR1081). Patch by Chandler Carruth!
llvm-svn: 32966
2007-01-06 23:53:43 +00:00
Chris Lattner 350563eba7 fix typo
llvm-svn: 32965
2007-01-06 23:51:31 +00:00
Reid Spencer 32af9e8cc5 For PR411:
Take an incremental step towards type plane elimination. This change
separates types from values in the symbol tables by finally making use
of the TypeSymbolTable class. This yields more natural interfaces for
dealing with types and unclutters the SymbolTable class.

llvm-svn: 32956
2007-01-06 07:24:44 +00:00
Reid Spencer ebbbbf6273 Regenerate.
llvm-svn: 32955
2007-01-06 06:04:32 +00:00
Reid Spencer cf025ad44a 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 780d4abb8c Add an option for getting the C compiler flags, --cflags.
Patch contributed by Chandler Carruth

llvm-svn: 32950
2007-01-06 02:48:03 +00:00
Reid Spencer 5f92611284 Regenerate
llvm-svn: 32944
2007-01-06 00:23:53 +00:00
Reid Spencer bfa5df2604 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 9329c5f06b 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 02165c634e Regenerate
llvm-svn: 32908
2007-01-05 17:20:02 +00:00
Reid Spencer 9ca1b589af Adjust to new header file name.
llvm-svn: 32907
2007-01-05 17:19:32 +00:00
Reid Spencer 6ee573f523 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 c205585943 regenerate
llvm-svn: 32880
2007-01-04 18:46:42 +00:00
Chris Lattner a0058929bc 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 844c7121c7 Regenerate.
llvm-svn: 32848
2007-01-03 23:45:42 +00:00
Reid Spencer 66ed21c213 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 c13fac5526 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
Evan Cheng a50e3919b1 A bit more debugging printf's.
llvm-svn: 32832
2007-01-03 07:44:30 +00:00
Reid Spencer 03c80e72d1 Regenerate.
llvm-svn: 32817
2007-01-02 06:34:08 +00:00
Reid Spencer 77283c18a1 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 62ad3bbd4c Regenerate.
llvm-svn: 32811
2007-01-02 05:45:11 +00:00
Reid Spencer 25f4cd093b 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 97f4ee7e93 Regenerate.
llvm-svn: 32805
2007-01-01 01:20:41 +00:00
Reid Spencer 1a5d6f56e2 For PR1070:
Remove useless bitcasts by commenting them out.

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

llvm-svn: 32790
2006-12-31 06:02:26 +00:00
Reid Spencer be5fd4a771 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 dc0a3a2fd2 Regenerate.
llvm-svn: 32772
2006-12-29 20:35:03 +00:00
Reid Spencer 0a53afe5ba 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 266e42b312 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 87fbf70789 Ignore the LibDeps.txt.tmp file.
llvm-svn: 32742
2006-12-22 02:02:45 +00:00
Reid Spencer cf0c82f5fa Remove a call to Type::isSigned().
llvm-svn: 32651
2006-12-18 07:58:01 +00:00
John Criswell 2bcf535e0f Remove DSA.
llvm-svn: 32542
2006-12-13 16:54:24 +00:00
Reid Spencer 20f7a2a09b Ressurrect this needed file.
llvm-svn: 32537
2006-12-13 08:10:16 +00:00
Reid Spencer 753036ebaa Ressurrect the Stacker "st" configuration. Someday this will all go
away, but until then Stacker needs its configuration.

llvm-svn: 32536
2006-12-13 08:09:48 +00:00
Reid Spencer 595cef1650 Generate the correct cast opcode for constant expressions.
llvm-svn: 32461
2006-12-12 01:31:37 +00:00
Reid Spencer b7e5180d3c Fix PR1040:
Don't rebuild llvm-config if none of the library dependencies changed.

llvm-svn: 32455
2006-12-12 00:43:38 +00:00
Chris Lattner 6161452b67 make statistics and timing info print even if the JIT'd program calls exit
instead of returning from main.

llvm-svn: 32414
2006-12-10 19:01:52 +00:00
Reid Spencer 04f47b9e8d Regenerate.
llvm-svn: 32405
2006-12-09 19:41:25 +00:00
Reid Spencer 2126b0518e 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 1719061bfd Regenerate.
llvm-svn: 32400
2006-12-09 16:57:22 +00:00
Reid Spencer 87644df5bc 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 7485a167a7 Regenerate.
llvm-svn: 32303
2006-12-07 04:23:03 +00:00
Reid Spencer fc9ca55b6a 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 f3baad3ee1 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 647e883a09 No need to update generated files.
llvm-svn: 32275
2006-12-06 11:03:10 +00:00
Jim Laskey 50c5597863 Fix build for older versios of bison.
llvm-svn: 32274
2006-12-06 10:57:33 +00:00
Reid Spencer 1cf93970d3 Regenerate.
llvm-svn: 32269
2006-12-06 06:30:15 +00:00
Reid Spencer ca83ffbdea Don't turn on SETCC upgrade yet!
llvm-svn: 32268
2006-12-06 06:29:36 +00:00
Reid Spencer bb59a90b7a Regenerate.
llvm-svn: 32267
2006-12-06 06:25:46 +00:00
Reid Spencer 2bbc2a165d Fix upgrade of setcc with bool operands.
llvm-svn: 32266
2006-12-06 06:25:22 +00:00
Chris Lattner 16ae73c83d reword message
llvm-svn: 32257
2006-12-06 05:39:18 +00:00
Chris Lattner 76d4632d92 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
Chris Lattner e549bac57b This needs the callgraph data structure to stick around as long as the
printer does.

llvm-svn: 32236
2006-12-05 19:43:42 +00:00
Reid Spencer 39651ae196 Regenerate.
llvm-svn: 32235
2006-12-05 19:21:25 +00:00
Reid Spencer c77c7157f8 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 c8809b5c08 Regenerate.
llvm-svn: 32178
2006-12-04 15:41:36 +00:00
Reid Spencer 723e07e9d8 Match the llvmAsmParser's handling of ICmp and FCmp instructions.
llvm-svn: 32153
2006-12-03 07:10:26 +00:00
Reid Spencer 6521b7a1c9 Regenerate.
llvm-svn: 32142
2006-12-03 03:16:48 +00:00
Reid Spencer bc17466558 Add a needed #include.
llvm-svn: 32141
2006-12-03 03:15:23 +00:00
Reid Spencer 690d437920 Regenerate.
llvm-svn: 32140
2006-12-02 22:14:11 +00:00
Reid Spencer 9a8b3173cc 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 1290f03fa3 Regenerate.
llvm-svn: 32128
2006-12-02 20:21:22 +00:00
Reid Spencer 2017e84f9a 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 7f327637b1 Regenerate.
llvm-svn: 32122
2006-12-02 16:19:52 +00:00
Reid Spencer 3a81da78a1 Implement the GEP upgrade for non-constant unsigned indices
llvm-svn: 32121
2006-12-02 16:19:28 +00:00
Reid Spencer 74fb4359a9 Keep lists of values so they can be examined.
llvm-svn: 32120
2006-12-02 15:16:01 +00:00
Reid Spencer f7e9f43e21 Build llvm-update now.
llvm-svn: 32116
2006-12-02 04:46:36 +00:00
Reid Spencer bc7daea442 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 114c808702 Handle upgrade of fp -> ptr cast with fp -> int -> ptr
llvm-svn: 32109
2006-12-01 23:40:53 +00:00
Reid Spencer 8a95b0bf21 Don't convert {} into []!
llvm-svn: 32106
2006-12-01 22:42:01 +00:00
Reid Spencer 7956c3647b Allow the new cast instructions.
llvm-svn: 32104
2006-12-01 22:34:43 +00:00
Reid Spencer c3f57a2f8b Upgrade shr to ashr and lshr
llvm-svn: 32103
2006-12-01 22:26:37 +00:00
Chris Lattner 571dd5778f target constructors are never used
llvm-svn: 32099
2006-12-01 21:59:37 +00:00
Reid Spencer f05199113c 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 7e798cc0ae 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 16353d6583 valgrind clean version of llvm-upgrade
llvm-svn: 32090
2006-12-01 20:36:40 +00:00
Reid Spencer 2daa57894f First version of llvm-upgrade that can correctly upgrade a large test
case.

llvm-svn: 32089
2006-12-01 20:26:20 +00:00
Nick Lewycky f0371198ec Remove extra header.
llvm-svn: 32056
2006-12-01 01:05:14 +00:00
Nick Lewycky e5a8617778 Fix opt -o option. Don't pass a pointer to an auto variable which is going
away before it's needed, and don't try to delete that pointer!

llvm-svn: 32055
2006-12-01 00:43:14 +00:00
Reid Spencer 3867383db0 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 120b380bb5 Ignore generated files.
llvm-svn: 32031
2006-11-30 06:37:43 +00:00
Reid Spencer 8e60eec519 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
Bill Wendling afd54eb8b6 Replacing std::iostreams with llvm iostreams. Some of these changes involve
adding a temporary wrapper around the ostream to make it friendly to
functions expecting an LLVM stream. This should be fixed in the future.

llvm-svn: 31990
2006-11-29 00:19:40 +00:00
Bill Wendling a531ac291c Convert to using llvm streams instead of iostreams.
llvm-svn: 31989
2006-11-28 23:33:06 +00:00
Reid Spencer d077fe70e9 Add an -append-exit-code option to bugpoint. This will cause bugpoint to
append "exit <retcode>" to the end of the output file. This is used by
the nightly tester to make bugpoint match the output generated by the
RunSafely.sh script so it doesn't find false positives.

llvm-svn: 31960
2006-11-28 07:04:10 +00:00
Reid Spencer 6c38f0bb07 For PR950:
The long awaited CAST patch. This introduces 12 new instructions into LLVM
to replace the cast instruction. Corresponding changes throughout LLVM are
provided. This passes llvm-test, llvm/test, and SPEC CPUINT2000 with the
exception of 175.vpr which fails only on a slight floating point output
difference.

llvm-svn: 31931
2006-11-27 01:05:10 +00:00
Nick Lewycky 09b7e4d3ab Update to new predicate simplifier VRP design. Fixes PR966 and PR967.
Remove predicate simplifier from default gcc3 pipeline. New design is too
slow to enable by default.
Add new testcases for problems encountered in development.

llvm-svn: 31895
2006-11-22 23:49:16 +00:00
John Criswell dffef2d2f5 Added the --disable-compression option which controls whether the
generated bytecode uses compression.

llvm-svn: 31891
2006-11-21 22:50:24 +00:00
Bill Wendling 0d630c33b2 Need <iostream> for the time being.
llvm-svn: 31821
2006-11-17 10:09:22 +00:00
Bill Wendling 605795ea8c Need iostream to be included for the time being.
llvm-svn: 31820
2006-11-17 10:05:07 +00:00
Reid Spencer 3005d47797 Minor style fixes from review.
llvm-svn: 31685
2006-11-11 19:59:25 +00:00
Reid Spencer 471bcb750e Add a -disable-loop-extraction option to bugpoint.
llvm-svn: 31683
2006-11-11 19:05:02 +00:00
Reid Spencer 75db664f44 For PR998:
Fix an infinite loop in the Linker and a few other assorted link problems.

Patch contributed by Scott Michel. Thanks, Scott!

llvm-svn: 31680
2006-11-11 11:54:25 +00:00
Chris Lattner 7275b02ea5 completely revert patrick's enhancement to bugpoint. Though it makes bugpoint
speed up, it sometimes makes it crash on complex bc files, which isn't very nice.


With this, bugpoint can reduce the 176.gcc failure.

llvm-svn: 31589
2006-11-09 06:24:56 +00:00
Chris Lattner f1a1a7ae6f add a new bugpoint mode -llc-safe. This uses LLC for both halves of a
miscompilation.  This is useful for working around GCC+CBE bugs or for handling
programs that CBE doesn't support (e.g. inline asm) when searching for
optimizer bugs.

llvm-svn: 31588
2006-11-09 05:57:53 +00:00
Reid Spencer fdff938a7e For PR950:
This patch converts the old SHR instruction into two instructions,
AShr (Arithmetic) and LShr (Logical). The Shr instructions now are not
dependent on the sign of their operands.

llvm-svn: 31542
2006-11-08 06:47:33 +00:00
Reid Spencer 5e5a05e753 Fix a problem in the the last patch that subverts error message printing.
llvm-svn: 31466
2006-11-05 19:53:08 +00:00
Jeff Cohen 7d6f3db3e2 Unbreak VC++ build.
llvm-svn: 31464
2006-11-05 19:31:28 +00:00
Reid Spencer 8bfe22d08d Make llvm2cpp -pedantic clean.
llvm-svn: 31389
2006-11-03 00:05:16 +00:00
Reid Spencer de46e48420 For PR786:
Turn on -Wunused and -Wno-unused-parameter. Clean up most of the resulting
fall out by removing unused variables. Remaining warnings have to do with
unused functions (I didn't want to delete code without review) and unused
variables in generated code. Maintainers should clean up the remaining
issues when they see them. All changes pass DejaGnu tests and Olden.

llvm-svn: 31380
2006-11-02 20:25:50 +00:00
Reid Spencer 7eb55b395f For PR950:
Replace the REM instruction with UREM, SREM and FREM.

llvm-svn: 31369
2006-11-02 01:53:59 +00:00
Bill Wendling ce3afd64e9 Forgot a }
llvm-svn: 31226
2006-10-27 20:22:04 +00:00
Bill Wendling 74a4a2a80b Re-added the part where it tries to remove all global variables first.
llvm-svn: 31225
2006-10-27 20:18:06 +00:00
Devang Patel a9abd62ede Save temp. bc files when saveTemps flag is true. Use final output file
name supplied by linker to construct temp bc file names.

Remove tabs.

llvm-svn: 31205
2006-10-26 20:46:22 +00:00
Reid Spencer 7e80b0b31e For PR950:
Make necessary changes to support DIV -> [SUF]Div. This changes llvm to
have three division instructions: signed, unsigned, floating point. The
bytecode and assembler are bacwards compatible, however.

llvm-svn: 31195
2006-10-26 06:15:43 +00:00
Bill Wendling 3f83343c52 Fix for PR960. Improves bugpoint so that it removes global variable
initializers as well. This is only a first pass. It can be slow because
it clones the module for each pass. An obvious improvement is not to do that.

llvm-svn: 31182
2006-10-25 18:36:14 +00:00
Devang Patel 07631698ac Supply alignment info to linker through LLVMSymbol.
llvm-svn: 31181
2006-10-25 18:10:07 +00:00
Devang Patel b0a5e39b26 Instead of hard coding global prefix, use TargetAsmInfo.
Add LTO destructor.

llvm-svn: 31168
2006-10-24 18:41:02 +00:00
Devang Patel fdf6144168 Fix typo. Add more comment. Avoid extra hash_map search.
llvm-svn: 31144
2006-10-23 23:57:53 +00:00
Devang Patel 6c01383118 Add removeModule().
llvm-svn: 31142
2006-10-23 23:12:26 +00:00
Reid Spencer e0fc4dfc22 For PR950:
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.

llvm-svn: 31063
2006-10-20 07:07:24 +00:00
Chris Lattner 8adfe927bb Make the bugpoint reduction heuristics more effective. Patch submitted by
Domagoj Babic, thanks!

llvm-svn: 30863
2006-10-10 21:42:25 +00:00
Devang Patel d90c2d7386 Use FindProgramByName instead of FindExecutable.
llvm-svn: 30846
2006-10-09 21:16:05 +00:00
Devang Patel 060c4857ca Do error checking.
llvm-svn: 30842
2006-10-09 20:20:13 +00:00
Chris Lattner dfa8d9258a Remove a dead var noticed by Yorion
llvm-svn: 30841
2006-10-09 20:12:37 +00:00
Devang Patel dacaf1e375 Use GetTemporaryDirectory. Fix http://llvm.org/bugs/show_bug.cgi?id=894
llvm-svn: 30838
2006-10-09 19:04:51 +00:00
Chris Lattner ddfe6998de simplify code
llvm-svn: 30661
2006-09-28 23:24:48 +00:00
Nick Lewycky 25587182f3 Enable 'predsimplify' optimization.
llvm-svn: 30589
2006-09-24 00:08:16 +00:00
Devang Patel 5af1651f7d Use abstract class to facilitate dlopen() interface.
llvm-svn: 30569
2006-09-21 17:22:55 +00:00
Chris Lattner ff8a6b86db comment out debug code
llvm-svn: 30401
2006-09-15 23:01:10 +00:00
Chris Lattner 634bc046ca Add a new -cbe-bug mode, which works just like -run-llc, except that it uses
LLC as the reference compiler to reduce testcases for bugs in GCC.

llvm-svn: 30400
2006-09-15 21:29:15 +00:00
Anton Korobeynikov d61d39ec53 Adding dllimport, dllexport and external weak linkage types.
DLL* linkages got full (I hope) codegeneration support in C & both x86
assembler backends.
External weak linkage added for future use, we don't provide any
codegeneration, etc. support for it.

llvm-svn: 30374
2006-09-14 18:23:27 +00:00
Chris Lattner 3f0ffd31cf add a new (hidden) -disable-core-files option
llvm-svn: 30318
2006-09-14 06:17:09 +00:00
Devang Patel dd53fd41cd Add comment.
llvm-svn: 30315
2006-09-14 05:49:10 +00:00
Nick Lewycky a2c681ab41 Fix --enable-valgrind. Add room for the new arguments, and don't keep
a pointer to a temporary.

llvm-svn: 30312
2006-09-14 04:20:17 +00:00
Nick Lewycky 7faef23f02 Add --enable-valgrind option to run optimizations through valgrind to
pick up on memory errors.

llvm-svn: 30311
2006-09-14 03:49:54 +00:00
Devang Patel e480d2a2d7 GlobalValue with InternalLinkage may have operands with ExternalLinkage
type. Do not ignore these operands while finding external references.

llvm-svn: 30310
2006-09-14 01:35:13 +00:00
Chris Lattner 70b9f5bd1e Move ipsccp pass earlier to clean up obvious bogosities
llvm-svn: 30232
2006-09-09 21:30:13 +00:00
Chris Lattner fe01c281a9 ok this really works :)
llvm-svn: 30195
2006-09-08 18:33:49 +00:00
Devang Patel 842163d60a Remove redundant include.
llvm-svn: 30194
2006-09-08 18:20:25 +00:00
Chris Lattner eda4a9e008 Need to include Makefile.config to get the value of $(OS). Add a comment.
llvm-svn: 30193
2006-09-08 18:08:50 +00:00
Anton Korobeynikov dc7b51910b Enabling LTO building on Darwin only right now. This probably should be
removed after 'PIC vs non-PIC' problem solution

llvm-svn: 30192
2006-09-08 18:00:43 +00:00
Devang Patel 5606dd8a45 Using addPassesToEmitWholeFile is not a good idea here.
Use FunctionPassManager to do the job.

llvm-svn: 30160
2006-09-07 21:41:11 +00:00
Devang Patel ce2c1eb154 Add linker into list of LINK_COMPONENTS.
llvm-svn: 30159
2006-09-07 21:36:55 +00:00
Devang Patel 12ee0cbde4 Add lto into the list of PARALLEL_DIRS
llvm-svn: 30154
2006-09-07 20:21:58 +00:00
Devang Patel 5b3510abd3 Use addPassesToEmitWholeFile() instead of addPassesToEmitFile()
llvm-svn: 30153
2006-09-07 20:20:56 +00:00
Chris Lattner 3b18c1a946 Change DisambiguateGlobalSymbols to not rename asm globals, which breaks
bugpoint on leopard.

llvm-svn: 30150
2006-09-07 18:21:07 +00:00
Devang Patel 5561aa7271 Add getTargetTriple() that linker can use to query target architecture.
llvm-svn: 30132
2006-09-06 20:16:28 +00:00
Devang Patel ee9f617cff Keep track of all modules crated using a name to module map.
Add private member function getMoudle().

llvm-svn: 30130
2006-09-06 18:50:26 +00:00
Devang Patel 95b7c7af2e Instead of demangling symbol name by hand, use original name, which was
used to mangle symbol name, directly.

llvm-svn: 30124
2006-09-06 00:45:52 +00:00
Devang Patel e3b9490b05 Extract target triplet from optimized module.
Untabify.

llvm-svn: 30123
2006-09-06 00:28:22 +00:00
Chris Lattner af726fe9d5 lli uses LinkAllCodegenComponents, so it needs this. Thanks to
Rafael Esp?ndola for pointing this out

llvm-svn: 30100
2006-09-04 18:34:16 +00:00
Chris Lattner 3b78c704d1 Use llvm-config instead of magic JIT thing to link in libs
llvm-svn: 30091
2006-09-04 06:01:43 +00:00
Chris Lattner 28689ff2d0 Use LINK_COMPONENTS to specify *components* to link against instead of
using USED_LIBS to specify *libraries* to link against.

llvm-svn: 30090
2006-09-04 05:59:09 +00:00
Chris Lattner 2d4cae9896 Allow things like --libs CBackend
llvm-svn: 30089
2006-09-04 05:35:23 +00:00
Chris Lattner 956f73bdfa Switch to using llvm-config to build
llvm-svn: 30088
2006-09-04 05:24:16 +00:00
Chris Lattner 36bf108d71 Switch to using llvm-config to select components to link in.
llvm-svn: 30085
2006-09-04 04:47:49 +00:00
Chris Lattner 12e97307a1 Completely rearchitect the interface between targets and the pass manager.
This pass:

1. Splits TargetMachine into TargetMachine (generic targets, can be implemented
any way, like the CBE) and LLVMTargetMachine (subclass of TM that is used by
things using libcodegen and other support).
2. Instead of having each target fully populate the passmgr for file or JIT
   output, move all this to common code, and give targets hooks they can
   implement.
3. Commonalize the target population stuff between file emission and JIT
   emission.
4. All (native code) codegen stuff now happens in a FunctionPassManager, which
   paves the way for "fast -O0" stuff in the CFE later, and now LLC could
   lazily stream .bc files from disk to use less memory.
5. There are now many fewer #includes and the targets don't depend on the
   scalar xforms or libanalysis anymore (but codegen does).
6. Changing common code generator pass ordering stuff no longer requires
   touching all targets.
7. The JIT now has the option of "-fast" codegen or normal optimized codegen,
   which is now orthogonal to the fact that JIT'ing is being done.

llvm-svn: 30081
2006-09-04 04:14:57 +00:00
Chris Lattner d140393a49 rearrange targets to satisfy dependencies. Too bad we aren't using llvm-config.
llvm-svn: 30077
2006-09-04 04:04:41 +00:00
Chris Lattner c754b0a37f If a cycle exists, don't succeed building the second time around.
llvm-svn: 30076
2006-09-04 01:49:10 +00:00
Chris Lattner dcd72422fd remove message
llvm-svn: 30075
2006-09-04 01:48:32 +00:00
Chris Lattner 2ecd34e869 Remove use of target::getName()
llvm-svn: 30069
2006-09-03 18:38:30 +00:00
Anton Korobeynikov 6c6a70f999 - Fixed broken Win32 build
- Removed warning about clobbered parameter in Bytecode/Reader

llvm-svn: 30026
2006-09-01 20:35:17 +00:00
Chris Lattner dcc8bcc04d Code cleanups, no functionality change.
llvm-svn: 29969
2006-08-29 23:38:20 +00:00
Reid Spencer 014a2dd53d Delete a no-longer-supported configuration item.
llvm-svn: 29960
2006-08-29 20:52:44 +00:00
Chris Lattner 29619a9a01 Add a --disable-compression option like llvm-link/llvm-as etc have
llvm-svn: 29941
2006-08-28 17:31:55 +00:00
Reid Spencer e7141c8be6 For PR387:
Close out this long standing bug by removing the remaining overloaded
virtual functions in LLVM. The -Woverloaded-virtual option is now turned on.

llvm-svn: 29934
2006-08-28 01:02:49 +00:00
Chris Lattner c2d3d3112e eliminate RegisterOpt. It does the same thing as RegisterPass.
llvm-svn: 29925
2006-08-27 22:42:52 +00:00
Chris Lattner dc729ee32b -analyze mode shouldn't output a .bc file.
llvm-svn: 29923
2006-08-27 22:40:26 +00:00
Chris Lattner 3c9b2420df Eliminate RegisterAnalysis. RegisterPass now does all that is necessary.
llvm-svn: 29921
2006-08-27 22:30:17 +00:00
Chris Lattner 68e53db664 analyze no longer exists, don't offer to run it :)
llvm-svn: 29919
2006-08-27 22:12:06 +00:00
Chris Lattner d8c0bfb9a1 eliminate only use of FilteredPassNameParser
llvm-svn: 29916
2006-08-27 22:07:43 +00:00
Chris Lattner 8e5e13b4fe Merge the 'analyze' mode code with the 'opt' mode code. Eliminate the
'autodetect .ll files' functionality.

llvm-svn: 29915
2006-08-27 22:07:01 +00:00
Reid Spencer f25aebf8cf For PR797:
Remove exception throwing/handling from lib/Bytecode, and adjust its users
to compensate for changes in the interface.

llvm-svn: 29875
2006-08-25 17:43:11 +00:00
Reid Spencer 84f4e1f776 Fix a bug introduced by a change in the Archive::writeToDisk interface.
llvm-svn: 29870
2006-08-25 05:29:36 +00:00
Reid Spencer 93a2acf7bc Fix a bug caused by change in the interface of Archive::writeToDisk.
llvm-svn: 29869
2006-08-25 05:28:17 +00:00
Reid Spencer ec0f205dc1 For PR797:
Remove exception handling from the bytecode archiver and adjust the llvm-ar
tool to accommodate the new interfaces.

llvm-svn: 29866
2006-08-24 23:45:08 +00:00
Nate Begeman a147cbfa21 Make sure that both non-asm file types are marked as experimental
llvm-svn: 29851
2006-08-23 21:29:52 +00:00
Nate Begeman 3cb3921a60 Initial checkin of the Mach-O emitter. There's plenty of fixmes, but it
does emit linkable .o files in very simple cases.

llvm-svn: 29850
2006-08-23 21:08:52 +00:00
Reid Spencer e4ca722199 For PR797:
Final removal of exceptions from lib/System and adjustment of users to
accommodate.

llvm-svn: 29846
2006-08-23 20:34:57 +00:00
Devang Patel 663a005fba If unable to create tmp. file on disk then return LTO_WRITE_FAILURE status.
llvm-svn: 29844
2006-08-23 16:59:25 +00:00
Reid Spencer 879ed5ab9c For PR797:
Eliminate exception throwing from Path::renamePathOnDisk and adjust its
users correspondingly.

llvm-svn: 29843
2006-08-23 07:30:48 +00:00
Reid Spencer 51edba15c6 For PR797:
Remove exception throwing from Path::getDirectoryContents and its users.

llvm-svn: 29841
2006-08-23 06:56:27 +00:00
Reid Spencer 8db844241b For PR797:
Remove exceptions from the Path::create*OnDisk methods. Update their users
to handle error messages via arguments and result codes.

llvm-svn: 29840
2006-08-23 00:39:35 +00:00
Reid Spencer 3376c6d8c5 Rearrange order to build more frequently used tools first and make the
triplet ordering (large, small, small) explicit with one triplet per line.

llvm-svn: 29839
2006-08-23 00:12:11 +00:00
Reid Spencer 37162a57ab Fix a typo.
llvm-svn: 29838
2006-08-23 00:06:14 +00:00
Reid Spencer 9d2f19c7e4 For PR797:
Change the Path::make*OnDisk methods exception free and adjust their usage.

llvm-svn: 29836
2006-08-22 23:27:23 +00:00
Reid Spencer 9afdac4a55 Rearrange the build order to better accommodate parallel build by reducing
memory pressure. This order spaces out large executables with small ones in
between so that in a -j2 or -j3 build, it only attempts to build only one
large executable at time. If you're doing -j4, you probably have enuogh
memory anyway.

llvm-svn: 29835
2006-08-22 23:21:21 +00:00
Reid Spencer 6ba87bbfd3 Make the sys::Path::GetTemporaryDirectory method not throw exceptions and
adjust users of it to compensate.

llvm-svn: 29831
2006-08-22 19:01:30 +00:00
Reid Spencer 944645af44 For PR797:
Adjust usage of the ExecuteAndWait function to use the last argument which
is the ErrMsg string. This is necessitated because this function no longer
throws exceptions on error.

llvm-svn: 29791
2006-08-21 06:04:45 +00:00
Reid Spencer a322366501 For PR885:
Consolidate the LinkAllAnalyses.h and LinkAllPasses.h headers into one
so there is no dupliation.

llvm-svn: 29787
2006-08-21 05:34:03 +00:00
Nate Begeman a12dc61def Fix a build failure
llvm-svn: 29786
2006-08-21 04:57:01 +00:00
Reid Spencer c295914b7a For PR797:
Make sys::Program::ExecuteAndWait not throw exceptions and update any
affected code. It now return -9999 to signal that the program couldn't be
executed. Only one case (in bugpoint) actually examines the result code.

llvm-svn: 29785
2006-08-21 02:04:43 +00:00
Reid Spencer 54aa04f972 Make sure the verify pass gets run after the user's loaded passes as well
when the verify-each option is given.

llvm-svn: 29783
2006-08-20 20:54:38 +00:00
Reid Spencer f2c6a5da97 Rename the -verify option to be -verify-each so that it doesn't conflict
with the -verify pass option. It is also more accurate in that this option
causes a verify option to be run after every pass.

llvm-svn: 29782
2006-08-20 20:48:44 +00:00
Reid Spencer 7ed9bb4b47 Convert llvm-ld to use the PluginLoader like opt instead of having its
one-off (and broken) RunOptimizations function. Also, run some cleanup
passes after the user's loaded passes run. This make sure to clean up
any cruft left around by thos passes.

This patch was inspired by a patch submitted by Bram Adams.

llvm-svn: 29781
2006-08-20 19:18:36 +00:00
Reid Spencer 713eedc1fb For PR797:
Rid the Assembly Parser of exceptions. This is a really gross hack but it
will do until the Assembly Parser is re-written as a recursive descent.
The basic premise is that wherever the old "ThrowException" function was
called (new name: GenerateError) we set a flag (TriggerError). Every
production checks that flag and calls YYERROR if it is set. Additionally,
each call to ThrowException in the grammar is replaced with GEN_ERROR
which calls GenerateError and then YYERROR immediately. This prevents
the remaining production from continuing after an error condition.

llvm-svn: 29763
2006-08-18 08:43:06 +00:00
Reid Spencer 378f7d5d20 For PR872:
Shrinkify LLVM's footprint by removing the analyze tool and moving its
functionality into the opt tool. THis eliminates one of the largest tools
from LLVM and doesn't make opt much bigger because it already included
most of the analysis passes.  To get the old analyze functionality pass
the -analyze option to opt. Note that the integeration here is dead
simple. The "main" of analyze was just copied to opt and invoked if the
-analyze option was given. There may be opportunities for further
integration such as removing the distinction between transform passes
and analysis passes.

To use the analysis functionality, if you previously did this:
  analyze $FNAME -domset -disable-verify
you would now do this:
  opt -analyze $FNAME -domset -disable-verify
Pretty simple.

llvm-svn: 29762
2006-08-18 06:34:30 +00:00
Chris Lattner 56588abbf8 fit in 80 cols
llvm-svn: 29754
2006-08-17 18:51:28 +00:00
Chris Lattner 6e81c96cb8 minor cleanups
llvm-svn: 29753
2006-08-17 18:49:52 +00:00
Reid Spencer 4e41aaf805 Patches to correct several bugs in llvmc.
Patches contributed by Bram Adams. Thanks Bram.

llvm-svn: 29729
2006-08-16 20:31:44 +00:00
Patrick Jenkins 38a197a2eb Adding FindBugs.cpp so the -find-bugs option will work.
llvm-svn: 29704
2006-08-15 16:41:52 +00:00
Patrick Jenkins c46c03834c This commit adds a new feature called find-bugs. The find-bugs option can be invoked on a .bc file from the command like with -find-bugs and a list of passes you wish to test. This procedure takes the set of optimization passes the user specifies, randomizes the passes, runs the passes on the specified .bc file, compiles the program, and finally runs the program checking its output vs the .bc file with no optimizations. This process repeats until either the user kills bugpoint or an error occurs in the optimizations, program complitation, or the running of the program. If an error occurs, bugpoint attempts to diagnose the error by eliminating passes that are not at fault and code that is not needed.
llvm-svn: 29703
2006-08-15 16:40:49 +00:00
Devang Patel 151c3969b1 untabify
llvm-svn: 29686
2006-08-14 23:37:18 +00:00
Devang Patel 4500688cc7 Use mangler, instead of addUnderscore(), to get mangled name.
Now, LLVMSymbol keeps symbol original name and mangled name.

llvm-svn: 29679
2006-08-14 22:36:16 +00:00
Reid Spencer 82c0e38366 Provide indentation of the generated program.
llvm-svn: 29678
2006-08-14 22:35:15 +00:00
Reid Spencer 47fcb4779d Don't print double newline for --src-root and --obj-root as it tends to
confuse shells that might use this output.

llvm-svn: 29629
2006-08-11 21:50:24 +00:00
Anton Korobeynikov 4bf026787a Fixed typo. Thanks, Reid.
llvm-svn: 29533
2006-08-04 22:55:53 +00:00
Anton Korobeynikov ec35113141 Removed usage of "sort", which can lead to undeterministic behavior on mingw & cygwin platforms.
llvm-svn: 29532
2006-08-04 21:52:23 +00:00
Devang Patel 308f033e59 Collect references from globals.
llvm-svn: 29530
2006-08-04 19:10:26 +00:00
Reid Spencer a5c3483f7d For PR845:
Enable the makefile check on the result of find-cycles.pl. LLVM is now
cycle free and we intend to keep it that way. This patch will fail the
build if cycles are found.

llvm-svn: 29517
2006-08-03 21:46:42 +00:00
Reid Spencer c45a6e40bd Fix a typo in the name of expand_dependencies.
Make the dependency line pattern match handle white space better.

llvm-svn: 29516
2006-08-03 21:45:35 +00:00
Devang Patel a108423475 Make it fit into 80-columns.
llvm-svn: 29503
2006-08-03 17:26:30 +00:00
Devang Patel 27672ee821 Fix typo.
llvm-svn: 29502
2006-08-03 17:25:36 +00:00
Devang Patel acd4b07075 Simplify. Use addprefix.
llvm-svn: 29501
2006-08-03 17:18:45 +00:00
Chris Lattner baf6ef94c1 Now that SparcV9 is gone, this logical can be simplified significantly.
llvm-svn: 29498
2006-08-03 16:59:17 +00:00
Devang Patel d615e20ef3 Remove ARM for the moment since it is a work in progress.
llvm-svn: 29495
2006-08-03 16:14:09 +00:00
Devang Patel 36839b8637 Add new tool, lto, to do link time optimization. This tool installs
dynamic library that linker can use to optimize llvm byte codes at
link time.

llvm-svn: 29494
2006-08-03 15:44:57 +00:00
Chris Lattner 5af6a3ffdb Fix the build on case-sensitive filesystems :(
llvm-svn: 29457
2006-08-01 22:34:35 +00:00
Chris Lattner b25c49dd0c no need to check readability here
llvm-svn: 29449
2006-08-01 18:22:21 +00:00
Chris Lattner ec905190bf No need to check isWriteable here (which isn't sufficient anyway). Just attempt
to do the operation and if it fails, oh well.

llvm-svn: 29446
2006-08-01 18:12:29 +00:00
Chris Lattner 63c5e1cf92 Use Path::getFileStatus
llvm-svn: 29445
2006-08-01 18:09:46 +00:00
Chris Lattner 32ffbc316a Use Path::getFileStatus to get status-related info.
llvm-svn: 29444
2006-08-01 18:04:01 +00:00
Jim Laskey 95eda5b1f3 Introducing plugable register allocators and instruction schedulers.
llvm-svn: 29434
2006-08-01 14:21:23 +00:00
Chris Lattner 4857253d98 Change Path::getStatusInfo to return a boolean and error string on an error
instead of throwing an exception.  This reduces the amount of code that is
exposed to exceptions (e.g. FileUtilities), though it is clearly only one step
along the way.

llvm-svn: 29395
2006-07-28 22:03:44 +00:00
Patrick Jenkins 752d52cbb6 Updating the comments above SplitFunctionsOutOfModule in ExtractFunction.cpp to reflect the changes made to that function. Specifically I am removing the FIXME comment because the issue has been addressed.
llvm-svn: 29385
2006-07-28 18:03:01 +00:00
Patrick Jenkins b417a5c166 This commit improves bugpoints speed. On my G4 this changed caused kimwitu++ to run through bugpoint in 1091.15 seconds (user + system time). The time it took to run this on my G4 before I made these changes is 1420.82 seconds (user + system time). This is a speedup of about 5.5 minutes.
This is faster because SplitFunctionsOutOfModule no longer calls Clone Module and then removes the functions it doesnt want from the module returned. Instead it creates a module and copies over the specified functions, making changes to the new and old module where neccessary. This reduces the memory demand.

llvm-svn: 29379
2006-07-28 01:19:28 +00:00
Reid Spencer b101b1bf60 Undo last commit, which was committed accidentally.
llvm-svn: 29369
2006-07-27 23:19:00 +00:00
Reid Spencer eca6f7320e Changes to support cross-compiling LLVM. The GenLibDeps.pl script needs to
have a compile-host version of "nm", not build-host. In order to effect this
we must use autoconf to determine the correct "nm" to use and propagate that
through the makefiles, through llvm-config and finally to GenLibDeps.pl as
an optional argument.
Patch contributed by Anton Korobeynikov. Thanks!

llvm-svn: 29368
2006-07-27 23:00:30 +00:00
Chris Lattner 44b1e8e53f Avoid a "scary" make warning for the 1.8 release. This should be reenabled
right after 1.8 "ships".

llvm-svn: 29308
2006-07-26 21:14:04 +00:00
Chris Lattner 729b7a98ad Add llvm2cpp to DIRs list
llvm-svn: 29299
2006-07-26 20:19:06 +00:00
Reid Spencer 5fd1180d71 Make changes necessary for stopping the build if a cyclic library
dependency is found. The find-cycles.pl script now exits with a return code
that equals the number of cycles found. The Makefile was changed to ignore
the status code of find-cycles.pl. This should be removed once the libraries
are free of cyclic dependencies.

llvm-svn: 29290
2006-07-26 17:10:54 +00:00
Reid Spencer 1c937fe257 Build llvm-config to identify library cycles earlier in the build process.
llvm-svn: 29289
2006-07-26 17:06:02 +00:00
Devang Patel 2c15c01c19 Fix MacOSX build failures. (pr841)
llvm-svn: 29246
2006-07-21 19:44:55 +00:00
Chris Lattner 55782c6c41 Build more debugger/selectiondag libraries as archives instead of .o files.
This works around bugs in some versions of the cygwin linker.

Patch contributed by Anton Korobeynikov.

llvm-svn: 29239
2006-07-21 00:10:47 +00:00
Andrew Lenharth 2b0baddc33 Fix linking on Alpha
llvm-svn: 29219
2006-07-20 17:27:58 +00:00
Reid Spencer 546436c482 Finish removal of EH usage from the Archive library. The REQUIRES_EH flag
in lib/Bytecode/Archive/Makefile is now removed. One small step closer to
a smaller LLVM.

llvm-svn: 29067
2006-07-07 20:56:50 +00:00
Reid Spencer cfa807ab31 Remove EH use from the Archive library and adjust its users accordingly.
llvm-svn: 29066
2006-07-07 19:09:14 +00:00