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

2578 Commits

Author SHA1 Message Date
Dan Gohman
df18b6f3db Fix a missing space after the return type in invoke statements.
This fixes PR2894.

llvm-svn: 57589
2008-10-15 18:02:08 +00:00
Daniel Dunbar
e11e618cc6 Prevent assert when using '"' in names (via hexadecimal).
Update LangRef to mention \xx quoting in names.

llvm-svn: 57538
2008-10-14 23:51:43 +00:00
Daniel Dunbar
f3b4f45878 Change getLLVMName to use raw_ostream & PrintLLVMName.
- Avoids duplicated quotification code.
 - Remove QuoteNameIfNeeded.
 - No functionality change.

llvm-svn: 57537
2008-10-14 23:28:09 +00:00
Daniel Dunbar
73ceb8010b Unbreak DbgStopPointInst::getFileName().
llvm-svn: 57373
2008-10-11 06:40:56 +00:00
Dale Johannesen
075a62519f Add a "loses information" return value to APFloat::convert
and APFloat::convertToInteger.  Restore return value to
IEEE754.  Adjust all users accordingly.

llvm-svn: 57329
2008-10-09 23:00:39 +00:00
Dale Johannesen
9e57068854 Rename APFloat::convertToAPInt to bitcastToAPInt to
make it clearer what the function does.  No functional
change.

llvm-svn: 57325
2008-10-09 18:53:47 +00:00
Duncan Sands
8f296a3788 Add <cstdio> include where needed by gcc-4.4.
Patch by Samuel Tardieu.

llvm-svn: 57291
2008-10-08 07:23:46 +00:00
Devang Patel
ca66d093c0 Remove interfaces implemented by dead pass from the list of available passes.
Patch By Matthijs Kooijman.

llvm-svn: 57202
2008-10-06 20:36:36 +00:00
Chris Lattner
4622ca2262 fix an incorrect and extremely confusing error message
llvm-svn: 57123
2008-10-05 18:24:03 +00:00
Devang Patel
0d22d8ebdb Fix function attribute verification check.
Thanks Duncan!

llvm-svn: 57029
2008-10-03 21:11:02 +00:00
Devang Patel
2bed4d4ca0 Verify function attributes.
llvm-svn: 57020
2008-10-03 17:50:00 +00:00
Devang Patel
92bd02d528 Remove redundant check.
llvm-svn: 56960
2008-10-02 18:38:23 +00:00
Devang Patel
d90556aed0 Attributes noinline alwaysinline are incompatible
llvm-svn: 56939
2008-10-01 23:41:25 +00:00
Chris Lattner
91e5279de1 add a new form of Type::dump that takes a module for type names,
patch provided by Tomas Lindquist Olsen!

llvm-svn: 56929
2008-10-01 20:16:19 +00:00
Dan Gohman
e1d0930044 Make some implicit conversions explicit, to avoid compiler warnings.
llvm-svn: 56927
2008-10-01 19:58:59 +00:00
Duncan Sands
88d8323743 Factorize code: remove variants of "strip off
pointer bitcasts and GEP's", and centralize the
logic in Value::getUnderlyingObject.  The
difference with stripPointerCasts is that
stripPointerCasts only strips GEPs if all
indices are zero, while getUnderlyingObject
strips GEPs no matter what the indices are.

llvm-svn: 56922
2008-10-01 15:25:41 +00:00
Dan Gohman
8ba73d6d60 Don't prepend a space character for constants in Value::print.
llvm-svn: 56920
2008-10-01 15:09:37 +00:00
Devang Patel
7536edca09 Support inreg, zext and sext as return value attributes.
llvm-svn: 56801
2008-09-29 20:49:50 +00:00
Devang Patel
47a504c87c Implement function notes as function attributes.
llvm-svn: 56716
2008-09-26 23:51:19 +00:00
Devang Patel
e4e6ea0728 Now Attributes are divided in three groups
- return attributes - inreg, zext and sext
- parameter attributes
- function attributes - nounwind, readonly, readnone, noreturn

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

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

llvm-svn: 56704
2008-09-26 22:53:05 +00:00
Dan Gohman
a9e963a0b4 Fix missing whitespace in the printing of function notes.
llvm-svn: 56702
2008-09-26 22:02:59 +00:00
Dale Johannesen
423053d8a7 Another file I forgot.
llvm-svn: 56678
2008-09-26 19:31:53 +00:00
Dale Johannesen
3f62c40108 Add "inreg" field to CallSDNode (doesn't increase
its size).  Adjust various lowering functions to
pass this info through from CallInst.  Use it to
implement sseregparm returns on X86.  Remove
X86_ssecall calling convention.

llvm-svn: 56677
2008-09-26 19:31:26 +00:00
Bill Wendling
8b4fecfb09 Make pointer parameter const for isUsedInBasicBlock.
llvm-svn: 56625
2008-09-25 22:42:01 +00:00
Devang Patel
64dd7a2e89 Large mechanical patch.
s/ParamAttr/Attribute/g
s/PAList/AttrList/g
s/FnAttributeWithIndex/AttributeWithIndex/g
s/FnAttr/Attribute/g

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

This requires corresponding changes in llvm-gcc and clang.

llvm-svn: 56622
2008-09-25 21:00:45 +00:00
Dan Gohman
f03be3916e Avoid a spurious extra space character when printing empty structs.
llvm-svn: 56616
2008-09-25 17:37:20 +00:00
Oscar Fuentes
4e4ae7ef78 CMake: Lists of source files updated. Removed bogus dependency from
lib/VMCore/CMakeLists.txt

