Commit Graph

29003 Commits

Author SHA1 Message Date
Reid Spencer e3db84c6c2 Explain that bitcast can only cast a pointer to another pointer.
llvm-svn: 33041
2007-01-09 20:08:58 +00:00
Reid Spencer 1fc9be30ef For PR1099:
Invert the "isSigned" logic in calls to printType and printPrimitiveType.
We want variables to be declared unsigned by default so that signless
operators like + and - perform the unsigned operation that LLVM expects
by default. Parameters with the sext attribute will be declared signed and
signed instructions will case operand values to signed regardless of the
type of the variable. This passes all tests and fixes PR1099.

llvm-svn: 33039
2007-01-09 17:09:09 +00:00
Chris Lattner 04398e8d48 Inline insertValue into CreateModuleSlot/CreateFunctionSlot
llvm-svn: 33038
2007-01-09 08:04:59 +00:00
Chris Lattner 721c213c0e Remove a bunch of complex logic that is completely dead: duplicates can
never be inserted!

llvm-svn: 33037
2007-01-09 07:58:11 +00:00
Chris Lattner ea862a33d9 Split CreateSlot into two versions, one for globals and one for function-local
values

llvm-svn: 33036
2007-01-09 07:55:49 +00:00
Chris Lattner 89e774efaa Remove extraneous return value from insertValue and getOrCreateSlot. Since
getOrCreateSlot no longer gets the slot, rename it to CreateSlot.

llvm-svn: 33035
2007-01-09 07:46:21 +00:00
Reid Spencer bf38bf7143 For PR1099:
Partial fix for this PR. Default function parameters to signed integer, just
like everything else in CBE. The bug was caused by incorrectly introducing
parameter attributes feature by choosing "signed" parameter if the
SExtAttribute was specified. Howeer, if no attribute is specified, this
causes it to become unsigned which is incorrect. Reversing the logic so
that signedness is detected by "not ZExtAttribute" set fixes the issue.

This fixes 197.parser but there is more to do. Any comparison and possibly
other operators involving arguments may need to correctly cast the parameter
before its use, depending on the sign of the operator.

llvm-svn: 33034
2007-01-09 06:38:06 +00:00
Reid Spencer d3ee816c17 Test case for PR1099.
llvm-svn: 33033
2007-01-09 06:25:15 +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
Chris Lattner 1b1bb222bd Add PR number for future reference
llvm-svn: 33031
2007-01-09 00:31:52 +00:00
Evan Cheng 232e751988 Fix test case.
llvm-svn: 33030
2007-01-09 00:09:34 +00:00
Reid Spencer a2d9adfa9a PR1085 is fixed now.
llvm-svn: 33029
2007-01-09 00:05:55 +00:00
Evan Cheng be68c65cf3 Added a test case from PR1075.
llvm-svn: 33028
2007-01-08 23:58:27 +00:00
Evan Cheng 0daf445878 Undo xfail now scheduler deficiency has been fixed.
llvm-svn: 33027
2007-01-08 23:57:40 +00:00
Evan Cheng 6730f03370 Naming consistency.
llvm-svn: 33026
2007-01-08 23:55:53 +00:00
Evan Cheng 961bbd393b Fix for PR1075: bottom-up register-reduction scheduling actually increases register pressure.
- Fixed bugs in sethi-ullman number computation and priority queue comparison
functions.
- Separate code that handles priority computation special cases from SU number computation.

llvm-svn: 33025
2007-01-08 23:50:38 +00:00
Chris Lattner 0199fd6d59 Implement some trivial FP foldings when -enable-unsafe-fp-math is specified.
This implements CodeGen/PowerPC/unsafe-math.ll

llvm-svn: 33024
2007-01-08 23:04:05 +00:00
Chris Lattner 8b574a767e new testcase
llvm-svn: 33023
2007-01-08 23:03:19 +00:00
Jim Laskey 3106724a03 Need to handle static declarations properly.
llvm-svn: 33022
2007-01-08 22:15:18 +00:00
Jeff Cohen 223004cd12 Unbreak VC++ build.
llvm-svn: 33021
2007-01-08 20:17:17 +00:00
Reid Spencer 7254c25fad Parameter attributes are part of a FunctionType and deserve to be factored
into comparisons of two FunctionTypes. Make it so.

llvm-svn: 33020
2007-01-08 19:41:01 +00:00
Reid Spencer 7b6fb56ec0 XFAIL this test until PR1085 mystery is resolved.
llvm-svn: 33019
2007-01-08 19:38:58 +00:00
Devang Patel 1c56a638a4 Add PMStack, a Pass Manager stack.
Eventually, Top level pass managers  will use this to keep track of
active pass managers. Eass pass will also learn how to find appropriate
manager from these managers stack.

llvm-svn: 33018
2007-01-08 19:29:38 +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
Andrew Lenharth 0d124b8e00 And asm writing for packed struct initializers
llvm-svn: 33016
2007-01-08 18:21:30 +00:00
Andrew Lenharth e3c5a4cfed Make packed structs use packed initialiers for consistency
llvm-svn: 33015
2007-01-08 18:16:47 +00:00
Andrew Lenharth 25ac8676ca Packed structs use packed struct initializers
llvm-svn: 33014
2007-01-08 18:15:35 +00:00
Chris Lattner 6bff61da4f testcase for PR1097
llvm-svn: 33013
2007-01-08 17:52:29 +00:00
Reid Spencer 8f166b0ef3 Comparison of primitive type sizes should now be done in bits, not bytes.
This patch converts getPrimitiveSize to getPrimitiveSizeInBits where it is
appropriate to do so (comparison of integer primitive types).

