Commit Graph

2765 Commits

Author SHA1 Message Date
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
Evan Cheng
1bf9a18834 Rename instance variables, parameter argument names to eliminate a bunch of compilation warnings with -Wshadow.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53970 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-24 00:08:56 +00:00
Dan Gohman
fc74abfba5 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53941 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-23 00:34:11 +00:00
Dan Gohman
ceab39f0b7 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53890 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-22 00:36:48 +00:00
Dan Gohman
e089160d10 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53887 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 23:30:30 +00:00
Chris Lattner
0c141e6673 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53749 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-18 05:23:39 +00:00
Chris Lattner
bbedb0e408 Fix a bunch of bugs handling vector compare constant expressions, fixing
PR2317.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53544 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-14 05:17:31 +00:00
Chris Lattner
071aade5f0 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.  



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53541 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-14 05:10:41 +00:00
Dan Gohman
c418bf3dd5 Use find instead of lower_bound.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53474 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-11 20:58:19 +00:00
Chris Lattner
7cc9a4b990 SImplify ConstantVector::get a bit and make it turn a vector
of all undefs into a single undef value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53384 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 00:44:03 +00:00
Chris Lattner
fea85c46c0 Fix a case where vector comparison constant folding would cause an
infinite recursion.  part of PR2529


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53383 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 00:29:28 +00:00
Chris Lattner
8638144825 add a helper method for code that wants to handle vector
constants by element without caring how they are formed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53381 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 00:28:11 +00:00
Chris Lattner
330e7e4d25 elementwise comparison of vector constants was completely wrong. Fix
it for PR2529


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53380 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 00:08:17 +00:00
Evan Cheng
250c1d8734 - 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53379 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-10 00:04:23 +00:00
Dan Gohman
0af8225088 Consistently put quotes around pass names in debugging output.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53268 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-09 00:50:40 +00:00
Chris Lattner
8013954f15 improve comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53243 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-08 18:47:38 +00:00
Duncan Sands
cfa3c236b2 Add some helpers for manipulating function
parameter attributes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53228 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-08 09:41:30 +00:00
Duncan Sands
2e033f31dc Add some convenience methods for manipulating
call attributes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53223 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-08 08:38:44 +00:00
Chris Lattner
155a490258 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)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53220 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-08 05:46:34 +00:00
Dan Gohman
1002c02034 Add explicit keywords.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53179 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-07 18:00:37 +00:00
Bill Wendling
10fff6078a Revert my previous check-in that split up MachineModuleInfo. It turns out to
slow the compiler down at -O0 some 30% or more. Ooops.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53120 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-03 22:53:42 +00:00
Matthijs Kooijman
10b9de62ff Add newline at the end of Constants.cpp.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53092 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-03 07:46:41 +00:00
Dan Gohman
8de552d6f3 Use operator new instead of new char[].
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53066 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-03 00:53:09 +00:00
Devang Patel
f35cfe11ef Disable dom info verifier by default.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52983 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-01 21:36:11 +00:00
Devang Patel
844a3d163b Fix typos in comments.
Thanks for the feedback!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52978 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-01 19:50:56 +00:00
Devang Patel
5b57e720c8 Add dom info verifier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52967 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-01 17:44:24 +00:00
Devang Patel
687e03b2fa Move dominator info printer into tool/opt/GraphPrinters.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52907 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-30 17:32:58 +00:00
Evan Cheng
0ff39b3feb - 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52891 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-30 07:31:25 +00:00
Anton Korobeynikov
6d116bc7ce 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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52884 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-29 17:57:03 +00:00
Chris Lattner
97388469b1 implement some fixme's by making "autorenaming" in the value symbol table not
thrash the heap with string stuff (e.g. utostr).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52838 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-27 21:26:26 +00:00
Chris Lattner
48cd712d4c simplify some code to avoid string thrashing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52837 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-27 21:25:24 +00:00
Chris Lattner
bb0e248718 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!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52834 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-27 21:09:10 +00:00
Devang Patel
42af887105 Add dominator info printer pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52829 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-27 16:43:21 +00:00
Bill Wendling
305635abea 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!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52800 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-27 00:09:40 +00:00
Eric Christopher
0d2b0aba42 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52748 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-26 00:31:12 +00:00
Mon P Wang
2887310630 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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52706 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-25 08:15:39 +00:00
Owen Anderson
e4f6ee590b Use push_back rather than operator[], which is incorrect in this cases. Unfortunately, this slow the testcase down a little bit,
but only marginally.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52700 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-25 01:05:05 +00:00
Owen Anderson
45e3958941 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52690 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-24 21:58:29 +00:00
Dan Gohman
78f39da1e8 Use const_cast instead of a C-style cast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52684 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-24 17:47:37 +00:00
Dan Gohman
2f27e174a9 Remove two convenience constructors because they're now private, and the
private implementation doesn't really need the convenience.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52629 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-23 16:48:17 +00:00
Dan Gohman
7894ea75b5 Use std::copy instead of a loop.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52628 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-23 16:45:24 +00:00
Dan Gohman
1a203571ca More changes from Chris' review: simplify getIndices and avoid
copying its return value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52627 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-23 16:39:44 +00:00
Dan Gohman
4d515d0b09 Use Function's arg_size() and size() methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52605 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-21 22:06:54 +00:00
Chris Lattner
a1aabe422f fix some warnings when assertions are disabled.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52587 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-21 19:47:03 +00:00
Dan Gohman
09ef00f979 Simplify this code. Thanks Chris!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52514 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-20 00:47:44 +00:00
Dan Gohman
44f6a2c951 Auto-upgrade code for multiple-value return statements. This code
isn't actually called yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52435 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-17 23:38:43 +00:00
Dan Gohman
80b9626ee3 In InsertValueInst's copy ctor, actually copy the operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52434 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-17 23:25:49 +00:00
Dan Gohman
b79bf1966d Implement the ExtractValueInst::getIndexedType that accepts one
index value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52432 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-17 21:07:55 +00:00
Owen Anderson
26bb50ab48 Add an insertBefore method for attaching previously unattached instructions,
such as those created by clone(), to a basic block.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52424 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-17 18:29:27 +00:00
Chris Lattner
d34ff14358 switch TypeHasCycleThroughItself from using an std::set to using a SmallPtrSet,
this speeds up the linking testcase in PR1860 by 44% (.379 -> 0.263)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52365 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-16 21:20:58 +00:00
Chris Lattner
6520aa0f5e fix pr2460
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52294 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-16 04:02:40 +00:00
Evan Cheng
502a4f5162 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52244 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-12 21:15:59 +00:00
Dan Gohman
7dc1def162 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52157 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-09 21:26:13 +00:00
Gabor Greif
76aca6f38f get rid of ExtractValueInst::init's Value argument, it is already passed to the UnaryInstruction ctor
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52064 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-06 21:06:32 +00:00
Gabor Greif
d4f268bdd4 make ExtractValueInst derived from UnaryInstruction
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52061 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-06 20:28:12 +00:00
Devang Patel
8fb6a94b69 Print debug message only if there are dead passes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52052 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-06 17:50:36 +00:00
Duncan Sands
83ec4b6711 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).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52044 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-06 12:08:01 +00:00
Dan Gohman
836bfcd689 Revert 52002.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52030 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-05 23:57:06 +00:00
Matthijs Kooijman
411e6a5efb Change the Verifier to support returning first class aggregrates.
Add a testcase for functions returning first class aggregrates.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52002 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-05 14:00:36 +00:00
Matthijs Kooijman
045b3f7bf1 * Make CallSite::hasArgument const and let it take a const parameter.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51989 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-05 08:04:58 +00:00
Matthijs Kooijman
9515a8f88a Add CallSite::hasArgument to allow for seeing if a call passes a certain value as an argument quickly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51946 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-04 16:31:12 +00:00
Matthijs Kooijman
338169ddc9 Add a Name parameter to two of the init methods of GetElementPointer to make the name setting more consistent.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51945 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-04 16:14:12 +00:00
Matthijs Kooijman
444099f615 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51937 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-04 14:40:55 +00:00
Evan Cheng
7c9b65207e More pass manager debugging outputs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51930 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-04 09:13:31 +00:00
Dale Johannesen
24f07dc6e4 Prevent a crash in debug dumps.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51910 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-03 18:14:29 +00:00
Devang Patel
c0c33f5e2c "Unable to schedule <A> required by <B>" is more helpful then
"Unable to handle Pass that requires lower level Analysis pass"


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51892 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-03 01:20:02 +00:00
Devang Patel
e62f750784 Add debugging aid.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51891 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-03 01:02:16 +00:00
Dan Gohman
6e68f59b78 Constant folding for insertvalue and extractvalue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51889 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-03 00:15:20 +00:00
Dan Gohman
995be7d07a AsmWriter support for insertvalue/extractvalue. These instructions can
now round-trip through assembly and bitcode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51823 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-31 19:12:39 +00:00
Dan Gohman
35651cdf0b Fix some bugs with the handling of indices in insertvalue/extractvalue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51820 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-31 19:09:08 +00:00
Dan Gohman
7e2dd6628e Factor several methods, including getInversePredicate and
getSwappedPredicate, from ICmpInst and FCmpInst into common
methods in CmpInst. This allows CmpInsts to be manipulated
generically.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51810 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-31 02:47:54 +00:00
Dan Gohman
81a0c0b44e 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51806 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-31 00:58:22 +00:00
Matthijs Kooijman
74b5e07cc4 Let Instruction::getOpcodeName() return something useful for the new
insertvalue / extractvalue instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51766 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-30 10:31:54 +00:00
Gabor Greif
0a4fd1ab7e back out last commit: The .cpp file for a module should include its corresponding header first, even if redundant.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51598 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-27 17:26:02 +00:00
Gabor Greif
3d8710e80a prune unneeded #includes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51590 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-27 11:06:03 +00:00
Gabor Greif
b9d9eba916 remove unneeded reinterpret_casts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51589 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-27 11:03:29 +00:00
Gabor Greif
9a6246c734 We have the correct headers included to know that BB isa Value. No reinterpret_cast necessary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51588 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-27 10:48:39 +00:00
Gabor Greif
6c80c38160 eliminate calls to deprecated Use::init() interface
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51570 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-26 21:33:52 +00:00
Duncan Sands
28c3cff825 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51567 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-26 19:58:59 +00:00
Evan Cheng
a31593901d Eliminate x86.sse2.punpckh.qdq and x86.sse2.punpckl.qdq.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51533 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-24 02:56:30 +00:00
Evan Cheng
e716bb1c59 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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51531 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-24 02:14:05 +00:00
Evan Cheng
4797f61657 Autoupgrade x86.sse2.loadh.pd and x86.sse2.loadl.pd.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51523 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-24 00:08:39 +00:00
Dan Gohman
02dea8b39f Tidy up BasicBlock::getFirstNonPHI, and change a bunch of places to
use it instead of duplicating its functionality.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51499 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-23 21:05:58 +00:00
Dan Gohman
ee335e35ac Add #includes to make some dependencies explicit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51496 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-23 20:40:06 +00:00
Dan Gohman
e4569943d9 Add more IR support for the new extractvalue and insertvalue
instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51461 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-23 00:36:11 +00:00
Chris Lattner
ea21ad4926 Fix PR2267, by allowing indirect outputs to be intermixed
with normal outputs.  Testcase here: 
test/CodeGen/X86/asm-indirect-mem.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51409 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-22 04:46:38 +00:00
Gordon Henriksen
83eaae19ad Remove a duplicative binding. Patch by Mahadevan R.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51238 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-19 05:47:10 +00:00
Nick Lewycky
08de1e476c Revert constant-folding change that will miscompile in some cases.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51223 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-17 19:00:05 +00:00
Nick Lewycky
6cccce3e58 Unbreak the build.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51217 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-17 09:05:22 +00:00
Nick Lewycky
d24ae8703f Constant fold inttoptr and ptrtoint.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51216 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-17 09:03:26 +00:00
Eric Christopher
0bf7b414ae Add functions to enable adding a single attribute to a function and
its associated call site.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51204 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-16 20:39:43 +00:00
Gabor Greif
7cbd8a3e92 API change for {BinaryOperator|CmpInst|CastInst}::create*() --> Create. Legacy interfaces will be in place for some time. (Merge from use-diet branch.)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51200 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-16 19:29:10 +00:00
Dan Gohman
eedff319dc Revert the change from r51157 in
test/Verifier/2002-11-05-GetelementptrPointers.ll, which was incorrect.
Instead, fix getIndexedType to not follow pointer types, as
PointerType is a subclass of CompositeType.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51171 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-16 00:16:32 +00:00
Dan Gohman
041e2eb517 IR support for extractvalue and insertvalue instructions. Also, begin
moving toward making structs and arrays first-class types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51157 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-15 19:50:34 +00:00
Gabor Greif
b1dbcd886a Fix a bunch of 80col violations that arose from the Create API change. Tweak makefile targets to find these better.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51143 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-15 10:04:30 +00:00
Nate Begeman
ff155f03bd Move the operator new and operator delete out of line. This fixes an issue with
operator new() referring to the static initTags function, which has to be in the 
same linkage unit as any file including User.h.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51136 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-15 01:23:11 +00:00
Dale Johannesen
aafce77b17 Add CommonLinkage; currently tentative definitions
are represented as "weak", but there are subtle differences
in some cases on Darwin, so we need both.  The intent
is that "common" will behave identically to "weak" unless
somebody changes their target to do something else.
No functional change as yet.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51118 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-14 20:12:51 +00:00
Dan Gohman
4d9dd6beae Make PreVerifyID, IntSigsEnd, and KillSigsEnd const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51088 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-14 00:42:30 +00:00
Gabor Greif
94fb68ba21 Merge of r51073-51074 from use-diet branch.
Do not rely on std::swap<Use>, provide a (faster) member function instead.
This change is primarily necessitated by MSVC++'s incompatibility with
declaring std::swap<Use> to be a friend of Use.

