1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
Commit Graph

16798 Commits

Author SHA1 Message Date
Reid Spencer
6468d49755 Move a function out of line.
llvm-svn: 33158
2007-01-12 23:30:31 +00:00
Chris Lattner
657e08b994 remove over-general code.
llvm-svn: 33157
2007-01-12 23:28:32 +00:00
Chris Lattner
5011520dda remove unneeded special case for bool
llvm-svn: 33156
2007-01-12 23:26:17 +00:00
Chris Lattner
996f22b99b Eliminate a log(n) lookup
llvm-svn: 33155
2007-01-12 23:23:08 +00:00
Reid Spencer
09efdecc2d Adjust #includes to compensate for lost of DerivedTypes.h in
TargetLowering.h

llvm-svn: 33154
2007-01-12 23:22:14 +00:00
Reid Spencer
baff834435 Add a new home for TargetLowering member functions.
llvm-svn: 33152
2007-01-12 23:18:18 +00:00
Chris Lattner
bc884d406d remove obsolete fixme
llvm-svn: 33151
2007-01-12 22:52:50 +00:00
Chris Lattner
7cfcfbb801 simplify some code
llvm-svn: 33150
2007-01-12 22:51:20 +00:00
Evan Cheng
e2a6d79cad Minor fix.
llvm-svn: 33149
2007-01-12 22:51:10 +00:00
Chris Lattner
48ec71f551 Remove over-general comparisons
llvm-svn: 33147
2007-01-12 22:49:11 +00:00
Jim Laskey
ee29cc6016 Allow isAllOnesValue testing on packed constants
llvm-svn: 33146
2007-01-12 22:39:14 +00:00
Lauro Ramos Venancio
14cf9f2c03 Don't add or sub zero to sp.
llvm-svn: 33142
2007-01-12 20:52:27 +00:00
Lauro Ramos Venancio
97e120a71c Build constants using instructions mov/orr or mvn/eor.
llvm-svn: 33141
2007-01-12 20:35:49 +00:00
Devang Patel
347efe4ce7 s/addPassToManager/add/g
llvm-svn: 33138
2007-01-12 20:07:16 +00:00
Anton Korobeynikov
ea90b2409f Regenerate
llvm-svn: 33137
2007-01-12 19:22:51 +00:00
Anton Korobeynikov
548b9af9c2 * PIC codegen for X86/Linux has been implemented
* PIC-aware internal structures in X86 Codegen have been refactored
* Visibility (default/weak) has been added
* Docs fixes (external weak linkage, visibility, formatting)

llvm-svn: 33136
2007-01-12 19:20:47 +00:00
Devang Patel
9afb283500 Move PMTopLevelManager, PMDataManager and FPPassManger classes into
new PassManagers.h header.

This opens door for implementing CGPassManager in IPA library.

llvm-svn: 33135
2007-01-12 18:52:44 +00:00
Chris Lattner
cb66b7721a Remove a bunch of duplicated code. Among other things, this fixes
constant folding of signed comparisons of bool.

llvm-svn: 33134
2007-01-12 18:42:52 +00:00
Chris Lattner
18fa0e53fa eliminate redundant check
llvm-svn: 33132
2007-01-12 18:35:11 +00:00
Chris Lattner
cee2f2e618 regenerate
llvm-svn: 33131
2007-01-12 18:33:30 +00:00
Chris Lattner
b2fb78205f This production is dead, the lexer can never return 'NOT'
llvm-svn: 33130
2007-01-12 18:32:39 +00:00
Chris Lattner
115b9b1a2b Branch conditions must be i1
llvm-svn: 33129
2007-01-12 18:30:11 +00:00
Chris Lattner
39030b8d42 don't discriminate against bool
llvm-svn: 33128
2007-01-12 18:28:58 +00:00
Chris Lattner
be3dff7815 remove unneeded special cases
llvm-svn: 33127
2007-01-12 18:23:49 +00:00
Chris Lattner
c5a3d1064e GEP operands can't be bools
llvm-svn: 33125
2007-01-12 18:20:48 +00:00
Chris Lattner
e0b9a74157 Simplify code
llvm-svn: 33123
2007-01-12 18:15:09 +00:00
Devang Patel
dc1430cb98 Remove dead code.
llvm-svn: 33121
2007-01-12 17:23:48 +00:00
Reid Spencer
6a286c69bd Regenerate.
llvm-svn: 33117
2007-01-12 07:28:27 +00:00
Reid Spencer
93f4aedbbb Integer type names need 1 or more digits, not zero or more.
llvm-svn: 33116
2007-01-12 07:27:59 +00:00
Reid Spencer
eeb33c0716 Always write 1 bit integers as i1 not "bool".
llvm-svn: 33115
2007-01-12 07:25:20 +00:00
Evan Cheng
0241c4a0b5 Comment.
llvm-svn: 33114
2007-01-12 07:25:16 +00:00
Reid Spencer
373d2bccea 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
Reid Spencer
3d986f6487 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
Evan Cheng
032a597692 Store default libgcc routine names and allow them to be redefined by target.
llvm-svn: 33105
2007-01-12 02:11:51 +00:00
Nick Lewycky
8229bc7c80 If we know that it's a constant being casted, propagate through the cast
instruction. Doesn't work the other way though (can't recover bits that
have been truncated).

