History log of /external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
cd81d94322a39503e4a3e87b6ee03d4fcb3465fb 21-Jul-2014 Stephen Hines <srhines@google.com> Update LLVM for rebase to r212749.

Includes a cherry-pick of:
r212948 - fixes a small issue with atomic calls

Change-Id: Ib97bd980b59f18142a69506400911a6009d9df18
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
dce4a407a24b04eebc6a376f8e62b41aaa7b071f 29-May-2014 Stephen Hines <srhines@google.com> Update LLVM for 3.5 rebase (r209712).

Change-Id: I149556c940fb7dc92d075273c87ff584f400941f
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
36b56886974eae4f9c5ebc96befd3e7bfe5de338 24-Apr-2014 Stephen Hines <srhines@google.com> Update to LLVM 3.5a.

Change-Id: Ifadecab779f128e62e430c2b4f6ddd84953ed617
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
3e033f29239e48c190f29cdf3a02cdfbaf2fe72b 21-Oct-2013 Bill Wendling <isanbard@gmail.com> Don't eliminate a partially redundant load if it's in a landing pad.

A landing pad can be jumped to only by the unwind edge of an invoke
instruction. If we eliminate a partially redundant load in a landing pad, it
will create a basic block that violates this constraint. It then leads to other
problems down the line if it tries to merge that basic block with the landing
pad. Avoid this by not eliminating the load in a landing pad.

PR17621


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193064 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
c11b107f21f8f1baf1021999fc7d01b93e00922b 07-Aug-2013 Benjamin Kramer <benny.kra@googlemail.com> JumpThreading: Turn a select instruction into branching if it allows to thread one half of the select.

This is a common pattern coming out of simplifycfg generating gross code.

a: ; preds = %entry
%sel = select i1 %cmp1, double %add, double 0.000000e+00
br label %b

b:
%cond5 = phi double [ %sel, %a ], [ %sub, %entry ]
%cmp6 = fcmp oeq double %cond5, 0.000000e+00
br i1 %cmp6, label %if.then, label %if.end

becomes

a:
br i1 %cmp1, label %b, label %if.then

b:
%cond5 = phi double [ %sub, %entry ], [ %add, %a ]
%cmp6 = fcmp oeq double %cond5, 0.000000e+00
br i1 %cmp6, label %if.then, label %if.end

Skipping block b completely if possible.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187880 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
81e480463d8bb57776d03cebfd083762909023f1 27-Jul-2013 Nick Lewycky <nicholas@mxc.ca> Reimplement isPotentiallyReachable to make nocapture deduction much stronger.
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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187283 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
0b8c9a80f20772c3793201ab5b251d3520b9cea3 02-Jan-2013 Chandler Carruth <chandlerc@gmail.com> Move all of the header files which are involved in modelling the LLVM IR
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171366 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
67ae13575900e8efd056672987249fd0adbf5e73 20-Dec-2012 James Molloy <james.molloy@arm.com> Add a new attribute, 'noduplicate'. If a function contains a noduplicate call, the call cannot be duplicated - Jump threading, loop unrolling, loop unswitching, and loop rotation are inhibited if they would duplicate the call.

Similarly inlining of the function is inhibited, if that would duplicate the call (in particular inlining is still allowed when there is only one callsite and the function has internal linkage).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170704 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
c69908695af9cf509bf498a492854db5f0556e0f 03-Dec-2012 Nadav Rotem <nrotem@apple.com> Teach the jump threading optimization to stop scanning the basic block when calculating the cost after passing the threshold.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169135 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
d04a8d4b33ff316ca4cf961e06c9e312eff8e64f 03-Dec-2012 Chandler Carruth <chandlerc@gmail.com> Use the new script to sort the includes of every file under lib.

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. =]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169131 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
3574eca1b02600bac4e625297f4ecf745f4c4f32 08-Oct-2012 Micah Villmow <villmow@gmail.com> Move TargetData to DataLayout.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165402 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
8e0d1c03ca7fd86e6879b4e37d0d7f0e982feef6 29-Aug-2012 Benjamin Kramer <benny.kra@googlemail.com> Make MemoryBuiltins aware of TargetLibraryInfo.

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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162841 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
a94d6e87c4c49f2e81b01d66d8bfb591277f8f96 24-Jul-2012 Nadav Rotem <nadav.rotem@intel.com> Clean whitespaces.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160668 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
dd2fb6c10b30e70ab8f910e21e583be3e90bb88c 20-Jul-2012 Richard Osborne <richard@xmos.com> Fix assertion in jump threading (PR13405).

GetBestDestForJumpOnUndef() assumes there is at least 1 successor, which isn't
true if the block ends in an indirect branch with no successors. Fix this by
bailing out earlier in this case.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160546 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
5161de6ebbd36b0532bd980483d757f5a3014611 13-Mar-2012 Chris Lattner <sabre@nondot.org> enhance jump threading to preserve TBAA information when PRE'ing loads,
fixing rdar://11039258, an issue that came up when inspecting clang's
bootstrapped codegen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152635 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
c10fa6c801e48771b5eade50afc2fe6abaf08227 08-Mar-2012 Stepan Dyatkovskiy <stpworld@narod.ru> Taken into account Duncan's comments for r149481 dated by 2nd Feb 2012:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20120130/136146.html

Implemented CaseIterator and it solves almost all described issues: we don't need to mix operand/case/successor indexing anymore. Base iterator class is implemented as a template since it may be initialized either from "const SwitchInst*" or from "SwitchInst*".

ConstCaseIt is just a read-only iterator.
CaseIt is read-write iterator; it allows to change case successor and case value.

Usage of iterator allows totally remove resolveXXXX methods. All indexing convertions done automatically inside the iterator's getters.

Main way of iterator usage looks like this:
SwitchInst *SI = ... // intialize it somehow

for (SwitchInst::CaseIt i = SI->caseBegin(), e = SI->caseEnd(); i != e; ++i) {
BasicBlock *BB = i.getCaseSuccessor();
ConstantInt *V = i.getCaseValue();
// Do something.
}

If you want to convert case number to TerminatorInst successor index, just use getSuccessorIndex iterator's method.
If you want initialize iterator from TerminatorInst successor index, use CaseIt::fromSuccessorIndex(...) method.