llvm-svn: 33012
2007-01-08 16:32:00 +00:00
Reid Spencer bf96e02a54 For PR1097:
Enable complex addressing modes on 64-bit platforms involving two induction
variables by keeping a size and scale in 64-bits not 32.
Patch by Dan Gohman.

llvm-svn: 33011
2007-01-08 16:17:51 +00:00
Reid Spencer c0b86d5dc4 For PR1090:
Clean up the definitions of the helper functions per Chris' review
suggestions so they are easier to read.

For PR1091:
Print minimum signed integer values as unsigned so that we get no warnings
from the C compiler about constant ranges and value comparisons.

llvm-svn: 33010
2007-01-08 08:00:00 +00:00
Chris Lattner db0790c2fd Fully specify the type of the llvm.va* intrinsics. This helps resolve
Pr1093

llvm-svn: 33009
2007-01-08 07:55:15 +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
Reid Spencer 13cae7c2a7 Fix PR1090:
Implemented some llvm_fcmp_{pred} functions at the start of the function bodies
and use them for fcmp instructions and constant expressions. These help
implement the ordered and unordered comparisons necessary for correct exectuion
of these comparisons.

llvm-svn: 33007
2007-01-08 06:58:32 +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
Reid Spencer 23414c0033 Fix a bug in an assert that would never trigger.
llvm-svn: 33005
2007-01-08 05:34:39 +00:00
Chandler Carruth 52b15458d4 Testing commit, and adding an entry to CREDITS.TXT
llvm-svn: 33004
2007-01-08 03:10:00 +00:00
Reid Spencer 7928c2fb9c Convert uses of getPrimitiveSize that should be getPrimitiveSizeInBits.
llvm-svn: 33003
2007-01-08 01:26:33 +00:00
Reid Spencer 4ef2c1c705 llvm.isunordered.* are gone.
llvm-svn: 33002
2007-01-07 23:30:23 +00:00
Reid Spencer 4f98e62831 Types should be const.
llvm-svn: 33001
2007-01-07 21:45:41 +00:00
Reid Spencer 968a5290f3 Redefinition of functions is no longer permitted.
llvm-svn: 33000
2007-01-07 19:33:49 +00:00
Chris Lattner 47d012e1c0 the old trace values pass has been removed, remove its runtime library.
llvm-svn: 32999
2007-01-07 18:13:48 +00:00
Chris Lattner 950d0e9926 this pass is unused
llvm-svn: 32998
2007-01-07 18:12:43 +00:00
Chris Lattner 9416cba610 remove an old instrumentation pass that is not used anymore.
llvm-svn: 32997
2007-01-07 18:12:13 +00:00
Chris Lattner 65842fe4cd llvm.isunordered is no longer alive.
llvm-svn: 32995
2007-01-07 08:53:26 +00:00
Chris Lattner 2a116abf3a llvm 2.0 doesn't support llvm.isunordered.*
llvm-svn: 32994
2007-01-07 08:52:43 +00:00
Chris Lattner 59585a61fc relax type
llvm-svn: 32993
2007-01-07 08:39:27 +00:00
Chris Lattner 10cae15d8e remove support for llvm.isunordered
llvm-svn: 32992
2007-01-07 08:37:22 +00:00
Chris Lattner d0c91e1c2e remove llvm.isunordered
llvm-svn: 32991
2007-01-07 08:19:47 +00:00
Chris Lattner 7b864c0d9e relax type
llvm-svn: 32990
2007-01-07 08:13:39 +00:00
Chris Lattner 34acba48cc Change the interface to Module::getOrInsertFunction to be easier to use,to resolve PR1088, and to help PR411.
This simplifies many clients also

llvm-svn: 32989
2007-01-07 08:12:01 +00:00
Chris Lattner 505c06b739 Change the interface to Module::getOrInsertFunction to be easier to use,
to resolve PR1088, and to help PR411.

llvm-svn: 32988
2007-01-07 08:09:25 +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 d97f1936bb prepare for adjustment to getOrInsertFunction method
llvm-svn: 32985
2007-01-07 07:54:34 +00:00
Chris Lattner b800b3921c add some casts to support a change in the getOrInsertFunction interface
llvm-svn: 32984
2007-01-07 07:40:09 +00:00
Chris Lattner f7eef61f20 relax type
llvm-svn: 32983
2007-01-07 07:24:32 +00:00
Chris Lattner cc4715e06e relax some types
llvm-svn: 32982
2007-01-07 07:22:20 +00:00
Chris Lattner 9641ab26ec relax types
llvm-svn: 32981
2007-01-07 06:59:47 +00:00
Chris Lattner fbc524fe87 relax some types
llvm-svn: 32980
2007-01-07 06:58:05 +00:00
Chris Lattner cd65cf6095 remove support for old-style varargs upgrading
llvm-svn: 32979
2007-01-07 06:45:57 +00:00
Chris Lattner bc3ffdda4c this is an overcomplex way to call exit :)
llvm-svn: 32978
2007-01-07 06:43:08 +00:00
Reid Spencer 96b3ffe309 Add a test case for PR1086
llvm-svn: 32977
2007-01-07 03:27:39 +00:00
Reid Spencer df7c61da7e For PR1086:
Parameter attributes do have to be specially handled in the CBE. Implement
their handling.

