Commit Graph

432 Commits

Author SHA1 Message Date
Reid Spencer
832254e1c2 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33776 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-02 02:16:23 +00:00
Chris Lattner
f7469af5a2 regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33696 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-31 04:44:08 +00:00
Chris Lattner
e013540654 eliminate a temporary vector
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33695 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-31 04:43:46 +00:00
Reid Spencer
5cbf985dcb For PR1136: Rename GlobalVariable::isExternal as isDeclaration to avoid
confusion with external linkage types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33663 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-30 20:08:39 +00:00
Anton Korobeynikov
9adeaa2f59 Regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33599 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-28 13:37:39 +00:00
Anton Korobeynikov
b10308e440 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33597 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-28 13:31:35 +00:00
Reid Spencer
41dff5e4f7 Regenerate for PR645 and PR761
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33525 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-26 08:05:27 +00:00
Reid Spencer
b2d1786090 For PR645:
Implement separation of local and global symbols. Local symbols and types
now use % prefix. Global variables and functions now use @ prefix.

For PR761:
Replace:
  target endian =
  target pointersize =
With:
  target datalayout =


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33524 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-26 08:04:51 +00:00
Jeff Cohen
361c3efd9a Fix this error:
llvm[2]: Compiling llvmAsmParser.cpp for Debug build
/usr/home/jeffc/llvm/lib/AsmParser/llvmAsmParser.y: In function 'int llvmAsmparse()':
/usr/home/jeffc/llvm/lib/AsmParser/llvmAsmParser.y:1846: error: expected `;' before '}' token


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33425 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-21 19:19:31 +00:00
Reid Spencer
b0fcf8fe8f Regenerate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33284 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-17 02:48:45 +00:00
Reid Spencer
93947c3985 For PR1117:
Make the assembler generate a nice error message if a bad cast instruction
is attempted instead of asserting out. This is made possible by the
recently exposed method CastInst::castIsValid() which checks the validity
of any cast instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33283 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-17 02:47:33 +00:00
Chris Lattner
42a7551725 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! :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33225 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-15 02:27:26 +00:00
Chris Lattner
b25c4ca9d8 regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33224 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-15 02:12:07 +00:00
Chris Lattner
3fa0ba7b32 allow i1 to operators like shift and add.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33221 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-15 02:00:29 +00:00
Reid Spencer
6f40790252 Regenerate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33182 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-13 05:00:46 +00:00
Reid Spencer
8088e9dfb4 Bye bye bool. AsmWriter doesn't generate it any more so AsmParser shouldn't
read it any more. This is consistent with the new IR as well.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33181 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-13 05:00:20 +00:00
Anton Korobeynikov
178a352079 Regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33137 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 19:22:51 +00:00
Anton Korobeynikov
7f70559bc4 * 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)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33136 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 19:20:47 +00:00
Chris Lattner
0fab59c7af regenerate
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33131 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 18:33:30 +00:00
Chris Lattner
89282b8fe7 This production is dead, the lexer can never return 'NOT'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33130 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 18:32:39 +00:00
Reid Spencer
4db2063eee Regenerate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33117 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 07:28:27 +00:00
Reid Spencer
c25a9b9102 Integer type names need 1 or more digits, not zero or more.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33116 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 07:27:59 +00:00
Reid Spencer
a54b7cbd45 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33113 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 07:05:14 +00:00
Reid Spencer
4fe16d607d Rename BoolTy as Int1Ty. Patch by Sheng Zhou.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33076 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 18:21:29 +00:00
Zhou Sheng
6b6b6ef167 For PR1043:
Merge ConstantIntegral and ConstantBool into ConstantInt.
Remove ConstantIntegral and ConstantBool from LLVM.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33073 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 12:24:14 +00:00
Andrew Lenharth
1acc5a4e87 Make packed structs use packed initialiers for consistency
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33015 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-08 18:16:47 +00:00
Reid Spencer
78d033e086 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32956 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-06 07:24:44 +00:00
Reid Spencer
63c3445cfe Regenerate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32934 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-05 21:51:07 +00:00
Reid Spencer
90e2f63151 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32933 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-05 21:50:38 +00:00
Reid Spencer
218ded2fc9 Regenerate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32905 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-05 17:07:23 +00:00
Reid Spencer
2c261789d3 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32904 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-05 17:06:19 +00:00
Reid Spencer
ac4a1dd7fa Regenerate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32862 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-04 02:57:52 +00:00
Reid Spencer
539b471a33 Disallow packed types in icmp/fcmp instructions. The code generator is
not prepared to handle them yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32861 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-04 02:57:22 +00:00
Reid Spencer
e68853be66 Regenerate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32853 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-04 00:06:14 +00:00
Reid Spencer
b4fdfdb882 Permit icmp and fcmp to have packed operands.
Make an error message a little more useful.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32852 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-04 00:05:48 +00:00
Reid Spencer
8c8a2dc467 Regenerate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32825 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-02 21:54:12 +00:00
Reid Spencer
98b3c5c2c0 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32824 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-02 21:53:43 +00:00
Reid Spencer
c6c59fd89f Regenerate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32800 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-31 21:47:02 +00:00
Reid Spencer
e03969f816 Remove an extra semi-colon.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32799 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-31 21:46:36 +00:00
Reid Spencer
71305d760e Add a missing colon. Noticed by Jeff Cohen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32796 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-31 21:25:25 +00:00
Reid Spencer
1431061ebb For PR950:
Regenerate


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32782 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-31 05:40:51 +00:00
Reid Spencer
e1553cc956 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) { ... }


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32781 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-31 05:40:12 +00:00
Reid Spencer
6fd36abf5e Regenerate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32772 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-29 20:35:03 +00:00
Reid Spencer
b951bc0283 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32770 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-29 20:29:48 +00:00
Reid Spencer
e4d87aa2de 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32751 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-23 06:05:41 +00:00
Reid Spencer
9ffad0a43f Allow negative constants for unsigned integers and unsigned constants
greater than MAX_INT64 for signed integers. This is now valid and is just
waiting for the distinction between signed and unsigned to go away.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32716 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-20 17:20:09 +00:00
Andrew Lenharth
6353e05f4f Hopefully these are the regenerated files
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32362 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-08 18:07:09 +00:00
Andrew Lenharth
38ecbf18eb Packed Structures
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32361 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-08 18:06:16 +00:00
Bill Wendling
e81561909d Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, are
now cerr, cout, and NullStream resp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32298 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 01:30:32 +00:00
Reid Spencer
b25389c67d Regenerate.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32246 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-05 23:50:48 +00:00