llvm-svn: 33104
2007-01-12 01:23:53 +00:00
Nick Lewycky
8f02993e38 Clean up logic after ConstantBool removal.
llvm-svn: 33096
2007-01-12 00:02:12 +00:00
Devang Patel
da5ae651e9 Start using PMStack. Now each pass is responsibe for assinging
a pass manager for itself.

There is some opportunity to remove some dead code from PassManager.cpp.

llvm-svn: 33087
2007-01-11 22:15:30 +00:00
Devang Patel
5f5c0486fb Use getPassManagerType() instead of dynamic_cast.
llvm-svn: 33078
2007-01-11 19:59:06 +00:00
Reid Spencer
f3265181e2 Rename BoolTy as Int1Ty. Patch by Sheng Zhou.
llvm-svn: 33076
2007-01-11 18:21:29 +00:00
Zhou Sheng
17235b194b Remove unnecessary boolean type check.
llvm-svn: 33075
2007-01-11 14:38:17 +00:00
Zhou Sheng
23d24526b2 For PR1043:
Merge ConstantIntegral and ConstantBool into ConstantInt.
Remove ConstantIntegral and ConstantBool from LLVM.

llvm-svn: 33073
2007-01-11 12:24:14 +00:00
Zhou Sheng
7c83700514 Fixed indentation.
llvm-svn: 33072
2007-01-11 10:33:26 +00:00
Reid Spencer
c511274dc1 Shut up a warning about signed/unsigned.
llvm-svn: 33071
2007-01-11 07:58:19 +00:00
Chris Lattner
6fee172493 simplify some logic further
llvm-svn: 33069
2007-01-11 04:30:21 +00:00
Chris Lattner
3147621368 Recommit my previous patch with a bugfix: printInfoComment works on both
local and global values.

llvm-svn: 33068
2007-01-11 03:54:27 +00:00
Nick Lewycky
fad35ab64a Quiet compiler warning. The only reason the function is marked virtual
is so that it can be called from inside a debugger.

llvm-svn: 33067
2007-01-11 02:38:21 +00:00
Nick Lewycky
7fb0a6d2ab New predicate simplifier!
Please do not enable, there is still some known miscompile problem.

llvm-svn: 33066
2007-01-11 02:32:38 +00:00
Devang Patel
e485c421c1 Add PassManagerType enum.
llvm-svn: 33065
2007-01-11 01:10:25 +00:00
Reid Spencer
0f61503a7e Avoid taking the address of a macro by checking to see if stdin is defined
or not. This allows DynamicLibrary.cpp to compile on Darwin.

llvm-svn: 33064
2007-01-11 00:35:10 +00:00
Reid Spencer
12c2bdcc62 Implement better constant folding of unordered FCMP predicates.
llvm-svn: 33063
2007-01-11 00:25:45 +00:00
Devang Patel
a0b4424ed4 Robustify assingPassManager() for Module, Function and Basic Block
Passes.

Robustify PMStack.push()

Add dump() routine to print PMStack.

llvm-svn: 33062
2007-01-11 00:19:00 +00:00
Reid Spencer
94ddfbe8b8 Allow LLI, in interpreter mode, to find stdin, stdout, and stderr. This is
a bit of a hack but it lets some of the llvm-test programs run.

