- Apr 28, 2014
-
-
Chandler Carruth authored
mapping from a basic block to an incoming value, either for removal or just lookup, is linear in the number of predecessors, and we were doing this for every entry in the 'Preds' list which is in many cases almost all of them! Unfortunately, the fixes are quite ugly. PHI nodes just don't make this operation easy. The efficient way to fix this is to have a clever 'remove_if' operation on PHI nodes that lets us do a single pass over all the incoming values of the original PHI node, extracting the ones we care about. Then we could quickly construct the new phi node from this list. This would remove the remaining underlying quadratic movement of unrelated incoming values and the need for silly backwards looping to "minimize" how often we hit the quadratic case. This is the last obvious fix for PR19499. It shaves another 20% off the compile time for me, and while UpdatePHINodes remains in the profile, most of the time is now stemming from the well known inefficiencies of LVI and jump threading. llvm-svn: 207409
-
Craig Topper authored
llvm-svn: 207394
-
- Apr 25, 2014
-
-
Craig Topper authored
llvm-svn: 207196
-
- Mar 19, 2014
-
-
Evgeniy Stepanov authored
llvm-svn: 204230
-
- Mar 04, 2014
-
-
Chandler Carruth authored
Move the test for this class into the IR unittests as well. This uncovers that ValueMap too is in the IR library. Ironically, the unittest for ValueMap is useless in the Support library (honestly, so was the ValueHandle test) and so it already lives in the IR unittests. Mmmm, tasty layering. llvm-svn: 202821
-
- Jan 13, 2014
-
-
Chandler Carruth authored
can be used by both the new pass manager and the old. This removes it from any of the virtual mess of the pass interfaces and lets it derive cleanly from the DominatorTreeBase<> template. In turn, tons of boilerplate interface can be nuked and it turns into a very straightforward extension of the base DominatorTree interface. The old analysis pass is now a simple wrapper. The names and style of this split should match the split between CallGraph and CallGraphWrapperPass. All of the users of DominatorTree have been updated to match using many of the same tricks as with CallGraph. The goal is that the common type remains the resulting DominatorTree rather than the pass. This will make subsequent work toward the new pass manager significantly easier. Also in numerous places things became cleaner because I switched from re-running the pass (!!! mid way through some other passes run!!!) to directly recomputing the domtree. llvm-svn: 199104
-
Chandler Carruth authored
directory. These passes are already defined in the IR library, and it doesn't make any sense to have the headers in Analysis. Long term, I think there is going to be a much better way to divide these matters. The dominators code should be fully separated into the abstract graph algorithm and have that put in Support where it becomes obvious that evn Clang's CFGBlock's can use it. Then the verifier can manually construct dominance information from the Support-driven interface while the Analysis library can provide a pass which both caches, reconstructs, and supports a nice update API. But those are very long term, and so I don't want to leave the really confusing structure until that day arrives. llvm-svn: 199082
-
- Dec 23, 2013
-
-
Kostya Serebryany authored
Summary: Before this change the instrumented code before Ret instructions looked like: <Unpoison Frame Redzones> if (Frame != OriginalFrame) // I.e. Frame is fake <Poison Complete Frame> Now the instrumented code looks like: if (Frame != OriginalFrame) // I.e. Frame is fake <Poison Complete Frame> else <Unpoison Frame Redzones> Reviewers: eugenis Reviewed By: eugenis CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D2458 llvm-svn: 197907
-
- Dec 19, 2013
-
-
Evgeniy Stepanov authored
Currently SplitBlockAndInsertIfThen requires that branch condition is an Instruction itself, which is very inconvenient, because it is sometimes an Operator, or even a Constant. llvm-svn: 197677
-
- Oct 05, 2013
-
-
Hal Finkel authored
UpdatePHINodes has an optimization to reuse an existing PHI node, where it first deletes all of its entries and then replaces them. Unfortunately, in the case where we had duplicate predecessors (which are allowed so long as the associated PHI entries have the same value), the loop removing the existing PHI entries from the to-be-reused PHI would assert (if that PHI was not the one which had the duplicates). llvm-svn: 192001
-
- Oct 01, 2013
-
-
Rafael Espindola authored
Patch by Alp Toker. llvm-svn: 191757
-
- Aug 06, 2013
-
-
Tom Stellard authored
Patch by: Mei Ye llvm-svn: 187764
-
- Jul 27, 2013
-
-
Nick Lewycky authored
Adds unit tests for it too. Split BasicBlockUtils into an analysis-half and a transforms-half, and put the analysis bits into a new Analysis/CFG.{h,cpp}. Promote isPotentiallyReachable into llvm::isPotentiallyReachable and move it into Analysis/CFG. llvm-svn: 187283
-
- Jul 04, 2013
-
-
Craig Topper authored
Use SmallVectorImpl::iterator/const_iterator instead of SmallVector to avoid specifying the vector size. llvm-svn: 185606
-
- Jan 15, 2013
-
-
Jakub Staszak authored
llvm-svn: 172489
-
- Jan 02, 2013
-
-
Chandler Carruth authored
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
-
- Dec 03, 2012
-
-
Chandler Carruth authored
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
-
- Oct 19, 2012
-
-
Evgeniy Stepanov authored
llvm-svn: 166278
-
- Oct 08, 2012
-
-
Micah Villmow authored
llvm-svn: 165402
-
- Aug 29, 2012
-
-
Benjamin Kramer authored
This disables malloc-specific optimization when -fno-builtin (or -ffreestanding) is specified. This has been a problem for a long time but became more severe with the recent memory builtin improvements. Since the memory builtin functions are used everywhere, this required passing TLI in many places. This means that functions that now have an optional TLI argument, like RecursivelyDeleteTriviallyDeadFunctions, won't remove dead mallocs anymore if the TLI argument is missing. I've updated most passes to do the right thing. Fixes PR13694 and probably others. llvm-svn: 162841
-
- Jul 27, 2012
-
-
Evan Cheng authored
into predecessor blocks to enable tail call optimization. rdar://11958338 llvm-svn: 160894
-
- Jun 25, 2012
-
-
Eli Bendersky authored
The name (and comment describing) of llvm::GetFirstDebuigLocInBasicBlock no 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
-
- Jan 17, 2012
-
-
David Blaikie authored
llvm-svn: 148284
-
- Dec 09, 2011
-
-
Jakub Staszak authored
llvm-svn: 146277
-
- Aug 24, 2011
-
-
Rafael Espindola authored
dominator information even though dominators were previously computed. Patch by Nick Sumner. llvm-svn: 138449
-
- Aug 20, 2011
-
-
Bill Wendling authored
then don't split it a second time, since that block will be dead. llvm-svn: 138153
-
- Aug 19, 2011
-
-
Bill Wendling authored
SplitLandingPadPredecessors is similar to SplitBlockPredecessors in that it splits the current block and attaches a set of predecessors to the new basic block. However, it differs from SplitBlockPredecessors in that it's specifically designed to handle landing pad blocks. Two new basic blocks are created: one that is has the vector of predecessors as its predecessors and one that has the remaining predecessors as its predecessors. Those two new blocks then receive a cloned copy of the landingpad instruction from the original block. The landingpad instructions are joined in a PHI, etc. Like SplitBlockPredecessors, it updates the LLVM IR, AliasAnalysis, DominatorTree, DominanceFrontier, LoopInfo, and LCCSA analyses. llvm-svn: 138014
-
- Aug 18, 2011
-
-
Bill Wendling authored
function. llvm-svn: 137979
-
Bill Wendling authored
llvm-svn: 137978
-
Bill Wendling authored
llvm-svn: 137959
-
Bill Wendling authored
functionality change. llvm-svn: 137926
-
- Aug 17, 2011
-
-
Bill Wendling authored
llvm-svn: 137872
-
- Jun 23, 2011
-
-
Jay Foad authored
-Wshorten-64-to-32 warning in Instructions.h. llvm-svn: 133708
-
Eric Christopher authored
"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
-
- Jun 21, 2011
-
-
Jay Foad authored
self-hosted build failure has been fixed (r133512). llvm-svn: 133513
-
Chad Rosier authored
llvm-svn: 133499
-
- Jun 20, 2011
-
-
Jay Foad authored
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
-
- May 02, 2011
-
-
Devang Patel authored
Scanning entire basic block may be too expensive in terms of compile time. Instead, just use whatever location info first non-phi instruction has. llvm-svn: 130729
-
- Apr 30, 2011
-
-
Devang Patel authored
llvm-svn: 130551
-
- Mar 30, 2011
-
-
Jay Foad authored
PHINode::Create() giving the (known or expected) number of operands. llvm-svn: 128537
-