Commit Graph

550 Commits

Author SHA1 Message Date
Rafael Espindola
27c076ae40 Fix most of PR10367.
This patch changes the design of GlobalAlias so that it doesn't take a
ConstantExpr anymore. It now points directly to a GlobalObject, but its type is
independent of the aliasee type.

To avoid changing all alias related tests in this patches, I kept the common
syntax

@foo = alias i32* @bar

to mean the same as now. The cases that used to use cast now use the more
general syntax

@foo = alias i16, i32* @bar.

Note that GlobalAlias now behaves a bit more like GlobalVariable. We
know that its type is always a pointer, so we omit the '*'.

For the bitcode, a nice surprise is that we were writing both identical types
already, so the format change is minimal. Auto upgrade is handled by looking
through the casts and no new fields are needed for now. New bitcode will
simply have different types for Alias and Aliasee.

One last interesting point in the patch is that replaceAllUsesWith becomes
smart enough to avoid putting a ConstantExpr in the aliasee. This seems better
than checking and updating every caller.

A followup patch will delete getAliasedGlobal now that it is redundant. Another
patch will add support for an explicit offset.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209007 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-16 19:35:39 +00:00
Rafael Espindola
1acea2db56 Don't crash on redefinitions.
One error we were not deleting the alias or putting it in the Module. The
end result is that there was an use left of the aliasee when the module was
deleted.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208447 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-09 21:49:17 +00:00
Duncan P. N. Exon Smith
76c17d324c IR: Don't allow non-default visibility on local linkage
Visibilities of `hidden` and `protected` are meaningless for symbols
with local linkage.

  - Change the assembler to reject non-default visibility on symbols
    with local linkage.

  - Change the bitcode reader to auto-upgrade `hidden` and `protected`
    to `default` when the linkage is local.

  - Update LangRef.

<rdar://problem/16141113>

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@208263 91177308-0d34-0410-b5e6-96231b3b80d8
2014-05-07 22:57:20 +00:00
Rafael Espindola
38048cdb1c Reject alias to undefined symbols in the verifier.
On ELF and COFF an alias is just another name for a position in the file.
There is no way to refer to a position in another file, so an alias to
undefined is meaningless.

MachO currently doesn't support aliases. The spec has a N_INDR, which when
implemented will have a different set of restrictions. Adding support for
it shouldn't be harder than any other IR extension.

For now, having the IR represent what is actually possible with current
tools makes it easier to fix the design of GlobalAlias.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203705 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-12 20:15:49 +00:00
Tim Northover
ca396e391e IR: add a second ordering operand to cmpxhg for failure
The syntax for "cmpxchg" should now look something like:

	cmpxchg i32* %addr, i32 42, i32 3 acquire monotonic

where the second ordering argument gives the required semantics in the case
that no exchange takes place. It should be no stronger than the first ordering
constraint and cannot be either "release" or "acq_rel" (since no store will
have taken place).

rdar://problem/15996804

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203559 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-11 10:48:52 +00:00
David Majnemer
39a09d2b7c IR: Change inalloca's grammar a bit
The grammar for LLVM IR is not well specified in any document but seems
to obey the following rules:

 - Attributes which have parenthesized arguments are never preceded by
   commas.  This form of attribute is the only one which ever has
   optional arguments.  However, not all of these attributes support
   optional arguments: 'thread_local' supports an optional argument but
   'addrspace' does not.  Interestingly, 'addrspace' is documented as
   being a "qualifier".  What constitutes a qualifier?  I cannot find a
   definition.

 - Some attributes use a space between the keyword and the value.
   Examples of this form are 'align' and 'section'.  These are always
   preceded by a comma.

 - Otherwise, the attribute has no argument.  These attributes do not
   have a preceding comma.

Sometimes an attribute goes before the instruction, between the
instruction and it's type, or after it's type.  'atomicrmw' has
'volatile' between the instruction and the type while 'call' has 'tail'
preceding the instruction.

With all this in mind, it seems most consistent for 'inalloca' on an
'inalloca' instruction to occur before between the instruction and the
type.  Unlike the current formulation, there would be no preceding
comma.  The combination 'alloca inalloca' doesn't look particularly
appetizing, perhaps a better spelling of 'inalloca' is down the road.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@203376 91177308-0d34-0410-b5e6-96231b3b80d8
2014-03-09 06:41:58 +00:00
Matt Arsenault
79e3fb53d6 Bug 18228 - Fix accepting bitcasts between vectors of pointers with a
different number of elements.

Bitcasts were passing with vectors of pointers with different number of
elements since the number of elements was checking
SrcTy->getVectorNumElements() == SrcTy->getVectorNumElements() which
isn't helpful. The addrspacecast was also wrong, but that case at least
is caught by the verifier. Refactor bitcast and addrspacecast handling
in castIsValid to be more readable and fix this problem.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199821 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-22 19:21:33 +00:00
Reid Kleckner
3cbfa1617f Add an inalloca flag to allocas
Summary:
The only current use of this flag is to mark the alloca as dynamic, even
if its in the entry block.  The stack adjustment for the alloca can
never be folded into the prologue because the call may clear it and it
has to be allocated at the top of the stack.

Reviewers: majnemer

CC: llvm-commits

Differential Revision: http://llvm-reviews.chandlerc.com/D2571

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199525 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-17 23:58:17 +00:00
Cameron McInally
9ad2161ea7 Clean up RUN command for Assembler/getInt.ll.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199158 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-13 22:37:35 +00:00
Cameron McInally
486fdf2e65 Fix uninitialized warning in llvm/lib/IR/DataLayout.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199147 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-13 22:04:55 +00:00
Benjamin Kramer
ccdb9c9483 Fix broken CHECK lines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199016 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-11 21:06:00 +00:00
Matt Arsenault
ee60d39cdd Allow addrspacecast in global aliases
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198349 91177308-0d34-0410-b5e6-96231b3b80d8
2014-01-02 20:55:01 +00:00
Nick Lewycky
99cebadb5c Fold vector selects with undef elements in the condition. Fixes PR18319.
Patch by Ilia Filippov!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@198267 91177308-0d34-0410-b5e6-96231b3b80d8
2013-12-31 19:30:47 +00:00
Manman Ren
bc8569d0c0 Debug Info: update testing cases to specify the debug info version number.
We are going to drop debug info without a version number or with a different
version number, to make sure we don't crash when we see bitcode files with
different debug info metadata format.

Make tests more robust by removing hard-coded metadata numbers in CHECK lines.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195535 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-23 01:16:29 +00:00
Rafael Espindola
edeaa6454e Make it explicit that nulls are not allowed in names.
The object files we support use null terminated strings, so there is no way to
support these.