llvm-svn: 33058
2007-01-10 19:50:43 +00:00
Reid Spencer
d6ed2499db Back out the last patch which is a nightly test killer. The assertion
in getLocalSlot fires on many, many values. It broke nearly all of
the dejagnu tests. Simple changes to the assertion did not fix the
problem.

llvm-svn: 33054
2007-01-10 09:18:16 +00:00
Chris Lattner
bf6aebe720 Last refactoring before PR645: split up getSlot into getLocalSlot and getGlobalSlot.
No functionality change.

llvm-svn: 33053
2007-01-10 07:01:46 +00:00
Chris Lattner
6ee5a4d0d2 eliminate some iterator gymnastics.
llvm-svn: 33052
2007-01-10 06:43:26 +00:00
Reid Spencer
e6d962e729 Change the file header name as this file was renamed.
llvm-svn: 33051
2007-01-10 04:17:32 +00:00
Reid Spencer
b808cbe40b Rename Writer.cpp as CBackend.cpp so it doesn't conflict with Writer.cpp
in the bytecode writer library. This helps with debugging.

llvm-svn: 33050
2007-01-10 04:16:17 +00:00
Chris Lattner
441127f582 Fix a bug in heap-sra that caused compilation failure of office-ispell.
llvm-svn: 33043
2007-01-09 23:29:37 +00:00
Reid Spencer
b4f3c47095 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
af73545299 Inline insertValue into CreateModuleSlot/CreateFunctionSlot
llvm-svn: 33038
2007-01-09 08:04:59 +00:00
Chris Lattner
ef3e9a5ea1 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
ee67a96b5d 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
88c55c3483 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
76d79c7040 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
Evan Cheng
6829d12846 Naming consistency.
llvm-svn: 33026
2007-01-08 23:55:53 +00:00
Evan Cheng
6cba4e114e 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
0f765fae89 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
Jim Laskey
8cc5a0d2fe Need to handle static declarations properly.
llvm-svn: 33022
2007-01-08 22:15:18 +00:00
Jeff Cohen
2bfbf6b99c Unbreak VC++ build.
llvm-svn: 33021
2007-01-08 20:17:17 +00:00
Reid Spencer
96ebce2eda 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
Devang Patel
e0b89a869d 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
Andrew Lenharth
31e7a82bea And asm writing for packed struct initializers
llvm-svn: 33016
2007-01-08 18:21:30 +00:00
Andrew Lenharth
55be52f117 Make packed structs use packed initialiers for consistency
llvm-svn: 33015
2007-01-08 18:16:47 +00:00
Reid Spencer
c857bb0b27 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
405e204fb3 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
1f80d735e2 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
Reid Spencer
1a8a0762a5 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
Reid Spencer
d876f05c66 Fix a bug in an assert that would never trigger.
llvm-svn: 33005
2007-01-08 05:34:39 +00:00
Reid Spencer
372c53dfbf Convert uses of getPrimitiveSize that should be getPrimitiveSizeInBits.
llvm-svn: 33003
2007-01-08 01:26:33 +00:00
Reid Spencer
74e4297a4c Types should be const.
llvm-svn: 33001
2007-01-07 21:45:41 +00:00
Chris Lattner
cd53253271 this pass is unused
llvm-svn: 32998
2007-01-07 18:12:43 +00:00
Chris Lattner
3e42a4147a llvm 2.0 doesn't support llvm.isunordered.*
llvm-svn: 32994
2007-01-07 08:52:43 +00:00
Chris Lattner
b6f6d3a00c remove support for llvm.isunordered
llvm-svn: 32992
2007-01-07 08:37:22 +00:00
Chris Lattner
ce03b9209c remove llvm.isunordered
llvm-svn: 32991
2007-01-07 08:19:47 +00:00
Chris Lattner
aa5051ae7f 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
fed811a032 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
Chris Lattner
a2f5c06174 prepare for adjustment to getOrInsertFunction method
llvm-svn: 32985
2007-01-07 07:54:34 +00:00
Chris Lattner
a62936ee6f relax type
llvm-svn: 32983
2007-01-07 07:24:32 +00:00
Chris Lattner
a966510e59 relax some types
llvm-svn: 32982
2007-01-07 07:22:20 +00:00
Chris Lattner
3e1aa998fb relax types
llvm-svn: 32981
2007-01-07 06:59:47 +00:00
Chris Lattner
e7017c4ccf relax some types
llvm-svn: 32980
2007-01-07 06:58:05 +00:00
Chris Lattner
5786d6f58e remove support for old-style varargs upgrading
llvm-svn: 32979
2007-01-07 06:45:57 +00:00
Reid Spencer
9fae72ee14 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
b76478fd3d 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
adc6319e45 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
e7eca26371 add -debug output for -indvars.
llvm-svn: 32971
2007-01-07 01:14:12 +00:00
Anton Korobeynikov
874aaaa34a As PR1085 was fixed, back out workaround
llvm-svn: 32969
2007-01-07 00:41:20 +00:00
Chris Lattner
051f1b7f78 wow, the link was already broken :)
llvm-svn: 32963
2007-01-06 23:20:51 +00:00
Chris Lattner
94f6358ce0 add a note
llvm-svn: 32962
2007-01-06 23:19:38 +00:00
Chris Lattner
a346ea7b29 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
808722cded 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
fdd778278f 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
cdaf88ff9d 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
Chris Lattner
7a0046dc65 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
3155b15453 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
9691941c37 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
176b690f07 no need to worry about int vs uint any more.
llvm-svn: 32946
2007-01-06 01:37:35 +00:00
Chris Lattner
aed0e0292b new note
llvm-svn: 32945
2007-01-06 01:30:45 +00:00
Evan Cheng
5ba049eabf setSetCCIsExpensive is gone.
llvm-svn: 32941
2007-01-05 23:42:53 +00:00
Evan Cheng
d378a229c5 Expand fcopysign to the bitwise sequence if select is marked as expensive.
llvm-svn: 32940
2007-01-05 23:33:44 +00:00
Devang Patel
c1627f6538 1) Remove old AnalysisResolver.
2) Rename AnalysisResolver_New as AnalysisResolver

