Commit Graph

289 Commits

Author SHA1 Message Date
Dale Johannesen 028084efe5 Revise previous patch per review comments.
Next round of x87 long double stuff.
Getting close now, basically works.

llvm-svn: 41875
2007-09-12 03:30:33 +00:00
Dale Johannesen bed9dc423c Next round of APFloat changes.
Use APFloat in UpgradeParser and AsmParser.
Change all references to ConstantFP to use the
APFloat interface rather than double.  Remove
the ConstantFP double interfaces.
Use APFloat functions for constant folding arithmetic
and comparisons.
(There are still way too many places APFloat is
just a wrapper around host float/double, but we're
getting there.)

llvm-svn: 41747
2007-09-06 18:13:44 +00:00
Chris Lattner 10f03a644a simplify code and print visibility for declarations.
llvm-svn: 41173
2007-08-19 22:15:26 +00:00
Reid Spencer bdf03b4174 Reinstate the patch for escaping non-printing characters and allow for
\\ to escape \. All these cases are now handled by the AsmParser.

llvm-svn: 37295
2007-05-22 19:27:35 +00:00
Chris Lattner 83d7dd419a temporarily revert reid's asmwriter patch, it is missing the asmparser piece
that decodes the escape sequences, thus breaking all cases that use them.

This fixes test/Assembler/2007-05-21-Escape.ll

llvm-svn: 37284
2007-05-22 07:00:50 +00:00
Reid Spencer e44b45e757 Get the order of the hext digits right!
llvm-svn: 37261
2007-05-19 14:44:42 +00:00
Reid Spencer 6473fb7916 Adjust how LLVM names are produced:
1. Always use % for local and @ for global.
2. Replace NameNeedsQuotes with QuoteNameIfNeeded so that any adjustments
   to the name can be done in one pass.
3. Implement generation of hex escapes so we don't get "wonky" characters
   in the output.

llvm-svn: 37260
2007-05-19 07:25:21 +00:00
Devang Patel 8c78a0bff0 Drop 'const'
llvm-svn: 36662
2007-05-03 01:11:54 +00:00
Devang Patel e95c6ad802 Use 'static const char' instead of 'static const int'.
Due to darwin gcc bug, one version of darwin linker coalesces
static const int, which defauts PassID based pass identification.

llvm-svn: 36652
2007-05-02 21:39:20 +00:00
Devang Patel 09f162ca6a Do not use typeinfo to identify pass in pass manager.
llvm-svn: 36632
2007-05-01 21:15:47 +00:00
Anton Korobeynikov 39f3cffbe3 Implement protected visibility. This partly implements PR1363. Linker
should be taught to deal with protected symbols.

llvm-svn: 36565
2007-04-29 18:35:00 +00:00
Anton Korobeynikov 546ea7ea88 Implement review feedback
llvm-svn: 36564
2007-04-29 18:02:48 +00:00
Anton Korobeynikov b18f8f85e9 Implement review feedback. Aliasees can be either GlobalValue's or
bitcasts of them.

llvm-svn: 36537
2007-04-28 13:45:00 +00:00
Chris Lattner d2747054b4 print aliases before functions
llvm-svn: 36459
2007-04-26 02:24:10 +00:00
Anton Korobeynikov a97b694c82 Implement aliases. This fixes PR1017 and it's dependent bugs. CFE part
will follow.

llvm-svn: 36435
2007-04-25 14:27:10 +00:00
Christopher Lamb 8448570beb PR400 work phase 1. Add attributed load/store instructions for volatile/align to LLVM.
llvm-svn: 36349
2007-04-22 19:24:39 +00:00
Reid Spencer 4388f0b4fa For PR1146:
Make ParamAttrsList objects unique. You can no longer directly create or
destroy them but instead must go through the ParamAttrsList::get()
interface.

llvm-svn: 36327
2007-04-22 05:46:44 +00:00
Reid Spencer 0c1349e6bc Revert Christopher Lamb's load/store alignment changes.
llvm-svn: 36309
2007-04-21 18:36:27 +00:00
Christopher Lamb bff50208c8 add support for alignment attributes on load/store instructions
llvm-svn: 36301
2007-04-21 08:16:25 +00:00
Chris Lattner 82738fe254 don't access argument list of prototypes
llvm-svn: 36238
2007-04-18 00:57:22 +00:00
Lauro Ramos Venancio 749e4668e7 Implement the "thread_local" keyword.
llvm-svn: 35950
2007-04-12 18:32:50 +00:00
Reid Spencer a472f66dd0 For PR1146:
Put the parameter attributes in their own ParamAttr name space. Adjust the
rest of llvm as a result.

