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

2251 Commits

Author SHA1 Message Date
Chris Lattner
e3970f1e95 conservatively say that volatile stores read memory.
llvm-svn: 50872
2008-05-08 21:58:49 +00:00
Chris Lattner
1e4afe8fa7 store can't read from memory.
llvm-svn: 50869
2008-05-08 21:47:43 +00:00
Chris Lattner
3c362081d5 add a new Instruction::mayReadFromMemory predicate, make
Instruction::mayWriteToMemory stronger for invokes.

llvm-svn: 50858
2008-05-08 17:16:51 +00:00
Anton Korobeynikov
ddb93e7a02 Turn StripPointerCast() into a method
llvm-svn: 50836
2008-05-07 22:54:15 +00:00
Anton Korobeynikov
90ee6d6616 Make StripPointerCast a common function (should we mak it method of Value instead?)
llvm-svn: 50775
2008-05-06 22:52:30 +00:00
Dan Gohman
a84b75df17 Remove uses of llvm/System/IncludeFile.h that are no longer needed.
llvm-svn: 50695
2008-05-06 01:32:53 +00:00
Gordon Henriksen
6f33fd36ab Use (void) instead of () in C code.
llvm-svn: 50620
2008-05-04 12:55:34 +00:00
Evan Cheng
c1c2adbfc6 Add separate intrinsics for MMX / SSE shifts with i32 integer operands. This allow us to simplify the horribly complicated matching code.
llvm-svn: 50601
2008-05-03 00:52:09 +00:00
Chris Lattner
757d7d318a fix a bug in my previous patch, a classic =/== bug.
llvm-svn: 50483
2008-04-30 15:27:09 +00:00
Chris Lattner
710d05695f add a method for comparing to see if a value has a specified name.
llvm-svn: 50465
2008-04-30 03:55:40 +00:00
Gordon Henriksen
0b2f0d3007 Expose parameter attributes via C bindings.
Patch by Anders Johnsen!

llvm-svn: 50360
2008-04-28 17:37:06 +00:00
Chris Lattner
bef7aa1d4b Allow asms to return multiple results by value.
llvm-svn: 50328
2008-04-27 23:33:55 +00:00
Nick Lewycky
1f831c0f57 Remove 'unwinds to' support from mainline. This patch undoes r47802 r47989
r48047 r48084 r48085 r48086 r48088 r48096 r48099 r48109 and r48123.

llvm-svn: 50265
2008-04-25 16:53:59 +00:00
Chris Lattner
50069efc7a tighten up verifier checks which missed cases where
return instrs operands didn't match up with function results.

llvm-svn: 50182
2008-04-23 20:33:41 +00:00
Chris Lattner
39e4b2e5d2 Enforce that multiple return values have to have at least one result.
llvm-svn: 50137
2008-04-23 05:36:34 +00:00
Chris Lattner
bc7ea01b8a Verify that the operand of a getresult instruction is a
call/invoke or undef.

llvm-svn: 50129
2008-04-23 04:06:15 +00:00
Chris Lattner
188b560336 more fallout from Nicholas' asmprinter patch.
llvm-svn: 50078
2008-04-22 02:45:44 +00:00
Chris Lattner
7925af6adf don't print dominators every time it is computed with -debug.
llvm-svn: 50032
2008-04-21 06:19:02 +00:00
Chris Lattner
c077c2a4ea another bug introduced in r47802 by nicholas, for no apparent reason.
llvm-svn: 50031
2008-04-21 06:12:55 +00:00
Chris Lattner
26468c09af fix a bug introduced by Nicholas' "unwinds to" stuff: we
lost newlines between blocks.

llvm-svn: 50024
2008-04-21 04:20:33 +00:00
Chris Lattner
368e2b28bf 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.

llvm-svn: 50004
2008-04-20 22:11:30 +00:00
Chris Lattner
75df16a5b0 hopefully resolve PR2240
llvm-svn: 49999
2008-04-20 19:59:12 +00:00
Chris Lattner
2bed045e5e rearrange some code, simplify handling of shifts.
llvm-svn: 49995
2008-04-20 18:24:14 +00:00
Chris Lattner
0cda383725 Use simplified ConstantFP::get method, fix a bug handling frem x, 0 with long doubles.
llvm-svn: 49976
2008-04-20 00:26:06 +00:00
Chris Lattner
8cde1e71f0 Implement PR2206.
llvm-svn: 49967
2008-04-19 22:17:26 +00:00
Chris Lattner
1303e72c66 refactor handling of symbolic constant folding, picking up
a few new cases( see Integer/a1.ll), but not anything that
would happen in practice.