llvm-svn: 32938
2007-01-05 22:47:07 +00:00
Reid Spencer
3e9aba042b Regenerate.
llvm-svn: 32934
2007-01-05 21:51:07 +00:00
Reid Spencer
6cec5bdd1c 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
df277336b8 - 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
Evan Cheng
cb71f273ff 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
237ec557ae 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
c5a284c3c6 Remove PassManagerT.h
llvm-svn: 32928
2007-01-05 20:21:13 +00:00
Devang Patel
fcddd83bfc Remove old pass manager.
llvm-svn: 32927
2007-01-05 20:16:23 +00:00
Reid Spencer
a6f1f11d07 Regenerate.
llvm-svn: 32905
2007-01-05 17:07:23 +00:00
Reid Spencer
4f14887126 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
Evan Cheng
c273c9c830 Typo
llvm-svn: 32902
2007-01-05 08:32:24 +00:00
Evan Cheng
bcf3d2bd15 With SSE2, expand FCOPYSIGN to a series of SSE bitwise operations.
llvm-svn: 32900
2007-01-05 07:55:56 +00:00
Chris Lattner
6cef95214b Implement InstCombine/vec_shuffle.ll:%test7, simplifying shuffles with
undef operands.

llvm-svn: 32899
2007-01-05 07:36:08 +00:00
Chris Lattner
79238a345b 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
f02fdf92a2 Compile X + ~X to -1. This implements Instcombine/add.ll:test34
llvm-svn: 32890
2007-01-05 02:17:46 +00:00
Evan Cheng
8d09e52569 GEP subscript is interpreted as a signed value.
llvm-svn: 32888
2007-01-05 01:46:20 +00:00
Chris Lattner
45c7c69c77 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
Evan Cheng
7674a71585 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
Lauro Ramos Venancio
078b85bdaa Expand SELECT (f32/f64) and FCOPYSIGN (f32/f64).
llvm-svn: 32870
2007-01-04 14:01:38 +00:00
Reid Spencer
dd9d393e32 Death to useless bitcast instructions!
llvm-svn: 32866
2007-01-04 05:23:51 +00:00
Reid Spencer
4b18100144 Do not allow packed types for icmp and fcmp instructions.
llvm-svn: 32865
2007-01-04 05:22:18 +00:00
Reid Spencer
d74df01f8b Regenerate.
llvm-svn: 32862
2007-01-04 02:57:52 +00:00
Reid Spencer
6d0c49f6bd 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
29a821859e 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
5eca81644b fix typo
llvm-svn: 32859
2007-01-04 02:13:20 +00:00
Chris Lattner
06b8d30502 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
793a771c59 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
d9342d1db3 Add a new ConstantPacked::getAllOnesValue method
llvm-svn: 32856
2007-01-04 01:49:26 +00:00
Reid Spencer
878c466bf4 Regenerate.
llvm-svn: 32853
2007-01-04 00:06:14 +00:00
Reid Spencer
bde43a8222 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
Bill Wendling
05f7a367a2 The previous implementation of LLVM Streams wasn't removing symbols. This
one should.

