Commit Graph

2462 Commits

Author SHA1 Message Date
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