History log of /external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
dce4a407a24b04eebc6a376f8e62b41aaa7b071f 29-May-2014 Stephen Hines <srhines@google.com> Update LLVM for 3.5 rebase (r209712).

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

Change-Id: Ifadecab779f128e62e430c2b4f6ddd84953ed617
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
ab09d1e0ead4ede09f22ef3645bbcf0785d667f8 08-Nov-2013 Hal Finkel <hfinkel@anl.gov> Remove dead code from LoopUnswitch

LoopUnswitch's code simplification routine has logic to convert conditional
branches into unconditional branches, after unswitching makes the condition
constant, and then remove any blocks that renders dead. Unfortunately, this
code is dead, currently broken, and furthermore, has never been alive (at least
as far back at 2006).

No functionality change intended.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194277 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
7198ee6f62d5726eb9f5c36238cd1866fb35d943 06-Aug-2013 Jakub Staszak <kubastaszak@gmail.com> Adjust file to the coding standard.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187808 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
a0ec3f9b7b826b9b40b80199923b664bad808cce 14-Jul-2013 Craig Topper <craig.topper@gmail.com> Use SmallVectorImpl& instead of SmallVector to avoid repeating small vector size.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186274 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
a5157e68d183e1bdf010e94a15dc0c44b65f889b 21-Jan-2013 Chandler Carruth <chandlerc@gmail.com> Switch CodeMetrics itself over to use TTI to determine if an instruction
is free. The whole CodeMetrics API should probably be reworked more, but
this is enough to allow deleting the duplicate code there for computing
whether an instruction is free.

All of the passes using this have been updated to pull in TTI and hand
it to the CodeMetrics stuff. Further, a dead CodeMetrics API
(analyzeFunction) is nuked for lack of users.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173036 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.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/LoopUnswitch.cpp
831737d329a727f53a1fb0572f7b7a8127208881 30-Dec-2012 Bill Wendling <isanbard@gmail.com> Remove the Function::getFnAttributes method in favor of using the AttributeSet
directly.

This is in preparation for removing the use of the 'Attribute' class as a
collection of attributes. That will shift to the AttributeSet class instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171253 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.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/LoopUnswitch.cpp
034b94b17006f51722886b0f2283fb6fb19aca1f 19-Dec-2012 Bill Wendling <isanbard@gmail.com> Rename the 'Attributes' class to 'Attribute'. It's going to represent a single attribute in the future.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170502 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.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/LoopUnswitch.cpp
be6f884afc019b54f6185064cd2daa45c5c73c57 16-Oct-2012 Jakub Staszak <kubastaszak@gmail.com> Simplify code. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166053 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
6765834754cbb3cb0f15b4b15e98c5e73fa50066 09-Oct-2012 Bill Wendling <isanbard@gmail.com> Create enums for the different attributes.