This patch adds an assert to catch bad API use and an error check in the .ll
parser.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@195155 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-19 21:12:39 +00:00
Matt Arsenault
59d3ae6cdc Add addrspacecast instruction.
Patch by Michele Scandale!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194760 91177308-0d34-0410-b5e6-96231b3b80d8
2013-11-15 01:34:59 +00:00
Matt Arsenault
c4a8c07f64 Change objectsize intrinsic to accept different address spaces.
Bitcasting everything to i8* won't work. Autoupgrade the old
intrinsic declarations to use the new mangling.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192117 91177308-0d34-0410-b5e6-96231b3b80d8
2013-10-07 18:06:48 +00:00
Richard Smith
9401181aed Remove verifier check that attribute 'builtin' is only applied to calls to
functions marked 'nobuiltin'. That approach doesn't play well with LTO, and
there's no harm in marking a call as 'builtin' if it was going to be a builtin
regardless.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190233 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-07 00:25:48 +00:00
Manman Ren
1307103dff Debug Info Testing: updated to use NULL instead of "i32 0" in a few fields.
Field 2 of DIType (Context), field 9 of DIDerivedType (TypeDerivedFrom),
field 12 of DICompositeType (ContainingType), fields 2, 7, 12 of DISubprogram
(Context, Type, ContainingType).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190205 91177308-0d34-0410-b5e6-96231b3b80d8
2013-09-06 21:03:58 +00:00
Manman Ren
6e3cd0ebe2 Debug Info: add an identifier field to DICompositeType.
DICompositeType will have an identifier field at position 14. For now, the
field is set to null in DIBuilder.
For DICompositeTypes where the template argument field (the 13th field)
was optional, modify DIBuilder to make sure the template argument field is set.
Now DICompositeType has 15 fields.

Update DIBuilder to use NULL instead of "i32 0" for null value of a MDNode.
Update verifier to check that DICompositeType has 15 fields and the last
field is null or a MDString.

Update testing cases to include an extra field for DICompositeType.
The identifier field will be used by type uniquing so a front end can
genearte a DICompositeType with a unique identifer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189282 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-26 22:39:55 +00:00
Daniel Dunbar
24ec2e5a72 [tests] Cleanup initialization of test suffixes.
- Instead of setting the suffixes in a bunch of places, just set one master
   list in the top-level config. We now only modify the suffix list in a few
   suites that have one particular unique suffix (.ml, .mc, .yaml, .td, .py).

 - Aside from removing the need for a bunch of lit.local.cfg files, this enables
   4 tests that were inadvertently being skipped (one in
   Transforms/BranchFolding, a .s file each in DebugInfo/AArch64 and
   CodeGen/PowerPC, and one in CodeGen/SI which is now failing and has been
   XFAILED).

 - This commit also fixes a bunch of config files to use config.root instead of
   older copy-pasted code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188513 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-16 00:37:11 +00:00
Tim Northover
dcef6a7400 Fix FileCheck --check-prefix lines.
Various tests had sprung up over the years which had --check-prefix=ABC on the
RUN line, but "CHECK-ABC:" later on. This happened to work before, but was
strictly incorrect. FileCheck is getting stricter soon though.

Patch by Ron Ofir.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188173 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-12 12:43:26 +00:00
Eric Christopher
13aeceb861 DISubprogram metadata have an MDNode representing which base type
contains the vtable pointer for the class as the operand at index
12. Replace the i32 0 with a null MDNode.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187970 91177308-0d34-0410-b5e6-96231b3b80d8
2013-08-08 08:35:37 +00:00
Manman Ren
096880b590 Debug Info: enable verifier for testing cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187375 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-29 20:18:19 +00:00
Manman Ren
2d69cc4bae Debug Info Verifier: verify SPs in llvm.dbg.sp.
Also always add DIType, DISubprogram and DIGlobalVariable to the list
in DebugInfoFinder without checking them, so we can verify them later
on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187285 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-27 01:26:08 +00:00
Rafael Espindola
16a0de5b4a Next batch of -disable-debug-info-verifier.
These tests fail without it if pipefail is enabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187205 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-26 14:16:30 +00:00
Manman Ren
a280a839f5 Update testing cases to pass debug info verifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187083 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-24 22:23:00 +00:00
Rafael Espindola
e9bff745a8 Add -disable-debug-info-verifier to a RUN line.
Found by running the test with pipefail enabled.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187046 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-24 14:56:31 +00:00
Manman Ren
3894b57228 Update testing cases to make them pass debug info verification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187016 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-24 01:26:37 +00:00
Manman Ren
0e29eeec27 Debug Info Finder: use processDeclare and processValue to list debug info
MDNodes used by DbgDeclareInst and DbgValueInst.

Another 16 testing cases failed and they are disabled with
-disable-debug-info-verifier.
A total of 34 cases are disabled with -disable-debug-info-verifier and will be
corrected.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186902 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-23 00:22:51 +00:00
Rafael Espindola
5b44586090 Fix test: It was missing run lines and llvm-dis has no -disable-verify option.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185550 91177308-0d34-0410-b5e6-96231b3b80d8
2013-07-03 16:27:55 +00:00
Michael Gottesman
2253a2f52f Added support for the Builtin attribute.
The Builtin attribute is an attribute that can be placed on function call site that signal that even though a function is declared as being a builtin,

rdar://problem/13727199

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185049 91177308-0d34-0410-b5e6-96231b3b80d8
2013-06-27 00:25:01 +00:00
David Blaikie
ad5a5e0427 Correct invalid debug info metadata
Code review feedback on r176838 by Patrik Hägglund.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176884 91177308-0d34-0410-b5e6-96231b3b80d8
2013-03-12 19:04:24 +00:00
Bill Wendling
7ab6c76ad1 Modify the LLVM assembly output so that it uses references to represent function attributes.
This makes the LLVM assembly look better. E.g.:

     define void @foo() #0 { ret void }
     attributes #0 = { nounwind noinline ssp }


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175605 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-20 07:21:42 +00:00
Bill Wendling
595ef3e314 FileCheck-ize the tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174865 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-11 08:34:57 +00:00
Michael Gottesman
a2de37c897 Added LLVM Asm/Bitcode Reader/Writer support for new IR keyword externally_initialized.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174340 91177308-0d34-0410-b5e6-96231b3b80d8
2013-02-05 05:57:38 +00:00
Dan Gohman
d363ae5299 Fix ConstantFold's folding of icmp instructions to recognize that,
for example, a one-past-the-end pointer from one global variable may
be equal to the base pointer of another global variable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173995 91177308-0d34-0410-b5e6-96231b3b80d8
2013-01-31 00:01:45 +00:00
Michael Ilseman
a52f3ae45c Fast-math test case for bitcode and textual reading/writing
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168647 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-27 00:45:08 +00:00
Justin Holewinski
eaff2d55a9 Preserve address space of forward-referenced global variables in the LL parser
Before, the parser would assert on the following code:

@a2 = global i8 addrspace(1)* @a
@a = addrspace(1) global i8 0

because the type of @a was "i8*" instead of "i8 addrspace(1)*" when parsing
the initializer for @a2.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168197 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-16 21:03:47 +00:00
Duncan Sands
2333e29be4 Relax the restrictions on vector of pointer types, and vector getelementptr.
Previously in a vector of pointers, the pointer couldn't be any pointer type,
it had to be a pointer to an integer or floating point type.  This is a hassle
for dragonegg because the GCC vectorizer happily produces vectors of pointers
where the pointer is a pointer to a struct or whatever.  Vector getelementptr
was restricted to just one index, but now that vectors of pointers can have
any pointer type it is more natural to allow arbitrary vector getelementptrs.
There is however the issue of struct GEPs, where if each lane chose different
struct fields then from that point on each lane will be working down into
unrelated types.  This seems like too much pain for too little gain, so when
you have a vector struct index all the elements are required to be the same.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167828 91177308-0d34-0410-b5e6-96231b3b80d8
2012-11-13 12:59:33 +00:00
Nick Lewycky
64ea275fe4 Don't crash if a .ll file contains a forward-reference that looks like a global
value but later turns out to be a function.

Unfortunately, we can't fold tests into a single file because we only get one
error out of llvm-as.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165680 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-11 00:38:25 +00:00
Bill Wendling
28d1c60f89 Inline the checks for mutually exclusive attributes since they're used in only one module.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165539 91177308-0d34-0410-b5e6-96231b3b80d8
2012-10-09 20:11:19 +00:00
Eli Friedman
6b951b25c3 The normal edge of an invoke is not allowed to branch to a block with a
landingpad.  Enforce it in the verifier, and fix the regression tests to match.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161697 91177308-0d34-0410-b5e6-96231b3b80d8
2012-08-10 20:55:20 +00:00
Chandler Carruth
1de43ede89 Fix the remaining TCL-style quotes found in the testsuite. This is
another mechanical change accomplished though the power of terrible Perl
scripts.

I have manually switched some "s to 's to make escaping simpler.

While I started this to fix tests that aren't run in all configurations,
the massive number of tests is due to a really frustrating fragility of
our testing infrastructure: things like 'grep -v', 'not grep', and
'expected failures' can mask broken tests all too easily.

Essentially, I'm deeply disturbed that I can change the testsuite so
radically without causing any change in results for most platforms. =/

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159547 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-02 19:09:46 +00:00
Chandler Carruth
49589f0d0e Convert the uses of '|&' to use '2>&1 |' instead, which works on old
versions of Bash. In addition, I can back out the change to the lit
built-in shell test runner to support this.

This should fix the majority of fallout on Darwin, but I suspect there
will be a few straggling issues.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159544 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-02 18:37:59 +00:00
Chandler Carruth
4177e6fff5 Convert all tests using TCL-style quoting to use shell-style quoting.
This was done through the aid of a terrible Perl creation. I will not
paste any of the horrors here. Suffice to say, it require multiple
staged rounds of replacements, state carried between, and a few
nested-construct-parsing hacks that I'm not proud of. It happens, by
luck, to be able to deal with all the TCL-quoting patterns in evidence
in the LLVM test suite.

If anyone is maintaining large out-of-tree test trees, feel free to poke
me and I'll send you the steps I used to convert things, as well as
answer any painful questions etc. IRC works best for this type of thing
I find.

Once converted, switch the LLVM lit config to use ShTests the same as
Clang. In addition to being able to delete large amounts of Python code
from 'lit', this will also simplify the entire test suite and some of
lit's architecture.

Finally, the test suite runs 33% faster on Linux now. ;]
For my 16-hardware-thread (2x 4-core xeon e5520): 36s -> 24s

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159525 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-02 12:47:22 +00:00
Chandler Carruth
563add96ce Make tests which first provide a negative assertion via 'not', then
a pipeline, and then a positive assertion via grep, use two RUN lines
instead.

Supporting these complex ideas of 'success' and 'failure' across
multiple stages of a pipeline is brittle in the shell world, and would
block switching to ShTest format; it only worked due to contrivances
introduced by the TclTest format.

Writing this as two separate RUN lines seems clearer in any event.

This is another step toward completely removing TclTests from lit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159524 91177308-0d34-0410-b5e6-96231b3b80d8
2012-07-02 12:23:19 +00:00
Hans Wennborg
ce718ff9f4 Extend the IL for selecting TLS models (PR9788)
This allows the user/front-end to specify a model that is better
than what LLVM would choose by default. For example, a variable
might be declared as

  @x = thread_local(initialexec) global i32 42

if it will not be used in a shared library that is dlopen'ed.

If the specified model isn't supported by the target, or if LLVM can
make a better choice, a different model may be used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159077 91177308-0d34-0410-b5e6-96231b3b80d8
2012-06-23 11:37:03 +00:00
Tobias Grosser
057beb8d4f Add half support to LLVM (for OpenCL)
Submitted by: Anton Lokhmotov  <Anton.Lokhmotov@arm.com>

Approved by: o Anton Korobeynikov
             o Micah Villmow
             o David Neto

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157393 91177308-0d34-0410-b5e6-96231b3b80d8
2012-05-24 15:59:06 +00:00
Bill Wendling
864737cc51 Remove old 'grep' lines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154283 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-08 11:53:54 +00:00
Bill Wendling
a0126afec8 FileCheckize these testcases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154281 91177308-0d34-0410-b5e6-96231b3b80d8
2012-04-08 11:00:38 +00:00
Eli Bendersky
0f0c411079 Replace all instances of dg.exp file with lit.local.cfg, since all tests are run with LIT now and now Dejagnu. dg.exp is no longer needed.
Patch reviewed by Daniel Dunbar. It will be followed by additional cleanup patches.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150664 91177308-0d34-0410-b5e6-96231b3b80d8
2012-02-16 06:28:33 +00:00
Chandler Carruth
2106badea3 Add an explicit test of the auto-upgrade functionality for the new
intrinsic syntax.