llvm-svn: 32976
2007-01-07 03:24:48 +00:00
Chris Lattner 783c1c47a5 Simplify the testcase
llvm-svn: 32975
2007-01-07 02:28:52 +00:00
Chris Lattner 18954852ae Fix PR1015 and Transforms/IndVarsSimplify/2007-01-06-TripCount.ll, a
miscompilation of Qt.

llvm-svn: 32974
2007-01-07 02:24:26 +00:00
Chris Lattner a4c150b69e Testcase for PR1015
llvm-svn: 32973
2007-01-07 02:24:10 +00:00
Chris Lattner 39087c7127 cast of int to bool no longer does a compare, rendering this fixme
obsolete

llvm-svn: 32972
2007-01-07 02:05:20 +00:00
Chris Lattner 0816559b13 add -debug output for -indvars.
llvm-svn: 32971
2007-01-07 01:14:12 +00:00
Reid Spencer 9e224a2533 Update the documentation for SymbolTable class.
llvm-svn: 32970
2007-01-07 00:41:39 +00:00
Anton Korobeynikov a9ab10942d As PR1085 was fixed, back out workaround
llvm-svn: 32969
2007-01-07 00:41:20 +00:00
Chris Lattner f6e91576dc Testcase for PR1085
llvm-svn: 32968
2007-01-07 00:32:15 +00:00
Chris Lattner 6a10713fea New testcase for PR1084
llvm-svn: 32967
2007-01-07 00:02:20 +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
Chris Lattner 5967600442 testcase for pr1083
llvm-svn: 32964
2007-01-06 23:38:37 +00:00
Chris Lattner dff39e53f1 wow, the link was already broken :)
llvm-svn: 32963
2007-01-06 23:20:51 +00:00
Chris Lattner 8a7183b5b8 add a note
llvm-svn: 32962
2007-01-06 23:19:38 +00:00
Chris Lattner 72a56fc44c Disable the macho writer until it is 100% functional. Enabling it when
broken invites bug reports.

llvm-svn: 32961
2007-01-06 22:27:58 +00:00
Chris Lattner 67a1ef647a this testcase is too large to be useful, and requires a .bc file to be
kept around.  We can do without it.

llvm-svn: 32960
2007-01-06 22:02:26 +00:00
Chris Lattner 7051d758de Fix regressions in InstCombine/call-cast-target.ll and InstCombine/2003-11-13-ConstExprCastCall.ll
llvm-svn: 32959
2007-01-06 19:53:32 +00:00
Anton Korobeynikov bb162f48ba gcc often inserts it's own names for sections (e.g.
gnu.linkonce.t.FunctionName). Convert them to "normal" LLVM names,
otherwise linker won't be able to merge them.

llvm-svn: 32958
2007-01-06 18:24:26 +00:00
Reid Spencer aeeeaea5a3 Regenerate for new bytecode file format.
llvm-svn: 32957
2007-01-06 07:28:52 +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 ba19a40e8c Accomodate new name manglinge done by llvm-upgrade
llvm-svn: 32954
2007-01-06 06:04:04 +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 5f678a48ff Currently, there is no fix for this.
llvm-svn: 32952
2007-01-06 05:16:27 +00:00
Reid Spencer d0842cdeca Test case for PR1082, an llvm-upgrade bug.
llvm-svn: 32951
2007-01-06 05:15:27 +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
Chris Lattner c343a99786 this final call to canLosslesslyBitCastTo is dead, because ValueRequiresCast
is only called on integers.

llvm-svn: 32949
2007-01-06 02:11:56 +00:00
Chris Lattner 400f959a0c simplify some more code now that there are not multiple different integer
types of the same size

llvm-svn: 32948
2007-01-06 02:09:32 +00:00
Chris Lattner 64d87b0215 eliminate some uses of canLosslesslyBitCastTo, this actually makes the code stronger, by nuking
relational pointer comparisons with casts.

llvm-svn: 32947
2007-01-06 01:45:59 +00:00
Chris Lattner 3fe98ae10a no need to worry about int vs uint any more.
llvm-svn: 32946
2007-01-06 01:37:35 +00:00
Chris Lattner af31398295 new note
llvm-svn: 32945
2007-01-06 01:30:45 +00:00
Reid Spencer 5f92611284 Regenerate
llvm-svn: 32944
2007-01-06 00:23:53 +00:00
Reid Spencer b82bb9b903 Test Case for PR1080.
llvm-svn: 32943
2007-01-06 00:22:38 +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
Evan Cheng 8bc7ddb84d setSetCCIsExpensive is gone.
llvm-svn: 32941
2007-01-05 23:42:53 +00:00
Evan Cheng 5f80c450f3 Expand fcopysign to the bitwise sequence if select is marked as expensive.
llvm-svn: 32940
2007-01-05 23:33:44 +00:00
Evan Cheng 549163707c - Remove isSetCCExpensive() etc. These are no longer used.
- Add isSelectExpensive() etc. It's used to tell codegen that select is expensive for a given target, avoid using it if possible. Currently it's only
used to expand FCOPYSIGN.

llvm-svn: 32939
2007-01-05 23:31:08 +00:00
Devang Patel b66334b73b 1) Remove old AnalysisResolver.
2) Rename AnalysisResolver_New as AnalysisResolver

