Commit Graph

28884 Commits

Author SHA1 Message Date
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
Reid Spencer c635f47d9a 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 be5fd4a771 For PR950:
Don't attempt to parse both the old and new grammars. It is near impossible
to get it right. Remove support for the new define keyword and don't
attempt to insert parameter attributes because there isn't enough
contextual information for it.

llvm-svn: 32784
2006-12-31 05:45:57 +00:00
Reid Spencer b46895bc1f 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 42f0cbe769 For PR950:
Regenerate

llvm-svn: 32782
2006-12-31 05:40:51 +00:00
Reid Spencer fa35bb3e20 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 8d9336d065 For PR950:
Change signed integer type names to unsigned equivalents.

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

llvm-svn: 32779
2006-12-31 05:25:34 +00:00
Reid Spencer 8c4914c1e3 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 61543eab05 For PR950:
Change integer type names for signless integer types

llvm-svn: 32777
2006-12-31 05:23:18 +00:00
Reid Spencer 67c4d9633d For PR950:
Add a new feature to FunctionType, Parameter Attributes. This allows tags
such as "sext" and "zext" to be associated with a faunction's arguments
or return type. This allows signedness information to be carried forward
from the frontend to the backend for arguments and result types.

llvm-svn: 32776
2006-12-31 05:22:12 +00:00