There are also related changes in llvm-clients: klee and clang.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152297 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
24473120a253a05f3601cd3373403b47e6d03d41 01-Feb-2012 Stepan Dyatkovskiy <stpworld@narod.ru> SwitchInst refactoring.
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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149481 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
2fac1d5d61a83c45dcf44119c41dce15ef10e9dc 09-Dec-2011 Jakub Staszak <kubastaszak@gmail.com> SplitBlockPredecessors uses ArrayRef instead of Data and Size.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146277 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
aab8e28d5e470711d80276bbf717408c3ab966fd 02-Dec-2011 Chad Rosier <mcrosier@apple.com> Fix a few more places where TargetData/TargetLibraryInfo is not being passed.
Add FIXMEs to places that are non-trivial to fix.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145661 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
2bc3d52b9ab422ee9f7e42a1a4e3b818e623a5f7 12-Sep-2011 Eli Friedman <eli.friedman@gmail.com> Change a bunch of isVolatile() checks to check for atomic load/store as well.

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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139533 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
f227b50a8e30598464c244a675d8e857b62a52ac 27-Jun-2011 Jakub Staszak <jstaszak@apple.com> Calculate GetBestDestForJumpOnUndef correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133946 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
5649ba70fb39f2fda4791d255ae8bb373071874f 22-May-2011 Frits van Bommel <fvbommel@gmail.com> 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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131855 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
95a7de6b916e49265ebdae04a32f6beda7f89028 05-May-2011 Devang Patel <dpatel@apple.com> Preserve line number information while threading jumps.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130880 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
f6832bbda08b6975caa264de183bf3ee1d472aca 14-Apr-2011 Owen Anderson <resistor@mac.com> 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129538 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
3ecfc861b4365f341c5c969b40e1afccde676e6f 30-Mar-2011 Jay Foad <jay.foad@gmail.com> Remove PHINode::reserveOperandSpace(). Instead, add a parameter to
PHINode::Create() giving the (known or expected) number of operands.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128537 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
d8b4fb4aab4d6fedb2b14bed1b846451b17bde7c 30-Mar-2011 Jay Foad <jay.foad@gmail.com> (Almost) always call reserveOperandSpace() on newly created PHINodes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128535 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
78f7a25f9826ba66610b5bca83ebea71793abf59 18-Feb-2011 Chris Lattner <sabre@nondot.org> prevent jump threading from merging blocks when their address is
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.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125829 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
01abcf339f8d42921c680fefb2ff988cfeee1198 16-Dec-2010 Frits van Bommel <fvbommel@gmail.com> 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121966 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
26e097ca4bdb31000655ff9ec39fe7d9b7ea226d 15-Dec-2010 Frits van Bommel <fvbommel@gmail.com> 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121859 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
e991b5fdd5ab583531300097cf35e1087d479ef0 13-Dec-2010 Chris Lattner <sabre@nondot.org> simplify code and reduce indentation


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121670 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
8e8cdc8fe03db3eb4bed463281d30a053b8770cc 07-Dec-2010 Frits van Bommel <fvbommel@gmail.com> Remove some dead code from the jump threading pass.

