1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Commit Graph

242 Commits

Author SHA1 Message Date
Chris Lattner
a0792c722e Change an std::set to a SmallPtrSet. This speeds up the verifier on
447.dealII from 1.27s to 0.86s.

llvm-svn: 34143
2007-02-10 08:19:44 +00:00
Jim Laskey
7d5ddeb668 Support var arg intrinsics.
llvm-svn: 33962
2007-02-06 18:02:54 +00:00
Reid Spencer
6af21b3029 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
591bfa1e0b 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
19af04a142 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
611d5e2eda 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
Chris Lattner
c5e1611848 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
Chris Lattner
f1797fe8bf teach VMCore to accept i1 add's and shifts
llvm-svn: 33223
2007-01-15 02:05:34 +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
f3265181e2 Rename BoolTy as Int1Ty. Patch by Sheng Zhou.
llvm-svn: 33076
2007-01-11 18:21:29 +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
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
0e961ea8f7 For PR950:
Change signed integer type names to unsigned equivalents.

llvm-svn: 32780
2006-12-31 05:26:44 +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
7329276511 Fix Regression/Verifier/invoke-1.ll
llvm-svn: 32722
2006-12-20 21:20:13 +00:00
Chris Lattner
e5e2285492 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
f810a0cfab Remove a useless statement.
llvm-svn: 32660
2006-12-18 23:40:19 +00:00
Reid Spencer
24a09586a9 For PR1042:
Fix a thinko. We want to check the second case if the first cast *didn't*
trigger.

llvm-svn: 32657
2006-12-18 21:56:29 +00:00
Chris Lattner
f511077490 Fix PR1042, by tightening up the subtle rules with invoke value use.
llvm-svn: 32624
2006-12-16 02:25:35 +00:00
Chris Lattner
1228f12fb4 only check non-external functions
llvm-svn: 32530
2006-12-13 04:45:46 +00:00
Chris Lattner
be3585daa3 Reject attempts to define intrinsics. This fixes PR1047 and
Regression/Verifier/2006-12-12-IntrinsicDefine.ll

llvm-svn: 32529
2006-12-13 04:30:37 +00:00
Bill Wendling
fe0af72bc4 Don't use <sstream> in Streams.h but <iosfwd> instead.
llvm-svn: 32340
2006-12-07 23:41:45 +00:00
Bill Wendling
a3246c4272 Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, are
now cerr, cout, and NullStream resp.

llvm-svn: 32298
2006-12-07 01:30:32 +00:00
Chris Lattner
3d1758e08c Remove the 'printname' argument to WriteAsOperand. It is always true, and
passing false would make the asmprinter fail anyway.

llvm-svn: 32264
2006-12-06 06:16:21 +00:00
Bill Wendling
aa02717a76 Changed to using LLVM streams.
llvm-svn: 31955
2006-11-28 02:09:03 +00:00
Reid Spencer
992d9788b3 For PR950:
The long awaited CAST patch. This introduces 12 new instructions into LLVM
to replace the cast instruction. Corresponding changes throughout LLVM are
provided. This passes llvm-test, llvm/test, and SPEC CPUINT2000 with the
exception of 175.vpr which fails only on a slight floating point output
difference.

llvm-svn: 31931
2006-11-27 01:05:10 +00:00
Reid Spencer
6e34ef887b For PR950:
First in a series of patches to convert SetCondInst into ICmpInst and
FCmpInst using only two opcodes and having the instructions contain their
predicate value. Nothing uses these classes yet. More patches to follow.

llvm-svn: 31867
2006-11-20 01:22:35 +00:00
Reid Spencer
d414793dbc For PR950:
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.

llvm-svn: 31063
2006-10-20 07:07:24 +00:00
Anton Korobeynikov
7c2118575c Added some eye-candy for Subtarget type checking
Added X86 StdCall & FastCall calling conventions. Codegen will follow.

llvm-svn: 30446
2006-09-17 20:25:45 +00:00
Anton Korobeynikov
6e19f80688 Adding dllimport, dllexport and external weak linkage types.
DLL* linkages got full (I hope) codegeneration support in C & both x86
assembler backends.
External weak linkage added for future use, we don't provide any
codegeneration, etc. support for it.

llvm-svn: 30374
2006-09-14 18:23:27 +00:00
Chris Lattner
a39dcb5377 eliminate RegisterOpt. It does the same thing as RegisterPass.
llvm-svn: 29925
2006-08-27 22:42:52 +00:00
Chris Lattner
33bd5dcfb7 s|llvm/Support/Visibility.h|llvm/Support/Compiler.h|
llvm-svn: 29911
2006-08-27 12:54:02 +00:00
Reid Spencer
10b9edbb69 For PR780:
1. Move IncludeFile.h to System library
2. Move IncludeFile.cpp to System library
3. #1 and #2 required to prevent cyclic library dependencies for libSystem
4. Convert all existing uses of Support/IncludeFile.h to System/IncludeFile.h
5. Add IncludeFile support to various lib/System classes.
6. Add new lib/System classes to LinkAllVMCore.h
All this in an attempt to pull in lib/System to what's required for VMCore

