Chris Lattner
60c2ca743d
we don't need a smallptrset to detect duplicates, the values are
...
sorted, so we can just do a linear scan.
llvm-svn: 92372
2009-12-31 19:49:01 +00:00
Chris Lattner
1d8979422a
make reassociate more careful about not leaving around dead mul's
...
llvm-svn: 92370
2009-12-31 19:34:45 +00:00
Chris Lattner
ed18917665
remove debug
...
llvm-svn: 92369
2009-12-31 19:25:19 +00:00
Chris Lattner
60b71b5c4d
teach reassociate to factor x+x+x -> x*3. While I'm at it,
...
fix RemoveDeadBinaryOp to actually do something.
llvm-svn: 92368
2009-12-31 19:24:52 +00:00
Chris Lattner
38abecbad0
change reassociate to use SmallVector for its key datastructures
...
instead of std::vector.
llvm-svn: 92366
2009-12-31 18:40:32 +00:00
Chris Lattner
ac61550504
change an if to an assert, fix comment.
...
llvm-svn: 92364
2009-12-31 18:18:46 +00:00
Chris Lattner
177140ad12
move the rest of the add optimization code out to OptimizeAdd,
...
improve some comments, simplify a bit of code.
llvm-svn: 92363
2009-12-31 18:17:13 +00:00
Chris Lattner
ba1f36aa99
factor statistic updating better.
...
llvm-svn: 92362
2009-12-31 17:51:05 +00:00
Benjamin Kramer
738800dd1d
Silence compiler warning.
...
warning: comparison between signed and unsigned integer expressions
llvm-svn: 92359
2009-12-31 16:27:13 +00:00
Chris Lattner
4e3a5678af
simple fix for an incorrect factoring which causes a
...
miscompilation, PR5458.
llvm-svn: 92354
2009-12-31 08:33:49 +00:00
Chris Lattner
2d3b53a68c
merge some more tests in.
...
llvm-svn: 92353
2009-12-31 08:32:22 +00:00
Chris Lattner
19a4baa201
filecheckize
...
llvm-svn: 92352
2009-12-31 08:29:56 +00:00
Chris Lattner
d5bace7092
fix refactoro
...
llvm-svn: 92349
2009-12-31 08:23:09 +00:00
Chris Lattner
5f8a005d38
factor code out into helper functions.
...
llvm-svn: 92347
2009-12-31 07:59:34 +00:00
Chris Lattner
f5c2b8b8d7
switch some std::vector's to smallvector. Reduce nesting.
...
llvm-svn: 92346
2009-12-31 07:48:51 +00:00
Chris Lattner
9039ff8912
use more modern datastructures.
...
llvm-svn: 92344
2009-12-31 07:33:14 +00:00
Chris Lattner
bc1512c8d1
clean up -debug output.
...
llvm-svn: 92343
2009-12-31 07:17:37 +00:00
Douglas Gregor
5639af4eac
Document the edit-distance algorithm used in StringRef, switch it over
...
to SmallVector, and add a unit test.
llvm-svn: 92340
2009-12-31 04:24:34 +00:00
Chris Lattner
5e9aca4c5d
this #include is ok.
...
llvm-svn: 92338
2009-12-31 03:02:42 +00:00
Chris Lattner
6a0ca6aa90
fix Analysis/DebugInfo.h to not include Metadata.h. Do this
...
by moving one method out of line and eliminating redundant checks
from other methods.
llvm-svn: 92337
2009-12-31 03:02:08 +00:00
Chris Lattner
cac432c846
add some basic named MD tests.
...
llvm-svn: 92336
2009-12-31 03:00:49 +00:00
Chris Lattner
b419a1e44f
use early exits to reduce indentation.
...
llvm-svn: 92335
2009-12-31 02:33:14 +00:00
Chris Lattner
cdec581a35
eliminate another copy of the mdnode printing logic, simplify the
...
one that remains.
llvm-svn: 92334
2009-12-31 02:31:59 +00:00
Chris Lattner
0d50bddda6
random tidying for MDNode printing.
...
llvm-svn: 92333
2009-12-31 02:27:30 +00:00
Chris Lattner
efb5e39428
eliminate a bunch of useless forwarding functions with one caller.
...
llvm-svn: 92332
2009-12-31 02:23:35 +00:00
Chris Lattner
cf4a76e441
make mdnMap type safe, rename accessors for consistency with the rest of llvm.
...
llvm-svn: 92331
2009-12-31 02:20:11 +00:00
Chris Lattner
01635a8428
metadata can't be a global var initializer.
...
llvm-svn: 92330
2009-12-31 02:15:45 +00:00
Chris Lattner
bddea6a530
simplify mdnode printing logic. Now N->dump() only
...
dumps one node instead of all of them.
llvm-svn: 92329
2009-12-31 02:13:35 +00:00
Chris Lattner
1e6e36785e
don't unittest mdnode printing, we have disassembler tests for this.
...
llvm-svn: 92328
2009-12-31 02:12:13 +00:00
Chris Lattner
2c48c64821
unify two copies of the NamedMDNode printing code.
...
llvm-svn: 92327
2009-12-31 01:54:05 +00:00
Chris Lattner
b9196679f9
fix printing of function-local metadata to print all the operands of the
...
mdnode, not just operand 0 over and over.
llvm-svn: 92326
2009-12-31 01:44:44 +00:00
Chris Lattner
31fcc28a84
simplify printing of mdstring and Argument.
...
llvm-svn: 92325
2009-12-31 01:41:14 +00:00
Chris Lattner
be2de79b77
simplify asmprinting of NamedMDNode
...
llvm-svn: 92324
2009-12-31 01:36:50 +00:00
Chris Lattner
cc8c8146d2
Remove #include of metadata.h from intrinsicinst.h. The only
...
method that needs it (DbgValueInst::getValue) has been moved out
of line.
llvm-svn: 92323
2009-12-31 01:32:41 +00:00
Chris Lattner
9b493028df
rename "elements" of metadata to "operands". "Elements" are
...
things that occur in types. "operands" are things that occur
in values.
llvm-svn: 92322
2009-12-31 01:22:29 +00:00
Chris Lattner
8cb6c3476d
Optimize MDNode to coallocate the operand list immediately
...
after the MDNode in memory. This eliminates the operands
pointer and saves a new[] per node.
Note that the code in DIDerivedType::replaceAllUsesWith is wrong
and quite scary. A MDNode should not be RAUW'd with something
else: this changes all uses of the mdnode, which may not be debug
info related! Debug info should use something non-mdnode for
declarations.
llvm-svn: 92321
2009-12-31 01:05:46 +00:00
Chris Lattner
8dace893fa
tidy
...
llvm-svn: 92320
2009-12-31 00:51:46 +00:00
Chris Lattner
30ae06be14
do not bother reuniquing mdnodes whose operands drop to null. Doing
...
so can be a huge performance issue when tearing down modules and mdnodes
are not guaranteed to be unique anyway. This speeds up:
$ time ~/llvm/Release/bin/clang gcc.c -w -S -g
from 72 to 35s, where gcc.c is from:
http://people.csail.mit.edu/smcc/projects/single-file-programs/
llvm-svn: 92315
2009-12-30 21:42:11 +00:00
Chris Lattner
09660c9b06
remove some misleading comments.
...
llvm-svn: 92311
2009-12-30 20:25:09 +00:00
Douglas Gregor
165882c240
Implement edit distance for StringRef
...
llvm-svn: 92309
2009-12-30 17:23:44 +00:00
Chris Lattner
16bafa6f14
remove some fixme's
...
llvm-svn: 92304
2009-12-30 06:00:36 +00:00
Chris Lattner
c5c08899e4
fix two bogus tests that the asmparser now rejects.
...
llvm-svn: 92303
2009-12-30 05:54:51 +00:00
Chris Lattner
94b9c5a73b
now that instruction metadata is only parsed in one place, eliminate the
...
parser-global MDsOnInst vector and make ParseInstructionMetadata return
its result by-ref through an argument like the entire rest of the parser.
llvm-svn: 92302
2009-12-30 05:48:36 +00:00
Chris Lattner
b2f3950da7
reimplement ParseOptionalInfo as ParseOptionalCommaAlign, correctly
...
handle the comma case for metadata.
llvm-svn: 92301
2009-12-30 05:44:30 +00:00
Chris Lattner
5c42763452
rename ParseOptionalCustomMetadata -> ParseInstructionMetadata,
...
and make it non-optional. This fixes the bug where we'd accept
and ignore a spurious comma after some instructions.
llvm-svn: 92300
2009-12-30 05:31:19 +00:00
Chris Lattner
f4f0342b08
convert 4 more instructions over.
...
llvm-svn: 92299
2009-12-30 05:27:33 +00:00
Chris Lattner
77b89dc58b
add facilities to start factoring instruction metadata parsing
...
out of each opcode's handler. Change ret over so far.
llvm-svn: 92298
2009-12-30 05:23:43 +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
bafee45d2c
remove two bogus calls that accepted metadata in the middle of insert/extract value
...
*constant exprs*.
llvm-svn: 92296
2009-12-30 05:04:46 +00:00
Chris Lattner
eafe4de021
rename NamedOrCustomMD -> MetadataVar to follow conventions of all the rest of the code.
...
llvm-svn: 92295
2009-12-30 05:02:06 +00:00