Commit Graph

16480 Commits

Author SHA1 Message Date
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 dc0a3a2fd2 Regenerate.
llvm-svn: 32772
2006-12-29 20:35:03 +00:00
Reid Spencer 7ce2d2a8fe 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 64493fb30d fix comment
llvm-svn: 32767
2006-12-29 14:28:12 +00:00
Lauro Ramos Venancio 8ab8f7df6f Define StaticCtorsSection and StaticDtorsSection for ARM.
llvm-svn: 32763
2006-12-28 13:13:00 +00:00
Lauro Ramos Venancio 7251e57ff8 Implement SELECT_CC (f32/f64) for ARM.
llvm-svn: 32762
2006-12-28 13:11:14 +00:00
Rafael Espindola 865b979833 remove duplicated line
bug noticed by Lauro

llvm-svn: 32761
2006-12-28 12:51:40 +00:00
Lauro Ramos Venancio d0ced3f1e8 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 9d36acf9ec 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 b15374974d Fix some comments.
llvm-svn: 32758
2006-12-24 18:42:29 +00:00
Reid Spencer 193df25eb9 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 910f23f7d7 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 43c77d53ff 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 ccf78ac1d0 Don't overload var names.
llvm-svn: 32752
2006-12-23 10:21:26 +00:00
Reid Spencer 266e42b312 For PR950:
This patch removes the SetCC instructions and replaces them with the ICmp
and FCmp instructions. The SetCondInst instruction has been removed and
been replaced with ICmpInst and FCmpInst.

llvm-svn: 32751
2006-12-23 06:05:41 +00:00
Chris Lattner f171af97d5 add a simple fast-path for dead allocas
llvm-svn: 32750
2006-12-22 23:14:42 +00:00
Devang Patel f5a994e5cc ModulePass and ImmutablePass. Force out of line virtual method.
llvm-svn: 32748
2006-12-22 22:49:00 +00:00
Anton Korobeynikov 430e68a1b9 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 d7a090ffc4 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 763550323d Debug dump error.
llvm-svn: 32743
2006-12-22 02:04:05 +00:00
Chris Lattner 959113a5c8 add a note
llvm-svn: 32741
2006-12-22 01:03:22 +00:00
Chris Lattner 5cfa5ef912 Fix for ARM weak symbols, patch by Lauro Ramos Venancio!
llvm-svn: 32740
2006-12-21 22:59:58 +00:00
Jim Laskey 28663c73ef Changes from Nick Lewycky with a simplified PPCTargetAsmInfo.
llvm-svn: 32735
2006-12-21 20:26:09 +00:00
Reid Spencer 4e0c2a0e41 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 cfcec2caac Add a FIXME about signedness.
llvm-svn: 32732
2006-12-21 18:59:16 +00:00
Reid Spencer 6156b02dd3 Simplify all the casting business and get rid of isSigned().
llvm-svn: 32731
2006-12-21 08:28:31 +00:00
Reid Spencer a276d0972c Remove isSigned calls via foreknowledge of main's argument types.
llvm-svn: 32730
2006-12-21 07:49:49 +00:00
Reid Spencer 4720d4d9ef Get rid of a useless if statement whose then and else blocks were identical.
llvm-svn: 32729
2006-12-21 07:15:54 +00:00
Reid Spencer a8a90a2f97 Add some comments about things that can go away once signless types are in.
llvm-svn: 32727
2006-12-21 06:43:46 +00:00
Devang Patel e3068403bd At the beginning of run, initialize analyis info availability for _ALL_
pass managers. Otherwise, stale available analysis info, from the managers not
yet run, may cause pass manager to take wrong turn.

This fixes CBE test failures reported by nightly tester.

llvm-svn: 32726
2006-12-21 00:16:50 +00:00
Jim Laskey 4c90a6df16 Oops.
llvm-svn: 32724
2006-12-20 21:35:00 +00:00
Jim Laskey c2c861d00e Original patch was overly complicated.
llvm-svn: 32723
2006-12-20 21:33:34 +00:00
Chris Lattner 6fc3c7a8be Fix Regression/Verifier/invoke-1.ll
llvm-svn: 32722
2006-12-20 21:20:13 +00:00
Jim Laskey 41621a72f5 Changes to target powerpc for non-Darwin assemblers.
1. Patches from Nick Lewycky.
2. Code to filter register names and print them as numeric values on
non-Darwin systems.

llvm-svn: 32721
2006-12-20 20:56:46 +00:00
Anton Korobeynikov b3d704c91d Fixed 80 cols & style violation
llvm-svn: 32720
2006-12-20 20:40:30 +00:00
Chris Lattner 439c25a08a Revert the previous patch which was incorrect. This unbreaks eon, but rebreaks
invoke-1.ll

llvm-svn: 32718
2006-12-20 19:50:15 +00:00
Reid Spencer 3f46fbaa00 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.

llvm-svn: 32716
2006-12-20 17:20:09 +00:00
Chris Lattner 1847f6ddbd handle undef values much more carefully: generalize the resolveundefbranches
code to handle instructions as well, so that we properly fold things like
X & undef -> 0.
This fixes Transforms/SCCP/2006-12-19-UndefBug.ll

llvm-svn: 32715
2006-12-20 06:21:33 +00:00
Evan Cheng 258657e64e getLoad() and getStore() calls missed SVOffset operand. Thanks to Dan Gohman
for pointing it out!

llvm-svn: 32712
2006-12-20 01:27:29 +00:00
Anton Korobeynikov 93acb49182 Fixed dllimported symbols support during JIT'ing. JIT on mingw32
platform should be more or less workable. At least, sim is running fine
under lli :)

llvm-svn: 32711
2006-12-20 01:03:20 +00:00
Chris Lattner 00bb216977 eliminate constructor from Statistic class. It is now impossible to get a
static constructor for them :).   Transition complete.

llvm-svn: 32710
2006-12-19 23:17:40 +00:00
Chris Lattner 575d3218ab switch statistics over to not use static ctors.
llvm-svn: 32709
2006-12-19 23:16:47 +00:00
Chris Lattner 1ef9cd400d eliminate static ctors for Statistic objects.
llvm-svn: 32703
2006-12-19 22:59:26 +00:00
Chris Lattner e712a5a1d2 elimiante Statistic static ctors
llvm-svn: 32702
2006-12-19 22:56:53 +00:00
Chris Lattner c346ecd780 remove static ctors from Statistic objects
llvm-svn: 32700
2006-12-19 22:43:32 +00:00