llvm-svn: 56541
2008-09-24 01:58:12 +00:00
Devang Patel
f0bda74eca s/ParamAttrsWithIndex/FnAttributeWithIndex/g
llvm-svn: 56535
2008-09-24 00:55:02 +00:00
Devang Patel
64a2547c42 s/ParamAttributeListImpl/AttributeListImpl/g
llvm-svn: 56532
2008-09-24 00:29:49 +00:00
Devang Patel
25ecdc49d9 Put FN_NOTE_AlwaysInline and others in FnAttr namespace.
llvm-svn: 56527
2008-09-24 00:06:15 +00:00
Devang Patel
b39defd763 Move FN_NOTE_AlwaysInline and other out of ParamAttrs namespace.
Do not check isDeclaration() in hasNote(). It is clients' responsibility.

llvm-svn: 56524
2008-09-23 23:52:03 +00:00
Devang Patel
1b09ba231f 80 cols
llvm-svn: 56521
2008-09-23 23:32:15 +00:00
Devang Patel
a3e9bf1bca s/ParameterAttributes/Attributes/g
llvm-svn: 56513
2008-09-23 23:03:40 +00:00
Devang Patel
ad8ca34acd Use parameter attribute store (soon to be renamed) for
Function Notes also. Function notes are stored at index ~0.

llvm-svn: 56511
2008-09-23 22:35:17 +00:00
Duncan Sands
2c9f6ab06d Rationalize the names of passes that print information:
-callgraph => print-callgraph
    -callscc   => print-callgraph-sccs
    -cfgscc    => print-cfg-sccs
    -externalfnconstants => print-externalfnconstants
    -print               => print-function
    -print-alias-sets (no change)
    -print-callgraph     => dot-callgraph
    -print-cfg           => dot-cfg
    -print-cfg-only      => dot-cfg-only
    -print-dom-info (no change)
    -printm              => print-module
    -printusedtypes      => print-used-types

llvm-svn: 56487
2008-09-23 12:47:39 +00:00
Devang Patel
c7fc5ed65f Add hasNote() to check note associated with a function.
llvm-svn: 56477
2008-09-22 22:32:29 +00:00
Oscar Fuentes
0f25988689 Initial support for the CMake build system.
llvm-svn: 56419
2008-09-22 01:08:49 +00:00
Gabor Greif
984ba5a313 backing out my last commit, it was not intended to go on the trunk
llvm-svn: 56349
2008-09-19 15:13:20 +00:00
Gabor Greif
67fa076542 first shot at removing Use::Val
untested, Use::swap() is definitely not done yet

llvm-svn: 56348
2008-09-19 15:03:57 +00:00
Dan Gohman
6418cb3998 Fix WriteAsOperand to not emit a leading space character. Adjust
its callers to emit a space character before calling it when a
space is needed.

This fixes several spurious whitespace issues in
ScalarEvolution's debug dumps. See the test changes for
examples.

This also fixes odd space-after-tab indentation in the output
for switch statements, and changes calls from being printed like
this:
  call void @foo( i32 %x )
to this:
  call void @foo(i32 %x)

llvm-svn: 56196
2008-09-14 17:21:12 +00:00
Devang Patel
b08f098957 Add assertion check.
llvm-svn: 56016
2008-09-09 21:38:40 +00:00
Anton Korobeynikov
6ad8b060d0 Make safer variant of alias resolution routine to be default
llvm-svn: 56005
2008-09-09 20:05:04 +00:00
Anton Korobeynikov
bcf0165453 Fix typo
llvm-svn: 55998
2008-09-09 18:24:07 +00:00
Anton Korobeynikov
3a24741034 Fix incorrect linker behaviour: we shouldn't resolve weak aliases.
llvm-svn: 55997
2008-09-09 18:23:48 +00:00
Devang Patel
ccd2dfd23a Simplify.
Fix outdated comment.

llvm-svn: 55993
2008-09-09 17:56:50 +00:00
Dan Gohman
3e79d697f3 Extend the vcmp/fcmp LLVM IR instructions to take vectors as arguments
and, if so, to return a vector of boolean as a result;

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

Update LangRef.html to describe these changes.

This patch was contributed by Preston Gurd!

llvm-svn: 55969
2008-09-09 01:02:47 +00:00
Dan Gohman
3d1ee171e8 Bitcasting two or from aggregate types is not permitted. Update
LangRef.html, and teach the verifier to check bitcast instructions.

llvm-svn: 55921
2008-09-08 16:45:59 +00:00
Dan Gohman
e1f9be27bc Tidy up several unbeseeming casts from pointer to intptr_t.
llvm-svn: 55779
2008-09-04 17:05:41 +00:00
Devang Patel
c0d6a60b65 Avoid extra comma.
llvm-svn: 55742
2008-09-03 22:55:40 +00:00
Devang Patel
f8c7bd2a05 Parse and print opt_size note.
llvm-svn: 55740
2008-09-03 22:10:21 +00:00
Nick Lewycky
8b8886c6b0 Try to fold each element of a vector. This is needed to maintain structural
equivalence.

llvm-svn: 55694
2008-09-03 06:48:55 +00:00
Nick Lewycky
57cebeaeba Don't crash when trying to constant fold a vector with some elements that can't
be folded. Instead, fail to fold the entire vector.

We could also return a vector with some elements folded and some not. If anyone
thinks that's a better approach, please speak up!