llvm-svn: 49965
2008-04-19 21:58:19 +00:00
Chris Lattner
57bd4076b5 indentation fix.
llvm-svn: 49964
2008-04-19 21:13:00 +00:00
Dale Johannesen
87b88d2a8f Don't read off end of the input array.
llvm-svn: 49799
2008-04-16 17:31:41 +00:00
Owen Anderson
030428b435 Major repairs to the post-dominators implementation. Patch from Florian Brandner!
llvm-svn: 49768
2008-04-16 04:21:16 +00:00
Dan Gohman
6c8b715be0 VAArg may trap.
llvm-svn: 49646
2008-04-14 15:07:08 +00:00
Duncan Sands
c5f548f784 Merge LLVMBuilder and FoldingBuilder, calling
the result IRBuilder.  Patch by Dominic Hamon.

llvm-svn: 49604
2008-04-13 06:22:09 +00:00
Dan Gohman
26c2127be9 Make several symbols static.
llvm-svn: 49496
2008-04-10 21:11:47 +00:00
Chris Lattner
843ee88189 add a simplified accessor for creating an fp constant of a
particular value but variable type.

llvm-svn: 49416
2008-04-09 06:38:30 +00:00
Chris Lattner
9d4d2f566e add a version of ConstantFP::get that doesn't take a redundant Type* value,
start migrating code over to use it.

llvm-svn: 49413
2008-04-09 00:45:01 +00:00
Duncan Sands
f86399a00f Convenience method for setting the nounwind
attribute for a function.

llvm-svn: 49373
2008-04-08 07:23:58 +00:00
Duncan Sands
c68e092c44 Make sure that intrinsics automagically get the
right parameter attributes no matter how they
are obtained.

llvm-svn: 49335
2008-04-07 13:39:11 +00:00
Gabor Greif
c82cfa3755 fix a warning
llvm-svn: 49282
2008-04-06 21:42:13 +00:00
Gabor Greif
6c6b8a57f3 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.

llvm-svn: 49277
2008-04-06 20:25:17 +00:00
Chris Lattner
d141d16ed7 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.

llvm-svn: 49041
2008-04-01 18:04:03 +00:00
Nate Begeman
610aa2511c Don't eliminate bitcast instructions that change the type of a pointer
llvm-svn: 48971
2008-03-31 00:22:16 +00:00
Duncan Sands
39afad0613 Fix comment typo.
llvm-svn: 48967
2008-03-30 19:38:55 +00:00
Nick Lewycky
96038a0528 Update example to new syntax.
llvm-svn: 48910
2008-03-28 06:46:51 +00:00
Dan Gohman
2b96ce84aa Add explicit keywords.
llvm-svn: 48801
2008-03-25 22:06:05 +00:00
Evan Cheng
8cb64d8e8b 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.
llvm-svn: 48792
2008-03-25 20:08:07 +00:00
Bill Wendling
b433b67093 Fix PR2062: Don't build Intrinsics.gen in the source directory. Do it in the
object directory.

llvm-svn: 48766
2008-03-25 09:12:48 +00:00
Dan Gohman
fec60bb357 Shrink the size of AllocationInst by using its SubclassData
field to store the alignment value instead of haing a
separate field.

