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

166 Commits

Author SHA1 Message Date
Chris Lattner
2265d6280b Add support for a union type in LLVM IR. Patch by Talin!
llvm-svn: 96011
2010-02-12 20:49:41 +00:00
Victor Hernandez
e65222a748 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.
llvm-svn: 95467
2010-02-06 01:21:09 +00:00
Victor Hernandez
28f795182c 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
llvm-svn: 95269
2010-02-04 01:13:08 +00:00
Victor Hernandez
c1b5223e76 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.

llvm-svn: 93531
2010-01-15 19:04:09 +00:00
Victor Hernandez
97d7107d5e Revert r93504 because older uses of llvm.dbg.declare intrinsics need to be auto-upgraded
llvm-svn: 93515
2010-01-15 17:36:47 +00:00
Victor Hernandez
aee71b4e81 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.

llvm-svn: 93504
2010-01-15 03:37:48 +00:00
Victor Hernandez
e5f811e0a6 Extend testcase to also test llvm.dbg.value intrinsic
llvm-svn: 93408
2010-01-14 02:12:41 +00:00
Victor Hernandez
70e33c3acd Now that LLParser, AsmWriter, BitcodeReader, and BitcodeWriter all correctly support function-local metadata, test it.
llvm-svn: 93406
2010-01-14 01:51:28 +00:00
Victor Hernandez
0e7561092b Re-add parsing of function-local metadata; this time with testcase.
llvm-svn: 92793
2010-01-05 22:22:14 +00:00
Dan Gohman
5fa04f2707 Delete useless trailing semicolons.
llvm-svn: 92740
2010-01-05 17:55:26 +00:00
Chris Lattner
70788c5e57 add some basic named MD tests.
llvm-svn: 92336
2009-12-31 03:00:49 +00:00
Chris Lattner
03a91d987f reimplement insertvalue/extractvalue metadata handling to not blindly
accept invalid input.  Actually add a testcase.

llvm-svn: 92297
2009-12-30 05:14:00 +00:00
Chris Lattner
c42b8ff24e fix parsing of mdstring values.
llvm-svn: 92290
2009-12-30 04:13:37 +00:00
Chris Lattner
c6b925c592 Each instruction is allowed to have *multiple* different
metadata objects on them.  Though the entire compiler supports this,
the asmparser didn't.

llvm-svn: 92270
2009-12-29 21:25:40 +00:00
Chris Lattner
86c74f4783 Do not crash when .ll printing metadata that smells like debug info, but isn't.
llvm-svn: 92268
2009-12-29 21:17:33 +00:00
Dale Johannesen
59fd73831e Adjust testcases for msasm -> alignstack.
llvm-svn: 84796
2009-10-21 23:29:12 +00:00
Dale Johannesen
7db511a23e 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.

llvm-svn: 84020
2009-10-13 20:46:56 +00:00
Nick Lewycky
42065f1555 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.

llvm-svn: 82361
2009-09-20 04:27:06 +00:00
Chris Lattner
cf3281f7d0 fix PR4963: folding insertvalue would sometimes turn a packed struct into
an unpacked one.

llvm-svn: 81845
2009-09-15 06:28:12 +00:00
Dan Gohman
ded1a79805 Fix this test to test what it was originally intended to test.
llvm-svn: 81539
2009-09-11 18:16:43 +00:00
Dan Gohman
205b641954 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.

llvm-svn: 81537
2009-09-11 18:01:28 +00:00
Chris Lattner
817a8fc5b0 fix test to not get a moduleid that matches 'br'
llvm-svn: 81526
2009-09-11 16:47:41 +00:00
Dan Gohman
aa66e3d968 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.

llvm-svn: 81483
2009-09-11 00:04:14 +00:00
Dan Gohman
c95df8b6d8 Use opt -S instead of piping bitcode output through llvm-dis.
llvm-svn: 81257
2009-09-08 22:34:10 +00:00
Dan Gohman
8d84372836 Change these tests to feed the assembly files to opt directly, instead
of using llvm-as, now that opt supports this.