llvm-svn: 55689
2008-09-03 05:54:33 +00:00
Devang Patel
5659d2508e s/FP_AlwaysInline/FN_NOTE_AlwaysInline/g
llvm-svn: 55676
2008-09-02 22:43:57 +00:00
Devang Patel
d131eb6bfb Use bitwise AND.
llvm-svn: 55656
2008-09-02 21:46:44 +00:00
Devang Patel
4b52a398c3 Print function notes.
llvm-svn: 55647
2008-09-02 20:56:33 +00:00
Devang Patel
863655cd40 Initialize function notes.
llvm-svn: 55645
2008-09-02 20:51:15 +00:00
Nuno Lopes
5c40eb8e05 plug a little memleak in verifyFunction()
# first commit to llvm, so whatch out :)

llvm-svn: 55631
2008-09-02 11:30:10 +00:00
Gordon Henriksen
3324b5c3ca PR2731: C and Ocaml bindings for setTailCall and isTailCall.
Based on patch by Giorgos Korfiatis.

llvm-svn: 55570
2008-08-30 16:34:54 +00:00
Gordon Henriksen
3a9a0e274b Fix ConstantExpr::getInsertElement.
Breakage was exposed in the Ocaml bindings tests after Chris
uncommented an assertion in r55084.

llvm-svn: 55566
2008-08-30 15:41:51 +00:00
Chris Lattner
efbbbb0cde Asmprint nameless instructions as:
%4 = add ...

instead of:

add ...    ; 4

This makes opt -print-cfg output actually usable and makes .ll files
generally easier to read.  This fixes PR2480

llvm-svn: 55541
2008-08-29 17:19:30 +00:00
Chris Lattner
bd43eec286 Make the verifier reject instructions which have null pointers
for operands: rdar://6179606.  no testcase, because I can't write
a .ll file that is this broken ;-)

llvm-svn: 55460
2008-08-28 04:02:44 +00:00
Bill Wendling
84547c2a09 Put file scoped constants in an anonymous namespace. Use the "using namespace
llvm" for consistency.

llvm-svn: 55435
2008-08-27 21:10:13 +00:00
Chris Lattner
551cf02a2d Minor cleanup.
llvm-svn: 55423
2008-08-27 17:36:58 +00:00
Dan Gohman
be3a88eac3 Diagnose uses of unsized types with the byval attribute in the
verifier. See PR2711 for details.

llvm-svn: 55414
2008-08-27 14:48:06 +00:00
Dan Gohman
6d6043d2fc Update wording, as aggregates are now first-class.
llvm-svn: 55413
2008-08-27 14:44:57 +00:00
Evan Cheng
20b295388f Add DebugInfoBuilder. Patch by Talin!
llvm-svn: 55409
2008-08-27 06:51:14 +00:00
Chris Lattner
df2af1f4c5 Fix pasto (values -> types) noticed by Josh Conner
llvm-svn: 55315
2008-08-25 17:03:15 +00:00
Chris Lattner
0efa9e9d2e flush stream after dumping.
llvm-svn: 55301
2008-08-25 04:55:46 +00:00
Chris Lattner
5a8d6a20e6 remove the type checking logic already done by tblgen, just keep the
parts tblgen doesn't do (checking for constant, alloca, enclosing 
function has gc marker).  This passes dj! :)

llvm-svn: 55294
2008-08-24 20:46:13 +00:00
Chris Lattner
f6e98a0f30 add a hack to temporarily allow pseudo source values.
llvm-svn: 55289
2008-08-24 18:33:17 +00:00
Chris Lattner
ea485fa47d minor cleanups.
llvm-svn: 55267
2008-08-23 22:52:27 +00:00
Chris Lattner
fe3155fc62 Switch the asmprinter (.ll) and all the stuff it requires over to
use raw_ostream instead of std::ostream.  Among other goodness,
this speeds up llvm-dis of kc++ with a release build from 0.85s
to 0.49s (88% faster).

Other interesting changes:
 1) This makes Value::print be non-virtual.
 2) AP[S]Int and ConstantRange can no longer print to ostream directly, 
    use raw_ostream instead.
 3) This fixes a bug in raw_os_ostream where it didn't flush itself 
    when destroyed.
 4) This adds a new SDNode::print method, instead of only allowing "dump".


A lot of APIs have both std::ostream and raw_ostream versions, it would
be useful to go through and systematically anihilate the std::ostream 
versions.

This passes dejagnu, but there may be minor fallout, plz let me know if
so and I'll fix it.

llvm-svn: 55263
2008-08-23 22:23:09 +00:00
Bill Wendling
ea70fb8ec9 Reverting r55227. This was causing the following failures in the regression
tests:

Running /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.HEAD.src/test/Verifier/dg.exp ...
FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.HEAD.src/test/Verifier/gcread-ptrptr.ll for PR1633
Failed with exit(1) at line 1
while running: not llvm-as < /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.HEAD.src/test/Verifier/gcread-ptrptr.ll >& /dev/null
child process exited abnormally
FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.HEAD.src/test/Verifier/gcroot-alloca.ll for PR1633
Failed with exit(1) at line 1
while running: not llvm-as < /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.HEAD.src/test/Verifier/gcroot-alloca.ll >& /dev/null
child process exited abnormally
FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.HEAD.src/test/Verifier/gcroot-meta.ll for PR1633
Failed with exit(1) at line 1
while running: not llvm-as < /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.HEAD.src/test/Verifier/gcroot-meta.ll >& /dev/null
child process exited abnormally
FAIL: ndbox/Buildbot/llvm/full-llvm/build/llvm.HEAD.src/test/Verifier/gcroot-ptrptr.ll for PR1633
Failed with exit(1) at line 1
while running: not llvm-as < /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.HEAD.src/test/Verifier/gcroot-ptrptr.ll >& /dev/null
child process exited abnormally
FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.HEAD.src/test/Verifier/gcwrite-ptrptr.ll for PR1633
Failed with exit(1) at line 1
while running: not llvm-as < /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.HEAD.src/test/Verifier/gcwrite-ptrptr.ll >& /dev/null
child process exited abnormally

		===  Summary ===

