Chris Lattner
13ee795c42
remove unions from LLVM IR. They are severely buggy and not
...
being actively maintained, improved, or extended.
llvm-svn: 112356
2010-08-28 04:09:24 +00:00
Dan Gohman
390914cbe8
Make GlobalValue alignment consistent with load, store, and alloca
...
alignment, fixing silent truncation of alignment values.
llvm-svn: 109653
2010-07-28 20:56:48 +00:00
Dan Gohman
a7e5a24093
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.
llvm-svn: 109643
2010-07-28 20:12:04 +00:00
Chris Lattner
3ae2dd2ba5
add newlines at the end of files.
...
llvm-svn: 100705
2010-04-07 22:53:17 +00:00
Chris Lattner
392be58cad
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
1b08138152
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
d44ee35f30
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
b324e66f4c
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
8d4904b639
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
5d6551816b
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
d2b4f36986
Extend testcase to also test llvm.dbg.value intrinsic
...
llvm-svn: 93408
2010-01-14 02:12:41 +00:00
Victor Hernandez
b658d30b91
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
dc6e65a6a8
Re-add parsing of function-local metadata; this time with testcase.
...
llvm-svn: 92793
2010-01-05 22:22:14 +00:00
Dan Gohman
fb4193625a
Delete useless trailing semicolons.
...
llvm-svn: 92740
2010-01-05 17:55:26 +00:00
Chris Lattner
cac432c846
add some basic named MD tests.
...
llvm-svn: 92336
2009-12-31 03:00:49 +00:00
Chris Lattner
28f1eebe3e
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
0f3bb7b25e
fix parsing of mdstring values.
...
llvm-svn: 92290
2009-12-30 04:13:37 +00:00
Chris Lattner
596760d9bb
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
93163c401e
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
f64ea095c1
Adjust testcases for msasm -> alignstack.
...
llvm-svn: 84796
2009-10-21 23:29:12 +00:00
Dale Johannesen
fd04c74bc0
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
9e085545f8
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
ee8f74f5d1
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
fceb22ff3c
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
1880092722
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
eeeb5e1198
fix test to not get a moduleid that matches 'br'
...
llvm-svn: 81526
2009-09-11 16:47:41 +00:00
Dan Gohman
21c6216c87
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
72a13d2476
Use opt -S instead of piping bitcode output through llvm-dis.
...
llvm-svn: 81257
2009-09-08 22:34:10 +00:00
Dan Gohman
9737a63ed8
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
1b84908f92
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
10ea8bb8e0
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
db5d4521f5
Fix spacing.
...
llvm-svn: 81097
2009-09-06 00:00:13 +00:00
Dan Gohman
0c2477c26b
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
0d4bbf2c4a
Remove obsolete -f flags.
...
llvm-svn: 79992
2009-08-25 15:38:29 +00:00
Dan Gohman
ef3d457126
Various AsmWriter output cleanups. Use WriteAsOperand instead of
...
PrintUnmangledNameSafely.
llvm-svn: 78878
2009-08-13 01:36:44 +00:00
Dan Gohman
466876b0a6
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
1639c3905e
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
9c7f808201
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
5c9cdb3e3a
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
902dfff8b6
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
0ebd69614c
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
98ef2852ab
Apparently Darwin doesn't have /dev/full :-(.
...
llvm-svn: 75809
2009-07-15 18:41:11 +00:00
Dan Gohman
56ba398889
Add a testcase for raw_ostream error checking.
...
llvm-svn: 75795
2009-07-15 16:47:02 +00:00
Nick Lewycky
a21d3daadc
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
a5b9645c4b
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
9c4dcfb4a7
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
a39d69684a
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
58440cf305
Make this test slightly more strict.
...
llvm-svn: 70180
2009-04-27 03:05:26 +00:00
Sanjiv Gupta
8d319047c5
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
73b5b5adae
add testcase for strange types of gep indices
...
llvm-svn: 70085
2009-04-25 22:20:49 +00:00