summaryrefslogtreecommitdiff
path: root/include/llvm/Support/IRBuilder.h
Commit message (Collapse)AuthorAge
* Move llvm/Support/IRBuilder.h -> llvm/IRBuilder.hChandler Carruth2012-06-29
| | | | | | | | | | | | | | | | | This was always part of the VMCore library out of necessity -- it deals entirely in the IR. The .cpp file in fact was already part of the VMCore library. This is just a mechanical move. I've tried to go through and re-apply the coding standard's preferred header sort, but at 40-ish files, I may have gotten some wrong. Please let me know if so. I'll be committing the corresponding updates to Clang and Polly, and Duncan has DragonEgg. Thanks to Bill and Eric for giving the green light for this bit of cleanup. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159421 91177308-0d34-0410-b5e6-96231b3b80d8
* Make it possible to indicate relaxed floating point requirements at the IR levelDuncan Sands2012-04-16
| | | | | | | | | | through the use of 'fpmath' metadata. Currently this only provides a 'fpaccuracy' value, which may be a number in ULPs or the keyword 'fast', however the intent is that this will be extended with additional information about NaN's, infinities etc later. No optimizations have been hooked up to this so far. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154822 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial commit of the 'landingpad' instruction.Bill Wendling2011-08-12
| | | | | | | | | | | | | This implements the 'landingpad' instruction. It's used to indicate that a basic block is a landing pad. There are several restrictions on its use (see LangRef.html for more detail). These restrictions allow the exception handling code to gather the information it needs in a much more sane way. This patch has the definition, implementation, C interface, parsing, and bitcode support in it. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137501 91177308-0d34-0410-b5e6-96231b3b80d8
* Preserve the name for this variant of IRBuilder::CreateCallPeter Collingbourne2011-08-10
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137192 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove CreateUnwind from the IRBuillder.Bill Wendling2011-08-03
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136811 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a couple silly typos in IRBuilder in the new atomic instructions.Eli Friedman2011-08-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136665 91177308-0d34-0410-b5e6-96231b3b80d8
* Add the 'resume' instruction for the new EH rewrite.Bill Wendling2011-07-31
| | | | | | | | | | This adds the 'resume' instruction class, IR parsing, and bitcode reading and writing. The 'resume' instruction resumes propagation of an existing (in-flight) exception whose unwinding was interrupted with a 'landingpad' instruction (to be added later). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136589 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r136253, r136263, r136269, r136313, r136325, r136326, r136329, r136338,Bill Wendling2011-07-30
| | | | | | | | | r136339, r136341, r136369, r136387, r136392, r136396, r136429, r136430, r136444, r136445, r136446, r136253 pending review. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136556 91177308-0d34-0410-b5e6-96231b3b80d8
* Misc optimizer+codegen work for 'cmpxchg' and 'atomicrmw'. They appear to beEli Friedman2011-07-29
| | | | | | | | | | | working on x86 (at least for trivial testcases); other architectures will need more work so that they actually emit the appropriate instructions for orderings stricter than 'monotonic'. (As far as I can tell, the ARM, PPC, Mips, and Alpha backends need such changes.) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136457 91177308-0d34-0410-b5e6-96231b3b80d8
* The personality function should be a Function* and not just a Value*.Bill Wendling2011-07-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136392 91177308-0d34-0410-b5e6-96231b3b80d8
* Merge the contents from exception-handling-rewrite to the mainline.Bill Wendling2011-07-27
| | | | | | | This adds the new instructions 'landingpad' and 'resume'. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136253 91177308-0d34-0410-b5e6-96231b3b80d8
* Initial implementation of 'fence' instruction, the new C++0x-style ↵Eli Friedman2011-07-25
| | | | | | | | | | replacement for llvm.memory.barrier. This is just a LangRef entry and reading/writing/memory representation; optimizer+codegen support coming soon. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136009 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert GetElementPtrInst to use ArrayRef.Jay Foad2011-07-25
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135904 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert IRBuilder::CreateGEP and IRBuilder::CreateInBoundsGEP to useJay Foad2011-07-22
| | | | | | | ArrayRef. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135761 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert ConstantFolder APIs to use ArrayRef.Jay Foad2011-07-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135671 91177308-0d34-0410-b5e6-96231b3b80d8
* land David Blaikie's patch to de-constify Type, with a few tweaks.Chris Lattner2011-07-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135375 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert CallInst and InvokeInst APIs to use ArrayRef.Jay Foad2011-07-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135265 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert InsertValueInst and ExtractValueInst APIs to use ArrayRef.Jay Foad2011-07-13
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135040 91177308-0d34-0410-b5e6-96231b3b80d8
* make the IRBuilder type methods return non-const types.Chris Lattner2011-07-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134959 91177308-0d34-0410-b5e6-96231b3b80d8
* Speculatively revert r134431.Devang Patel2011-07-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134440 91177308-0d34-0410-b5e6-96231b3b80d8
* Clear debug loc while updating insert point.Devang Patel2011-07-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134431 91177308-0d34-0410-b5e6-96231b3b80d8
* Added IRBuilder::SetInsertPoint(Use) to find a valid insertion pointAndrew Trick2011-06-29
| | | | | | | that dominates the given Use. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134111 91177308-0d34-0410-b5e6-96231b3b80d8
* whitespaceAndrew Trick2011-06-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134110 91177308-0d34-0410-b5e6-96231b3b80d8
* Add CreateLifetimeStart and CreateLifetimeEnd to the IRBuilder, with plans toNick Lewycky2011-05-21
| | | | | | | use these soon. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131812 91177308-0d34-0410-b5e6-96231b3b80d8
* Set debug location while setting insertion point.Devang Patel2011-05-18
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131575 91177308-0d34-0410-b5e6-96231b3b80d8
* If builder is initialized using an instruction as insertion point, then use ↵Devang Patel2011-05-04
| | | | | | the instruction's debug location as current debug location. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130874 91177308-0d34-0410-b5e6-96231b3b80d8
* add a helper method.Chris Lattner2011-04-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129806 91177308-0d34-0410-b5e6-96231b3b80d8
* Make IRBuilder support StringRef for building strings.Nick Lewycky2011-04-12
| | | | | | | Also document that the global variables produced are mergable. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129330 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for ArrayRef in IRBuilder's CreateCall.Nick Lewycky2011-04-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129039 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the LLVMContext& arguments from *Folder constructors, as they don't ↵Frits van Bommel2011-04-03
| | | | | | seem to be used anywhere. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128793 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove PHINode::reserveOperandSpace(). Instead, add a parameter toJay Foad2011-03-30
| | | | | | PHINode::Create() giving the (known or expected) number of operands. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128537 91177308-0d34-0410-b5e6-96231b3b80d8
* switch the constantexpr, target folder, and IRBuilder interfacesChris Lattner2011-02-10
| | | | | | | | for NSW/NUW binops to follow the pattern of exact binops. This allows someone to use Builder.CreateAdd(x, y, "tmp", MaybeNUW); git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125270 91177308-0d34-0410-b5e6-96231b3b80d8
* Rework InstrTypes.h so to reduce the repetition around the NSW/NUW/ExactChris Lattner2011-02-09
| | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125194 91177308-0d34-0410-b5e6-96231b3b80d8
* Add IRBuilder methods for creating an exact udiv, like for exact sdiv.Duncan Sands2011-02-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125002 91177308-0d34-0410-b5e6-96231b3b80d8
* add methods to IRBuilder to create memcpy/memset/memmove.Chris Lattner2010-12-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122571 91177308-0d34-0410-b5e6-96231b3b80d8
* add a version of IRBuilder::SetInsertPoint that takes an instruction.Chris Lattner2010-12-19
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122180 91177308-0d34-0410-b5e6-96231b3b80d8
* patch from Frits van Bommel:Chris Lattner2010-11-18
| | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119614 91177308-0d34-0410-b5e6-96231b3b80d8
* It is confusing to call a random-access iterator 'InputIterator'.Mikhail Glushenkov2010-10-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117441 91177308-0d34-0410-b5e6-96231b3b80d8
* Trailing whitespace.Mikhail Glushenkov2010-10-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117440 91177308-0d34-0410-b5e6-96231b3b80d8
* remove some unneeded overloads that were causing Chris Lattner2010-07-15
| | | | | | | ambiguity problems on some systems. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108462 91177308-0d34-0410-b5e6-96231b3b80d8
* Provide IRBuilder conveniences for creating integer constants at common widths,John McCall2010-07-06
| | | | | | | | and give a more precise return type for some of the type-creation methods. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107683 91177308-0d34-0410-b5e6-96231b3b80d8
* Provide an abstraction to save and restore the current insertion point ofJohn McCall2010-07-06
| | | | | | | | an IRBuilder. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107677 91177308-0d34-0410-b5e6-96231b3b80d8
* fit in 80 colsChris Lattner2010-06-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106968 91177308-0d34-0410-b5e6-96231b3b80d8
* IRBuilder: Add Create{Shl,LShr,And,Or,Xor} methods from uin64_t and APInt ↵Daniel Dunbar2010-04-13
| | | | | | constants. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101110 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply address space patch after fixing an issue in MemCopyOptimizer.Mon P Wang2010-04-04
| | | | | | | | 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) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100304 91177308-0d34-0410-b5e6-96231b3b80d8
* rename NewDebugLoc -> DebugLoc, prune #includes in DebugLoc.h.Chris Lattner2010-04-02
| | | | | | | | | This keeps around temporary typedef for clang/llvm-gcc so the build won't break when I commit this :) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100218 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r100191 since it breaks objc in clang Mon P Wang2010-04-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100199 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply address space patch after fixing an issue in MemCopyOptimizer.Mon P Wang2010-04-02
| | | | | | | | 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) git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100191 91177308-0d34-0410-b5e6-96231b3b80d8
* switch IRBuilder to use NewDebugLoc for locations insteadChris Lattner2010-04-01
| | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100095 91177308-0d34-0410-b5e6-96231b3b80d8
* Correct comment.Duncan Sands2010-03-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99991 91177308-0d34-0410-b5e6-96231b3b80d8