# of expected passes		3021
# of unexpected failures	6
# of expected failures		16
make[1]: *** [check-local] Error 1
make: *** [check] Error 2

llvm-svn: 55233
2008-08-23 09:46:46 +00:00
Chris Lattner
0c4ec79e1e Verify that the alignment argument to llvm.memcpy is a constant
integer, PR2318.

llvm-svn: 55228
2008-08-23 05:31:10 +00:00
Chris Lattner
3bc83cafea remove verification for gc intrinsic argument types. it was indented wrong
and tblgen now knows intrinsic prototypes.

llvm-svn: 55227
2008-08-23 05:26:35 +00:00
Chris Lattner
9e471bdb4b the bug was apparently fixed long ago, reenable the assertion
llvm-svn: 55224
2008-08-23 03:48:35 +00:00
Dale Johannesen
aa332f4fca Accept NOT of a constant vector of int.
llvm-svn: 55140
2008-08-21 21:20:09 +00:00
Chris Lattner
7a310366a6 Add a new ConstantExpr::getWithOperands that takes any array of operands
instead of requiring an std::vector.

llvm-svn: 55084
2008-08-20 22:27:40 +00:00
Chris Lattner
2b6a31501e more cleanups, random methods shouldn't return ostreams.
llvm-svn: 54984
2008-08-19 05:26:17 +00:00
Chris Lattner
8cc806c9be more cleanup, eliminate getLLVMName when printing out
type names at the top of the file.

llvm-svn: 54983
2008-08-19 05:16:28 +00:00
Chris Lattner
b665916d8d random cleanups, factor some printing code for linkage and visibility
llvm-svn: 54982
2008-08-19 05:06:27 +00:00
Chris Lattner
6df4ed8bfd Change WriteTypeSymbolic/WriteAsOperand to return void instead of
an ostream, which is just weird.

Rename SC_DEBUG -> ST_DEBUG

Remove static indentation strangeness from WriteConstantInt.  This makes it 
so that large structs are not broken down and printed on multiple lines.  If
there is demand for this to return, there are better ways to implement this.

llvm-svn: 54981
2008-08-19 04:47:09 +00:00
Chris Lattner
b4cfc1a85e whitespace cleanup
llvm-svn: 54980
2008-08-19 04:45:47 +00:00
Chris Lattner
50a2b09df9 rearrange code and make more legible.
llvm-svn: 54976
2008-08-19 04:36:02 +00:00
Chris Lattner
de5c9e9be5 put SlotTracker in an anon namespace since it is private.
llvm-svn: 54975
2008-08-19 04:28:07 +00:00
Chris Lattner
c6e031668d Reid had to call this class "slot machine" out of some strange reference
to the gambling device.  Name it something more meaningful.

llvm-svn: 54974
2008-08-19 04:26:57 +00:00
Chris Lattner
467a8dc22e Fix a bug daniel pointed out to me, where asmprinter started
printing ascii code for hex numbers instead of the hex numbers 
themselves.

llvm-svn: 54936
2008-08-18 19:41:26 +00:00
Gordon Henriksen
2cc861a6c1 Rename some GC classes so that their roll will hopefully be clearer.
In particular, Collector was confusing to implementors. Several
thought that this compile-time class was the place to implement
their runtime GC heap. Of course, it doesn't even exist at runtime.
Specifically, the renames are:

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

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

llvm-svn: 54899
2008-08-17 18:44:35 +00:00
Chris Lattner
aa7b21d49b getLLVMName is only used for types now, which always pass in LocalPrefix. Specialize on it.
llvm-svn: 54897
2008-08-17 17:28:37 +00:00
Chris Lattner
2dc591352d switch valuemap's from std::map to densemap. This speeds up llvm-dis
on a stripped kc++ .bc file from 0.83 to 0.77s (8%)

llvm-svn: 54896
2008-08-17 17:25:25 +00:00
Chris Lattner
661710bbd1 avoid an extraneous std::string construction
llvm-svn: 54875
2008-08-17 07:24:08 +00:00
Chris Lattner
c0610874cc Rework the routines that convert AP[S]Int into a string. Now, instead of
returning an std::string by value, it fills in a SmallString/SmallVector
passed in.  This significantly reduces string thrashing in some cases.

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

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

llvm-svn: 54873
2008-08-17 07:19:36 +00:00
Chris Lattner
332a173cff avoid string thrashing when formatting names in output. This
speeds up release-asserts llvm-dis on kc++ from 1.86s to 1.04s (~79%)

llvm-svn: 54868
2008-08-17 04:40:13 +00:00
Chris Lattner
ba25bb349e random cleanups.
llvm-svn: 54866
2008-08-17 04:17:45 +00:00
Chris Lattner
f991487f21 Inline the fastpath of PATypeHolder::get(). This is a small speedup in
instcombine among other things.

llvm-svn: 54814
2008-08-15 15:16:50 +00:00
Devang Patel
b5abdd4c33 The pass manager is not able to schedule -loop-deletion -loop-index-split.
The loop-deletion pass does not preserve dom frontier, which is required by
loop-index-split. When the PM checks dom frontier for loop-index-split, it has
already verified that lcssa is availalble. However, new dom frontier forces new
loop pass manager, which does not  have lcssa yet.

The PM should recheck availability of required analysis passes in such cases.