Now that this is explicitly covered, I plan to upgrade the existing test
suite to use an explicit immediate. Note that I plan to specify 'true'
in most places rather than the auto-upgraded value as that is the far
more common value to end up here as that is the value coming from GCC's
builtins. The only place I'm likely to put a 'false' in is when testing
x86 which actually has different instructions for the two variants.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146369 91177308-0d34-0410-b5e6-96231b3b80d8
2011-12-12 11:23:11 +00:00
Chris Lattner
3211c6e31b remove autoupgrade support for old forms of llvm.prefetch and the old
trampoline forms.  Both of these were correct in LLVM 3.0, and we don't
need to support LLVM 2.9 and earlier in mainline.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145174 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-27 07:42:04 +00:00
Chris Lattner
663aebf8d6 remove some old autoupgrade logic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145167 91177308-0d34-0410-b5e6-96231b3b80d8
2011-11-27 06:10:54 +00:00
Eli Friedman
c3d3598425 Fix a typo in the bitcode reader in the handling of atomic stores. Reported by David Meyer on llvmdev.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140040 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-19 19:41:28 +00:00
Duncan Sands
4a544a79bd Split the init.trampoline intrinsic, which currently combines GCC's
init.trampoline and adjust.trampoline intrinsics, into two intrinsics
like in GCC.  While having one combined intrinsic is tempting, it is
not natural because typically the trampoline initialization needs to
be done in one function, and the result of adjust trampoline is needed
in a different (nested) function.  To get around this llvm-gcc hacks the
nested function lowering code to insert an additional parent variable
holding the adjust.trampoline result that can be accessed from the child
function.  Dragonegg doesn't have the luxury of tweaking GCC code, so it
stored the result of adjust.trampoline in the memory GCC set aside for
the trampoline itself (this is always available in the child function),
and set up some new memory (using an alloca) to hold the trampoline.
Unfortunately this breaks Go which allocates trampoline memory on the
heap and wants to use it even after the parent has exited (!).  Rather
than doing even more hacks to get Go working, it seemed best to just use
two intrinsics like in GCC.  Patch mostly by Sanjoy Das.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139140 91177308-0d34-0410-b5e6-96231b3b80d8
2011-09-06 13:37:06 +00:00
Bill Wendling
1a9a2d0d6b Update to the new EH scheme.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138606 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-25 23:48:37 +00:00
Eli Friedman
f03bb260c9 Move "atomic" and "volatile" designations on instructions after the opcode
of the instruction.

Note that this change affects the existing non-atomic load and store
instructions; the parser now accepts both forms, and the change is noted
in the release notes.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137527 91177308-0d34-0410-b5e6-96231b3b80d8
2011-08-12 22:50:01 +00:00
Chris Lattner
1afcace3a3 Land the long talked about "type system rewrite" patch. This
patch brings numerous advantages to LLVM.  One way to look at it
is through diffstat:
 109 files changed, 3005 insertions(+), 5906 deletions(-)

Removing almost 3K lines of code is a good thing.  Other advantages
include:

1. Value::getType() is a simple load that can be CSE'd, not a mutating
   union-find operation.
2. Types a uniqued and never move once created, defining away PATypeHolder.
3. Structs can be "named" now, and their name is part of the identity that
   uniques them.  This means that the compiler doesn't merge them structurally
   which makes the IR much less confusing.
4. Now that there is no way to get a cycle in a type graph without a named
   struct type, "upreferences" go away.
5. Type refinement is completely gone, which should make LTO much MUCH faster
   in some common cases with C++ code.
6. Types are now generally immutable, so we can use "Type *" instead 
   "const Type *" everywhere.

Downsides of this patch are that it removes some functions from the C API,
so people using those will have to upgrade to (not yet added) new API.  
"LLVM 3.0" is the right time to do this.

There are still some cleanups pending after this, this patch is large enough
as-is.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134829 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-09 17:41:24 +00:00
Chris Lattner
5445ecdf69 more tests not making the jump into the brave new world.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134820 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-09 16:57:10 +00:00
Chris Lattner
ca5470c99d remove some crufy old tests that aren't adding much value
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134819 91177308-0d34-0410-b5e6-96231b3b80d8
2011-07-09 16:55:16 +00:00
Chris Lattner
a53616d08b Remove support for parsing the "type i32" syntax for defining a numbered
top level type without a specified number.  This syntax isn't documented
and blocks forward progress.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133371 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-19 00:03:46 +00:00
Chris Lattner
b85e4eba85 rip out a ton of intrinsic modernization logic from AutoUpgrade.cpp, which is
for pre-2.9 bitcode files.  We keep x86 unaligned loads, movnt, crc32, and the
target indep prefetch change.

As usual, updating the testsuite is a PITA.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133337 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-18 06:05:24 +00:00
Chris Lattner
d589099eec make the asmparser reject function and type redefinitions. 'Merging' hasn't been
needed since llvm-gcc 3.4 days.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133248 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-17 07:06:44 +00:00
Chris Lattner
437544f25c remove parser support for the obsolete "multiple return values" syntax, which
was replaced with return of a "first class aggregate".



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133245 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-17 06:49:41 +00:00
Chris Lattner
26b0000166 manually upgrade a bunch of tests to modern syntax, and remove some that
are either unreduced or only test old syntax.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133228 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-17 03:14:27 +00:00
Nick Lewycky
1e85ef645d Add testcase for r133050 which added support for printing and parsing escaped
names for named metadata nodes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133166 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-16 17:14:38 +00:00
Bruno Cardoso Lopes
9a767330f5 Add one more argument to the prefetch intrinsic to indicate whether it's a data
or instruction cache access. Update the targets to match it and also teach
autoupgrade.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132976 91177308-0d34-0410-b5e6-96231b3b80d8
2011-06-14 04:58:37 +00:00
Duncan Sands
bb1695e333 Tighten up checking of the validity of casts. (1) The IR parser would
happily accept things like "sext <2 x i32> to <999 x i64>".  It would
also accept "sext <2 x i32> to i64", though the verifier would catch
that later.  Fixed by having castIsValid check that vector lengths match
except when doing a bitcast.  (2) When creating a cast instruction, check
that the cast is valid (this was already done when creating constexpr
casts).  While there, replace getScalarSizeInBits (used to allow more
vector casts) with getPrimitiveSizeInBits in getCastOpcode and isCastable
since vector to vector casts are now handled explicitly by passing to the
element types; i.e. this bit should result in no functional change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131532 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-18 09:21:57 +00:00
Bill Wendling
9493a285d1 Replace the "movnt" intrinsics with a native store + nontemporal metadata bit.
<rdar://problem/8460511>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130791 91177308-0d34-0410-b5e6-96231b3b80d8
2011-05-03 21:11:17 +00:00
Bill Wendling
f93f7b2446 Reapply r129401 with patch for clang.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129419 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-13 00:36:11 +00:00
Bill Wendling
f9b2dc66c8 Revert r129401 for now. Clang is using the old way of doing things.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129403 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-12 22:59:27 +00:00
Bill Wendling
d5f323d70b Remove the unaligned load intrinsics in favor of using native unaligned loads.
Now that we have a first-class way to represent unaligned loads, the unaligned
load intrinsics are superfluous.