llvm-svn: 32938
2007-01-05 22:47:07 +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
Evan Cheng 97cbd70494 Update test case.
llvm-svn: 32936
2007-01-05 21:53:15 +00:00
Reid Spencer f7d59e282d For PR1077:
Remove the XFAIL now that global redefinitions are not permitted.

llvm-svn: 32935
2007-01-05 21:51:57 +00:00
Reid Spencer 3325908643 Regenerate.
llvm-svn: 32934
2007-01-05 21:51:07 +00:00
Reid Spencer 6c435f0fa0 For PR1077:
Disallow merging of dupliate global variables. It is now illegal to declare
or define two global variables of the same name and same type. llvm-gcc3 is
dead in 2.0 and llvm-gcc4 doesn't have that problem nor need the hack.

llvm-svn: 32933
2007-01-05 21:50:38 +00:00
Evan Cheng 82241c86e9 - FCOPYSIGN custom lowering bug. Clear the sign bit of operand 0 first before
or'ing in the sign bit of operand 1.
- Tweaking: rather than left shift the sign bit, fp_extend operand 1 first
  before taking its sign bit if its type is smaller than that of operand 0.

llvm-svn: 32932
2007-01-05 21:37:56 +00:00
Reid Spencer db94353bff Add an example to the trunc instruction to clarify trunc to bool.
Example provided by Baptiste Lepilleur.

llvm-svn: 32931
2007-01-05 21:33:08 +00:00
Evan Cheng 3b841ddbe0 Bug in ExpandFCOPYSIGNToBitwiseOps(). Clear the old sign bit of operand 0
before or'ing in the sign bit of operand 1.

llvm-svn: 32930
2007-01-05 21:31:51 +00:00
Evan Cheng 376c9c4c97 CopyToReg source operand can be a register as well. e.g. Copy from GlobalBaseReg.
llvm-svn: 32929
2007-01-05 20:59:06 +00:00
Devang Patel 20f9e22ae2 Remove PassManagerT.h
llvm-svn: 32928
2007-01-05 20:21:13 +00:00
Devang Patel c6b5a554a4 Remove old pass manager.
llvm-svn: 32927
2007-01-05 20:16:23 +00:00
Reid Spencer d35f7d9240 This test case needs parameter attributes, manually upgrade and don't
run llvm-upgrade.

llvm-svn: 32926
2007-01-05 18:38:33 +00:00
Reid Spencer ad3398ce7d Global variables are not renamed by llvm-upgrade any more.
llvm-svn: 32925
2007-01-05 18:37:18 +00:00
Reid Spencer b4d32e8bcd Update for change in parameter attribute syntax.
llvm-svn: 32924
2007-01-05 18:35:52 +00:00
Reid Spencer adabc4b5b8 Update for change in parameter attributes syntax.
llvm-svn: 32923
2007-01-05 18:34:20 +00:00
Reid Spencer f72ca86125 Wrap long RUN: line.
llvm-svn: 32922
2007-01-05 18:33:43 +00:00
Reid Spencer a3188cfe06 Globals are not renamed any more.
llvm-svn: 32921
2007-01-05 18:33:16 +00:00
Reid Spencer c82fade7b2 This test case needs zext and sext attributes so manually upgrade it and
don't run llvm-upgrade.

llvm-svn: 32920
2007-01-05 18:31:56 +00:00
Reid Spencer 1cc9bbd5a3 Changes to parameter attribute syntax.
llvm-svn: 32919
2007-01-05 17:41:34 +00:00
Reid Spencer 791fbf64fc Changes to parameter attributes syntax.
llvm-svn: 32918
2007-01-05 17:40:40 +00:00
Reid Spencer 629aff553a Globals are not being renamed any more.
llvm-svn: 32917
2007-01-05 17:39:54 +00:00
Reid Spencer ba1ad0236a This test case has been translated to 2.0 assembly so don't run
llvm-upgrade on it.

llvm-svn: 32916
2007-01-05 17:39:07 +00:00
Reid Spencer ec18a463d7 Fix this to check for the correct error message.
llvm-svn: 32915
2007-01-05 17:37:59 +00:00
Reid Spencer ab9842ea8b This tests for something that will become illegal soon. The test/Feature
suite has a test for renaming of global variables.

llvm-svn: 32914
2007-01-05 17:36:59 +00:00
Reid Spencer c01fe62caa Beef up this test case a little by introducing a global variable name
conflict after upgrade resulting from collapsed type planes. The test now
checks to make sure llvm-upgrade produces appropriate warning messages.

llvm-svn: 32913
2007-01-05 17:35:05 +00:00
Reid Spencer 0ea405d0eb Make this test that we can drop the implementation keyword for llvm-as.
llvm-upgrade is irrelevant for this test case.

llvm-svn: 32912
2007-01-05 17:29:41 +00:00
Reid Spencer 6acdd1973d Fix the test case for the change in parameter attribute syntax. The @ is
no longer needed and the @(...) syntax has been dropped in favor of a
simple space separated list of attribute names.

llvm-svn: 32911
2007-01-05 17:26:04 +00:00
Reid Spencer 6bcc22ce57 For PR1077:
Split this test case into three cases. globalredefinition.ll just tests
that a global can be forward referenced. globalredefinition2.ll tests
that llvm-upgrade will warn about renaming duplicate global variables.
globalredefinition3.ll tests that llvm-as will generate an error on
duplicate global variables. This last test is currently XFAIL because
the restriction is not implemented yet.