llvm-svn: 48727
2008-03-24 16:55:58 +00:00
Gordon Henriksen
52f3a08237 Objective Caml bindings for basic block, function, global, and arg iterators.
llvm-svn: 48711
2008-03-23 22:21:29 +00:00
Anton Korobeynikov
5dfc7591ef Fix merge error
llvm-svn: 48687
2008-03-22 08:50:08 +00:00
Anton Korobeynikov
25a0157827 Add testcase for prev. commit. Minor fixes
llvm-svn: 48686
2008-03-22 08:37:05 +00:00
Anton Korobeynikov
197f07a72b Aliasing chains cleanups: update langref, add check into verifier
llvm-svn: 48685
2008-03-22 08:36:14 +00:00
Anton Korobeynikov
06f3b7f4ee Support chained aliases for LLVM IR printing. This fixes PR2145
llvm-svn: 48684
2008-03-22 08:17:17 +00:00
Anton Korobeynikov
6ba56eb5e7 Slightly increase default set size. It's cheap and won't hurt.
llvm-svn: 48682
2008-03-22 07:48:40 +00:00
Dan Gohman
a363ba510c Don't include <map> in Pass.h, which doesn't need it. This requires
adding <map> to many files that actually do need it.

llvm-svn: 48667
2008-03-21 23:51:57 +00:00
Duncan Sands
a53967843f 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.

llvm-svn: 48645
2008-03-21 15:53:17 +00:00
Evan Cheng
4ae9fee64c Undo 48570. Correctly match mmx shift instructions with an immediate operand.
llvm-svn: 48627
2008-03-21 00:40:09 +00:00
Devang Patel
1b64c7d1e5 These passes preserve CFG.
This patch fixes Benchmarks/Trimaran/enc-pc1/enc-pc1 failure reported by Grawp-PIC i386 nightly tester

llvm-svn: 48623
2008-03-20 23:27:18 +00:00
Devang Patel
f15fe34521 Restore isCFGOnly property of various analysis passes.
llvm-svn: 48579
2008-03-20 02:25:21 +00:00
Devang Patel
e4f39224eb Keep track of analysis information inherited from Module pass manager.
llvm-svn: 48576
2008-03-20 01:09:53 +00:00
Evan Cheng
6f729b2820 Add intrinsics to match mmx shift builtin's with immediate operand.
llvm-svn: 48569
2008-03-19 23:38:52 +00:00
Devang Patel
3af681c5fb #if 1 .. #endif markers do not add any value.
llvm-svn: 48560
2008-03-19 22:24:25 +00:00
Devang Patel
5e8cbbea65 PassInfo keep tracks whether a pass is an analysis pass or not.
llvm-svn: 48554
2008-03-19 21:56:59 +00:00
Chris Lattner
1642451cf7 add some convenience methods for creating GEP instructions and
struct types.  Patch by David Chisnall, with some tweaks.

llvm-svn: 48531
2008-03-19 05:06:05 +00:00
Gordon Henriksen
e4b3339de8 C bindings for Module-, Function-, and BasicBlock::iterator.
llvm-svn: 48528
2008-03-19 03:47:18 +00:00
Gordon Henriksen
15006d5da0 C and Objective Caml bindings for the various getParent methods of the IR.
Based on Erick Tryzelaar's patch.

llvm-svn: 48523
2008-03-19 01:11:35 +00:00
Devang Patel
38f181fa8c Do not use virtual function to identify an analysis pass.
llvm-svn: 48520
2008-03-19 00:48:41 +00:00
Devang Patel
811ca3ddba Identify Analysis pass.
Do not run analysis pass again if analysis info is still available.
This fixes PR1441.

llvm-svn: 48476
2008-03-18 00:39:19 +00:00
Gordon Henriksen
caeafc4911 C and Objective Caml bindings for PassManagers.
llvm-svn: 48413
2008-03-16 04:20:44 +00:00
Gordon Henriksen
7ebaba8579 Expose Module::dump via C and Ocaml.
Patch by Erick Tryzelaar.

llvm-svn: 48379
2008-03-14 23:58:56 +00:00
Dan Gohman
37a26f973f Update comments; getPassName no longer uses RTTI.
llvm-svn: 48369
2008-03-14 18:27:04 +00:00
Chris Lattner
a14cdebdd9 move a bunch of trivial methods to be inline.
llvm-svn: 48326
2008-03-13 05:00:21 +00:00
Chris Lattner
d4a9aafc3f Various improvements suggested by Duncan
llvm-svn: 48325
2008-03-13 04:33:03 +00:00
Dan Gohman
e84a9f3740 Eliminate a few unnecessary uses of dynamic_cast.
llvm-svn: 48318
2008-03-13 02:08:36 +00:00
Dan Gohman
548e24d9ae Fix a typo.
llvm-svn: 48317
2008-03-13 01:58:48 +00:00
Dan Gohman
971fdb877c Don't redundantly clear std::vector members in destructors.
llvm-svn: 48316
2008-03-13 01:57:34 +00:00
Dan Gohman
abf6c9aa1d 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.