First part of <rdar://problem/8460511>.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129401 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-12 22:46:31 +00:00
Jay Foad
3e2f74e6d6 Remove some support for ReturnInsts with multiple operands, and for
returning a scalar value in a function whose return type is a single-
element structure or array.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128810 91177308-0d34-0410-b5e6-96231b3b80d8
2011-04-04 07:44:02 +00:00
Stuart Hastings
c74513d1b6 Reapply: Add type output to llvm-dis annotations. Patch by Yuri!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127824 91177308-0d34-0410-b5e6-96231b3b80d8
2011-03-17 19:50:04 +00:00
Chris Lattner
f067d584a8 implement .ll and .bc support for nsw/nuw on shl and exact on lshr/ashr.
Factor some code better.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125006 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-07 16:40:21 +00:00
Chris Lattner
35bda8914c enhance vmcore to know that udiv's can be exact, and add a trivial
instcombine xform to exercise this.

Nothing forms exact udivs yet though.  This is progress on PR8862



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124992 91177308-0d34-0410-b5e6-96231b3b80d8
2011-02-06 21:44:57 +00:00
Rafael Espindola
3971df5203 Move unnamed_addr after the function arguments on Sabre's request.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124209 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-25 19:09:56 +00:00
Rafael Espindola
ba7c38c36a Allow unnamed_addr on declarations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123529 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-15 08:15:00 +00:00
Rafael Espindola
d72479c2f0 Reject uses of unnamed_addr in declarations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123358 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-13 01:30:30 +00:00
Rafael Espindola
bea4626f93 First step in fixing PR8927:
Add a unnamed_addr bit to global variables and functions. This will be used
to indicate that the address is not significant and therefore the constant
or function can be merged with others.

If an optimization pass can show that an address is not used, it can set this.

Examples of things that can have this set by the FE are globals created to
hold string literals and C++ constructors.

Adding unnamed_addr to a non-const global should have no effect unless
an optimization can transform that global into a constant.

Aliases are not allowed to have unnamed_addr since I couldn't figure
out any use for it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123063 91177308-0d34-0410-b5e6-96231b3b80d8
2011-01-08 16:42:36 +00:00
Frits van Bommel
a4805cf6ef Fix PR 4170 by having ExtractValueInst::getIndexedType() reject out-of-bounds indexing.
Also add asserts that the indices are valid in InsertValueInst::init(). ExtractValueInst already asserts when constructed with invalid indices.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120956 91177308-0d34-0410-b5e6-96231b3b80d8
2010-12-05 20:50:26 +00:00
Bill Wendling
6cf6c79e82 The pshufw instruction came about in MMX2 when SSE was introduced. Don't place
it in with the SSSE3 instructions.

Steward! Could you place this chair by the aft sun deck? I'm trying to get away
from the Astors. They are such boors!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115552 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-04 20:24:01 +00:00
Bill Wendling
4066010302 Auto-upgrade tests for the new MMX intrinsic calls.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115456 91177308-0d34-0410-b5e6-96231b3b80d8
2010-10-03 01:12:20 +00:00
Dale Johannesen
0488fb649a Massive rewrite of MMX:
The x86_mmx type is used for MMX intrinsics, parameters and
return values where these use MMX registers, and is also
supported in load, store, and bitcast.

Only the above operations generate MMX instructions, and optimizations
do not operate on or produce MMX intrinsics. 

MMX-sized vectors <2 x i32> etc. are lowered to XMM or split into
smaller pieces.  Optimizations may occur on these forms and the
result casted back to x86_mmx, provided the result feeds into a
previous existing x86_mmx operation.