Also contains some minor tweaks to Use inline functions,
to undo pointless changes that sneaked in with the last merge.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51078 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-13 22:51:52 +00:00
Devang Patel
2527e88416 Dominance Frontier is cfg only pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51075 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-13 22:43:21 +00:00
Gabor Greif
d6a2218586 Derive GetResultInst from UnaryInstruction, this simplifies code and removes a FIXME.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51023 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-13 07:09:08 +00:00
Dan Gohman
6ddba2b933 Change class' public PassInfo variables to by initialized with the
address of the PassInfo directly instead of calling getPassInfo.
This eliminates a bunch of dynamic initializations of static data.

Also, fold RegisterPassBase into PassInfo, make a bunch of its
data members const, and rearrange some code to initialize data
members in constructors instead of using setter member functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51022 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-13 02:05:11 +00:00
Dan Gohman
844731a7f1 Clean up the use of static and anonymous namespaces. This turned up
several things that were neither in an anonymous namespace nor static
but not intended to be global.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51017 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-13 00:00:25 +00:00
Nate Begeman
c83ad0d8e7 Pointer comparisons should be handled by icmp, not vicmp :)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50994 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-12 20:11:05 +00:00
Nate Begeman
18e4e8500f Hard code CmpInst back to i1 for now while I go track down what in the bitcode reader/writer is assuming i1
This was breaking a bunch of tests


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50992 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-12 20:01:56 +00:00
Nate Begeman
6fd90ce2ee Fix build breakage
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50986 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-12 19:23:22 +00:00
Nate Begeman
ac80ade158 Add two new instructions to the llvm IR, vicmp and vfcmp. see updated LangRef
for details.  CodeGen support coming in a follow up patch


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50985 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-12 19:01:56 +00:00
Dan Gohman
9b38d7db6d Update comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50974 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-12 16:34:30 +00:00
Gabor Greif
efe65369a7 merge of use-diet branch to trunk
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50943 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-10 08:32:32 +00:00
Anton Korobeynikov
018f771398 Check for validity of aliasee pointer before dereference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50878 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-08 23:11:06 +00:00
Chris Lattner
748118d8aa conservatively say that volatile stores read memory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50872 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-08 21:58:49 +00:00
Chris Lattner
38818b072f store can't read from memory.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50869 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-08 21:47:43 +00:00
Chris Lattner
d96288a2ff add a new Instruction::mayReadFromMemory predicate, make
Instruction::mayWriteToMemory stronger for invokes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50858 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-08 17:16:51 +00:00
Anton Korobeynikov
0b12ecf6ff Turn StripPointerCast() into a method
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50836 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-07 22:54:15 +00:00
Anton Korobeynikov
b04adddd50 Make StripPointerCast a common function (should we mak it method of Value instead?)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50775 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06 22:52:30 +00:00
Dan Gohman
84b7df43fb Remove uses of llvm/System/IncludeFile.h that are no longer needed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50695 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-06 01:32:53 +00:00
Gordon Henriksen
16c1f44d91 Use (void) instead of () in C code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50620 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-04 12:55:34 +00:00
Evan Cheng
22b942aa4d Add separate intrinsics for MMX / SSE shifts with i32 integer operands. This allow us to simplify the horribly complicated matching code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50601 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-03 00:52:09 +00:00
Chris Lattner
5c5f1095ec fix a bug in my previous patch, a classic =/== bug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50483 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-30 15:27:09 +00:00
Chris Lattner
12e6d20059 add a method for comparing to see if a value has a specified name.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50465 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-30 03:55:40 +00:00
Gordon Henriksen
e2435da8ab Expose parameter attributes via C bindings.
Patch by Anders Johnsen!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50360 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-28 17:37:06 +00:00
Chris Lattner
96bb622646 Allow asms to return multiple results by value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50328 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-27 23:33:55 +00:00
Nick Lewycky
280a6e607d Remove 'unwinds to' support from mainline. This patch undoes r47802 r47989
r48047 r48084 r48085 r48086 r48088 r48096 r48099 r48109 and r48123.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50265 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-25 16:53:59 +00:00
Chris Lattner
80b8f5dd6b tighten up verifier checks which missed cases where
return instrs operands didn't match up with function results.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50182 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-23 20:33:41 +00:00
Chris Lattner
d52b62ae05 Enforce that multiple return values have to have at least one result.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50137 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-23 05:36:34 +00:00
Chris Lattner
42369b7e4b Verify that the operand of a getresult instruction is a
call/invoke or undef.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50129 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-23 04:06:15 +00:00
Chris Lattner
eb411291fa more fallout from Nicholas' asmprinter patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50078 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-22 02:45:44 +00:00
Chris Lattner
ea705199af don't print dominators every time it is computed with -debug.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50032 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-21 06:19:02 +00:00
Chris Lattner
a1b5858fda another bug introduced in r47802 by nicholas, for no apparent reason.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50031 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-21 06:12:55 +00:00
Chris Lattner
96c5b2f8c7 fix a bug introduced by Nicholas' "unwinds to" stuff: we
lost newlines between blocks.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50024 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-21 04:20:33 +00:00
Chris Lattner
7ae40e7d8a add a handy helper method to instruction, useful for determining
whether it is used outside of some block.  This can be used to see
if there are any non-local references, for example.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50004 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-20 22:11:30 +00:00
Chris Lattner
3e5d1d8d08 hopefully resolve PR2240
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49999 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-20 19:59:12 +00:00
Chris Lattner
0e4b6c7551 rearrange some code, simplify handling of shifts.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49995 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-20 18:24:14 +00:00
Chris Lattner
eb9c8e1e3f Use simplified ConstantFP::get method, fix a bug handling frem x, 0 with long doubles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49976 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-20 00:26:06 +00:00
Chris Lattner
d881ad2c57 Implement PR2206.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49967 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-19 22:17:26 +00:00
Chris Lattner
1c14c29746 refactor handling of symbolic constant folding, picking up
a few new cases( see Integer/a1.ll), but not anything that
would happen in practice.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49965 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-19 21:58:19 +00:00
Chris Lattner
61783d7322 indentation fix.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49964 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-19 21:13:00 +00:00
Dale Johannesen
48325f4b08 Don't read off end of the input array.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49799 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-16 17:31:41 +00:00
Owen Anderson
1f23e16319 Major repairs to the post-dominators implementation. Patch from Florian Brandner!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49768 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-16 04:21:16 +00:00
Dan Gohman
d660f973dc VAArg may trap.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49646 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-14 15:07:08 +00:00
Duncan Sands
89f6d88db3 Merge LLVMBuilder and FoldingBuilder, calling
the result IRBuilder.  Patch by Dominic Hamon.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49604 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-13 06:22:09 +00:00
Dan Gohman
3bd659ba20 Make several symbols static.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49496 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-10 21:11:47 +00:00
Chris Lattner
288e78fbe7 add a simplified accessor for creating an fp constant of a
particular value but variable type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49416 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09 06:38:30 +00:00
Chris Lattner
4592230265 add a version of ConstantFP::get that doesn't take a redundant Type* value,
start migrating code over to use it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49413 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-09 00:45:01 +00:00
Duncan Sands
92432a8db1 Convenience method for setting the nounwind
attribute for a function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49373 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-08 07:23:58 +00:00
Duncan Sands
79ab3e8014 Make sure that intrinsics automagically get the
right parameter attributes no matter how they
are obtained.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49335 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-07 13:39:11 +00:00
Gabor Greif
c024cbca22 fix a warning
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49282 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-06 21:42:13 +00:00
Gabor Greif
051a950000 API changes for class Use size reduction, wave 1.
Specifically, introduction of XXX::Create methods
for Users that have a potentially variable number of
Uses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49277 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-06 20:25:17 +00:00
Chris Lattner
038112a4e0 Change the MemoryBuffer::getFile* methods to take just a pointer to the
start of a filename, not a filename+length.  All clients can produce a
null terminated name, and the system api's require null terminated 
strings anyway.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49041 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-01 18:04:03 +00:00
Nate Begeman
83ad90a779 Don't eliminate bitcast instructions that change the type of a pointer
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48971 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-31 00:22:16 +00:00
Duncan Sands
66a1a05c86 Fix comment typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48967 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-30 19:38:55 +00:00
Nick Lewycky
0c78ac11dd Update example to new syntax.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48910 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-28 06:46:51 +00:00
Dan Gohman
950a4c40b8 Add explicit keywords.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48801 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-25 22:06:05 +00:00
Evan Cheng
26471c48b3 Handle a special case xor undef, undef -> 0. Technically this should be transformed to undef. But this is such a common idiom (misuse) we are going to handle it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48792 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-25 20:08:07 +00:00
Bill Wendling
92e73d7628 Fix PR2062: Don't build Intrinsics.gen in the source directory. Do it in the
object directory.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48766 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-25 09:12:48 +00:00
Dan Gohman
52837078c7 Shrink the size of AllocationInst by using its SubclassData
field to store the alignment value instead of haing a
separate field.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48727 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-24 16:55:58 +00:00
Gordon Henriksen
4733be3893 Objective Caml bindings for basic block, function, global, and arg iterators.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48711 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-23 22:21:29 +00:00
Anton Korobeynikov
4a0a001e15 Fix merge error
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48687 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-22 08:50:08 +00:00
Anton Korobeynikov
ef30c1d006 Add testcase for prev. commit. Minor fixes
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48686 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-22 08:37:05 +00:00
Anton Korobeynikov
726d45c548 Aliasing chains cleanups: update langref, add check into verifier
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48685 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-22 08:36:14 +00:00
Anton Korobeynikov
591858a403 Support chained aliases for LLVM IR printing. This fixes PR2145
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48684 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-22 08:17:17 +00:00
Anton Korobeynikov
89a3d3f25c Slightly increase default set size. It's cheap and won't hurt.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48682 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-22 07:48:40 +00:00
Dan Gohman
c9235d2e85 Don't include <map> in Pass.h, which doesn't need it. This requires
adding <map> to many files that actually do need it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48667 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-21 23:51:57 +00:00
Duncan Sands
495304e351 Make it possible to get an empty struct using
the new StructType::get method.  The second NULL
is to pacify the gcc warning mechanism.  This
patch compiles but is otherwise untested.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48645 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-21 15:53:17 +00:00
Evan Cheng
fa5a91a71e Undo 48570. Correctly match mmx shift instructions with an immediate operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48627 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-21 00:40:09 +00:00
Devang Patel
9f83512ce8 These passes preserve CFG.
This patch fixes Benchmarks/Trimaran/enc-pc1/enc-pc1 failure reported by Grawp-PIC i386 nightly tester


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48623 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-20 23:27:18 +00:00
Devang Patel
4f4c28f75f Restore isCFGOnly property of various analysis passes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48579 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-20 02:25:21 +00:00
Devang Patel
bed7e68498 Keep track of analysis information inherited from Module pass manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48576 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-20 01:09:53 +00:00
Evan Cheng
dff1dcac6c Add intrinsics to match mmx shift builtin's with immediate operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48569 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-19 23:38:52 +00:00
Devang Patel
b9c432fe77 #if 1 .. #endif markers do not add any value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48560 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-19 22:24:25 +00:00
Devang Patel
c758209153 PassInfo keep tracks whether a pass is an analysis pass or not.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48554 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-19 21:56:59 +00:00
Chris Lattner
d8ff3caaa0 add some convenience methods for creating GEP instructions and
struct types.  Patch by David Chisnall, with some tweaks.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48531 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-19 05:06:05 +00:00
Gordon Henriksen
3400097966 C bindings for Module-, Function-, and BasicBlock::iterator.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48528 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-19 03:47:18 +00:00
Gordon Henriksen
dc1ce7bdc6 C and Objective Caml bindings for the various getParent methods of the IR.
Based on Erick Tryzelaar's patch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48523 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-19 01:11:35 +00:00
Devang Patel
c7fe32e840 Do not use virtual function to identify an analysis pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48520 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-19 00:48:41 +00:00
Devang Patel
1cee94f041 Identify Analysis pass.
Do not run analysis pass again if analysis info is still available.
This fixes PR1441.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48476 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-18 00:39:19 +00:00
Gordon Henriksen
d78c0f5a72 C and Objective Caml bindings for PassManagers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48413 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-16 04:20:44 +00:00
Gordon Henriksen
af59b105bb Expose Module::dump via C and Ocaml.
Patch by Erick Tryzelaar.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48379 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-14 23:58:56 +00:00
Dan Gohman
b973d5f9b5 Update comments; getPassName no longer uses RTTI.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48369 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-14 18:27:04 +00:00
Chris Lattner
d5d94df73f move a bunch of trivial methods to be inline.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48326 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-13 05:00:21 +00:00
Chris Lattner
041221c097 Various improvements suggested by Duncan
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48325 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-13 04:33:03 +00:00
Dan Gohman
59ef015c65 Eliminate a few unnecessary uses of dynamic_cast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48318 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-13 02:08:36 +00:00
Dan Gohman
9769cee9f7 Fix a typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48317 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-13 01:58:48 +00:00
Dan Gohman
5fe6e33ef8 Don't redundantly clear std::vector members in destructors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48316 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-13 01:57:34 +00:00
Dan Gohman
0961ec1afe Change PMTopLevelManager's PassManagers vector element type from
Pass* to PMDataManager*. PMDataManager is more specific than Pass,
so this more accurately describes the objects that are being stored.