llvm-svn: 29287
2006-07-26 16:18:00 +00:00
Chris Lattner
c46e26828e Fix PR826, testcase here: Regression/Verifier/2006-07-11-StoreStruct.ll
llvm-svn: 29112
2006-07-11 20:29:49 +00:00
Chris Lattner
c55abf6f70 Change the verifier to never throw an exception. Instead verifyModule canoptionally return the string error, which is an easier api for clients touse anyway.
llvm-svn: 29017
2006-07-06 18:02:27 +00:00
Chris Lattner
11f1b29308 Use hidden visibility to reduce the sizes of some .o files. This chops 60K off a release llvm-dis.
llvm-svn: 28969
2006-06-28 21:38:54 +00:00
Chris Lattner
cf73ab6b7c csret functions can be varargs (as can target cc's). Verify restrictions on
csret functions.

llvm-svn: 28405
2006-05-19 21:25:17 +00:00
Chris Lattner
703a8cf960 remove dead var
llvm-svn: 28287
2006-05-14 18:34:36 +00:00
Chris Lattner
73fc98fdeb Use the isValidOperands helper instead of duplicating checking code
llvm-svn: 27524
2006-04-08 04:07:52 +00:00
Chris Lattner
14b19acd56 Add shufflevector support, todo, implement better constant folding.
llvm-svn: 27510
2006-04-08 01:18:18 +00:00
Jeff Cohen
6c699c72a8 Fix build breakage.
llvm-svn: 27292
2006-03-31 07:22:05 +00:00
Chris Lattner
17549e4da1 Add a new method to verify intrinsic function prototypes.
llvm-svn: 27282
2006-03-31 04:46:47 +00:00
Chris Lattner
e428e4d828 Use the autogenerated intrinsic verifier
llvm-svn: 26667
2006-03-09 22:06:04 +00:00
Chris Lattner
dc7268f6a3 remove dbg_declare, it's not used yet.
llvm-svn: 26659
2006-03-09 20:02:42 +00:00
Chris Lattner
999aa36a04 remove the read/write port/io intrinsics.
llvm-svn: 26479
2006-03-03 00:19:58 +00:00
Chris Lattner
c8da528e6c Split memcpy/memset/memmove intrinsics into i32/i64 versions, resolving
PR709, and paving the way for future progress.

Significantly refactor autoupgrading code, to handle the more complex case
(where we upgrade one argument in a function), and fix some bugs in it.

Testcase here: llvm/test/Regression/Bytecode/memcpy.ll

llvm-svn: 26474
2006-03-02 23:58:40 +00:00
Chris Lattner
e930f6bafb Make sure the only user of InlineAsm's are direct calls.
llvm-svn: 25626
2006-01-26 00:08:45 +00:00
Reid Spencer
e14cf26e04 Don't accept the ctpop, cttz, or ctlz intrinsics with signed arguments. The
interface requires unsigned arguments.

llvm-svn: 25433
2006-01-19 01:20:03 +00:00
Robert Bocchino
4e3d87a0dc VMCore support for the insertelement operation.
llvm-svn: 25408
2006-01-17 20:07:22 +00:00
Reid Spencer
3cecd3c4cf For PR411:
This patch is an incremental step towards supporting a flat symbol table.
It de-overloads the intrinsic functions by providing type-specific intrinsics
and arranging for automatically upgrading from the old overloaded name to
the new non-overloaded name. Specifically:
  llvm.isunordered -> llvm.isunordered.f32, llvm.isunordered.f64
  llvm.sqrt -> llvm.sqrt.f32, llvm.sqrt.f64
  llvm.ctpop -> llvm.ctpop.i8, llvm.ctpop.i16, llvm.ctpop.i32, llvm.ctpop.i64
  llvm.ctlz -> llvm.ctlz.i8, llvm.ctlz.i16, llvm.ctlz.i32, llvm.ctlz.i64
  llvm.cttz -> llvm.cttz.i8, llvm.cttz.i16, llvm.cttz.i32, llvm.cttz.i64
New code should not use the overloaded intrinsic names. Warnings will be
emitted if they are used.

llvm-svn: 25366
2006-01-16 21:12:35 +00:00
Chris Lattner
bc3620ba6b Thanks to Daniel Berlin's ETForest fix, we can now use it again for the verifier
llvm-svn: 25345
2006-01-15 21:58:50 +00:00
Chris Lattner
37428f4021 ET-Forest has issues with unreachable blocks. Temporarily disable verifiers use
of it until they are resolved.

llvm-svn: 25341
2006-01-15 20:00:51 +00:00
Nate Begeman
4750001146 Add bswap intrinsics as documented in the Language Reference
llvm-svn: 25309
2006-01-14 01:25:24 +00:00
Chris Lattner
e13a03d217 Add recognition and verification of new llvm.stacksave/llvm.stackrestore intrinsics
llvm-svn: 25266
2006-01-13 02:15:39 +00:00
Chris Lattner
376a82c32c Convert the verifier over to use ETForest instead of DominatorSet. Patch
by Daniel Berlin

llvm-svn: 25242
2006-01-12 06:17:59 +00:00
Robert Bocchino
9a57550e4e Added support for the extractelement operation.
llvm-svn: 25181
2006-01-10 19:05:34 +00:00
Chris Lattner
d51de8d76f Get logical operations to like packed types, allow BinOp::getNot to create
the right vector of -1's as its operand.

llvm-svn: 24906
2005-12-21 18:22:19 +00:00
Andrew Lenharth
dca2f13e76 continued readcyclecounter support
llvm-svn: 24300
2005-11-11 16:47:30 +00:00
Andrew Lenharth
a9214fec08 core changes for varargs
llvm-svn: 22254
2005-06-18 18:34:52 +00:00
Chris Lattner
fb4a99b117 Verify that varargs functions all have ccc
llvm-svn: 21792
2005-05-08 22:27:09 +00:00
Andrew Lenharth
8b64bd0fd5 Implement count leading zeros (ctlz), count trailing zeros (cttz), and count
population (ctpop).  Generic lowering is implemented, however only promotion
is implemented for SelectionDAG at the moment.

More coming soon.

llvm-svn: 21676
2005-05-03 17:19:30 +00:00
Chris Lattner
234ffe2395 Add llvm.sqrt intrinsic, patch contributed by Morten Ofstad
llvm-svn: 21627
2005-04-30 03:44:07 +00:00
Misha Brukman
53e199440e Remove trailing whitespace
llvm-svn: 21427
2005-04-21 23:48:37 +00:00
Andrew Lenharth
c287cd1e4e First step in adding pcmarker intrinsic. Second step (soon) is adding backend support.
llvm-svn: 20900
2005-03-28 20:05:49 +00:00
Chris Lattner
4b688a1c70 This mega patch converts us from using Function::a{iterator|begin|end} to
using Function::arg_{iterator|begin|end}.  Likewise Module::g* -> Module::global_*.

This patch is contributed by Gabor Greif, thanks!

llvm-svn: 20597
2005-03-15 04:54:21 +00:00
Chris Lattner
c4205a6b93 Verify llvm.prefetch.
llvm-svn: 20376
2005-02-28 19:27:42 +00:00
Chris Lattner
af54bd6050 Fix some problems where the verifier would crash on invalid input instead of
reporting the problem and exiting.

llvm-svn: 20302
2005-02-24 16:58:29 +00:00
Jeff Cohen
7311de2af2 Use binary mode for reading/writing bytecode files
llvm-svn: 19751
2005-01-22 17:36:17 +00:00
Chris Lattner
4faf86336e Add a verifier assertion
llvm-svn: 18965
2004-12-15 20:23:49 +00:00
Alkis Evlogimenos
7202acacf7 Check if a block has a terminator first before calling front() on
it. If a block has a terminator then it is certainly non-empty so the
verifier will not crash on it.

llvm-svn: 18484
2004-12-04 02:30:42 +00:00
Alkis Evlogimenos
edf490b75e Make error msg reflect what exactly went wrong.
llvm-svn: 18478
2004-12-04 01:25:06 +00:00
Misha Brukman
dba13ac3cb The Alpha (tm) intrinsics have never been used anywhere
llvm-svn: 17340
2004-10-29 18:43:17 +00:00
Chris Lattner
7af052f5c8 Make sure to check select instructions for generic instruction properties
llvm-svn: 16597
2004-09-29 21:19:28 +00:00
Chris Lattner
da5c635143 Don't use DominatorSet::dominates for intra-block instruction dom checks.
This method is linear time in the size of the basic block, which is very
bad for large basic blocks.  On the Assembler/2004-09-29-VerifierIsReallySlow.llx
testcase, the verifier changes from taking 50s to 0.23s with this patch.

llvm-svn: 16593
2004-09-29 20:07:45 +00:00
Reid Spencer
c4abcbefb1 Changes For Bug 352
Move include/Config and include/Support into include/llvm/Config,
include/llvm/ADT and include/llvm/Support. From here on out, all LLVM
public header files must be under include/llvm/.

llvm-svn: 16137
2004-09-01 22:55:40 +00:00
Brian Gaeke
01636f4e0f Packed types, brought to you by Brad Jones
llvm-svn: 15938
2004-08-20 06:00:58 +00:00
Chris Lattner
59c0771263 Updates to gc intrinsics, contributed by Tobias Nurmiranta
llvm-svn: 15096
2004-07-22 05:50:01 +00:00
Reid Spencer
873e776581 bug 122:
- Correct an assert to not have redundant isa<GlobalValue>

llvm-svn: 14934
2004-07-18 00:02:41 +00:00
Reid Spencer
d02e1dc90d - #include <iostream> since its not in Value.h any more.
llvm-svn: 14617
2004-07-04 11:55:37 +00:00
Misha Brukman
da2521c04f * Capitalize `Java'
* Sprinkle hypens liberally
* Fix some grammar in comments

llvm-svn: 14374
2004-06-24 21:47:35 +00:00
Chris Lattner
18f8ae4e3e Minor cleanup
llvm-svn: 14199
2004-06-17 17:56:54 +00:00
Chris Lattner
7c3600a50e isnan is dead
llvm-svn: 14191
2004-06-15 21:52:58 +00:00
Alkis Evlogimenos
173e9e832c Make assertions more consistent with the rest of the intrinsic
function verification and make it a requirement that both arguments to
llvm.isunordered are of the same type.

llvm-svn: 14165
2004-06-13 00:55:26 +00:00
Alkis Evlogimenos
9b28aef6cb Add the isunordered intrinsic.
llvm-svn: 14159
2004-06-12 19:19:14 +00:00
Chris Lattner
b07bf147cd I misled Alkis: LLVM should have isnan, not isunordered.
isunordered(X, Y) === isnan(X) | isnan(Y)

Remove isunordered, add isnan.

llvm-svn: 14132
2004-06-11 02:29:43 +00:00
Alkis Evlogimenos
1ae8b4e7c4 Add the isunordered intrinsic.
llvm-svn: 14127
2004-06-11 01:08:18 +00:00
Chris Lattner
a1c9755c7c Fix PR361.
Dominance properties don't hold in unreachable code

llvm-svn: 14053
2004-06-07 23:07:33 +00:00
Chris Lattner
6e63236846 Fix GCC warning
llvm-svn: 14045
2004-06-05 17:44:48 +00:00
Chris Lattner
678cafb8a9 Work around VS bug
llvm-svn: 14036
2004-06-05 00:22:04 +00:00
Chris Lattner
e78fedecf2 * Verify function prototypes, not just functions with bodies.
* Verify that functions do not take aggregates as arguments.

llvm-svn: 13984
2004-06-03 06:38:43 +00:00
Reid Spencer
693dcc2f89 Fix for bug 348.
The SymbolTable changes caused this one too.

llvm-svn: 13859
2004-05-27 21:58:13 +00:00
Reid Spencer
e6cf613d2a Convert to SymbolTable's new iteration interface. Remove tabs.
llvm-svn: 13753
2004-05-25 08:53:29 +00:00
Chris Lattner
5f65590915 Recognize and verify the new GC intrinsics.
llvm-svn: 13687
2004-05-23 21:16:51 +00:00
Chris Lattner
30cc4edfc3 Fix for PR340: Verifier misses malformed switch instruction
llvm-svn: 13618
2004-05-21 16:47:21 +00:00
Brian Gaeke
5d639ac9f3 Fold two assertions with backwards error messages into one with a
correct error message.

llvm-svn: 13590
2004-05-17 21:15:18 +00:00
John Criswell
b51e979c2c Fixed inconsistent indentation.
llvm-svn: 13363
2004-05-04 21:46:05 +00:00
Chris Lattner
644ad23b21 Make sure to check for a very bad class of errors: an instruction
that does not dominate all of its users, but is in the same basic block as
its users.  This class of error is what caused the mysterious CBE only
failures last night.

llvm-svn: 12979
2004-04-16 05:51:47 +00:00
John Criswell
bed6463449 Remove the return type check for llvm.readio. This check is done for all
functions and is not needed here.
Simplify the pointer type check per Chris's suggestions.

llvm-svn: 12945
2004-04-14 15:06:48 +00:00
John Criswell
e00ecd7e84 Added code to verify that llvm.readio's pointer argument returns something
that matches its return type.

llvm-svn: 12944
2004-04-14 14:49:36 +00:00
John Criswell
11f7f60028 Finish adding the llvm.readio and llvm.writeio intrinsics.
Sorry these didn't get in yesterday.

llvm-svn: 12942
2004-04-14 13:46:52 +00:00