1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 03:23:01 +02:00
Commit Graph

136 Commits

Author SHA1 Message Date
Jay Foad
483a783217 Convert ConstantFolder APIs to use ArrayRef.
llvm-svn: 135671
2011-07-21 07:52:17 +00:00
Chris Lattner
e1fe7061ce land David Blaikie's patch to de-constify Type, with a few tweaks.
llvm-svn: 135375
2011-07-18 04:54:35 +00:00
Jay Foad
c826df8fb7 Convert CallInst and InvokeInst APIs to use ArrayRef.
llvm-svn: 135265
2011-07-15 08:37:34 +00:00
Jay Foad
88fb4f4597 Convert InsertValueInst and ExtractValueInst APIs to use ArrayRef.
llvm-svn: 135040
2011-07-13 10:26:04 +00:00
Chris Lattner
62f6b6dde1 make the IRBuilder type methods return non-const types.
llvm-svn: 134959
2011-07-12 04:14:22 +00:00
Devang Patel
5f3ea5c3cb Speculatively revert r134431.
llvm-svn: 134440
2011-07-05 21:16:28 +00:00
Devang Patel
de1261583f Clear debug loc while updating insert point.
llvm-svn: 134431
2011-07-05 18:58:22 +00:00
Andrew Trick
d755da03ed Added IRBuilder::SetInsertPoint(Use) to find a valid insertion point
that dominates the given Use.

llvm-svn: 134111
2011-06-29 23:01:52 +00:00
Andrew Trick
ffcd0f2f4b whitespace
llvm-svn: 134110
2011-06-29 22:52:51 +00:00
Nick Lewycky
0539f44b9f Add CreateLifetimeStart and CreateLifetimeEnd to the IRBuilder, with plans to
use these soon.

llvm-svn: 131812
2011-05-21 23:14:36 +00:00
Devang Patel
f1e313af0f Set debug location while setting insertion point.
llvm-svn: 131575
2011-05-18 20:58:47 +00:00
Devang Patel
7f23f2aba6 If builder is initialized using an instruction as insertion point, then use the instruction's debug location as current debug location.
llvm-svn: 130874
2011-05-04 21:57:22 +00:00
Chris Lattner
649aa9aa1e add a helper method.
llvm-svn: 129806
2011-04-19 20:47:57 +00:00
Nick Lewycky
7ee6960a5f Make IRBuilder support StringRef for building strings.
Also document that the global variables produced are mergable.

llvm-svn: 129330
2011-04-12 00:29:07 +00:00
Nick Lewycky
fccee4ca24 Add support for ArrayRef in IRBuilder's CreateCall.
llvm-svn: 129039
2011-04-07 00:03:25 +00:00
Frits van Bommel
4efc489131 Remove the LLVMContext& arguments from *Folder constructors, as they don't seem to be used anywhere.
llvm-svn: 128793
2011-04-03 19:46:28 +00:00
Jay Foad
53632b7c03 Remove PHINode::reserveOperandSpace(). Instead, add a parameter to
PHINode::Create() giving the (known or expected) number of operands.

llvm-svn: 128537
2011-03-30 11:28:46 +00:00
Chris Lattner
63f1d56458 switch the constantexpr, target folder, and IRBuilder interfaces
for NSW/NUW binops to follow the pattern of exact binops.  This
allows someone to use Builder.CreateAdd(x, y, "tmp", MaybeNUW);

llvm-svn: 125270
2011-02-10 07:01:55 +00:00
Chris Lattner
7468ab4b90 Rework InstrTypes.h so to reduce the repetition around the NSW/NUW/Exact
versions of creation functions.  Eventually, the "insertion point" versions
of these should just be removed, we do have IRBuilder afterall.

Do a massive rewrite of much of pattern match.  It is now shorter and less
redundant and has several other widgets I will be using in other patches.
Among other changes, m_Div is renamed to m_IDiv (since it only matches 
integer divides) and m_Shift is gone (it used to match all binops!!) and
we now have m_LogicalShift for the one client to use.

Enhance IRBuilder to have "isExact" arguments to things like CreateUDiv
and reduce redundancy within IRbuilder by having these methods chain to
each other more instead of duplicating code.

llvm-svn: 125194
2011-02-09 17:00:45 +00:00
Duncan Sands
edd8383ed9 Add IRBuilder methods for creating an exact udiv, like for exact sdiv.
llvm-svn: 125002
2011-02-07 09:21:52 +00:00
Chris Lattner
a46fd80777 add methods to IRBuilder to create memcpy/memset/memmove.
llvm-svn: 122571
2010-12-26 22:49:25 +00:00
Chris Lattner
4ce6f60782 add a version of IRBuilder::SetInsertPoint that takes an instruction.
llvm-svn: 122180
2010-12-19 19:16:22 +00:00
Chris Lattner
de283efb5d patch from Frits van Bommel:
The attached patch fixes IRBuilder and the NoFolder class so that when
NoFolder is used the instructions it generates are treated just like
the ones IRBuilder creates directly (insert into block, assign them a
name and debug info, as applicable).
It does this by
1) having NoFolder return Instruction*s instead of Value*s,
2) having IRBuilder call Insert(Value, Name) on values obtained from
the folder like it does on instructions it creates directly, and
3) adding an Insert(Constant*, const Twine& = "") overload which just
returns the constant so that the other folders shouldn't have any
extra overhead as long as inlining is enabled.

While I was there, I also added some missing (CreateFNeg and various
Create*Cast) methods to NoFolder.

