summaryrefslogtreecommitdiff
path: root/include/llvm/Instructions.h
Commit message (Collapse)AuthorAge
* Add a predicate to determine if a call is an inline asm statement.Owen Anderson2010-08-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110488 91177308-0d34-0410-b5e6-96231b3b80d8
* remove the private hack from CallInst, it was not supposed to hit the branch ↵Gabor Greif2010-08-05
| | | | | | | | | anyway as a positive consequence the CallSite::getCallee() methods now can be rewritten to be a bit more efficient git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110380 91177308-0d34-0410-b5e6-96231b3b80d8
* doxygenize argument accessorsGabor Greif2010-07-31
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109950 91177308-0d34-0410-b5e6-96231b3b80d8
* Move MaximumAlignment to Value.h, now that GlobalValue.h needs it.Dan Gohman2010-07-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109656 91177308-0d34-0410-b5e6-96231b3b80d8
* Define a maximum supported alignment value for load, store, andDan Gohman2010-07-28
| | | | | | | | | | alloca instructions (constrained by their internal encoding), and add error checking for it. Fix an instcombine bug which generated huge alignment values (null is infinitely aligned). This fixes undefined behavior noticed by John Regehr. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109643 91177308-0d34-0410-b5e6-96231b3b80d8
* restore aestheticsGabor Greif2010-07-21
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109001 91177308-0d34-0410-b5e6-96231b3b80d8
* eliminate CallInst::ArgOffsetGabor Greif2010-07-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108522 91177308-0d34-0410-b5e6-96231b3b80d8
* rotate CallInst operandsGabor Greif2010-07-13
| | | | | | | | | | | | | | | | | | | with this commit the callee moves to the end of the operand array (from the start) and the call arguments now start at index 0 (formerly 1) this ordering is now consistent with InvokeInst this commit only flips the switch, functionally it is equivalent to r101465 I intend to commit several cleanups after a few days of soak period git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108240 91177308-0d34-0410-b5e6-96231b3b80d8
* make the prototypes for CreateMalloc and CreateFree more consistent. PatchChris Lattner2010-07-12
| | | | | | | by Hans Vandierendonck from PR7605 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108116 91177308-0d34-0410-b5e6-96231b3b80d8
* minor cosmetic changes that happened to sit in my treeGabor Greif2010-07-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107764 91177308-0d34-0410-b5e6-96231b3b80d8
* second round of low-level interface squeeze-out:Gabor Greif2010-07-06
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | making all of CallInst's low-level operand accessors private If you get compile errors I strongly urge you to update your code. I tried to write the necessary clues into the header where the compiler may point to, but no guarantees. It works for my GCC. You have several options to update your code: - you can use the v2.8 ArgOperand accessors - you can go via a temporary CallSite - you can upcast to, say, User and call its low-level accessors if your code is definitely operand-order agnostic. If you run into serious problems, please comment in below thread (and back out this revision only if absolutely necessary): <http://groups.google.com/group/llvm-dev/browse_thread/thread/64650cf343b28271> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107667 91177308-0d34-0410-b5e6-96231b3b80d8
* Add default value to setIsNoInline for parity with the other methods of itsNick Lewycky2010-07-06
| | | | | | | | | kind. Also fold some functions that fit on a line to a single line. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107636 91177308-0d34-0410-b5e6-96231b3b80d8
* back out r107580, I have seen what I wantedGabor Greif2010-07-04
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107582 91177308-0d34-0410-b5e6-96231b3b80d8
* [another test commit, just to tickle the selfhost buildbots; I'll back out ↵Gabor Greif2010-07-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | in a few minutes] second round of low-level interface squeeze-out: making all of CallInst's low-level operand accessors private If you get compile errors I strongly urge you to update your code. I tried to write the necessary clues into the header where the compiler may point to, but no guarantees. It works for my GCC. You have several options to update your code: - you can use the v2.8 ArgOperand accessors - you can go via a temporary CallSite - you can upcast to, say, User and call its low-level accessors if your code is definitely operand-order agnostic. If you run into serious problems, please comment in below thread (and back out this revision only if absolutely necessary): <http://groups.google.com/group/llvm-dev/browse_thread/thread/64650cf343b28271> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107580 91177308-0d34-0410-b5e6-96231b3b80d8
* back out r107480, it was just testing the waters anyway...Gabor Greif2010-07-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107481 91177308-0d34-0410-b5e6-96231b3b80d8
* [test commit, just to tickle the selfhost buildbots; I'll back out in a few ↵Gabor Greif2010-07-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | minutes] second round of low-level interface squeeze-out: making all of CallInst's low-level operand accessors private If you get compile errors I strongly urge you to update your code. I tried to write the necessary clues into the header where the compiler may point to, but no guarantees. It works for my GCC. You have several options to update your code: - you can use the v2.8 ArgOperand accessors - you can go via a temporary CallSite - you can upcast to, say, User and call its low-level accessors if your code is definitely operand-order agnostic. If you run into serious problems, please comment in below thread (and back out this revision only if absolutely necessary): <http://groups.google.com/group/llvm-dev/browse_thread/thread/64650cf343b28271> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107480 91177308-0d34-0410-b5e6-96231b3b80d8
* evil hack to coerce external users (projects)Gabor Greif2010-07-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | to update their code to high-level interfaces If you get compile errors in your project please update your code according to the comments. This is a re-commit of r107396 which causes compile errors for the indicated usage patterns instead of link errors (which are less easy to fix because of missing source location). If you get compile errors please perform following functionally equivalent transformations: - getOperand(0) ---> getCalledValue() - setOperand(0, V) ---> setCalledFunction(V) This will make your code more future-proof and avoid potentially hard-to-debug bugs. please refer to this thread on llvm-dev: <http://groups.google.com/group/llvm-dev/browse_thread/thread/64650cf343b28271> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107432 91177308-0d34-0410-b5e6-96231b3b80d8
* back out r107396 for now, it needs another minor change to function as ↵Gabor Greif2010-07-01
| | | | | | advertised git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107399 91177308-0d34-0410-b5e6-96231b3b80d8
* evil hack to coerce external users (projects)Gabor Greif2010-07-01
| | | | | | | | | | to update their code to high-level interfaces If you get compile errors in your project please update your code according to the comments. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107396 91177308-0d34-0410-b5e6-96231b3b80d8
* minor cosmeticsGabor Greif2010-06-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107148 91177308-0d34-0410-b5e6-96231b3b80d8
* use ArgOffset constant to prepare for operand rotationGabor Greif2010-06-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107146 91177308-0d34-0410-b5e6-96231b3b80d8
* extend ArgOperand interface: setArgOperandGabor Greif2010-06-28
| | | | | | | | | | | (in both CallInst and InvokeInst) also add a (short-lived) constant to CallInst, that names the operand index of the first call argument. This is strictly transitional and should not be used for new code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107001 91177308-0d34-0410-b5e6-96231b3b80d8
* add some named accessors for StoreInstChris Lattner2010-06-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106969 91177308-0d34-0410-b5e6-96231b3b80d8
* Create new accessors to get arguments for call/invoke instructions. It breaksBill Wendling2010-06-07
| | | | | | | | | encapsulation to force the users of these classes to know about the internal data structure of the Operands structure. It also can lead to errors, like in the MSIL writer. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105539 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert 101465, it broke internal OpenGL testing.Eric Christopher2010-04-16
| | | | | | | | Probably the best way to know that all getOperand() calls have been handled is to replace that API instead of updating. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101579 91177308-0d34-0410-b5e6-96231b3b80d8
* reapply r101434Gabor Greif2010-04-16
| | | | | | | | | | | | | | with a fix for self-hosting rotate CallInst operands, i.e. move callee to the back of the operand array the motivation for this patch are laid out in my mail to llvm-commits: more efficient access to operands and callee, faster callgraph-construction, smaller compiler binary git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101465 91177308-0d34-0410-b5e6-96231b3b80d8
* back out r101423 and r101397, they break llvm-gcc self-host on darwin10Gabor Greif2010-04-16
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101434 91177308-0d34-0410-b5e6-96231b3b80d8
* reapply r101364, which has been backed out in r101368Gabor Greif2010-04-15
| | | | | | | | | | | | | | with a fix rotate CallInst operands, i.e. move callee to the back of the operand array the motivation for this patch are laid out in my mail to llvm-commits: more efficient access to operands and callee, faster callgraph-construction, smaller compiler binary git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101397 91177308-0d34-0410-b5e6-96231b3b80d8
* back out r101364, as it trips the linux nightlybot on some clang C++ testsGabor Greif2010-04-15
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101368 91177308-0d34-0410-b5e6-96231b3b80d8
* rotate CallInst operands, i.e. move callee to the backGabor Greif2010-04-15
| | | | | | | | | | | of the operand array the motivation for this patch are laid out in my mail to llvm-commits: more efficient access to operands and callee, faster callgraph-construction, smaller compiler binary git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101364 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r99451 with a fix to move the NoInline check to the cost functionsEric Christopher2010-03-25
| | | | | | | instead of InlineFunction. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99483 91177308-0d34-0410-b5e6-96231b3b80d8
* Temporarily revert this, it's causing an issue with an internal project.Eric Christopher2010-03-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99451 91177308-0d34-0410-b5e6-96231b3b80d8
* Finally land the InvokeInst operand reordering.Gabor Greif2010-03-24
| | | | | | | | | | | | | I have audited all getOperandNo calls now, fixing hidden assumptions. CallSite related uglyness will be eliminated successively. Note this patch has a long and griveous history, for all the back-and-forths have a look at CallSite.h's log. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99399 91177308-0d34-0410-b5e6-96231b3b80d8
* add some accessors to callsite/callinst/invokeinst to checkChris Lattner2010-03-23
| | | | | | | | | for the noinline attribute, and make the inliner refuse to inline a call site when the call site is marked noinline even if the callee isn't. This fixes PR6682. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99341 91177308-0d34-0410-b5e6-96231b3b80d8
* backing out r99170 because it still fails on clang-x86_64-darwin10-fntGabor Greif2010-03-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99171 91177308-0d34-0410-b5e6-96231b3b80d8
* Now that hopefully all direct accesses to InvokeInst operands are fixedGabor Greif2010-03-22
| | | | | | | | we can reapply the InvokeInst operand reordering patch. (see r98957). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99170 91177308-0d34-0410-b5e6-96231b3b80d8
* Add a setCalledFunction member to InvokeInst (like in CallInst)Gabor Greif2010-03-20
| | | | | | | | and use this (as well as getCalledValue) to access the callee, instead of {g|s}etOperand(0). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99084 91177308-0d34-0410-b5e6-96231b3b80d8
* back out r98957, it broke ↵Gabor Greif2010-03-19
| | | | | | http://smooshlab.apple.com:8010/builders/clang-x86_64-darwin10-fnt/builds/703 in the nightly test suite git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98958 91177308-0d34-0410-b5e6-96231b3b80d8
* Recommit r80858 again (which has been backed out in r80871).Gabor Greif2010-03-19
| | | | | | | | | | | | | This time I did a self-hosted bootstrap on Linux x86-64, with no problems. Let's see how darwin 64-bit self-hosting goes. At the first sign of failure I'll back this out. Maybe the valgrind bots give me a hint of what may be wrong (it at all). git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98957 91177308-0d34-0410-b5e6-96231b3b80d8
* fix PR6589Gabor Greif2010-03-16
| | | | | | | | | | | | | | adjusted unittest I have added some doxygen to OptionalOperandTraits, so hopefully there will be no confusion in the future. Incidentally OptionalOperandTraits is not used any more (IIUC), but the obvious client would be BranchInstr, and I plan to rearrange it that way. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98624 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix various doxygen warnings.Dan Gohman2010-02-22
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96779 91177308-0d34-0410-b5e6-96231b3b80d8
* There are two ways of checking for a given type, for example isa<PointerType>(T)Duncan Sands2010-02-16
| | | | | | | | and T->isPointerTy(). Convert most instances of the first form to the second form. Requested by Chris. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96344 91177308-0d34-0410-b5e6-96231b3b80d8
* Uniformize the names of type predicates: rather than having isFloatTy andDuncan Sands2010-02-15
| | | | | | | isInteger, we now have isFloatTy and isIntegerTy. Requested by Chris! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96223 91177308-0d34-0410-b5e6-96231b3b80d8
* sink the Instruction::HasMetadata bit into SubclassData.Chris Lattner2009-12-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92240 91177308-0d34-0410-b5e6-96231b3b80d8
* add a layer of accessors around the Value::SubClassData member, and use Chris Lattner2009-12-29
| | | | | | | | | | | | | a convention (shadowing the setter with private forwarding function) to prevent subclasses from accidentally using it. This exposed some bogosity in ConstantExprs, which was propaging the opcode of the constant expr into the NUW/NSW/Exact field in the getWithOperands/getWithOperandReplaced methods. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92239 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-commit r86077 now that r86290 fixes the 179.art and 175.vpr ARM regressions.Victor Hernandez2009-11-07
| | | | | | | | | | | | | | | | | | | | | | | | | Here is the original commit message: This commit updates malloc optimizations to operate on malloc calls that have constant int size arguments. Update CreateMalloc so that its callers specify the size to allocate: MallocInst-autoupgrade users use non-TargetData-computed allocation sizes. Optimization uses use TargetData to compute the allocation size. Now that malloc calls can have constant sizes, update isArrayMallocHelper() to use TargetData to determine the size of the malloced type and the size of malloced arrays. Extend getMallocType() to support malloc calls that have non-bitcast uses. Update OptimizeGlobalAddressOfMalloc() to optimize malloc calls that have non-bitcast uses. The bitcast use of a malloc call has to be treated specially here because the uses of the bitcast need to be replaced and the bitcast needs to be erased (just like the malloc call) for OptimizeGlobalAddressOfMalloc() to work correctly. Update PerformHeapAllocSRoA() to optimize malloc calls that have non-bitcast uses. The bitcast use of the malloc is not handled specially here because ReplaceUsesOfMallocWithGlobal replaces through the bitcast use. Update OptimizeOnceStoredGlobal() to not care about the malloc calls' bitcast use. Update all globalopt malloc tests to not rely on autoupgraded-MallocInsts, but instead use explicit malloc calls with correct allocation sizes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86311 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r86077 because it caused crashes in 179.art and 175.vpr on ARMVictor Hernandez2009-11-06
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86213 91177308-0d34-0410-b5e6-96231b3b80d8
* Update CreateMalloc so that its callers specify the size to allocate:Victor Hernandez2009-11-05
| | | | | | | | | | | | | | | | | | | MallocInst-autoupgrade users use non-TargetData-computed allocation sizes. Optimization uses use TargetData to compute the allocation size. Now that malloc calls can have constant sizes, update isArrayMallocHelper() to use TargetData to determine the size of the malloced type and the size of malloced arrays. Extend getMallocType() to support malloc calls that have non-bitcast uses. Update OptimizeGlobalAddressOfMalloc() to optimize malloc calls that have non-bitcast uses. The bitcast use of a malloc call has to be treated specially here because the uses of the bitcast need to be replaced and the bitcast needs to be erased (just like the malloc call) for OptimizeGlobalAddressOfMalloc() to work correctly. Update PerformHeapAllocSRoA() to optimize malloc calls that have non-bitcast uses. The bitcast use of the malloc is not handled specially here because ReplaceUsesOfMallocWithGlobal replaces through the bitcast use. Update OptimizeOnceStoredGlobal() to not care about the malloc calls' bitcast use. Update all globalopt malloc tests to not rely on autoupgraded-MallocInsts, but instead use explicit malloc calls with correct allocation sizes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86077 91177308-0d34-0410-b5e6-96231b3b80d8
* rename indbr -> indirectbr to appease the residents of #llvm.Chris Lattner2009-10-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85351 91177308-0d34-0410-b5e6-96231b3b80d8
* Factor out redundancy from clone() implementations.Devang Patel2009-10-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85327 91177308-0d34-0410-b5e6-96231b3b80d8