llvm-svn: 32910
2007-01-05 17:25:12 +00:00
Reid Spencer fc899e6f74 For PR1077:
Global variable definitions with the same name and same type are no longer
valid so don't attempt to test for this "feature".

llvm-svn: 32909
2007-01-05 17:22:13 +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
Reid Spencer bf48e3c87d Regenerate.
llvm-svn: 32905
2007-01-05 17:07:23 +00:00
Reid Spencer 136a91c4e7 Change the syntax for parameter attributes:
1. The @ sign is no longer necessary.
2. We now support "function attributes" as parameter attribute 0.
3. Instead of locating the return type attributes after the type of a
   function result, they are now located after the function header's
   closing paranthesis and before any alignment or section options.
4. The way has been prepared for a new "noreturn" function attribute but
   there is no support for recognizing it in the lexer nor doing anything
   with it if it does get set.
5. The FunctionType::getParamAttrsText method now has support for
   returning multiple attributes. This required a change in its interface.

I'm unhappy that this change leads to 6 new shift/reduce conflicts, but
in each case bison's decision to choose the shift is correct so there
shouldn't be any damage from these conflicts.

llvm-svn: 32904
2007-01-05 17:06:19 +00:00
Reid Spencer edd3ad549a Give the assembler some input.
llvm-svn: 32903
2007-01-05 16:45:06 +00:00
Evan Cheng 8c7094a770 Typo
llvm-svn: 32902
2007-01-05 08:32:24 +00:00
Evan Cheng e8345f2445 Add a test case for SSE fcopysign using SSE bitwise operations.
llvm-svn: 32901
2007-01-05 08:12:59 +00:00
Evan Cheng 4363e884c0 With SSE2, expand FCOPYSIGN to a series of SSE bitwise operations.
llvm-svn: 32900
2007-01-05 07:55:56 +00:00
Chris Lattner d7b6ea166d Implement InstCombine/vec_shuffle.ll:%test7, simplifying shuffles with
undef operands.

llvm-svn: 32899
2007-01-05 07:36:08 +00:00
Chris Lattner e4f7c5cf35 new test
llvm-svn: 32898
2007-01-05 07:35:24 +00:00
Chris Lattner dc1e33ace7 manually upgrade this testcase
llvm-svn: 32897
2007-01-05 07:34:41 +00:00
Chris Lattner 17c7c030c2 fold things like a^b != c^a -> b != c. This implements InstCombine/xor.ll:test27
llvm-svn: 32893
2007-01-05 03:04:57 +00:00
Chris Lattner 130fff0d03 new testcase
llvm-svn: 32892
2007-01-05 03:03:51 +00:00
Chris Lattner 54ea1ec249 llvm upgrade doesn't accept 'define'
llvm-svn: 32891
2007-01-05 03:03:27 +00:00
Chris Lattner 23eb8ec78b Compile X + ~X to -1. This implements Instcombine/add.ll:test34
llvm-svn: 32890
2007-01-05 02:17:46 +00:00
Chris Lattner ce0f91ebd6 new testcase
llvm-svn: 32889
2007-01-05 02:16:36 +00:00
Evan Cheng 8ec5283dc4 GEP subscript is interpreted as a signed value.
llvm-svn: 32888
2007-01-05 01:46:20 +00:00
Reid Spencer 92c671e77e Correct the documentation for function declarations. They can have dllimport
or extern_weak linkage as well as "externally visible".

llvm-svn: 32887
2007-01-05 00:59:10 +00:00
Chris Lattner a0e341f429 add missing flags
llvm-svn: 32885
2007-01-04 23:18:14 +00:00
Chris Lattner 96035bed51 fix PowerPC/2007-01-04-ArgExtension.ll, a bug handling K&R prototypes with
the recent signless changes.

llvm-svn: 32884
2007-01-04 22:22:37 +00:00
Chris Lattner 447a9dd56e new testcase
llvm-svn: 32883
2007-01-04 22:22:07 +00:00
Chris Lattner bc5cc2e7fa Fix broken links, reported by Baptiste Lepilleur
llvm-svn: 32882
2007-01-04 22:01:45 +00:00
Evan Cheng 003feb03d5 Expand fcopysign to a series of bitwise of operations when it's profitable to
do so.

llvm-svn: 32881
2007-01-04 21:56:39 +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 8392ed123a Document this tool as experimental and list its deficiencies.
llvm-svn: 32878
2007-01-04 17:55:11 +00:00
Chris Lattner 11c822d053 remove the 'protected' workaround now that we don't care about gcc 2.95 anymore.
Reid already did this for FunctionType, this just cleans the rest up.

llvm-svn: 32877
2007-01-04 17:50:42 +00:00
Chris Lattner 354a911b90 remove xfailed test that depends on obsolete argument to lli
llvm-svn: 32876
2007-01-04 17:47:42 +00:00
Reid Spencer 2c3d9e64b7 Remove a manual renaming of a variable that was introduced before
llvm-upgrade could properly handle collapsed type planes.

llvm-svn: 32875
2007-01-04 16:46:46 +00:00
Reid Spencer 3e628eb989 Clean up usage of "unsigned" and "signed" in the documentation to indicate
only that specific instructions regard their operands as signed and
unsigned not that the operands *are* signed or unsigned.