llvm-svn: 81226
2009-09-08 16:50:01 +00:00
Dan Gohman
1147a7ba87 Reappy r80998, now that the GlobalOpt bug that it exposed on MiniSAT is fixed.
llvm-svn: 81172
2009-09-07 23:54:19 +00:00
Daniel Dunbar
452643b58c Revert "Include optional subclass flags, such as inbounds, nsw, etc., ...", this
breaks MiniSAT on x86_64.

llvm-svn: 81098
2009-09-06 00:11:24 +00:00
Daniel Dunbar
1a946234a4 Fix spacing.
llvm-svn: 81097
2009-09-06 00:00:13 +00:00
Dan Gohman
8b386a0b63 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.

llvm-svn: 80998
2009-09-04 12:08:11 +00:00
Dan Gohman
bf08e82d8e Remove obsolete -f flags.
llvm-svn: 79992
2009-08-25 15:38:29 +00:00
Dan Gohman
4b9cae5af3 Various AsmWriter output cleanups. Use WriteAsOperand instead of
PrintUnmangledNameSafely.

llvm-svn: 78878
2009-08-13 01:36:44 +00:00
Dan Gohman
4ee8471442 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.

llvm-svn: 78859
2009-08-12 23:32:33 +00:00
Dan Gohman
490eb36e1d Add a new keyword 'inbounds' for use with getelementptr. See the
LangRef.html changes for details.

llvm-svn: 77259
2009-07-27 21:53:46 +00:00
Dan Gohman
39c0d3b10a 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.

llvm-svn: 77194
2009-07-27 16:11:46 +00:00
Eli Friedman
11e86150c4 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...

llvm-svn: 77005
2009-07-24 21:56:17 +00:00
Dan Gohman
001d777207 Rename the new unsigned and signed keywords to nuw and nsw,
which stand for no-unsigned-wrap and no-signed-wrap.

llvm-svn: 76810
2009-07-22 22:44:56 +00:00
Dan Gohman
d2ad3e183b Assembly and Bitcode support for unsigned/signed overflow flags and
exact sdiv flags.

llvm-svn: 76475
2009-07-20 21:19:07 +00:00
Dan Gohman
8d6df1287d Apparently Darwin doesn't have /dev/full :-(.
llvm-svn: 75809
2009-07-15 18:41:11 +00:00
Dan Gohman
afe44327d4 Add a testcase for raw_ostream error checking.
llvm-svn: 75795
2009-07-15 16:47:02 +00:00
Nick Lewycky
d46a7b2d22 Remove the vicmp and vfcmp instructions. Because we never had a release with
these instructions, no autoupgrade or backwards compatibility support is
provided.

llvm-svn: 74991
2009-07-08 03:04:38 +00:00
Dan Gohman
5f6f8101d5 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

llvm-svn: 72897
2009-06-04 22:49:04 +00:00
Torok Edwin
9b75edbd14 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.

llvm-svn: 72249
2009-05-22 07:12:05 +00:00
Torok Edwin
8c1af7f5be 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.

llvm-svn: 72248
2009-05-22 06:41:43 +00:00
Dan Gohman
220d4325b0 Make this test slightly more strict.
llvm-svn: 70180
2009-04-27 03:05:26 +00:00
Sanjiv Gupta
0877e1eabe 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.
llvm-svn: 70134
2009-04-26 17:14:35 +00:00
Chris Lattner
92716db3bb add testcase for strange types of gep indices
llvm-svn: 70085
2009-04-25 22:20:49 +00:00
Chris Lattner
f795b63fb2 testcase and asmparser fix for PR4066
llvm-svn: 70080
2009-04-25 21:26:00 +00:00
Torok Edwin
285a5fb1d5 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.

llvm-svn: 70038
2009-04-25 10:25:12 +00:00
Chris Lattner
e7eed82209 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.

llvm-svn: 67682
2009-03-25 06:36:36 +00:00
Dan Gohman
4646e714c4 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.

llvm-svn: 67010
2009-03-14 17:09:17 +00:00