Commit Graph

2567 Commits

Author SHA1 Message Date
Devang Patel
2c9c3e7368 Implement function notes as function attributes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56716 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26 23:51:19 +00:00
Devang Patel
19c874638d 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56704 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26 22:53:05 +00:00
Dan Gohman
533d3b3f37 Fix missing whitespace in the printing of function notes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56702 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26 22:02:59 +00:00
Dale Johannesen
7fefc6b4fe Another file I forgot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56678 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26 19:31:53 +00:00
Dale Johannesen
86098bd6a6 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56677 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-26 19:31:26 +00:00
Bill Wendling
c4f72dd6e7 Make pointer parameter const for isUsedInBasicBlock.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56625 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-25 22:42:01 +00:00
Devang Patel
0598866c05 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56622 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-25 21:00:45 +00:00
Dan Gohman
0c8927efed Avoid a spurious extra space character when printing empty structs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56616 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-25 17:37:20 +00:00
Oscar Fuentes
5f1f2aef7d CMake: Lists of source files updated. Removed bogus dependency from
lib/VMCore/CMakeLists.txt


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56541 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-24 01:58:12 +00:00
Devang Patel
e3d76d37e9 s/ParamAttrsWithIndex/FnAttributeWithIndex/g
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56535 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-24 00:55:02 +00:00
Devang Patel
1e48000966 s/ParamAttributeListImpl/AttributeListImpl/g
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56532 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-24 00:29:49 +00:00
Devang Patel
20bcaff6a7 Put FN_NOTE_AlwaysInline and others in FnAttr namespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56527 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-24 00:06:15 +00:00
Devang Patel
dd4924c564 Move FN_NOTE_AlwaysInline and other out of ParamAttrs namespace.
Do not check isDeclaration() in hasNote(). It is clients' responsibility.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56524 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-23 23:52:03 +00:00
Devang Patel
06117b6598 80 cols
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56521 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-23 23:32:15 +00:00
Devang Patel
eaf42abab6 s/ParameterAttributes/Attributes/g
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56513 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-23 23:03:40 +00:00
Devang Patel
d9b4a5f859 Use parameter attribute store (soon to be renamed) for
Function Notes also. Function notes are stored at index ~0.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56511 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-23 22:35:17 +00:00
Duncan Sands
3ee8fc9649 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56487 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-23 12:47:39 +00:00
Devang Patel
f3ba70861c Add hasNote() to check note associated with a function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56477 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-22 22:32:29 +00:00
Oscar Fuentes
3d01fc7de8 Initial support for the CMake build system.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56419 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-22 01:08:49 +00:00
Gabor Greif
6f4266506b backing out my last commit, it was not intended to go on the trunk
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56349 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-19 15:13:20 +00:00
Gabor Greif
6c2c95d0ac first shot at removing Use::Val
untested, Use::swap() is definitely not done yet

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56348 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-19 15:03:57 +00:00
Dan Gohman
8dae138d06 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)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56196 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-14 17:21:12 +00:00
Devang Patel
bd6dc7a086 Add assertion check.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56016 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-09 21:38:40 +00:00
Anton Korobeynikov
19e861a4ff Make safer variant of alias resolution routine to be default
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56005 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-09 20:05:04 +00:00
Anton Korobeynikov
820c83bf6c Fix typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55998 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-09 18:24:07 +00:00
Anton Korobeynikov
832b2a9cd8 Fix incorrect linker behaviour: we shouldn't resolve weak aliases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55997 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-09 18:23:48 +00:00
Devang Patel
0938f74242 Simplify.
Fix outdated comment.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55993 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-09 17:56:50 +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
Dan Gohman
500233aef9 Bitcasting two or from aggregate types is not permitted. Update
LangRef.html, and teach the verifier to check bitcast instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55921 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-08 16:45:59 +00:00
Dan Gohman
ae73dc1448 Tidy up several unbeseeming casts from pointer to intptr_t.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55779 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-04 17:05:41 +00:00
Devang Patel
72ab076e67 Avoid extra comma.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55742 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-03 22:55:40 +00:00
Devang Patel
52e89dd4e2 Parse and print opt_size note.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55740 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-03 22:10:21 +00:00
Nick Lewycky
8373d38afd Try to fold each element of a vector. This is needed to maintain structural
equivalence.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55694 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-03 06:48:55 +00:00
Nick Lewycky
83c05e5d30 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!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55689 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-03 05:54:33 +00:00
Devang Patel
cb7f483d8c s/FP_AlwaysInline/FN_NOTE_AlwaysInline/g
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55676 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-02 22:43:57 +00:00
Devang Patel
1b47e48a64 Use bitwise AND.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55656 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-02 21:46:44 +00:00
Devang Patel
94bdae14ba Print function notes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55647 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-02 20:56:33 +00:00
Devang Patel
81b2ab8a24 Initialize function notes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55645 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-02 20:51:15 +00:00
Nuno Lopes
6e95d90b4c plug a little memleak in verifyFunction()
# first commit to llvm, so whatch out :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55631 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-02 11:30:10 +00:00
Gordon Henriksen
07cabf6102 PR2731: C and Ocaml bindings for setTailCall and isTailCall.
Based on patch by Giorgos Korfiatis.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55570 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-30 16:34:54 +00:00
Gordon Henriksen
699609cf91 Fix ConstantExpr::getInsertElement.
Breakage was exposed in the Ocaml bindings tests after Chris
uncommented an assertion in r55084.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55566 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-30 15:41:51 +00:00
Chris Lattner
828db8a2f9 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55541 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-29 17:19:30 +00:00
Chris Lattner
cad208b8bc 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 ;-)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55460 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-28 04:02:44 +00:00
Bill Wendling
d64d956f3d Put file scoped constants in an anonymous namespace. Use the "using namespace
llvm" for consistency.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55435 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-27 21:10:13 +00:00
Chris Lattner
505569dc9c Minor cleanup.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55423 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-27 17:36:58 +00:00
Dan Gohman
39dfc2cb9c Diagnose uses of unsized types with the byval attribute in the
verifier. See PR2711 for details.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55414 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-27 14:48:06 +00:00
Dan Gohman
9f50eeea8c Update wording, as aggregates are now first-class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55413 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-27 14:44:57 +00:00
Evan Cheng
1505cdbcea Add DebugInfoBuilder. Patch by Talin!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55409 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-27 06:51:14 +00:00
Chris Lattner
7059e530ed Fix pasto (values -> types) noticed by Josh Conner
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55315 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-25 17:03:15 +00:00
Chris Lattner
3518175d42 flush stream after dumping.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55301 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-25 04:55:46 +00:00
Chris Lattner
415b414a8f 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! :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55294 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-24 20:46:13 +00:00
Chris Lattner
5a1c68c776 add a hack to temporarily allow pseudo source values.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55289 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-24 18:33:17 +00:00
Chris Lattner
ab49ee752e minor cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55267 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-23 22:52:27 +00:00
Chris Lattner
944fac71e0 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55263 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-23 22:23:09 +00:00
Bill Wendling
955fdeb19c 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



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55233 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-23 09:46:46 +00:00
Chris Lattner
259f88e3c9 Verify that the alignment argument to llvm.memcpy is a constant
integer, PR2318.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55228 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-23 05:31:10 +00:00
Chris Lattner
dbf7aa5b4b remove verification for gc intrinsic argument types. it was indented wrong
and tblgen now knows intrinsic prototypes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55227 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-23 05:26:35 +00:00
Chris Lattner
b4f572597e the bug was apparently fixed long ago, reenable the assertion
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55224 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-23 03:48:35 +00:00
Dale Johannesen
3434994874 Accept NOT of a constant vector of int.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55140 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-21 21:20:09 +00:00
Chris Lattner
b054bfd3ea Add a new ConstantExpr::getWithOperands that takes any array of operands
instead of requiring an std::vector.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55084 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-20 22:27:40 +00:00
Chris Lattner
4667b71f93 more cleanups, random methods shouldn't return ostreams.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54984 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-19 05:26:17 +00:00
Chris Lattner
52b26de325 more cleanup, eliminate getLLVMName when printing out
type names at the top of the file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54983 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-19 05:16:28 +00:00
Chris Lattner
cfb5a200d6 random cleanups, factor some printing code for linkage and visibility
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54982 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-19 05:06:27 +00:00
Chris Lattner
242330371b 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54981 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-19 04:47:09 +00:00
Chris Lattner
76a690e024 whitespace cleanup
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54980 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-19 04:45:47 +00:00
Chris Lattner
6ab910b946 rearrange code and make more legible.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54976 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-19 04:36:02 +00:00
Chris Lattner
b64871a6ad put SlotTracker in an anon namespace since it is private.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54975 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-19 04:28:07 +00:00
Chris Lattner
0d9574a1cd Reid had to call this class "slot machine" out of some strange reference
to the gambling device.  Name it something more meaningful.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54974 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-19 04:26:57 +00:00
Chris Lattner
d7cbd1574f Fix a bug daniel pointed out to me, where asmprinter started
printing ascii code for hex numbers instead of the hex numbers 
themselves.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54936 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-18 19:41:26 +00:00
Gordon Henriksen
5eca075b74 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54899 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-17 18:44:35 +00:00
Chris Lattner
addd44427c getLLVMName is only used for types now, which always pass in LocalPrefix. Specialize on it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54897 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-17 17:28:37 +00:00
Chris Lattner
9225507cda 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%)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54896 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-17 17:25:25 +00:00
Chris Lattner
95e4bd81d7 avoid an extraneous std::string construction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54875 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-17 07:24:08 +00:00
Chris Lattner
fad86b003a 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54873 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-17 07:19:36 +00:00
Chris Lattner
c97536e6a7 avoid string thrashing when formatting names in output. This
speeds up release-asserts llvm-dis on kc++ from 1.86s to 1.04s (~79%)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54868 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-17 04:40:13 +00:00
Chris Lattner
45d4c73aa7 random cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54866 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-17 04:17:45 +00:00
Chris Lattner
3b12ab4519 Inline the fastpath of PATypeHolder::get(). This is a small speedup in
instcombine among other things.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54814 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-15 15:16:50 +00:00
Devang Patel
488dc6732d 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54805 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-14 23:07:48 +00:00
Owen Anderson
9d7f0b76aa Have LeakDetector use a SmallPtrSet instead of an std::set.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54785 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-14 20:40:10 +00:00
Dan Gohman
7f8613e5b8 Improve support for vector casts in LLVM IR and CodeGen.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54784 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-14 20:04:46 +00:00
Dale Johannesen
7dc00abd86 Add read/write support for X86's sseregparm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54744 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-13 18:40:23 +00:00
Devang Patel
78766ff67c Use SmallVector instead of std::vector
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54685 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-12 15:44:31 +00:00
Devang Patel
721e59cfb2 Use DenseMap to keep track of last users.
Use inversed map for faster queries.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54662 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-12 00:26:16 +00:00
Devang Patel
3b8a90686a Keep track of analysis usage information for passes. Avoid invoking
getAnalysisUsage() repeatedly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54650 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-11 21:13:39 +00:00
Gordon Henriksen
f068263cbc Delete a redundant binding, LLVMHasInitializer.
Please use !LLVMIsDeclaration instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54572 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-09 02:13:58 +00:00
Eric Christopher
7a61d701c0 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54546 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-08 19:39:37 +00:00
Chris Lattner
0dabb7e8f3 Don't call getAnalysisUsage unless -debug-pass is enabled. This speeds
up the passmgr by avoiding useless work.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54528 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-08 15:14:09 +00:00
Chris Lattner
fc65d38085 Speed up the passmgr by avoiding heap thrashing on vectors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54515 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-08 05:33:04 +00:00
Chris Lattner
e2c5ecd46a Don't verify passes when assertions are disabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54446 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-07 07:34:50 +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
Dan Gohman
430b8a22e2 Fix several const-correctness issues, resolving some -Wcast-qual warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54349 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-05 14:45:15 +00:00
Duncan Sands
58921feaa9 Fix comment typos.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54266 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-01 12:23:49 +00:00
Mon P Wang
e3b3a7241c 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54195 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-30 04:36:53 +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
Matthijs Kooijman
e2afdedec5 Add a GetElementPtrInst::getIndexedType that accepts uint64_t's instead of just Value*'s.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54157 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-29 08:46:11 +00:00
Dan Gohman
fed90b6d09 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54146 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-28 21:51:04 +00:00
Nate Begeman
ff795a80a3 Remove unnecessary implicit argument
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54031 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-25 17:56:27 +00:00
Nate Begeman
b5557abcf1 Fix minor issues with VICmp/VFCmp constant expressions
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54030 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-25 17:35:37 +00:00
Nate Begeman
0abbe2bf15 Allow verifier to be run on partially materialized modules.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54028 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-25 17:28:23 +00:00
Nate Begeman
b4ab9d69da Tab removal
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54025 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-25 17:24:13 +00:00