llvm-svn: 119614
2010-11-18 02:15:42 +00:00
Mikhail Glushenkov
64c0814208 It is confusing to call a random-access iterator 'InputIterator'.
llvm-svn: 117441
2010-10-27 07:39:54 +00:00
Mikhail Glushenkov
a52646c12e Trailing whitespace.
llvm-svn: 117440
2010-10-27 07:39:48 +00:00
Chris Lattner
7d39c259b8 remove some unneeded overloads that were causing
ambiguity problems on some systems.

llvm-svn: 108462
2010-07-15 21:24:02 +00:00
John McCall
0e0d4bcfc8 Provide IRBuilder conveniences for creating integer constants at common widths,
and give a more precise return type for some of the type-creation methods.

llvm-svn: 107683
2010-07-06 18:34:49 +00:00
John McCall
2b36dbadb8 Provide an abstraction to save and restore the current insertion point of
an IRBuilder.

llvm-svn: 107677
2010-07-06 18:07:52 +00:00
Chris Lattner
28ed238cc7 fit in 80 cols
llvm-svn: 106968
2010-06-26 23:26:22 +00:00
Daniel Dunbar
dbce77ee48 IRBuilder: Add Create{Shl,LShr,And,Or,Xor} methods from uin64_t and APInt constants.
llvm-svn: 101110
2010-04-13 01:38:57 +00:00
Mon P Wang
484bbe6aa9 Reapply address space patch after fixing an issue in MemCopyOptimizer.
Added support for address spaces and added a isVolatile field to memcpy, memmove, and memset,
e.g., llvm.memcpy.i32(i8*, i8*, i32, i32) -> llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1)

llvm-svn: 100304
2010-04-04 03:10:48 +00:00
Chris Lattner
a686e27bab rename NewDebugLoc -> DebugLoc, prune #includes in DebugLoc.h.
This keeps around temporary typedef for clang/llvm-gcc so the
build won't break when I commit this :)

llvm-svn: 100218
2010-04-02 20:21:22 +00:00
Mon P Wang
0ccf050ca3 Revert r100191 since it breaks objc in clang
llvm-svn: 100199
2010-04-02 18:43:02 +00:00
Mon P Wang
a01350755e Reapply address space patch after fixing an issue in MemCopyOptimizer.
Added support for address spaces and added a isVolatile field to memcpy, memmove, and memset,
e.g., llvm.memcpy.i32(i8*, i8*, i32, i32) -> llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1)

llvm-svn: 100191
2010-04-02 18:04:15 +00:00
Chris Lattner
b27da4e9b4 switch IRBuilder to use NewDebugLoc for locations instead
of raw mdnodes.  This allows frontends to specify debug
locations without ever creating an MDNode for the DILocation.

This requires a corresponding clang/llvm-gcc change which
I'll try to commit as simultaneously as possible.

llvm-svn: 100095
2010-04-01 06:31:45 +00:00
Duncan Sands
f2ded21752 Correct comment.
llvm-svn: 99991
2010-03-31 05:27:33 +00:00
Chris Lattner
c02045830c make irbuilder use the new optimized debug info accessors.
llvm-svn: 99984
2010-03-31 04:09:11 +00:00
Bob Wilson
aae933cc81 Revert Mon Ping's change 99928, since it broke all the llvm-gcc buildbots.
llvm-svn: 99948
2010-03-30 22:27:04 +00:00
Mon P Wang
9351ea594a Added support for address spaces and added a isVolatile field to memcpy, memmove, and memset,
e.g., llvm.memcpy.i32(i8*, i8*, i32, i32) -> llvm.memcpy.p0i8.p0i8.i32(i8*, i8*, i32, i32, i1)
A update of langref will occur in a subsequent checkin.

llvm-svn: 99928
2010-03-30 20:55:56 +00:00
Eric Christopher
1e4aafa273 Add support for an i8* type accessor.
llvm-svn: 97841
2010-03-05 22:21:58 +00:00
Dan Gohman
efb42fa7c7 Fix several comments which had previously been "the the" where a
different word was intended.

llvm-svn: 95795
2010-02-10 20:04:19 +00:00
Dan Gohman
92b6122204 Fix "the the" and similar typos.
llvm-svn: 95781
2010-02-10 16:03:48 +00:00
Duncan Sands
364e9510fb Adding missing methods for creating Add, Mul, Neg and Sub with NUW.
llvm-svn: 95086
2010-02-02 12:53:04 +00:00
Chris Lattner
f1704b24be remove #include that comes in from ConstantFolder.h
llvm-svn: 92232
2009-12-28 21:52:06 +00:00
Chris Lattner
28de6cdbf5 remove #include of Function.h from IRBuilder
llvm-svn: 92231
2009-12-28 21:50:56 +00:00
Chris Lattner
e70c40e8ac move debug info stuff out of line, allowing two #includes
to go away from IRBuilder.h

llvm-svn: 92230
2009-12-28 21:45:40 +00:00
Chris Lattner
e0b9847223 split code that doesn't need to be templated out of IRBuilder into a new
non-templated IRBuilderBase class.  Move that large CreateGlobalString
out of line, eliminating the need to #include GlobalVariable.h in IRBuilder.h

llvm-svn: 92227
2009-12-28 21:28:46 +00:00
Chris Lattner
13e5945d1d rename ivar to be more descriptive.
llvm-svn: 92226
2009-12-28 21:12:29 +00:00
Chris Lattner
cd3aa9d1ff rename getMDKind -> getMDKindID, make it autoinsert if an MD Kind
doesn't exist already, eliminate registerMDKind.  Tidy up a bunch
of random stuff.

llvm-svn: 92225
2009-12-28 20:45:51 +00:00
Dan Gohman
3ceb7c0c47 Add utility routines for NSW multiply.
llvm-svn: 91664
2009-12-18 03:10:26 +00:00