llvm-svn: 35877
2007-04-11 02:44:20 +00:00
Reid Spencer 1517de317a For PR1146:
Adjust writing of parameter attributes to use ParamAttrList class.

llvm-svn: 35808
2007-04-09 06:10:42 +00:00
Reid Spencer 6d8e75ddb2 No need to generate the implementation keyword any more. Its frivolous.
llvm-svn: 35405
2007-03-28 01:53:20 +00:00
Dan Gohman dcb291faa4 Change uses of Function::front to Function::getEntryBlock for readability.
llvm-svn: 35265
2007-03-22 16:38:57 +00:00
Reid Spencer 508167861d For PR1258:
Radically simplify the SlotMachine. There is no need to keep Value planes
around any more. This change causes slot numbering to number all un-named,
non-void values starting at 0 and incrementing monotonically through the
function, regardless of type (including BasicBlocks). Getting slot numbers
is now a single lookup operation instead of a double lookup.

llvm-svn: 35171
2007-03-19 18:32:53 +00:00
Reid Spencer e2eb1fab8c Adjust to changes in the APInt interface.
llvm-svn: 34681
2007-02-27 20:25:25 +00:00
Reid Spencer ad25003200 Allow the AsmWriter to print out arbitrary precision integers.
llvm-svn: 34664
2007-02-27 08:34:09 +00:00
Reid Spencer d84d35ba70 For PR1195:
Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and
PackedTyID -> VectorTyID. No functional changes.

llvm-svn: 34293
2007-02-15 02:26:10 +00:00
Reid Spencer 3aaaa0b2bd For PR411:
This patch replaces the SymbolTable class with ValueSymbolTable which does
not support types planes. This means that all symbol names in LLVM must now
be unique. The patch addresses the necessary changes to deal with this and
removes code no longer needed as a result. This completes the bulk of the
changes for this PR. Some cleanup patches will follow.

llvm-svn: 33918
2007-02-05 20:47:22 +00:00
Reid Spencer 0cdd04fa90 Fix a comment that needed to change after SHIFT patch landed.
llvm-svn: 33781
2007-02-02 13:54:55 +00:00
Reid Spencer 2341c22ec7 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.

llvm-svn: 33776
2007-02-02 02:16:23 +00:00
Reid Spencer 5301e7c605 For PR1136: Rename GlobalVariable::isExternal as isDeclaration to avoid
confusion with external linkage types.

llvm-svn: 33663
2007-01-30 20:08:39 +00:00
Anton Korobeynikov 037c867b54 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.
llvm-svn: 33597
2007-01-28 13:31:35 +00:00
Reid Spencer 788e317cd7 For PR645:
Implement new syntax for local and global symbols. Types and local
symbols use the % prefix. Global variables and functions use the @ prefix.

llvm-svn: 33523
2007-01-26 08:02:52 +00:00
Chris Lattner 90d2e426f9 make this more efficient in release builds (time and space)
llvm-svn: 33239
2007-01-15 18:28:18 +00:00
Chris Lattner 03c4953cdd 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! :)

llvm-svn: 33225
2007-01-15 02:27:26 +00:00
Anton Korobeynikov a0554d90e8 * 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
Reid Spencer c87215900d Always write 1 bit integers as i1 not "bool".
llvm-svn: 33115
2007-01-12 07:25:20 +00:00
Reid Spencer 7a9c62baa6 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 cddc9dfe97 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
Reid Spencer 542964f55b Rename BoolTy as Int1Ty. Patch by Sheng Zhou.
llvm-svn: 33076
2007-01-11 18:21:29 +00:00
Zhou Sheng 75b871fb1e 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
Reid Spencer 5656cad97d Shut up a warning about signed/unsigned.
llvm-svn: 33071
2007-01-11 07:58:19 +00:00
Chris Lattner 550a8f3760 simplify some logic further
llvm-svn: 33069
2007-01-11 04:30:21 +00:00
Chris Lattner 5e04332326 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
Reid Spencer c6c4fab067 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 2d56715015 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 2cf85c7507 eliminate some iterator gymnastics.
llvm-svn: 33052
2007-01-10 06:43:26 +00:00
Chris Lattner 04398e8d48 Inline insertValue into CreateModuleSlot/CreateFunctionSlot
llvm-svn: 33038
2007-01-09 08:04:59 +00:00