History log of /external/llvm/lib/Transforms/Utils/Local.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
186f8f9d41ea5dfa219144fec3cdb4bf2dd0f64a 02-Aug-2013 Matt Arsenault <Matthew.Arsenault@amd.com> Teach getOrEnforceKnownAlignment about address spaces

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187629 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
59a3878c525657701e83bd516d27236814e29f25 24-Jul-2013 Matt Arsenault <Matthew.Arsenault@amd.com> Fix spelling

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186997 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
a18c5748989d0b2889d076a2951be17ce61d4f69 23-Jul-2013 Jakub Staszak <kubastaszak@gmail.com> Remove trailing spaces.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186890 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
c48b55a33dc5cd898dc9e58c0a1650b8f24c3879 11-Jul-2013 Duncan Sands <baldrick@free.fr> TryToSimplifyUncondBranchFromEmptyBlock was checking that any common
predecessors of the two blocks it is attempting to merge supply the
same incoming values to any phi in the successor block. This change
allows merging in the case where there is one or more incoming values
that are undef. The undef values are rewritten to match the non-undef
value that flows from the other edge. Patch by Mark Lacey.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186069 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
6227d5c690504c7ada5780c00a635b282c46e275 04-Jul-2013 Craig Topper <craig.topper@gmail.com> Use SmallVectorImpl::iterator/const_iterator instead of SmallVector to avoid specifying the vector size.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185606 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
cbafae6d33031a72ba8219c28cb0e852511f79a3 28-Jun-2013 Manman Ren <mren@apple.com> Debug Info: clean up usage of Verify.

No functionality change.
It should suffice to check the type of a debug info metadata, instead of
calling Verify. For cases where we know the type of a DI metadata, use
assert.

Also update testing cases to make them conform to the format of DI classes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185135 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
8479989ebe30f8fb9e14fbd5622fe0fd51988ff6 27-Jun-2013 Eric Christopher <echristo@gmail.com> Revert "Debug Info: clean up usage of Verify." as it's breaking bots.

This reverts commit r185020

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185032 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
02e75021d80bb068d0178f1e4fdd0a4fb36b9811 26-Jun-2013 Manman Ren <mren@apple.com> Debug Info: clean up usage of Verify.

No functionality change.
It should suffice to check the type of a debug info metadata, instead of
calling Verify.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185020 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
9d5d58a49b23d4145c8bdb12dd10fc88e37bb8f8 26-Apr-2013 Adrian Prantl <aprantl@apple.com> fix a typo that due to cu&paste quadrupled itself
rdar://problem/13056109

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180618 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
163da930235839d635ecae0c1c8e2f41d8018a24 26-Apr-2013 Adrian Prantl <aprantl@apple.com> Bugfix for the debug intrinsic handling in InstCombiner:
Since we can't guarantee that the original dbg.declare instrinsic
is removed by LowerDbgDeclare(), we need to make sure that we are
not inserting the same dbg.value intrinsic over and over.
This removes tons of redundant DIEs when compiling optimized code.

rdar://problem/13056109

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180615 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
7541cd36fdd1bd044e22497838faac7b8f7e48cd 22-Mar-2013 Evgeniy Stepanov <eugeni.stepanov@gmail.com> Fix llvm::removeUnreachableBlocks to handle unreachable loops.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177713 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.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/Utils/Local.cpp
58a2cbef4aac9ee7d530dfb690c78d6fc11a2371 02-Jan-2013 Chandler Carruth <chandlerc@gmail.com> Resort the #include lines in include/... and lib/... with the
utils/sort_includes.py script.

Most of these are updating the new R600 target and fixing up a few
regressions that have creeped in since the last time I sorted the
includes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171362 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
3a19999413b18304d1a00cbdbe73fc43ea9cb75f 24-Dec-2012 Alexey Samsonov <samsonov@google.com> Fix typo in comments

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171021 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
3333e668221f52f8c708df0037ee9c4bf2417929 21-Dec-2012 Evgeniy Stepanov <eugeni.stepanov@gmail.com> [msan] Remove unreachable blocks before instrumenting a function.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170883 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
1afbb517965e29b07cb42e2335d5eadd87de6535 12-Dec-2012 Alexey Samsonov <samsonov@google.com> Improve debug info generated with enabled AddressSanitizer.

When ASan replaces <alloca instruction> with
<offset into a common large alloca>, it should also patch
llvm.dbg.declare calls and replace debug info descriptors to mark
that we've replaced alloca with a value that stores an address
of the user variable, not the user variable itself.

See PR11818 for more context.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169984 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.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/Utils/Local.cpp
426c2bf5cdd2173e4a33aea8cb92cf684a724f4b 01-Nov-2012 Chandler Carruth <chandlerc@gmail.com> Revert the majority of the next patch in the address space series:

r165941: Resubmit the changes to llvm core to update the functions to
support different pointer sizes on a per address space basis.

Despite this commit log, this change primarily changed stuff outside of
VMCore, and those changes do not carry any tests for correctness (or
even plausibility), and we have consistently found questionable or flat
out incorrect cases in these changes. Most of them are probably correct,
but we need to devise a system that makes it more clear when we have
handled the address space concerns correctly, and ideally each pass that
gets updated would receive an accompanying test case that exercises that
pass specificaly w.r.t. alternate address spaces.

However, from this commit, I have retained the new C API entry points.
Those were an orthogonal change that probably should have been split
apart, but they seem entirely good.

In several places the changes were very obvious cleanups with no actual
multiple address space code added; these I have not reverted when
I spotted them.

In a few other places there were merge conflicts due to a cleaner
solution being implemented later, often not using address spaces at all.
In those cases, I've preserved the new code which isn't address space
dependent.

This is part of my ongoing effort to clean out the partial address space
code which carries high risk and low test coverage, and not likely to be
finished before the 3.2 release looms closer. Duncan and I would both
like to see the above issues addressed before we return to these
changes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167222 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
ece6c6bb6329748b92403c06ac87f45c43485911 01-Nov-2012 Chandler Carruth <chandlerc@gmail.com> Revert the series of commits starting with r166578 which introduced the
getIntPtrType support for multiple address spaces via a pointer type,
and also introduced a crasher bug in the constant folder reported in
PR14233.

These commits also contained several problems that should really be
addressed before they are re-committed. I have avoided reverting various
cleanups to the DataLayout APIs that are reasonable to have moving
forward in order to reduce the amount of churn, and minimize the number
of commits that were reverted. I've also manually updated merge
conflicts and manually arranged for the getIntPtrType function to stay
in DataLayout and to be defined in a plausible way after this revert.

Thanks to Duncan for working through this exact strategy with me, and
Nick Lewycky for tracking down the really annoying crasher this
triggered. (Test case to follow in its own commit.)

After discussing with Duncan extensively, and based on a note from
Micah, I'm going to continue to back out some more of the more
problematic patches in this series in order to ensure we go into the
LLVM 3.2 branch with a reasonable story here. I'll send a note to
llvmdev explaining what's going on and why.

Summary of reverted revisions:

r166634: Fix a compiler warning with an unused variable.
r166607: Add some cleanup to the DataLayout changes requested by
Chandler.
r166596: Revert "Back out r166591, not sure why this made it through
since I cancelled the command. Bleh, sorry about this!
r166591: Delete a directory that wasn't supposed to be checked in yet.
r166578: Add in support for getIntPtrType to get the pointer type based
on the address space.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167221 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
bf94e4134ca7fdd54ffaf80cd0f613adab7329df 25-Oct-2012 Micah Villmow <villmow@gmail.com> Fix a compiler warning with an unused variable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166634 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
b52fb876171e3670e7307fda4459ca005d49d9f5 24-Oct-2012 Micah Villmow <villmow@gmail.com> Add some cleanup to the DataLayout changes requested by Chandler.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166607 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
2c39b15073db81d93bb629303915b7d7e5d088dc 15-Oct-2012 Micah Villmow <villmow@gmail.com> Resubmit the changes to llvm core to update the functions to support different pointer sizes on a per address space basis.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165941 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
fb384d61c78b60787ed65475d8403aee65023962 11-Oct-2012 Micah Villmow <villmow@gmail.com> Revert 165732 for further review.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165747 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
f3840d2c16a4ec4c879a8ded402835746de380f8 11-Oct-2012 Micah Villmow <villmow@gmail.com> Add in the first iteration of support for llvm/clang/lldb to allow variable per address space pointer sizes to be optimized correctly.


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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165402 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
ad2890760f9661fb6a3dfa3ca863a87f6aea4139 14-Sep-2012 Manman Ren <mren@apple.com> PGO: preserve branch-weight metadata when simplifying a switch with a single
case to a conditional branch and when removing dead cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163942 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
ee99c7f1bfe115f8fe2d1b118010a82c1ce83f18 12-Sep-2012 Manman Ren <mren@apple.com> PGO: preserve branch-weight metadata when removing a case which jumps
to the default target.


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

This disables malloc-specific optimization when -fno-builtin (or -ffreestanding)
is specified. This has been a problem for a long time but became more severe
with the recent memory builtin improvements.

Since the memory builtin functions are used everywhere, this required passing
TLI in many places. This means that functions that now have an optional TLI
argument, like RecursivelyDeleteTriviallyDeadFunctions, won't remove dead
mallocs anymore if the TLI argument is missing. I've updated most passes to do
the right thing.

Fixes PR13694 and probably others.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@162841 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
ea4755300665eaf03599d0cc55cfdd2c27946a19 30-Jun-2012 Nuno Lopes <nunoplopes@sapo.pt> revert r159440. As Duncan pointed out, the test for invoke is not needed at this point

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159471 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
60db7966acc9462e62ccfd5075aece683149505b 29-Jun-2012 Nuno Lopes <nunoplopes@sapo.pt> ignore 'invoke new' in isInstructionTriviallyDead, since most callers are not ready to handle invokes. instcombine will take care of this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159440 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
06cb8ed00696eb14d1b831921452e50ec0568ea2 29-Jun-2012 Chandler Carruth <chandlerc@gmail.com> Move llvm/Support/IRBuilder.h -> llvm/IRBuilder.h

This was always part of the VMCore library out of necessity -- it deals
entirely in the IR. The .cpp file in fact was already part of the VMCore
library. This is just a mechanical move.

I've tried to go through and re-apply the coding standard's preferred
header sort, but at 40-ish files, I may have gotten some wrong. Please
let me know if so.

I'll be committing the corresponding updates to Clang and Polly, and
Duncan has DragonEgg.

Thanks to Bill and Eric for giving the green light for this bit of cleanup.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159421 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
16eeb6f5ebc978b03745177b9ac82684ab1c6932 29-Jun-2012 Bill Wendling <isanbard@gmail.com> The DIBuilder class is just a wrapper around debug info creation
(a.k.a. MDNodes). The module doesn't belong in Analysis. Move it to the VMCore
instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159414 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
0bcbd1df7a204e1e512f1a27066d725309de1b13 28-Jun-2012 Bill Wendling <isanbard@gmail.com> Move lib/Analysis/DebugInfo.cpp to lib/VMCore/DebugInfo.cpp and
include/llvm/Analysis/DebugInfo.h to include/llvm/DebugInfo.h.

The reasoning is because the DebugInfo module is simply an interface to the
debug info MDNodes and has nothing to do with analysis.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159312 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
47cbc4e0ee6098b7be3c60108000a979f1809949 23-Jun-2012 Stepan Dyatkovskiy <stpworld@narod.ru> Optimized usage of new SwitchInst case values (IntegersSubset type) in Local.cpp, Execution.cpp and BitcodeWriter.cpp.
I got about 1% of compile-time improvement on my machines (Ubuntu 11.10 i386 and Ubuntu 12.04 x64).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159076 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
9e72a79ef4a9fcda482ce0b0e1f0bd6a4f16cffd 21-Jun-2012 Nuno Lopes <nunoplopes@sapo.pt> refactor the MemoryBuiltin analysis:
- provide more extensive set of functions to detect library allocation functions (e.g., malloc, calloc, strdup, etc)
- provide an API to compute the size and offset of an object pointed by

Move a few clients (GVN, AA, instcombine, ...) to the new API.
This implementation is a lot more aggressive than each of the custom implementations being replaced.

Patch reviewed by Nick Lewycky and Chandler Carruth, thanks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158919 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
d9b0b025612992a0b724eeca8bdf10b1d7a5c355 02-Jun-2012 Benjamin Kramer <benny.kra@googlemail.com> Fix typos found by http://github.com/lyda/misspell-check

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157885 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
43eb31bfae470b33bab9a6764b98b5e8a0beeda5 02-Jun-2012 Stepan Dyatkovskiy <stpworld@narod.ru> PR1255: case ranges.
IntRange converted from struct to class. So main change everywhere is replacement of ".Low/High" with ".getLow/getHigh()"



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157884 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
0aa32d5d0ff6cd65b6cff957858a79e2d2a614bd 29-May-2012 Stepan Dyatkovskiy <stpworld@narod.ru> ConstantRangesSet renamed to IntegersSubset. CRSBuilder renamed to IntegersSubsetMapping.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157612 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
484fc93eff0295b1aa52b9a64d22346580e4b0e2 28-May-2012 Stepan Dyatkovskiy <stpworld@narod.ru> PR1255: Case Ranges
Implemented IntItem - the wrapper around APInt. Why not to use APInt item directly right now?
1. It will very difficult to implement case ranges as series of small patches. We got several large and heavy patches. Each patch will about 90-120 kb. If you replace ConstantInt with APInt in SwitchInst you will need to changes at the same time all Readers,Writers and absolutely all passes that uses SwitchInst.
2. We can implement APInt pool inside and save memory space. E.g. we use several switches that works with 256 bit items (switch on signatures, or strings). We can avoid value duplicates in this case.
3. IntItem can be easyly easily replaced with APInt.
4. Currenly we can interpret IntItem both as ConstantInt and as APInt. It allows to provide SwitchInst methods that works with ConstantInt for non-updated passes.