llvm-svn: 32845
2007-01-03 22:37:27 +00:00
Chris Lattner
aaafc3d16b 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
a3f7277e2e Private labels start with .L on linux, not just .
llvm-svn: 32841
2007-01-03 18:16:48 +00:00
Reid Spencer
c2da5d3d97 Fix a comment that referred to the now defunct ubyte type.
llvm-svn: 32840
2007-01-03 17:24:59 +00:00
Reid Spencer
741b64d1ca Remove two useless bit casts.
llvm-svn: 32839
2007-01-03 17:24:11 +00:00
Reid Spencer
20d9040d17 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
4308b27af2 NULL names should pass validation.
llvm-svn: 32835
2007-01-03 13:46:20 +00:00
Jim Laskey
c0dfc41747 Silence warning.
llvm-svn: 32834
2007-01-03 13:36:40 +00:00
Anton Korobeynikov
2b39939053 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
Reid Spencer
87c68ceb32 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
92c52fe025 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
206bcb64c1 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
Jim Laskey
06f1a4227e Vectors are not supported by ConstantInt::getAllOnesValue.
llvm-svn: 32827
2007-01-03 00:11:03 +00:00
Reid Spencer
dac232ab56 Regenerate.
llvm-svn: 32825
2007-01-02 21:54:12 +00:00
Reid Spencer
e2e6789b50 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
bd6a333b52 Fix naming inconsistency.
llvm-svn: 32823
2007-01-02 21:33:40 +00:00
Evan Cheng
09bcc91be2 - Fixing naming inconsistency: calleesave -> calleesaved.
- Make use of spillCalleeSavedRegisters() and restoreCalleeSavedRegisters().

llvm-svn: 32822
2007-01-02 21:31:15 +00:00
Reid Spencer
7eeddcbe43 Fix a typo.
llvm-svn: 32803
2006-12-31 22:26:06 +00:00
Reid Spencer
45bed286fa 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
4d8fdf20cc Regenerate.
llvm-svn: 32800
2006-12-31 21:47:02 +00:00
Reid Spencer
0579e58c4b Remove an extra semi-colon.
llvm-svn: 32799
2006-12-31 21:46:36 +00:00
Reid Spencer
670dd05e78 Fix a bug in comparison of GEP indices.
llvm-svn: 32798
2006-12-31 21:43:30 +00:00
Reid Spencer
067487a8f8 Add a missing colon. Noticed by Jeff Cohen.
llvm-svn: 32796
2006-12-31 21:25:25 +00:00
Rafael Espindola
d1baea3471 implement missing compares
patch by Lauro
bug fixed by me

llvm-svn: 32795
2006-12-31 18:52:39 +00:00
Reid Spencer
32825eb0bf 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
dda168599d 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
a3ebd9757c For PR950:
Convert signed integer types to signless ones.

llvm-svn: 32787
2006-12-31 05:51:36 +00:00
Reid Spencer
0fb7fa82d4 For PR950:
This patch replaces signed integer types with signless ones:
1. [US]Byte -> Int8
2. [U]Short -> Int16
3. [U]Int   -> Int32
4. [U]Long  -> Int64.
5. Removal of isSigned, isUnsigned, getSignedVersion, getUnsignedVersion
   and other methods related to signedness. In a few places this warranted
   identifying the signedness information from other sources.

llvm-svn: 32785
2006-12-31 05:48:39 +00:00
Reid Spencer
931386421e For PR950:
Update for signless integer types and parameter attribute implementation.
Of significant note:
  1. This changes the bytecode format yet again.
  2. There are 1/2 as many integer type planes (this is a good thing)
  3. GEP indices now use only 1 bit to identify their type which means
     more GEP instructions won't be relegated to format 0 (size win)
  4. Parameter attributes are implemented but currently being stored
     verbosely for each function type. Some other day this needs to be
     optimized for size.