This eliminates the need for several dynamic_casts to PMDataManager*.
It does introduce one dynamic_cast though, in dumpPasses(). Give
this one a comment describing why a dynamic_cast is being used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48315 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-13 01:48:32 +00:00
Dan Gohman
c2f12ab5e5 Change PMStack::push to accept a PMDataManager* instead of
a Pass*. PMDataManager* is what it actually holds, so this
makes it clearer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48314 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-13 01:21:31 +00:00
Chris Lattner
58d74910c6 Reimplement the parameter attributes support, phase #1. hilights:
1. There is now a "PAListPtr" class, which is a smart pointer around
   the underlying uniqued parameter attribute list object, and manages
   its refcount.  It is now impossible to mess up the refcount.
2. PAListPtr is now the main interface to the underlying object, and
   the underlying object is now completely opaque.
3. Implementation details like SmallVector and FoldingSet are now no
   longer part of the interface.
4. You can create a PAListPtr with an arbitrary sequence of
   ParamAttrsWithIndex's, no need to make a SmallVector of a specific 
   size (you can just use an array or scalar or vector if you wish).
5. All the client code that had to check for a null pointer before
   dereferencing the pointer is simplified to just access the 
   PAListPtr directly.
6. The interfaces for adding attrs to a list and removing them is a
   bit simpler.