The point of all this is prevent optimizations from introducing
MMX operations, which is unsafe due to the EMMS problem.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115243 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-30 23:57:10 +00:00
Dale Johannesen
8e88c908b0 Basic smoke test for new x86mmx type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113783 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-13 21:01:36 +00:00
Chris Lattner
6cd71f0c40 add a new "llvm-dis -show-annotations" option, which causes it to print
#uses comments, with a testcase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112906 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 23:21:44 +00:00
Chris Lattner
042ff0358d remove some noise from tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112889 91177308-0d34-0410-b5e6-96231b3b80d8
2010-09-02 22:35:33 +00:00
Chris Lattner
61c70e98ac remove unions from LLVM IR. They are severely buggy and not
being actively maintained, improved, or extended.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112356 91177308-0d34-0410-b5e6-96231b3b80d8
2010-08-28 04:09:24 +00:00
Dan Gohman
6bbe671e1c Make GlobalValue alignment consistent with load, store, and alloca
alignment, fixing silent truncation of alignment values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109653 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 20:56:48 +00:00
Dan Gohman
138aa2a82b Define a maximum supported alignment value for load, store, and
alloca instructions (constrained by their internal encoding),
and add error checking for it. Fix an instcombine bug which
generated huge alignment values (null is infinitely aligned).
This fixes undefined behavior noticed by John Regehr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109643 91177308-0d34-0410-b5e6-96231b3b80d8
2010-07-28 20:12:04 +00:00
Chris Lattner
d2075586c8 add newlines at the end of files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100705 91177308-0d34-0410-b5e6-96231b3b80d8
2010-04-07 22:53:17 +00:00
Chris Lattner
fdfeb6976f Add support for a union type in LLVM IR. Patch by Talin!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96011 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-12 20:49:41 +00:00
Victor Hernandez
2b3365ca1d Function-local metadata whose operands had been optimized to no longer refer to function-local IR were not getting written by BitcodeWriter; solution is for these metadata to be enumerated just like global metadata.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95467 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-06 01:21:09 +00:00
Victor Hernandez
af6ce14d67 Fix (and test) function-local metadata that occurs before the instruction that it refers to; fix is to not enumerate operands of function-local metadata until after all instructions have been enumerated
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95269 91177308-0d34-0410-b5e6-96231b3b80d8
2010-02-04 01:13:08 +00:00
Victor Hernandez
3a32865d58 Improve llvm.dbg.declare intrinsic by referring directly to the storage in its first argument, via function-local metadata (instead of via a bitcast).
This patch also cleans up code that expects there to be a bitcast in the first argument and testcases that call llvm.dbg.declare.
It also strips old llvm.dbg.declare intrinsics that did not pass metadata as the first argument.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93531 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 19:04:09 +00:00
Victor Hernandez
5f03238d62 Revert r93504 because older uses of llvm.dbg.declare intrinsics need to be auto-upgraded
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93515 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 17:36:47 +00:00
Victor Hernandez
283ba2fbb4 Improve llvm.dbg.declare intrinsic by referring directly to the storage in its first argument, via function-local metadata (instead of via a bitcast).
This patch also cleans up code that expects there to be a bitcast in the first argument and testcases that call llvm.dbg.declare.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93504 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-15 03:37:48 +00:00
Victor Hernandez
b2eb48180a Extend testcase to also test llvm.dbg.value intrinsic
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93408 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 02:12:41 +00:00
Victor Hernandez
ac260e1b04 Now that LLParser, AsmWriter, BitcodeReader, and BitcodeWriter all correctly support function-local metadata, test it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93406 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-14 01:51:28 +00:00
Victor Hernandez
bf170d4c2f Re-add parsing of function-local metadata; this time with testcase.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92793 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 22:22:14 +00:00
Dan Gohman
aceba31b7a Delete useless trailing semicolons.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92740 91177308-0d34-0410-b5e6-96231b3b80d8
2010-01-05 17:55:26 +00:00
Chris Lattner
6e7f3b39ef add some basic named MD tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92336 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-31 03:00:49 +00:00
Chris Lattner
628c13ad76 reimplement insertvalue/extractvalue metadata handling to not blindly
accept invalid input.  Actually add a testcase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92297 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-30 05:14:00 +00:00
Chris Lattner
860775c2b0 fix parsing of mdstring values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92290 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-30 04:13:37 +00:00
Chris Lattner
3f3a0f6b49 Each instruction is allowed to have *multiple* different
metadata objects on them.  Though the entire compiler supports this,
the asmparser didn't.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92270 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 21:25:40 +00:00
Chris Lattner
837eda93ee Do not crash when .ll printing metadata that smells like debug info, but isn't.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92268 91177308-0d34-0410-b5e6-96231b3b80d8
2009-12-29 21:17:33 +00:00
Dale Johannesen
7d977a3e80 Adjust testcases for msasm -> alignstack.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84796 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-21 23:29:12 +00:00
Dale Johannesen
4360298d2b Add an "msasm" flag to inline asm as suggested in PR 5125.
A little ugliness is accepted to keep the binary file format
compatible.  No functional change yet.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84020 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-13 20:46:56 +00:00
Nick Lewycky
3892baac42 Clean up the usage of evaluateICmpRelation's return value.
Add another line to the ConstantExprFold test to demonstrate the GEPs may not
wrap around in either the signed or unsigned senses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82361 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-20 04:27:06 +00:00
Chris Lattner
dd4238e04d fix PR4963: folding insertvalue would sometimes turn a packed struct into
an unpacked one.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81845 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-15 06:28:12 +00:00
Dan Gohman
d5b9cbacbc Fix this test to test what it was originally intended to test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81539 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 18:16:43 +00:00
Dan Gohman
f2f6ce65b7 Change tests from "opt %s" to "opt < %s" so that opt doesn't see the
input filename so that opt doesn't print the input filename in the
output so that grep lines in the tests don't unintentionally match
strings in the input filename.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81537 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 18:01:28 +00:00
Chris Lattner
a5ef57df7c fix test to not get a moduleid that matches 'br'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81526 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 16:47:41 +00:00
Dan Gohman
3bfbc4587a Teach lib/VMCore/ConstantFold.cpp how to set the inbounds keyword and
how to fold notionally-out-of-bounds array getelementptr indices instead
of just doing these in lib/Analysis/ConstantFolding.cpp, because it can
be done in a fairly general way without TargetData, and because not all
constants are visited by lib/Analysis/ConstantFolding.cpp. This enables
more constant folding.

Also, set the "inbounds" flag when the getelementptr indices are
one-past-the-end.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81483 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-11 00:04:14 +00:00
Dan Gohman
3e054fe9ef Use opt -S instead of piping bitcode output through llvm-dis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81257 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 22:34:10 +00:00
Dan Gohman
b1e1e82c54 Change these tests to feed the assembly files to opt directly, instead
of using llvm-as, now that opt supports this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81226 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-08 16:50:01 +00:00
Dan Gohman
f8dbee7cea Reappy r80998, now that the GlobalOpt bug that it exposed on MiniSAT is fixed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81172 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-07 23:54:19 +00:00
Daniel Dunbar
92a97a9166 Revert "Include optional subclass flags, such as inbounds, nsw, etc., ...", this
breaks MiniSAT on x86_64.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81098 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06 00:11:24 +00:00
Daniel Dunbar
0985b3c81c Fix spacing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81097 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-06 00:00:13 +00:00
Dan Gohman
859fff476d Include optional subclass flags, such as inbounds, nsw, etc., in the
Constant uniquing tables. This allows distinct ConstantExpr objects
with the same operation and different flags.

Even though a ConstantExpr "a + b" is either always overflowing or
never overflowing (due to being a ConstantExpr), it's still necessary
to be able to represent it both with and without overflow flags at
the same time within the IR, because the safety of the flag may
depend on the context of the use. If the constant really does overflow,
it wouldn't ever be safe to use with the flag set, however the use
may be in code that is never actually executed.

This also makes it possible to merge all the flags tests into a single test.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80998 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-04 12:08:11 +00:00
Dan Gohman
fea1dd0804 Remove obsolete -f flags.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79992 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-25 15:38:29 +00:00
Dan Gohman
cf20ac4fd1 Various AsmWriter output cleanups. Use WriteAsOperand instead of
PrintUnmangledNameSafely.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78878 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 01:36:44 +00:00
Dan Gohman
3845e50ede Extend the AsmWriter to print unnamed numbered types as "%0 = type ..."
and unnamed numbered global variables as "@0 = global ...". Extend the
AsmParser to recognize these forms.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78859 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-12 23:32:33 +00:00
Dan Gohman
dd8004dc73 Add a new keyword 'inbounds' for use with getelementptr. See the
LangRef.html changes for details.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77259 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 21:53:46 +00:00
Dan Gohman
59858cf792 Change the assembly syntax for nsw, nuw, and exact, putting them
after their associated opcodes rather than before. This makes them
a little easier to read.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77194 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 16:11:46 +00:00
Eli Friedman
4e9bac3769 Fix assert assembling zero-argument constant GEP.
There's still a strict-aliasing violation here, but I don't feel like 
dealing with that right now...



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77005 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 21:56:17 +00:00
Dan Gohman
08d012eba4 Rename the new unsigned and signed keywords to nuw and nsw,
which stand for no-unsigned-wrap and no-signed-wrap.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76810 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-22 22:44:56 +00:00
Dan Gohman
1224c38698 Assembly and Bitcode support for unsigned/signed overflow flags and
exact sdiv flags.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76475 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-20 21:19:07 +00:00
Dan Gohman
2467677cd6 Apparently Darwin doesn't have /dev/full :-(.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75809 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 18:41:11 +00:00
Dan Gohman
6a60e16662 Add a testcase for raw_ostream error checking.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75795 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 16:47:02 +00:00
Nick Lewycky
7f6aa2b162 Remove the vicmp and vfcmp instructions. Because we never had a release with
these instructions, no autoupgrade or backwards compatibility support is
provided.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74991 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-08 03:04:38 +00:00
Dan Gohman
ae3a0be92e Split the Add, Sub, and Mul instruction opcodes into separate
integer and floating-point opcodes, introducing
FAdd, FSub, and FMul.