Why I need it right now? Currently I need to update SimplifyCFG pass (EqualityComparisons). I need to work with APInts directly a lot, so peaces of code
ConstantInt *V = ...;
if (V->getValue().ugt(AnotherV->getValue()) {
...
}
will look awful. Much more better this way:
IntItem V = ConstantIntVal->getValue();
if (AnotherV < V) {
}

Of course any reviews are welcome.

P.S.: I'm also going to rename ConstantRangesSet to IntegersSubset, and CRSBuilder to IntegersSubsetMapping (allows to map individual subsets of integers to the BasicBlocks).
Since in future these classes will founded on APInt, it will possible to use them in more generic ways.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157576 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
a2067fbe22930be8413584ae58c5ef78bd032190 23-May-2012 Stepan Dyatkovskiy <stpworld@narod.ru> PR1255(case ranges) related changes in Local Transformations.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157315 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
e54874471cf565bbacdca69c95ae7287badc578f 10-May-2012 Nuno Lopes <nunoplopes@sapo.pt> teach DSE and isInstructionTriviallyDead() about calloc

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156553 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
26c8dcc692fb2addd475446cfff24d6a4e958bca 04-Apr-2012 Rafael Espindola <rafael.espindola@gmail.com> Always compute all the bits in ComputeMaskedBits.
This allows us to keep passing reduced masks to SimplifyDemandedBits, but
know about all the bits if SimplifyDemandedBits fails. This allows instcombine
to simplify cases like the one in the included testcase.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154011 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
acdae3e25a03e4e08039cb18f50b7788f71c0b2e 25-Mar-2012 Chandler Carruth <chandlerc@gmail.com> Add an asserting ValueHandle to the block simplification code which will
fire if anything ever invalidates the assumption of a terminator
instruction being unchanged throughout the routine.

I've convinced myself that the current definition of simplification
precludes such a transformation, so I think getting some asserts
coverage that we don't violate this agreement is sufficient to make this
code safe for the foreseeable future.

Comments to the contrary or other suggestions are of course welcome. =]
The bots are now happy with this code though, so it appears the bug here
has indeed been fixed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153401 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
858cd1c33c6ba47cf3401b1e00862aa22302af10 25-Mar-2012 Chandler Carruth <chandlerc@gmail.com> Don't form a WeakVH around the sentinel node in the instructions BB
list. This is a bad idea. ;] I'm hopeful this is the bug that's showing
up with the MSVC bots, but we'll see.

It is definitely unnecessary. InstSimplify won't do anything to
a terminator instruction, we don't need to even include it in the
iteration range. We can also skip the now dead terminator check,
although I've made it an assert to help document that this is an
important invariant.

I'm still a bit queasy about this because there is an implicit
assumption that the terminator instruction cannot be RAUW'ed by the
simplification code. While that appears to be true at the moment, I see
no guarantee that would ensure it remains true in the future. I'm
looking at the cleanest way to solve that...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153399 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
6b980541df5846ad335c377c8803b517968daee2 24-Mar-2012 Chandler Carruth <chandlerc@gmail.com> Refactor the interface to recursively simplifying instructions to be tad
bit simpler by handling a common case explicitly.

Also, refactor the implementation to use a worklist based walk of the
recursive users, rather than trying to use value handles to detect and
recover from RAUWs during the recursive descent. This fixes a very
subtle bug in the previous implementation where degenerate control flow
structures could cause mutually recursive instructions (PHI nodes) to
collapse in just such a way that From became equal to To after some
amount of recursion. At that point, we hit the inf-loop that the assert
at the top attempted to guard against. This problem is defined away when
not using value handles in this manner. There are lots of comments
claiming that the WeakVH will protect against just this sort of error,
but they're not accurate about the actual implementation of WeakVHs,
which do still track RAUWs.

I don't have any test case for the bug this fixes because it requires
running the recursive simplification on unreachable phi nodes. I've no
way to either run this or easily write an input that triggers it. It was
found when using instruction simplification inside the inliner when
running over the nightly test-suite.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153393 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.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/Utils/Local.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/Utils/Local.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/Utils/Local.cpp
88c09143b6af07ed7b16381885a03c4b10886f96 06-Dec-2011 Benjamin Kramer <benny.kra@googlemail.com> Simplify common predecessor finding.

- Walking over pred_begin/pred_end is an expensive operation.
- PHINodes contain a value for each predecessor anyway.
- While it may look like we used to save a few iterations with the set,
be aware that getIncomingValueForBlock does a linear search on
the values of the phi node.
- Another -5% on ARMDisassembler.cpp (Release build). This was the last
entry in the profile that was obviously wasting time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145937 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
d3a38ccfbb6be0edad037961df77649db2cb9597 29-Nov-2011 Duncan Sands <baldrick@free.fr> Fix a theoretical problem (not seen in the wild): if different instances of a
weak variable are compiled by different compilers, such as GCC and LLVM, while
LLVM may increase the alignment to the preferred alignment there is no reason to
think that GCC will use anything more than the ABI alignment. Since it is the
GCC version that might end up in the final program (as the linkage is weak), it
is wrong to increase the alignment of loads from the global up to the preferred
alignment as the alignment might only be the ABI alignment.

Increasing alignment up to the ABI alignment might be OK, but I'm not totally
convinced that it is. It seems better to just leave the alignment of weak
globals alone.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145413 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
4a3935c27e5315081844a5b7ae1f7097efc234b0 24-Oct-2011 Nick Lewycky <nicholas@mxc.ca> A dead malloc, a free(NULL) and a free(undef) are all trivially dead
instructions.

This doesn't introduce any optimizations we weren't doing before (except
potentially due to pass ordering issues), now passes will eliminate them sooner
as part of their own cleanups.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142787 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
bb5b3f33594cfa40e9f53bf9a71af359b080a697 11-Oct-2011 Lang Hames <lhames@gmail.com> Add a natural stack alignment field to TargetData, and prevent InstCombine from
promoting allocas to preferred alignments that exceed the natural
alignment. This avoids some potentially expensive dynamic stack realignments.

The natural stack alignment is set in target data strings via the "S<size>"
option. Size is in bits and must be a multiple of 8. The natural stack alignment
defaults to "unspecified" (represented by a zero value), and the "unspecified"
value does not prevent any alignment promotions. Target maintainers that care
about avoiding promotions should explicitly add the "S<size>" option to their
target data strings.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@141599 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
187b1924a4b68350a6492b116db0fb19c659222f 15-Aug-2011 Bill Wendling <isanbard@gmail.com> The "landingpad" instruction will never be "trivially" dead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137642 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
3e69c13c301acee99c8bde7e692777bf856a6362 02-Aug-2011 Nick Lewycky <nicholas@mxc.ca> Lifetime intrinsics on undef are dead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136722 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
747032522f9f3b2d9bae71aa303c1a0fd953eee9 20-Jul-2011 Eli Friedman <eli.friedman@gmail.com> Clean up includes of llvm/Analysis/ConstantFolding.h so it's included where it's used and not included where it isn't.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135628 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
77a2c372face15a302f4c9e5cb9acc035b8b3bd3 30-Jun-2011 Rafael Espindola <rafael.espindola@gmail.com> Add r134057 back, but splice the predecessor after the successors phi
nodes.

Original message:
Let simplify cfg simplify bb with only debug and lifetime intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134182 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
ce77aa3edc0d07c8a2b9a613d9b57457dee43425 29-Jun-2011 Chad Rosier <mcrosier@apple.com> Temporarily revert r134057: "Let simplify cfg simplify bb with only debug and
lifetime intrinsics" due to buildbot failures.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134071 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
0fb7dcd48fd6580e3ebf35eafa952a9fe1cac8b2 29-Jun-2011 Rafael Espindola <rafael.espindola@gmail.com> Let simplify cfg simplify bb with only debug and lifetime intrinsics.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134057 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
89991d44136414c4c74eee7c6dfbdbeab287b881 28-Jun-2011 Nick Lewycky <nicholas@mxc.ca> Fix typo in comment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133990 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.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/Utils/Local.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/Utils/Local.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/Utils/Local.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/Utils/Local.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/Utils/Local.cpp
b53c7937c5651e5500b554186657b27838137365 15-Jun-2011 Eli Friedman <eli.friedman@gmail.com> Simplify; no significant functionality change.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133086 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
c827939046670a9800659b83e2048f1d3a79a531 24-May-2011 Cameron Zwarich <zwarich@apple.com> Make LoadAndStorePromoter preserve debug info and create llvm.dbg.values when
promoting allocas to SSA variables. Fixes <rdar://problem/9479036>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131953 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
5649ba70fb39f2fda4791d255ae8bb373071874f 22-May-2011 Frits van Bommel <fvbommel@gmail.com> Add a parameter to ConstantFoldTerminator() that callers can use to ask it to also clean up the condition of any conditional terminator it folds to be unconditional, if that turns the condition into dead code. This just means it calls RecursivelyDeleteTriviallyDeadInstructions() in strategic spots. It defaults to the old behavior.