llvm-svn: 32874
2007-01-04 16:43:23 +00:00
Lauro Ramos Venancio 4464d208de Add test for constructor and destructor sections.
llvm-svn: 32873
2007-01-04 14:41:33 +00:00
Lauro Ramos Venancio 697f86bbe3 Add extload(i1) test.
llvm-svn: 32872
2007-01-04 14:27:21 +00:00
Lauro Ramos Venancio 8c45da0664 Add test for FCOPYSIGN.
llvm-svn: 32871
2007-01-04 14:24:32 +00:00
Lauro Ramos Venancio 7284073ec2 Expand SELECT (f32/f64) and FCOPYSIGN (f32/f64).
llvm-svn: 32870
2007-01-04 14:01:38 +00:00
Bill Wendling 4d95e91eca Removed reference to "cnull" because typical users shouldn't need to use
it.

llvm-svn: 32869
2007-01-04 08:38:04 +00:00
Chris Lattner 424d4dc713 ding dong llvm-gcc3 is dead
llvm-svn: 32868
2007-01-04 07:08:27 +00:00
Chris Lattner 13ce918505 gcc 4.1.1 on amd64 is broken
llvm-svn: 32867
2007-01-04 07:06:05 +00:00
Reid Spencer 6ff3e73db6 Death to useless bitcast instructions!
llvm-svn: 32866
2007-01-04 05:23:51 +00:00
Reid Spencer 438f562e56 Do not allow packed types for icmp and fcmp instructions.
llvm-svn: 32865
2007-01-04 05:22:18 +00:00
Reid Spencer 784ef79b55 icmp and fcmp do not take packed type operands.
llvm-svn: 32864
2007-01-04 05:19:58 +00:00
Reid Spencer 1434f95410 XFAIL this test until such time that code gen can handle a comparison of
packed types.

llvm-svn: 32863
2007-01-04 03:06:23 +00:00
Reid Spencer 494289f70e Regenerate.
llvm-svn: 32862
2007-01-04 02:57:52 +00:00
Reid Spencer 8a1be97a9e Disallow packed types in icmp/fcmp instructions. The code generator is
not prepared to handle them yet.

llvm-svn: 32861
2007-01-04 02:57:22 +00:00
Chris Lattner f96f4492e0 Now that setcondinst has been eliminated, we can mark Value::SubclassID
const and remove the ugly mutator methods.

llvm-svn: 32860
2007-01-04 02:15:37 +00:00
Chris Lattner 858f4e9362 fix typo
llvm-svn: 32859
2007-01-04 02:13:20 +00:00
Chris Lattner 806adafd95 Enable a couple xforms for packed vectors (undef | v) -> -1 for packed.
llvm-svn: 32858
2007-01-04 02:12:40 +00:00
Chris Lattner 26f13eb1f3 fix some bugs handling vectors, avoid host-specific handling of undefined shift results.
llvm-svn: 32857
2007-01-04 01:56:39 +00:00
Chris Lattner ecab54cfc0 Add a new ConstantPacked::getAllOnesValue method
llvm-svn: 32856
2007-01-04 01:49:26 +00:00
Devang Patel 2f0b276731 Enable new pass manager, which was accidentally disabled.
llvm-svn: 32855
2007-01-04 01:27:03 +00:00
Reid Spencer 836567a9d8 Add a test to ensure that we can assembly comparisons of packed values.
llvm-svn: 32854
2007-01-04 00:29:09 +00:00
Reid Spencer ca3d1cb840 Regenerate.
llvm-svn: 32853
2007-01-04 00:06:14 +00:00
Reid Spencer 4eda71eec1 Permit icmp and fcmp to have packed operands.
Make an error message a little more useful.

llvm-svn: 32852
2007-01-04 00:05:48 +00:00
Reid Spencer 6fb16b1bce Test @zext and @sext fully as well as testing the "short" call syntax.
llvm-svn: 32851
2007-01-04 00:03:37 +00:00
Reid Spencer 724ffc6cd0 Add a test case to test parameter attributes feature.
llvm-svn: 32850
2007-01-03 23:54:02 +00:00
Reid Spencer db879b6013 Update test cases that grepped for register names that have now changed
as a result of llvm-upgrade handling collapsed type planes better.

llvm-svn: 32849
2007-01-03 23:47:29 +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
Bill Wendling 4ec17c3951 The previous implementation of LLVM Streams wasn't removing symbols. This
one should.

llvm-svn: 32845
2007-01-03 22:37:27 +00:00
Reid Spencer bf671f17cb Fix a configure warning noticed by Duncan Sands.
llvm-svn: 32844
2007-01-03 20:59:52 +00:00
Reid Spencer b8f3fe8ec5 Remove the find_rule label from the output of flex. This will break any
use of the REJECT macro but we don't use it. This just hushes up a warning
in the presence of -Wno-unused.

llvm-svn: 32843
2007-01-03 19:56:14 +00:00
Chris Lattner f9cf05370f fix testcase. It's not safe to strictly evaluate a load that should be lazy.
llvm-svn: 32842
2007-01-03 19:12:31 +00:00
Chris Lattner 4889a7af36 Private labels start with .L on linux, not just .
llvm-svn: 32841
2007-01-03 18:16:48 +00:00
Reid Spencer e87b5e9825 Fix a comment that referred to the now defunct ubyte type.
llvm-svn: 32840
2007-01-03 17:24:59 +00:00
Reid Spencer fb4070521a Remove two useless bit casts.
llvm-svn: 32839
2007-01-03 17:24:11 +00:00
Reid Spencer 95c466a52b It is no longer permissible to have undefined types in function parameters.
Just fix it by defining the type as opaque.