llvm-svn: 32783
2006-12-31 05:44:24 +00:00
Reid Spencer
55be342ed9 For PR950:
Regenerate

llvm-svn: 32782
2006-12-31 05:40:51 +00:00
Reid Spencer
220b9a99f3 For PR950:
Major reorganization. This patch introduces the signedness changes for
the new integer types (i8, i16, i32, i64) which replace the old signed
versions (ubyte, sbyte, ushort, short, etc). This patch also implements
the function type parameter attributes feature. Together these conspired
to introduce new reduce/reduce errors into the grammar. Consequently, it
was necessary to introduce a new keyword into the grammar in order to
disambiguate. Without this, yacc would make incorrect shift/reduce and
reduce/reduce decisions and fail to parse the intended assembly.

Changes in assembly:

1. The "implementation" keyword is superfluous but still supported. You
   can use it as a sentry which will ensure there are no remaining up
   reference types. However, this is optional as those checks are also
   performed elsewhere.

2. Parameter attributes are now implemented using an at sign to
   indicate the attribute. The attributes are placed after the type
   in a function declaration or after the argument value in a function
   call. For example:
      i8 @sext %myfunc(i16 @zext)
      call i8 @sext %myfunc(i16 @zext %someVal)
   The facility is available for supporting additional attributes and
   they can be combined using the @(attr1,attr2,attr3) syntax. Right
   now  the only two supported are @sext and @zext

3. Functions must now be defined with the "define" keyword which is
   analagous to the "declare" keyword for function declarations. The
   introduction of this keyword disambiguates situations where a
   named result type is confused with a new type or gvar definition.
   For example:
      %MyType = type i16
      %MyType %func(%MyType) { ... }
   With the introduction of optional parameter attributes between
   the function name and the function result type, yacc will pick
   the wrong rule to reduce unless it is disambiguated with "define"
   before the function definition, as in:
      define %MyType @zext %func(%MyType %someArg) { ... }

llvm-svn: 32781
2006-12-31 05:40:12 +00:00
Reid Spencer
0e961ea8f7 For PR950:
Change signed integer type names to unsigned equivalents.

llvm-svn: 32780
2006-12-31 05:26:44 +00:00
Reid Spencer
af0921c568 For PR950:
Implement signless integer types and FunctionType parameter attributes.

llvm-svn: 32779
2006-12-31 05:25:34 +00:00
Reid Spencer
ba137437bf For PR950:
* Change integer type name from signed to signless
* Implement printing of FunctionType parameter attributes.

llvm-svn: 32778
2006-12-31 05:24:50 +00:00
Reid Spencer
0c70732d9d Regenerate.
llvm-svn: 32772
2006-12-29 20:35:03 +00:00
Reid Spencer
38002bb037 For PR950:
Remove all grammar conflicts from assembly parsing.  This change involves:
1. Making the "type" keyword not a primitive type (removes several
   reduce/reduce conflicts)
2. Being more specific about which linkage types are allowed for functions
   and global variables. In particular "appending" can no longer be
   specified for a function. A differentiation was made between the various
   internal and external linkage types.
3. Introduced the "define" keyword which is now required when defining a
   function. This disambiguates several cases where a named function return
   type could get confused with the definition of a new type. Using the
   keyword eliminates all shift/reduce conflicts and the remaining
   reduce/reduce conflicts.

These changes are necessary to implement the function parameter attributes
that will be introduced soon. Adding the function parameter attributes in
the presence of the shift/reduce and reduce/reduce conflicts led to severe
ambiguities that caused the parser to report syntax errors that needed to
be resolved. This patch resolves them.

llvm-svn: 32770
2006-12-29 20:29:48 +00:00
Rafael Espindola
16af307d42 fix comment
llvm-svn: 32767
2006-12-29 14:28:12 +00:00
Lauro Ramos Venancio
c87ce8ee4b Define StaticCtorsSection and StaticDtorsSection for ARM.
llvm-svn: 32763
2006-12-28 13:13:00 +00:00
Lauro Ramos Venancio
7bfe536783 Implement SELECT_CC (f32/f64) for ARM.
llvm-svn: 32762
2006-12-28 13:11:14 +00:00
Rafael Espindola
da5b9584ce remove duplicated line
bug noticed by Lauro

