summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Instructions.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Use Type::isIntOrIntVector and Type::isFPOrFPVector.Dan Gohman2009-06-151-9/+8
| | | | llvm-svn: 73433
* Support vector casts in more places, fixing a variety of assertionDan Gohman2009-06-151-32/+32
| | | | | | | | | | | | | | | failures. To support this, add some utility functions to Type to help support vector/scalar-independent code. Change ConstantInt::get and ConstantFP::get to support vector types, and add an overload to ConstantInt::get that uses a static IntegerType type, for convenience. Introduce a new getConstant method for ScalarEvolution, to simplify common use cases. llvm-svn: 73431
* Fix old-style type names in comments.Dan Gohman2009-06-141-3/+3
| | | | llvm-svn: 73362
* Split the Add, Sub, and Mul instruction opcodes into separateDan Gohman2009-06-041-8/+62
| | | | | | | | | | | | | | | integer and floating-point opcodes, introducing FAdd, FSub, and FMul. For now, the AsmParser, BitcodeReader, and IRBuilder all preserve backwards compatability, and the Core LLVM APIs preserve backwards compatibility for IR producers. Most front-ends won't need to change immediately. This implements the first step of the plan outlined here: http://nondot.org/sabre/LLVMNotes/IntegerOverflow.txt llvm-svn: 72897
* Revert r72025. It is possible for clients to convert between signed typesDan Gohman2009-05-181-3/+0
| | | | | | | and pointer types safely if they only do so when the sizes are the same. llvm-gcc is such a client. llvm-svn: 72029
* Add assertions to CastInst::getCastOpcode to catch attempted conversionsDan Gohman2009-05-181-0/+3
| | | | | | | | between integers and pointers when the source type is marked signed, since inttoptr and ptrtoint always use zero-extension when the destination is larger than the source. llvm-svn: 72025
* Revert r66920. It was causing failures in the self-hosting buildbot (in releaseBill Wendling2009-03-131-12/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mode). Running /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/dg.exp ... FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/crash-narrowfunctiontest.ll Failed with signal(SIGBUS) at line 1 while running: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/crash-narrowfunctiontest.ll -bugpoint-crashcalls -silence-passes > /dev/null 0 bugpoint 0x0035dd25 llvm::sys::SetInterruptFunction(void (*)()) + 85 1 bugpoint 0x0035e382 llvm::sys::RemoveFileOnSignal(llvm::sys::Path const&, std::string*) + 706 2 libSystem.B.dylib 0x92f112bb _sigtramp + 43 3 libSystem.B.dylib 0xffffffff _sigtramp + 1829694831 4 bugpoint 0x00021d1c main + 92 5 bugpoint 0x00002106 start + 54 6 bugpoint 0x00000004 start + 18446744073709543220 Stack dump: 0. Program arguments: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/crash-narrowfunctiontest.ll -bugpoint-crashcalls -silence-passes FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/misopt-basictest.ll Failed with signal(SIGBUS) at line 1 while running: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/misopt-basictest.ll -dce -bugpoint-deletecalls -simplifycfg -silence-passes 0 bugpoint 0x0035dd25 llvm::sys::SetInterruptFunction(void (*)()) + 85 1 bugpoint 0x0035e382 llvm::sys::RemoveFileOnSignal(llvm::sys::Path const&, std::string*) + 706 2 libSystem.B.dylib 0x92f112bb _sigtramp + 43 3 libSystem.B.dylib 0xffffffff _sigtramp + 1829694831 4 bugpoint 0x00021d1c main + 92 5 bugpoint 0x00002106 start + 54 6 bugpoint 0x00000006 start + 18446744073709543222 Stack dump: 0. Program arguments: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/misopt-basictest.ll -dce -bugpoint-deletecalls -simplifycfg -silence-passes FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/remove_arguments_test.ll Failed with signal(SIGBUS) at line 1 while running: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/remove_arguments_test.ll -bugpoint-crashcalls -silence-passes 0 bugpoint 0x0035dd25 llvm::sys::SetInterruptFunction(void (*)()) + 85 1 bugpoint 0x0035e382 llvm::sys::RemoveFileOnSignal(llvm::sys::Path const&, std::string*) + 706 2 libSystem.B.dylib 0x92f112bb _sigtramp + 43 3 libSystem.B.dylib 0xffffffff _sigtramp + 1829694831 4 bugpoint 0x00021d1c main + 92 5 bugpoint 0x00002106 start + 54 Stack dump: 0. Program arguments: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/remove_arguments_test.ll -bugpoint-crashcalls -silence-passes --- Reverse-merging (from foreign repository) r66920 into '.': U include/llvm/Support/CallSite.h U include/llvm/Instructions.h U lib/Analysis/IPA/GlobalsModRef.cpp U lib/Analysis/IPA/Andersens.cpp U lib/Bitcode/Writer/BitcodeWriter.cpp U lib/VMCore/Instructions.cpp U lib/VMCore/Verifier.cpp U lib/VMCore/AsmWriter.cpp U lib/Transforms/Utils/LowerInvoke.cpp U lib/Transforms/Scalar/SimplifyCFGPass.cpp U lib/Transforms/IPO/PruneEH.cpp U lib/Transforms/IPO/DeadArgumentElimination.cpp llvm-svn: 66953
* Second installment of "BasicBlock operands to the back"Gabor Greif2009-03-131-5/+12
| | | | | | | | | | | | | | | | | | changes. For InvokeInst now all arguments begin at op_begin(). The Callee, Cont and Fail are now faster to get by access relative to op_end(). This patch introduces some temporary uglyness in CallSite. Next I'll bring CallInst up to a similar scheme and then the uglyness will magically vanish. This patch also exposes all the reliance of the libraries on InvokeInst's operand ordering. I am thinking of taking care of that too. llvm-svn: 66920
* Rearrange operands of the BranchInst, to be able toGabor Greif2009-03-121-12/+38
| | | | | | | | | | | | | | | | | | | | | | | | | access each with a fixed negative index from op_end(). This has two important implications: - getUser() will work faster, because there are less iterations for the waymarking algorithm to perform. This is important when running various analyses that want to determine callers of basic blocks. - getSuccessor() now runs faster, because the indirection via OperandList is not necessary: Uses corresponding to the successors are at fixed offset to "this". The price we pay is the slightly more complicated logic in the operator User::delete, as it has to pick up the information whether it has to free the memory of an original unconditional BranchInst or a BranchInst that was originally conditional, but has been shortened to unconditional. I was not able to come up with a nicer solution to this problem. (And rest assured, I tried *a lot*). Similar reorderings will follow for InvokeInst and CallInst. After that some optimizations to pred_iterator and CallSite will fall out naturally. llvm-svn: 66815
* fix Analysis/BasicAA/2004-12-08-BasicAACrash.ll by allowing opaque types.Chris Lattner2009-03-091-2/+4
| | | | llvm-svn: 66395
* Fix PR3746 - Crash in isel with GEP of function pointerChris Lattner2009-03-091-13/+17
| | | | | | | | | | | by checking that the top-level type of a gep is sized. This causes us to reject the example with: llvm-as: t2.ll:2:16: invalid getelementptr indices getelementptr i32()* null, i32 1 ^ llvm-svn: 66393
* simplify CallSite helper class to not consult the Instruction'sGabor Greif2009-01-111-59/+33
| | | | | | | | opcode on each delegation. Instead the information is cached on construction and the cached flag used thereafter. Introduced two predicates: isCall and isInvoke. llvm-svn: 62055
* move select validation logic into a shared place where the select ctor,Chris Lattner2008-12-291-0/+27
| | | | | | verifier, asm parser, etc can share it. llvm-svn: 61461
* add a long-overdue AllocaInst::isStaticAlloca method.Chris Lattner2008-11-261-0/+12
| | | | llvm-svn: 60080
* Silence unused variable warnings.Devang Patel2008-11-211-0/+1
| | | | llvm-svn: 59841
* Added support for the following definition of shufflevector Mon P Wang2008-11-101-11/+10
| | | | | | <result> = shufflevector <n x <ty>> <v1>, <n x <ty>> <v2>, <m x i32> <mask> llvm-svn: 58964
* Silence unused variable warnings.Devang Patel2008-11-051-1/+3
| | | | llvm-svn: 58743
* Large mechanical patch.Devang Patel2008-09-251-22/+22
| | | | | | | | | | | | | | | s/ParamAttr/Attribute/g s/PAList/AttrList/g s/FnAttributeWithIndex/AttributeWithIndex/g s/FnAttr/Attribute/g This sets the stage - to implement function notes as function attributes and - to distinguish between function attributes and return value attributes. This requires corresponding changes in llvm-gcc and clang. llvm-svn: 56622
* s/ParameterAttributes/Attributes/gDevang Patel2008-09-231-7/+7
| | | | llvm-svn: 56513
* Improve support for vector casts in LLVM IR and CodeGen.Dan Gohman2008-08-141-13/+18
| | | | llvm-svn: 54784
* Add vector shifts to the IR, patch by Eli Friedman.Nate Begeman2008-07-291-2/+5
| | | | | | CodeGen & Clang work coming next. llvm-svn: 54161
* Add a GetElementPtrInst::getIndexedType that accepts uint64_t's instead of ↵Matthijs Kooijman2008-07-291-4/+20
| | | | | | just Value*'s. llvm-svn: 54157
* Tab removalNate Begeman2008-07-251-1/+1
| | | | llvm-svn: 54025
* Enable first-class aggregates support.Dan Gohman2008-07-231-93/+10
| | | | | | | | | | | | Remove the GetResultInst instruction. It is still accepted in LLVM assembly and bitcode, where it is now auto-upgraded to ExtractValueInst. Also, remove support for return instructions with multiple values. These are auto-upgraded to use InsertValueInst instructions. The IRBuilder still accepts multiple-value returns, and auto-upgrades them to InsertValueInst instructions. llvm-svn: 53941
* Add some convenience methods for manipulatingDuncan Sands2008-07-081-14/+32
| | | | | | call attributes. llvm-svn: 53223
* Remove two convenience constructors because they're now private, and theDan Gohman2008-06-231-18/+0
| | | | | | private implementation doesn't really need the convenience. llvm-svn: 52629
* Use std::copy instead of a loop.Dan Gohman2008-06-231-3/+1
| | | | llvm-svn: 52628
* Simplify this code. Thanks Chris!Dan Gohman2008-06-201-3/+2
| | | | llvm-svn: 52514
* In InsertValueInst's copy ctor, actually copy the operands.Dan Gohman2008-06-171-0/+2
| | | | llvm-svn: 52434
* Implement the ExtractValueInst::getIndexedType that accepts oneDan Gohman2008-06-171-0/+6
| | | | | | index value. llvm-svn: 52432
* fix pr2460Chris Lattner2008-06-161-1/+2
| | | | llvm-svn: 52294
* get rid of ExtractValueInst::init's Value argument, it is already passed to ↵Gabor Greif2008-06-061-6/+4
| | | | | | the UnaryInstruction ctor llvm-svn: 52064
* make ExtractValueInst derived from UnaryInstructionGabor Greif2008-06-061-12/+9
| | | | llvm-svn: 52061
* * Make CallSite::hasArgument const and let it take a const parameter.Matthijs Kooijman2008-06-051-1/+1
| | | | llvm-svn: 51989
* Add CallSite::hasArgument to allow for seeing if a call passes a certain ↵Matthijs Kooijman2008-06-041-0/+7
| | | | | | value as an argument quickly. llvm-svn: 51946
* Add a Name parameter to two of the init methods of GetElementPointer to make ↵Matthijs Kooijman2008-06-041-6/+8
| | | | | | the name setting more consistent. llvm-svn: 51945
* Implement the two constructors in InsertValueInst and ExtractValueInst.Matthijs Kooijman2008-06-041-5/+54
| | | | | | | Add a Name argment to two init methods in these classes as well to make things a bit more consistent. llvm-svn: 51937
* Factor several methods, including getInversePredicate andDan Gohman2008-05-311-43/+31
| | | | | | | | getSwappedPredicate, from ICmpInst and FCmpInst into common methods in CmpInst. This allows CmpInsts to be manipulated generically. llvm-svn: 51810
* IR, bitcode reader, bitcode writer, and asmparser changes toDan Gohman2008-05-311-44/+46
| | | | | | | | | | | insertvalue and extractvalue to use constant indices instead of Value* indices. And begin updating LangRef.html. There's definately more to come here, but I'm checking this basic support in now to make it available to people who are interested. llvm-svn: 51806
* prune unneeded #includesGabor Greif2008-05-271-1/+0
| | | | llvm-svn: 51590
* remove unneeded reinterpret_castsGabor Greif2008-05-271-2/+2
| | | | llvm-svn: 51589
* We have the correct headers included to know that BB isa Value. No ↵Gabor Greif2008-05-271-6/+6
| | | | | | reinterpret_cast necessary. llvm-svn: 51588
* eliminate calls to deprecated Use::init() interfaceGabor Greif2008-05-261-108/+108
| | | | llvm-svn: 51570
* Add more IR support for the new extractvalue and insertvalueDan Gohman2008-05-231-0/+68
| | | | | | instructions. llvm-svn: 51461
* Add functions to enable adding a single attribute to a function andEric Christopher2008-05-161-0/+12
| | | | | | its associated call site. llvm-svn: 51204
* API change for {BinaryOperator|CmpInst|CastInst}::create*() --> Create. ↵Gabor Greif2008-05-161-44/+44
| | | | | | Legacy interfaces will be in place for some time. (Merge from use-diet branch.) llvm-svn: 51200
* Revert the change from r51157 inDan Gohman2008-05-161-1/+1
| | | | | | | | test/Verifier/2002-11-05-GetelementptrPointers.ll, which was incorrect. Instead, fix getIndexedType to not follow pointer types, as PointerType is a subclass of CompositeType. llvm-svn: 51171
* IR support for extractvalue and insertvalue instructions. Also, beginDan Gohman2008-05-151-32/+37
| | | | | | moving toward making structs and arrays first-class types. llvm-svn: 51157
* Fix a bunch of 80col violations that arose from the Create API change. Tweak ↵Gabor Greif2008-05-151-26/+39
| | | | | | makefile targets to find these better. llvm-svn: 51143
* Merge of r51073-51074 from use-diet branch.Gabor Greif2008-05-131-1/+1
| | | | | | | | | | | Do not rely on std::swap<Use>, provide a (faster) member function instead. This change is primarily necessitated by MSVC++'s incompatibility with declaring std::swap<Use> to be a friend of Use. Also contains some minor tweaks to Use inline functions, to undo pointless changes that sneaked in with the last merge. llvm-svn: 51078
OpenPOWER on IntegriCloud