summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Instructions.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Simplify the construction and destruction of Uses. SimplifyJay Foad2011-01-161-8/+7
| | | | | | User::dropHungOffUses(). llvm-svn: 123580
* Remove casts between Value** and Constant**, which won't work if aJay Foad2011-01-141-0/+6
| | | | | | | static_cast from Constant* to Value* has to adjust the "this" pointer. This is groundwork for PR889. llvm-svn: 123435
* Simplify the allocation and freeing of Users' operand lists, now thatJay Foad2011-01-071-27/+1
| | | | | | every BranchInst has a fixed number of operands. llvm-svn: 123027
* These methods should be "const"; make them so.Duncan Sands2011-01-041-4/+4
| | | | llvm-svn: 122809
* Change all self assignments X=X to (void)X, so that we can turn on aJeffrey Yasskin2010-12-231-6/+6
| | | | | | | new gcc warning that complains on self-assignments and self-initializations. llvm-svn: 122458
* Fix PR 4170 by having ExtractValueInst::getIndexedType() reject ↵Frits van Bommel2010-12-051-7/+24
| | | | | | | | out-of-bounds indexing. Also add asserts that the indices are valid in InsertValueInst::init(). ExtractValueInst already asserts when constructed with invalid indices. llvm-svn: 120956
* fix PR8613 - Copy constructor of SwitchInst does not call SwitchInst::initChris Lattner2010-11-171-8/+9
| | | | llvm-svn: 119463
* Fix a layering violation: hasConstantValue, which is part of the PHINodeDuncan Sands2010-11-171-56/+7
| | | | | | | | | | | | | | class, uses DominatorTree which is an analysis. This change moves all of the tricky hasConstantValue logic to SimplifyInstruction, and replaces it with a very simple literal implementation. I already taught users of hasConstantValue that need tricky stuff to use SimplifyInstruction instead. I didn't update InlineFunction because the IR looks like it might be in a funky state at the point it calls hasConstantValue, which makes calling SimplifyInstruction dangerous since it can in theory do a lot of tricky reasoning. This may be a pessimization, for example in the case where all phi node operands are either undef or a fixed constant. llvm-svn: 119459
* If dom tree information is available, make it possible to passDuncan Sands2010-11-141-1/+1
| | | | | | it to get better phi node simplification. llvm-svn: 119055
* Cleanup. Get rid of extraneous variable.Bill Wendling2010-10-031-3/+2
| | | | llvm-svn: 115453
* Attempt to outwit overly smart compiler.Dale Johannesen2010-10-011-0/+1
| | | | llvm-svn: 115251
* Massive rewrite of MMX: Dale Johannesen2010-09-301-0/+14
| | | | | | | | | | | | | | | | | | | The x86_mmx type is used for MMX intrinsics, parameters and return values where these use MMX registers, and is also supported in load, store, and bitcast. Only the above operations generate MMX instructions, and optimizations do not operate on or produce MMX intrinsics. MMX-sized vectors <2 x i32> etc. are lowered to XMM or split into smaller pieces. Optimizations may occur on these forms and the result casted back to x86_mmx, provided the result feeds into a previous existing x86_mmx operation. The point of all this is prevent optimizations from introducing MMX operations, which is unsafe due to the EMMS problem. llvm-svn: 115243
* Make this code 65-bit clean.Dan Gohman2010-09-271-1/+1
| | | | llvm-svn: 114828
* Move some code from Verifier into SVI::isValidOperands. This allows us to ↵Nate Begeman2010-08-131-2/+17
| | | | | | catch bad shufflevector operations when they are created, rather than waiting for someone to notice later on. llvm-svn: 110986
* remove the private hack from CallInst, it was not supposed to hit the branch ↵Gabor Greif2010-08-051-1/+1
| | | | | | | | | anyway as a positive consequence the CallSite::getCallee() methods now can be rewritten to be a bit more efficient llvm-svn: 110380
* Define a maximum supported alignment value for load, store, andDan Gohman2010-07-281-0/+8
| | | | | | | | | 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. llvm-svn: 109643
* eliminate CallInst::ArgOffsetGabor Greif2010-07-161-12/+10
| | | | llvm-svn: 108522
* Convert some tab stops into spaces.Duncan Sands2010-07-121-1/+1
| | | | llvm-svn: 108130
* fix PR7311 by avoiding breaking casts when a bitcast from scalar->vectorChris Lattner2010-07-121-0/+8
| | | | | | is involved. llvm-svn: 108117
* make the prototypes for CreateMalloc and CreateFree more consistent. PatchChris Lattner2010-07-121-3/+4
| | | | | | by Hans Vandierendonck from PR7605 llvm-svn: 108116
* 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
OpenPOWER on IntegriCloud