1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-22 12:33:33 +02:00
Commit Graph

778 Commits

Author SHA1 Message Date
Chris Lattner
6488ba2b78 add checking intentionally elided for vfcmp/vicmp since they should really
just be removed.  However, this fixes PR3281:crash04.ll, diagnosing it with:

lvm-as: crash04.ll:2:13: vfcmp requires vector floating point operands
  vfcmp uno double* undef, undef
            ^
llvm-svn: 61680
2009-01-05 08:09:48 +00:00
Chris Lattner
706b194790 diagnose PR3281:crash02.ll with:
llvm-as: crash02.ll:1:62: invalid function return type
declare { <{ <{}>, void ([1898 x { void ()* }], opaque, ...) (), fp128 * }>, opaque } @t ()
                                                             ^

llvm-svn: 61679
2009-01-05 08:04:33 +00:00
Chris Lattner
121105b8d7 reject PR3281:crash01.ll with:
llvm-as: crash01.ll:1:9: invalid function return type
declare opaque @t()
        ^

llvm-svn: 61678
2009-01-05 08:00:30 +00:00
Chris Lattner
4269844a07 fix PR3281:accepted0[02].ll: represent empty arrays distinctly, and
diagnose attempts to initialize non-empty arrays with them.  This 
produces:
llvm-as: accepted02.ll:1:28: invalid empty array initializer
@"o" = global [5 x double] []
                           ^
llvm-as: accepted00.ll:1:32: invalid empty array initializer
@"za" = thread_local global {} []
                               ^