llvm-svn: 54805
2008-08-14 23:07:48 +00:00
Owen Anderson
3c7772990a Have LeakDetector use a SmallPtrSet instead of an std::set.
llvm-svn: 54785
2008-08-14 20:40:10 +00:00
Dan Gohman
b0f5e18201 Improve support for vector casts in LLVM IR and CodeGen.
llvm-svn: 54784
2008-08-14 20:04:46 +00:00
Dale Johannesen
c3d88ff804 Add read/write support for X86's sseregparm.
llvm-svn: 54744
2008-08-13 18:40:23 +00:00
Devang Patel
d0aabe5ce6 Use SmallVector instead of std::vector
llvm-svn: 54685
2008-08-12 15:44:31 +00:00
Devang Patel
670f3a9e03 Use DenseMap to keep track of last users.
Use inversed map for faster queries.

llvm-svn: 54662
2008-08-12 00:26:16 +00:00
Devang Patel
404762f720 Keep track of analysis usage information for passes. Avoid invoking
getAnalysisUsage() repeatedly.

llvm-svn: 54650
2008-08-11 21:13:39 +00:00
Gordon Henriksen
78a53c516d Delete a redundant binding, LLVMHasInitializer.
Please use !LLVMIsDeclaration instead.

llvm-svn: 54572
2008-08-09 02:13:58 +00:00
Eric Christopher
dcd4752642 Have IRBuilder take a template argument on whether or not to preserve
names. This can save a lot of allocations if you aren't going to be
looking at the output.

llvm-svn: 54546
2008-08-08 19:39:37 +00:00
Chris Lattner
a4e876cf8a Don't call getAnalysisUsage unless -debug-pass is enabled. This speeds
up the passmgr by avoiding useless work.

llvm-svn: 54528
2008-08-08 15:14:09 +00:00
Chris Lattner
c1ca63307d Speed up the passmgr by avoiding heap thrashing on vectors.
llvm-svn: 54515
2008-08-08 05:33:04 +00:00
Chris Lattner
863d710738 Don't verify passes when assertions are disabled.
llvm-svn: 54446
2008-08-07 07:34:50 +00:00
Dan Gohman
51a5eb52c5 Fix the AsmWriter to not print extra spaces after parameter attributes.
llvm-svn: 54351
2008-08-05 15:51:44 +00:00
Dan Gohman
de163bb39d Fix several const-correctness issues, resolving some -Wcast-qual warnings.
llvm-svn: 54349
2008-08-05 14:45:15 +00:00
Duncan Sands
573c01d5da Fix comment typos.
llvm-svn: 54266
2008-08-01 12:23:49 +00:00
Mon P Wang
fb483982f5 Added support for overloading intrinsics (atomics) based on pointers
to different address spaces.  This alters the naming scheme for those
intrinsics, e.g., atomic.load.add.i32 => atomic.load.add.i32.p0i32

llvm-svn: 54195
2008-07-30 04:36:53 +00:00
Nate Begeman
9a71580e21 Add vector shifts to the IR, patch by Eli Friedman.
CodeGen & Clang work coming next.

llvm-svn: 54161
2008-07-29 15:49:41 +00:00
Matthijs Kooijman
6ef5a25c7f Add a GetElementPtrInst::getIndexedType that accepts uint64_t's instead of just Value*'s.
llvm-svn: 54157
2008-07-29 08:46:11 +00:00
Dan Gohman
9653b21dc2 Fold the useful features of alist and alist_node into ilist, and
a new ilist_node class, and remove them. Unlike alist_node,
ilist_node doesn't attempt to manage storage itself, so it avoids
the associated problems, including being opaque in gdb.

Adjust the Recycler class so that it doesn't depend on alist_node.
Also, change it to use explicit Size and Align parameters, allowing
it to work when the largest-sized node doesn't have the greatest
alignment requirement.

Change MachineInstr's MachineMemOperand list from a pool-backed
alist to a std::list for now.

llvm-svn: 54146
2008-07-28 21:51:04 +00:00
Nate Begeman
a6cdff50b0 Remove unnecessary implicit argument
llvm-svn: 54031
2008-07-25 17:56:27 +00:00
Nate Begeman
ce064348d9 Fix minor issues with VICmp/VFCmp constant expressions
llvm-svn: 54030
2008-07-25 17:35:37 +00:00
Nate Begeman
8c76bda987 Allow verifier to be run on partially materialized modules.
llvm-svn: 54028
2008-07-25 17:28:23 +00:00
Nate Begeman
d340dc3fab Tab removal
llvm-svn: 54025
2008-07-25 17:24:13 +00:00
Evan Cheng
e91c8c4508 Rename instance variables, parameter argument names to eliminate a bunch of compilation warnings with -Wshadow.
llvm-svn: 53970
2008-07-24 00:08:56 +00:00
Dan Gohman
6564581be0 Enable first-class aggregates support.
Remove the GetResultInst instruction. It is still accepted in LLVM assembly
and bitcode, where it is now auto-upgraded to ExtractValueInst. Also, remove
support for return instructions with multiple values. These are auto-upgraded
to use InsertValueInst instructions.

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

llvm-svn: 53941
2008-07-23 00:34:11 +00:00
Dan Gohman
cb26a8abeb Fix multiple-return-value-to-first-class-aggregates autoupgrade to
correctly handle the case where multiple-return-value constructs
were used to return one or zero values.

llvm-svn: 53890
2008-07-22 00:36:48 +00:00
Dan Gohman
183bd17a66 InsertValue and ExtractValue constant expressions are always
folded. Remove code that handled the case where they aren't
folded, and remove bitcode reader/writer support for them.