I also changed -simplifycfg, -jump-threading and -codegenprepare to use this to produce slightly better code without any extra cleanup passes (AFAICT this was the only place in -simplifycfg where now-dead conditions of replaced terminators weren't being cleaned up). The only other user of this function is -sccp, but I didn't read that thoroughly enough to figure out whether it might be holding pointers to instructions that could be deleted by this.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131855 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
f88ad9aeeeb861a82f590f44484a055fcaf25b5c 18-May-2011 Matt Beaumont-Gay <matthewbg@google.com> fix typo

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131543 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
62fb3556eab41d9d66994e92d15e3e707c181988 18-May-2011 Devang Patel <dpatel@apple.com> Use IRBuiler while constant folding terminator.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131541 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
227dfdb3c44c5cc5ec140b4be89f618bdc59a133 16-May-2011 Devang Patel <dpatel@apple.com> Preserve debug info for unused zero extended boolean argument.
Radar 9422775.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131422 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
81ad03c020d7c1f73a78ce41ca713f1e425efe3d 28-Apr-2011 Devang Patel <dpatel@apple.com> Remove DbgDeclare only if all uses are converted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130431 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
1a0390253b3e7c2327139d81e5a8c16d5bf85aa8 19-Apr-2011 Jay Foad <jay.foad@gmail.com> Trivial simplification.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129759 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
562b84b3aea359d1f918184e355da82bf05eb290 11-Apr-2011 Jay Foad <jay.foad@gmail.com> Don't include Operator.h from InstrTypes.h.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129271 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
eeb7f4ce2dca47453d5e39448a4aa61c1c7d72d1 04-Apr-2011 Eli Friedman <eli.friedman@gmail.com> Attempt to fix breakage from r128782 reported by Francois Pichet on
llvm-commits. (Not sure why it only breaks on Windows; maybe it has
something to do with the iterator representation...)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128802 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
71ad2c9eda710bc26ec1621a9afefad11dd7fad2 03-Apr-2011 Eli Friedman <eli.friedman@gmail.com> PR9446: RecursivelyDeleteTriviallyDeadInstructions can delete the instruction
after the given instruction; make sure to handle that case correctly.
(It's difficult to trigger; the included testcase involves a dead
block, but I don't think that's a requirement.)

While I'm here, get rid of the unnecessary warning about
SimplifyInstructionsInBlock, since it should work correctly as far as I know.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128782 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
b99462117ebd4be41788346246d7935fc90a11ee 21-Mar-2011 Devang Patel <dpatel@apple.com> Simplify.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128030 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
36fae67831517f132255118b45b21a8cf199a012 19-Mar-2011 Devang Patel <dpatel@apple.com> If an AllocaInst referred by DbgDeclareInst is used by a LoadInst then the LoadInst should also get a corresponding llvm.dbg.value intrinsic.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127924 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
79fcad85a41b57ae69bafdfd20390b7f832223ba 19-Mar-2011 Devang Patel <dpatel@apple.com> Remove dead code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127923 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
9c5822a966572ea78f4e818870d4229c7a855749 19-Mar-2011 Devang Patel <dpatel@apple.com> Consider debug info intrinsics pointing to null value as dead instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127922 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
813c9a0f19c0d27085a3ea81eb44033747007741 17-Mar-2011 Devang Patel <dpatel@apple.com> Try to not lose variable's debug info during instcombine.
This is done by lowering dbg.declare intrinsic into dbg.value intrinsic.
Radar 9143931.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127834 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
5ee20680c7ebc765950983633e19fafab5235245 17-Mar-2011 Devang Patel <dpatel@apple.com> Refactor into a separate utility function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127832 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
2bc2a08b1bf6b5dcbfa515acc85999d6f884ec1a 04-Mar-2011 Jakob Stoklund Olesen <stoklund@2pi.dk> DenseMap<uintptr_t,...> doesn't allow all values as keys.

Avoid colliding with the sentinels, hopefully unbreaking
llvm-gcc-x86_64-linux-selfhost.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126982 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
2cfbf018a938d14126b9cb10c600e025f9831d2d 21-Feb-2011 Duncan Sands <baldrick@free.fr> If the phi node was used by an unreachable instruction that ends up using
itself without going via a phi node then we could return false here in
spite of making a change. Also, tweak the comment because this method
can (and always could) return true without deleting the original phi node.
For example, if the phi node was used by a read-only invoke instruction
which is used by another phi node phi2 which is only used by and only uses
the invoke, then phi2 would be deleted but not the invoke instruction and
not the original phi node.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126129 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
b4098ba03d51a3845bde5aeb4fca893d1a90d3f8 21-Feb-2011 Duncan Sands <baldrick@free.fr> Simplify RecursivelyDeleteDeadPHINode. The only functionality change
should be that if the phi is used by a side-effect free instruction with
no uses then the phi and the instruction now get zapped (checked by the
unittest).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126124 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
eff5e69c82096812acec0c5c6f135c755a1632d2 20-Feb-2011 Nick Lewycky <nicholas@mxc.ca> Make RecursivelyDeleteDeadPHINode delete a phi node that has no users and add a
test for that. With this change, test/CodeGen/X86/codegen-dce.ll no longer finds
any instructions to DCE, so delete the test.

Also renamed J and JP to I and IP in RecursivelyDeleteDeadPHINode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126088 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
1a4021a2be4a59e9f9010776cb6f72107241aeb5 20-Feb-2011 Nick Lewycky <nicholas@mxc.ca> Teach RecursivelyDeleteDeadPHINodes to handle multiple self-references. Patch
by Andrew Clinton!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126077 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
80f6a507d4e11ba066ad0e53e12ad25ad8cf07ba 08-Jan-2011 Cameron Zwarich <zwarich@apple.com> Make more passes preserve dominators (or state that they preserve dominators if
they all ready do). This removes two dominator recomputations prior to isel,
which is a 1% improvement in total llc time for 403.gcc.

The only potentially suspect thing is making GCStrategy recompute dominators if
it used a custom lowering strategy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123064 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
8f9ffbd056172da470bcd3a9f1d5b4c2414fce59 07-Jan-2011 Jay Foad <jay.foad@gmail.com> Remove all uses of the "ugly" method BranchInst::setUnconditionalDest().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123025 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
19282365147f498a60463d250dbed2f8e1b81861 30-Dec-2010 Benjamin Kramer <benny.kra@googlemail.com> Make a bunch of symbols internal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122642 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
ae47be1ea023e4b1e6bbbdc4687333eea54c84c8 25-Dec-2010 Chris Lattner <sabre@nondot.org> don't lose TD info


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122556 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
687140c818ba4b896329a83324714140b6580ef8 25-Dec-2010 Chris Lattner <sabre@nondot.org> Move getOrEnforceKnownAlignment out of instcombine into Transforms/Utils.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122554 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
d6f02d1fffb1f05b98905d0e4a61d8364320617c 30-Nov-2010 Chris Lattner <sabre@nondot.org> remove the pointless check of MemoryUseIntrinsic from
is trivially dead, since these have side effects. This makes the
(misnamed) MemoryUseIntrinsic class dead, so remove it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120382 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
6ac3386e100db376895dbc4a324d56d0ecd666d2 17-Nov-2010 Duncan Sands <baldrick@free.fr> Have RemovePredecessorAndSimplify you SimplifyInstruction
rather than hasConstantValue.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@119457 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
e2c6d131d12c779a410740e0a90545def75e0f48 14-Aug-2010 Dan Gohman <gohman@apple.com> Teach SimplifyCFG how to simplify indirectbr instructions.
- Eliminate redundant successors.
- Convert an indirectbr with one successor into a direct branch.

Also, generalize SimplifyCFG to be able to be run on a function entry block.
It knows quite a few simplifications which are applicable to the entry
block, and it only needs a few checks to avoid trouble with the entry block.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111060 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
35a939b97dba538bfc12010b7ac26bffbf5ec4cb 15-Jul-2010 Chris Lattner <sabre@nondot.org> make various clients of ReplaceAndSimplifyAllUses tolerate
it *changing* the things it replaces, not just causing them
to drop to null. There is no functionality change yet, but
this is required for a subsequent patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108414 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
f1b2874c68e4b5561972f77ffa7c8ff7fccb6132 12-Jul-2010 Gabor Greif <ggreif@gmail.com> cache dereferenced iterators

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104949 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.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/Utils/Local.cpp
37914c8e83c43d710925263b66014159f03fa355 15-Feb-2010 Chris Lattner <sabre@nondot.org> fix PR6305 by handling BlockAddress in a helper function
called by jump threading.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96263 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
3cb8509b680209c79632d7445709452f28213057 01-Feb-2010 Bob Wilson <bob.wilson@apple.com> Fix pr6198 by moving the isSized() check to an outer conditional.
The testcase from pr6198 does not crash for me -- I don't know what's up with
that -- so I'm not adding it to the tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94984 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
49db68fba01722ca032dc5170f8248a9d25f0199 30-Jan-2010 Bob Wilson <bob.wilson@apple.com> Check alignment of loads when deciding whether it is safe to execute them
unconditionally. Besides checking the offset, also check that the underlying
object is aligned as much as the load itself.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94875 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
963e84f9fcbbfadf69f26f1604e8a588081a6d88 29-Jan-2010 Bob Wilson <bob.wilson@apple.com> Use uint64_t instead of unsigned for offsets and sizes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94835 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
3eb4f7e2dd98038f94e45d1c45ccff49e6659c87 29-Jan-2010 Bob Wilson <bob.wilson@apple.com> Improve isSafeToLoadUnconditionally to recognize that GEPs with constant
indices are safe if the result is known to be within the bounds of the
underlying object.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94829 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
6c146eefbf75875250af37a0f1ea70fc6b4716ee 22-Jan-2010 Victor Hernandez <vhernandez@apple.com> DbgInfoIntrinsics no longer appear in an instruction's use list; so clean up looking for them in use iterations and remove OnlyUsedByDbgInfoIntrinsics()

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94111 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
e234a30a282f1aaec4aa63460fe8bba6416832a8 12-Jan-2010 Chris Lattner <sabre@nondot.org> add a helper function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93251 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
ba25f0924ef3be887fb67ed6a66f3dee77461f44 05-Jan-2010 Dan Gohman <gohman@apple.com> Nick Lewycky pointed out that this code makes changes unconditionally.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92739 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
321a813c536e2f1f2f05bbe78a7fbf64046f0557 05-Jan-2010 Dan Gohman <gohman@apple.com> Use do+while instead of while for loops which obviously have a
non-zero trip count. Use SmallVector's pop_back_val().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92734 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
90fe0bd68cdbeb980c08628c4992dffad0dc728f 05-Jan-2010 Dan Gohman <gohman@apple.com> Make RecursivelyDeleteTriviallyDeadInstructions,
RecursivelyDeleteDeadPHINode, and DeleteDeadPHIs return a flag
indicating whether they made any changes.


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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92606 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
19f2dc436df4f768484287a478973e83efd4202a 29-Dec-2009 Chris Lattner <sabre@nondot.org> prune #includes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92260 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
43a8241b65b70ded3a87fb26852719633908a1e4 02-Dec-2009 Jim Grosbach <grosbach@apple.com> Move EliminateDuplicatePHINodes() from SimplifyCFG.cpp to Local.cpp

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90324 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
a3da922a27da1b5db04bbbe6cbf4848a688b6786 11-Nov-2009 Duncan Sands <baldrick@free.fr> Don't trivially delete unused calls to llvm.invariant.start. This allows
llvm.invariant.start to be used without necessarily being paired with a call
to llvm.invariant.end. If you run the entire optimization pipeline then such
calls are in fact deleted (adce does it), but that's actually a good thing since
we probably do want them to be zapped late in the game. There should really be
an integration test that checks that the llvm.invariant.start call lasts long
enough that all passes that do interesting things with it get to do their stuff
before it is deleted. But since no passes do anything interesting with it yet
this will have to wait for later.


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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86735 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
dce94d92df77da125a1c1256a9294db891a9db9c 10-Nov-2009 Chris Lattner <sabre@nondot.org> refactor TryToSimplifyUncondBranchFromEmptyBlock out of SimplifyCFG.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86666 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
938e17663338b3b1b9f2dba21516c4c80876edb1 03-Nov-2009 Chris Lattner <sabre@nondot.org> remove a isFreeCall check: it is a callinst that can write to memory already.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85863 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
0a4c6789d5adafb6eb33080fe1833b416a152d7c 01-Nov-2009 Chris Lattner <sabre@nondot.org> constant fold indirectbr(blockaddress(%bb)) -> br label %bb.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85704 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
f006b183e2d2bebcf6968d1dd7350397c95b0325 27-Oct-2009 Victor Hernandez <vhernandez@apple.com> Rename MallocFreeHelper as MemoryBuiltins

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85286 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
f2becca90b832cc02345fba063b9b439b2be33ad 27-Oct-2009 Victor Hernandez <vhernandez@apple.com> Rename MallocHelper as MallocFreeHelper, since it now also identifies calls to free()

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85181 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
046e78ce55a7c3d82b7b6758d2d77f2d99f970bf 27-Oct-2009 Victor Hernandez <vhernandez@apple.com> Remove FreeInst.
Remove LowerAllocations pass.
Update some more passes to treate free calls just like they were treating FreeInst.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85176 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
66284e063a1e46500acae48bdc0e4a00652021d1 24-Oct-2009 Victor Hernandez <vhernandez@apple.com> Auto-upgrade free instructions to calls to the builtin free function.
Update all analysis passes and transforms to treat free calls just like FreeInst.
Remove RaiseAllocations and all its tests since FreeInst no longer needs to be raised.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84987 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
ad80981a106c9d0ec83351e63ee3ac75ed646bf4 16-Sep-2009 Andreas Neustifter <astifter-llvm@gmx.at> Preserve ProfileInfo during CodeGenPrepare.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82034 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.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/Utils/Local.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/Utils/Local.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/Utils/Local.cpp
07cf79ef537caff6d39145f190a28a336e629b6f 07-Jul-2009 Owen Anderson <resistor@mac.com> "LLVMContext* " --> "LLVMContext *"


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74878 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
0a205a459884ec745df1c529396dd921f029dafd 06-Jul-2009 Owen Anderson <resistor@mac.com> More LLVMContext-ification.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74807 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
acec7b35aa031a98dcd9ab9263445d1008ee60e5 27-Jun-2009 Devang Patel <dpatel@apple.com> Remove unused routines.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74351 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
6cc8a93c486f889c5767278508bc655942ba408e 16-Jun-2009 Chris Lattner <sabre@nondot.org> Generalize instcombine's isSafeToLoadUnconditionally() function
to ignore readonly calls, and factor it out of instcombine so
that it can be used by other passes. Patch by Frits van Bommel!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73506 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
e9d87f49063cb1bd213d8e9c339b9b63393cc2d9 06-May-2009 Dan Gohman <gohman@apple.com> Simplify code by using SmallVector's pop_back_val() instead of
separate back() and pop_back() calls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71089 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.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/Utils/Local.cpp
35738ac150afafe2359268d4b2169498c6c98c5f 05-May-2009 Dan Gohman <gohman@apple.com> Re-apply 70645, converting ScalarEvolution to use
CallbackVH, with fixes. allUsesReplacedWith need to
walk the def-use chains and invalidate all users of a
value that is replaced. SCEVs of users need to be
recalcualted even if the new value is equivalent. Also,
make forgetLoopPHIs walk def-use chains, since any
SCEV that depends on a PHI should be recalculated when
more information about that PHI becomes available.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70927 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
f9a77b77c2324b2ca5c644909ebda387daf82fe3 03-May-2009 Dan Gohman <gohman@apple.com> Revert r70645 for now; it's causing a variety of regressions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70661 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
db6fa2964176c34f0e878e101427c28782c93419 02-May-2009 Dan Gohman <gohman@apple.com> Convert ScalarEvolution to use CallbackVH for its internal map. This
makes ScalarEvolution::deleteValueFromRecords, and it's code that
subtly needed to be called before ReplaceAllUsesWith, unnecessary.

It also makes ValueDeletionListener unnecessary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70645 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
afc36a9520971832dfbebc0333593bf5d3098296 02-May-2009 Dan Gohman <gohman@apple.com> Previously, RecursivelyDeleteDeadInstructions provided an option
of returning a list of pointers to Values that are deleted. This was
unsafe, because the pointers in the list are, by nature of what
RecursivelyDeleteDeadInstructions does, always dangling. Replace this
with a simple callback mechanism. This may eventually be removed if
all clients can reasonably be expected to use CallbackVH.

Use this to factor out the dead-phi-cycle-elimination code from LSR
utility function, and generalize it to use the
RecursivelyDeleteTriviallyDeadInstructions utility function.

This makes LSR more aggressive about eliminating dead PHI cycles;
adjust tests to either be less trivial or to simply expect fewer
instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70636 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
16767c6b49659d5187ebb70c97207b0bf146ba35 18-Mar-2009 Zhou Sheng <zhousheng00@gmail.com> Revert my previous change on Local.cpp, instead, fix the bug on scalarrepl.
If the instruction has no users, it is also not only used by debug info
and should not be deleted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67194 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
df95a2f6a90d81100972ccf3a22fca4b637806ac 18-Mar-2009 Zhou Sheng <zhousheng00@gmail.com> Fix a bug.
If I->use_empty(), this method should return false.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67180 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
c79e1182470ed12f1f3d0d35c1725366519a9af7 06-Mar-2009 Devang Patel <dpatel@apple.com> Add "check/remove dbg var" helper routines.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66223 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
127a7936dea7b86e5cad337ad4b537bc115c2588 04-Mar-2009 Dale Johannesen <dalej@apple.com> Marking debug info intrinsics as not touching memory
caused them to be considered trivially dead. Fix this.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65979 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
4afc90dacf309999d8b7f6c2b4b0c56af346bab5 10-Feb-2009 Devang Patel <dpatel@apple.com> Enable scalar replacement of AllocaInst whose one of the user is dbg info.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64207 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
998cbb0444ecb597e4b46f1950561d92b5395769 05-Feb-2009 Devang Patel <dpatel@apple.com> Revert rev. 63876. It is causing llvm-gcc bootstrap failure.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63888 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
1851db6b0f9ef1b85d14b24eb9f838748396352f 05-Feb-2009 Devang Patel <dpatel@apple.com> Ignore dbg intrinsics while propagating conditional expression info.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63876 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
c1bb13f1b8794aa6f3219b3ac567f569ad78a6d1 30-Jan-2009 Gabor Greif <ggreif@gmail.com> use precise getters

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63402 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
7605730ba8eaf248a8285bb2055e131f13c15b63 28-Nov-2008 Chris Lattner <sabre@nondot.org> rewrite RecursivelyDeleteTriviallyDeadInstructions to use a more efficient
formulation that doesn't require set lookups or scanning a set.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60203 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
2872177834d83b42cd042a37299cb7089965f36b 28-Nov-2008 Chris Lattner <sabre@nondot.org> remove some weirdness that came from the LSR code that has
nothing to do with dead instruction elimination. No tests in
dejagnu depend on this, so I don't know what it was needed for.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60202 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
564c0a233010cb1ff2f9ee2d4d16870284d72487 28-Nov-2008 Chris Lattner <sabre@nondot.org> enhance RecursivelyDeleteTriviallyDeadInstructions to make
PHIs dead if they are single-value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60194 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
4f02c74a8ec8f4ca83b823146cb9c987ed79b3f6 28-Nov-2008 Chris Lattner <sabre@nondot.org> Enhance RecursivelyDeleteTriviallyDeadInstructions to optionally
return a list of deleted instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60193 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
3481f24c06b3c9de48bdd99c37547471ca8e761e 27-Nov-2008 Chris Lattner <sabre@nondot.org> remove doConstantPropagation and dceInstruction, they are just
wrappers around the interesting code and use an obscure iterator
abstraction that dates back many many years.

Move EraseDeadInstructions to Transforms/Utils and name it
RecursivelyDeleteTriviallyDeadInstructions.



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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60162 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
1adec83ae84031bfa9f0bf209c5ee6c64906a1ff 22-Jun-2008 Dan Gohman <gohman@apple.com> Use Instruction::eraseFromParent().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52606 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.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/Utils/Local.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/Utils/Local.cpp
741c0aea08feab0ebd1932aaa8dd38836b2073ea 29-Dec-2007 Chris Lattner <sabre@nondot.org> dead calls to llvm.stacksave can be deleted, even though they
have potential side-effects.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45392 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
37f3ee17d2192e52f436f640788b28c0b68db102 26-Jul-2007 Dan Gohman <gohman@apple.com> Move the GET_SIDE_EFFECT_INFO logic from isInstructionTriviallyDead
to Instruction::mayWriteToMemory, fixing a FIXME, and helping
various places that call mayWriteToMemory directly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40533 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
5520732b24a5a321140dd79af70d321c7ff3dec9 31-Jan-2007 Chris Lattner <sabre@nondot.org> move a bunch of constant folding code f rom Transforms/Utils/Local.cpp into
libanalysis/ConstantFolding.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33679 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
4973190b07d6634166d8631687c5a38162e3c15a 31-Jan-2007 Chris Lattner <sabre@nondot.org> remove now-dead code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33678 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
9fa038dc21e966dceb23f9410351e863e3ce1114 31-Jan-2007 Chris Lattner <sabre@nondot.org> Change constant folding APIs to take an optional TargetData, and change
ConstantFoldInstOperands/ConstantFoldCall to take a pointer to an array
of operands + size, instead of an std::vector.

In some cases, switch to using a SmallVector instead of a vector.
This allows us to get rid of some special case gross code that was there
to avoid the cost of constructing a vector.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33670 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.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/Utils/Local.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/Utils/Local.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/Utils/Local.cpp
3da59db637a887474c1b1346c1f3ccf53b6c4663 27-Nov-2006 Reid Spencer <rspencer@reidspencer.com> For PR950:
The long awaited CAST patch. This introduces 12 new instructions into LLVM
to replace the cast instruction. Corresponding changes throughout LLVM are
provided. This passes llvm-test, llvm/test, and SPEC CPUINT2000 with the
exception of 175.vpr which fails only on a slight floating point output
difference.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31931 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
d6c3422e3126927840683574a658a0deada903f0 08-Nov-2006 Jim Laskey <jlaskey@mac.com> Remove redundant <cmath>.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31561 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
3822ff5c71478c7c90a50ca57045fb676fcb5005 08-Nov-2006 Reid Spencer <rspencer@reidspencer.com> For PR950:
This patch converts the old SHR instruction into two instructions,
AShr (Arithmetic) and LShr (Logical). The Shr instructions now are not
dependent on the sign of their operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31542 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
b83eb6447ba155342598f0fabe1f08f5baa9164a 20-Oct-2006 Reid Spencer <rspencer@reidspencer.com> For PR950:
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31063 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
4b30fcb5f51a841d4ef2bb3ed0f29d4754aa9c46 27-May-2006 Chris Lattner <sabre@nondot.org> Refactor some code to expose an interface to constant fold and instruction given it's opcode, typeand operands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28517 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
99f2af2dee68c4fe102b7b19d5ed9e565b2a4b23 25-May-2006 Chris Lattner <sabre@nondot.org> Revert a patch that is unsafe, due to out of range array accesses in inner
array scopes possibly accessing valid memory in outer subscripts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28478 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
a04c0c417b335d15b6a6efa8092f8f3bb3a7ce16 24-May-2006 Chris Lattner <sabre@nondot.org> Patch for a new instcombine xform, patch contributed by Nick Lewycky!
This implements Transforms/InstCombine/2006-05-10-InvalidIndexUndef.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28450 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
543abdf1d0914228899061b36674fb1c6234aaff 08-Apr-2006 Chris Lattner <sabre@nondot.org> Add supprot for shufflevector


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27513 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
7224f84c15da784bd0cedcdb082f7869a6074c0d 02-Apr-2006 Chris Lattner <sabre@nondot.org> Adjust to change in Intrinsics.gen interface.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27344 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
aeebe7f208eda273041a3d31cb261bfe372ea96b 09-Mar-2006 Chris Lattner <sabre@nondot.org> use autogenerated side-effect information


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26673 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
d900c6a8b3de655bac138cfdf4b9a85b7e64ec1c 20-Jan-2006 Robert Bocchino <bocchino@illinois.edu> ConstantFoldLoadThroughGEPConstantExpr wasn't handling pointers to
packed types correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25470 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
956fd7254f976581a27ba0ee73d7707ff484d2c3 17-Jan-2006 Robert Bocchino <bocchino@illinois.edu> Constant folding support for the insertelement operation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25407 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
0b118206bf3411722707f2e5cab8fd2eedcd50d6 16-Jan-2006 Reid Spencer <rspencer@reidspencer.com> For PR411:
This patch is an incremental step towards supporting a flat symbol table.
It de-overloads the intrinsic functions by providing type-specific intrinsics
and arranging for automatically upgrading from the old overloaded name to
the new non-overloaded name. Specifically:
llvm.isunordered -> llvm.isunordered.f32, llvm.isunordered.f64
llvm.sqrt -> llvm.sqrt.f32, llvm.sqrt.f64
llvm.ctpop -> llvm.ctpop.i8, llvm.ctpop.i16, llvm.ctpop.i32, llvm.ctpop.i64
llvm.ctlz -> llvm.ctlz.i8, llvm.ctlz.i16, llvm.ctlz.i32, llvm.ctlz.i64
llvm.cttz -> llvm.cttz.i8, llvm.cttz.i16, llvm.cttz.i32, llvm.cttz.i64
New code should not use the overloaded intrinsic names. Warnings will be
emitted if they are used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25366 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
6fb3bd6a658940287789198d3207b0da04c0a4e6 14-Jan-2006 Nate Begeman <natebegeman@mac.com> Add bswap intrinsics as documented in the Language Reference


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25309 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
5522037136f6f7b7cf5818d131526e7049e2c2da 13-Jan-2006 Chris Lattner <sabre@nondot.org> it is ok to dce stacksave.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25295 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
b52ee7f5ffd189c4f21ab227c6a24061ef3378fc 10-Jan-2006 Robert Bocchino <bocchino@illinois.edu> Added support for the extractelement operation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25181 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
cbbc6b74e357afbf8fb37fdeb177ed78021092d3 27-Oct-2005 Chris Lattner <sabre@nondot.org> Fix #include order


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24044 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
a11564335749cd259d8a1391be34c1abbe302c42 27-Oct-2005 John Criswell <criswell@uiuc.edu> Move some constant folding code shared by Analysis and Transform passes
into the LLVMAnalysis library.
This allows LLVMTranform and LLVMTransformUtils to be archives and linked
with LLVMAnalysis.a, which provides any missing definitions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24036 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
32643d8e057b8ef58b1d8c915e458926f3593bdf 28-Sep-2005 Chris Lattner <sabre@nondot.org> Constant fold llvm.sqrt


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23487 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
c5f52e6da18e6e8ccb62aac2a4cb431df98e7d6d 26-Sep-2005 Chris Lattner <sabre@nondot.org> Move the ConstantFoldLoadThroughGEPConstantExpr function out of the InstCombine
pass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23444 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
a83ba0f5c934e2cdbb5724cab365ecc0b5aae6c6 05-Aug-2005 Nate Begeman <natebegeman@mac.com> Fix a fixme in CondPropagate.cpp by moving a PhiNode optimization into
BasicBlock's removePredecessor routine. This requires shuffling around
the definition and implementation of hasContantValue from Utils.h,cpp into
Instructions.h,cpp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22664 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
00b16889ab461b7ecef1c91ade101186b7f1fce2 27-Jul-2005 Jeff Cohen <jeffc@jolt-lang.org> Eliminate all remaining tabs and trailing spaces.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22523 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
94cd87f658e278102e6e10404c59991aeca2eedc 19-Jun-2005 Andrew Lenharth <andrewl@lenharth.org> prevent DCE of vaarg intrinsics. This should take care of most regressions


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22263 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
ec710c5b12af647ae90f53917122726269c18738 06-May-2005 Chris Lattner <sabre@nondot.org> DCE intrinsic instructions without side effects.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21719 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
df4945bcb53acb028da1cfb3af8b37bfc99ef667 29-Apr-2005 Reid Spencer <rspencer@reidspencer.com> Remove optimizations that don't require both operands to be constant. These
are moved to simplify-libcalls pass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21614 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
1d3b71846b128c20164af62ceadef7d0eff245fa 29-Apr-2005 Reid Spencer <rspencer@reidspencer.com> * Add constant folding for additional floating point library calls such as
sinh, cosh, etc.
* Make the name comparisons for the fp libcalls a little more efficient by
switching on the first character of the name before doing comparisons.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21611 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.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/Utils/Local.cpp
8143c2bc0de4f39bef0432a25d9a111be4767fa1 17-Oct-2004 Chris Lattner <sabre@nondot.org> Enhance hasConstantValue to ignore undef values in phi nodes. This allows it
to think that PHI[4, undef] == 4.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17096 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.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/Utils/Local.cpp
1f2b892b4b6e5989f3bfe8938901deefdbb212b1 23-Jun-2004 Brian Gaeke <gaeke@uiuc.edu> Use new IsNAN() wrapper.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14340 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
30c02f7eff8ab4a3bdc56957546abb41b0a52d3e 21-Jun-2004 Chris Lattner <sabre@nondot.org> Comment out the isnan stuff until we get a proper autoconf test for it
breaking the build on sparc is not acceptable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14277 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
afe16e174264e3902bf376d7603b0cba2a0659bf 18-Jun-2004 Brian Gaeke <gaeke@uiuc.edu> I love the smell of a freshly broken PowerPC build in the morning.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14206 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
5253f05709b11c93e807885e2af6e3302e7d3877 17-Jun-2004 Chris Lattner <sabre@nondot.org> Fix compilation problem on freebsd. Problem noted by Vladimir Merzliakov in
PR371


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14203 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
83a7049270962165579c9cfdb9f76d305b0f94bd 16-Jun-2004 Brian Gaeke <gaeke@uiuc.edu> Um, did someone make a typo or something?


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14192 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
c45ef6d395eb800c62aee61b666cd4fd890dd603 15-Jun-2004 Chris Lattner <sabre@nondot.org> Remove support for the isnan intrinsic


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14186 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
fda2cce3bf04b530d87b551cf37a80f82074893d 14-Jun-2004 Brian Gaeke <gaeke@uiuc.edu> Quick hack to get this file compiling again on Mac OS X. The right thing to do
is write an autoconf macro that checks whether __isnan or isnan actually works
**using the C++ compiler after #include <cmath>**, instead of doing it the easy
way with AC_CHECK_FUNCS().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14171 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
df497317f1cfc1566d3e1c61040593d90434fca2 13-Jun-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Add constant folding capabilities to the isunordered intrinsic.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14168 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
cf11035a6f9973d68d8eaf837d71dcf272d36b79 11-Jun-2004 Chris Lattner <sabre@nondot.org> Constant fold the isnan intrinsic


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14150 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
8dfe5705b16eeebec701f725351cc5a6102e0dfd 27-May-2004 Chris Lattner <sabre@nondot.org> Implement constant folding of fmod, which is used a lot in povray


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13823 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
b18b9d73740dd9f6f9fd746fb19c463817f8fdf1 27-May-2004 Chris Lattner <sabre@nondot.org> Restructure call constant folding code a bit to make it simpler
Add support for acos/asin/atan. 188.ammp contains three calls to acos with
constant arguments. Constant folding it allows elimination of those 3 calls
and three FP divisions of the results.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13821 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
09233fb86e237715d138db5dc5b72ada386089f2 21-Apr-2004 Alkis Evlogimenos <alkis@evlogimenos.com> Include cerrno (gcc-3.4 fix)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13091 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
f5b9eb37a92a36e80bacc21a89f538731ed63aa2 17-Apr-2004 Chris Lattner <sabre@nondot.org> Add support for evaluation of exp/log/log10/pow


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13011 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
c598517c24c2ee87acafd67643b9a19bda8514af 16-Apr-2004 Brian Gaeke <gaeke@uiuc.edu> Include <cmath> for compatibility with gcc 3.0.x (the system compiler on
Debian.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12986 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
25b8390bf23ed35640664d244951d684c5a7b132 13-Apr-2004 Chris Lattner <sabre@nondot.org> Add a simple call constant propagation interface.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12919 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
17fd273512037da9838240b522619f4a6d2792b7 12-Mar-2004 Chris Lattner <sabre@nondot.org> Add constant folding wrapper support for select instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12319 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
7822c2ae077429d7bf6eb3f6ebf99d61f359b601 12-Jan-2004 Chris Lattner <sabre@nondot.org> Clean up #includes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10799 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
c6646ebdb957a3c613d389be8b0135271b8b8ece 12-Jan-2004 Chris Lattner <sabre@nondot.org> Remove use of ConstantExpr::getShift


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10792 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
81ebc300891a81c305258aed980567514dff952d 12-Jan-2004 Chris Lattner <sabre@nondot.org> Remove use of ConstantHandling


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10789 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
8f90b005d6649bca12b8016f35b31f2826799499 12-Jan-2004 Chris Lattner <sabre@nondot.org> Move llvm::ConstantFoldInstruction from VMCore to here, next to ConstantFoldTerminator


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10785 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
abbc2dd77908f146f73f4cd1abfdfe47faacf43d 19-Dec-2003 Chris Lattner <sabre@nondot.org> Add new function


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10529 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
d0fde30ce850b78371fd1386338350591f9ff494 11-Nov-2003 Brian Gaeke <gaeke@uiuc.edu> Put all LLVM code into the llvm namespace, as per bug 109.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9903 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
b576c94c15af9a440f69d9d03c2afead7971118c 20-Oct-2003 John Criswell <criswell@uiuc.edu> Added LLVM project notice to the top of every C++ source file.
Header files will be on the way.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9298 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
7d6c24cdbf41522818ec9ae7b8d3b624660853c1 24-Aug-2003 Chris Lattner <sabre@nondot.org> Implement SimplifyCFG/2003-08-17-FoldSwitch.ll:test5


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8093 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
10b1f5a94196f27c75c950ba7ed26bd0a62c91e9 17-Aug-2003 Chris Lattner <sabre@nondot.org> Implement folding of switch instructions.
Implements SimplifyCFG/2003-08-17-FoldSwitch.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7923 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
694e37f08a7c09ccc24642532106295cf7b3a1e3 17-Aug-2003 Chris Lattner <sabre@nondot.org> Fix bug: SimplifyCFG/2003-08-17-BranchFoldOrdering.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7921 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
342a9d1464ed3483b45b0ca47c0b130ba080c938 17-Aug-2003 Chris Lattner <sabre@nondot.org> The fixme is irrelevant: if that happens, the LLVM bytecode is malformed.
This fixes testcase: SimplifyCFG/2003-08-17-BranchFold.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7919 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
82c89b9f3a9b88bb63ce13b09b4f27fbb72f66fc 20-May-2003 Misha Brukman <brukman+llvm@gmail.com> Hopefully, the final fix for `[Pp]ropogate'.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6251 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
f0a93ed9c59d706494496c6fe4e8354864d24aa7 24-Feb-2003 Chris Lattner <sabre@nondot.org> Rename Instruction::hasSideEffects() -> mayWriteToMemory()


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5620 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
18961504fc2b299578dba817900a0696cf3ccc4d 25-Jun-2002 Chris Lattner <sabre@nondot.org> *** empty log message ***


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2777 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
16da494c81a09ea4273e7f3e7ad12eec68b05468 26-May-2002 Chris Lattner <sabre@nondot.org> Simplify the interface to local DCE and Constant prop


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2749 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
76ae3445f81164aaff9f95123426109c119f27c0 21-May-2002 Chris Lattner <sabre@nondot.org> Simplify interface to ConstantFoldTerminator


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2697 91177308-0d34-0410-b5e6-96231b3b80d8
/external/llvm/lib/Transforms/Utils/Local.cpp
4d1e46e7b06534cde262d32fad038135f406b6b7 07-May-2002 Chris Lattner <sabre@nondot.org> Add code pulled out of TransformInternals.cpp, ConstProp.cpp, and DCE.cpp


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