The last uses of these functions were removed in r113852 when LazyValueInfo was permanently enabled and removed the need for them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121133 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
6033b346e20d6932cc62c754cf23ae51786724d6 07-Dec-2010 Frits van Bommel <fvbommel@gmail.com> Implement jump threading of 'indirectbr' by keeping track of whether we're looking for ConstantInt*s or BlockAddress*s.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121066 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
ea388f217b8368db13f598e4c547bab5582eb82a 05-Dec-2010 Frits van Bommel <fvbommel@gmail.com> Refactor jump threading.
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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120946 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
6f9a8307e087110d57b1e63dae154d351f6b0f6b 05-Dec-2010 Frits van Bommel <fvbommel@gmail.com> Remove trailing whitespace.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120945 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
081c34b725980f995be9080eaec24cd3dfaaf065 19-Oct-2010 Owen Anderson <resistor@mac.com> 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116820 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
2ab36d350293c77fc8941ce1023e4899df7e3a82 12-Oct-2010 Owen Anderson <resistor@mac.com> Begin adding static dependence information to passes, which will allow us to
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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116334 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
ce665bd2e2b581ab0858d1afe359192bac96b868 08-Oct-2010 Owen Anderson <resistor@mac.com> Now with fewer extraneous semicolons!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115996 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
36c4debc94e7c68c769dfda781851a0c963dd746 29-Sep-2010 Owen Anderson <resistor@mac.com> 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115082 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
c809d90bca41a5578012959ea2e493f9d949f969 14-Sep-2010 Owen Anderson <resistor@mac.com> Remove the option to disable LazyValueInfo in JumpThreading, as it is now
on by default and has received significant testing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113852 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
bdabacdccae980b82b5d92e10697b8aeb3b94cfa 05-Sep-2010 Chris Lattner <sabre@nondot.org> Change lower atomic pass to use IntrinsicInst to simplify it a bit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113114 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
906a675db8af7bacdd78708453fc7f7558e64033 05-Sep-2010 Chris Lattner <sabre@nondot.org> eliminate some non-obvious casts. UndefValue isa Constant.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113113 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
fc6e29d4ab52b7d3efd83846ed495a9ca7e51e49 02-Sep-2010 Duncan Sands <baldrick@free.fr> Reapply commit 112699, speculatively reverted by echristo, since
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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112810 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
9bfa6fec068abb8bea4da03e5c9c39765f963ef2 01-Sep-2010 Owen Anderson <resistor@mac.com> JumpThreading keeps LazyValueInfo up to date, so we don't need to rerun it
if we schedule another LVI-using pass afterwards.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112722 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
adc581f5cb6bdb929b1c6a155c330151ebd3bf72 01-Sep-2010 Eric Christopher <echristo@apple.com> Speculatively revert 112699 and 112702, they seem to be causing
self host errors on clang-x86-64.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112719 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
4d588bceb035589ade874f432d70a41bb7ec6273 01-Sep-2010 Duncan Sands <baldrick@free.fr> 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112699 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
0eb355ab6be61ebd7adb407e02a3604be032b99e 31-Aug-2010 Owen Anderson <resistor@mac.com> More cleanups of my JumpThreading transforms, including extracting some duplicated code into a helper function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112634 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
9ba353627a11349b1da7b596fe44e73cd5fe7a48 31-Aug-2010 Owen Anderson <resistor@mac.com> Add an RAII helper to make cleanup of the RecursionSet more fool-proof.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112628 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
c1bdac66fff1e65aba02ec853cc0693dcc967f33 31-Aug-2010 Owen Anderson <resistor@mac.com> Refactor my fix for PR5652 to terminate the predecessor lookups after the first failure.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112620 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
cb21190cbd8ae1aece5b833ebe3814ada4260627 31-Aug-2010 Owen Anderson <resistor@mac.com> 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112589 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
327ca7bec274e25c05a0a4ae5b51a8a2062012c7 31-Aug-2010 Owen Anderson <resistor@mac.com> 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112550 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
d930f205db1d5982cea5abbdc515c49793cadcc6 31-Aug-2010 Owen Anderson <resistor@mac.com> Revert r112539. It accidentally introduced a miscompilation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112543 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
1e35610f20ba04daf3aa3048219914421b9931af 31-Aug-2010 Owen Anderson <resistor@mac.com> 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.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112539 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
fc2fb17fb764470626f3d7ecf2fb68fe73b0d757 27-Aug-2010 Owen Anderson <resistor@mac.com> Fix typos in comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112286 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
660cab32fe5105bcaa17daa4704c24065ac0a7e6 27-Aug-2010 Owen Anderson <resistor@mac.com> Use LVI to eliminate conditional branches where we've tested a related condition previously. Update tests for this change.
This fixes PR5652.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112270 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
62efd3b38576536cf06ed5bf2f39535eb7961e99 26-Aug-2010 Owen Anderson <resistor@mac.com> Make JumpThreading smart enough to properly thread StrSwitch when it's compiled with clang++.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112198 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
53c36c41ae036047867960f31a7a116d473e1f9f 24-Aug-2010 Owen Anderson <resistor@mac.com> Turn LVI on, previously detected failures should be fixed now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111923 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
b6ad691ad73f2c11d184db39821462dc67bdc799 23-Aug-2010 Owen Anderson <resistor@mac.com> Turn LVI back off, I have a testcase now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111834 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
0e2c359a3e57e934d93298f1c666241ed0d481ee 23-Aug-2010 Owen Anderson <resistor@mac.com> Re-enable LazyValueInfo. Monitoring for failures.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111816 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
684d8d5b5003402241235917bfcf67d60f70c2c7 19-Aug-2010 Owen Anderson <resistor@mac.com> Disable LVI while I evaluate a failure.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111551 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
f2d197b77a34c35bfe25de0c098a34068cc4d85c 19-Aug-2010 Owen Anderson <resistor@mac.com> Tentatively enabled LVI by default. I'll be monitoring for any failures.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111543 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
00ac77ef886f57bd421341d717849695e5fde474 18-Aug-2010 Owen Anderson <resistor@mac.com> Inform LazyValueInfo whenever a block is deleted, to avoid dangling pointer issues.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111382 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
2fa7b48eb594db245dc6af6060c92bbd2b19546b 18-Aug-2010 Chris Lattner <sabre@nondot.org> Fix PR7755: knowing something about an inval for a pred
from the LHS should disable reconsidering that pred on the
RHS. However, knowing something about the pred on the RHS
shouldn't disable subsequent additions on the RHS from
happening.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111349 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
90c579de5a383cee278acc3f7e7b9d0a656e6a35 06-Aug-2010 Owen Anderson <resistor@mac.com> Reapply r110396, with fixes to appease the Linux buildbot gods.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110460 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
1f74590e9d1b9cf0f1f81a156efea73f76546e05 06-Aug-2010 Owen Anderson <resistor@mac.com> Revert r110396 to fix buildbots.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110410 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
9ccaf53ada99c63737547c0235baeb8454b04e80 06-Aug-2010 Owen Anderson <resistor@mac.com> Don't use PassInfo* as a type identifier for passes. Instead, use the address of the static
ID member as the sole unique type identifier. Clean up APIs related to this change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110396 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
f35b08db501557b1d41628291811c77c2bc163fb 06-Aug-2010 Owen Anderson <resistor@mac.com> Give JumpThreading+LVI a long-form cl::opt so that it's easier to toggle the default.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110384 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
cfa7fb6df5aaaf9e54fe97633167b44782224e45 26-Jul-2010 Owen Anderson <resistor@mac.com> Add an initial implementation of LazyValueInfo updating for JumpThreading. Disabled for now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109424 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
d13db2c59cc94162d6cf0a04187d408bfef6d4a7 22-Jul-2010 Owen Anderson <resistor@mac.com> Fix batch of converting RegisterPass<> to INTIALIZE_PASS().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109045 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
ee1f44fba3f2ba01657f217d159b4d09f249e46d 12-Jul-2010 Gabor Greif <ggreif@gmail.com> cache results of operator*

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108142 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
0a96144aac449114330a5264b649eb449dc19a37 12-Jul-2010 Chris Lattner <sabre@nondot.org> if jump threading is able to infer interesting values on both
the LHS and RHS of an and/or instruction, don't multiply add
known predecessor values. This fixes the crash on testcase
from PR7498


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108114 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
e58867e55e472d81bbf5b1d26310a5b3918d2fb6 14-Jun-2010 Chris Lattner <sabre@nondot.org> jump threading can't split a critical edge from an indirectbr. This
fixes PR7356.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105950 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
dd9344f3face8f1978a7f9f393c31b628144d1f6 28-May-2010 Dan Gohman <gohman@apple.com> Move FindAvailableLoadedValue isSafeToLoadUnconditionally out of
lib/Transforms/Utils and into lib/Analysis so that Analysis passes
can use them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104949 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
6f285d21053552e5aff9aba74f0425505d6ab61a 10-Apr-2010 Chris Lattner <sabre@nondot.org> fix PR6743, a case where we'd delete an instruction before using it
in some cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100937 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
1df9859c40492511b8aa4321eb76496005d3b75b 16-Feb-2010 Duncan Sands <baldrick@free.fr> There are two ways of checking for a given type, for example isa<PointerType>(T)
and T->isPointerTy(). Convert most instances of the first form to the second form.
Requested by Chris.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96344 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
b0bc6c361da9009e8414efde317d9bbff755f6c0 15-Feb-2010 Duncan Sands <baldrick@free.fr> Uniformize the names of type predicates: rather than having isFloatTy and
isInteger, we now have isFloatTy and isIntegerTy. Requested by Chris!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96223 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
1e452650c6044735b6aa922d41736bda5721adcc 11-Feb-2010 Chris Lattner <sabre@nondot.org> Make jump threading honor x|undef -> true and x&undef -> false,
instead of considering x|undef -> x, which may not be true.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95850 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
d668839cb9b5db6865fd98e5e7dfccd64abf3e95 23-Jan-2010 Chris Lattner <sabre@nondot.org> third bug from PR6119: the xor dupe extension allows
for arbitrary terminators in predecessors, don't assume
it is a conditional or uncond branch. The testcase shows
an example where they can happen with switches.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94323 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
2dd7657a5b063e6f77c34f418b7e23654b6fe4a0 23-Jan-2010 Chris Lattner <sabre@nondot.org> add an early out to ProcessBranchOnXOR to speed it up,
handle the case when we can infer an input to the xor
from all inputs that agree, instead of going into an
infinite loop. Another part of PR6199


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94321 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
8231fd1e6ca940511843381ea5f0dbfbc740b1e6 23-Jan-2010 Chris Lattner <sabre@nondot.org> fix a crash in jump threading, PR6119


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94319 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
972a46c96a06ecb0e8ce73c796c313175abe76bb 12-Jan-2010 Chris Lattner <sabre@nondot.org> 1) Use the new SimplifyInstructionsInBlock routine instead of the copy
in JT.