llvm-svn: 53887
2008-07-21 23:30:30 +00:00
Chris Lattner
0429684d2d verify limits-fndefn.c from the GCC testsuite before the
heat death of the universe, fixing an O(N^2) problem in the
size of a basic block.

llvm-svn: 53749
2008-07-18 05:23:39 +00:00
Chris Lattner
b786d147c9 Fix a bunch of bugs handling vector compare constant expressions, fixing
PR2317.

llvm-svn: 53544
2008-07-14 05:17:31 +00:00
Chris Lattner
accde0a86b Document and fix Constant::getVectorElements to return an empty vector
when presented with a constant expr.

If ConstantExpr::getV[IF]Cmp to work when ConstantFoldCompareInstruction
returns an undef or constant expr.  

llvm-svn: 53541
2008-07-14 05:10:41 +00:00
Dan Gohman
d1342570f2 Use find instead of lower_bound.
llvm-svn: 53474
2008-07-11 20:58:19 +00:00
Chris Lattner
7797bfa0fd SImplify ConstantVector::get a bit and make it turn a vector
of all undefs into a single undef value.

llvm-svn: 53384
2008-07-10 00:44:03 +00:00
Chris Lattner
563d2c9fac Fix a case where vector comparison constant folding would cause an
infinite recursion.  part of PR2529

llvm-svn: 53383
2008-07-10 00:29:28 +00:00
Chris Lattner
6c12d086d9 add a helper method for code that wants to handle vector
constants by element without caring how they are formed.

llvm-svn: 53381
2008-07-10 00:28:11 +00:00
Chris Lattner
4fbada0bef elementwise comparison of vector constants was completely wrong. Fix
it for PR2529

llvm-svn: 53380
2008-07-10 00:08:17 +00:00
Evan Cheng
80f6966c7f - Replace use of std::map<std::string, ..> with StringMap. Replace use of std::map with DenseMap, std::set with SmallPtrSet. This results in minor speed up.
- Some code clean up.

llvm-svn: 53379
2008-07-10 00:04:23 +00:00
Dan Gohman
f152c7c967 Consistently put quotes around pass names in debugging output.
llvm-svn: 53268
2008-07-09 00:50:40 +00:00
Chris Lattner
6163b7a5ad improve comment
llvm-svn: 53243
2008-07-08 18:47:38 +00:00
Duncan Sands
65028bf60d Add some helpers for manipulating function
parameter attributes.

llvm-svn: 53228
2008-07-08 09:41:30 +00:00
Duncan Sands
b854603cb5 Add some convenience methods for manipulating
call attributes.

llvm-svn: 53223
2008-07-08 08:38:44 +00:00
Chris Lattner
d4bcc9011b Fix three bugs:
1) evaluate [v]fcmp true/false with undefs to true or false instead
   of undef.
2) fix vector comparisons with undef to return a vector result instead 
   of i1
3) fix vector comparisons with evaluatable results to return vector
   true/false instead of i1 true/false (PR2529)

llvm-svn: 53220
2008-07-08 05:46:34 +00:00
Dan Gohman
955fdc7a4c Add explicit keywords.
llvm-svn: 53179
2008-07-07 18:00:37 +00:00
Bill Wendling
2c9a84d788 Revert my previous check-in that split up MachineModuleInfo. It turns out to
slow the compiler down at -O0 some 30% or more. Ooops.

llvm-svn: 53120
2008-07-03 22:53:42 +00:00
Matthijs Kooijman
b7ade2592f Add newline at the end of Constants.cpp.
llvm-svn: 53092
2008-07-03 07:46:41 +00:00
Dan Gohman
b4de0f42af Use operator new instead of new char[].
llvm-svn: 53066
2008-07-03 00:53:09 +00:00
Devang Patel
a4a94290b8 Disable dom info verifier by default.
llvm-svn: 52983
2008-07-01 21:36:11 +00:00
Devang Patel
0fc2badc38 Fix typos in comments.
Thanks for the feedback!

llvm-svn: 52978
2008-07-01 19:50:56 +00:00
Devang Patel
1e1f4a0bdd Add dom info verifier.
llvm-svn: 52967
2008-07-01 17:44:24 +00:00
Devang Patel
5b8e75e2fe Move dominator info printer into tool/opt/GraphPrinters.cpp
llvm-svn: 52907
2008-06-30 17:32:58 +00:00
Evan Cheng
2005804de6 - Re-apply 52748 and friends with fix. GetConstantStringInfo() returns an empty string for ConstantAggregateZero case which surprises selectiondag.
- Correctly handle memcpy from constant string which is zero-initialized.

llvm-svn: 52891
2008-06-30 07:31:25 +00:00
Anton Korobeynikov
6f260767ec Revert (52748 and friends):
Move GetConstantStringInfo to lib/Analysis. Remove
string output routine from Constant. Update all
callers. Change debug intrinsic api slightly to
accomodate move of routine, these now return values
instead of strings.

This unbreaks llvm-gcc bootstrap.

llvm-svn: 52884
2008-06-29 17:57:03 +00:00
Chris Lattner
8e2bd43f29 implement some fixme's by making "autorenaming" in the value symbol table not
thrash the heap with string stuff (e.g. utostr).

llvm-svn: 52838
2008-06-27 21:26:26 +00:00
Chris Lattner
5c75711282 simplify some code to avoid string thrashing.
llvm-svn: 52837
2008-06-27 21:25:24 +00:00
Chris Lattner
6b3b22747a Add a new version of Module::getFunction that takes a const char* instead
of a std::string.  This avoids copying the string to the heap in common
cases.  Patch by Pratik Solanki!