We use the enums to query whether an Attributes object has that attribute. The
opaque layer is responsible for knowing where that specific attribute is stored.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165488 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
2c189061184925c6a8ecbb5a19e648b230a41c0e 26-Sep-2012 Bill Wendling <isanbard@gmail.com> Remove the `hasFnAttr' method from Function.

The hasFnAttr method has been replaced by querying the Attributes explicitly. No
intended functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164725 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
fcaf5fa89cafe66d2659b711e7c190f3851f4ac5 20-May-2012 Peter Collingbourne <peter@pcc.me.uk> Do not pass an invalid domtree to SimplifyInstruction from
LoopUnswitch. Fixes PR12887.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157140 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
bfbab99b58aa530d5d6aa886ef66be42a047c756 30-Apr-2012 Bill Wendling <isanbard@gmail.com> Second attempt at PR12573:

Allow the "SplitCriticalEdge" function to split the edge to a landing pad. If
the pass is *sure* that it thinks it knows what it's doing, then it may go ahead
and specify that the landing pad can have its critical edge split. The loop
unswitch pass is one of these passes. It will split the critical edges of all
edges coming from a loop to a landing pad not within the loop. Doing so will
retain important loop analysis information, such as loop simplify.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155817 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
6aa33274ed9e428292989c099957aa096bc80014 30-Apr-2012 Bill Wendling <isanbard@gmail.com> Remove hack from r154987. The problem persists even with it, so it's not even a good hack.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155813 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
dc21604d4af9cbe27d7fa067f7411e334ba5186e 20-Apr-2012 Bill Wendling <isanbard@gmail.com> Put this expensive check below the less expensive ones.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@155166 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
135604129646650ef9abcd12a38b2d8976d3493c 18-Apr-2012 Bill Wendling <isanbard@gmail.com> Use a heavy hammer to fix PR12573.

If the loop contains invoke instructions, whose unwind edge escapes the loop,
then don't try to unswitch the loop. Doing so may cause the unwind edge to be
split, which not only is non-trivial but doesn't preserve loop simplify
information.

Fixes PR12573


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154987 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
d9fc1ce8096f7138c60edc3a6655583bf209780e 10-Apr-2012 Andrew Trick <atrick@apple.com> Fix 12513: Loop unrolling breaks with indirect branches.

Take this opportunity to generalize the indirectbr bailout logic for
loop transformations. CFG transformations will never get indirectbr
right, and there's no point trying.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154386 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
64c0748eb34272a6548980b3277aedebb6e6d265 10-Apr-2012 Andrew Trick <atrick@apple.com> whitespace

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154385 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
aad9c3f17a73b3104f4a3673a2dc511a4878e20e 02-Apr-2012 Stepan Dyatkovskiy <stpworld@narod.ru> Fast fix for PR12343:
http://llvm.org/bugs/show_bug.cgi?id=12343

We have not trivial way for splitting edges that are goes from indirect branch. We can do it with some tricks, but it should be additionally discussed. And it is still dangerous due to difficulty of indirect branches controlling.

Fix forbids this case for unswitching.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153879 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
ae029098a5861e451b77969627f11a4ef3342a76 15-Mar-2012 Chandler Carruth <chandlerc@gmail.com> This pass didn't want the inline cost per-se, it just wants generic code
metrics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152760 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
3d3abe0852d5f499bed7ab014519dd582a0a795d 11-Mar-2012 Stepan Dyatkovskiy <stpworld@narod.ru> llvm::SwitchInst
Renamed methods caseBegin, caseEnd and caseDefault with case_begin, case_end, and case_default.
Added some notes relative to case iterators.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152532 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.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/LoopUnswitch.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/LoopUnswitch.cpp
27bf56056bed53d55d7ef0fd67d1851fa860b4f2 16-Jan-2012 Stepan Dyatkovskiy <stpworld@narod.ru> Fixed comment in loop-unswitch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148252 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
0499c1fd8f1fb3f011d12ae7c5957b30a25c5e97 15-Jan-2012 Stepan Dyatkovskiy <stpworld@narod.ru> Cosmetic patch for r148215.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148216 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
209287d2259e4c7cae3b4ea8b6c11ba5bd03f997 15-Jan-2012 Stepan Dyatkovskiy <stpworld@narod.ru> Fixup for r148132. Type replacement for LoopsProperties: from DenseMap to std::map, since we need to keep a valid pointer to properties of current loop.

Message for r148132:
LoopUnswitch: All helper data that is collected during loop-unswitch iterations was moved to separated class (LUAnalysisCache).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148215 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
09a536a88b76dfbc58f48944c23b91f6728c0abe 13-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Speculatively revert r148132+r148133 to try and fix a buildbot failure.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148149 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
5dab2bf2932cd8efb7db70ee41473258328e79cb 13-Jan-2012 Stepan Dyatkovskiy <stpworld@narod.ru> Cosmetic patch for r148132.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148133 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
a5a1e46d0004bc4a2de5d4726e3af8301fab1532 13-Jan-2012 Stepan Dyatkovskiy <stpworld@narod.ru> LoopUnswitch: All helper data that is collected during loop-unswitch iterations was moved to separated class (LUAnalysisCache).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148132 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
88c5c42c5c832f599b34a5f5f4d361b9c1eacf6c 11-Jan-2012 Stepan Dyatkovskiy <stpworld@narod.ru> Improved compile time:
1. Size heuristics changed. Now we calculate number of unswitching
branches only once per loop.
2. Some checks was moved from UnswitchIfProfitable to
processCurrentLoop, since it is not changed during processCurrentLoop
iteration. It allows decide to skip some loops at an early stage.
Extended statistics:
- Added total number of instructions analyzed.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147935 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
8a5641d856da53978a032dd37f2112b3c7a83b19 24-Dec-2011 Nick Lewycky <nicholas@mxc.ca> Fix typo "infinte".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147226 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
a816bf7c0d00f5335faa92741945e5c622147fdf 22-Dec-2011 Chad Rosier <mcrosier@apple.com> Add the actual code for r147175.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147176 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
5ddb7a0105a71faf86bed587b1682a3add99e551 22-Dec-2011 Chad Rosier <mcrosier@apple.com> Speculatively revert r146578 to determine if it is the cause of a number of
performance regressions (both execution-time and compile-time) on our
nightly testers.

Original commit message:
Fix for bug #11429: Wrong behaviour for switches. Small improvement for code
size heuristics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147131 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
ac12ef4ad22de941655c889f319a4c6923b77620 14-Dec-2011 Stepan Dyatkovskiy <stpworld@narod.ru> Fix for bug #11429: Wrong behaviour for switches. Small improvement for code size heuristics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146578 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.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/LoopUnswitch.cpp
618c1dbd293d15ee19f61b1156ab8086ad28311a 01-Dec-2011 Chad Rosier <mcrosier@apple.com> Propagate TargetLibraryInfo throughout ConstantFolding.cpp and
InstructionSimplify.cpp. Other fixups as needed.
Part of rdar://10500969

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145559 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
be4c84464892ea0a4bf51773502f2b0a086fe184 29-Nov-2011 Stepan Dyatkovskiy <stpworld@narod.ru> Potential bug in RewriteLoopBodyWithConditionConstant: use iterator should not be changed inside the uses enumeration loop.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145432 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
a9390a4d5f5d568059a80970d22194b165d097a7 27-Sep-2011 Benjamin Kramer <benny.kra@googlemail.com> Stop emitting instructions with the name "tmp" they eat up memory and have to be uniqued, without any benefit.

If someone prefers %tmp42 to %42, run instnamer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140634 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
d5520987d146487733e2453c8f0cf6ddd0f6ceba 27-Sep-2011 Bill Wendling <isanbard@gmail.com> Split the landing pad basic block with the correct function. Also merge the
split landingpad instructions into a PHI node.
PR11016


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140592 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
95c3e48f9557adb6064d580684bb14cacec2f826 23-Jun-2011 Jay Foad <jay.foad@gmail.com> Reinstate r133513 (reverted in r133700) with an additional fix for a
-Wshorten-64-to-32 warning in Instructions.h.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133708 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
e59fbc04ad343435705c28b3cf7038d65fe4af0a 23-Jun-2011 Eric Christopher <echristo@apple.com> Revert r133513:

"Reinstate r133435 and r133449 (reverted in r133499) now that the clang
self-hosted build failure has been fixed (r133512)."

Due to some additional warnings.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133700 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
cd35e09a4a3c640b9da0b1dfe3548a605c929ae5 21-Jun-2011 Jay Foad <jay.foad@gmail.com> Reinstate r133435 and r133449 (reverted in r133499) now that the clang
self-hosted build failure has been fixed (r133512).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133513 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
a88a0ca8082006b37d14d8aee4a644b20bae8bc9 21-Jun-2011 Chad Rosier <mcrosier@apple.com> Revert r133435 and r133449 to appease buildbots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133499 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
72f5f313d87558958696ce69593d82efcdfa9128 20-Jun-2011 Jay Foad <jay.foad@gmail.com> Change how PHINodes store their operands.

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.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133435 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
444f297a782047fbe6255a3543bc3ccd025c0691 03-Jun-2011 Nick Lewycky <nicholas@mxc.ca> Bail on unswitching a switch statement for a case with a critical edge. We name
which edge to split by pred/succ pair, which means that we can end up splitting
the wrong edge (by case value) in the switch statement entirely. Fixes PR10031!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132535 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
237d10db8c3d8677b17bb447e3504674b2d31393 25-May-2011 Evan Cheng <evan.cheng@apple.com> Simplify r132022 based on Cameron's feedback.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132071 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
21d378d73563034b7ca3d8995699b886b2c68719 25-May-2011 Evan Cheng <evan.cheng@apple.com> Forgot dyn_cast check.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132025 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
424641ef83fbb99640d3e2758148a9d3ea2b3830 25-May-2011 Evan Cheng <evan.cheng@apple.com> Fix LoopUnswitch bug. RewriteLoopBodyWithConditionConstant can delete a dead
case of a switch instruction. Back off this optimization when this would
eliminate all of the predecessors to the latch.

Sorry, I am unable to reduce a reasonably sized test case.

rdar://9486843


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132022 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
71132af89a56f237bc6e18a4e1247b0fc8ee3e6b 11-Feb-2011 Cameron Zwarich <zwarich@apple.com> Make LoopUnswitch preserve ScalarEvolution by just forgetting everything about
a loop when unswitching it. It only does this in the complex case, because
everything should be fine already in the simple case.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125369 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
b5fa5fcecc97168a72c9533c84cf297c018b957c 08-Jan-2011 Chris Lattner <sabre@nondot.org> Revamp the ValueMapper interfaces in a couple ways:

1. Take a flags argument instead of a bool. This makes
it more clear to the reader what it is used for.
2. Add a flag that says that "remapping a value not in the
map is ok".
3. Reimplement MapValue to share a bunch of code and be a lot
more efficient. For lookup failures, don't drop null values
into the map.
4. Using the new flag a bunch of code can vaporize in LinkModules
and LoopUnswitch, kill it.

No functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123058 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
0f827639df520ac85eca6cc8f826e3fc36c4d171 23-Nov-2010 Duncan Sands <baldrick@free.fr> Constant folding here is pointless, because InstructionSimplify
(which does constant folding and more) is called a few lines
later.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120042 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
d0c6f3dafd7c3e9137d4e6415014c94137fcd3fc 18-Nov-2010 Duncan Sands <baldrick@free.fr> Factor code for testing whether replacing one value with another
preserves LCSSA form out of ScalarEvolution and into the LoopInfo
class. Use it to check that SimplifyInstruction simplifications
are not breaking LCSSA form. Fixes PR8622.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119727 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
eff0581583ef10e2872e9baf537a04b67d992101 14-Nov-2010 Duncan Sands <baldrick@free.fr> If dom tree information is available, make it possible to pass
it to get better phi node simplification.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119055 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
205942a4a55d568e93480fc22d25cc7dac525fb7 19-Oct-2010 Owen Anderson <resistor@mac.com> Passes do not need to recursively initialize passes that they preserve, if
they do not also require them. This allows us to reduce inter-pass linkage
dependencies.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116854 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.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/LoopUnswitch.cpp
1ed219a9d2279ce5a5bbcf16d9b7ccc05cce638c 13-Oct-2010 Rafael Espindola <rafael.espindola@gmail.com> Be more consistent in using ValueToValueMapTy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116387 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.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/LoopUnswitch.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/LoopUnswitch.cpp
b0a57210a435090d8106fc7fb3529ba21e6540bd 01-Sep-2010 Dan Gohman <gohman@apple.com> Fix loop unswitching's assumption that a code path which either
infinite loops or exits will eventually exit. This fixes PR5373.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112745 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
ea1092374cdeea2a4ba66bfdc33e40c0fee9ebe2 29-Aug-2010 Chris Lattner <sabre@nondot.org> apparently unswitch had the same "Feature". Stop its
claims that it preserves domfrontier if it doesn't really.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112445 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.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/LoopUnswitch.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/LoopUnswitch.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/LoopUnswitch.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/LoopUnswitch.cpp
e9916a302f1bacad234d7dafc1df3dc968a6ba0f 24-Jun-2010 Devang Patel <dpatel@apple.com> Use ValueMap instead of DenseMap.
The ValueMapper used by various cloning utility maps MDNodes also.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106706 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
42c7d23c6d56e0743169d94025264eaf17eb799d 09-Jun-2010 Kenneth Uildriks <kennethuil@gmail.com> Pulled CodeMetrics out of InlineCost.h and made it a bit more general, so it can be reused from PartialSpecializationCost

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105725 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
4f1f6f63426f03663c28effdf00009218adfcf7e 20-Apr-2010 Chris Lattner <sabre@nondot.org> remove a bunch of ad-hoc code to simplify instructions from
loop unswitch, and use inst simplify instead. It is more
powerful and less duplication.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101874 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
a78130c3207e59bfb2ec0b77ca3f48677685d9ae 20-Apr-2010 Chris Lattner <sabre@nondot.org> RewriteLoopBodyWithConditionConstant can end up rewriting the
condition we're unswitching on. In this case, don't try to
simplify the second copy of the loop which may be dead or not,
but is probably a constant now. This fixes PR6879


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101870 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
9e185800c057dad3d468c78d1d2045826a9f2299 05-Apr-2010 Chris Lattner <sabre@nondot.org> some code cleanups, use SwitchInst::findCaseValue, reduce indentation



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100468 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
0f1666b480f7ac55af09fdd5ff09c3df7c20e2e4 05-Apr-2010 Evan Cheng <evan.cheng@apple.com> Code clean up.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100467 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
02720242103ab7adc44580328bd8d35fa555bcb1 03-Apr-2010 Evan Cheng <evan.cheng@apple.com> Code refactoring.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100262 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
bbf81d88116d23fb0776412b5916f7d0b8b3ca7e 10-Mar-2010 Dan Gohman <gohman@apple.com> Add a DominatorTree argument to isLCSSA so that it doesn't have to
compute a set of reachable blocks for itself each time it is called, which
is fairly frequently.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98179 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.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/LoopUnswitch.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/LoopUnswitch.cpp
3d606bbc92b5bbed17492b38b4f80728e676179f 02-Feb-2010 Chris Lattner <sabre@nondot.org> fix a crash in loop unswitch on a loop invariant vector condition.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95055 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
11acaa374cdcebb161bf0de5f244265d78a749c1 05-Jan-2010 Benjamin Kramer <benny.kra@googlemail.com> Convert a ton of simple integer type equality tests to the new predicate.


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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92608 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
92329c7fbe572892c17aa2d2542a10e3ea16132f 18-Dec-2009 Dan Gohman <gohman@apple.com> Add Loop contains utility methods for testing whether a loop
contains another loop, or an instruction. The loop form is
substantially more efficient on large loops than the typical
code it replaces.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@91654 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
f68d0c1bbe96ccbe7f695471536862dcd047fe59 09-Dec-2009 Dan Gohman <gohman@apple.com> Dereference loopHeader after checking for null rather than before.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90990 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
25798439da8c1a11512317dd38d6f0022a3d1f7d 25-Nov-2009 Edward O'Callaghan <eocallaghan@auroraux.org> Reverting patch in revision 89758, initial attempt at fixing PR5373 has proven to be bogus.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89844 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
de8d3b73c85aa1a68959d296088fe022c839003f 24-Nov-2009 Edward O'Callaghan <eocallaghan@auroraux.org> Fix for PR5373, Credit to Jakub Staszak.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89758 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.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/LoopUnswitch.cpp
03e896bd6073efc4523d8bcd0239d6ed62126db7 05-Nov-2009 Dan Gohman <gohman@apple.com> Update various Loop optimization passes to cope with the possibility that
LoopSimplify form may not be available.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86175 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
da9c281121537d9823ddeecf7bb15095d95b2722 01-Nov-2009 Chris Lattner <sabre@nondot.org> if CostMetrics says to never duplicate some code, don't unswitch a loop.
This prevents unswitching from duplicating indbr's.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85705 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
cd53f64367b3d9e2b1a82e589d09682a42f538ea 20-Oct-2009 Dan Gohman <gohman@apple.com> Restore LoopUnswitch's block-oriented threshold. LoopUnswitch now checks both
the estimated code size and the number of blocks when deciding whether to
do a non-trivial unswitch. This protects it from some very undesirable
worst-case behavior on large numbers of loop-unswitchable conditions, such
as in the testcase in PR5259.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84661 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
9674d15120d657c9a9e681a7dc668349fa3a8de0 14-Oct-2009 Devang Patel <dpatel@apple.com> Use isVoidTy()


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84118 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
228ebd0f4cf9207d32d61ef4b11b81736895dc09 14-Oct-2009 Devang Patel <dpatel@apple.com> Check void type before using RAUWd.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84049 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
1bf5ebc7be0d5b05e4175c7adb767b38896adef1 13-Oct-2009 Devang Patel <dpatel@apple.com> Do not check use_empty() before replaceAllUsesWith(). This gives ValueHandles a chance to get properly updated.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84033 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
597c5e2d32647382c4da0ad2005085a7760e65bb 13-Oct-2009 Dan Gohman <gohman@apple.com> Use the new CodeMetrics class to compute code size instead of
manually counting instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84016 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
b24f6c74957540a87b7475a1917e4a66f1634cf0 13-Oct-2009 Dan Gohman <gohman@apple.com> Make LoopUnswitch's cost estimation count Instructions, rather than
BasicBlocks, so that it doesn't blindly procede in the presence of
large individual BasicBlocks. This addresses a class of code-size
expansion problems.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83992 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
c02f0d7e4b60a10d4b0eb0bd1409550174efff81 09-Sep-2009 Mike Stump <mrs@apple.com> Reflow comment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81361 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
842dee44b543ba5fc9fc2e7c12a15b444827046f 09-Sep-2009 Dan Gohman <gohman@apple.com> Fix an 80-column violation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81354 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
5c89b5240c90eb8171f999e5f06f815502d0321c 08-Sep-2009 Dan Gohman <gohman@apple.com> Re-apply r80926, with fixes: keep the domtree informed of new blocks
that get created during loop unswitching, and fix SplitBlockPredecessors'
LCSSA updating code to create new PHIs instead of trying to just move
existing ones.

Also, optimize Loop::verifyLoop, since it gets called a lot. Use
searches on a sorted list of blocks instead of calling the "contains"
function, as is done in other places in the Loop class, since "contains"
does a linear search. Also, don't call verifyLoop from LoopSimplify or
LCSSA, as the PassManager is already calling verifyLoop as part of
LoopInfo's verifyAnalysis.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81221 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
8f78a58e14fa754cde827e46ad03f00c7a6ead01 06-Sep-2009 Evan Cheng <evan.cheng@apple.com> Revert r80926. It causes loop unswitch assertion and slow down some JIT tests significantly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81101 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
8fc5ad33691b2a0672a7487da1f56b6f7f675a1b 03-Sep-2009 Dan Gohman <gohman@apple.com> Add a verifyAnalysis to LoopInfo, LoopSimplify, and LCSSA form that verify
that these passes are properly preserved.

Fix several transformation passes that claimed to preserve LoopSimplify
form but weren't.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80926 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.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/LoopUnswitch.cpp
bdff548e4dd577a72094d57b282de4e765643b96 23-Aug-2009 Chris Lattner <sabre@nondot.org> eliminate the "Value" printing methods that print to a std::ostream.
This required converting a bunch of stuff off DOUT and other cleanups.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79819 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.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/LoopUnswitch.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/LoopUnswitch.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/LoopUnswitch.cpp
ce63ffb52f249b62cdf2d250c128007b13f27e71 25-Jul-2009 Daniel Dunbar <daniel@zuster.org> More migration to raw_ostream, the water has dried up around the iostream hole.
- Some clients which used DOUT have moved to DEBUG. We are deprecating the
"magic" DOUT behavior which avoided calling printing functions when the
statement was disabled. In addition to being unnecessary magic, it had the
downside of leaving code in -Asserts builds, and of hiding potentially
unnecessary computations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77019 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.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/LoopUnswitch.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/LoopUnswitch.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/LoopUnswitch.cpp
bdc017edacb713119b24ab269d250a82d62fffeb 15-Jul-2009 Dan Gohman <gohman@apple.com> Make makeLoopInvariant report whether it made any changes or not,
and use this to simplify more code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75722 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
0df6e09d43d6d733555a10d22572ddb0006e7d23 14-Jul-2009 Dan Gohman <gohman@apple.com> Update LoopSimplify and LoopUnswitch to use the new makeLoopInvariant
function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75584 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.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/LoopUnswitch.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/LoopUnswitch.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/LoopUnswitch.cpp
7af1c78b98d2df7d0ab9154461ca3d835706716e 06-May-2009 Duncan Sands <baldrick@free.fr> Allow readonly functions to unwind exceptions. Teach
the optimizers about this. For example, a readonly
function with no uses cannot be removed unless it is
also marked nounwind.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71071 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
9c0f146d50ccc3ba780d4854b8e14422430013ef 19-Mar-2009 Nick Lewycky <nicholas@mxc.ca> Remove strange extra semicolons.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67287 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
28aa5de050e0f43617f2b5cce65edc8827f3e2f1 03-Feb-2009 Devang Patel <dpatel@apple.com> If "optimize for size" attribute is set then block non-trivial loop unswitches but allow trivial loop unswitches.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63670 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
1465d61bdd36cfd6021036a527895f0dd358e97d 28-Jan-2009 Duncan Sands <baldrick@free.fr> Rename getAnalysisToUpdate to getAnalysisIfAvailable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63198 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
6d9896f153359785299651bcffd363fdefd67a4c 08-Dec-2008 Devang Patel <dpatel@apple.com> Undo previous patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60701 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.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/LoopUnswitch.cpp
265ca5dff5ad21add569fadab435f64423861793 03-Nov-2008 Devang Patel <dpatel@apple.com> Ignore conditions that are outside the loop.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58631 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
394f0441e06dafca29f0752cf400990a5b8fe4b1 23-Oct-2008 Daniel Dunbar <daniel@zuster.org> Change create*Pass factory functions to return Pass* instead of
LoopPass*.
- Although less precise, this means they can be used in clients
without RTTI (who would otherwise need to include LoopPass.h, which
eventually includes things using dynamic_cast). This was the
simplest solution that presented itself, but I am happy to use a
better one if available.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58010 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
a1fcd77ccfc61087dfad4fad69752a414179836c 17-Oct-2008 Dan Gohman <gohman@apple.com> Use 0 instead of false to return a null pointer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57660 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
2c9c3e73682749016d5885b67ff719f634b37d58 27-Sep-2008 Devang Patel <dpatel@apple.com> Implement function notes as function attributes.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56716 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
0598866c052147c31b808391f58434ce3dbfb838 25-Sep-2008 Devang Patel <dpatel@apple.com> Large mechanical patch.

s/ParamAttr/Attribute/g
s/PAList/AttrList/g
s/FnAttributeWithIndex/AttributeWithIndex/g
s/FnAttr/Attribute/g

This sets the stage
- to implement function notes as function attributes and
- to distinguish between function attributes and return value attributes.

This requires corresponding changes in llvm-gcc and clang.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56622 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
20bcaff6a7f93a9894f7233c449b016bafe93b26 24-Sep-2008 Devang Patel <dpatel@apple.com> Put FN_NOTE_AlwaysInline and others in FnAttr namespace.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56527 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
dd4924c564c7a661b78b604ebf16dfef7aa62b35 24-Sep-2008 Devang Patel <dpatel@apple.com> Move FN_NOTE_AlwaysInline and other out of ParamAttrs namespace.
Do not check isDeclaration() in hasNote(). It is clients' responsibility.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56524 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
d9b4a5f859188cbb168c223071b413e58c53c925 24-Sep-2008 Devang Patel <dpatel@apple.com> Use parameter attribute store (soon to be renamed) for
Function Notes also. Function notes are stored at index ~0.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56511 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
f3ba70861ccf00b1072ae1b6ade3ebe2da6cff40 23-Sep-2008 Devang Patel <dpatel@apple.com> Add hasNote() to check note associated with a function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56477 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
deafefabae915cf20884fd829d2542f9626786e8 05-Sep-2008 Devang Patel <dpatel@apple.com> A loop may be unswitched multiple times. Reconstruct dom info. at the end.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55806 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
027bb9254199bee2b99253de8fab55d14d4e2639 04-Sep-2008 Devang Patel <dpatel@apple.com> Initialize loop data first.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55792 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
10b359ccb60de3114f262d2a204f54c532758cfc 04-Sep-2008 Devang Patel <dpatel@apple.com> Do not unswitch if the function notes say we're optimizing this function for size.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55786 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.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/LoopUnswitch.cpp
77a01136ff62502b0340c2749c6f708151018533 03-Jul-2008 Devang Patel <dpatel@apple.com> Do not try to update dominator info while manipulating CFG. This code does not handle all cases and keeps invalid dom info around some cases, which misleads other passes down stream.

Right now, dom info is recaluclated in the end if the loop is switched.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53106 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
38976dc394e4eb3c76fc5c31612715ed7c4a16cc 03-Jul-2008 Bill Wendling <isanbard@gmail.com> Remove unused function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53090 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
f31b3bbd106c01dbd10c875213ec85cee5982ae2 03-Jul-2008 Devang Patel <dpatel@apple.com> Remove extra FIXME


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53087 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
4be7d294f8045f08bcdbd74f1886ea8121a77022 03-Jul-2008 Devang Patel <dpatel@apple.com> Reconstruct dom info, if loop is unswitched.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53086 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
b76247b8b1534f42d6fcaa2290c8e4e1baf5443a 03-Jul-2008 Devang Patel <dpatel@apple.com> LoopUnswitch does not preserve dominator info in all cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53085 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
825cb98d9a9a28c007d6a10d5ebec858e669a685 03-Jul-2008 Devang Patel <dpatel@apple.com> Undo previous patch. It is not that simple to fix dom info here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53062 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
501e763dfe8337be6a530c61ca31f724f105fd05 03-Jul-2008 Devang Patel <dpatel@apple.com> Preserve dom info while simplifing loop after the unswitch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53052 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
1e41f6d724d6cecd4c3b3409da84608b2df16069 02-Jul-2008 Devang Patel <dpatel@apple.com> reuse vectors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53007 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
2095c38c7a064190193c8cb238f11a927cb93bff 02-Jul-2008 Devang Patel <dpatel@apple.com> Fix comment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53006 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
e6962dfb64864c81009b3455214fe4bd1cce4829 02-Jul-2008 Devang Patel <dpatel@apple.com> Preserve loop data so that it is not fetched everytime it is needed.
Keep track of currentLoop.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53005 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
64cd6582238b38a93ff0113409f91ad7ab746f35 18-Jun-2008 Devang Patel <dpatel@apple.com> Preserve dominance frontier while trivially unswitching loop.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52438 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
2f170997b5349bf7e9ef4cb5cb38af5f7df0c54b 03-Jun-2008 Devang Patel <dpatel@apple.com> Update dom tree. Fix PR 2372.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51887 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.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/LoopUnswitch.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/LoopUnswitch.cpp
4a3f6c88820a204f80ca0fa3f1f2fe09ca10b02f 06-May-2008 Dan Gohman <gohman@apple.com> Make several variable declarations static.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50696 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
280a6e607d8eb7401749a92db624a82de47da777 25-Apr-2008 Nick Lewycky <nicholas@mxc.ca> Remove 'unwinds to' support from mainline. This patch undoes r47802 r47989
r48047 r48084 r48085 r48086 r48088 r48096 r48099 r48109 and r48123.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50265 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
48a80b07bd6856130eefc7478084b8c9c6d65d90 21-Apr-2008 Chris Lattner <sabre@nondot.org> fit some more code in 80 cols.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50016 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
051a950000e21935165db56695e35bade668193b 06-Apr-2008 Gabor Greif <ggreif@gmail.com> API changes for class Use size reduction, wave 1.
Specifically, introduction of XXX::Create methods
for Users that have a potentially variable number of
Uses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49277 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
529de8a45702cd34968d79d13f95ed1e5d5fa250 09-Mar-2008 Nick Lewycky <nicholas@mxc.ca> Update the block cloner which fixes bugpoint on code using unwind_to (phew!)
and also update the cloning interface's major user, the loop optimizations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48088 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
4ee451de366474b9c228b4e5fa573795a715216d 29-Dec-2007 Chris Lattner <sabre@nondot.org> Remove attribution from file headers, per discussion on llvmdev.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45418 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
60f7515479683e56d92288d20ead59d7f9563723 17-Dec-2007 David Greene <greened@obbligato.org> Get rid of annoying spaces.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45100 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
d735ee85dbab8e4f66f9ec157f19956e0d11ec7a 27-Nov-2007 Owen Anderson <resistor@mac.com> Make LoopInfoBase more generic, in preparation for having MachineLoopInfo. This involves a small interface change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44348 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
b593898e114370ccabccc2d49889350d1680419a 09-Oct-2007 Devang Patel <dpatel@apple.com> Do not walk invalid iterator.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42812 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
5c4cd0d82e22a50e95a1acffa3364e4f7658ab32 06-Oct-2007 Devang Patel <dpatel@apple.com> Fix bug in updating dominance frontier after loop
unswitch when frontier includes basic blocks that
are not inside loop.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42654 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
c1e2660c5d44154617144138a503088cd5a4c4d5 03-Oct-2007 Devang Patel <dpatel@apple.com> Fix 80 col violation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42591 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
f476e8e7ce7b6aa0bec26aeb9e926148f7f9d02a 03-Oct-2007 Devang Patel <dpatel@apple.com> Refactor code in a separate method.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42590 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
9ee49c541bb2b83e05005d4c45685b79c5d8af07 21-Sep-2007 Devang Patel <dpatel@apple.com> Update aux. info associated with an instruction before erasing instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42180 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
b7211a2ce13a0365e0e1dd2f27adda2ee3d1288b 21-Aug-2007 Devang Patel <dpatel@apple.com> Use SmallVector instead of std::vector.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41207 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
8ff18e9c99293a093e066dad717b28ffab122f59 07-Aug-2007 David Greene <greened@obbligato.org> Fix GLIBCXX_DEBUG error triggered by incrementing erased iterator.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40897 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
684b22df79c51114a12289e10a4063d5f02259a9 02-Aug-2007 Chris Lattner <sabre@nondot.org> wrap some long lines. Major offenders that are left include
gvn, gvnpre, dse, and predsimplify. To see these, use:

make check-line-length



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40738 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
1ff61385c8feb655a1e70cc67999680cc93f0f67 02-Aug-2007 Devang Patel <dpatel@apple.com> Update dominator info for the middle blocks created while spliting
exit edge to preserve LCSSA.

Fix dominance frontier update during loop unswitch. This fixes PR 1589, again



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40737 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
2f2e519083d8ac06f4e0a980b43fa78a3aa727f4 02-Aug-2007 Devang Patel <dpatel@apple.com> Undo previous check-in.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40698 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
28ae151c48df634b4df5b3630a9a65021574fb4c 02-Aug-2007 Devang Patel <dpatel@apple.com> Update dominator info for the middle blocks created while spliting
exit edge to preserve LCSSA.

Fix dominance frontier update during loop unswitch. This fixes PR 1589.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40695 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
c2bbfc18e9adbbdcf5b3375d8d25e2452f7df7f1 01-Aug-2007 Dan Gohman <gohman@apple.com> More explicit keywords.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40673 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
15c260adff08bffaa810e848668e8d2653fc883c 31-Jul-2007 Devang Patel <dpatel@apple.com> Loop unswitch preserves dom info.
Use simple analysis interface to preserve analysis info maintained by other loop passes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40627 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
6f62af6e64716a5add36531ccd1ffdfab7391224 31-Jul-2007 Devang Patel <dpatel@apple.com> If loop can be unswitched again, then do it yourself.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40609 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
df5cf2074c336fb4de7e5b77e7b3bbbf21948a53 30-Jul-2007 Devang Patel <dpatel@apple.com> Remove dead code.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40606 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
936baaa5aeddb78ff41b1f655101b4d88c47473b 27-Jul-2007 Chuck Rose III <cfr@adobe.com> VStudio compiler errors and placing Function*->ExFunc map under ManagedStatic control.

This commit fixes two things. One is a pair of VStudio compiler errors stemming from variables
which defined within the for loop statement and also within the body of the for loop. I fixed these
by renaming one of the two variables. Additionally, I've made the Function*->ExFunc map in
ExternalFunctions.cpp a ManagedStatic object, so that cleanup will be done on llvm_shutdown. In repeated
uses of the interpreter, where the same Function* address may get used for completely differnet functions,
this was causing a crash.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40558 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
24857a3fac0c858cc9b8d3a5b7ba645776cc3483 19-Jul-2007 Devang Patel <dpatel@apple.com> Fix typo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40025 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
31ad75329ec8e1e3806dc767038678ce8eedb638 19-Jul-2007 Devang Patel <dpatel@apple.com> Fix dominator info update to accommodate CFG changes.
This fixes PR1559.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40024 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
fba36b8cbabcc0a457484bb2babe71a5f570435c 13-Jul-2007 Devang Patel <dpatel@apple.com> Disable claims to preserve analysis until open issues are resolved.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@39834 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
05c1dc64936c196d7242567e85710b26e8696336 07-Jul-2007 Devang Patel <dpatel@apple.com> These rountines are now available as part of basic block utilities.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37955 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
f34a43acc0bf92a972874b54ccbc88273581d24f 30-Jun-2007 Devang Patel <dpatel@apple.com> Preserve DominanceFrontier.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37820 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
6c631988c724b58a69c49af782d1eec79e46d29f 29-Jun-2007 Devang Patel <dpatel@apple.com> Do not filter loop if candidate branch is in loop header.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37792 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
eb62eca5033f3b2f22a2d09362397660bf3b05f3 28-Jun-2007 Devang Patel <dpatel@apple.com> - Undo previous check and allow loop switch for condtion that is not inside
loop.
- Avoid loop unswich for loop header branch.
- While cloning dominators fix typo and handle self dominating blocks.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37772 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
cce624a7a9c0022fc75afe2e58997ed9f53d9adc 28-Jun-2007 Devang Patel <dpatel@apple.com> Update LoopUnswitch pass to preserve DomiantorTree.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37771 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
558f1b8439847d6241cb033ba32c5aeaed0cf8ff 28-Jun-2007 Devang Patel <dpatel@apple.com> If a condition is not inside a loop then the condition is suitable
to loop unswitch candidate for the loop.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37770 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
743f7e8839dc02f2e808e977803368c431279189 06-Jun-2007 Devang Patel <dpatel@apple.com> Avoid non-trivial loop unswitching while optimizing for size.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37446 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
fd98dc9a76b0b00b3f076fb9c09f698b1b592ab1 09-May-2007 Devang Patel <dpatel@apple.com> Fix PR1333
Testcases :
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070507/049451.html
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20070507/049452.html


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36955 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
1997473cf72957d0e70322e2fe6fe2ab141c58a6 03-May-2007 Devang Patel <dpatel@apple.com> Drop 'const'


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36662 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
3e15bf33e024b9df9e89351a165acfdb1dde51ed 02-May-2007 Devang Patel <dpatel@apple.com> Use 'static const char' instead of 'static const int'.
Due to darwin gcc bug, one version of darwin linker coalesces
static const int, which defauts PassID based pass identification.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36652 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
794fd75c67a2cdc128d67342c6d88a504d186896 01-May-2007 Devang Patel <dpatel@apple.com> Do not use typeinfo to identify pass in pass manager.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36632 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
1bc89361c2ba023f305bf00edd4b5d95b021cac6 07-Mar-2007 Devang Patel <dpatel@apple.com> Now LoopUnswitch is a LoopPass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34992 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
a5dae0cac062a53edb2fc2dcd5be7658388d025a 03-Mar-2007 Reid Spencer <rspencer@reidspencer.com> Use more efficient test for one value in a ConstantInt.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34859 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
fb688d4d1c353d58c9c5f44c6a0681245c693ace 26-Feb-2007 Devang Patel <dpatel@apple.com> Use efficient container SmallPtrSet


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34640 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
5295692061b48f94d73d2016ff22f0504ccdd494 26-Feb-2007 Devang Patel <dpatel@apple.com> Do not unswitch loop on same value again and again.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34638 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
9133fe28954d498fc4de13064c7d65bd811de02c 06-Feb-2007 Reid Spencer <rspencer@reidspencer.com> Apply the VISIBILITY_HIDDEN field to the remaining anonymous classes in
the Transforms library. This reduces debug library size by 132 KB, debug
binary size by 376 KB, and reduces link time for llvm tools slightly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33939 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
5e665f559419c7f58a4fd9360cd488f065505c44 03-Feb-2007 Chris Lattner <sabre@nondot.org> Switch inliner over to use DenseMap instead of std::map for ValueMap. This
speeds up the inliner 16%.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33801 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
79066fa6acce02c97c714a5a6e151ed8a249721c 31-Jan-2007 Chris Lattner <sabre@nondot.org> Adjust #includes to match movement of constant folding code from transformutils to libanalysis.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33680 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
c10305743c313558405079452138f03124e87581 19-Jan-2007 Reid Spencer <rspencer@reidspencer.com> For PR1043:
This is the final patch for this PR. It implements some minor cleanup
in the use of IntegerType, to wit:
1. Type::getIntegerTypeMask -> IntegerType::getBitMask
2. Type::Int*Ty changed to IntegerType* from Type*
3. ConstantInt::getType() returns IntegerType* now, not Type*

This also fixes PR1120.

Patch by Sheng Zhou.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33370 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
c08b56f6a085f822e21bf3aa18a0554ed9ecd479 13-Jan-2007 Chris Lattner <sabre@nondot.org> fix a bug in a recent patch


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33164 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
579dca12c2cfd60bc18aaadbd5331897d48fec29 12-Jan-2007 Reid Spencer <rspencer@reidspencer.com> Implement review feedback for the ConstantBool->ConstantInt merge. Chris
recommended that getBoolValue be replaced with getZExtValue and that
get(bool) be replaced by get(const Type*, uint64_t). This implements
those changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33110 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
4fe16d607d11e29d742208894909733f5ad01f8f 11-Jan-2007 Reid Spencer <rspencer@reidspencer.com> Rename BoolTy as Int1Ty. Patch by Sheng Zhou.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33076 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
6b6b6ef1677fa71b1072c2911b4c1f9524a558c9 11-Jan-2007 Zhou Sheng <zhousheng00@gmail.com> For PR1043:
Merge ConstantIntegral and ConstantBool into ConstantInt.
Remove ConstantIntegral and ConstantBool from LLVM.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33073 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
e4d87aa2de6e52952dca73716386db09aad5a8fd 23-Dec-2006 Reid Spencer <rspencer@reidspencer.com> For PR950:
This patch removes the SetCC instructions and replaces them with the ICmp
and FCmp instructions. The SetCondInst instruction has been removed and
been replaced with ICmpInst and FCmpInst.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32751 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
0e5f499638c8d277b9dc4a4385712177c53b5681 19-Dec-2006 Chris Lattner <sabre@nondot.org> Switch over Transforms/Scalar to use the STATISTIC macro. For each statistic
converted, we lose a static initializer. This also allows GCC to emit warnings
about unused statistics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32690 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
ac0b6ae358944ae8b2b5a11dc08f52c3ed89f2da 06-Dec-2006 Chris Lattner <sabre@nondot.org> Detemplatize the Statistic class. The only type it is instantiated with
is 'unsigned'.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32279 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
b7427031372337e6d67f9573ec6c722ab5ea913e 26-Nov-2006 Bill Wendling <isanbard@gmail.com> Removed #include <iostream> and replaced with llvm_* streams.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31923 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
3ed469ccd7b028a030b550d84b7336d146f5d8fa 02-Nov-2006 Reid Spencer <rspencer@reidspencer.com> For PR786:
Turn on -Wunused and -Wno-unused-parameter. Clean up most of the resulting
fall out by removing unused variables. Remaining warnings have to do with
unused functions (I didn't want to delete code without review) and unused
variables in generated code. Maintainers should clean up the remaining
issues when they see them. All changes pass DejaGnu tests and Olden.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31380 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
47811b76ca92ddfebdd73c633d04ba8a4f5b7b59 29-Sep-2006 Chris Lattner <sabre@nondot.org> Eliminate ConstantBool::True and ConstantBool::False. Instead, provide
ConstantBool::getTrue() and ConstantBool::getFalse().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30665 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
4b8f36f10672bbdd747eabfb5708e4758c3d5337 30-Aug-2006 Devang Patel <dpatel@apple.com> Do not rely on std::sort and std::erase to get list of unique
exit blocks. The output is dependent on addresses of basic block.

Add and use Loop::getUniqueExitBlocks.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29966 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
7f8897f22e88271cfa114998a4d6088e7c8e8e11 28-Aug-2006 Chris Lattner <sabre@nondot.org> eliminate RegisterOpt. It does the same thing as RegisterPass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29925 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
db5b9cfd8625282aa5e08daaa8c10dd99469f0d9 19-Jul-2006 Owen Anderson <resistor@mac.com> Fix a error that hadn't yet cause any problems, but I'm sure it would have
somewhere down the road.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29197 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
372994be25cbb4687516833b9859820414399c57 28-Jun-2006 Owen Anderson <resistor@mac.com> Switch to a very conservative heuristic for determining when loop-unswitching
will be profitable. This is mainly to remove some cases where excessive
unswitching would result in long compile times and/or huge generated code.

Once someone comes up with a better heuristic that avoids these cases, this
should be switched out.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28962 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
daa2bf9a192496a456b548fbb6787cdcee183c70 28-Jun-2006 Chris Lattner <sabre@nondot.org> Don't unswitch really large loops even if they are mostly filled with empty
blocks.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28959 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
bef850873787b23aa1dc02520d8ab224660b4e5e 28-Jun-2006 Owen Anderson <resistor@mac.com> Fix for 2006-06-27-DeadSwitchCase.ll

Be more careful when updating Phi nodes after eliminating dead switch cases. Fix
proposed by Chris.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28947 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
2b67f07d2b27fca793fb825731af1750cd1e5ddd 26-Jun-2006 Owen Anderson <resistor@mac.com> Make LoopUnswitch able to unswitch loops with live-out values by taking advantage
of LCSSA. This results several times the number of unswitchings occurring on
tests such and timberwolfmc, unix-tbl, and ldecod.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28912 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
f7a121285003d7f3b970601cffdcccb5bb71fff8 14-Jun-2006 Chris Lattner <sabre@nondot.org> Fix Transforms/LoopUnswitch/2006-06-13-SingleEntryPHI.ll, a loop unswitch
bug exposed by the recent lcssa work.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28779 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
6edf399bb4a83813352bac2e6392d034955e2214 12-Jun-2006 Owen Anderson <resistor@mac.com> Reapply my 6/9 changes. The bug Evan saw no longer occurs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28759 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
b9b2b309d3195d9e2ed1e72da8566a470783e8d7 11-Jun-2006 Evan Cheng <evan.cheng@apple.com> Back out Owen's 6/9 changes. They broke MultiSource/Benchmarks/Prolangs-C/bison (and perhaps others).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28747 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
fcaf345c88bc19d0ef96bfa1eaa411cb725250ed 09-Jun-2006 Owen Anderson <resistor@mac.com> Add LCSSA as a requirement for LoopUnswitch, and assert that LoopUnswitch preserves
LCSSA.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28739 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
0f862e50aebccf893afd62bb901456d721b7f054 24-Mar-2006 Chris Lattner <sabre@nondot.org> add the actual cost to the debug info


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27051 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
f8bf116f808ecc6a9ca09cb761fe2a169e006b57 23-Feb-2006 Chris Lattner <sabre@nondot.org> Fix Regression/Transforms/LoopUnswitch/2006-02-22-UnswitchCrash.ll, which
caused SPASS to fail building last night.

We can't trivially unswitch a loop if the exit block has phi nodes in it,
because we don't know which predecessor to use.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26320 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
bd28e3f8ef5be0ceb7d5fa395cd89362a78508b8 22-Feb-2006 Chris Lattner <sabre@nondot.org> Add some comments, simplify some code, and fix a bug that caused rewriting
to rewrite with the wrong value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26311 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
a6fc94b71e2d8e4ab38a3d437fad659201d50627 18-Feb-2006 Chris Lattner <sabre@nondot.org> improved support for branch folding, still not enabled.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26289 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
db41024a8545d3b5594ab9a5ccbe7277f5097e11 18-Feb-2006 Chris Lattner <sabre@nondot.org> Implement deletion of dead blocks, currently disabled.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26285 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
caf489353605905fce38b7033987010bad910b57 18-Feb-2006 Chris Lattner <sabre@nondot.org> a previous patch completely disabled trivial unswitching, this fixees it.
Thanks to nate for pointing this out :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26280 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
f4412d890dd20af78120a793c973f319e4b506ea 18-Feb-2006 Chris Lattner <sabre@nondot.org> initial trivial support for folding branches that have now-constant destinations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26279 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
25cae0fd1ca1be2dc4b10864e0f7c8fc86ecd51d 18-Feb-2006 Chris Lattner <sabre@nondot.org> When unswitching a loop, make sure to update loop info with exit blocks in
the right loop.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26277 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
0017d480cc79eb43950a913acec85ba1207f9424 17-Feb-2006 Chris Lattner <sabre@nondot.org> Fix loops where the header has an exit, fixing a loop-unswitch crash on crafty


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26258 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
52221f7b16d452d832c61954869d6a589dd7b2a1 17-Feb-2006 Chris Lattner <sabre@nondot.org> start of some new simplification code, not thoroughly tested, use at your own
risk :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26248 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
10cd9bbde7bda0b125cb5153f330ddc1f8509bd1 16-Feb-2006 Chris Lattner <sabre@nondot.org> Change SplitBlock to increment a BasicBlock::iterator, not an Instruction*. Apparently they do different things :)

This fixes a testcase that nate reduced from spass.

Also included are a couple minor code changes that don't affect the generated
code at all.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26235 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
21c107ab0f1db3d959545ab93e369bbfcf56e573 16-Feb-2006 Jeff Cohen <jeffc@jolt-lang.org> Fix VC++ warning.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26228 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
f17c42d409ce9d981996dea11918774e84400eea 16-Feb-2006 Chris Lattner <sabre@nondot.org> fix a bug where we unswitched the wrong way


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26225 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
a48654ef23c35d9d07e5c0cb80726ec788dae93a 15-Feb-2006 Chris Lattner <sabre@nondot.org> Implement trivial unswitching for switch stmts. This allows us to trivial
unswitch this loop on 2 before sweating to unswitch on 1/3.

void test4(int N, int i, int C, int*P, int*Q) {
int j;
for (j = 0; j < N; ++j) {
switch (C) { // general unswitching.
default: P[i+j] = 0; break;
case 1: Q[i+j] = 0; break;
case 3: P[i+j] = Q[i+j]; break;
case 2: break; // TRIVIAL UNSWITCH on C==2
}
}
}


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26223 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
4e1323969c4afa60cd6675cbbaade90afe7e6632 15-Feb-2006 Chris Lattner <sabre@nondot.org> make "trivial" unswitching significantly more general. It can now handle
this for example:

for (j = 0; j < N; ++j) { // trivial unswitch
if (C)
P[i+j] = 0;
}

turning it into the obvious code without bothering to duplicate an empty loop.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26220 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
3fdde110eb55116242f9c7dd9e687cbd102beb7c 15-Feb-2006 Chris Lattner <sabre@nondot.org> Checking the wrong value. This caused us to emit silly code like
Y = seteq bool X, true
instead of just using X :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26215 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
6d9d13d2e493250b62fdf9812058a7a4dbcc6513 15-Feb-2006 Chris Lattner <sabre@nondot.org> more refactoring, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26194 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
fed5d9dbd3e2b6c8d80949dd90360f7d35c889fc 15-Feb-2006 Chris Lattner <sabre@nondot.org> pull some code out into a function


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26191 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
3dd4c402de81ed4256e12a7f1045c50defd63ddb 14-Feb-2006 Chris Lattner <sabre@nondot.org> Use statistics to keep track of what flavors of loops we are unswitching


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26157 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
c23580969fb3ac419641608bb46f4239062c187f 11-Feb-2006 Chris Lattner <sabre@nondot.org> implement unswitching of loops with switch stmts and selects in them


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26114 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
e825593bf2f8ab00878ea8086e982bf689063c79 11-Feb-2006 Chris Lattner <sabre@nondot.org> Update PHI nodes in successors of exit blocks.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26113 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
b2bc315eac9e3211aafb484479685d1a9bdee5a9 11-Feb-2006 Chris Lattner <sabre@nondot.org> Reform the unswitching code in terms of edge splitting, not block splitting.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26112 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
81be2e961be525834d2ac1ee37c880286a508151 10-Feb-2006 Chris Lattner <sabre@nondot.org> Fix a case where UnswitchTrivialCondition broke critical edges with
phi's in the successors


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26108 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
708e1a5c9c5f10879295172ec382f064b0443733 10-Feb-2006 Chris Lattner <sabre@nondot.org> add some notes, move some code around. Implement unswitching of loops
with branches on partially invariant computations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26104 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
dd3ee6d0861eda2ac86083fd2459b4036e5139dc 10-Feb-2006 Chris Lattner <sabre@nondot.org> Move code around to be more logical, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26103 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
4d1ca946ea8e5b193149661842527b782241e6d4 10-Feb-2006 Chris Lattner <sabre@nondot.org> When unswitching a trivial loop, do admit we are doing it! :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26102 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
4c41d49a9282047765df4cc101551d3fdd6f5d9f 10-Feb-2006 Chris Lattner <sabre@nondot.org> Implement unconditional unswitching of 'trivial' loops, those loops that contain
branches in their entry block that control whether or not the loop is a noop or not.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26101 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
f4f5f4e56fde2f34baff4b4daf23e1e4ec439273 09-Feb-2006 Chris Lattner <sabre@nondot.org> Simplify control flow a bit, note that unswitch preserves canonical loop form


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26098 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
e487abbfbf9fdef21e5216379b2e74436ef99c7b 09-Feb-2006 Chris Lattner <sabre@nondot.org> Make the threshold a parameter


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26093 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
2f4b898e8cecbc8d94d877834a210827312e4671 09-Feb-2006 Chris Lattner <sabre@nondot.org> Simplify the loop-unswitch pass, by not even trying to unswitch loops with
uses of loop values outside the loop. We need loop-closed SSA form to do
this right, or to use SSA rewriting if we really care.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26089 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
dac58ad983c62b49629e1f2969f4e0a621167d63 23-Jan-2006 Chris Lattner <sabre@nondot.org> Make iostream #inclusion explicit


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25514 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
fd93908ae8b9684fe71c239e3c6cfe13ff6a2663 22-Apr-2005 Misha Brukman <brukman+llvm@gmail.com> Remove trailing whitespace


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21427 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
f5e58f8f436259656886161792127b3630ab7bfd 06-Jan-2005 Jeff Cohen <jeffc@jolt-lang.org> Put createLoopUnswitchPass() into proper namespace


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19306 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
20aa474f8fbebde588edc101b90e834df28ce4ce 03-Sep-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Fixes to make LLVM compile with vc7.1.

Patch contributed by Paolo Invernizzi!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16152 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
551ccae044b0ff658fe629dd67edd5ffe75d10e8 02-Sep-2004 Reid Spencer <rspencer@reidspencer.com> Changes For Bug 352
Move include/Config and include/Support into include/llvm/Config,
include/llvm/ADT and include/llvm/Support. From here on out, all LLVM
public header files must be under include/llvm/.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16137 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Scalar/LoopUnswitch.cpp
18f16094c25d4ec7c1bede39b3f541ed56b1e96f 19-Apr-2004 Chris Lattner <sabre@nondot.org> Initial checkin of a simple loop unswitching pass. It still needs work,
but it's a start, and seems to do it's basic job.


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