- Sep 12, 2011
-
-
Eli Friedman authored
No tests; these changes aren't really interesting in the sense that the logic is the same for volatile and atomic. I believe this completes all of the changes necessary for the optimizer to handle loads and stores correctly. I'm going to try and come up with some additional testing, though. llvm-svn: 139533
-
- Jun 27, 2011
-
-
Jakub Staszak authored
llvm-svn: 133946
-
- May 22, 2011
-
-
Frits van Bommel authored
Add a parameter to ConstantFoldTerminator() that callers can use to ask it to also clean up the condition of any conditional terminator it folds to be unconditional, if that turns the condition into dead code. This just means it calls RecursivelyDeleteTriviallyDeadInstructions() in strategic spots. It defaults to the old behavior. I also changed -simplifycfg, -jump-threading and -codegenprepare to use this to produce slightly better code without any extra cleanup passes (AFAICT this was the only place in -simplifycfg where now-dead conditions of replaced terminators weren't being cleaned up). The only other user of this function is -sccp, but I didn't read that thoroughly enough to figure out whether it might be holding pointers to instructions that could be deleted by this. llvm-svn: 131855
-
- May 05, 2011
-
-
Devang Patel authored
llvm-svn: 130880
-
- Apr 14, 2011
-
-
Owen Anderson authored
Fix an infinite alternation in JumpThreading where two transforms would repeatedly undo each other. The solution is to perform more aggressive constant folding to make one of the edges just folded away rather than trying to thread it. Fixes <rdar://problem/9284786>. Discovered with CSmith. llvm-svn: 129538
-
- Mar 30, 2011
- Feb 18, 2011
-
-
Chris Lattner authored
taken (and used!). This prevents merging the blocks (invalidating the block addresses) in a case like this: #define _THIS_IP_ ({ __label__ __here; __here: (unsigned long)&&__here; }) void foo() { printf("%p\n", _THIS_IP_); printf("%p\n", _THIS_IP_); printf("%p\n", _THIS_IP_); } which fixes PR4151. llvm-svn: 125829
-
- Dec 16, 2010
-
-
Frits van Bommel authored
Fix a bug in the loop in JumpThreading::ProcessThreadableEdges() where it could falsely produce a MultipleDestSentinel value if the first predecessor ended with an 'indirectbr'. If that happened, it caused an unnecessary FindMostPopularDest() call. This wasn't a correctness problem, but it broke the fast path for single-predecessor blocks. llvm-svn: 121966
-
- Dec 15, 2010
-
-
Frits van Bommel authored
Teach jump threading to "look through" a select when the branch direction of a terminator depends on it. When it sees a promising select it now tries to figure out whether the condition of the select is known in any of the predecessors and if so it maps the operands appropriately. llvm-svn: 121859
-
- Dec 13, 2010
-
-
Chris Lattner authored
llvm-svn: 121670
-
- Dec 07, 2010
-
-
Frits van Bommel authored
The last uses of these functions were removed in r113852 when LazyValueInfo was permanently enabled and removed the need for them. llvm-svn: 121133
-
Frits van Bommel authored
Implement jump threading of 'indirectbr' by keeping track of whether we're looking for ConstantInt*s or BlockAddress*s. llvm-svn: 121066
-
- Dec 05, 2010
-
-
Frits van Bommel authored
Should have no functional change other than the order of two transformations that are mutually-exclusive and the exact formatting of debug output. Internally, it now stores the ConstantInt*s as Constant*s, and actual undef values instead of nulls. llvm-svn: 120946
-
Frits van Bommel authored
llvm-svn: 120945
-
- Oct 19, 2010
-
-
Owen Anderson authored
Get rid of static constructors for pass registration. Instead, every pass exposes an initializeMyPassFunction(), which must be called in the pass's constructor. This function uses static dependency declarations to recursively initialize the pass's dependencies. Clients that only create passes through the createFooPass() APIs will require no changes. Clients that want to use the CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h before parsing commandline arguments. I have tested this with all standard configurations of clang and llvm-gcc on Darwin. It is possible that there are problems with the static dependencies that will only be visible with non-standard options. If you encounter any crash in pass registration/creation, please send the testcase to me directly. llvm-svn: 116820
-
- Oct 12, 2010
-
-
Owen Anderson authored
perform initialization without static constructors AND without explicit initialization by the client. For the moment, passes are required to initialize both their (potential) dependencies and any passes they preserve. I hope to be able to relax the latter requirement in the future. llvm-svn: 116334
-
- Oct 08, 2010
-
-
Owen Anderson authored
llvm-svn: 115996
-
- Sep 29, 2010
-
-
Owen Anderson authored
Fix PR8247: JumpThreading can cause a block to become unreachable while still having predecessor, if it is part of a self-loop. Because of this, we cannot use the Simplify* APIs, as they can assert-fail on unreachable code. Since it's not easy to determine if a given threading will cause a block to become unreachable, simply defer simplifying simplification to later InstCombine and/or DCE passes. llvm-svn: 115082
-
- Sep 14, 2010
-
-
Owen Anderson authored
on by default and has received significant testing. llvm-svn: 113852
-
- Sep 05, 2010
-
-
Chris Lattner authored
llvm-svn: 113114
-
Chris Lattner authored
llvm-svn: 113113
-
- Sep 02, 2010
-
-
Duncan Sands authored
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
-
- Sep 01, 2010
-
-
Owen Anderson authored
if we schedule another LVI-using pass afterwards. llvm-svn: 112722
-
Eric Christopher authored
self host errors on clang-x86-64. llvm-svn: 112719
-
Duncan Sands authored
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
-
- Aug 31, 2010
-
-
Owen Anderson authored
More cleanups of my JumpThreading transforms, including extracting some duplicated code into a helper function. llvm-svn: 112634
-
Owen Anderson authored
llvm-svn: 112628
-
Owen Anderson authored
llvm-svn: 112620
-
Owen Anderson authored
More Chris-inspired JumpThreading fixes: use ConstantExpr to correctly constant-fold undef, and be more careful with its return value. This actually exposed an infinite recursion bug in ComputeValueKnownInPredecessors which theoretically already existed (in JumpThreading's handling of and/or of i1's), but never manifested before. This patch adds a tracking set to prevent this case. llvm-svn: 112589
-
Owen Anderson authored
Re-apply r112539, being more careful to respect the return values of the constant folding methods. Additionally, use the ConstantExpr::get*() methods to simplify some constant folding. llvm-svn: 112550
-
Owen Anderson authored
llvm-svn: 112543
-
Owen Anderson authored
Fixes and cleanups pointed out by Chris. In general, be careful to handle 0 results from ComputeValueKnownInPredecessors (indicating undef), and re-use existing constant folding APIs. llvm-svn: 112539
-
- Aug 27, 2010
-
-
Owen Anderson authored
llvm-svn: 112286
-
Owen Anderson authored
Use LVI to eliminate conditional branches where we've tested a related condition previously. Update tests for this change. This fixes PR5652. llvm-svn: 112270
-
- Aug 26, 2010
-
-
Owen Anderson authored
llvm-svn: 112198
-
- Aug 24, 2010
-
-
Owen Anderson authored
llvm-svn: 111923
-
- Aug 23, 2010
-
-
Owen Anderson authored
llvm-svn: 111834
-
Owen Anderson authored
llvm-svn: 111816
-
- Aug 19, 2010
-
-
Owen Anderson authored
llvm-svn: 111551
-