llvm-svn: 52834
2008-06-27 21:09:10 +00:00
Devang Patel
d5faa747e9 Add dominator info printer pass.
llvm-svn: 52829
2008-06-27 16:43:21 +00:00
Bill Wendling
2ab62b9a92 Refactor the DebugInfoDesc stuff out of the MachineModuleInfo file. Clean up
some uses of std::vector, where it's return std::vector by value. Yuck!

llvm-svn: 52800
2008-06-27 00:09:40 +00:00
Eric Christopher
4f05c48718 Move GetConstantStringInfo to lib/Analysis. Remove
string output routine from Constant. Update all
callers. Change debug intrinsic api slightly to
accomodate move of routine, these now return values
instead of strings.

llvm-svn: 52748
2008-06-26 00:31:12 +00:00
Mon P Wang
7d89d61387 Added MemOperands to Atomic operations since Atomics touches memory.
Added abstract class MemSDNode for any Node that have an associated MemOperand
Changed atomic.lcs => atomic.cmp.swap, atomic.las => atomic.load.add, and
atomic.lss => atomic.load.sub

llvm-svn: 52706
2008-06-25 08:15:39 +00:00
Owen Anderson
968d4e2444 Use push_back rather than operator[], which is incorrect in this cases. Unfortunately, this slow the testcase down a little bit,
but only marginally.

llvm-svn: 52700
2008-06-25 01:05:05 +00:00
Owen Anderson
673cae8561 In ConstantArray::getAsString(), we know the size of the resultant string in advance so we can pre-allocate it and just fill in
the entries.  This improves the time for the AsmPrinter on InstructionCombining.cpp from 0.4248s to 0.3370s.

llvm-svn: 52690
2008-06-24 21:58:29 +00:00
Dan Gohman
fcb2dc2dd6 Use const_cast instead of a C-style cast.
llvm-svn: 52684
2008-06-24 17:47:37 +00:00
Dan Gohman
b52f318a0c Remove two convenience constructors because they're now private, and the
private implementation doesn't really need the convenience.

llvm-svn: 52629
2008-06-23 16:48:17 +00:00
Dan Gohman
12a793b025 Use std::copy instead of a loop.
llvm-svn: 52628
2008-06-23 16:45:24 +00:00
Dan Gohman
d9e2c8b72a More changes from Chris' review: simplify getIndices and avoid
copying its return value.

llvm-svn: 52627
2008-06-23 16:39:44 +00:00
Dan Gohman
e0744f181b Use Function's arg_size() and size() methods.
llvm-svn: 52605
2008-06-21 22:06:54 +00:00
Chris Lattner
96b3955e9b fix some warnings when assertions are disabled.
llvm-svn: 52587
2008-06-21 19:47:03 +00:00
Dan Gohman
bcddb92f4e Simplify this code. Thanks Chris!
llvm-svn: 52514
2008-06-20 00:47:44 +00:00
Dan Gohman
c190d65454 Auto-upgrade code for multiple-value return statements. This code
isn't actually called yet.

llvm-svn: 52435
2008-06-17 23:38:43 +00:00
Dan Gohman
d9d529d7ed In InsertValueInst's copy ctor, actually copy the operands.
llvm-svn: 52434
2008-06-17 23:25:49 +00:00
Dan Gohman
24d9c8400f Implement the ExtractValueInst::getIndexedType that accepts one
index value.

llvm-svn: 52432
2008-06-17 21:07:55 +00:00
Owen Anderson
79605db969 Add an insertBefore method for attaching previously unattached instructions,
such as those created by clone(), to a basic block.

llvm-svn: 52424
2008-06-17 18:29:27 +00:00
Chris Lattner
dd707dc82d switch TypeHasCycleThroughItself from using an std::set to using a SmallPtrSet,
this speeds up the linking testcase in PR1860 by 44% (.379 -> 0.263)

llvm-svn: 52365
2008-06-16 21:20:58 +00:00
Chris Lattner
09554fd076 fix pr2460
llvm-svn: 52294
2008-06-16 04:02:40 +00:00
Evan Cheng
5897328890 Do not speculatively execute an instruction by hoisting it to its predecessor BB if any of its operands are defined but not used in BB. The transformation will prevent the operand from being sunk into the use block.
llvm-svn: 52244
2008-06-12 21:15:59 +00:00
Dan Gohman
68f8fbdac4 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.

llvm-svn: 52157
2008-06-09 21:26:13 +00:00
Gabor Greif
7c2e365dbc get rid of ExtractValueInst::init's Value argument, it is already passed to the UnaryInstruction ctor
llvm-svn: 52064
2008-06-06 21:06:32 +00:00
Gabor Greif
8ac103e71d make ExtractValueInst derived from UnaryInstruction
llvm-svn: 52061
2008-06-06 20:28:12 +00:00
Devang Patel
1db00c242e Print debug message only if there are dead passes.
llvm-svn: 52052
2008-06-06 17:50:36 +00:00
Duncan Sands
d634afe3aa Wrap MVT::ValueType in a struct to get type safety
and better control the abstraction.  Rename the type
to MVT.  To update out-of-tree patches, the main
thing to do is to rename MVT::ValueType to MVT, and
rewrite expressions like MVT::getSizeInBits(VT) in
the form VT.getSizeInBits().  Use VT.getSimpleVT()
to extract a MVT::SimpleValueType for use in switch
statements (you will get an assert failure if VT is
an extended value type - these shouldn't exist after
type legalization).
This results in a small speedup of codegen and no
new testsuite failures (x86-64 linux).

