summaryrefslogtreecommitdiffstats
path: root/llvm/lib/VMCore/Instructions.cpp
Commit message (Collapse)AuthorAgeFilesLines
* 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
* Change PHINode::hasConstantValue to have a DominatorTree argumentDan Gohman2009-09-031-7/+20
| | | | | | | | instead of a bool argument, and to do the dominator check itself. This makes it eaiser to use when DominatorTree information is available. llvm-svn: 80920
* back out my recent commit (r80858), it seems to break self-hosting ↵Gabor Greif2009-09-031-12/+5
| | | | | | buildbot's stage 2 configure llvm-svn: 80871
* re-commit r66920 (which has been backed out in r66953) I may have more luck ↵Gabor Greif2009-09-031-5/+12
| | | | | | this time. I'll back out if needed... llvm-svn: 80858
* Retype from unsigned to CallingConv::ID accordingly. Approved by Bob Wilson.Sandeep Patel2009-09-021-2/+2
| | | | llvm-svn: 80773
* Fix the InsertAtEnd form of ShuffleVectorInst constructor to useDan Gohman2009-08-251-4/+6
| | | | | | the correct type. llvm-svn: 80050
* Eliminate the unused Context argument on one of the ICmpInst and FCmpInstDan Gohman2009-08-251-5/+5
| | | | | | constructors. llvm-svn: 80049
* Use covariant return types for Instruction::clone, and eliminateDan Gohman2009-08-251-12/+12
| | | | | | | the forms of ExtractElementInst and InsertElementInst that are equivalent to clone. llvm-svn: 80041
* Rename Instruction::isIdenticalTo to Instruction::isIdenticalToWhenDefined,Dan Gohman2009-08-251-65/+132
| | | | | | | | | | | | | | | | and introduce a new Instruction::isIdenticalTo which tests for full identity, including the SubclassOptionalData flags. Also, fix the Instruction::clone implementations to preserve the SubclassOptionalData flags. Finally, teach several optimizations how to handle SubclassOptionalData correctly, given these changes. This fixes the counterintuitive behavior of isIdenticalTo not comparing the full value, and clone not returning an identical clone, as well as some subtle bugs that could be caused by these. Thanks to Nick Lewycky for reporting this, and for an initial patch! llvm-svn: 80038
* Push LLVMContexts through the IntegerType APIs.Owen Anderson2009-08-131-45/+55
| | | | llvm-svn: 78948
* Remove a bunch more now-unnecessary Context arguments.Dan Gohman2009-08-121-12/+6
| | | | llvm-svn: 78809
* Revert 78680 until I figure out why it completely broke things.Daniel Dunbar2009-08-111-0/+40
| | | | llvm-svn: 78697
* Remove some unnecessary LoadInst constructors, missed during Twinification.Daniel Dunbar2009-08-111-40/+0
| | | | llvm-svn: 78689
* Move a few more APIs back to 2.5 forms. The only remaining ones left to ↵Owen Anderson2009-07-311-4/+4
| | | | | | | | change back are metadata related, which I'm waiting on to avoid conflicting with Devang. llvm-svn: 77721
* Move more code back to 2.5 APIs.Owen Anderson2009-07-301-4/+3
| | | | llvm-svn: 77635
OpenPOWER on IntegriCloud