summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/CodeExtractor.cpp
Commit message (Collapse)AuthorAgeFilesLines
* SwitchInst refactoring.Stepan Dyatkovskiy2012-02-011-3/+3
| | | | | | | | | | | | | | | | | The purpose of refactoring is to hide operand roles from SwitchInst user (programmer). If you want to play with operands directly, probably you will need lower level methods than SwitchInst ones (TerminatorInst or may be User). After this patch we can reorganize SwitchInst operands and successors as we want. What was done: 1. Changed semantics of index inside the getCaseValue method: getCaseValue(0) means "get first case", not a condition. Use getCondition() if you want to resolve the condition. I propose don't mix SwitchInst case indexing with low level indexing (TI successors indexing, User's operands indexing), since it may be dangerous. 2. By the same reason findCaseValue(ConstantInt*) returns actual number of case value. 0 means first case, not default. If there is no case with given value, ErrorIndex will returned. 3. Added getCaseSuccessor method. I propose to avoid usage of TerminatorInst::getSuccessor if you want to resolve case successor BB. Use getCaseSuccessor instead, since internal SwitchInst organization of operands/successors is hidden and may be changed in any moment. 4. Added resolveSuccessorIndex and resolveCaseIndex. The main purpose of these methods is to see how case successors are really mapped in TerminatorInst. 4.1 "resolveSuccessorIndex" was created if you need to level down from SwitchInst to TerminatorInst. It returns TerminatorInst's successor index for given case successor. 4.2 "resolveCaseIndex" converts low level successors index to case index that curresponds to the given successor. Note: There are also related compatability fix patches for dragonegg, klee, llvm-gcc-4.0, llvm-gcc-4.2, safecode, clang. llvm-svn: 149481
* Use ArrayRef instead of an explicit 'const std::vector &'.Bill Wendling2011-09-201-3/+3
| | | | llvm-svn: 140172
* Use ArrayRef instead of 'const std::vector' to pass around the list of basic ↵Bill Wendling2011-09-201-8/+10
| | | | | | blocks to extract. llvm-svn: 140168
* Fix comments.Bill Wendling2011-09-201-4/+4
| | | | llvm-svn: 140164
* Revert r140083 and r140084 until buildbots can be fixed.Bill Wendling2011-09-191-8/+1
| | | | llvm-svn: 140094
* If we are extracting a basic block that ends in an invoke call, we must alsoBill Wendling2011-09-191-1/+8
| | | | | | | | | | extract the landing pad block. Otherwise, there will be a situation where the invoke's unwind edge lands on a non-landing pad. We also forbid the user from extracting the landing pad block by itself. Again, this is not a valid transformation. llvm-svn: 140083
* Convert GetElementPtrInst to use ArrayRef.Jay Foad2011-07-251-5/+4
| | | | llvm-svn: 135904
* land David Blaikie's patch to de-constify Type, with a few tweaks.Chris Lattner2011-07-181-3/+3
| | | | llvm-svn: 135375
* Convert CallInst and InvokeInst APIs to use ArrayRef.Jay Foad2011-07-151-1/+1
| | | | llvm-svn: 135265
* Second attempt at de-constifying LLVM Types in FunctionType::get(),Jay Foad2011-07-121-3/+3
| | | | | | StructType::get() and TargetData::getIntPtrType(). llvm-svn: 134982
* Revert r134893 and r134888 (and related patches in other trees). It was causingBill Wendling2011-07-121-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | an assert on Darwin llvm-gcc builds. Assertion failed: (castIsValid(op, S, Ty) && "Invalid cast!"), function Create, file /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.llvm-gcc-i386-darwin9-RA/llvm.src/lib/VMCore/Instructions.cpp, li\ ne 2067. etc. http://smooshlab.apple.com:8013/builders/llvm-gcc-i386-darwin9-RA/builds/2354 --- Reverse-merging r134893 into '.': U include/llvm/Target/TargetData.h U include/llvm/DerivedTypes.h U tools/bugpoint/ExtractFunction.cpp U unittests/Support/TypeBuilderTest.cpp U lib/Target/ARM/ARMGlobalMerge.cpp U lib/Target/TargetData.cpp U lib/VMCore/Constants.cpp U lib/VMCore/Type.cpp U lib/VMCore/Core.cpp U lib/Transforms/Utils/CodeExtractor.cpp U lib/Transforms/Instrumentation/ProfilingUtils.cpp U lib/Transforms/IPO/DeadArgumentElimination.cpp U lib/CodeGen/SjLjEHPrepare.cpp --- Reverse-merging r134888 into '.': G include/llvm/DerivedTypes.h U include/llvm/Support/TypeBuilder.h U include/llvm/Intrinsics.h U unittests/Analysis/ScalarEvolutionTest.cpp U unittests/ExecutionEngine/JIT/JITTest.cpp U unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp U unittests/VMCore/PassManagerTest.cpp G unittests/Support/TypeBuilderTest.cpp U lib/Target/MBlaze/MBlazeIntrinsicInfo.cpp U lib/Target/Blackfin/BlackfinIntrinsicInfo.cpp U lib/VMCore/IRBuilder.cpp G lib/VMCore/Type.cpp U lib/VMCore/Function.cpp G lib/VMCore/Core.cpp U lib/VMCore/Module.cpp U lib/AsmParser/LLParser.cpp U lib/Transforms/Utils/CloneFunction.cpp G lib/Transforms/Utils/CodeExtractor.cpp U lib/Transforms/Utils/InlineFunction.cpp U lib/Transforms/Instrumentation/GCOVProfiling.cpp U lib/Transforms/Scalar/ObjCARC.cpp U lib/Transforms/Scalar/SimplifyLibCalls.cpp U lib/Transforms/Scalar/MemCpyOptimizer.cpp G lib/Transforms/IPO/DeadArgumentElimination.cpp U lib/Transforms/IPO/ArgumentPromotion.cpp U lib/Transforms/InstCombine/InstCombineCompares.cpp U lib/Transforms/InstCombine/InstCombineAndOrXor.cpp U lib/Transforms/InstCombine/InstCombineCalls.cpp U lib/CodeGen/DwarfEHPrepare.cpp U lib/CodeGen/IntrinsicLowering.cpp U lib/Bitcode/Reader/BitcodeReader.cpp llvm-svn: 134949
* De-constify Types in StructType::get() and TargetData::getIntPtrType().Jay Foad2011-07-111-1/+1
| | | | llvm-svn: 134893
* De-constify Types in FunctionType::get().Jay Foad2011-07-111-2/+2
| | | | llvm-svn: 134888
* Fix a ton of comment typos found by codespell. Patch byChris Lattner2011-04-151-1/+1
| | | | | | Luis Felipe Strano Moraes! llvm-svn: 129558
* Remove PHINode::reserveOperandSpace(). Instead, add a parameter toJay Foad2011-03-301-3/+2
| | | | | | PHINode::Create() giving the (known or expected) number of operands. llvm-svn: 128537
* (Almost) always call reserveOperandSpace() on newly created PHINodes.Jay Foad2011-03-301-3/+4
| | | | llvm-svn: 128535
* typoesGabor Greif2010-09-101-2/+2
| | | | llvm-svn: 113647
* rename llvm::llvm_report_error -> llvm::report_fatal_errorChris Lattner2010-04-071-1/+1
| | | | llvm-svn: 100709
* Fix nondeterministic behavior.Julien Lerouge2010-01-101-9/+3
| | | | llvm-svn: 93093
* Fix nondeterministic behavior.Julien Lerouge2010-01-091-6/+7
| | | | llvm-svn: 93038
* Avoid going through the LLVMContext for type equality where it's safe to ↵Benjamin Kramer2010-01-051-1/+1
| | | | | | dereference the type pointer. llvm-svn: 92726
* Change errs() to dbgs().David Greene2010-01-051-7/+7
| | | | llvm-svn: 92601
* Remove includes of Support/Compiler.h that are no longer needed after theNick Lewycky2009-10-251-1/+0
| | | | | | VISIBILITY_HIDDEN removal. llvm-svn: 85043
* Remove VISIBILITY_HIDDEN from class/struct found inside anonymous namespaces.Nick Lewycky2009-10-251-1/+1
| | | | | | | Chris claims we should never have visibility_hidden inside any .cpp file but that's still not true even after this commit. llvm-svn: 85042
* Comment-ify.Owen Anderson2009-08-251-0/+3
| | | | llvm-svn: 80009
* Switch to SmallVector.Owen Anderson2009-08-251-2/+2
| | | | llvm-svn: 80007
* Pull out this predicate loop into a helper function.Owen Anderson2009-08-251-11/+15
| | | | llvm-svn: 80006
* Handle a corner case when extracing code regions where one of the immediate ↵Owen Anderson2009-08-251-2/+20
| | | | | | | | | | successor of an extracted block contains a PHI using a value defined in the extracted region. With this patch, the partial inliner now passes MultiSource/Applications. llvm-svn: 79963
* When extracting SEME regions of code, the extractor needs to update the ↵Owen Anderson2009-08-241-2/+18
| | | | | | dominator tree for split return blocks. llvm-svn: 79957
* eliminate the "Value" printing methods that print to a std::ostream.Chris Lattner2009-08-231-7/+8
| | | | | | This required converting a bunch of stuff off DOUT and other cleanups. llvm-svn: 79819
* Push LLVMContexts through the IntegerType APIs.Owen Anderson2009-08-131-23/+31
| | | | llvm-svn: 78948
* Privatize the StructType table, which unfortunately involves routing ↵Owen Anderson2009-08-051-2/+2
| | | | | | contexts through a number of APIs. llvm-svn: 78258
* Move a few more APIs back to 2.5 forms. The only remaining ones left to ↵Owen Anderson2009-07-311-10/+6
| | | | | | | | change back are metadata related, which I'm waiting on to avoid conflicting with Devang. llvm-svn: 77721
* Move types back to the 2.5 API.Owen Anderson2009-07-291-5/+4
| | | | llvm-svn: 77516
* Revert the ConstantInt constructors back to their 2.5 forms where possible, ↵Owen Anderson2009-07-241-7/+7
| | | | | | thanks to contexts-on-types. More to come. llvm-svn: 77011
* Switch to getNameStr().Daniel Dunbar2009-07-241-4/+4
| | | | llvm-svn: 76962
* Get rid of the Pass+Context magic.Owen Anderson2009-07-221-19/+19
| | | | llvm-svn: 76702
* Revert yesterday's change by removing the LLVMContext parameter to ↵Owen Anderson2009-07-151-3/+2
| | | | | | AllocaInst and MallocInst. llvm-svn: 75863
* Move EVER MORE stuff over to LLVMContext.Owen Anderson2009-07-141-2/+3
| | | | llvm-svn: 75703
* Convert more assert(0)+abort() -> LLVM_UNREACHABLE,Torok Edwin2009-07-111-1/+3
| | | | | | and abort()/exit() -> llvm_report_error(). llvm-svn: 75363
* "LLVMContext* " --> "LLVMContext *"Owen Anderson2009-07-061-2/+2
| | | | llvm-svn: 74878
* More LLVMContext-ification.Owen Anderson2009-07-051-17/+25
| | | | llvm-svn: 74807
* Fix PR2929 by making bugpoint/code extract propagate the nothrowChris Lattner2008-12-181-0/+4
| | | | | | bit from the original function to the cloned one. llvm-svn: 61194
* Fix spelling.Misha Brukman2008-12-131-1/+1
| | | | llvm-svn: 60971
* Use Instruction::eraseFromParent().Dan Gohman2008-06-211-3/+3
| | | | llvm-svn: 52606
* Tidy up BasicBlock::getFirstNonPHI, and change a bunch of places toDan Gohman2008-05-231-2/+1
| | | | | | use it instead of duplicating its functionality. llvm-svn: 51499
* Fix a bunch of 80col violations that arose from the Create API change. Tweak ↵Gabor Greif2008-05-151-1/+2
| | | | | | makefile targets to find these better. llvm-svn: 51143
* Revert r49614. As Dan pointed out, some of these aren't correct.Owen Anderson2008-04-141-1/+1
| | | | llvm-svn: 49657
* Replace calls of the form V1->setName(V2->getName()) with V1->takeName(V2), Owen Anderson2008-04-131-1/+1
| | | | | | which is significantly more efficient. llvm-svn: 49614
* API changes for class Use size reduction, wave 1.Gabor Greif2008-04-061-31/+31
| | | | | | | | Specifically, introduction of XXX::Create methods for Users that have a potentially variable number of Uses. llvm-svn: 49277
OpenPOWER on IntegriCloud