[

llvm-svn: 61676
2009-01-05 07:52:51 +00:00
Chris Lattner
92af77f45c PR3281:crash00.ll: produce this diagnostic instead of crashing:
@t = global i8 0, align 3
                        ^

llvm-svn: 61675
2009-01-05 07:46:05 +00:00
Chris Lattner
a76e94a12e Refactor some parser interfaces to fix PR3278 and a FIXME:
ParseAssemblyString with a specified module would not parse
into the module, it would create and return a new one.

llvm-svn: 61635
2009-01-04 20:44:11 +00:00
Misha Brukman
45c8a4df20 Alphabetized #includes.
llvm-svn: 61595
2009-01-02 22:49:28 +00:00
Misha Brukman
8d90975ba9 Down with trailing whitespace!
llvm-svn: 61594
2009-01-02 22:46:48 +00:00
Daniel Dunbar
eedbd9ee1b Remove comma at end of enumerator list.
llvm-svn: 61585
2009-01-02 16:32:55 +00:00
Daniel Dunbar
2c89c6ebae Remove bison specific Makefile bits for AsmParser.
llvm-svn: 61584
2009-01-02 16:29:09 +00:00
Chris Lattner
f90c958115 Fix a really horrible typo, which caused undefined behavior.
llvm-svn: 61566
2009-01-02 08:49:06 +00:00
Chris Lattner
1af2113e10 minor cleanups and comment improvements.
llvm-svn: 61564
2009-01-02 08:05:26 +00:00
Chris Lattner
2950e29626 add a #include to hopefully get the x86-64-linux buildbot building.
llvm-svn: 61563
2009-01-02 07:18:46 +00:00
Chris Lattner
2d37a9be23 update the cmakefile. This is a "best guess", I haven't tested this.
llvm-svn: 61561
2009-01-02 07:14:23 +00:00
Chris Lattner
f28c74870f Reimplement the old and horrible bison parser for .ll files with a nice
and clean recursive descent parser.

This change has a couple of ramifications:
1. The parser code is about 400 lines shorter (in what we maintain, not
   including what is autogenerated).
2. The code should be significantly faster than the old code because we 
   don't have to work around bison's poor handling of datatypes with 
   ctors/dtors.  This also makes the code much more resistant to memory 
   leaks.
3. We now get caret diagnostics from the .ll parser, woo.
4. The actual diagnostics emited from the parser are completely different
   so a bunch of testcases had to be updated.
5. I now disallow "%ty = type opaque %ty = type i32".  There was no good
   reason to support this, it was just an accident of the old 
   implementation.  I have no reason to think that anyone is actually using
   this.
6. The syntax for sticking a global variable has changed to make it 
   unambiguous.  I don't think anyone is depending on this since only clang
   supports this and it is not solid yet, so I'm not worried about anything
   breaking.
7. This gets rid of the last use of bison, and along with it the .cvs files.
   I'll prune this from the makefiles as a subsequent commit.

There are a few minor cleanups that can be done after this commit (suggestions
welcome!) but this passes dejagnu testing and is ready for its time in the
limelight.

llvm-svn: 61558
2009-01-02 07:01:27 +00:00
Nick Lewycky
4f2d81176d Update the .cvs files for nocapture.
llvm-svn: 61241
2008-12-19 09:41:54 +00:00
Nick Lewycky
b8719a653f Commit missed files from nocapture change.
llvm-svn: 61240
2008-12-19 09:38:31 +00:00
Bill Wendling
d364440e53 Forgot to revert r61031 when I reverted r61019, r61030, and r61040.
llvm-svn: 61150
2008-12-17 20:59:57 +00:00
Bill Wendling
f807a68f2e Temporarily revert r61019, r61030, and r61040. These were breaking LLVM Release
builds.

llvm-svn: 61094
2008-12-16 19:06:48 +00:00
Nick Lewycky
212b42c4c0 Update generated files after nocapture syntax change.
llvm-svn: 61031
2008-12-15 07:31:07 +00:00
Nick Lewycky
504288e7af It turns out that "align 1" and unaligned are different. Add a bias to the
alignment attribute such that 0 means unaligned.

This will probably require a rebuild of llvm-gcc because of the change to
Attributes.h. If you see many test failures on "make check", please rebuild
your llvm-gcc.

llvm-svn: 61030
2008-12-15 07:29:55 +00:00
Nick Lewycky
8bdae4db80 Introducing nocapture, a parameter attribute for pointers to indicate that the
callee will not introduce any new aliases of that pointer.

The attributes had all bits allocated already, so I decided to collapse
alignment. Alignment was previously stored as a 16-bit integer from bits 16 to
32 of the attribute, but it was required to be a power of 2. Now it's stored in
log2 encoded form in five bits from 16 to 21. That gives us 11 more bits of
space.

You may have already noticed that you only need four bits to encode a 16-bit
power of two, so why five bits? Because the AsmParser accepted 32-bit
alignments, even though we couldn't store them (they were silently discarded).
Now we can store them in memory, but not in the bitcode.

The bitcode format was already storing these as 64-bit VBR integers. So, the
bitcode format stays the same, keeping the alignment values stored as 16 bit
raw values. There's some hideous code in the reader and writer that deals with
this, waiting to be ripped out the moment we run out of bits again and have to
replace the parameter attributes table encoding.

llvm-svn: 61019
2008-12-15 01:34:58 +00:00
Nick Lewycky
47fa9bd187 Extend the 'noalias' attribute to function return values. This is intended to
indicate functions that allocate, such as operator new, or list::insert. The
actual definition is slightly less strict (for now).

No changes to the bitcode reader/writer, asm printer or verifier were needed.

llvm-svn: 59934
2008-11-24 03:41:24 +00:00
Bill Wendling
dedf359e39 Regenerated
llvm-svn: 59204
2008-11-13 01:03:00 +00:00
Bill Wendling
f5b264a64b Implement stack protectors as function attributes: "ssp" and "sspreq".
llvm-svn: 59202
2008-11-13 01:02:14 +00:00
Nuno Lopes
b16d9bd0c3 regenerate
llvm-svn: 58697
2008-11-04 14:43:20 +00:00
Nuno Lopes
064bb29c9d fix leakage of APFloats in getExistingVal()
llvm-svn: 58696
2008-11-04 14:42:19 +00:00
Nuno Lopes
8499bc5e1d regenerate
llvm-svn: 58694
2008-11-04 14:28:33 +00:00
Nuno Lopes
5caf466051 fix leakage of APSInt in getVal()
llvm-svn: 58693
2008-11-04 14:26:58 +00:00
Oscar Fuentes
64fd2ab298 CMake: Cross-platform support for using pre-generated llvmAsmParser.cpp and llvmAsmParser.h.
llvm-svn: 58130
2008-10-25 03:19:08 +00:00
Cedric Venet
c5bd480a57 Modify the cmake build system so that if it doesn't find bison, it will use the pregenerated file in from the svn (.cvs). Work only for windows for the moment. Tested on Vista64 with MSVC2008express.
llvm-svn: 58090
2008-10-24 11:24:33 +00:00
Nuno Lopes
fcab7d3d0c regenerate
llvm-svn: 57577
2008-10-15 12:05:02 +00:00
Nuno Lopes
8d27c6100b fix memleak in GetForwardRefForGlobal()
llvm-svn: 57576
2008-10-15 12:04:36 +00:00
Nuno Lopes
5b1a422162 regenerate
llvm-svn: 57575
2008-10-15 11:20:21 +00:00
Nuno Lopes
067c8791fe fix memleak in getTypeVal()
llvm-svn: 57574
2008-10-15 11:19:34 +00:00
Nuno Lopes
970117385a regenerate
llvm-svn: 57573
2008-10-15 11:11:12 +00:00
Nuno Lopes
0e2359f53d fix memleak in ResolveTypeTo()
llvm-svn: 57572
2008-10-15 11:10:21 +00:00
Chris Lattner
33e7093540 regenerate
llvm-svn: 57561
2008-10-15 06:16:57 +00:00
Chris Lattner
9449f199b3 Fix the .ll grammar rules to allow any type before an 'i32', not just an
integer type.  Invalid things like 'float 42' are now rejected by the
semantic analysis in the productions not the parser.  This fixes PR2733.

llvm-svn: 57560
2008-10-15 06:16:45 +00:00
Chris Lattner
33079f9c37 regenerate
llvm-svn: 57559
2008-10-15 06:03:48 +00:00
Chris Lattner
dc80d9772a Eliminate the "IntType ::= INTTYPE" production, just use
INTTYPE everywhere.

llvm-svn: 57558
2008-10-15 06:03:37 +00:00
Dale Johannesen
cc34c2da3a Generated files for previous checkin.
llvm-svn: 57331
2008-10-09 23:01:34 +00:00
Dale Johannesen
075a62519f Add a "loses information" return value to APFloat::convert
and APFloat::convertToInteger.  Restore return value to
IEEE754.  Adjust all users accordingly.

llvm-svn: 57329
2008-10-09 23:00:39 +00:00
Chris Lattner
293590ca07 regenerate
llvm-svn: 57290
2008-10-08 06:44:45 +00:00
Chris Lattner
4afce47e9b Add missing semicolumns in parser rules, those missing semicolumns
are required to compile with the latest Bison.

Patch by Samuel Tardieu!

llvm-svn: 57289
2008-10-08 06:44:36 +00:00
Nuno Lopes
4cf7f0e3cd regenerate
llvm-svn: 57114
2008-10-05 16:49:34 +00:00
Nuno Lopes
9e274c3532 clean ArgTypeListI production: free the PATypeHolder
llvm-svn: 57113
2008-10-05 16:49:03 +00:00
Nuno Lopes
3fbdc238d6 regenerate
llvm-svn: 57009
2008-10-03 15:52:39 +00:00
Nuno Lopes
5cb07eb550 fix more memleaks in ResolveTypeTo() and ParseGlobalVariable()
llvm-svn: 57008
2008-10-03 15:51:46 +00:00
Nuno Lopes
263d218cd1 regenerate with bison 2.3
llvm-svn: 57007
2008-10-03 15:45:58 +00:00
Nuno Lopes
949c7ea3e7 fix memleak in FunctionHeaderH
llvm-svn: 57005
2008-10-03 15:44:21 +00:00
Devang Patel
7536edca09 Support inreg, zext and sext as return value attributes.
llvm-svn: 56801
2008-09-29 20:49:50 +00:00
Devang Patel
47a504c87c Implement function notes as function attributes.
llvm-svn: 56716
2008-09-26 23:51:19 +00:00
Dale Johannesen
54cc5b6eee Generated files for warning fix.
llvm-svn: 56715
2008-09-26 23:46:20 +00:00
Dale Johannesen
96018ccd87 Fix a compiler warning.
llvm-svn: 56714
2008-09-26 23:45:53 +00:00
Devang Patel
e4e6ea0728 Now Attributes are divided in three groups
- return attributes - inreg, zext and sext
- parameter attributes
- function attributes - nounwind, readonly, readnone, noreturn

Return attributes use 0 as the index.
Function attributes use ~0U as the index.

This patch requires corresponding changes in llvm-gcc and clang.

llvm-svn: 56704
2008-09-26 22:53:05 +00:00
Dale Johannesen
9ce0f3e4b3 Generated files for previous patch.
llvm-svn: 56679
2008-09-26 19:32:34 +00:00
Dale Johannesen
3f62c40108 Add "inreg" field to CallSDNode (doesn't increase
its size).  Adjust various lowering functions to
pass this info through from CallInst.  Use it to
implement sseregparm returns on X86.  Remove
X86_ssecall calling convention.

llvm-svn: 56677
2008-09-26 19:31:26 +00:00
Devang Patel
64dd7a2e89 Large mechanical patch.
s/ParamAttr/Attribute/g
s/PAList/AttrList/g
s/FnAttributeWithIndex/AttributeWithIndex/g
s/FnAttr/Attribute/g

This sets the stage 
- to implement function notes as function attributes and 
- to distinguish between function attributes and return value attributes.

This requires corresponding changes in llvm-gcc and clang.

llvm-svn: 56622
2008-09-25 21:00:45 +00:00
Eric Christopher
c53ff83d48 Fix fallout from revision r56535.
llvm-svn: 56545
2008-09-24 04:55:49 +00:00
Devang Patel
25ecdc49d9 Put FN_NOTE_AlwaysInline and others in FnAttr namespace.
llvm-svn: 56527
2008-09-24 00:06:15 +00:00
Devang Patel
b39defd763 Move FN_NOTE_AlwaysInline and other out of ParamAttrs namespace.
Do not check isDeclaration() in hasNote(). It is clients' responsibility.

llvm-svn: 56524
2008-09-23 23:52:03 +00:00
Devang Patel
3ce6525647 s/ParameterAttributes/Attributes/g
llvm-svn: 56520
2008-09-23 23:25:44 +00:00
Devang Patel
a3e9bf1bca s/ParameterAttributes/Attributes/g
llvm-svn: 56513
2008-09-23 23:03:40 +00:00
Devang Patel
ad8ca34acd Use parameter attribute store (soon to be renamed) for
Function Notes also. Function notes are stored at index ~0.

llvm-svn: 56511
2008-09-23 22:35:17 +00:00
Chris Lattner
b5ced46ab8 regenerate
llvm-svn: 56502
2008-09-23 21:18:31 +00:00
Chris Lattner
7d905c615f allow inreg on the result of a function
llvm-svn: 56501
2008-09-23 21:18:08 +00:00
Oscar Fuentes
0f25988689 Initial support for the CMake build system.
llvm-svn: 56419
2008-09-22 01:08:49 +00:00
Dan Gohman
90358a2f67 Update generated files.
llvm-svn: 55972
2008-09-09 01:13:24 +00:00
Dan Gohman
3e79d697f3 Extend the vcmp/fcmp LLVM IR instructions to take vectors as arguments
and, if so, to return a vector of boolean as a result;

Extend the select LLVM IR instruction to allow you to specify a result
type which is a vector of boolean, in which case the result will be an
element-wise selection instead of choosing one vector or the other; and

Update LangRef.html to describe these changes.

This patch was contributed by Preston Gurd!

llvm-svn: 55969
2008-09-09 01:02:47 +00:00
Devang Patel
f8c7bd2a05 Parse and print opt_size note.
llvm-svn: 55740
2008-09-03 22:10:21 +00:00
Devang Patel
5659d2508e s/FP_AlwaysInline/FN_NOTE_AlwaysInline/g
llvm-svn: 55676
2008-09-02 22:43:57 +00:00
Devang Patel
f06ad159e9 Parse function notes.
llvm-svn: 55646
2008-09-02 20:52:40 +00:00
Chris Lattner
a90998343b regenerate
llvm-svn: 55542
2008-08-29 17:20:18 +00:00
Chris Lattner
b23f7dae39 Add support for parsing .ll files that have numbers in front of
nameless values, such as:

%3 = add i32 4, 2

This fixes the first half of PR2480

llvm-svn: 55539
2008-08-29 17:12:13 +00:00
Gordon Henriksen
8409ec74bc Regenerate.
llvm-svn: 54900
2008-08-17 18:48:50 +00:00
Gordon Henriksen
2cc861a6c1 Rename some GC classes so that their roll will hopefully be clearer.
In particular, Collector was confusing to implementors. Several
thought that this compile-time class was the place to implement
their runtime GC heap. Of course, it doesn't even exist at runtime.
Specifically, the renames are:

  Collector               -> GCStrategy
  CollectorMetadata       -> GCFunctionInfo
  CollectorModuleMetadata -> GCModuleInfo
  CollectorRegistry       -> GCRegistry
  Function::getCollector  -> getGC (setGC, hasGC, clearGC)

Several accessors and nested types have also been renamed to be
consistent. These changes should be obvious.

llvm-svn: 54899
2008-08-17 18:44:35 +00:00
Chris Lattner
c0610874cc Rework the routines that convert AP[S]Int into a string. Now, instead of
returning an std::string by value, it fills in a SmallString/SmallVector
passed in.  This significantly reduces string thrashing in some cases.

More specifically, this:
 - Adds an operator<< and a print method for APInt that allows you to 
   directly send them to an ostream.
 - Reimplements APInt::toString to be much simpler and more efficient
   algorithmically in addition to not thrashing strings quite as much.

This speeds up llvm-dis on kc++ by 7%, and may also slightly speed up the
asmprinter.  This also fixes a bug I introduced into the asmwriter in a
previous patch w.r.t. alias printing.

llvm-svn: 54873
2008-08-17 07:19:36 +00:00
Dale Johannesen
b23672a4e3 Generated files for 54744.
llvm-svn: 54745
2008-08-13 18:41:46 +00:00
Dale Johannesen
c3d88ff804 Add read/write support for X86's sseregparm.
llvm-svn: 54744
2008-08-13 18:40:23 +00:00
Nate Begeman
9a71580e21 Add vector shifts to the IR, patch by Eli Friedman.
CodeGen & Clang work coming next.

llvm-svn: 54161
2008-07-29 15:49:41 +00:00
Dan Gohman
7f0f329344 Update the generated .cvs files.
llvm-svn: 53943
2008-07-23 00:54:54 +00:00
Dan Gohman
6564581be0 Enable first-class aggregates support.
Remove the GetResultInst instruction. It is still accepted in LLVM assembly
and bitcode, where it is now auto-upgraded to ExtractValueInst. Also, remove
support for return instructions with multiple values. These are auto-upgraded
to use InsertValueInst instructions.

The IRBuilder still accepts multiple-value returns, and auto-upgrades them
to InsertValueInst instructions.

llvm-svn: 53941
2008-07-23 00:34:11 +00:00
Duncan Sands
94f659d6cb Align comments, colons and cases. Remove trailing
whitespace.

llvm-svn: 53453
2008-07-11 07:37:30 +00:00
Chris Lattner
20b1bde882 regenerate
llvm-svn: 53440
2008-07-11 00:30:39 +00:00
Chris Lattner
9dff6fbe58 Implement PR2538
llvm-svn: 53438
2008-07-11 00:30:06 +00:00
Mon P Wang
7d89d61387 Added MemOperands to Atomic operations since Atomics touches memory.
Added abstract class MemSDNode for any Node that have an associated MemOperand
Changed atomic.lcs => atomic.cmp.swap, atomic.las => atomic.load.add, and
atomic.lss => atomic.load.sub

llvm-svn: 52706
2008-06-25 08:15:39 +00:00
Dan Gohman
29c5903a80 Fix some signed vs. unsigned issues in array and vector handling.
llvm-svn: 52664
2008-06-24 01:17:52 +00:00
Dan Gohman
5a929b928e Update the .cvs files.
llvm-svn: 52637
2008-06-23 18:43:26 +00:00
Dan Gohman
7492d685c7 Fix the types for NumElements variables, and add a comment
explaining why empty array constants use ValID::createUndef().

llvm-svn: 52636
2008-06-23 18:40:28 +00:00
Dan Gohman
7c97681798 AsmParser support for immediate constant aggregate values.
llvm-svn: 52149
2008-06-09 14:45:02 +00:00
Dan Gohman
ac5c3382fe IR, bitcode reader, bitcode writer, and asmparser changes to
insertvalue and extractvalue to use constant indices instead of
Value* indices. And begin updating LangRef.html.

There's definately more to come here, but I'm checking this 
basic support in now to make it available to people who are
interested.

llvm-svn: 51806
2008-05-31 00:58:22 +00:00
Dan Gohman
abbe3d47ab Don't silently truncate array extents to 32 bits.
llvm-svn: 51505
2008-05-23 21:40:55 +00:00
Dan Gohman
d3610b38ac Issue errors in several situations instead of aborting.
llvm-svn: 51493
2008-05-23 18:23:11 +00:00
Dan Gohman
c7007dd0dc Make structs and arrays first-class types, and add assembly
and bitcode support for the extractvalue and insertvalue
instructions and constant expressions.

Note that this does not yet include CodeGen support.

llvm-svn: 51468
2008-05-23 01:55:30 +00:00
Dan Gohman
bed6c00ef0 Recognize the "default" keyword, which is documented in LangRef.html
and supported in the grammar, in the lexer.

llvm-svn: 51448
2008-05-22 22:30:09 +00:00
Gordon Henriksen
27c184c385 Reverting accidental commit of generated files.
llvm-svn: 51239
2008-05-19 05:57:12 +00:00
Gordon Henriksen
a1f7004038 Remove a duplicative binding. Patch by Mahadevan R.
llvm-svn: 51238
2008-05-19 05:47:10 +00:00
Gabor Greif
d61f20217a API change for {BinaryOperator|CmpInst|CastInst}::create*() --> Create. Legacy interfaces will be in place for some time. (Merge from use-diet branch.)
llvm-svn: 51200
2008-05-16 19:29:10 +00:00
Dan Gohman
821bf58428 IR support for extractvalue and insertvalue instructions. Also, begin
moving toward making structs and arrays first-class types.

llvm-svn: 51157
2008-05-15 19:50:34 +00:00