llvm-svn: 48315
2008-03-13 01:48:32 +00:00
Dan Gohman
70f4b55e3f Change PMStack::push to accept a PMDataManager* instead of
a Pass*. PMDataManager* is what it actually holds, so this
makes it clearer.

llvm-svn: 48314
2008-03-13 01:21:31 +00:00
Chris Lattner
7925cc72c0 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.

llvm-svn: 48289
2008-03-12 17:45:29 +00:00
Anton Korobeynikov
38bc6e43f7 Add helper for ultimate aliasee resoltion
llvm-svn: 48255
2008-03-11 22:28:56 +00:00
Dan Gohman
2b0112a65a 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. 

llvm-svn: 48226
2008-03-11 16:41:42 +00:00
Dan Gohman
54b152cbbf Fix typos in comments.
llvm-svn: 48225
2008-03-11 16:18:48 +00:00
Dan Gohman
13e8dd3b34 Use utostr instead of a stringstream.
llvm-svn: 48198
2008-03-10 23:55:07 +00:00
Dan Gohman
0b00b3b786 Initialize ArgTypes directly instead of manually copying in the elements.
llvm-svn: 48195
2008-03-10 23:41:23 +00:00
Dan Gohman
70ab77e185 Remove an unnecessary #include
llvm-svn: 48193
2008-03-10 23:37:12 +00:00
Nick Lewycky
5dd879d5b5 Turn unwind_to into "unwinds to".
llvm-svn: 48123
2008-03-10 02:20:00 +00:00
Nick Lewycky
c64eb33c52 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.

llvm-svn: 48085
2008-03-09 05:04:48 +00:00
Dan Gohman
8ff072e188 Remove unused runPass methods.
llvm-svn: 48044
2008-03-08 01:43:56 +00:00
Devang Patel
a97b000dcc Check struct return type first.
llvm-svn: 47922
2008-03-05 00:27:05 +00:00
Devang Patel
a33f4b4cc7 Print types for all ret operands.
llvm-svn: 47911
2008-03-04 22:05:14 +00:00
Devang Patel
26d0fac377 Revert SmallVector ctor variants.
llvm-svn: 47908
2008-03-04 21:54:56 +00:00
Devang Patel
27426dedc0 Add FunctionType ctor variant that takes SmallVector params.
llvm-svn: 47895
2008-03-04 18:57:05 +00:00
Devang Patel
d0d7028a2b s/isReturnStruct()/hasStructRetAttr()/g
llvm-svn: 47857
2008-03-03 21:46:28 +00:00
Devang Patel
f5e729f70b If a function uses multive values in ret instruction then it
is returning a struct value.

llvm-svn: 47848
2008-03-03 18:58:16 +00:00
Chris Lattner
ffde7a642a Add a new ShuffleVectorInst::getMaskValue method.
llvm-svn: 47813
2008-03-02 05:28:33 +00:00
Nick Lewycky
b02fe64d8b 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.

llvm-svn: 47802
2008-03-02 02:48:09 +00:00
Nick Lewycky
c0b361a17c Print the name, not a pointer.
llvm-svn: 47796
2008-03-01 17:20:55 +00:00
Chris Lattner
64e101b2d9 Fix PR2113 by verifying allocations.
llvm-svn: 47792
2008-03-01 09:01:57 +00:00
Dan Gohman
3491cd8454 Use the new convertFromAPInt instead of convertFromZeroExtendedInteger.
llvm-svn: 47744
2008-02-29 01:42:52 +00:00
Devang Patel
351830e819 Remove dead code.
llvm-svn: 47700
2008-02-27 23:33:51 +00:00
Devang Patel
c68e26f9fe Add comment.
llvm-svn: 47653
2008-02-27 01:20:54 +00:00
Devang Patel
98774b4b6a Add assert to check return type.
llvm-svn: 47637
2008-02-26 22:55:21 +00:00