summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/ValueMapper.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Reinstate r133513 (reverted in r133700) with an additional fix for aJay Foad2011-06-231-0/+14
| | | | | | -Wshorten-64-to-32 warning in Instructions.h. llvm-svn: 133708
* Revert r133513:Eric Christopher2011-06-231-14/+0
| | | | | | | | | "Reinstate r133435 and r133449 (reverted in r133499) now that the clang self-hosted build failure has been fixed (r133512)." Due to some additional warnings. llvm-svn: 133700
* Reinstate r133435 and r133449 (reverted in r133499) now that the clangJay Foad2011-06-211-0/+14
| | | | | | self-hosted build failure has been fixed (r133512). llvm-svn: 133513
* Revert r133435 and r133449 to appease buildbots.Chad Rosier2011-06-211-14/+0
| | | | llvm-svn: 133499
* Change how PHINodes store their operands.Jay Foad2011-06-201-0/+14
| | | | | | | | | | | | | | | | | | | Change PHINodes to store simple pointers to their incoming basic blocks, instead of full-blown Uses. Note that this loses an optimization in SplitCriticalEdge(), because we can no longer walk the use list of a BasicBlock to find phi nodes. See the comment I removed starting "However, the foreach loop is slow for blocks with lots of predecessors". Extend replaceAllUsesWith() on a BasicBlock to also update any phi nodes in the block's successors. This mimics what would have happened when PHINodes were proper Users of their incoming blocks. (Note that this only works if OldBB->replaceAllUsesWith(NewBB) is called when OldBB still has a terminator instruction, so it still has some successors.) llvm-svn: 133435
* PR9214: Convert Metadata API to use ArrayRef.Jay Foad2011-04-211-2/+2
| | | | llvm-svn: 129932
* fix PR9015, a crash linking recursive metadata.Chris Lattner2011-01-241-6/+11
| | | | llvm-svn: 124099
* Revamp the ValueMapper interfaces in a couple ways:Chris Lattner2011-01-081-105/+64
| | | | | | | | | | | | | | | | 1. Take a flags argument instead of a bool. This makes it more clear to the reader what it is used for. 2. Add a flag that says that "remapping a value not in the map is ok". 3. Reimplement MapValue to share a bunch of code and be a lot more efficient. For lookup failures, don't drop null values into the map. 4. Using the new flag a bunch of code can vaporize in LinkModules and LoopUnswitch, kill it. No functionality change. llvm-svn: 123058
* Fix PR8313 by changing ValueToValueMap use a TrackingVH.Rafael Espindola2010-10-131-1/+1
| | | | llvm-svn: 116390
* Reapply r112091 and r111922, support for metadata linking, with aDan Gohman2010-08-261-21/+61
| | | | | | | | | | | | | | fix: add a flag to MapValue and friends which indicates whether any module-level mappings are being made. In the common case of inlining, no module-level mappings are needed, so MapValue doesn't need to examine non-function-local metadata, which can be very expensive in the case of a large module with really deep metadata (e.g. a large C++ program compiled with -g). This flag is a little awkward; perhaps eventually it can be moved into the ClonedCodeInfo class. llvm-svn: 112190
* Revert r111922, "MapValue support for MDNodes. This is similar to r109117,Daniel Dunbar2010-08-261-27/+8
| | | | | | | except ...", it is causing *massive* performance regressions when building Clang with itself (-O3 -g). llvm-svn: 112158
* Revert r112091, "Remap metadata attached to instructions when remappingDaniel Dunbar2010-08-261-12/+1
| | | | | | individual ...", which depends on r111922, which I am reverting. llvm-svn: 112157
* Remap metadata attached to instructions when remapping individualDan Gohman2010-08-251-1/+12
| | | | | | instructions, not when remapping modules. llvm-svn: 112091
* Use MapValue in the Linker instead of having a private functionDan Gohman2010-08-241-1/+1
| | | | | | | | which does the same thing. This eliminates redundant code and handles MDNodes better. MDNode linking still doesn't fully work yet though. llvm-svn: 111941
* MapValue support for MDNodes. This is similar to r109117, exceptDan Gohman2010-08-241-8/+27
| | | | | | | | that it avoids a lot of unnecessary cloning by avoiding remapping MDNode cycles when none of the nodes in the cycle actually need to be remapped. Also it uses the new temporary MDNode mechanism. llvm-svn: 111922
* Revert this because we can't clone cyclic MDNodes which are creating during aNick Lewycky2010-07-241-3/+4
| | | | | | build of llvm-gcc. llvm-svn: 109355
* Whether function-local or not, a MDNode may reference a Function in which caseNick Lewycky2010-07-241-4/+3
| | | | | | | it needs to be mapped to refer to the function in the new module, not the old one. Fixes PR7700. llvm-svn: 109353
* Speculatively revert 109117Devang Patel2010-07-221-27/+6
| | | | llvm-svn: 109132
* Map MDNode correctly. Devang Patel2010-07-221-6/+27
| | | | | | A non function local MDNode can have an operand which is cloned by MapValue(). llvm-svn: 109117
* MDString is already checked earlier.Devang Patel2010-07-021-1/+1
| | | | llvm-svn: 107516
* Cosmetic change.Devang Patel2010-06-231-4/+4
| | | | | | Do not use "ValueMap" as a name for a local variable or an argument. llvm-svn: 106698
* Revert 106592 for now. It causes clang-selfhost build failure.Devang Patel2010-06-221-34/+13
| | | | llvm-svn: 106598
* If a metadata operand is seeded in value map and the metadata should also be ↵Devang Patel2010-06-221-13/+34
| | | | | | | | | | | seeded in value map. This is not limited to function local metadata. Failure to seed metdata in such cases causes troubles when in a cloned module, metadata from a new module refers to values in old module. Usually this results in mysterious bugpoint crashes. For example, Checking to see if we can delete global inits: Unknown constant! UNREACHABLE executed at /d/g/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:904! llvm-svn: 106592
* Revert 106528. It is causing self host failures.Devang Patel2010-06-221-5/+7
| | | | llvm-svn: 106529
* Do not rely on DenseMap slot which can be easily invalidated when DenseMap ↵Devang Patel2010-06-221-7/+5
| | | | | | grows. llvm-svn: 106528
* Rename ValueMapTy as ValueToValueMapTy to clearly indicate that this has no ↵Devang Patel2010-04-201-2/+2
| | | | | | replationship with ADT/ValueMap. llvm-svn: 101950
* There is no need to install ValueMapper.h header. Devang Patel2010-04-201-1/+1
| | | | llvm-svn: 101949
* Avoid extra calls to MD->getNumOperands()Victor Hernandez2010-01-261-1/+1
| | | | llvm-svn: 94618
* It turns out that this #include is needed because otherwiseChris Lattner2010-01-211-1/+1
| | | | | | | | | ValueMapper.cpp ends up calling an out of line __ZNK4llvm12PATypeHolder3getEv, which is a template and llvm-config determines arbitrarily to use the one in libipo. This sucks, but keeping the #include is a reasonable workaround. llvm-svn: 94103
* unbreak the build, apparently without this transformutils starts depending ↵Chris Lattner2010-01-211-0/+1
| | | | | | on libipa? llvm-svn: 94102
* tidy upChris Lattner2010-01-211-14/+7
| | | | llvm-svn: 94101
* Don't need to include IntrinsicInst.h any moreVictor Hernandez2010-01-211-1/+0
| | | | llvm-svn: 94092
* No need to map NULL operands of metadataVictor Hernandez2010-01-211-1/+1
| | | | llvm-svn: 94091
* Switch Elts from vector to SmallVectorVictor Hernandez2010-01-201-2/+1
| | | | llvm-svn: 93989
* Map operands of all function-local metadata, not just metadata passed to ↵Victor Hernandez2010-01-201-19/+13
| | | | | | llvm.dbg.declare intrinsics llvm-svn: 93979
* While mapping llvm.dbg.declare intrinsic manually map its operand, if possible,Devang Patel2010-01-181-0/+18
| | | | | | because it points to an alloca instruction through metadata. llvm-svn: 93757
* Revert 85678/85680. The decision is to stay with the current form of Chris Lattner2009-11-011-7/+2
| | | | | | | indirectbr, thus we don't need "blockaddr(@func, null)". Eliminate it for simplicity. llvm-svn: 85699
* adjust a couple xforms to work with null bb's in BlockAddress.Chris Lattner2009-10-311-2/+7
| | | | llvm-svn: 85680
* teach various passes about blockaddress. We no longerChris Lattner2009-10-291-2/+2
| | | | | | crash on any clang tests. llvm-svn: 85465
* teach ValueMapper about BlockAddress', making bugpoint a lot more useful.Chris Lattner2009-10-291-7/+10
| | | | llvm-svn: 85458
* unindent massive blocks, no functionality change.Chris Lattner2009-10-291-69/+75
| | | | llvm-svn: 85457
* MapValue doesn't needs its LLVMContext argument.Dan Gohman2009-10-241-10/+9
| | | | llvm-svn: 85020
* Rename MDNode.h header. It defines MDnode and other metadata classes.Devang Patel2009-07-281-1/+1
| | | | | | New name is Metadata.h. llvm-svn: 77370
* Return ConstantVector to 2.5 API.Owen Anderson2009-07-281-1/+1
| | | | llvm-svn: 77366
* Change ConstantArray to 2.5 API.Owen Anderson2009-07-281-1/+1
| | | | llvm-svn: 77347
* Move ConstantStruct back to 2.5 API.Owen Anderson2009-07-271-1/+1
| | | | llvm-svn: 77266
* Do not seed mstadata into the value map.Devang Patel2009-07-271-25/+4
| | | | llvm-svn: 77208
* Get rid of the Pass+Context magic.Owen Anderson2009-07-221-5/+5
| | | | llvm-svn: 76702
* llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.Torok Edwin2009-07-141-1/+1
| | | | | | | | | This adds location info for all llvm_unreachable calls (which is a macro now) in !NDEBUG builds. In NDEBUG builds location info and the message is off (it only prints "UREACHABLE executed"). llvm-svn: 75640
* assert(0) -> LLVM_UNREACHABLE.Torok Edwin2009-07-111-1/+2
| | | | | | | | | Make llvm_unreachable take an optional string, thus moving the cerr<< out of line. LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for NDEBUG builds. llvm-svn: 75379
OpenPOWER on IntegriCloud