For now, the AsmParser, BitcodeReader, and IRBuilder all preserve
backwards compatability, and the Core LLVM APIs preserve backwards
compatibility for IR producers. Most front-ends won't need to change
immediately.

This implements the first step of the plan outlined here:
http://nondot.org/sabre/LLVMNotes/IntegerOverflow.txt


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72897 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-04 22:49:04 +00:00
Torok Edwin
382cb2189a Revert this. There's no way to verifiy indirect calls, and an optimizer can turn
indirect call into direct call, thus the verifier would reject something it
previously accepted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72249 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-22 07:12:05 +00:00
Torok Edwin
9107c54693 Verify that calling conventions match function prototype.
This only rejects mismatches between target specific calling convention
and C/LLVM specific calling convention.
There are too many fastcc/C, coldcc/cc42 mismatches in the testsuite, these are
not reject by the verifier.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72248 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-22 06:41:43 +00:00
Dan Gohman
fa6c716842 Make this test slightly more strict.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70180 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-27 03:05:26 +00:00
Sanjiv Gupta
9341c808ae Any size of integral indices are allowed in gep for indexing into sequential types. Also adding a test case to check the indices type allowed into struct.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70134 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-26 17:14:35 +00:00
Chris Lattner
b5fbb06e32 add testcase for strange types of gep indices
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70085 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-25 22:20:49 +00:00
Chris Lattner
040f758e3a testcase and asmparser fix for PR4066
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70080 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-25 21:26:00 +00:00
Torok Edwin
4cdc44c82c Fix g++-4.4.0 warning, it was causing llvm-nm to fail on wrapped BC files:
Path.cpp:59: warning: case label value exceeds maximum value for type
magic[0] is a (signed) char, but some case values are unsigned (e.g. 0xde).
When magic[0] was 0xde, the switch has taken the default branch instead of case
0xde branch.
Apparently this was the behaviour with older versions of gcc too, but not with g++.
Now g++-4.4 behaves as gcc, and ignores unsigned case values out of range signed
range.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70038 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-25 10:25:12 +00:00
Chris Lattner
ad9ad7c827 Fix a bug in our autoupgrade support: in an argument list to a function
call, we should treat "i64 zext" as the start of a constant expr, but
"i64 0 zext" as an argument with an obsolete attribute on it (this form
is already tested by test/Assembler/2007-07-30-AutoUpgradeZextSext.ll).

Make the autoupgrade logic more discerning to avoid treating "i64 zext"
as an old-style attribute, causing us to reject a valid constant expr.
This fixes PR3876.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67682 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-25 06:36:36 +00:00
Dan Gohman
c131793904 Apply a patch by Micah Villmow to fix AsmParser to accept vector
shift constant expressions, and add support for folding vector
shift constant expressions. This fixes PR3802.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67010 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-14 17:09:17 +00:00
Chris Lattner
f6f0bdfec3 Fix a pretty awesome bug that only happened in a strange case with anonymous
types.  This was reading the uint for the keyword after the token was advanced.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65743 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-01 00:53:13 +00:00
Chris Lattner
413fd2304d Fix a long-standing bug and misfeature of the disassembler: when dealing with a
stripped .bc file, it didn't make any attempt to try to reuse anonymous types.
This causes an amazing type explosion due to types getting duplicated everywhere
they are referenced and other problems.

This also caused correctness issues, because opaque types are unique for each time
they are uttered in the file.  This means that stripping a .bc file could produce
a .ll file that could not be assembled (e.g. 2009-02-28-StripOpaqueName.ll).

This patch fixes both of these issues.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65738 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-01 00:03:38 +00:00
Chris Lattner
f570e621ab add proper asmwriter and asmparser support for anonymous functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64953 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-18 21:48:13 +00:00
Nate Begeman
0091cf92c6 Remove now-incorrect test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63772 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-04 21:07:37 +00:00
Chris Lattner
91dad87ddc Fix PR3372
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63501 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-02 07:24:28 +00:00
Rafael Espindola
bb46f52027 Add the private linkage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62279 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-15 20:18:42 +00:00
Chris Lattner
012a03a1d4 this testcase is huge and hasn't regressed ever, I don't think it is worth keeping.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61931 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-08 19:01:45 +00:00
Duncan Sands
4050a2324c Don't spew bitcode to standard out if this test
fails, like it is right now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61690 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 10:52:29 +00:00
Chris Lattner
df98617b23 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61558 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-02 07:01:27 +00:00
Chris Lattner
c7e3069bfa 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57560 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-15 06:16:45 +00:00
Daniel Dunbar
76dea9547d Prevent assert when using '"' in names (via hexadecimal).
Update LangRef to mention \xx quoting in names.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57538 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-14 23:51:43 +00:00
Devang Patel
7c31085b1c Attributes noinline alwaysinline are incompatible
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56939 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-01 23:41:25 +00:00
Dan Gohman
e4c38bac31 Don't leave an output file in the test directory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56910 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-01 04:13:23 +00:00
Devang Patel
652203f3f3 Support inreg, zext and sext as return value attributes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56801 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-29 20:49:50 +00:00
Devang Patel
8526390768 Update tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56730 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-27 00:25:28 +00:00
Dan Gohman
fb2bbbe786 Re-enables the new vector select in the bitcode reader, by modifying the
bitcode reader/writer as follows:

- add and use new bitcode FUNC_CODE_INST_VSELECT to handle the llvm
select opcode using either i1 or [N x i1] as the selector.
- retain old BITCODE FUNC_CODE_INST_SELECT in the bitcode reader to
handle select on i1 for backwards compatibility with existing bitcode
files.
- re-enable the vector-select.ll test program.