llvm-svn: 32838
2007-01-03 17:03:48 +00:00
Reid Spencer 98fd5eb48c Fix this test case. It is no longer permissible to have undefined types
in function parameters. Fix by just defining the type as opaque.

llvm-svn: 32837
2007-01-03 17:01:18 +00:00
Reid Spencer e6f81876eb Legalizer doesn't do an ANY_EXTEND if we don't ask for one so make sure
that we default to an ANY_EXTEND if no parameter attribute is set on the
result value of a function.

llvm-svn: 32836
2007-01-03 16:49:33 +00:00
Jim Laskey 7601f2f36e NULL names should pass validation.
llvm-svn: 32835
2007-01-03 13:46:20 +00:00
Jim Laskey 751314fab9 Silence warning.
llvm-svn: 32834
2007-01-03 13:36:40 +00:00
Anton Korobeynikov 4efbbc963f Really big cleanup.
- New target type "mingw" was introduced
- Same things for both mingw & cygwin are marked as "cygming" (as in
gcc)
- .lcomm is supported here, so allow LLVM to use it
- Correctly use underscored versions of setjmp & _longjmp for both mingw
& cygwin

llvm-svn: 32833
2007-01-03 11:43:14 +00:00
Evan Cheng a50e3919b1 A bit more debugging printf's.
llvm-svn: 32832
2007-01-03 07:44:30 +00:00
Reid Spencer 2a34b91666 Restore previous behavior of defaulting to ZEXT. This works around two
things: (1) preventing PR1071 and (2) working around missing parameter
attributes for bool type. (2) will be fixed shortly. When PR1071 is fixed,
this patch should be undone.

llvm-svn: 32831
2007-01-03 05:03:05 +00:00
Reid Spencer 0917adf614 Two changes:
1. Switch expression and cases are compared signed and are sign extended.
2. For function results needing extended, do SIGN_EXTEND if the SExtAttribute
   is set and ZERO_EXTEND if the ZExtAttribute is set, otherwise just let
   the Legalizer do ANY_EXTEND.
This fixes the recent regression in kimwitu++ and probably the llvm-gcc
bootstrap issue we had today.

llvm-svn: 32830
2007-01-03 04:25:33 +00:00
Reid Spencer 791864c6a5 Clean up from recent changes. Comment the new parameter to ExpandLibCall.
Consolidate some lines of code and remove duplication.

llvm-svn: 32829
2007-01-03 04:22:32 +00:00
Reid Spencer a6fda18b13 Fix this test cases to use parameter attributes for its parameter and
result types. These tests are checking for sext behavior and it won't
happen unless requested with the parameter attribute.

llvm-svn: 32828
2007-01-03 04:20:23 +00:00
Jim Laskey c4ba9c161b Vectors are not supported by ConstantInt::getAllOnesValue.
llvm-svn: 32827
2007-01-03 00:11:03 +00:00
Reid Spencer ab2fccd9eb This test case previously passed the assembler without error even though
it used an undefined type name as a parameter argument. This bug in the
assembler has been fixed and it is now necessary to define the type.

llvm-svn: 32826
2007-01-02 21:56:26 +00:00
Reid Spencer 87622ae03d Regenerate.
llvm-svn: 32825
2007-01-02 21:54:12 +00:00
Reid Spencer 6130ae0000 Implement checking for unresolved types in the argument types and result
type of function definitions.
This fixes test/Regression/Assember/2007-01-02-Undefined-Arg-Type.ll

llvm-svn: 32824
2007-01-02 21:53:43 +00:00
Evan Cheng 74b46e8c05 Fix naming inconsistency.
llvm-svn: 32823
2007-01-02 21:33:40 +00:00
Evan Cheng 92484c2aa4 - Fixing naming inconsistency: calleesave -> calleesaved.
- Make use of spillCalleeSavedRegisters() and restoreCalleeSavedRegisters().

llvm-svn: 32822
2007-01-02 21:31:15 +00:00
Evan Cheng 07140c22c7 Fix naming inconsistency: calleesave -> calleesaved.
llvm-svn: 32821
2007-01-02 21:30:17 +00:00
Evan Cheng f43d679951 Add virtual method spillCalleeSaveRegisters() and restoreCalleeSaveRegisters()
to MRegisterInfo. These allow the target to issue instructions to spill and
restore callee saved registers in case where individual stores / loads aren't
the correct / profitable choice.

llvm-svn: 32820
2007-01-02 20:55:17 +00:00
Reid Spencer 42a1cb7c0c Add a test case for abstract parameter and result types in function
definitions. The assembler should produce an error on this input.

llvm-svn: 32819
2007-01-02 20:47:51 +00:00
Jim Laskey a131cf78ad PR1068 - Unbounded array debug info.
llvm-svn: 32818
2007-01-02 11:53:52 +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 e9da1b0ae0 For PR1070:
Tweak the RUN: lines of these tests to accommodate the renaming of
variables done by llvm-upgrade. The renaming occurs as a result of avoiding
name collisons for collapsed type planes. Conflicting names have a .u
(unsigned) or .s (signed) suffix added. This patch updates the grep
expression to accommodate the new names.

llvm-svn: 32815
2007-01-02 05:55:05 +00:00
Reid Spencer 9f7ab3a3cd For PR1070:
Revert previous patch now that llvm-upgrade can handle collapsed type
plane conversion properly.