llvm-svn: 32761
2006-12-28 12:51:40 +00:00
Lauro Ramos Venancio
2cde823f98 This patch defines extloadi1 and fixes an internal compiler error on
arm.

llvm-svn: 32760
2006-12-26 19:30:42 +00:00
Reid Spencer
5c1e9c39ef Cleanup ConstantFoldCompareInstruction:
1. Make the arguments const like the other ConstantFold* functions.
2. Clean up evaluateFCmpRelation so it makes sense for floating point.
3. Implement the use of evaluateFCmpRelation to fold floating point CEs
4. Shorten a variable name so more things fit on one line.
5. Fix various comments.

llvm-svn: 32759
2006-12-24 18:52:08 +00:00
Reid Spencer
8d3b67ce23 Fix some comments.
llvm-svn: 32758
2006-12-24 18:42:29 +00:00
Reid Spencer
66a349efb1 For PR1066:
Fix this by ensuring that a bitcast is inserted to do sign switching. This
is only temporarily needed as the merging of signed and unsigned is next
on the SignlessTypes plate.

llvm-svn: 32757
2006-12-24 00:40:59 +00:00
Reid Spencer
a4415de894 Shut up some compilers that can't accurately analyze variable usage
correctly and emit "may be used uninitialized" warnings.

llvm-svn: 32756
2006-12-23 19:17:57 +00:00
Reid Spencer
c9426f9566 For PR1065:
Don't allow CmpInst instances to be processed in FoldSelectOpOp because
you can't easily swap their operands.

llvm-svn: 32753
2006-12-23 18:58:04 +00:00
Reid Spencer
13d15a94aa Don't overload var names.
llvm-svn: 32752
2006-12-23 10:21:26 +00:00
Reid Spencer
4428c3483b For PR950:
This patch removes the SetCC instructions and replaces them with the ICmp
and FCmp instructions. The SetCondInst instruction has been removed and
been replaced with ICmpInst and FCmpInst.

llvm-svn: 32751
2006-12-23 06:05:41 +00:00
Chris Lattner
456861c115 add a simple fast-path for dead allocas
llvm-svn: 32750
2006-12-22 23:14:42 +00:00
Devang Patel
e01677db41 ModulePass and ImmutablePass. Force out of line virtual method.
llvm-svn: 32748
2006-12-22 22:49:00 +00:00
Anton Korobeynikov
3a6faf0b96 Refactored JIT codegen for mingw32. Now we're using standart relocation
type for distinguish JIT & non-JIT instead of "dirty" hacks :)

llvm-svn: 32745
2006-12-22 22:29:05 +00:00
Jim Laskey
7ee1bda593 Need to walk the derived chain of typedefs to get actual size.
llvm-svn: 32744
2006-12-22 20:03:42 +00:00
Evan Cheng
a70d66df55 Debug dump error.
llvm-svn: 32743
2006-12-22 02:04:05 +00:00
Chris Lattner
f04c00f475 add a note
llvm-svn: 32741
2006-12-22 01:03:22 +00:00
Chris Lattner
fd16bf61d8 Fix for ARM weak symbols, patch by Lauro Ramos Venancio!
llvm-svn: 32740
2006-12-21 22:59:58 +00:00
Jim Laskey
80eeff2d0d Changes from Nick Lewycky with a simplified PPCTargetAsmInfo.
llvm-svn: 32735
2006-12-21 20:26:09 +00:00
Reid Spencer
3dc538fe7c Just print integer constants as signed values. The actual signedness
doesn't matter as it is determined in the way the constant is used.

llvm-svn: 32733
2006-12-21 19:04:23 +00:00
Reid Spencer
bf23c40f9f Add a FIXME about signedness.
llvm-svn: 32732
2006-12-21 18:59:16 +00:00
Reid Spencer
66611d3e06 Simplify all the casting business and get rid of isSigned().
llvm-svn: 32731
2006-12-21 08:28:31 +00:00
Reid Spencer
7f2fd86692 Remove isSigned calls via foreknowledge of main's argument types.
llvm-svn: 32730
2006-12-21 07:49:49 +00:00