Phase #2 will rename some stuff (e.g. PAListPtr) and do other less 
invasive changes.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48289 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-12 17:45:29 +00:00
Anton Korobeynikov
e846dd89c1 Add helper for ultimate aliasee resoltion
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48255 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-11 22:28:56 +00:00
Dan Gohman
580b89992f Give PassManager and FunctionPassManager a common base class, with
add(Pass *) as a pure virtual member function. This will allow all
the various addPassesTo* functions in LLVM to avoid hard-coding what
type of PassManager is used. 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48226 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-11 16:41:42 +00:00
Dan Gohman
b4b28231f7 Fix typos in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48225 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-11 16:18:48 +00:00
Dan Gohman
ac9dff686f Use utostr instead of a stringstream.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48198 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-10 23:55:07 +00:00
Dan Gohman
450e7c3c54 Initialize ArgTypes directly instead of manually copying in the elements.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48195 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-10 23:41:23 +00:00
Dan Gohman
e1ff8ec36f Remove an unnecessary #include
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48193 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-10 23:37:12 +00:00
Nick Lewycky
9be3c97183 Turn unwind_to into "unwinds to".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48123 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-10 02:20:00 +00:00
Nick Lewycky
c6694228fa Two things. Preserve the unwind_to when splitting a BB.
Add the ability to remove just one instance of a BB from a phi node. This fixes
the compile error in the tree now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48085 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-09 05:04:48 +00:00
Dan Gohman
cdff0d6b04 Remove unused runPass methods.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48044 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-08 01:43:56 +00:00
Devang Patel
45e99e4f29 Check struct return type first.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47922 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-05 00:27:05 +00:00
Devang Patel
6494768ffc Print types for all ret operands.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47911 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-04 22:05:14 +00:00
Devang Patel
552ec65ebd Revert SmallVector ctor variants.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47908 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-04 21:54:56 +00:00
Devang Patel
52f8ed8368 Add FunctionType ctor variant that takes SmallVector params.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47895 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-04 18:57:05 +00:00
Devang Patel
41e2397b72 s/isReturnStruct()/hasStructRetAttr()/g
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47857 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-03 21:46:28 +00:00
Devang Patel
d15d5e3bbe If a function uses multive values in ret instruction then it
is returning a struct value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47848 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-03 18:58:16 +00:00
Chris Lattner
8728f1915f Add a new ShuffleVectorInst::getMaskValue method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47813 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-02 05:28:33 +00:00
Nick Lewycky
fc82fabe00 Add an unwind_to field to basic blocks, making them Users instead of Values.
This is the first checkin for PR1269, the new EH infrastructure.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47802 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-02 02:48:09 +00:00
Nick Lewycky
1038222a9b Print the name, not a pointer.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47796 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-01 17:20:55 +00:00
Chris Lattner
ab3b77834c Fix PR2113 by verifying allocations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47792 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-01 09:01:57 +00:00
Dan Gohman
37a9ca5bc5 Use the new convertFromAPInt instead of convertFromZeroExtendedInteger.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47744 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-29 01:42:52 +00:00
Devang Patel
26c22cfbcd Remove dead code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47700 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-27 23:33:51 +00:00
Devang Patel
e6be34a53e Add comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47653 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-27 01:20:54 +00:00
Devang Patel
8e50760dfe Add assert to check return type.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47637 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26 22:55:21 +00:00
Devang Patel
53284d39cd Remove unncessary ReturnInst constructors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47633 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26 22:12:58 +00:00
Devang Patel
f4511cd8fb Use SmallVector while constructing ReturnInst.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47619 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26 19:38:17 +00:00
Devang Patel
fea9830468 Avoid const_casts
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47616 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26 19:15:26 +00:00
Devang Patel
f8989657a7 Remove unnecessary getOperand/setOperand overriders.
Simplify getReturnValue()


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47614 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26 19:08:13 +00:00
Devang Patel
814ebd77b0 Unify to ReturnInst::init() member functions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47611 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26 18:49:29 +00:00
Devang Patel
64d4e61259 Optimize most common case by using single RetVal in ReturnInst.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47607 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26 17:56:20 +00:00
Devang Patel
aaeb60ae40 Pass const vectors by reference.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47577 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-26 00:12:13 +00:00
Devang Patel
377e04b926 print getresult operand and its type directly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47514 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-23 01:04:26 +00:00
Devang Patel
d7313c5608 Use dyn_cast instead of isa + cast.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47511 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-23 00:47:00 +00:00
Devang Patel
57ef4f46c1 To support multiple return values, now ret instruction supports multiple operands instead of one aggregate operand.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47508 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-23 00:35:18 +00:00
Dale Johannesen
22c3979fca Split ParameterAttributes.h, putting the complicated
stuff into ParamAttrsList.h.  Per feedback from
ParamAttrs changes.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47504 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-22 22:17:59 +00:00
Dale Johannesen
08e78b18b8 Pass alignment on ByVal parameters, from FE, all
the way through.  It is now used for codegen.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47484 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-22 17:49:45 +00:00
Devang Patel
452743e5e4 Print getresult instruction properly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47473 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-22 03:10:23 +00:00
Devang Patel
ec25f24dbf Print ret instruction that returns aggregates.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47472 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-22 02:50:49 +00:00
Devang Patel
95cb2ad919 print getresult instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47461 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-21 23:02:20 +00:00
Devang Patel
6c94b70d6e Use isa<> instead of getTypeID() to check StructType.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47460 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-21 22:24:17 +00:00
Devang Patel
db71d63467 Let invoke return aggregate value.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47425 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-21 02:14:01 +00:00
Devang Patel
bb4f8d4045 Let function call return aggregate.
Now, we have very first multiple return value testcase!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47424 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-21 01:54:02 +00:00
Devang Patel
93f9d57bcd What if functions can return aggregate values ?
One small step towards multiple return value support.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47406 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-20 22:36:03 +00:00
Devang Patel
dd4d45337b getresult does not support nested aggregates.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47396 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-20 19:39:41 +00:00
Devang Patel
9fcde0fa13 Verifier should use Assert1 instead of assert.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47394 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-20 19:32:20 +00:00
Devang Patel
474869f2b2 getresult type is the type of indexed aggregate element
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47392 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-20 19:26:55 +00:00
Devang Patel
23755d8755 Specify GetResultInst index as an unsigned.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47390 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-20 19:10:47 +00:00
Devang Patel
85eab709ca Use isValidOperands() to verify GetResultInst.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47387 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-20 18:36:46 +00:00
Anton Korobeynikov
4aefd6b7d4 Fix newly-introduced 4.3 warnings
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47375 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-20 12:07:57 +00:00
Anton Korobeynikov
ae9f3a3b7c Unbreak build with gcc 4.3: provide missed includes and silence most annoying warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47367 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-20 11:08:44 +00:00
Dale Johannesen
6167c3fcda Add Alignment field to ParameterAttributes and
treat more or less rationally in interface
functions, subject to change.  No functional change.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47352 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 23:51:49 +00:00
Devang Patel
40a04216da Add GetResultInst. First step for multiple return value support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47348 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 22:15:16 +00:00
Dale Johannesen
0d51e7ec0d Expand ParameterAttributes to 32 bits (in preparation
for adding alignment info, not there yet).  Clean up
interfaces to reference ParameterAttributes consistently.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47342 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 21:38:47 +00:00
Chris Lattner
46acf85b97 Fix some minor issues folding undef, PR2052
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47314 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 06:22:12 +00:00
Duncan Sands
548448a317 Simplify caller updating using a CallSite, as
requested by Chris.  While there, do the same
for an existing function committed by someone
called "lattner" :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47273 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 17:32:13 +00:00
Owen Anderson
874a892c99 I got the predicate backwards in my last patch. The comment is correct, the code was not.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47264 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 09:22:21 +00:00
Owen Anderson
9eb948b466 Duncan pointed out that we can fast fail here, because the sret parameter of
a function must be the first parameter.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47254 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 04:06:26 +00:00
Owen Anderson
7d54254c9c Add a predicate to Argument to check for the StructRet attribute.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47248 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-17 23:22:28 +00:00
Duncan Sands
b3a94608b3 Some micro-optimizations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47219 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-16 20:53:06 +00:00
Chris Lattner
705da96697 targets that support quotes for mangled names still need to escape newlines
when they occur in the name, just like " is escaped.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47169 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-15 18:54:56 +00:00
Chris Lattner
9071dd3a57 check that terminators only occur at the end of a block. This catches the
common problem of putting two terminators in the same block.  I can't write
a testcase for this because the .ll parser rejects this before the verifier
can, but this can occur when generating IR.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46900 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-09 01:06:01 +00:00
Dan Gohman
b3f5cfc670 Fix a typo in a comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46836 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-07 02:30:40 +00:00
Devang Patel
1cf47cb217 Add comment explaining what is lower level analysis pass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46658 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-02 01:43:30 +00:00
Gordon Henriksen
e62a8a353c Fixing a bug creating floating point constants of type other
than double through the C bindings. Thanks to Tomas Lindquist
Olsen for reporting it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46656 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-02 01:07:50 +00:00
Dan Gohman
97cf759b82 Fix 80-col violations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46510 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-29 12:09:55 +00:00
Dan Gohman
1327f69d98 Add explicit keywords.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46506 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-29 11:36:12 +00:00
Nick Lewycky
4189a538e4 Handle some more combinations of extend and icmp. Fixes PR1940.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46431 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-28 03:48:02 +00:00
Chris Lattner
de6fa5f25f Add hasByValAttr() and hasNoAliasAttr() methods to the Argument class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46314 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-24 17:47:11 +00:00
Duncan Sands
03531a4816 It turns out that in C++ it is legal to declare functions
that return an opaque type by value, as long as you don't
call it or provide a body (you can take the address of it).
So it is wrong to insist that sret parameters not be an
opaque*.  And I guess it is really up to codegen to complain
if someone tries to call such a function.  I'm also removing
the analogous check from byval parameters, since I don't
see why we shouldn't allow them as long as no-one tries to
call the function or give it a body.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46216 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-21 21:37:41 +00:00
Duncan Sands
333e8be5e8 Check that sret is only used on pointers to types
with a size, like byval.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46207 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-21 11:28:49 +00:00
Duncan Sands
53d4afcee9 Be consistent with other attribute methods, and
check the callee also if it is known.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46206 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-21 11:27:55 +00:00
Chris Lattner
163974de47 improve compatibility with mingw, patch by Alain Frisch
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46026 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-15 22:50:50 +00:00
Bill Wendling
585e64e63e Reformatted. It was confusing the other way. No functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46009 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-15 21:16:32 +00:00
Duncan Sands
15ea48c9ce Simplify CallInst::hasByValArgument using a new method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45974 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-14 19:57:00 +00:00
Duncan Sands
b0c9b93bb4 I noticed that the trampoline straightening transformation could
drop attributes on varargs call arguments.  Also, it could generate
invalid IR if the transformed call already had the 'nest' attribute
somewhere (this can never happen for code coming from llvm-gcc,
but it's a theoretical possibility).  Fix both problems.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45973 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-14 19:52:09 +00:00
Evan Cheng
42725e7251 Simplify code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45950 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-14 02:38:45 +00:00
Duncan Sands
421d1c93cc Allow the byval attribute for pointers to any type with
a size, not just structs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45938 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-13 21:19:12 +00:00
Evan Cheng
f4a5498ab4 Add hasByValArgument() to test if a call instruction has byval argument(s).
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45913 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-12 18:57:32 +00:00
Duncan Sands
cfad1b4f78 Be more liberal in what parameter attributes are
allowed on the vararg arguments of a call.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45909 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-12 16:42:01 +00:00
Duncan Sands
623a389f62 Do not allow attributes beyond a function's last
parameter, even if it is a varargs function.  Do
allow attributes on the varargs part of a call,
but not beyond the last argument.  Only allow
selected attributes to be on the varargs part of
a call (currently only 'byval' is allowed).  The
reasoning here is that most attributes, eg inreg,
simply make no sense here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45887 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 22:36:48 +00:00
Evan Cheng
c37ab63df7 Allow parameter attributes on varargs function parameters.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45850 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-11 02:13:09 +00:00
Duncan Sands
6c3470efdc Small cleanup for handling of type/parameter attribute
incompatibility.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45704 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-07 17:16:06 +00:00
Duncan Sands
ad9a9e1559 The transform that tries to turn calls to bitcast functions into
direct calls bails out unless caller and callee have essentially
equivalent parameter attributes.  This is illogical - the callee's
attributes should be of no relevance here.  Rework the logic, which
incidentally fixes a crash when removed arguments have attributes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45658 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-06 18:27:01 +00:00
Duncan Sands
a9d0c9dc58 When transforming a call to a bitcast function into
a direct call with cast parameters and cast return
value (if any), instcombine was prepared to cast any
non-void return value into any other, whether castable
or not.  Add a new predicate for testing whether casting
is valid, and check it both for the return value and
(as a cleanup) for the parameters.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45657 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-06 10:12:28 +00:00
Gordon Henriksen
23d9791ddd Trying that again.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45529 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-03 03:32:33 +00:00
Gordon Henriksen
98232f5859 Fix a compile error on Windows.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45528 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-03 03:21:18 +00:00
Chris Lattner
50cffa0107 Remove the function attr cache for intrinsics. This does not maintain the
refcount on these correctly, and can end up referring to deleted 
attributes.  This fixes PR1881.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45525 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-03 01:20:12 +00:00
Chris Lattner
89e94bd00c Don't create a new ParamAttrsList (which copies the vector) just to
get a profile.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45524 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-03 00:29:27 +00:00
Chris Lattner
fabfde3ff0 move some code out of line, rearrange a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45519 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-03 00:10:22 +00:00
Chris Lattner
50ee9ddc8f Split param attr implementation out from Function.cpp into its
own file.  Don't #include ParameterAttributes.h into any major
public header files: just move methods out of line as appropriate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45517 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-02 23:42:30 +00:00
Chris Lattner
f897b7d305 remove blob of #if'd out code.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45512 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-02 23:10:45 +00:00
Chris Lattner
5dfdc1c809 Fix a build issue on cygwin
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45506 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-02 22:03:27 +00:00
Gordon Henriksen
ab477ccde9 Adding C bindings for SwitchInst::addCase.
Patch by Bryan O'Sullivan!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45481 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-01 05:50:53 +00:00
Gordon Henriksen
dc2c07a7cf Add some doxygen comments to llvm-c/Core.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45450 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-30 17:46:33 +00:00
Chris Lattner
4ee451de36 Remove attribution from file headers, per discussion on llvmdev.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45418 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-29 20:36:04 +00:00
Chris Lattner
fc643c5e88 remove attribution from lib Makefiles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45415 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-29 20:09:26 +00:00
Gordon Henriksen
a353ffa7e5 Adding bindings for target triple and data layout.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45369 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-27 20:13:47 +00:00
Gordon Henriksen
1d2e49cd84 Switch the bindings to use LLVMFoldingBuilder.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45367 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-27 18:25:59 +00:00
Gordon Henriksen
e1433f24cf Noting and enforcing that GC intrinsics are valid only within a
function with GC.

This will catch the error when the inliner inlines a function with
GC into a caller with no GC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45350 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-25 02:31:26 +00:00
Gordon Henriksen
27acd3a999 Adjusting verification of "llvm.gc*" intrinsic prototypes to match
LangRef.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45349 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-25 02:02:10 +00:00
Duncan Sands
d9d70395d9 Get the verifier to check attributes on calls as well
as on functions.  Make it verify invokes and not just
ordinary calls.  As a (desired) side-effect, it is no
longer legal to have call attributes on arguments that
are being passed to the varargs part of a varargs
function (llvm-as drops them on the floor anyway).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45286 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-21 19:19:01 +00:00
Gordon Henriksen
da1435f86e Adding bindings for memory buffers and module providers. Switching
to exceptions rather than variants for error handling in Ocaml.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45226 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-19 22:30:40 +00:00
Duncan Sands
f0c3354d99 When inlining through an 'nounwind' call, mark inlined
calls 'nounwind'.  It is important for correct C++
exception handling that nounwind markings do not get
lost, so this transformation is actually needed for
correctness.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45218 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-19 21:13:37 +00:00
Chris Lattner
e395598c98 remove a dead annotation
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45163 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-18 19:04:24 +00:00
Duncan Sands
2b0e8990ab Rename isNoReturn to doesNotReturn, and isNoUnwind to
doesNotThrow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45160 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-18 09:59:50 +00:00
Christopher Lamb
ef989a275c Don't forget to print address space qualifiers when printing out the type table! Thanks to Gordon Henriksen for pointing this out.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45147 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-18 03:49:35 +00:00
Evan Cheng
a5cecd0a13 Remove int_x86_sse2_movl_dq. It's replaced with a string compare.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45140 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-18 01:04:25 +00:00
Evan Cheng
f9b83fcf95 Bring back int_x86_sse2_movl_dq intrinsic for backward compatibility. Make sure
it's auto-upgraded to a shufflevector instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45131 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-17 22:33:23 +00:00
Duncan Sands
fd7b326bea Make invokes of inline asm legal. Teach codegen
how to lower them (with no attempt made to be
efficient, since they should only occur for
unoptimized code).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45108 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-17 18:08:19 +00:00
Gordon Henriksen
57cebeec7b C and Ocaml bindings for address spaces, for that burgeoning market
for Ocaml-based compilers targeting embedded devices. :)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45096 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-17 16:08:32 +00:00
Christopher Lamb
43ad6b3e0d Change the PointerType api for creating pointer types. The old functionality of PointerType::get() has become PointerType::getUnqual(), which returns a pointer in the generic address space. The new prototype of PointerType::get() requires both a type and an address space.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45082 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-17 01:12:55 +00:00
Christopher Lamb
303dae993a Make it clear in the LangRef that allocation instructions only operated on the generic address space. Implement support in the verifier for ensuring this is true.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45080 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-17 01:00:21 +00:00
Duncan Sands
ece2c04d53 Make instcombine promote inline asm calls to 'nounwind'
calls.  Remove special casing of inline asm from the
inliner.  There is a potential problem: the verifier
rejects invokes of inline asm (not sure why).  If an
asm call is not marked "nounwind" in some .ll, and
instcombine is not run, but the inliner is run, then
an illegal module will be created.  This is bad but
I'm not sure what the best approach is.  I'm tempted
to remove the check in the verifier...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45073 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-16 15:51:49 +00:00
Anders Carlsson
d04764a8ac All MMX shift instructions took a <2 x i32> vector as the shift amount parameter. Change this to be <1 x i64> instead, which matches the assembler instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45027 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-14 06:38:54 +00:00
Duncan Sands
7915cbee4d Revert r44626, which turned off the use of readonly
and readnone for functions with bodies because it
broke llvm-gcc-4.2 bootstrap.  It turns out that,
because of LLVM's array_ref hack, gcc was computing
pure/const attributes wrong (now fixed by turning
off the gcc ipa-pure-const pass).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44937 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-12 16:01:40 +00:00
Gordon Henriksen
1ae6135fa3 Add (very basic) bindings for ModuleProvider.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44899 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-12 01:04:30 +00:00
Christopher Lamb
fe63fb986d Implement address space attribute for LLVM pointer types. Address spaces are
regions of memory that have a target specific relationship, as described in the 
Embedded C Technical Report. 

This also implements the 2007-12-11-AddressSpaces test, 
which demonstrates how address space attributes can be used in LLVM IR.

In addition, this patch changes the bitcode signature for stores (in a backwards 
compatible manner), such that the pointer type, rather than the pointee type, is 
encoded. This permits type information in the pointer (e.g. address space) to be 
preserved for stores.

LangRef updates are forthcoming.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44858 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-11 08:59:05 +00:00