2) When cloning blocks for PHI or xor conditions, use
instsimplify to simplify the code as we go. This allows us to
squish common cases early in JT which opens up opportunities for
subsequent iterations, and allows it to completely simplify the
testcase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93253 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
797c440caf24e92b16b9a87a39ef2f5c4cfb60f0 12-Jan-2010 Chris Lattner <sabre@nondot.org> tidy up


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93222 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
2249a0b1bd0941e61c0b87f2f64a5c8cab45f14c 12-Jan-2010 Chris Lattner <sabre@nondot.org> Teach jump threading to duplicate small blocks when the branch
condition is a xor with a phi node. This eliminates nonsense
like this from 176.gcc in several places:

LBB166_84:
testl %eax, %eax
- setne %al
- xorb %cl, %al
- notb %al
- testb $1, %al
- je LBB166_85
+ je LBB166_69
+ jmp LBB166_85

This is rdar://7391699



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93221 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
77beb479f556093c5f1b4854fcbb095cda34f202 12-Jan-2010 Chris Lattner <sabre@nondot.org> some cleanup, and make it obvious that ProcessJumpOnPHI only works
on branches by renaming it and checking for a branch at the call site.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93208 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
66b581ef4965ca3a6c72450ee9916a5c2ab44461 07-Jan-2010 Benjamin Kramer <benny.kra@googlemail.com> Use a do-while loop instead of while + boolean.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92912 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
fe7fe6603fea2ca121282cd329f5300ea7d9fd51 05-Jan-2010 David Greene <greened@obbligato.org> Change errs() to dbgs().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92614 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
5660846f15847e540066ae320a4adef7357d597d 28-Dec-2009 Chris Lattner <sabre@nondot.org> Metadata.h doesn't need to include ValueHandle.h anymore.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92211 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
08bc2701a22cae61d202c0960a390d8410434e5c 06-Dec-2009 Chris Lattner <sabre@nondot.org> fix PR5698


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90708 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
46875c0bfb77880ba4120eeed7caca7f1f7c1f69 01-Dec-2009 Chris Lattner <sabre@nondot.org> fix PR5640 by tracking whether a block is the header of a loop more
precisely, which prevents us from infinitely peeling the loop.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90211 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
4e447ebc5897a466c37bd2e9f5514d3fc5135789 15-Nov-2009 Chris Lattner <sabre@nondot.org> make PRE of loads preserve the alignment of the moved load instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88865 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
1fb5630474d261eca0b4de9c79279b9c9e42a444 15-Nov-2009 Chris Lattner <sabre@nondot.org> fix a bug handling 'not x' when x is undef.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88864 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
66c04c48debfd4357beaf9310346b2b24046b685 12-Nov-2009 Chris Lattner <sabre@nondot.org> use getPredicateOnEdge to fold comparisons through PHI nodes,
which implements GCC PR18046. This also gets us 360 more
jump threads on 176.gcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86953 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
f496e79f44f13ac80564f5f8e69aa648033e7889 12-Nov-2009 Chris Lattner <sabre@nondot.org> various fixes to the lattice transfer functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86952 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
0e0ff29271df58e3bc545e40f5432c436e8bd76b 12-Nov-2009 Chris Lattner <sabre@nondot.org> switch jump threading to use getPredicateOnEdge in one place
making the new LVI stuff smart enough to subsume some special
cases in the old code. Disable them when LVI is around, the
testcase still passes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86951 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
87e9f59c7a823ba86d8aafa4e15ac03e6db244c3 12-Nov-2009 Chris Lattner <sabre@nondot.org> with the new code we can thread non-instruction values. This
allows us to handle the test10 testcase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86924 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
1c96b4187be7589492dccf33e9fe7679ac61023d 12-Nov-2009 Chris Lattner <sabre@nondot.org> this argument can be an arbitrary value, it doesn't need to be an instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86923 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
38392bbeb81233d0b342ad33166fc82ad922bc34 12-Nov-2009 Chris Lattner <sabre@nondot.org> expose edge information and switch j-t to use it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86920 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
2ad00bf99d5738c39dbc8cab7e30a0b55e0714ad 11-Nov-2009 Chris Lattner <sabre@nondot.org> pass TD into a SimplifyCmpInst call. Add another case that
uses LVI info when -enable-jump-threading-lvi is passed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86886 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
cc4d3b25f336eef135cb7125716ecb2c1979e92e 11-Nov-2009 Chris Lattner <sabre@nondot.org> stub out some LazyValueInfo interfaces, and have JumpThreading
start using them in a trivial way when -enable-jump-threading-lvi
is passed. enable-jump-threading-lvi will be my playground for
awhile.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86789 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
b14b88a40ab12996c2982c4bc10fd35bb9a371d4 11-Nov-2009 Chris Lattner <sabre@nondot.org> add a fixme


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86766 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
055d046f483af3c66f4d19a32a17fc63ed2c22d5 10-Nov-2009 Chris Lattner <sabre@nondot.org> implement a TODO by teaching jump threading about "xor x, 1".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86739 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
40d8c28b27377199b7465ba2c5a2c59c6fd12fa9 10-Nov-2009 Chris Lattner <sabre@nondot.org> move some generally useful functions out of jump threading
into libanalysis and transformutils.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86735 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
6f84a5feee5c7322a5145992bd4704225987909c 10-Nov-2009 Chris Lattner <sabre@nondot.org> improve comment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86723 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
f3183f6da6321c6496daa107ea5d6d48b99d9330 10-Nov-2009 Chris Lattner <sabre@nondot.org> Make jump threading eliminate blocks that just contain phi nodes,
debug intrinsics, and an unconditional branch when possible. This
reuses the TryToSimplifyUncondBranchFromEmptyBlock function split
out of simplifycfg.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86722 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
fddcf47a249fe3a1102257deddc996ee327a85cb 10-Nov-2009 Chris Lattner <sabre@nondot.org> make jump threading recursively simplify expressions instead of doing it
just one level deep. On the testcase we go from getting this:

F1: ; preds = %T2
%F = and i1 true, %cond ; <i1> [#uses=1]
br i1 %F, label %X, label %Y

to a fully threaded:

F1: ; preds = %T2
br label %Y


This changes gets us to the point where we're forming (too many) switch
instructions on doug's strswitch testcase.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86646 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
e7c90967b17286b0e8fe21fcbfb9cf898b6e7a96 10-Nov-2009 Chris Lattner <sabre@nondot.org> don't invalidate PN, rewrite of this code is in progress anyway.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86639 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
e34537856a544c83513e390ac9552a8bc3823346 10-Nov-2009 Chris Lattner <sabre@nondot.org> add a new SimplifyInstruction API, which is like ConstantFoldInstruction,
except that the result may not be a constant. Switch jump threading to
use it so that it gets things like (X & 0) -> 0, which occur when phi preds
are deleted and the remaining phi pred was a zero.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86637 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
9dbb42944c4d7caddab21016b24cca31019a3faf 10-Nov-2009 Chris Lattner <sabre@nondot.org> rename SimplifyCompare -> SimplifyCmpInst and split it into
Simplify[IF]Cmp pieces. Add some predicates to CmpInst to
determine whether a predicate is fp or int.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86624 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
9819ef7742cc2e3af92a0b760fa33e30218ff7bb 10-Nov-2009 Chris Lattner <sabre@nondot.org> use instructionsimplify instead of a weak clone of ad-hoc folding stuff.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86616 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
c2c23d03df415d064c7789349cd82e438f9d44bb 09-Nov-2009 Chris Lattner <sabre@nondot.org> stub out a new form of BasicBlock::RemovePredecessorAndSimplify which
simplifies instruction users of PHIs when the phi is eliminated. This
will be moved to transforms/utils after some other refactoring.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86603 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
e7e63fe9650fc01043c96e2bf8a1ecc19e49c5b7 09-Nov-2009 Chris Lattner <sabre@nondot.org> comment typos pointed out by Duncan


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86497 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
5729d38c81bc2e3b21a2bb7a80a8cde384fc7b7b 07-Nov-2009 Chris Lattner <sabre@nondot.org> reapply 86289, 86278, 86270, 86267, 86266 & 86264 plus a fix
(making pred factoring only happen if threading is guaranteed
to be successful).

This now survives an X86-64 bootstrap of llvm-gcc.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86355 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
12d53dba36905d20b02cf7c4cdae057ae4a5a5e1 07-Nov-2009 Devang Patel <dpatel@apple.com> Revert following patches to fix llvmgcc bootstrap.
86289, 86278, 86270, 86267, 86266 & 86264
Chris, please take a look.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86321 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
9beab3fe6fa87034c156415f861c9c42d26b847a 07-Nov-2009 Jeffrey Yasskin <jyasskin@google.com> Avoid "ambiguous 'else'" warning from gcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86314 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
79f0332c203b33c4afc0fb6ad946fbe041164e6e 07-Nov-2009 Chris Lattner <sabre@nondot.org> Fix a bug where we'd call SplitBlockPredecessors with a pred in the
set only once even if it has multiple edges to BB.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86299 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
50591ab1ea2e8d483fca5c6984f47edd6e726f10 06-Nov-2009 Eli Friedman <eli.friedman@gmail.com> Remove function left over from other jump threading cleanup.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86289 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
82114b98c9da043d97a39a07255518dbc00ba522 06-Nov-2009 Chris Lattner <sabre@nondot.org> Fix a problem discovered on self host.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86278 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
90b924737750732fca2bd033b1315fd81891a14b 06-Nov-2009 Chris Lattner <sabre@nondot.org> remove more code subsumed by r86264


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86270 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
f7807f6b9e9a215f365ce98a4c252aced4f651fb 06-Nov-2009 Chris Lattner <sabre@nondot.org> eliminate some more code subsumed by r86264


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86267 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
90926ab827a534ac3ccaebd049372d30873aa821 06-Nov-2009 Chris Lattner <sabre@nondot.org> remove now redundant code, r86264 handles this case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86266 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
785672534d32d196d04ad022c111fde3864e0d28 06-Nov-2009 Chris Lattner <sabre@nondot.org> Extend jump threading to support much more general threading
predicates. This allows us to jump thread things like:

_ZN12StringSwitchI5ColorE4CaseILj7EEERS1_RAT__KcRKS0_.exit119:
%tmp1.i24166 = phi i8 [ 1, %bb5.i117 ], [ %tmp1.i24165, %_Z....exit ], [ %tmp1.i24165, %bb4.i114 ]
%toBoolnot.i87 = icmp eq i8 %tmp1.i24166, 0 ; <i1> [#uses=1]
%tmp4.i90 = icmp eq i32 %tmp2.i, 6 ; <i1> [#uses=1]
%or.cond173 = and i1 %toBoolnot.i87, %tmp4.i90 ; <i1> [#uses=1]
br i1 %or.cond173, label %bb4.i96, label %_ZN12...

Where it is "obvious" that when coming from %bb5.i117 that the 'and' is always
false. This triggers a surprisingly high number of times in the testsuite,
and gets us closer to generating good code for doug's strswitch testcase.

This also make a bunch of other code in jump threading redundant, I'll rip
out in the next patch. This survived an enable-checking llvm-gcc bootstrap.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86264 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
7b550ccfc5a3346c17e0390a59e2d6d19bc52705 06-Nov-2009 Chris Lattner <sabre@nondot.org> remove a bunch of extraneous LLVMContext arguments
from various APIs, addressing PR5325.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86231 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
40dd12e7080c5df253fd70b468368e3144a43c0c 05-Nov-2009 Chris Lattner <sabre@nondot.org> improve DSE when TargetData is not around, based on work by
Hans Wennborg!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86067 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
5a06cf644f35b873686c8694968192ad3385e36a 11-Oct-2009 Chris Lattner <sabre@nondot.org> when folding duplicate conditions, delete the
now-probably-dead instruction tree feeding it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83778 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
78c552ef309eb8c47d12aac2c0b3af7849c27ce9 11-Oct-2009 Chris Lattner <sabre@nondot.org> implement a transformation in jump threading that is currently
done by condprop, but do it in a much more general form. The
basic idea is that we can do a limited form of tail duplication
in the case when we have a branch on a phi. Moving the branch
up in to the predecessor block makes instruction selection
much easier and encourages chained jump threadings.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83759 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
6b65f47ad5d4da8bab31802a2c3df88379f0c9d9 11-Oct-2009 Chris Lattner <sabre@nondot.org> restructure some code, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83756 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
bdbf1a177de085927c375efa986c52af2057fb7a 11-Oct-2009 Chris Lattner <sabre@nondot.org> factor some code better and move a function, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83755 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
e33583b7c2b4d715a24e4d668bf446af9c836e54 11-Oct-2009 Chris Lattner <sabre@nondot.org> make jump threading on a phi with undef inputs happen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83754 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
433a0dbb262b16b42d75715a4dad618a475ba91b 10-Oct-2009 Chris Lattner <sabre@nondot.org> Change jump threading to use the new SSAUpdater class instead of
DemoteRegToStack. This makes it more efficient (because it isn't
creating a ton of load/stores that are eventually removed by a later
mem2reg), and more slightly more effective (because those load/stores
don't get in the way of threading).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83706 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
6776064d190701c5bae4d5403939eed2e480d1cd 27-Sep-2009 Nick Lewycky <nicholas@mxc.ca> Instruction::clone does not need to take an LLVMContext&. Remove that and
update all the callers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82889 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
3e8b6631e67e01e4960a7ba4668a50c596607473 02-Sep-2009 Chris Lattner <sabre@nondot.org> eliminate VISIBILITY_HIDDEN from Transforms/Scalar. PR4861


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80766 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
1d0be15f89cb5056e20e2d24faa8d6afb1573bca 13-Aug-2009 Owen Anderson <resistor@mac.com> Push LLVMContexts through the IntegerType APIs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78948 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
5defacc6e605f4651c6300237cef8e9bb2eb6d0e 31-Jul-2009 Owen Anderson <resistor@mac.com> Move getTrue() and getFalse() to 2.5-like APIs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77685 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
9e9a0d5fc26878e51a58a8b57900fcbf952c2691 31-Jul-2009 Owen Anderson <resistor@mac.com> Move more code back to 2.5 APIs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77635 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
baf3c404409d5e47b13984a7f95bfbd6d1f2e79e 29-Jul-2009 Owen Anderson <resistor@mac.com> Move ConstantExpr to 2.5 API.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77494 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
460f656475738d1a95a6be95346908ce1597df25 26-Jul-2009 Daniel Dunbar <daniel@zuster.org> Remove Value::getName{Start,End}, the last of the old Name APIs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77152 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
93b67e40de356569493c285b86b138a3f11b5035 26-Jul-2009 Daniel Dunbar <daniel@zuster.org> Eliminate some uses of DOUT, cerr, and getNameStart().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77145 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
eed707b1e6097aac2bb6b3d47271f6300ace7f2e 25-Jul-2009 Owen Anderson <resistor@mac.com> Revert the ConstantInt constructors back to their 2.5 forms where possible, thanks to contexts-on-types. More to come.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77011 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
02a436c48ecff9e34d50ce0a2f861e5acdd9bf3f 24-Jul-2009 Dan Gohman <gohman@apple.com> Convert several more passes to use getAnalysisIfAvailable<TargetData>()
instead of getAnalysis<TargetData>().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76982 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
e922c0201916e0b980ab3cfe91e1413e68d55647 22-Jul-2009 Owen Anderson <resistor@mac.com> Get rid of the Pass+Context magic.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76702 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
b3056faa5554ded7ac1ac5865d10ef5839fb77d3 21-Jul-2009 Owen Anderson <resistor@mac.com> Rename getConstantInt{True|False} to get{True|False} at Chris' behest.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76598 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
50dead06ffc107edb7e84857baaeeb09039c631c 16-Jul-2009 Owen Anderson <resistor@mac.com> Revert yesterday's change by removing the LLVMContext parameter to AllocaInst and MallocInst.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75863 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
9adc0abad3c3ed40a268ccbcee0c74cb9e1359fe 15-Jul-2009 Owen Anderson <resistor@mac.com> Move EVER MORE stuff over to LLVMContext.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75703 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
333c40096561218bc3597cf153c0a3895274414c 10-Jul-2009 Owen Anderson <resistor@mac.com> This started as a small change, I swear. Unfortunately, lots of things call the [I|F]CmpInst constructors. Who knew!?


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75200 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
07cf79ef537caff6d39145f190a28a336e629b6f 07-Jul-2009 Owen Anderson <resistor@mac.com> "LLVMContext* " --> "LLVMContext *"


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74878 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
508955156a25a9abc470a29e1760aa176d341cf9 06-Jul-2009 Owen Anderson <resistor@mac.com> Thread LLVMContext through the constant folding APIs, which touches a lot of files.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74844 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
1ff50b380e6f5549f5ddd9e6c390dcb00332e3e9 03-Jul-2009 Owen Anderson <resistor@mac.com> Second batch of passes using LLVMContext.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74753 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
62c762f329cb16783f19b075bb2fefe35b5d5879 02-Jul-2009 Chris Lattner <sabre@nondot.org> fix inverted logic pointed out by John McCall, noticed by inspection.

This was considering vector intrinsics to have cost 2, but non-vector
intrinsics to have cost 1, which is backward.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74698 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
f530c92cd55f35f64904e42e38b3a2bc92b347cb 02-Jul-2009 Dan Gohman <gohman@apple.com> Fix a bunch of other places that used operator[] to test whether
a key is present in a std::map or DenseMap to use find instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74676 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
79c740ff479dde322aceafe15887b162c19ea195 19-Jun-2009 Chris Lattner <sabre@nondot.org> make jump threading handle lexically identical compare instructions
as if they were multiple uses of the same instruction. This interacts
well with the existing loadpre that j-t does to open up many new jump
threads earlier.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73768 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
9683f181746c2312c8828c79b6e25a07fb441d57 19-Jun-2009 Nick Lewycky <nicholas@mxc.ca> Teach jump threading to look at comparisons between phi nodes and non-constants.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73755 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
fe095f39e7009c51d1c86769792ccbcad8cdd2ec 04-May-2009 Mike Stump <mrs@apple.com> Restore minor deletion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70892 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
6b233395025069f63156ea2b524cdb708a14731f 17-Mar-2009 Dale Johannesen <dalej@apple.com> Fix a debug info dependency in jump threading.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67064 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
0070ce511eb68f42a43266375ae679180dd2b94b 06-Mar-2009 Chris Lattner <sabre@nondot.org> this wasn't intended to go in.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66252 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
cc14d25dd99e891c586bd56aa41796abbe4ac3d8 06-Mar-2009 Chris Lattner <sabre@nondot.org> Change various llvm utilities to use PrettyStackTraceProgram in
their main routines. This makes the tools print their argc/argv
commands if they crash.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66248 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
2c7ed11d93239dacf81540e2307f0db456bb9122 19-Jan-2009 Chris Lattner <sabre@nondot.org> Fix PR3353, infinitely jump threading an infinite loop make from switches.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62529 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
2a99b482a62e3f1ac3fd716fba430ac32fedade4 09-Jan-2009 Chris Lattner <sabre@nondot.org> Fix PR3298, a crash in Jump Threading. Apparently even
jump threading can have bugs, who knew? ;-)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61983 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
20fa76ef6f7c2d3073e0960cf347af8db64708fc 08-Dec-2008 Chris Lattner <sabre@nondot.org> remove DebugIterations option. Despite the accusations,
jump threading has been shown to only expose problems not
have bugs itself. I'm sure it's completely bug free! ;-)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60725 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
3cda3cdab118fd2b185b3e6e05e2b19a4a70c1ad 04-Dec-2008 Chris Lattner <sabre@nondot.org> Start simplifying a switch that has a successor that is a switch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60534 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
77ee977fcfc29bdcec2d704eabe3464317e1db94 04-Dec-2008 Chris Lattner <sabre@nondot.org> add a debugging option to help track down j-t problems.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60514 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
421fa9e32e445c972df4a981c60fbec4e21ac187 03-Dec-2008 Chris Lattner <sabre@nondot.org> Teach jump threading some more simple tricks:

1) have it fold "br undef", which does occur with
surprising frequency as jump threading iterates.
2) teach j-t to delete dead blocks. This removes the successor
edges, reducing the in-edges of other blocks, allowing
recursive simplification.
3) Fold things like:
br COND, BBX, BBY
BBX:
br COND, BBZ, BBW