llvm-svn: 32814
2007-01-02 05:53:06 +00:00
Reid Spencer 5b353d3116 Manually upgrade this test case to make sure that the new cast-to-bool
semantics are retained.

llvm-svn: 32813
2007-01-02 05:50:11 +00:00
Reid Spencer f8e060f589 For PR1070:
Add a test case to ensure that llvm-upgrade retains correct semantics
for the previous definition of "cast to bool" which compared against null.

llvm-svn: 32812
2007-01-02 05:48:32 +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 51397401ba Reverse last patch, committed by accident.
llvm-svn: 32809
2007-01-02 04:30:40 +00:00
Reid Spencer 8218de2f01 Fix this test case to be legal. There is no ubyte %tmp ever defined!
llvm-svn: 32808
2007-01-02 04:19:32 +00:00
Reid Spencer 45fe75d755 Add some convenience functions for getting the source and destination
types from any Cast instruction.

llvm-svn: 32807
2007-01-02 02:08:27 +00:00
Reid Spencer 7b25bf07af Back out last revision now that llvm-upgrade can remove useless bitcasts.
This serves as a test of that feature.

llvm-svn: 32806
2007-01-01 01:22:53 +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 e8a74ee5ea Fix a typo.
llvm-svn: 32803
2006-12-31 22:26:06 +00:00
Reid Spencer 62f3c0d57b Convert the intrinsic function definitions to use llvm_i32_ty instead of
llvm_uint_ty or llvm_int_ty. Similarly for i8, i16 and i64

llvm-svn: 32802
2006-12-31 22:24:55 +00:00
Reid Spencer 9cfa4e8459 Fix a cut-and-paste bug for processing of InvokeInst parameter attributes.
The lookup of parameter attributes was offset by two because of the
additional operands in an invoke instruction.

llvm-svn: 32801
2006-12-31 22:17:01 +00:00
Reid Spencer d0da3e200a Regenerate.
llvm-svn: 32800
2006-12-31 21:47:02 +00:00
Reid Spencer d6979030c1 Remove an extra semi-colon.
llvm-svn: 32799
2006-12-31 21:46:36 +00:00
Reid Spencer c90cf77367 Fix a bug in comparison of GEP indices.
llvm-svn: 32798
2006-12-31 21:43:30 +00:00
Reid Spencer 72ba499004 Remove documentation of non-existent cextcc and csretextcc calling
conventions as these have been replaced with parameter attributes.

llvm-svn: 32797
2006-12-31 21:30:18 +00:00
Reid Spencer 6829c25a3c Add a missing colon. Noticed by Jeff Cohen.
llvm-svn: 32796
2006-12-31 21:25:25 +00:00
Rafael Espindola fd68718467 implement missing compares
patch by Lauro
bug fixed by me

llvm-svn: 32795
2006-12-31 18:52:39 +00:00
Reid Spencer 4e746749de Fix a bug in getParamAttrs where an invalid value would be returned if the
index passed in was out of range for the number of parameter attributes set.

llvm-svn: 32794
2006-12-31 17:50:33 +00:00
Reid Spencer 655dcc6fce One more try on the table formatting.
llvm-svn: 32793
2006-12-31 07:20:23 +00:00
Reid Spencer 58c08716af Clean up some typos and formatting.
llvm-svn: 32792
2006-12-31 07:18:34 +00:00
Reid Spencer b5ebf3d667 For PR950:
Update for signless integer types:
1. Replace [us]byte with i8
2. Replace [u]short with i16
3. Replace [u]int   with i32
4. Replace [u]long  with i64
5. Document the "define" keyword and use it in all examples.
6. Document parameter attributes and how they affect function types.

llvm-svn: 32791
2006-12-31 07:07:53 +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 deb4d5ab46 For PR950:
Update the test suite to accommodate the change from signed integer types
to signless integer types. The changes were of only a few kinds:

1. Make sure llvm-upgrade is run on the source which does the bulk of the
   changes automatically.

2. Change things like "grep 'int'" to "grep 'i32'"

3. In several tests bitcasting caused the same name to be reused in the
   same type plane. These had to be manually fixed. The fix was (generally)
   to leave the bitcast and provide the instruction with a new name. This
   should not affect the semantics of the test. In a few cases, the
   bitcasts were known to be superfluous and irrelevant to the test case
   so they were removed.

4. One test case uses a bytecode file which needed to be updated to the
   latest bytecode format.

llvm-svn: 32789
2006-12-31 06:02:00 +00:00
Reid Spencer e63b6518fa For PR950:
Three changes:
1. Convert signed integer types to signless versions.
2. Implement the @sext and @zext parameter attributes. Previously the
   type of an function parameter was used to determine whether it should
   be sign extended or zero extended before the call. This information is
   now communicated via the function type's parameter attributes.
3. The interface to LowerCallTo had to be changed in order to accommodate
   the parameter attribute information. Although it would have been
   convenient to pass in the FunctionType itself, there isn't always one
   present in the caller. Consequently, a signedness indication for the
   result type and for each parameter was provided for in the interface
   to this method. All implementations were changed to make the adjustment
   necessary.

llvm-svn: 32788
2006-12-31 05:55:36 +00:00
Reid Spencer 0d54e78a39 For PR950:
Convert signed integer types to signless ones.

llvm-svn: 32787
2006-12-31 05:51:36 +00:00
Reid Spencer bc013ba367 For PR950:
Convert signed integer types to signless.

llvm-svn: 32786
2006-12-31 05:50:28 +00:00