Also, rename the recently added bitcode opcode FUNC_CODE_INST_VCMP to
FUNC_CODE_INST_CMP2 and make the bitcode writer use it to handle
fcmp/icmp on scalars or vectors. In the bitcode writer, use
FUNC_CODE_INST_CMP for vfcmp/vicmp only. In the bitcode reader, have
FUNC_CODE_INST_CMP handle icmp/fcmp returning bool, for backwards
compatibility with existing bitcode files.

Patch by Preston Gurd!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56233 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-16 01:01:33 +00:00
Dan Gohman
be919409cc Temporarily disable vector select in the bitcode reader. The
way it handles the type of the condition is breaking plain
scalar select in the case that the value is a
forward-reference.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55976 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-09 02:08:49 +00:00
Dan Gohman
f72fb679ef 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!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55969 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-09 01:02:47 +00:00
Devang Patel
7ad033c9e7 Read and write function notes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55657 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-02 21:47:13 +00:00
Devang Patel
9018f569be Function notes tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55648 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-02 20:58:16 +00:00
Chris Lattner
6ac28095c2 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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55539 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-29 17:12:13 +00:00
Dan Gohman
c3be0fd8c3 Fix the AsmWriter to not print extra spaces after parameter attributes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54351 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-05 15:51:44 +00:00
Nate Begeman
5bc1ea0736 Add vector shifts to the IR, patch by Eli Friedman.
CodeGen & Clang work coming next.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54161 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-29 15:49:41 +00:00
Chris Lattner
bbedb0e408 Fix a bunch of bugs handling vector compare constant expressions, fixing
PR2317.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53544 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-14 05:17:31 +00:00
Chris Lattner
d15990189d Implement PR2538
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53438 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-11 00:30:06 +00:00
Matthijs Kooijman
888fa33cfb Fix some escaping and quoting in RUN lines, mainly involving { and <. In two
cases quoting of <{ didn't work out, so I changed the grep to check for }>
instead.

This fixes 7 testcases that were not properly running before.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52182 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-10 16:04:47 +00:00
Matthijs Kooijman
1cd8f11cc0 For all RUN lines starting with "not", redirect stderr to /dev/null so tests
don't fail when (expected) error output is produced. This fixes 17 tests.

While I was there, I also made all RUN lines of the form "not llvm-as..." a bit
more consistent, they now all redirect stderr and stdout to /dev/null and use
input redirect to read their input.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52174 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-10 12:57:32 +00:00
Dan Gohman
7dc1def162 Re-apply 52002, allowing the verifier to accept non-MRV struct return
types on functions, with adjustments so that it accepts both
new-style aggregate returns and old-style MRV returns, including those
with only a single member.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52157 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-09 21:26:13 +00:00
Dan Gohman
836bfcd689 Revert 52002.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52030 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-05 23:57:06 +00:00
Matthijs Kooijman
411e6a5efb Change the Verifier to support returning first class aggregrates.
Add a testcase for functions returning first class aggregrates.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52002 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-05 14:00:36 +00:00
Dan Gohman
6d9861120e nounwindify.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51893 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-03 01:21:11 +00:00
Dan Gohman
6e68f59b78 Constant folding for insertvalue and extractvalue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51889 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-03 00:15:20 +00:00
Dan Gohman
81a0c0b44e 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51806 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-31 00:58:22 +00:00
Dan Gohman
80f0f616e8 Don't silently truncate array extents to 32 bits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51505 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-23 21:40:55 +00:00
Dan Gohman
e4977cf750 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51468 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-23 01:55:30 +00:00
Gabor Greif
5edf210bdf Eliminate questionable syntax for stdin redirection. This probably also speeds things up a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51357 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 22:07:21 +00:00
Gabor Greif
f6cadc440c sabre brings to my attention that the 'tr' suffix is also obsolete
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51349 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 21:00:03 +00:00
Gabor Greif
722243bd40 Rename the last test with .llx extension to .ll, resolve duplicate test by renaming to isnan2. Now that no test has llx ending there is no need to search for them from dg.exp too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51328 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-20 19:52:04 +00:00
Chris Lattner
7e4687a9f2 returning an empty multiple return list is not valid.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50135 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-23 05:29:14 +00:00
Chris Lattner
e972299f34 rename *.llx -> *.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49969 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-19 22:26:29 +00:00
Chris Lattner
d881ad2c57 Implement PR2206.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49967 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-19 22:17:26 +00:00
Dan Gohman
f4423b1e45 Teach llvm-as to accept function types with multiple return types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49945 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-19 00:24:39 +00:00
Devang Patel
d9d99ff8e8 Update bitcode reader and writer to handle multiple return values.
Take 2.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47583 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26 01:29:32 +00:00
Evan Cheng
1df439773c Backing out r47521 for now. This has broken a number of tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47533 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-23 19:32:32 +00:00
Devang Patel
e9fabd94ab Properly read and write bitcodes for multiple return values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47521 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-23 01:44:55 +00:00
Devang Patel
db71d63467 Let invoke return aggregate value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47425 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-21 02:14:01 +00:00
Devang Patel
bb4f8d4045 Let function call return aggregate.
Now, we have very first multiple return value testcase!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47424 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-21 01:54:02 +00:00
Devang Patel
ad9153ed25 XFAIL for now.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47411 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-20 23:10:42 +00:00
Devang Patel
2102cab02f Now functions can return aggregate values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47409 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-20 22:51:28 +00:00
Chris Lattner
689e8b294e Fix PR2060 by rejecting invalid types for integer constants.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47311 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 04:36:07 +00:00
Chris Lattner
26fdb11e4e this test isn't useful since we added @ notation for globals.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47229 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-17 00:12:03 +00:00
Chris Lattner
8a39257fa5 this line was commented out.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47228 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-17 00:09:08 +00:00
Tanya Lattner
709f6ecd03 Remove llvm-upgrade and update tests.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47227 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-16 23:55:46 +00:00
Tanya Lattner
91974939d0 Removing llvm upgrade, so remove tests specific to llvm-upgrade and update the tests that used it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47225 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-16 23:27:24 +00:00
Chris Lattner
d1bb1c2765 upgrade this test, which wasn't testing the right thing since llvm-upgrade came around.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47194 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-15 23:58:25 +00:00
Chris Lattner
01042345c8 rename llx -> ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47192 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-15 23:51:48 +00:00
Tanya Lattner
6e9bceea97 Remove llvm-upgrade
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47119 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-14 07:57:12 +00:00