summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Instructions.cpp
Commit message (Collapse)AuthorAgeFilesLines
* reformulate CallSite::getCallee to adapt to CallInst::ArgOffset, and make it ↵Gabor Greif2010-07-011-1/+3
| | | | | | work even if CallInst::op_* are private llvm-svn: 107390
* encode operand initializations (at fixed index)Gabor Greif2010-06-291-12/+8
| | | | | | | | | in terms of Op<> and ArgOffset. This works for values of {0, 1} for ArgOffset. Please note that ArgOffset will become 0 soon and will go away eventually. llvm-svn: 107129
* Use A.append(...) instead of A.insert(A.end(), ...) when A is aDan Gohman2010-06-211-2/+2
| | | | | | SmallVector, and other SmallVector simplifications. llvm-svn: 106452
* Split the logic behind CastInst::isNoopCast into a separate static function,Dan Gohman2010-05-281-5/+13
| | | | | | as is done with most other cast opcode predicates. llvm-svn: 105008
* Eliminate the restriction that the array size in an alloca must be i32.Dan Gohman2010-05-281-2/+2
| | | | | | This will help reduce the amount of casting required on 64-bit targets. llvm-svn: 104911
* Remove the API compatibility layer which converted add, sub, and mulDan Gohman2010-05-031-18/+4
| | | | | | | | to fadd, fsub, and fmul, when used with a floating-point type. LLVM has supported the new instructions since 2.6, so it's time to get on board. llvm-svn: 102971
* Revert 101465, it broke internal OpenGL testing.Eric Christopher2010-04-161-11/+13
| | | | | | | Probably the best way to know that all getOperand() calls have been handled is to replace that API instead of updating. llvm-svn: 101579
* reapply r101434Gabor Greif2010-04-161-13/+11
| | | | | | | | | | | | | 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 llvm-svn: 101465
* back out r101423 and r101397, they break llvm-gcc self-host on darwin10Gabor Greif2010-04-161-11/+13
| | | | llvm-svn: 101434
* reapply r101364, which has been backed out in r101368Gabor Greif2010-04-151-13/+11
| | | | | | | | | | | | | 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 llvm-svn: 101397
* back out r101364, as it trips the linux nightlybot on some clang C++ testsGabor Greif2010-04-151-11/+13
| | | | llvm-svn: 101368
* rotate CallInst operands, i.e. move callee to the backGabor Greif2010-04-151-13/+11
| | | | | | | | | | 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 llvm-svn: 101364
* Move a bunch of methods from CallSite to CallSiteBase, so that they canDan Gohman2010-04-141-77/+0
| | | | | | be used in ImmutableCallSite too. llvm-svn: 101292
* Say bitcast instead of bitconvert.Dan Gohman2010-04-071-1/+1
| | | | llvm-svn: 100720
* Introduce ImmutableCallSite, useful for contexts where no mutationGabor Greif2010-04-011-5/+0
| | | | | | | | | is necessary. Inherits from new templated baseclass CallSiteBase<> which is highly customizable. Base CallSite on it too, in a configuration that allows full mutation. Adapt some call sites in analyses to employ ImmutableCallSite. llvm-svn: 100100
* Reapply r99451 with a fix to move the NoInline check to the cost functionsEric Christopher2010-03-251-2/+13
| | | | | | instead of InlineFunction. llvm-svn: 99483
* Temporarily revert this, it's causing an issue with an internal project.Eric Christopher2010-03-241-13/+2
| | | | llvm-svn: 99451
* Finally land the InvokeInst operand reordering.Gabor Greif2010-03-241-5/+12
| | | | | | | | | | | | 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. llvm-svn: 99399
* add some accessors to callsite/callinst/invokeinst to checkChris Lattner2010-03-231-2/+13
| | | | | | | | 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. llvm-svn: 99341
* word-oGabor Greif2010-03-231-1/+1
| | | | llvm-svn: 99275
* backing out r99170 because it still fails on clang-x86_64-darwin10-fntGabor Greif2010-03-221-12/+5
| | | | llvm-svn: 99171
* Now that hopefully all direct accesses to InvokeInst operands are fixedGabor Greif2010-03-221-5/+12
| | | | | | we can reapply the InvokeInst operand reordering patch. (see r98957). llvm-svn: 99170
* back out r98957, it broke ↵Gabor Greif2010-03-191-12/+5
| | | | | | http://smooshlab.apple.com:8010/builders/clang-x86_64-darwin10-fnt/builds/703 in the nightly test suite llvm-svn: 98958
* Recommit r80858 again (which has been backed out in r80871).Gabor Greif2010-03-191-5/+12
| | | | | | | | | | | 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). llvm-svn: 98957
* There are two ways of checking for a given type, for example isa<PointerType>(T)Duncan Sands2010-02-161-31/+31
| | | | | | | and T->isPointerTy(). Convert most instances of the first form to the second form. Requested by Chris. llvm-svn: 96344
* Uniformize the names of type predicates: rather than having isFloatTy andDuncan Sands2010-02-151-63/+64
| | | | | | isInteger, we now have isFloatTy and isIntegerTy. Requested by Chris! llvm-svn: 96223
* Adding missing methods for creating Add, Mul, Neg and Sub with NUW.Duncan Sands2010-02-021-0/+12
| | | | llvm-svn: 95086
* fix CastInst::castIsValid to reject aggregate types, fixing PR6153:Chris Lattner2010-01-261-1/+2
| | | | | | | | llvm-as: t.ll:1:25: error: invalid cast opcode for cast from '[4 x i8]' to '[1 x i32]' @x = constant [1 x i32] bitcast ([4 x i8] c"abcd" to [1 x i32]) ^ llvm-svn: 94595
* Fix ICmpInst::makeConstantRange to use ConstantRange's API properlyDan Gohman2010-01-261-2/+30
| | | | | | in the case of empty and full ranges. llvm-svn: 94548
* simplify code a bit.Chris Lattner2010-01-231-5/+5
| | | | llvm-svn: 94281
* InstCombine should not fold sext/zext of a vector and a bitcast to a scalar ↵Mon P Wang2010-01-231-2/+3
| | | | | | to a sext/zext llvm-svn: 94280
* add an out-of-line virtual method to CmpInst to give it a home.Chris Lattner2010-01-221-0/+2
| | | | llvm-svn: 94161
* fix a buggy assertion, CreateIntegerCast should allow Chris Lattner2010-01-101-1/+2
| | | | | | integer vectors as well as just integers. llvm-svn: 93126
* Move remaining stuff to the isInteger predicate.Benjamin Kramer2010-01-051-4/+3
| | | | llvm-svn: 92771
* Convert a ton of simple integer type equality tests to the new predicate.Benjamin Kramer2010-01-051-2/+2
| | | | llvm-svn: 92760
* Avoid going through the LLVMContext for type equality where it's safe to ↵Benjamin Kramer2010-01-051-8/+7
| | | | | | dereference the type pointer. llvm-svn: 92726
* sink the Instruction::HasMetadata bit into SubclassData.Chris Lattner2009-12-291-5/+5
| | | | llvm-svn: 92240
* add a layer of accessors around the Value::SubClassData member, and use Chris Lattner2009-12-291-7/+11
| | | | | | | | | | | 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. llvm-svn: 92239
* Add utility routines for creating integer negation operators with NSW set.Dan Gohman2009-12-181-0/+12
| | | | | | Integer negation only overflows with INT_MIN, but that's an important case. llvm-svn: 91662
* make this handle redefinition of malloc function with different prototype ↵Victor Hernandez2009-11-101-7/+9
| | | | | | correctly llvm-svn: 86712
* make this handle redefinition of malloc with different prototype correctly.Chris Lattner2009-11-091-3/+3
| | | | llvm-svn: 86525
* prune #include / layering violationChris Lattner2009-11-071-2/+0
| | | | llvm-svn: 86365
* Fit in 80 columnsVictor Hernandez2009-11-071-2/+4
| | | | llvm-svn: 86316
* Re-commit r86077 now that r86290 fixes the 179.art and 175.vpr ARM regressions.Victor Hernandez2009-11-071-25/+20
| | | | | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 86311
* CallInst::CreateMalloc() and CallInst::CreateFree() need to create calls ↵Victor Hernandez2009-11-061-2/+4
| | | | | | with correct calling convention llvm-svn: 86290
* Revert r86077 because it caused crashes in 179.art and 175.vpr on ARMVictor Hernandez2009-11-061-20/+25
| | | | llvm-svn: 86213
* Update CreateMalloc so that its callers specify the size to allocate:Victor Hernandez2009-11-051-25/+20
| | | | | | | | | | | | | | | | | | 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. llvm-svn: 86077
* add sanity check for indbr.Chris Lattner2009-10-291-1/+2
| | | | llvm-svn: 85496
* rename indbr -> indirectbr to appease the residents of #llvm.Chris Lattner2009-10-281-18/+19
| | | | llvm-svn: 85351
* Factor out redundancy from clone() implementations.Devang Patel2009-10-271-289/+84
| | | | llvm-svn: 85327
OpenPOWER on IntegriCloud