llvm-svn: 52044
2008-06-06 12:08:01 +00:00
Dan Gohman
70fe9e347d Revert 52002.
llvm-svn: 52030
2008-06-05 23:57:06 +00:00
Matthijs Kooijman
ebf00c0f65 Change the Verifier to support returning first class aggregrates.
Add a testcase for functions returning first class aggregrates.

llvm-svn: 52002
2008-06-05 14:00:36 +00:00
Matthijs Kooijman
6216df14cb * Make CallSite::hasArgument const and let it take a const parameter.
llvm-svn: 51989
2008-06-05 08:04:58 +00:00
Matthijs Kooijman
de47a7518d Add CallSite::hasArgument to allow for seeing if a call passes a certain value as an argument quickly.
llvm-svn: 51946
2008-06-04 16:31:12 +00:00
Matthijs Kooijman
318e1df0e4 Add a Name parameter to two of the init methods of GetElementPointer to make the name setting more consistent.
llvm-svn: 51945
2008-06-04 16:14:12 +00:00
Matthijs Kooijman
2f6b694afc Implement the two constructors in InsertValueInst and ExtractValueInst.
Add a Name argment to two init methods in these classes as well to make things
a bit more consistent.

llvm-svn: 51937
2008-06-04 14:40:55 +00:00
Evan Cheng
20d22b220a More pass manager debugging outputs.
llvm-svn: 51930
2008-06-04 09:13:31 +00:00
Dale Johannesen
2803c991a5 Prevent a crash in debug dumps.
llvm-svn: 51910
2008-06-03 18:14:29 +00:00
Devang Patel
edc62adcd9 "Unable to schedule <A> required by <B>" is more helpful then
"Unable to handle Pass that requires lower level Analysis pass"

llvm-svn: 51892
2008-06-03 01:20:02 +00:00
Devang Patel
390d72740e Add debugging aid.
llvm-svn: 51891
2008-06-03 01:02:16 +00:00
Dan Gohman
fbf0f6cf8e Constant folding for insertvalue and extractvalue.
llvm-svn: 51889
2008-06-03 00:15:20 +00:00
Dan Gohman
06d49b3c5b AsmWriter support for insertvalue/extractvalue. These instructions can
now round-trip through assembly and bitcode.

llvm-svn: 51823
2008-05-31 19:12:39 +00:00
Dan Gohman
caa9c6e94d Fix some bugs with the handling of indices in insertvalue/extractvalue.
llvm-svn: 51820
2008-05-31 19:09:08 +00:00
Dan Gohman
1ab21af8e0 Factor several methods, including getInversePredicate and
getSwappedPredicate, from ICmpInst and FCmpInst into common
methods in CmpInst. This allows CmpInsts to be manipulated
generically.

llvm-svn: 51810
2008-05-31 02:47:54 +00:00
Dan Gohman
ac5c3382fe IR, bitcode reader, bitcode writer, and asmparser changes to
insertvalue and extractvalue to use constant indices instead of
Value* indices. And begin updating LangRef.html.

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

llvm-svn: 51806
2008-05-31 00:58:22 +00:00
Matthijs Kooijman
32c5d3a9ee Let Instruction::getOpcodeName() return something useful for the new
insertvalue / extractvalue instructions.

llvm-svn: 51766
2008-05-30 10:31:54 +00:00
Gabor Greif
2abf6ec2e5 back out last commit: The .cpp file for a module should include its corresponding header first, even if redundant.
llvm-svn: 51598
2008-05-27 17:26:02 +00:00
Gabor Greif
0b9cf0d491 prune unneeded #includes
llvm-svn: 51590
2008-05-27 11:06:03 +00:00
Gabor Greif
0fb81af839 remove unneeded reinterpret_casts
llvm-svn: 51589
2008-05-27 11:03:29 +00:00
Gabor Greif
b93cb3dc6f We have the correct headers included to know that BB isa Value. No reinterpret_cast necessary.
llvm-svn: 51588
2008-05-27 10:48:39 +00:00
Gabor Greif
e052a42a62 eliminate calls to deprecated Use::init() interface
llvm-svn: 51570
2008-05-26 21:33:52 +00:00
Duncan Sands
fa995d7cc5 Factor code to copy global value attributes like
the section or the visibility from one global
value to another: copyAttributesFrom.  This is
particularly useful for duplicating functions:
previously this was done by explicitly copying
each attribute in turn at each place where a
new function was created out of an old one, with
the result that obscure attributes were regularly
forgotten (like the collector or the section).
Hopefully now everything is uniform and nothing
is forgotten.

llvm-svn: 51567
2008-05-26 19:58:59 +00:00
Evan Cheng
e5e0b4660d Eliminate x86.sse2.punpckh.qdq and x86.sse2.punpckl.qdq.
llvm-svn: 51533
2008-05-24 02:56:30 +00:00
Evan Cheng
564238c841 Eliminate x86.sse2.movs.d, x86.sse2.shuf.pd, x86.sse2.unpckh.pd, and x86.sse2.unpckl.pd intrinsics. These will be lowered into shuffles.
llvm-svn: 51531
2008-05-24 02:14:05 +00:00
Evan Cheng
365e0f3932 Autoupgrade x86.sse2.loadh.pd and x86.sse2.loadl.pd.
llvm-svn: 51523
2008-05-24 00:08:39 +00:00
Dan Gohman
8b6f4366ae Tidy up BasicBlock::getFirstNonPHI, and change a bunch of places to
use it instead of duplicating its functionality.

llvm-svn: 51499
2008-05-23 21:05:58 +00:00