summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Transforms/Utils/SSAUpdater.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Move all of the header files which are involved in modelling the LLVM IRChandler Carruth2013-01-021-3/+3
| | | | | | | | | | | | | | | | | | | | | into their new header subdirectory: include/llvm/IR. This matches the directory structure of lib, and begins to correct a long standing point of file layout clutter in LLVM. There are still more header files to move here, but I wanted to handle them in separate commits to make tracking what files make sense at each layer easier. The only really questionable files here are the target intrinsic tablegen files. But that's a battle I'd rather not fight today. I've updated both CMake and Makefile build systems (I think, and my tests think, but I may have missed something). I've also re-sorted the includes throughout the project. I'll be committing updates to Clang, DragonEgg, and Polly momentarily. llvm-svn: 171366
* Use the new script to sort the includes of every file under lib.Chandler Carruth2012-12-031-4/+4
| | | | | | | | | | | | | | | | | Sooooo many of these had incorrect or strange main module includes. I have manually inspected all of these, and fixed the main module include to be the nearest plausible thing I could find. If you own or care about any of these source files, I encourage you to take some time and check that these edits were sensible. I can't have broken anything (I strictly added headers, and reordered them, never removed), but they may not be the headers you'd really like to identify as containing the API being implemented. Many forward declarations and missing includes were added to a header files to allow them to parse cleanly when included first. The main module rule does in fact have its merits. =] llvm-svn: 169131
* Fix undefined behavior (binding a reference to a dereferenced null pointer) ifRichard Smith2012-08-171-1/+1
| | | | | | SSAUpdater was created and destroyed without being initialized. llvm-svn: 162137
* LICM uses AliasSet information to hoist and sink instructions. However, ↵Nadav Rotem2012-08-131-0/+5
| | | | | | | | | | | | other passes, such as LoopRotate may invalidate its AliasSet because SSAUpdater does not update the AliasSet properly. This patch teaches SSAUpdater to notify AliasSet that it made changes. The testcase in PR12901 is too big to be useful and I could not reduce it to a normal size. rdar://11872059 PR12901 llvm-svn: 161803
* The name (and comment describing) of llvm::GetFirstDebuigLocInBasicBlock no ↵Eli Bendersky2012-06-251-2/+5
| | | | | | longer represents what the function does. Therefore, the function is removed and its functionality is folded into the only place in the code-base where it was being used. llvm-svn: 159133
* Fix two rather subtle internal vs. external linker issues.Chandler Carruth2012-06-201-25/+20
| | | | | | | | | | | | | | | | | | | | | | I'll admit I'm not entirely satisfied with this change, but it seemed the cleanest option. Other suggestions quite welcome The issue is that the traits specializations have static methods which return the typedef'ed PHI_iterator type. In both the IR and MI layers this is typedef'ed to a custom iterator class defined in an anonymous namespace giving the types and the functions returning them internal linkage. However, because the traits specialization is defined in the 'llvm' namespace (where it has to be, specialized template lives there), and is in turn used in the templated implementation of the SSAUpdater. This led to the linkage conflict that Clang now warns about. The simplest solution to me was just to define the PHI_iterator as a nested class inside the trait specialization. That way it still doesn't get scoped widely, it can't be accidentally reused somewhere, etc. This is a little gross just because nested class definitions are a little gross, but the alternatives seem more ad-hoc. llvm-svn: 158799
* Make headers standalone, move a virtual method out of line.Benjamin Kramer2011-11-141-0/+7
| | | | llvm-svn: 144536
* land David Blaikie's patch to de-constify Type, with a few tweaks.Chris Lattner2011-07-181-1/+1
| | | | llvm-svn: 135375
* fix a warning in TinyPtrVector, adopt it in SSAUpdater, saving someChris Lattner2011-07-181-3/+3
| | | | | | mallocs. llvm-svn: 135366
* Simplify. Consolidate dbg.declare handling in AllocaPromoter.Devang Patel2011-07-061-11/+3
| | | | llvm-svn: 134538
* Clean up the lazy initialization of DIBuilder a bit.Cameron Zwarich2011-05-241-9/+3
| | | | llvm-svn: 131956
* Make LoadAndStorePromoter preserve debug info and create llvm.dbg.values whenCameron Zwarich2011-05-241-7/+25
| | | | | | promoting allocas to SSA variables. Fixes <rdar://problem/9479036>. llvm-svn: 131953
* Assing line number info to new PHIs created by SSA updater.Devang Patel2011-04-291-0/+5
| | | | llvm-svn: 130551
* Don't include Operator.h from InstrTypes.h.Jay Foad2011-04-111-0/+1
| | | | llvm-svn: 129271
* Remove PHINode::reserveOperandSpace(). Instead, add a parameter toJay Foad2011-03-301-5/+4
| | | | | | PHINode::Create() giving the (known or expected) number of operands. llvm-svn: 128537
* fix PR9017, a bug where we'd assert when promoting in unreachableChris Lattner2011-01-241-0/+3
| | | | | | code. llvm-svn: 124100
* Generalize LoadAndStorePromoter a bit and switch LICMChris Lattner2011-01-151-16/+25
| | | | | | to use it. llvm-svn: 123501
* Add a new LoadAndStorePromoter class, which implements the generalChris Lattner2011-01-141-0/+154
| | | | | | | "promote a bunch of load and stores" logic, allowing the code to be shared and reused. llvm-svn: 123456
* Have a few places that want to simplify phi nodes use SimplifyInstructionDuncan Sands2010-11-161-2/+3
| | | | | | rather than calling hasConstantValue. No intended functionality change. llvm-svn: 119352
* Reapply commit 112699, speculatively reverted by echristo, sinceDuncan Sands2010-09-021-13/+11
| | | | | | | | | I'm sure it is harmless. Original commit message: If PrototypeValue is erased in the middle of using the SSAUpdator then the SSAUpdator may access freed memory. Instead, simply pass in the type and name explicitly, which is all that was used anyway. llvm-svn: 112810
* Speculatively revert 112699 and 112702, they seem to be causingEric Christopher2010-09-011-11/+13
| | | | | | self host errors on clang-x86-64. llvm-svn: 112719
* If PrototypeValue is erased in the middle of using the SSAUpdatorDuncan Sands2010-09-011-13/+11
| | | | | | | then the SSAUpdator may access freed memory. Instead, simply pass in the type and name explicitly, which is all that was used anyway. llvm-svn: 112699
* implement SSAUpdater::RewriteUseAfterInsertions, a helpful form of RewriteUse.Chris Lattner2010-08-291-0/+16
| | | | llvm-svn: 112409
* Combine the implementations of the core part of the SSAUpdater andBob Wilson2010-05-041-429/+102
| | | | | | MachineSSAUpdater to avoid duplicating all the code. llvm-svn: 103060
* Fix a performance problem with the new SSAUpdater. This showed up in theBob Wilson2010-04-211-2/+8
| | | | | | GCCAS time for MultiSource/Benchmarks/ASCI_Purple/SMG2000. llvm-svn: 102009
* Re-commit my previous SSAUpdater changes. The previous version naively triedBob Wilson2010-04-171-179/+434
| | | | | | | | | | | to determine where to place PHIs by iteratively comparing reaching definitions at each block. That was just plain wrong. This version now computes the dominator tree within the subset of the CFG where PHIs may need to be placed, and then places the PHIs in the iterated dominance frontier of each definition. The rest of the patch is mostly the same, with a few more performance improvements added in. llvm-svn: 101612
* Revert all my SSAUpdater patches. The PHI placement algorithm is not correctBob Wilson2010-04-031-315/+183
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (what was I thinking?) and there's also a problem with LCSSA. I'll try again later with fixes. --- Reverse-merging r100263 into '.': U lib/Transforms/Utils/SSAUpdater.cpp --- Reverse-merging r100177 into '.': G lib/Transforms/Utils/SSAUpdater.cpp --- Reverse-merging r100148 into '.': G lib/Transforms/Utils/SSAUpdater.cpp --- Reverse-merging r100147 into '.': U include/llvm/Transforms/Utils/SSAUpdater.h G lib/Transforms/Utils/SSAUpdater.cpp --- Reverse-merging r100131 into '.': G include/llvm/Transforms/Utils/SSAUpdater.h G lib/Transforms/Utils/SSAUpdater.cpp --- Reverse-merging r100130 into '.': G lib/Transforms/Utils/SSAUpdater.cpp --- Reverse-merging r100126 into '.': G include/llvm/Transforms/Utils/SSAUpdater.h G lib/Transforms/Utils/SSAUpdater.cpp --- Reverse-merging r100050 into '.': D test/Transforms/GVN/2010-03-31-RedundantPHIs.ll --- Reverse-merging r100047 into '.': G include/llvm/Transforms/Utils/SSAUpdater.h G lib/Transforms/Utils/SSAUpdater.cpp llvm-svn: 100264
* Add a DEBUG_TYPE for the SSAUpdater.Bob Wilson2010-04-031-0/+1
| | | | llvm-svn: 100263
* Recommit 100158 now that the buildbots are happy again.Bob Wilson2010-04-021-21/+29
| | | | llvm-svn: 100177
* Revert 100158 in case it is causing some of the buildbot problems.Bob Wilson2010-04-021-29/+21
| | | | llvm-svn: 100164
* Check for terminating conditions before adding PHIs to the worklists.Bob Wilson2010-04-021-21/+29
| | | | | | This is more efficient than adding them to the worklist and then ignoring them. llvm-svn: 100158
* Remove trailing whitespace.Bob Wilson2010-04-011-5/+5
| | | | llvm-svn: 100148
* Rewrite another SSAUpdater function to avoid recursion.Bob Wilson2010-04-011-32/+46
| | | | llvm-svn: 100147
* Change another SSAUpdater function to avoid recursion.Bob Wilson2010-04-011-18/+24
| | | | llvm-svn: 100131
* Simplify the code to check for existing PHIs, now that it is only used inBob Wilson2010-04-011-30/+12
| | | | | | one place. This removes the template function added in svn 94690. llvm-svn: 100130
* The SSAUpdater should avoid recursive traversals of the CFG, since that mayBob Wilson2010-04-011-15/+23
| | | | | | blow out the stack for really big functions. Start by fixing an easy case. llvm-svn: 100126
* Rewrite part of the SSAUpdater to be more careful about inserting redundantBob Wilson2010-03-311-150/+263
| | | | | | | | PHIs. The previous algorithm was unable to reliably detect when existing PHIs in a cycle can be reused. I'm still working on reducing a testcase. Radar 7711900. llvm-svn: 100047
* Avoid creating redundant PHIs in SSAUpdater::GetValueInMiddleOfBlock.Bob Wilson2010-01-271-41/+75
| | | | | | | This was already being done in SSAUpdater::GetValueAtEndOfBlock so I've just changed SSAUpdater to check for existing PHIs in both places. llvm-svn: 94690
* Change errs() to dbgs().David Greene2010-01-051-2/+2
| | | | llvm-svn: 92603
* improve indentation avoid a pointless conversion from weakvh to trackingvh,Chris Lattner2009-12-211-3/+3
| | | | | | no functionality change. llvm-svn: 91848
* fix PR5837 by having SSAUpdate reuse phi nodes for theChris Lattner2009-12-211-1/+23
| | | | | | | | | | 'GetValueInMiddleOfBlock' case, instead of inserting duplicates. A similar fix is almost certainly needed by the machine-level SSAUpdate implementation. llvm-svn: 91820
* add an assert to make it really clear what this is doing. Return singularval asChris Lattner2009-12-041-1/+5
| | | | | | a compile time perf optimization to avoid a load. llvm-svn: 90507
* alternate fix for PR5258 which avoids worklist problems, with reduced testcase.Chris Lattner2009-10-201-11/+6
| | | | llvm-svn: 84667
* Fix PR5258, jump-threading creating invalid PHIs.Torok Edwin2009-10-201-2/+10
| | | | | | | When an incoming value for a PHI is updated, we must also updated all other incoming values for the same BB to match, otherwise we create invalid PHIs. llvm-svn: 84638
* Strip trailing white space.Duncan Sands2009-10-161-33/+31
| | | | llvm-svn: 84256
* add a simple helper method.Chris Lattner2009-10-101-0/+6
| | | | llvm-svn: 83745
* add ability for clients of SSAUpdater to find out about theChris Lattner2009-10-101-1/+9
| | | | | | PHI nodes inserted. llvm-svn: 83744
* add the ability to get a rewritten value from the middle of a block,Chris Lattner2009-10-101-3/+92
| | | | | | | not just at the end. Add a big comment explaining when this could be useful (which never happens for jump threading). llvm-svn: 83741
* rename GetValueInBlock -> GetValueAtEndOfBlock to better reflect Chris Lattner2009-10-101-11/+11
| | | | | | what it does. llvm-svn: 83740
* use a typedef instead of spelling out an insane type. Yay for auto someday.Chris Lattner2009-10-101-3/+3
| | | | llvm-svn: 83707
OpenPOWER on IntegriCloud