summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Instructions.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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
* add enough support for indirect branch for the feature test to passChris Lattner2009-10-271-0/+121
| | | | | | | (assembler,asmprinter, bc reader+writer) and document it. Codegen currently aborts on it. llvm-svn: 85274
* Remove FreeInst.Victor Hernandez2009-10-261-32/+0
| | | | | | | Remove LowerAllocations pass. Update some more passes to treate free calls just like they were treating FreeInst. llvm-svn: 85176
* Remove ICmpInst::isSignedPredicate which was a reimplementationNick Lewycky2009-10-251-11/+0
| | | | | | CmpInst::isSigned. llvm-svn: 85037
* Sink isTrueWhenEqual from ICmpInst to CmpInst. Add a matching isFalseWhenEqualNick Lewycky2009-10-251-1/+18
| | | | | | which is equal to !isTrueWhenEqual for ints but not for floats. llvm-svn: 85036
* Auto-upgrade free instructions to calls to the builtin free function.Victor Hernandez2009-10-241-0/+45
| | | | | | | Update all analysis passes and transforms to treat free calls just like FreeInst. Remove RaiseAllocations and all its tests since FreeInst no longer needs to be raised. llvm-svn: 84987
* Remove AllocationInst. Since MallocInst went away, AllocaInst is the only ↵Victor Hernandez2009-10-231-13/+47
| | | | | | subclass of AllocationInst, so it no longer is necessary. llvm-svn: 84969
* Fix test/Bindings/Ocaml/vmcore.ml. When IRBuilder::CreateMalloc was removed,Nick Lewycky2009-10-171-11/+12
| | | | | | | LLVMBuildMalloc was reimplemented but with the bug that it didn't insert the resulting instruction. llvm-svn: 84374
* Remove MallocInst from LLVM Instructions.Victor Hernandez2009-10-171-13/+1
| | | | llvm-svn: 84299
* Autoupgrade malloc insts to malloc calls.Victor Hernandez2009-10-171-15/+25
| | | | | | | | Update testcases that rely on malloc insts being present. Also prematurely remove MallocInst handling from IndMemRemoval and RaiseAllocations to help pass tests in this incremental step. llvm-svn: 84292
* Introduce and use convenience methods for getting pointer typesDuncan Sands2009-10-061-1/+1
| | | | | | | where the element is of a basic builtin type. For example, to get an i8* use getInt8PtrTy. llvm-svn: 83379
* Round out the API for the new optimization flags.Nick Lewycky2009-09-271-0/+16
| | | | llvm-svn: 82930
* Instruction::clone does not need to take an LLVMContext&. Remove that andNick Lewycky2009-09-271-44/+42
| | | | | | update all the callers. llvm-svn: 82889
* Revert 82694 "Auto-upgrade malloc instructions to malloc calls." because it ↵Victor Hernandez2009-09-251-12/+8
| | | | | | causes regressions in the nightly tests. llvm-svn: 82784
* Auto-upgrade malloc instructions to malloc calls.Victor Hernandez2009-09-241-8/+12
| | | | | | Reviewed by Devang Patel. llvm-svn: 82694
* Do not leave behind metadata while cloning an instruction.Devang Patel2009-09-231-0/+146
| | | | llvm-svn: 82638
* tidy upChris Lattner2009-09-211-18/+17
| | | | llvm-svn: 82489
* Update malloc call creation code (AllocType is now the element type of the ↵Victor Hernandez2009-09-181-45/+38
| | | | | | | | | | | | | | | | | | malloc, not the resulting type). In getMallocArraySize(), fix bug in the case that array size is the product of 2 constants. Extend isArrayMalloc() and getMallocArraySize() to handle case where malloc is used as char array. Ensure that ArraySize in LowerAllocations::runOnBasicBlock() is correct type. Extend Instruction::isSafeToSpeculativelyExecute() to handle malloc calls. Add verification for malloc calls. Reviewed by Dan Gohman. llvm-svn: 82257
* Fix -Asserts warning.Daniel Dunbar2009-09-111-2/+2
| | | | llvm-svn: 81580
* Fix indentation.Dan Gohman2009-09-111-1/+1
| | | | llvm-svn: 81484
* Add some braces to make newer GCCs happy and update CMakeLists.Benjamin Kramer2009-09-101-3/+5
| | | | llvm-svn: 81443
* Add malloc call utility functions. Patch by Victor Hernandez.Evan Cheng2009-09-101-0/+111
| | | | llvm-svn: 81426
* Reappy r80998, now that the GlobalOpt bug that it exposed on MiniSAT is fixed.Dan Gohman2009-09-071-0/+15
| | | | llvm-svn: 81172
* Revert "Include optional subclass flags, such as inbounds, nsw, etc., ...", thisDaniel Dunbar2009-09-061-15/+0
| | | | | | breaks MiniSAT on x86_64. llvm-svn: 81098
* Include optional subclass flags, such as inbounds, nsw, etc., in theDan Gohman2009-09-041-0/+15
| | | | | | | | | | | | | | | | | Constant uniquing tables. This allows distinct ConstantExpr objects with the same operation and different flags. Even though a ConstantExpr "a + b" is either always overflowing or never overflowing (due to being a ConstantExpr), it's still necessary to be able to represent it both with and without overflow flags at the same time within the IR, because the safety of the flag may depend on the context of the use. If the constant really does overflow, it wouldn't ever be safe to use with the flag set, however the use may be in code that is never actually executed. This also makes it possible to merge all the flags tests into a single test. llvm-svn: 80998
OpenPOWER on IntegriCloud