which also happens because jump threading iterates.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60470 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
a3522000ab9c821f48856d0c25ada8297c1c2914 01-Dec-2008 Chris Lattner <sabre@nondot.org> switch a couple more calls to use array_pod_sort.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60337 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
ef0c6744d5050ad724e1ae90e6ac2b932ce01e13 01-Dec-2008 Chris Lattner <sabre@nondot.org> Teach jump threading to clean up after itself, DCE and constfolding the
new instructions it simplifies. Because we're threading jumps on edges
with constants coming in from PHI's, we inherently are exposing a lot more
constants to the new block. Folding them and deleting dead conditions
allows the cost model in jump threading to be more accurate as it iterates.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60327 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
f5102a0f088e7c96f7028bf7ca1c24975c314fff 28-Nov-2008 Chris Lattner <sabre@nondot.org> don't call MergeBasicBlockIntoOnlyPred on a block whose only
predecessor is itself. This doesn't make sense, and this is
a dead infinite loop anyway.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60210 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
3d86d242c69a26ba2e6102f32b00b04884c4c9b1 27-Nov-2008 Chris Lattner <sabre@nondot.org> Fix PR3138: if we merge the entry block into another block, make sure to
move the other block back up into the entry position!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60179 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
52c95856b4a40ccae6c4b0e13b2a04101e1f79c9 27-Nov-2008 Chris Lattner <sabre@nondot.org> move FindAvailableLoadedValue from JumpThreading to Transforms/Utils.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60166 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
b29714a10af94b6daae437e48a82ae32675f79cb 27-Nov-2008 Chris Lattner <sabre@nondot.org> move MergeBasicBlockIntoOnlyPred to Transforms/Utils.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60162 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
c7bcbf6903a741e5252d6003916fb3624be937e5 27-Nov-2008 Chris Lattner <sabre@nondot.org> rename ThreadBlock to ProcessBlock, since it does other things than
just simple threading.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60157 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
69e067fdd86d34cb81ccdffb82415b4f89144218 27-Nov-2008 Chris Lattner <sabre@nondot.org> Make jump threading substantially more powerful, in the following ways:

1. Make it fold blocks separated by an unconditional branch. This enables
jump threading to see a broader scope.
2. Make jump threading able to eliminate locally redundant loads when they
feed the branch condition of a block. This frequently occurs due to
reg2mem running.
3. Make jump threading able to eliminate *partially redundant* loads when
they feed the branch condition of a block. This is common in code with
lots of loads and stores like C++ code and 255.vortex.

This implements thread-loads.ll and rdar://6402033.

Per the fixme's, several pieces of this should be moved into Transforms/Utils.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60148 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
ae73dc1448d25b02cabc7c64c86c64371453dda8 04-Sep-2008 Dan Gohman <gohman@apple.com> Tidy up several unbeseeming casts from pointer to intptr_t.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55779 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
fc74abfba5128544a750fce22fdf13eb0403e3ce 23-Jul-2008 Dan Gohman <gohman@apple.com> Enable first-class aggregates support.

Remove the GetResultInst instruction. It is still accepted in LLVM assembly
and bitcode, where it is now auto-upgraded to ExtractValueInst. Also, remove
support for return instructions with multiple values. These are auto-upgraded
to use InsertValueInst instructions.

The IRBuilder still accepts multiple-value returns, and auto-upgrades them
to InsertValueInst instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53941 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
43e2a035309f4e353a8bd5547d10125414597e74 27-May-2008 Duncan Sands <baldrick@free.fr> Fix some constructs that gcc-4.4 warns about.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51591 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
02dea8b39f3acad5de1df36273444d149145e7fc 23-May-2008 Dan Gohman <gohman@apple.com> Tidy up BasicBlock::getFirstNonPHI, and change a bunch of places to
use it instead of duplicating its functionality.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51499 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
6e7b322d36fc9e571cd54cb4b9c6043346a97e3a 20-May-2008 Matthijs Kooijman <matthijs@stdin.nl> Fix typo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51303 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
844731a7f1909f55935e3514c9e713a62d67662e 13-May-2008 Dan Gohman <gohman@apple.com> Clean up the use of static and anonymous namespaces. This turned up
several things that were neither in an anonymous namespace nor static
but not intended to be global.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51017 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
94019f8e064bf84085b44c35ab0c1efb76fb94f7 09-May-2008 Chris Lattner <sabre@nondot.org> restore doxygen comment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50881 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
a8a118b68fa3ca1632e7280cd6994aa0f8f1eec1 08-May-2008 Gordon Henriksen <gordonhenriksen@mac.com> Improve pass documentation and comments.

Patch by Matthijs Kooijman!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50861 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
9b34849a6ba605082822b5ec6416c67fabbf57a4 06-May-2008 Chris Lattner <sabre@nondot.org> fix typo Duncan noticed


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50699 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
8554cc2ea79861ddf43998bff634d1682e848216 05-May-2008 Chris Lattner <sabre@nondot.org> Fix a crash when threading a block that includes a MRV call result.
DemoteRegToStack doesn't work with MRVs yet, because it relies on the
ability to load/store things.

This fixes PR2285.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50667 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
eede65ce6cb29c8f3a701be8606e95c9a213efff 25-Apr-2008 Chris Lattner <sabre@nondot.org> Don't infininitely thread branches when a threaded edge
goes back to the block, e.g.:

Threading edge through bool from 'bb37.us.thread3829' to 'bb37.us' with cost: 1, across block:

bb37.us: ; preds = %bb37.us.thread3829, %bb37.us, %bb33
%D1361.1.us = phi i32 [ %tmp36, %bb33 ], [ %D1361.1.us, %bb37.us ], [ 0, %bb37.us.thread3829 ] ; <i32> [#uses=2]
%tmp39.us = icmp eq i32 %D1361.1.us, 0 ; <i1> [#uses=1]
br i1 %tmp39.us, label %bb37.us, label %bb42.us



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50251 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
a5ddb59a1319ccd23844c74809a64bc4d88f59d1 22-Apr-2008 Chris Lattner <sabre@nondot.org> Start doing the significantly useful part of jump threading: handle cases
where a comparison has a phi input and that phi is a constant. For example,
stuff like:

Threading edge through bool from 'bb2149' to 'bb2231' with cost: 1, across block:
bb2237: ; preds = %bb2231, %bb2149
%tmp2328.rle = phi i32 [ %tmp2232, %bb2231 ], [ %tmp2232439, %bb2149 ] ; <i32> [#uses=2]
%done.0 = phi i32 [ %done.2, %bb2231 ], [ 0, %bb2149 ] ; <i32> [#uses=1]
%tmp2239 = icmp eq i32 %done.0, 0 ; <i1> [#uses=1]
br i1 %tmp2239, label %bb2231, label %bb2327

or

bb38.i298: ; preds = %bb33.i295, %bb1693
%tmp39.i296.rle = phi %struct.ibox* [ null, %bb1693 ], [ %tmp39.i296.rle1109, %bb33.i295 ] ; <%struct.ibox*> [#uses=2]
%minspan.1.i291.reg2mem.1 = phi i32 [ 32000, %bb1693 ], [ %minspan.0.i288, %bb33.i295 ] ; <i32> [#uses=1]
%tmp40.i297 = icmp eq %struct.ibox* %tmp39.i296.rle, null ; <i1> [#uses=1]
br i1 %tmp40.i297, label %implfeeds.exit311, label %bb43.i301

This triggers thousands of times in spec.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50110 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
ae65b3c7912138ec636b3bde5ff528d948161651 22-Apr-2008 Chris Lattner <sabre@nondot.org> Dig through multiple levels of AND to thread jumps if needed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50106 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
6bf77500c655520a04ea8640af6dccbcf995a754 22-Apr-2008 Chris Lattner <sabre@nondot.org> Teach jump threading to thread through blocks like:

br (and X, phi(Y, Z, false)), label L1, label L2

This triggers once on 252.eon and 6 times on 176.gcc. Blocks
in question often look like this:

bb262: ; preds = %bb261, %bb248
%iftmp.251.0 = phi i1 [ true, %bb261 ], [ false, %bb248 ] ; <i1> [#uses=4]
%tmp270 = icmp eq %struct.rtx_def* %tmp.0.i, null ; <i1> [#uses=1]
%bothcond = or i1 %iftmp.251.0, %tmp270 ; <i1> [#uses=1]
br i1 %bothcond, label %bb288, label %bb273

In this case, it is clear that it doesn't matter if tmp.0.i is null when coming from bb261. When coming from bb248, it is all that matters.


Another random example:

check_asm_operands.exit: ; preds = %check_asm_operands.exit.thr_comm, %bb30.i, %bb12.i, %bb6.i413
%tmp.0.i420 = phi i1 [ true, %bb6.i413 ], [ true, %bb12.i ], [ true, %bb30.i ], [ false, %check_asm_operands.exit.thr_comm ; <i1> [#uses=1]
call void @llvm.stackrestore( i8* %savedstack ) nounwind
%tmp4389 = icmp eq i32 %added_sets_1.0, 0 ; <i1> [#uses=1]
%tmp4394 = icmp eq i32 %added_sets_2.0, 0 ; <i1> [#uses=1]
%bothcond80 = and i1 %tmp4389, %tmp4394 ; <i1> [#uses=1]
%bothcond81 = and i1 %bothcond80, %tmp.0.i420 ; <i1> [#uses=1]
br i1 %bothcond81, label %bb4398, label %bb4397

Here is the case from 252.eon:

bb290.i.i: ; preds = %bb23.i57.i.i, %bb8.i39.i.i, %bb100.i.i, %bb100.i.i, %bb85.i.i110
%myEOF.1.i.i = phi i1 [ true, %bb100.i.i ], [ true, %bb100.i.i ], [ true, %bb85.i.i110 ], [ true, %bb8.i39.i.i ], [ false, %bb23.i57.i.i ] ; <i1> [#uses=2]
%i.4.i.i = phi i32 [ %i.1.i.i, %bb85.i.i110 ], [ %i.0.i.i, %bb100.i.i ], [ %i.0.i.i, %bb100.i.i ], [ %i.3.i.i, %bb8.i39.i.i ], [ %i.3.i.i, %bb23.i57.i.i ] ; <i32> [#uses=3]
%tmp292.i.i = load i8* %tmp16.i.i100, align 1 ; <i8> [#uses=1]
%tmp293.not.i.i = icmp ne i8 %tmp292.i.i, 0 ; <i1> [#uses=1]
%bothcond.i.i = and i1 %tmp293.not.i.i, %myEOF.1.i.i ; <i1> [#uses=1]
br i1 %bothcond.i.i, label %bb202.i.i, label %bb301.i.i
Factoring out 3 common predecessors.

On the path from any blocks other than bb23.i57.i.i, the load and compare
are dead.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50096 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
d38c14e6ed0136624a18cf8338c82f1709d804aa 22-Apr-2008 Chris Lattner <sabre@nondot.org> refactor some code, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50094 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
037c781de797242ba652db775f1f2c5d2d4eb19b 21-Apr-2008 Chris Lattner <sabre@nondot.org> fix grammar-o, thanks to Duncan for noticing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50047 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
2cc675180b06d0a2173365a4015606933f1a285d 21-Apr-2008 Chris Lattner <sabre@nondot.org> Use the new SplitBlockPredecessors to implement a todo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50022 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
bd3401fa98b578080e227afce940bca80137dea6 21-Apr-2008 Chris Lattner <sabre@nondot.org> finish the first cut of a jump threading pass implementation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50006 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
f9065a904fca1018d6ea3e1536b9b3368c084725 20-Apr-2008 Chris Lattner <sabre@nondot.org> we can only thread blocks when there is a pred we can determine the succ of.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50003 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
177480b7ede0441135572d641a2497df25a7d95f 20-Apr-2008 Chris Lattner <sabre@nondot.org> improve comments, infrastructure, and add some validity checks for threading.
Add a cost function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50002 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp
8383a7b7a6acdae478d4b4c2520915153b73f676 20-Apr-2008 Chris Lattner <sabre@nondot.org> Add a new Jump Threading pass, which will handle cases
such as those in PR2235. Right now the pass is not very
effective. :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50000 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/JumpThreading.cpp