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

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

Change-Id: Ib97bd980b59f18142a69506400911a6009d9df18
rgumentPromotion.cpp
eadArgumentElimination.cpp
unctionAttrs.cpp
lobalDCE.cpp
lobalOpt.cpp
ergeFunctions.cpp
assManagerBuilder.cpp
dce4a407a24b04eebc6a376f8e62b41aaa7b071f 29-May-2014 Stephen Hines <srhines@google.com> Update LLVM for 3.5 rebase (r209712).

Change-Id: I149556c940fb7dc92d075273c87ff584f400941f
rgumentPromotion.cpp
onstantMerge.cpp
eadArgumentElimination.cpp
xtractGV.cpp
unctionAttrs.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
nlineAlways.cpp
nlineSimple.cpp
nliner.cpp
nternalize.cpp
oopExtractor.cpp
ergeFunctions.cpp
artialInlining.cpp
assManagerBuilder.cpp
runeEH.cpp
tripDeadPrototypes.cpp
tripSymbols.cpp
36b56886974eae4f9c5ebc96befd3e7bfe5de338 24-Apr-2014 Stephen Hines <srhines@google.com> Update to LLVM 3.5a.

Change-Id: Ifadecab779f128e62e430c2b4f6ddd84953ed617
ndroid.mk
rgumentPromotion.cpp
arrierNoopPass.cpp
onstantMerge.cpp
eadArgumentElimination.cpp
xtractGV.cpp
unctionAttrs.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
PO.cpp
nlineAlways.cpp
nlineSimple.cpp
nliner.cpp
nternalize.cpp
LVMBuild.txt
oopExtractor.cpp
ergeFunctions.cpp
artialInlining.cpp
assManagerBuilder.cpp
runeEH.cpp
tripDeadPrototypes.cpp
tripSymbols.cpp
ce9904c6ea8fd669978a8eefb854b330eb9828ff 12-Feb-2014 Stephen Hines <srhines@google.com> Merge remote-tracking branch 'upstream/release_34' into merge-20140211

Conflicts:
lib/Linker/LinkModules.cpp
lib/Support/Unix/Signals.inc

Change-Id: Ia54f291fa5dc828052d2412736e8495c1282aa64
dd36ddfaec578968b163fc4bbb7148921084aa6e 14-Dec-2013 Bill Wendling <isanbard@gmail.com> Merging r197178:
------------------------------------------------------------------------
r197178 | hfinkel | 2013-12-12 12:45:24 -0800 (Thu, 12 Dec 2013) | 9 lines

Fix a use-after-free error in GlobalOpt CleanupConstantGlobalUsers

GlobalOpt's CleanupConstantGlobalUsers function uses a worklist array to manage
constant users to be visited. The pointers in this array need to be weak
handles because when we delete a constant array, we may also be holding a
pointer to one of its elements (or an element of one of its elements if we're
dealing with an array of arrays) in the worklist.

Fixes PR17347.
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_34@197322 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
c877b10446669bf107c19cab78b920ce9cffb989 09-Dec-2013 Manman Ren <manman.ren@gmail.com> Merging r195505:
------------------------------------------------------------------------
r195505 | mren | 2013-11-22 14:06:31 -0800 (Fri, 22 Nov 2013) | 8 lines

Debug Info: move StripDebugInfo from StripSymbols.cpp to DebugInfo.cpp.

We can share the implementation between StripSymbols and dropping debug info
for metadata versions that do not match.

Also update the comments to match the implementation. A follow-on patch will
drop the "Debug Info Version" module flag in StripDebugInfo.

------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_34@196816 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
fcb80cc5656e4672702e3150bfe425f4a58b7a65 27-Nov-2013 Bill Wendling <isanbard@gmail.com> Merging r195769:
------------------------------------------------------------------------
r195769 | dyatkovskiy | 2013-11-26 08:11:03 -0800 (Tue, 26 Nov 2013) | 27 lines

PR17925 bugfix.

Short description.

This issue is about case of treating pointers as integers.
We treat pointers as different if they references different address space.
At the same time, we treat pointers equal to integers (with machine address
width). It was a point of false-positive. Consider next case on 32bit machine:

void foo0(i32 addrespace(1)* %p)
void foo1(i32 addrespace(2)* %p)
void foo2(i32 %p)

foo0 != foo1, while
foo1 == foo2 and foo0 == foo2.

As you can see it breaks transitivity. That means that result depends on order
of how functions are presented in module. Next order causes merging of foo0
and foo1: foo2, foo0, foo1
First foo0 will be merged with foo2, foo0 will be erased. Second foo1 will be
merged with foo2.
Depending on order, things could be merged we don't expect to.

The fix:
Forbid to treat any pointer as integer, except for those, who belong to address space 0.


------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_34@195810 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
3343ddf466b414f811048dc9f3be2d55ffbb9658 25-Nov-2013 Bill Wendling <isanbard@gmail.com> Merging r195477:
------------------------------------------------------------------------
r195477 | rafael | 2013-11-22 09:58:12 -0800 (Fri, 22 Nov 2013) | 13 lines

Add a fixed version of r195470 back.

The fix is simply to use CurI instead of I when handling aliases to
avoid accessing a invalid iterator.

original message:

Convert linkonce* to weak* instead of strong.

Also refactor the logic into a helper function. This is an important improve
on mingw where the linker complains about mixed weak and strong symbols.
Converting to weak ensures that the symbol is not dropped, but keeps in a
comdat, making the linker happy.
------------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/branches/release_34@195603 91177308-0d34-0410-b5e6-96231b3b80d8
xtractGV.cpp
c8dc96be28fd1a3d6ddebbb48b8d55b61e4bd89b 17-Nov-2013 Hal Finkel <hfinkel@anl.gov> Add a loop rerolling flag to the PassManagerBuilder

This adds a boolean member variable to the PassManagerBuilder to control loop
rerolling (just like we have for unrolling and the various vectorization
options). This is necessary for control by the frontend. Loop rerolling remains
disabled by default at all optimization levels.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194966 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
bebe48dbfe00078329341945bfb11f778ace6d12 17-Nov-2013 Hal Finkel <hfinkel@anl.gov> Add a loop rerolling pass

This adds a loop rerolling pass: the opposite of (partial) loop unrolling. The
transformation aims to take loops like this:

for (int i = 0; i < 3200; i += 5) {
a[i] += alpha * b[i];
a[i + 1] += alpha * b[i + 1];
a[i + 2] += alpha * b[i + 2];
a[i + 3] += alpha * b[i + 3];
a[i + 4] += alpha * b[i + 4];
}

and turn them into this:

for (int i = 0; i < 3200; ++i) {
a[i] += alpha * b[i];
}

and loops like this:

for (int i = 0; i < 500; ++i) {
x[3*i] = foo(0);
x[3*i+1] = foo(0);
x[3*i+2] = foo(0);
}

and turn them into this:

for (int i = 0; i < 1500; ++i) {
x[i] = foo(0);
}

There are two motivations for this transformation:

1. Code-size reduction (especially relevant, obviously, when compiling for
code size).

2. Providing greater choice to the loop vectorizer (and generic unroller) to
choose the unrolling factor (and a better ability to vectorize). The loop
vectorizer can take vector lengths and register pressure into account when
choosing an unrolling factor, for example, and a pre-unrolled loop limits that
choice. This is especially problematic if the manual unrolling was optimized
for a machine different from the current target.

The current implementation is limited to single basic-block loops only. The
rerolling recognition should work regardless of how the loop iterations are
intermixed within the loop body (subject to dependency and side-effect
constraints), but the significant restriction is that the order of the
instructions in each iteration must be identical. This seems sufficient to
capture all current use cases.

This pass is not currently enabled by default at any optimization level.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194939 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
c160efc28b815dbea73f0243f0729c1f0e1fabdb 15-Nov-2013 Manman Ren <manman.ren@gmail.com> ArgumentPromotion: correctly transfer TBAA tags and alignments.

We used to use std::map<IndicesVector, LoadInst*> for OriginalLoads, and when we
try to promote two arguments, they will both write to OriginalLoads causing
created loads for the two arguments to have the same original load. And the same
tbaa tag and alignment will be put to the created loads for the two arguments.

The fix is to use std::map<std::pair<Argument*, IndicesVector>, LoadInst*>
for OriginalLoads, so each Argument will write to different parts of the map.

PR17906


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194846 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
46456f6a2ff5b81a3ea60bdcf9a0813c9fa4257f 12-Nov-2013 Rafael Espindola <rafael.espindola@gmail.com> Corruptly merge constants with explicit and implicit alignments.

Constant merge can merge a constant with implicit alignment with one that has
explicit alignment. Before this change it was assuming that the explicit
alignment was higher than the implicit one, causing the result to be under
aligned in some cases.

Fixes pr17815.

Patch by Chris Smowton!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194506 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
432bdf65719c521206daaf90970505bea027c944 10-Nov-2013 Matt Arsenault <Matthew.Arsenault@amd.com> Teach MergeFunctions about address spaces

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194342 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
6f744ee498357155d3b0b6466b2f34a785c9c435 04-Nov-2013 Shuxin Yang <shuxin.llvm@gmail.com> Remove dead code

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@194017 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
42864070b016976b87c64830395e96ae0e49279c 03-Nov-2013 David Majnemer <david.majnemer@gmail.com> Spell "Actual" correctly


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193954 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
7e667c56cf7e27ff521ceb86518beab32bfb630d 31-Oct-2013 Rafael Espindola <rafael.espindola@gmail.com> Use LTO_SYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDEN instead of the "dso list".

There are two ways one could implement hiding of linkonce_odr symbols in LTO:
* LLVM tells the linker which symbols can be hidden if not used from native
files.
* The linker tells LLVM which symbols are not used from other object files,
but will be put in the dso symbol table if present.

GOLD's API is the second option. It was implemented almost 1:1 in llvm by
passing the list down to internalize.

LLVM already had partial support for the first option. It is also very similar
to how ld64 handles hiding these symbols when *not* doing LTO.

This patch then
* removes the APIs for the DSO list.
* marks LTO_SYMBOL_SCOPE_DEFAULT_CAN_BE_HIDDEN all linkonce_odr unnamed_addr
global values and other linkonce_odr whose address is not used.
* makes the gold plugin responsible for handling the API mismatch.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193800 91177308-0d34-0410-b5e6-96231b3b80d8
PO.cpp
nternalize.cpp
assManagerBuilder.cpp
c143c7573bfd0d55cf283cc2676dbd852f939c87 31-Oct-2013 Rafael Espindola <rafael.espindola@gmail.com> Merge CallGraph and BasicCallGraph.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193734 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
unctionAttrs.cpp
nlineAlways.cpp
nlineSimple.cpp
runeEH.cpp
69bd41dfe33f24414be281ba5e2204b7348c33ae 27-Oct-2013 Shuxin Yang <shuxin.llvm@gmail.com> Revert r193251 : Use address-taken to disambiguate global variable and indirect memops.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193489 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
8e3851a6eb9fe5fc30094c3a00d2b89c7cd68cbd 23-Oct-2013 Shuxin Yang <shuxin.llvm@gmail.com> Use address-taken to disambiguate global variable and indirect memops.

Major steps include:
1). introduces a not-addr-taken bit-field in GlobalVariable
2). GlobalOpt pass sets "not-address-taken" if it proves a global varirable
dosen't have its address taken.
3). AA use this info for disambiguation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193251 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
d114b41e62d8b784a9a48644d72489eba37c8a31 22-Oct-2013 Eric Christopher <echristo@gmail.com> Fix spelling, grammar, and match naming convention for test files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193130 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
244d24597497c09ab68969c8bbbdf2576130262c 21-Oct-2013 Matt Arsenault <Matthew.Arsenault@amd.com> Use more type helper functions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193109 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
713cab059ebb67c2f51d8da9d8e57be2b1dcd9c2 21-Oct-2013 Rafael Espindola <rafael.espindola@gmail.com> Optimize more linkonce_odr values during LTO.

When a linkonce_odr value that is on the dso list is not unnamed_addr
we can still look to see if anything is actually using its address. If
not, it is safe to hide it.

This patch implements that by moving GlobalStatus to Transforms/Utils
and using it in Internalize.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193090 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
nternalize.cpp
fe16848601bdde6e3a5e0860199169dd171222a4 19-Oct-2013 Nadav Rotem <nrotem@apple.com> Mark some command line flags as hidden

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@193013 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
b75fcecb0ff2f22e79454ce9ed7c246792bdbf0d 17-Oct-2013 Rafael Espindola <rafael.espindola@gmail.com> Rename fields of GlobalStatus to match the coding style.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192910 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
9bb874cea257753349854106a994999981290259 17-Oct-2013 Rafael Espindola <rafael.espindola@gmail.com> rename SafeToDestroyConstant to isSafeToDestroyConstant and clang-format.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192907 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
4a7cef2202893d74caf5aa817aa40d1a67c8de46 17-Oct-2013 Rafael Espindola <rafael.espindola@gmail.com> Simplify the interface of AnalyzeGlobal a bit and rename to analyzeGlobal.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192906 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
e0409098aee1270164a7e453e450264f8e62cbfd 09-Oct-2013 Shuxin Yang <shuxin.llvm@gmail.com> Fix a bug in Dead Argument Elimination.

If a function seen at compile time is not necessarily the one linked to
the binary being built, it is illegal to change the actual arguments
passing to it.

e.g.
--------------------------
void foo(int lol) {
// foo() has linkage satisifying isWeakForLinker()
// "lol" is not used at all.
}

void bar(int lo2) {
// xform to foo(undef) is illegal, as compiler dose not know which
// instance of foo() will be linked to the the binary being built.
foo(lol2);
}
-----------------------------

Such functions can be captured by isWeakForLinker(). NOTE that
mayBeOverridden() is insufficient for this purpose as it dosen't include
linkage types like AvailableExternallyLinkage and LinkOnceODRLinkage.
Take link_odr* as an example, it indicates a set of *EQUIVALENT* globals
that can be merged at link-time. However, the semantic of
*EQUIVALENT*-functions includes parameters. Changing parameters breaks
the assumption.

Thank John McCall for help, especially for the explanation of subtle
difference between linkage types.

rdar://11546243


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192302 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
23eb90714bb6a5a7d94a262f439b5bf872733cf1 07-Oct-2013 Alexey Samsonov <samsonov@google.com> Revert r191834 until we measure the effect of this benchmarks and maybe find a better way to fix it

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@192121 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
438900938c3ac9d7fac2dd5d2c85ca4b9b2e35f7 03-Oct-2013 Rafael Espindola <rafael.espindola@gmail.com> Optimize linkonce_odr unnamed_addr functions during LTO.

Generalize the API so we can distinguish symbols that are needed just for a DSO
symbol table from those that are used from some native .o.

The symbols that are only wanted for the dso symbol table can be dropped if
llvm can prove every other dso has a copy (linkonce_odr) and the address is not
important (unnamed_addr).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191922 91177308-0d34-0410-b5e6-96231b3b80d8
PO.cpp
nternalize.cpp
assManagerBuilder.cpp
6ffce6fa9295699078f81fabb9ca32f6f22bdf09 02-Oct-2013 Alexey Samsonov <samsonov@google.com> Remove "localize global" optimization

Summary:
As discussed in http://llvm-reviews.chandlerc.com/D1754,
this optimization isn't really valid for C, and fires too rarely anyway.

Reviewers: rafael, nicholas

Reviewed By: nicholas

CC: rnk, llvm-commits, nicholas

Differential Revision: http://llvm-reviews.chandlerc.com/D1769

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191834 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
187c774a7650e4bbbaac175cb6509f709edba593 01-Oct-2013 Matt Arsenault <Matthew.Arsenault@amd.com> Don't merge tiny functions.

It's silly to merge functions like these:

define void @foo(i32 %x) {
ret void
}

define void @bar(i32 %x) {
ret void
}

to get

define void @bar(i32) {
tail call void @foo(i32 %0)
ret void
}

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191786 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
0d293e45b66c742fdbc3998209bb20ed6c5806bf 22-Sep-2013 Benjamin Kramer <benny.kra@googlemail.com> Provide basic type safety for array_pod_sort comparators.

This makes using array_pod_sort significantly safer. The implementation relies
on function pointer casting but that should be safe as we're dealing with void*
here.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191175 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
80361492ae7ea9fedbb5a55c72d4aea6a3d600b1 17-Sep-2013 Stepan Dyatkovskiy <stpworld@narod.ru> Bugfix for PR17099:
Wrong cast operation.
MergeFunctions emits Bitcast instead of pointer-to-integer operation.
Patch fixes MergeFunctions::writeThunk function. It replaces
unconditional Bitcast creation with "Value* createCast(...)" method, that
checks operand types and selects proper instruction.
See unit-test as example.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190859 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
1e3037f0be430ef2339838bbdede11f45658bd82 16-Sep-2013 Peter Collingbourne <peter@pcc.me.uk> Implement function prefix data as an IR feature.

Previous discussion:
http://lists.cs.uiuc.edu/pipermail/llvmdev/2013-July/063909.html

Differential Revision: http://llvm-reviews.chandlerc.com/D1191

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190773 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
9a8392b8acf2803f344060f21b0ce4a07df3de7e 13-Sep-2013 Duncan Sands <baldrick@free.fr> Avoid a compiler warning about Found not being used when assertions are
disabled.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190668 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
cf16bae9fe1b566e3f6a011df6805426767610b7 11-Sep-2013 Matt Arsenault <Matthew.Arsenault@amd.com> Use type form of getIntPtrType

This doesn't change anything since malloc always returns
address space 0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190498 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
b1c54930cb1450534d6f3f0ebd81eb1e042a3246 10-Sep-2013 Eli Friedman <eli.friedman@gmail.com> Don't shrink atomic ops to bool in GlobalOpt.

LLVM IR doesn't currently allow atomic bool load/store operations, and the
transformation is dubious anyway because it isn't profitable on all platforms.

PR17163.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190357 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
466fa17aba4014d8ce1e42e9f5622f5b872949f3 05-Sep-2013 Rafael Espindola <rafael.espindola@gmail.com> Remove unused argument.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190090 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
a83aeae350d822ec84ded34ff3fdf1e0917d3bfd 05-Sep-2013 Nick Lewycky <nicholas@mxc.ca> Declare missing dependency on AliasAnalysis. Patch by Liu Xin!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190035 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
775079c227083be3fe22f6ae071d5b74a7ade745 04-Sep-2013 Rafael Espindola <rafael.espindola@gmail.com> Rename some variables to match the style guide.

I am about to patch this code, and this makes the diff far more readable.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189982 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
1d7df349ab7fa051ffe88589b06a1aa514f84a00 04-Sep-2013 Rafael Espindola <rafael.espindola@gmail.com> Small simplification given that insert of an empty range is a nop.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189971 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
0fb771667eb2f8a5cd623ce0ee3775b4d1416576 04-Sep-2013 Rafael Espindola <rafael.espindola@gmail.com> Refactor duplicated logic to a helper function.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189969 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
8b08904e6c7fae76a1df500c154671dcb4d00b10 04-Sep-2013 Rafael Espindola <rafael.espindola@gmail.com> Remove dead code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189967 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
9718158222ad9c52b2fb14609a341d4e24def8bb 04-Sep-2013 Rafael Espindola <rafael.espindola@gmail.com> Revert "Add r159136 back now that pr13124 has been fixed."

This reverts commit r189886.

I found a corner case where this optimization is not valid:

Say we have a "linkonce_odr unnamed_addr" in two translation units:
* In TU 1 this optimization kicks in and makes it hidden.
* In TU 2 it gets const merged with a constant that is *not* unnamed_addr,
resulting in a non unnamed_addr constant with default visibility.
* The static linker rules for combining visibility them produce a hidden
symbol, which is incorrect from the point of view of the non unnamed_addr
constant.

The one place we can do this is when we know that the symbol is not used from
another TU in the same shared object, i.e., during LTO. I will move it there.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189954 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
79869ee59abc3aeebda6e15540273a7e5936adb4 04-Sep-2013 Rafael Espindola <rafael.espindola@gmail.com> Add r159136 back now that pr13124 has been fixed.

Original message:
If a constant or a function has linkonce_odr linkage and unnamed_addr, mark
hidden. Being linkonce_odr guarantees that it is available in every dso that
needs it. Being a constant/function with unnamed_addr guarantees that the
copies don't have to be merged.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189886 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
7b15c0afc1403c451e32d6ae4ecc43a83af496be 03-Sep-2013 Nadav Rotem <nrotem@apple.com> Enable late-vectorization by default.
This patch changes the default setting for the LateVectorization flag that controls where the loop-vectorizer is ran.

Perf gains:
SingleSource/Benchmarks/Shootout/matrix -37.33%
MultiSource/Benchmarks/PAQ8p/paq8p -22.83%
SingleSource/Benchmarks/Linpack/linpack-pc -16.22%
SingleSource/Benchmarks/Shootout-C++/ary3 -15.16%
MultiSource/Benchmarks/TSVC/NodeSplitting-flt/NodeSplitting-flt -10.34%
MultiSource/Benchmarks/TSVC/NodeSplitting-dbl/NodeSplitting-dbl -7.12%

Regressions:
SingleSource/Benchmarks/Misc/lowercase 15.10%
MultiSource/Benchmarks/TSVC/Equivalencing-flt/Equivalencing-flt 13.18%
SingleSource/Benchmarks/Shootout-C++/matrix 8.27%
SingleSource/Benchmarks/CoyoteBench/lpbench 7.30%



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189858 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
86d49563a65b3990d8ea7dac62d9222c1fd3b1cf 30-Aug-2013 Bill Wendling <isanbard@gmail.com> Compulsive reformatting.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189697 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
6e4d93b2325b268d5394b82201c1a782cca78fae 30-Aug-2013 Bill Wendling <isanbard@gmail.com> Random cleanup: No need to use a std::vector here, since createInternalizePass uses an ArrayRef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189632 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
f1cd7983b195b2ab9c106c88b4da82983fe63f92 29-Aug-2013 Nadav Rotem <nrotem@apple.com> Vectorizer/PassManager: I am working on moving the vectorizer out of the SCC passes. This patch moves the SLP-vectorizer and BB-vectorizer back into SCC passes for two reasons:
1. They are a kind of cannonicalization.
2. The performance measurements show that it is better to keep them in.

There should be no functional change if you are not enabling the LateVectorization mode.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189539 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
435798e96a64738b55a01055dde1bc9a88a15191 28-Aug-2013 Hal Finkel <hfinkel@anl.gov> Disable unrolling in the loop vectorizer when disabled in the pass manager

When unrolling is disabled in the pass manager, the loop vectorizer should also
not unroll loops. This will allow the -fno-unroll-loops option in Clang to
behave as expected (even for vectorizable loops). The loop vectorizer's
-force-vector-unroll option will (continue to) override the pass-manager
setting (including -force-vector-unroll=0 to force use of the internal
auto-selection logic).

In order to test this, I added a flag to opt (-disable-loop-unrolling) to force
disable unrolling through opt (the analog of -fno-unroll-loops in Clang). Also,
this fixes a small bug in opt where the loop vectorizer was enabled only after
the pass manager populated the queue of passes (the global_alias.ll test needed
a slight update to the RUN line as a result of this fix).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189499 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
442d5f6c4b2395914c5970012916ce3746a39c39 27-Aug-2013 Michael Gottesman <mgottesman@apple.com> Fixed typo.

Noticed by Stephen Checkoway <s@pahtak.org>.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189312 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
e0e66b9dfaca5f9cae3bba563b05a6230d64e21d 23-Aug-2013 Michael Gottesman <mgottesman@apple.com> Update StripDeadDebugInfo to use DebugInfoFinder so that it is no longer stale to the point of not working and more resilient to debug info changes.

The current version of StripDeadDebugInfo became stale and no longer actually
worked since it was expecting an older version of debug info.

This patch updates it to use DebugInfoFinder and the modern DebugInfo classes as
much as possible to make it more redundent to such changes. Additionally, the
only place where that was avoided (the code where we replace the old sets with
the new), I call verify on the DIContextUnit implying that if the format changes
and my live set changes no longer make sense an assert will be hit. In order to
ensure that that occurs I have included a test case.

The actual stripping of the dead debug info follows the same strategy as was
used before in this class: find the live set and replace the old set in the
given compile unit (which may contain dead global variables/functions) with the
new live one.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@189078 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
55d4c38074145bf9f594142b6b4cdca60699f4d1 22-Aug-2013 Michael Gottesman <mgottesman@apple.com> Fixed typo.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188957 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
4920bf77be434681a4f782c80ca0ab982abfb726 22-Aug-2013 Michael Gottesman <mgottesman@apple.com> Removed trailing whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188956 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
ceda68fe2430e0e3c8bec5487d66881f34b275ed 13-Aug-2013 Arnold Schwaighofer <aschwaighofer@apple.com> Also remove logic in LateVectorize

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188285 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
b6171c529670e5c240aaf9c08f5f1b6dba9d16fc 13-Aug-2013 Arnold Schwaighofer <aschwaighofer@apple.com> Remove logic that decides whether to vectorize or not depending on O-levels

I have moved this logic into clang and opt.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188281 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
d275ff5d4c4f4f8bf9a77acd70605caa98c14246 12-Aug-2013 Bill Wendling <isanbard@gmail.com> Move stack protector names to the same place.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@188198 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
fab2daa4a1127ecb217abe2b07c1769122b6fee1 08-Aug-2013 Stephen Hines <srhines@google.com> Merge commit '10251753b6897adcd22cc981c0cc42f348c109de' into merge-20130807

Conflicts:
lib/Archive/ArchiveReader.cpp
lib/Support/Unix/PathV2.inc

Change-Id: I29d8c1e321a4a380b6013f00bac6a8e4b593cc4e
01d7203ef8316fdd71c3cec59f8e68fb869e0dbf 06-Aug-2013 Tom Stellard <thomas.stellard@amd.com> Factor FlattenCFG out from SimplifyCFG

Patch by: Mei Ye

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187764 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
72bc423e7f88808f562798504f8405eee625f272 02-Aug-2013 Nadav Rotem <nrotem@apple.com> Move the optlevel check to the frontend.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187628 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
a4cbd78af84b76f92202f2f2b1a3c49ff1f85798 01-Aug-2013 Nadav Rotem <nrotem@apple.com> Only enable SLP-vectorization on O3 builds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187595 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
57e6b2d1f3de0bf459e96f7038e692d624f7e580 27-Jul-2013 Tom Stellard <thomas.stellard@amd.com> SimplifyCFG: Use parallel-and and parallel-or mode to consolidate branch conditions

Merge consecutive if-regions if they contain identical statements.
Both transformations reduce number of branches. The transformation
is guarded by a target-hook, and is currently enabled only for +R600,
but the correctness has been tested on X86 target using a variety of
CPU benchmarks.

Patch by: Mei Ye

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187278 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
4ef7eafa3f823443d1b8921f6020d946612281db 25-Jul-2013 Rafael Espindola <rafael.espindola@gmail.com> Respect llvm.used in Internalize.

The language reference says that:

"If a symbol appears in the @llvm.used list, then the compiler,
assembler, and linker are required to treat the symbol as if there is
a reference to the symbol that it cannot see"

Since even the linker cannot see the reference, we must assume that
the reference can be using the symbol table. For example, a user can add
__attribute__((used)) to a debug helper function like dump and use it from
a debugger.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187103 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
nternalize.cpp
b97b1627316ef4a9eb7591ef4f814917ba054ff6 25-Jul-2013 Nick Lewycky <nicholas@mxc.ca> Check that TD isn't NULL before dereferencing it down this path.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187099 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
2d680824e3a5272e386aa6c1d2a66676de7899fd 25-Jul-2013 Rafael Espindola <rafael.espindola@gmail.com> Make these methods const correct.

Thanks to Nick Lewycky for noticing it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@187098 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
64f2f910bd48c123a6b5945ebe90b018f7bea4d5 21-Jul-2013 Rafael Espindola <rafael.espindola@gmail.com> Don't crash when llvm.compiler.used becomes empty.

GlobalOpt simplifies llvm.compiler.used by removing any members that are also
in the more strict llvm.used. Handle the special case where llvm.compiler.used
becomes empty.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186778 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
70968319719fbfb00a58ebcf82b1e18ec04be5be 19-Jul-2013 Rafael Espindola <rafael.espindola@gmail.com> s/compiler_used/compiler.used/.

We were incorrectly using compiler_used instead of compiler.used. Unfortunately
the passes using the broken name had tests also using the broken name.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186705 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
b05ad799e7dc19d7c88576820b1cf16b43a4de9e 19-Jul-2013 Nick Lewycky <nicholas@mxc.ca> Clean up some of this code a tiny bit, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186622 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
86f4f6526b18765cdb78bee593e1354bc9f55085 17-Jul-2013 Hal Finkel <hfinkel@anl.gov> Fix comparisons of alloca alignment in inliner merging

Duncan pointed out a mistake in my fix in r186425 when only one of the allocas
being compared had the target-default alignment. This is essentially his
suggested solution. Thanks!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186510 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
5a5ebb7f9fa7fa82c0c466a36a90e5c18bb13073 16-Jul-2013 Hal Finkel <hfinkel@anl.gov> When the inliner merges allocas, it must keep the larger alignment

For safety, the inliner cannot decrease the allignment on an alloca when
merging it with another.

I've included two variants of the test case for this: one with DataLayout
available, and one without. When DataLayout is not available, if only one of
the allocas uses the default alignment (getAlignment() == 0), then they cannot
be safely merged.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@186425 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
201cdb10049126ea740e47f1dab01612a93a5698 09-Jul-2013 Eli Bendersky <eliben@google.com> Fix comment


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185888 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
60ceb6ec151eb3cad0de6559de247be972cd94d6 06-Jul-2013 Nick Lewycky <nicholas@mxc.ca> Fix annotation of unlink. Should fix builder.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185738 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
dc89737bcdbb8f69d8ae7578bdfa904cabcfc5ed 06-Jul-2013 Nick Lewycky <nicholas@mxc.ca> Extend 'readonly' and 'readnone' to work on function arguments as well as
functions. Make the function attributes pass add it to known library functions
and when it can deduce it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185735 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
08bdfe26a5e22425699a53e9ad3ee287b0c9b1b9 04-Jul-2013 Nick Lewycky <nicholas@mxc.ca> Tabs to spaces. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185612 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.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
tripSymbols.cpp
7cb0321ad8d86c9fdfb70d3bfa1ff3e8e1ff9f71 03-Jul-2013 Michael Gottesman <mgottesman@apple.com> Added support in FunctionAttrs for adding relevant function/argument attributes for the posix call gettimeofday.

This implies annotating it as nounwind and its arguments as nocapture. To be
conservative, we do not annotate the arguments with noalias since some platforms
do not have restrict on the declaration for gettimeofday.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185502 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
e7dd3afef074596dd61211b5e0b05c4de5d5f85b 02-Jul-2013 Nick Lewycky <nicholas@mxc.ca> Add missing break statements. Noticed by inspection.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185414 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
3f4385a0b6f52ff0feb99ddb6431b7e7960b13af 30-Jun-2013 Stephen Lin <stephenwlin@gmail.com> DeadArgumentElimination: keep return value on functions that have a live argument with the 'returned' attribute (rather than generate invalid IR); however, if both can be eliminated, both will be


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185290 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.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
eadArgumentElimination.cpp
tripSymbols.cpp
6bf3a05235effa06b10196ee9ebeffee14d886ee 24-Jun-2013 Chandler Carruth <chandlerc@gmail.com> Add a flag to defer vectorization into a phase after the inliner and its
CGSCC pass manager. This should insulate the inlining decisions from the
vectorization decisions, however it may have both compile time and code
size problems so it is just an experimental option right now.

Adding this based on a discussion with Arnold and it seems at least
worth having this flag for us to both run some experiments to see if
this strategy is workable. It may solve some of the regressions seen
with the loop vectorizer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184698 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
5729b8ea01739cf9b1171f0a4349275bc8124756 22-Jun-2013 Benjamin Kramer <benny.kra@googlemail.com> Revert "FunctionAttrs: Merge attributes once instead of doing it for every argument."

It doesn't work as I intended it to. This reverts commit r184638.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184641 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
39bab0e11abc1a310c537052872415b29b6a4241 22-Jun-2013 Benjamin Kramer <benny.kra@googlemail.com> FunctionAttrs: Merge attributes once instead of doing it for every argument.

It has become an expensive operation. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184638 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
be87bce32bc9af9bc5918a6e08806b61e3088165 20-Jun-2013 Meador Inge <meadori@codesourcery.com> Remove the simplify-libcalls pass (finally)

This commit completely removes what is left of the simplify-libcalls
pass. All of the functionality has now been migrated to the instcombine
and functionattrs passes. The following C API functions are now NOPs:

1. LLVMAddSimplifyLibCallsPass
2. LLVMPassManagerBuilderSetDisableSimplifyLibCalls

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184459 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
7459ff4be22e92efdd89884a7c2a0ca63904998d 17-Jun-2013 Nadav Rotem <nrotem@apple.com> Disable vectorization for -Oz.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184089 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
f9f86812865b941e0dd2855318d138e8935792cc 17-Jun-2013 Nadav Rotem <nrotem@apple.com> Enable the loop vectorizer by default for -Os and -O2.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184084 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
1750632ee13c51e6191c513b163c5f41e0dab4eb 15-Jun-2013 Benjamin Kramer <benny.kra@googlemail.com> PruneEH: Only merge attribute sets when used. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@184041 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
c06e5cf2e3724762a6c9830a00395736ec07d81a 13-Jun-2013 Derek Schuff <dschuff@google.com> Fix DeleteDeadVarargs not to crash on functions referenced by BlockAddresses

This pass was assuming that if hasAddressTaken() returns false for a
function, the function's only uses are call sites. That's not true
because there can be references by BlockAddresses too.

Fix the pass to handle this case. Fix
BlockAddress::replaceUsesOfWithOnConstant() to allow a function's type
to be changed by RAUW'ing the function with a bitcast of the recreated
function.

Patch by Mark Seaborn.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183933 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
1878f9a7874b1ff569d745c0269f49d3daf7203d 12-Jun-2013 Stephen Hines <srhines@google.com> Merge commit '100fbdd06be7590b23c4707a98cd605bdb519498' into merge_20130612
100fbdd06be7590b23c4707a98cd605bdb519498 12-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com> Always remove an alias when we rename the target.

Should fix the dragonegg build bots.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183845 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
d1b6ca23b42ad8180780c0e714e9a900e04785b1 11-Jun-2013 Rafael Espindola <rafael.espindola@gmail.com> Change how globalopt handles aliases in llvm.used.

Instead of a custom implementation of replaceAllUsesWith, we just call
replaceAllUsesWith and recreate llvm.used and llvm.compiler-used.

This change is particularity interesting because it makes llvm see
through what clang is doing with static used functions in extern "C"
contexts. With this change, running clang -O2 in

extern "C" {
__attribute__((used)) static void foo() {}
}

produces

@llvm.used = appending global [1 x i8*] [i8* bitcast (void ()* @foo to
i8*)], section "llvm.metadata"
define internal void @foo() #0 {
entry:
ret void
}

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183756 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
d84b17e157bb27bed236a400cccf4562d0b19d96 09-Jun-2013 Tim Northover <tnorthover@apple.com> Make DeadArgumentElimination more conservative on variadic functions

Variadic functions are particularly fragile in the face of ABI changes, so this
limits how much the pass changes them

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183625 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
9342b9ccdd3f99ad76cdcb03b4c6f557517dd0d8 07-Jun-2013 Nadav Rotem <nrotem@apple.com> Jeffrey Yasskin volunteered to benchmark the vectorizer on -O2 or -Os when compiling chrome. This patch adds a new flag to enable vectorization on all levels and not only on -O3. It should go away once we make a decision.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183456 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
7c2b4be2a718b994298803dd09e81e49a016ffb2 01-Jun-2013 Benjamin Kramer <benny.kra@googlemail.com> Move getRealLinkageName to a common place and remove all the duplicates of it.

Also simplify code a bit while there. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@183076 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
5150270d071f05c6ea1fd26ef448954ddb5746dc 14-May-2013 Manman Ren <mren@apple.com> GlobalOpt: fix an issue where CXAAtExitFn points to a deleted function.

CXAAtExitFn was set outside a loop and before optimizations where functions
can be deleted. This patch will set CXAAtExitFn inside the loop and after
optimizations.

Seg fault when running LTO because of accesses to a deleted function.
rdar://problem/13838828


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181838 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
95f885390bff8ff2d0c5eb33e6bc3bd536c1594f 09-May-2013 Rafael Espindola <rafael.espindola@gmail.com> Don't replace an alias in llvm.used with its target.

When we replace an internal alias with its target, be careful not to
replace the entry in llvm.used (and llvm.compiler_used).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181524 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
eaf14786ca3975266ed7041ac242122c02baf1cf 06-May-2013 Rafael Espindola <rafael.espindola@gmail.com> Fix const merging when an alias of a const is llvm.used.

We used to disable constant merging not only if a constant is llvm.used, but
also if an alias of a constant is llvm.used. This change fixes that.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@181175 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
38578c4919ea18ceb27e29988b2d857afe6215bf 03-May-2013 Stephen Hines <srhines@google.com> Merge remote-tracking branch 'upstream/master' into merge-20130502

Conflicts:
lib/Support/Unix/Signals.inc
unittests/Transforms/Utils/Cloning.cpp

Change-Id: I027581a4390ec3ce4cd8d33da8b5f4c0c7d372c8
40be1e85665d10f5444186f0e7106e368dd735b8 01-May-2013 Filip Pizlo <fpizlo@apple.com> This patch breaks up Wrap.h so that it does not have to include all of
the things, and renames it to CBindingWrapping.h. I also moved
CBindingWrapping.h into Support/.

This new file just contains the macros for defining different wrap/unwrap
methods.

The calls to those macros, as well as any custom wrap/unwrap definitions
(like for array of Values for example), are put into corresponding C++
headers.

Doing this required some #include surgery, since some .cpp files relied
on the fact that including Wrap.h implicitly caused the inclusion of a
bunch of other things.

This also now means that the C++ headers will include their corresponding
C API headers; for example Value.h must include llvm-c/Core.h. I think
this is harmless, since the C API headers contain just external function
declarations and some C types, so I don't believe there should be any
nasty dependency issues here.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180881 91177308-0d34-0410-b5e6-96231b3b80d8
PO.cpp
assManagerBuilder.cpp
3e39731e88f2d4f597cebc74388fd6650ca4f604 23-Apr-2013 Eric Christopher <echristo@gmail.com> Move C++ code out of the C headers and into either C++ headers
or the C++ files themselves. This enables people to use
just a C compiler to interoperate with LLVM.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180063 91177308-0d34-0410-b5e6-96231b3b80d8
PO.cpp
assManagerBuilder.cpp
cde25b435a907e7741da0c0d18953850936277c4 22-Apr-2013 Rafael Espindola <rafael.espindola@gmail.com> Clarify that llvm.used can contain aliases.

Also add a check for llvm.used in the verifier and simplify clients now that
they can assume they have a ConstantArray.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@180019 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
tripSymbols.cpp
24a5f30f77fa2890329fa3a9165b54c13bbd51e7 20-Apr-2013 Benjamin Kramer <benny.kra@googlemail.com> MergeFunc: Make pointer and integer types generate the same hash.

The logic that actually compares the types considers pointers and integers the
same if they are of the same size. This created a strange mismatch between hash
and reality and made the test case for this fail on some platforms (yay,
test cases).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179905 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
74d892433d617daa9728f2c52446b2cc2846553f 19-Apr-2013 Bill Wendling <isanbard@gmail.com> Implement a better fix for PR15185.

If the return type is a pointer and the call returns an integer, then do the
inttoptr convertions. And vice versa.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179817 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
23e00ae631d8063a5d52d424968a6ebdc24e81f7 16-Apr-2013 Bill Wendling <isanbard@gmail.com> We are not able to bitcast a pointer to an integral value.

Two return types are not equivalent if one is a pointer and the other is an
integral. This is because we cannot bitcast a pointer to an integral value.
PR15185


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179569 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
e9a4411db4d3a05965630f668daf8071bf2d3513 16-Apr-2013 Nadav Rotem <nrotem@apple.com> SLPVectorizer: Make it a function pass and add code for hoisting the vector-gather sequence out of loops.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179562 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
1129a832e6ef5291b0144e9f22c76b2599cd5587 15-Apr-2013 Nadav Rotem <nrotem@apple.com> Add an option -vectorize-slp-aggressive for running the BB vectorizer. Make -fslp-vectorize run the slp-vectorizer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179508 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
8849838965941919257b923f8603ca1bacd3fa46 15-Apr-2013 Nadav Rotem <nrotem@apple.com> Rename the slp-vectorizer clang/llvm flags. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179505 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
9cbee63b1a475782dbefe767f4935fad9e5ff20d 13-Apr-2013 Benjamin Kramer <benny.kra@googlemail.com> GlobalDCE: Fix an oversight in my last commit that could lead to crashes.

There is a Constant with non-constant operands: blockaddress.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179460 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
8848680ce0ab416cb646d0a03aa6f4f6f25e7623 13-Apr-2013 Benjamin Kramer <benny.kra@googlemail.com> Fix a scalability issue with complex ConstantExprs.

This is basically the same fix in three different places. We use a set to avoid
walking the whole tree of a big ConstantExprs multiple times.

For example: (select cmp, (add big_expr 1), (add big_expr 2))
We don't want to visit big_expr twice here, it may consist of thousands of
nodes.

The testcase exercises this by creating an insanely large ConstantExprs out of
a loop. It's questionable if the optimizer should ever create those, but this
can be triggered with real C code. Fixes PR15714.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@179458 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
2b7923665d628c247fcc50c52d7e0618359491c6 02-Apr-2013 Bill Wendling <isanbard@gmail.com> Use a worklist to avoid a sneaky iterator invalidation.

The iterator could be invalidated when it's recursively deleting a whole bunch
of constant expressions in a constant initializer.

Note: This was only reproducible if `opt' was run on a `.bc' file. If `opt' was
run on a `.ll' file, it wouldn't crash. This is why the test first pushes the
`.ll' file through `llvm-as' before feeding it to `opt'.

PR15440


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178531 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
cf47ce616c53040cb8aa09eff9dc0b693e571842 21-Mar-2013 Meador Inge <meadori@codesourcery.com> Move library call prototype attribute inference to functionattrs

The simplify-libcalls pass implemented a doInitialization hook to infer
function prototype attributes for well-known functions. Given that the
simplify-libcalls pass is going away *and* that the functionattrs pass
is already in place to deduce function attributes, I am moving this logic
to the functionattrs pass. This approach was discussed during patch
review:
http://lists.cs.uiuc.edu/pipermail/llvm-commits/Week-of-Mon-20121126/157465.html.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@177619 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
2d4629c5d7dcc6582fa7b85a517744f1a3654eba 19-Mar-2013 Stephen Hines <srhines@google.com> Merge branch 'upstream' into merge_2013_03_18
0ebc084132cbf4ebebdb6c931ef42f97e3ff5fe1 10-Mar-2013 Nick Lewycky <nicholas@mxc.ca> Use LLVMBool instead of 'bool' in the C API. Based on a patch by Peter Zotov!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176793 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
76c25dc2bf23b0c710d896ca61f236fe5b18ee08 06-Mar-2013 Andrew Trick <atrick@apple.com> Generalize my previous fix for -print-options.

Always print options that differ from their implicit default. At least
for simple option types.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176572 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
122136b1194fb770f9791f3fea2ef3116e78f504 06-Mar-2013 Andrew Trick <atrick@apple.com> Give -loop-vectorize an explicit default.

This way, clang -mllvm -print-options shows that the driver is overriding it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176569 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
5adb136be579e8fff3734461580cb34d1d2983b8 06-Mar-2013 Stephen Hines <srhines@google.com> Merge commit 'b3201c5cf1e183d840f7c99ff779d57f1549d8e5' into merge_20130226

Conflicts:
include/llvm/Support/ELF.h
lib/Support/DeltaAlgorithm.cpp

Change-Id: I24a4fbce62eb39d924efee3c687b55e1e17b30cd
880e8c0ad41345f353b819c51092baa8f05e1950 04-Mar-2013 Lang Hames <lhames@gmail.com> Check isDiscardableIfUnused, rather than hasLocalLinkage, when bumping
GlobalValue linkage up to ExternalLinkage in the ExtractGV pass. This
prevents linkonce and linkonce_odr symbols from being DCE'd.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176459 91177308-0d34-0410-b5e6-96231b3b80d8
xtractGV.cpp
17fe48ce6ee694eb1fb29804f4cba3dbea5e9248 14-Feb-2013 Bill Wendling <isanbard@gmail.com> Retain the name of the new internal global that's been shrunk.

It's possible (e.g. after an LTO build) that an internal global may be used for
debugging purposes. If that's the case appending a '.b' to it makes it hard to
find that variable. Steal the name from the old GV before deleting it so that
they can find that variable again.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@175104 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
fb10b256aa018a1ef59a18f7c9634bd72a95e6e3 02-Feb-2013 Nick Lewycky <nicholas@mxc.ca> Revert accidental commit (ran svn commit from wrong directory).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174241 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
214a5661d1c76468222d6f941e5dcb415f0f482a 02-Feb-2013 Nick Lewycky <nicholas@mxc.ca> This patch makes "&Cls::purevfn" not an odr use. This isn't what the standard
says, but that's a defect (to be filed). "Cls::purevfn()" is still an odr use.

Also fixes a bug in the previous patch that caused us to not mark the function
referenced just because we didn't want to mark it odr used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@174240 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
ac72eb264c3a8a15cda81aaead6adc8419058666 31-Jan-2013 Bill Wendling <isanbard@gmail.com> Remove addRetAttributes and addFnAttributes, which aren't useful abstractions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173992 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
e74365462a39529ae48ef4d34ec76b4543b8ea29 31-Jan-2013 Bill Wendling <isanbard@gmail.com> Convert typeIncompatible to return an AttributeSet.

There are still places which treat the Attribute object as a collection of
attributes. I'm systematically removing them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173990 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
c0b3d4c9c252acec01de719d4e756456d5377e6d 29-Jan-2013 Hal Finkel <hfinkel@anl.gov> Unroll again after running BBVectorize

Because BBVectorize may significantly shorten a loop body, unroll
again after vectorization. This is especially important when using
runtime or partial unrolling.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173730 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
24c4898973a074713201fb9351d302b9f7733e92 28-Jan-2013 Michael Gottesman <mgottesman@apple.com> Extracted ObjCARC.cpp into its own library libLLVMObjCARCOpts in preparation for refactoring the ARC Optimizer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173647 91177308-0d34-0410-b5e6-96231b3b80d8
LVMBuild.txt
b2484b4332ffe385421e338de21372ea8a9dc5cf 27-Jan-2013 Bill Wendling <isanbard@gmail.com> Use the AttributeSet instead of AttributeWithIndex.

In the future, AttributeWithIndex won't be used anymore. Besides, it exposes the
internals of the AttributeSet to outside users, which isn't goodness.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173601 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
d04b2d45d97312475867d9f20724701267738240 27-Jan-2013 Bill Wendling <isanbard@gmail.com> Use the AttributeSet instead of AttributeWithIndex.

In the future, AttributeWithIndex won't be used anymore. Besides, it exposes the
internals of the AttributeSet to outside users, which isn't goodness.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173600 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
8e47daf2858e980210f3e1f007036b24da342c29 26-Jan-2013 Bill Wendling <isanbard@gmail.com> Remove some introspection functions.

The 'getSlot' function and its ilk allow introspection into the AttributeSet
class. However, that class should be opaque. Allow access through accessor
methods instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173522 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
lobalOpt.cpp
85875647d6f85cbcbe506809640b9857eaaa26a4 25-Jan-2013 Bill Wendling <isanbard@gmail.com> Use the new 'getSlotIndex' method to retrieve the attribute's slot index.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173499 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
lobalOpt.cpp
3f16858579fdf7ee1cc6823736c68cede6643da1 25-Jan-2013 Pedro Artigas <partigas@apple.com> added ability to dynamically change the ExportList of an already
created InternalizePass (useful for pass reuse)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173474 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
114baee1fa017daefad2339c77b45b9ca3d79a41 23-Jan-2013 Bill Wendling <isanbard@gmail.com> Add the IR attribute 'sspstrong'.

SSPStrong applies a heuristic to insert stack protectors in these situations:

* A Protector is required for functions which contain an array, regardless of
type or length.

* A Protector is required for functions which contain a structure/union which
contains an array, regardless of type or length. Note, there is no limit to
the depth of nesting.

* A protector is required when the address of a local variable (i.e., stack
based variable) is exposed. (E.g., such as through a local whose address is
taken as part of the RHS of an assignment or a local whose address is taken as
part of a function argument.)

This patch implements the SSPString attribute to be equivalent to
SSPRequired. This will change in a subsequent patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173230 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
28d65722d6f283b327b5815914382077fe9c0ab4 23-Jan-2013 Bill Wendling <isanbard@gmail.com> Remove the last of uses that use the Attribute object as a collection of attributes.

Collections of attributes are handled via the AttributeSet class now. This
finally frees us up to make significant changes to how attributes are structured.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173228 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
unctionAttrs.cpp
8246df61f6de716acf1f8c64fac3c19970a2c174 23-Jan-2013 Bill Wendling <isanbard@gmail.com> Use the AttributeSet when removing multiple attributes. Use Attribute::AttrKind
when removing one attribute. This further encapsulates the use of the attributes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173214 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
lobalOpt.cpp
70d2ca0725b05a2d372e4dc3336e8ea350093e98 23-Jan-2013 Bill Wendling <isanbard@gmail.com> Use the AttributeSet when adding multiple attributes and an Attribute::AttrKind
when adding a single attribute to the function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173210 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
defaca00b8087d452df2b783250a48a32658a910 22-Jan-2013 Bill Wendling <isanbard@gmail.com> More encapsulation work.

Use the AttributeSet when we're talking about more than one attribute. Add a
function that adds a single attribute. No functionality change intended.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173196 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
3fc4b96b503fa202411317684a2ba02e41e43072 21-Jan-2013 Bill Wendling <isanbard@gmail.com> Have AttributeSet::getRetAttributes() return an AttributeSet instead of Attribute.

This further restricts the use of the Attribute class to the Attribute family of
classes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173098 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
c5f1bc88a2eb7ad9ff924ca90cf88494e5f947b9 21-Jan-2013 Bill Wendling <isanbard@gmail.com> Make AttributeSet::getFnAttributes() return an AttributeSet instead of an Attribute.

This is more code to isolate the use of the Attribute class to that of just
holding one attribute instead of a collection of attributes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173094 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
3aef70314b053a1df4f85ca4a6f3890d06ebbdd6 09-Jan-2013 Stephen Hines <srhines@google.com> Update LLVM for merge to r171905.

Android.mk
lib/Analysis/Android.mk
lib/CodeGen/Android.mk
lib/CodeGen/MachineScheduler.cpp - specify std::pop_heap()
lib/IR/Android.mk - new from lib/VMCore
lib/MC/Android.mk
lib/MC/MCAssembler.cpp - put back pointer param (from reference).
lib/Support/DeltaAlgorithm.cpp - iterator -> const_iterator !
lib/TableGen/Android.mk
lib/Target/ARM/ARMJITInfo.cpp - Removed unused legacy JIT changes
lib/Target/ARM/Android.mk
lib/Target/ARM/AsmParser/Android.mk
lib/Target/ARM/Disassembler/Android.mk
lib/Target/ARM/MCTargetDesc/Android.mk
lib/Target/Android.mk
lib/Target/Mips/Android.mk
lib/Target/Mips/Disassembler/Android.mk
lib/Target/Mips/MCTargetDesc/Android.mk
lib/Target/X86/Android.mk
lib/Target/X86/AsmParser/Android.mk
lib/Target/X86/Disassembler/Android.mk
lib/Transforms/IPO/Android.mk
lib/Transforms/Instrumentation/Android.mk
lib/Transforms/Scalar/Android.mk
lib/Transforms/Utils/Android.mk
lib/Transforms/Vectorize/Android.mk
lib/VMCore/Android.mk - moved to lib/IR
llvm-gen-intrinsics.mk - new Intrinsics.td location
utils/TableGen/Android.mk

Change-Id: Ifebdb1716c372fd917a844c44be9d10df66434b0
ndroid.mk
059800f9e3fee2852672f846d91a2da14da7783a 21-Jan-2013 Stephen Hines <srhines@google.com> Merge remote-tracking branch 'upstream/master' into merge-llvm

Conflicts:
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
lib/MC/MCAssembler.cpp
lib/Support/Atomic.cpp
lib/Support/Memory.cpp
lib/Target/ARM/ARMJITInfo.cpp

Change-Id: Ib339baf88df5b04870c8df1bedcfe1f877ccab8d
86953b5795007eaa98838297360a6987e33e92e7 21-Jan-2013 Chandler Carruth <chandlerc@gmail.com> Make the inline cost a proper analysis pass. This remains essentially
a dynamic analysis done on each call to the routine. However, now it can
use the standard pass infrastructure to reference other analyses,
instead of a silly setter method. This will become more interesting as
I teach it about more analysis passes.

This updates the two inliner passes to use the inline cost analysis.
Doing so highlights how utterly redundant these two passes are. Either
we should find a cheaper way to do always inlining, or we should merge
the two and just fiddle with the thresholds to get the desired behavior.
I'm leaning increasingly toward the latter as it would also remove the
Inliner sub-class split.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173030 91177308-0d34-0410-b5e6-96231b3b80d8
nlineAlways.cpp
nlineSimple.cpp
0378e3916a3d568ee161803d4f0107512e595af8 21-Jan-2013 Chandler Carruth <chandlerc@gmail.com> Formatting and comment fixes to the always inliner.

Formatting fixes brought to you by clang-format.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173029 91177308-0d34-0410-b5e6-96231b3b80d8
nlineAlways.cpp
5a47127c4c1aeed8a4caac5bcd25301eb69bd461 21-Jan-2013 Chandler Carruth <chandlerc@gmail.com> Clean up the formatting and doxygen for the simple inliner a bit. No
functionality changed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@173028 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
1b0c54f1c5dd61e56cb7cbc435fcb3319cff628f 18-Jan-2013 Bill Wendling <isanbard@gmail.com> Use AttributeSet accessor methods instead of Attribute accessor methods.

Further encapsulation of the Attribute object. Don't allow direct access to the
Attribute object as an aggregate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172853 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
956f13440a4aa0297606a4412f4aa091d931592a 18-Jan-2013 Bill Wendling <isanbard@gmail.com> Push some more methods down to hide the use of the Attribute class.

Because the Attribute class is going to stop representing a collection of
attributes, limit the use of it as an aggregate in favor of using AttributeSet.
This replaces some of the uses for querying the function attributes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172844 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
96f498bd9f140a98321c478f517877c4767b94fa 13-Jan-2013 Dmitri Gribenko <gribozavr@gmail.com> Remove redundant 'llvm::' qualifications


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172358 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
0813589f72de5f15a28f36e2235cb933b7b8ebc0 12-Jan-2013 Benjamin Kramer <benny.kra@googlemail.com> GlobalOpt: Avoid jump on uninitialized value.

Found by valgrind.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172318 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
dcf669560e2ae00c5392474d10aa758a51c609a8 12-Jan-2013 Michael Gottesman <mgottesman@apple.com> Fixed whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172271 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
cddd8a613e377e3064a2e7ca1d7ac8cb25f9b849 11-Jan-2013 Michael Gottesman <mgottesman@apple.com> Added debug messages to GlobalOpt.

Specifically:
1. Added a missing new line when we emit a debug message saying that we are marking a global variable as constant.
2. Added debug messages that describe what is occuring when GlobalOpt is evaluating a block/function.
3. Added a debug message that says what specific constructor is being evaluated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172247 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
1d505a33f9cb77a2adb644b85136e7be64a186d9 10-Jan-2013 Joey Gouly <joey.gouly@arm.com> Fix TryToShrinkGlobalToBoolean in GlobalOpt, so that it does not discard address spaces.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@172051 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
4068e1af9ff68b6b5fdb3233f1304e53f1bf179a 07-Jan-2013 Chandler Carruth <chandlerc@gmail.com> Move TypeFinder.h into the IR tree, it clearly belongs with the IR library.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171749 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
3251e81d793a293b78f4914be6093b405c24fc2a 07-Jan-2013 Chandler Carruth <chandlerc@gmail.com> Move CallGraphSCCPass.h into the Analysis tree; that's where the
implementation lives already.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171746 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
unctionAttrs.cpp
runeEH.cpp
1ada2ada3cb145861599d349ba372bfc39b20c1d 07-Jan-2013 Chandler Carruth <chandlerc@gmail.com> Remove the long defunct 'DefaultPasses' header. We have a pass manager
builder these days, and this thing hasn't seen updates for a very long
time.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171741 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
b7c772922e53a2b4705fe93397dfbc92d1dc8ef7 04-Jan-2013 Nadav Rotem <nrotem@apple.com> Move the loop vectorizer from O2 to O3. It looks like the increase in code size actually hurts the performance on many programs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171471 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.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
rgumentPromotion.cpp
onstantMerge.cpp
eadArgumentElimination.cpp
xtractGV.cpp
unctionAttrs.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
nlineAlways.cpp
nlineSimple.cpp
nliner.cpp
nternalize.cpp
oopExtractor.cpp
ergeFunctions.cpp
artialInlining.cpp
runeEH.cpp
tripDeadPrototypes.cpp
tripSymbols.cpp
98281a20503896349bd152e2dfe87435d3a6aada 30-Dec-2012 Nuno Lopes <nunoplopes@sapo.pt> convert a bunch of callers from DataLayout::getIndexedOffset() to GEP::accumulateConstantOffset().
The later API is nicer than the former, and is correct regarding wrap-around offsets (if anyone cares).
There are a few more places left with duplicated code, which I'll remove soon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171259 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
39cd0c8e477255a7296b2bd1dc67193f8d38c003 30-Dec-2012 Bill Wendling <isanbard@gmail.com> Remove Function::getParamAttributes and use the AttributeSet accessor methods instead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171255 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
831737d329a727f53a1fb0572f7b7a8127208881 30-Dec-2012 Bill Wendling <isanbard@gmail.com> Remove the Function::getFnAttributes method in favor of using the AttributeSet
directly.

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171253 91177308-0d34-0410-b5e6-96231b3b80d8
nlineAlways.cpp
nliner.cpp
7ccc2f7a7859a72ce73e6d8dc4242c6dd7984c45 27-Dec-2012 Chandler Carruth <chandlerc@gmail.com> Make this parameter be named consistently with most other
getAnalysisUsage implementations.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171157 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
38b06020dbd804f01ee3802779a52c05cffdf87d 21-Dec-2012 Roman Divacky <rdivacky@freebsd.org> Remove duplicate includes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170902 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
034b94b17006f51722886b0f2283fb6fb19aca1f 19-Dec-2012 Bill Wendling <isanbard@gmail.com> Rename the 'Attributes' class to 'Attribute'. It's going to represent a single attribute in the future.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170502 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
unctionAttrs.cpp
lobalOpt.cpp
nlineAlways.cpp
nliner.cpp
runeEH.cpp
62570c2813702814f9d7450ac4c4df065b8b6ccc 19-Dec-2012 Nadav Rotem <nrotem@apple.com> Enable the loop vectorizer in clang and not in the pass manager, so that we can disable it in clang.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170470 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
04b116e08eefe1ddd4a719889f136c624ee5914e 18-Dec-2012 Nadav Rotem <nrotem@apple.com> Enable the loop vectorizer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170416 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
0005093db659ec3d629cdfc014e7f979ad0bb7b8 15-Dec-2012 NAKAMURA Takumi <geek4civic@gmail.com> Revert r170246, "Enable the loop vectorizer by default."

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170267 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
f53e7cb9b95677dcc2181485fed8cb592056b805 14-Dec-2012 Nadav Rotem <nrotem@apple.com> Enable the loop vectorizer by default.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170246 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
31bc9e00d1025186484473ad7e566fbeb7c90a8a 14-Dec-2012 Nadav Rotem <nrotem@apple.com> revert r170166 - disable the loop vectorizer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170172 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
44a71c4575956ce1727df2e1d2fc03fce87fd11b 14-Dec-2012 Nadav Rotem <nrotem@apple.com> Enable the loop vectorizer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170166 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
a97fd7f1a8d5eccdd6b2fb13110de158ea50be5d 14-Dec-2012 Nadav Rotem <nrotem@apple.com> Disable the loop vectorizer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170162 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
9ad73e93a51c473a90e010a489a9c7c221112030 14-Dec-2012 Nadav Rotem <nrotem@apple.com> Enable the Loop Vectorizer by default for O2 and O3. Disable if-conversion by default. I plan to revert this patch later today.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170157 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
fcc934322bc6e0b89df8fbcdde59145f5af1179a 13-Dec-2012 Quentin Colombet <qcolombet@apple.com> Take into account minimize size attribute in the inliner.

Better controls the inlining of functions when the caller function has MinSize attribute.
Basically, when the caller function has this attribute, we do not "force" the inlining
of callee functions carrying the InlineHint attribute (i.e., functions defined with
inline keyword)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170065 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
ae3b652f5cc19d83b6466d4fa70a7d1c7fb6d06c 12-Dec-2012 Nadav Rotem <nrotem@apple.com> LoopVectorizer: Use the "optsize" attribute to decide if we are allowed to increase the function size.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@170004 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
5da804150d418b8b4956b84013f8f67df553c543 12-Dec-2012 Nadav Rotem <nrotem@apple.com> LoopVectorizer: When -Os is used, vectorize only loops that dont require a tail loop. There is no testcase because I dont know of a way to initialize the loop vectorizer pass without adding an additional hidden flag.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169950 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
0439f3e0cf67049877578aa9ae94f7a0a90e86e7 11-Dec-2012 Rafael Espindola <rafael.espindola@gmail.com> Use an ArrayRef instead of a std::vector&.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169881 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
9e81a440f5229f13e21031c208fdecbe07b056c7 10-Dec-2012 Nadav Rotem <nrotem@apple.com> Enable the loop vectorizer only on O2 and above. (Still disabled by default)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169774 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
99faa3b4ec6d03ac7808fe4ff3fbf3d04e375502 08-Dec-2012 Bill Wendling <isanbard@gmail.com> s/AttrListPtr/AttributeSet/g to better label what this class is going to be in the near future.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169651 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
unctionAttrs.cpp
lobalOpt.cpp
runeEH.cpp
5b4af8b52af2cb9e15c89a0e01686f2ed9127d86 06-Dec-2012 Jakub Staszak <kubastaszak@gmail.com> Remove unused field.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169551 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
582088c088140845c73a15067a679e69c18984d0 06-Dec-2012 Jakub Staszak <kubastaszak@gmail.com> Remove trailing spaces.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169550 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
ee721156701ec3afb198d4cfede00095b228eeac 04-Dec-2012 Matt Beaumont-Gay <matthewbg@google.com> Add 'using' declarations to suppress -Woverloaded-virtual warnings.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169214 91177308-0d34-0410-b5e6-96231b3b80d8
nlineAlways.cpp
nlineSimple.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
rgumentPromotion.cpp
onstantMerge.cpp
eadArgumentElimination.cpp
xtractGV.cpp
unctionAttrs.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
nlineAlways.cpp
nlineSimple.cpp
nliner.cpp
nternalize.cpp
oopExtractor.cpp
ergeFunctions.cpp
artialInlining.cpp
assManagerBuilder.cpp
runeEH.cpp
tripDeadPrototypes.cpp
tripSymbols.cpp
efcdb2944bb81519c839feef3a83feed35552393 01-Dec-2012 Zhou Sheng <zhousheng00@gmail.com> Revert previous check in r168581, r169079 as they are still in code review status.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169083 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
702aa2ee19132593b552d211c985aa540787c197 01-Dec-2012 Zhou Sheng <zhousheng00@gmail.com> The patch is to improve the memory footprint of pass GlobalOpt.
Also check in a case to repeat the issue, on which 'opt -globalopt' consumes 1.6GB memory.
The big memory footprint cause is that current GlobalOpt one by one hoists and stores the leaf element constant into the global array, in each iteration, it recreates the global array initializer constant and leave the old initializer alone. This may result in many obsolete constants left.
For example: we have global array @rom = global [16 x i32] zeroinitializer
After the first element value is hoisted and installed: @rom = global [16 x i32] [ 1, 0, 0, ... ]
After the second element value is installed: @rom = global [16 x 32] [ 1, 2, 0, 0, ... ] // here the previous initializer is obsolete
...
When the transform is done, we have 15 obsolete initializers left useless.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@169079 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
3d1a975026688379fcd69405062abb1826ef5cf9 29-Nov-2012 Nadav Rotem <nrotem@apple.com> No need to run LICM after loop vectorization because we dont generate invariant code any more.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168928 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
0976e00fd1cbf4128daeb72efd8957d00383fda9 20-Nov-2012 Bill Wendling <isanbard@gmail.com> Make the AttrListPtr object a part of the LLVMContext.

When code deletes the context, the AttributeImpls that the AttrListPtr points to
are now invalid. Therefore, instead of keeping a separate managed static for the
AttrListPtrs that's reference counted, move it into the LLVMContext and delete
it when deleting the AttributeImpls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168354 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
28f872f8a1945635f30763805c1418a90c6b345e 19-Nov-2012 Bob Wilson <bob.wilson@apple.com> Clean up handling of always-inline functions in the inliner.

This patch moves the isInlineViable function from the InlineAlways pass into
the InlineCostAnalyzer and then changes the InlineCost computation to use that
simple check for always-inline functions. All the special-case checks for
AlwaysInline in the CallAnalyzer can then go away.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168300 91177308-0d34-0410-b5e6-96231b3b80d8
nlineAlways.cpp
79c07d2a36282b09b9c5d0aa65ebf4bff017621b 15-Nov-2012 Dmitri Gribenko <gribozavr@gmail.com> Use empty parens for empty function parameter list instead of '(void)'.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168049 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
1839858983dcbaf1808a6a37f5cd64d92981f27e 15-Nov-2012 Hans Wennborg <hans@hanshq.net> Make GlobalOpt be conservative with TLS variables (PR14309)

For global variables that get the same value stored into them
everywhere, GlobalOpt will replace them with a constant. The problem is
that a thread-local GlobalVariable looks like one value (the address of
the TLS var), but is different between threads.

This patch introduces Constant::isThreadDependent() which returns true
for thread-local variables and constants which depend on them (e.g. a GEP
into a thread-local array), and teaches GlobalOpt not to track such
values.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@168037 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.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
lobalOpt.cpp
ergeFunctions.cpp
b4c9d9c51fcb8a4cad2336b1ad9d225f504bbc4c 31-Oct-2012 Benjamin Kramer <benny.kra@googlemail.com> Replace some instances of UniqueVector with SetVector, which is slightly cheaper.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167116 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
9210cc3a173224b40d9fc45b202f52cc7acf5c5a 30-Oct-2012 Nadav Rotem <nrotem@apple.com> 80-col

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@167036 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
2459bf24274bf039a72db650ebf38cd66911eafc 29-Oct-2012 Nadav Rotem <nrotem@apple.com> Rename the BB-vectorize flag to match the dragonegg name

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166948 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
d233b78760e481a9602266f8376eb1189c58bc9a 29-Oct-2012 Nadav Rotem <nrotem@apple.com> Change the PassManagerBuilder (used by -O3) loop vectorizer flag from -vectorize to -vectorize-loops because we dont want to share the same flag as the bb-vectorizer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166937 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
9cb90e7c1578de19d00806cc121a8ef5ad6c9089 29-Oct-2012 Rafael Espindola <rafael.espindola@gmail.com> llvm-extract changes linkages so that functions on both sides of the
split module can see each other. If it is keeping a symbol that already has
a non local linkage, it doesn't need to change it.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166908 91177308-0d34-0410-b5e6-96231b3b80d8
xtractGV.cpp
c0916d30e09192b7023e453aaa7d2ffe026345ed 29-Oct-2012 Rafael Espindola <rafael.espindola@gmail.com> llvm-extract was unable to handle aliases. It would leave a copy on the
output of both

llvm-extract foo.ll -func=bar
and
llvm-extract foo.ll -func=bar -delete

so the two new files could not be linked together anymore. With this change
alias are handled almost like functions and global variables. Almost because
with alias we cannot just clear the initializer/body, we have to create a new
declaration and replace the alias with it.

The net result is that now the output of the above commands can be linked
even if foo.ll has aliases.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166907 91177308-0d34-0410-b5e6-96231b3b80d8
xtractGV.cpp
e5551ed9cec1ae777c4e4b8852a1d7842c2e1c3d 26-Oct-2012 Rafael Espindola <rafael.espindola@gmail.com> Change the internalize pass to internalize all symbols when given an empty
list of externals. This makes sense since a shared library with no symbols
can still be useful if it has static constructors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166795 91177308-0d34-0410-b5e6-96231b3b80d8
PO.cpp
nternalize.cpp
assManagerBuilder.cpp
c58b799da583697c7056b5a467ffa819d74d2bc3 25-Oct-2012 Nadav Rotem <nrotem@apple.com> revert accidental change

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166643 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
2652c50f74bc4a874c6a2e4b34ff2d52d479183f 25-Oct-2012 Nadav Rotem <nrotem@apple.com> Implement a basic cost model for vector and scalar instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166642 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
aa76e9e2cf50af190de90bc778b7f7e42ef9ceff 24-Oct-2012 Micah Villmow <villmow@gmail.com> Add in support for getIntPtrType to get the pointer type based on the address space.
This checkin also adds in some tests that utilize these paths and updates some of the
clients.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166578 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
ergeFunctions.cpp
63a1eb62e4eef1cbdedce5c60c3e1243a071eba1 18-Oct-2012 Chandler Carruth <chandlerc@gmail.com> Introduce a BarrierNoop pass, a hack designed to allow *some* control
over the implicitly-formed-and-nesting CGSCC pass manager and function
pass managers, especially when using them on the opt commandline or
using extension points in the module builder. The '-barrier' opt flag
(or the pass itself) will create a no-op module pass in the pipeline,
resetting the pass manager stack, and allowing the creation of a new
pipeline of function passes or CGSCC passes to be created that is
independent from any previous pipelines.

For example, this can be used to test running two CGSCC passes in
independent CGSCC pass managers as opposed to in the same CGSCC pass
manager. It also allows us to introduce a further hack into the
PassManagerBuilder to separate the O0 pipeline extension passes from the
always-inliner's CGSCC pass manager, which they likely do not want to
participate in... At the very least none of the Sanitizer passes want
this behavior.

This fixes a bug with ASan at O0 currently, and I'll commit the ASan
test which covers this pass. I'm happy to add a test case that this pass
exists and works, but not sure how much time folks would like me to
spend adding test cases for the details of its behavior of partition
pass managers.... The whole thing is just vile, and mostly intended to
unblock ASan, so I'm hoping to rip this all out in a brave new pass
manager world.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166172 91177308-0d34-0410-b5e6-96231b3b80d8
arrierNoopPass.cpp
MakeLists.txt
assManagerBuilder.cpp
d15c0c7ac118cb23241b002e7206221283e36e2d 17-Oct-2012 Nadav Rotem <nrotem@apple.com> Add a loop vectorizer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166112 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
46d5dd9b058f31637f2449b2925f13a5707d126d 16-Oct-2012 Bill Wendling <isanbard@gmail.com> Use the Attributes::get method which takes an AttrVal value directly to simplify the code a bit. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166009 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
126048c18c4a735ebb2c7c544b9bd48f395b53d9 16-Oct-2012 Craig Topper <craig.topper@gmail.com> Fix filename in file header.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@166004 91177308-0d34-0410-b5e6-96231b3b80d8
PO.cpp
702cc91aa1bd41540e8674921ae7ac89a4ff061f 15-Oct-2012 Bill Wendling <isanbard@gmail.com> Move the Attributes::Builder outside of the Attributes class and into its own class named AttrBuilder. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165960 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
unctionAttrs.cpp
lobalOpt.cpp
runeEH.cpp
07aae2e7d58fe23e370e0cbb9e1a3def99434c36 15-Oct-2012 Bill Wendling <isanbard@gmail.com> Add an enum for the return and function indexes into the AttrListPtr object. This gets rid of some magic numbers.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165924 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
unctionAttrs.cpp
cb3de0bc800d7920087b19bb12a545d4cc84114e 15-Oct-2012 Bill Wendling <isanbard@gmail.com> Attributes Rewrite

Convert the internal representation of the Attributes class into a pointer to an
opaque object that's uniqued by and stored in the LLVMContext object. The
Attributes class then becomes a thin wrapper around this opaque
object. Eventually, the internal representation will be expanded to include
attributes that represent code generation options, etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165917 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
unctionAttrs.cpp
lobalOpt.cpp
runeEH.cpp
7be7848e17f60825f5fbc177b8a25909a30ddb00 14-Oct-2012 Bill Wendling <isanbard@gmail.com> Remove operator cast method in favor of querying with the correct method.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165899 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
1feacad0ca033e7e8f2f557a0d7fa5acc4076080 14-Oct-2012 Bill Wendling <isanbard@gmail.com> Remove the bitwise AND operators from the Attributes class. Replace it with the equivalent from the builder class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165896 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
c416795feaaa2052f7b46fa7a3f9b6ec3751b1eb 14-Oct-2012 Bill Wendling <isanbard@gmail.com> Remove the bitwise assignment OR operator from the Attributes class. Replace it with the equivalent from the builder class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165895 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
5886b7bfc82385dfd35b7602304c86075e1d72e6 14-Oct-2012 Bill Wendling <isanbard@gmail.com> Remove the bitwise NOT operator from the Attributes class. Replace it with the equivalent from the builder class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165892 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
lobalOpt.cpp
7d2f2496c1d263eecdc104fd72e847a31d8695b9 10-Oct-2012 Bill Wendling <isanbard@gmail.com> Remove the final bits of Attributes being declared in the Attribute
namespace. Use the attribute's enum value instead. No functionality change
intended.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165610 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
lobalOpt.cpp
f5e6d70f8c8f21e744a10fd463cdeddae31cbab5 10-Oct-2012 Bill Wendling <isanbard@gmail.com> Have 'addFnAttr' take the attribute enum value. Then have it build the attribute object and add it appropriately. No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165595 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
3e2d76c946ba753c2b11af192a52e25b6f9b46ff 09-Oct-2012 Bill Wendling <isanbard@gmail.com> Use the attribute enums to query if a parameter has an attribute.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165550 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
942895d371c4dfc96105665b5ed8644f05ab8eff 09-Oct-2012 Alexey Samsonov <samsonov@google.com> Fixup for r165490: Use DenseMap instead of std::map. Simplify the loop in CollectFunctionDIs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165498 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
2e879bcd52583335c753c005d203bf2ffe8b67b5 09-Oct-2012 Bill Wendling <isanbard@gmail.com> Use the enum value of the attributes when adding them to the attributes builder.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165494 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
e97a3a4b4fccbe6283b616af93ab0117d3a7fee9 09-Oct-2012 Alexey Samsonov <samsonov@google.com> Fix PR14016.
DeadArgumentElimination pass can replace one LLVM function with another,
invalidating a pointer stored in debug info metadata entry for this function.
To fix this, we collect debug info descriptors for functions before
running a DeadArgumentElimination pass and "patch" pointers in metadata nodes
if we replace a function.


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

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165488 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
lobalOpt.cpp
nlineAlways.cpp
nliner.cpp
c40abb0b6853ccd7b32c9adb4487e7d8fbc13c09 09-Oct-2012 Bill Wendling <isanbard@gmail.com> Convert to using the Attributes::Builder class to create attributes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165468 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
c92b8aa79f4a2cd16f7b674189e425c2c367e886 09-Oct-2012 Nick Lewycky <nicholas@mxc.ca> Give CaptureTracker::shouldExplore a base implementation. Most users want to do
the same thing. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165435 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.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
onstantMerge.cpp
lobalOpt.cpp
nlineAlways.cpp
nlineSimple.cpp
nliner.cpp
ergeFunctions.cpp
b44e3ee1a7af03062706cfa22ef4c0e57dfddca7 04-Oct-2012 Bill Wendling <isanbard@gmail.com> Use method to query for attributes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165209 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
5df15c692b944b6c46ec6d532fc286b7e0000d5d 04-Oct-2012 Bill Wendling <isanbard@gmail.com> Add method to query for 'NoAlias' attribute on call/invoke instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165208 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
fac31ded9610565bac130754729f7ff32af08c0d 04-Oct-2012 Bill Wendling <isanbard@gmail.com> Use method to query for attributes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165207 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
9158eecd42613e40b7a5825059cadfb702a1a7ba 04-Oct-2012 Bill Wendling <isanbard@gmail.com> Query for attributes via the correct method call.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@165206 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
1fe4fae463eba5965aa1f98600161ef7de96aaf1 02-Oct-2012 Chandler Carruth <chandlerc@gmail.com> Turn the new SROA pass back on. Let's see if it sticks this time. =]

Again, let me know if anything breaks due to this!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164986 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
72f0976c1b91c7ba50dce4d0ad0289dc14d37f81 30-Sep-2012 Benjamin Kramer <benny.kra@googlemail.com> ArgumentPromotion: Remove ancient workaround for a bug in the C backend.

Fun fact: The CBE learned how to deal with this situation before it was removed.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164918 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
f5fdc14df9914969bf56315cd3be8a3b3822a22e 28-Sep-2012 Evan Cheng <evan.cheng@apple.com> GlobalDCE should be run at -O2 / -Os to eliminate unused dtor, etc. rdar://9142819

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164850 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
ab16423c912a7baa73f36e9032365925914487a3 28-Sep-2012 Benjamin Kramer <benny.kra@googlemail.com> GlobalOpt: non-constexpr bitcasts or GEPs can occur even if the global value is only stored once.

Fixes PR13968.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164815 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
94c22716d60ff5edf6a98a3c67e0faa001be1142 27-Sep-2012 Sylvestre Ledru <sylvestre@debian.org> Revert 'Fix a typo 'iff' => 'if''. iff is an abreviation of if and only if. See: http://en.wikipedia.org/wiki/If_and_only_if Commit 164767

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164768 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
lobalOpt.cpp
runeEH.cpp
7e2c793a2b5c746344652b6579e958ee42fafdcc 27-Sep-2012 Sylvestre Ledru <sylvestre@debian.org> Fix a typo 'iff' => 'if'

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164767 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
lobalOpt.cpp
runeEH.cpp
bfc342d412724c91f87da1c3abdcf8e1dbf2db8c 27-Sep-2012 Nick Lewycky <nicholas@mxc.ca> Disable the new SROA pass to get the tree back in working order. We don't yet
have testcases for the current problems.


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

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164725 91177308-0d34-0410-b5e6-96231b3b80d8
nlineAlways.cpp
nliner.cpp
853a8c5f2ee9fa16f7c4c1fca658db40d4c73743 25-Sep-2012 Bill Wendling <isanbard@gmail.com> Move Attribute::typeIncompatible inside of the Attributes class.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164629 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
84d882ee56b76d571971e9f265be1611b1583720 24-Sep-2012 Chandler Carruth <chandlerc@gmail.com> Enable the new SROA pass by default.

Queue the fallout. ;]

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164480 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
e5373b7c3f3ab3567f5b67f8fe8d61a7f22cea23 18-Sep-2012 Benjamin Kramer <benny.kra@googlemail.com> LNT builders have picked up new SROA, disable it to get the remaining builders green again.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164124 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
c370acdf9698b7eee11f3d8e3732f1d72cd25943 18-Sep-2012 Chandler Carruth <chandlerc@gmail.com> Add a major missing piece to the new SROA pass: aggressive splitting of
FCAs. This is essential in order to promote allocas that are used in
struct returns by frontends like Clang. The FCA load would block the
rest of the pass from firing, resulting is significant regressions with
the bullet benchmark in the nightly test suite.

Thanks to Duncan for repeated discussions about how best to do this, and
to both him and Benjamin for review.

This appears to have blocked many places where the pass tries to fire,
and so I'm expect somewhat different results with this fix added.

As with the last big patch, I'm including a change to enable the SROA by
default *temporarily*. Ben is going to remove this as soon as the LNT
bots pick up the patch. I'm just trying to get a round of LNT numbers
from the stable machines in the lab.

NOTE: Four clang tests are expected to fail in the brief window where
this is enabled. Sorry for the noise!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@164119 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
8a96348a417acedef5d62eaff5245d31d0efa3f9 15-Sep-2012 Benjamin Kramer <benny.kra@googlemail.com> Disable new sroa now that all buildbots have tested it.

What we have so far:
- Some clang test failures (these were known already)

- Perf results are mixed, some big regressions
http://llvm.org/perf/db_default/v4/nts/3844
http://llvm.org/perf/db_default/v4/nts/3845

bullet suffers a lot. matmul is interesting: slower scalar code, faster with -vectorize.

- Some dragonegg selfhost bots crash in SROA during selfhost now
http://lab.llvm.org:8011/builders/dragonegg-x86_64-linux-gcc-4.6-self-host-checks/builds/1632
http://lab.llvm.org:8011/builders/dragonegg-x86_64-linux-gcc-4.5-self-host/builds/1891

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163968 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
1c8db50a9aca4229ebee75ed9cfbf8b222292787 15-Sep-2012 Chandler Carruth <chandlerc@gmail.com> Port the SSAUpdater-based promotion logic from the old SROA pass to the
new one, and add support for running the new pass in that mode and in
that slot of the pass manager. With this the new pass can completely
replace the old one within the pipeline.

The strategy for enabling or disabling the SSAUpdater logic is to do it
by making the requirement of the domtree analysis optional. By default,
it is required and we get the standard mem2reg approach. This is usually
the desired strategy when run in stand-alone situations. Within the
CGSCC pass manager, we disable requiring of the domtree analysis and
consequentially trigger fallback to the SSAUpdater promotion.

In theory this would allow the pass to re-use a domtree if one happened
to be available even when run in a mode that doesn't require it. In
practice, it lets us have a single pass rather than two which was
simpler for me to wrap my head around.

There is a hidden flag to force the use of the SSAUpdater code path for
the purpose of testing. The primary testing strategy is just to run the
existing tests through that path. One notable difference is that it has
custom code to handle lifetime markers, and one of the tests has been
enhanced to exercise that code.

This has survived a bootstrap and the test suite without serious
correctness issues, however my run of the test suite produced *very*
alarming performance numbers. I don't entirely understand or trust them
though, so more investigation is on-going.

To aid my understanding of the performance impact of the new SROA now
that it runs throughout the optimization pipeline, I'm enabling it by
default in this commit, and will disable it again once the LNT bots have
picked up one iteration with it. I want to get those bots (which are
much more stable) to evaluate the impact of the change before I jump to
any conclusions.

NOTE: Several Clang tests will fail because they run -O3 and check the
result's order of output. They'll go back to passing once I disable it
again.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163965 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
63db8bebe6d4792b2d387a8648409fdd12eb498a 14-Sep-2012 Chandler Carruth <chandlerc@gmail.com> Actually keep the flag default-off for now. =/ That's what I get for
being busy testing this...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163890 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
713aa9431d84805c5b7ddce57159d14ee94cd548 14-Sep-2012 Chandler Carruth <chandlerc@gmail.com> Introduce a new SROA implementation.

This is essentially a ground up re-think of the SROA pass in LLVM. It
was initially inspired by a few problems with the existing pass:
- It is subject to the bane of my existence in optimizations: arbitrary
thresholds.
- It is overly conservative about which constructs can be split and
promoted.
- The vector value replacement aspect is separated from the splitting
logic, missing many opportunities where splitting and vector value
formation can work together.
- The splitting is entirely based around the underlying type of the
alloca, despite this type often having little to do with the reality
of how that memory is used. This is especially prevelant with unions
and base classes where we tail-pack derived members.
- When splitting fails (often due to the thresholds), the vector value
replacement (again because it is separate) can kick in for
preposterous cases where we simply should have split the value. This
results in forming i1024 and i2048 integer "bit vectors" that
tremendously slow down subsequnet IR optimizations (due to large
APInts) and impede the backend's lowering.

The new design takes an approach that fundamentally is not susceptible
to many of these problems. It is the result of a discusison between
myself and Duncan Sands over IRC about how to premptively avoid these
types of problems and how to do SROA in a more principled way. Since
then, it has evolved and grown, but this remains an important aspect: it
fixes real world problems with the SROA process today.

First, the transform of SROA actually has little to do with replacement.
It has more to do with splitting. The goal is to take an aggregate
alloca and form a composition of scalar allocas which can replace it and
will be most suitable to the eventual replacement by scalar SSA values.
The actual replacement is performed by mem2reg (and in the future
SSAUpdater).

The splitting is divided into four phases. The first phase is an
analysis of the uses of the alloca. This phase recursively walks uses,
building up a dense datastructure representing the ranges of the
alloca's memory actually used and checking for uses which inhibit any
aspects of the transform such as the escape of a pointer.

Once we have a mapping of the ranges of the alloca used by individual
operations, we compute a partitioning of the used ranges. Some uses are
inherently splittable (such as memcpy and memset), while scalar uses are
not splittable. The goal is to build a partitioning that has the minimum
number of splits while placing each unsplittable use in its own
partition. Overlapping unsplittable uses belong to the same partition.
This is the target split of the aggregate alloca, and it maximizes the
number of scalar accesses which become accesses to their own alloca and
candidates for promotion.

Third, we re-walk the uses of the alloca and assign each specific memory
access to all the partitions touched so that we have dense use-lists for
each partition.

Finally, we build a new, smaller alloca for each partition and rewrite
each use of that partition to use the new alloca. During this phase the
pass will also work very hard to transform uses of an alloca into a form
suitable for promotion, including forming vector operations, speculating
loads throguh PHI nodes and selects, etc.

After splitting is complete, each newly refined alloca that is
a candidate for promotion to a scalar SSA value is run through mem2reg.

There are lots of reasonably detailed comments in the source code about
the design and algorithms, and I'm going to be trying to improve them in
subsequent commits to ensure this is well documented, as the new pass is
in many ways more complex than the old one.

Some of this is still a WIP, but the current state is reasonbly stable.
It has passed bootstrap, the nightly test suite, and Duncan has run it
successfully through the ACATS and DragonEgg test suites. That said, it
remains behind a default-off flag until the last few pieces are in
place, and full testing can be done.

Specific areas I'm looking at next:
- Improved comments and some code cleanup from reviews.
- SSAUpdater and enabling this pass inside the CGSCC pass manager.
- Some datastructure tuning and compile-time measurements.
- More aggressive FCA splitting and vector formation.

Many thanks to Duncan Sands for the thorough final review, as well as
Benjamin Kramer for lots of review during the process of writing this
pass, and Daniel Berlin for reviewing the data structures and algorithms
and general theory of the pass. Also, several other people on IRC, over
lunch tables, etc for lots of feedback and advice.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163883 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
aa8405811ed9ad84e5afb70dac04ebfbae519316 13-Sep-2012 Nadav Rotem <nrotem@apple.com> Fix an 80 char line limit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@163808 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
1c4ad5ef4fab105f0c8af7edd026e00502fb6279 11-Sep-2012 Stephen Hines <srhines@google.com> Merge branch 'upstream' into merge-2012_09_10

Conflicts:
lib/CodeGen/AsmPrinter/AsmPrinterInlineAsm.cpp
lib/Support/DynamicLibrary.cpp
lib/Support/LockFileManager.cpp

Change-Id: I91e94c3a7a76e19c688307c5a480a640a3bd2b7e
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
lobalOpt.cpp
nliner.cpp
31675153bd2d7617db8cb6aeb58054934c7b9f73 24-Aug-2012 Stephen Hines <srhines@google.com> Merge branch 'upstream' into merge_2

Conflicts:
lib/Target/ARM/ARMCodeEmitter.cpp

Change-Id: I6702d340c733e9721499b5d85b13b96ad9c14eb5
7744acd1ab73b3eec6f1449f47083abe3fb1b527 03-Aug-2012 Shih-wei Liao <sliao@google.com> Merge with LLVM upstream r160668 (Jul 24th 2012)

Conflicts:
include/llvm/Support/ELF.h
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
lib/Support/Memory.cpp
lib/Transforms/Instrumentation/AddressSanitizer.cpp

Change-Id: Iddd658cf2eadc7165b2805b446d31af2c5c9917f
573e97326766359d3a9747eed7b7d47b6c33fa0f 03-Aug-2012 Bill Wendling <isanbard@gmail.com> Move the "findUsedStructTypes" functionality outside of the Module class.

The "findUsedStructTypes" method is very expensive to run. It needs to be
optimized so that LTO can run faster. Splitting this method out of the Module
class will help this occur. For instance, it can keep a list of seen objects so
that it doesn't process them over and over again.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@161228 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
b8cd66b5d78eaeba41ab372aaca5180dd54e4385 25-Jul-2012 Nick Lewycky <nicholas@mxc.ca> It's not safe to blindly remove invoke instructions. This happens when we
encounter an invoke of an allocation function. This should fix the dragonegg
bootstrap. Testcase to follow, later.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160757 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
952f5d562c40bc19147df4fbf3415069659236d1 24-Jul-2012 Nick Lewycky <nicholas@mxc.ca> Don't delete one more instruction than we're allowed to. This should fix the
Darwin bootstrap. Testcase exists but isn't fully reduced, I expect to commit
the testcase this evening.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160693 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
8899d5c6fb3cf118c5c73eade290b6ebb2b3b850 24-Jul-2012 Nick Lewycky <nicholas@mxc.ca> Teach globalopt to not nuke all stores to globals. Keep them around of they
might be deliberate "one time" leaks, so that leak checkers can find them.
This is a reapply of r160602 with the fix that this time I'm committing the
code I thought I was committing last time; the I->eraseFromParent() goes
*after* the break out of the loop.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160664 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
c7088c9a9cc37a5dce54def94f8c347922e0631c 21-Jul-2012 Nick Lewycky <nicholas@mxc.ca> Revert r160602.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160603 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
61e2ff8f821beec2eefdbb21a5954f74b1c0a295 21-Jul-2012 Nick Lewycky <nicholas@mxc.ca> Teach globalopt to play nice with leak checkers. This is a reapplication of
r160529 that was subsequently reverted. The fix was to not call
GV->eraseFromParent() right before the caller does the same. The existing
testcases already caught this bug if run under valgrind.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160602 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
4a96d0e44bd691759f0d4d4f8be9b47cb64d7f64 20-Jul-2012 Nick Lewycky <nicholas@mxc.ca> Revert r160529 due to crashes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160532 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
39e357fafe074babbd9661f3e78239f5ebe7c429 20-Jul-2012 Nick Lewycky <nicholas@mxc.ca> Don't wipe out global variables that are probably storing pointers to heap
memory. This makes clang play nice with leak checkers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160529 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
b26e2916c937d03bc2d7e273b2df4ffccdb061b4 19-Jul-2012 Benjamin Kramer <benny.kra@googlemail.com> Replace some explicit compare loops with std::equal.

No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160501 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
56cb2298663017eb77aa4f4dda8db7ecd1b58173 19-Jul-2012 Bill Wendling <isanbard@gmail.com> Remove tabs.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@160477 91177308-0d34-0410-b5e6-96231b3b80d8
xtractGV.cpp
ergeFunctions.cpp
b2fe7f183d54d7e93880c8a472e0145e13dce070 02-Jul-2012 Duncan Sands <baldrick@free.fr> GlobalOpt forgot to handle bitcast when analyzing globals. Found by inspection.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159546 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.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
ergeFunctions.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
tripSymbols.cpp
06b8c285d387d413e51108abea5168d7dc1d97b7 27-Jun-2012 Matt Beaumont-Gay <matthewbg@google.com> Revert r159136 due to PR13124.

Original commit message:

If a constant or a function has linkonce_odr linkage and unnamed_addr, mark it
hidden. Being linkonce_odr guarantees that it is available in every dso that
needs it. Being a constant/function with unnamed_addr guarantees that the
copies don't have to be merged.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159272 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
a0706a9ff4469b137ed6eea3f484a0152bab4c88 25-Jun-2012 Rafael Espindola <rafael.espindola@gmail.com> If a constant or a function has linkonce_odr linkage and unnamed_addr, mark it
hidden. Being linkonce_odr guarantees that it is available in every dso that
needs it. Being a constant/function with unnamed_addr guarantees that the
copies don't have to be merged.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159136 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
d5c407d2d01ff8797c29343e4da5f765fe52fb5f 24-Jun-2012 NAKAMURA Takumi <geek4civic@gmail.com> llvm/lib: [CMake] Add explicit dependency to intrinsics_gen.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159112 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
3eab3c4d40e381d2c2eed93a423cb67e97ad718f 24-Jun-2012 Nick Lewycky <nicholas@mxc.ca> Tab to spaces. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159104 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
ce718ff9f42c7da092eaa01dd0242e8d5ba84713 23-Jun-2012 Hans Wennborg <hans@hanshq.net> Extend the IL for selecting TLS models (PR9788)

This allows the user/front-end to specify a model that is better
than what LLVM would choose by default. For example, a variable
might be declared as

@x = thread_local(initialexec) global i32 42

if it will not be used in a shared library that is dlopen'ed.

If the specified model isn't supported by the target, or if LLVM can
make a better choice, a different model may be used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159077 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
cd88efe516510d3413c0e880217779e3eb56e956 22-Jun-2012 Nuno Lopes <nunoplopes@sapo.pt> fix whitespace in my last commit.
sorry for the churn :S enough for today; going to sleep.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158953 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
eb7c6865cd8d44a882aa7c3e10e1d976f333344f 22-Jun-2012 Nuno Lopes <nunoplopes@sapo.pt> remove extractMallocCallFromBitCast, since it was tailor maded for its sole user. Update GlobalOpt accordingly.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158952 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
2f135d4c14d26d00deaa72fd0f36731968161e5e 15-Jun-2012 Rafael Espindola <rafael.espindola@gmail.com> Some optimizations done by globalopt are safe only for internal linkage, not
linkonce linkage. For example, it is not valid to add unnamed_addr.

This also fixes a crash in g++.dg/opt/static5.C.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158528 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
0397729d3b8da4208660a163d18296b1a3bd32b8 15-Jun-2012 Rafael Espindola <rafael.espindola@gmail.com> Implement the isSafeToDiscardIfUnused predicate and use it in globalopt and
globaldce. Globaldce was already removing linkonce globals, but globalopt was
not.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@158476 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
lobalOpt.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
nliner.cpp
d509d0b532ec2358b3f341d4a4cd1411cb8b5db2 28-May-2012 Chris Lattner <sabre@nondot.org> switch AttrListPtr::get to take an ArrayRef, simplifying a lot of clients.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157556 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
ab767213fdfc219384e26b8073783cb883974dcd 23-May-2012 Patrik Hägglund <patrik.h.hagglund@ericsson.com> Fix the inliner so that the optsize function attribute don't alter the
inline threshold if the global inline threshold is lower (as for -Oz).

Reviewed by Chandler Carruth and Bill Wendling.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@157323 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
b7454fd9df0b477e3daf2fce6e1d5e1b241562df 12-May-2012 Jay Foad <jay.foad@gmail.com> Teach Function::hasAddressTaken that BlockAddress doesn't really take
the address of a function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156703 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
99650c9088c5dd4b6788a99b63c82d13e0518961 04-May-2012 Chandler Carruth <chandlerc@gmail.com> Move the CodeExtractor utility to a dedicated header file / source file,
and expose it as a utility class rather than as free function wrappers.

The simple free-function interface works well for the bugpoint-specific
pass's uses of code extraction, but in an upcoming patch for more
advanced code extraction, they simply don't expose a rich enough
interface. I need to expose various stages of the process of doing the
code extraction and query information to decide whether or not to
actually complete the extraction or give up.

Rather than build up a new predicate model and pass that into these
functions, just take the class that was actually implementing the
functions and lift it up into a proper interface that can be used to
perform code extraction. The interface is cleaned up and re-documented
to work better in a header. It also is now setup to accept the blocks to
be extracted in the constructor rather than in a method.

In passing this essentially reverts my previous commit here exposing
a block-level query for eligibility of extraction. That is no longer
necessary with the more rich interface as clients can query the
extraction object for eligibility directly. This will reduce the number
of walks of the input basic block sequence by quite a bit which is
useful if this enters the normal optimization pipeline.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@156163 91177308-0d34-0410-b5e6-96231b3b80d8
oopExtractor.cpp
artialInlining.cpp
cf5a1461acaace0f3e7d11fbbcfbf635b8c8ea9d 24-Apr-2012 Shih-wei Liao <sliao@google.com> Merge with LLVM upstream r155090.

Conflicts:
lib/Support/Unix/PathV2.inc

Change-Id: I7b89833849f6cbcfa958a33a971d0f7754c9cb2c
ab3a9193b12059bebb380ec90fe9a373542bc920 16-Apr-2012 Bill Wendling <isanbard@gmail.com> Add a Fixme.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154793 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
064551e94c9763c7e74121b88f9cbccc0969946a 13-Apr-2012 Hal Finkel <hfinkel@anl.gov> By default, use Early-CSE instead of GVN for vectorization cleanup.

As has been suggested by Duncan and others, Early-CSE and GVN should
do similar redundancy elimination, but Early-CSE is much less expensive.
Most of my autovectorization benchmarks show a performance regresion, but
all of these are < 0.1%, and so I think that it is still worth using
the less expensive pass.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154673 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
aab3c0cb077f741af3447cc030c28bedd23b491c 13-Apr-2012 Bill Wendling <isanbard@gmail.com> Code-gen may inject code into the IR before it emits the ASM. The linker
obviously cannot know that this code is present, let alone used. So prevent the
internalize pass from internalizing those global values which code-gen may
insert.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154645 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
d6fc26217e194372cabe4ef9e2514beac511a943 11-Apr-2012 Chandler Carruth <chandlerc@gmail.com> Add two statistics to help track how we are computing the inline cost.

Yea, 'NumCallerCallersAnalyzed' isn't a great name, suggestions welcome.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@154492 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
3197b4453d214aa96de3a42da8f8fe189fff2077 03-Apr-2012 Bill Wendling <isanbard@gmail.com> Add an option to turn off the expensive GVN load PRE part of GVN.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153902 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
dafe48e230916ce0de4228d81dece732159994f1 01-Apr-2012 Chandler Carruth <chandlerc@gmail.com> Belatedly address some code review from Chris.

As a side note, I really dislike array_pod_sort... Do we really still
care about any STL implementations that get this so wrong? Does libc++?

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153834 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
6052eef8bd701b30a0ab5749296671ca34389c39 01-Apr-2012 Chandler Carruth <chandlerc@gmail.com> Fix a pretty scary bug I introduced into the always inliner with
a single missing character. Somehow, this had gone untested. I've added
tests for returns-twice logic specifically with the always-inliner that
would have caught this, and fixed the bug.

Thanks to Matt for the careful review and spotting this!!! =D

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153832 91177308-0d34-0410-b5e6-96231b3b80d8
nlineAlways.cpp
b594a84df501385e4d90bd9531084be62cef0857 31-Mar-2012 Chandler Carruth <chandlerc@gmail.com> Give the always-inliner its own custom filter. It shouldn't have to pay
the very high overhead of the complex inline cost analysis when all it
wants to do is detect three patterns which must not be inlined. Comment
the code, clean it up, and leave some hints about possible performance
improvements if this ever shows up on a profile.

Moving this off of the (now more expensive) inline cost analysis is
particularly important because we have to run this inliner even at -O0.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153814 91177308-0d34-0410-b5e6-96231b3b80d8
nlineAlways.cpp
45de584b4f82fbfb9cb9c50bc1fc08931b534308 31-Mar-2012 Chandler Carruth <chandlerc@gmail.com> Remove a bunch of empty, dead, and no-op methods from all of these
interfaces. These methods were used in the old inline cost system where
there was a persistent cache that had to be updated, invalidated, and
cleared. We're now doing more direct computations that don't require
this intricate dance. Even if we resume some level of caching, it would
almost certainly have a simpler and more narrow interface than this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153813 91177308-0d34-0410-b5e6-96231b3b80d8
nlineAlways.cpp
nlineSimple.cpp
nliner.cpp
f2286b0152f0b942e82d8e809186e5cc0d247131 31-Mar-2012 Chandler Carruth <chandlerc@gmail.com> Initial commit for the rewrite of the inline cost analysis to operate
on a per-callsite walk of the called function's instructions, in
breadth-first order over the potentially reachable set of basic blocks.

This is a major shift in how inline cost analysis works to improve the
accuracy and rationality of inlining decisions. A brief outline of the
algorithm this moves to:

- Build a simplification mapping based on the callsite arguments to the
function arguments.
- Push the entry block onto a worklist of potentially-live basic blocks.
- Pop the first block off of the *front* of the worklist (for
breadth-first ordering) and walk its instructions using a custom
InstVisitor.
- For each instruction's operands, re-map them based on the
simplification mappings available for the given callsite.
- Compute any simplification possible of the instruction after
re-mapping, and store that back int othe simplification mapping.
- Compute any bonuses, costs, or other impacts of the instruction on the
cost metric.
- When the terminator is reached, replace any conditional value in the
terminator with any simplifications from the mapping we have, and add
any successors which are not proven to be dead from these
simplifications to the worklist.
- Pop the next block off of the front of the worklist, and repeat.
- As soon as the cost of inlining exceeds the threshold for the
callsite, stop analyzing the function in order to bound cost.

The primary goal of this algorithm is to perfectly handle dead code
paths. We do not want any code in trivially dead code paths to impact
inlining decisions. The previous metric was *extremely* flawed here, and
would always subtract the average cost of two successors of
a conditional branch when it was proven to become an unconditional
branch at the callsite. There was no handling of wildly different costs
between the two successors, which would cause inlining when the path
actually taken was too large, and no inlining when the path actually
taken was trivially simple. There was also no handling of the code
*path*, only the immediate successors. These problems vanish completely
now. See the added regression tests for the shiny new features -- we
skip recursive function calls, SROA-killing instructions, and high cost
complex CFG structures when dead at the callsite being analyzed.

Switching to this algorithm required refactoring the inline cost
interface to accept the actual threshold rather than simply returning
a single cost. The resulting interface is pretty bad, and I'm planning
to do lots of interface cleanup after this patch.

Several other refactorings fell out of this, but I've tried to minimize
them for this patch. =/ There is still more cleanup that can be done
here. Please point out anything that you see in review.

I've worked really hard to try to mirror at least the spirit of all of
the previous heuristics in the new model. It's not clear that they are
all correct any more, but I wanted to minimize the change in this single
patch, it's already a bit ridiculous. One heuristic that is *not* yet
mirrored is to allow inlining of functions with a dynamic alloca *if*
the caller has a dynamic alloca. I will add this back, but I think the
most reasonable way requires changes to the inliner itself rather than
just the cost metric, and so I've deferred this for a subsequent patch.
The test case is XFAIL-ed until then.

As mentioned in the review mail, this seems to make Clang run about 1%
to 2% faster in -O0, but makes its binary size grow by just under 4%.
I've looked into the 4% growth, and it can be fixed, but requires
changes to other parts of the inliner.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153812 91177308-0d34-0410-b5e6-96231b3b80d8
nlineAlways.cpp
nlineSimple.cpp
nliner.cpp
1955c9cf46f64513d1f0034573ca00b6b396fabe 31-Mar-2012 Benjamin Kramer <benny.kra@googlemail.com> Internalize: Remove reference of @llvm.noinline, it was replaced with the noinline attribute a long time ago.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153806 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
c1ea16ec4339a9746f436c6f2f5b08197f309343 28-Mar-2012 Benjamin Kramer <benny.kra@googlemail.com> GlobalOpt: If we have an inbounds GEP from a ConstantAggregateZero global that we just determined to be constant, replace all loads from it with a zero value.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153576 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
dacffb6679ff99fec4cc9c54f4257d2913870d01 27-Mar-2012 Chandler Carruth <chandlerc@gmail.com> Make a seemingly tiny change to the inliner and fix the generated code
size bloat. Unfortunately, I expect this to disable the majority of the
benefit from r152737. I'm hopeful at least that it will fix PR12345. To
explain this requires... quite a bit of backstory I'm afraid.

TL;DR: The change in r152737 actually did The Wrong Thing for
linkonce-odr functions. This change makes it do the right thing. The
benefits we saw were simple luck, not any actual strategy. Benchmark
numbers after a mini-blog-post so that I've written down my thoughts on
why all of this works and doesn't work...

To understand what's going on here, you have to understand how the
"bottom-up" inliner actually works. There are two fundamental modes to
the inliner:

1) Standard fixed-cost bottom-up inlining. This is the mode we usually
think about. It walks from the bottom of the CFG up to the top,
looking at callsites, taking information about the callsite and the
called function and computing th expected cost of inlining into that
callsite. If the cost is under a fixed threshold, it inlines. It's
a touch more complicated than that due to all the bonuses, weights,
etc. Inlining the last callsite to an internal function gets higher
weighth, etc. But essentially, this is the mode of operation.

2) Deferred bottom-up inlining (a term I just made up). This is the
interesting mode for this patch an r152737. Initially, this works
just like mode #1, but once we have the cost of inlining into the
callsite, we don't just compare it with a fixed threshold. First, we
check something else. Let's give some names to the entities at this
point, or we'll end up hopelessly confused. We're considering
inlining a function 'A' into its callsite within a function 'B'. We
want to check whether 'B' has any callers, and whether it might be
inlined into those callers. If so, we also check whether inlining 'A'
into 'B' would block any of the opportunities for inlining 'B' into
its callers. We take the sum of the costs of inlining 'B' into its
callers where that inlining would be blocked by inlining 'A' into
'B', and if that cost is less than the cost of inlining 'A' into 'B',
then we skip inlining 'A' into 'B'.

Now, in order for #2 to make sense, we have to have some confidence that
we will actually have the opportunity to inline 'B' into its callers
when cheaper, *and* that we'll be able to revisit the decision and
inline 'A' into 'B' if that ever becomes the correct tradeoff. This
often isn't true for external functions -- we can see very few of their
callers, and we won't be able to re-consider inlining 'A' into 'B' if
'B' is external when we finally see more callers of 'B'. There are two
cases where we believe this to be true for C/C++ code: functions local
to a translation unit, and functions with an inline definition in every
translation unit which uses them. These are represented as internal
linkage and linkonce-odr (resp.) in LLVM. I enabled this logic for
linkonce-odr in r152737.

Unfortunately, when I did that, I also introduced a subtle bug. There
was an implicit assumption that the last caller of the function within
the TU was the last caller of the function in the program. We want to
bonus the last caller of the function in the program by a huge amount
for inlining because inlining that callsite has very little cost.
Unfortunately, the last caller in the TU of a linkonce-odr function is
*not* the last caller in the program, and so we don't want to apply this
bonus. If we do, we can apply it to one callsite *per-TU*. Because of
the way deferred inlining works, when it sees this bonus applied to one
callsite in the TU for 'B', it decides that inlining 'B' is of the
*utmost* importance just so we can get that final bonus. It then
proceeds to essentially force deferred inlining regardless of the actual
cost tradeoff.

The result? PR12345: code bloat, code bloat, code bloat. Another result
is getting *damn* lucky on a few benchmarks, and the over-inlining
exposing critically important optimizations. I would very much like
a list of benchmarks that regress after this change goes in, with
bitcode before and after. This will help me greatly understand what
opportunities the current cost analysis is missing.

Initial benchmark numbers look very good. WebKit files that exhibited
the worst of PR12345 went from growing to shrinking compared to Clang
with r152737 reverted.

- Bootstrapped Clang is 3% smaller with this change.
- Bootstrapped Clang -O0 over a single-source-file of lib/Lex is 4%
faster with this change.

Please let me know about any other performance impact you see. Thanks to
Nico for reporting and urging me to actually fix, Richard Smith, Duncan
Sands, Manuel Klimek, and Benjamin Kramer for talking through the issues
today.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153506 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
d54f9a4c3bcdb247ea4aa311251c19242b03be63 25-Mar-2012 Chandler Carruth <chandlerc@gmail.com> Move the instruction simplification of callsite arguments in the inliner
to instead rely on much more generic and powerful instruction
simplification in the function cloner (and thus inliner).

This teaches the pruning function cloner to use instsimplify rather than
just the constant folder to fold values during cloning. This can
simplify a large number of things that constant folding alone cannot
begin to touch. For example, it will realize that 'or' and 'and'
instructions with certain constant operands actually become constants
regardless of what their other operand is. It also can thread back
through the caller to perform simplifications that are only possible by
looking up a few levels. In particular, GEPs and pointer testing tend to
fold much more heavily with this change.

This should (in some cases) have a positive impact on compile times with
optimizations on because the inliner itself will simply avoid cloning
a great deal of code. It already attempted to prune proven-dead code,
but now it will be use the stronger simplifications to prove more code
dead.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153403 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
c59a7995d22e2889706810c90a20a51ecfec278b 24-Mar-2012 Shih-wei Liao <sliao@google.com> Merge branch 'upstream' into sliao_d
1db394921b9635980555cc8d7e0d05b5e885784f 24-Mar-2012 Kostya Serebryany <kcc@google.com> add EP_OptimizerLast extension point

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@153353 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
b2442fc76016203df3449c365bf4943dad8500e4 16-Mar-2012 Chandler Carruth <chandlerc@gmail.com> Rip out support for 'llvm.noinline'. This thing has a strange history...

It was added in 2007 as the first cut at supporting no-inline
attributes, but we didn't have function attributes of any form at the
time. However, it was added without any mention in the LangRef or other
documentation.

Later on, in 2008, Devang added function notes for 'inline=never' and
then turned them into proper function attributes. From that point
onward, as far as I can tell, the world moved on, and no one has touched
'llvm.noinline' in any meaningful way since.

It's time has now come. We have had better mechanisms for doing this for
a long time, all the frontends I'm aware of use them, and this is just
holding back progress. Given that it was never a documented feature of
the IR, I've provided no auto-upgrade support. If people know of real,
in-the-wild bitcode that relies on this, yell at me and I'll add it, but
I *seriously* doubt anyone cares.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152904 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
f91f5af802bd4487c49ee17cd0d3e46c6456263e 16-Mar-2012 Chandler Carruth <chandlerc@gmail.com> Start removing the use of an ad-hoc 'never inline' set and instead
directly query the function information which this set was representing.
This simplifies the interface of the inline cost analysis, and makes the
always-inline pass significantly more efficient.

Previously, always-inline would first make a single set of every
function in the module *except* those marked with the always-inline
attribute. It would then query this set at every call site to see if the
function was a member of the set, and if so, refuse to inline it. This
is quite wasteful. Instead, simply check the function attribute directly
when looking at the callsite.

The normal inliner also had similar redundancy. It added every function
in the module with the noinline attribute to its set to ignore, even
though inside the cost analysis function we *already tested* the
noinline attribute and produced the same result.

The only tricky part of removing this is that we have to be able to
correctly remove only the functions inlined by the always-inline pass
when finalizing, which requires a bit of a hack. Still, much less of
a hack than the set of all non-always-inline functions was. While I was
touching this function, I switched a heavy-weight set to a vector with
sort+unique. The algorithm already had a two-phase insert and removal
pattern, we were just needlessly paying the uniquing cost on every
insert.

This probably speeds up some compiles by a small amount (-O0 compiles
with lots of always-inline, so potentially heavy libc++ users), but I've
not tried to measure it.

I believe there is no functional change here, but yell if you spot one.
None are intended.

Finally, the direction this is going in is to greatly simplify the
inline cost query interface so that we can replace its implementation
with a much more clever one. Along the way, all the APIs get simplified,
so it seems incrementally good.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152903 91177308-0d34-0410-b5e6-96231b3b80d8
nlineAlways.cpp
nlineSimple.cpp
nliner.cpp
b16117c368ad4e6d004ac912549b2c6ed06731a5 14-Mar-2012 Chandler Carruth <chandlerc@gmail.com> Change where we enable the heuristic that delays inlining into functions
which are small enough to themselves be inlined. Delaying in this manner
can be harmful if the function is inelligible for inlining in some (or
many) contexts as it pessimizes the code of the function itself in the
event that inlining does not eventually happen.

Previously the check was written to only do this delaying of inlining
for static functions in the hope that they could be entirely deleted and
in the knowledge that all callers of static functions will have the
opportunity to inline if it is in fact profitable. However, with C++ we
get two other important sources of functions where the definition is
always available for inlining: inline functions and templated functions.
This patch generalizes the inliner to allow linkonce-ODR (the linkage
such C++ routines receive) to also qualify for this delay-based
inlining.

Benchmarking across a range of large real-world applications shows
roughly 2% size increase across the board, but an average speedup of
about 0.5%. Some benhcmarks improved over 2%, and the 'clang' binary
itself (when bootstrapped with this feature) shows a 1% -O0 performance
improvement when run over all Sema, Lex, and Parse source code smashed
into a single file. A clean re-build of Clang+LLVM with a bootstrapped
Clang shows approximately 2% improvement, but that measurement is often
noisy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152737 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
f1ce79f3c359bf33c2f30a74625a9babc3cc2a48 13-Mar-2012 Dan Gohman <gohman@apple.com> Teach globalopt how to evaluate an invoke with a non-void return type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152634 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
6c0b3ac8ea51d35bbd2565f17f1a73c3bfcb5cdf 12-Mar-2012 Chandler Carruth <chandlerc@gmail.com> When inlining a function and adding its inner call sites to the
candidate set for subsequent inlining, try to simplify the arguments to
the inner call site now that inlining has been performed.

The goal here is to propagate and fold constants through deeply nested
call chains. Without doing this, we loose the inliner bonus that should
be applied because the arguments don't match the exact pattern the cost
estimator uses.

Reviewed on IRC by Benjamin Kramer.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152556 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.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
lobalOpt.cpp
c02a5c5e8d9c1fd2a20ad4aed40f328564e95b40 05-Mar-2012 Stephen Hines <srhines@google.com> Merge branch 'upstream' into merge-20120305

Conflicts:
lib/Support/Atomic.cpp

Change-Id: I563b3bc2a82942ccbae5bed42e53b9149a8bf3a0
3bbf2b6548340bb9218836f991da8c3a4718f6db 27-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> Plog a memleak in GlobalOpt.

Found by valgrind.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151525 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
dfba3ad88276b0aad3d515320bb4a50480c364d9 25-Feb-2012 Chad Rosier <mcrosier@apple.com> Add comment.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151431 91177308-0d34-0410-b5e6-96231b3b80d8
nlineAlways.cpp
nlineSimple.cpp
fa086f1f00a8b75ab2e2208bd7a028e62f9854db 25-Feb-2012 Chad Rosier <mcrosier@apple.com> Add support for disabling llvm.lifetime intrinsics in the AlwaysInliner. These
are optimization hints, but at -O0 we're not optimizing. This becomes a problem
when the alwaysinline attribute is abused.
rdar://10921594



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151429 91177308-0d34-0410-b5e6-96231b3b80d8
nlineAlways.cpp
nlineSimple.cpp
nliner.cpp
ff16eb64f5248df439a7b006f4aefd470606287a 25-Feb-2012 Chad Rosier <mcrosier@apple.com> Fix indentation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151420 91177308-0d34-0410-b5e6-96231b3b80d8
nlineAlways.cpp
4b794f81917d2799225a9d1951729f1798431f81 23-Feb-2012 Duncan Sands <baldrick@free.fr> GCC fails to understand that NextBB is always initialized if EvaluateBlock
returns 'true' and emits a warning. Help it out.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151242 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
a641c07828fe4e836d680b9e8b0b4af3204b8b97 21-Feb-2012 Nick Lewycky <nicholas@mxc.ca> Use the target-aware constant folder on expressions to improve the chance
they'll be simple enough to simulate, and to reduce the chance we'll encounter
equal but different simple pointer constants.

This removes the symptoms from PR11352 but is not a full fix. A proper fix would
either require a guarantee that two constant objects we simulate are folded
when equal, or a different way of handling equal pointers (ie., trying a
constantexpr icmp on them to see whether we know they're equal or non-equal or
unsure).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151093 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
0ef0557ab5cd11f56c16e82551d4f3b58bb2507a 21-Feb-2012 Nick Lewycky <nicholas@mxc.ca> Check for the correct size in the invariant marker.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@151003 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
7fa767770574ba0312165ac9ed08f792b8fb7874 20-Feb-2012 Nick Lewycky <nicholas@mxc.ca> Rename class Evaluate to Evaluator and put it in an anonymous namespace.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150947 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
23ec5d7759ed9a3b52fc8c470695248a1719cce8 20-Feb-2012 Nick Lewycky <nicholas@mxc.ca> Move EvaluateFunction and EvaluateBlock into a class, and make the class store
the information that they pass around between them. No functionality change!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150939 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
81266c5c9358d71331886a98e750ac9409cc640c 17-Feb-2012 Nick Lewycky <nicholas@mxc.ca> Add support for invariant.start inside the static constructor evaluator. This is
useful to represent a variable that is const in the source but can't be constant
in the IR because of a non-trivial constructor. If globalopt evaluates the
constructor, and there was an invariant.start with no matching invariant.end
possible, it will mark the global constant afterwards.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150794 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
132bd9ce56e1f6d0231c34acec738a8bc92c9cfa 12-Feb-2012 Nick Lewycky <nicholas@mxc.ca> Handle InvokeInst in EvaluateBlock. Don't try to support exceptions, it's just
that no optz'ns have run yet to convert invokes to calls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150326 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
6f160d3d78c1b7839b6bc053339e1fdfbf0276de 12-Feb-2012 Nick Lewycky <nicholas@mxc.ca> false is totally null!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150324 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
6a7df9aae620801d97da72d718e9aff76eebac9b 12-Feb-2012 Nick Lewycky <nicholas@mxc.ca> Remove redundant getAnalysis<> calls in GlobalOpt. Add a few Itanium ABI calls
to TargetLibraryInfo and use one of them in GlobalOpt.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150323 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
6a577f82ba56a4da48e984702240a01c3ba7e941 12-Feb-2012 Nick Lewycky <nicholas@mxc.ca> Pass TargetData and TargetLibraryInfo through to the constant folder. Fixes a
few fixme's when TLI was added.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150322 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
db292a6f7ffe410913255f65e195004327e2e0ce 12-Feb-2012 Nick Lewycky <nicholas@mxc.ca> Fix function name in comment to match actual name. Fix comments that are using
doxy-style on local variables to not do so. Fix one 80-col violation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150320 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
8e4ba6b954d58bd60b342770dfca62de4cf4eb6e 12-Feb-2012 Nick Lewycky <nicholas@mxc.ca> Don't traverse the PHI nodes twice. No functionality change!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150319 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
c1322a13b5b3a4e4f5017deeb27d85ac41f7a839 09-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> Tweak comment readability and grammar.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150183 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
d4692747439aac1fbc2064e11b53e3e6ea5ad463 09-Feb-2012 Benjamin Kramer <benny.kra@googlemail.com> GlobalOpt: Be more aggressive about elminating side-effect free static dtors.

GlobalOpt runs early in the pipeline (before inlining) and complex class
hierarchies often introduce bitcasts or GEPs which weren't optimized away.
Teach it to ignore side-effect free instructions instead of depending on
other passes to remove them.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150174 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
aa5abe88d6aa445afa593476a665e3ab14b3524c 06-Feb-2012 Bill Wendling <isanbard@gmail.com> [unwind removal] We no longer have 'unwind' instructions being generated, so
remove the code that handles them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149901 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
da82fd411ec37bc81a1e584d2f3163aeda4d2e95 06-Feb-2012 Nick Lewycky <nicholas@mxc.ca> Split part of EvaluateFunction into a new EvaluateBlock method. No functionality
change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149861 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
fad4d40f3792b0d9e101c40738e1f691131007d2 05-Feb-2012 Nick Lewycky <nicholas@mxc.ca> Teach GlobalOpt to handle atomic accesses to globals.

* Most of the transforms come through intact by having each transformed load or
store copy the ordering and synchronization scope of the original.
* The transform that turns a global only accessed in main() into an alloca
(since main is non-recursive) with a store of the initial value uses an
unordered store, since it's guaranteed to be the first thing to happen in main.
(Threads may have started before main (!) but they can't have the address of a
function local before the point in the entry block we insert our code.)
* The heap-SRoA transforms are disabled in the face of atomic operations. This
can probably be improved; it seems odd to have atomic accesses to an alloca
that doesn't have its address taken.

AnalyzeGlobal keeps track of the strongest ordering found in any use of the
global. This is more information than we need right now, but it's cheap to
compute and likely to be useful.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149847 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
bc384a1feb08141691ef994a7d11a506e89c5a62 05-Feb-2012 Nick Lewycky <nicholas@mxc.ca> Clean up some whitespace and comments. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149845 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.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
lobalOpt.cpp
de5e5ec3045a73a06b1054417f9ac6c02929e9ce 01-Feb-2012 Hal Finkel <hfinkel@anl.gov> Add a basic-block autovectorization pass.

This is the initial checkin of the basic-block autovectorization pass along with some supporting vectorization infrastructure.
Special thanks to everyone who helped review this code over the last several months (especially Tobias Grosser).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149468 91177308-0d34-0410-b5e6-96231b3b80d8
LVMBuild.txt
assManagerBuilder.cpp
a78fa8cc2dd6d2ffe5e4fe605f38aae7b3d2fb7a 27-Jan-2012 Chris Lattner <sabre@nondot.org> continue making the world safe for ConstantDataVector. At this point,
we should (theoretically optimize and codegen ConstantDataVector as well
as ConstantVector.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149116 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
d59ae907eea28285ece6696d6f3271b4ca578c0d 26-Jan-2012 Chris Lattner <sabre@nondot.org> Continue improving support for ConstantDataAggregate, and use the
new methods recently added to (sometimes greatly!) simplify code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149024 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
a1f00f4d488eb5daff52faaf99c62ee652fd3b85 25-Jan-2012 Chris Lattner <sabre@nondot.org> use Constant::getAggregateElement to simplify a bunch of code.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148934 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
4d6ccb5f68cd7c6418a209f1fa4dbade569e4493 20-Jan-2012 David Blaikie <dblaikie@gmail.com> More dead code removal (using -Wunreachable-code)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148578 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
7d4c87ef6eea424b7a28392ea11137ed77b44b57 17-Jan-2012 Dan Gohman <gohman@apple.com> Add a new PassManagerBuilder customization point,
EP_ModuleOptimizerEarly, to allow passes to be added before the
main ModulePass optimizers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148329 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
e15f421a9acd18ca71fed382ac09f7367b6a72f6 11-Jan-2012 Eli Friedman <eli.friedman@gmail.com> Re-fix the issue Bill fixed in r147899 in a slightly different way, which doesn't abuse the semantics of linker_private. We don't really want to merge any string constant with a weak_odr global.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147971 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
37b94c6b4e605c522164bcafc58ea1e1afb50cc0 11-Jan-2012 Bill Wendling <isanbard@gmail.com> If the global variable is removed by the linker, then don't constant merge it
with other symbols.

An object in the __cfstring section is suppoed to be filled with CFString
objects, which have a pointer to ___CFConstantStringClassReference followed by a
pointer to a __cstring. If we allow the object in the __cstring section to be
merged with another global, then it could end up in any section. Because the
linker is going to remove these symbols in the final executable, we shouldn't
bother to merge them.
<rdar://problem/10564621>


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147899 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
fb54ad19e7ef1b4f7177a005332ca8aca9bdbcb1 06-Jan-2012 Eli Friedman <eli.friedman@gmail.com> PR11705, part 2: globalopt shouldn't put inttoptr/ptrtoint operations into global initializers if there's an implied extension or truncation.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147625 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
720ac9196997e856c5fed7a23fdfe144425222b1 05-Jan-2012 Nick Lewycky <nicholas@mxc.ca> SCCCaptured is trivially false on entry to this loop and not modified inside it.
Eliminate the dead test for it on each loop iteration. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147616 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
b48a18903a5769f0ecb295db069252576b1388b0 29-Dec-2011 Nick Lewycky <nicholas@mxc.ca> Change CaptureTracking to pass a Use* instead of a Value* when a value is
captured. This allows the tracker to look at the specific use, which may be
especially interesting for function calls.

Use this to fix 'nocapture' deduction in FunctionAttrs. The existing one does
not iterate until a fixpoint and does not guarantee that it produces the same
result regardless of iteration order. The new implementation builds up a graph
of how arguments are passed from function to function, and uses a bottom-up walk
on the argument-SCCs to assign nocapture. This gets us nocapture more often, and
does so rather efficiently and independent of iteration order.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147327 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
a1e6e241a813f81be2d2f36ab60c950ca297574b 16-Dec-2011 Logan Chien <loganchien@google.com> Merge with LLVM upstream r146714 (Dec 16th 2011)

Change-Id: Ied458adb08bf9a69250cbcee9b14b44d17e8701a
4ab406d7fc06b1272d02cd8be46f0c5ebe51a3da 12-Dec-2011 Daniel Dunbar <daniel@zuster.org> LLVMBuild: Remove trailing newline, which irked me.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@146409 91177308-0d34-0410-b5e6-96231b3b80d8
LVMBuild.txt
0ea3a0c2361e508f07c6c88465799814627ab6cc 07-Dec-2011 Duncan Sands <baldrick@free.fr> Remove unused include.


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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145661 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
00737bdb488cc7157ca5f7a40d6cd8467ad09a79 01-Dec-2011 Chad Rosier <mcrosier@apple.com> Last bit of TargetLibraryInfo propagation. Also fixed a case for TargetData
where it appeared beneficial to pass.
More of rdar://10500969

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145630 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
af65a8c54b66e9a78e2c7a9a810a33a73fb7f63a 30-Nov-2011 Kostya Serebryany <kcc@google.com> make asan work at -O0, llvm part. Patch by glider@google.com

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145530 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
d782bae970e888572f0458ac05369bbd7752f05a 29-Nov-2011 Daniel Dunbar <daniel@zuster.org> build/CMake: Finish removal of add_llvm_library_dependencies.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@145420 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
1429059dc0129c1cec938c29d6fce89e14293241 25-Nov-2011 Logan Chien <loganchien@google.com> Merge with LLVM upstream r145126 (Nov 25th 2011)

Change-Id: I30d08ae004a4c3c74092ad2537ab30cce4280e1d
a7b0cb759433c715065440ee2a963a04db7f2b0b 15-Nov-2011 Benjamin Kramer <benny.kra@googlemail.com> Remove all remaining uses of Value::getNameStr().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144648 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
f9c1b92c27bf4ac40a52e0f1ef6d006d7e74bed3 15-Nov-2011 Logan Chien <loganchien@google.com> Merge with LLVM upstream r144606 (Nov 15th 2011)

Conflicts:
Makefile.rules
configure
docs/ReleaseNotes.html
lib/Analysis/ScalarEvolution.cpp
lib/CodeGen/AsmPrinter/DwarfCompileUnit.cpp
lib/CodeGen/ExecutionDepsFix.cpp
lib/CodeGen/MachineBlockPlacement.cpp
lib/CodeGen/MachineBranchProbabilityInfo.cpp
lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
lib/ExecutionEngine/JIT/LLVMBuild.txt
lib/MC/LLVMBuild.txt
lib/MC/MCDisassembler/LLVMBuild.txt
lib/MC/MCDwarf.cpp
lib/Object/LLVMBuild.txt
lib/Target/ARM/ARMExpandPseudoInsts.cpp
lib/Target/ARM/ARMFastISel.cpp
lib/Target/ARM/ARMInstrInfo.td
lib/Target/ARM/AsmParser/ARMAsmParser.cpp
lib/Target/ARM/Disassembler/ARMDisassembler.cpp
lib/Target/ARM/Disassembler/LLVMBuild.txt
lib/Target/ARM/TargetInfo/LLVMBuild.txt
lib/Target/CBackend/TargetInfo/LLVMBuild.txt
lib/Target/CellSPU/MCTargetDesc/LLVMBuild.txt
lib/Target/CellSPU/TargetInfo/LLVMBuild.txt
lib/Target/CppBackend/TargetInfo/LLVMBuild.txt
lib/Target/LLVMBuild.txt
lib/Target/MBlaze/Disassembler/LLVMBuild.txt
lib/Target/MBlaze/TargetInfo/LLVMBuild.txt
lib/Target/MSP430/MCTargetDesc/LLVMBuild.txt
lib/Target/MSP430/TargetInfo/LLVMBuild.txt
lib/Target/Mips/CMakeLists.txt
lib/Target/Mips/InstPrinter/MipsInstPrinter.cpp
lib/Target/Mips/Mips64InstrInfo.td
lib/Target/Mips/MipsAsmPrinter.cpp
lib/Target/Mips/MipsISelLowering.cpp
lib/Target/Mips/MipsMCInstLower.cpp
lib/Target/Mips/TargetInfo/LLVMBuild.txt
lib/Target/PTX/LLVMBuild.txt
lib/Target/PTX/PTXAsmPrinter.cpp
lib/Target/PTX/TargetInfo/LLVMBuild.txt
lib/Target/PowerPC/TargetInfo/LLVMBuild.txt
lib/Target/Sparc/TargetInfo/LLVMBuild.txt
lib/Target/X86/TargetInfo/LLVMBuild.txt
lib/Target/X86/X86ISelLowering.cpp
lib/Target/X86/X86InstrSSE.td
lib/Target/XCore/MCTargetDesc/LLVMBuild.txt
lib/Target/XCore/TargetInfo/LLVMBuild.txt
lib/Transforms/IPO/LLVMBuild.txt
lib/Transforms/Utils/LLVMBuild.txt
test/CodeGen/ARM/2011-10-26-memset-with-neon.ll
test/CodeGen/ARM/2011-11-07-PromoteVectorLoadStore.ll
test/CodeGen/ARM/fast-isel-cmp-imm.ll
test/CodeGen/ARM/fast-isel-ldrh-strh-arm.ll
test/CodeGen/CellSPU/call_indirect.ll
test/CodeGen/X86/avx2-logic.ll
test/CodeGen/X86/block-placement.ll
test/CodeGen/X86/sse-domains.ll
test/CodeGen/X86/sse3.ll
test/CodeGen/X86/vec_shuffle-39.ll
test/MC/ARM/neon-vld-encoding.s
test/MC/ARM/neon-vst-encoding.s
tools/llvm-config-2/llvm-config.cpp
utils/TableGen/LLVMBuild.txt

Change-Id: I70f454db6fc79d7799f56d0f6f2eb7b99561c504
00ade8bab0045bde35b13d2489021b8642aeb0cc 03-Nov-2011 Daniel Dunbar <daniel@zuster.org> build: Add initial cut at LLVMBuild.txt files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143634 91177308-0d34-0410-b5e6-96231b3b80d8
LVMBuild.txt
772c20516464423e3dce74fc8b74d350ddfa619b 20-Oct-2011 Eli Friedman <eli.friedman@gmail.com> Refactor code from inlining and globalopt that checks whether a function definition is unused, and enhance it so it can tell that functions which are only used by a blockaddress are in fact dead. This probably doesn't happen much on most code, but the Linux kernel's _THIS_IP_ can trigger this issue with blockaddress. (GlobalDCE can also handle the given tescase, but we only run that at -O3.) Found while looking at PR11180.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142572 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
nliner.cpp
b8ebca83f4dff04ba21cc97673003f0bd35a2e49 12-Nov-2011 Daniel Dunbar <daniel@zuster.org> build: Attempt to rectify inconsistencies between CMake and LLVMBuild versions of explicit dependencies.
- The hope is that we have a tool/test to verify these are accurate (and tight) soon.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144444 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
8396893fa54d35c59f7538ea9589d496a6275903 11-Nov-2011 Daniel Dunbar <daniel@zuster.org> LLVMBuild: Alphabetize required_libraries lists.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@144416 91177308-0d34-0410-b5e6-96231b3b80d8
LVMBuild.txt
a3a2dfd4a2a8265a9a0c962cb776e2e6ba123956 03-Nov-2011 Daniel Dunbar <daniel@zuster.org> build: Add initial cut at LLVMBuild.txt files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@143634 91177308-0d34-0410-b5e6-96231b3b80d8
LVMBuild.txt
2e5a5ee613fae456a8ed4282acede56860682f4f 21-Oct-2011 Logan Chien <loganchien@google.com> Apply changes to migrate to upstream Oct 20th 2011.

Change-Id: I2bb819151f3fa5ce18690ef373bf071205d3f278
ndroid.mk
c66330504c3f433430a28cd7f7f981e555c51bce 20-Oct-2011 Eli Friedman <eli.friedman@gmail.com> Refactor code from inlining and globalopt that checks whether a function definition is unused, and enhance it so it can tell that functions which are only used by a blockaddress are in fact dead. This probably doesn't happen much on most code, but the Linux kernel's _THIS_IP_ can trigger this issue with blockaddress. (GlobalDCE can also handle the given tescase, but we only run that at -O3.) Found while looking at PR11180.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@142572 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
nliner.cpp
0ebc07a576037e4e36f68bf5cece32740ca120c0 19-Oct-2011 Logan Chien <loganchien@google.com> Merge with LLVM upstream 2011/10/20 (r142530)

Conflicts:
lib/Support/Unix/Host.inc

Change-Id: Idc00db3b63912dca6348bddd9f8a1af2a8d5d147
b2ab2fa524f3f90376639037bd81924483cca0af 01-Oct-2011 Andrew Trick <atrick@apple.com> Inlining and unrolling heuristics should be aware of free truncs.

We want heuristics to be based on accurate data, but more importantly
we don't want llvm to behave randomly. A benign trunc inserted by an
upstream pass should not cause a wild swings in optimization
level. See PR11034. It's a general problem with threshold-based
heuristics, but we can make it less bad.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140919 91177308-0d34-0410-b5e6-96231b3b80d8
nlineAlways.cpp
nlineSimple.cpp
5c655413cf9466c29e38204ab3f19b33fffd7996 01-Oct-2011 Andrew Trick <atrick@apple.com> whitespace


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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140634 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
b7e807f9a9a74d743547856c4275a320f7b5b15e 21-Sep-2011 Bill Wendling <isanbard@gmail.com> Place the check for an exit landing pad where it will be run on both code paths through the if-then-else.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140195 91177308-0d34-0410-b5e6-96231b3b80d8
oopExtractor.cpp
84b6706d9003f6078a81ed7d84f4e49ee70f7ef8 21-Sep-2011 Bill Wendling <isanbard@gmail.com> Omit extracting a loop if one of the exits is a landing pad.

The landing pad must accompany the invoke when it's extracted. However, if it
does, then the loop isn't properly extracted. I.e., the resulting extraction has
a loop in it. The extracted function is then extracted, etc. resulting in an
infinite loop.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140193 91177308-0d34-0410-b5e6-96231b3b80d8
oopExtractor.cpp
8c93d5b602377e9860c32a1367fc697d9684e3ee 20-Sep-2011 Bill Wendling <isanbard@gmail.com> Check the terminator, not the basic block.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140176 91177308-0d34-0410-b5e6-96231b3b80d8
oopExtractor.cpp
2f1cd85598d260e5567804460e87f8bee0c5e1e5 20-Sep-2011 Bill Wendling <isanbard@gmail.com> When extracting a basic block that ends in an 'invoke' instruction, we need to
extract its associated landing pad block as well. However, that landing pad
block may have more than one predecessor. So split the landing pad block so that
individual landing pads have only one predecessor.

This type of transformation may produce a false positive with bugpoint.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140173 91177308-0d34-0410-b5e6-96231b3b80d8
oopExtractor.cpp
613d13beb03bb56a17e6b3262c5e8e539a7e9db8 19-Aug-2011 Benjamin Kramer <benny.kra@googlemail.com> C API functions must be able to see their extern "C" definitions, or it will be impossible to call them from C.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@138022 91177308-0d34-0410-b5e6-96231b3b80d8
PO.cpp
7a817eae6cb00a2ba5ec2a4127775b839a357e4c 16-Aug-2011 David Chisnall <csdavec@swan.ac.uk> Add a mechanism for optimisation plugins to register passes that all front ends can use without needing to be aware of the plugin (or the plugin be aware of the front end).

Before 3.0, I'd like to add a mechanism for automatically loading a set of plugins from a config file. API suggestions welcome...



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137717 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
2199dfb0e6b98fdce0a3c863eb84d466d426b968 16-Aug-2011 Eli Friedman <eli.friedman@gmail.com> Revert a bit of r137667; the logic in question can safely handle atomic load/store.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137702 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
33cb445fb68589d59172e02253367cfae700d4b1 16-Aug-2011 Eli Friedman <eli.friedman@gmail.com> Minor comment fixes.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137693 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
3d30b435e2b3d0e7480019577f48472b51133c21 16-Aug-2011 Eli Friedman <eli.friedman@gmail.com> Update inter-procedural optimizations for atomic load/store.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137667 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
unctionAttrs.cpp
lobalOpt.cpp
ergeFunctions.cpp
bc4fcbbc7b61e21f154ec3a4687178ec20a5f09b 15-Aug-2011 Bill Wendling <isanbard@gmail.com> Mark the SCC as "might unwind" if we run into a 'resume' instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137627 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
3ebb64946bc8e7c8feba1b2044e7a47f80b3a83f 12-Aug-2011 Chris Lattner <sabre@nondot.org> switch to use the new api for structtypes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137480 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
69cb216009387694122c78438a9117f31a2f9ad5 10-Aug-2011 Rafael Espindola <rafael.espindola@gmail.com> Add a C interface to PassManagerBuilder. It is missing the addExtension
functionality since in the C api a pass is created and added to a pass
manager in a single call.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@137159 91177308-0d34-0410-b5e6-96231b3b80d8
assManagerBuilder.cpp
2626dba9c5515d2e534c117bb16ceb03dd4d0930 04-Aug-2011 Bill Wendling <isanbard@gmail.com> Remove the LowerSetJmp pass. It wasn't used effectively by any of the targets.
This is some of my original LLVM code. *wipes tear*


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136821 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
PO.cpp
owerSetJmp.cpp
c684e83e4554bfaf6180426f86b9253b65dd46ec 02-Aug-2011 Rafael Espindola <rafael.espindola@gmail.com> Move methods in PassManagerBuilder offline.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136727 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
assManagerBuilder.cpp
dccc03b2423fe65efb5963ae816b99c24fc53374 31-Jul-2011 Bill Wendling <isanbard@gmail.com> Add the 'resume' instruction for the new EH rewrite.

This adds the 'resume' instruction class, IR parsing, and bitcode reading and
writing. The 'resume' instruction resumes propagation of an existing (in-flight)
exception whose unwinding was interrupted with a 'landingpad' instruction (to be
added later).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136589 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
10c6d12a9fd4dab411091f64db4db69670b88850 30-Jul-2011 Bill Wendling <isanbard@gmail.com> Revert r136253, r136263, r136269, r136313, r136325, r136326, r136329, r136338,
r136339, r136341, r136369, r136387, r136392, r136396, r136429, r136430, r136444,
r136445, r136446, r136253 pending review.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136556 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
55ba816883842e793cdeb32fcb805c4e011b527f 29-Jul-2011 Eli Friedman <eli.friedman@gmail.com> Misc optimizer+codegen work for 'cmpxchg' and 'atomicrmw'. They appear to be
working on x86 (at least for trivial testcases); other architectures will
need more work so that they actually emit the appropriate instructions for
orderings stricter than 'monotonic'. (As far as I can tell, the ARM, PPC,
Mips, and Alpha backends need such changes.)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136457 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
ac03e736c77bcf7e8deb515fc16a7e55d343dc8d 29-Jul-2011 Chandler Carruth <chandlerc@gmail.com> Rewrite the CMake build to use explicit dependencies between libraries,
specified in the same file that the library itself is created. This is
more idiomatic for CMake builds, and also allows us to correctly specify
dependencies that are missed due to bugs in the GenLibDeps perl script,
or change from compiler to compiler. On Linux, this returns CMake to
a place where it can relably rebuild several targets of LLVM.

I have tried not to change the dependencies from the ones in the current
auto-generated file. The only places I've really diverged are in places
where I was seeing link failures, and added a dependency. The goal of
this patch is not to start changing the dependencies, merely to move
them into the correct location, and an explicit form that we can control
and change when necessary.

This also removes a serialization point in the build because we don't
have to scan all the libraries before we begin building various tools.
We no longer have a step of the build that regenerates a file inside the
source tree. A few other associated cleanups fall out of this.

This isn't really finished yet though. After talking to dgregor he urged
switching to a single CMake macro to construct libraries with both
sources and dependencies in the arguments. Migrating from the two macros
to that style will be a follow-up patch.

Also, llvm-config is still generated with GenLibDeps.pl, which means it
still has slightly buggy dependencies. The internal CMake
'llvm-config-like' macro uses the correct explicitly specified
dependencies however. A future patch will switch llvm-config generation
(when using CMake) to be based on these deps as well.

This may well break Windows. I'm getting a machine set up now to dig
into any failures there. If anyone can chime in with problems they see
or ideas of how to solve them for Windows, much appreciated.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136433 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
772fe17a6d07304ae2e6b3052bbb24ebb751f0f3 27-Jul-2011 Bill Wendling <isanbard@gmail.com> Merge the contents from exception-handling-rewrite to the mainline.

This adds the new instructions 'landingpad' and 'resume'.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136253 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
e511186183d49fb9c4ebefe746ca65e5d9275ff4 27-Jul-2011 Nick Lewycky <nicholas@mxc.ca> Teach the ConstantMerge pass about alignment. Fixes PR10514!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136250 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
3d72290ecb30002d4372b6afbeda73812221ac3e 26-Jul-2011 Rafael Espindola <rafael.espindola@gmail.com> Add LLVMAddAlwaysInlinerPass to the C API.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136083 91177308-0d34-0410-b5e6-96231b3b80d8
PO.cpp
a03084d86e937968ca8cf6888f3b298069d7ccac 26-Jul-2011 Rafael Espindola <rafael.espindola@gmail.com> LLVM 3.0 is here, remove old do nothing method.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136082 91177308-0d34-0410-b5e6-96231b3b80d8
PO.cpp
a9203109f4ac95aa7e9624f2838e3d89623ec902 25-Jul-2011 Jay Foad <jay.foad@gmail.com> Convert GetElementPtrInst to use ArrayRef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135904 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
lobalOpt.cpp
b4263a6ff4f9696fc84a8f75b5d09564ff06381f 22-Jul-2011 Jay Foad <jay.foad@gmail.com> Fix more MSVC warnings caused by a cases I missed when converting
ConstantExpr::getGetElementPtr to use ArrayRef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135762 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
4b5e207bf24ea9799547a0634acaf7398b32897c 21-Jul-2011 Jay Foad <jay.foad@gmail.com> Make better use of ConstantExpr::getGetElementPtr's InBounds parameter.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135676 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
dab3d29605a5c83db41b28176273ef55961120c1 21-Jul-2011 Jay Foad <jay.foad@gmail.com> Convert ConstantExpr::getGetElementPtr and
ConstantExpr::getInBoundsGetElementPtr to use ArrayRef.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135673 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
c30a38f34bdfecb99ce49e3ffa479039c9bf0209 21-Jul-2011 Chris Lattner <sabre@nondot.org> move tier out of an anonymous namespace, it doesn't make sense
to for it to be an an anon namespace and be in a header.

Eliminate some extraenous uses of tie.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135669 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
ebf5f0962932032481ae306b42c96c68c3a0be95 20-Jul-2011 Logan Chien <loganchien@google.com> Merge with LLVM upstream r135568 (Jul 20th 2011)

Conflicts:
lib/Bitcode/Reader/BitcodeReader.cpp

Change-Id: Iebed76d2f7d281e742947e31d9a0b78174daf2d6
8fbbb3980755d74539a0aed02bc18842ed2bd18d 19-Jul-2011 Jay Foad <jay.foad@gmail.com> Convert TargetData::getIndexedOffset to use ArrayRef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135478 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
1d2f569c3428d70d0cf690c9adb459ad4a3ecff2 19-Jul-2011 Jay Foad <jay.foad@gmail.com> Use ArrayRef in ConstantFoldInstOperands and ConstantFoldCall.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135477 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
db125cfaf57cc83e7dd7453de2d509bc8efd0e5e 18-Jul-2011 Chris Lattner <sabre@nondot.org> land David Blaikie's patch to de-constify Type, with a few tweaks.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135375 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
lobalOpt.cpp
PConstantPropagation.cpp
nliner.cpp
owerSetJmp.cpp
ergeFunctions.cpp
72fdeda08aedc76f6d04c484d83058e96c8af3a9 16-Jul-2011 Nowar Gu <nowar100@gmail.com> Fix Android.mk.
ndroid.mk
a71642b2a4944eaa269d881cf71b02b8e8fe5638 16-Jul-2011 Nowar Gu <nowar100@gmail.com> Merge upstream to r135343 at Sat. 16th July 2011.
a3efbb15ddd5aa9006564cd79086723640084878 15-Jul-2011 Jay Foad <jay.foad@gmail.com> Convert CallInst and InvokeInst APIs to use ArrayRef.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@135265 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
owerSetJmp.cpp
ergeFunctions.cpp
runeEH.cpp
5fdd6c8793462549e3593890ec61573da06e3346 12-Jul-2011 Jay Foad <jay.foad@gmail.com> Second attempt at de-constifying LLVM Types in FunctionType::get(),
StructType::get() and TargetData::getIntPtrType().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134982 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
2280ebd61416b73d0b6137f275b25af82e268d1f 12-Jul-2011 Bill Wendling <isanbard@gmail.com> Revert r134893 and r134888 (and related patches in other trees). It was causing
an assert on Darwin llvm-gcc builds.

Assertion failed: (castIsValid(op, S, Ty) && "Invalid cast!"), function Create, file /Users/buildslave/zorg/buildbot/smooshlab/slave-0.8/build.llvm-gcc-i386-darwin9-RA/llvm.src/lib/VMCore/Instructions.cpp, li\
ne 2067.
etc.

http://smooshlab.apple.com:8013/builders/llvm-gcc-i386-darwin9-RA/builds/2354

--- Reverse-merging r134893 into '.':
U include/llvm/Target/TargetData.h
U include/llvm/DerivedTypes.h
U tools/bugpoint/ExtractFunction.cpp
U unittests/Support/TypeBuilderTest.cpp
U lib/Target/ARM/ARMGlobalMerge.cpp
U lib/Target/TargetData.cpp
U lib/VMCore/Constants.cpp
U lib/VMCore/Type.cpp
U lib/VMCore/Core.cpp
U lib/Transforms/Utils/CodeExtractor.cpp
U lib/Transforms/Instrumentation/ProfilingUtils.cpp
U lib/Transforms/IPO/DeadArgumentElimination.cpp
U lib/CodeGen/SjLjEHPrepare.cpp
--- Reverse-merging r134888 into '.':
G include/llvm/DerivedTypes.h
U include/llvm/Support/TypeBuilder.h
U include/llvm/Intrinsics.h
U unittests/Analysis/ScalarEvolutionTest.cpp
U unittests/ExecutionEngine/JIT/JITTest.cpp
U unittests/ExecutionEngine/JIT/JITMemoryManagerTest.cpp
U unittests/VMCore/PassManagerTest.cpp
G unittests/Support/TypeBuilderTest.cpp
U lib/Target/MBlaze/MBlazeIntrinsicInfo.cpp
U lib/Target/Blackfin/BlackfinIntrinsicInfo.cpp
U lib/VMCore/IRBuilder.cpp
G lib/VMCore/Type.cpp
U lib/VMCore/Function.cpp
G lib/VMCore/Core.cpp
U lib/VMCore/Module.cpp
U lib/AsmParser/LLParser.cpp
U lib/Transforms/Utils/CloneFunction.cpp
G lib/Transforms/Utils/CodeExtractor.cpp
U lib/Transforms/Utils/InlineFunction.cpp
U lib/Transforms/Instrumentation/GCOVProfiling.cpp
U lib/Transforms/Scalar/ObjCARC.cpp
U lib/Transforms/Scalar/SimplifyLibCalls.cpp
U lib/Transforms/Scalar/MemCpyOptimizer.cpp
G lib/Transforms/IPO/DeadArgumentElimination.cpp
U lib/Transforms/IPO/ArgumentPromotion.cpp
U lib/Transforms/InstCombine/InstCombineCompares.cpp
U lib/Transforms/InstCombine/InstCombineAndOrXor.cpp
U lib/Transforms/InstCombine/InstCombineCalls.cpp
U lib/CodeGen/DwarfEHPrepare.cpp
U lib/CodeGen/IntrinsicLowering.cpp
U lib/Bitcode/Reader/BitcodeReader.cpp



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134949 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
eeb64ae6e52ac2a7980884fe89c01508014af6a9 11-Jul-2011 Jay Foad <jay.foad@gmail.com> De-constify Types in StructType::get() and TargetData::getIntPtrType().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134893 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
f362affa3a695164a94d275fb44d18f44ebb855a 11-Jul-2011 Jay Foad <jay.foad@gmail.com> De-constify Types in FunctionType::get().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134888 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
aca50a94b8d4863adf07eec980b83599c541ed99 09-Jul-2011 Chris Lattner <sabre@nondot.org> remove the DerivedType which isn't adding value anymore.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134832 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
1afcace3a3a138b1b18e5c6270caa8dae2261ae2 09-Jul-2011 Chris Lattner <sabre@nondot.org> Land the long talked about "type system rewrite" patch. This
patch brings numerous advantages to LLVM. One way to look at it
is through diffstat:
109 files changed, 3005 insertions(+), 5906 deletions(-)

Removing almost 3K lines of code is a good thing. Other advantages
include:

1. Value::getType() is a simple load that can be CSE'd, not a mutating
union-find operation.
2. Types a uniqued and never move once created, defining away PATypeHolder.
3. Structs can be "named" now, and their name is part of the identity that
uniques them. This means that the compiler doesn't merge them structurally
which makes the IR much less confusing.
4. Now that there is no way to get a cycle in a type graph without a named
struct type, "upreferences" go away.
5. Type refinement is completely gone, which should make LTO much MUCH faster
in some common cases with C++ code.
6. Types are now generally immutable, so we can use "Type *" instead
"const Type *" everywhere.

Downsides of this patch are that it removes some functions from the C API,
so people using those will have to upgrade to (not yet added) new API.
"LLVM 3.0" is the right time to do this.

There are still some cleanups pending after this, this patch is large enough
as-is.




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@134829 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
eadTypeElimination.cpp
PO.cpp
ergeFunctions.cpp
tripSymbols.cpp
bb5c18c80e7ae4ce49eb9067b664f0559ec50965 23-Jun-2011 Nowar Gu <nowar100@gmail.com> Merge upstream to r133679 at Thu. 23th Jun 2011.
2a73c7f188f16049faa9282c9bd1217f878bd5d2 17-Jun-2011 Nowar Gu <nowar100@gmail.com> Fix source list of Android.mk.
ndroid.mk
907af0f20f58f2ea26da7ea64e1f094cd6880db7 17-Jun-2011 Nowar Gu <nowar100@gmail.com> Merge upstream to r133240 at Fri. 17th Jun 2011.

Conflicts:
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
lib/Target/ARM/ARMCodeEmitter.cpp
b065b06c12dba6001b8140df2744d0c856ef6ea1 20-Jun-2011 Chris Lattner <sabre@nondot.org> Revamp the "ConstantStruct::get" methods. Previously, these were scattered
all over the place in different styles and variants. Standardize on two
preferred entrypoints: one that takes a StructType and ArrayRef, and one that
takes StructType and varargs.

In cases where there isn't a struct type convenient, we now add a
ConstantStruct::getAnon method (whose name will make more sense after a few
more patches land).

It would be "really really nice" if the ConstantStruct::get and
ConstantVector::get methods didn't make temporary std::vectors.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133412 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
ca5bec22e0e04d0712f5ac78fc6aeceabcf80955 09-Jun-2011 John McCall <rjmccall@apple.com> When deleting a basic block, remove call edges only for non-intrinsics.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132803 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
d896d418510d16f47f8236f1956c3784e1520017 09-Jun-2011 Rafael Espindola <rafael.espindola@gmail.com> Improve the handling of available_externally and llvm.global_ctors.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132775 91177308-0d34-0410-b5e6-96231b3b80d8
xtractGV.cpp
bcb85087a7f281dcc85b04f82be3a79ff9387fc5 29-May-2011 Nick Lewycky <nicholas@mxc.ca> Don't crash owhen ComputeLoadResult can't compute the result of the load.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132290 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
1f237b00279ada1ccce35ab924a7f797d9dea25d 29-May-2011 Nick Lewycky <nicholas@mxc.ca> Obey the isVolatile bit on memory intrinsics when analyzing uses of a global
variable. Noticed by inspection.

Simulate memset in EvaluateFunction where the target of the memset and the
value we're setting are both the null value. Fixes PR10047!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@132288 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
98a42b2fc39f3fc46905fb98078cce4ce4e0a827 22-May-2011 Chris Lattner <sabre@nondot.org> fix PR9856, an incorrectly conservative assertion: a global can be
"stored once" even if its address is compared.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131849 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
eea6c95d5d9f202ccb4e90995dc8a4a4c439cec3 13-May-2011 Julien Lerouge <jlerouge@apple.com> Fix a source of non determinism in FindUsedTypes, use a SetVector instead of a
set.

rdar://9423996


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131283 91177308-0d34-0410-b5e6-96231b3b80d8
eadTypeElimination.cpp
65a2f77b0e155f7f1b0a31b0bc9f683b441bc8e2 10-May-2011 Devang Patel <dpatel@apple.com> Preserve line number information.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131112 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
ddcdcc88631c6bd4ad43d9198b98bc9a829be036 23-Apr-2011 Jay Foad <jay.foad@gmail.com> Remove unused STL header includes.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130068 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
runeEH.cpp
7a2bdde0a0eebcd2125055e0eacaca040f0b766c 15-Apr-2011 Chris Lattner <sabre@nondot.org> Fix a ton of comment typos found by codespell. Patch by
Luis Felipe Strano Moraes!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129558 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
b5f18f5df00e861b68a06d7d6da0664b3e0ba3d8 12-Apr-2011 Chris Lattner <sabre@nondot.org> remove the StructRetPromotion pass. It is unused, not maintained and
has some bugs. If this is interesting functionality, it should be
reimplemented in the argpromotion pass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129314 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
PO.cpp
tructRetPromotion.cpp
5ea5c61589e62a1068746ddcc52c6aa39ec0f8b0 12-Apr-2011 Nick Lewycky <nicholas@mxc.ca> Just because a GlobalVariable's initializer is [N x { i32, void ()* }] doesn't
mean that it has to be ConstantArray of ConstantStruct. We might have
ConstantAggregateZero, at either level, so don't crash on that.

Also, semi-deprecate the sentinal value. The linker isn't aware of sentinals so
we end up with the two lists appended, each with their "sentinals" on them.
Different parts of LLVM treated sentinals differently, so make them all just
ignore the single entry and continue on with the rest of the list.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129307 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.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
lobalOpt.cpp
ergeFunctions.cpp
18a2e50a9bfe4ecde57dc3913a7bd98b954ec81a 09-Apr-2011 Eli Friedman <eli.friedman@gmail.com> Add back a couple checks removed by r129128; the fact that an intitializer
is an array of structures doesn't imply it's a ConstantArray of
ConstantStruct.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129207 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
8feda7ee332f1f91e4d3a42d9f7ad729012ed174 09-Apr-2011 Jush Lu <jush.msn@gmail.com> Merge upstream r129128
2c44a80d991df258a45e2f5fa76d5ada9e99015c 08-Apr-2011 Nick Lewycky <nicholas@mxc.ca> llvm.global_[cd]tor is defined to be either external, or appending with an array
of { i32, void ()* }. Teach the verifier to verify that, deleting copies of
checks strewn about.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129128 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
3e2f74e6d6dbc07563ba8ee9ffd2a230514929fb 04-Apr-2011 Jay Foad <jay.foad@gmail.com> Remove some support for ReturnInsts with multiple operands, and for
returning a scalar value in a function whose return type is a single-
element structure or array.


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

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

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128535 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
owerSetJmp.cpp
artialInlining.cpp
628b337561cfb8ae862155fee710b5ca172b7a8e 25-Mar-2011 Nick Lewycky <nicholas@mxc.ca> No functionality change, just adjust some whitespace for coding style compliance.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128257 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
807bc2a3814bb45b38702785ad9978153d176698 22-Mar-2011 Anders Carlsson <andersca@mac.com> Handle another case that Frits suggested.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@128068 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
b12caf31f43eefc399eb2584225924d22cfd5b28 21-Mar-2011 Anders Carlsson <andersca@mac.com> More cleanups to the OptimizeEmptyGlobalCXXDtors GlobalOpt function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127997 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
262a8627870c38f385944fc2ed9ae365347adf47 21-Mar-2011 Anders Carlsson <andersca@mac.com> As suggested by Nick Lewycky, ignore debugging intrinsics when trying to decide whether a destructor is empty or not.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127985 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
35ee1c921c55ced16748b90c486c9feeb433c74b 21-Mar-2011 Nick Lewycky <nicholas@mxc.ca> Fix comments


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127984 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
4f735ca1855bb66974f3b1c4ee493534d5037eda 20-Mar-2011 Anders Carlsson <andersca@mac.com> Don't try to eliminate invokes to __cxa_atexit.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127976 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
372ec6aa915534f3b11c252dbc9e6c63814bcab3 20-Mar-2011 Anders Carlsson <andersca@mac.com> Don't segfault on mutual recursion, as pointed out by Frits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127975 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
1f7c7ba380cf411fd02a070822c439fadac91ce6 20-Mar-2011 Anders Carlsson <andersca@mac.com> Address comments from Frits van Bommel.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127974 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
a201c4c2e604a519665ca55dc49e913628444ddb 20-Mar-2011 Anders Carlsson <andersca@mac.com> Add an optimization to GlobalOpt that eliminates calls to __cxa_atexit, if the function passed is empty.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127970 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
0ef1560f27a377d2b83c8b3a4c75e3e0d7b60927 09-Mar-2011 Devang Patel <dpatel@apple.com> These llvm.dbg.* constants are not used anymore.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127352 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
cc7665f5895e1dd9682ee21d1e755d0de28c161b 09-Mar-2011 Jush Lu <jush.msn@gmail.com> Update build scripts after merge r127116
ndroid.mk
b5530586d68bd25831a6796b5d3199cb0769a35c 09-Mar-2011 Jush Lu <jush.msn@gmail.com> Merge upstream r127116
1b5ec068f5f068e4b8e600007e2fa126fafe796f 07-Mar-2011 Rafael Espindola <rafael.espindola@gmail.com> Don't internalize available_externally functions. We already did the right
thing for variables.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@127138 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
f291ab2fbaa5ed1cfa20ca47e8dece1040a5065b 01-Mar-2011 Eli Friedman <eli.friedman@gmail.com> Add an obvious missing safety check to DAE::RemoveDeadArgumentsFromCallers.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126720 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
4d03e416be8cf1f0f502118826b7cbaeec0b79b2 28-Feb-2011 jush <jush.msn@gmail.com> Merge LLVM upstream r119309 into honey
eafe863b6dc35f9ba5360685f300d16d0a5e0c3c 20-Feb-2011 Nick Lewycky <nicholas@mxc.ca> Instead of keeping two Value*->id# mappings, keep one Value->Value mapping and
one Value set. This is faster because we only need to use the set when there
isn't already an entry in the map. No functionality change!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@126076 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
2ca5c8644e6c35b3a7910a576ed89cddb7b82c3b 15-Feb-2011 Chris Lattner <sabre@nondot.org> convert ConstantVector::get to use ArrayRef.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125537 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
75831904220042260c4faece8507a2807acba47f 14-Feb-2011 Chris Lattner <sabre@nondot.org> revert my ConstantVector patch, it seems to have made the llvm-gcc
builders unhappy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125504 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
283c8caccd093f8e1d4f0bdd01ac240b4edbd20a 14-Feb-2011 Chris Lattner <sabre@nondot.org> Switch ConstantVector::get to use ArrayRef instead of a pointer+size
idiom. Change various clients to simplify their code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125487 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
3ba974a1c535563bff9a160996ad015a2a56cc05 09-Feb-2011 Nick Lewycky <nicholas@mxc.ca> When removing a function from the function set and adding it to deferred, we
could end up removing a different function than we intended because it was
functionally equivalent, then end up with a comparison of a function against
itself in the next round of comparisons (the one in the function set and the
one on the deferred list). To fix this, I introduce a choice in the form of
comparison for ComparableFunctions, either normal or "pointer only" used to
find exact Function*'s in lookups.

Also add some debugging statements.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@125180 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
39c33e3b6344be1d1cc35ad9fb1b647fd8adfe65 06-Feb-2011 Nick Lewycky <nicholas@mxc.ca> Simplify away redundant test, and document what's going on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124977 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
d489332549f226701825de990a2f5869dad96ace 06-Feb-2011 Nick Lewycky <nicholas@mxc.ca> Remove specialized comparison of InlineAsm objects. They're uniqued on creation
now, and this wasn't comparing some of their relevant bits anyhow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124976 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
8eb3e54592ae7d7b43454fcd08d0da7a51ecd4d8 02-Feb-2011 Nick Lewycky <nicholas@mxc.ca> Remove wasteful caching. This isn't needed for correctness because any function
that might have changed been affected by a merge elsewhere will have been
removed from the function set, and it isn't needed for performance because we
call grow() ahead of time to prevent reallocations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124717 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
468ee0a90db9ee7367bd163fcc3cb5b867753385 28-Jan-2011 Nick Lewycky <nicholas@mxc.ca> Rename functions to follow coding standard. Also rejiggers comments. No
functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124482 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
8b5964381ecdba39ff4062085eb26832caa49238 28-Jan-2011 Nick Lewycky <nicholas@mxc.ca> Add a doxygen comment for this class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124480 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
285cf8040da6245d5dbc9ebfac8a8caf3647caf4 28-Jan-2011 Nick Lewycky <nicholas@mxc.ca> Reorder for readability. (Chris, is this what you meant?)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124479 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
07317f7d333fd03ae216865a6f0e8b3bde5f030d 28-Jan-2011 Nick Lewycky <nicholas@mxc.ca> Reduce the number of functions we look at in the first pass, and preallocate
the function equality set.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124475 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
9c1858cf4a91d0f373d2315ccf834adedd197e6e 27-Jan-2011 Benjamin Kramer <benny.kra@googlemail.com> Unbreak the build.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124426 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
c9d69489ebe12f265828c48defb0278f6bd9121f 27-Jan-2011 Nick Lewycky <nicholas@mxc.ca> Expound upon this comparison!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124406 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
dfc597297484736ac939efe4c233e7c10ce8ad29 27-Jan-2011 Nick Lewycky <nicholas@mxc.ca> Use dyn_cast instead of isa+cast.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124404 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
25296e25fd30806b4a1f2348cbf73f227962be86 27-Jan-2011 Nick Lewycky <nicholas@mxc.ca> Fix surprising missed optimization in mergefunc where we forgot to consider
that relationships like "i8* null" is equivalent to "i32* null".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124368 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
f6c63c23203ca4c4aa89efa2bff722bb479cfe3c 26-Jan-2011 Nick Lewycky <nicholas@mxc.ca> AttrListPtr has an overloaded operator== which does this for us, we should use
it. No functionality change!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124286 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
207c193e7e9cc177115101333079e952a7676689 26-Jan-2011 Nick Lewycky <nicholas@mxc.ca> Teach mergefunc that intptr_t is the same width as a pointer. We still can't
merge vector<intptr_t>::push_back() and vector<void*>::push_back() because
Enumerate() doesn't realize that "i64* null" and "i8** null" are equivalent.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124285 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
388f4918fbd8349a6c5b8403e31f65aa3408add6 26-Jan-2011 Nick Lewycky <nicholas@mxc.ca> There are no vectors of pointer or arrays, so we don't need to check vector
elements for type equivalence.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124284 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
b38824f866447ccf8dd0c76656755b05bcede1b1 25-Jan-2011 Nick Lewycky <nicholas@mxc.ca> Teach mergefunc how to emit aliases safely again -- but keep it turned it off
for now. It's controlled by the HasGlobalAliases variable which is not attached
to any flag yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@124182 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
c4440e3e307fb696146c08c127c53300a982fe82 19-Jan-2011 Rafael Espindola <rafael.espindola@gmail.com> Add unnamed_addr when we can show that address of a global is not used.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123834 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
daad56a8e3ac99c517d766130ac4ac03b578d180 18-Jan-2011 Rafael Espindola <rafael.espindola@gmail.com> Reduce indentation and remove commented out code.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123729 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
0599c6bb3c9c3817600021f31f16eb49e57ea9d8 16-Jan-2011 Anders Carlsson <andersca@mac.com> Teach DAE to look for functions whose arguments are unused, and change all callers to pass in an undefvalue instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123596 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
d6e5cbc84226ad4a62e8847f1babecf86089d415 16-Jan-2011 Rafael Espindola <rafael.espindola@gmail.com> Don't merge two constants if we care about the address of both.

This fixes the original testcase in PR8927. It also causes a clang
binary built with a patched clang to increase in size by 0.21%.

We can probably get some of the size back by writing a pass that
detects that a global never has its pointer compared and adds
unnamed_addr to it (maybe extend global opt). It is also possible that
there are some other cases clang could add unnamed_addr to.

I will investigate extending globalopt next.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123584 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
42c32daadbb1bd0626cced08c418d1b7a0b16fb4 14-Jan-2011 Logan <tzuhsiang.chien@gmail.com> Add LOCAL_MODULE_TAGS := optional

Change-Id: I292f6297b06f97360c15884677057d624e73fbf6
ndroid.mk
28252b6f0a483ffb0ead991c7a1ead14e3cd2fc1 16-Jan-2011 Chris Lattner <sabre@nondot.org> fix PR8932, a case where arg promotion could infinitely promote.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123574 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
66f708f7e5f207d7a7ab259b70b5fd94795fb74c 16-Jan-2011 Owen Anderson <resistor@mac.com> Improve the safety of my globalopt enhancement by ensuring that the bitcast
of the stored value to the new store type is always. Also, add a testcase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123563 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
d5f656f48b98b4fc4dcb131f113316ba04180f11 16-Jan-2011 Chris Lattner <sabre@nondot.org> simplify this code, it is still broken but will follow up on llvm-commits.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123558 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
0092b1142f5d35d204f35ec3cfe19d8de082400f 16-Jan-2011 Chris Lattner <sabre@nondot.org> remove the partial specialization pass. It is unmaintained and has bugs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123554 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
PO.cpp
artialSpecialization.cpp
cd7f0a1a7f216418856812f6417faf4fe5e72046 15-Jan-2011 Nick Lewycky <nicholas@mxc.ca> Add missing whitespace.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123543 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
2820c25e847c76f241388446f6f3dd86e067403b 15-Jan-2011 Nick Lewycky <nicholas@mxc.ca> Make constmerge a two-pass algorithm so that it won't miss merging
opporuntities. Fixes PR8978.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123541 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
bfa3b905822800c804ab55a7a2e7367b473d5504 15-Jan-2011 Benjamin Kramer <benny.kra@googlemail.com> Try to unbreak selfhost.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123537 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
e8f8139429ffc41ae3a339d4a32e336a74f189c0 15-Jan-2011 Nick Lewycky <nicholas@mxc.ca> Add a cache that protects mergefunc's internals from more surprises in DenseSet.

Also, replace tabs with spaces. Yes, it's 2011.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123535 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
e95a32ce40f8c189e939788a82fd54ca9280f973 14-Jan-2011 Owen Anderson <resistor@mac.com> Fix a false-positive warning.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123480 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
cff6b3772bd991119ff4882e06af29fbdb60e93f 14-Jan-2011 Owen Anderson <resistor@mac.com> Enhance GlobalOpt to be able evaluate initializers that involve stores through
bitcasts, at least in simple cases. This fixes clang's CodeGenCXX/virtual-base-dtor.cpp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@123477 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
c84e3c0c03a0dab7aea7047e7b8e38051542f7e4 04-Jan-2011 Dale Johannesen <dalej@apple.com> Improve the accuracy of the inlining heuristic looking for the
case where a static caller is itself inlined everywhere else, and
thus may go away if it doesn't get too big due to inlining other
things into it. If there are references to the caller other than
calls, it will not be removed; account for this.
This results in same-day completion of the case in PR8853.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122821 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
d081b04f99de015519357ccaef29868c38c57d87 02-Jan-2011 Nick Lewycky <nicholas@mxc.ca> Also remove functions that use complex constant expressions in terms of
another function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122705 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
abd6c754090b1ff13b0dee925989bf8676d9cb4c 02-Jan-2011 Nick Lewycky <nicholas@mxc.ca> Remove functions from the FnSet when one of their callee's is being merged. This
maintains the guarantee that the DenseSet expects two elements it contains to
not go from inequal to equal under its nose.

As a side-effect, this also lets us switch from iterating to a fixed-point to
actually maintaining a work queue of functions to look at again, and we don't
add thunks to our work queue so we don't need to detect and ignore them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122677 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
d91ed10b7028c8470c8a9b7fa61a712d04ab07d9 01-Jan-2011 Chris Lattner <sabre@nondot.org> fix a globalopt crash on two Adobe-C++ testcases that the recent
loop idiom pass exposed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122674 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
1945d58025203aec7883c11ac51b827d440f6916 07-Dec-2010 Chris Lattner <sabre@nondot.org> reapply r121100 with a tweak to constant fold ConstExprs with TargetData
(if available) as we go so that we get simple constantexprs not insane ones.
This fixes the failure of clang/test/CodeGenCXX/virtual-base-ctor.cpp
that the previous iteration of this patch had.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121111 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
6a3e3053263904fa296c86dc91778f54a8bb29c5 07-Dec-2010 Eric Christopher <echristo@apple.com> Temporarily revert r121100 as it's causing clang to fail
CodeGenCXX/virtual-base-ctor.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121102 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
fb431099c5783f5e25a0a4c789274256cde3e925 07-Dec-2010 Chris Lattner <sabre@nondot.org> fix PR8710 - teach global opt that some constantexprs are too complex to
put in a global variable's initializer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121100 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
f51a6cc5bf123d5d71bc846767b34701c4dc6014 06-Dec-2010 Chris Lattner <sabre@nondot.org> replace a linear scan with a symtab lookup, reduce indentation.
No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@121042 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
6c3ee0f3c9684e588c8852d90c891d6354175c9e 06-Dec-2010 Chris Lattner <sabre@nondot.org> Fix PR8735, a really terrible problem in the inliner's "alloca merging"
optimization.

Consider:
static void foo() {
A = alloca
...
}

static void bar() {
B = alloca
...
call foo();
}

void main() {
bar()
}

The inliner proceeds bottom up, but lets pretend it decides not to inline foo
into bar. When it gets to main, it inlines bar into main(), and says "hey, I
just inlined an alloca "B" into main, lets remember that. Then it keeps going
and finds that it now contains a call to foo. It decides to inline foo into
main, and says "hey, foo has an alloca A, and I have an alloca B from another
inlined call site, lets reuse it". The problem with this of course, is that
the lifetime of A and B are nested, not disjoint.

Unfortunately I can't create a reasonable testcase for this: the one in the
PR is both huge and extremely sensitive, because you minor tweaks end up
causing foo to get inlined into bar too early. We already have tests for the
basic alloca merging optimization and this does not break them.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120995 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
7d32b8032d7ec2472b994aab2ac3459e8d47c496 06-Dec-2010 Chris Lattner <sabre@nondot.org> improve -debug output and comments a little.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@120993 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
8d2e407e84aff7583f02af9a3a0f4d6844c0187f 11-Nov-2010 Dan Gohman <gohman@apple.com> Add helper functions for computing the Location of load, store,
and vaarg instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118845 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
unctionAttrs.cpp
6d8eb156e6be727570b300bac7712f745a318c7d 11-Nov-2010 Dan Gohman <gohman@apple.com> Add helper functions for computing the Location of load, store,
and vaarg instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118845 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
unctionAttrs.cpp
68101eff9191d7610ff708821e2a3ab8366f06b9 11-Nov-2010 Dan Gohman <gohman@apple.com> Factor out Instruction::isSafeToSpeculativelyExecute's code for
testing for dereferenceable pointers into a helper function,
isDereferenceablePointer. Teach it how to reason about GEPs
with simple non-zero indices.

Also eliminate ArgumentPromtion's IsAlwaysValidPointer,
which didn't check for weak externals or out of range gep
indices.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118840 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
4d70a2949007edeaad4662d5cdcb2d272cb2b2ff 11-Nov-2010 Dan Gohman <gohman@apple.com> Factor out Instruction::isSafeToSpeculativelyExecute's code for
testing for dereferenceable pointers into a helper function,
isDereferenceablePointer. Teach it how to reason about GEPs
with simple non-zero indices.

Also eliminate ArgumentPromtion's IsAlwaysValidPointer,
which didn't check for weak externals or out of range gep
indices.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118840 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
3ac79e213ac085a189fae7c7f3591577321307bd 11-Nov-2010 Dan Gohman <gohman@apple.com> TBAA-enable ArgumentPromotion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118804 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
56653f0df85f8e4ee60941a6ca31c17ca6f936ff 11-Nov-2010 Dan Gohman <gohman@apple.com> TBAA-enable ArgumentPromotion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118804 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
c7fefb59114cdf7a4d05ee587e5b34e0ceae1b77 10-Nov-2010 Dan Gohman <gohman@apple.com> Add a doesAccessArgPointees helper function, and update code to use
it, and to be consistent.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118692 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
68a6056dafd4913ce42606353ab1ff7208215ff2 10-Nov-2010 Dan Gohman <gohman@apple.com> Add a doesAccessArgPointees helper function, and update code to use
it, and to be consistent.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118692 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
876ee0862554ed421a5ba58f16bd2fa7ed8a0bc2 10-Nov-2010 Dan Gohman <gohman@apple.com> Factor out the code for testing whether a function accesses
arbitrary memory into a helper function, and adjust some comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118687 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
432d08cbdb9ceaa333f1d6eab4f8b542fdddf9db 10-Nov-2010 Dan Gohman <gohman@apple.com> Factor out the code for testing whether a function accesses
arbitrary memory into a helper function, and adjust some comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118687 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
bb43939e5c3fd9b50547eafd60e6e7c39db6983c 10-Nov-2010 Dan Gohman <gohman@apple.com> Make ModRefBehavior a lattice. Use this to clean up AliasAnalysis
chaining and simplify FunctionAttrs' GetModRefBehavior logic.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118660 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
42c31a70735e55bf82e66a9315c97d1821c9a798 10-Nov-2010 Dan Gohman <gohman@apple.com> Make ModRefBehavior a lattice. Use this to clean up AliasAnalysis
chaining and simplify FunctionAttrs' GetModRefBehavior logic.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118660 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
bacd5df0f8bf8d380c60237417ed9e06a513855f 09-Nov-2010 Dan Gohman <gohman@apple.com> Teach FunctionAttrs about the VAArg instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118627 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
4cf0dcfb44d9d308f2df48e2878c91297395179c 09-Nov-2010 Dan Gohman <gohman@apple.com> Teach FunctionAttrs about the VAArg instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118627 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
89d2d431018c6a19bc9359c14ab9c8fc49151799 09-Nov-2010 Dan Gohman <gohman@apple.com> Use the AliasAnalysis interface to determine how a Function accesses
memory. This isn't a real improvement with present day AliasAnalysis
implementations; it's mainly for consistency.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118624 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
6d44d64f61359c865cbf2d7f331bb9c97ce253d5 09-Nov-2010 Dan Gohman <gohman@apple.com> Use the AliasAnalysis interface to determine how a Function accesses
memory. This isn't a real improvement with present day AliasAnalysis
implementations; it's mainly for consistency.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118624 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
fae0f29df6a6a5177e0e9137baffd90f89d47077 09-Nov-2010 Dan Gohman <gohman@apple.com> Teach FunctionAttrs about AccessesArgumentsReadonly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118617 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
40b6a19daa0efa5131a56aa15cc8694d3cf6171e 09-Nov-2010 Dan Gohman <gohman@apple.com> Teach FunctionAttrs about AccessesArgumentsReadonly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118617 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
6df35b9cf56836e462899a54041f7a1ffdfd9c38 08-Nov-2010 Dan Gohman <gohman@apple.com> Fix a thinko that Duncan spotted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118430 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
554375b707d741c357a78650160ba5d093b4993a 08-Nov-2010 Dan Gohman <gohman@apple.com> Fix a thinko that Duncan spotted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118430 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
26862a84703cd49fc414a1249872d4174633140e 08-Nov-2010 Dan Gohman <gohman@apple.com> Make FunctionAttrs TBAA-aware.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118417 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
ea8900f5df76e11efb9464157af160f5fa41e9c0 08-Nov-2010 Dan Gohman <gohman@apple.com> Make FunctionAttrs TBAA-aware.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118417 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
a14b31ab8d5ca36fdd0cb4569b728c37e97478e7 08-Nov-2010 Dan Gohman <gohman@apple.com> Extend the AliasAnalysis::pointsToConstantMemory interface to allow it
to optionally look for constant or local (alloca) memory.

Teach BasicAliasAnalysis::pointsToConstantMemory to look through Select
and Phi nodes, and to support looking for local memory.

Remove FunctionAttrs' PointsToLocalOrConstantMemory function, now that
AliasAnalysis knows all the tricks that it knew.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118412 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
a25e5dbcc2371352386a01e3c1b8e76dd890272b 08-Nov-2010 Dan Gohman <gohman@apple.com> Extend the AliasAnalysis::pointsToConstantMemory interface to allow it
to optionally look for constant or local (alloca) memory.

Teach BasicAliasAnalysis::pointsToConstantMemory to look through Select
and Phi nodes, and to support looking for local memory.

Remove FunctionAttrs' PointsToLocalOrConstantMemory function, now that
AliasAnalysis knows all the tricks that it knew.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118412 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
db016b5ef3edf01d25c0a17e23141bd1d57f9c5d 08-Nov-2010 Dan Gohman <gohman@apple.com> Make FunctionAttrs use AliasAnalysis::getModRefBehavior, now that it
knows about intrinsic functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118410 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
3c97f7af9e75507f12a3977bced6b91c7e2ffb2a 08-Nov-2010 Dan Gohman <gohman@apple.com> Make FunctionAttrs use AliasAnalysis::getModRefBehavior, now that it
knows about intrinsic functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118410 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
860847553460378e38db1bf8dac7ef4ad4daafc7 03-Nov-2010 Duncan Sands <baldrick@free.fr> Rename PointsToLocalMemory to PointsToLocalOrConstantMemory to make
the code more self-documenting.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118171 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
391f5bce046e229a8d52faf317a7ab980aff0dbb 03-Nov-2010 Duncan Sands <baldrick@free.fr> Rename PointsToLocalMemory to PointsToLocalOrConstantMemory to make
the code more self-documenting.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118171 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
1446c29e9ddfd7756b5e5374f9e877039b667537 03-Nov-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Let the -inline-threshold command line argument take precedence over the
threshold given to createFunctionInliningPass().

Both opt -O3 and clang would silently ignore the -inline-threshold option.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118117 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
930f5efac0f76aa9e3772d9a36757f18b3573112 03-Nov-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Let the -inline-threshold command line argument take precedence over the
threshold given to createFunctionInliningPass().

Both opt -O3 and clang would silently ignore the -inline-threshold option.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@118117 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
4a5645eace5a2199fc1bb9d496470936cc846c9f 30-Oct-2010 Duncan Sands <baldrick@free.fr> Now that the MallocInst no longer exists, this workaround for
it claiming not to have side-effects is no longer needed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117789 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
aa660993304216053b578aeb2537d26071c3a51e 30-Oct-2010 Duncan Sands <baldrick@free.fr> Now that the MallocInst no longer exists, this workaround for
it claiming not to have side-effects is no longer needed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117789 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
331003c6d9cc86490a066d74314a67058da2e5d4 30-Oct-2010 Duncan Sands <baldrick@free.fr> If a function does a volatile load from a global constant, do not
consider it to be readonly. In fact, don't even consider it to be
readonly if it does a volatile load from an AllocaInst either (it
is debatable as to whether readonly would be correct or not in this
case; play safe for the moment). This fixes PR8279.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117783 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
ad6f541840015690ad1483821eb9d8e5f7e50442 30-Oct-2010 Duncan Sands <baldrick@free.fr> If a function does a volatile load from a global constant, do not
consider it to be readonly. In fact, don't even consider it to be
readonly if it does a volatile load from an AllocaInst either (it
is debatable as to whether readonly would be correct or not in this
case; play safe for the moment). This fixes PR8279.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117783 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
70bef507cff1e70dbd5b9fc92c081aa3cd6a9e28 21-Oct-2010 Duncan Sands <baldrick@free.fr> RetOp is not actually used for anything useful (though
it looks like maybe it was supposed to be used in the
test...), so zap it (gcc-4.6 warning).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117023 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
2b55f56df8a69dd2fc057626e314cdf29d7c10ed 21-Oct-2010 Duncan Sands <baldrick@free.fr> RetOp is not actually used for anything useful (though
it looks like maybe it was supposed to be used in the
test...), so zap it (gcc-4.6 warning).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117023 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
32f5cb23caae91a35c354496a9dd3edddbafbc17 20-Oct-2010 Dan Gohman <gohman@apple.com> Reapply r116831 and r116839, converting AliasAnalysis to use
uint64_t, plus fixes for places I missed before.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116875 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
3da848bbda62b25c12335998aaa44ab361f0bf15 20-Oct-2010 Dan Gohman <gohman@apple.com> Reapply r116831 and r116839, converting AliasAnalysis to use
uint64_t, plus fixes for places I missed before.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116875 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
a65d6a686e6ad865c61aec70c5bdfb30bf6f5b22 19-Oct-2010 Owen Anderson <resistor@mac.com> Get rid of static constructors for pass registration. Instead, every pass exposes an initializeMyPassFunction(), which
must be called in the pass's constructor. This function uses static dependency declarations to recursively initialize
the pass's dependencies.

Clients that only create passes through the createFooPass() APIs will require no changes. Clients that want to use the
CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h
before parsing commandline arguments.

I have tested this with all standard configurations of clang and llvm-gcc on Darwin. It is possible that there are problems
with the static dependencies that will only be visible with non-standard options. If you encounter any crash in pass
registration/creation, please send the testcase to me directly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116820 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
onstantMerge.cpp
eadArgumentElimination.cpp
eadTypeElimination.cpp
unctionAttrs.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
nlineAlways.cpp
nlineSimple.cpp
nternalize.cpp
oopExtractor.cpp
owerSetJmp.cpp
ergeFunctions.cpp
artialInlining.cpp
artialSpecialization.cpp
runeEH.cpp
tripDeadPrototypes.cpp
tripSymbols.cpp
tructRetPromotion.cpp
081c34b725980f995be9080eaec24cd3dfaaf065 19-Oct-2010 Owen Anderson <resistor@mac.com> Get rid of static constructors for pass registration. Instead, every pass exposes an initializeMyPassFunction(), which
must be called in the pass's constructor. This function uses static dependency declarations to recursively initialize
the pass's dependencies.

Clients that only create passes through the createFooPass() APIs will require no changes. Clients that want to use the
CommandLine options for passes will need to manually call the appropriate initialization functions in PassInitialization.h
before parsing commandline arguments.

I have tested this with all standard configurations of clang and llvm-gcc on Darwin. It is possible that there are problems
with the static dependencies that will only be visible with non-standard options. If you encounter any crash in pass
registration/creation, please send the testcase to me directly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116820 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
onstantMerge.cpp
eadArgumentElimination.cpp
eadTypeElimination.cpp
unctionAttrs.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
nlineAlways.cpp
nlineSimple.cpp
nternalize.cpp
oopExtractor.cpp
owerSetJmp.cpp
ergeFunctions.cpp
artialInlining.cpp
artialSpecialization.cpp
runeEH.cpp
tripDeadPrototypes.cpp
tripSymbols.cpp
tructRetPromotion.cpp
fd46f9530483dd40a018b038c7334c955c52a49a 19-Oct-2010 Mikhail Glushenkov <foldr@codedgers.com> GlobalOpt: EvaluateFunction() must not evaluate stores to weak_odr globals.

Fixes PR8389.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116812 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
99fca5de96d3435e8eb7c84e8366cee98ef5416a 19-Oct-2010 Mikhail Glushenkov <foldr@codedgers.com> GlobalOpt: EvaluateFunction() must not evaluate stores to weak_odr globals.

Fixes PR8389.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116812 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
3302c000f59d2b6f9e4e4841e3b0bc953fb12005 18-Oct-2010 Mikhail Glushenkov <foldr@codedgers.com> Trailing whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116749 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
9d28fdd7225b344789ed7f54cf51b4019763b30b 18-Oct-2010 Mikhail Glushenkov <foldr@codedgers.com> Trailing whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116749 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
5580e98eccbc98d875b9b4dca4ba8f6e8faf99a9 14-Oct-2010 Owen Anderson <resistor@mac.com> CallGraphSCC passes implicity require CallGraph analysis.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116443 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
unctionAttrs.cpp
nlineSimple.cpp
runeEH.cpp
tructRetPromotion.cpp
ae0a7bc68303ce0c8721f0e981ae602601390e68 14-Oct-2010 Owen Anderson <resistor@mac.com> CallGraphSCC passes implicity require CallGraph analysis.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116443 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
unctionAttrs.cpp
nlineSimple.cpp
runeEH.cpp
tructRetPromotion.cpp
d063712b883d8a3d0766b67ce010def0f0572964 13-Oct-2010 Rafael Espindola <rafael.espindola@gmail.com> Be more consistent in using ValueToValueMapTy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116387 91177308-0d34-0410-b5e6-96231b3b80d8
artialInlining.cpp
artialSpecialization.cpp
1ed219a9d2279ce5a5bbcf16d9b7ccc05cce638c 13-Oct-2010 Rafael Espindola <rafael.espindola@gmail.com> Be more consistent in using ValueToValueMapTy.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116387 91177308-0d34-0410-b5e6-96231b3b80d8
artialInlining.cpp
artialSpecialization.cpp
cdb0c03397e05fb01ed67a7caaa5f82ec993c564 12-Oct-2010 Owen Anderson <resistor@mac.com> Begin adding static dependence information to passes, which will allow us to
perform initialization without static constructors AND without explicit initialization
by the client. For the moment, passes are required to initialize both their
(potential) dependencies and any passes they preserve. I hope to be able to relax
the latter requirement in the future.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116334 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadTypeElimination.cpp
oopExtractor.cpp
2ab36d350293c77fc8941ce1023e4899df7e3a82 12-Oct-2010 Owen Anderson <resistor@mac.com> Begin adding static dependence information to passes, which will allow us to
perform initialization without static constructors AND without explicit initialization
by the client. For the moment, passes are required to initialize both their
(potential) dependencies and any passes they preserve. I hope to be able to relax
the latter requirement in the future.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116334 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadTypeElimination.cpp
oopExtractor.cpp
e42cc85b97a62e183be61ef408786dc946d9ae8b 10-Oct-2010 Kenneth Uildriks <kennethuil@gmail.com> Now using a variant of the existing inlining heuristics to decide whether to create a given specialization of a function in PartialSpecialization. If the total performance bonus across all callsites passing the same constant exceeds the specialization cost, we create the specialization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116158 91177308-0d34-0410-b5e6-96231b3b80d8
artialSpecialization.cpp
74fa7327d690e6ceda6ce77e4e5b8ef75cb12538 10-Oct-2010 Kenneth Uildriks <kennethuil@gmail.com> Now using a variant of the existing inlining heuristics to decide whether to create a given specialization of a function in PartialSpecialization. If the total performance bonus across all callsites passing the same constant exceeds the specialization cost, we create the specialization.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@116158 91177308-0d34-0410-b5e6-96231b3b80d8
artialSpecialization.cpp
1434dfa8cead98bd1e63411fcb9424e1d37f61ac 08-Oct-2010 Owen Anderson <resistor@mac.com> Now with fewer extraneous semicolons!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115996 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
onstantMerge.cpp
eadArgumentElimination.cpp
eadTypeElimination.cpp
unctionAttrs.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
nlineAlways.cpp
nlineSimple.cpp
nternalize.cpp
oopExtractor.cpp
owerSetJmp.cpp
ergeFunctions.cpp
artialInlining.cpp
artialSpecialization.cpp
runeEH.cpp
tripDeadPrototypes.cpp
tripSymbols.cpp
tructRetPromotion.cpp
ce665bd2e2b581ab0858d1afe359192bac96b868 08-Oct-2010 Owen Anderson <resistor@mac.com> Now with fewer extraneous semicolons!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115996 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
onstantMerge.cpp
eadArgumentElimination.cpp
eadTypeElimination.cpp
unctionAttrs.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
nlineAlways.cpp
nlineSimple.cpp
nternalize.cpp
oopExtractor.cpp
owerSetJmp.cpp
ergeFunctions.cpp
artialInlining.cpp
artialSpecialization.cpp
runeEH.cpp
tripDeadPrototypes.cpp
tripSymbols.cpp
tructRetPromotion.cpp
5286c8249c8ebf3e770eaae13eac5543af228c09 07-Oct-2010 Owen Anderson <resistor@mac.com> Add an initialization routine for libLLVMipo.a


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115933 91177308-0d34-0410-b5e6-96231b3b80d8
PO.cpp
2c81296bc237cb26c2bb789514e331b3b5b31f79 07-Oct-2010 Owen Anderson <resistor@mac.com> Add an initialization routine for libLLVMipo.a


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115933 91177308-0d34-0410-b5e6-96231b3b80d8
PO.cpp
c48ef0d1a2817f312353d3e2cd4ebfbe6c8046c7 01-Oct-2010 Dale Johannesen <dalej@apple.com> Massive rewrite of MMX:
The x86_mmx type is used for MMX intrinsics, parameters and
return values where these use MMX registers, and is also
supported in load, store, and bitcast.

Only the above operations generate MMX instructions, and optimizations
do not operate on or produce MMX intrinsics.

MMX-sized vectors <2 x i32> etc. are lowered to XMM or split into
smaller pieces. Optimizations may occur on these forms and the
result casted back to x86_mmx, provided the result feeds into a
previous existing x86_mmx operation.

The point of all this is prevent optimizations from introducing
MMX operations, which is unsafe due to the EMMS problem.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115243 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
0488fb649a56b7fc89a5814df5308813f9e5a85d 01-Oct-2010 Dale Johannesen <dalej@apple.com> Massive rewrite of MMX:
The x86_mmx type is used for MMX intrinsics, parameters and
return values where these use MMX registers, and is also
supported in load, store, and bitcast.

Only the above operations generate MMX instructions, and optimizations
do not operate on or produce MMX intrinsics.

MMX-sized vectors <2 x i32> etc. are lowered to XMM or split into
smaller pieces. Optimizations may occur on these forms and the
result casted back to x86_mmx, provided the result feeds into a
previous existing x86_mmx operation.

The point of all this is prevent optimizations from introducing
MMX operations, which is unsafe due to the EMMS problem.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115243 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
335edd1b5f4d10458376cf20cda536fc291f5a10 29-Sep-2010 Oscar Fuentes <ofv@wanadoo.es> Removed a bunch of unnecessary target_link_libraries.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114999 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
3609eb0de2f786ca6917d0388c37c23873dbd247 29-Sep-2010 Oscar Fuentes <ofv@wanadoo.es> Removed a bunch of unnecessary target_link_libraries.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114999 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
b7f0904521a3ac65575937b0c72eae844c4faa08 23-Sep-2010 Bob Wilson <bob.wilson@apple.com> Fix llvm-extract so that it changes the linkage of all GlobalValues to
"external" even when doing lazy bitcode loading. This was broken because
a function that is not materialized fails the !isDeclaration() test.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114666 91177308-0d34-0410-b5e6-96231b3b80d8
xtractGV.cpp
edf017487ffdd52cd42f3129c0e6b78fffb31e89 23-Sep-2010 Bob Wilson <bob.wilson@apple.com> Fix llvm-extract so that it changes the linkage of all GlobalValues to
"external" even when doing lazy bitcode loading. This was broken because
a function that is not materialized fails the !isDeclaration() test.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@114666 91177308-0d34-0410-b5e6-96231b3b80d8
xtractGV.cpp
6ed57ad0ded7b5e5136b7d29901f6d5dabcbb7b5 15-Sep-2010 Chris Lattner <sabre@nondot.org> fix PR8144, a bug where constant merge would merge globals marked
attribute(used).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113911 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
49ddd3a1a4b75f1181e0bd3faae4b50950e6ff53 15-Sep-2010 Chris Lattner <sabre@nondot.org> fix PR8144, a bug where constant merge would merge globals marked
attribute(used).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113911 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
f318164d18455fe44fcc9e03329036917f303edc 14-Sep-2010 Michael J. Spencer <bigcheesegs@gmail.com> Revert "CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally."

This reverts commit r113632

Conflicts:

cmake/modules/AddLLVM.cmake

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113819 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
3a210e2d302758101ac06946e86027b327c7d0f3 14-Sep-2010 Michael J. Spencer <bigcheesegs@gmail.com> Revert "CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally."

This reverts commit r113632

Conflicts:

cmake/modules/AddLLVM.cmake

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113819 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
da61c1662bd86ea1f7fad601e9966f1b700636c1 11-Sep-2010 Shih-wei Liao <sliao@google.com> Merge commit '69494cf8102cf872e9cb76662e9960be7c112112' into HEAD

Conflicts:
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
lib/Target/ARM/ARMCodeEmitter.cpp
lib/Target/ARM/ARMJITInfo.cpp
lib/Target/ARM/ARMRelocations.h
lib/Transforms/IPO/MergeFunctions.cpp

Change-Id: I23d40983717e072fa49334c1fa54f2cf961476c7
338c97baad1444a4158a7d99162e0e654f058c43 10-Sep-2010 Michael J. Spencer <bigcheesegs@gmail.com> CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113632 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
4e9c939312ff73bd0c6a6485fd5f97012f5910fa 10-Sep-2010 Michael J. Spencer <bigcheesegs@gmail.com> CMake: Get rid of LLVMLibDeps.cmake and export the libraries normally.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113632 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ff380f202ea6a168a5167cdf238a6a22a9ea3a71 07-Sep-2010 Nick Lewycky <nicholas@mxc.ca> Fix major bug in thunk detection. Also verify the calling convention.

Switch from isWeakForLinker to mayBeOverridden which is more accurate.

Add more statistics and debugging info. Add comments. Move static function
outside anonymous namespace.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113190 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
2b6c01b40b75e363e46b3ad7c598113eb98f34fb 07-Sep-2010 Nick Lewycky <nicholas@mxc.ca> Fix major bug in thunk detection. Also verify the calling convention.

Switch from isWeakForLinker to mayBeOverridden which is more accurate.

Add more statistics and debugging info. Add comments. Move static function
outside anonymous namespace.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113190 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
13471ed2e2a99a33881b90c4f36bbc56b30b2351 05-Sep-2010 Nick Lewycky <nicholas@mxc.ca> Fix warning reported by MSVC++ builder.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113106 91177308-0d34-0410-b5e6-96231b3b80d8
xtractGV.cpp
e110abb3132eff4d3ad1fd5a6166d7703d2b8996 05-Sep-2010 Nick Lewycky <nicholas@mxc.ca> Fix warning reported by MSVC++ builder.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113106 91177308-0d34-0410-b5e6-96231b3b80d8
xtractGV.cpp
c7df1866e2d14925f10134dbcf6cd428c85ac53f 05-Sep-2010 Nick Lewycky <nicholas@mxc.ca> Switch FnSet to containing the ComparableFunction instead of a pointer to one.
This reduces malloc traffic (yay!) and removes MergeFunctionsEqualityInfo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113105 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
b0e17779ba401feae32cdd1dd4096d49c1746153 05-Sep-2010 Nick Lewycky <nicholas@mxc.ca> Switch FnSet to containing the ComparableFunction instead of a pointer to one.
This reduces malloc traffic (yay!) and removes MergeFunctionsEqualityInfo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113105 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
94c43c36d916e286f170ec9fedd46ae782333f63 05-Sep-2010 Nick Lewycky <nicholas@mxc.ca> Fix many bugs when merging weak-strong and weak-weak pairs. We now merge all
strong functions first to make sure they're the canonical definitions and then
do a second pass looking only for weak functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113104 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
b0104e1bb56cde925d91a5b2432a18f87214484a 05-Sep-2010 Nick Lewycky <nicholas@mxc.ca> Fix many bugs when merging weak-strong and weak-weak pairs. We now merge all
strong functions first to make sure they're the canonical definitions and then
do a second pass looking only for weak functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113104 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
5a2e4d83b41d4519f33486dfaec106bf94667c73 31-Aug-2010 Nick Lewycky <nicholas@mxc.ca> Fix an infinite loop; merging two functions will create a new function (if the
two are weak, we make them thunks to a new strong function) so don't iterate
through the function list as we're modifying it.

Also add back the outermost loop which got removed during the cleanups.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112595 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
65a0af3855c7003fa57d41eeb6586b20eefa8cfd 31-Aug-2010 Nick Lewycky <nicholas@mxc.ca> Fix an infinite loop; merging two functions will create a new function (if the
two are weak, we make them thunks to a new strong function) so don't iterate
through the function list as we're modifying it.

Also add back the outermost loop which got removed during the cleanups.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112595 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
50da563e52e9d4597554a975f4977066f1a52f32 31-Aug-2010 Nick Lewycky <nicholas@mxc.ca> Switch to DenseSet, simplifying much more code. We now have a single iteration
where we hash, compare and fold, instead of one iteration where we build up
the hash buckets and a second one to fold.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112582 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
f53de86cba33b63ecd54e16dcea735939c5b0e4a 31-Aug-2010 Nick Lewycky <nicholas@mxc.ca> Switch to DenseSet, simplifying much more code. We now have a single iteration
where we hash, compare and fold, instead of one iteration where we build up
the hash buckets and a second one to fold.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112582 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
32497e1a4b44bbad671605bf3d382c6dc4b92c23 28-Aug-2010 Chris Lattner <sabre@nondot.org> remove unions from LLVM IR. They are severely buggy and not
being actively maintained, improved, or extended.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112356 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
61c70e98ac3c7504d31dd9bc81c4e9cb998e9984 28-Aug-2010 Chris Lattner <sabre@nondot.org> remove unions from LLVM IR. They are severely buggy and not
being actively maintained, improved, or extended.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112356 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
ac8e12c0904eb6a0a463c3396088f6a23e4ef2fe 26-Aug-2010 Dan Gohman <gohman@apple.com> Reapply r112091 and r111922, support for metadata linking, with a
fix: add a flag to MapValue and friends which indicates whether
any module-level mappings are being made. In the common case of
inlining, no module-level mappings are needed, so MapValue doesn't
need to examine non-function-local metadata, which can be very
expensive in the case of a large module with really deep metadata
(e.g. a large C++ program compiled with -g).

This flag is a little awkward; perhaps eventually it can be moved
into the ClonedCodeInfo class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112190 91177308-0d34-0410-b5e6-96231b3b80d8
artialInlining.cpp
artialSpecialization.cpp
6cb8c23db1c3becdce6dfbf1b7f1677faca4251e 26-Aug-2010 Dan Gohman <gohman@apple.com> Reapply r112091 and r111922, support for metadata linking, with a
fix: add a flag to MapValue and friends which indicates whether
any module-level mappings are being made. In the common case of
inlining, no module-level mappings are needed, so MapValue doesn't
need to examine non-function-local metadata, which can be very
expensive in the case of a large module with really deep metadata
(e.g. a large C++ program compiled with -g).

This flag is a little awkward; perhaps eventually it can be moved
into the ClonedCodeInfo class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112190 91177308-0d34-0410-b5e6-96231b3b80d8
artialInlining.cpp
artialSpecialization.cpp
a52b82058da920c7386f8a7d181c5f403c571fb5 26-Aug-2010 Chris Lattner <sabre@nondot.org> zap dead code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112130 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
2a36545176ff8f9b7cd132070d186edcdcc3b2a3 26-Aug-2010 Chris Lattner <sabre@nondot.org> zap dead code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112130 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
33bcdfefeff07a861eb4599ac162a9c2f3309a49 26-Aug-2010 Dan Gohman <gohman@apple.com> Rewrite ExtractGV, removing a bunch of stuff that didn't fully work,
and was over-complicated, and replacing it with a simple implementation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112120 91177308-0d34-0410-b5e6-96231b3b80d8
xtractGV.cpp
b4e3cda1189fae8333fd3fa9051b47ed067ae1fd 26-Aug-2010 Dan Gohman <gohman@apple.com> Rewrite ExtractGV, removing a bunch of stuff that didn't fully work,
and was over-complicated, and replacing it with a simple implementation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112120 91177308-0d34-0410-b5e6-96231b3b80d8
xtractGV.cpp
813243c73d159f832c0f340a3b85377a702dad10 25-Aug-2010 Devang Patel <dpatel@apple.com> DIGlobalVariable can be used to encode debug info for globals that are directly folded into a constant by FE.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112072 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
1955cf195021b2fd3b509d9ad414a83291f3311a 25-Aug-2010 Devang Patel <dpatel@apple.com> DIGlobalVariable can be used to encode debug info for globals that are directly folded into a constant by FE.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@112072 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
28c238c9ded0b5c91e122c94b5a02d76a5245c11 20-Aug-2010 Ying Wang <wangying@google.com> Fix sim build.

Note that this only makes the sim build green, but the built images won't work for sure:
No libbcc.so, which depends on something else that can not build in sim mode.
No x86 bitcode is generated as well, I believe.

Change-Id: Idca8378427196622ac77cd56a38c6a160f03ba22
ndroid.mk
32808c46fd95e1e86698b2614c30cd45b3a6c2be 09-Aug-2010 Nick Lewycky <nicholas@mxc.ca> Fix a use after free error caught by the valgrind builders.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110601 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
3221834f8a6216d01a7e1d1201bd14eafd79cff3 09-Aug-2010 Nick Lewycky <nicholas@mxc.ca> Fix a use after free error caught by the valgrind builders.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110601 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
c536adf751e8b0bcd5cfad42ebbc0e50a0e7c597 08-Aug-2010 Nick Lewycky <nicholas@mxc.ca> Do more to modernize MergeFunctions. Refactor in response to Chris' code review.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110538 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
be04fdeb6c46e92fdeda7535c5912d072eff008c 08-Aug-2010 Nick Lewycky <nicholas@mxc.ca> Do more to modernize MergeFunctions. Refactor in response to Chris' code review.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110538 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
7569322765651f19eea0609fb082e6b267d5d2b5 06-Aug-2010 Owen Anderson <resistor@mac.com> Reapply r110396, with fixes to appease the Linux buildbot gods.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110460 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
onstantMerge.cpp
eadArgumentElimination.cpp
eadTypeElimination.cpp
xtractGV.cpp
unctionAttrs.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
nlineAlways.cpp
nlineSimple.cpp
nliner.cpp
nternalize.cpp
oopExtractor.cpp
owerSetJmp.cpp
ergeFunctions.cpp
artialInlining.cpp
artialSpecialization.cpp
runeEH.cpp
tripDeadPrototypes.cpp
tripSymbols.cpp
tructRetPromotion.cpp
90c579de5a383cee278acc3f7e7b9d0a656e6a35 06-Aug-2010 Owen Anderson <resistor@mac.com> Reapply r110396, with fixes to appease the Linux buildbot gods.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110460 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
onstantMerge.cpp
eadArgumentElimination.cpp
eadTypeElimination.cpp
xtractGV.cpp
unctionAttrs.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
nlineAlways.cpp
nlineSimple.cpp
nliner.cpp
nternalize.cpp
oopExtractor.cpp
owerSetJmp.cpp
ergeFunctions.cpp
artialInlining.cpp
artialSpecialization.cpp
runeEH.cpp
tripDeadPrototypes.cpp
tripSymbols.cpp
tructRetPromotion.cpp
c436e61ce13beacdde991bc9add783be131731ff 06-Aug-2010 Nick Lewycky <nicholas@mxc.ca> Work in progress, cleaning up MergeFuncs.
Further clean up the comparison function by removing overly generalized
"domains".
Remove all understanding of ELF aliases and simplify folding code and comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110434 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
c9dcbed6a39f3aa2562de070bb15670d81c38650 06-Aug-2010 Nick Lewycky <nicholas@mxc.ca> Work in progress, cleaning up MergeFuncs.
Further clean up the comparison function by removing overly generalized
"domains".
Remove all understanding of ELF aliases and simplify folding code and comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110434 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
619acdc63ab0a47d125dca0591285c8ac4c9ed20 06-Aug-2010 Owen Anderson <resistor@mac.com> Revert r110396 to fix buildbots.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110410 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
onstantMerge.cpp
eadArgumentElimination.cpp
eadTypeElimination.cpp
xtractGV.cpp
unctionAttrs.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
nlineAlways.cpp
nlineSimple.cpp
nliner.cpp
nternalize.cpp
oopExtractor.cpp
owerSetJmp.cpp
ergeFunctions.cpp
artialInlining.cpp
artialSpecialization.cpp
runeEH.cpp
tripDeadPrototypes.cpp
tripSymbols.cpp
tructRetPromotion.cpp
1f74590e9d1b9cf0f1f81a156efea73f76546e05 06-Aug-2010 Owen Anderson <resistor@mac.com> Revert r110396 to fix buildbots.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110410 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
onstantMerge.cpp
eadArgumentElimination.cpp
eadTypeElimination.cpp
xtractGV.cpp
unctionAttrs.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
nlineAlways.cpp
nlineSimple.cpp
nliner.cpp
nternalize.cpp
oopExtractor.cpp
owerSetJmp.cpp
ergeFunctions.cpp
artialInlining.cpp
artialSpecialization.cpp
runeEH.cpp
tripDeadPrototypes.cpp
tripSymbols.cpp
tructRetPromotion.cpp
0e63653ab0d25d579ad99948db606d8723d271dd 06-Aug-2010 Owen Anderson <resistor@mac.com> Don't use PassInfo* as a type identifier for passes. Instead, use the address of the static
ID member as the sole unique type identifier. Clean up APIs related to this change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110396 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
onstantMerge.cpp
eadArgumentElimination.cpp
eadTypeElimination.cpp
xtractGV.cpp
unctionAttrs.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
nlineAlways.cpp
nlineSimple.cpp
nliner.cpp
nternalize.cpp
oopExtractor.cpp
owerSetJmp.cpp
ergeFunctions.cpp
artialInlining.cpp
artialSpecialization.cpp
runeEH.cpp
tripDeadPrototypes.cpp
tripSymbols.cpp
tructRetPromotion.cpp
9ccaf53ada99c63737547c0235baeb8454b04e80 06-Aug-2010 Owen Anderson <resistor@mac.com> Don't use PassInfo* as a type identifier for passes. Instead, use the address of the static
ID member as the sole unique type identifier. Clean up APIs related to this change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110396 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
onstantMerge.cpp
eadArgumentElimination.cpp
eadTypeElimination.cpp
xtractGV.cpp
unctionAttrs.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
nlineAlways.cpp
nlineSimple.cpp
nliner.cpp
nternalize.cpp
oopExtractor.cpp
owerSetJmp.cpp
ergeFunctions.cpp
artialInlining.cpp
artialSpecialization.cpp
runeEH.cpp
tripDeadPrototypes.cpp
tripSymbols.cpp
tructRetPromotion.cpp
503e204470d7d49eacf973cef28ec26ff6641914 03-Aug-2010 Dan Gohman <gohman@apple.com> Thread const correctness through a bunch of AliasAnalysis interfaces and
eliminate several const_casts.

Make CallSite implicitly convertible to ImmutableCallSite.

Rename the getModRefBehavior for intrinsic IDs to
getIntrinsicModRefBehavior to avoid overload ambiguity with CallSite,
which happens to be implicitly convertible to bool.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110155 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
79fca6fea87be7221843031870bbf2c9ae1fc555 03-Aug-2010 Dan Gohman <gohman@apple.com> Thread const correctness through a bunch of AliasAnalysis interfaces and
eliminate several const_casts.

Make CallSite implicitly convertible to ImmutableCallSite.

Rename the getModRefBehavior for intrinsic IDs to
getIntrinsicModRefBehavior to avoid overload ambiguity with CallSite,
which happens to be implicitly convertible to bool.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110155 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
3951b343e96b52f8707b65b40f1bbdcbcec17950 02-Aug-2010 Oscar Fuentes <ofv@wanadoo.es> Prefix `next' iterator operation with `llvm::'.

Fixes potential ambiguity problems on VS 2010.

Patch by nobled!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110029 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
ee56c42168f6c4271593f6018c4409b6a5910302 02-Aug-2010 Oscar Fuentes <ofv@wanadoo.es> Prefix `next' iterator operation with `llvm::'.

Fixes potential ambiguity problems on VS 2010.

Patch by nobled!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110029 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
07c67fc5974e87f54fad1a77d77aa70871a2484f 02-Aug-2010 Daniel Dunbar <daniel@zuster.org> Fix a -Wreorder warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110022 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
44c7486c6331cdc726057b35ca57f00b5936e261 02-Aug-2010 Daniel Dunbar <daniel@zuster.org> Fix a -Wreorder warning.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110022 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
f50a75f75ce2a1cb834c4fb7b13ddac11cd9b9d4 02-Aug-2010 Nick Lewycky <nicholas@mxc.ca> Work in progress.
Start cleaning up MergeFunctions to look more like the rest of LLVM. The
primary change here is to move the methods responsible for comparison into the
new FunctionComparator object. Some comments added. There's more to do.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110021 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
78d4330fd83a94707b345e19f5277e7a46892689 02-Aug-2010 Nick Lewycky <nicholas@mxc.ca> Work in progress.
Start cleaning up MergeFunctions to look more like the rest of LLVM. The
primary change here is to move the methods responsible for comparison into the
new FunctionComparator object. Some comments added. There's more to do.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@110021 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
7aa26b64708e6c766a18fe32c46dfa99105dcc20 31-Jul-2010 Rafael Espindola <rafael.espindola@gmail.com> The BlockExtractorPass() constructor was not reading the BlockFile and that was
exactly what bugpoint expected it to do.

There was also only one user of
BlockExtractorPass(const std::vector<BasicBlock*> &B), so just remove it and
make BlockExtractorPass read BlockFile.

This fixes bugpoint's block extraction.

Nick, please review.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109936 91177308-0d34-0410-b5e6-96231b3b80d8
oopExtractor.cpp
d720670393434effa832b686b4a482b736bd9c4d 31-Jul-2010 Rafael Espindola <rafael.espindola@gmail.com> The BlockExtractorPass() constructor was not reading the BlockFile and that was
exactly what bugpoint expected it to do.

There was also only one user of
BlockExtractorPass(const std::vector<BasicBlock*> &B), so just remove it and
make BlockExtractorPass read BlockFile.

This fixes bugpoint's block extraction.

Nick, please review.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109936 91177308-0d34-0410-b5e6-96231b3b80d8
oopExtractor.cpp
36129ca8be5481a03bbf164b04bd026f114db81a 29-Jul-2010 Gabor Greif <ggreif@gmail.com> simplify by using CallSite constructors; virtually eliminates CallSite::get from the tree

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109687 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
unctionAttrs.cpp
PConstantPropagation.cpp
nliner.cpp
tructRetPromotion.cpp
7d3056b16038a6a09c452c0dfcc3c8f4e421506a 29-Jul-2010 Gabor Greif <ggreif@gmail.com> simplify by using CallSite constructors; virtually eliminates CallSite::get from the tree

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109687 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
unctionAttrs.cpp
PConstantPropagation.cpp
nliner.cpp
tructRetPromotion.cpp
e035519df392f87833b9f18e113129f55d90a7b7 22-Jul-2010 Gabor Greif <ggreif@gmail.com> mass elimination of reliance on automatic iterator dereferencing

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109103 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
96f1d8ebdd33b3f9bdb3b1163f36072c68599f42 22-Jul-2010 Gabor Greif <ggreif@gmail.com> mass elimination of reliance on automatic iterator dereferencing

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109103 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
cb394c5ca2c34e69f19542b9f4b6488d163b5687 22-Jul-2010 Gabor Greif <ggreif@gmail.com> simplify

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109101 91177308-0d34-0410-b5e6-96231b3b80d8
artialSpecialization.cpp
945f1ab0a5fb922871b3adda512404d9d6533760 22-Jul-2010 Gabor Greif <ggreif@gmail.com> simplify

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109101 91177308-0d34-0410-b5e6-96231b3b80d8
artialSpecialization.cpp
69995c73ec6c44fce08baa44eb81b641ee071cd2 22-Jul-2010 Gabor Greif <ggreif@gmail.com> do not access arguments via low-level interface, do not multiply dereference use_iterators

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109100 91177308-0d34-0410-b5e6-96231b3b80d8
artialSpecialization.cpp
efdf039aecf9f5dc53ac080549bf1837ea5776b7 22-Jul-2010 Gabor Greif <ggreif@gmail.com> do not access arguments via low-level interface, do not multiply dereference use_iterators

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109100 91177308-0d34-0410-b5e6-96231b3b80d8
artialSpecialization.cpp
c22140ab9f31dc4cbc67ac89035a1e7283987ebd 22-Jul-2010 Gabor Greif <ggreif@gmail.com> pass dereferenced iterator to dyn_cast

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109099 91177308-0d34-0410-b5e6-96231b3b80d8
artialInlining.cpp
85e01df73d9051ad9468cc835fabbdf40b77e5f6 22-Jul-2010 Gabor Greif <ggreif@gmail.com> pass dereferenced iterator to dyn_cast

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109099 91177308-0d34-0410-b5e6-96231b3b80d8
artialInlining.cpp
af08dfbc409d39bdcb04522161c650c4e26dd060 22-Jul-2010 Gabor Greif <ggreif@gmail.com> undo 80 column trespassing I caused

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109092 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
a399781289092fcdceb58b21174229f4373c4191 22-Jul-2010 Gabor Greif <ggreif@gmail.com> undo 80 column trespassing I caused

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109092 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
6374c3d4d7b1fece8ed9acb590f809a0e6fb17ee 22-Jul-2010 Owen Anderson <resistor@mac.com> Fix batch of converting RegisterPass<> to INTIALIZE_PASS().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109045 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
onstantMerge.cpp
eadArgumentElimination.cpp
eadTypeElimination.cpp
unctionAttrs.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
nlineAlways.cpp
nlineSimple.cpp
nternalize.cpp
oopExtractor.cpp
owerSetJmp.cpp
ergeFunctions.cpp
artialInlining.cpp
artialSpecialization.cpp
runeEH.cpp
tripDeadPrototypes.cpp
tripSymbols.cpp
tructRetPromotion.cpp
d13db2c59cc94162d6cf0a04187d408bfef6d4a7 22-Jul-2010 Owen Anderson <resistor@mac.com> Fix batch of converting RegisterPass<> to INTIALIZE_PASS().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@109045 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
onstantMerge.cpp
eadArgumentElimination.cpp
eadTypeElimination.cpp
unctionAttrs.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
nlineAlways.cpp
nlineSimple.cpp
nternalize.cpp
oopExtractor.cpp
owerSetJmp.cpp
ergeFunctions.cpp
artialInlining.cpp
artialSpecialization.cpp
runeEH.cpp
tripDeadPrototypes.cpp
tripSymbols.cpp
tructRetPromotion.cpp
2205f42036958f8e23ca29cbfd03cfc7ec2a20bc 21-Jul-2010 Dan Gohman <gohman@apple.com> Make this code a little more readable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108968 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
549979f5509ef6ff14e1e46c141990deb8d8274e 21-Jul-2010 Dan Gohman <gohman@apple.com> Make this code a little more readable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108968 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
103d42ff0f73f10b6306e293e7563a9e7e512c01 21-Jul-2010 Dan Gohman <gohman@apple.com> Fix a typo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108962 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
e336cbc450b98e90ee7f6f6dc8cfff45511baad7 21-Jul-2010 Dan Gohman <gohman@apple.com> Fix a typo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108962 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
0bdec64f002278d67eb56d3c1b18aaf1a72d6805 21-Jul-2010 Dan Gohman <gohman@apple.com> Don't look up the "dbg" metadata kind by name.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108961 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
7bc230ec6aad867333db43636f7beda68bb628ae 21-Jul-2010 Dan Gohman <gohman@apple.com> Don't look up the "dbg" metadata kind by name.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108961 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
9efeffd4eec6c97393944e079d3b2163fd6d4df3 20-Jul-2010 Dan Gohman <gohman@apple.com> Use getDebugLoc and setDebugLoc instead of getDbgMetadata and setDbgMetadata,
avoiding MDNode overhead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108909 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
bda025263905252aa1b7f811d0129fc4fb9322aa 20-Jul-2010 Dan Gohman <gohman@apple.com> Use getDebugLoc and setDebugLoc instead of getDbgMetadata and setDbgMetadata,
avoiding MDNode overhead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108909 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
5d5dcc84ec06b125efcb1a30d72e923ed9da3629 16-Jul-2010 Chris Lattner <sabre@nondot.org> eliminate unlockedRefineAbstractTypeTo, types are all per-llvmcontext,
so there is no locking involved in type refinement.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108553 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
49669e6d3a5743bf02a7b22f16fee6fa187c1930 16-Jul-2010 Chris Lattner <sabre@nondot.org> eliminate unlockedRefineAbstractTypeTo, types are all per-llvmcontext,
so there is no locking involved in type refinement.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108553 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
f5db8d3671fd4faf65f6a63ed1910cf801fa10f9 16-Jul-2010 Nick Lewycky <nicholas@mxc.ca> Arrays and vectors with different numbers of elements are not equivalent.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108517 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
394ce41b7fcb64a35d5cd1c1fefc0e2225ebfc01 16-Jul-2010 Nick Lewycky <nicholas@mxc.ca> Arrays and vectors with different numbers of elements are not equivalent.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108517 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
6f4dc10528435f6bf9d6965a2a35332b4b5e9b39 15-Jul-2010 Nick Lewycky <nicholas@mxc.ca> This is a full sentence.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108418 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
706f50820cbef16b1e7951dfa734f79b73cb5b39 15-Jul-2010 Nick Lewycky <nicholas@mxc.ca> This is a full sentence.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108418 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
c63c9b071671d532e77f4830254458c60aca5c31 15-Jul-2010 Nick Lewycky <nicholas@mxc.ca> Disable aliases on all platforms.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108417 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
664040a03c17f432a127a35013eeb6b6a26e41fb 15-Jul-2010 Nick Lewycky <nicholas@mxc.ca> Disable aliases on all platforms.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108417 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
f46dd68edc17bcb9c8a6e35f4716f0cf3c0af76e 13-Jul-2010 Eric Christopher <echristo@apple.com> Grammar.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108252 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
f0193ed8decb2e78d8d5ec4a4eaeed8f3036bf6e 13-Jul-2010 Eric Christopher <echristo@apple.com> Grammar.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108252 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
faf60e48004d28c1477f886e351552fb87688b4c 12-Jul-2010 Gabor Greif <ggreif@gmail.com> cache result of operator*

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108146 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
a53029b1fcc71b1482863a7031ddb0c48d7a1177 12-Jul-2010 Gabor Greif <ggreif@gmail.com> cache result of operator*

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108146 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
ce6bf113e6acd2ea4f40f9f5ffc553801bc9d834 12-Jul-2010 Gabor Greif <ggreif@gmail.com> cache result of operator*

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108145 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
65b9212d344d97f7305f61048c1c87bd5ffa0c32 12-Jul-2010 Gabor Greif <ggreif@gmail.com> cache result of operator*

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108145 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
8845b468c7a34d4bf32096cf87679cca84e17df2 12-Jul-2010 Gabor Greif <ggreif@gmail.com> cache result of operator*

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108144 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
aaaaa02a93d3815d4cde97071ed354acc64ec6f6 12-Jul-2010 Gabor Greif <ggreif@gmail.com> cache result of operator*

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108144 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
a035df260372b61b0c2af6857efd3e2a480e71af 12-Jul-2010 Gabor Greif <ggreif@gmail.com> cache results of operator*

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108143 91177308-0d34-0410-b5e6-96231b3b80d8
owerSetJmp.cpp
b7df50006336831cdb2e1d68ff093d584f85365f 12-Jul-2010 Gabor Greif <ggreif@gmail.com> cache results of operator*

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108143 91177308-0d34-0410-b5e6-96231b3b80d8
owerSetJmp.cpp
742a53445d2955040fe069e266c36b3c7d3aa7c9 12-Jul-2010 Gabor Greif <ggreif@gmail.com> cache dereferenced iterators

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108134 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
fc41f9081798f04d1c2e8be54f94deebe4be97e3 12-Jul-2010 Gabor Greif <ggreif@gmail.com> cache dereferenced iterators

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108134 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
9d835771bdc16fa527e26201b5e615e24471b0af 12-Jul-2010 Chris Lattner <sabre@nondot.org> make the prototypes for CreateMalloc and CreateFree more consistent. Patch
by Hans Vandierendonck from PR7605


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108116 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
5a30a8574cbcd3b385b1e8681c6a5c45856efb38 12-Jul-2010 Chris Lattner <sabre@nondot.org> make the prototypes for CreateMalloc and CreateFree more consistent. Patch
by Hans Vandierendonck from PR7605


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@108116 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
17311da4af2de2788d3b1e2f4cde1d97f92bfef4 09-Jul-2010 Gabor Greif <ggreif@gmail.com> cache result of operator*

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107990 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
e664267ae7af018a5e3802667e5420f8e8282888 09-Jul-2010 Gabor Greif <ggreif@gmail.com> cache result of operator*

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107990 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
de3cd651c30222193710d096d34144f279b0864c 07-Jul-2010 Duncan Sands <baldrick@free.fr> Rename "Release" builds as "Release+Asserts"; rename "Release-Asserts"
builds to "Release". The default build is unchanged (optimization on,
assertions on), however it is now called Release+Asserts. The intent
is that future LLVM releases released via llvm.org will be Release builds
in the new sense, i.e. will have assertions disabled (currently they have
assertions enabled, for a more than 20% slowdown). This will bring them
in line with MacOS releases, which ship with assertions disabled. It also
means that "Release" now means the same things in make and cmake builds:
cmake already disables assertions for "Release" builds AFAICS.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107758 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
8246adc1f0e2d28374da3aeab864aee5ff03f3ff 07-Jul-2010 Duncan Sands <baldrick@free.fr> Rename "Release" builds as "Release+Asserts"; rename "Release-Asserts"
builds to "Release". The default build is unchanged (optimization on,
assertions on), however it is now called Release+Asserts. The intent
is that future LLVM releases released via llvm.org will be Release builds
in the new sense, i.e. will have assertions disabled (currently they have
assertions enabled, for a more than 20% slowdown). This will bring them
in line with MacOS releases, which ship with assertions disabled. It also
means that "Release" now means the same things in make and cmake builds:
cmake already disables assertions for "Release" builds AFAICS.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107758 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
f823966e3fdbd57c5f85cc1ce856c7435c474bf4 01-Jul-2010 Bill Wendling <isanbard@gmail.com> Implement the "linker_private_weak" linkage type. This will be used for
Objective-C metadata types which should be marked as "weak", but which the
linker will remove upon final linkage. However, this linkage isn't specific to
Objective-C.

For example, the "objc_msgSend_fixup_alloc" symbol is defined like this:

.globl l_objc_msgSend_fixup_alloc
.weak_definition l_objc_msgSend_fixup_alloc
.section __DATA, __objc_msgrefs, coalesced
.align 3
l_objc_msgSend_fixup_alloc:
.quad _objc_msgSend_fixup
.quad L_OBJC_METH_VAR_NAME_1

This is different from the "linker_private" linkage type, because it can't have
the metadata defined with ".weak_definition".

Currently only supported on Darwin platforms.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107433 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
5e721d768254a920b78b9129d79a84c0163cb3f4 01-Jul-2010 Bill Wendling <isanbard@gmail.com> Implement the "linker_private_weak" linkage type. This will be used for
Objective-C metadata types which should be marked as "weak", but which the
linker will remove upon final linkage. However, this linkage isn't specific to
Objective-C.

For example, the "objc_msgSend_fixup_alloc" symbol is defined like this:

.globl l_objc_msgSend_fixup_alloc
.weak_definition l_objc_msgSend_fixup_alloc
.section __DATA, __objc_msgrefs, coalesced
.align 3
l_objc_msgSend_fixup_alloc:
.quad _objc_msgSend_fixup
.quad L_OBJC_METH_VAR_NAME_1

This is different from the "linker_private" linkage type, because it can't have
the metadata defined with ".weak_definition".

Currently only supported on Darwin platforms.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107433 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
e524efeba7ff6f1f017539d6206dbc4e6218fbc5 01-Jul-2010 Devang Patel <dpatel@apple.com> Debugging infomration is encoded in llvm IR using metadata. This is designed
such a way that debug info for symbols preserved even if symbols are
optimized away by the optimizer.

Add new special pass to remove debug info for such symbols.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107416 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
26d14294de179ada3ba472d206bd25e9785f05a3 01-Jul-2010 Devang Patel <dpatel@apple.com> Debugging infomration is encoded in llvm IR using metadata. This is designed
such a way that debug info for symbols preserved even if symbols are
optimized away by the optimizer.

Add new special pass to remove debug info for such symbols.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107416 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
7c4b8e70e77105eabf1f404e90a0eb9e5c30e58a 01-Jul-2010 Devang Patel <dpatel@apple.com> If a named mdnode is removed then mark module as changed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107412 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
e62b203570e1a6b071a0ef4c64cb81093026d93a 01-Jul-2010 Devang Patel <dpatel@apple.com> If a named mdnode is removed then mark module as changed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107412 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
cfb60212c3ba818e1b8c8ad7d72fd330d8e904e0 30-Jun-2010 Devang Patel <dpatel@apple.com> Remove all debug info related named mdnodes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107323 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
444a08cd6f21c5ef7fbb64eccc7ac6beba33e891 30-Jun-2010 Devang Patel <dpatel@apple.com> Remove all debug info related named mdnodes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107323 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
ca175d6d70319aa3c5ad5c4432d6ded092815be3 30-Jun-2010 Gabor Greif <ggreif@gmail.com> use ArgOperand API

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107277 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
e9af352d74d1fa670afbaf50594f899c1b12a995 30-Jun-2010 Gabor Greif <ggreif@gmail.com> use ArgOperand API

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107277 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
e066d26445ddf4114e2738021273126206cc4822 30-Jun-2010 Bill Wendling <isanbard@gmail.com> Revert r107205 and r107207.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107215 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
07d317711781d8c9268f7d6afcf1ba7eadf1d127 30-Jun-2010 Bill Wendling <isanbard@gmail.com> Revert r107205 and r107207.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107215 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
f8b6137ea514c38511dbeedde9c02e27c937cad3 29-Jun-2010 Bill Wendling <isanbard@gmail.com> Introducing the "linker_weak" linkage type. This will be used for Objective-C
metadata types which should be marked as "weak", but which the linker will
remove upon final linkage. For example, the "objc_msgSend_fixup_alloc" symbol is
defined like this:

.globl l_objc_msgSend_fixup_alloc
.weak_definition l_objc_msgSend_fixup_alloc
.section __DATA, __objc_msgrefs, coalesced
.align 3
l_objc_msgSend_fixup_alloc:
.quad _objc_msgSend_fixup
.quad L_OBJC_METH_VAR_NAME_1

This is different from the "linker_private" linkage type, because it can't have
the metadata defined with ".weak_definition".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107205 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
207855cff9b4811004b9720f28a5bd0adf3784b7 29-Jun-2010 Bill Wendling <isanbard@gmail.com> Introducing the "linker_weak" linkage type. This will be used for Objective-C
metadata types which should be marked as "weak", but which the linker will
remove upon final linkage. For example, the "objc_msgSend_fixup_alloc" symbol is
defined like this:

.globl l_objc_msgSend_fixup_alloc
.weak_definition l_objc_msgSend_fixup_alloc
.section __DATA, __objc_msgrefs, coalesced
.align 3
l_objc_msgSend_fixup_alloc:
.quad _objc_msgSend_fixup
.quad L_OBJC_METH_VAR_NAME_1

This is different from the "linker_private" linkage type, because it can't have
the metadata defined with ".weak_definition".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107205 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
ac8dc3a3c471f7f046345f1354c872e0aff2bc20 29-Jun-2010 Duncan Sands <baldrick@free.fr> Return Changed. This required setting Changed if dbg metadata
is stripped off. Currently set unconditionally, since the API
does not provide a way of working out if anything was actually
stripped off.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107142 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
a7065b1fcc394c91a647759aa36feaa280391b12 29-Jun-2010 Duncan Sands <baldrick@free.fr> Return Changed. This required setting Changed if dbg metadata
is stripped off. Currently set unconditionally, since the API
does not provide a way of working out if anything was actually
stripped off.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@107142 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
64414d3e54026f80e31771d02fb4d2848ce13f07 24-Jun-2010 Gabor Greif <ggreif@gmail.com> use ArgOperand API and CallSite for arg range; add necessary casts and perform some cosmetics

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106747 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
9e4f243de7c0a41ae02c93f7209ad97935e9853d 24-Jun-2010 Gabor Greif <ggreif@gmail.com> use ArgOperand API and CallSite for arg range; add necessary casts and perform some cosmetics

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106747 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
82f14144123f9d0f3170260f563b56fa588edba4 24-Jun-2010 Gabor Greif <ggreif@gmail.com> use ArgOperand API and CallSite for arg range

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106745 91177308-0d34-0410-b5e6-96231b3b80d8
owerSetJmp.cpp
fef8c4eb54b585b5a299910ccf5a8479f4982243 24-Jun-2010 Gabor Greif <ggreif@gmail.com> use ArgOperand API and CallSite for arg range

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106745 91177308-0d34-0410-b5e6-96231b3b80d8
owerSetJmp.cpp
7098bafbb20fa645ae350d8bc1676ac29d023033 24-Jun-2010 Devang Patel <dpatel@apple.com> Use ValueMap instead of DenseMap.
The ValueMapper used by various cloning utility maps MDNodes also.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106706 91177308-0d34-0410-b5e6-96231b3b80d8
artialInlining.cpp
artialSpecialization.cpp
e9916a302f1bacad234d7dafc1df3dc968a6ba0f 24-Jun-2010 Devang Patel <dpatel@apple.com> Use ValueMap instead of DenseMap.
The ValueMapper used by various cloning utility maps MDNodes also.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106706 91177308-0d34-0410-b5e6-96231b3b80d8
artialInlining.cpp
artialSpecialization.cpp
559d513348a11936bc90b64aad75e2540b26c6a4 22-Jun-2010 Dan Gohman <gohman@apple.com> Use pre-increment instead of post-increment when the result is not used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106542 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
fe60104ac97f3a8736dcfbfdf9547c7b7cc7b951 22-Jun-2010 Dan Gohman <gohman@apple.com> Use pre-increment instead of post-increment when the result is not used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106542 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
28188e1c4986d9e4985f0f4a8ce268743eb94631 08-Jun-2010 Shih-wei Liao <sliao@google.com> Git hiccup. Retry....

Change-Id: I5a329137a43f36bab32ea62386ade11da550c0b0
ndroid.mk
c156bc696311928af01132d159b9e307436779bb 08-Jun-2010 Shih-wei Liao <sliao@google.com> Fix llvm.mk and the other 49 mk files

Change-Id: I5aa02363c1083297d163a575f5a35c495f950230
ndroid.mk
4a325cbf6f2acb1034635bbcc7f3e5ea9829d012 07-Jun-2010 Dan Gohman <gohman@apple.com> Make bugpoint dead-argument-hacking actually work, and actually test it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105551 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
b9539745c54de13452e5ae7d0a13cb20dd763c10 07-Jun-2010 Dan Gohman <gohman@apple.com> Make bugpoint dead-argument-hacking actually work, and actually test it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105551 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
22c9e6cfb0b6ce51fbef6ae5678a4a564a38871a 05-Jun-2010 Kenneth Uildriks <kennethuil@gmail.com> Partial specialization was not checking the callsite to make sure it was using the same constants as the specialization, leading to calls to the wrong specialization. Patch by Takumi Nakamura\!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105528 91177308-0d34-0410-b5e6-96231b3b80d8
artialSpecialization.cpp
3a4340d4cb7c8a4914075a93e762f5023f81d084 05-Jun-2010 Kenneth Uildriks <kennethuil@gmail.com> Partial specialization was not checking the callsite to make sure it was using the same constants as the specialization, leading to calls to the wrong specialization. Patch by Takumi Nakamura\!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105528 91177308-0d34-0410-b5e6-96231b3b80d8
artialSpecialization.cpp
180babcf88067f29711c1d968bdca224b75cfd6c 31-May-2010 Benjamin Kramer <benny.kra@googlemail.com> Avoid swap when a copy suffices.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105220 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
c29df3cac735bc85d16e4ef3186cb50e41bec7bb 31-May-2010 Benjamin Kramer <benny.kra@googlemail.com> Avoid swap when a copy suffices.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105220 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
ba0e38cdf9c1fa6decdd9d3684028281d61b6af8 20-May-2010 Devang Patel <dpatel@apple.com> Strip llvm.dbg.lv also.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104236 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
69b4d1caff87585938641737ff39dcee5d104556 20-May-2010 Devang Patel <dpatel@apple.com> Strip llvm.dbg.lv also.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@104236 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
b891aa6db01ea676a70d5c768b0f313d31586bc8 15-May-2010 Nick Lewycky <nicholas@mxc.ca> Teach the always inliner to release its inline cost estimates, like the basic
inliner did in r103653. Why does the always inliner even bother with cost
estimates anyways?


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103858 91177308-0d34-0410-b5e6-96231b3b80d8
nlineAlways.cpp
54b78dca4e98f15e1723368fabda6cdf81f73956 15-May-2010 Nick Lewycky <nicholas@mxc.ca> Teach the always inliner to release its inline cost estimates, like the basic
inliner did in r103653. Why does the always inliner even bother with cost
estimates anyways?


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103858 91177308-0d34-0410-b5e6-96231b3b80d8
nlineAlways.cpp
84a80c048f135d01cfbd4a415b5b225a07026a67 15-May-2010 Nick Lewycky <nicholas@mxc.ca> Clean up, no functional change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103857 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
1462a9b97f25fac50369c69d1848016199e66eb5 15-May-2010 Nick Lewycky <nicholas@mxc.ca> Clean up, no functional change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103857 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
7acc8bc5a8a0287a6c47c3b0a72cc3acc1a72d5d 13-May-2010 Nick Lewycky <nicholas@mxc.ca> Remove heinous tabs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103700 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
911ae391e85ead1bb11895562a6bbdb2c0f8ebd2 13-May-2010 Nick Lewycky <nicholas@mxc.ca> Remove heinous tabs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103700 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
c798190224b9009b912564ef757004817782d182 13-May-2010 Nick Lewycky <nicholas@mxc.ca> Replace the core comparison login in merge functions. We can now merge
vector<>::push_back() in:

int foo(vector<int> &a, vector<unsigned> &b) {
a.push_back(10);
b.push_back(11);
}

to two calls to the same push_back function, or fold away the two copies of
push_back() in:

struct T { int; };
struct S { char; };
vector<T*> t;
vector<S*> s;
void f(T *x) { t.push_back(x); }
void g(S *x) { s.push_back(x); }

but leave f() and g() separate, since they refer to two different global
variables.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103698 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
33ab0b15689abd32f72a5417cd104bde19f4b4aa 13-May-2010 Nick Lewycky <nicholas@mxc.ca> Replace the core comparison login in merge functions. We can now merge
vector<>::push_back() in:

int foo(vector<int> &a, vector<unsigned> &b) {
a.push_back(10);
b.push_back(11);
}

to two calls to the same push_back function, or fold away the two copies of
push_back() in:

struct T { int; };
struct S { char; };
vector<T*> t;
vector<S*> s;
void f(T *x) { t.push_back(x); }
void g(S *x) { s.push_back(x); }

but leave f() and g() separate, since they refer to two different global
variables.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103698 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
5804e5ec731ecf58212bf0125d80ac313315fcc3 12-May-2010 Nick Lewycky <nicholas@mxc.ca> Clear CachedFunctionInfo upon Pass::releaseMemory. Because ValueMap will abort
on RAUW of functions, this is a correctness issue instead of a mere memory
usage problem.


No testcase until the new MergeFunctions can land.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103653 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
9a1581b9102511282ee823ab9a29819bc060e6a5 12-May-2010 Nick Lewycky <nicholas@mxc.ca> Clear CachedFunctionInfo upon Pass::releaseMemory. Because ValueMap will abort
on RAUW of functions, this is a correctness issue instead of a mere memory
usage problem.


No testcase until the new MergeFunctions can land.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@103653 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
28d891ebe3f6230e858fce0b4bb8b7880e40ed25 01-May-2010 Chris Lattner <sabre@nondot.org> revert r102831. We already delete dead readonly calls in
other places, killing a valid transformation is not the right
answer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102850 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
83f66fe6144c2041f1f7897f7015b0e2e68faad3 01-May-2010 Chris Lattner <sabre@nondot.org> revert r102831. We already delete dead readonly calls in
other places, killing a valid transformation is not the right
answer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102850 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
364dfd843b1cd8307ba264c426e079ae773d3c43 01-May-2010 Owen Anderson <resistor@mac.com> Disable the call-deletion transformation introduced in r86975. Without
halting analysis, it is illegal to delete a call to a read-only function.
The correct solution is almost certainly to add a "must halt" attribute and
only allow deletions in its presence.

XFAIL the relevant testcase for now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102831 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
1b4a38646f6bbeb32a125a1f2316a7b2d27916d7 01-May-2010 Owen Anderson <resistor@mac.com> Disable the call-deletion transformation introduced in r86975. Without
halting analysis, it is illegal to delete a call to a read-only function.
The correct solution is almost certainly to add a "must halt" attribute and
only allow deletions in its presence.

XFAIL the relevant testcase for now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102831 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
1708d84108e60703f6a3a90c5698e5f7c7f2d6fe 01-May-2010 Chris Lattner <sabre@nondot.org> rename InlineInfo.DevirtualizedCalls -> InlinedCalls to
reflect that it includes all inlined calls now, not just
devirtualized ones.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102824 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
0ca2f28458ae9122f413a4092ddcee33a9dd21c6 01-May-2010 Chris Lattner <sabre@nondot.org> rename InlineInfo.DevirtualizedCalls -> InlinedCalls to
reflect that it includes all inlined calls now, not just
devirtualized ones.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102824 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
41c33d362de8e8bd37d36364ad31192b701d023f 01-May-2010 Chris Lattner <sabre@nondot.org> The inliner has traditionally not considered call sites
that appear due to inlining a callee as candidates for
futher inlining, but a recent patch made it do this if
those call sites were indirect and became direct.

Unfortunately, in bizarre cases (see testcase) doing this
can cause us to infinitely inline mutually recursive
functions into callers not in the cycle. Fix this by
keeping track of the inline history from which callsite
inline candidates got inlined from.

This shouldn't affect any "real world" code, but is required
for a follow on patch that is coming up next.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102822 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
159528702aed7222cb30c3e8b55287e4ca8068cf 01-May-2010 Chris Lattner <sabre@nondot.org> The inliner has traditionally not considered call sites
that appear due to inlining a callee as candidates for
futher inlining, but a recent patch made it do this if
those call sites were indirect and became direct.

Unfortunately, in bizarre cases (see testcase) doing this
can cause us to infinitely inline mutually recursive
functions into callers not in the cycle. Fix this by
keeping track of the inline history from which callsite
inline candidates got inlined from.

This shouldn't affect any "real world" code, but is required
for a follow on patch that is coming up next.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102822 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
52546c223b7aee67abb238623881f71d2d77a779 30-Apr-2010 Devang Patel <dpatel@apple.com> Preserve debug info attached with call instruction while eliminating dead argument.
Radar 7927803


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102760 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
0aa885d3ab800d290198ebe6b6893524f784b002 30-Apr-2010 Devang Patel <dpatel@apple.com> Preserve debug info attached with call instruction while eliminating dead argument.
Radar 7927803


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102760 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
7abe37e4aee38cc79d91dd069a37d7e91d5bef53 28-Apr-2010 Shih-wei Liao <sliao@google.com> Sync upstream to r102410.
Re-turn on sdk.

Change-Id: I91a890863989a67243b4d2dfd1ae09b843ebaeaf
ndroid.mk
rgumentPromotion.cpp
MakeLists.txt
eadArgumentElimination.cpp
unctionAttrs.cpp
lobalOpt.cpp
PO.cpp
nlineAlways.cpp
nlineSimple.cpp
nliner.cpp
nternalize.cpp
ergeFunctions.cpp
artialInlining.cpp
runeEH.cpp
tructRetPromotion.cpp
9d9b543fe106d9689aae22d1348898f5e4de6cc7 25-Apr-2010 Chris Lattner <sabre@nondot.org> remove #if 1's.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102296 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
d89673c028a5091ffe68bd2e7e818e6e906b8f89 25-Apr-2010 Chris Lattner <sabre@nondot.org> remove #if 1's.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102296 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
68e334788c3cd222ceb49880d404d77a91fb4916 23-Apr-2010 Chris Lattner <sabre@nondot.org> enable my inliner change: add newly devirtualized call sites to
the worklist, making them inline candidates.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102213 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
5d7da4321521850e5e35a77b7af0b168d8121633 23-Apr-2010 Chris Lattner <sabre@nondot.org> enable my inliner change: add newly devirtualized call sites to
the worklist, making them inline candidates.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102213 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
40004bba0fc4fe0241a88b1c11bacae79cbd01a6 23-Apr-2010 Chris Lattner <sabre@nondot.org> switch InlineInfo.DevirtualizedCalls's list to be of WeakVH.
This fixes a bug where calls inlined into an invoke would get
changed into an invoke but the array would keep pointing to
the (now dead) call. The improved inliner behavior is still
disabled for now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102196 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
076863225ce070345ff7048f48b3550e00598a10 23-Apr-2010 Chris Lattner <sabre@nondot.org> switch InlineInfo.DevirtualizedCalls's list to be of WeakVH.
This fixes a bug where calls inlined into an invoke would get
changed into an invoke but the array would keep pointing to
the (now dead) call. The improved inliner behavior is still
disabled for now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102196 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
93ff359d75526a97df918f4b59085b992e302658 23-Apr-2010 Chris Lattner <sabre@nondot.org> disable my previous inliner patch, it appears to be busting self-host.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102153 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
62cc838b90d32b41f3025b400845b3e194b53e32 23-Apr-2010 Chris Lattner <sabre@nondot.org> disable my previous inliner patch, it appears to be busting self-host.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102153 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
9f978be03b031572af84c1e8876432ce62a34148 23-Apr-2010 Chris Lattner <sabre@nondot.org> The inliner was choosing to not consider call sites
that appear in the SCC as a result of inlining as candidates
for inlining. Change this so that it *does* consider call
sites that change from being indirect to being direct as a
result of inlining. This allows it to completely
"devirtualize" the testcase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102146 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
fe9af3b1f7e5d68ecc330bdf4f047d76838f8cc3 23-Apr-2010 Chris Lattner <sabre@nondot.org> The inliner was choosing to not consider call sites
that appear in the SCC as a result of inlining as candidates
for inlining. Change this so that it *does* consider call
sites that change from being indirect to being direct as a
result of inlining. This allows it to completely
"devirtualize" the testcase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102146 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
a81d1fe0151bd7500209af19b28301a638ca8593 23-Apr-2010 Chris Lattner <sabre@nondot.org> refactor the interface to InlineFunction so that most of the in/out
arguments are handled with a new InlineFunctionInfo class. This
makes it easier to extend InlineFunction to return more info in the
future.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102137 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
artialInlining.cpp
60915146f4d35e12f10dcdaa155596fac79184da 23-Apr-2010 Chris Lattner <sabre@nondot.org> refactor the interface to InlineFunction so that most of the in/out
arguments are handled with a new InlineFunctionInfo class. This
makes it easier to extend InlineFunction to return more info in the
future.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@102137 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
artialInlining.cpp
bf96362ab8192e400753e35b7e687e3fb70fc1be 20-Apr-2010 Gabor Greif <ggreif@gmail.com> use abstract accessors to CallInst

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101899 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
a9b2313c13a1bc8cbae751da03a9049ecaf0f918 20-Apr-2010 Gabor Greif <ggreif@gmail.com> use abstract accessors to CallInst

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101899 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
c09394ab3e86b8b2f31a86475027910e16e668c9 20-Apr-2010 Chris Lattner <sabre@nondot.org> make the inliner do less work for leaf functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101846 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
4471136e4db67f5b6cf064cb3b0a7668f15bfe6c 20-Apr-2010 Chris Lattner <sabre@nondot.org> make the inliner do less work for leaf functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101846 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
4980d1938a8056c12a70f640ec96ac630269697c 20-Apr-2010 Chris Lattner <sabre@nondot.org> Fix rdar://7879828 - crash in CallGraph, a self host issue.
Arg promotion was deleting call graph nodes that still had references
from the 'indirect' CGN. Like the inliner, it should only delete the
function if all references are gone.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101845 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eae220259fca393adc874ed41e3930011047beb7 20-Apr-2010 Chris Lattner <sabre@nondot.org> Fix rdar://7879828 - crash in CallGraph, a self host issue.
Arg promotion was deleting call graph nodes that still had references
from the 'indirect' CGN. Like the inliner, it should only delete the
function if all references are gone.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101845 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
fbf918ba42cda25ba57d28eecd0aee89a83a1ecc 17-Apr-2010 Eric Christopher <echristo@apple.com> Revert 101465, it broke internal OpenGL testing.

Probably the best way to know that all getOperand() calls have been handled
is to replace that API instead of updating.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101579 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
owerSetJmp.cpp
551754c4958086cc6910da7c950f2875e212f5cf 17-Apr-2010 Eric Christopher <echristo@apple.com> Revert 101465, it broke internal OpenGL testing.

Probably the best way to know that all getOperand() calls have been handled
is to replace that API instead of updating.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101579 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
owerSetJmp.cpp
c9976c7a4b78b8116cda74bf89a593d478aaab37 17-Apr-2010 Chris Lattner <sabre@nondot.org> introduce a new CallGraphSCC class, and pass it around
to CallGraphSCCPass's instead of passing around a
std::vector<CallGraphNode*>. No functionality change,
but now we have a much tidier interface.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101558 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
unctionAttrs.cpp
nliner.cpp
runeEH.cpp
tructRetPromotion.cpp
2decb22222cac46bb1d9163e7b89d7e5be8ef65f 17-Apr-2010 Chris Lattner <sabre@nondot.org> introduce a new CallGraphSCC class, and pass it around
to CallGraphSCCPass's instead of passing around a
std::vector<CallGraphNode*>. No functionality change,
but now we have a much tidier interface.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101558 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
unctionAttrs.cpp
nliner.cpp
runeEH.cpp
tructRetPromotion.cpp
b86413602e2d1d0d510016044092949168ac4d3f 16-Apr-2010 Gabor Greif <ggreif@gmail.com> reapply r101434
with a fix for self-hosting

rotate CallInst operands, i.e. move callee to the back
of the operand array

the motivation for this patch are laid out in my mail to llvm-commits:
more efficient access to operands and callee, faster callgraph-construction,
smaller compiler binary


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101465 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
owerSetJmp.cpp
4ec2258ffb495d7ce00177e447740ef1123a27db 16-Apr-2010 Gabor Greif <ggreif@gmail.com> reapply r101434
with a fix for self-hosting

rotate CallInst operands, i.e. move callee to the back
of the operand array

the motivation for this patch are laid out in my mail to llvm-commits:
more efficient access to operands and callee, faster callgraph-construction,
smaller compiler binary


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101465 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
owerSetJmp.cpp
ab05d8fcf61f7b926cf3e08f111794c69ca60690 16-Apr-2010 Gabor Greif <ggreif@gmail.com> back out r101423 and r101397, they break llvm-gcc self-host on darwin10

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101434 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
owerSetJmp.cpp
607a7ab3da72a2eb53553a520507cbb8068dd1d8 16-Apr-2010 Gabor Greif <ggreif@gmail.com> back out r101423 and r101397, they break llvm-gcc self-host on darwin10

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101434 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
owerSetJmp.cpp
763153ef8466ad11db0c5bb55647483cc5d69a2a 15-Apr-2010 Gabor Greif <ggreif@gmail.com> reapply r101364, which has been backed out in r101368
with a fix

rotate CallInst operands, i.e. move callee to the back
of the operand array

the motivation for this patch are laid out in my mail to llvm-commits:
more efficient access to operands and callee, faster callgraph-construction,
smaller compiler binary


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101397 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
owerSetJmp.cpp
2ff961f66816daab8bbc58a19025161d969821c2 15-Apr-2010 Gabor Greif <ggreif@gmail.com> reapply r101364, which has been backed out in r101368
with a fix

rotate CallInst operands, i.e. move callee to the back
of the operand array

the motivation for this patch are laid out in my mail to llvm-commits:
more efficient access to operands and callee, faster callgraph-construction,
smaller compiler binary


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101397 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
owerSetJmp.cpp
52f155ee5d607b3773c2bc19fa688758f8887e35 15-Apr-2010 Gabor Greif <ggreif@gmail.com> back out r101364, as it trips the linux nightlybot on some clang C++ tests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101368 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
owerSetJmp.cpp
9ee17208115482441953127615231c59a2f4d052 15-Apr-2010 Gabor Greif <ggreif@gmail.com> back out r101364, as it trips the linux nightlybot on some clang C++ tests

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101368 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
owerSetJmp.cpp
d46fdb45387f46beeadc04472b3a66ad1da3aca1 15-Apr-2010 Gabor Greif <ggreif@gmail.com> rotate CallInst operands, i.e. move callee to the back
of the operand array

the motivation for this patch are laid out in my mail to llvm-commits:
more efficient access to operands and callee, faster callgraph-construction,
smaller compiler binary


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101364 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
owerSetJmp.cpp
165dac08d1bb8428b32a5f39cdd3dbee2888987f 15-Apr-2010 Gabor Greif <ggreif@gmail.com> rotate CallInst operands, i.e. move callee to the back
of the operand array

the motivation for this patch are laid out in my mail to llvm-commits:
more efficient access to operands and callee, faster callgraph-construction,
smaller compiler binary


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101364 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
owerSetJmp.cpp
640bf9d3706f79d0842198a2a235662e734fce57 15-Apr-2010 Tobias Grosser <grosser@fim.uni-passau.de> IPO needs ScalarOpts and InstCombine in its libs

The commit "Adding IPSCCP and Internalize passes to the C-bindings" introduced
new dependencies for IPO. Add these to the CMAKE build as otherwise the
BUILD_SHARED_LIBS=1 build fails.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101313 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
a76b334d4477266f7810ab5821429eb20b522c13 15-Apr-2010 Tobias Grosser <grosser@fim.uni-passau.de> IPO needs ScalarOpts and InstCombine in its libs

The commit "Adding IPSCCP and Internalize passes to the C-bindings" introduced
new dependencies for IPO. Add these to the CMAKE build as otherwise the
BUILD_SHARED_LIBS=1 build fails.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101313 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
2459eb452f0061da7e921267486e262360750fee 14-Apr-2010 Evan Cheng <evan.cheng@apple.com> - Code clean up to reduce indentation.
- TryToOptimizeStoreOfMallocToGlobal should check if TargetData is available and bail out if it is not. The transformations being done requires TD.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101285 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
86cd445645803282db7eccda297e0c19e9e25b51 14-Apr-2010 Evan Cheng <evan.cheng@apple.com> - Code clean up to reduce indentation.
- TryToOptimizeStoreOfMallocToGlobal should check if TargetData is available and bail out if it is not. The transformations being done requires TD.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101285 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
8ee588a721e26af017b786eb2b3d0cc1741eb310 14-Apr-2010 Nick Lewycky <nicholas@mxc.ca> I don't know how, but I managed to goof the revert. Remove function that should
have been removed in r101231.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101232 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
3c594ff2900dfbd7640df4945c389de6de2b5e0a 14-Apr-2010 Nick Lewycky <nicholas@mxc.ca> I don't know how, but I managed to goof the revert. Remove function that should
have been removed in r101231.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101232 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
848bea84de2d995446520042b10f4b9cadd8d294 14-Apr-2010 Nick Lewycky <nicholas@mxc.ca> Revert r101213.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101231 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
3715e45da564e1c92410bf7b2d799d998664ff44 14-Apr-2010 Nick Lewycky <nicholas@mxc.ca> Revert r101213.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101231 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
d2b97a330bb36c33e6e6ff55d3d24786069a39dc 14-Apr-2010 Nick Lewycky <nicholas@mxc.ca> Remove tab.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101223 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
ff1ef6bdf18abbd2303d5081c1ba812304c2f039 14-Apr-2010 Nick Lewycky <nicholas@mxc.ca> Remove tab.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101223 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
0d82891b026c85fea97705267c40b6053590dcdd 14-Apr-2010 Nick Lewycky <nicholas@mxc.ca> While DAE can't modify the function signature of an externally visible function,
it can check whether the visible direct callers are passing in parameters to
dead arguments and replace those with undef.

This reinstates r94322 with bugs fixed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101213 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
5894c0b60ef75f382d64b268a5f1a0f2b0db840f 14-Apr-2010 Nick Lewycky <nicholas@mxc.ca> While DAE can't modify the function signature of an externally visible function,
it can check whether the visible direct callers are passing in parameters to
dead arguments and replace those with undef.

This reinstates r94322 with bugs fixed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101213 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
10c749c5af060222953ebc90643f11f7e9f950ce 10-Apr-2010 Chris Lattner <sabre@nondot.org> Implement support for varargs functions without any fixed
parameters in the CBE by implicitly adding a fixed argument.
This allows eliminating a work-around from DAE. Patch by
Sylvere Teissier!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100944 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
5106dcd078832ae20e285081a25bb79ec85eae6a 10-Apr-2010 Chris Lattner <sabre@nondot.org> Implement support for varargs functions without any fixed
parameters in the CBE by implicitly adding a fixed argument.
This allows eliminating a work-around from DAE. Patch by
Sylvere Teissier!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100944 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
5b2a8c1ce7c4e691b9505b996b9c3a6346ad87bb 10-Apr-2010 Chris Lattner <sabre@nondot.org> fix PR6760, a missing check in heap SRoA.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100936 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
a2fb234b04eb632fb23aff72e56fd3962aa56e65 10-Apr-2010 Chris Lattner <sabre@nondot.org> fix PR6760, a missing check in heap SRoA.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100936 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
f34e797c210a3ab07b9ba5045532ad977a618cd6 09-Apr-2010 Wesley Peck <peckw@wesleypeck.com> Adding IPSCCP and Internalize passes to the C-bindings

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100893 91177308-0d34-0410-b5e6-96231b3b80d8
PO.cpp
16ddd885d84beb57ac68e1503faa94cda279be4b 09-Apr-2010 Wesley Peck <peckw@wesleypeck.com> Adding IPSCCP and Internalize passes to the C-bindings

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100893 91177308-0d34-0410-b5e6-96231b3b80d8
PO.cpp
e4454320b3cfffe926a487c33fbeb454366de2f8 07-Apr-2010 Shih-wei Liao <sliao@google.com> libbcc

Change-Id: Ieaa3ebd5a38f370752495549f8870b534eeedfc5
rgumentPromotion.cpp
onstantMerge.cpp
eadArgumentElimination.cpp
eadTypeElimination.cpp
unctionAttrs.cpp
lobalOpt.cpp
nliner.cpp
tripSymbols.cpp
bfcfff3acc4e79edab494d6b6f6e988de28a9d65 07-Apr-2010 Gabor Greif <ggreif@gmail.com> fix 80-col violations

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100677 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
272369149209bad11f2b2f9020362f77fae60579 07-Apr-2010 Gabor Greif <ggreif@gmail.com> fix 80-col violations

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100677 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
1a79a93a1614980ca6c54a1197a9a0244bea1bbe 06-Apr-2010 Gabor Greif <ggreif@gmail.com> make more two predicates constant

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100549 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
6ce02b5939147784553c37d78e45a92dacee0037 06-Apr-2010 Gabor Greif <ggreif@gmail.com> make more two predicates constant

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100549 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
b58b72c10cb925253787f3b521bf7db9978e7e54 06-Apr-2010 Gabor Greif <ggreif@gmail.com> performance: get rid of repeated dereferencing of use_iterator by caching its result

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100547 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
a01d6db569c7def7c5d1727fa1abedfc160b688c 06-Apr-2010 Gabor Greif <ggreif@gmail.com> performance: get rid of repeated dereferencing of use_iterator by caching its result

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100547 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
2dedb5f23ae934c70d24e914b523a5779a9a4508 06-Apr-2010 Gabor Greif <ggreif@gmail.com> const-ize predicate ValueIsOnlyUsedLocallyOrStoredToOneGlobal

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100546 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
0b520db74d75da91dbbc96ae7c939c49f1bc222d 06-Apr-2010 Gabor Greif <ggreif@gmail.com> const-ize predicate ValueIsOnlyUsedLocallyOrStoredToOneGlobal

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100546 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
3be3ab75d6545698dc54d1197b8bd93ed4325add 06-Apr-2010 Gabor Greif <ggreif@gmail.com> use CallSite to access calls vs. invokes uniformly
and remove assumptions about operand order

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100544 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
fa1f5c22c5186d1055343aae74224a6637b831b2 06-Apr-2010 Gabor Greif <ggreif@gmail.com> use CallSite to access calls vs. invokes uniformly
and remove assumptions about operand order

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100544 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
d5ae7893e4129db33a05ec5b705489a297f08eb9 03-Apr-2010 Chris Lattner <sabre@nondot.org> don't internalize available_externally functions, they are
really just declarations. This is related to PR6524


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100269 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
8e9c48a606acd5894407f73453448bb0911648c7 03-Apr-2010 Chris Lattner <sabre@nondot.org> don't internalize available_externally functions, they are
really just declarations. This is related to PR6524


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100269 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
3ed470da2b05e027282e2f8c67b3739dad11745c 02-Apr-2010 Dan Gohman <gohman@apple.com> Revert the recent alignment changes. They're broken for -Os because,
in particular, they end up aligning strings at 16-byte boundaries, and
there's no way for GlobalOpt to check OptForSize.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100172 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
f860db2398b39ed4602b595b9b352fd3f9556107 02-Apr-2010 Dan Gohman <gohman@apple.com> Revert the recent alignment changes. They're broken for -Os because,
in particular, they end up aligning strings at 16-byte boundaries, and
there's no way for GlobalOpt to check OptForSize.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100172 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
c2873722e6025a93391e7d8460ec2be480b899a4 02-Apr-2010 Dan Gohman <gohman@apple.com> Make globalopt refine global variable alignment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100160 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
c9ae19e46520c1051b828171205b379b5a0bb6ad 02-Apr-2010 Dan Gohman <gohman@apple.com> Make globalopt refine global variable alignment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100160 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
0fbd0306b7f5e7d139def41ec3f1f9a8f6bc977a 01-Apr-2010 Gabor Greif <ggreif@gmail.com> Introduce ImmutableCallSite, useful for contexts where no mutation
is necessary. Inherits from new templated baseclass CallSiteBase<>
which is highly customizable. Base CallSite on it too, in a configuration
that allows full mutation.
Adapt some call sites in analyses to employ ImmutableCallSite.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100100 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
lobalOpt.cpp
c8b82ccbcf3b2e2384d2c0b5176e7b0b40b7f82f 01-Apr-2010 Gabor Greif <ggreif@gmail.com> Introduce ImmutableCallSite, useful for contexts where no mutation
is necessary. Inherits from new templated baseclass CallSiteBase<>
which is highly customizable. Base CallSite on it too, in a configuration
that allows full mutation.
Adapt some call sites in analyses to employ ImmutableCallSite.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100100 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
lobalOpt.cpp
a98cba265bbeae9b6740ca2a8f18c47253c94ca7 01-Apr-2010 Nick Lewycky <nicholas@mxc.ca> Clean up this file a little, no functionality change. This is a subset of my
patch back in r94322.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100097 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
2d7820cb782d6f2ee74b3c9e90438229324f84cd 01-Apr-2010 Nick Lewycky <nicholas@mxc.ca> Clean up this file a little, no functionality change. This is a subset of my
patch back in r94322.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100097 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
26d0f3ff37857fef3b3074a1321fa9cde40bb819 27-Mar-2010 Eric Christopher <echristo@apple.com> When we promote a load of an argument make sure to take the alignment
of the previous load - it's usually important. For example, we don't want
to blindly turn an unaligned load into an aligned one.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99699 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
6fde0bd39b1b431b7be30aaf9221ce6c60b0a5f0 27-Mar-2010 Eric Christopher <echristo@apple.com> When we promote a load of an argument make sure to take the alignment
of the previous load - it's usually important. For example, we don't want
to blindly turn an unaligned load into an aligned one.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99699 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
09452dca7da2e17525402bb7604bc5f4af3e321c 24-Mar-2010 Gabor Greif <ggreif@gmail.com> Finally land the InvokeInst operand reordering.
I have audited all getOperandNo calls now, fixing
hidden assumptions. CallSite related uglyness will
be eliminated successively.

Note this patch has a long and griveous history,
for all the back-and-forths have a look at
CallSite.h's log.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99399 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
runeEH.cpp
c9f7500d1752feac7cece26d20007a99d21f677c 24-Mar-2010 Gabor Greif <ggreif@gmail.com> Finally land the InvokeInst operand reordering.
I have audited all getOperandNo calls now, fixing
hidden assumptions. CallSite related uglyness will
be eliminated successively.

Note this patch has a long and griveous history,
for all the back-and-forths have a look at
CallSite.h's log.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99399 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
runeEH.cpp
fbfae158507c206713c978724f56719d53825bd3 24-Mar-2010 Gabor Greif <ggreif@gmail.com> tighten a type and remove trailing whitespace, no functional changes

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99398 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
6d6aaeca4f50e1ce101b71b33a52cbd66db01c52 24-Mar-2010 Gabor Greif <ggreif@gmail.com> tighten a type and remove trailing whitespace, no functional changes

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99398 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
af38b314ca242959d7e9edd66dac42bd8ef453dc 23-Mar-2010 Gabor Greif <ggreif@gmail.com> add assert in argpromotion, which cannot trigger
if Function::hasAddressTaken works as advertised

also included some cosmetic cleanups

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99276 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
0054c7a867f85f52fdcc11279d696160de92c9f8 23-Mar-2010 Gabor Greif <ggreif@gmail.com> add assert in argpromotion, which cannot trigger
if Function::hasAddressTaken works as advertised

also included some cosmetic cleanups

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99276 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
edd3c028c5f99b46ac784b7e28db76b4960bb998 22-Mar-2010 Gabor Greif <ggreif@gmail.com> backing out r99170 because it still fails on clang-x86_64-darwin10-fnt

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99171 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
runeEH.cpp
1cde4af15712f6ccdb81ab540df800cda90d0d74 22-Mar-2010 Gabor Greif <ggreif@gmail.com> backing out r99170 because it still fails on clang-x86_64-darwin10-fnt

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99171 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
runeEH.cpp
2dcf8b2fcc2729b376e28db29bbe32712d8745e8 22-Mar-2010 Gabor Greif <ggreif@gmail.com> Now that hopefully all direct accesses to InvokeInst operands are fixed
we can reapply the InvokeInst operand reordering patch. (see r98957).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99170 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
runeEH.cpp
9b1061e2e3c3a463aa251e2e6631d5e4313a7ac6 22-Mar-2010 Gabor Greif <ggreif@gmail.com> Now that hopefully all direct accesses to InvokeInst operands are fixed
we can reapply the InvokeInst operand reordering patch. (see r98957).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99170 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
runeEH.cpp
85c4cc2a1422d46cdf549871c79dd2eb789708da 20-Mar-2010 Gabor Greif <ggreif@gmail.com> Add a setCalledFunction member to InvokeInst (like in CallInst)
and use this (as well as getCalledValue) to access the callee,
instead of {g|s}etOperand(0).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99084 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
654c06f6457f80428e40810ad251c412462731e4 20-Mar-2010 Gabor Greif <ggreif@gmail.com> Add a setCalledFunction member to InvokeInst (like in CallInst)
and use this (as well as getCalledValue) to access the callee,
instead of {g|s}etOperand(0).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99084 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
e02ef8a6fcc83c39068e2baf33c7f55e4a5c9c20 19-Mar-2010 Gabor Greif <ggreif@gmail.com> back out r98957, it broke http://smooshlab.apple.com:8010/builders/clang-x86_64-darwin10-fnt/builds/703 in the nightly test suite

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98958 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
runeEH.cpp
cc52ed0c4feec63e7a127462b78fd4a6b217f469 19-Mar-2010 Gabor Greif <ggreif@gmail.com> back out r98957, it broke http://smooshlab.apple.com:8010/builders/clang-x86_64-darwin10-fnt/builds/703 in the nightly test suite

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98958 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
runeEH.cpp
de6c04c8aba7acc53865d4e09a6fd9ed0bacd6c2 19-Mar-2010 Gabor Greif <ggreif@gmail.com> Recommit r80858 again (which has been backed out in r80871).

This time I did a self-hosted bootstrap on Linux x86-64,
with no problems. Let's see how darwin 64-bit self-hosting
goes. At the first sign of failure I'll back this out.

Maybe the valgrind bots give me a hint of what may be wrong
(it at all).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98957 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
runeEH.cpp
f4f10e37791cef519a057d10d12f688333f554a7 19-Mar-2010 Gabor Greif <ggreif@gmail.com> Recommit r80858 again (which has been backed out in r80871).

This time I did a self-hosted bootstrap on Linux x86-64,
with no problems. Let's see how darwin 64-bit self-hosting
goes. At the first sign of failure I'll back this out.

Maybe the valgrind bots give me a hint of what may be wrong
(it at all).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98957 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
runeEH.cpp
2d11fe63b130745bf3c91cd55b643f4a3719016f 10-Mar-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Try to keep the cached inliner costs around for a bit longer for big functions.

The Caller cost info would be reset everytime a callee was inlined. If the
caller has lots of calls and there is some mutual recursion going on, the
caller cost info could be calculated many times.

This patch reduces inliner runtime from 240s to 0.5s for a function with 20000
small function calls.

This is a more conservative version of r98089 that doesn't break the clang
test CodeGenCXX/temp-order.cpp. That test relies on rather extreme inlining
for constant folding.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98099 91177308-0d34-0410-b5e6-96231b3b80d8
nlineAlways.cpp
nlineSimple.cpp
nliner.cpp
f7477470d37ee2ab9075eaee4745fa084d424ab8 10-Mar-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Try to keep the cached inliner costs around for a bit longer for big functions.

The Caller cost info would be reset everytime a callee was inlined. If the
caller has lots of calls and there is some mutual recursion going on, the
caller cost info could be calculated many times.

This patch reduces inliner runtime from 240s to 0.5s for a function with 20000
small function calls.

This is a more conservative version of r98089 that doesn't break the clang
test CodeGenCXX/temp-order.cpp. That test relies on rather extreme inlining
for constant folding.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98099 91177308-0d34-0410-b5e6-96231b3b80d8
nlineAlways.cpp
nlineSimple.cpp
nliner.cpp
8fcf1d5da18e76fd599964b610efab799b18257a 09-Mar-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Revert r98089, it was breaking a clang test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98094 91177308-0d34-0410-b5e6-96231b3b80d8
nlineAlways.cpp
nlineSimple.cpp
nliner.cpp
b5a158bab81b0b3f15d409fc433e706f8e885375 09-Mar-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Revert r98089, it was breaking a clang test.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98094 91177308-0d34-0410-b5e6-96231b3b80d8
nlineAlways.cpp
nlineSimple.cpp
nliner.cpp
b6c1eccaf3026398325efd7ccb7dbdeae543f281 09-Mar-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Try to keep the cached inliner costs around for a bit longer for big functions.

The Caller cost info would be reset everytime a callee was inlined. If the
caller has lots of calls and there is some mutual recursion going on, the
caller cost info could be calculated many times.

This patch reduces inliner runtime from 240s to 0.5s for a function with 20000
small function calls.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98089 91177308-0d34-0410-b5e6-96231b3b80d8
nlineAlways.cpp
nlineSimple.cpp
nliner.cpp
9e5d87d568498db251de19cd3c26d02cc74bb2e1 09-Mar-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Try to keep the cached inliner costs around for a bit longer for big functions.

The Caller cost info would be reset everytime a callee was inlined. If the
caller has lots of calls and there is some mutual recursion going on, the
caller cost info could be calculated many times.

This patch reduces inliner runtime from 240s to 0.5s for a function with 20000
small function calls.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98089 91177308-0d34-0410-b5e6-96231b3b80d8
nlineAlways.cpp
nlineSimple.cpp
nliner.cpp
64703d89c06b36ecb449d1cb106b6cf25117a42d 09-Mar-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Add inlining threshold to log output.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98024 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
2ddbf8208e0ee50cb1aeb24d509b52549a85c211 09-Mar-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Add inlining threshold to log output.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@98024 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
57c75f8fdbafc62fad3d941b696eefcd73f55511 27-Feb-2010 Chris Lattner <sabre@nondot.org> Fix rdar://7694996 a miscompile of 183.equake from my patch yesterday,
confusing the old MAT variable with the new GlobalType one. This caused
us to promote the @disp global pointer into:

@disp.body = internal global double*** undef

instead of:

@disp.body = internal global [3 x double**] undef




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97285 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
e9fd444dcd59f5b17bd30f919cb1b3a50519d3c1 27-Feb-2010 Chris Lattner <sabre@nondot.org> Fix rdar://7694996 a miscompile of 183.equake from my patch yesterday,
confusing the old MAT variable with the new GlobalType one. This caused
us to promote the @disp global pointer into:

@disp.body = internal global double*** undef

instead of:

@disp.body = internal global [3 x double**] undef




git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97285 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
7d91dc8a910b7a462f104b1951706e3771f5c6c1 27-Feb-2010 Chris Lattner <sabre@nondot.org> remove dead code, by this point all uses of CI are gone.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97283 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
c6a669b6e7fb13669abefa62c6ac4f871b84bb0b 27-Feb-2010 Chris Lattner <sabre@nondot.org> remove dead code, by this point all uses of CI are gone.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97283 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
9c75b33e8b8a9d268021eb4a8535f9ce450cd098 26-Feb-2010 Chris Lattner <sabre@nondot.org> fix PR6435 another bug from the MallocInst elimination work.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97231 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
3f5e0b8114e8f446b42d5102805494801af38ecb 26-Feb-2010 Chris Lattner <sabre@nondot.org> fix PR6435 another bug from the MallocInst elimination work.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97231 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
baf1dcf6ce3b674291691159b407133f97d75b9d 25-Feb-2010 Chris Lattner <sabre@nondot.org> rewrite OptimizeGlobalAddressOfMalloc to fix PR6422, some bugs
introduced when mallocinst was eliminated.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97178 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
a687465bae9ce793444fef37eb790ac7722f6bc7 25-Feb-2010 Chris Lattner <sabre@nondot.org> rewrite OptimizeGlobalAddressOfMalloc to fix PR6422, some bugs
introduced when mallocinst was eliminated.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97178 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
adcffdd4285149cef2e0b4f9fd273387ef3ca88b 25-Feb-2010 Nick Lewycky <nicholas@mxc.ca> Modernize comment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97121 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
e7ee59b6a4ec6c7a360a77aac044a546b0012c37 25-Feb-2010 Nick Lewycky <nicholas@mxc.ca> Modernize comment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97121 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
79314575b1059c25664c172488244d3fb105f244 25-Feb-2010 Nick Lewycky <nicholas@mxc.ca> Correct whitespace.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97120 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
813636a97bfb05955f507f77bd68c42ed101745f 25-Feb-2010 Nick Lewycky <nicholas@mxc.ca> Correct whitespace.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@97120 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
10343d91c52ddbfd7572032a95724f0c1ba10c7b 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
rgumentPromotion.cpp
eadArgumentElimination.cpp
unctionAttrs.cpp
lobalOpt.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
rgumentPromotion.cpp
eadArgumentElimination.cpp
unctionAttrs.cpp
lobalOpt.cpp
e92dee17fa016e12fa9fad042f3d19bf9322908b 15-Feb-2010 Duncan Sands <baldrick@free.fr> Uniformize the names of type predicates: rather than having isFloatTy and
isInteger, we now have isFloatTy and isIntegerTy. Requested by Chris!


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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96223 91177308-0d34-0410-b5e6-96231b3b80d8
eadTypeElimination.cpp
lobalOpt.cpp
78b1040a79c64d735bc77d02db22fa589b2f2b1e 13-Feb-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Enable the inlinehint attribute in the Inliner.

Functions explicitly marked inline will get an inlining threshold slightly
more aggressive than the default for -O3. This means than -O3 builds are
mostly unaffected while -Os builds will be a bit bigger and faster.

The difference depends entirely on how many 'inline's are sprinkled on the
source.

In the CINT2006 suite, only these tests are significantly affected under -Os:

Size Time
471.omnetpp +1.63% -1.85%
473.astar +4.01% -6.02%
483.xalancbmk +4.60% 0.00%

Note that 483.xalancbmk runs too quickly to give useful timing results.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96066 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
f0907fe59093753fe5a9e8fe5adc399dbdc94627 13-Feb-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Enable the inlinehint attribute in the Inliner.

Functions explicitly marked inline will get an inlining threshold slightly
more aggressive than the default for -O3. This means than -O3 builds are
mostly unaffected while -Os builds will be a bit bigger and faster.

The difference depends entirely on how many 'inline's are sprinkled on the
source.

In the CINT2006 suite, only these tests are significantly affected under -Os:

Size Time
471.omnetpp +1.63% -1.85%
473.astar +4.01% -6.02%
483.xalancbmk +4.60% 0.00%

Note that 483.xalancbmk runs too quickly to give useful timing results.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96066 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
93d4f3580e8a4bfd66d1b143d0271fc45a9d978c 12-Feb-2010 Chris Lattner <sabre@nondot.org> 1. modernize the constantmerge pass, using densemap/smallvector.
2. don't bother trying to merge globals in non-default sections,
doing so is quite dubious at best anyway.
3. fix a bug reported by Arnaud de Grandmaison where we'd try to
merge two globals in different address spaces.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95995 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
c3b6ffc431bbf01f615c6695a0dc1b9368102cad 12-Feb-2010 Chris Lattner <sabre@nondot.org> 1. modernize the constantmerge pass, using densemap/smallvector.
2. don't bother trying to merge globals in non-default sections,
doing so is quite dubious at best anyway.
3. fix a bug reported by Arnaud de Grandmaison where we'd try to
merge two globals in different address spaces.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95995 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
989853e4880cfbbe2eb3b08511fb00b1b61b005e 10-Feb-2010 Devang Patel <dpatel@apple.com> Strip new llvm.dbg.value intrinsic.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95807 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
df9292cbddfa634318e35ed58e9b8b9a464ee70f 10-Feb-2010 Devang Patel <dpatel@apple.com> Strip new llvm.dbg.value intrinsic.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95807 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
e264f62ca09a8f65c87a46d562a4d0f9ec5d457e 10-Feb-2010 Shih-wei Liao <sliao@google.com> Check in LLVM r95781.
rgumentPromotion.cpp
MakeLists.txt
onstantMerge.cpp
eadArgumentElimination.cpp
eadTypeElimination.cpp
xtractGV.cpp
unctionAttrs.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
PO.cpp
nlineAlways.cpp
nlineSimple.cpp
nliner.cpp
nternalize.cpp
oopExtractor.cpp
owerSetJmp.cpp
akefile
ergeFunctions.cpp
artialInlining.cpp
artialSpecialization.cpp
runeEH.cpp
tripDeadPrototypes.cpp
tripSymbols.cpp
tructRetPromotion.cpp
df1a7ffe7f19756ba874b3c07615d93ece611a1d 10-Feb-2010 Dan Gohman <gohman@apple.com> Fix "the the" and similar typos.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95781 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
artialInlining.cpp
f451cb870efcf9e0302d25ed05f4cac6bb494e42 10-Feb-2010 Dan Gohman <gohman@apple.com> Fix "the the" and similar typos.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95781 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
artialInlining.cpp
7718073fd2b0913241388a391b57589323f48a3b 06-Feb-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Reintroduce the InlineHint function attribute.

This time it's for real! I am going to hook this up in the frontends as well.

The inliner has some experimental heuristics for dealing with the inline hint.
When given a -respect-inlinehint option, functions marked with the inline
keyword are given a threshold just above the default for -O3.

We need some experiments to determine if that is the right thing to do.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95466 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
570a4a5d9ca31f276a67502d1e0533d59d331fea 06-Feb-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Reintroduce the InlineHint function attribute.

This time it's for real! I am going to hook this up in the frontends as well.

The inliner has some experimental heuristics for dealing with the inline hint.
When given a -respect-inlinehint option, functions marked with the inline
keyword are given a threshold just above the default for -O3.

We need some experiments to determine if that is the right thing to do.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95466 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
e94f5a297ec0b300e8e58cc5b54f1f9a202394a2 04-Feb-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Increase inliner thresholds by 25.

This makes the inliner about as agressive as it was before my changes to the
inliner cost calculations. These levels give the same performance and slightly
smaller code than before.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95320 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
f9c3b228e5579e0d2a9cd05a2191fe17b4c58b23 04-Feb-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Increase inliner thresholds by 25.

This makes the inliner about as agressive as it was before my changes to the
inliner cost calculations. These levels give the same performance and slightly
smaller code than before.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95320 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
a734c6cd2b9f463d7dd19d13905a1f10e34507a7 30-Jan-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Keep iterating over all uses when meeting a phi node in AllUsesOfValueWillTrapIfNull().

This bug was exposed by my inliner cost changes in r94615, and caused failures
of lencod on most architectures when building with LTO.

This patch fixes lencod and 464.h264ref on x86-64 (and likely others).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94858 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
b489d0f88a59cf620fad7a0a82037ad2cd3cad16 30-Jan-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Keep iterating over all uses when meeting a phi node in AllUsesOfValueWillTrapIfNull().

This bug was exposed by my inliner cost changes in r94615, and caused failures
of lencod on most architectures when building with LTO.

This patch fixes lencod and 464.h264ref on x86-64 (and likely others).

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94858 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
62de4e7b460f8ffbe0ee71a5a09503790102943f 27-Jan-2010 Jeffrey Yasskin <jyasskin@google.com> Kill ModuleProvider and ghost linkage by inverting the relationship between
Modules and ModuleProviders. Because the "ModuleProvider" simply materializes
GlobalValues now, and doesn't provide modules, it's renamed to
"GVMaterializer". Code that used to need a ModuleProvider to materialize
Functions can now materialize the Functions directly. Functions no longer use a
magic linkage to record that they're materializable; they simply ask the
GVMaterializer.

Because the C ABI must never change, we can't remove LLVMModuleProviderRef or
the functions that refer to it. Instead, because Module now exposes the same
functionality ModuleProvider used to, we store a Module* in any
LLVMModuleProviderRef and translate in the wrapper methods. The bindings to
other languages still use the ModuleProvider concept. It would probably be
worth some time to update them to follow the C++ more closely, but I don't
intend to do it.

Fixes http://llvm.org/PR5737 and http://llvm.org/PR5735.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94686 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
f0356fe140af1a30587b9a86bcfb1b2c51b8ce20 27-Jan-2010 Jeffrey Yasskin <jyasskin@google.com> Kill ModuleProvider and ghost linkage by inverting the relationship between
Modules and ModuleProviders. Because the "ModuleProvider" simply materializes
GlobalValues now, and doesn't provide modules, it's renamed to
"GVMaterializer". Code that used to need a ModuleProvider to materialize
Functions can now materialize the Functions directly. Functions no longer use a
magic linkage to record that they're materializable; they simply ask the
GVMaterializer.

Because the C ABI must never change, we can't remove LLVMModuleProviderRef or
the functions that refer to it. Instead, because Module now exposes the same
functionality ModuleProvider used to, we store a Module* in any
LLVMModuleProviderRef and translate in the wrapper methods. The bindings to
other languages still use the ModuleProvider concept. It would probably be
worth some time to update them to follow the C++ more closely, but I don't
intend to do it.

Fixes http://llvm.org/PR5737 and http://llvm.org/PR5735.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94686 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
e9a40677cd1fd95ed7e9b75a1df19449f432ad9e 24-Jan-2010 Chris Lattner <sabre@nondot.org> make -fno-rtti the default unless a directory builds with REQUIRES_RTTI.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94378 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
43b5f9312d56be400af031f7487a99b75b7b0f97 24-Jan-2010 Chris Lattner <sabre@nondot.org> make -fno-rtti the default unless a directory builds with REQUIRES_RTTI.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94378 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
a4f8f9d21039e6f49bebadbf7a86d0ee218dfac4 23-Jan-2010 Nick Lewycky <nicholas@mxc.ca> Speculatively revert r94322 to see if it fixes darwin selfhost buildbot.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94331 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
44540740aeafcae8c5d030000e7fd468f01d0da9 23-Jan-2010 Nick Lewycky <nicholas@mxc.ca> Speculatively revert r94322 to see if it fixes darwin selfhost buildbot.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94331 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
56739070eb19f5ed1bbad753e9ddc573ae3c8d37 23-Jan-2010 Nick Lewycky <nicholas@mxc.ca> Teach DAE that even though it can't modify the function signature of an
externally visible function, it can still find all callers of it and replace
the parameters to a dead argument with undef.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94322 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
dbeecede809c1bffb016e48674622c5e8cb75a0c 23-Jan-2010 Nick Lewycky <nicholas@mxc.ca> Teach DAE that even though it can't modify the function signature of an
externally visible function, it can still find all callers of it and replace
the parameters to a dead argument with undef.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94322 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
95ba416da66adde9fb7f33bd16d6978ecc54131e 22-Jan-2010 Benjamin Kramer <benny.kra@googlemail.com> Another strncmp -> StringRef.startswith simplification.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94203 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
b0706d1859549d7677b374c9d9e648ed01df06c9 22-Jan-2010 Benjamin Kramer <benny.kra@googlemail.com> Another strncmp -> StringRef.startswith simplification.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94203 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
5c804558fe5a69a7534b8a3bb7420ec1a483a1c8 22-Jan-2010 Chris Lattner <sabre@nondot.org> Stop building RTTI information for *most* llvm libraries. Notable
missing ones are libsupport, libsystem and libvmcore. libvmcore is
currently blocked on bugpoint, which uses EH. Once it stops using
EH, we can switch it off.

This #if 0's out 3 unit tests, because gtest requires RTTI information.
Suggestions welcome on how to fix this.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94164 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
e73a31f667ad2fe03e25c97ac45b58c30d7f07c3 22-Jan-2010 Chris Lattner <sabre@nondot.org> Stop building RTTI information for *most* llvm libraries. Notable
missing ones are libsupport, libsystem and libvmcore. libvmcore is
currently blocked on bugpoint, which uses EH. Once it stops using
EH, we can switch it off.

This #if 0's out 3 unit tests, because gtest requires RTTI information.
Suggestions welcome on how to fix this.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94164 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
a9f03562b0459b8592c148bc5daa57a313e160f8 20-Jan-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Move per-function inline threshold calculation to a method.

No functional change except the forgotten test for
InlineLimit.getNumOccurrences() == 0 in the CurrentThreshold2 calculation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94007 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
f8526cb711ec96cd2d5aff30da57f65ae8e5b7b8 20-Jan-2010 Jakob Stoklund Olesen <stoklund@2pi.dk> Move per-function inline threshold calculation to a method.

No functional change except the forgotten test for
InlineLimit.getNumOccurrences() == 0 in the CurrentThreshold2 calculation.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@94007 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
896bab920bbbe39fa5cc5dd852ce540f3aa89e6a 07-Jan-2010 Duncan Sands <baldrick@free.fr> Be less stingy as to how many selects and phi nodes we
are prepared to look through.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92898 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
5d8ea117a07b53c4bbabbc6912e3c54b50e1a51c 07-Jan-2010 Duncan Sands <baldrick@free.fr> Be less stingy as to how many selects and phi nodes we
are prepared to look through.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92898 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
003b65f67c10bdf648ee64bc4ed5ccb6c5dc8345 07-Jan-2010 Chris Lattner <sabre@nondot.org> handle ConstantVector while I'm in here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92892 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
4039bd055086ec741132afe32f1ab7fdf5ebd710 07-Jan-2010 Chris Lattner <sabre@nondot.org> handle ConstantVector while I'm in here.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92892 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
e07d77d2742143385c0ade8a2ea048c207110c32 07-Jan-2010 Chris Lattner <sabre@nondot.org> fix a globalopt crash on 'bullet' (handling evaluation of a store
to an element of a vector in a static ctor) which occurs with an
unrelated patch I'm testing. Annoyingly, EvaluateStoreInto basically
does exactly the same stuff as InsertElement constant folding, but it
now handles vectors, and you can't insertelement into a vector. It
would be 'really nice' if GEP into a vector were not legal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92889 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
a0e9a2475cd6e45966a591de8e0740a102fe0dfe 07-Jan-2010 Chris Lattner <sabre@nondot.org> fix a globalopt crash on 'bullet' (handling evaluation of a store
to an element of a vector in a static ctor) which occurs with an
unrelated patch I'm testing. Annoyingly, EvaluateStoreInto basically
does exactly the same stuff as InsertElement constant folding, but it
now handles vectors, and you can't insertelement into a vector. It
would be 'really nice' if GEP into a vector were not legal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92889 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
78242aed35d1d1fc96d2fbd44d4a0d625b9113ab 06-Jan-2010 Duncan Sands <baldrick@free.fr> Fix a README item: have functionattrs look through selects and
phi nodes when deciding which pointers point to local memory.
I actually checked long ago how useful this is, and it isn't
very: it hardly ever fires in the testsuite, but since Chris
wants it here it is!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92836 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
e10920d678c4d6046619e51770de1c9de0c3fe0a 06-Jan-2010 Duncan Sands <baldrick@free.fr> Fix a README item: have functionattrs look through selects and
phi nodes when deciding which pointers point to local memory.
I actually checked long ago how useful this is, and it isn't
very: it hardly ever fires in the testsuite, but since Chris
wants it here it is!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92836 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
f68032c88a8d62573427a88e42e55a9fb72711e1 06-Jan-2010 Duncan Sands <baldrick@free.fr> Partially address a README by having functionattrs consider calls to
memcpy, memset and other intrinsics that only access their arguments
to be readnone if the intrinsic's arguments all point to local memory.
This improves the testcase in the README to readonly, but it could in
theory be made readnone, however this would involve more sophisticated
analysis that looks through the memcpy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92829 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
7c422ac216fe39fc9c402a704cf296cca9dc5b22 06-Jan-2010 Duncan Sands <baldrick@free.fr> Partially address a README by having functionattrs consider calls to
memcpy, memset and other intrinsics that only access their arguments
to be readnone if the intrinsic's arguments all point to local memory.
This improves the testcase in the README to readonly, but it could in
theory be made readnone, however this would involve more sophisticated
analysis that looks through the memcpy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92829 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
f0e83d2fd7d71ba3f18fffdb36cf9b70dc1f8490 05-Jan-2010 Benjamin Kramer <benny.kra@googlemail.com> Move remaining stuff to the isInteger predicate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92771 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
8c65f6e71c1d46d823b9a884819992a9255edd54 05-Jan-2010 Benjamin Kramer <benny.kra@googlemail.com> Move remaining stuff to the isInteger predicate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92771 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
f416493006249d2f31afa4e9877e08707edcc2c6 05-Jan-2010 Dan Gohman <gohman@apple.com> Fix indentation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92733 91177308-0d34-0410-b5e6-96231b3b80d8
artialInlining.cpp
b7a9f2b5042589db89e521a4f86fd2fd70845e0f 05-Jan-2010 Dan Gohman <gohman@apple.com> Fix indentation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92733 91177308-0d34-0410-b5e6-96231b3b80d8
artialInlining.cpp
f2052d5e0eb5028a06f41d2cebb8e22b6876ebc0 05-Jan-2010 Benjamin Kramer <benny.kra@googlemail.com> Avoid going through the LLVMContext for type equality where it's safe to dereference the type pointer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92726 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
ergeFunctions.cpp
tructRetPromotion.cpp
f012705c7e4ca8cf90b6b734ce1d5355daca5ba5 05-Jan-2010 Benjamin Kramer <benny.kra@googlemail.com> Avoid going through the LLVMContext for type equality where it's safe to dereference the type pointer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92726 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
ergeFunctions.cpp
tructRetPromotion.cpp
8b783879ec9d1113432a1ff2d56c1f77176cee95 05-Jan-2010 David Greene <greened@obbligato.org> Change errs() to dbgs().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92639 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
5ededf7d42417379d230c92fc73912ebb650ede9 05-Jan-2010 David Greene <greened@obbligato.org> Change errs() to dbgs().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92639 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
22dd47e5d6c689c6e041990cfaf39671f76d8c6d 05-Jan-2010 David Greene <greened@obbligato.org> Change errs() to dbgs().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92636 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
3307e951886d48f7786234256feea3a931d41c72 05-Jan-2010 David Greene <greened@obbligato.org> Change errs() to dbgs().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92636 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
54723f4e6bcfa7358f1d51425292b23c316258f6 05-Jan-2010 David Greene <greened@obbligato.org> Change errs() to dbgs().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92633 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
3a078b520808d9c09b330617bd98c436ad8caff1 05-Jan-2010 David Greene <greened@obbligato.org> Change errs() to dbgs().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92633 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
bf1f0f1a93a848dd6a5a8c89fde8ddc36c61390c 05-Jan-2010 David Greene <greened@obbligato.org> Change errs() to dbgs().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92631 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
fd2ab9ff4466cb2e07be536fc838d3520a0f8aa5 05-Jan-2010 David Greene <greened@obbligato.org> Change errs() to dbgs().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92631 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
f26def4258366d4b67cd723e3e41f279208ff1e4 05-Jan-2010 David Greene <greened@obbligato.org> Change errs() to dbgs().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92629 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
3215b0ee8248ca1e4bc2c7e2f5fd3ce120c3ee45 05-Jan-2010 David Greene <greened@obbligato.org> Change errs() to dbgs().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92629 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
0cedd0c1fa675acabdda3e390d9f874d96a5436c 05-Jan-2010 David Greene <greened@obbligato.org> Change errs() to dbgs().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92627 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
09d70db3ed5a5b8461a4503d89cc44a3c6614548 05-Jan-2010 David Greene <greened@obbligato.org> Change errs() to dbgs().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92627 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
07cac01a4c3a692d1f7b1b9f2e49ec6c21323beb 05-Jan-2010 David Greene <greened@obbligato.org> Change errs() to dbgs().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92625 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
c0aa67950ae0f6e9611240d8f0e3ac49dc8195c0 05-Jan-2010 David Greene <greened@obbligato.org> Change errs() to dbgs().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92625 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
a0d451f0c3b152920c0bc50ab6c5fb6b9eef89b4 29-Dec-2009 Chris Lattner <sabre@nondot.org> Final step in the metadata API restructuring: move the
getMDKindID/getMDKindNames methods to LLVMContext (and add
convenience methods to Module), eliminating MetadataContext.
Move the state that it maintains out to LLVMContext.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92259 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
081134741b40b342fb2f85722c9cea5d412489a8 29-Dec-2009 Chris Lattner <sabre@nondot.org> Final step in the metadata API restructuring: move the
getMDKindID/getMDKindNames methods to LLVMContext (and add
convenience methods to Module), eliminating MetadataContext.
Move the state that it maintains out to LLVMContext.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92259 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
dcf0657604692cafafdd6ff729087344271c2ace 29-Dec-2009 Chris Lattner <sabre@nondot.org> This is a major cleanup of the instruction metadata interfaces that
I asked Devang to do back on Sep 27. Instead of going through the
MetadataContext class with methods like getMD() and getMDs(), just
ask the instruction directly for its metadata with getMetadata()
and getAllMetadata().

This includes a variety of other fixes and improvements: previously
all Value*'s were bloated because the HasMetadata bit was thrown into
value, adding a 9th bit to a byte. Now this is properly sunk down to
the Instruction class (the only place where it makes sense) and it
will be folded away somewhere soon.

This also fixes some confusion in getMDs and its clients about
whether the returned list is indexed by the MDID or densely packed.
This is now returned sorted and densely packed and the comments make
this clear.

This introduces a number of fixme's which I'll follow up on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92235 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
3990b121cf4a0b280ed3e54cf13870cbf4259e78 29-Dec-2009 Chris Lattner <sabre@nondot.org> This is a major cleanup of the instruction metadata interfaces that
I asked Devang to do back on Sep 27. Instead of going through the
MetadataContext class with methods like getMD() and getMDs(), just
ask the instruction directly for its metadata with getMetadata()
and getAllMetadata().

This includes a variety of other fixes and improvements: previously
all Value*'s were bloated because the HasMetadata bit was thrown into
value, adding a 9th bit to a byte. Now this is properly sunk down to
the Instruction class (the only place where it makes sense) and it
will be folded away somewhere soon.

This also fixes some confusion in getMDs and its clients about
whether the returned list is indexed by the MDID or densely packed.
This is now returned sorted and densely packed and the comments make
this clear.

This introduces a number of fixme's which I'll follow up on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92235 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
9741b1d2ca9e6fca4cb6ffa33022eb35c446cd8e 28-Dec-2009 Chris Lattner <sabre@nondot.org> rename getMDKind -> getMDKindID, make it autoinsert if an MD Kind
doesn't exist already, eliminate registerMDKind. Tidy up a bunch
of random stuff.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92225 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
0eb419800ae51d6e0e00a656ede0627483755361 28-Dec-2009 Chris Lattner <sabre@nondot.org> rename getMDKind -> getMDKindID, make it autoinsert if an MD Kind
doesn't exist already, eliminate registerMDKind. Tidy up a bunch
of random stuff.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@92225 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
35138e397b334bffa8f1c9121fa97f9129880d09 08-Dec-2009 Duncan Sands <baldrick@free.fr> Teach GlobalOpt to delete aliases with internal linkage (after
forwarding any uses). GlobalDCE can also do this, but is only
run at -O3.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90850 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
7a154cf22830857bc184566102abd8a2ada8df94 08-Dec-2009 Duncan Sands <baldrick@free.fr> Teach GlobalOpt to delete aliases with internal linkage (after
forwarding any uses). GlobalDCE can also do this, but is only
run at -O3.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@90850 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
4f77c3e8551139a6bf4b6460794a9ef6b312ef52 23-Nov-2009 Dan Gohman <gohman@apple.com> Make ConstantFoldConstantExpression recursively visit the entire
ConstantExpr, not just the top-level operator. This allows it to
fold many more constants.

Also, make GlobalOpt call ConstantFoldConstantExpression on
GlobalVariable initializers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89659 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
01b97dd01eec1197d79fceb7229f5ec233994de3 23-Nov-2009 Dan Gohman <gohman@apple.com> Make ConstantFoldConstantExpression recursively visit the entire
ConstantExpr, not just the top-level operator. This allows it to
fold many more constants.

Also, make GlobalOpt call ConstantFoldConstantExpression on
GlobalVariable initializers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89659 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
6e8bc9ccd4e6d8c9a7f6e4f4ae1a664abcb076a5 23-Nov-2009 Nick Lewycky <nicholas@mxc.ca> Remove unused LLVMContext.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89642 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
ae3d802953b5209e7e9530cd5b5d4e457a6974dc 23-Nov-2009 Nick Lewycky <nicholas@mxc.ca> Remove unused LLVMContext.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89642 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
c4f555a862e61afbb08604327f70ced9f9e6b934 19-Nov-2009 Dan Gohman <gohman@apple.com> Extend CaptureTracking to indicate when a value is never stored, even
if it is not ultimately captured. Teach BasicAliasAnalysis that a
local object address which does not escape and is never stored does
not alias with a value resulting from a load.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89398 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
f94b5edc452c32d9ae258e7de30c33391fda6cc9 19-Nov-2009 Dan Gohman <gohman@apple.com> Extend CaptureTracking to indicate when a value is never stored, even
if it is not ultimately captured. Teach BasicAliasAnalysis that a
local object address which does not escape and is never stored does
not alias with a value resulting from a load.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89398 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
dadd6cd96d573649490516c5840139af923d9176 17-Nov-2009 Devang Patel <dpatel@apple.com> Remove debug info attached with an instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89016 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
76e3e50b8a2c72598b7ee586dd383bb63a236682 17-Nov-2009 Devang Patel <dpatel@apple.com> Remove debug info attached with an instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89016 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
17909ebface5a88cea9259ab16689ea4baf7464a 12-Nov-2009 Chris Lattner <sabre@nondot.org> use isInstructionTriviallyDead, as pointed out by Duncan


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87035 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
4ff4141a9ee9ce705f2a709f3372acaf58d86ea3 12-Nov-2009 Chris Lattner <sabre@nondot.org> use isInstructionTriviallyDead, as pointed out by Duncan


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@87035 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
83cd6cbb1c6ad22198d156c6d43b1158eeca4ee8 12-Nov-2009 Chris Lattner <sabre@nondot.org> implement a nice little efficiency hack in the inliner. Since we're now
running IPSCCP early, and we run functionattrs interlaced with the inliner,
we often (particularly for small or noop functions) completely propagate
all of the information about a call to its call site in IPSSCP (making a call
dead) and functionattrs is smart enough to realize that the function is
readonly (because it is interlaced with inliner).

To improve compile time and make the inliner threshold more accurate, realize
that we don't have to inline dead readonly function calls. Instead, just
delete the call. This happens all the time for C++ codes, here are some
counters from opt/llvm-ld counting the number of times calls were deleted vs
inlined on various apps:

Tramp3d opt:
5033 inline - Number of call sites deleted, not inlined
24596 inline - Number of functions inlined
llvm-ld:
667 inline - Number of functions deleted because all callers found
699 inline - Number of functions inlined

483.xalancbmk opt:
8096 inline - Number of call sites deleted, not inlined
62528 inline - Number of functions inlined
llvm-ld:
217 inline - Number of allocas merged together
2158 inline - Number of functions inlined

471.omnetpp:
331 inline - Number of call sites deleted, not inlined
8981 inline - Number of functions inlined
llvm-ld:
171 inline - Number of functions deleted because all callers found
629 inline - Number of functions inlined


Deleting a call is much faster than inlining it, and is insensitive to the
size of the callee. :)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86975 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
dbab4dc942e0c3286415908762de71a9447f9dfa 12-Nov-2009 Chris Lattner <sabre@nondot.org> implement a nice little efficiency hack in the inliner. Since we're now
running IPSCCP early, and we run functionattrs interlaced with the inliner,
we often (particularly for small or noop functions) completely propagate
all of the information about a call to its call site in IPSSCP (making a call
dead) and functionattrs is smart enough to realize that the function is
readonly (because it is interlaced with inliner).

To improve compile time and make the inliner threshold more accurate, realize
that we don't have to inline dead readonly function calls. Instead, just
delete the call. This happens all the time for C++ codes, here are some
counters from opt/llvm-ld counting the number of times calls were deleted vs
inlined on various apps:

Tramp3d opt:
5033 inline - Number of call sites deleted, not inlined
24596 inline - Number of functions inlined
llvm-ld:
667 inline - Number of functions deleted because all callers found
699 inline - Number of functions inlined

483.xalancbmk opt:
8096 inline - Number of call sites deleted, not inlined
62528 inline - Number of functions inlined
llvm-ld:
217 inline - Number of allocas merged together
2158 inline - Number of functions inlined

471.omnetpp:
331 inline - Number of call sites deleted, not inlined
8981 inline - Number of functions inlined
llvm-ld:
171 inline - Number of functions deleted because all callers found
629 inline - Number of functions inlined


Deleting a call is much faster than inlining it, and is insensitive to the
size of the callee. :)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86975 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
43af76a34cd64afcaf7579be626b0309a6f1cc0d 10-Nov-2009 Victor Hernandez <vhernandez@apple.com> Update computeArraySize() to use ComputeMultiple() to determine the array size associated with a malloc; also extend PerformHeapAllocSRoA() to check if the optimized malloc's arg had its highest bit set, so that it is safe for ComputeMultiple() to look through sext instructions while determining the optimized malloc's array size

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86676 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
8e345a1c418608c49abb7c51a090bbb36f1273bc 10-Nov-2009 Victor Hernandez <vhernandez@apple.com> Update computeArraySize() to use ComputeMultiple() to determine the array size associated with a malloc; also extend PerformHeapAllocSRoA() to check if the optimized malloc's arg had its highest bit set, so that it is safe for ComputeMultiple() to look through sext instructions while determining the optimized malloc's array size

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86676 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
f1e1f4c9a3c02d44a9ea7f82c986794318b20415 07-Nov-2009 Victor Hernandez <vhernandez@apple.com> - new SROA mallocs should have the mallocs running-or'ed, not the malloc's bitcast
- fix ProcessInternalGlobal() debug output



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86317 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
631f3c0dfdf21b0702fcd9baa4ce79ec9ab360dc 07-Nov-2009 Victor Hernandez <vhernandez@apple.com> - new SROA mallocs should have the mallocs running-or'ed, not the malloc's bitcast
- fix ProcessInternalGlobal() debug output



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86317 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
955449e468395f33a2debd72e3e6f8f5a1dc1b46 07-Nov-2009 Victor Hernandez <vhernandez@apple.com> Re-commit r86077 now that r86290 fixes the 179.art and 175.vpr ARM regressions.

Here is the original commit message:

This commit updates malloc optimizations to operate on malloc calls that have constant int size arguments.

Update CreateMalloc so that its callers specify the size to allocate:
MallocInst-autoupgrade users use non-TargetData-computed allocation sizes.
Optimization uses use TargetData to compute the allocation size.

Now that malloc calls can have constant sizes, update isArrayMallocHelper() to use TargetData to determine the size of the malloced type and the size of malloced arrays.
Extend getMallocType() to support malloc calls that have non-bitcast uses.

Update OptimizeGlobalAddressOfMalloc() to optimize malloc calls that have non-bitcast uses. The bitcast use of a malloc call has to be treated specially here because the uses of the bitcast need to be replaced and the bitcast needs to be erased (just like the malloc call) for OptimizeGlobalAddressOfMalloc() to work correctly.

Update PerformHeapAllocSRoA() to optimize malloc calls that have non-bitcast uses. The bitcast use of the malloc is not handled specially here because ReplaceUsesOfMallocWithGlobal replaces through the bitcast use.

Update OptimizeOnceStoredGlobal() to not care about the malloc calls' bitcast use.

Update all globalopt malloc tests to not rely on autoupgraded-MallocInsts, but instead use explicit malloc calls with correct allocation sizes.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86311 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
9d0b704e3ea418441001dac4d1a56c2c224cdbf5 07-Nov-2009 Victor Hernandez <vhernandez@apple.com> Re-commit r86077 now that r86290 fixes the 179.art and 175.vpr ARM regressions.

Here is the original commit message:

This commit updates malloc optimizations to operate on malloc calls that have constant int size arguments.

Update CreateMalloc so that its callers specify the size to allocate:
MallocInst-autoupgrade users use non-TargetData-computed allocation sizes.
Optimization uses use TargetData to compute the allocation size.

Now that malloc calls can have constant sizes, update isArrayMallocHelper() to use TargetData to determine the size of the malloced type and the size of malloced arrays.
Extend getMallocType() to support malloc calls that have non-bitcast uses.

Update OptimizeGlobalAddressOfMalloc() to optimize malloc calls that have non-bitcast uses. The bitcast use of a malloc call has to be treated specially here because the uses of the bitcast need to be replaced and the bitcast needs to be erased (just like the malloc call) for OptimizeGlobalAddressOfMalloc() to work correctly.

Update PerformHeapAllocSRoA() to optimize malloc calls that have non-bitcast uses. The bitcast use of the malloc is not handled specially here because ReplaceUsesOfMallocWithGlobal replaces through the bitcast use.

Update OptimizeOnceStoredGlobal() to not care about the malloc calls' bitcast use.

Update all globalopt malloc tests to not rely on autoupgraded-MallocInsts, but instead use explicit malloc calls with correct allocation sizes.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86311 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
6070c017ba421c2862fc0c25d9770169e858c7e3 06-Nov-2009 Chris Lattner <sabre@nondot.org> remove a bunch of extraneous LLVMContext arguments
from various APIs, addressing PR5325.


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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86231 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
2243fcd787afdb7b7f59f388778ba99d57b6a468 06-Nov-2009 Victor Hernandez <vhernandez@apple.com> Revert r86077 because it caused crashes in 179.art and 175.vpr on ARM

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86213 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
df98761d08ae091420b7e9c1366de7684400fc36 06-Nov-2009 Victor Hernandez <vhernandez@apple.com> Revert r86077 because it caused crashes in 179.art and 175.vpr on ARM

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86213 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
aef6c7a849c4e8bdd07c017aef2dcfb8c019e287 05-Nov-2009 Dan Gohman <gohman@apple.com> Update various Loop optimization passes to cope with the possibility that
LoopSimplify form may not be available.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86175 91177308-0d34-0410-b5e6-96231b3b80d8
oopExtractor.cpp
03e896bd6073efc4523d8bcd0239d6ed62126db7 05-Nov-2009 Dan Gohman <gohman@apple.com> Update various Loop optimization passes to cope with the possibility that
LoopSimplify form may not be available.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86175 91177308-0d34-0410-b5e6-96231b3b80d8
oopExtractor.cpp
e67ebab906b981bb9534cd7c68fda75cb5ff57c9 05-Nov-2009 Victor Hernandez <vhernandez@apple.com> Update CreateMalloc so that its callers specify the size to allocate:
MallocInst-autoupgrade users use non-TargetData-computed allocation sizes.
Optimization uses use TargetData to compute the allocation size.

Now that malloc calls can have constant sizes, update isArrayMallocHelper() to use TargetData to determine the size of the malloced type and the size of malloced arrays.
Extend getMallocType() to support malloc calls that have non-bitcast uses.

Update OptimizeGlobalAddressOfMalloc() to optimize malloc calls that have non-bitcast uses. The bitcast use of a malloc call has to be treated specially here because the uses of the bitcast need to be replaced and the bitcast needs to be erased (just like the malloc call) for OptimizeGlobalAddressOfMalloc() to work correctly.

Update PerformHeapAllocSRoA() to optimize malloc calls that have non-bitcast uses. The bitcast use of the malloc is not handled specially here because ReplaceUsesOfMallocWithGlobal replaces through the bitcast use.

Update OptimizeOnceStoredGlobal() to not care about the malloc calls' bitcast use.

Update all globalopt malloc tests to not rely on autoupgraded-MallocInsts, but instead use explicit malloc calls with correct allocation sizes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86077 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
24f934d0551e33508c4ffd24318ea0e970db9810 05-Nov-2009 Victor Hernandez <vhernandez@apple.com> Update CreateMalloc so that its callers specify the size to allocate:
MallocInst-autoupgrade users use non-TargetData-computed allocation sizes.
Optimization uses use TargetData to compute the allocation size.

Now that malloc calls can have constant sizes, update isArrayMallocHelper() to use TargetData to determine the size of the malloced type and the size of malloced arrays.
Extend getMallocType() to support malloc calls that have non-bitcast uses.

Update OptimizeGlobalAddressOfMalloc() to optimize malloc calls that have non-bitcast uses. The bitcast use of a malloc call has to be treated specially here because the uses of the bitcast need to be replaced and the bitcast needs to be erased (just like the malloc call) for OptimizeGlobalAddressOfMalloc() to work correctly.

Update PerformHeapAllocSRoA() to optimize malloc calls that have non-bitcast uses. The bitcast use of the malloc is not handled specially here because ReplaceUsesOfMallocWithGlobal replaces through the bitcast use.

Update OptimizeOnceStoredGlobal() to not care about the malloc calls' bitcast use.

Update all globalopt malloc tests to not rely on autoupgraded-MallocInsts, but instead use explicit malloc calls with correct allocation sizes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86077 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
1e96e727b2b74ae92c8d3ed6c1c786aca6f513f5 03-Nov-2009 Benjamin Kramer <benny.kra@googlemail.com> Eliminate some temporaries.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85896 91177308-0d34-0410-b5e6-96231b3b80d8
owerSetJmp.cpp
419e44edab26ae227fbc3b06db29243065d2845e 03-Nov-2009 Benjamin Kramer <benny.kra@googlemail.com> Eliminate some temporaries.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85896 91177308-0d34-0410-b5e6-96231b3b80d8
owerSetJmp.cpp
3f2e8ec4afbba963c09dd4856258dd5cabf59112 01-Nov-2009 Chris Lattner <sabre@nondot.org> cleanups, switch GlobalDCE to SmallPtrSet instead of std::set


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85730 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
lobalOpt.cpp
ec4c7b976645cc49ccfe8dc1c3bfc31ec5fedc62 01-Nov-2009 Chris Lattner <sabre@nondot.org> cleanups, switch GlobalDCE to SmallPtrSet instead of std::set


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85730 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
lobalOpt.cpp
67127294f701ddec34ccb7a5dc324817be4645e7 01-Nov-2009 Douglas Gregor <doug.gregor@gmail.com> Reverting 85714, 85715, 85716, which are breaking the build

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85717 91177308-0d34-0410-b5e6-96231b3b80d8
PO.cpp
076124ef26ff67f88663bd11f3b4d6b3d3bb3a9d 01-Nov-2009 Douglas Gregor <dgregor@apple.com> Reverting 85714, 85715, 85716, which are breaking the build

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85717 91177308-0d34-0410-b5e6-96231b3b80d8
PO.cpp
e7f59f3af13b5fdee43de653d00598ca5a53bff6 01-Nov-2009 Dan Gohman <gohman@apple.com> Remove the #include of Pass.h from PassManager.h. This breaks a significant
#include dependency, as frontends commonly pull in PassManager.h.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85714 91177308-0d34-0410-b5e6-96231b3b80d8
PO.cpp
b2fae7560dcac617d40a83c73c976d4045bfb97f 01-Nov-2009 Dan Gohman <gohman@apple.com> Remove the #include of Pass.h from PassManager.h. This breaks a significant
#include dependency, as frontends commonly pull in PassManager.h.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85714 91177308-0d34-0410-b5e6-96231b3b80d8
PO.cpp
2f4875062faa6cad24c7ada735dba0877b5da634 01-Nov-2009 Chris Lattner <sabre@nondot.org> teach ipsccp and ipconstprop that a blockaddress doesn't 'take the address' of a function
in a way that should prevent ip constprop. This allows clang/test/CodeGen/indirect-goto.c
to pass with the new indirect goto lowering.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85709 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
b2710041fbed34ae888a6fed4172aea92bced1b5 01-Nov-2009 Chris Lattner <sabre@nondot.org> teach ipsccp and ipconstprop that a blockaddress doesn't 'take the address' of a function
in a way that should prevent ip constprop. This allows clang/test/CodeGen/indirect-goto.c
to pass with the new indirect goto lowering.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85709 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
620cead9d0a40e874503c5605952c40186d585f0 01-Nov-2009 Chris Lattner <sabre@nondot.org> Revert 85678/85680. The decision is to stay with the current form of
indirectbr, thus we don't need "blockaddr(@func, null)". Eliminate it
for simplicity.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85699 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
cdfc940912d56a63b6f12eaa7f3faf79cf74c693 01-Nov-2009 Chris Lattner <sabre@nondot.org> Revert 85678/85680. The decision is to stay with the current form of
indirectbr, thus we don't need "blockaddr(@func, null)". Eliminate it
for simplicity.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85699 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
4200f2c815159e939351d5d447f7f68fb557e600 31-Oct-2009 Chris Lattner <sabre@nondot.org> adjust a couple xforms to work with null bb's in BlockAddress.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85680 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
c1dc35094e3ffcb4b3a765f0f786b8a2948bc321 31-Oct-2009 Chris Lattner <sabre@nondot.org> adjust a couple xforms to work with null bb's in BlockAddress.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85680 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
4f2bbd66a9e049f60c8187a201f18d0df80c2e12 29-Oct-2009 Chris Lattner <sabre@nondot.org> just for the hell of it, allow globalopt to statically evaluate
static constructors with indirect gotos :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85495 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
b3d5a65d94ca017570fe86578423186c6a2f642e 29-Oct-2009 Chris Lattner <sabre@nondot.org> just for the hell of it, allow globalopt to statically evaluate
static constructors with indirect gotos :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85495 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
ff1a8e5764e4f6a8c471e432a400858e849923b2 29-Oct-2009 Chris Lattner <sabre@nondot.org> teach various passes about blockaddress. We no longer
crash on any clang tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85465 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
4c0236fd8b94f9721bac8a66c3220e797310c593 29-Oct-2009 Chris Lattner <sabre@nondot.org> teach various passes about blockaddress. We no longer
crash on any clang tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85465 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
9d632b6c0cc62539b5316a2861f247515d9c43a1 28-Oct-2009 Victor Hernandez <vhernandez@apple.com> Extend getMallocArraySize() to determine the array size if the malloc argument is:
ArraySize * ElementSize
ElementSize * ArraySize
ArraySize << log2(ElementSize)
ElementSize << log2(ArraySize)

Refactor isArrayMallocHelper and delete isSafeToGetMallocArraySize, so that there is only 1 copy of the malloc array determining logic.
Update users of getMallocArraySize() to not bother calling isArrayMalloc() as well.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85421 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
90f48e7c91a8faa875ba889ca66b137ffd46e34a 28-Oct-2009 Victor Hernandez <vhernandez@apple.com> Extend getMallocArraySize() to determine the array size if the malloc argument is:
ArraySize * ElementSize
ElementSize * ArraySize
ArraySize << log2(ElementSize)
ElementSize << log2(ArraySize)

Refactor isArrayMallocHelper and delete isSafeToGetMallocArraySize, so that there is only 1 copy of the malloc array determining logic.
Update users of getMallocArraySize() to not bother calling isArrayMalloc() as well.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85421 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
d8c44710c05973817296df4b1800105768d7c2d1 28-Oct-2009 Devang Patel <dpatel@apple.com> llvm.dbg.global_variables do not exist anymore.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85402 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
cd0fee86deaa91bfd3f321d5d3fa695fab7e663e 28-Oct-2009 Devang Patel <dpatel@apple.com> llvm.dbg.global_variables do not exist anymore.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85402 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
67abb53946800619c549c67053d6f344d664ff27 28-Oct-2009 Chris Lattner <sabre@nondot.org> Previously, all operands to Constant were themselves constant.
In the new world order, BlockAddress can have a BasicBlock operand.
This doesn't permute much, because if you have a ConstantExpr (or
anything more specific than Constant) we still know the operand has
to be a Constant.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85375 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
0eeb913aa17a68b1f2963b02ca1d68f09dba0b78 28-Oct-2009 Chris Lattner <sabre@nondot.org> Previously, all operands to Constant were themselves constant.
In the new world order, BlockAddress can have a BasicBlock operand.
This doesn't permute much, because if you have a ConstantExpr (or
anything more specific than Constant) we still know the operand has
to be a Constant.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85375 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
28f4d2fb94b9057d8daba2128867fde276a37d1b 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
unctionAttrs.cpp
lobalOpt.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
unctionAttrs.cpp
lobalOpt.cpp
43a4c67a86782f5f6ad5d80dbbf29ff23f3faa08 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
unctionAttrs.cpp
lobalOpt.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
unctionAttrs.cpp
lobalOpt.cpp
5a44ef9fd5f7c3964ad79b94778261175dea5c33 25-Oct-2009 Nick Lewycky <nicholas@mxc.ca> Remove includes of Support/Compiler.h that are no longer needed after the
VISIBILITY_HIDDEN removal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85043 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
onstantMerge.cpp
eadArgumentElimination.cpp
eadTypeElimination.cpp
xtractGV.cpp
unctionAttrs.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
nlineAlways.cpp
nlineSimple.cpp
nternalize.cpp
oopExtractor.cpp
owerSetJmp.cpp
ergeFunctions.cpp
artialInlining.cpp
artialSpecialization.cpp
runeEH.cpp
tripDeadPrototypes.cpp
tructRetPromotion.cpp
f5a86f45e75ec744c203270ffa03659eb0a220c1 25-Oct-2009 Nick Lewycky <nicholas@mxc.ca> Remove includes of Support/Compiler.h that are no longer needed after the
VISIBILITY_HIDDEN removal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85043 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
onstantMerge.cpp
eadArgumentElimination.cpp
eadTypeElimination.cpp
xtractGV.cpp
unctionAttrs.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
nlineAlways.cpp
nlineSimple.cpp
nternalize.cpp
oopExtractor.cpp
owerSetJmp.cpp
ergeFunctions.cpp
artialInlining.cpp
artialSpecialization.cpp
runeEH.cpp
tripDeadPrototypes.cpp
tructRetPromotion.cpp
492d06efde44a4e38a6ed321ada4af5a75494df6 25-Oct-2009 Nick Lewycky <nicholas@mxc.ca> Remove VISIBILITY_HIDDEN from class/struct found inside anonymous namespaces.
Chris claims we should never have visibility_hidden inside any .cpp file but
that's still not true even after this commit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85042 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
onstantMerge.cpp
eadArgumentElimination.cpp
eadTypeElimination.cpp
xtractGV.cpp
unctionAttrs.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
nlineAlways.cpp
nlineSimple.cpp
nternalize.cpp
oopExtractor.cpp
owerSetJmp.cpp
ergeFunctions.cpp
artialInlining.cpp
artialSpecialization.cpp
runeEH.cpp
tripDeadPrototypes.cpp
tructRetPromotion.cpp
6726b6d75a8b679068a58cb954ba97cf9d1690ba 25-Oct-2009 Nick Lewycky <nicholas@mxc.ca> Remove VISIBILITY_HIDDEN from class/struct found inside anonymous namespaces.
Chris claims we should never have visibility_hidden inside any .cpp file but
that's still not true even after this commit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85042 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
onstantMerge.cpp
eadArgumentElimination.cpp
eadTypeElimination.cpp
xtractGV.cpp
unctionAttrs.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
nlineAlways.cpp
nlineSimple.cpp
nternalize.cpp
oopExtractor.cpp
owerSetJmp.cpp
ergeFunctions.cpp
artialInlining.cpp
artialSpecialization.cpp
runeEH.cpp
tripDeadPrototypes.cpp
tructRetPromotion.cpp
939460818ececec9e225ac70ab473c109300bbad 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
MakeLists.txt
lobalOpt.cpp
PO.cpp
aiseAllocations.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
MakeLists.txt
lobalOpt.cpp
PO.cpp
aiseAllocations.cpp
625fc8a70dea12493a862ff030cf63e1a3eeec8c 22-Oct-2009 Devang Patel <dpatel@apple.com> Derive metadata hierarchy from Value instead of User.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84801 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
tripSymbols.cpp
49708ad993529611cedfbe49ae44bb10beb73abe 22-Oct-2009 Devang Patel <dpatel@apple.com> Derive metadata hierarchy from Value instead of User.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84801 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
tripSymbols.cpp
df16f21228cf99bf3e8bd192afa1a8246e70341c 21-Oct-2009 Devang Patel <dpatel@apple.com> Do not remove dead metadata for now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84731 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
08e4339310a4f4d3ebebe47eb84a33f27bc3ba1f 21-Oct-2009 Devang Patel <dpatel@apple.com> Do not remove dead metadata for now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84731 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
96a4cb23a20b1c7c67bd04759f2a67bf4f289bbd 19-Oct-2009 Victor Hernandez <vhernandez@apple.com> Malloc calls are marked NoAlias, so the code below the isMalloc() check makes it redundant. Removing the isMalloc() check.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84541 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
93bb60d3793e6354866e2820a030f3baebb55a38 19-Oct-2009 Victor Hernandez <vhernandez@apple.com> Malloc calls are marked NoAlias, so the code below the isMalloc() check makes it redundant. Removing the isMalloc() check.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84541 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
b68e27a04f32573543c23bbcd33518cd9257905a 18-Oct-2009 Chris Lattner <sabre@nondot.org> remove the IndMemRemPass, which only made sense for when malloc/free were intrinsic
instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84404 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ndMemRemoval.cpp
98b532cf33a3198391f2f411879059f6c7bf99a0 18-Oct-2009 Chris Lattner <sabre@nondot.org> remove the IndMemRemPass, which only made sense for when malloc/free were intrinsic
instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84404 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
ndMemRemoval.cpp
37f513df87ceb54e873adc113a1fcf4af9556833 17-Oct-2009 Victor Hernandez <vhernandez@apple.com> Remove MallocInst from LLVM Instructions.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84299 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
lobalOpt.cpp
a276c603b82a11b0bf0b59f0517a69e4b63adeab 17-Oct-2009 Victor Hernandez <vhernandez@apple.com> Remove MallocInst from LLVM Instructions.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84299 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
lobalOpt.cpp
6203d9d219ba79ef8427a773cc0b2df69e3165f7 17-Oct-2009 Victor Hernandez <vhernandez@apple.com> Autoupgrade malloc insts to malloc calls.
Update testcases that rely on malloc insts being present.

Also prematurely remove MallocInst handling from IndMemRemoval and RaiseAllocations to help pass tests in this incremental step.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84292 91177308-0d34-0410-b5e6-96231b3b80d8
ndMemRemoval.cpp
aiseAllocations.cpp
13ad5aaaff8a446758b402fd5e9aea22f5bc5682 17-Oct-2009 Victor Hernandez <vhernandez@apple.com> Autoupgrade malloc insts to malloc calls.
Update testcases that rely on malloc insts being present.

Also prematurely remove MallocInst handling from IndMemRemoval and RaiseAllocations to help pass tests in this incremental step.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84292 91177308-0d34-0410-b5e6-96231b3b80d8
ndMemRemoval.cpp
aiseAllocations.cpp
2d1e0840efbf5ad8d6f9578ff9b7029b0246c3af 17-Oct-2009 Victor Hernandez <vhernandez@apple.com> HeapAllocSRoA also needs to check if malloc array size can be computed.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84288 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
8db42d2b1ce05e69b67f37c4e56a0f987a0c01d7 17-Oct-2009 Victor Hernandez <vhernandez@apple.com> HeapAllocSRoA also needs to check if malloc array size can be computed.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84288 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
8905891e04393b45d9d1857f379027b7ce0d0324 15-Oct-2009 Victor Hernandez <vhernandez@apple.com> Fix bug where array malloc with unexpected computation of the size argument resulted in MallocHelper
identifying the malloc as a non-array malloc. This broke GlobalOpt's optimization of stores of mallocs
to global variables.

The fix is to classify malloc's into 3 categories:
1. non-array mallocs
2. array mallocs whose array size can be determined
3. mallocs that cannot be determined to be of type 1 or 2 and cannot be optimized

getMallocArraySize() returns NULL for category 3, and all users of this function must avoid their
malloc optimization if this function returns NULL.

Eventually, currently unexpected codegen for computing the malloc's size argument will be supported in
isArrayMalloc() and getMallocArraySize(), extending malloc optimizations to those examples.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84199 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
2491ce03535cf8ec171570d2e28df63e4db3dd6b 15-Oct-2009 Victor Hernandez <vhernandez@apple.com> Fix bug where array malloc with unexpected computation of the size argument resulted in MallocHelper
identifying the malloc as a non-array malloc. This broke GlobalOpt's optimization of stores of mallocs
to global variables.

The fix is to classify malloc's into 3 categories:
1. non-array mallocs
2. array mallocs whose array size can be determined
3. mallocs that cannot be determined to be of type 1 or 2 and cannot be optimized

getMallocArraySize() returns NULL for category 3, and all users of this function must avoid their
malloc optimization if this function returns NULL.

Eventually, currently unexpected codegen for computing the malloc's size argument will be supported in
isArrayMalloc() and getMallocArraySize(), extending malloc optimizations to those examples.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84199 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
fad07189d3c7d121a1dc1473211096a76197177d 13-Oct-2009 Dan Gohman <gohman@apple.com> Move the InlineCost code from Transforms/Utils to Analysis.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83998 91177308-0d34-0410-b5e6-96231b3b80d8
nlineAlways.cpp
nlineSimple.cpp
nliner.cpp
e4aeec003f82a5263ffb168e175e6fca8b6f681d 13-Oct-2009 Dan Gohman <gohman@apple.com> Move the InlineCost code from Transforms/Utils to Analysis.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83998 91177308-0d34-0410-b5e6-96231b3b80d8
nlineAlways.cpp
nlineSimple.cpp
nliner.cpp
f5c20d7bc7641c093c9630366823584817b1f784 09-Oct-2009 Dale Johannesen <dalej@apple.com> Use names instead of numbers for some of the magic
constants used in inlining heuristics (especially
those used in more than one file). No functional change.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83675 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
bdb984bc2757114bc706026603ed40d7f508c4c1 09-Oct-2009 Dale Johannesen <dalej@apple.com> Use names instead of numbers for some of the magic
constants used in inlining heuristics (especially
those used in more than one file). No functional change.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83675 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
fa77a95f69eb7ebf8ad5eec689ab92f2f8961f64 09-Oct-2009 Dale Johannesen <dalej@apple.com> When considering whether to inline Callee into Caller,
and that will make Caller too big to inline, see if it
might be better to inline Caller into its callers instead.
This situation is described in PR 2973, although I haven't
tried the specific case in SPASS.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83602 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
e91b9a3b59688023e20cee8441179300b87c844e 09-Oct-2009 Dale Johannesen <dalej@apple.com> When considering whether to inline Callee into Caller,
and that will make Caller too big to inline, see if it
might be better to inline Caller into its callers instead.
This situation is described in PR 2973, although I haven't
tried the specific case in SPASS.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83602 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
f2519d6193d736ee7f2b9cc24e0143cfa933f79e 06-Oct-2009 Duncan Sands <baldrick@free.fr> Introduce and use convenience methods for getting pointer types
where the element is of a basic builtin type. For example, to get
an i8* use getInt8PtrTy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83379 91177308-0d34-0410-b5e6-96231b3b80d8
xtractGV.cpp
owerSetJmp.cpp
aiseAllocations.cpp
ac53a0b272452013124bfc70480aea5e41b60f40 06-Oct-2009 Duncan Sands <baldrick@free.fr> Introduce and use convenience methods for getting pointer types
where the element is of a basic builtin type. For example, to get
an i8* use getInt8PtrTy.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83379 91177308-0d34-0410-b5e6-96231b3b80d8
xtractGV.cpp
owerSetJmp.cpp
aiseAllocations.cpp
f49f7b0e07de54727532f40a75be162878b882c7 05-Oct-2009 Dan Gohman <gohman@apple.com> Remove an unnnecessary LLVMContext argument in
ConstantFoldLoadThroughGEPConstantExpr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83311 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
c6f69e94fa46f585b59bb9d7ace3224b0e638c95 05-Oct-2009 Dan Gohman <gohman@apple.com> Remove an unnnecessary LLVMContext argument in
ConstantFoldLoadThroughGEPConstantExpr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83311 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
9c46ca5cfeec9bc6fe2d8ddc14dfefa66151189c 04-Oct-2009 Evan Cheng <evan.cheng@apple.com> Allow -inline-threshold override default threshold even if compiling to optimize for size.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83274 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
a0479e53323ade402272ddf8302c8aa2c496c775 04-Oct-2009 Evan Cheng <evan.cheng@apple.com> Allow -inline-threshold override default threshold even if compiling to optimize for size.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83274 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
b65091d85c1c7a467ecf0622747900e54012b2fb 28-Sep-2009 Dan Gohman <gohman@apple.com> Convert LoopSimplify and LoopExtractor from FunctionPass to LoopPass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82990 91177308-0d34-0410-b5e6-96231b3b80d8
oopExtractor.cpp
d84db1133345234738b646c70b907bf8a0983ac9 28-Sep-2009 Dan Gohman <gohman@apple.com> Convert LoopSimplify and LoopExtractor from FunctionPass to LoopPass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82990 91177308-0d34-0410-b5e6-96231b3b80d8
oopExtractor.cpp
47fe1012616c84ce6211a298f822462db8dda2ef 27-Sep-2009 Chris Lattner <sabre@nondot.org> remove special handling of bitcast(malloc), it will be handled
when the loop inspects the bitcast operand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82928 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
439044f4f9594990fb9a8149ea67c119a2b05387 27-Sep-2009 Chris Lattner <sabre@nondot.org> remove special handling of bitcast(malloc), it will be handled
when the loop inspects the bitcast operand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82928 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
4e577c0241756a4d6350c2c310c0cb96a3ecee5e 27-Sep-2009 Chris Lattner <sabre@nondot.org> unlike the malloc instruction, "malloc" calls do not claim to be readonly, just nounwind.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82927 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
2a9325ff2fc21d8c9873b999cb9ebe2bc6b6f1a1 27-Sep-2009 Chris Lattner <sabre@nondot.org> unlike the malloc instruction, "malloc" calls do not claim to be readonly, just nounwind.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82927 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
129b2d16553e46db3b5675b63e777931e2ea4cec 24-Sep-2009 Edwin Török <edwintorok@gmail.com> Constant propagating byval pointer is safe if function is readonly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82700 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
c3384995258efcec26acf3a88715dc99cd871c3e 24-Sep-2009 Torok Edwin <edwintorok@gmail.com> Constant propagating byval pointer is safe if function is readonly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82700 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
d54353779c9a33c745178f01785113300c7acb0e 24-Sep-2009 Edwin Török <edwintorok@gmail.com> Don't constant propagate byval pointers, since they are not really pointers, but
rather structs passed by value.
This fixes PR5038.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82689 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
30a94e3b4203cee64db0edd997780bbe4ad0acdc 24-Sep-2009 Torok Edwin <edwintorok@gmail.com> Don't constant propagate byval pointers, since they are not really pointers, but
rather structs passed by value.
This fixes PR5038.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82689 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
3be44e69724c80460d2ef5abab22d802f78615cc 20-Sep-2009 Daniel Dunbar <daniel@zuster.org> Tabs -> spaces, and remove trailing whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82355 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
a279bc3da55691784064cb47200a1c584408b8ab 20-Sep-2009 Daniel Dunbar <daniel@zuster.org> Tabs -> spaces, and remove trailing whitespace.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82355 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
9229fdb0d591d22ad962dfb97d98d12ef56b5833 19-Sep-2009 Nick Lewycky <nicholas@mxc.ca> Remove the default value for ConstantStruct::get's isPacked parameter and
update the code which was broken by this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82327 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
c332fba8285e35a5a11463c34795af84f3960759 19-Sep-2009 Nick Lewycky <nicholas@mxc.ca> Remove the default value for ConstantStruct::get's isPacked parameter and
update the code which was broken by this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82327 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
48c3c54ceb1fbdcddac9f11a11163a44efe21f55 19-Sep-2009 Victor Hernandez <vhernandez@apple.com> Enhance transform passes so that they apply the same tranforms to malloc calls as to MallocInst.

Reviewed by Dan Gohman.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82300 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
lobalOpt.cpp
83d63919bd990ce00f62e18114504b9e4a5cb35e 19-Sep-2009 Victor Hernandez <vhernandez@apple.com> Enhance transform passes so that they apply the same tranforms to malloc calls as to MallocInst.

Reviewed by Dan Gohman.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82300 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
lobalOpt.cpp
69177fbaef43d051fcc9a84184b2884f41765c6b 15-Sep-2009 Chris Lattner <sabre@nondot.org> add a new CallGraphNode::replaceCallEdge method and use it from
argpromote to avoid invalidating an iterator. This fixes PR4977.
All clang tests now pass with expensive checking (on my system
at least).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81843 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
a51c39cc3265f5d0d5de87b4a3ef9332c83556e1 15-Sep-2009 Chris Lattner <sabre@nondot.org> add a new CallGraphNode::replaceCallEdge method and use it from
argpromote to avoid invalidating an iterator. This fixes PR4977.
All clang tests now pass with expensive checking (on my system
at least).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81843 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
db050e9d9673fda33b4acbf67b1137a6a91e74b7 11-Sep-2009 Dan Gohman <gohman@apple.com> Factor out the code for checking that all indices in a getelementptr are
within the notional bounds of the static type of the getelementptr (which
is not the same as "inbounds") from GlobalOpt into a utility routine,
and use it in ConstantFold.cpp to check whether there are any mis-behaved
indices.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81478 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
e6992f728a94654e43269580a10a667f18dadba9 11-Sep-2009 Dan Gohman <gohman@apple.com> Factor out the code for checking that all indices in a getelementptr are
within the notional bounds of the static type of the getelementptr (which
is not the same as "inbounds") from GlobalOpt into a utility routine,
and use it in ConstantFold.cpp to check whether there are any mis-behaved
indices.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81478 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
66b57f3a2a4891f05392bdffb6717326f99b9bc6 08-Sep-2009 Owen Anderson <resistor@mac.com> Fix PR4909, patch by Jakub Staszak.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81250 91177308-0d34-0410-b5e6-96231b3b80d8
artialInlining.cpp
a0ecbe782177d3ec7c98700434d2d92fb0c0e600 08-Sep-2009 Owen Anderson <resistor@mac.com> Fix PR4909, patch by Jakub Staszak.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81250 91177308-0d34-0410-b5e6-96231b3b80d8
artialInlining.cpp
c2723ad812300b525b77334a4180d3531613ae3e 08-Sep-2009 Dan Gohman <gohman@apple.com> Don't commit stores with addresses that have indices that are not
compile-time constant integers or that are out of bounds for their
corresponding static array types. These can cause aliasing that
GlobalOpt assumes won't happen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81165 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
80bdc967e946b5d68646ffdee857400f9a120cca 08-Sep-2009 Dan Gohman <gohman@apple.com> Don't commit stores with addresses that have indices that are not
compile-time constant integers or that are out of bounds for their
corresponding static array types. These can cause aliasing that
GlobalOpt assumes won't happen.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81165 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
9524ee6fbbe252887fc957b2d5612318abed5171 08-Sep-2009 Dan Gohman <gohman@apple.com> Don't commit addresses of aggregate values. This avoids problems with
an aggregate store overlapping a different aggregate store, despite
the stores having distinct addresses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81164 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
ce5de5b52768d0c3b9c0f6c4bc915a17e962202c 08-Sep-2009 Dan Gohman <gohman@apple.com> Don't commit addresses of aggregate values. This avoids problems with
an aggregate store overlapping a different aggregate store, despite
the stores having distinct addresses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81164 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
0c834c07335e47546df1d9ef10f79b69cfee7651 08-Sep-2009 Dan Gohman <gohman@apple.com> Fix GlobalOpt to avoid committing a store if the address getelementptr
is missing the inbounds flag. This is slightly conservative, but it
avoids problems with two constants pointing to the same address but
getting distinct entries in the Memory DenseMap.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81163 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
c62482d4edecd416e6529e31427fa6fd8a9b7ece 08-Sep-2009 Dan Gohman <gohman@apple.com> Fix GlobalOpt to avoid committing a store if the address getelementptr
is missing the inbounds flag. This is slightly conservative, but it
avoids problems with two constants pointing to the same address but
getting distinct entries in the Memory DenseMap.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81163 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
6d907d00498eaaa2bf0d176adf73f66c0c80d8e8 08-Sep-2009 Dan Gohman <gohman@apple.com> Preserve the InBounds flag when evaluating a getelementptr instruction
into a getelementptr ConstantExpr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81162 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
4a7e6b7a15cea1f8ead4d1bb1cf2e3a39a339cb3 08-Sep-2009 Dan Gohman <gohman@apple.com> Preserve the InBounds flag when evaluating a getelementptr instruction
into a getelementptr ConstantExpr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81162 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
278fbe6ee2d970a5379dbeb8cf4e55a54e0421d6 08-Sep-2009 Dan Gohman <gohman@apple.com> Simplify this code by using hasDefinitiveInitializer().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81161 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
fd54a898be08e8da12cb2e99dbb63015083940a3 08-Sep-2009 Dan Gohman <gohman@apple.com> Simplify this code by using hasDefinitiveInitializer().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81161 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
04791af064e508422996148f33ef1f5f48c29e5b 03-Sep-2009 Nick Lewycky <nicholas@mxc.ca> Remove VISIBILITY_HIDDEN from this file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80903 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
8aa9fba7cbc9ed58a0f5e32ad5e54c3bb984b3e4 03-Sep-2009 Nick Lewycky <nicholas@mxc.ca> Remove VISIBILITY_HIDDEN from this file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80903 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
5a6b6b43459b875e88d598c232ddef7b805fe107 03-Sep-2009 Gabor Greif <ggreif@gmail.com> back out my recent commit (r80858), it seems to break self-hosting buildbot's stage 2 configure

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80871 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
runeEH.cpp
03a5f139fb7d3e9c49fe95aea4c717fab2285d82 03-Sep-2009 Gabor Greif <ggreif@gmail.com> back out my recent commit (r80858), it seems to break self-hosting buildbot's stage 2 configure

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80871 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
runeEH.cpp
fe15ce4a51f0d83bd2a0bb788af70663fc8713aa 03-Sep-2009 Gabor Greif <ggreif@gmail.com> re-commit r66920 (which has been backed out in r66953) I may have more luck this time. I'll back out if needed...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80858 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
runeEH.cpp
190390b8d31af0a549827478911b322af4bc111a 03-Sep-2009 Gabor Greif <ggreif@gmail.com> re-commit r66920 (which has been backed out in r66953) I may have more luck this time. I'll back out if needed...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80858 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
runeEH.cpp
b980f057d2ea2119836fbf39040ca8e49386d297 01-Sep-2009 Chris Lattner <sabre@nondot.org> remove CallGraphNode::replaceCallSite, it is redundant with other APIs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80708 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
tructRetPromotion.cpp
da230cb876edf0d4fa8eefc289b8addfb722cd07 01-Sep-2009 Chris Lattner <sabre@nondot.org> remove CallGraphNode::replaceCallSite, it is redundant with other APIs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80708 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
tructRetPromotion.cpp
0b6ab543047eac94f4155297b7b12af78e0e6a6d 01-Sep-2009 Chris Lattner <sabre@nondot.org> cleanup/simplify


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80706 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
7c8c1ba40ce54fa49c914352e2e19dcc849402b6 01-Sep-2009 Chris Lattner <sabre@nondot.org> cleanup/simplify


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80706 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
a59b5decad2d3e3b9e2f565ff5d4e1857b9202a1 01-Sep-2009 Chris Lattner <sabre@nondot.org> Change CallGraphNode to maintain it's Function as an AssertingVH
for sanity. This didn't turn up any bugs.

Change CallGraphNode to maintain its "callsite" information in the
call edges list as a WeakVH instead of as an instruction*. This fixes
a broad class of dangling pointer bugs, and makes CallGraph have a number
of useful invariants again. This fixes the class of problem indicated
by PR4029 and PR3601.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80663 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
a541b0fde2ab6b8b037edf113d42da41a2c5aae9 01-Sep-2009 Chris Lattner <sabre@nondot.org> Change CallGraphNode to maintain it's Function as an AssertingVH
for sanity. This didn't turn up any bugs.

Change CallGraphNode to maintain its "callsite" information in the
call edges list as a WeakVH instead of as an instruction*. This fixes
a broad class of dangling pointer bugs, and makes CallGraph have a number
of useful invariants again. This fixes the class of problem indicated
by PR4029 and PR3601.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80663 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
4c76b7e8e15bf7ed6607393535f64a9070b6df8c 31-Aug-2009 Chris Lattner <sabre@nondot.org> comment and simplify some code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80540 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
d43d5e832f756c9d2c0c8ff4d2f51807a27cab8d 31-Aug-2009 Chris Lattner <sabre@nondot.org> comment and simplify some code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80540 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
d441cd63a37ec3589fed1cfba11bbb177dab8fa6 31-Aug-2009 Chris Lattner <sabre@nondot.org> add -debug output


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80539 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
a3512bd589ad9269ddaa4e9c008da43c36b4a1b8 31-Aug-2009 Chris Lattner <sabre@nondot.org> add -debug output


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80539 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
b74203603b43d08ddef33e9a4c9c03752d86aee6 31-Aug-2009 Chris Lattner <sabre@nondot.org> simplify some code by making the SCCNodes set contain Function*'s
instead of CallGraphNode*'s. This also papers over a callgraph
problem where a pass (in this case, MemCpyOpt) introduces a new
function into the module (llvm.memset.i64) but doesn't add it to
the call graph (nor should it, since it is a function pass).

While it might be a good idea for MemCpyOpt to not synthesize
functions in a runOnFunction(), there is no need for FunctionAttrs
to be boneheaded, so fix it there. This fixes an assertion building
176.gcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80535 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
98a27ce03f092ab5464e65725f7d1fa0c03652f2 31-Aug-2009 Chris Lattner <sabre@nondot.org> simplify some code by making the SCCNodes set contain Function*'s
instead of CallGraphNode*'s. This also papers over a callgraph
problem where a pass (in this case, MemCpyOpt) introduces a new
function into the module (llvm.memset.i64) but doesn't add it to
the call graph (nor should it, since it is a function pass).

While it might be a good idea for MemCpyOpt to not synthesize
functions in a runOnFunction(), there is no need for FunctionAttrs
to be boneheaded, so fix it there. This fixes an assertion building
176.gcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80535 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
fd7079292b43ca5eceae2c585fc2899033a448f7 31-Aug-2009 Chris Lattner <sabre@nondot.org> Fix PR4834, a tricky case where the inliner would resolve an
indirect function pointer, inline it, then go to delete the body.
The problem is that the callgraph had other references to the function,
though the inliner had no way to know it, so we got a dangling pointer
and an invalid iterator out of the deal.

The fix to this is pretty simple: stop the inliner from deleting the
function by knowing that there are references to it. Do this by making
CallGraphNodes contain a refcount. This requires moving deletion of
available_externally functions to the module-level cleanup sweep where
it belongs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80533 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
b374b90e81d0ce6b5d02041ba4f7b15a945b38d8 31-Aug-2009 Chris Lattner <sabre@nondot.org> Fix PR4834, a tricky case where the inliner would resolve an
indirect function pointer, inline it, then go to delete the body.
The problem is that the callgraph had other references to the function,
though the inliner had no way to know it, so we got a dangling pointer
and an invalid iterator out of the deal.

The fix to this is pretty simple: stop the inliner from deleting the
function by knowing that there are references to it. Do this by making
CallGraphNodes contain a refcount. This requires moving deletion of
available_externally functions to the module-level cleanup sweep where
it belongs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80533 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
3dab7152eedc0d822a9499102303eba526026021 31-Aug-2009 Chris Lattner <sabre@nondot.org> Fix some nasty callgraph dangling pointer problems in
argpromotion and structretpromote. Basically, when replacing
a function, they used the 'changeFunction' api which changes
the entry in the function map (and steals/reuses the callgraph
node).

This has some interesting effects: first, the problem is that it doesn't
update the "callee" edges in any callees of the function in the call graph.
Second, this covers for a major problem in all the CGSCC pass stuff, which
is that it is completely broken when functions are deleted if they *don't*
reuse a CGN. (there is a cute little fixme about this though :).

This patch changes the protocol that CGSCC passes must obey: now the CGSCC
pass manager copies the SCC and preincrements its iterator to avoid passes
invalidating it. This allows CGSCC passes to mutate the current SCC. However
multiple passes may be run on that SCC, so if passes do this, they are now
required to *update* the SCC to be current when they return.

Other less interesting parts of this patch are that it makes passes update
the CG more directly, eliminates changeFunction, and requires clients of
replaceCallSite to specify the new callee CGN if they are changing it.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80527 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
unctionAttrs.cpp
nliner.cpp
runeEH.cpp
tructRetPromotion.cpp
5095e3d1d1caef8d573534d369e37277c623064c 31-Aug-2009 Chris Lattner <sabre@nondot.org> Fix some nasty callgraph dangling pointer problems in
argpromotion and structretpromote. Basically, when replacing
a function, they used the 'changeFunction' api which changes
the entry in the function map (and steals/reuses the callgraph
node).

This has some interesting effects: first, the problem is that it doesn't
update the "callee" edges in any callees of the function in the call graph.
Second, this covers for a major problem in all the CGSCC pass stuff, which
is that it is completely broken when functions are deleted if they *don't*
reuse a CGN. (there is a cute little fixme about this though :).

This patch changes the protocol that CGSCC passes must obey: now the CGSCC
pass manager copies the SCC and preincrements its iterator to avoid passes
invalidating it. This allows CGSCC passes to mutate the current SCC. However
multiple passes may be run on that SCC, so if passes do this, they are now
required to *update* the SCC to be current when they return.

Other less interesting parts of this patch are that it makes passes update
the CG more directly, eliminates changeFunction, and requires clients of
replaceCallSite to specify the new callee CGN if they are changing it.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80527 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
unctionAttrs.cpp
nliner.cpp
runeEH.cpp
tructRetPromotion.cpp
15e723d2c6021bbeacad9baa9c0d946d4a19867e 29-Aug-2009 Devang Patel <dpatel@apple.com> Reapply 79977.
Use MDNodes to encode debug info in llvm IR.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80406 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
e4b275610a7a05b7ee4c0378a906a6330e4c4ab0 29-Aug-2009 Devang Patel <dpatel@apple.com> Reapply 79977.
Use MDNodes to encode debug info in llvm IR.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80406 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
d7e5bacf57cba6f139d726a0c63cb195f38cd39d 28-Aug-2009 Chris Lattner <sabre@nondot.org> finish a half formed thought :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80334 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
cc0a0299d96676e0a51e9b8f5bf617d8025f09a7 28-Aug-2009 Chris Lattner <sabre@nondot.org> finish a half formed thought :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80334 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
bc42440879f2a302f2801e224828cfdccd5a92a7 27-Aug-2009 Chris Lattner <sabre@nondot.org> Implement a new optimization in the inliner: if inlining multiple
calls into a function and if the calls bring in arrays, try to merge
them together to reduce stack size. For example, in the testcase
we'd previously end up with 4 allocas, now we end up with 2 allocas.

As described in the comments, this is not really the ideal solution
to this problem, but it is surprisingly effective. For example, on
176.gcc, we end up eliminating 67 arrays at "gccas" time and another
24 at "llvm-ld" time.

One piece of concern that I didn't look into: at -O0 -g with
forced inlining this will almost certainly result in worse debug
info. I think this is acceptable though given that this is a case
of "debugging optimized code", and we don't want debug info to
prevent the optimizer from doing things anyway.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80215 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
199ba42cbf56b2fc9c708edb4f08f97dd99ddd49 27-Aug-2009 Chris Lattner <sabre@nondot.org> Implement a new optimization in the inliner: if inlining multiple
calls into a function and if the calls bring in arrays, try to merge
them together to reduce stack size. For example, in the testcase
we'd previously end up with 4 allocas, now we end up with 2 allocas.

As described in the comments, this is not really the ideal solution
to this problem, but it is surprisingly effective. For example, on
176.gcc, we end up eliminating 67 arrays at "gccas" time and another
24 at "llvm-ld" time.

One piece of concern that I didn't look into: at -O0 -g with
forced inlining this will almost certainly result in worse debug
info. I think this is acceptable though given that this is a case
of "debugging optimized code", and we don't want debug info to
prevent the optimizer from doing things anyway.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80215 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
d1586b1a1d27d5efeb8e487bbeb7ed255159e53b 27-Aug-2009 Chris Lattner <sabre@nondot.org> reduce header #include'age


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80204 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
12f0babca4459c253675700e1d707652d5b6ba17 27-Aug-2009 Chris Lattner <sabre@nondot.org> reduce header #include'age


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80204 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
ae56c0de911bf5328ffda48e51ce37bcd7aa0d76 27-Aug-2009 Chris Lattner <sabre@nondot.org> reduce inlining factor some stuff out to a static helper function,
and other code cleanups. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80199 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
135755dae4c3fa8003b76150689d5064aa4612ee 27-Aug-2009 Chris Lattner <sabre@nondot.org> reduce inlining factor some stuff out to a static helper function,
and other code cleanups. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80199 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
94060421ce73922e71c183fba0fda8bace7d0e2d 26-Aug-2009 Devang Patel <dpatel@apple.com> Revert 79977. It causes llvm-gcc bootstrap failures on some platforms.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80073 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
824598883513789516a919651f4b35e7a638ec5c 26-Aug-2009 Devang Patel <dpatel@apple.com> Revert 79977. It causes llvm-gcc bootstrap failures on some platforms.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80073 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
fc00c4a2407c1b30a19fef9ec0a1ae00f7f7472d 26-Aug-2009 Dan Gohman <gohman@apple.com> Rename Instruction::isIdenticalTo to Instruction::isIdenticalToWhenDefined,
and introduce a new Instruction::isIdenticalTo which tests for full
identity, including the SubclassOptionalData flags. Also, fix the
Instruction::clone implementations to preserve the SubclassOptionalData
flags. Finally, teach several optimizations how to handle
SubclassOptionalData correctly, given these changes.

This fixes the counterintuitive behavior of isIdenticalTo not comparing
the full value, and clone not returning an identical clone, as well as
some subtle bugs that could be caused by these.

Thanks to Nick Lewycky for reporting this, and for an initial patch!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80038 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
58cfa3b13752579c86cf85270d49f9ced0942f2f 26-Aug-2009 Dan Gohman <gohman@apple.com> Rename Instruction::isIdenticalTo to Instruction::isIdenticalToWhenDefined,
and introduce a new Instruction::isIdenticalTo which tests for full
identity, including the SubclassOptionalData flags. Also, fix the
Instruction::clone implementations to preserve the SubclassOptionalData
flags. Finally, teach several optimizations how to handle
SubclassOptionalData correctly, given these changes.

This fixes the counterintuitive behavior of isIdenticalTo not comparing
the full value, and clone not returning an identical clone, as well as
some subtle bugs that could be caused by these.

Thanks to Nick Lewycky for reporting this, and for an initial patch!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80038 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
57b83c78f56324e3a8ff636b311235f6f2350b4e 25-Aug-2009 Devang Patel <dpatel@apple.com> Update DebugInfo interface to use metadata, instead of special named llvm.dbg.... global variables, to encode debugging information in llvm IR. This is mostly a mechanical change that tests metadata support very well.

This change speeds up llvm-gcc by more then 6% at "-O0 -g" (measured by compiling InstructionCombining.cpp!)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79977 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
2a610c7387664bc557a35ce3bb4c0d4df56e4755 25-Aug-2009 Devang Patel <dpatel@apple.com> Update DebugInfo interface to use metadata, instead of special named llvm.dbg.... global variables, to encode debugging information in llvm IR. This is mostly a mechanical change that tests metadata support very well.

This change speeds up llvm-gcc by more then 6% at "-O0 -g" (measured by compiling InstructionCombining.cpp!)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79977 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
30d4d765dfc6d01bc4c1d6934582050106bcceba 25-Aug-2009 Dale Johannesen <dalej@apple.com> Allow multiple occurrences of -inline-threshold on
the command line. This gives llvm-gcc developers
a way to control inlining (documented as "not intended
for end users").



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79966 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
5fee49eff92c2ae2f70eb84d136c31a706560750 25-Aug-2009 Dale Johannesen <dalej@apple.com> Allow multiple occurrences of -inline-threshold on
the command line. This gives llvm-gcc developers
a way to control inlining (documented as "not intended
for end users").



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79966 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
f537768f6dfcdf5f06696b0383e292cbe3c6fec1 24-Aug-2009 Chris Lattner <sabre@nondot.org> prune the #includes in raw_ostream.h by moving a
member out of line. ftostr is not particularly speedy,
so that method is presumably not perf sensitive.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79885 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
23132b188ba651ba172380cd082cc286df73d440 24-Aug-2009 Chris Lattner <sabre@nondot.org> prune the #includes in raw_ostream.h by moving a
member out of line. ftostr is not particularly speedy,
so that method is presumably not perf sensitive.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79885 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
bf9d76de710117c29a70a3cd18aca0254064aa68 23-Aug-2009 Chris Lattner <sabre@nondot.org> convert LoopInfo.h and GraphWriter.h to use raw_ostream


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79836 91177308-0d34-0410-b5e6-96231b3b80d8
oopExtractor.cpp
103289e9383ad1eb66caf28c9b166aebce963a35 23-Aug-2009 Chris Lattner <sabre@nondot.org> convert LoopInfo.h and GraphWriter.h to use raw_ostream


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79836 91177308-0d34-0410-b5e6-96231b3b80d8
oopExtractor.cpp
36eef827f1576cb240418a78e2323863ef6b4f8c 23-Aug-2009 Chris Lattner <sabre@nondot.org> eliminate uses of cerr()


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79834 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
4437ae213d5435390f0750213b53ec807c047f22 23-Aug-2009 Chris Lattner <sabre@nondot.org> eliminate uses of cerr()


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79834 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
2b40c564224cda719903f8f552caefd285716632 23-Aug-2009 Chris Lattner <sabre@nondot.org> remove a few DOUTs here and there.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79832 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
ergeFunctions.cpp
tructRetPromotion.cpp
bbbfa99d3d18fe9f20265305e833666645ada528 23-Aug-2009 Chris Lattner <sabre@nondot.org> remove a few DOUTs here and there.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79832 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
ergeFunctions.cpp
tructRetPromotion.cpp
8a6411ca14e6216192ccddb18c5196a26e98e1b3 23-Aug-2009 Chris Lattner <sabre@nondot.org> eliminate the "Value" printing methods that print to a std::ostream.
This required converting a bunch of stuff off DOUT and other cleanups.


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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79819 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
5e423ede22161ecfb96aeb6bc35745b3f26bd629 19-Aug-2009 Dan Gohman <gohman@apple.com> Use hasDefinitiveInitializer() instead of testing the same thing
by hand, and fix a few places that were using hasInitializer() that
appear to depend on the initializer value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79441 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
lobalOpt.cpp
nlineSimple.cpp
8255573835970e7130ba93271972172fb335f2ec 19-Aug-2009 Dan Gohman <gohman@apple.com> Use hasDefinitiveInitializer() instead of testing the same thing
by hand, and fix a few places that were using hasInitializer() that
appear to depend on the initializer value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79441 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
lobalOpt.cpp
nlineSimple.cpp
f0080a1f68db309b258710251612593bf4d73759 18-Aug-2009 Dan Gohman <gohman@apple.com> Fix a bug that caused globalopt to miscompile tramp3d: don't miss
unruly indices for arrays that are members of structs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79337 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
6874a2ae033b7b5e1d0c10714e01d9c87480956a 18-Aug-2009 Dan Gohman <gohman@apple.com> Fix a bug that caused globalopt to miscompile tramp3d: don't miss
unruly indices for arrays that are members of structs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79337 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
408bbf32d1c18f0af5f3f6fd9013291c2bcb7e6c 17-Aug-2009 Duncan Sands <baldrick@free.fr> Don't access the first element of a potentially empty
vector (&Formals[0]). With this change llvm-gcc builds
with expensive checking enabled for C, C++ and Fortran.
While there, change a std::vector into a SmallVector.
This is partly gratuitous, but mostly because not all
STL vector implementations define the data method (and
it should be faster).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79237 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
fa6a1cf1ed4282145269b12578f687b3869d6476 17-Aug-2009 Duncan Sands <baldrick@free.fr> Don't access the first element of a potentially empty
vector (&Formals[0]). With this change llvm-gcc builds
with expensive checking enabled for C, C++ and Fortran.
While there, change a std::vector into a SmallVector.
This is partly gratuitous, but mostly because not all
STL vector implementations define the data method (and
it should be faster).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79237 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
f657fcd97b562975f6b7423f2a91a7a0fae5f8ac 14-Aug-2009 Dan Gohman <gohman@apple.com> Make TargetData optional in GlobalOpt and ArgumentPromotion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78967 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
lobalOpt.cpp
7eb28f3786543f63cb9a4099655e6d456fca71f7 14-Aug-2009 Dan Gohman <gohman@apple.com> Make TargetData optional in GlobalOpt and ArgumentPromotion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78967 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
lobalOpt.cpp
35b4707edb32008b1a7976dcbf3920b1160fc1c6 13-Aug-2009 Owen Anderson <resistor@mac.com> Push LLVMContexts through the IntegerType APIs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78948 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
xtractGV.cpp
lobalOpt.cpp
PConstantPropagation.cpp
ndMemRemoval.cpp
owerSetJmp.cpp
ergeFunctions.cpp
runeEH.cpp
aiseAllocations.cpp
tructRetPromotion.cpp
1d0be15f89cb5056e20e2d24faa8d6afb1573bca 13-Aug-2009 Owen Anderson <resistor@mac.com> Push LLVMContexts through the IntegerType APIs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78948 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
xtractGV.cpp
lobalOpt.cpp
PConstantPropagation.cpp
ndMemRemoval.cpp
owerSetJmp.cpp
ergeFunctions.cpp
runeEH.cpp
aiseAllocations.cpp
tructRetPromotion.cpp
cdff21264de2f2d0ba98cdf333618c6f0e822ef9 12-Aug-2009 Dan Gohman <gohman@apple.com> Remove a bunch more now-unnecessary Context arguments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78809 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
4ae5126d041768ab9665cf2f11c024becd76c41f 12-Aug-2009 Dan Gohman <gohman@apple.com> Remove a bunch more now-unnecessary Context arguments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78809 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
46a803a67e7b3157f11173e696a8e724c6af190e 11-Aug-2009 Dan Gohman <gohman@apple.com> Remove unnecessary casts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78664 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
1b2d0b83977a37cb22391dc5a7bf09de76caf0b2 11-Aug-2009 Dan Gohman <gohman@apple.com> Remove unnecessary casts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78664 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
16f4033a9131c3a7dc8ba4267c4c2fcd636b7e54 11-Aug-2009 Devang Patel <dpatel@apple.com> Remove dead metadata.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78651 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
9d3627ea27195534242ec8026a9b8c888b85bbba 11-Aug-2009 Devang Patel <dpatel@apple.com> Remove dead metadata.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78651 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
6d29b324f77099bf84fefbf8cb529de5141e1080 07-Aug-2009 Dan Gohman <gohman@apple.com> Fix a bunch of namespace pollution.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78363 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
7db949df789383acce98ef072f08794fdd5bd04e 07-Aug-2009 Dan Gohman <gohman@apple.com> Fix a bunch of namespace pollution.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78363 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
791211fbaf493253b5a7ea96f03e4cdc4456fb4f 06-Aug-2009 Devang Patel <dpatel@apple.com> Use DebugInfoFinder.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78333 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
734068a90fd63bfb95362a23537e1a0cbd444481 06-Aug-2009 Devang Patel <dpatel@apple.com> Use DebugInfoFinder.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78333 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
d2ed7457a184bdb8699f25e22f5cb8856c36bc5b 06-Aug-2009 Owen Anderson <resistor@mac.com> Privatize the StructType table, which unfortunately involves routing contexts through a number of APIs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78258 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
lobalOpt.cpp
d7f2a6cb3fbc012763adb42fd967f6fefbb22a37 06-Aug-2009 Owen Anderson <resistor@mac.com> Privatize the StructType table, which unfortunately involves routing contexts through a number of APIs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78258 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
lobalOpt.cpp
aac2837c17cafaf4ff6487a54bab42e6618b5945 31-Jul-2009 Owen Anderson <resistor@mac.com> Move a few more APIs back to 2.5 forms. The only remaining ones left to change back are
metadata related, which I'm waiting on to avoid conflicting with Devang.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77721 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
lobalOpt.cpp
owerSetJmp.cpp
a7235ea7245028a0723e8ab7fd011386b3900777 31-Jul-2009 Owen Anderson <resistor@mac.com> Move a few more APIs back to 2.5 forms. The only remaining ones left to change back are
metadata related, which I'm waiting on to avoid conflicting with Devang.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77721 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
lobalOpt.cpp
owerSetJmp.cpp
04de68108895b6106ddda53d34c7cb7bbc11c360 31-Jul-2009 Bill Wendling <isanbard@gmail.com> - Convert the rest of the DOUTs to DEBUG+errs().
- One formatting change.

No intended functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77717 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
84a832f9272ed7f1a47c3e019c770b62e373cc6c 31-Jul-2009 Bill Wendling <isanbard@gmail.com> - Convert the rest of the DOUTs to DEBUG+errs().
- One formatting change.

No intended functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77717 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
4f720fae677b937ace6ffd2bdbfb670ddbadc663 31-Jul-2009 Owen Anderson <resistor@mac.com> Move getTrue() and getFalse() to 2.5-like APIs.


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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77685 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
b99ecca4954cbc3fbff77ffb252952cc19c4d799 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
eadArgumentElimination.cpp
lobalOpt.cpp
PConstantPropagation.cpp
owerSetJmp.cpp
runeEH.cpp
aiseAllocations.cpp
tripSymbols.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
eadArgumentElimination.cpp
lobalOpt.cpp
PConstantPropagation.cpp
owerSetJmp.cpp
runeEH.cpp
aiseAllocations.cpp
tripSymbols.cpp
15676ac89f4f0c3e10108f267ddad19149ad9cb5 30-Jul-2009 Daniel Dunbar <daniel@zuster.org> Twines: Don't allow implicit conversion from integers, this is too tricky.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77605 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
lobalOpt.cpp
fe09b2098ac483f6d6ce6ea4ab237a9539bdb6b9 30-Jul-2009 Daniel Dunbar <daniel@zuster.org> Twines: Don't allow implicit conversion from integers, this is too tricky.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77605 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
lobalOpt.cpp
bfea4859278283431cfbac082a279e4f2742d0bd 30-Jul-2009 Daniel Dunbar <daniel@zuster.org> Switch obvious clients to Twine instead of utostr (when they were already using
a Twine, e.g., for names).
- I am a little ambivalent about this; we don't want the string conversion of
utostr, but using overload '+' mixed with string and integer arguments is
sketchy. On the other hand, this particular usage is something of an idiom.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77579 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
lobalOpt.cpp
7f93dc8345fb33652973e35cae4c3b58addf4f87 30-Jul-2009 Daniel Dunbar <daniel@zuster.org> Switch obvious clients to Twine instead of utostr (when they were already using
a Twine, e.g., for names).
- I am a little ambivalent about this; we don't want the string conversion of
utostr, but using overload '+' mixed with string and integer arguments is
sketchy. On the other hand, this particular usage is something of an idiom.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77579 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
lobalOpt.cpp
61c577cd24a013595f5f46825db8397f5148e673 30-Jul-2009 Douglas Gregor <doug.gregor@gmail.com> Eliminate a few unused-variable warnings

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77519 91177308-0d34-0410-b5e6-96231b3b80d8
xtractGV.cpp
f485b3bbab86274161e2b56e829b404cce227675 30-Jul-2009 Douglas Gregor <dgregor@apple.com> Eliminate a few unused-variable warnings

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77519 91177308-0d34-0410-b5e6-96231b3b80d8
xtractGV.cpp
6b6e2d9392782724c48110bcca4bee2c8fbbd7b9 30-Jul-2009 Owen Anderson <resistor@mac.com> Move types back to the 2.5 API.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77516 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
xtractGV.cpp
lobalOpt.cpp
owerSetJmp.cpp
aiseAllocations.cpp
tructRetPromotion.cpp
debcb01b0f0a15f568ca69e8f288fade4bfc7297 30-Jul-2009 Owen Anderson <resistor@mac.com> Move types back to the 2.5 API.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77516 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
xtractGV.cpp
lobalOpt.cpp
owerSetJmp.cpp
aiseAllocations.cpp
tructRetPromotion.cpp
02b48c3be2112c64d8fc9cf5419c9c8d4ec30b71 29-Jul-2009 Owen Anderson <resistor@mac.com> Move ConstantExpr to 2.5 API.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77494 91177308-0d34-0410-b5e6-96231b3b80d8
xtractGV.cpp
lobalOpt.cpp
ergeFunctions.cpp
baf3c404409d5e47b13984a7f95bfbd6d1f2e79e 29-Jul-2009 Owen Anderson <resistor@mac.com> Move ConstantExpr to 2.5 API.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77494 91177308-0d34-0410-b5e6-96231b3b80d8
xtractGV.cpp
lobalOpt.cpp
ergeFunctions.cpp
7b4f9f8b74cd8f8d476787763ea02030762b00e7 28-Jul-2009 Owen Anderson <resistor@mac.com> Change ConstantArray to 2.5 API.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77347 91177308-0d34-0410-b5e6-96231b3b80d8
xtractGV.cpp
lobalOpt.cpp
1fd7096407d5e598ed3366a1141548e71273f1c5 28-Jul-2009 Owen Anderson <resistor@mac.com> Change ConstantArray to 2.5 API.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77347 91177308-0d34-0410-b5e6-96231b3b80d8
xtractGV.cpp
lobalOpt.cpp
9c9f10e3c7667d9104b1ed98090cf0c84e90f8e0 28-Jul-2009 Owen Anderson <resistor@mac.com> Move ConstantStruct back to 2.5 API.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77266 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
8fa3338ed2400c1352b137613d2c2c70d1ead695 28-Jul-2009 Owen Anderson <resistor@mac.com> Move ConstantStruct back to 2.5 API.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77266 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
5d3ea9690f9045261c1e70c245fccc2b6b586aa6 26-Jul-2009 Daniel Dunbar <daniel@zuster.org> Remove Value::getName{Start,End}, the last of the old Name APIs.


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


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


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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77019 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
lobalOpt.cpp
nliner.cpp
nternalize.cpp
ergeFunctions.cpp
eacb44d0bb89c608c4465b7900eea3afc0f0be0d 25-Jul-2009 Owen Anderson <resistor@mac.com> Revert the ConstantInt constructors back to their 2.5 forms where possible, thanks to contexts-on-types. More to come.


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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77011 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
lobalOpt.cpp
owerSetJmp.cpp
56de36b1f34669355b1535fd73aaac4e6ab0131c 24-Jul-2009 Dan Gohman <gohman@apple.com> Convert several more passes to use getAnalysisIfAvailable<TargetData>()
instead of getAnalysis<TargetData>().


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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76982 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
1e13b9756098b2d657c09fc2910dd66f255d9592 24-Jul-2009 Daniel Dunbar <daniel@zuster.org> Switch to getNameStr().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76962 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
f6ccee5a9d2b9573f679bca6266ade3eb8cd3f88 24-Jul-2009 Daniel Dunbar <daniel@zuster.org> Switch to getNameStr().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76962 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
bbcb03b54884d73e5c2587ab12134a99ac7e9c1f 22-Jul-2009 Daniel Dunbar <daniel@zuster.org> Remove unnecessary store to temporary std::string.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76782 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
dfd3b647839d3f944b5d8bffd6e9a2ec022d3507 22-Jul-2009 Daniel Dunbar <daniel@zuster.org> Remove unnecessary store to temporary std::string.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76782 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
175b6540352920afd47979cecb8c2667a3f7fdd3 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
rgumentPromotion.cpp
eadArgumentElimination.cpp
eadTypeElimination.cpp
xtractGV.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
ndMemRemoval.cpp
nternalize.cpp
owerSetJmp.cpp
ergeFunctions.cpp
artialInlining.cpp
artialSpecialization.cpp
runeEH.cpp
aiseAllocations.cpp
tripDeadPrototypes.cpp
tripSymbols.cpp
tructRetPromotion.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
rgumentPromotion.cpp
eadArgumentElimination.cpp
eadTypeElimination.cpp
xtractGV.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
ndMemRemoval.cpp
nternalize.cpp
owerSetJmp.cpp
ergeFunctions.cpp
artialInlining.cpp
artialSpecialization.cpp
runeEH.cpp
aiseAllocations.cpp
tripDeadPrototypes.cpp
tripSymbols.cpp
tructRetPromotion.cpp
71f286c68d892cd26eab145e9de034f3d5fa41d4 21-Jul-2009 Owen Anderson <resistor@mac.com> Rename getConstantInt{True|False} to get{True|False} at Chris' behest.


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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76598 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
7c2347378f9cd367502093a19f615c3b181443c5 21-Jul-2009 Ted Kremenek <kremenek@apple.com> Update CMake files.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76595 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
c55db82cd0417d7e27655136f13868ff9540f6ee 21-Jul-2009 Ted Kremenek <kremenek@apple.com> Update CMake files.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76595 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
1e0e0d15d2749d27af05086f860cc2204f1f828e 20-Jul-2009 Chris Lattner <sabre@nondot.org> implement a new magic global "llvm.compiler.used" which is like llvm.used, but
doesn't cause ".no_dead_strip" to be emitted on darwin.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76399 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
tripSymbols.cpp
401e10c4fbfcdcfade5065093e2ca97f69a1d144 20-Jul-2009 Chris Lattner <sabre@nondot.org> implement a new magic global "llvm.compiler.used" which is like llvm.used, but
doesn't cause ".no_dead_strip" to be emitted on darwin.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76399 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
tripSymbols.cpp
41a0785fdd228e1563e606f650cef9b3617ab29e 20-Jul-2009 Bill Wendling <isanbard@gmail.com> Add plumbing for the `linker_private' linkage type. This type is meant for
"private" symbols which the assember shouldn't strip, but which the linker may
remove after evaluation. This is mostly useful for Objective-C metadata.

This is plumbing, so we don't have a use of it yet. More to come, etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76385 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
3d10a5a75794356a0a568ce283713adc3a963200 20-Jul-2009 Bill Wendling <isanbard@gmail.com> Add plumbing for the `linker_private' linkage type. This type is meant for
"private" symbols which the assember shouldn't strip, but which the linker may
remove after evaluation. This is mostly useful for Objective-C metadata.

This is plumbing, so we don't have a use of it yet. More to come, etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76385 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
bf4732d2c143398dbc48e031a4034f3650e11311 18-Jul-2009 Eli Friedman <eli.friedman@gmail.com> Add line breaks to make the debug output a bit more readable.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76284 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
ef6ab66bcfdbd87f2e25c720e7e1dca7e36cf269 18-Jul-2009 Eli Friedman <eli.friedman@gmail.com> Add line breaks to make the debug output a bit more readable.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76284 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
e1f1f82a2c1506c57f77df09c0a86de6e59ff952 16-Jul-2009 Owen Anderson <resistor@mac.com> Move the ConstantInt uniquing table into LLVMContextImpl. This exposed a number of issues in
our current context-passing stuff, which is also fixed here


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76089 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
eadTypeElimination.cpp
xtractGV.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
ndMemRemoval.cpp
nternalize.cpp
owerSetJmp.cpp
ergeFunctions.cpp
artialInlining.cpp
artialSpecialization.cpp
aiseAllocations.cpp
tripDeadPrototypes.cpp
tripSymbols.cpp
001dbfebcbbded8c8e74b19e838b50da2b6c6fb5 16-Jul-2009 Owen Anderson <resistor@mac.com> Move the ConstantInt uniquing table into LLVMContextImpl. This exposed a number of issues in
our current context-passing stuff, which is also fixed here


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76089 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
eadTypeElimination.cpp
xtractGV.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
ndMemRemoval.cpp
nternalize.cpp
owerSetJmp.cpp
ergeFunctions.cpp
artialInlining.cpp
artialSpecialization.cpp
aiseAllocations.cpp
tripDeadPrototypes.cpp
tripSymbols.cpp
140166dfcd14dc05ebca646f41d1dfe155718182 16-Jul-2009 Owen Anderson <resistor@mac.com> Revert yesterday's change by removing the LLVMContext parameter to AllocaInst and MallocInst.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75863 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
lobalOpt.cpp
ndMemRemoval.cpp
owerSetJmp.cpp
aiseAllocations.cpp
tructRetPromotion.cpp
50dead06ffc107edb7e84857baaeeb09039c631c 16-Jul-2009 Owen Anderson <resistor@mac.com> Revert yesterday's change by removing the LLVMContext parameter to AllocaInst and MallocInst.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75863 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
lobalOpt.cpp
ndMemRemoval.cpp
owerSetJmp.cpp
aiseAllocations.cpp
tructRetPromotion.cpp
9f5b2aa7fba203469386acc413c23dd41a713bc9 15-Jul-2009 Owen Anderson <resistor@mac.com> Move EVER MORE stuff over to LLVMContext.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75703 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
lobalOpt.cpp
ndMemRemoval.cpp
owerSetJmp.cpp
aiseAllocations.cpp
tructRetPromotion.cpp
9adc0abad3c3ed40a268ccbcee0c74cb9e1359fe 15-Jul-2009 Owen Anderson <resistor@mac.com> Move EVER MORE stuff over to LLVMContext.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75703 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
lobalOpt.cpp
ndMemRemoval.cpp
owerSetJmp.cpp
aiseAllocations.cpp
tructRetPromotion.cpp
bd448e3ca993226084d7f53445388fcd8e46b996 14-Jul-2009 Edwin Török <edwintorok@gmail.com> llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.
This adds location info for all llvm_unreachable calls (which is a macro now) in
!NDEBUG builds.
In NDEBUG builds location info and the message is off (it only prints
"UREACHABLE executed").


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75640 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
ergeFunctions.cpp
c23197a26f34f559ea9797de51e187087c039c42 14-Jul-2009 Torok Edwin <edwintorok@gmail.com> llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.
This adds location info for all llvm_unreachable calls (which is a macro now) in
!NDEBUG builds.
In NDEBUG builds location info and the message is off (it only prints
"UREACHABLE executed").


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75640 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
ergeFunctions.cpp
035d41d6c7abc88fc6be5f7f4eb8fe959fe97323 13-Jul-2009 Owen Anderson <resistor@mac.com> Move more functionality over to LLVMContext.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75497 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
73c6b7127aff4499e4d6a2edb219685aee178ee1 13-Jul-2009 Owen Anderson <resistor@mac.com> Move more functionality over to LLVMContext.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75497 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
675d56222b6b98d2c22a17aaf69a036e57d5426a 11-Jul-2009 Edwin Török <edwintorok@gmail.com> assert(0) -> LLVM_UNREACHABLE.
Make llvm_unreachable take an optional string, thus moving the cerr<< out of
line.
LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for
NDEBUG builds.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75379 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
ergeFunctions.cpp
c25e7581b9b8088910da31702d4ca21c4734c6d7 11-Jul-2009 Torok Edwin <edwintorok@gmail.com> assert(0) -> LLVM_UNREACHABLE.
Make llvm_unreachable take an optional string, thus moving the cerr<< out of
line.
LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for
NDEBUG builds.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75379 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
ergeFunctions.cpp
6601fcdc38a21a39ac124f2bd8794846519b6455 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
lobalOpt.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
lobalOpt.cpp
e17fc1d7a2bcc05efc0ebe943254b273c99d77fd 08-Jul-2009 Owen Anderson <resistor@mac.com> Switch GlobalVariable ctors to a sane API, where *either* a context or a module is required.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75025 91177308-0d34-0410-b5e6-96231b3b80d8
xtractGV.cpp
lobalOpt.cpp
e9b11b431308f4766b73cda93e38ec930c912122 08-Jul-2009 Owen Anderson <resistor@mac.com> Switch GlobalVariable ctors to a sane API, where *either* a context or a module is required.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75025 91177308-0d34-0410-b5e6-96231b3b80d8
xtractGV.cpp
lobalOpt.cpp
e0f136d9637981bbc5096ca396e4df383c59eafe 08-Jul-2009 Owen Anderson <resistor@mac.com> Push LLVMContext through GlobalVariables and IRBuilder.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74985 91177308-0d34-0410-b5e6-96231b3b80d8
xtractGV.cpp
lobalOpt.cpp
3d29df3e8a203b167d8071ea6f805b21db18a5af 08-Jul-2009 Owen Anderson <resistor@mac.com> Push LLVMContext through GlobalVariables and IRBuilder.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74985 91177308-0d34-0410-b5e6-96231b3b80d8
xtractGV.cpp
lobalOpt.cpp
5349f05e4c7c8a54751db96006d811752644011b 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
lobalOpt.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
lobalOpt.cpp
e755b09fd18cdd5e4776016930df45106748ce54 07-Jul-2009 Owen Anderson <resistor@mac.com> Finish LLVMContext-ing lib/Analysis. This required pushing LLVMContext's through the ValueTracking API.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74873 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
76f600b205606a055ec35e7d3fd1a99602329d67 07-Jul-2009 Owen Anderson <resistor@mac.com> Finish LLVMContext-ing lib/Analysis. This required pushing LLVMContext's through the ValueTracking API.


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


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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74844 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
086ea05299f2a6ffc2e283c70ef4ef39897db6a3 06-Jul-2009 Owen Anderson <resistor@mac.com> More LLVMContext-ification.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74811 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
xtractGV.cpp
lobalOpt.cpp
PConstantPropagation.cpp
owerSetJmp.cpp
ergeFunctions.cpp
runeEH.cpp
aiseAllocations.cpp
tripSymbols.cpp
tructRetPromotion.cpp
14ce9ef2e9013ba56e1daafebd91fe3ee1e8647e 06-Jul-2009 Owen Anderson <resistor@mac.com> More LLVMContext-ification.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74811 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
xtractGV.cpp
lobalOpt.cpp
PConstantPropagation.cpp
owerSetJmp.cpp
ergeFunctions.cpp
runeEH.cpp
aiseAllocations.cpp
tripSymbols.cpp
tructRetPromotion.cpp
efd53dd02c0c5f0f69566ed624ab3df84dd13cb4 03-Jul-2009 Duncan Sands <baldrick@free.fr> Add newline at end of file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74773 91177308-0d34-0410-b5e6-96231b3b80d8
artialInlining.cpp
d5f50da7f06199c03de1294981e35cfd1c4d53dd 03-Jul-2009 Duncan Sands <baldrick@free.fr> Add newline at end of file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74773 91177308-0d34-0410-b5e6-96231b3b80d8
artialInlining.cpp
3fd51c08231f27cb280cab51d72e8b5f6f096e32 01-Jul-2009 Chris Lattner <sabre@nondot.org> improve the APIs for creating struct and function types with no arguments/elements
to not have to create a temporary vector (in the API at least). Patch by Jay Foad!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74584 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
aiseAllocations.cpp
0fd38069cb6699ce21eb159f22d3f23c012c9e81 01-Jul-2009 Chris Lattner <sabre@nondot.org> improve the APIs for creating struct and function types with no arguments/elements
to not have to create a temporary vector (in the API at least). Patch by Jay Foad!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74584 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
aiseAllocations.cpp
166f843a9f6913e1699b343b8adeecce568274d7 26-Jun-2009 Devang Patel <dpatel@apple.com> Remove debug info anchors - llvm.dbg.compile_units, llvm.dbg.subprograms
and llvm.dbg.global_variables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74251 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
13e16b65ddd679d6edb5f182d683701fdea37b85 26-Jun-2009 Devang Patel <dpatel@apple.com> Remove debug info anchors - llvm.dbg.compile_units, llvm.dbg.subprograms
and llvm.dbg.global_variables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74251 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
961b5d2c75a25ac3e92ad442117d8191ce9d34d8 17-Jun-2009 Sanjiv Gupta <sanjiv.gupta@microchip.com> >> What if my global variable was into a different address space than stack?
>>
>
> It doesn't matter in terms of semantics: because AnalyzeGlobal
> returned false, we're guaranteed the address of the global is never
> taken. I wouldn't be surprised if we end up generating invalid IR in
> some cases, though, because of the semantics of replaceAllUsesWith.
> Do you have a testcase that breaks?
>
>
The problem is replaceAllUsesWith asserts for type mismatch here. Try attached .bc with llvm-ld.

assert(New->getType() == getType() &&
"replaceAllUses of value with new value of different type!");

Since stack is always on address space zero, I don't think that type of GV in a different address space is ever going to match.
The other way is to allow replaceAllUsesWith to ignore address spaces while comparing types. (do we have a way to do that ?).
But then such an optimization may fail the entire idea of user wanting to place a variable into different memory space. The original idea of user might be to save on the stack space (data memory) and hence he asked the variable to be placed into different memory space (program memory). So the best bet here is to deny this optimization by checking

GV->getType()->getAddressSpace() == 0.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73605 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
059aa8c604ddbc5fd88a981f2218713aea4f49a9 17-Jun-2009 Sanjiv Gupta <sanjiv.gupta@microchip.com> >> What if my global variable was into a different address space than stack?
>>
>
> It doesn't matter in terms of semantics: because AnalyzeGlobal
> returned false, we're guaranteed the address of the global is never
> taken. I wouldn't be surprised if we end up generating invalid IR in
> some cases, though, because of the semantics of replaceAllUsesWith.
> Do you have a testcase that breaks?
>
>
The problem is replaceAllUsesWith asserts for type mismatch here. Try attached .bc with llvm-ld.

assert(New->getType() == getType() &&
"replaceAllUses of value with new value of different type!");

Since stack is always on address space zero, I don't think that type of GV in a different address space is ever going to match.
The other way is to allow replaceAllUsesWith to ignore address spaces while comparing types. (do we have a way to do that ?).
But then such an optimization may fail the entire idea of user wanting to place a variable into different memory space. The original idea of user might be to save on the stack space (data memory) and hence he asked the variable to be placed into different memory space (program memory). So the best bet here is to deny this optimization by checking

GV->getType()->getAddressSpace() == 0.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73605 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
ff67202168b77156c369aff139accd709f166ea6 15-Jun-2009 Owen Anderson <resistor@mac.com> Merge PartialInliner changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73412 91177308-0d34-0410-b5e6-96231b3b80d8
artialInlining.cpp
636768458f9c74b6062f1d9f159b6a0464b208c4 15-Jun-2009 Owen Anderson <resistor@mac.com> Merge PartialInliner changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73412 91177308-0d34-0410-b5e6-96231b3b80d8
artialInlining.cpp
9e1657f79a7cf86a12be2c0a2b4ae4a2600266c6 15-Jun-2009 Dan Gohman <gohman@apple.com> Fix old-style type names in comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73362 91177308-0d34-0410-b5e6-96231b3b80d8
aiseAllocations.cpp
a119de86a064414622562cfe32953de7f9b0ee40 15-Jun-2009 Dan Gohman <gohman@apple.com> Fix old-style type names in comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73362 91177308-0d34-0410-b5e6-96231b3b80d8
aiseAllocations.cpp
d8c88d5903b2e468caebfd2d893ff1a3060cc9ab 14-Jun-2009 Edwin Török <edwintorok@gmail.com> Fix CMake build. Patch from Ingmar Vanhassel.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73342 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
caf6b2bbaf40580596e974b5eee0a7e59b58bd98 14-Jun-2009 Torok Edwin <edwintorok@gmail.com> Fix CMake build. Patch from Ingmar Vanhassel.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73342 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
f2d29738e0c93510cc3dd8909567653a888410c5 14-Jun-2009 Owen Anderson <resistor@mac.com> Add an early implementation of a partial inlining pass. The idea behind this
is that, for functions whose bodies are entirely guarded by an if-statement, it
can be profitable to pull the test out of the callee and into the caller.

This code has had some cursory testing, but still has a number of known issues
on the LLVM test suite.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73338 91177308-0d34-0410-b5e6-96231b3b80d8
artialInlining.cpp
ca399021d47d640551eb786620bcd108e1758485 14-Jun-2009 Owen Anderson <resistor@mac.com> Add an early implementation of a partial inlining pass. The idea behind this
is that, for functions whose bodies are entirely guarded by an if-statement, it
can be profitable to pull the test out of the callee and into the caller.

This code has had some cursory testing, but still has a number of known issues
on the LLVM test suite.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73338 91177308-0d34-0410-b5e6-96231b3b80d8
artialInlining.cpp
6b36c8f67ac93b8a9366a0edc5f127991f7a5ade 13-Jun-2009 Nick Lewycky <nicholas@mxc.ca> Unlike the other instructions, GEP really does need to look at the type of a
pointer. This fixes kimwitu++. Pointed out by Frits van Bommel on review!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73299 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
a142c9302b690cda799737d78ec29414e3b47fc8 13-Jun-2009 Nick Lewycky <nicholas@mxc.ca> Unlike the other instructions, GEP really does need to look at the type of a
pointer. This fixes kimwitu++. Pointed out by Frits van Bommel on review!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73299 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
c0273dad1f2c8226d1c55cd1429794d6415e8adc 12-Jun-2009 Dan Gohman <gohman@apple.com> Give Instruction::isSameOperationAs a corresponding comment to note
the relationship with MergeFunctions.cpp's isEquivalentOperation,
and make a trivial code reordering so that the two functions are
easier to compare.

Fix the name of Instruction::isSameOperationAs in MergeFunction.cpp's
isEquivalentOperation's comment, and fix a nearby 80-column violation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73241 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
194ae785e1f94619cbdcdcf2921caa6997277d32 12-Jun-2009 Dan Gohman <gohman@apple.com> Give Instruction::isSameOperationAs a corresponding comment to note
the relationship with MergeFunctions.cpp's isEquivalentOperation,
and make a trivial code reordering so that the two functions are
easier to compare.

Fix the name of Instruction::isSameOperationAs in MergeFunction.cpp's
isEquivalentOperation's comment, and fix a nearby 80-column violation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73241 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
3867f09c00d3df76d6e87b112d46154ba909a757 12-Jun-2009 Nick Lewycky <nicholas@mxc.ca> Keep callers of a weak function calling it, instead of the non-weak equivalent.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73235 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
93531e49867aca33629a54073241481202635d3e 12-Jun-2009 Nick Lewycky <nicholas@mxc.ca> Keep callers of a weak function calling it, instead of the non-weak equivalent.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73235 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
369c197a9ee80255f57eb683e3753055d046d3cf 12-Jun-2009 Nick Lewycky <nicholas@mxc.ca> Don't forget to match the calling convention when producing a thunk.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73231 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
b3c36c9c9aba3fce8ae35b52eda4192531a9d3df 12-Jun-2009 Nick Lewycky <nicholas@mxc.ca> Don't forget to match the calling convention when producing a thunk.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73231 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
f4dcd8a81ee3bf239caa9e3988b8fe6c0dbbd381 12-Jun-2009 Nick Lewycky <nicholas@mxc.ca> Given two identical weak functions, produce one internal function and two weak
thunks.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73230 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
8728d7a3ea7cad3297f9ab0984358007238ae83a 12-Jun-2009 Nick Lewycky <nicholas@mxc.ca> Given two identical weak functions, produce one internal function and two weak
thunks.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73230 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
270132623116c918337f216f6006a8be6f67d55e 12-Jun-2009 Nick Lewycky <nicholas@mxc.ca> Add an "are types equivalent" operation that ignores the types that a pointer
points to while analyzing all other fields.

Use FoldingSetNodeID to produce a good hash. This dramatically decreases run
times.

Emit thunks. This means that it can look at all functions regardless of what
the linkage is or if the address is taken, but unfortunately some small
functions can be even shorter than the thunk because our backend doesn't yet
realize it can just turn these into jumps. This means that this pass will
pessimize code on average.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73222 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
287de607dc3e05aa287edf4e3b6aa29e6c4517c9 12-Jun-2009 Nick Lewycky <nicholas@mxc.ca> Add an "are types equivalent" operation that ignores the types that a pointer
points to while analyzing all other fields.

Use FoldingSetNodeID to produce a good hash. This dramatically decreases run
times.

Emit thunks. This means that it can look at all functions regardless of what
the linkage is or if the address is taken, but unfortunately some small
functions can be even shorter than the thunk because our backend doesn't yet
realize it can just turn these into jumps. This means that this pass will
pessimize code on average.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73222 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
1379d599ff83cbb9cc9e7b782a16ebbb68b0581c 10-Jun-2009 Jay Foad <jay.foad@gmail.com> Implement and use new method Function::hasAddressTaken().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73164 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
lobalOpt.cpp
757068f3bad425fb126fe16ab7b8a82a636e6bbd 10-Jun-2009 Jay Foad <jay.foad@gmail.com> Implement and use new method Function::hasAddressTaken().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73164 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
lobalOpt.cpp
e49143534aa59881e9bdd826aebd7b8d6bd7408c 09-Jun-2009 Jay Foad <jay.foad@gmail.com> Remove an unused function SafeToDestroyConstant(). Rename an almost
identical function ConstantIsDead() to SafeToDestroyConstant(), to
emphasise the connection with Constant::destroyConstant().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73149 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
lobalOpt.cpp
e3acf159d968b5a9db350203d8160a4d3c2d1a43 09-Jun-2009 Jay Foad <jay.foad@gmail.com> Remove an unused function SafeToDestroyConstant(). Rename an almost
identical function ConstantIsDead() to SafeToDestroyConstant(), to
emphasise the connection with Constant::destroyConstant().

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73149 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
lobalOpt.cpp
d1d6a14f4b5809d249120f5ffaf6de84c1901398 06-Jun-2009 Jay Foad <jay.foad@gmail.com> Use cast<> instead of dyn_cast<> for things that are known to be
Instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73002 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
PConstantPropagation.cpp
0906b1bf09769d5301e62d372b363b4cd0b5a6c7 06-Jun-2009 Jay Foad <jay.foad@gmail.com> Use cast<> instead of dyn_cast<> for things that are known to be
Instructions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73002 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
PConstantPropagation.cpp
b00d928b57f8c212ab25ce3b7480845e53ce909c 02-Jun-2009 Evan Cheng <evan.cheng@apple.com> Avoid infinite looping in AllGlobalLoadUsesSimpleEnoughForHeapSRA(). This can happen when PHI uses are recursively dependent on each other.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72710 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
5d16396a33bfaa76da99c97c526a737af9618d05 02-Jun-2009 Evan Cheng <evan.cheng@apple.com> Avoid infinite looping in AllGlobalLoadUsesSimpleEnoughForHeapSRA(). This can happen when PHI uses are recursively dependent on each other.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72710 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
6fc3a5f7fc346f394fcd6a2d41c015af1be639e5 23-May-2009 Edwin Török <edwintorok@gmail.com> available_externall linkage is not local, this was confusing the codegenerator,
and it wasn't generating calls through @PLT for these functions.
hasLocalLinkage() is now false for available_externally,
I attempted to fix the inliner and dce to handle available_externally properly.
It passed make check.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72328 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
nliner.cpp
f5ff1d335b76170c2c715d5f13e6ed598b2b5677 23-May-2009 Torok Edwin <edwintorok@gmail.com> available_externall linkage is not local, this was confusing the codegenerator,
and it wasn't generating calls through @PLT for these functions.
hasLocalLinkage() is now false for available_externally,
I attempted to fix the inliner and dce to handle available_externally properly.
It passed make check.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72328 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
nliner.cpp
ec4f97dd91023f63e05e94a333cdd2d4c57efedf 09-May-2009 Duncan Sands <baldrick@free.fr> Rename PaddedSize to AllocSize, in the hope that this
will make it more obvious what it represents, and stop
it being confused with the StoreSize.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71349 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
777d2306b36816a53bc1ae1244c0dc7d998ae691 09-May-2009 Duncan Sands <baldrick@free.fr> Rename PaddedSize to AllocSize, in the hope that this
will make it more obvious what it represents, and stop
it being confused with the StoreSize.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71349 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
7d73ce807adbc95b540340ce4ef5c4e778876dba 06-May-2009 Duncan Sands <baldrick@free.fr> Fix PR3754: don't mark functions that wrap MallocInst with
the readnone. Since MallocInst is scheduled for deletion
it doesn't seem worth doing anything more subtle, such as
having mayWriteToMemory return true for MallocInst.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71077 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
cfd0ebea276521a48370c197e651064b032a381e 06-May-2009 Duncan Sands <baldrick@free.fr> Fix PR3754: don't mark functions that wrap MallocInst with
the readnone. Since MallocInst is scheduled for deletion
it doesn't seem worth doing anything more subtle, such as
having mayWriteToMemory return true for MallocInst.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71077 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
0e670dfa277279463d7c8d8bba093c2b2160d9ff 03-May-2009 Nick Lewycky <nicholas@mxc.ca> Revert r70630. Go back to appending ".b" to internal globals when shrinking
them to bool.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70653 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
74e96b753ce2d17a3262dedc13b033bb7ce62c31 03-May-2009 Nick Lewycky <nicholas@mxc.ca> Revert r70630. Go back to appending ".b" to internal globals when shrinking
them to bool.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70653 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
e66f6f15e6afe3d437ccdca93f2209b3d4158486 02-May-2009 Dan Gohman <gohman@apple.com> The second argument to RecursivelyDeleteTriviallyDeadInstructions has
a default value, and will hopefully be going away soon.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70642 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
db2b946085f0a96a35d660f30e72afd5ff0575a0 02-May-2009 Dan Gohman <gohman@apple.com> The second argument to RecursivelyDeleteTriviallyDeadInstructions has
a default value, and will hopefully be going away soon.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70642 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
0e80b7cda155ef89dbac46d5d226bb333021b5f7 02-May-2009 Nick Lewycky <nicholas@mxc.ca> Don't append ".b" to the names of globals that are being shrunk to booleans.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70630 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
3e5206d4aa51829b72fd7b2b42652a484cfb9316 02-May-2009 Nick Lewycky <nicholas@mxc.ca> Don't append ".b" to the names of globals that are being shrunk to booleans.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70630 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
5b7dfbd89a0a0b7b59603bf9eb0f3f58534b4dd5 17-Apr-2009 David Greene <greened@obbligato.org> Use a safer iterator interface and get rid of std C++ library misuse.
This fixes a --enable-expensive-checks problem.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69353 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
417be400d742d9d7b13dadbbd5ff421e060e7292 17-Apr-2009 David Greene <greened@obbligato.org> Use a safer iterator interface and get rid of std C++ library misuse.
This fixes a --enable-expensive-checks problem.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69353 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
2c71b8f64f571b34e8df2a83120a2e889627b8d4 13-Apr-2009 Chris Lattner <sabre@nondot.org> eliminate unneeded parens.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68939 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
7004abf7dfccfda17a721315fb28b37d847352a9 13-Apr-2009 Chris Lattner <sabre@nondot.org> eliminate unneeded parens.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68939 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
16581bf931c0ccf2f8993397acfa4e1d509a68dc 24-Mar-2009 Dale Johannesen <dalej@apple.com> Use a SmallPtrSet instead of std::set.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67578 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
db0d867d9639be997eb8734a101505eb8fbc3b2f 24-Mar-2009 Dale Johannesen <dalej@apple.com> Use a SmallPtrSet instead of std::set.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67578 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
1f67ce4aa3f65619f54c8a3072539da5b0022841 19-Mar-2009 Dale Johannesen <dalej@apple.com> Clear the cached cost when removing a function in
the inliner; prevents nondeterministic behavior
when the same address is reallocated.
Don't build call graph nodes for debug intrinsic calls;
they're useless, and there were typically a lot of them.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67311 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
runeEH.cpp
b618d08af241953a4ae62336aa7a5a0787e4dffc 19-Mar-2009 Dale Johannesen <dalej@apple.com> Clear the cached cost when removing a function in
the inliner; prevents nondeterministic behavior
when the same address is reallocated.
Don't build call graph nodes for debug intrinsic calls;
they're useless, and there were typically a lot of them.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67311 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
runeEH.cpp
a5affdcf4cdae48ce1e20a42f8dec6fb6f1c3495 18-Mar-2009 Chris Lattner <sabre@nondot.org> aha, DAE does have to think about PHI nodes. Many thanks to "Dr Evil" (aka Duncan)
for pointing this out :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67212 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
39298eaf355931f6e1400988d3218de50ab3b4ed 18-Mar-2009 Chris Lattner <sabre@nondot.org> aha, DAE does have to think about PHI nodes. Many thanks to "Dr Evil" (aka Duncan)
for pointing this out :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67212 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
f023b54bcd817a7dea1a7f02f1db6f69eae3f0d6 18-Mar-2009 Chris Lattner <sabre@nondot.org> add an assertion to make it clear that PHI nodes are not allowed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67210 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
64dd20c3ef8d69592ee60d9fc35b17c76c2a7370 18-Mar-2009 Chris Lattner <sabre@nondot.org> add an assertion to make it clear that PHI nodes are not allowed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67210 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
bda0765e0763cd7d9b0980328fc1d718a6773628 18-Mar-2009 Chris Lattner <sabre@nondot.org> Fix PR3807 by inserting 'insertelement' instructions in the normal dest of
an invoke instead of after the invoke (in its block), which is invalid.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67139 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
118b766c7cc0ef519b4a9c5c775488e230fdbf16 18-Mar-2009 Chris Lattner <sabre@nondot.org> Fix PR3807 by inserting 'insertelement' instructions in the normal dest of
an invoke instead of after the invoke (in its block), which is invalid.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67139 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
4425240dbcb6e0da24f4a9f72cfb24f529f5b7af 13-Mar-2009 Dale Johannesen <dalej@apple.com> Fix -strip-debug-declare to work when there are
llvm.global.variable's but no llvm.declare's.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66977 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
dd031b7466fc2cb9c12d9f8adc682543e5f363ab 13-Mar-2009 Dale Johannesen <dalej@apple.com> Fix -strip-debug-declare to work when there are
llvm.global.variable's but no llvm.declare's.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66977 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
9a507cd915e6460bc7dadee2185c53df326274c1 13-Mar-2009 Bill Wendling <isanbard@gmail.com> Revert r66920. It was causing failures in the self-hosting buildbot (in release
mode).

Running /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/dg.exp ...
FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/crash-narrowfunctiontest.ll
Failed with signal(SIGBUS) at line 1
while running: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/crash-narrowfunctiontest.ll -bugpoint-crashcalls -silence-passes > /dev/null
0 bugpoint 0x0035dd25 llvm::sys::SetInterruptFunction(void (*)()) + 85
1 bugpoint 0x0035e382 llvm::sys::RemoveFileOnSignal(llvm::sys::Path const&, std::string*) + 706
2 libSystem.B.dylib 0x92f112bb _sigtramp + 43
3 libSystem.B.dylib 0xffffffff _sigtramp + 1829694831
4 bugpoint 0x00021d1c main + 92
5 bugpoint 0x00002106 start + 54
6 bugpoint 0x00000004 start + 18446744073709543220
Stack dump:
0. Program arguments: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/crash-narrowfunctiontest.ll -bugpoint-crashcalls -silence-passes

FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/misopt-basictest.ll
Failed with signal(SIGBUS) at line 1
while running: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/misopt-basictest.ll -dce -bugpoint-deletecalls -simplifycfg -silence-passes
0 bugpoint 0x0035dd25 llvm::sys::SetInterruptFunction(void (*)()) + 85
1 bugpoint 0x0035e382 llvm::sys::RemoveFileOnSignal(llvm::sys::Path const&, std::string*) + 706
2 libSystem.B.dylib 0x92f112bb _sigtramp + 43
3 libSystem.B.dylib 0xffffffff _sigtramp + 1829694831
4 bugpoint 0x00021d1c main + 92
5 bugpoint 0x00002106 start + 54
6 bugpoint 0x00000006 start + 18446744073709543222
Stack dump:
0. Program arguments: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/misopt-basictest.ll -dce -bugpoint-deletecalls -simplifycfg -silence-passes

FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/remove_arguments_test.ll
Failed with signal(SIGBUS) at line 1
while running: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/remove_arguments_test.ll -bugpoint-crashcalls -silence-passes
0 bugpoint 0x0035dd25 llvm::sys::SetInterruptFunction(void (*)()) + 85
1 bugpoint 0x0035e382 llvm::sys::RemoveFileOnSignal(llvm::sys::Path const&, std::string*) + 706
2 libSystem.B.dylib 0x92f112bb _sigtramp + 43
3 libSystem.B.dylib 0xffffffff _sigtramp + 1829694831
4 bugpoint 0x00021d1c main + 92
5 bugpoint 0x00002106 start + 54
Stack dump:
0. Program arguments: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/remove_arguments_test.ll -bugpoint-crashcalls -silence-passes

--- Reverse-merging (from foreign repository) r66920 into '.':
U include/llvm/Support/CallSite.h
U include/llvm/Instructions.h
U lib/Analysis/IPA/GlobalsModRef.cpp
U lib/Analysis/IPA/Andersens.cpp
U lib/Bitcode/Writer/BitcodeWriter.cpp
U lib/VMCore/Instructions.cpp
U lib/VMCore/Verifier.cpp
U lib/VMCore/AsmWriter.cpp
U lib/Transforms/Utils/LowerInvoke.cpp
U lib/Transforms/Scalar/SimplifyCFGPass.cpp
U lib/Transforms/IPO/PruneEH.cpp
U lib/Transforms/IPO/DeadArgumentElimination.cpp



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66953 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
runeEH.cpp
69b4a53e15d23fa5e3d5b7d189d8eced4f97ffc5 13-Mar-2009 Bill Wendling <isanbard@gmail.com> Revert r66920. It was causing failures in the self-hosting buildbot (in release
mode).

Running /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/dg.exp ...
FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/crash-narrowfunctiontest.ll
Failed with signal(SIGBUS) at line 1
while running: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/crash-narrowfunctiontest.ll -bugpoint-crashcalls -silence-passes > /dev/null
0 bugpoint 0x0035dd25 llvm::sys::SetInterruptFunction(void (*)()) + 85
1 bugpoint 0x0035e382 llvm::sys::RemoveFileOnSignal(llvm::sys::Path const&, std::string*) + 706
2 libSystem.B.dylib 0x92f112bb _sigtramp + 43
3 libSystem.B.dylib 0xffffffff _sigtramp + 1829694831
4 bugpoint 0x00021d1c main + 92
5 bugpoint 0x00002106 start + 54
6 bugpoint 0x00000004 start + 18446744073709543220
Stack dump:
0. Program arguments: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/crash-narrowfunctiontest.ll -bugpoint-crashcalls -silence-passes

FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/misopt-basictest.ll
Failed with signal(SIGBUS) at line 1
while running: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/misopt-basictest.ll -dce -bugpoint-deletecalls -simplifycfg -silence-passes
0 bugpoint 0x0035dd25 llvm::sys::SetInterruptFunction(void (*)()) + 85
1 bugpoint 0x0035e382 llvm::sys::RemoveFileOnSignal(llvm::sys::Path const&, std::string*) + 706
2 libSystem.B.dylib 0x92f112bb _sigtramp + 43
3 libSystem.B.dylib 0xffffffff _sigtramp + 1829694831
4 bugpoint 0x00021d1c main + 92
5 bugpoint 0x00002106 start + 54
6 bugpoint 0x00000006 start + 18446744073709543222
Stack dump:
0. Program arguments: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/misopt-basictest.ll -dce -bugpoint-deletecalls -simplifycfg -silence-passes

FAIL: /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/remove_arguments_test.ll
Failed with signal(SIGBUS) at line 1
while running: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/remove_arguments_test.ll -bugpoint-crashcalls -silence-passes
0 bugpoint 0x0035dd25 llvm::sys::SetInterruptFunction(void (*)()) + 85
1 bugpoint 0x0035e382 llvm::sys::RemoveFileOnSignal(llvm::sys::Path const&, std::string*) + 706
2 libSystem.B.dylib 0x92f112bb _sigtramp + 43
3 libSystem.B.dylib 0xffffffff _sigtramp + 1829694831
4 bugpoint 0x00021d1c main + 92
5 bugpoint 0x00002106 start + 54
Stack dump:
0. Program arguments: bugpoint /Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvmCore/test/BugPoint/remove_arguments_test.ll -bugpoint-crashcalls -silence-passes

--- Reverse-merging (from foreign repository) r66920 into '.':
U include/llvm/Support/CallSite.h
U include/llvm/Instructions.h
U lib/Analysis/IPA/GlobalsModRef.cpp
U lib/Analysis/IPA/Andersens.cpp
U lib/Bitcode/Writer/BitcodeWriter.cpp
U lib/VMCore/Instructions.cpp
U lib/VMCore/Verifier.cpp
U lib/VMCore/AsmWriter.cpp
U lib/Transforms/Utils/LowerInvoke.cpp
U lib/Transforms/Scalar/SimplifyCFGPass.cpp
U lib/Transforms/IPO/PruneEH.cpp
U lib/Transforms/IPO/DeadArgumentElimination.cpp



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66953 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
runeEH.cpp
b14cda3c0dea98bdd44c2f209afaf4fb36d42a8a 13-Mar-2009 Gabor Greif <ggreif@gmail.com> Second installment of "BasicBlock operands to the back"
changes.

For InvokeInst now all arguments begin at op_begin().
The Callee, Cont and Fail are now faster to get by
access relative to op_end().

This patch introduces some temporary uglyness in CallSite.
Next I'll bring CallInst up to a similar scheme and then
the uglyness will magically vanish.

This patch also exposes all the reliance of the libraries
on InvokeInst's operand ordering. I am thinking of taking
care of that too.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66920 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
runeEH.cpp
7c751027906e033b3dd3860c114945c9019328bc 13-Mar-2009 Gabor Greif <ggreif@gmail.com> Second installment of "BasicBlock operands to the back"
changes.

For InvokeInst now all arguments begin at op_begin().
The Callee, Cont and Fail are now faster to get by
access relative to op_end().

This patch introduces some temporary uglyness in CallSite.
Next I'll bring CallInst up to a similar scheme and then
the uglyness will magically vanish.

This patch also exposes all the reliance of the libraries
on InvokeInst's operand ordering. I am thinking of taking
care of that too.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66920 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
runeEH.cpp
412a4469746d468c46b7e7e4f1c77407dab0a1ce 10-Mar-2009 Devang Patel <dpatel@apple.com> Ignore debug info while evaluating function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66490 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
5b1082bc496123ff4cf1ef64368feac36f24fbb6 10-Mar-2009 Devang Patel <dpatel@apple.com> Ignore debug info while evaluating function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66490 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
d07128c906c4b8b64ddc8cb7b14db67d77128b5d 09-Mar-2009 Devang Patel <dpatel@apple.com> Remove llvm.dbg.global_variables also.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66471 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
3a402b08cf903b02e1eabc6cef8a4186ddc87936 09-Mar-2009 Devang Patel <dpatel@apple.com> Remove llvm.dbg.global_variables also.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66471 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
23e528be8069ead5f598e4043481fa2ef122a0e6 09-Mar-2009 Devang Patel <dpatel@apple.com> Add helper pass to remove llvm.dbg.declare intrinsics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66454 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
3876c8aa7e9046c815d6b7a5c45a7287a3c6efe4 09-Mar-2009 Devang Patel <dpatel@apple.com> Add helper pass to remove llvm.dbg.declare intrinsics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66454 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
ee199f72bbc8984eab542ed982f75c5acf42256f 09-Mar-2009 Duncan Sands <baldrick@free.fr> This debug info special case should no longer
be needed now that these intrinsics are marked
as not accessing memory.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66420 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
2967db26f43d968b2ee45cedeebac876f160fc40 09-Mar-2009 Duncan Sands <baldrick@free.fr> This debug info special case should no longer
be needed now that these intrinsics are marked
as not accessing memory.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66420 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
d694a789cb3dd2944280c9601f912db92c855472 08-Mar-2009 Nick Lewycky <nicholas@mxc.ca> Keep calling-convention and tail-call bit when creating new invoke or call.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66384 91177308-0d34-0410-b5e6-96231b3b80d8
artialSpecialization.cpp
b08d7f0d11d83ab98e8c417cf2cf2374b7534258 08-Mar-2009 Nick Lewycky <nicholas@mxc.ca> Keep calling-convention and tail-call bit when creating new invoke or call.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66384 91177308-0d34-0410-b5e6-96231b3b80d8
artialSpecialization.cpp
4bfba9da0afb00ea1cc7df764da03ed9ebb7676b 08-Mar-2009 Nick Lewycky <nicholas@mxc.ca> Fix comments, pointed out by Duncan Sands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66381 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
9cc582afe2902cd8695c8d55f87534fc681372cb 08-Mar-2009 Nick Lewycky <nicholas@mxc.ca> Fix comments, pointed out by Duncan Sands.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66381 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
199aa3c09c6ec42da6165c5ba1415aaeeaf7c11f 08-Mar-2009 Nick Lewycky <nicholas@mxc.ca> Mark function returns as noalias.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66369 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
ca95e5cd6410f328000428d35e3e55af0b4d0bef 08-Mar-2009 Nick Lewycky <nicholas@mxc.ca> Mark function returns as noalias.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66369 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
8e10844ad0341fa4b0a1264324a3614903d8ff9e 08-Mar-2009 Chris Lattner <sabre@nondot.org> use MemTransferInst.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66362 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
b914b9547a31acdf7829a877b75e8928d2f01bb4 08-Mar-2009 Chris Lattner <sabre@nondot.org> use MemTransferInst.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66362 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
6f6923fd4fdab46c88503c71548e076dd7373b74 08-Mar-2009 Chris Lattner <sabre@nondot.org> fix a serious pessimization that Tron on IRC pointed out where we would
"boolify" pointers, generating really awful code because getting the pointer
value requires a load itself. Before:

_foo:
movb $1, _X.b
ret
_get:
xorl %ecx, %ecx
movb _X.b, %al
testb %al, %al
movl $_Y, %eax
cmove %ecx, %eax
ret

With the xform disabled:

_foo:
movl $_Y, _X
ret
_get:
movl _X, %eax
ret



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66351 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
e1d0fa1c2288e7141ee86c0c82093d75500ea144 08-Mar-2009 Chris Lattner <sabre@nondot.org> fix a serious pessimization that Tron on IRC pointed out where we would
"boolify" pointers, generating really awful code because getting the pointer
value requires a load itself. Before:

_foo:
movb $1, _X.b
ret
_get:
xorl %ecx, %ecx
movb _X.b, %al
testb %al, %al
movl $_Y, %eax
cmove %ecx, %eax
ret

With the xform disabled:

_foo:
movl $_Y, _X
ret
_get:
movl _X, %eax
ret



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66351 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
667d4b8de6dea70195ff12ef39a4deebffa2f5c7 07-Mar-2009 Duncan Sands <baldrick@free.fr> Introduce new linkage types linkonce_odr, weak_odr, common_odr
and extern_weak_odr. These are the same as the non-odr versions,
except that they indicate that the global will only be overridden
by an *equivalent* global. In C, a function with weak linkage can
be overridden by a function which behaves completely differently.
This means that IP passes have to skip weak functions, since any
deductions made from the function definition might be wrong, since
the definition could be replaced by something completely different
at link time. This is not allowed in C++, thanks to the ODR
(One-Definition-Rule): if a function is replaced by another at
link-time, then the new function must be the same as the original
function. If a language knows that a function or other global can
only be overridden by an equivalent global, it can give it the
weak_odr linkage type, and the optimizers will understand that it
is alright to make deductions based on the function body. The
code generators on the other hand map weak and weak_odr linkage
to the same thing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66339 91177308-0d34-0410-b5e6-96231b3b80d8
ndMemRemoval.cpp
19d161f714b83cd850fe489aa3fdaa3d3744157b 07-Mar-2009 Duncan Sands <baldrick@free.fr> Introduce new linkage types linkonce_odr, weak_odr, common_odr
and extern_weak_odr. These are the same as the non-odr versions,
except that they indicate that the global will only be overridden
by an *equivalent* global. In C, a function with weak linkage can
be overridden by a function which behaves completely differently.
This means that IP passes have to skip weak functions, since any
deductions made from the function definition might be wrong, since
the definition could be replaced by something completely different
at link time. This is not allowed in C++, thanks to the ODR
(One-Definition-Rule): if a function is replaced by another at
link-time, then the new function must be the same as the original
function. If a language knows that a function or other global can
only be overridden by an equivalent global, it can give it the
weak_odr linkage type, and the optimizers will understand that it
is alright to make deductions based on the function body. The
code generators on the other hand map weak and weak_odr linkage
to the same thing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66339 91177308-0d34-0410-b5e6-96231b3b80d8
ndMemRemoval.cpp
57c03831ccaabd619d1d7eb164375e7e3027031d 06-Mar-2009 Chris Lattner <sabre@nondot.org> add a bunch more passes to the C bindings (PR3734), patch by
Lennart Augustsson!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66272 91177308-0d34-0410-b5e6-96231b3b80d8
PO.cpp
25a899903465b6356984edf150d50dbe43ada882 06-Mar-2009 Chris Lattner <sabre@nondot.org> add a bunch more passes to the C bindings (PR3734), patch by
Lennart Augustsson!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66272 91177308-0d34-0410-b5e6-96231b3b80d8
PO.cpp
fc5940d2a09a795e683ae86b237d6f55fb3551d4 06-Mar-2009 Duncan Sands <baldrick@free.fr> While thinking about the one-definition-rule and trying
to find a tiny mouse hole to squeeze through, it struck
me that globals without a name can be considered internal
since they can't be referenced from outside the current
module. This patch makes GlobalOpt give them internal
linkage. Also done for aliases even though they always
have names, since in my opinion anonymous aliases should
be allowed for consistency with global variables and
functions. So if that happens one day, this code is ready!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66267 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
0c7b63356c52e94b98d574343c581ca196cb1a2d 06-Mar-2009 Duncan Sands <baldrick@free.fr> While thinking about the one-definition-rule and trying
to find a tiny mouse hole to squeeze through, it struck
me that globals without a name can be considered internal
since they can't be referenced from outside the current
module. This patch makes GlobalOpt give them internal
linkage. Also done for aliases even though they always
have names, since in my opinion anonymous aliases should
be allowed for consistency with global variables and
functions. So if that happens one day, this code is ready!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66267 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
771281f1806ba3299fb515f59bd2f726a6a7a77e 06-Mar-2009 Devang Patel <dpatel@apple.com> Revert 66224.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66233 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
9b951559061c60e5dc9dfb51f7defe7b96ad31a3 06-Mar-2009 Devang Patel <dpatel@apple.com> Revert 66224.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66233 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
743cdf8edf21d96b3d155eb322578936aebc4876 06-Mar-2009 Devang Patel <dpatel@apple.com> Revert rev. 66167.
We are still not out of woods yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66232 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
3b6b19e769460219103cc49e5393be2805b5e806 06-Mar-2009 Devang Patel <dpatel@apple.com> Revert rev. 66167.
We are still not out of woods yet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66232 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
f70bda2f8175db0e0ea24d080a8e5c921b95a74c 06-Mar-2009 Devang Patel <dpatel@apple.com> Do not let debug info prevert globalopt from shriking a global vars to boolean.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66224 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
08600f0c51738348b30fc8f5bf118d8f8bea1ed5 06-Mar-2009 Devang Patel <dpatel@apple.com> Do not let debug info prevert globalopt from shriking a global vars to boolean.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66224 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
504960067233f271884c23869e81272918ad2883 05-Mar-2009 Devang Patel <dpatel@apple.com> GlobalOpt only process non constant local GVs while optimizing global vars.

If non constant local GV named A is used by a constant local GV named B (e.g. llvm.dbg.variable) and B is not used by anyone else then eliminate A as well as B.

In other words, debug info should not interfere in removal of unused GV.
--This life, and those below, will be ignored--

M test/Transforms/GlobalOpt/2009-03-03-dbg.ll
M lib/Transforms/IPO/GlobalOpt.cpp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66167 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
bdaaa1e25ef79a795400178255726fb1a246244d 05-Mar-2009 Devang Patel <dpatel@apple.com> GlobalOpt only process non constant local GVs while optimizing global vars.

If non constant local GV named A is used by a constant local GV named B (e.g. llvm.dbg.variable) and B is not used by anyone else then eliminate A as well as B.

In other words, debug info should not interfere in removal of unused GV.
--This life, and those below, will be ignored--

M test/Transforms/GlobalOpt/2009-03-03-dbg.ll
M lib/Transforms/IPO/GlobalOpt.cpp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66167 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
380c3ca0937e2a9ea9e5457f3e2d06e776d05341 04-Mar-2009 Bill Wendling <isanbard@gmail.com> Temporarily revert r65994. It was causing rdar://6646455.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66083 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
7525a58b44e2e8b3727db3efbb34466ac4ee1676 04-Mar-2009 Bill Wendling <isanbard@gmail.com> Temporarily revert r65994. It was causing rdar://6646455.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66083 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
7f6179d1d8723fdbd59ff105cecc4632d897e99d 04-Mar-2009 Devang Patel <dpatel@apple.com> If a global constant is dead then global's debug info should not prevent the optimizer in deleting the global. And while deleting global, delete global's debug info also.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65994 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
baf715897dfb6a6edb54bf31a8a32182b0f95ab0 04-Mar-2009 Devang Patel <dpatel@apple.com> If a global constant is dead then global's debug info should not prevent the optimizer in deleting the global. And while deleting global, delete global's debug info also.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65994 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
9adb01cbc3ef70e7fa8b4d6b1a1229c63082a496 03-Mar-2009 Devang Patel <dpatel@apple.com> Recursively remove dead argument while removing llvm.dbg.declare intrinsic.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65971 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
e68804ac2530de3f032c41955d7cc319f608bb93 03-Mar-2009 Devang Patel <dpatel@apple.com> Recursively remove dead argument while removing llvm.dbg.declare intrinsic.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65971 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
cd11991203f2f8ca8b0c7bd920fa4e32b4f88e1d 03-Mar-2009 Devang Patel <dpatel@apple.com> Ignore debug info intrinsics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65908 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
711b384f7df3e41e708a89a49da00da2974a9d0e 03-Mar-2009 Devang Patel <dpatel@apple.com> Ignore debug info intrinsics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65908 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
73df3c972157409e5b88a08682cdfbe9173f5927 02-Mar-2009 Devang Patel <dpatel@apple.com> Remove all dbg symobls, including those with circular references.

This is ugly, but I can't figure out a quick way out of this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65889 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
4ed9e40ef50a3dedf49c256e2bac56fd0e483416 02-Mar-2009 Devang Patel <dpatel@apple.com> Remove all dbg symobls, including those with circular references.

This is ugly, but I can't figure out a quick way out of this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65889 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
95c5d0fb0a4e1ec88edae43c2db464e0cc63c76e 18-Feb-2009 Duncan Sands <baldrick@free.fr> In theory the aliasee may have dead constant users
here. Since we only do the transform if there is
one use, strip off any such users in the hope of
making the transform fire more often.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64926 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
7531ad632837037dd4b8b0101359e6522a9ba392 18-Feb-2009 Duncan Sands <baldrick@free.fr> In theory the aliasee may have dead constant users
here. Since we only do the transform if there is
one use, strip off any such users in the hope of
making the transform fire more often.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64926 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
38deef9ce58b33dba34515f23fb7dbde02164c77 18-Feb-2009 Dan Gohman <gohman@apple.com> Add explicit keywords.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64915 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
edd345ce4a1840451fc1b891bc1df0bb226dfb4f 18-Feb-2009 Dan Gohman <gohman@apple.com> Add explicit keywords.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64915 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
cdf5ffb7fb3215e9ce5556ce896d4f573ab564e4 18-Feb-2009 Duncan Sands <baldrick@free.fr> If an alias is dead and so is its aliasee, then globaldce would
crash because the alias would still be using the aliasee when the
aliasee was deleted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64844 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
394c508a628cbd2fd1ca915486fb8a261b73db4e 18-Feb-2009 Duncan Sands <baldrick@free.fr> If an alias is dead and so is its aliasee, then globaldce would
crash because the alias would still be using the aliasee when the
aliasee was deleted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64844 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
7ae5b9e1eb1bf70ffecc34c42d66743d5f029d3a 17-Feb-2009 Duncan Sands <baldrick@free.fr> This transform also applies to private linkage.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64773 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
8f723612986299a02ec0a7312dd956fac2e33f39 17-Feb-2009 Duncan Sands <baldrick@free.fr> This transform also applies to private linkage.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64773 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
a37d119f63c6aa1a6b93d4aa6ea0019b7bf5ee16 15-Feb-2009 Duncan Sands <baldrick@free.fr> Make this more useful for cleaning up after the
one-definition-rule llvm-gcc changes (coming soon
to a tree near you!).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64588 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
e10858a8c639c317d884eaface2a253d6793c077 15-Feb-2009 Duncan Sands <baldrick@free.fr> Make this more useful for cleaning up after the
one-definition-rule llvm-gcc changes (coming soon
to a tree near you!).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64588 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
4782b305c2ccc2b2e5a4cad65d7ffd15395d0727 15-Feb-2009 Duncan Sands <baldrick@free.fr> If the target of an alias has internal linkage, then the
alias can be morphed into the target. Implement this
transform, and fix a crash in the existing transform at
the same time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64583 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
e7f431f9d4c41cb3cfc4cee1d2d5a3cda7f58a0c 15-Feb-2009 Duncan Sands <baldrick@free.fr> If the target of an alias has internal linkage, then the
alias can be morphed into the target. Implement this
transform, and fix a crash in the existing transform at
the same time.


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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63198 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
4e0d6a7d48464188a1a25b544a6355326d3fd3bf 28-Jan-2009 Duncan Sands <baldrick@free.fr> Rename getAnalysisToUpdate to getAnalysisIfAvailable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63198 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
9d4979123e5cf264fe21888b711d5bd141413fbd 25-Jan-2009 Nick Lewycky <nicholas@mxc.ca> The function that does nothing but call malloc is noalias return.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62956 91177308-0d34-0410-b5e6-96231b3b80d8
ndMemRemoval.cpp
bee4c2eba4b8d320e9cdef05259445f590bc3691 25-Jan-2009 nicholas <nicholas@91177308-0d34-0410-b5e6-96231b3b80d8> The function that does nothing but call malloc is noalias return.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62956 91177308-0d34-0410-b5e6-96231b3b80d8
ndMemRemoval.cpp
40b65c898d1f259593997b1ac14c4c018ad513f7 23-Jan-2009 Gabor Greif <ggreif@gmail.com> use CallSite::isCalle instead of slow getOperandNo

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62877 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
0817b6673720ad4633b70feb12e0192ecfd6de30 23-Jan-2009 Gabor Greif <ggreif@gmail.com> use CallSite::isCalle instead of slow getOperandNo

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62877 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
a36791da41cf4f635e50077b290676b873836bda 23-Jan-2009 Gabor Greif <ggreif@gmail.com> Simplify the logic of getting hold of a PHI predecessor block.
There is now a direct way from value-use-iterator to incoming block in PHINode's API.
This way we avoid the iterator->index->iterator trip, and especially the costly
getOperandNo() invocation. Additionally there is now an assertion that the iterator
really refers to one of the PHI's Uses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62869 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
261734d4cc45b1720ab8a3deedbb62f08d026a1a 23-Jan-2009 Gabor Greif <ggreif@gmail.com> Simplify the logic of getting hold of a PHI predecessor block.
There is now a direct way from value-use-iterator to incoming block in PHINode's API.
This way we avoid the iterator->index->iterator trip, and especially the costly
getOperandNo() invocation. Additionally there is now an assertion that the iterator
really refers to one of the PHI's Uses.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62869 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
edc4d69917df7dc34543adf719d5c93249fd5e27 22-Jan-2009 Gabor Greif <ggreif@gmail.com> introduce a useful abstraction to find out if a Use is in the call position of an instruction

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62788 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
PConstantPropagation.cpp
tructRetPromotion.cpp
6be9a1b0acfb99378d1b4027d13949b46a09392e 22-Jan-2009 Gabor Greif <ggreif@gmail.com> introduce a useful abstraction to find out if a Use is in the call position of an instruction

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62788 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
PConstantPropagation.cpp
tructRetPromotion.cpp
8556d2a7f155c7edfaf454a3acda8ce28863c5e4 18-Jan-2009 Duncan Sands <baldrick@free.fr> BasicAliasAnalysis and FunctionAttrs were both
doing very similar pointer capture analysis.
Factor out the common logic. The new version
is from FunctionAttrs since it does a better
job than the version in BasicAliasAnalysis


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62461 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
b233fb516c0c3cde8a2141e25ecf29425657f560 18-Jan-2009 Duncan Sands <baldrick@free.fr> BasicAliasAnalysis and FunctionAttrs were both
doing very similar pointer capture analysis.
Factor out the common logic. The new version
is from FunctionAttrs since it does a better
job than the version in BasicAliasAnalysis


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62461 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
bb46f52027416598a662dc1c58f48d9d56b1a65b 15-Jan-2009 Rafael Espindola <rafael.espindola@gmail.com> Add the private linkage.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62279 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
onstantMerge.cpp
eadArgumentElimination.cpp
xtractGV.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
nliner.cpp
nternalize.cpp
ergeFunctions.cpp
tripSymbols.cpp
tructRetPromotion.cpp
a168fc98dedfc8cac01c34f84b699fe5f48ad76d 15-Jan-2009 Rafael Espindola <rafael.espindola@gmail.com> Add the private linkage.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62279 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
onstantMerge.cpp
eadArgumentElimination.cpp
xtractGV.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
nliner.cpp
nternalize.cpp
ergeFunctions.cpp
tripSymbols.cpp
tructRetPromotion.cpp
92c6bd2c45f0002385300a8aa298fa34ef9bff64 14-Jan-2009 Chris Lattner <sabre@nondot.org> rewrite OptimizeAwayTrappingUsesOfLoads to 1) avoid a temporary
vector and extraneous loop over it, 2) not delete globals used by
phis/selects etc which could actually be useful. This fixes PR3321.
Many thanks to Duncan for narrowing this down.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62201 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
9806cc10e18d8864fffc433d7091753367b5fe6d 14-Jan-2009 Chris Lattner <sabre@nondot.org> rewrite OptimizeAwayTrappingUsesOfLoads to 1) avoid a temporary
vector and extraneous loop over it, 2) not delete globals used by
phis/selects etc which could actually be useful. This fixes PR3321.
Many thanks to Duncan for narrowing this down.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62201 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
b5024401648eb58e2a9150ce0f57a56ad87daeaf 13-Jan-2009 Duncan Sands <baldrick@free.fr> Correct a comment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62165 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
2546415803443ab2ae642d39007b37936de32371 13-Jan-2009 Duncan Sands <baldrick@free.fr> Correct a comment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62165 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
cbfdf9644ce38fd3404469c26ac3c8466c940b6e 12-Jan-2009 Dale Johannesen <dalej@apple.com> Enable recursive inlining. Reduce inlining threshold
back to 200; 400 seems to be too high, loses more than
it gains.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62107 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
5adaa754419fc9ee5d2f768ea848d594d1e97fe0 12-Jan-2009 Dale Johannesen <dalej@apple.com> Enable recursive inlining. Reduce inlining threshold
back to 200; 400 seems to be too high, loses more than
it gains.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62107 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
ceb4d1aecb9deffe59b3dcdc9a783ffde8477be9 12-Jan-2009 Duncan Sands <baldrick@free.fr> Rename getABITypeSize to getTypePaddedSize, as
suggested by Chris.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62099 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
d68f13bf716faa496767a21140fab558adddc19a 12-Jan-2009 Duncan Sands <baldrick@free.fr> Rename getABITypeSize to getTypePaddedSize, as
suggested by Chris.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62099 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
c3443718540c6662f7502feb76849cf816baaa9f 12-Jan-2009 Dale Johannesen <dalej@apple.com> Increase default inlining aggressiveness in partial
compensation for turning off gcc's inliner. This gets
us closer to the amount of inlining we were getting before.
It is not a win on everything, of course, but seems to
gain overall.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62058 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
c7f9aa76c1fc9d5b6350f3aba3d99e164b13b500 12-Jan-2009 Dale Johannesen <dalej@apple.com> Increase default inlining aggressiveness in partial
compensation for turning off gcc's inliner. This gets
us closer to the amount of inlining we were getting before.
It is not a win on everything, of course, but seems to
gain overall.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62058 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
9b8f542e2746b28721b3ec603c3aaaa10ea708fc 09-Jan-2009 Misha Brukman <brukman+llvm@gmail.com> Removed trailing whitespace from Makefiles.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61991 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
e025bcca322301af5c4a5178b1a64080cb900ec1 09-Jan-2009 Misha Brukman <brukman+llvm@gmail.com> Removed trailing whitespace from Makefiles.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61991 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
e345566f8eaeeda45e29e3709114a42209a360cc 09-Jan-2009 Dale Johannesen <dalej@apple.com> Adjustments to last patch based on review.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61969 91177308-0d34-0410-b5e6-96231b3b80d8
nlineAlways.cpp
nlineSimple.cpp
nliner.cpp
ec46e4852f6e2e628f27a980ba58c4672bb26a3c 09-Jan-2009 Dale Johannesen <dalej@apple.com> Adjustments to last patch based on review.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61969 91177308-0d34-0410-b5e6-96231b3b80d8
nlineAlways.cpp
nlineSimple.cpp
nliner.cpp
177d84e048d3c0b94ff2d2ff1a9bda8d498c1397 07-Jan-2009 Duncan Sands <baldrick@free.fr> Whitespace - correct formatting.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61879 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
0f064b9ac51e1c45815f92f6db2a9c556ed4f90b 07-Jan-2009 Duncan Sands <baldrick@free.fr> Whitespace - correct formatting.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61879 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
b0cea8ff3979b8af15311b34df12bbb4440fd888 07-Jan-2009 Duncan Sands <baldrick@free.fr> Remove alloca tracking from nocapture analysis. Not only
was it not very helpful, it was also wrong! The problem
is shown in the testcase: the alloca might be passed to
a nocapture callee which dereferences it and returns the
original pointer. But because it was a nocapture call we
think we don't need to track its uses, but we do.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61876 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
8b3fc692a759db39344f2d84cb1a65730305363c 07-Jan-2009 Duncan Sands <baldrick@free.fr> Remove alloca tracking from nocapture analysis. Not only
was it not very helpful, it was also wrong! The problem
is shown in the testcase: the alloca might be passed to
a nocapture callee which dereferences it and returns the
original pointer. But because it was a nocapture call we
think we don't need to track its uses, but we do.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61876 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
acf984417fbb721467205011b5ef8f3595771df7 07-Jan-2009 Duncan Sands <baldrick@free.fr> Reorder these.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61873 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
2265b0cc728e76b5846ee92dc0a049d916b87134 07-Jan-2009 Duncan Sands <baldrick@free.fr> Reorder these.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61873 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
00e7ea98c0fd4a568fe974e79fb44913f173fa77 07-Jan-2009 Duncan Sands <baldrick@free.fr> Use a switch rather than a sequence of "isa" tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61872 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
ec6d347213ecd74e6f28296f11d317ac6914c364 07-Jan-2009 Duncan Sands <baldrick@free.fr> Use a switch rather than a sequence of "isa" tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61872 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
b18715acb5fbc00f6662718f219cdb94c060efb5 07-Jan-2009 Duncan Sands <baldrick@free.fr> The verifier checks that the aliasee is not null.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61870 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
e9af8ee84ed09c96715f17221bc876269ddcd9ff 07-Jan-2009 Duncan Sands <baldrick@free.fr> The verifier checks that the aliasee is not null.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61870 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
27a53009efcf1b0334dc17c3d54382798686ff59 05-Jan-2009 Duncan Sands <baldrick@free.fr> Teach the internalize pass to also internalize
global aliases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61754 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
414d658f95b8f9daa4e91a077b5747a8f95ca13e 05-Jan-2009 Duncan Sands <baldrick@free.fr> Teach the internalize pass to also internalize
global aliases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61754 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
de77ebcbb9e4554d41ff29608ad716f922e0db98 05-Jan-2009 Duncan Sands <baldrick@free.fr> Not having an aliasee is a theoretical possibility.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61745 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
bd93cbe33093dc955fddb685406ece0cdb3a6414 05-Jan-2009 Duncan Sands <baldrick@free.fr> Not having an aliasee is a theoretical possibility.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61745 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
15b57506642522a4d0a3b9f15223c4454bcaf401 05-Jan-2009 Duncan Sands <baldrick@free.fr> Format more neatly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61744 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
744917b63a32776dab3561e2f28312d08a10561d 05-Jan-2009 Duncan Sands <baldrick@free.fr> Format more neatly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61744 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
2631ac3b5b4c2d7eaf8d1db178dc98071a708ad2 05-Jan-2009 Duncan Sands <baldrick@free.fr> Remove trailing spaces.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61743 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
4eef18f12286e0918b50a82fab7e611d5f926295 05-Jan-2009 Duncan Sands <baldrick@free.fr> Remove trailing spaces.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61743 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
1da5f2dd2ec1b1eea67a25928668f7ea2bd67b96 05-Jan-2009 Duncan Sands <baldrick@free.fr> Delete unused global aliases with internal linkage.
In fact this also deletes those with linkonce linkage,
however this is currently dead because for the moment
aliases aren't allowed to have this linkage type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61742 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
bd1b450d673b80c73bc90a1dcaef53edf9f5d0e9 05-Jan-2009 Duncan Sands <baldrick@free.fr> Delete unused global aliases with internal linkage.
In fact this also deletes those with linkonce linkage,
however this is currently dead because for the moment
aliases aren't allowed to have this linkage type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61742 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
3b3b4e3f0f4e4adb2af74942aa939b283a4d5f16 03-Jan-2009 Nick Lewycky <nicholas@mxc.ca> Any void readonly functions are provably dead, don't waste time adding
nocapture attributes to them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61610 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
d5c91b461a0fbd306afee8b85f81d5af95de59b7 03-Jan-2009 Nick Lewycky <nicholas@mxc.ca> Any void readonly functions are provably dead, don't waste time adding
nocapture attributes to them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61610 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
9c5a5b01b4c463fb6dc7c98cfa7ce06e1e9a63dd 02-Jan-2009 Duncan Sands <baldrick@free.fr> Load tracking means that the value analyzed may
not have pointer type. In particular, it may
be the condition argument for a select or a GEP
index. While I was unable to construct a testcase
for which some bits of the original pointer are
captured due to one of these, it's very very close
to being possible - so play safe and exclude these
possibilities.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61580 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
773c3b3600d7684351df02ea91d45f18db2c0db1 02-Jan-2009 Duncan Sands <baldrick@free.fr> Load tracking means that the value analyzed may
not have pointer type. In particular, it may
be the condition argument for a select or a GEP
index. While I was unable to construct a testcase
for which some bits of the original pointer are
captured due to one of these, it's very very close
to being possible - so play safe and exclude these
possibilities.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61580 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
338cd6ba6e36c291185541bb8e391427f57a32b1 02-Jan-2009 Duncan Sands <baldrick@free.fr> When calculating 'nocapture' argument attributes, allow
the argument to be stored to an alloca by tracking uses
of the alloca. This occurs 4 times (out of 7121, 0.05%)
in MultiSource/Applications, so may not be worth it. On
the other hand, it is easy to do and fairly cheap. The
functions it helps are: W_addcom and W_addlit in spiff;
process_args (argv) in d (make_dparser); ercPixConcealIMB
in JM/ldecod.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61570 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
0183ee660d42864ddbfe04a5c18f3d5d818d3e20 02-Jan-2009 Duncan Sands <baldrick@free.fr> When calculating 'nocapture' argument attributes, allow
the argument to be stored to an alloca by tracking uses
of the alloca. This occurs 4 times (out of 7121, 0.05%)
in MultiSource/Applications, so may not be worth it. On
the other hand, it is easy to do and fairly cheap. The
functions it helps are: W_addcom and W_addlit in spiff;
process_args (argv) in d (make_dparser); ercPixConcealIMB
in JM/ldecod.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61570 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
b2f2279056ab9e2e80f94c20d79affc007a4de62 02-Jan-2009 Duncan Sands <baldrick@free.fr> Improve comments and reorganize a bit - no functionality
change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61569 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
f29d79dd605eb0bdc2bee4822a591b2b5eaf6409 02-Jan-2009 Duncan Sands <baldrick@free.fr> Improve comments and reorganize a bit - no functionality
change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61569 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
6b0568628319e08b36b8ec14793083e6bbf101a7 02-Jan-2009 Nick Lewycky <nicholas@mxc.ca> Make adding nocapture a bit stronger. FreeInst is nocapture. Also,
functions that don't write can't leak a pointer except through
the return value, so a void readonly function is implicitly nocapture.

Test these, and add a test that verifies that f1 calling f2 with an
otherwise dead pointer gets both of them marked nocapture.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61552 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
73f4edd72f41130fa0fd561d0517954d510ffb93 02-Jan-2009 Nick Lewycky <nicholas@mxc.ca> Make adding nocapture a bit stronger. FreeInst is nocapture. Also,
functions that don't write can't leak a pointer except through
the return value, so a void readonly function is implicitly nocapture.

Test these, and add a test that verifies that f1 calling f2 with an
otherwise dead pointer gets both of them marked nocapture.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61552 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
88e76757deb4872fc5d0db8592019fa73bfecfe7 01-Jan-2009 Duncan Sands <baldrick@free.fr> Mention that this pass does escape analysis in the
leading comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61548 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
b3c7f3d3301f1604810569139820057905b4a11b 01-Jan-2009 Duncan Sands <baldrick@free.fr> Mention that this pass does escape analysis in the
leading comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61548 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
1010941954a44520d12037d8b6d81a4af89b57a6 31-Dec-2008 Duncan Sands <baldrick@free.fr> Look through phi nodes and select instructions when
calculating nocapture attributes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61535 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
7120a89c7f4886b42b816bface60fd1accc206c6 31-Dec-2008 Duncan Sands <baldrick@free.fr> Look through phi nodes and select instructions when
calculating nocapture attributes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61535 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
17da06ffbd1f7269b6b9037f883a3d8a5c985f62 31-Dec-2008 Duncan Sands <baldrick@free.fr> Don't analyze arguments already marked 'nocapture'.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61532 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
9f81f8f01c23674fbae1f8c0a9557dcb6aced4fe 31-Dec-2008 Duncan Sands <baldrick@free.fr> Don't analyze arguments already marked 'nocapture'.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61532 91177308-0d34-0410-b5e6-96231b3b80d8
unctionAttrs.cpp
9e89ba31f16a960239a750a26a982b4c9dfe8949 31-Dec-2008 Duncan Sands <baldrick@free.fr> Rename AddReadAttrs to FunctionAttrs, and teach it how
to work out (in a very simplistic way) which function
arguments (pointer arguments only) are only dereferenced
and so do not escape. Mark such arguments 'nocapture'.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61525 91177308-0d34-0410-b5e6-96231b3b80d8
ddReadAttrs.cpp
MakeLists.txt
unctionAttrs.cpp
1410dfde5c04d0c94590baa0b86467e9153b4af6 31-Dec-2008 Duncan Sands <baldrick@free.fr> Rename AddReadAttrs to FunctionAttrs, and teach it how
to work out (in a very simplistic way) which function
arguments (pointer arguments only) are only dereferenced
and so do not escape. Mark such arguments 'nocapture'.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61525 91177308-0d34-0410-b5e6-96231b3b80d8
ddReadAttrs.cpp
MakeLists.txt
unctionAttrs.cpp
2964fe37aee3696e887dc50f52926df3ba51f4c7 29-Dec-2008 Duncan Sands <baldrick@free.fr> Experiments show that looking through phi nodes
and select instructions doesn't buy anything here
except extra complexity: the only difference in
the entire testsuite was that a readonly function
became readnone in MiBench/consumer-typeset. Add
a comment about this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61478 91177308-0d34-0410-b5e6-96231b3b80d8
ddReadAttrs.cpp
f07c55c09393460be0d81a6a8cbe9f8d4fcaf83a 29-Dec-2008 Duncan Sands <baldrick@free.fr> Experiments show that looking through phi nodes
and select instructions doesn't buy anything here
except extra complexity: the only difference in
the entire testsuite was that a readonly function
became readnone in MiBench/consumer-typeset. Add
a comment about this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61478 91177308-0d34-0410-b5e6-96231b3b80d8
ddReadAttrs.cpp
516ec62bfef9dcf7390811083d07ee9fe16fe091 29-Dec-2008 Duncan Sands <baldrick@free.fr> Allow readnone functions to read (and write!) global
constants, since doing so is irrelevant for aliasing
purposes. While this doesn't increase the total number
of functions marked readonly or readnone in MultiSource/
Applications (3089), it does result in 12 functions being
marked readnone rather than readonly.
Before:
readnone: 820
readonly: 2269
After:
readnone: 832
readonly: 2257


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61469 91177308-0d34-0410-b5e6-96231b3b80d8
ddReadAttrs.cpp
b00686aee1e05cba250da392dfab03bdaa2591c4 29-Dec-2008 Duncan Sands <baldrick@free.fr> Allow readnone functions to read (and write!) global
constants, since doing so is irrelevant for aliasing
purposes. While this doesn't increase the total number
of functions marked readonly or readnone in MultiSource/
Applications (3089), it does result in 12 functions being
marked readnone rather than readonly.
Before:
readnone: 820
readonly: 2269
After:
readnone: 832
readonly: 2257


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61469 91177308-0d34-0410-b5e6-96231b3b80d8
ddReadAttrs.cpp
f49a28cd0287351bce7a17dfffdbce4926763b5b 17-Dec-2008 Chris Lattner <sabre@nondot.org> insert some sequence points and preincrement an iterator to avoid
iterator invalidation problems.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61124 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
a5e124b31f76182e37ec8a54556fabe2f2369bd1 17-Dec-2008 Chris Lattner <sabre@nondot.org> insert some sequence points and preincrement an iterator to avoid
iterator invalidation problems.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61124 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
bce4afe83968bf6504aaf0791d4c49f971d58c52 17-Dec-2008 Chris Lattner <sabre@nondot.org> Enhance heap sra to be substantially more aggressive w.r.t PHI
nodes. This allows it to do fairly general phi insertion if a
load from a pointer global wants to be SRAd but the load is used
by (recursive) phi nodes. This fixes a pessimization on ppc
introduced by Load PRE.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61123 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
8a2d32ebbe8faa19e53dd094621c7d9a226c87f5 17-Dec-2008 Chris Lattner <sabre@nondot.org> Enhance heap sra to be substantially more aggressive w.r.t PHI
nodes. This allows it to do fairly general phi insertion if a
load from a pointer global wants to be SRAd but the load is used
by (recursive) phi nodes. This fixes a pessimization on ppc
introduced by Load PRE.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61123 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
85d3d4f35de33c6d0d3800bd87619c00d06a98e2 16-Dec-2008 Chris Lattner <sabre@nondot.org> Fix another crash found by inspection. If we have a PHI node merging
the load multiple times, make sure the check the uses of the PHI to
ensure they are transformable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61102 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
7f252db2883e75e87c6b10bdab09eda0e0a562bb 16-Dec-2008 Chris Lattner <sabre@nondot.org> Fix another crash found by inspection. If we have a PHI node merging
the load multiple times, make sure the check the uses of the PHI to
ensure they are transformable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61102 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
542dc1a0decc2b598a1f856370a55091a51e102c 16-Dec-2008 Chris Lattner <sabre@nondot.org> fix a crash found by inspection.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61101 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
ae6b096b4d196dffec11b08fe94a24a7fb2ef7e4 16-Dec-2008 Chris Lattner <sabre@nondot.org> fix a crash found by inspection.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61101 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
5a6bb6ae78fb42bedd8987ccd611abd0a548edbf 16-Dec-2008 Chris Lattner <sabre@nondot.org> switch some std::set/std::map to SmallPtrSet/DenseMap.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61081 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
4cd08c211e2d247f419c346a456563b455d11442 16-Dec-2008 Chris Lattner <sabre@nondot.org> switch some std::set/std::map to SmallPtrSet/DenseMap.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61081 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
101f44e81f3bfae1b8ebefe74bef73883dac78ac 15-Dec-2008 Chris Lattner <sabre@nondot.org> enhance heap-sra to apply to fixed sized array allocations, not just
variable sized array allocations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61051 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
27ef89e4d9ff953ae2d56adcadd66a8f035adc01 15-Dec-2008 Chris Lattner <sabre@nondot.org> enhance heap-sra to apply to fixed sized array allocations, not just
variable sized array allocations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61051 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
344b41cfbd30980a2194c56db382b0537d087ea9 15-Dec-2008 Chris Lattner <sabre@nondot.org> Use stripPointerCasts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61047 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
2e729117046dc836fe8e19ebe797caa0be7e2a99 15-Dec-2008 Chris Lattner <sabre@nondot.org> Use stripPointerCasts.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61047 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
49b6d4ae9e3132525657880c45619f83e5c89c8f 15-Dec-2008 Chris Lattner <sabre@nondot.org> minor tweaks for formatting, allow bitcast in ValueIsOnlyUsedLocallyOrStoredToOneGlobal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61046 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
183b0cfd9491234de2fb8fbfd97eeaa977512e8f 15-Dec-2008 Chris Lattner <sabre@nondot.org> minor tweaks for formatting, allow bitcast in ValueIsOnlyUsedLocallyOrStoredToOneGlobal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61046 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
e61d0a626e58bdba004a7aad9abecb3a9bd85256 15-Dec-2008 Chris Lattner <sabre@nondot.org> refactor some code into a new TryToOptimizeStoreOfMallocToGlobal function.
Use GetElementPtrInst::hasAllZeroIndices where possible.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61045 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
78e568b7de736319d95aa86824e147a20483bbf5 15-Dec-2008 Chris Lattner <sabre@nondot.org> refactor some code into a new TryToOptimizeStoreOfMallocToGlobal function.
Use GetElementPtrInst::hasAllZeroIndices where possible.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61045 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
66c75aaa028683c389c55b377ee2411b61081677 21-Nov-2008 Bill Wendling <isanbard@gmail.com> Fix error where it wasn't getting the correct caller function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59758 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
1106f2cb38fd150a434b5ebd04b8792809585f7e 21-Nov-2008 Bill Wendling <isanbard@gmail.com> Fix error where it wasn't getting the correct caller function.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59758 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
8c1604e7d617622cb391f1c679ddf70ea03baedc 21-Nov-2008 Bill Wendling <isanbard@gmail.com> If the function being inlined has a higher stack protection level than the
inlining function, then increase the stack protection level on the inlining
function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59757 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
2ce7f303f44a09519e7f133642fb12130003057f 21-Nov-2008 Bill Wendling <isanbard@gmail.com> If the function being inlined has a higher stack protection level than the
inlining function, then increase the stack protection level on the inlining
function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59757 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
f23de86fa3b275cabc6450349dcbbb448ee5952b 20-Nov-2008 Devang Patel <dpatel@apple.com> Do not forget llvm.dbg.declare's first argument while removing debugging information.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59688 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
abd691195fa4f616fddfc57bb58eb925b5f8ea4e 20-Nov-2008 Devang Patel <dpatel@apple.com> Do not forget llvm.dbg.declare's first argument while removing debugging information.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59688 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
fb5fd5a0bb5f81acda6d04d69c20d49ef06a36f0 19-Nov-2008 Devang Patel <dpatel@apple.com> Remove unused variables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59570 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
43f586b92d108b5c5b0cc1888df677489a9f99f0 19-Nov-2008 Devang Patel <dpatel@apple.com> Remove unused variables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59570 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
b876cc193c163c269d9cf7ad1274fc31a5c1b106 19-Nov-2008 Devang Patel <dpatel@apple.com> Fix typo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59569 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
4bb7d03021fa96542e97fe72172d8479a84a5437 19-Nov-2008 Devang Patel <dpatel@apple.com> Fix typo.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59569 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
f17fc461d17f9fa85f8fbc140ded8f3c591791e2 18-Nov-2008 Devang Patel <dpatel@apple.com> Add new helper pass that strips all symbol names except debugging information.
This pass makes it easier to test wheter debugging info. influences optimization passes or not.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59552 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
159f7ceb58bf6406030e84f7b4ec994ba8f71ab6 18-Nov-2008 Devang Patel <dpatel@apple.com> Add new helper pass that strips all symbol names except debugging information.
This pass makes it easier to test wheter debugging info. influences optimization passes or not.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59552 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
4460a7e90c318857a37be386a7ebccff3020a795 18-Nov-2008 Devang Patel <dpatel@apple.com> Remove even more llvm.dbg variables.
Remove all dead globals from llvm.metadata.
Ignore linkonce linkage for selected llvm.dbg values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59547 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
2d53e2dfbd990f43ef083bf5bcee4e5c24a56a20 18-Nov-2008 Devang Patel <dpatel@apple.com> Remove even more llvm.dbg variables.
Remove all dead globals from llvm.metadata.
Ignore linkonce linkage for selected llvm.dbg values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59547 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
b079a391c8b85d088dabce715d99be5917af88fa 16-Nov-2008 Torok Edwin <edwintorok@gmail.com> If SI->size() is 0, we are not allowed to dereference ->begin().
This fixed PR3078.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59416 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
134c437c9def3d8b904fabf88d79d5f24163ecc9 16-Nov-2008 Edwin Török <edwintorok@gmail.com> If SI->size() is 0, we are not allowed to dereference ->begin().
This fixed PR3078.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59416 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
3f914f0138415d64ce5eacfb464d7c1ad99c19d4 16-Nov-2008 Chris Lattner <sabre@nondot.org> simplify loop


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59406 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
ba58d9ca78372162be346a67d5d413c9353fe9e2 16-Nov-2008 Chris Lattner <sabre@nondot.org> simplify loop


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59406 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
229de95eabb7f5350a42152eab8c4c8643cdd0bf 14-Nov-2008 Devang Patel <dpatel@apple.com> Refactor code.
Strip debug information before stripping symbol names.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59328 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
2c98b520d7a7320260755c9d495dfe17b0ebd5fb 14-Nov-2008 Devang Patel <dpatel@apple.com> Refactor code.
Strip debug information before stripping symbol names.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59328 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
bf5db817f4f66701f3efd7c7ae001cc36f825086 13-Nov-2008 Devang Patel <dpatel@apple.com> Really remove all debug information.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59208 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
2fa8556adaa16188587d4109ea8c846ad9c5f9f4 13-Nov-2008 Devang Patel <dpatel@apple.com> Really remove all debug information.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59208 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
772777e105c6fb08db826231bf462cc21f9b07f2 11-Nov-2008 Devang Patel <dpatel@apple.com> Use actual function name in comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59063 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
57fdf7d116c043477dc3b8fb423389cb54c9647c 11-Nov-2008 Devang Patel <dpatel@apple.com> Use actual function name in comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59063 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
b7c6bf1e073088635951435acedff793add1cefd 05-Nov-2008 Devang Patel <dpatel@apple.com> Do now allow InlineAlways pass to remove dead functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58744 91177308-0d34-0410-b5e6-96231b3b80d8
nlineAlways.cpp
nliner.cpp
c5456a4974b49ded9f76b217fdce327d24c536d4 05-Nov-2008 Devang Patel <dpatel@apple.com> Do now allow InlineAlways pass to remove dead functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58744 91177308-0d34-0410-b5e6-96231b3b80d8
nlineAlways.cpp
nliner.cpp
06a1242207f3777419d9c87820b42e5768d636fc 03-Nov-2008 Andrew Lenharth <andrewl@lenharth.org> add a period at the end of the comment, ignoring the fact that the comment would be hard pressed to be considered a sentence, but if it makes Bill happy...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58630 91177308-0d34-0410-b5e6-96231b3b80d8
artialSpecialization.cpp
dc07c857b01999e844c55cc333ce413df395a9c7 03-Nov-2008 Andrew Lenharth <alenhar2@cs.uiuc.edu> add a period at the end of the comment, ignoring the fact that the comment would be hard pressed to be considered a sentence, but if it makes Bill happy...

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58630 91177308-0d34-0410-b5e6-96231b3b80d8
artialSpecialization.cpp
97bd9a914bbf754e3a1624b1def7b9224041cbbf 03-Nov-2008 Andrew Lenharth <andrewl@lenharth.org> Ensure that we are checking only calls to the function we are interested in specializing

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58615 91177308-0d34-0410-b5e6-96231b3b80d8
artialSpecialization.cpp
ae6197331f02da0e8ab08eadc2cec1dde9466e27 03-Nov-2008 Andrew Lenharth <alenhar2@cs.uiuc.edu> Ensure that we are checking only calls to the function we are interested in specializing

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58615 91177308-0d34-0410-b5e6-96231b3b80d8
artialSpecialization.cpp
6feb333695f913cd7b525f9a2d5b887f4b0fca1f 02-Nov-2008 Nick Lewycky <nicholas@mxc.ca> Changes from Duncan's review:
* merge two weak functions by making them both alias a third non-weak fn
* don't reimplement CallSite::hasArgument
* whitelist the safe linkage types


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58568 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
94b22442900824a52fd76136dbafa110faff5e18 02-Nov-2008 Nick Lewycky <nicholas@mxc.ca> Changes from Duncan's review:
* merge two weak functions by making them both alias a third non-weak fn
* don't reimplement CallSite::hasArgument
* whitelist the safe linkage types


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58568 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
5baf8ece830b7a14ac466d09d6a113205296f6ee 02-Nov-2008 Duncan Sands <baldrick@free.fr> Get this building on 64 bit machines (error:
cast from ‘const llvm::PointerType*’ to ‘unsigned int’
loses precision).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58561 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
6dfddd4aa01831dbbe648defcd0a0b65cb9e3c73 02-Nov-2008 Duncan Sands <baldrick@free.fr> Get this building on 64 bit machines (error:
cast from ‘const llvm::PointerType*’ to ‘unsigned int’
loses precision).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58561 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
2b82b7e77ee20eb601ea12f3ed2f686ab838f08f 02-Nov-2008 Oscar Fuentes <ofv@wanadoo.es> CMake: added a source file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58559 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
8401db164743ff389a890b0e7c0af1ee568b54ae 02-Nov-2008 Oscar Fuentes <ofv@wanadoo.es> CMake: added a source file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58559 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
579a0246616d76bc536de0e41edf069d091604be 02-Nov-2008 Nick Lewycky <nicholas@mxc.ca> Add a new MergeFunctions pass. It finds identical functions and merges them.

This triggers only 60 times in llvm-test (look at .llvm.bc, not .linked.rbc)
and so it probably wont be turned on by default. Also, may of those are likely
to go away when PR2973 is fixed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58557 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
3dd811792f3d70785be9a1a431a77a6f23a9c583 02-Nov-2008 Nick Lewycky <nicholas@mxc.ca> Add a new MergeFunctions pass. It finds identical functions and merges them.

This triggers only 60 times in llvm-test (look at .llvm.bc, not .linked.rbc)
and so it probably wont be turned on by default. Also, may of those are likely
to go away when PR2973 is fixed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58557 91177308-0d34-0410-b5e6-96231b3b80d8
ergeFunctions.cpp
c5e1ec47c719806fcc882470595960512edc7441 30-Oct-2008 Daniel Dunbar <daniel@zuster.org> Add InlineCost class for represent the estimated cost of inlining a
function.
- This explicitly models the costs for functions which should
"always" or "never" be inlined. This fixes bugs where such costs
were not previously respected.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58450 91177308-0d34-0410-b5e6-96231b3b80d8
nlineAlways.cpp
nlineSimple.cpp
nliner.cpp
de4982c2dd800824f5f95d724173699326191a36 30-Oct-2008 Daniel Dunbar <daniel@zuster.org> Add InlineCost class for represent the estimated cost of inlining a
function.
- This explicitly models the costs for functions which should
"always" or "never" be inlined. This fixes bugs where such costs
were not previously respected.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58450 91177308-0d34-0410-b5e6-96231b3b80d8
nlineAlways.cpp
nlineSimple.cpp
nliner.cpp
1a99dbfe3b70c83d3f3e4648b5868c04697cd77c 29-Oct-2008 Daniel Dunbar <daniel@zuster.org> Factor shouldInline method out of Inliner.
- No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58355 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
fbda8c79ef60fa7391e7a0317ec97962e64403b0 29-Oct-2008 Daniel Dunbar <daniel@zuster.org> Factor shouldInline method out of Inliner.
- No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58355 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
f184c66e71a5cb6dbfb3a9bd68c2c0a7e1a59e0d 29-Oct-2008 Daniel Dunbar <daniel@zuster.org> Assorted comment/naming fixes, 80-col violations, and reindentation.
- No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58352 91177308-0d34-0410-b5e6-96231b3b80d8
nlineAlways.cpp
c0dabb8cff91f3df3b0ee9653694e3168ba73c27 29-Oct-2008 Daniel Dunbar <daniel@zuster.org> Assorted comment/naming fixes, 80-col violations, and reindentation.
- No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58352 91177308-0d34-0410-b5e6-96231b3b80d8
nlineAlways.cpp
b9a31a15f9ee8d4eff5bb0fec3dbfde54121af56 21-Oct-2008 Dan Gohman <gohman@apple.com> Fix a bug that prevented llvm-extract -delete from working.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57864 91177308-0d34-0410-b5e6-96231b3b80d8
xtractGV.cpp
595a4e792978390f4d8c8f0ba41a21bc87e8a8e4 21-Oct-2008 Dan Gohman <gohman@apple.com> Fix a bug that prevented llvm-extract -delete from working.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57864 91177308-0d34-0410-b5e6-96231b3b80d8
xtractGV.cpp
7a85a62f502cf9d4149f6a26fba0c9973c4d21d0 08-Oct-2008 Nuno Lopes <nunoplopes@sapo.pt> dont specialize weak functions and the like

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57305 91177308-0d34-0410-b5e6-96231b3b80d8
artialSpecialization.cpp
1c9b6e8033fa1c68e1797a8f15adddc31dab58af 08-Oct-2008 Nuno Lopes <nunoplopes@sapo.pt> dont specialize weak functions and the like

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57305 91177308-0d34-0410-b5e6-96231b3b80d8
artialSpecialization.cpp
c82b6a1ed2496ce0d61d2e51ed3a4cac4db786da 04-Oct-2008 Duncan Sands <baldrick@free.fr> Ignore loads from and stores to local memory (i.e. allocas)
when deciding whether to mark a function readnone/readonly.
Since the pass is currently run before SROA, this may be
quite helpful. Requested by Chris on IRC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57050 91177308-0d34-0410-b5e6-96231b3b80d8
ddReadAttrs.cpp
1d650eeaf15bc0c8868c5c312c900bcb9645e014 04-Oct-2008 Duncan Sands <baldrick@free.fr> Ignore loads from and stores to local memory (i.e. allocas)
when deciding whether to mark a function readnone/readonly.
Since the pass is currently run before SROA, this may be
quite helpful. Requested by Chris on IRC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57050 91177308-0d34-0410-b5e6-96231b3b80d8
ddReadAttrs.cpp
792e1e92c78be7a8610405d05a5e16dae6265ddd 04-Oct-2008 Dan Gohman <gohman@apple.com> Clean up some multiple-return-value code that is no longer
applicable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57033 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
ef81dbcda63df4ed9e3e4827ad00d9c93f11a33d 04-Oct-2008 Dan Gohman <gohman@apple.com> Clean up some multiple-return-value code that is no longer
applicable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57033 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
a2582da44dbe7204aac49cdaeccfd4e77ff7c408 03-Oct-2008 Duncan Sands <baldrick@free.fr> Teach internalize to preserve the callgraph.
Why? Because it was there!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56996 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
349bf2e29f53aa64e7d4e906b84e9d4199a59760 03-Oct-2008 Duncan Sands <baldrick@free.fr> Teach internalize to preserve the callgraph.
Why? Because it was there!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56996 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
86364023e65cf84567715324b296912176a3af1d 01-Oct-2008 Nuno Lopes <nunoplopes@sapo.pt> revert the addition of Preverves(CallGraph), per Duncan's comments

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56917 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
f4d48e15f7af90a5b0b056cea6a21bbfa266779e 01-Oct-2008 Nuno Lopes <nunoplopes@sapo.pt> revert the addition of Preverves(CallGraph), per Duncan's comments

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56917 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
0483d018c4f15f206a83364e498957127e74f431 01-Oct-2008 Nuno Lopes <nunoplopes@sapo.pt> add preserversCFG() + preservers(CallGraph)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56887 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
5de97242323586a5e4399a26f69831bb7edc2156 01-Oct-2008 Nuno Lopes <nunoplopes@sapo.pt> add preserversCFG() + preservers(CallGraph)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56887 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
dd7c3e4e56f739f6b67a4f3d67d061f2c5bca029 30-Sep-2008 Nuno Lopes <nunoplopes@sapo.pt> add AU.setPreservesCFG() since this pass only adds and removes function attributes

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56868 91177308-0d34-0410-b5e6-96231b3b80d8
ddReadAttrs.cpp
e723593bfd951754955cad403772fbde26e5549b 30-Sep-2008 Nuno Lopes <nunoplopes@sapo.pt> add AU.setPreservesCFG() since this pass only adds and removes function attributes

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56868 91177308-0d34-0410-b5e6-96231b3b80d8
ddReadAttrs.cpp
6cccf03d02936e16319e7cebf7a158643a8b1040 29-Sep-2008 Duncan Sands <baldrick@free.fr> Speed up these passes when the callgraph has
huge simply connected components. Suggested
by Chris.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56787 91177308-0d34-0410-b5e6-96231b3b80d8
ddReadAttrs.cpp
runeEH.cpp
f726bc7f31ba28c7ea873f93df177e427fcb57bf 29-Sep-2008 Duncan Sands <baldrick@free.fr> Speed up these passes when the callgraph has
huge simply connected components. Suggested
by Chris.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56787 91177308-0d34-0410-b5e6-96231b3b80d8
ddReadAttrs.cpp
runeEH.cpp
5ed3b894c913b0d4f4a0f3bd47f3ea1adf6eb52e 29-Sep-2008 Nuno Lopes <nunoplopes@sapo.pt> remove redundant test (mayBeOverriden() includes hasLinkOnceLinkage)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56786 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
d7469cb558572ec2552b38af8c8249ccb04c2f66 29-Sep-2008 Nuno Lopes <nunoplopes@sapo.pt> remove redundant test (mayBeOverriden() includes hasLinkOnceLinkage)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56786 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
224c86ee77c87cb90899041f4ee9027ac79d4fd2 29-Sep-2008 Duncan Sands <baldrick@free.fr> Tweak some comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56784 91177308-0d34-0410-b5e6-96231b3b80d8
ddReadAttrs.cpp
120f8f9aec270a551f4de031f884bd30aeea4f00 29-Sep-2008 Duncan Sands <baldrick@free.fr> Tweak some comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56784 91177308-0d34-0410-b5e6-96231b3b80d8
ddReadAttrs.cpp
5df3186f598163258fabf3448d9372843804d1ab 29-Sep-2008 Duncan Sands <baldrick@free.fr> Rename isWeakForLinker to mayBeOverridden. Use it
instead of hasWeakLinkage in a bunch of optimization
passes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56782 91177308-0d34-0410-b5e6-96231b3b80d8
ddReadAttrs.cpp
PConstantPropagation.cpp
runeEH.cpp
eb3f45fbeb3d009f9861f3c4ff82931b8aefe239 29-Sep-2008 Duncan Sands <baldrick@free.fr> Rename isWeakForLinker to mayBeOverridden. Use it
instead of hasWeakLinkage in a bunch of optimization
passes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56782 91177308-0d34-0410-b5e6-96231b3b80d8
ddReadAttrs.cpp
PConstantPropagation.cpp
runeEH.cpp
2c9c3e73682749016d5885b67ff719f634b37d58 27-Sep-2008 Devang Patel <dpatel@apple.com> Implement function notes as function attributes.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56716 91177308-0d34-0410-b5e6-96231b3b80d8
nlineAlways.cpp
nlineSimple.cpp
nliner.cpp
008cd3ecea2958540d8d8f5370deffb6103c6758 27-Sep-2008 Devang Patel <dpatel@apple.com> Implement function notes as function attributes.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56716 91177308-0d34-0410-b5e6-96231b3b80d8
nlineAlways.cpp
nlineSimple.cpp
nliner.cpp
19c874638d9478a5d5028854817a5ee72293bb2b 27-Sep-2008 Devang Patel <dpatel@apple.com> Now Attributes are divided in three groups
- return attributes - inreg, zext and sext
- parameter attributes
- function attributes - nounwind, readonly, readnone, noreturn

Return attributes use 0 as the index.
Function attributes use ~0U as the index.

This patch requires corresponding changes in llvm-gcc and clang.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56704 91177308-0d34-0410-b5e6-96231b3b80d8
ddReadAttrs.cpp
rgumentPromotion.cpp
eadArgumentElimination.cpp
runeEH.cpp
tructRetPromotion.cpp
f2a4a927452158a7f9d33594b74aa93cb70cdd0a 27-Sep-2008 Devang Patel <dpatel@apple.com> Now Attributes are divided in three groups
- return attributes - inreg, zext and sext
- parameter attributes
- function attributes - nounwind, readonly, readnone, noreturn

Return attributes use 0 as the index.
Function attributes use ~0U as the index.

This patch requires corresponding changes in llvm-gcc and clang.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56704 91177308-0d34-0410-b5e6-96231b3b80d8
ddReadAttrs.cpp
rgumentPromotion.cpp
eadArgumentElimination.cpp
runeEH.cpp
tructRetPromotion.cpp
0598866c052147c31b808391f58434ce3dbfb838 25-Sep-2008 Devang Patel <dpatel@apple.com> Large mechanical patch.

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

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

This requires corresponding changes in llvm-gcc and clang.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56622 91177308-0d34-0410-b5e6-96231b3b80d8
ddReadAttrs.cpp
rgumentPromotion.cpp
eadArgumentElimination.cpp
lobalOpt.cpp
nlineAlways.cpp
nlineSimple.cpp
nliner.cpp
owerSetJmp.cpp
runeEH.cpp
tructRetPromotion.cpp
d222f86d9d51a2d6299d43fb876099869430bf0f 25-Sep-2008 Devang Patel <dpatel@apple.com> Large mechanical patch.

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

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

This requires corresponding changes in llvm-gcc and clang.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56622 91177308-0d34-0410-b5e6-96231b3b80d8
ddReadAttrs.cpp
rgumentPromotion.cpp
eadArgumentElimination.cpp
lobalOpt.cpp
nlineAlways.cpp
nlineSimple.cpp
nliner.cpp
owerSetJmp.cpp
runeEH.cpp
tructRetPromotion.cpp
e3d76d37e972d6f7b1335a3944ce31ae8f4cd3c9 24-Sep-2008 Devang Patel <dpatel@apple.com> s/ParamAttrsWithIndex/FnAttributeWithIndex/g


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56535 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
tructRetPromotion.cpp
93044ceb33ed9ba6acaa9385725074b3cad4899f 24-Sep-2008 Devang Patel <dpatel@apple.com> s/ParamAttrsWithIndex/FnAttributeWithIndex/g


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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56527 91177308-0d34-0410-b5e6-96231b3b80d8
nlineAlways.cpp
nlineSimple.cpp
nliner.cpp
dc1611f62dc62d4c9cf5d906ed314e6e2c00969a 24-Sep-2008 Devang Patel <dpatel@apple.com> Put FN_NOTE_AlwaysInline and others in FnAttr namespace.


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


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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56524 91177308-0d34-0410-b5e6-96231b3b80d8
nlineAlways.cpp
nlineSimple.cpp
nliner.cpp
eaf42abab6d465c38891345d999255871cf03943 24-Sep-2008 Devang Patel <dpatel@apple.com> s/ParameterAttributes/Attributes/g



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56513 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
runeEH.cpp
tructRetPromotion.cpp
e480dfa79c90cf5a85680bc1ff503f21e6439a72 24-Sep-2008 Devang Patel <dpatel@apple.com> s/ParameterAttributes/Attributes/g



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



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



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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56477 91177308-0d34-0410-b5e6-96231b3b80d8
nlineAlways.cpp
nlineSimple.cpp
nliner.cpp
0c130eac67fad1c59c8e0c7cc36057e40fa258e6 23-Sep-2008 Devang Patel <dpatel@apple.com> Add hasNote() to check note associated with a function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56477 91177308-0d34-0410-b5e6-96231b3b80d8
nlineAlways.cpp
nlineSimple.cpp
nliner.cpp
3d01fc7de86c75926e4e5ac7cc49f0116018893d 22-Sep-2008 Oscar Fuentes <ofv@wanadoo.es> Initial support for the CMake build system.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56419 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
00905d5339fd277781c7393112f80febe86b2945 22-Sep-2008 Oscar Fuentes <ofv@wanadoo.es> Initial support for the CMake build system.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56419 91177308-0d34-0410-b5e6-96231b3b80d8
MakeLists.txt
f95f945fb00ea7fb33adab917ceb022451e9f2a5 20-Sep-2008 Duncan Sands <baldrick@free.fr> Implement review feedback from Devang: make use
of mayReadFromMemory and mayWriteToMemory.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56387 91177308-0d34-0410-b5e6-96231b3b80d8
ddReadAttrs.cpp
42b0e8575f8b6c7634ff1b776b72d4a7786451f7 20-Sep-2008 Duncan Sands <baldrick@free.fr> Implement review feedback from Devang: make use
of mayReadFromMemory and mayWriteToMemory.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56387 91177308-0d34-0410-b5e6-96231b3b80d8
ddReadAttrs.cpp
9f07a290b92a8ff06dfb9f3c28d6aa082217d9a6 19-Sep-2008 Duncan Sands <baldrick@free.fr> Add a new pass AddReadAttrs which works out which functions
can get the readnone/readonly attributes, and gives them it.
The plan is to remove markmodref (which did the same thing
by querying GlobalsModRef) and delete the analogous
functionality from GlobalsModRef.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56341 91177308-0d34-0410-b5e6-96231b3b80d8
ddReadAttrs.cpp
58f3877307afd8c07fdad680eb09c0f2771a3240 19-Sep-2008 Duncan Sands <baldrick@free.fr> Add a new pass AddReadAttrs which works out which functions
can get the readnone/readonly attributes, and gives them it.
The plan is to remove markmodref (which did the same thing
by querying GlobalsModRef) and delete the analogous
functionality from GlobalsModRef.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56341 91177308-0d34-0410-b5e6-96231b3b80d8
ddReadAttrs.cpp
19e861a4ffb896f16a691d5ac869e894df3cd464 09-Sep-2008 Anton Korobeynikov <asl@math.spbu.ru> Make safer variant of alias resolution routine to be default

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56005 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
c7b9091a9b49563aaf8a6ca14b6f31f34ffbe044 09-Sep-2008 Anton Korobeynikov <asl@math.spbu.ru> Make safer variant of alias resolution routine to be default

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56005 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
e4c6b61ebd8f2dbb6a2e51fe1d0e2bdbe17986c4 09-Sep-2008 Anton Korobeynikov <asl@math.spbu.ru> Resolve aliases, when possible

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56001 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
76944bd174830d003869ab80500c89f79e9da05c 09-Sep-2008 Anton Korobeynikov <asl@math.spbu.ru> Resolve aliases, when possible

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56001 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
a9c3251e6bb6b8c1ebd2ba5119adfb21cbbc434f 08-Sep-2008 Duncan Sands <baldrick@free.fr> Update the callgraph correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55896 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
fd5437a0888dfc9448b40d33330859997a5db445 08-Sep-2008 Duncan Sands <baldrick@free.fr> Update the callgraph correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55896 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
34c8847b2d27433ec7b81c824b66771e7665873a 08-Sep-2008 Duncan Sands <baldrick@free.fr> Update the callgraph correctly in ArgumentPromotion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55895 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
148c539e3dab2f2579e4601485d11c7272339b95 08-Sep-2008 Duncan Sands <baldrick@free.fr> Update the callgraph correctly in ArgumentPromotion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55895 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
d7b9851c4e634ed3599b1a4c70b1c76c90a11686 08-Sep-2008 Duncan Sands <baldrick@free.fr> Reapply 55859. This doesn't change anything as
long as the callgraph is correct. It checks
for wrong callgraphs more strictly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55894 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
104431b173524bc249d1d1956b2cdb76c5c18676 08-Sep-2008 Duncan Sands <baldrick@free.fr> Reapply 55859. This doesn't change anything as
long as the callgraph is correct. It checks
for wrong callgraphs more strictly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55894 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
4cddaf77c4f2482e7d3e7cc1c80895523dcfb68e 07-Sep-2008 Duncan Sands <baldrick@free.fr> Correct a comment and strip trailing whitespace.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55883 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
c7241ac448c72c48cbe08e4d01eebce2330b703c 07-Sep-2008 Duncan Sands <baldrick@free.fr> Correct a comment and strip trailing whitespace.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55883 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
b9baf3167908fc56f7ed49d0b31fe25237bca841 06-Sep-2008 Nuno Lopes <nunoplopes@sapo.pt> fix crash when the malloc/free function is defined or is a declaration with 0 parameters.
this pass doesnt seem to be used, but still it's now a little more correct

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55873 91177308-0d34-0410-b5e6-96231b3b80d8
ndMemRemoval.cpp
959ba4e70d28b7a59c5d09246ab2d9adabd71e6b 06-Sep-2008 Nuno Lopes <nunoplopes@sapo.pt> fix crash when the malloc/free function is defined or is a declaration with 0 parameters.
this pass doesnt seem to be used, but still it's now a little more correct

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55873 91177308-0d34-0410-b5e6-96231b3b80d8
ndMemRemoval.cpp
fec2c2bf5ea14679f8a2d74a72bdec76f05fa001 06-Sep-2008 Duncan Sands <baldrick@free.fr> When PruneEH turned an invoke into an ordinary
call (thus changing the call site) it didn't
inform the callgraph about this. But the
call site does matter - as shown by the testcase,
the callgraph become invalid after the inliner
ran (with an edge between two functions simply
missing), resulting in wrong deductions by
GlobalsModRef.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55872 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
7e8958a9f3366d225ddff95a069efb61f9f3567a 06-Sep-2008 Duncan Sands <baldrick@free.fr> When PruneEH turned an invoke into an ordinary
call (thus changing the call site) it didn't
inform the callgraph about this. But the
call site does matter - as shown by the testcase,
the callgraph become invalid after the inliner
ran (with an edge between two functions simply
missing), resulting in wrong deductions by
GlobalsModRef.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55872 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
6e6074508c2f781c3e52dfe0e301cb1c7f395a91 06-Sep-2008 Owen Anderson <resistor@mac.com> Revert r55859. This is breaking the build in the abscence of its companion commit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55865 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
134f6e5b6d7246384eaaeacbf5052a3a218cc887 06-Sep-2008 Owen Anderson <resistor@mac.com> Revert r55859. This is breaking the build in the abscence of its companion commit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55865 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
c94fe21a56f9e4e5ebbe99252a25636c36392509 05-Sep-2008 Duncan Sands <baldrick@free.fr> Delete the removeCallEdgeTo callgraph method,
because it does not maintain a correct list
of callsites. I discovered (see following
commit) that the inliner will create a wrong
callgraph if it is fed a callgraph with
correct edges but incorrect callsites. These
were created by Prune-EH, and while it wasn't
done via removeCallEdgeTo, it could have been
done via removeCallEdgeTo, which is an accident
waiting to happen. Use removeCallEdgeFor
instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55859 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
b16e8adb5ac391917e1fee448757f4272aabf83c 05-Sep-2008 Duncan Sands <baldrick@free.fr> Delete the removeCallEdgeTo callgraph method,
because it does not maintain a correct list
of callsites. I discovered (see following
commit) that the inliner will create a wrong
callgraph if it is fed a callgraph with
correct edges but incorrect callsites. These
were created by Prune-EH, and while it wasn't
done via removeCallEdgeTo, it could have been
done via removeCallEdgeTo, which is an accident
waiting to happen. Use removeCallEdgeFor
instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55859 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
6f0a7687ab9a0509e847279fae27554ce7da0ba1 05-Sep-2008 Duncan Sands <baldrick@free.fr> Use removeAllCalledFunctions rather than removing
edges one by one by hand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55836 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
d105c3434c708ef9ccfa8c3e99861ffb05db1022 05-Sep-2008 Duncan Sands <baldrick@free.fr> Use removeAllCalledFunctions rather than removing
edges one by one by hand.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55836 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
cae62e34984e413414304eab959797ec5c2cbf32 05-Sep-2008 Duncan Sands <baldrick@free.fr> Make this pass return that it made a change if
it modifies a functions attributes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55831 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
c1a6bc5002d68c819f4ed7894a4a1ca83964c0b1 05-Sep-2008 Duncan Sands <baldrick@free.fr> Make this pass return that it made a change if
it modifies a functions attributes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55831 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
eb50479714047c5b8d88e5e879089925156194f2 04-Sep-2008 Andrew Lenharth <andrewl@lenharth.org> try to seperate the mechanism into something others can use

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55785 91177308-0d34-0410-b5e6-96231b3b80d8
artialSpecialization.cpp
fb83aef511cfd5c5ea2b2c14c808667443b2ff54 04-Sep-2008 Andrew Lenharth <alenhar2@cs.uiuc.edu> try to seperate the mechanism into something others can use

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55779 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
onstantMerge.cpp
eadArgumentElimination.cpp
eadTypeElimination.cpp
xtractGV.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
ndMemRemoval.cpp
nliner.cpp
nternalize.cpp
oopExtractor.cpp
owerSetJmp.cpp
artialSpecialization.cpp
runeEH.cpp
aiseAllocations.cpp
tripDeadPrototypes.cpp
tripSymbols.cpp
tructRetPromotion.cpp
26f8c27c34b44f7d87de74d1de2128c1a02855bf 04-Sep-2008 Dan Gohman <gohman@apple.com> Tidy up several unbeseeming casts from pointer to intptr_t.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55779 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
onstantMerge.cpp
eadArgumentElimination.cpp
eadTypeElimination.cpp
xtractGV.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
ndMemRemoval.cpp
nliner.cpp
nternalize.cpp
oopExtractor.cpp
owerSetJmp.cpp
artialSpecialization.cpp
runeEH.cpp
aiseAllocations.cpp
tripDeadPrototypes.cpp
tripSymbols.cpp
tructRetPromotion.cpp
ef7803217a401e7be14ea26d70f12fb3ec7da66f 04-Sep-2008 Andrew Lenharth <andrewl@lenharth.org> cleanup as per Duncan's review

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55766 91177308-0d34-0410-b5e6-96231b3b80d8
artialSpecialization.cpp
a9abc43c0f2be77ae00eec46a57c893092582abf 04-Sep-2008 Andrew Lenharth <alenhar2@cs.uiuc.edu> cleanup as per Duncan's review

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55766 91177308-0d34-0410-b5e6-96231b3b80d8
artialSpecialization.cpp
7bbb4339f905345f92fcd60bf8f64bdc29c8cc36 04-Sep-2008 Devang Patel <dpatel@apple.com> Update inline threshold for current function if the notes say, optimize for size.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55745 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
a09b2a1db043bfae4e878d45f41a6829b677f27e 04-Sep-2008 Devang Patel <dpatel@apple.com> Update inline threshold for current function if the notes say, optimize for size.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55745 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
cf996d4b5613616f9de3a816751e2a128dac7d8a 03-Sep-2008 Andrew Lenharth <andrewl@lenharth.org> Initial version of a Partial Specialization IPO pass. It triggers a couple hundred times on 176.gcc. I don't know the performance impact yet, the heuristic is quite simple still.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55734 91177308-0d34-0410-b5e6-96231b3b80d8
artialSpecialization.cpp
4a3a40ad54f1e6b70a63fb824862261f98b2f353 03-Sep-2008 Andrew Lenharth <alenhar2@cs.uiuc.edu> Initial version of a Partial Specialization IPO pass. It triggers a couple hundred times on 176.gcc. I don't know the performance impact yet, the heuristic is quite simple still.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55734 91177308-0d34-0410-b5e6-96231b3b80d8
artialSpecialization.cpp
7946e7b8a4058fc2c76f782fa87340738caafaec 03-Sep-2008 Devang Patel <dpatel@apple.com> Fix typo in a comment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55720 91177308-0d34-0410-b5e6-96231b3b80d8
nlineAlways.cpp
1cd3a415b1e5d5420c2125eb523d7605779f9b94 03-Sep-2008 Devang Patel <dpatel@apple.com> Fix typo in a comment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55720 91177308-0d34-0410-b5e6-96231b3b80d8
nlineAlways.cpp
79cca4f49f8a29f7c1259ad12a068a51d666cb60 03-Sep-2008 Devang Patel <dpatel@apple.com> Add parentheses to make code more readable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55717 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
3cfb72c717f7096479deeac14637d8b73a152f2e 03-Sep-2008 Devang Patel <dpatel@apple.com> Add parentheses to make code more readable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55717 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
3fb68373c42fe0b8b670f506457d2c45bf12e6a5 03-Sep-2008 Devang Patel <dpatel@apple.com> Fix comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55716 91177308-0d34-0410-b5e6-96231b3b80d8
nlineAlways.cpp
74625384e661880102167eacf25bf95042d2d54b 03-Sep-2008 Devang Patel <dpatel@apple.com> Fix comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55716 91177308-0d34-0410-b5e6-96231b3b80d8
nlineAlways.cpp
22ec199fa0198220a11eb70ee55bb7ea3d1f7c60 03-Sep-2008 Devang Patel <dpatel@apple.com> Add custom inliner that handles only functions that are marked as always_inline.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55713 91177308-0d34-0410-b5e6-96231b3b80d8
nlineAlways.cpp
61650e3ce5bdeebfa7e3e38954e5dd04f7d2b0ba 03-Sep-2008 Devang Patel <dpatel@apple.com> Add custom inliner that handles only functions that are marked as always_inline.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55713 91177308-0d34-0410-b5e6-96231b3b80d8
nlineAlways.cpp
67243399dd7427c4f530a8c8cc73dfcfd4788f73 03-Sep-2008 Devang Patel <dpatel@apple.com> Handle "always inline" note during inline cost analysis.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55712 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
d783272bb70046b281e80289b59f96f0058c92ac 03-Sep-2008 Devang Patel <dpatel@apple.com> Handle "always inline" note during inline cost analysis.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55712 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
5e060104628b5a5779fc910f6e2d5a15771fa15b 03-Sep-2008 Devang Patel <dpatel@apple.com> Check noinline note and ignore other notes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55711 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
9f4d2d87e014441edd5ded22e0e3d03590e1d6da 03-Sep-2008 Devang Patel <dpatel@apple.com> Check noinline note and ignore other notes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55711 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
910c120a7c439ee3c6e9cd249ff0a05f0fdb6c98 03-Sep-2008 Devang Patel <dpatel@apple.com> Handle "noinline" note inside the simple inliner.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55708 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
nliner.cpp
41b0339e920d53ecba9b2f0f17ec5b01db0b13df 03-Sep-2008 Devang Patel <dpatel@apple.com> Handle "noinline" note inside the simple inliner.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55708 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
nliner.cpp
cb7f483d8c1e0ee48969e13aa3929dd172c97eff 03-Sep-2008 Devang Patel <dpatel@apple.com> s/FP_AlwaysInline/FN_NOTE_AlwaysInline/g


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55676 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
cfae3655f45016849e483c4f14cba63f29000c90 03-Sep-2008 Devang Patel <dpatel@apple.com> s/FP_AlwaysInline/FN_NOTE_AlwaysInline/g


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55676 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
691e52445e2a32d237fc23073fbaf93fb96ce584 03-Sep-2008 Devang Patel <dpatel@apple.com> respect inline=never and inline=always notes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55673 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
a697ae934e6cea0e472b324d6ca7328763992d8a 03-Sep-2008 Devang Patel <dpatel@apple.com> respect inline=never and inline=always notes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55673 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
a8c763b3071ae1a58ee8baeb282331245527e004 14-Aug-2008 Dan Gohman <gohman@apple.com> Use empty() instead of begin() == end().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54780 91177308-0d34-0410-b5e6-96231b3b80d8
oopExtractor.cpp
c8424dea0d4d223edbf5b6ed10d92d0567fd3c2c 14-Aug-2008 Dan Gohman <gohman@apple.com> Use empty() instead of begin() == end().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54780 91177308-0d34-0410-b5e6-96231b3b80d8
oopExtractor.cpp
c1f1d46f000eacceaa861e5b083ef0424cb9b41a 14-Aug-2008 Matthijs Kooijman <matthijs@stdin.nl> Replace two for loops with while(!X->use_empty()) loops. This prevents
invalidating the iterator by deleting the current use. This fixes a segfault on
64 bit linux reported in PR2675.

Also remove an unneeded if.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54778 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
9ca41bad635d3f582b8f4874f11a79e57823b16f 14-Aug-2008 Matthijs Kooijman <matthijs@stdin.nl> Replace two for loops with while(!X->use_empty()) loops. This prevents
invalidating the iterator by deleting the current use. This fixes a segfault on
64 bit linux reported in PR2675.

Also remove an unneeded if.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54778 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
f9e67aca52b3d889f4a5c38aaaa336020bba8ae4 13-Aug-2008 Bill Wendling <isanbard@gmail.com> Remove tabs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54707 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
3c470e2b3debc2bfade2e4a65d31f60de4c889e1 13-Aug-2008 Bill Wendling <isanbard@gmail.com> Remove tabs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54707 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
7d942001fa4384c02b991f997e3862067d4f4a62 07-Aug-2008 Matthijs Kooijman <matthijs@stdin.nl> Let SRETPromotion properly preserve the function name instead of (implicitly)
postfixing it with a number.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54468 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
610305fb93fc2427e1b857448a30f8a4302fd175 07-Aug-2008 Matthijs Kooijman <matthijs@stdin.nl> Let SRETPromotion properly preserve the function name instead of (implicitly)
postfixing it with a number.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54468 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
a7bab2c81c2b7340d210b9cf9221c5157d60b969 07-Aug-2008 Matthijs Kooijman <matthijs@stdin.nl> Fix SRETPromotion, it was generating functions without returns statements since
r53941 (but this was not noticed due to the lack of a basic test for
SRETPromotion).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54467 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
5074378452205e581c4570c18ef50c8550c1d22b 07-Aug-2008 Matthijs Kooijman <matthijs@stdin.nl> Fix SRETPromotion, it was generating functions without returns statements since
r53941 (but this was not noticed due to the lack of a basic test for
SRETPromotion).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54467 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
81ec2486b36e5f190785329faaa4ffe146cbcedc 07-Aug-2008 Matthijs Kooijman <matthijs@stdin.nl> Add some debug output to SRETPromotion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54464 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
48a1155fef7f164ac5f4904259605967a40e1f3d 07-Aug-2008 Matthijs Kooijman <matthijs@stdin.nl> Add some debug output to SRETPromotion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54464 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
477f5a2f11a0383b4ecfcb0db2913027ed38ee39 29-Jul-2008 Matthijs Kooijman <matthijs@stdin.nl> Restructure ArgumentPromotion a bit. Instead of just having a single boolean
that says "unconditional loads from this argument are safe", we now keep track
of the safety per set of indices from which loads happen. This prevents
ArgPromotion from promoting loads that aren't really valid. As an added effect,
this will now disregard the the type of the indices passed to a GEP, so
"load GEP %A, i32 1" and "load GEP %A, i64 1" will result in a single argument,
not two.

This fixes PR2598, for which a testcase has been added as well.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@54159 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
62e15650cc222b45f607a3bbe717a33dd4203c7a 29-Jul-2008 Matthijs Kooijman <matthijs@stdin.nl> Restructure ArgumentPromotion a bit. Instead of just having a single boolean
that says "unconditional loads from this argument are safe", we now keep track
of the safety per set of indices from which loads happen. This prevents
ArgPromotion from promoting loads that aren't really valid. As an added effect,
this will now disregard the the type of the indices passed to a GEP, so
"load GEP %A, i32 1" and "load GEP %A, i64 1" will result in a single argument,
not two.

This fixes PR2598, for which a testcase has been added as well.



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

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

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53941 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
tructRetPromotion.cpp
29474e9327b30f3f79a5ce3d4264cc23e1e6dcdb 23-Jul-2008 Dan Gohman <gohman@apple.com> Enable first-class aggregates support.

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

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53941 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
tructRetPromotion.cpp
bc1f989e3c58b24faf37a149a1ede294483b09b8 17-Jul-2008 Matthijs Kooijman <matthijs@stdin.nl> Make GlobalOpt preserve address spaces when scalar replacing aggregate globals.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53716 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
36693bbd9e9b2ab6cd23066f28596bae0bf39c9f 17-Jul-2008 Matthijs Kooijman <matthijs@stdin.nl> Make GlobalOpt preserve address spaces when scalar replacing aggregate globals.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53716 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
4f72368529b3afdfbc709ad5e8822835463b56c4 15-Jul-2008 Matthijs Kooijman <matthijs@stdin.nl> Allow deadargelim to change return types even though now values were dead. This
again canonicalizes {i32} into i32 and {} into void.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53610 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
49326620232db55392648ffeb396fa43bed32107 15-Jul-2008 Matthijs Kooijman <matthijs@stdin.nl> Allow deadargelim to change return types even though now values were dead. This
again canonicalizes {i32} into i32 and {} into void.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53610 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
d1d1de7f39335244e84b2d6b04381c370e0bb1a4 15-Jul-2008 Matthijs Kooijman <matthijs@stdin.nl> Revert r53606. It turns out that explicitely tracking the liveness of the
return value as a whole in deadargelim is really not needed now that we simply
rebuild the old return value and actually prevents some canonicalization from
taking place.

This revert stops deadargelim from changing {i32} into i32 for now, but I'll
fix that next.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53609 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
4c87b1aed60dfff8a984f1079861bd4b001ac327 15-Jul-2008 Matthijs Kooijman <matthijs@stdin.nl> Revert r53606. It turns out that explicitely tracking the liveness of the
return value as a whole in deadargelim is really not needed now that we simply
rebuild the old return value and actually prevents some canonicalization from
taking place.

This revert stops deadargelim from changing {i32} into i32 for now, but I'll
fix that next.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53609 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
eb32b453b3f4aaea5f93665ec5291a7dab864c5d 15-Jul-2008 Matthijs Kooijman <matthijs@stdin.nl> Make deadargelim a bit less smart, so it doesn't choke on nested structs as
return values that are still (partially) live. Instead of updating all uses of
a call instruction after removing some elements, it now just rebuilds the
original struct (With undef gaps where the unused values were) and leaves it to
instcombine to clean this up.

The added testcase still fails currently, but this is due to instcombine which
isn't good enough yet. I will fix that part next.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53608 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
45de1f9a3bb0d73ae6904cf9be96fec8971c77c6 15-Jul-2008 Matthijs Kooijman <matthijs@stdin.nl> Make deadargelim a bit less smart, so it doesn't choke on nested structs as
return values that are still (partially) live. Instead of updating all uses of
a call instruction after removing some elements, it now just rebuilds the
original struct (With undef gaps where the unused values were) and leaves it to
instcombine to clean this up.

The added testcase still fails currently, but this is due to instcombine which
isn't good enough yet. I will fix that part next.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53608 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
9c9418d0f36c8162f0a4f13193164a5509db0b5f 15-Jul-2008 Matthijs Kooijman <matthijs@stdin.nl> Don't use isa when we can reuse a previous dyn_cast.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53607 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
46ac260ecf43b0308b7d4af574539fc76c8ed95d 15-Jul-2008 Matthijs Kooijman <matthijs@stdin.nl> Don't use isa when we can reuse a previous dyn_cast.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53607 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
ddd1a79b6d9dafc7ebafea252266438f2b7c876a 15-Jul-2008 Matthijs Kooijman <matthijs@stdin.nl> Make DeadArgElim keep liveness of the return value as a whole in addition to
only the liveness of partial return values (for functions returning a struct).
This is more explicit to prevent unwanted changes in the return value.

In particular, deadargelim now canonicalizes a function returning {i32} to
returning i32 and {} to void, if the struct returned is not used in its
entirety, but only the single element is used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53606 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
68fe933adc585907c76314da0920243c52ceb70c 15-Jul-2008 Matthijs Kooijman <matthijs@stdin.nl> Make DeadArgElim keep liveness of the return value as a whole in addition to
only the liveness of partial return values (for functions returning a struct).
This is more explicit to prevent unwanted changes in the return value.

In particular, deadargelim now canonicalizes a function returning {i32} to
returning i32 and {} to void, if the struct returned is not used in its
entirety, but only the single element is used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53606 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
2bf5372d8ad714be63bdd34dbfda2ad4bd8eeaba 15-Jul-2008 Matthijs Kooijman <matthijs@stdin.nl> Let DAE keep a list of live functions, instead of simply marking all arguments
and return values live for those functions. This doesn't change anything yet,
but prepares for the coming commits.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53601 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
13f98053ce7b58546ba027ea3dfe18bf09d803f6 15-Jul-2008 Matthijs Kooijman <matthijs@stdin.nl> Let DAE keep a list of live functions, instead of simply marking all arguments
and return values live for those functions. This doesn't change anything yet,
but prepares for the coming commits.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53601 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
30156524734c5a4ac49a1e8c607c375346770fa5 15-Jul-2008 Matthijs Kooijman <matthijs@stdin.nl> Split DAE::MarkLive into MarkLive and PropagateLiveness.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53600 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
53d25bd95ad54eb4e50873ac1b07cbd4906d58cd 15-Jul-2008 Matthijs Kooijman <matthijs@stdin.nl> Split DAE::MarkLive into MarkLive and PropagateLiveness.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53600 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
6cdd54b6f73b1e8a00f9879a3f7eb5f20c9d4830 15-Jul-2008 Matthijs Kooijman <matthijs@stdin.nl> Pass around const RetOrArg references instead of copying values. Also, mark
RetOrArg::getDescription() as const.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53599 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
0b51b3993d2ef05a595421b2fd417353e3a898a8 15-Jul-2008 Matthijs Kooijman <matthijs@stdin.nl> Pass around const RetOrArg references instead of copying values. Also, mark
RetOrArg::getDescription() as const.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53599 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
03016ca361d159f51b3fda200674d0ec652ba039 15-Jul-2008 Matthijs Kooijman <matthijs@stdin.nl> Simplify debug code by using RetOrArg::getDescription().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53598 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
24ca635521d9598de3a46872aab85ae759da8828 15-Jul-2008 Matthijs Kooijman <matthijs@stdin.nl> Simplify debug code by using RetOrArg::getDescription().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53598 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
0d1730a14c6f9e2723e79afe857d46c0c3793a0d 15-Jul-2008 Matthijs Kooijman <matthijs@stdin.nl> Fix indentation (intentionally left out of the previous commit).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53592 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
c18b12ff288ef05746b4a621f25bb6222a1fbd24 15-Jul-2008 Matthijs Kooijman <matthijs@stdin.nl> Fix indentation (intentionally left out of the previous commit).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53592 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
a3ec5d6eccb0fa3746050a3d3c739bd9718b6bd0 15-Jul-2008 Matthijs Kooijman <matthijs@stdin.nl> Move the deadargelim code for intrinsically alive functions into its own
method, to slightly simplify control flow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53591 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
fbcf7c741332ee9956b37c0f512d3b65bbb48812 15-Jul-2008 Matthijs Kooijman <matthijs@stdin.nl> Move the deadargelim code for intrinsically alive functions into its own
method, to slightly simplify control flow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53591 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
c418bf3dd593b5b2fe2f978930f6d0d6b17e344e 11-Jul-2008 Dan Gohman <gohman@apple.com> Use find instead of lower_bound.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53474 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
b261a98997b7b93e6baffc418f7320873a709d7e 11-Jul-2008 Dan Gohman <gohman@apple.com> Use find instead of lower_bound.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53474 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
d16918f843933dbdfb23345b24de82c1da0637fe 10-Jul-2008 Matthijs Kooijman <matthijs@stdin.nl> Restructure dead argument elimination, try #3 :-)

Rewrite the DeadArgumentElimination pass, to use a more explicit tracking of
dependencies between return values and/or arguments. Also make the handling of
arguments and return values the same.

The pass now looks properly inside returned structs, but only at the first
level (ie, not inside nested structs).

This version fixed a few more bugs and was cleaned up a bit. It now passes all
of LLVM's testing, and should still pass SPEC2006. There is still a minor bug
with regard to returning nested structs. Since there is currently nothing that
emits such IR, I will fix that in a seperate commit (partly because it requires
a non-trivial fix).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53400 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
e5db99978f99c4b0db77a38dbff87a223a120570 10-Jul-2008 Matthijs Kooijman <matthijs@stdin.nl> Restructure dead argument elimination, try #3 :-)

Rewrite the DeadArgumentElimination pass, to use a more explicit tracking of
dependencies between return values and/or arguments. Also make the handling of
arguments and return values the same.

The pass now looks properly inside returned structs, but only at the first
level (ie, not inside nested structs).

This version fixed a few more bugs and was cleaned up a bit. It now passes all
of LLVM's testing, and should still pass SPEC2006. There is still a minor bug
with regard to returning nested structs. Since there is currently nothing that
emits such IR, I will fix that in a seperate commit (partly because it requires
a non-trivial fix).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53400 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
890aaa871046fa63e0cbb78681cecf3418865ac1 25-Jun-2008 Evan Cheng <evan.cheng@apple.com> Restore DeadArgElim back to 52570. It's breaking 447.dealII.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52736 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
330218558066b02166e4c3d9456b40803fba2dc0 25-Jun-2008 Evan Cheng <evan.cheng@apple.com> Restore DeadArgElim back to 52570. It's breaking 447.dealII.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52736 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
b58d211dbb18f54f1e389b0ad180d22fdc4ebaa3 25-Jun-2008 Duncan Sands <baldrick@free.fr> Pacify gcc-4.3.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52723 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
0fed0688e23e00fb427124cf9cb4f77dac490b0f 25-Jun-2008 Duncan Sands <baldrick@free.fr> Pacify gcc-4.3.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52723 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
ea9e516e86b3a6ca1b3a5b374365735e1cca414d 25-Jun-2008 Matthijs Kooijman <matthijs@stdin.nl> Fix a (false) warning on darwin.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52705 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
35e2c0e675b20b860e720a07027449eefefeb325 25-Jun-2008 Matthijs Kooijman <matthijs@stdin.nl> Fix a (false) warning on darwin.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52705 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
177058b4bd8980f48ec677fdbf5475ab16702179 25-Jun-2008 Matthijs Kooijman <matthijs@stdin.nl> Fix some cosmetics in comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52704 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
59962670e6e8d53f0d86e54def85ab01fbb69c89 25-Jun-2008 Matthijs Kooijman <matthijs@stdin.nl> Fix some cosmetics in comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52704 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
1d9a27776101ed4c2b71b6b910803c63100209f4 24-Jun-2008 Matthijs Kooijman <matthijs@stdin.nl> Commit the new DeadArgElim pass again, this time with the gcc bootstrap failures fixed.

Also add a testcase to reproduce the gcc bootstrap failure in very much reduced form.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52677 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
1e0eea1ef6e0ab89923f9f566b0662f385fd98aa 24-Jun-2008 Matthijs Kooijman <matthijs@stdin.nl> Commit the new DeadArgElim pass again, this time with the gcc bootstrap failures fixed.

Also add a testcase to reproduce the gcc bootstrap failure in very much reduced form.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52677 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
4e78908b9453edf7d0907d4811c469a630aff560 24-Jun-2008 Matthijs Kooijman <matthijs@stdin.nl> Rename a few variables to be more consistent.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52672 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
99feb6a8f1c2a691f61cda4fc3ac52a431950c7a 24-Jun-2008 Matthijs Kooijman <matthijs@stdin.nl> Rename a few variables to be more consistent.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52672 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.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
owerSetJmp.cpp
aiseAllocations.cpp
de087372732c19ef097a04c39942a047ca3553e8 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
owerSetJmp.cpp
aiseAllocations.cpp
9f99b7c595b6c8ce68cd5f9f85e473f68705bed1 21-Jun-2008 Evan Cheng <evan.cheng@apple.com> Back out Matthijs' DAE patches. It's miscompiling gcc driver.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52570 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
2649ffc10b238d737fddd93a624ebecba5414a1a 21-Jun-2008 Evan Cheng <evan.cheng@apple.com> Back out Matthijs' DAE patches. It's miscompiling gcc driver.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52570 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
7e43b3be885579c46fe6d2f8a7c57cf88fa13a25 20-Jun-2008 Matthijs Kooijman <matthijs@stdin.nl> 80 column and trailing whitespace fixes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52539 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
d4bd5f31158333815533c8b8e3d74fac536273f5 20-Jun-2008 Matthijs Kooijman <matthijs@stdin.nl> 80 column and trailing whitespace fixes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52539 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
df0891d2ffb6d00c5bd5b929dae02c74535ea246 20-Jun-2008 Matthijs Kooijman <matthijs@stdin.nl> Don't let DeadArgumentElimination attempt to update callers when the return
type wasn't changed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52538 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
c345e5f9a86d854044dea4cbeb679c6323c17846 20-Jun-2008 Matthijs Kooijman <matthijs@stdin.nl> Don't let DeadArgumentElimination attempt to update callers when the return
type wasn't changed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52538 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
03d18569cb39b0e4bd50f5eff2d4fe61bb234678 20-Jun-2008 Matthijs Kooijman <matthijs@stdin.nl> Don't let DeadArgElimination change the return type ({} into void and {T}
into T) when no return values are actually dead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52537 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
77edab7da10893a0e62aa8df3b933988f0040f01 20-Jun-2008 Matthijs Kooijman <matthijs@stdin.nl> Don't let DeadArgElimination change the return type ({} into void and {T}
into T) when no return values are actually dead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52537 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
9cb6ec26b3041ff4879579fd9ecee48b616154d8 20-Jun-2008 Matthijs Kooijman <matthijs@stdin.nl> Explicitely track if any arguments or return values were removed in
DeadArgumentElimination and assert that the function type does not change if
nothing was changed. This should catch subtle changes in function type that are
not intended.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52536 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
eea53d81f43eaedc30d0d87531ee490701142983 20-Jun-2008 Matthijs Kooijman <matthijs@stdin.nl> Explicitely track if any arguments or return values were removed in
DeadArgumentElimination and assert that the function type does not change if
nothing was changed. This should catch subtle changes in function type that are
not intended.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52536 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
1b492b2f8d2999b1cbc4aaf48874b091e81796a0 20-Jun-2008 Matthijs Kooijman <matthijs@stdin.nl> Remove debug output.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52535 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
ee24cfbb42c83b256ff886cd045ed66a570c19dc 20-Jun-2008 Matthijs Kooijman <matthijs@stdin.nl> Remove debug output.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52535 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
c95e44b4e0f7aa7a32be2f3649decf2ec006a503 20-Jun-2008 Matthijs Kooijman <matthijs@stdin.nl> Recommit r52459, rewriting of the dead argument elimination pass.

This is a fixed version that no longer uses multimap::equal_range, which
resulted in a pointer invalidation problem.

Also, DAE::InspectedFunctions was not really necessary, so it got removed.

Lastly, this version no longer applies the extra arg hack on functions who did
not have any arguments to start with.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52532 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
8a8d0dc80fc4776f7cc45741c26a620f8a3bff6a 20-Jun-2008 Matthijs Kooijman <matthijs@stdin.nl> Recommit r52459, rewriting of the dead argument elimination pass.

This is a fixed version that no longer uses multimap::equal_range, which
resulted in a pointer invalidation problem.

Also, DAE::InspectedFunctions was not really necessary, so it got removed.

Lastly, this version no longer applies the extra arg hack on functions who did
not have any arguments to start with.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52532 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
52d36e6f87fbb77ef89f1c73905993cf88f52a22 19-Jun-2008 Dan Gohman <gohman@apple.com> Use the common API for adding instructions to basic blocks instead of
using BasicBlock::getInstList.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52500 91177308-0d34-0410-b5e6-96231b3b80d8
owerSetJmp.cpp
20eea1bf14b533c0898df25a88315eb0216ecdb7 19-Jun-2008 Dan Gohman <gohman@apple.com> Use the common API for adding instructions to basic blocks instead of
using BasicBlock::getInstList.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52500 91177308-0d34-0410-b5e6-96231b3b80d8
owerSetJmp.cpp
f0da2039d17a3e6b72fd1c0df1f889afac65cbd0 19-Jun-2008 Matthijs Kooijman <matthijs@stdin.nl> Use a CallSite to find the nth argument of a call/invoke instruction instead of
using getOperand() directly. This makes things work with invoke instructions as
well.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52489 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
43fa9f6630889295ef1e03ac876634b87b9f19c6 19-Jun-2008 Matthijs Kooijman <matthijs@stdin.nl> Use a CallSite to find the nth argument of a call/invoke instruction instead of
using getOperand() directly. This makes things work with invoke instructions as
well.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52489 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
bb3761c9e5756f35b6fc219a2816d5a21f4fc7cd 18-Jun-2008 Owen Anderson <resistor@mac.com> Revert r52459, which was causing an infinite loop or massive slowdown on MultiSource/Applications/SPASS, and possibly others as well.
Please reapply once this is fixed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52465 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
a8cc5ef840f9a6b695842bb886dd9e1d6cb19d11 18-Jun-2008 Owen Anderson <resistor@mac.com> Revert r52459, which was causing an infinite loop or massive slowdown on MultiSource/Applications/SPASS, and possibly others as well.
Please reapply once this is fixed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52465 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
ca85d65277e7d07985712e49b267b34a65fe6aab 18-Jun-2008 Matthijs Kooijman <matthijs@stdin.nl> Rewrite the DeadArgumentElimination pass, to use a more explicit tracking of
dependencies between return values and/or arguments. Also make the handling of
arguments and return values the same.

The pass now looks properly inside returned structs, but only at the first
level (ie, not inside nested structs).

Also add a testcase for testing various variations of (multiple) dead rerturn
values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52459 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
c54966dc0438eff727bc5e370a1c455e1cd9f93e 18-Jun-2008 Matthijs Kooijman <matthijs@stdin.nl> Rewrite the DeadArgumentElimination pass, to use a more explicit tracking of
dependencies between return values and/or arguments. Also make the handling of
arguments and return values the same.

The pass now looks properly inside returned structs, but only at the first
level (ie, not inside nested structs).

Also add a testcase for testing various variations of (multiple) dead rerturn
values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52459 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
c2afe89019790adb2c590397960d69b8f1d9a537 18-Jun-2008 Matthijs Kooijman <matthijs@stdin.nl> Reapply r52397 (make IPConstProp promote returned arguments), but fixed this
time. Sorry for the trouble!

This time, also add a testcase, which I should have done in the first place...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52455 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
675d7b0cbf3401b6f24ed6b65076d13d4e4d4aa9 18-Jun-2008 Matthijs Kooijman <matthijs@stdin.nl> Reapply r52397 (make IPConstProp promote returned arguments), but fixed this
time. Sorry for the trouble!

This time, also add a testcase, which I should have done in the first place...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52455 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
8b0fcf38ef08874af8c718520a33554d73f7bd4f 18-Jun-2008 Matthijs Kooijman <matthijs@stdin.nl> Reapply r52396, it was unrelated to the breakage (that was caused by r52397, my
commit after this).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52453 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
054407f6d7ea6c4a72e9a180216c96dc56762d43 18-Jun-2008 Matthijs Kooijman <matthijs@stdin.nl> Reapply r52396, it was unrelated to the breakage (that was caused by r52397, my
commit after this).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52453 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
fc329f4fa18cf4e7b64c1813041d4895b19fa347 17-Jun-2008 Chris Lattner <sabre@nondot.org> revert recent patch which is causing widespread breakage.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52415 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
24240a3a2a1c7a3eeb50ea5c5b4155bc0675905d 17-Jun-2008 Chris Lattner <sabre@nondot.org> revert recent patch which is causing widespread breakage.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52415 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
2fbabf6e6dc61e0627b93a596bf13e272345c5e8 17-Jun-2008 Matthijs Kooijman <matthijs@stdin.nl> Learn IPConstProp to propagate arguments that are directly returned. Strictly
speaking these are not constant values. However, when a function always returns
one of its arguments, then from the point of view of each caller the return
value is constant (or at least a known value) and can be replaced.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52397 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
bfb4e84913551f92dccd3b725b66f2ba9bd81f47 17-Jun-2008 Matthijs Kooijman <matthijs@stdin.nl> Learn IPConstProp to propagate arguments that are directly returned. Strictly
speaking these are not constant values. However, when a function always returns
one of its arguments, then from the point of view of each caller the return
value is constant (or at least a known value) and can be replaced.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52397 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
906e423724f9f4409ff8725d0da8ecd09bec23cf 17-Jun-2008 Matthijs Kooijman <matthijs@stdin.nl> Learn IPConstProp to look at individual return values and propagate them
individually.

Also learn IPConstProp how returning first class aggregates work, in addition
to old style multiple return instructions.

Modify the return-constants testscase to confirm this behaviour.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52396 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
b951a957dcb24c4ec671d7f4a99751b9a9f66c94 17-Jun-2008 Matthijs Kooijman <matthijs@stdin.nl> Learn IPConstProp to look at individual return values and propagate them
individually.

Also learn IPConstProp how returning first class aggregates work, in addition
to old style multiple return instructions.

Modify the return-constants testscase to confirm this behaviour.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52396 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
18d73c206e8259de61abf54d8d0f47c0e54f42aa 09-Jun-2008 Chris Lattner <sabre@nondot.org> Fix PR2411, where ip constant prop would propagate the
result of a weak function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52137 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
a77a73efa3773167893a676484ca6af50fd8ae7f 09-Jun-2008 Chris Lattner <sabre@nondot.org> Fix PR2411, where ip constant prop would propagate the
result of a weak function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52137 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
47c6fd73172b07211ffaaad7189847ccd2416a73 05-Jun-2008 Matthijs Kooijman <matthijs@stdin.nl> Let StructRetPromotion check if all if its users are really calls or invokesn,
not other instructions. This fixes a crash with the added testcase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51992 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
75ac80378b1febd2a917dc849f099a16ca2243cf 05-Jun-2008 Matthijs Kooijman <matthijs@stdin.nl> Let StructRetPromotion check if all if its users are really calls or invokesn,
not other instructions. This fixes a crash with the added testcase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51992 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
257da0a7fc2df19444e57e7c84a278c6c1b9b551 05-Jun-2008 Matthijs Kooijman <matthijs@stdin.nl> Let StructRetPromotion check if it's users are really calling it and not
passing its pointer. Fixes test with added testcase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51991 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
848fa3472ab017516acfc3c6f36797a49afa8f7f 05-Jun-2008 Matthijs Kooijman <matthijs@stdin.nl> Let StructRetPromotion check if it's users are really calling it and not
passing its pointer. Fixes test with added testcase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51991 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
41335411a84aaf709e79b86b7dc109976940b772 05-Jun-2008 Matthijs Kooijman <matthijs@stdin.nl> Use use_iterator::getOperandNo instead of CallSite::hasArgument to check if a
function is passed as an argument instead of called. Also do this check a bit
earlier.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51990 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
611142833d24a7c266349b06f673b57b0838177c 05-Jun-2008 Matthijs Kooijman <matthijs@stdin.nl> Use use_iterator::getOperandNo instead of CallSite::hasArgument to check if a
function is passed as an argument instead of called. Also do this check a bit
earlier.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51990 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
227c27dd0628d317fdb71e900809ff7bd39e70d2 04-Jun-2008 Matthijs Kooijman <matthijs@stdin.nl> Replace two manual loops with calls to CallSite::hasArguments (no functional changes).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51947 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
ba7a5288f11501d08beaccafd8e9c0d7ff6553ca 04-Jun-2008 Matthijs Kooijman <matthijs@stdin.nl> Replace two manual loops with calls to CallSite::hasArguments (no functional changes).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51947 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
494661c623e06122eb63fe3a78aef131cdad10d2 30-May-2008 Matthijs Kooijman <matthijs@stdin.nl> Use eraseFromParent() instead of doing that manually in two places.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51770 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
3a25c1eb49da45e83578f17b4254743197fb06f6 30-May-2008 Matthijs Kooijman <matthijs@stdin.nl> Use eraseFromParent() instead of doing that manually in two places.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51770 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
5e46321d665d6b1f445aff70d8eabb4870a6cf0e 29-May-2008 Gabor Greif <ggreif@gmail.com> convert more operand loops to iterator formulation

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51663 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
lobalOpt.cpp
20f03f506b5a33ab4a836d91691dd29cebf01fcf 29-May-2008 Gabor Greif <ggreif@gmail.com> convert more operand loops to iterator formulation

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51591 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
f689071811289c4553024e901981734a4afe90fd 27-May-2008 Duncan Sands <baldrick@free.fr> Fix some constructs that gcc-4.4 warns about.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51591 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
28c3cff8250b3fe2adc6479306fe7dbdb48a1bdb 26-May-2008 Duncan Sands <baldrick@free.fr> Factor code to copy global value attributes like
the section or the visibility from one global
value to another: copyAttributesFrom. This is
particularly useful for duplicating functions:
previously this was done by explicitly copying
each attribute in turn at each place where a
new function was created out of an old one, with
the result that obscure attributes were regularly
forgotten (like the collector or the section).
Hopefully now everything is uniform and nothing
is forgotten.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51567 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
xtractGV.cpp
tructRetPromotion.cpp
0cc9058a792d86876b5ea532eb8be6842b407123 26-May-2008 Duncan Sands <baldrick@free.fr> Factor code to copy global value attributes like
the section or the visibility from one global
value to another: copyAttributesFrom. This is
particularly useful for duplicating functions:
previously this was done by explicitly copying
each attribute in turn at each place where a
new function was created out of an old one, with
the result that obscure attributes were regularly
forgotten (like the collector or the section).
Hopefully now everything is uniform and nothing
is forgotten.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51567 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
xtractGV.cpp
tructRetPromotion.cpp
992e97eed344a141ff581838cfdacb76a1e9559a 23-May-2008 Matthijs Kooijman <matthijs@stdin.nl> Indent fix.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51477 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
db5f959baa3f6ec0ac2a1182735b904c1355758d 23-May-2008 Matthijs Kooijman <matthijs@stdin.nl> Indent fix.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51477 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
399101a5990621b0357009ab1852cc00f410a6c6 23-May-2008 Dan Gohman <gohman@apple.com> Use isSingleValueType instead of isFirstClassType to
exclude struct and array types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51459 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
lobalOpt.cpp
5e8fbc2c0c34b9d212b77a54c38563b75726e13f 23-May-2008 Dan Gohman <gohman@apple.com> Use isSingleValueType instead of isFirstClassType to
exclude struct and array types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51459 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
lobalOpt.cpp
31e5bdccf29f0ce6172f0f0bbb43a9a736b1ef0c 23-May-2008 Dan Gohman <gohman@apple.com> Use isSingleValueType instead of isFirstClassType to
exclude struct and array types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51456 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
66aff3a01214a7c0617b972fdc31ac1de089dbfb 23-May-2008 Dan Gohman <gohman@apple.com> Use isSingleValueType instead of isFirstClassType to
exclude struct and array types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51456 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
1f7580c5ebfb3ab79c4be77cc5b85408bf3a8cf4 17-May-2008 Dale Johannesen <dalej@apple.com> Less conservative verison of previous patch,
suggested by Duncan.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51211 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
d62319192aad1fb17621082f4ca0e80db9678bf5 17-May-2008 Dale Johannesen <dalej@apple.com> Less conservative verison of previous patch,
suggested by Duncan.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51211 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
6796629611a07bdc9d6bb79ca1cf6cae78325411 16-May-2008 Dale Johannesen <dalej@apple.com> Weak functions not declared non-throwing might be
replaced at linktime with a body that throws, even
if the body in this file does not. Make PruneEH
be more conservative in this case.
g++.dg/eh/weak1.C



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51207 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
64a946cf5557910edf5001f034c1cf92e6fad242 16-May-2008 Dale Johannesen <dalej@apple.com> Weak functions not declared non-throwing might be
replaced at linktime with a body that throws, even
if the body in this file does not. Make PruneEH
be more conservative in this case.
g++.dg/eh/weak1.C



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51207 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
7cbd8a3e92221437048b484d5ef9c0a22d0f8c58 16-May-2008 Gabor Greif <ggreif@gmail.com> API change for {BinaryOperator|CmpInst|CastInst}::create*() --> Create. Legacy interfaces will be in place for some time. (Merge from use-diet branch.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51200 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
ndMemRemoval.cpp
aiseAllocations.cpp
a645dd3694fe06586679809ad2ded420666b4665 16-May-2008 Gabor Greif <ggreif@gmail.com> API change for {BinaryOperator|CmpInst|CastInst}::create*() --> Create. Legacy interfaces will be in place for some time. (Merge from use-diet branch.)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51200 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
ndMemRemoval.cpp
aiseAllocations.cpp
b1dbcd886a4b5597a839f299054b78b33fb2d6df 15-May-2008 Gabor Greif <ggreif@gmail.com> Fix a bunch of 80col violations that arose from the Create API change. Tweak makefile targets to find these better.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51143 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
b91ea9d5ae92622ca2100feb19af1bc7e784abbd 15-May-2008 Gabor Greif <ggreif@gmail.com> Fix a bunch of 80col violations that arose from the Create API change. Tweak makefile targets to find these better.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51143 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
ef3682a4fbfc3ff1a593adf95740ad8ab0d1d487 14-May-2008 Devang Patel <dpatel@apple.com> Simplify internalize pass. Add test case.
Patch by Matthijs Kooijman!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51114 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
23c4b31c100190589bf59639be592a47f91ee5c9 14-May-2008 Devang Patel <dpatel@apple.com> Simplify internalize pass. Add test case.
Patch by Matthijs Kooijman!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51114 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
a72acf938902ea8ae2776cad7327257e88a63a54 13-May-2008 Nate Begeman <natebegeman@mac.com> 80 col / tabs fixes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51021 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
285e2e4b303a2bd5d48eb4c27bf9405b17c129a4 13-May-2008 Nate Begeman <natebegeman@mac.com> 80 col / tabs fixes


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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51017 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
onstantMerge.cpp
eadArgumentElimination.cpp
eadTypeElimination.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
ndMemRemoval.cpp
nlineSimple.cpp
nliner.cpp
nternalize.cpp
oopExtractor.cpp
owerSetJmp.cpp
runeEH.cpp
aiseAllocations.cpp
tripDeadPrototypes.cpp
tripSymbols.cpp
tructRetPromotion.cpp
089efffd7d1ca0d10522ace38d36e0a67f4fac2d 13-May-2008 Dan Gohman <gohman@apple.com> Clean up the use of static and anonymous namespaces. This turned up
several things that were neither in an anonymous namespace nor static
but not intended to be global.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51017 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
onstantMerge.cpp
eadArgumentElimination.cpp
eadTypeElimination.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
ndMemRemoval.cpp
nlineSimple.cpp
nliner.cpp
nternalize.cpp
oopExtractor.cpp
owerSetJmp.cpp
runeEH.cpp
aiseAllocations.cpp
tripDeadPrototypes.cpp
tripSymbols.cpp
tructRetPromotion.cpp
33af59d0f021838c8e601cb300681f71ee31c47a 09-May-2008 Duncan Sands <baldrick@free.fr> Fix a type and formatting.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50900 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
8573b004e18a9054ba57c01d66fb5b83f48c4a97 09-May-2008 Duncan Sands <baldrick@free.fr> Fix a type and formatting.


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

Patch by Matthijs Kooijman!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50861 91177308-0d34-0410-b5e6-96231b3b80d8
tripDeadPrototypes.cpp
tructRetPromotion.cpp
085566990b5cc483b9bc5f7c9abd12e976062d65 08-May-2008 Gordon Henriksen <gordonhenriksen@mac.com> Improve pass documentation and comments.

Patch by Matthijs Kooijman!

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50861 91177308-0d34-0410-b5e6-96231b3b80d8
tripDeadPrototypes.cpp
tructRetPromotion.cpp
d7266d484a861c3fcc6763df27fc81a8e3c46fc5 08-May-2008 Devang Patel <dpatel@apple.com> Check linkage.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50851 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
355881e62de7e330060761c6c6a9ef89d44d5bd2 08-May-2008 Devang Patel <dpatel@apple.com> Check linkage.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50851 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
4a3f6c88820a204f80ca0fa3f1f2fe09ca10b02f 06-May-2008 Dan Gohman <gohman@apple.com> Make several variable declarations static.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50696 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
nternalize.cpp
oopExtractor.cpp
2c37da52902a619dc12b5dd46040fd223ee7d2eb 06-May-2008 Dan Gohman <gohman@apple.com> Make several variable declarations static.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50696 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
nternalize.cpp
oopExtractor.cpp
fd1cbbe9cfeddab8ec99a9325c1e87311609c0a3 01-May-2008 Chris Lattner <sabre@nondot.org> Delete the IPO simplify-libcalls and completely reimplement it as
a FunctionPass. This makes it simpler, fixes dozens of bugs, adds
a couple of minor features, and shrinks is considerably: from
2214 to 1437 lines.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50520 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
993fd31e0f17cd6f6408ebd6593f6dd026f2f621 01-May-2008 Chris Lattner <sabre@nondot.org> Delete the IPO simplify-libcalls and completely reimplement it as
a FunctionPass. This makes it simpler, fixes dozens of bugs, adds
a couple of minor features, and shrinks is considerably: from
2214 to 1437 lines.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50520 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
ea8650cddfb4ec7a532409ea918173e050cb40e8 30-Apr-2008 Chris Lattner <sabre@nondot.org> use string length computation to generalize several xforms.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50464 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
0bf186f378b9623ec80d51580cfc3fa284ce9424 30-Apr-2008 Chris Lattner <sabre@nondot.org> use string length computation to generalize several xforms.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50464 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
5b222d748a0976497297fa77d1dd36328331e32c 29-Apr-2008 Chris Lattner <sabre@nondot.org> Implement more aggressive support for analyzing string length. This
generalizes the previous code to handle the case when the string is not
an immediate to the strlen call (for example, crazy stuff like
strlen(c ? "foo" : "bart"+1) -> 3). This implements
gcc.c-torture/execute/builtins/strlen-2.c. I will generalize other
cases in simplifylibcalls to use the same routine later.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50408 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
a244a39772791f01871e87985907d8b184ccec8f 29-Apr-2008 Chris Lattner <sabre@nondot.org> Implement more aggressive support for analyzing string length. This
generalizes the previous code to handle the case when the string is not
an immediate to the strlen call (for example, crazy stuff like
strlen(c ? "foo" : "bart"+1) -> 3). This implements
gcc.c-torture/execute/builtins/strlen-2.c. I will generalize other
cases in simplifylibcalls to use the same routine later.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50408 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
998182b3802d2be8d081ca484b5d4fd5e1188950 26-Apr-2008 Chris Lattner <sabre@nondot.org> When SRoA'ing a global variable, make sure the new globals get the
appropriate alignment. This fixes a miscompilation of 252.eon on
x86-64 (rdar://5891920).

Bill, please pull this into Tak.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50308 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
20846274a7f535146b327141c523befa40c727de 26-Apr-2008 Chris Lattner <sabre@nondot.org> When SRoA'ing a global variable, make sure the new globals get the
appropriate alignment. This fixes a miscompilation of 252.eon on
x86-64 (rdar://5891920).

Bill, please pull this into Tak.


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


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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50265 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
4af6ad37898bcda9e29fe1c7abbb1b9899af3b5b 23-Apr-2008 Chris Lattner <sabre@nondot.org> simplify code for propagation of constant arguments into
callees.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50142 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
92edf5083bb6b2b90c102e17d852a12beaf8c3d7 23-Apr-2008 Chris Lattner <sabre@nondot.org> simplify code for propagation of constant arguments into
callees.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50142 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
e9625c6c88477382d7b4db6c16108ab2db2b1326 23-Apr-2008 Chris Lattner <sabre@nondot.org> Fix a number of bugs in ipconstantprop, simplify the code, fit in 80 cols,
fix read after free bug (PR2238).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50141 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
7f295eaf991a6117c50fea44069dbb55bc231889 23-Apr-2008 Chris Lattner <sabre@nondot.org> Fix a number of bugs in ipconstantprop, simplify the code, fit in 80 cols,
fix read after free bug (PR2238).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50141 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
281def945608e177e7ca8bcaf142b58a06e0892d 21-Apr-2008 Chris Lattner <sabre@nondot.org> don't assume that the argument passed to fprintf("%s" is a string. This
fixes a crash in opt on 433.milc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50023 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
4724e814ee4e17f54625c2db27a4916329ca734a 21-Apr-2008 Chris Lattner <sabre@nondot.org> don't assume that the argument passed to fprintf("%s" is a string. This
fixes a crash in opt on 433.milc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50023 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
bcd203cf860269987f32b14737b200b84fc2b63e 19-Apr-2008 Chris Lattner <sabre@nondot.org> Allow argpromote to promote struct arguments with a specified number
of elements. Patch by Matthijs Kooijman!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49962 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
57e8a5bb6c0489a5c0428c54db1ef9e1111d777b 19-Apr-2008 Chris Lattner <sabre@nondot.org> Allow argpromote to promote struct arguments with a specified number
of elements. Patch by Matthijs Kooijman!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49962 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
0c1963099f350415a2d091ace8ff5f61b8592910 10-Apr-2008 Chris Lattner <sabre@nondot.org> Disable an xform we've had for a long time, pow(x,0.5) -> sqrt.
This is not safe for all inputs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49458 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
73d02362e91f35823087df560483b6f97c189a19 10-Apr-2008 Chris Lattner <sabre@nondot.org> Disable an xform we've had for a long time, pow(x,0.5) -> sqrt.
This is not safe for all inputs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49458 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
cc7f168c6cb6c5a41de59aa524dd57593250ba5f 09-Apr-2008 Chris Lattner <sabre@nondot.org> Generalize getUnaryFloatFunction to handle any FP unary function, automatically
figuring out the suffix to use. implement pow(2,x) -> exp2(x).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49437 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
184b84e1953d8d5853e8f553bb55918a6b03fbb0 09-Apr-2008 Chris Lattner <sabre@nondot.org> Generalize getUnaryFloatFunction to handle any FP unary function, automatically
figuring out the suffix to use. implement pow(2,x) -> exp2(x).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49437 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
8bb9a4f28f62502b7d7a9a1b4e553406fcbac87d 09-Apr-2008 Chris Lattner <sabre@nondot.org> use the new ConstantFP::get method to make this work with
long double and simplify the code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49435 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
45b857495d1e0aee884654f358d21afef3d017c9 09-Apr-2008 Chris Lattner <sabre@nondot.org> use the new ConstantFP::get method to make this work with
long double and simplify the code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49435 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
77d00b0cea5ff46d2b8bc14069b9548ffd74e3ac 09-Apr-2008 Chris Lattner <sabre@nondot.org> many cleanups to the pow optimizer. Allow it to handle powf,
add support for pow(x, 2.0) -> x*x.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49411 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
89c3e3d87a4c190d9b6c8aad8b844f1fa3fa15f0 09-Apr-2008 Chris Lattner <sabre@nondot.org> many cleanups to the pow optimizer. Allow it to handle powf,
add support for pow(x, 2.0) -> x*x.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49411 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
e2c4304654442ca353b307d73c86dce2a4acadbf 07-Apr-2008 Duncan Sands <baldrick@free.fr> Use Intrinsic::getDeclaration in more places.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49338 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
3c81269349934a51dc02c6a67442ef5e59cfca8e 07-Apr-2008 Duncan Sands <baldrick@free.fr> Use Intrinsic::getDeclaration in more places.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49338 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.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
rgumentPromotion.cpp
eadArgumentElimination.cpp
xtractGV.cpp
lobalOpt.cpp
ndMemRemoval.cpp
owerSetJmp.cpp
runeEH.cpp
aiseAllocations.cpp
implifyLibCalls.cpp
tructRetPromotion.cpp
d6da1d0d17e2605363504f044664696f4d85b30f 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
rgumentPromotion.cpp
eadArgumentElimination.cpp
xtractGV.cpp
lobalOpt.cpp
ndMemRemoval.cpp
owerSetJmp.cpp
runeEH.cpp
aiseAllocations.cpp
implifyLibCalls.cpp
tructRetPromotion.cpp
7c3becd9d729b976d79b18e6165e74390e613bb5 02-Apr-2008 Evan Cheng <evan.cheng@apple.com> 1. Drop default inline threshold back down to 200.
2. Do not use # of basic blocks as part of the cost computation since it doesn't really figure into function size.
3. More aggressively inline function with vector code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49061 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
a3a03293053509bb588fb56ed81cfed06b9ec14f 02-Apr-2008 Evan Cheng <evan.cheng@apple.com> 1. Drop default inline threshold back down to 200.
2. Do not use # of basic blocks as part of the cost computation since it doesn't really figure into function size.
3. More aggressively inline function with vector code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49061 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
8d84d5b62cdf2a772d51338136c7022a6e1ff931 24-Mar-2008 Evan Cheng <evan.cheng@apple.com> Increasing the inline limit from (overly conservative) 200 to 300. Given each BB costs 20 and each instruction costs 5, 200 means a 4 BB function + 24 instructions (actually less because caller's size also contributes to it).

Furthermore, double the limit when more than 10% of the callee instructions are vector instructions. Multimedia kernels tend to love inlining.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48725 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
nliner.cpp
9880e57fedff6ca8174c2cdc5f130c1669a5c09b 24-Mar-2008 Evan Cheng <evan.cheng@apple.com> Increasing the inline limit from (overly conservative) 200 to 300. Given each BB costs 20 and each instruction costs 5, 200 means a 4 BB function + 24 instructions (actually less because caller's size also contributes to it).

Furthermore, double the limit when more than 10% of the callee instructions are vector instructions. Multimedia kernels tend to love inlining.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48725 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
nliner.cpp
c9235d2e855c56e9aa157969f8132a05f9ba89d8 22-Mar-2008 Dan Gohman <gohman@apple.com> Don't include <map> in Pass.h, which doesn't need it. This requires
adding <map> to many files that actually do need it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48667 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
eadArgumentElimination.cpp
lobalOpt.cpp
owerSetJmp.cpp
249ddbfb29dfc2335f98984878c52b2c77703417 22-Mar-2008 Dan Gohman <gohman@apple.com> Don't include <map> in Pass.h, which doesn't need it. This requires
adding <map> to many files that actually do need it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48667 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
eadArgumentElimination.cpp
lobalOpt.cpp
owerSetJmp.cpp
7623716e613032cff6c3d6808a19f0091ba9f4e8 21-Mar-2008 Andrew Lenharth <andrewl@lenharth.org> FunctionExtractorPass has been superceded by GVExtractorPass

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48648 91177308-0d34-0410-b5e6-96231b3b80d8
xtractFunction.cpp
6c30a3aa5300084b46bda62baab7f2fdd369be96 21-Mar-2008 Andrew Lenharth <alenhar2@cs.uiuc.edu> FunctionExtractorPass has been superceded by GVExtractorPass

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48648 91177308-0d34-0410-b5e6-96231b3b80d8
xtractFunction.cpp
488b678a4915eae8e878f5776549a19493edecf7 20-Mar-2008 Devang Patel <dpatel@apple.com> Incorporate feedback.
- Fix loop nest.
- Use RetVals.size()
- Check for null return value.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48605 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
f922e8585d4bb8c173120dd86b1ebfa8ce913abc 20-Mar-2008 Devang Patel <dpatel@apple.com> Incorporate feedback.
- Fix loop nest.
- Use RetVals.size()
- Check for null return value.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48605 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
2b3407f5b3d8626b924c532bcfea15daaf1bd3c0 20-Mar-2008 Zhou Sheng <zhousheng00@gmail.com> Take the old function's name.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48588 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
7f161cc0f58c8837d0508752aa5dd20857ac4bc5 20-Mar-2008 Zhou Sheng <zhousheng00@gmail.com> Take the old function's name.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48588 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
58d74910c6b82e622ecbb57d6644d48fec5a5c0f 12-Mar-2008 Chris Lattner <sabre@nondot.org> Reimplement the parameter attributes support, phase #1. hilights:

1. There is now a "PAListPtr" class, which is a smart pointer around
the underlying uniqued parameter attribute list object, and manages
its refcount. It is now impossible to mess up the refcount.
2. PAListPtr is now the main interface to the underlying object, and
the underlying object is now completely opaque.
3. Implementation details like SmallVector and FoldingSet are now no
longer part of the interface.
4. You can create a PAListPtr with an arbitrary sequence of
ParamAttrsWithIndex's, no need to make a SmallVector of a specific
size (you can just use an array or scalar or vector if you wish).
5. All the client code that had to check for a null pointer before
dereferencing the pointer is simplified to just access the
PAListPtr directly.
6. The interfaces for adding attrs to a list and removing them is a
bit simpler.

Phase #2 will rename some stuff (e.g. PAListPtr) and do other less
invasive changes.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48289 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
lobalOpt.cpp
runeEH.cpp
tructRetPromotion.cpp
1c8733e1fd69e634daaa7fefd0d1436b846a8eb3 12-Mar-2008 Chris Lattner <sabre@nondot.org> Reimplement the parameter attributes support, phase #1. hilights:

1. There is now a "PAListPtr" class, which is a smart pointer around
the underlying uniqued parameter attribute list object, and manages
its refcount. It is now impossible to mess up the refcount.
2. PAListPtr is now the main interface to the underlying object, and
the underlying object is now completely opaque.
3. Implementation details like SmallVector and FoldingSet are now no
longer part of the interface.
4. You can create a PAListPtr with an arbitrary sequence of
ParamAttrsWithIndex's, no need to make a SmallVector of a specific
size (you can just use an array or scalar or vector if you wish).
5. All the client code that had to check for a null pointer before
dereferencing the pointer is simplified to just access the
PAListPtr directly.
6. The interfaces for adding attrs to a list and removing them is a
bit simpler.

Phase #2 will rename some stuff (e.g. PAListPtr) and do other less
invasive changes.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48289 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
lobalOpt.cpp
runeEH.cpp
tructRetPromotion.cpp
045497ae27bdf28589f5ada0d132990af464c598 12-Mar-2008 Devang Patel <dpatel@apple.com> Check multiple return values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48267 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
ead436b69e5df9b2644e353a349f72fef7aff33b 12-Mar-2008 Devang Patel <dpatel@apple.com> Check multiple return values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48267 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
8f9b551147c928c216de5e693ecc433015ab531a 12-Mar-2008 Devang Patel <dpatel@apple.com> Fix attribute handling.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48262 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
3ec7de712fb78f0d8f126a5e8e18f037e1bdf58b 12-Mar-2008 Devang Patel <dpatel@apple.com> Fix attribute handling.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48262 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
7db30ba70111bd082d854e00f0b854c8d91eed76 11-Mar-2008 Devang Patel <dpatel@apple.com> Handle multiple ret values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48254 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
13f24373c42edb379182ac0899f4d73de773a262 11-Mar-2008 Devang Patel <dpatel@apple.com> Handle multiple ret values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48254 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
a0238778db5f96fc1dd104cd3c0c8e024f5e24b3 11-Mar-2008 Devang Patel <dpatel@apple.com> Initialize.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48253 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
5d4617e8254bffd47c9fdb20586547d92e1eeb27 11-Mar-2008 Devang Patel <dpatel@apple.com> Initialize.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48253 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
9be3c97183f832d084bcf0fab82f7cd8aae08385 10-Mar-2008 Nick Lewycky <nicholas@mxc.ca> Turn unwind_to into "unwinds to".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48123 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
3bfbfd81e938182bd7f7fc6cace0c23c2da6a96d 10-Mar-2008 Nick Lewycky <nicholas@mxc.ca> Turn unwind_to into "unwinds to".


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48123 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
58d5e051574339106ce4139697ebadd21e34dbc0 09-Mar-2008 Ted Kremenek <kremenek@apple.com> Fix some compilation errors on msvc:
- "Redefinition of I" (iterator masks previous definition)
- include missing header file

Patch by Argiris Kirtzidis!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48115 91177308-0d34-0410-b5e6-96231b3b80d8
xtractGV.cpp
d40cdd29d09900bf2749cb8f7cc5a69a1e612ac0 09-Mar-2008 Ted Kremenek <kremenek@apple.com> Fix some compilation errors on msvc:
- "Redefinition of I" (iterator masks previous definition)
- include missing header file

Patch by Argiris Kirtzidis!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48115 91177308-0d34-0410-b5e6-96231b3b80d8
xtractGV.cpp
3c4a26226f30f2e9a022d155586e660af38aba1f 09-Mar-2008 Nick Lewycky <nicholas@mxc.ca> And again.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48112 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
ed87023e697c2621f9b15f09d62fa32822519c1c 09-Mar-2008 Nick Lewycky <nicholas@mxc.ca> And again.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48112 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
f336983bbcdc21fba7dcc02f4f6cfc06341b1e6d 09-Mar-2008 Nick Lewycky <nicholas@mxc.ca> Braces belong here. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48111 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
9b149b36a262753fd70449c035d4b743276caad7 09-Mar-2008 Nick Lewycky <nicholas@mxc.ca> Braces belong here. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48111 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
c0d025f54f96ff719ae99d57d7c413aee35b6cbc 09-Mar-2008 Nick Lewycky <nicholas@mxc.ca> Prune the unwind_to labels on BBs that don't need them. Another step in the
removal of invoke, PR1269.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48084 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
62bf14d17c085faf184f207912106fe93da746d7 09-Mar-2008 Nick Lewycky <nicholas@mxc.ca> Prune the unwind_to labels on BBs that don't need them. Another step in the
removal of invoke, PR1269.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48084 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
d245a8ae470e2ee84d138379f793095646c590e5 07-Mar-2008 Andrew Lenharth <andrewl@lenharth.org> add a pass that can extract all kinds of global values, not just functions. Update llvm-extract to use it and optionally extract a global variable if you want it too

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48015 91177308-0d34-0410-b5e6-96231b3b80d8
xtractGV.cpp
38a176764521c0168e78213dace030c47a9b2124 07-Mar-2008 Andrew Lenharth <alenhar2@cs.uiuc.edu> add a pass that can extract all kinds of global values, not just functions. Update llvm-extract to use it and optionally extract a global variable if you want it too

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48015 91177308-0d34-0410-b5e6-96231b3b80d8
xtractGV.cpp
e0a6a3f22d2d847237e802307c2e6cd036d3c0ac 06-Mar-2008 Devang Patel <dpatel@apple.com> Skip, for now, callsites where use of sret argument is not dominated by callsite.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47980 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
876fff555f9c6891f93354a0b72d1ecf4cb6ebc9 06-Mar-2008 Devang Patel <dpatel@apple.com> Skip, for now, callsites where use of sret argument is not dominated by callsite.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47980 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
a9fe8bb3b668c7822ff458beae3fb60df920b16d 04-Mar-2008 Devang Patel <dpatel@apple.com> Filter nested structs


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47906 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
d81d65f70dff2899a0d4856b32394b1942ce262d 04-Mar-2008 Devang Patel <dpatel@apple.com> Filter nested structs


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47906 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
96f9cc02e31f9d8722eec33f13ddb0f75eb67ccc 04-Mar-2008 Devang Patel <dpatel@apple.com> Use appropriate index to get the result value.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47897 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
13eee89f99a592d28aad7bcec2b0326e56884150 04-Mar-2008 Devang Patel <dpatel@apple.com> Use appropriate index to get the result value.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47897 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
544b92bb3ccae1f21fe55a5884a2f15d5a42eb85 04-Mar-2008 Devang Patel <dpatel@apple.com> Skip sret attribute while preparing attribute list for
new function and new call sites.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47896 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
7d7e00a1c1bfc23aefec69580bf46aba2ca38b2e 04-Mar-2008 Devang Patel <dpatel@apple.com> Skip sret attribute while preparing attribute list for
new function and new call sites.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47896 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
df1d15c52ebdb3fa6826d56dda231952f495b30f 04-Mar-2008 Devang Patel <dpatel@apple.com> Increment counter that keeps track of total number of sret promoted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47892 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
09bfbff9a9c17bb3440fcfc109111bfbc5a43633 04-Mar-2008 Devang Patel <dpatel@apple.com> Increment counter that keeps track of total number of sret promoted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47892 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
d0f4103a3126827a48189466ce61edc432d01593 04-Mar-2008 Devang Patel <dpatel@apple.com> Skip declarations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47890 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
eaaffb5f939f5fe5597973aed80580b1f31ab88d 04-Mar-2008 Devang Patel <dpatel@apple.com> Skip declarations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47890 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
74382c3453f99bcf0b3336138f4573a906b7f2f1 04-Mar-2008 Devang Patel <dpatel@apple.com> Process externally visible functions also. Later on code generator will do the right thing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47889 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
c4878e921c87e8d5d32316832b14ad851a7d35bc 04-Mar-2008 Devang Patel <dpatel@apple.com> Process externally visible functions also. Later on code generator will do the right thing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47889 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
98a6e067df5f6a17c12ad68fed5586e238575275 04-Mar-2008 Devang Patel <dpatel@apple.com> Collect statistics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47888 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
fdf8881f8171716733cba8d38aff9b0fbd04a63e 04-Mar-2008 Devang Patel <dpatel@apple.com> Collect statistics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47888 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
41e2397b720bc5d917ef614a7a6c257e8a3c8e42 03-Mar-2008 Devang Patel <dpatel@apple.com> s/isReturnStruct()/hasStructRetAttr()/g


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47857 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
tructRetPromotion.cpp
949a4b703892bb1609da45f4f9b6573c9c83f161 03-Mar-2008 Devang Patel <dpatel@apple.com> s/isReturnStruct()/hasStructRetAttr()/g


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47857 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
tructRetPromotion.cpp
2a4821b2b35be16c8ce1547856ca2bb75cdff751 03-Mar-2008 Devang Patel <dpatel@apple.com> Preserve paramater attributes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47847 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
0a42ac0b418b9deb271dacccf4b0f59a78b6c87d 03-Mar-2008 Devang Patel <dpatel@apple.com> Preserve paramater attributes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47847 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
b822e70f368b232c32c34d5ae93377aaa824becc 01-Mar-2008 Chris Lattner <sabre@nondot.org> allow specified inline threshold to be negative, as the value is
itself sometimes negative.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47786 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
9774be3b21e4b1b9dfb246c67d595b4979724368 01-Mar-2008 Chris Lattner <sabre@nondot.org> allow specified inline threshold to be negative, as the value is
itself sometimes negative.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47786 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
c45b5d9f6675c39bea87c15da0067cb4b183b3a2 01-Mar-2008 Devang Patel <dpatel@apple.com> Fix cut-n-pasto.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47777 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
3b3596f0fc5cd37fdd180ca2712dfb8fabcaf34f 01-Mar-2008 Devang Patel <dpatel@apple.com> Fix cut-n-pasto.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47777 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
ca891ecf9152791f72f33a0dafff6b4a022642ee 01-Mar-2008 Devang Patel <dpatel@apple.com> Add pass to promote sret.
This pass transforms

%struct._Point = type { i32, i32, i32, i32, i32, i32 }
define internal void @foo(%struct._Point* sret %agg.result)

into

%struct._Point = type { i32, i32, i32, i32, i32, i32 }
define internal %struct._Point @foo()

This pass updates foo() clients appropriately to use
getresult instruction to extract return values.

This pass is not yet ready for prime time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47776 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
72ef0c1eb70f920d113423818bf73575b315c4b2 01-Mar-2008 Devang Patel <dpatel@apple.com> Add pass to promote sret.
This pass transforms

%struct._Point = type { i32, i32, i32, i32, i32, i32 }
define internal void @foo(%struct._Point* sret %agg.result)

into

%struct._Point = type { i32, i32, i32, i32, i32, i32 }
define internal %struct._Point @foo()

This pass updates foo() clients appropriately to use
getresult instruction to extract return values.

This pass is not yet ready for prime time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47776 91177308-0d34-0410-b5e6-96231b3b80d8
tructRetPromotion.cpp
22c3979fcaa7ff19c44253eb9b0b0160dfef0aa4 22-Feb-2008 Dale Johannesen <dalej@apple.com> Split ParameterAttributes.h, putting the complicated
stuff into ParamAttrsList.h. Per feedback from
ParamAttrs changes.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47504 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
lobalOpt.cpp
runeEH.cpp
98738829ab804dc840148c732abd9cb91205475c 22-Feb-2008 Dale Johannesen <dalej@apple.com> Split ParameterAttributes.h, putting the complicated
stuff into ParamAttrsList.h. Per feedback from
ParamAttrs changes.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47504 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
lobalOpt.cpp
runeEH.cpp
c6ee8276f3c442b03f40255fd1136dc2b84b54cf 20-Feb-2008 Anton Korobeynikov <asl@math.spbu.ru> Get rid of hash_map. Use StringMap instead


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47373 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
05d33ee7e7c61f156d1143ec461309798d9b268b 20-Feb-2008 Anton Korobeynikov <asl@math.spbu.ru> Get rid of hash_map. Use StringMap instead


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47373 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
07e6e56f57e8781a8d7bc601cc9034a3741d84c2 20-Feb-2008 Anton Korobeynikov <asl@math.spbu.ru> Make Transforms to be 4.3 warnings-clean


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47371 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
PConstantPropagation.cpp
8522e1cb53143973c245b49b21e353ed046b195d 20-Feb-2008 Anton Korobeynikov <asl@math.spbu.ru> Make Transforms to be 4.3 warnings-clean


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47371 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
PConstantPropagation.cpp
ae9f3a3b7c915f725aef5a7250e88eaeddda03c6 20-Feb-2008 Anton Korobeynikov <asl@math.spbu.ru> Unbreak build with gcc 4.3: provide missed includes and silence most annoying warnings.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47367 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
357a27dc855c3247c2a73120fbcb98e708564400 20-Feb-2008 Anton Korobeynikov <asl@math.spbu.ru> Unbreak build with gcc 4.3: provide missed includes and silence most annoying warnings.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47367 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
0d51e7ec0d2dcbea9e304fd58deb05f37eb75635 19-Feb-2008 Dale Johannesen <dalej@apple.com> Expand ParameterAttributes to 32 bits (in preparation
for adding alignment info, not there yet). Clean up
interfaces to reference ParameterAttributes consistently.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47342 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
runeEH.cpp
f4666f59fc17a4e5c4764e56220d1c5888fd8f58 19-Feb-2008 Dale Johannesen <dalej@apple.com> Expand ParameterAttributes to 32 bits (in preparation
for adding alignment info, not there yet). Clean up
interfaces to reference ParameterAttributes consistently.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47342 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
runeEH.cpp
548448a317b39ec8446f3c82f44d01f938b921b2 18-Feb-2008 Duncan Sands <baldrick@free.fr> Simplify caller updating using a CallSite, as
requested by Chris. While there, do the same
for an existing function committed by someone
called "lattner" :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47273 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
551ec909057f58b1103f57a9dee45e4d7cf5e061 18-Feb-2008 Duncan Sands <baldrick@free.fr> Simplify caller updating using a CallSite, as
requested by Chris. While there, do the same
for an existing function committed by someone
called "lattner" :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47273 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
3d5378ff8e015e6ede4fd3d33c3e05a1dfec5b99 16-Feb-2008 Duncan Sands <baldrick@free.fr> Remove any 'nest' parameter attributes if the function
is not passed as an argument to a trampoline intrinsic.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47220 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
afa10bfb94fb68da6cc3a895f7a4730df87064dd 16-Feb-2008 Duncan Sands <baldrick@free.fr> Remove any 'nest' parameter attributes if the function
is not passed as an argument to a trampoline intrinsic.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47220 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
eedcf3fc4623ee9b40e3859fe6810895127f0c45 13-Feb-2008 Chris Lattner <sabre@nondot.org> remove some dead code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47066 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
890651a61b11f3ab422d9cdc7925765f55199336 13-Feb-2008 Chris Lattner <sabre@nondot.org> remove some dead code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47066 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
532d022794beabceae09c7fcc222a6e4e929c748 01-Feb-2008 Duncan Sands <baldrick@free.fr> Don't drop function/call return attributes like 'nounwind'.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46645 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
23071519ddfe464b70edfdd0c38ca34632d0ad23 01-Feb-2008 Duncan Sands <baldrick@free.fr> Don't drop function/call return attributes like 'nounwind'.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46645 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
c69d3c94425cbdcbfe4f758e07ba083d3377a382 29-Jan-2008 Chris Lattner <sabre@nondot.org> Don't let globalopt hack on volatile loads or stores.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46523 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
75a2db813395e577d844d0996b4528010ee09e1d 29-Jan-2008 Chris Lattner <sabre@nondot.org> Don't let globalopt hack on volatile loads or stores.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46523 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
303595942502f17c087fa28874c2b89117148c45 29-Jan-2008 Dan Gohman <gohman@apple.com> Use empty() instead of comparing size() with zero.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46514 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
301f405ef34539e7f287513bd7df0cbcf4f71d07 29-Jan-2008 Dan Gohman <djg@cray.com> Use empty() instead of comparing size() with zero.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46514 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
0818ea8317854db0626fc891a9b2c068e2acefa4 28-Jan-2008 Chris Lattner <sabre@nondot.org> Transform calls to memcpy into llvm.memcpy calls, patch by Eli Friedman.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46433 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
d3c51ad1ab5462a45c079a93137f8300ab502ee3 28-Jan-2008 Chris Lattner <sabre@nondot.org> Transform calls to memcpy into llvm.memcpy calls, patch by Eli Friedman.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46433 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
b2fc2a330a9106c67d50a2b6dbfffc679af4ce88 17-Jan-2008 Evan Cheng <evan.cheng@apple.com> DAE bug fix. Don't lose parameter attributes on vararg arguments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46113 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
ae46cc2cb7863e33edfbc7df46010cf6804ce7bb 17-Jan-2008 Evan Cheng <evan.cheng@apple.com> DAE bug fix. Don't lose parameter attributes on vararg arguments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46113 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
ab04e13a1f017c2b0a82344b4c083d92139ee2cc 17-Jan-2008 Chris Lattner <sabre@nondot.org> Fix arg promotion to propagate the correct attrs on the calls to
promoted functions. This is important for varargs calls in
particular. Thanks to duncan for providing a great testcase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46108 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
af5a54a5b3ede130b5af1c06e72ac5d7039082f1 17-Jan-2008 Chris Lattner <sabre@nondot.org> Fix arg promotion to propagate the correct attrs on the calls to
promoted functions. This is important for varargs calls in
particular. Thanks to duncan for providing a great testcase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46108 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
1e9aa716e9058b035c12673d3873c18c6781820c 16-Jan-2008 Chris Lattner <sabre@nondot.org> Handle attribute(used) global variables that are i8.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46090 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
476eea997ba9ba3ced09a60c62ff90c3375f8dbc 16-Jan-2008 Chris Lattner <sabre@nondot.org> Handle attribute(used) global variables that are i8.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46090 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
8c231e5dda26b790ff388fe2f70eeeda621c9261 16-Jan-2008 Devang Patel <dpatel@apple.com> Do not strip llvm.used values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46045 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
5dc8fde2502bae42e5e1541cbcb3e38ab5f88095 16-Jan-2008 Devang Patel <dpatel@apple.com> Do not strip llvm.used values.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46045 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
941db495b8233a3753ce72a84021f677073ff4ea 14-Jan-2008 Chris Lattner <sabre@nondot.org> Fix the miscompilation of MiBench/consumer-lame that was exposed by Evan's
byval work. This miscompilation is due to the program indexing an array out
of range and us doing a transformation that broke this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45949 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
7bd79da17abb69c8f33466d24862e120ddf2f549 14-Jan-2008 Chris Lattner <sabre@nondot.org> Fix the miscompilation of MiBench/consumer-lame that was exposed by Evan's
byval work. This miscompilation is due to the program indexing an array out
of range and us doing a transformation that broke this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45949 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
6a93fc01a787ae53095504f882781dbf550b23c6 14-Jan-2008 Chris Lattner <sabre@nondot.org> The isNotSuitableForSRA property is now dead, don't compute it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45948 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
cad76211e1b923ae5c519666679712be469cccda 14-Jan-2008 Chris Lattner <sabre@nondot.org> The isNotSuitableForSRA property is now dead, don't compute it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45948 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
727c21084d2f96c25b0ec1bc9a03cb88105a417c 14-Jan-2008 Chris Lattner <sabre@nondot.org> Change SRAGlobal to not depend on isNotSuitableForSRA, which makes it very
difficult to understand the invariants.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45947 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
7329c667c1d8611e4b9de01c1525a74b9dd2405e 14-Jan-2008 Chris Lattner <sabre@nondot.org> Change SRAGlobal to not depend on isNotSuitableForSRA, which makes it very
difficult to understand the invariants.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45947 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
58e44f49ddd16825fbacc60d6146376ca17f47eb 14-Jan-2008 Chris Lattner <sabre@nondot.org> Make the 'shrink global to bool' optimization more self contained, and thus
easier to show that its safe. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45946 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
ece46dbd8659d41f7e606a1278d498dff2b28e56 14-Jan-2008 Chris Lattner <sabre@nondot.org> Make the 'shrink global to bool' optimization more self contained, and thus
easier to show that its safe. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45946 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
e3a8830c1d263b41ee114d7cb3fd50d240ec32b3 13-Jan-2008 Duncan Sands <baldrick@free.fr> Small simplification.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45932 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
14f0b6f42fa27c1abf4fc4db63563dbe454aa5f0 13-Jan-2008 Duncan Sands <baldrick@free.fr> Small simplification.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45932 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
120d053e3ba810b44047fbcb719824bed5673ca9 12-Jan-2008 Chris Lattner <sabre@nondot.org> Allow clients to specify the inline threshold when creating
the inliner pass. Patch by Robert Zeh.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45903 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
nliner.cpp
758296df4ac666c9fe3c47fadf3545c2df26d8a1 12-Jan-2008 Chris Lattner <sabre@nondot.org> Allow clients to specify the inline threshold when creating
the inliner pass. Patch by Robert Zeh.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45903 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
nliner.cpp
bfc5ae6df028a455efd24dc0bb223e717e0e3655 12-Jan-2008 Duncan Sands <baldrick@free.fr> When DAE drops the varargs part of a function, ensure any
attributes on the vararg call arguments are also dropped.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45892 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
3a73fd8087e2c784e5bc56ad017625cf8c76f83c 12-Jan-2008 Duncan Sands <baldrick@free.fr> When DAE drops the varargs part of a function, ensure any
attributes on the vararg call arguments are also dropped.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45892 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
10603e0c84d15f61443e8b17bc35f98cc46606d9 11-Jan-2008 Chris Lattner <sabre@nondot.org> Teach argpromote to ruthlessly hack small byval structs when it can
get away with it, which exposes opportunities to eliminate the memory
objects entirely. For example, we now compile byval.ll to:

define internal void @f1(i32 %b.0, i64 %b.1) {
entry:
%tmp2 = add i32 %b.0, 1 ; <i32> [#uses=0]
ret void
}

define i32 @main() nounwind {
entry:
call void @f1( i32 1, i64 2 )
ret i32 0
}

This seems like it would trigger a lot for code that passes around small
structs (e.g. SDOperand's or _Complex)...



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45886 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
a1dde2b04d0816f80eef908e6492c5fb6876f0ae 11-Jan-2008 Chris Lattner <sabre@nondot.org> Teach argpromote to ruthlessly hack small byval structs when it can
get away with it, which exposes opportunities to eliminate the memory
objects entirely. For example, we now compile byval.ll to:

define internal void @f1(i32 %b.0, i64 %b.1) {
entry:
%tmp2 = add i32 %b.0, 1 ; <i32> [#uses=0]
ret void
}

define i32 @main() nounwind {
entry:
call void @f1( i32 1, i64 2 )
ret i32 0
}

This seems like it would trigger a lot for code that passes around small
structs (e.g. SDOperand's or _Complex)...



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45886 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
e027efa21816dbd2350d137fdfa181c24cbe8c49 11-Jan-2008 Chris Lattner <sabre@nondot.org> Use smallptrset instead of std::set for efficiency.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45878 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
ba799be3f7ca197bb7e1107e1843ccae0543f7f9 11-Jan-2008 Chris Lattner <sabre@nondot.org> Use smallptrset instead of std::set for efficiency.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45878 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
170b1816b2cd6f02a8d0d5f1e13d9bda2f247012 11-Jan-2008 Chris Lattner <sabre@nondot.org> a byval argument is guaranteed to be valid to load.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45877 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
41e0d20f9797204a655a68914668b9a7be90c364 11-Jan-2008 Chris Lattner <sabre@nondot.org> a byval argument is guaranteed to be valid to load.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45877 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
40c14be5bc9ba900f01c408b65aca57e053788e1 11-Jan-2008 Chris Lattner <sabre@nondot.org> Update this code to use eraseFromParent where possible. Compute
whether an argument is byval and pass into isSafeToPromoteArgument.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45876 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
09ddfdab44f79ed47df19696666c64b94157c7ac 11-Jan-2008 Chris Lattner <sabre@nondot.org> Update this code to use eraseFromParent where possible. Compute
whether an argument is byval and pass into isSafeToPromoteArgument.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45876 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
f1577014ddd13113c4a06d85bc75cd7b2dce71a9 11-Jan-2008 Chris Lattner <sabre@nondot.org> replace a loop with a constant time check.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45875 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
16d8bddd5e0018c3d9bd0f1a62ca0237668a50ac 11-Jan-2008 Chris Lattner <sabre@nondot.org> replace a loop with a constant time check.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45875 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
6e8410abf1d8841f15d17a30dcd346038862c926 11-Jan-2008 Chris Lattner <sabre@nondot.org> another minor datastructure tweak.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45874 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
7122ea76630d85dcad4ac1e8436a4a374d69f35e 11-Jan-2008 Chris Lattner <sabre@nondot.org> another minor datastructure tweak.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45874 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
a10145fdf6325c5c528689e8952ad7e4e2a1a6b5 11-Jan-2008 Chris Lattner <sabre@nondot.org> start using smallvector to avoid vector heap thrashing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45873 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
7ec4140a87f7eb661bf7a0b5980e81dfacf9f110 11-Jan-2008 Chris Lattner <sabre@nondot.org> start using smallvector to avoid vector heap thrashing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45873 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
6c3470efdc59245707c56ad92ab8355afdac2c62 07-Jan-2008 Duncan Sands <baldrick@free.fr> Small cleanup for handling of type/parameter attribute
incompatibility.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45704 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
dbe97dcf092b53023b4e6e3120c227116cdaa9d6 07-Jan-2008 Duncan Sands <baldrick@free.fr> Small cleanup for handling of type/parameter attribute
incompatibility.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45704 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
ad9a9e15595bc9d5ba1ed752caf8572957f77a3d 06-Jan-2008 Duncan Sands <baldrick@free.fr> The transform that tries to turn calls to bitcast functions into
direct calls bails out unless caller and callee have essentially
equivalent parameter attributes. This is illogical - the callee's
attributes should be of no relevance here. Rework the logic, which
incidentally fixes a crash when removed arguments have attributes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45658 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
c849e66c0ae3520c6e89499ccd81f4fc00ea198f 06-Jan-2008 Duncan Sands <baldrick@free.fr> The transform that tries to turn calls to bitcast functions into
direct calls bails out unless caller and callee have essentially
equivalent parameter attributes. This is illogical - the callee's
attributes should be of no relevance here. Rework the logic, which
incidentally fixes a crash when removed arguments have attributes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45658 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
9027b3cc7f79a67ecf75640c0e25a73dc61d62cf 04-Jan-2008 Chris Lattner <sabre@nondot.org> Fix PR1896


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45568 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
ad8665a2a2d76a04248b89fb746350beadcc05c1 04-Jan-2008 Chris Lattner <sabre@nondot.org> Fix PR1896


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45568 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
a114b14e5dd1869b8dfcf79736fe05a3616b520a 03-Jan-2008 Chris Lattner <sabre@nondot.org> add missing #include


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45516 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
7507772067468c18354e343e4f626431f51ae391 03-Jan-2008 Chris Lattner <sabre@nondot.org> add missing #include


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45516 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.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
rgumentPromotion.cpp
onstantMerge.cpp
eadArgumentElimination.cpp
eadTypeElimination.cpp
xtractFunction.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
ndMemRemoval.cpp
nlineSimple.cpp
nliner.cpp
nternalize.cpp
oopExtractor.cpp
owerSetJmp.cpp
runeEH.cpp
aiseAllocations.cpp
implifyLibCalls.cpp
tripDeadPrototypes.cpp
tripSymbols.cpp
081ce940e7351e90fff829320b7dc6738a6b3815 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
rgumentPromotion.cpp
onstantMerge.cpp
eadArgumentElimination.cpp
eadTypeElimination.cpp
xtractFunction.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
ndMemRemoval.cpp
nlineSimple.cpp
nliner.cpp
nternalize.cpp
oopExtractor.cpp
owerSetJmp.cpp
runeEH.cpp
aiseAllocations.cpp
implifyLibCalls.cpp
tripDeadPrototypes.cpp
tripSymbols.cpp
fc643c5e88c596f217750dd91fcc66488dfed73d 29-Dec-2007 Chris Lattner <sabre@nondot.org> remove attribution from lib Makefiles.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45415 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
80455b86f2c6c56b56f690db3c1fdd3a401f9df3 29-Dec-2007 Chris Lattner <sabre@nondot.org> remove attribution from lib Makefiles.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45415 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
194c90ed2a8e74b5a1c5184835f84c572d524dad 25-Dec-2007 Gordon Henriksen <gordonhenriksen@mac.com> Fixing several transforms which would drop the collector attribute
when copying functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45356 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
xtractFunction.cpp
3e7ea1e79f0bdb067ad0f983bdacdfb00b0b19ad 25-Dec-2007 Gordon Henriksen <gordonhenriksen@mac.com> Fixing several transforms which would drop the collector attribute
when copying functions.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45356 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
xtractFunction.cpp
110c8350394df3222307fbebe608ff9ed88ea487 21-Dec-2007 Duncan Sands <baldrick@free.fr> Make DAE not wipe out attributes on calls, and not drop
return attributes on the floor. In the case of a call
to a varargs function where the varargs arguments are
being removed, any call attributes on those arguments
need to be dropped. I didn't do this because I plan to
make it illegal to have such attributes (see next patch).
With this change, compiling the gcc filter2 eh test at -O0
and then running opt -std-compile-opts on it results in
a correctly working program (compiling at -O1 or higher
results in the test failing due to a problem with how we
output eh info into the IR).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45285 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
c826815ca9ee8f4491c2e14fdf003c78f2e75e3d 21-Dec-2007 Duncan Sands <baldrick@free.fr> Make DAE not wipe out attributes on calls, and not drop
return attributes on the floor. In the case of a call
to a varargs function where the varargs arguments are
being removed, any call attributes on those arguments
need to be dropped. I didn't do this because I plan to
make it illegal to have such attributes (see next patch).
With this change, compiling the gcc filter2 eh test at -O0
and then running opt -std-compile-opts on it results in
a correctly working program (compiling at -O1 or higher
results in the test failing due to a problem with how we
output eh info into the IR).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45285 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
f0c3354d998507515ab39e26b5292ea0ceb06aef 19-Dec-2007 Duncan Sands <baldrick@free.fr> When inlining through an 'nounwind' call, mark inlined
calls 'nounwind'. It is important for correct C++
exception handling that nounwind markings do not get
lost, so this transformation is actually needed for
correctness.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45218 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
2937e3586b67478127d9015f648efdcd3dbd6ff9 19-Dec-2007 Duncan Sands <baldrick@free.fr> When inlining through an 'nounwind' call, mark inlined
calls 'nounwind'. It is important for correct C++
exception handling that nounwind markings do not get
lost, so this transformation is actually needed for
correctness.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45218 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
2b0e8990ab33ec2dad21286d3ce01dbb4bbe63c1 18-Dec-2007 Duncan Sands <baldrick@free.fr> Rename isNoReturn to doesNotReturn, and isNoUnwind to
doesNotThrow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45160 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
7dc19d416c29a99bcdbb6e46fada84bc1bb45d32 18-Dec-2007 Duncan Sands <baldrick@free.fr> Rename isNoReturn to doesNotReturn, and isNoUnwind to
doesNotThrow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45160 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
43ad6b3e0d6ada51e9b23aab3e061187f1f5710c 17-Dec-2007 Christopher Lamb <christopher.lamb@gmail.com> Change the PointerType api for creating pointer types. The old functionality of PointerType::get() has become PointerType::getUnqual(), which returns a pointer in the generic address space. The new prototype of PointerType::get() requires both a type and an address space.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45082 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
owerSetJmp.cpp
aiseAllocations.cpp
implifyLibCalls.cpp
bb2f2222b45179d8ddd0c7d481ad9dc068c82b6c 17-Dec-2007 Christopher Lamb <christopher.lamb@gmail.com> Change the PointerType api for creating pointer types. The old functionality of PointerType::get() has become PointerType::getUnqual(), which returns a pointer in the generic address space. The new prototype of PointerType::get() requires both a type and an address space.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45082 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
owerSetJmp.cpp
aiseAllocations.cpp
implifyLibCalls.cpp
cbb8badce8838ece47cb806a0399c77d76a7e11b 10-Dec-2007 Duncan Sands <baldrick@free.fr> Make PruneEH update the nounwind/noreturn attributes
on functions as it calculates them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44802 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
7f511cf8a95fe261e646c2c562f01ef409e0b050 10-Dec-2007 Duncan Sands <baldrick@free.fr> Make PruneEH update the nounwind/noreturn attributes
on functions as it calculates them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44802 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
a3355ffb3d30d19d226bbb75707991c60f236e37 03-Dec-2007 Duncan Sands <baldrick@free.fr> Rather than having special rules like "intrinsics cannot
throw exceptions", just mark intrinsics with the nounwind
attribute. Likewise, mark intrinsics as readnone/readonly
and get rid of special aliasing logic (which didn't use
anything more than this anyway).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44544 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
79d2887c7bd6fa2d4cd915d3f2b0e45e3dba83b2 03-Dec-2007 Duncan Sands <baldrick@free.fr> Rather than having special rules like "intrinsics cannot
throw exceptions", just mark intrinsics with the nounwind
attribute. Likewise, mark intrinsics as readnone/readonly
and get rid of special aliasing logic (which didn't use
anything more than this anyway).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44544 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
dc024674ff96820d6020757b48d47f46d4c07db2 27-Nov-2007 Duncan Sands <baldrick@free.fr> Fix PR1146: parameter attributes are longer part of
the function type, instead they belong to functions
and function calls. This is an updated and slightly
corrected version of Reid Spencer's original patch.
The only known problem is that auto-upgrading of
bitcode files doesn't seem to work properly (see
test/Bitcode/AutoUpgradeIntrinsics.ll). Hopefully
a bitcode guru (who might that be? :) ) will fix it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44359 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
xtractFunction.cpp
owerSetJmp.cpp
runeEH.cpp
f5588dc4ec43da1e4423e5ff2394669c0f000350 27-Nov-2007 Duncan Sands <baldrick@free.fr> Fix PR1146: parameter attributes are longer part of
the function type, instead they belong to functions
and function calls. This is an updated and slightly
corrected version of Reid Spencer's original patch.
The only known problem is that auto-upgrading of
bitcode files doesn't seem to work properly (see
test/Bitcode/AutoUpgradeIntrinsics.ll). Hopefully
a bitcode guru (who might that be? :) ) will fix it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44359 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
xtractFunction.cpp
owerSetJmp.cpp
runeEH.cpp
311c4b6e9867bba83fdd9b52c3746b203a3d829d 22-Nov-2007 Anton Korobeynikov <asl@math.spbu.ru> Don't crash on bogus llvm.noinline. This is first part of PR1817 (preventing reduction)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44281 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
5286e13220cb11dbb34e24f306e3d9bda3bf6f5a 22-Nov-2007 Anton Korobeynikov <asl@math.spbu.ru> Don't crash on bogus llvm.noinline. This is first part of PR1817 (preventing reduction)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44281 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
701bc4264d3b6f9f7c8192f96a953d6815a7cb64 15-Nov-2007 Chris Lattner <sabre@nondot.org> Fix PR1788 by taking the approach suggested by Richard Smith.
Thanks to him for his detailed analysis of the problem.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44162 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
6b863f4976b8cbc44f486fa32b0b130776449117 15-Nov-2007 Chris Lattner <sabre@nondot.org> Fix PR1788 by taking the approach suggested by Richard Smith.
Thanks to him for his detailed analysis of the problem.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44162 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
6fa98b13206583e6eb90b8304758b35548914944 14-Nov-2007 Nick Lewycky <nicholas@mxc.ca> Allow the block extractor take to take a list of basic blocks to not extract
from a file containing Function/BasicBlock pairings. This is not safe against
anonymous or abnormally-named Funcs or BBs.

Make bugpoint use this interface to pass the BBs list to the child bugpoint.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44101 91177308-0d34-0410-b5e6-96231b3b80d8
oopExtractor.cpp
43e736db4de7378b461f6602c58fa5127dacb81b 14-Nov-2007 Nick Lewycky <nicholas@mxc.ca> Allow the block extractor take to take a list of basic blocks to not extract
from a file containing Function/BasicBlock pairings. This is not safe against
anonymous or abnormally-named Funcs or BBs.

Make bugpoint use this interface to pass the BBs list to the child bugpoint.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44101 91177308-0d34-0410-b5e6-96231b3b80d8
oopExtractor.cpp
19450241e5ca3f679251c29f4926bb5f12ed535f 13-Nov-2007 Chris Lattner <sabre@nondot.org> Fix the regression on Transforms/GlobalOpt/deadglobal-2.ll from my
patch on friday.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44068 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
2dd9c04c1d32c111930c0928f5adcf6175d86021 13-Nov-2007 Chris Lattner <sabre@nondot.org> Fix the regression on Transforms/GlobalOpt/deadglobal-2.ll from my
patch on friday.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44068 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
7b52fe7272ec337a77b7cc96b14e27d15fec3c89 09-Nov-2007 Chris Lattner <sabre@nondot.org> Tighten up a check for folding away loads from (newly constant) globals. This
fixes a crash on Transforms/GlobalOpt/2007-11-09-GEP-GEP-Crash.ll and
rdar://5585488.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43949 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
7ebafca2adebb83d1d1d310a35f57494b5a4e4d7 09-Nov-2007 Chris Lattner <sabre@nondot.org> Tighten up a check for folding away loads from (newly constant) globals. This
fixes a crash on Transforms/GlobalOpt/2007-11-09-GEP-GEP-Crash.ll and
rdar://5585488.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43949 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
4e1be6d5ea90d0714171d0d19033508bc4fe7f30 05-Nov-2007 Gordon Henriksen <gordonhenriksen@mac.com> Deleting redundant copy of block extractor pass. See also PR1775.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43694 91177308-0d34-0410-b5e6-96231b3b80d8
oopExtractor.cpp
52909454c479c63c49a3386059a5ad58bbcc8b97 05-Nov-2007 Gordon Henriksen <gordonhenriksen@mac.com> Deleting redundant copy of block extractor pass. See also PR1775.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43694 91177308-0d34-0410-b5e6-96231b3b80d8
oopExtractor.cpp
c86b67742a3298c0a5a715b57a64f11107b8a3f2 04-Nov-2007 Gordon Henriksen <gordonhenriksen@mac.com> Finishing initial docs for all transformations in Passes.html.

Also cleaned up some comments in source files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43674 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
79ed5875918f9d8d2780f84b532f3b89ef2b4a6a 04-Nov-2007 Gordon Henriksen <gordonhenriksen@mac.com> Finishing initial docs for all transformations in Passes.html.

Also cleaned up some comments in source files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43674 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
514ab348fddcdffa8367685dc608b2f8d5de986d 01-Nov-2007 Duncan Sands <baldrick@free.fr> Executive summary: getTypeSize -> getTypeStoreSize / getABITypeSize.
The meaning of getTypeSize was not clear - clarifying it is important
now that we have x86 long double and arbitrary precision integers.
The issue with long double is that it requires 80 bits, and this is
not a multiple of its alignment. This gives a primitive type for
which getTypeSize differed from getABITypeSize. For arbitrary precision
integers it is even worse: there is the minimum number of bits needed to
hold the type (eg: 36 for an i36), the maximum number of bits that will
be overwriten when storing the type (40 bits for i36) and the ABI size
(i.e. the storage size rounded up to a multiple of the alignment; 64 bits
for i36).

This patch removes getTypeSize (not really - it is still there but
deprecated to allow for a gradual transition). Instead there is:

(1) getTypeSizeInBits - a number of bits that suffices to hold all
values of the type. For a primitive type, this is the minimum number
of bits. For an i36 this is 36 bits. For x86 long double it is 80.
This corresponds to gcc's TYPE_PRECISION.

(2) getTypeStoreSizeInBits - the maximum number of bits that is
written when storing the type (or read when reading it). For an
i36 this is 40 bits, for an x86 long double it is 80 bits. This
is the size alias analysis is interested in (getTypeStoreSize
returns the number of bytes). There doesn't seem to be anything
corresponding to this in gcc.

(3) getABITypeSizeInBits - this is getTypeStoreSizeInBits rounded
up to a multiple of the alignment. For an i36 this is 64, for an
x86 long double this is 96 or 128 depending on the OS. This is the
spacing between consecutive elements when you form an array out of
this type (getABITypeSize returns the number of bytes). This is
TYPE_SIZE in gcc.

Since successive elements in a SequentialType (arrays, pointers
and vectors) need to be aligned, the spacing between them will be
given by getABITypeSize. This means that the size of an array
is the length times the getABITypeSize. It also means that GEP
computations need to use getABITypeSize when computing offsets.
Furthermore, if an alloca allocates several elements at once then
these too need to be aligned, so the size of the alloca has to be
the number of elements multiplied by getABITypeSize. Logically
speaking this doesn't have to be the case when allocating just
one element, but it is simpler to also use getABITypeSize in this
case. So alloca's and mallocs should use getABITypeSize. Finally,
since gcc's only notion of size is that given by getABITypeSize, if
you want to output assembler etc the same as gcc then getABITypeSize
is the size you want.

Since a store will overwrite no more than getTypeStoreSize bytes,
and a read will read no more than that many bytes, this is the
notion of size appropriate for alias analysis calculations.

In this patch I have corrected all type size uses except some of
those in ScalarReplAggregates, lib/Codegen, lib/Target (the hard
cases). I will get around to auditing these too at some point,
but I could do with some help.

Finally, I made one change which I think wise but others might
consider pointless and suboptimal: in an unpacked struct the
amount of space allocated for a field is now given by the ABI
size rather than getTypeStoreSize. I did this because every
other place that reserves memory for a type (eg: alloca) now
uses getABITypeSize, and I didn't want to make an exception
for unpacked structs, i.e. I did it to make things more uniform.
This only effects structs containing long doubles and arbitrary
precision integers. If someone wants to pack these types more
tightly they can always use a packed struct.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43620 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
lobalOpt.cpp
f99fdc666e16255e15d8ab0888a49bddbb96aa2d 01-Nov-2007 Duncan Sands <baldrick@free.fr> Executive summary: getTypeSize -> getTypeStoreSize / getABITypeSize.
The meaning of getTypeSize was not clear - clarifying it is important
now that we have x86 long double and arbitrary precision integers.
The issue with long double is that it requires 80 bits, and this is
not a multiple of its alignment. This gives a primitive type for
which getTypeSize differed from getABITypeSize. For arbitrary precision
integers it is even worse: there is the minimum number of bits needed to
hold the type (eg: 36 for an i36), the maximum number of bits that will
be overwriten when storing the type (40 bits for i36) and the ABI size
(i.e. the storage size rounded up to a multiple of the alignment; 64 bits
for i36).

This patch removes getTypeSize (not really - it is still there but
deprecated to allow for a gradual transition). Instead there is:

(1) getTypeSizeInBits - a number of bits that suffices to hold all
values of the type. For a primitive type, this is the minimum number
of bits. For an i36 this is 36 bits. For x86 long double it is 80.
This corresponds to gcc's TYPE_PRECISION.

(2) getTypeStoreSizeInBits - the maximum number of bits that is
written when storing the type (or read when reading it). For an
i36 this is 40 bits, for an x86 long double it is 80 bits. This
is the size alias analysis is interested in (getTypeStoreSize
returns the number of bytes). There doesn't seem to be anything
corresponding to this in gcc.

(3) getABITypeSizeInBits - this is getTypeStoreSizeInBits rounded
up to a multiple of the alignment. For an i36 this is 64, for an
x86 long double this is 96 or 128 depending on the OS. This is the
spacing between consecutive elements when you form an array out of
this type (getABITypeSize returns the number of bytes). This is
TYPE_SIZE in gcc.

Since successive elements in a SequentialType (arrays, pointers
and vectors) need to be aligned, the spacing between them will be
given by getABITypeSize. This means that the size of an array
is the length times the getABITypeSize. It also means that GEP
computations need to use getABITypeSize when computing offsets.
Furthermore, if an alloca allocates several elements at once then
these too need to be aligned, so the size of the alloca has to be
the number of elements multiplied by getABITypeSize. Logically
speaking this doesn't have to be the case when allocating just
one element, but it is simpler to also use getABITypeSize in this
case. So alloca's and mallocs should use getABITypeSize. Finally,
since gcc's only notion of size is that given by getABITypeSize, if
you want to output assembler etc the same as gcc then getABITypeSize
is the size you want.

Since a store will overwrite no more than getTypeStoreSize bytes,
and a read will read no more than that many bytes, this is the
notion of size appropriate for alias analysis calculations.

In this patch I have corrected all type size uses except some of
those in ScalarReplAggregates, lib/Codegen, lib/Target (the hard
cases). I will get around to auditing these too at some point,
but I could do with some help.

Finally, I made one change which I think wise but others might
consider pointless and suboptimal: in an unpacked struct the
amount of space allocated for a field is now given by the ABI
size rather than getTypeStoreSize. I did this because every
other place that reserves memory for a type (eg: alloca) now
uses getABITypeSize, and I didn't want to make an exception
for unpacked structs, i.e. I did it to make things more uniform.
This only effects structs containing long doubles and arbitrary
precision integers. If someone wants to pack these types more
tightly they can always use a packed struct.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43620 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
lobalOpt.cpp
55cbec317d9c30c8ae1d35eaa008ca63d1f2fce9 26-Oct-2007 Gordon Henriksen <gordonhenriksen@mac.com> More fleshing out of docs/Passes.html, plus some typo fixes and
improved wording in source files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43377 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
9adadb4a2a9d7d3a4399216c12c08efee0460ae9 26-Oct-2007 Gordon Henriksen <gordonhenriksen@mac.com> More fleshing out of docs/Passes.html, plus some typo fixes and
improved wording in source files.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43377 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
0fcee0639e6de9f40dbf63b4d0d6f807a3d87ac5 24-Oct-2007 Dale Johannesen <dalej@apple.com> Fix off by 1 bug in printf->puts lowering.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43309 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
488548ace09a1d6049a7dc185dcf36d5d077f880 24-Oct-2007 Dale Johannesen <dalej@apple.com> Fix off by 1 bug in printf->puts lowering.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43309 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
a0bc7fc7bd048a69533ea14e73a57504eea56ca1 18-Oct-2007 Chris Lattner <sabre@nondot.org> Fix PR1735 and Transforms/DeadArgElim/2007-10-18-VarargsReturn.ll by
fixing some obviously broken code :(


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43141 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
1d432ca4a7d0310c0bf3722cad04ea8225070eaa 18-Oct-2007 Chris Lattner <sabre@nondot.org> Fix PR1735 and Transforms/DeadArgElim/2007-10-18-VarargsReturn.ll by
fixing some obviously broken code :(


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43141 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
84458323a254c4ee31aae553f1a8b66742cd0562 17-Oct-2007 Devang Patel <dpatel@apple.com> Do not raise free() call that is called through invoke instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43083 91177308-0d34-0410-b5e6-96231b3b80d8
aiseAllocations.cpp
ea682b31f376052c18d65117f1cfc78425008b75 17-Oct-2007 Devang Patel <dpatel@apple.com> Do not raise free() call that is called through invoke instruction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43083 91177308-0d34-0410-b5e6-96231b3b80d8
aiseAllocations.cpp
cb406c25973b4e88a6c10ad839ef1beeb3664715 03-Oct-2007 Dan Gohman <gohman@apple.com> Use empty() member functions when that's what's being tested for instead
of comparing begin() and end().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42585 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
aiseAllocations.cpp
3f7d94b6cd40a3653c000f4b2e166c82dc3e3715 03-Oct-2007 Dan Gohman <djg@cray.com> Use empty() member functions when that's what's being tested for instead
of comparing begin() and end().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42585 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
aiseAllocations.cpp
088b5913ef6f91fccc3c931653e16bfeb330c90b 03-Oct-2007 Tanya Lattner <tonic@nondot.org> Fix PR1719, by not marking llvm.global.annotations internal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42578 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
aa42b9d7a9e6c2ca1423ebdc1a3ba06d9ba05828 03-Oct-2007 Tanya Lattner <tonic@nondot.org> Fix PR1719, by not marking llvm.global.annotations internal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42578 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
bd14f58b765e994bf9a020575d517c5dc9bfbfe1 03-Oct-2007 Chris Lattner <sabre@nondot.org> Fix PR1719, by not marking llvm.noinline internal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42565 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
7ba70aeafb9594e1a369015c64fe541322b9ee3c 03-Oct-2007 Chris Lattner <sabre@nondot.org> Fix PR1719, by not marking llvm.noinline internal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42565 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
4292d1c02a6f10eca22aa6e27d57ea8bf15b3140 28-Sep-2007 Dale Johannesen <dalej@apple.com> minor long double related changes



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42439 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
3b5303b49c6643f0556976ef9ce26d30d30c8991 28-Sep-2007 Dale Johannesen <dalej@apple.com> minor long double related changes



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@42439 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
5e6e494a977614568ed5582dacb548f8d466d398 14-Sep-2007 Chris Lattner <sabre@nondot.org> Fix a logic error in ValueIsOnlyUsedLocallyOrStoredToOneGlobal that caused
miscompilation of 188.ammp. Reject select and bitcast in
ValueIsOnlyUsedLocallyOrStoredToOneGlobal because RewriteHeapSROALoadUser can't handle it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41950 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
4bde3c4cefa21d1d333b4eb693a301659f577bf5 14-Sep-2007 Chris Lattner <sabre@nondot.org> Fix a logic error in ValueIsOnlyUsedLocallyOrStoredToOneGlobal that caused
miscompilation of 188.ammp. Reject select and bitcast in
ValueIsOnlyUsedLocallyOrStoredToOneGlobal because RewriteHeapSROALoadUser can't handle it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41950 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
309f20fc45a599ca45ad1262525d9f4c332b1911 13-Sep-2007 Chris Lattner <sabre@nondot.org> Teach GlobalLoadUsesSimpleEnoughForHeapSRA and the SROA rewriter how to handle
a limited form of PHI nodes. This finally fixes PR1639, speeding 179.art up
from 7.84s to 3.13s on PPC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41933 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
eefff98945229344a7d85e0335a4ae66dbfe7172 13-Sep-2007 Chris Lattner <sabre@nondot.org> Teach GlobalLoadUsesSimpleEnoughForHeapSRA and the SROA rewriter how to handle
a limited form of PHI nodes. This finally fixes PR1639, speeding 179.art up
from 7.84s to 3.13s on PPC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41933 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
a637a8b1e7ecc9ce06e0463b64be0721bf52255d 13-Sep-2007 Chris Lattner <sabre@nondot.org> be tolerant of PHI nodes when rewriting heap SROA code. This is a step
along the way of PR1639


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41930 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
20eef0f652c5358059d6d0f7f8cf585d971fb28b 13-Sep-2007 Chris Lattner <sabre@nondot.org> be tolerant of PHI nodes when rewriting heap SROA code. This is a step
along the way of PR1639


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41930 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
330245e90bc3c74cebfbae47d67aaef8d74a73dd 13-Sep-2007 Chris Lattner <sabre@nondot.org> refactor some code, no functionality change. On the path to PR1639



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41929 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
af82fb8152100d20d729a78f61fa42a9645d5542 13-Sep-2007 Chris Lattner <sabre@nondot.org> refactor some code, no functionality change. On the path to PR1639



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41929 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
c451f9c1670321256c22fc1a44a7cc62f7ad523b 13-Sep-2007 Chris Lattner <sabre@nondot.org> Make ValueIsOnlyUsedLocallyOrStoredToOneGlobal smart enough to see through
bitcasts and phis. This is a step to fixing PR1639.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41928 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
e7606f4485acd6d11fd8e2a77f379708eb1a74ce 13-Sep-2007 Chris Lattner <sabre@nondot.org> Make ValueIsOnlyUsedLocallyOrStoredToOneGlobal smart enough to see through
bitcasts and phis. This is a step to fixing PR1639.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41928 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
816861803fe4f5e17f565f00e70989ab24d7ec45 13-Sep-2007 Chris Lattner <sabre@nondot.org> Make AllUsesOfLoadedValueWillTrapIfNull strong enough to see through PHI
nodes. This is the first step of the fix for PR1639.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41927 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
bdf77460a8f2031f3461a2d91b9096861e11c2c8 13-Sep-2007 Chris Lattner <sabre@nondot.org> Make AllUsesOfLoadedValueWillTrapIfNull strong enough to see through PHI
nodes. This is the first step of the fix for PR1639.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41927 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
43421b3dd70af5b70e71816521f37502c397cc65 06-Sep-2007 Dale Johannesen <dalej@apple.com> Next round of APFloat changes.
Use APFloat in UpgradeParser and AsmParser.
Change all references to ConstantFP to use the
APFloat interface rather than double. Remove
the ConstantFP double interfaces.
Use APFloat functions for constant folding arithmetic
and comparisons.
(There are still way too many places APFloat is
just a wrapper around host float/double, but we're
getting there.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41747 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
b9de9f07d611823ea3371b65f87035f482ace2ad 06-Sep-2007 Dale Johannesen <dalej@apple.com> Next round of APFloat changes.
Use APFloat in UpgradeParser and AsmParser.
Change all references to ConstantFP to use the
APFloat interface rather than double. Remove
the ConstantFP double interfaces.
Use APFloat functions for constant folding arithmetic
and comparisons.
(There are still way too many places APFloat is
just a wrapper around host float/double, but we're
getting there.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41747 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
b8f74793b9d161bc666fe27fc92fe112b6ec169b 04-Sep-2007 David Greene <greened@obbligato.org> Update GEP constructors to use an iterator interface to fix
GLIBCXX_DEBUG issues.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41697 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
lobalOpt.cpp
393be88e51bce88754c8b5615e8a295adbdab1e2 04-Sep-2007 David Greene <greened@obbligato.org> Update GEP constructors to use an iterator interface to fix
GLIBCXX_DEBUG issues.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41697 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
lobalOpt.cpp
f1355a55f8d815f5385e9a4432195f03b65f3a42 27-Aug-2007 David Greene <greened@obbligato.org> Update InvokeInst to work like CallInst


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41506 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
owerSetJmp.cpp
8278ef592ef0caf5cf0ccd8646fb7fdfbdc2e2d8 27-Aug-2007 David Greene <greened@obbligato.org> Update InvokeInst to work like CallInst


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41506 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
owerSetJmp.cpp
e3784951af0c2ddc6447805b321db222689aa1d2 27-Aug-2007 Dan Gohman <gohman@apple.com> Change comments to refer to @malloc and @free instead of %malloc and %free.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41488 91177308-0d34-0410-b5e6-96231b3b80d8
aiseAllocations.cpp
2e4337e395081be095aa263f959812f9268feebe 27-Aug-2007 Dan Gohman <djg@cray.com> Change comments to refer to @malloc and @free instead of %malloc and %free.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41488 91177308-0d34-0410-b5e6-96231b3b80d8
aiseAllocations.cpp
9132a2b81842b0e2b77703fab3e6fe7467f859bb 23-Aug-2007 Chris Lattner <sabre@nondot.org> rename APInt::toString -> toStringUnsigned for symmetry with toStringSigned()

Add an APSInt::toString() method.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41309 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
9b502d40396d6515559d10a4056e3e4c4089b10d 23-Aug-2007 Chris Lattner <sabre@nondot.org> rename APInt::toString -> toStringUnsigned for symmetry with toStringSigned()

Add an APSInt::toString() method.



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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41207 91177308-0d34-0410-b5e6-96231b3b80d8
oopExtractor.cpp
02451fa1861ed11e1761604bbfddef95d11419b2 21-Aug-2007 Devang Patel <dpatel@apple.com> Use SmallVector instead of std::vector.


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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40673 91177308-0d34-0410-b5e6-96231b3b80d8
xtractFunction.cpp
nternalize.cpp
oopExtractor.cpp
tripSymbols.cpp
34c280e03131036065fb78613b754badb1c30514 01-Aug-2007 Dan Gohman <djg@cray.com> More explicit keywords.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40673 91177308-0d34-0410-b5e6-96231b3b80d8
xtractFunction.cpp
nternalize.cpp
oopExtractor.cpp
tripSymbols.cpp
52eec548206d0b135b55ba52dd0e82e978f15ae5 01-Aug-2007 David Greene <greened@obbligato.org> New CallInst interface to address GLIBCXX_DEBUG errors caused by
indexing an empty std::vector.

Updates to all clients.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40660 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
owerSetJmp.cpp
runeEH.cpp
implifyLibCalls.cpp
b1c4a7b210b9a8aa98fcffae8a84a0a20860ec7a 01-Aug-2007 David Greene <greened@obbligato.org> New CallInst interface to address GLIBCXX_DEBUG errors caused by
indexing an empty std::vector.

Updates to all clients.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40660 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
owerSetJmp.cpp
runeEH.cpp
implifyLibCalls.cpp
29381fb7cdba040facf562f4ea028400cd626d2b 27-Jul-2007 Devang Patel <dpatel@apple.com> Use SmallPtrSet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40560 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
d6605a8512d567beab56429e70bdc30062556930 27-Jul-2007 Devang Patel <dpatel@apple.com> Use SmallPtrSet.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40560 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
6899b314225dd5fa5ccc2a5692daaa89c1d623d8 25-Jul-2007 Devang Patel <dpatel@apple.com> Add BasicInliner interface.
This interface allows clients to inline bunch of functions with module
level call graph information.:wq



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40486 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
7c2e99c7dce12a5256f3611d5f12aad91db3d571 25-Jul-2007 Devang Patel <dpatel@apple.com> Add BasicInliner interface.
This interface allows clients to inline bunch of functions with module
level call graph information.:wq



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40486 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
f17a25c88b892d30c2b41ba7ecdfbdfb2b4be9cc 18-Jul-2007 Dan Gohman <djg@cray.com> It's not necessary to do rounding for alloca operations when the requested
alignment is equal to the stack alignment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40004 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
onstantMerge.cpp
eadArgumentElimination.cpp
eadTypeElimination.cpp
xtractFunction.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
ndMemRemoval.cpp
nlineSimple.cpp
nliner.cpp
nternalize.cpp
oopExtractor.cpp
owerSetJmp.cpp
akefile
runeEH.cpp
aiseAllocations.cpp
implifyLibCalls.cpp
tripDeadPrototypes.cpp
tripSymbols.cpp
ba6801e6e72a9f4de1e116ea81b370456eb7ecd3 25-Jun-2007 Chris Lattner <sabre@nondot.org> fix Transforms/Inline/2007-06-25-WeakInline.ll by not inlining functions
with weak linkage.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37723 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
c91c56cf435b2a51479b8135c2bb907d09a8df41 20-Jun-2007 Tanya Lattner <tonic@nondot.org> Moved Inliner.h to include/llvm/Transforms/IPO/InlinerPass.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37666 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.h
6f7426ec2e46bb19cc9f9e75f1c355b35cf12d7d 20-Jun-2007 Tanya Lattner <tonic@nondot.org> Inliner pass header file was moved.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37665 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
nliner.cpp
4b90e3a276c0bb1bd4d90289e27aa3c4f890b5af 08-Jun-2007 Devang Patel <dpatel@apple.com> Do not use ETForest as well as DomiantorTree. DominatorTree is sufficient.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37501 91177308-0d34-0410-b5e6-96231b3b80d8
oopExtractor.cpp
b62fa8ab6bf223e8f10178345e89721c9f46a9c9 07-Jun-2007 Tanya Lattner <tonic@nondot.org> Formating fixes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37491 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
682f683669d01f208c647ebce8d41a2580ef7707 06-Jun-2007 Tanya Lattner <tonic@nondot.org> Instruct the inliner to obey the noinline attribute. Add test case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37481 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
4e2288b9de2fc30d4b88b437c86594cd8ec332fa 06-Jun-2007 Chris Lattner <sabre@nondot.org> simplify this code and fix PR1493, now that llvm-gcc3 is dead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37478 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
f0a9aaba4c61388678494c17c690f93b7eff270c 05-Jun-2007 Chris Lattner <sabre@nondot.org> When rebuilding constant structs, make sure to honor the isPacked bit.
This fixes PR1491 and GlobalOpt/2007-06-04-PackedStruct.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37423 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
ce3e2bff8bd22ef63d10923c9d0fbab922e00957 15-May-2007 Chris Lattner <sabre@nondot.org> selects can also reach here


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37081 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
79cfddf646c3d235df095f2ffdfd4d9603475192 13-May-2007 Chris Lattner <sabre@nondot.org> Fix Transforms/GlobalOpt/2007-05-13-Crash.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37020 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
1ce6f8da7283a1f281f1767905873537d66560d5 07-May-2007 Chris Lattner <sabre@nondot.org> Fix PR1395, by passing the ID correctly


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36894 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
nliner.cpp
nliner.h
ecd94c804a563f2a86572dcf1d2e81f397e19daa 06-May-2007 Nick Lewycky <nicholas@mxc.ca> Fix typo in comment.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36873 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
onstantMerge.cpp
eadArgumentElimination.cpp
eadTypeElimination.cpp
xtractFunction.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
ndMemRemoval.cpp
nlineSimple.cpp
nternalize.cpp
oopExtractor.cpp
owerSetJmp.cpp
runeEH.cpp
aiseAllocations.cpp
implifyLibCalls.cpp
tripDeadPrototypes.cpp
tripSymbols.cpp
1997473cf72957d0e70322e2fe6fe2ab141c58a6 03-May-2007 Devang Patel <dpatel@apple.com> Drop 'const'


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36662 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
onstantMerge.cpp
eadArgumentElimination.cpp
eadTypeElimination.cpp
xtractFunction.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
ndMemRemoval.cpp
nlineSimple.cpp
nliner.cpp
nliner.h
nternalize.cpp
oopExtractor.cpp
owerSetJmp.cpp
runeEH.cpp
aiseAllocations.cpp
implifyLibCalls.cpp
tripDeadPrototypes.cpp
tripSymbols.cpp
3e15bf33e024b9df9e89351a165acfdb1dde51ed 02-May-2007 Devang Patel <dpatel@apple.com> Use 'static const char' instead of 'static const int'.
Due to darwin gcc bug, one version of darwin linker coalesces
static const int, which defauts PassID based pass identification.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36652 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
onstantMerge.cpp
eadArgumentElimination.cpp
eadTypeElimination.cpp
xtractFunction.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
ndMemRemoval.cpp
nlineSimple.cpp
nliner.cpp
nliner.h
nternalize.cpp
oopExtractor.cpp
owerSetJmp.cpp
runeEH.cpp
aiseAllocations.cpp
implifyLibCalls.cpp
tripDeadPrototypes.cpp
tripSymbols.cpp
794fd75c67a2cdc128d67342c6d88a504d186896 01-May-2007 Devang Patel <dpatel@apple.com> Do not use typeinfo to identify pass in pass manager.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36632 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
onstantMerge.cpp
eadArgumentElimination.cpp
eadTypeElimination.cpp
xtractFunction.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
ndMemRemoval.cpp
nlineSimple.cpp
nliner.cpp
nliner.h
nternalize.cpp
oopExtractor.cpp
owerSetJmp.cpp
runeEH.cpp
aiseAllocations.cpp
implifyLibCalls.cpp
tripDeadPrototypes.cpp
tripSymbols.cpp
c6c98af9e5814e8066c82f20ca11cf646a5fc289 29-Apr-2007 Anton Korobeynikov <asl@math.spbu.ru> Implement review feedback


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36564 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
a80e1181b78183dc36ec6568559d38faa86981f0 28-Apr-2007 Anton Korobeynikov <asl@math.spbu.ru> Implement review feedback. Aliasees can be either GlobalValue's or
bitcasts of them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36537 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
8b0a8c84da2030ee8f4440d5b60a8033de691222 25-Apr-2007 Anton Korobeynikov <asl@math.spbu.ru> Implement aliases. This fixes PR1017 and it's dependent bugs. CFE part
will follow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36435 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
bed2946a96ecb15b0b636fa74cb26ce61b1c648e 16-Apr-2007 Anton Korobeynikov <asl@math.spbu.ru> Removed tabs everywhere except autogenerated & external files. Add make
target for tabs checking.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36146 91177308-0d34-0410-b5e6-96231b3b80d8
ndMemRemoval.cpp
nternalize.cpp
83ae2fcacc34675c4a1bb862bc651f03de31f7e7 15-Apr-2007 Chris Lattner <sabre@nondot.org> fix SimplifyLibCalls/IsDigit.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36047 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
ae143ceb83e4247a59315304163d886faf7331b0 14-Apr-2007 Chris Lattner <sabre@nondot.org> avoid iterator invalidation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36002 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
98a72203d75c7f2c94169155626f51f10eaca530 14-Apr-2007 Jeff Cohen <jeffc@jolt-lang.org> An even better fix.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35998 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
e4aee1d3a4677cadc0596d989b5a28ef21ab9a0b 14-Apr-2007 Jeff Cohen <jeffc@jolt-lang.org> Fix recent regression that broke several llvm-tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35996 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
35b9b49fd17fe8600d5a6ac25d812694af7b1051 14-Apr-2007 Chris Lattner <sabre@nondot.org> Implement a few missing xforms: printf("foo\n") -> puts. printf("x") -> putchar
printf("") -> noop. Still need to do the xforms for fprintf.

This implements Transforms/SimplifyLibCalls/Printf.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35984 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
8264a9fccae4d0b8942360f57d9167519d09f220 14-Apr-2007 Chris Lattner <sabre@nondot.org> in addition to merging, constantmerge should also delete trivially dead globals,
in order to clean up after simplifylibcalls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35982 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
c763552299165b88d34a7d4f2d76ff413cbc7f67 12-Apr-2007 Lauro Ramos Venancio <lauro.venancio@gmail.com> Implement the "thread_local" keyword.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35950 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
51047859ed6b365c0951a3eaac3550a37580f2d2 08-Apr-2007 Chris Lattner <sabre@nondot.org> Fix a typo that broke SimplifyLibCalls/SPrintF.ll (pr1315)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35768 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
5cef3c6eb7d06eca8e6844dee43818d528b1f516 08-Apr-2007 Chris Lattner <sabre@nondot.org> implement a fixme: move optimizations for fwrite out of fputs into a new
fwrite optimizer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35758 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
0cd3a23d2af0dbf109141d69157c44751e40b260 07-Apr-2007 Chris Lattner <sabre@nondot.org> Significantly simplify the clients of GetConstantStringInfo, by having it
just return the string itself.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35755 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
73f5d42a9722eef5127cdf3e5967c8518dbad812 07-Apr-2007 Chris Lattner <sabre@nondot.org> Fix problems in the sprintf optimizer


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35754 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
3492cda48f85ca9048824baff18e24a19edaf7ed 07-Apr-2007 Chris Lattner <sabre@nondot.org> Change CastToCStr to take a pointer instead of a reference.
Fix some miscompilations in fprintf optimizer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35753 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
af33e6579a76611db02014e574bc4314cfb703df 07-Apr-2007 Chris Lattner <sabre@nondot.org> Fix an off-by-one error that broke Prolangs/deriv2 with llc on x86
and Prolangs-C/cdecl


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35749 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
c6fcf29e81f54b68146fb8d375c347d2c689566d 07-Apr-2007 Owen Anderson <resistor@mac.com> Expunge DomSet from CodeExtractor. This is part of the continuing work
on PR1171.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35726 91177308-0d34-0410-b5e6-96231b3b80d8
oopExtractor.cpp
045af54275b7c1d13b35490e133b821e47095299 07-Apr-2007 Chris Lattner <sabre@nondot.org> fix a miscompilation in printf optimizer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35713 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
ef4fd3572627f59b8787107632605835993f9a1c 07-Apr-2007 Chris Lattner <sabre@nondot.org> trunc to bool no longer compares against zero


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35712 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
71bf3e2ef936979e8282d84edd5068a8f30f3789 07-Apr-2007 Chris Lattner <sabre@nondot.org> cleanups for strlen optimizer


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35711 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
679d7188c736b39063b1bb5a38e42b5b4b3e002c 07-Apr-2007 Chris Lattner <sabre@nondot.org> Introduce a new ReplaceCallWith method, which simplifies a lot of code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35710 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
db895b82a38c1d3b7f5633d584783dbc1f77f4ba 07-Apr-2007 Chris Lattner <sabre@nondot.org> fixes for strcpy optimizer


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35709 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
7b50c8f2787db9ca16d4e3043faf9f2dc55f3c5a 07-Apr-2007 Chris Lattner <sabre@nondot.org> Fix bugs in strncmp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35708 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
ceb375ecf26e5139a28db50a6c445215a6c484fd 07-Apr-2007 Chris Lattner <sabre@nondot.org> fix 3 miscompilations and several compielr crashes in strcmp optimizer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35707 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
6897fe58610f4671705566d27af5b76b0c587b31 07-Apr-2007 Chris Lattner <sabre@nondot.org> Fix several nasty bugs in the strchr optimizer, this fixes
SimplifyLibCalls/2007-04-06-strchr-miscompile.ll and PR1307


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35706 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
09c11aa7f599e783a4c9fe489de7cf365f1f8bb9 07-Apr-2007 Chris Lattner <sabre@nondot.org> clean up strcat optimizer, no functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35704 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
c8e1741bb9c3e01d5cab764e012d7cfaffc6dff2 07-Apr-2007 Chris Lattner <sabre@nondot.org> rename getConstantStringLength -> GetConstantStringInfo. Make it return
the start index of the array as well as the length. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35703 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
4913bf47fddaafaf21d2657fd06eed5e48bc8eb9 05-Apr-2007 Chris Lattner <sabre@nondot.org> Fix Transforms/GlobalOpt/2007-04-05-Crash.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35689 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
ca5183d445954a9b2a570d6bbba1bc2b00ad6442 05-Mar-2007 Jeff Cohen <jeffc@jolt-lang.org> Unbreak VC++ build.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34917 91177308-0d34-0410-b5e6-96231b3b80d8
aiseAllocations.cpp
cae5754619433aed7be74abbf1c0551a82d369cb 02-Mar-2007 Reid Spencer <rspencer@reidspencer.com> Prefer non-virtual calls to ConstantInt::isZero over virtual calls to
Constant::isNullValue() in situations where it is possible.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34821 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
implifyLibCalls.cpp
a0e0129e3f03fae1a275537a00e426a31d5eb649 01-Mar-2007 Reid Spencer <rspencer@reidspencer.com> Use APInt conversion to string so the result is correct regardless of the
bit width of the ConstantInt being converted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34810 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
4a6f363491c37e0a31f462e72d640d9d4c63177e 18-Feb-2007 Chris Lattner <sabre@nondot.org> fix comment


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34395 91177308-0d34-0410-b5e6-96231b3b80d8
tripDeadPrototypes.cpp
eb47391994497060793d8f91d1c0a94e39538c6d 18-Feb-2007 Chris Lattner <sabre@nondot.org> simplify pass, delete dead gvar protos as well.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34394 91177308-0d34-0410-b5e6-96231b3b80d8
tripDeadPrototypes.cpp
9d6565a5b1fbc4286d6ee638d8f47a3171a9ed7e 15-Feb-2007 Reid Spencer <rspencer@reidspencer.com> For PR1195:
Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and
PackedTyID -> VectorTyID. No functional changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34293 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
c18470cb0044129f1b43d09d7a4eb683ee3996ad 13-Feb-2007 Chris Lattner <sabre@nondot.org> eliminate a bunch of vector-related heap traffic


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34222 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
93e985f1b17aef62d58e3198a4604f9f6cfe8d19 13-Feb-2007 Chris Lattner <sabre@nondot.org> Eliminate use of ctors that take vectors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34219 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
owerSetJmp.cpp
runeEH.cpp
1ccd185cb49d81465a2901622e58ceae046d1d83 12-Feb-2007 Chris Lattner <sabre@nondot.org> stop using methods that take vectors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34205 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
lobalOpt.cpp
dec628eead87b20773c98a00830580df211acc98 12-Feb-2007 Chris Lattner <sabre@nondot.org> Switch ValueSymbolTable to use StringMap<Value*> instead of std::map<std::string, Value*>
as its main datastructure. There are many improvements yet to be made, but
this speeds up opt --std-compile-opts on 447.dealII by 7.3%.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34193 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
046800a7125cd497613efc0e1ea15cb595666585 11-Feb-2007 Chris Lattner <sabre@nondot.org> simplify name juggling through the use of Value::takeName.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34175 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
xtractFunction.cpp
lobalOpt.cpp
runeEH.cpp
aiseAllocations.cpp
3cfc1d22b2ed48834fefadc629c5841972763dfd 07-Feb-2007 Chris Lattner <sabre@nondot.org> Fix Transforms/DeadArgElim/2007-02-07-FuncRename.ll, fallout from PR411.
This happened because deadargelim now causes VMCore to auto-rename every
function that it hacks arguments out of. Because it hacks arguments out of
functions in a non-deterministic order, this caused the resultant numbering
to be nondet. The fix is to just be careful to not rename functions!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34005 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
7f1444bc0aefdd924e9b231e20d4c0529311e141 07-Feb-2007 Chris Lattner <sabre@nondot.org> shrink vmcore by moving symbol table stripping support out of VMCore into
the one IPO pass that uses it.


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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33939 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
onstantMerge.cpp
eadArgumentElimination.cpp
eadTypeElimination.cpp
xtractFunction.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
ndMemRemoval.cpp
nlineSimple.cpp
nternalize.cpp
oopExtractor.cpp
owerSetJmp.cpp
runeEH.cpp
aiseAllocations.cpp
implifyLibCalls.cpp
tripSymbols.cpp
7ea07659a12e8c6b75da1fa58224d64f697b5948 05-Feb-2007 Reid Spencer <rspencer@reidspencer.com> Add missing and needed #include.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33926 91177308-0d34-0410-b5e6-96231b3b80d8
tripDeadPrototypes.cpp
9153a6729f78a0c3bf89b3b571e8405165c93670 05-Feb-2007 Reid Spencer <rspencer@reidspencer.com> Make the class VISIBILITY_HIDDEN.
Reduce lexical size of the anonymous namespace.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33925 91177308-0d34-0410-b5e6-96231b3b80d8
tripDeadPrototypes.cpp
688b0490e22eb67623f5aaa24406209be74efcb2 05-Feb-2007 Reid Spencer <rspencer@reidspencer.com> For PR411:
Adjust to changes in Module interface:
getMainFunction() -> getFunction("main")
getNamedFunction(X) -> getFunction(X)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33922 91177308-0d34-0410-b5e6-96231b3b80d8
xtractFunction.cpp
ndMemRemoval.cpp
nternalize.cpp
owerSetJmp.cpp
tripSymbols.cpp
ef9b9a793949469cdaa4ab6d0173136229dcab7b 05-Feb-2007 Reid Spencer <rspencer@reidspencer.com> For PR411:
This patch replaces the SymbolTable class with ValueSymbolTable which does
not support types planes. This means that all symbol names in LLVM must now
be unique. The patch addresses the necessary changes to deal with this and
removes code no longer needed as a result. This completes the bulk of the
changes for this PR. Some cleanup patches will follow.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33918 91177308-0d34-0410-b5e6-96231b3b80d8
oopExtractor.cpp
aiseAllocations.cpp
tripSymbols.cpp
15468bfc22302b4f79300252425d74cd6865f8b1 05-Feb-2007 Reid Spencer <rspencer@reidspencer.com> For PR411:
This pass is no longer needed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33917 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
c19fbd6ec8a5a50d0dcea1325190570dffde2302 05-Feb-2007 Reid Spencer <rspencer@reidspencer.com> Create a pass to strip dead function declarations (prototypes). This is
for use by llvm-extract and bugpoint.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33916 91177308-0d34-0410-b5e6-96231b3b80d8
tripDeadPrototypes.cpp
832254e1c2387c0cbeb0a820b8315fbe85cb003a 02-Feb-2007 Reid Spencer <rspencer@reidspencer.com> Changes to support making the shift instructions be true BinaryOperators.
This feature is needed in order to support shifts of more than 255 bits
on large integer types. This changes the syntax for llvm assembly to
make shl, ashr and lshr instructions look like a binary operator:
shl i32 %X, 1
instead of
shl i32 %X, i8 1
Additionally, this should help a few passes perform additional optimizations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33776 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
699d144a4b726e11d5e72e23ab9b7b665ca9341f 31-Jan-2007 Chris Lattner <sabre@nondot.org> eliminate temporary vectors


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33712 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
implifyLibCalls.cpp
55eb1c47de30a6b4e8707b6392e878e32a6583e9 31-Jan-2007 Chris Lattner <sabre@nondot.org> eliminate temporary vectors


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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33680 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
ff2dad312883e5da91fb9f4e3619b7d095867f3b 31-Jan-2007 Chris Lattner <sabre@nondot.org> the inliner pass now passes targetdata down through the inliner api's


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33677 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
nliner.h
6c1f56574c8a0ba70480b7c65c4ec3847ff70864 31-Jan-2007 Chris Lattner <sabre@nondot.org> adjust to api change


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33671 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
5cbf985dcbc89fba3208e7baf8b6f488b06d3ec9 30-Jan-2007 Reid Spencer <rspencer@reidspencer.com> For PR1136: Rename GlobalVariable::isExternal as isDeclaration to avoid
confusion with external linkage types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33663 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
xtractFunction.cpp
unctionResolution.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
ndMemRemoval.cpp
nliner.cpp
nternalize.cpp
runeEH.cpp
aiseAllocations.cpp
implifyLibCalls.cpp
b10308e440c80dd6ffb4b478f741ff7e5f30cb48 28-Jan-2007 Anton Korobeynikov <asl@math.spbu.ru> Propagate changes from my local tree. This patch includes:
1. New parameter attribute called 'inreg'. It has meaning "place this
parameter in registers, if possible". This is some generalization of
gcc's regparm(n) attribute. It's currently used only in X86-32 backend.
2. Completely rewritten CC handling/lowering code inside X86 backend.
Merged stdcall + c CCs and fastcall + fast CC.
3. Dropped CSRET CC. We cannot add struct return variant for each
target-specific CC (e.g. stdcall + csretcc and so on).
4. Instead of CSRET CC introduced 'sret' parameter attribute. Setting in
on first attribute has meaning 'This is hidden pointer to structure
return. Handle it gently'.
5. Fixed small bug in llvm-extract + add new feature to
FunctionExtraction pass, which relinks all internal-linkaged callees
from deleted function to external linkage. This will allow further
linking everything together.

NOTEs: 1. Documentation will be updated soon.
2. llvm-upgrade should be improved to translate csret => sret.
Before this, there will be some unexpected test fails.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33597 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
xtractFunction.cpp
44c3b9fdd416c79f4b67cde1aecfced5921efd81 26-Jan-2007 Jim Laskey <jlaskey@mac.com> Change the MachineDebugInfo to MachineModuleInfo to better reflect usage
for debugging and exception handling.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33550 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
c71ca3cdd2d7a08b043ebb717cad0beadaf47450 26-Jan-2007 Devang Patel <dpatel@apple.com> Inherit CallGraphSCCPass directly from Pass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33514 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
nlineSimple.cpp
runeEH.cpp
338305b0b6ce21ad2ef0c883afe78d42b4b2911d 25-Jan-2007 Chris Lattner <sabre@nondot.org> Make llvm-extract preserve the callingconv of prototypes in the extracted
code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33500 91177308-0d34-0410-b5e6-96231b3b80d8
xtractFunction.cpp
24d6da5fedcf39891f7d8c5b031c01324b3db545 21-Jan-2007 Reid Spencer <rspencer@reidspencer.com> For PR970:
Clean up handling of isFloatingPoint() and dealing with PackedType.
Patch by Gordon Henriksen!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33415 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
f4d5de4080c2ddb791c4c2171b30f47d51111e67 20-Jan-2007 Owen Anderson <resistor@mac.com> Correct a comment.


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

This also fixes PR1120.

Patch by Sheng Zhou.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33370 91177308-0d34-0410-b5e6-96231b3b80d8
ndMemRemoval.cpp
42a75517250017a52afb03a0ade03cbd49559fe5 15-Jan-2007 Chris Lattner <sabre@nondot.org> rename Type::isIntegral to Type::isInteger, eliminating the old Type::isInteger.
rename Type::getIntegralTypeMask to Type::getIntegerTypeMask.

This makes naming much more consistent. For example, there are now no longer any
instances of IntegerType that are not considered isInteger! :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33225 91177308-0d34-0410-b5e6-96231b3b80d8
eadTypeElimination.cpp
implifyLibCalls.cpp
4d5f508318b2f666ed50a2ed5e49e4aa343a92d6 15-Jan-2007 Chris Lattner <sabre@nondot.org> Eliminate calls to isInteger, generalizing code and tightening checks as needed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33218 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
720922fe27379301ff398d05b1f6214a6483b030 12-Jan-2007 Chris Lattner <sabre@nondot.org> Remove over-general comparisons


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33147 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
97d1fad3d2e5aac2a89beacc3961ff9451841248 12-Jan-2007 Chris Lattner <sabre@nondot.org> Branch conditions must be i1


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33129 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
a54b7cbd452b3adb2f51346140d996b29c2cdb30 12-Jan-2007 Reid Spencer <rspencer@reidspencer.com> For PR1064:
Implement the arbitrary bit-width integer feature. The feature allows
integers of any bitwidth (up to 64) to be defined instead of just 1, 8,
16, 32, and 64 bit integers.

This change does several things:
1. Introduces a new Derived Type, IntegerType, to represent the number of
bits in an integer. The Type classes SubclassData field is used to
store the number of bits. This allows 2^23 bits in an integer type.
2. Removes the five integer Type::TypeID values for the 1, 8, 16, 32 and
64-bit integers. These are replaced with just IntegerType which is not
a primitive any more.
3. Adjust the rest of LLVM to account for this change.

Note that while this incremental change lays the foundation for arbitrary
bit-width integers, LLVM has not yet been converted to actually deal with
them in any significant way. Most optimization passes, for example, will
still only deal with the byte-width integer types. Future increments
will rectify this situation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33113 91177308-0d34-0410-b5e6-96231b3b80d8
eadTypeElimination.cpp
implifyLibCalls.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
lobalOpt.cpp
4fe16d607d11e29d742208894909733f5ad01f8f 11-Jan-2007 Reid Spencer <rspencer@reidspencer.com> Rename BoolTy as Int1Ty. Patch by Sheng Zhou.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33076 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
owerSetJmp.cpp
implifyLibCalls.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
lobalOpt.cpp
39ff1e2afc07acf4c29af48853b09e15c41875d2 10-Jan-2007 Chris Lattner <sabre@nondot.org> Fix a bug in heap-sra that caused compilation failure of office-ispell.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33043 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
3c628627eab803f5b130e5ee870ce5936a5f1ba7 07-Jan-2007 Reid Spencer <rspencer@reidspencer.com> Types should be const.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33001 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
b76efb71d41dc1ae33e47d5d9ef79df25cde0b5d 07-Jan-2007 Chris Lattner <sabre@nondot.org> Change the interface to Module::getOrInsertFunction to be easier to use,to resolve PR1088, and to help PR411.
This simplifies many clients also


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32989 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
35057c2625efb902048c215cf52f960f60944318 07-Jan-2007 Chris Lattner <sabre@nondot.org> relax types


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32981 91177308-0d34-0410-b5e6-96231b3b80d8
owerSetJmp.cpp
78d033e086e19e016273de014f9214aa6f3f844b 06-Jan-2007 Reid Spencer <rspencer@reidspencer.com> For PR411:
Take an incremental step towards type plane elimination. This change
separates types from values in the symbol tables by finally making use
of the TypeSymbolTable class. This yields more natural interfaces for
dealing with types and unclutters the SymbolTable class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32956 91177308-0d34-0410-b5e6-96231b3b80d8
eadTypeElimination.cpp
tripSymbols.cpp
c5b206b6be61d0d933b98b6af5e22f42edd48ad1 31-Dec-2006 Reid Spencer <rspencer@reidspencer.com> For PR950:
This patch replaces signed integer types with signless ones:
1. [US]Byte -> Int8
2. [U]Short -> Int16
3. [U]Int -> Int32
4. [U]Long -> Int64.
5. Removal of isSigned, isUnsigned, getSignedVersion, getUnsignedVersion
and other methods related to signedness. In a few places this warranted
identifying the signedness information from other sources.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32785 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
lobalOpt.cpp
ndMemRemoval.cpp
owerSetJmp.cpp
aiseAllocations.cpp
implifyLibCalls.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
lobalOpt.cpp
implifyLibCalls.cpp
a2913eea9d7530f8cad652b984cb642ee12c0d6d 21-Dec-2006 Reid Spencer <rspencer@reidspencer.com> Get rid of a useless if statement whose then and else blocks were identical.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32729 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
1c560adfd1be8051644d7aefd32f2dcdb4070689 20-Dec-2006 Chris Lattner <sabre@nondot.org> switch statistics over to not use static ctors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32709 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
86453c52ba02e743d29c08456e51006500041456 19-Dec-2006 Chris Lattner <sabre@nondot.org> Eliminate static ctors due to Statistic objects


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32693 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
onstantMerge.cpp
eadArgumentElimination.cpp
eadTypeElimination.cpp
unctionResolution.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
ndMemRemoval.cpp
nliner.cpp
nternalize.cpp
oopExtractor.cpp
owerSetJmp.cpp
runeEH.cpp
aiseAllocations.cpp
implifyLibCalls.cpp
95ca3a453ad0a86c77ba44ba48f019f1c5d8e960 16-Dec-2006 Chris Lattner <sabre@nondot.org> when inserting a dummy argument to work-around the CBE not supporting
zero arg vararg functions, pass undef instead of 'int 0', which is cheaper.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32634 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
dccd9fe161135bffd3fddf0091f8e8efd4fd259b 13-Dec-2006 Reid Spencer <rspencer@reidspencer.com> Fix some casts. isdigit(c) returns 0 or 1, not 0 or -1


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32534 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
7b06bd532d3324a2f76bbc856ae20ff89d8e0e92 13-Dec-2006 Reid Spencer <rspencer@reidspencer.com> Replace CastInst::createInferredCast calls with more accurate cast
creation calls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32521 91177308-0d34-0410-b5e6-96231b3b80d8
ndMemRemoval.cpp
aiseAllocations.cpp
implifyLibCalls.cpp
d977d8651a5cd26a3e1088267f31cade405f2adf 13-Dec-2006 Reid Spencer <rspencer@reidspencer.com> Replace inferred getCast(V,Ty) calls with more strict variants.
Rename getZeroExtend and getSignExtend to getZExt and getSExt to match
the the casting mnemonics in the rest of LLVM.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32514 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
4da49122f3f3c8da68a52723d846b88c72166a68 12-Dec-2006 Reid Spencer <rspencer@reidspencer.com> Change inferred getCast into specific getCast. Passes all tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32469 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
f5da13367f88f06e3b585dc2263ab6e9ca6c4bf8 07-Dec-2006 Bill Wendling <isanbard@gmail.com> What should be the last unnecessary <iostream>s in the library.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32333 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
832171cb9724d2d31c8dfb73172e2be8f6dd13ee 07-Dec-2006 Bill Wendling <isanbard@gmail.com> Removing even more <iostream> includes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32320 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
e81561909d128c6e2d8033cb5465a49b2596b26a 07-Dec-2006 Bill Wendling <isanbard@gmail.com> Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, are
now cerr, cout, and NullStream resp.


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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32279 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
onstantMerge.cpp
eadArgumentElimination.cpp
eadTypeElimination.cpp
unctionResolution.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
ndMemRemoval.cpp
nliner.cpp
nternalize.cpp
oopExtractor.cpp
owerSetJmp.cpp
runeEH.cpp
aiseAllocations.cpp
implifyLibCalls.cpp
d0a6a7a0307f124d47df9c649946bcb0767c5631 30-Nov-2006 Chris Lattner <sabre@nondot.org> make it clear that this is always a zext


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32044 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
6e8fbad67554e0a605af59d072b4129a8706681e 30-Nov-2006 Chris Lattner <sabre@nondot.org> One more bugfix, 3 cases of making casts explicit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32043 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
9a989f0f97dfb96477e5fec080c170f34930a7fe 30-Nov-2006 Chris Lattner <sabre@nondot.org> Fix a bug in globalopt due to the recent cast patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32042 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.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
lobalOpt.cpp
ndMemRemoval.cpp
nlineSimple.cpp
owerSetJmp.cpp
aiseAllocations.cpp
implifyLibCalls.cpp
0a81aac4b46eed130d20714af5a1c01b05d0275e 26-Nov-2006 Bill Wendling <isanbard@gmail.com> Replace #include <iostream> with llvm_* streams.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31924 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
lobalOpt.cpp
ndMemRemoval.cpp
nliner.cpp
nternalize.cpp
08ff1480ffcb22e946c7bb6c7d66c5d977ae3d6e 10-Nov-2006 Chris Lattner <sabre@nondot.org> second patch to fix PR992/993.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31610 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
a9d709d51a952a61d8baf413036363adcc90a3e2 10-Nov-2006 Chris Lattner <sabre@nondot.org> Minimal patch to fix PR992/PR993


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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31380 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
lobalOpt.cpp
ndMemRemoval.cpp
nlineSimple.cpp
nliner.cpp
owerSetJmp.cpp
implifyLibCalls.cpp
25de4e5c21b8ef1bbf6d625de548ca3508c58947 01-Nov-2006 Chris Lattner <sabre@nondot.org> Fix GlobalOpt/2006-11-01-ShrinkGlobalPhiCrash.ll and McGill/chomp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31352 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
1628cec4d7fce310d9cde0bcc73997e5a71692c4 26-Oct-2006 Reid Spencer <rspencer@reidspencer.com> For PR950:
Make necessary changes to support DIV -> [SUF]Div. This changes llvm to
have three division instructions: signed, unsigned, floating point. The
bytecode and assembler are bacwards compatible, however.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31195 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
9dcbf0dedc47e667ed90a46844cbf8655eda0070 20-Oct-2006 Chris Lattner <sabre@nondot.org> llvm-extract should remove module-level asm


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31086 91177308-0d34-0410-b5e6-96231b3b80d8
xtractFunction.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
rgumentPromotion.cpp
lobalOpt.cpp
owerSetJmp.cpp
implifyLibCalls.cpp
99435d32b3318f1b2f593f484ea9ba26804bf56c 03-Oct-2006 Evan Cheng <evan.cheng@apple.com> Revert previous patch. Still breaking things.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30698 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
596721f0d7e59e5092ff89b2dd3ba4abeffc43e5 01-Oct-2006 Chris Lattner <sabre@nondot.org> Fix debug output


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30680 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
8639503abe611a6655fc7ac78537770ce5983cb0 01-Oct-2006 Chris Lattner <sabre@nondot.org> Implement SRA of heap allocations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30679 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
cff1673182b239a8b8a53ac68fc48fe93161357e 30-Sep-2006 Chris Lattner <sabre@nondot.org> Add some ifdef'd out debug info


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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30665 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
32954718469b91193561c2efdc45db7d7cdd05df 29-Sep-2006 Owen Anderson <resistor@mac.com> Another attempt at making ArgPromotion smarter. This patch no longer breaks Burg.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30657 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
4af90abc13a7406efdb3f2261fce8ecd7d38bbd7 18-Sep-2006 Chris Lattner <sabre@nondot.org> Implement a trivial optzn: of vastart is never called in a function that takes
... args, remove the '...'.

This is Transforms/DeadArgElim/dead_vaargs.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30459 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
94876527af8703273c523840cf41b00aaf85389b 15-Sep-2006 Chris Lattner <sabre@nondot.org> revert previous two patches. They cause miscompilation of MultiSource/Applications/Burg


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30397 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
46f022a7f105211d5ea2c394e406d1943b80908c 15-Sep-2006 Owen Anderson <resistor@mac.com> Revert my previous work on ArgumentPromotion. Further investigation has revealed these
changes to be incorrect. They just weren't showing up in any of our current testcases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30385 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
b74ed07bfd3af42331b1964c24c39912610a08f4 14-Sep-2006 Anton Korobeynikov <asl@math.spbu.ru> Adding dllimport, dllexport and external weak linkage types.
DLL* linkages got full (I hope) codegeneration support in C & both x86
assembler backends.
External weak linkage added for future use, we don't provide any
codegeneration, etc. support for it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30374 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
implifyLibCalls.cpp
56eac5f6f78b2aec32179d13115f57cd4bcc5675 13-Sep-2006 Devang Patel <dpatel@apple.com> Initialize DontInternalize.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30281 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
7b166d9969670665d9f093f20ed3381057427256 09-Sep-2006 Chris Lattner <sabre@nondot.org> Make inlining costs more accurate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30231 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
b833e5ac3fc9230947cbdfd50c7d8782a0c17d60 02-Sep-2006 Owen Anderson <resistor@mac.com> Make ArgumentPromotion handle recursive functions that pass pointers in their recursive calls.


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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29925 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
onstantMerge.cpp
eadArgumentElimination.cpp
eadTypeElimination.cpp
unctionResolution.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
ndMemRemoval.cpp
nlineSimple.cpp
nternalize.cpp
oopExtractor.cpp
owerSetJmp.cpp
runeEH.cpp
aiseAllocations.cpp
implifyLibCalls.cpp
tripSymbols.cpp
d828a4b285339a2ae7d97428b64016628d9ef6db 20-Jul-2006 Devang Patel <dpatel@apple.com> Make it fit into 80 cols.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29223 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
753d94a1c8fe02f64eb4f482d396712c68db1d84 20-Jul-2006 Devang Patel <dpatel@apple.com> Add new constructor to accept vector of exported names while creating
InternalizePass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29222 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
d85340f4ec587e22b0239617f3b747a6df113894 12-Jul-2006 Chris Lattner <sabre@nondot.org> Change the callgraph representation to store the callsite along with the
target CG node. This allows the inliner to properly update the callgraph
when using the pruning inliner. The pruning inliner may not copy over all
call sites from a callee to a caller, so the edges corresponding to those
call sites should not be copied over either.

This fixes PR827 and Transforms/Inline/2006-07-12-InlinePruneCGUpdate.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29120 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
7cd580f0b7cf5f49ccd75bb747d6627292c8fe73 07-Jul-2006 Chris Lattner <sabre@nondot.org> Fix PR820 and Transforms/GlobalOpt/2006-07-07-InlineAsmCrash.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29071 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
92044ce4e93fead19e6a34485a506849d018565b 27-Jun-2006 Chris Lattner <sabre@nondot.org> Fix Transforms/DeadArgElim/2006-06-27-struct-ret.ll. -deadargelim should not
remove the struct return argument of a csret function, even if it is obviously
dead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28943 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
fb9d0dce976452f878e5bfd768f1ba35b182c33d 16-Jun-2006 Evan Cheng <evan.cheng@apple.com> Add missing casts. This fixed some regressions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28834 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
21abac2757087358249eec702ba93f1dde656cf2 16-Jun-2006 Evan Cheng <evan.cheng@apple.com> More libcall transformations:
printf("%s\n", str) -> puts(str)
printf("%c", c) -> putchar(c)
Also fixed fprintf(file, "%c", c) -> fputc(c, file)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28815 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
952895243e79f57f1e5c2789ffacca8c8d3e4f02 16-Jun-2006 Evan Cheng <evan.cheng@apple.com> Simplify fprintf(file, "%s", str) to fputs(str, file).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28814 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
2144c2536428f3e4eff4ec8323f00b3b47a80a2e 13-May-2006 Chris Lattner <sabre@nondot.org> Remove some dead variables.

Fix a nasty bug in the memcmp optimizer where we used the wrong variable!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28269 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
implifyLibCalls.cpp
61e99c9db845f4824cac9c78c2245cceeb542213 13-Apr-2006 Andrew Lenharth <andrewl@lenharth.org> linear -> constant time


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27652 91177308-0d34-0410-b5e6-96231b3b80d8
ndMemRemoval.cpp
3433141a3e5cae22f79019f52b624d0f384018a7 10-Apr-2006 Andrew Lenharth <andrewl@lenharth.org> Add a simple pass to make sure that all (non-library) calls to malloc and free
are visible to analysis as intrinsics. That is, make sure someone doesn't pass
free around by address in some struct (as happens in say 176.gcc).

This doesn't get rid of any indirect calls, just ensure calls to free and malloc
are always direct.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@27560 91177308-0d34-0410-b5e6-96231b3b80d8
ndMemRemoval.cpp
4ca9757a39a1bf3bd1264a77e52db62e02cc85fb 23-Mar-2006 Jim Laskey <jlaskey@mac.com> Strip changes to llvm.dbg intrinsics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26993 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
b2f6c0075cc1aafce3c83a756242f148429ade0f 15-Mar-2006 Chris Lattner <sabre@nondot.org> Teach the strip pass to strip type names in addition to value names. This
is fallout from the type/value split in the symtab long long ago :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26785 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
f4321a3a438833dade457e24da6e1e6907cabcd5 13-Mar-2006 Jim Laskey <jlaskey@mac.com> Handle the removal of the debug chain.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26729 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
e2b59d2760a4f72c84c262af67642ba09e91bfd1 09-Mar-2006 Chris Lattner <sabre@nondot.org> fix a pasto


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26627 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
e8c3e3b51c21dad94f0b427d7e0d6722e663fc64 07-Mar-2006 Jim Laskey <jlaskey@mac.com> Switch to using a numeric id for anchors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26598 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
e1c173bc77e44fe250d905f9e2399dd8868e51a0 07-Mar-2006 Chris Lattner <sabre@nondot.org> Fix ConstantMerge/2006-03-07-DontMergeDiffSections.ll, a problem Jim
hypotheticalized about, where we would incorrectly merge two globals in
different sections.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26597 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
aecb0627fa7e4fec42799c2b19d0743ff3ff7ae9 03-Mar-2006 Chris Lattner <sabre@nondot.org> Make this work with renamed intrinsics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26482 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
2f9859486a6cfc03a685c7dc8a805d1a8fb6b9d3 15-Feb-2006 Andrew Lenharth <andrewl@lenharth.org> fix a bunch of alpha regressions. see bug 709


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26218 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
e46f6e99a08ce514ecb832f48213f5c3d3f94e93 23-Jan-2006 Chris Lattner <sabre@nondot.org> add a bunch more optimizations for unary double math functions


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25530 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
7070c5f24125e06e969874c481d0f58f18e0097f 23-Jan-2006 Chris Lattner <sabre@nondot.org> Refactor/genericize this, no functionality change


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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25514 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
unctionResolution.cpp
lobalOpt.cpp
nliner.cpp
nternalize.cpp
e05cf716169a7072a301a570e864a37075bd76b7 23-Jan-2006 Chris Lattner <sabre@nondot.org> Make this more efficient in the following ways:
1. Do not statically construct a map when the program starts up, this
is expensive and cannot be optimized. Instead, create a list.
2. Do not insert entries for all function in the module into a hashmap
that lives the full life of the compiler.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25512 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
0f9f8c37595d5756ef06c5a976c3f03c438b71fd 22-Jan-2006 Chris Lattner <sabre@nondot.org> Several non-functionality changing changes:
1. Use the varargs version of getOrInsertFunction to simplify code.
2. remove #include
3. Reduce the number of #ifdef's.
4. remove extraneous vertical whitespace.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25508 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
aa87e0523d7d231d12f2b37463184c1ad356718f 19-Jan-2006 Reid Spencer <rspencer@reidspencer.com> For PR696:
Don't do floor->floorf conversion if floorf is not available. This checks
the compiler's host, not its target, which is incorrect for cross-compilers
Not sure that's important as we don't build many cross-compilers.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25456 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
727552bb899688f9fc473651bef67d4105597b8f 19-Jan-2006 Chris Lattner <sabre@nondot.org> If not internalizing, don't mark llvm.global[cd]tors const, as a fix for a
hypothetical future boog.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25430 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
ee9e14cb8ab8e613bc6642396aaada20695b9458 19-Jan-2006 Chris Lattner <sabre@nondot.org> Don't internalize llvm.global[cd]tor unless there are uses of it. This
unbreaks front-ends that don't use __main (like the new CFE).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25429 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
f91e97ae81d0037effea5165e34915fe359fdc94 17-Jan-2006 Chris Lattner <sabre@nondot.org> Clean up the FFS optimization code, and make it correctly create the appropriate
unsigned llvm.cttz.* intrinsic, fixing the 2005-05-11-Popcount-ffs-fls regression
last night.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25398 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
432a205769d22e7744dd8b0b45efd687aa6998e3 14-Jan-2006 Chris Lattner <sabre@nondot.org> Let the inliner update the callgraph to reflect the changes it makes, instead
of doing it ourselves. This fixes Transforms/Inline/2006-01-14-CallGraphUpdate.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25321 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
ccca3ca85f046bf7c99aa954ac121fdf59722499 13-Jan-2006 Chris Lattner <sabre@nondot.org> Permit inlining functions that contain dynamic allocations now that
InlineFunction handles this case safely. This implements
Transforms/Inline/dynamic_alloca_test.ll.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25288 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
8acb249725e3304aafe91d5357f69722957c51b1 13-Jan-2006 Chris Lattner <sabre@nondot.org> Fix 80 column violations


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25279 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
4eb40df1a839c08bca6dcab90ba1a4831e5ef52d 03-Jan-2006 Chris Lattner <sabre@nondot.org> Pull inline methods out of the pass class definition to make it easier to
read the code.

Do not internalize debugger anchors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25067 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
2f1890792c5da3692167050f6156f48634c2c6b8 13-Dec-2005 Reid Spencer <rspencer@reidspencer.com> Improve ResolveFunctions to:
a) use better local variable names (OldMT -> OldFT) where "M" is used to
mean "Function" (perhaps it was previously "Method"?)
b) print out the module identifier in a warning message so that it is
possible to track down in which module the error occurred.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24698 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
6b44ba28030e5ceb738f6d8cdf87a679e4867ef7 05-Dec-2005 Chris Lattner <sabre@nondot.org> Wrap a long line, never internalize llvm.used.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24602 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
14b0529532904b9e5a1e34526b4a3209f3e5bc62 05-Nov-2005 Nate Begeman <natebegeman@mac.com> Add support alignment of allocation instructions.
Add support for specifying alignment and size of setjmp jmpbufs.

No targets currently do anything with this information, nor is it presrved
in the bytecode representation. That's coming up next.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24196 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
e9c6d3637752b940a3c280196b0f594b65725e54 25-Oct-2005 Alkis Evlogimenos <alkis@evlogimenos.com> Stop using deprecated types


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23973 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
f36aeedaa30b34b044c20e8ef5d43bd8c6c0e342 24-Oct-2005 Chris Lattner <sabre@nondot.org> DONT_BUILD_RELINKED is gone and implied by BUILD_ARCHIVE now


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23940 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
ab0ed3592b0837c31aaaab65edd9bac8746f899e 24-Oct-2005 Chris Lattner <sabre@nondot.org> Only build .a file versions of these libraries, instead of .a and .o versions.
This should speed up build times.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23933 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
66c5fd6c537269eaef0f630fa14360dcaff6a295 23-Oct-2005 Jeff Cohen <jeffc@jolt-lang.org> When a function takes a variable number of pointer arguments, with a zero
pointer marking the end of the list, the zero *must* be cast to the pointer
type. An un-cast zero is a 32-bit int, and at least on x86_64, gcc will
not extend the zero to 64 bits, thus allowing the upper 32 bits to be
random junk.

The new END_WITH_NULL macro may be used to annotate a such a function
so that GCC (version 4 or newer) will detect the use of un-casted zero
at compile time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23888 91177308-0d34-0410-b5e6-96231b3b80d8
owerSetJmp.cpp
implifyLibCalls.cpp
a27ea769eb6f8be437ae1ff28ff49018a578f019 18-Oct-2005 Chris Lattner <sabre@nondot.org> Add an option to this pass. If it is set, we are allowed to internalize
all but main. If it's not set, we can still internalize, but only if an
explicit symbol list is provided.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23783 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
a48bc53cad55452f534f7b5dad06a0d4c4607cc6 29-Sep-2005 Chris Lattner <sabre@nondot.org> Fold isascii into a simple comparison. This speeds up 197.parser by 7.4%,
bringing the LLC time down to the CBE time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23521 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
e9b6242780a46f563b30063497246dd9d1140036 29-Sep-2005 Chris Lattner <sabre@nondot.org> remove a bunch of unneeded stuff, or self evident comments


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23519 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
c330069e20ff266c0bf74b8226d49420ecde91cc 29-Sep-2005 Chris Lattner <sabre@nondot.org> Implement a couple of memcmp folds from the todo list


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23517 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
9a5582f2516634f5b66c9bbdbab5360d6eb3ef35 28-Sep-2005 Chris Lattner <sabre@nondot.org> Fix a regression in my previous patch, fixing GlobalOpt/2005-09-27-Crash.ll
and PR632.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23484 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
a9ec8ab32bce9021c9501b45eea6bbc76ffeb207 27-Sep-2005 Chris Lattner <sabre@nondot.org> Add support for external calls that we know how to constant fold. This implements
ctor-list-opt.ll:CTOR8


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23465 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
231308c54538c1f50d7175f76b26e3d368e4703e 27-Sep-2005 Chris Lattner <sabre@nondot.org> Fix a bug where we would evaluate stores into linkonce objects which could be
potentially replaced at link-time.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23463 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
cd27142cc8d09dcab8110a7ef31e5cd6767d8b93 27-Sep-2005 Chris Lattner <sabre@nondot.org> Implement support for static constructors with calls in them. This is useful
because gccas runs globalopt before inlining.

This implements ctor-list-opt.ll:CTOR7


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23462 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
8a7cc6e71ca9bedf97abfae2ec9a5e9af212dc15 27-Sep-2005 Chris Lattner <sabre@nondot.org> Refactor this code a bit, no functionality changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23460 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
ff0c1ef9eb9266acaf4bb956de17d6f6ceab87e0 26-Sep-2005 Chris Lattner <sabre@nondot.org> Remove some dead code. ctor evaluation subsumes empty ctor elim


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23453 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
a22fdb0a37f935fc3e3391d47d64267a92cfc2e8 26-Sep-2005 Chris Lattner <sabre@nondot.org> Add support for alloca, implementing ctor-list-opt.ll:CTOR6


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23452 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
aae4a1cd3f5d41d0b909a75b4f5699b20605db5e 26-Sep-2005 Chris Lattner <sabre@nondot.org> Add a debug printout, fix a crash on kc++


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23450 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
798b4d5bb32d51f9fed87893f65ea571fd90b161 26-Sep-2005 Chris Lattner <sabre@nondot.org> Implement loads/stores through GEP's of globals. This implements
ctor-list-opt.ll:CTOR5.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23449 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
0b142e39209677daa4e62cf0dbe6bae07d30e0f3 26-Sep-2005 Chris Lattner <sabre@nondot.org> Replace TraverseGEPInitializer with ConstantFoldLoadThroughGEPConstantExpr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23447 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
562a055ca731c2f673cc4cfb60de963fce5e38a6 26-Sep-2005 Chris Lattner <sabre@nondot.org> add a comment


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23442 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
04de1cfb2b58cd3fff06d0328a733082ce775ab6 26-Sep-2005 Chris Lattner <sabre@nondot.org> Add support for getelementptr, load, and correctly reject volatile stores.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23441 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
cdf98bed968ff76b8f310a2adae5811f5ba88ec4 26-Sep-2005 Chris Lattner <sabre@nondot.org> Add support for br/brcond/switch and phi


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23439 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
79c1101947101ff1585a38dc69d1f1079d44bb04 26-Sep-2005 Chris Lattner <sabre@nondot.org> Add a simple interpreter to this code, allowing us to statically evaluate
global ctors that are simple enough. This implements ctor-list-opt.ll:CTOR2.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23437 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
db973e60ced33cfa0332462b1a2d5ae1ae15ad25 26-Sep-2005 Chris Lattner <sabre@nondot.org> factor some code into a InstallGlobalCtors method, add comments. No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23435 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
7d8e58f38425692e203edc45e87dcf3dcd65dae6 26-Sep-2005 Chris Lattner <sabre@nondot.org> Make the global opt optimizer work on modules with a null terminator, by
accepting the null even with a non-65535 init prio


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23434 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
b1ab4580478c90375abec5e2b6e89dc1a15fa98b 26-Sep-2005 Chris Lattner <sabre@nondot.org> Factor this code out into a few methods.
Implement the start of global ctor optimization. It is currently smart
enough to remove the global ctor for cases like this:

struct foo {
foo() {}
} x;

... saving a bit of startup time for the program.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23433 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
aebac50e776933bd6fb4f04e3c6c79d6fb7dab81 25-Sep-2005 Chris Lattner <sabre@nondot.org> Fix some logic I broke that caused a regression on
SimplifyLibCalls/2005-05-20-sprintf-crash.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23430 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
5d735bf29bb85c3d691d4e0c61f15b1675b90355 25-Sep-2005 Chris Lattner <sabre@nondot.org> Simplify this code a bit by relying on recursive simplification. Support
sprintf("%s", P)'s that have uses.

s/hasNUses(0)/use_empty()/


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23425 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
53249865ec4bca31481f29b8f35e3695c90437f7 24-Aug-2005 Chris Lattner <sabre@nondot.org> Transform floor((double)FLT) -> (double)floorf(FLT), implementing
Regression/Transforms/SimplifyLibCalls/floor.ll. This triggers 19 times in
177.mesa.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@23017 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
bbf728edebe3ba724d49fa3aff525c59ebca7942 07-Aug-2005 Chris Lattner <sabre@nondot.org> All stats are "Number of ..."


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22694 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
9cc5f42febe20d413e4bc027e1e0fd1d691869c6 01-Aug-2005 Chris Lattner <sabre@nondot.org> ConstantInt::get only works for arguments < 128.

SimplifyLibCalls probably has to be audited to make sure it does not make
this mistake elsewhere. Also, if this code knows that the type will be
unsigned, obviously one arm of this is dead.

Reid, can you take a look into this further?


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22566 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.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
runeEH.cpp
implifyLibCalls.cpp
46b8db2ec640ff8c109bb2cb0a187817aa8eb57c 29-Jun-2005 John Criswell <criswell@uiuc.edu> Doh! Forgot to LLVMify the style.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22312 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
1d231ec0b04268d40fe9903f6d0b0ae90a500150 29-Jun-2005 John Criswell <criswell@uiuc.edu> Basic fix for PR#591; don't convert an fprintf() to an fwrite() if there
is a mismatch in their character type pointers (i.e. fprintf() prints an
array of ubytes while fwrite() takes an array of sbytes).
We can probably do better than this (such as casting the ubyte to an
sbyte).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22310 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
543a02704e4d9ba9d0dd812658afc129048d37ec 24-Jun-2005 Chris Lattner <sabre@nondot.org> add a debug type


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22277 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
134d2e4af861d29176631cb716b27ce1780b6f96 18-Jun-2005 Reid Spencer <rspencer@reidspencer.com> Fix a problem with the strcmp optimization checking the wrong string and
not casting to the correct type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22250 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
d286b245be9aa45e6cf1c03a70cb5137f7e7d7e9 16-Jun-2005 Chris Lattner <sabre@nondot.org> Fix PR575, patch provided by John Mellor-Crummey. Thanks!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22223 91177308-0d34-0410-b5e6-96231b3b80d8
owerSetJmp.cpp
553ca5262361e520f98a72d1a109d6b10d1918ee 15-Jun-2005 Chris Lattner <sabre@nondot.org> Do not promote globals only used by main to locals if there are constantexprs
or other uses hanging off of them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22219 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
5633cd13e257ae0a55840b4b310bfb3f81d3233a 09-Jun-2005 Chris Lattner <sabre@nondot.org> Fix a problem on 64-bit targets where we passed (int)0 through ... instead of
(void*)0.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22205 91177308-0d34-0410-b5e6-96231b3b80d8
owerSetJmp.cpp
89026028d1c730c360f4b20d7449ca73dea065d4 21-May-2005 Reid Spencer <rspencer@reidspencer.com> Make the registration hash_map static. No other module needs it. Also,
document what its for a little better.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22164 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
0660f754df416e5fee4d80711b16cf9dc5318d35 21-May-2005 Reid Spencer <rspencer@reidspencer.com> Adjust the file comment to read a little easier.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22163 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
b82baf04ecc33f450c0102f68f9272c0724610ed 21-May-2005 Reid Spencer <rspencer@reidspencer.com> Make sure ... arguments are casted to sbyte* where needed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22162 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
5845623148891ab1a41e55358cbe8393814fed14 21-May-2005 Reid Spencer <rspencer@reidspencer.com> Add a "brief" comment for CastToCStr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22161 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
937513599951540cfa01fe9c3d9ed60f19b2bf00 21-May-2005 Chris Lattner <sabre@nondot.org> Fix mismatched type problem that crashed on cases like this:

sprintf(P, "%s", X);

Where X is not an sbyte*. This fixes the bug JohnMC reported on llvm-bugs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22159 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
49fbff45685c21d7f42aca7a104fc841cdbd5d43 18-May-2005 Chris Lattner <sabre@nondot.org> teach the inliner about coldcc and noreturn functions


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22113 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
c3f6abdd8573d1b6ff1b5fe2b8ce8dad49b3b801 15-May-2005 Reid Spencer <rspencer@reidspencer.com> Don't look for __builtin_ffs, we'll never see it from llvm-gcc and there's
not reason to include it for other front ends.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22070 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
f74eb3fa2a0761054277664a9eecb61e93ee614a 15-May-2005 Reid Spencer <rspencer@reidspencer.com> Provide this optimization as well:
ffs(x) -> (x == 0 ? 0 : 1+llvm.cttz(x))


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22068 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
c64e3e77f9c69e86b15ba6f8d18bb7aa4b7a9d68 15-May-2005 Reid Spencer <rspencer@reidspencer.com> Duh .. you actually have to #include Config/config.h before you can test
for one of the values that it defines!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22058 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
c29b13d6486ceb2453f16d17f6cd44af55f706cc 14-May-2005 Reid Spencer <rspencer@reidspencer.com> Changes for ffs lib call simplification:
* Check for availability of ffsll call in configure script
* Support ffs, ffsl, and ffsll conversion to constant value if the argument
is constant.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22027 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
f201dbc1a4a638659ec3916785196e2c204c7755 09-May-2005 Chris Lattner <sabre@nondot.org> Preserve calling conventions when doing IPO


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21798 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
runeEH.cpp
fb217adf92cbfd045614a652be63c710ce6a263d 09-May-2005 Chris Lattner <sabre@nondot.org> Convert non-address taken functions with C calling conventions to fastcc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21791 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
789082af0399576a80141a8bd6241f96e29e2902 07-May-2005 Reid Spencer <rspencer@reidspencer.com> * Add two strlen optimizations:
strlen(x) != 0 -> *x != 0
strlen(x) == 0 -> *x == 0
* Change nested statistics to use style of other LLVM statistics so that
only the name of the optimization (simplify-libcalls) is used as the
statistic name, and the description indicates which specific all is
optimized. Cuts down on some redundancy and saves a few bytes of space.
* Make note of stpcpy optimization that could be done.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21766 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
673c1a917035a7fe04f4491fbba62a7e13de2069 07-May-2005 Reid Spencer <rspencer@reidspencer.com> Don't increment the counter unless the debug flag is set.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21762 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
1430ef134d36888b99d2e6fedd2b025882593538 06-May-2005 Chris Lattner <sabre@nondot.org> preserve the tail marker


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21734 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
eadArgumentElimination.cpp
19bdc03adcc2961248068e3dfbbb54edbe0430e0 06-May-2005 Chris Lattner <sabre@nondot.org> Wrap long lines


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21720 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
3987abdfe3d31b411b4e7eb7dd3724888a27b4ab 05-May-2005 Chris Lattner <sabre@nondot.org> Fix a bug compimling Ruby, fixing this testcase:
LowerSetJmp/2005-05-05-OldUses.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21696 91177308-0d34-0410-b5e6-96231b3b80d8
owerSetJmp.cpp
cea6559f602392b5be5d2c20e3bc5dc00d067e51 04-May-2005 Reid Spencer <rspencer@reidspencer.com> Implement the IsDigitOptimization for simplifying calls to the isdigit
library function:
isdigit(chr) -> 0 or 1 if chr is constant
isdigit(chr) -> chr - '0' <= 9 otherwise

Although there are many calls to isdigit in llvm-test, most of them are
compiled away by macros leaving only this:

2 MultiSource/Applications/hexxagon


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21688 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
58b563ce4351996dd403646231fed40794a0aa4c 04-May-2005 Reid Spencer <rspencer@reidspencer.com> * Correct the function prototypes for some of the functions to match the
actual spec (int -> uint)
* Add the ability to get/cache the strlen function prototype.
* Make sure generated values are appropriately named for debugging purposes
* Add the SPrintFOptimiation for 4 casts of sprintf optimization:
sprintf(str,cstr) -> llvm.memcpy(str,cstr) (if cstr has no %)
sprintf(str,"") -> store sbyte 0, str
sprintf(str,"%s",src) -> llvm.memcpy(str,src) (if src is constant)
sprintf(str,"%c",chr) -> store chr, str ; store sbyte 0, str+1

The sprintf optimization didn't fire as much as I had hoped:

2 MultiSource/Applications/SPASS
5 MultiSource/Benchmarks/McCat/18-imp
22 MultiSource/Benchmarks/Prolangs-C/TimberWolfMC
1 MultiSource/Benchmarks/Prolangs-C/assembler
6 MultiSource/Benchmarks/Prolangs-C/unix-smail
2 MultiSource/Benchmarks/mediabench/mpeg2/mpeg2dec


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21679 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
21506ff821ed8dc10ff9626dd7ce992b6e9571d1 03-May-2005 Reid Spencer <rspencer@reidspencer.com> Implement optimizations for the strchr and llvm.memset library calls.
Neither of these activated as many times as was hoped:

strchr:
9 MultiSource/Applications/siod
1 MultiSource/Applications/d
2 MultiSource/Prolangs-C/archie-client
1 External/SPEC/CINT2000/176.gcc/176.gcc

llvm.memset:
no hits


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21669 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
9974ddab2bac51952f4f6682a37810105dc8292d 03-May-2005 Reid Spencer <rspencer@reidspencer.com> Avoid garbage output in the statistics display by ensuring that the
strings passed to Statistic's constructor are not destructable. The stats
are printed during static destruction and the SimplifyLibCalls module was
getting destructed before the statistics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21661 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
e6ec8cc8c698627a501a87fd16dc66755b682621 03-May-2005 Reid Spencer <rspencer@reidspencer.com> Add the StrNCmpOptimization which is similar to strcmp.

Unfortunately, this optimization didn't trigger on any llvm-test tests.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21660 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
a1b43909389a06186394cb895ad18a7d25ea050f 03-May-2005 Reid Spencer <rspencer@reidspencer.com> Implement the fprintf optimization which converts calls like this:
fprintf(F,"hello") -> fwrite("hello",strlen("hello"),1,F)
fprintf(F,"%s","hello") -> fwrite("hello",strlen("hello"),1,F)
fprintf(F,"%c",'x') -> fputc('c',F)

This optimization fires severals times in llvm-test:

313 MultiSource/Applications/Burg
302 MultiSource/Benchmarks/Prolangs-C/TimberWolfMC
189 MultiSource/Benchmarks/Prolangs-C/mybison
175 MultiSource/Benchmarks/Prolangs-C/football
130 MultiSource/Benchmarks/Prolangs-C/unix-tbl


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21657 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
63a7513ac1a9ba97a9d94244f7459f80503f681f 30-Apr-2005 Reid Spencer <rspencer@reidspencer.com> Fix a comment that stated the wrong thing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21638 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
9f56b1feeb9f2d50fdf5bb9e9a71a0973ae33ef7 30-Apr-2005 Reid Spencer <rspencer@reidspencer.com> * Don't depend on "guessing" what a FILE* is, just require that the actual
type be obtained from a CallInst we're optimizing.
* Make it possible for getConstantStringLength to return the ConstantArray
that it extracts in case the content is needed by an Optimization.
* Implement the strcmp optimization
* Implement the toascii optimization

This pass is now firing several to many times in the following MultiSource
tests:

Applications/Burg - 7 (strcat,strcpy)
Applications/siod - 13 (strcat,strcpy,strlen)
Applications/spiff - 120 (exit,fputs,strcat,strcpy,strlen)
Applications/treecc - 66 (exit,fputs,strcat,strcpy)
Applications/kimwitu++ - 34 (strcmp,strcpy,strlen)
Applications/SPASS - 588 (exit,fputs,strcat,strcpy,strlen)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21626 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
ff5525daf30eeb70cb2331e9d94eef8caa61da11 29-Apr-2005 Reid Spencer <rspencer@reidspencer.com> Implement the optimizations for "pow" and "fputs" library calls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21618 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
5882b92360e460176380e0afe7d9913b5b7a16a3 29-Apr-2005 Jeff Cohen <jeffc@jolt-lang.org> Consistently use 'class' to silence VC++


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21612 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
5624c75f9f2bb921872af33508f0d53c653de869 28-Apr-2005 Reid Spencer <rspencer@reidspencer.com> Remove from the TODO list those optimizations that are already handled by
constant folding implemented in lib/Transforms/Utils/Local.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21604 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
8441a01146983f1c4f6c4dd63b441ba725473485 28-Apr-2005 Reid Spencer <rspencer@reidspencer.com> Document additional libcall transformations that need to be written.

Help Wanted!

There's a lot of them to write.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21603 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
716f49e5a24bcbe38d304e18009034feefe80ff1 27-Apr-2005 Reid Spencer <rspencer@reidspencer.com> Doxygenate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21602 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
209a0aea220548b96c80963062958b97f4ee394f 27-Apr-2005 Chris Lattner <sabre@nondot.org> remove 'statement with no effect' warning


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21600 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
3f7d8c65bb15f36f9feff92a52e8d401f94dfed2 27-Apr-2005 Reid Spencer <rspencer@reidspencer.com> More Cleanup:
* Name the instructions by appending to name of original
* Factor common part out of a switch statement.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21597 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
a16d5a5185e25dc2b96f19ed369d9198da65a9ed 27-Apr-2005 Reid Spencer <rspencer@reidspencer.com> This is a cleanup commit:
* Correct stale documentation in a few places
* Re-order the file to better associate things and reduce line count
* Make the pass thread safe by caching the Function* objects needed by the
optimizers in the pass object instead of globally.
* Provide the SimplifyLibCalls pass object to the optimizer classes so they
can access cached Function* objects and TargetData info
* Make sure the pass resets its cache if the Module passed to runOnModule
changes
* Rename CallOptimizer LibCallOptimization. All the classes are named
*Optimization while the objects are *Optimizer.
* Don't cache Function* in the optimizer objects because they could be used
by multiple PassManager's running in multiple threads
* Add an optimization for strcpy which is similar to strcat
* Add a "TODO" list at the end of the file for ideas on additional libcall
optimizations that could be added (get ideas from other compilers).

Sorry for the huge diff. Its mostly reorganization of code. That won't
happen again as I believe the design and infrastructure for this pass is
now done or close to it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21589 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
d651f441ae4c5a9e2c77a9a38604f83d0d4261ea 27-Apr-2005 Chris Lattner <sabre@nondot.org> detect functions that never return, and turn the instruction following a
call to them into an 'unreachable' instruction.

This triggers a bunch of times, particularly on gcc:

gzip: 36
gcc: 601
eon: 12
bzip: 38


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21587 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
026a87a8680aa639ba9c7db17624fd801635c0db 27-Apr-2005 Reid Spencer <rspencer@reidspencer.com> Prefix the debug statistics so they group together.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21583 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
1ea099c5fde3405e3069d90d0afc92e087fc0316 27-Apr-2005 Reid Spencer <rspencer@reidspencer.com> In debug builds, make a statistic for each kind of call optimization. This
helps track down what gets triggered in the pass so its easier to identify
good test cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21582 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
bc9fa589efdfba8c86a8dee4f8e92b79025a7419 27-Apr-2005 Chris Lattner <sabre@nondot.org> This analysis doesn't take 'throwing' into consideration, it looks at
'unwinding'


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21581 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
0ddf0d6becf73eabd342ce2d3793ed28950514db 27-Apr-2005 Reid Spencer <rspencer@reidspencer.com> Fix up the debug statement to actually use a newline .. radical concept.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21580 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
ef99ea318e8299d4ed7a631ba82a65a2c9483025 27-Apr-2005 Reid Spencer <rspencer@reidspencer.com> Uh, this isn't argpromotion.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21579 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
8f132618639eb2f53229018d5b7eafb9f2123d06 27-Apr-2005 Reid Spencer <rspencer@reidspencer.com> Add some debugging output so we can tell which calls are getting triggered


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21578 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
47a3785062cfc336e31d84b293c752f01d166d92 27-Apr-2005 Reid Spencer <rspencer@reidspencer.com> No, seriously folks, memcpy really does return void.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21575 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
a525f6d8f556a05cc453621adc8e0bd785c30123 27-Apr-2005 Reid Spencer <rspencer@reidspencer.com> memcpy returns void!!!!!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21574 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
43fd4d077f22e6b71a8a96c6662c9a15dab0f330 26-Apr-2005 Reid Spencer <rspencer@reidspencer.com> Fix some bugs found by running on llvm-test:
* MemCpyOptimization can only be optimized if the 3rd and 4th arguments are
constants and we weren't checking for that.
* The result of llvm.memcpy (and llvm.memmove) is void* not sbyte*, put in
a cast.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21570 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
fcbdb9c85bd94b1603446fef15cf08e51c842d68 26-Apr-2005 Reid Spencer <rspencer@reidspencer.com> Changes From Review Feedback:
* Have the SimplifyLibCalls pass acquire the TargetData and pass it down to
the optimization classes so they can use it to make better choices for
the signatures of functions, etc.
* Rearrange the code a little so the utility functions are closer to their
usage and keep the core of the pass near the top of the files.
* Adjust the StrLen pass to get/use the correct prototype depending on the
TargetData::getIntPtrType() result. The result of strlen is size_t which
could be either uint or ulong depending on the platform.
* Clean up some coding nits (cast vs. dyn_cast, remove redundant items from
a switch, etc.)
* Implement the MemMoveOptimization as a twin of MemCpyOptimization (they
only differ in name).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21569 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
20754ac069f19dca5837fc43c0488a4dae224f7b 26-Apr-2005 Reid Spencer <rspencer@reidspencer.com> * Merge get_GVInitializer and getCharArrayLength into a single function
named getConstantStringLength. This is the common part of StrCpy and
StrLen optimizations and probably several others, yet to be written. It
performs all the validity checks for looking at constant arrays that are
supposed to be null-terminated strings and then computes the actual
length of the string.
* Implement the MemCpyOptimization class. This just turns memcpy of 1, 2, 4
and 8 byte data blocks that are properly aligned on those boundaries into
a load and a store. Much more could be done here but alignment
restrictions and lack of knowledge of the target instruction set prevent
use from doing significantly more. That will have to be delegated to the
code generators as they lower llvm.memcpy calls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21562 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
912401c3f61a2523b7b6ba1722d115677aedb8d9 26-Apr-2005 Reid Spencer <rspencer@reidspencer.com> * Implement StrLenOptimization
* Factor out commonalities between StrLenOptimization and StrCatOptimization
* Make sure that signatures return sbyte* not void*


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21559 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
43e0baece37f87c4aa5e658c9dbc61edf0c5e779 26-Apr-2005 Reid Spencer <rspencer@reidspencer.com> Incorporate feedback from Chris:
* Change signatures of OptimizeCall and ValidateCalledFunction so they are
non-const, allowing the optimization object to be modified. This is in
support of caching things used across multiple calls.
* Provide two functions for constructing and caching function types
* Modify the StrCatOptimization to cache Function objects for strlen and
llvm.memcpy so it doesn't regenerate them on each call site. Make sure
these are invalidated each time we start the pass.
* Handle both a GEP Instruction and a GEP ConstantExpr
* Add additional checks to make sure we really are dealing with an arary of
sbyte and that all the element initializers are ConstantInt or
ConstantExpr that reduce to ConstantInt.
* Make sure the GlobalVariable is constant!
* Don't use ConstantArray::getString as it can fail and it doesn't give us
the right thing. We must check for null bytes in the middle of the array.
* Use llvm.memcpy instead of memcpy so we can factor alignment into it.
* Don't use void* types in signatures, replace with sbyte* instead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21555 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
855adb1ac449d6a8c5d686a21953e0a4f6279ddc 25-Apr-2005 Reid Spencer <rspencer@reidspencer.com> Changes due to code review and new implementation:
* Don't use std::string for the function names, const char* will suffice
* Allow each CallOptimizer to validate the function signature before
doing anything
* Repeatedly loop over the functions until an iteration produces
no more optimizations. This allows one optimization to insert a
call that is optimized by another optimization.
* Implement the ConstantArray portion of the StrCatOptimization
* Provide a template for the MemCpyOptimization
* Make ExitInMainOptimization split the block, not delete everything
after the return instruction.
(This covers revision 1.3 and 1.4, as the 1.3 comments were botched)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21548 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
6cc0311c6d013ac5d7602be87ccd4c48b9d8fafc 25-Apr-2005 Reid Spencer <rspencer@reidspencer.com> Lots of changes based on review and new functionality:
* Use a 


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21546 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
b7c11e3966abbad0cf005ca87bcee46aafe48bed 25-Apr-2005 Reid Spencer <rspencer@reidspencer.com> Post-Review Cleanup:
* Fix comments at top of file
* Change algorithm for running the call optimizations from n*n to something
closer to n.
* Use a hash_map to store and lookup the optimizations since there will
eventually (or potentially) be a large number of them. This gets lookup
based on the name of the function to O(1). Each CallOptimizer now has a
std::string member named func_name that tracks the name of the function
that it applies to. It is this string that is entered into the hash_map
for fast comparison against the function names encountered in the module.
* Cleanup some style issues pertaining to iterator invalidation
* Don't pass the Function pointer to the OptimizeCall function because if
the optimization needs it, it can get it from the CallInst passed in.
* Add the skeleton for a new CallOptimizer, StrCatOptimizer which will
eventually replace strcat's of constant strings with direct copies.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21526 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.cpp
a7c049bf6a7b5c7982ff87e9ff72bec02c733ebf 25-Apr-2005 Reid Spencer <rspencer@reidspencer.com> A new pass to provide specific optimizations for certain well-known library
calls. The pass visits all external functions in the module and determines
if such function calls can be optimized. The optimizations are specific to
the library calls involved. This initial version only optimizes calls to
exit(3) when they occur in main(): it changes them to ret instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21522 91177308-0d34-0410-b5e6-96231b3b80d8
implifyLibCalls.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
rgumentPromotion.cpp
onstantMerge.cpp
eadArgumentElimination.cpp
eadTypeElimination.cpp
xtractFunction.cpp
unctionResolution.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
nlineSimple.cpp
nliner.cpp
nliner.h
nternalize.cpp
oopExtractor.cpp
owerSetJmp.cpp
runeEH.cpp
aiseAllocations.cpp
tripSymbols.cpp
cb2d1a2dc29f32a30a64cad048127c1077a83099 21-Apr-2005 Chris Lattner <sabre@nondot.org> Fix a bug where we would not promote calls to invokes if they occured in
the same block as the setjmp. Thanks to Greg Pettyjohn for noticing this!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21403 91177308-0d34-0410-b5e6-96231b3b80d8
owerSetJmp.cpp
feb15508249fd47694fe68027f39f7494053e884 15-Mar-2005 Chris Lattner <sabre@nondot.org> stop using method.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20603 91177308-0d34-0410-b5e6-96231b3b80d8
xtractFunction.cpp
e4d5c441e04bdc00ccf1804744af670655123b07 15-Mar-2005 Chris Lattner <sabre@nondot.org> This mega patch converts us from using Function::a{iterator|begin|end} to
using Function::arg_{iterator|begin|end}. Likewise Module::g* -> Module::global_*.

This patch is contributed by Gabor Greif, thanks!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20597 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
onstantMerge.cpp
eadArgumentElimination.cpp
xtractFunction.cpp
unctionResolution.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
nlineSimple.cpp
nternalize.cpp
tripSymbols.cpp
82aa566795fbcb42b6d606732a395595b54c0486 06-Mar-2005 Chris Lattner <sabre@nondot.org> Make this MUCH faster by avoiding a linear search in the symbol table code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20479 91177308-0d34-0410-b5e6-96231b3b80d8
eadTypeElimination.cpp
35c81b0b120f87373584f2e238e4d77f9d2ae88f 27-Feb-2005 Chris Lattner <sabre@nondot.org> Teach globalopt how memset/cpy/move affect memory, to allow better optimization.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20352 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
da895d63377b421dc50117befb2bec80d2973526 27-Feb-2005 Chris Lattner <sabre@nondot.org> Fix spelling, patch contributed by Gabor Greif!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20343 91177308-0d34-0410-b5e6-96231b3b80d8
aiseAllocations.cpp
1f21ef1511ce003fc177121b980e783b83992f82 23-Feb-2005 Chris Lattner <sabre@nondot.org> make this more efficient. Scan up to 16 nodes, not the whole list.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20289 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
f64ea9d1221f52c47fed2ea86a74946c05f224ad 10-Feb-2005 Alkis Evlogimenos <alkis@evlogimenos.com> Localize globals if they are only used in main(). This replaces the
global with an alloca, which eventually gets promoted into a
register. This enables a lot of other optimizations later on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20109 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
d514d8294d13e6a695ed324b415d3a9263313355 01-Feb-2005 Chris Lattner <sabre@nondot.org> Adjust to changes in APIs


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19958 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
lobalOpt.cpp
667fdaef9f83b4cd957dda65c1d65113c7863ee3 29-Jan-2005 Chris Lattner <sabre@nondot.org> Switchinst takes a hint for the number of cases it will have.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19899 91177308-0d34-0410-b5e6-96231b3b80d8
owerSetJmp.cpp
ecc1cef8bfd07575ba4026780adf7054c771e12e 10-Jan-2005 Jeff Cohen <jeffc@jolt-lang.org> Apply feedback from Chris.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19432 91177308-0d34-0410-b5e6-96231b3b80d8
oopExtractor.cpp
4d0801b243ebb05954ec2173b45ed9f892ef961a 08-Jan-2005 Chris Lattner <sabre@nondot.org> Fix VS warnings.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19382 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
lobalOpt.cpp
bf65268def058af3e1d35aba233d5f0fd5a80fce 08-Jan-2005 Jeff Cohen <jeffc@jolt-lang.org> Add more missing createXxxPass functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@19370 91177308-0d34-0410-b5e6-96231b3b80d8
oopExtractor.cpp
38c2556d0c02f7aca08732225ae1c97975f55aa0 12-Dec-2004 Chris Lattner <sabre@nondot.org> Properly implement copying of a global, fixing the 255.vortex & povray
failures from last night.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18832 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
077f1a82923fee977569df5f2bd4ba914e6ee22e 12-Dec-2004 Chris Lattner <sabre@nondot.org> Though the previous xform applies to literally dozens (hundreds?) of variables
in SPEC, the subsequent optimziations that we are after don't play with
with FP values, so disable this xform for them. Really we just don't want
stuff like:

double G; (always 0 or 412312.312)
= G;

turning into:

bool G_b;
= G_b ? 412312.312 : 0;

We'd rather just do the load.

-Chris


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18819 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
96a86b2993c03be1de934b2c4e10ed08dbacfe0a 12-Dec-2004 Chris Lattner <sabre@nondot.org> If a variable can only hold two values, and is not already a bool, shrink it
down to actually BE a bool. This allows simple value range propagation
stuff work harder, deleting comparisons in bzip2 in some hot loops.

This implements GlobalOpt/integer-bool.ll, which is the essence of the
loop condition distilled into a testcase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18817 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
2ffa47b6bf5e98f887a45fd3a51452d4f3b67c2d 11-Dec-2004 Chris Lattner <sabre@nondot.org> Only cound if we actually made a change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18800 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
dd0ecf67316d68940fda2733faacf73b8bd22ec6 03-Dec-2004 Chris Lattner <sabre@nondot.org> Implement stripping of debug symbols, making the --strip-debug options in
gccas/gccld more than just a noop.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18456 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
e3ad43c828280cf11e8631f1a814a51a0b168016 02-Dec-2004 Chris Lattner <sabre@nondot.org> Initial reimplementation of the -strip pass, with a stub for implementing
-S


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18440 91177308-0d34-0410-b5e6-96231b3b80d8
tripSymbols.cpp
fa07e4fc302b1e274c292c2db4604e61d69458d5 02-Dec-2004 Chris Lattner <sabre@nondot.org> Implement a FIXME by checking to make sure that a malloc is not being used
in scary and unknown ways before we promote it. This fixes the miscompilation
of 188.ammp that has been plauging us since a globalopt patch went in.

Thanks a ton to Tanya for helping me diagnose the problem!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18418 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
bc965b97ade56092b5fe4251eb68695271f1d82a 02-Dec-2004 Chris Lattner <sabre@nondot.org> Fix a minor bug where we set a var to initialized on malloc, not on store.

This doesn't fix anything that I'm aware of, just noticed it by inspection


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18417 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
8db93f18cc0ff019c04066478b92ed9aeec9b235 22-Nov-2004 Chris Lattner <sabre@nondot.org> Ignore debugger intrinsics when doing inlining size computations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@18109 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
bd38edfe236944ebecbbf84ef9ea75d5412737b5 14-Nov-2004 Chris Lattner <sabre@nondot.org> If a global is just loaded and restored, realize that it is not changing
value. This allows us to turn more globals into constants and eliminate them.
This patch implements GlobalOpt/load-store-global.llx.

Note that this patch speeds up 255.vortex from:

Output/255.vortex.out-cbe.time:program 7.640000
Output/255.vortex.out-llc.time:program 9.810000

to:

Output/255.vortex.out-cbe.time:program 7.250000
Output/255.vortex.out-llc.time:program 9.490000

Which isn't bad at all!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17746 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
6739eae7ea45672a82029ac0a907c97ec1fe6dc5 14-Nov-2004 Chris Lattner <sabre@nondot.org> Remove note to self


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17734 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
a990d94330141404158a2ae6ba25661be4468b25 14-Nov-2004 Chris Lattner <sabre@nondot.org> If a function always returns a constant, replace all calls sites with that
constant value. This makes the return value dead and allows for
simplification in the caller.

This implements IPConstantProp/return-constant.ll

This triggers several dozen times throughout SPEC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17730 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
4c989b6bd7f3ccaedd522a6a53a49ea7e170e75e 14-Nov-2004 Chris Lattner <sabre@nondot.org> Remove debugging code


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17719 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
11a3d7b7ddd10659b72ed248d878fa0d90ddcb45 14-Nov-2004 Chris Lattner <sabre@nondot.org> Argument promotion transforms functions to unconditionally load their
argument pointers. This is only valid to do if the function already
unconditionally loaded an argument or if the pointer passed in is known
to be valid. Make sure to do the required checks.

This fixed ArgumentPromotion/control-flow.ll and the Burg program.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17718 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
d79c7b43f4afeb2bb81128e7acf079ea9912a561 11-Nov-2004 Chris Lattner <sabre@nondot.org> Actually, leave the check in. This prevents us from counting dead arguments
as IPCP opportunities.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17680 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
3e062eacab10938825b92ffdfa5bf3d9cf228c36 11-Nov-2004 Chris Lattner <sabre@nondot.org> Fix bug: IPConstantProp/deadarg.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17679 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
ff1529b6cf3b4babad13a39587a20f41b4b46577 10-Nov-2004 Chris Lattner <sabre@nondot.org> Make IP Constant prop more aggressive about handling self recursive calls.
This implements IPConstantProp/recursion.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17666 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
c890bfe1da56e3740d633559f3ea9bd33ee6d2f7 09-Nov-2004 Chris Lattner <sabre@nondot.org> Do not let dead constant expressions hanging off of functions prevent IPCP.
This allows to elimination of a bunch of global pool descriptor args from
programs being pool allocated (and is also generally useful!)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17657 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
a8e475093af462787cfdc7d7ff1413d0f058dae8 09-Nov-2004 Chris Lattner <sabre@nondot.org> Change this back so that I get stable numbers to reflect the change from the
nightly testers


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17646 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
52f20f83082ec92d536f2dcc4234f35638aea6f9 09-Nov-2004 Chris Lattner <sabre@nondot.org> Fix bug: 2004-11-08-FreeUseCrash.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17642 91177308-0d34-0410-b5e6-96231b3b80d8
aiseAllocations.cpp
ae18963a70b45086f351a10641f2ca756063eeaf 07-Nov-2004 Chris Lattner <sabre@nondot.org> VERY large functions that are only called from one place are not really
exciting to inline. Only inline medium or small sized functions with a
single call site.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17588 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
6cb21d443eff9369e4f9035af28efd627e8f3909 28-Oct-2004 Reid Spencer <rspencer@reidspencer.com> Change Library Names Not To Conflict With Others When Installed


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17286 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
e9ece2a7462c29f2c57c0b0e063f950514f41ab4 22-Oct-2004 Chris Lattner <sabre@nondot.org> *** empty log message ***


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17161 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
cac731ecbe6a80e0c607ece2833525a92601db99 22-Oct-2004 Reid Spencer <rspencer@reidspencer.com> We won't use automake


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17155 91177308-0d34-0410-b5e6-96231b3b80d8
akefile.am
akefile.in
86d341b204171d53a470c361ee58811bfc22bf1a 19-Oct-2004 Reid Spencer <rspencer@reidspencer.com> Initial automake generated Makefile template


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17136 91177308-0d34-0410-b5e6-96231b3b80d8
akefile.in
f26801b0e6ab958001f796fd42367e93e9feb96e 18-Oct-2004 Chris Lattner <sabre@nondot.org> Get this file compiling with VC++, patch contributed by Morten Ofstad. Thanks Morten!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17125 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
7a7ed0274d01efb2e12a32fd5fee6aa9596b0b9a 16-Oct-2004 Chris Lattner <sabre@nondot.org> Add support for the undef value. Implement a new optimization based on globals
that are initialized with undef. When promoting malloc to a global, start out
initialized to undef


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17042 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
b23cd2f6887d2d6333bc596d88eb93aa2e2a04e4 14-Oct-2004 Chris Lattner <sabre@nondot.org> Fix a bug John tracked down in libstdc++ where we were incorrectly deleting
weak functions. Thanks for finding this John!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16997 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
d96cb6eaa0a878467d9594a12dfe3a55466706f0 13-Oct-2004 Reid Spencer <rspencer@reidspencer.com> Update to reflect changes in Makefile rules.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16950 91177308-0d34-0410-b5e6-96231b3b80d8
akefile.am
30ba5690cf7a6f4db8913463d03f239f82d17440 11-Oct-2004 Chris Lattner <sabre@nondot.org> This patch implements two things (sorry).

First, it allows SRA of globals that have embedded arrays, implementing
GlobalOpt/globalsra-partial.llx. This comes up infrequently, but does allow,
for example, deleting several stores to dead parts of globals in dhrystone.

Second, this implements GlobalOpt/malloc-promote-*.llx, which is the
following nifty transformation:

Basically if a global pointer is initialized with malloc, and we can tell
that the program won't notice, we transform this:

struct foo *FooPtr;
...
FooPtr = malloc(sizeof(struct foo));
...
FooPtr->A FooPtr->B

Into:

struct foo FooPtrBody;
...
FooPtrBody.A FooPtrBody.B

This comes up occasionally, for example, the 'disp' global in 183.equake (where
the xform speeds the CBE version of the program up from 56.16s to 52.40s (7%)
on apoc), and the 'desired_accept', 'fixLRBT', 'macroArray', & 'key_queue'
globals in 300.twolf (speeding it up from 22.29s to 21.55s (3.4%)).

The nice thing about this xform is that it exposes the resulting global to
global variable optimization and makes alias analysis easier in addition to
eliminating a few loads.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16916 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
708148e41f8f7c1e24c73cfd943645b13a1e05f9 11-Oct-2004 Chris Lattner <sabre@nondot.org> Just because we cannot completely eliminate all uses of a global, we can
still optimize away all of the indirect calls and loads, etc from it.
This turns code like this:

if (G != 0)
G();

into
if (G != 0)
ActualCallee();

This triggers a couple of times in gcc and libstdc++.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16901 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
81f76b324e0b22731d06ed34641032de983428b1 11-Oct-2004 Reid Spencer <rspencer@reidspencer.com> Initial version of automake Makefile.am file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16893 91177308-0d34-0410-b5e6-96231b3b80d8
akefile.am
8be8012ba493f1b17967c4ad7863c5709bf34a75 10-Oct-2004 Chris Lattner <sabre@nondot.org> Fix 2004-10-10-CastStoreOnce.llx, by adjusting types back if we strip off a cast


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16878 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
c4d81b0388dff9f38e1387bb223cc7b514c06d01 10-Oct-2004 Chris Lattner <sabre@nondot.org> Implement GlobalOpt/deadglobal-2.llx, deletion of globals that are only
stored to, but are stored at variable indexes. This occurs at least in
176.gcc, but probably others, and we should handle it for completeness.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16876 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
031955d4623193b1c4163bd43db0eaaf6b08c27b 10-Oct-2004 Chris Lattner <sabre@nondot.org> Avoid calling use_size() which could (in theory) be expensive if the global
has a large number of users. Instead, just keep track of whether we're
making changes as we do so.

This patch has no functionlity changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16874 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
9b34a6101908c36df659fe0b188713c949a32304 09-Oct-2004 Chris Lattner <sabre@nondot.org> Eliminate global pointers that are only stored a single value and null if
we know that all uses of the global will trap if the pointer contained is
null. In this case, we forward substitute the stored value to any uses.

This has the effect of devirtualizing trivial globals in trivial cases. For
example, 164.gzip contains this:

gzip.h:extern int (*read_buf) OF((char *buf, unsigned size));
bits.c: read_buf = file_read;
deflate.c: lookahead = read_buf((char*)window,
deflate.c: n = read_buf((char*)window+strstart+lookahead, more);

Since read_buf has to point to file_read at every use, we just replace
the calls through read_buf with a direct call to file_read.

This occurs in several benchmarks, including 176.gcc and 164.gzip. Direct
calls are good and stuff.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16871 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
930f475604bcd8835197df0dac0c63235f8f1bb3 09-Oct-2004 Chris Lattner <sabre@nondot.org> Fix infinite loop due to iteration


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16864 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
8f57e9c083b1e1aa9677e83284969ab65b975821 09-Oct-2004 Chris Lattner <sabre@nondot.org> If we found a dead global, we should at least delete it...


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16858 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
a4be1dc0a192175bbc561a633c0b7197853e6a74 08-Oct-2004 Chris Lattner <sabre@nondot.org> * Pull out the meat of runOnModule into another function for clarity.
* Do not lead dangling dead constants prevent optimization
* Iterate global optimization while we're making progress.

These changes allow us to be more aggressive, handling cases like
GlobalOpt/iterate.llx without a problem (turning it into 'ret int 0').


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16857 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
e40e2d1a71777289a8bfb9d77452754478722e55 08-Oct-2004 Chris Lattner <sabre@nondot.org> We might as well delete the known-dead global sooner rather than later since
we know it is dead.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16855 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
670c889ac90e79fc6b1f9f18e78e536562d86f87 08-Oct-2004 Chris Lattner <sabre@nondot.org> Implement SRA for global variables. This allows the other global variable
optimizations to trigger much more often. This allows the elimination of
several dozen more global variables in Programs/External. Note that we only
do this for non-constant globals: constant globals will already be optimized
out if the accesses to them permit it.

This implements Transforms/GlobalOpt/globalsra.llx


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16842 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
cf4d2a569972b5b4f0978e88fa775870dabcfed0 07-Oct-2004 Chris Lattner <sabre@nondot.org> Improve comments, no functionality changes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16814 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
3602549c3dbce144bdfc5b0db784c60880a3062f 07-Oct-2004 Chris Lattner <sabre@nondot.org> Fix a bug in the safety analysis routine


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16804 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
bc53e5e628940153d015cf46ac45fb7cfcb39c4f 07-Oct-2004 Chris Lattner <sabre@nondot.org> Comment cleanups


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16803 91177308-0d34-0410-b5e6-96231b3b80d8
owerSetJmp.cpp
7a90b68e5c85fe11a4ccc386be9c5fcddd4a8b61 07-Oct-2004 Chris Lattner <sabre@nondot.org> * Rename pass to globalopt, since we do more than just constify
* Instead of handling dead functions specially, just nuke them.
* Be more aggressive about cleaning up after constification, in
particular, handle getelementptr instructions and constantexprs.
* Be a little bit more structured about how we process globals.

*** Delete globals that are only stored to, and never read. These are
clearly not useful, so they should go. This implements deadglobal.llx

This last one triggers quite a few times. In particular, 2208 in the
external tests, 1865 of which are in 252.eon. This shrinks eon from
1995094 to 1732341 bytes of bytecode.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16802 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
e47ba74b07b2a6015239bcbabba09750580aeced 06-Oct-2004 Chris Lattner <sabre@nondot.org> Implement GlobalConstifier/trivialstore.llx, and also do some
simplifications of the resultant program to avoid making later passes
do it all.

This allows us to constify globals that just have the same constant that
they are initialized stored into them.

Suprisingly this comes up ALL of the freaking time, dozens of times in
SPEC, 30 times in vortex alone.

For example, on 256.bzip2, it allows us to constify these two globals:

%smallMode = internal global ubyte 0 ; <ubyte*> [#uses=8]
%verbosity = internal global int 0 ; <int*> [#uses=49]

Which (with later optimizations) results in the bytecode file shrinking
from 82286 to 69686 bytes! Lets hear it for IPO :)

For the record, it's nuking lots of "if (verbosity > 2) { do lots of stuff }"
code.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16793 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
23367a779cc59e87d38628d8195f6214f4aa8af8 30-Sep-2004 Chris Lattner <sabre@nondot.org> Disable the 'WARNING: Found global types that are not compatible' warning
that always prints when linking programs to libstdc++ :(


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16603 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
b12914bfc0f76a7a48357162d5f4c39a1343e69b 20-Sep-2004 Chris Lattner <sabre@nondot.org> 'Pass' should now not be derived from by clients. Instead, they should derive
from ModulePass. Instead of implementing Pass::run, then should implement
ModulePass::runOnModule.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16436 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
onstantMerge.cpp
eadArgumentElimination.cpp
eadTypeElimination.cpp
xtractFunction.cpp
unctionResolution.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
nlineSimple.cpp
nternalize.cpp
oopExtractor.cpp
owerSetJmp.cpp
runeEH.cpp
aiseAllocations.cpp
f5afcabff887c2e9023f0c69c44f1de15b5c4347 19-Sep-2004 Chris Lattner <sabre@nondot.org> Add comment


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16400 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
0c0aa711b8a0550c21f032125c4663ff45864f81 18-Sep-2004 Chris Lattner <sabre@nondot.org> Fix the inliner to always delete any edges from the external call node to
a function being deleted. Due to optimizations done while inlining, there
can be edges from the external call node to a function node that were not
apparent any longer.

This fixes the compiler crash while compiling 175.vpr


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16399 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
5eb6f6c829ddfe353f94623aa1009c72be930497 18-Sep-2004 Chris Lattner <sabre@nondot.org> Convert this pass to be a CallGraphSCCPass instead of a Pass, which eliminates
the worklist and makes it more efficient. This does not change functionality
at all.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16390 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
ebeb0cba94e41b60f2095d4e7f09989f16233da4 17-Sep-2004 Chris Lattner <sabre@nondot.org> Fix typo in comment


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@16384 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.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
rgumentPromotion.cpp
onstantMerge.cpp
eadArgumentElimination.cpp
eadTypeElimination.cpp
unctionResolution.cpp
lobalDCE.cpp
lobalOpt.cpp
PConstantPropagation.cpp
nliner.cpp
nternalize.cpp
oopExtractor.cpp
owerSetJmp.cpp
runeEH.cpp
aiseAllocations.cpp
4e4c444d5c9d83992dafa7f3e40901567f90b754 20-Aug-2004 Chris Lattner <sabre@nondot.org> If we are linking two global variables and they have the same size, do not
spew warnings, even if the types don't match.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15933 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
77a2a9d9dae5dbe551cec102e37ea02f45da44ed 14-Aug-2004 Chris Lattner <sabre@nondot.org> Implement test/Regression/Transforms/GlobalConstifier/phi-select.llx
This allows more globals to be marked constant, particularly global arrays.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15735 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
8528672e7eef90086726bbf69568f74defb6fae2 13-Aug-2004 Chris Lattner <sabre@nondot.org> "extract" the block extractor pass from bugpoint (haha)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15714 91177308-0d34-0410-b5e6-96231b3b80d8
oopExtractor.cpp
ee45f4cbe409b2e89207f3c554e9121101c9e52e 12-Aug-2004 Chris Lattner <sabre@nondot.org> This patch makes the inliner refuse to inline functions that have alloca
instructions in the body of the function (not the entry block). This fixes
test/Programs/SingleSource/Regression/C/2004-08-12-InlinerAndAllocas.c
and test/Programs/External/SPEC/CINT2000/176.gcc on zion.

This should obviously be pulled into 1.3.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15684 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
54970c032815edadb1b2988ea33f5a1173e5b29c 08-Aug-2004 Chris Lattner <sabre@nondot.org> Fix another really nasty regression that Anshu pointed out. In cases where
dangling constant users were removed from a function, causing it to be dead,
we never removed the call graph edge from the external node to the function.

In most cases, this didn't cause a problem (by luck). This should definitely
go into 1.3


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15570 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
47b14a4a6a455c7be169cfd312fcbe796f0ad426 29-Jul-2004 Misha Brukman <brukman+llvm@gmail.com> Fix #includes of i*.h => Instructions.h as per PR403.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15334 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
unctionResolution.cpp
nliner.cpp
oopExtractor.cpp
runeEH.cpp
aiseAllocations.cpp
9ce300013d5c5b9e2c7e26626ddbc8f3a42bdb88 20-Jul-2004 Chris Lattner <sabre@nondot.org> Ignore instructions that are in trivially dead functions. This allows us
to constify 14 globals instead of 4 in a trivial C++ testcase.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@15027 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
8919cccc3db3290149e9b0f750f883ece3ba2bc7 18-Jul-2004 Chris Lattner <sabre@nondot.org> Fix a performance regression from the CPR patch, simplify code


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14974 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
96940cb5223d8441f3710b75063a0ee5a3c824ed 18-Jul-2004 Chris Lattner <sabre@nondot.org> Strip out and simplify some code. This also fixes the regression last
night compiling cfrac. It did not realize that code like this:

int G; int *H = &G;

takes the address of G.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14973 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
3188cab9898d30f14bf240a6f9a71754d25c2c4d 18-Jul-2004 Reid Spencer <rspencer@reidspencer.com> Avoid an unnecessary isa<Constant>.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14963 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
25c6d68029dc0e45dce5f6aa08c5e868b8a923fa 18-Jul-2004 Chris Lattner <sabre@nondot.org> Remove useless statistic, fix some slightly broken logic


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14958 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
5827aebe64e442241fd16ef7006433251d060738 18-Jul-2004 Chris Lattner <sabre@nondot.org> Fix a rather serious bug in previous checkin


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14957 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
518310cb0d136906ff0a99d7a24cb460794de5bf 18-Jul-2004 Reid Spencer <rspencer@reidspencer.com> bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14953 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
lobalOpt.cpp
nliner.cpp
aiseAllocations.cpp
460f16c6253928519689e882a4dbb7f236f33294 18-Jul-2004 Reid Spencer <rspencer@reidspencer.com> bug 122:
- Minimize redundant isa<GlobalValue> usage


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14948 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
nlineSimple.cpp
0c4a0418d3f73ec373977b28e06920b5046f2727 18-Jul-2004 Reid Spencer <rspencer@reidspencer.com> bug 122:
- Replace ConstantPointerRef usage with GlobalValue usage
- Rename methods to get ride of ConstantPointerRef usage


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14945 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
317815891826673a117554c7b5bf1431c253c4e7 18-Jul-2004 Reid Spencer <rspencer@reidspencer.com> bug 122:
- Excise dead CPR procesing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14944 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
fdd9f1facc941a918b3c9ffef5c01e75faeeee4c 28-Jun-2004 Chris Lattner <sabre@nondot.org> Remove unused file


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14460 91177308-0d34-0410-b5e6-96231b3b80d8
utateStructTypes.cpp
65f437ce7b477b19f2d54fee1f95100de75a628d 28-Jun-2004 Chris Lattner <sabre@nondot.org> These passes are long dead/obsolete. They never worked in the first place
and are a maintenence burden. Nuke nuke nuke


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14457 91177308-0d34-0410-b5e6-96231b3b80d8
impleStructMutation.cpp
e5d6dab09e7e1dfaba1a8c51aff9bfbc1fdbffc0 22-Jun-2004 Misha Brukman <brukman+llvm@gmail.com> File depends on DSA, moved to lib/Analysis/DataStructure


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14325 91177308-0d34-0410-b5e6-96231b3b80d8
arallelize.cpp
beabf45a6923b1748edae40d53e2b2c4362cc32f 21-Jun-2004 Chris Lattner <sabre@nondot.org> Make order of argument addition deterministic. In particular, the layout
of ConstantInt objects in memory used to determine which order arguments
were added in in some cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14276 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
cf5933a716e7eb6bd5ff49aa62f3e76379ebaf51 20-Jun-2004 Chris Lattner <sabre@nondot.org> Fix the inliner to be deterministic, not letting its output depend on the
relative location of Function objects in memory.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14260 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
e5ad50b2e8ee0fae2e1078276a7e2f3a306f66de 18-Jun-2004 Chris Lattner <sabre@nondot.org> Do not function resolve intrinsics. This prevents warnings and possible bad
things from happening due to

declare bool %llvm.isunordered(double, double)
declare bool %llvm.isunordered(float, float)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14219 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
f70c22b019494723d0e706f93d6542dfaa6e73a5 17-Jun-2004 Chris Lattner <sabre@nondot.org> Rename Type::PrimitiveID to TypeId and ::getPrimitiveID() to ::getTypeID()


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@14201 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
utateStructTypes.cpp
e7b9a1a5f2eeb370e4c642743ffb64230a05c56c 27-May-2004 John Criswell <criswell@uiuc.edu> Fix a bug in the -deadtypeelim pass. The SymbolTable re-write changed it
to eliminate the wrong type.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13855 91177308-0d34-0410-b5e6-96231b3b80d8
eadTypeElimination.cpp
9231ac8b6f2c3f9877bdb7a223f7392061258ab6 25-May-2004 Reid Spencer <rspencer@reidspencer.com> Convert to SymbolTable's new iteration interface.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13754 91177308-0d34-0410-b5e6-96231b3b80d8
eadTypeElimination.cpp
utateStructTypes.cpp
b11a99bd39ec12733527bde330302b435b8d9f1a 24-May-2004 Chris Lattner <sabre@nondot.org> Fix a bug in my previous checkin


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13717 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
befa499d45ffcc32bd9902518aec18589464e47c 23-May-2004 Chris Lattner <sabre@nondot.org> Fix cases where we missed inlining some more obvious candidates because the
caller was in an SCC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13693 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
74c68ffd5f865e20dc47ece8f1840f6ff3abb548 23-May-2004 Chris Lattner <sabre@nondot.org> Simplify the interface and remove an unneeded #include


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13692 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.h
9e7cc2f0d42aa4127e3b8406e25907a96ce9ada0 23-May-2004 Chris Lattner <sabre@nondot.org> Fairly substantial changes to update the alias analysis we are querying as
we make the transformation. This allows us to use interprocedural alias
analyses successfully.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13691 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
7d248397a738c31bbe6e22bfe93a17cc560efdf7 23-Apr-2004 Misha Brukman <brukman+llvm@gmail.com> Clarify the logic: the flag is renamed to `deleteFn' to signify it will delete
the function instead of isolating it. This also means the condition is reversed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13112 91177308-0d34-0410-b5e6-96231b3b80d8
xtractFunction.cpp
79906c9825d4ff18e3f1fff54eef8162257b72a9 23-Apr-2004 Misha Brukman <brukman+llvm@gmail.com> Add a flag to choose between isolating a function or deleting the function from
the Module. The default behavior keeps functionality as before: the chosen
function is the one that remains.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13111 91177308-0d34-0410-b5e6-96231b3b80d8
xtractFunction.cpp
3e1358a9fa1ebd3f51c94eb69da55d693895fe7c 21-Apr-2004 Chris Lattner <sabre@nondot.org> Fix an incredibly nasty iterator invalidation problem. I am too spoiled by ilists :)
Eventually it would be nice if CallGraph maintained an ilist of CallGraphNode's instead
of a vector of pointers to them, but today is not that day.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13100 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
107fb18d8968064667b187c3f65ff0558ee130e1 21-Apr-2004 Chris Lattner <sabre@nondot.org> Fix typeo


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13089 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
68d57e7ae80044401efd889270a12c71b3efb9ab 21-Apr-2004 Chris Lattner <sabre@nondot.org> REALLY fix PR324: don't delete linkonce functions until after the SCC traversal
is done, which avoids invalidating iterators in the SCC traversal routines


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13088 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
nliner.h
5ad2b1d54424f39390250d2ff11cc29312926efc 20-Apr-2004 Chris Lattner <sabre@nondot.org> Fix PR324 and testcase: Inline/2004-04-20-InlineLinkOnce.llx


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13080 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
f1ab4b4eac5603d19c20f4a508f93a118a52bdd5 19-Apr-2004 Chris Lattner <sabre@nondot.org> Change the ExitBlocks list from being explicitly contained in the Loop
structure to being dynamically computed on demand. This makes updating
loop information MUCH easier.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@13045 91177308-0d34-0410-b5e6-96231b3b80d8
oopExtractor.cpp
ce1a3a292d7696c973efe27809384d33a530dd65 12-Apr-2004 Chris Lattner <sabre@nondot.org> Actually update the call graph as the inliner changes it. This allows us to
execute other CallGraphSCCPasses after the inliner without crashing.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12861 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
85eb157d966c6015262ec0d7f0353c7f416dee7b 12-Apr-2004 Chris Lattner <sabre@nondot.org> Stop printing Function*


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12857 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
d08ddd3300d5244012c1765d34b21cc9e11a80ad 12-Apr-2004 Chris Lattner <sabre@nondot.org> Simplify code a bit, and be sure to mark the external node as potentially throwing


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12856 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
775cbdd51a3b33dd5eb343689f65ab5cc8ac7118 08-Apr-2004 Chris Lattner <sabre@nondot.org> Remove the "really gross hacks" that are there to deal with recursive functions.
Now we collect all of the call sites we are interested in inlining, then inline
them. This entirely avoids issues with trying to inline a call site we got by
inlining another call site. This also eliminates iterator invalidation issues.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12770 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
nliner.cpp
nliner.h
f6e43bc7968df6794e518e964c3428fff86dc0f8 18-Mar-2004 Chris Lattner <sabre@nondot.org> Add statistics to the loop extractor. The loop extractor has successfully
extracted all 63 loops for Olden/bh without crashing and without
miscompiling the program!!!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12491 91177308-0d34-0410-b5e6-96231b3b80d8
oopExtractor.cpp
fdded9f95ae6233ec553fd54acc11f2dac1aee9d 18-Mar-2004 Chris Lattner <sabre@nondot.org> Fix problem with PHI nodes having multiple predecessors from different
exit nodes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12490 91177308-0d34-0410-b5e6-96231b3b80d8
oopExtractor.cpp
369287bab599c2c515eab4ffd8a7f3bab227d346 18-Mar-2004 Chris Lattner <sabre@nondot.org> The code extractor needs dominator info. Provide it


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12483 91177308-0d34-0410-b5e6-96231b3b80d8
oopExtractor.cpp
6dd196f762c934981ede17e197746b11426cd23a 15-Mar-2004 Chris Lattner <sabre@nondot.org> Restore old inlining heuristic. As the comment indicates, this is a nasty
horrible hack.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12423 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
5156c39d6419c891b3004da505487091c418bf63 15-Mar-2004 Chris Lattner <sabre@nondot.org> Fix several bugs in the loop extractor. In particular, subloops were never
extracted, and a function that contained a single top-level loop never had
the loop extracted, regardless of how much non-loop code there was.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12403 91177308-0d34-0410-b5e6-96231b3b80d8
oopExtractor.cpp
41bc0b069c74afa05e92a97ff2c5d3cfa7426505 14-Mar-2004 Chris Lattner <sabre@nondot.org> Split into two passes. Now there is the general loop extractor, usable on
the command line, and the single loop extractor, usable by bugpoint


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12390 91177308-0d34-0410-b5e6-96231b3b80d8
oopExtractor.cpp
97836fad2c3d705c90855bf2fbb79696c129a64f 14-Mar-2004 Chris Lattner <sabre@nondot.org> Passes don't print stuff!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12385 91177308-0d34-0410-b5e6-96231b3b80d8
oopExtractor.cpp
16d0eb04688d283dc70a8f4a9905cb19d8636cd2 14-Mar-2004 Chris Lattner <sabre@nondot.org> FunctionPass's should not define their own 'run' method.
Require 'simplified' loops, not just raw natural loops. This fixes
CodeExtractor/2004-03-13-LoopExtractorCrash.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12381 91177308-0d34-0410-b5e6-96231b3b80d8
oopExtractor.cpp
1e3cb34753a0cf6b8d99ebf3ada17c87dcebed79 14-Mar-2004 Chris Lattner <sabre@nondot.org> Move prototype to IPO.h instead of Scalar.h
Make sure that the file interface header (IPO.h) is included first
remove dead #incldue


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12375 91177308-0d34-0410-b5e6-96231b3b80d8
oopExtractor.cpp
efddcfa0df921ebca3e316120480df7df3e6e405 14-Mar-2004 Chris Lattner <sabre@nondot.org> Indent anon namespace properly, add copyright block


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12373 91177308-0d34-0410-b5e6-96231b3b80d8
oopExtractor.cpp
c3c8703c3bf0d4fff3420ee3ce00caea992a354c 14-Mar-2004 Chris Lattner <sabre@nondot.org> Move to the IPO library. Utils shouldn't contain passes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12372 91177308-0d34-0410-b5e6-96231b3b80d8
oopExtractor.cpp
a2dc727ac4d3cd6d6826140e33eb7b54f074b9d7 14-Mar-2004 Chris Lattner <sabre@nondot.org> DemoteRegToStack got moved from DemoteRegToStack.h to Local.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12368 91177308-0d34-0410-b5e6-96231b3b80d8
owerSetJmp.cpp
arallelize.cpp
619d3544b19dfdc0006bb0f036253d76488fc212 14-Mar-2004 Chris Lattner <sabre@nondot.org> This change makes two big adjustments.
* Be a lot more accurate about what the effects will be when inlining a call
to a function when an argument is an alloca.
* Dramatically reduce the penalty for inlining a call in a large function.
This heuristic made it almost impossible to inline a function into a large
function, no matter how small the callee is.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12363 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
9440db886627161a8413e823797569fc7b10beaf 08-Mar-2004 Chris Lattner <sabre@nondot.org> Implement ArgumentPromotion/aggregate-promote.ll

This allows pointers to aggregate objects, whose elements are only read, to
be promoted and passed in by element instead of by reference. This can
enable a LOT of subsequent optimizations in the caller function.

It's worth pointing out that this stuff happens a LOT of C++ programs, because
objects in templates are generally passed around by reference. When these
templates are instantiated on small aggregate or scalar types, however, it is
more efficient to pass them in by value than by reference.

This transformation triggers most on C++ codes (e.g. 334 times on eon), but
does happen on C codes as well. For example, on mesa it triggers 72 times,
and on gcc it triggers 35 times. this is amazingly good considering that
we are using 'basicaa' so far.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12202 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
86a734bd40857db9ef205234f3b58e550ee5959b 07-Mar-2004 Chris Lattner <sabre@nondot.org> Implement: ArgumentPromotion/chained.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12200 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
7db5a6df78749bf0cd37870fcefe08b8849e38e6 07-Mar-2004 Chris Lattner <sabre@nondot.org> Fix another minor bug, exposed by perlbmk


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12198 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
7e6f5090afbb5c05c8f73c836d56aadb16425bb0 07-Mar-2004 Chris Lattner <sabre@nondot.org> Fix a minor bug and turn debug output into, well, debug output.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12195 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
ed570a7dca45e001a6223e2a25d034b838934f88 07-Mar-2004 Chris Lattner <sabre@nondot.org> New LLVM pass: argument promotion. This version only handles simple scalar
variables.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12193 91177308-0d34-0410-b5e6-96231b3b80d8
rgumentPromotion.cpp
99cc88bb643e463667cc87f780457ac6627350f5 01-Mar-2004 Misha Brukman <brukman+llvm@gmail.com> * Remove function to find "main" in a Module, there's a method for that
* Removing extraneous empty space and empty comment lines


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@12014 91177308-0d34-0410-b5e6-96231b3b80d8
arallelize.cpp
7d90a2738e889efc5ff6e64c015c3b5cf5324aff 27-Feb-2004 Chris Lattner <sabre@nondot.org> setcond instructions don't have aliasing implications.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11919 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
4f77caaa3d2265d69a52bd6a4e5905504896c220 26-Feb-2004 Chris Lattner <sabre@nondot.org> Since LLVM uses structure type equivalence, it isn't useful to keep around
multiple type names for the same structural type. Make DTE eliminate all
but one of the type names


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11879 91177308-0d34-0410-b5e6-96231b3b80d8
eadTypeElimination.cpp
079236d1c9909365ffd0ef06831523c87335bb4a 25-Feb-2004 Chris Lattner <sabre@nondot.org> My faith in programmers has been found to be totally misplaced. One would
assume that if they don't intend to write to a global variable, that they
would mark it as constant. However, there are people that don't understand
that the compiler can do nice things for them if they give it the information
it needs.

This pass looks for blatently obvious globals that are only ever read from.
Though it uses a trivially simple "alias analysis" of sorts, it is still able
to do amazing things to important benchmarks. 253.perlbmk, for example,
contains several ***GIANT*** function pointer tables that are not marked
constant and should be. Marking them constant allows the optimizer to turn
a whole bunch of indirect calls into direct calls. Note that only a link-time
optimizer can do this transformation, but perlbmk does have several strings
and other minor globals that can be marked constant by this pass when run
from GCCAS.

176.gcc has a ton of strings and large tables that are marked constant, both
at compile time (38 of them) and at link time (48 more). Other benchmarks
give similar results, though it seems like big ones have disproportionally
more than small ones.

This pass is extremely quick and does good things. I'm going to enable it
in gccas & gccld. Not bad for 50 SLOC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11836 91177308-0d34-0410-b5e6-96231b3b80d8
lobalOpt.cpp
0db085baecad690efa1f4afca32b191ae8d12663 13-Feb-2004 Chris Lattner <sabre@nondot.org> Intrinsic functions cannot throw


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11383 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
68b86f4f41f7a6c1c7d13609b162f19222102257 09-Feb-2004 Chris Lattner <sabre@nondot.org> Don't depend on auto data conversion


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11229 91177308-0d34-0410-b5e6-96231b3b80d8
impleStructMutation.cpp
d21cd809b656d3011ec089536857e048e037159c 09-Feb-2004 Chris Lattner <sabre@nondot.org> Adjust to the changed StructType interface. In particular, getElementTypes() is gone.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11228 91177308-0d34-0410-b5e6-96231b3b80d8
utateStructTypes.cpp
impleStructMutation.cpp
d5d89967206e1153d24abdb7b22002f7533f55c7 09-Feb-2004 Chris Lattner <sabre@nondot.org> Start using the new and improve interface to FunctionType arguments


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11224 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
utateStructTypes.cpp
aeb2a1d70807aa626f335fb23d47bc604ffeaa15 08-Feb-2004 Chris Lattner <sabre@nondot.org> rename the "exceptional" destination of an invoke instruction to the 'unwind' dest


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11202 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
owerSetJmp.cpp
runeEH.cpp
e0def04e430d741daa48f69b05cfe132adb6db11 08-Feb-2004 Chris Lattner <sabre@nondot.org> Fix PR225: [pruneeh] -pruneeh pass removes invoke instructions it shouldn't


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11200 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
edb1cf0c19dc0d155a2c0d35c099dd63a182fcc2 08-Feb-2004 Chris Lattner <sabre@nondot.org> splitBasicBlock "does the right thing" now, no reason to reposition it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11199 91177308-0d34-0410-b5e6-96231b3b80d8
owerSetJmp.cpp
3b332fd37660a5ff91c183cb3a23e18e267b8b08 04-Feb-2004 Chris Lattner <sabre@nondot.org> Remove unneeded code now that splitBasicBlock does the "right thing"


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11111 91177308-0d34-0410-b5e6-96231b3b80d8
owerSetJmp.cpp
09ca4115ee725d2ae3b51322719fd8a43f7379c9 02-Feb-2004 Brian Gaeke <gaeke@uiuc.edu> Make deadarghaX0r warning louder.

(I just love typing haX0r. haX0r haX0r haX0r.)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@11079 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
21949d90881e89ab9c7b752f82f51577a1f0c095 09-Jan-2004 Chris Lattner <sabre@nondot.org> Remove dependence on structure index type. s/MT/FT


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10726 91177308-0d34-0410-b5e6-96231b3b80d8
utateStructTypes.cpp
0898c78a52e04f94de5576d380d73517a9ea1b05 28-Dec-2003 Chris Lattner <sabre@nondot.org> Merging constants can cause further room for improvement. Iterate until
we converge


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10618 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
b97238079d871c13e0690336329ae01cdd7c54ef 23-Dec-2003 Chris Lattner <sabre@nondot.org> Fix memory corruption bug PR193


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10586 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
eb12cd67dd5ee08a091f1381db79c8699f409232 07-Dec-2003 Chris Lattner <sabre@nondot.org> Implement RaiseAllocations/FreeCastConstantExpr.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10305 91177308-0d34-0410-b5e6-96231b3b80d8
aiseAllocations.cpp
ab25f5a6c1cbbbc68c46a519148650b5a1095000 22-Nov-2003 Chris Lattner <sabre@nondot.org> Delete dead line


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10164 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
3788c242be54c0f33adf2b17b4c83e069fe58a44 22-Nov-2003 Chris Lattner <sabre@nondot.org> Fix bug: Transforms/PruneEH/2003-11-21-PHIUpdate.llx


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10163 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
6d1db01284b08a88db975f1a97ad7f95bdd9f6e6 21-Nov-2003 Chris Lattner <sabre@nondot.org> Considering that CI is not even IN SCOPE here, I wooda thought the compiler
would have caught this. *sigh*


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10142 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
1e2385b941242f2f96398dc62767420622856149 21-Nov-2003 Chris Lattner <sabre@nondot.org> Finegrainify namespacification


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10138 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
eadArgumentElimination.cpp
eadTypeElimination.cpp
xtractFunction.cpp
lobalDCE.cpp
PConstantPropagation.cpp
nternalize.cpp
owerSetJmp.cpp
arallelize.cpp
runeEH.cpp
aiseAllocations.cpp
1192283096de782da55b3ac0a7ff15abfde8866c 21-Nov-2003 Chris Lattner <sabre@nondot.org> Get rid of using decls, finegrainify namespacification


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10137 91177308-0d34-0410-b5e6-96231b3b80d8
impleStructMutation.cpp
869adc283c0c15e46d9b18ca73628600f1c6c54e 21-Nov-2003 Chris Lattner <sabre@nondot.org> * Finegrainify namespacification
* Make the cost metric for passing constants in as arguments to functions MUCH
more accurate, by actually estimating the amount of code that will be constant
propagated away.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10136 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
a51bcb50b0c74adc741361824ef81dbefb715c53 21-Nov-2003 Chris Lattner <sabre@nondot.org> Finegrainify namespacification
Print out the costs for functions that AREN'T inlined as well


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10135 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
03fb8b2a424b11e7a035e856fce8e7c583d84863 20-Nov-2003 Chris Lattner <sabre@nondot.org> * Finegrainify namespacification
* Implement FuncResolve/2003-11-20-BogusResolveWarning.ll
... which eliminates a large number of annoying warnings. I know misha
will miss them though!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10123 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
f8485c643412dbff46fe87ea2867445169a5c28e 20-Nov-2003 Chris Lattner <sabre@nondot.org> Start using the nicer terminator auto-insertion API


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10111 91177308-0d34-0410-b5e6-96231b3b80d8
owerSetJmp.cpp
143df9a1bb1d9b0d68959dfcd45e1cad3a37f66c 20-Nov-2003 Chris Lattner <sabre@nondot.org> When spewing out warnings during function resolution, do not vomit out pages
and pages of non-symbolic types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10109 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
444fdea19d7c8ea54770080f7311e217497d6915 17-Nov-2003 Misha Brukman <brukman+llvm@gmail.com> This file was somehow missing a top-level comment line.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@10055 91177308-0d34-0410-b5e6-96231b3b80d8
xtractFunction.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
onstantMerge.cpp
eadArgumentElimination.cpp
eadTypeElimination.cpp
xtractFunction.cpp
unctionResolution.cpp
lobalDCE.cpp
PConstantPropagation.cpp
nlineSimple.cpp
nliner.cpp
nliner.h
nternalize.cpp
owerSetJmp.cpp
utateStructTypes.cpp
arallelize.cpp
runeEH.cpp
aiseAllocations.cpp
impleStructMutation.cpp
d77922f1a2ed9290544ded8a50d52fd24065556f 09-Nov-2003 Chris Lattner <sabre@nondot.org> Do NOT inline self recursive calls into other functions. This is causing the
pool allocator no end of trouble, and doesn't make a lot of sense anyway. This
does not solve the problem with mutually recursive functions, but they are much less common.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9828 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
nliner.h
b045e1411151624623ef58a05406c7d05b4524e7 09-Nov-2003 Chris Lattner <sabre@nondot.org> Untypo


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9827 91177308-0d34-0410-b5e6-96231b3b80d8
eadTypeElimination.cpp
d7222ec801618a1e22285832e7101de3dbc126d0 06-Nov-2003 Chris Lattner <sabre@nondot.org> Fix bug: PR93


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9752 91177308-0d34-0410-b5e6-96231b3b80d8
owerSetJmp.cpp
b6e0631a942d83947eec7808e643e17648a08da5 05-Nov-2003 Chris Lattner <sabre@nondot.org> Fix the problem with running cleanups in bugpoint: We were deleting arguments
of intrinsic functions, causing the verifier to fail.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9745 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
fdcc3acb7b82c57b4e59ed29264d094c79f2e3e2 05-Nov-2003 Chris Lattner <sabre@nondot.org> Split behavior into two pieces


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9741 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
d6d0d8c18d64c5f212cd6c2b42b9bcde5acebf72 02-Nov-2003 Chris Lattner <sabre@nondot.org> Fix PR78


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9648 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
bb9ae1512e1179681c1774f2f1a9d8c042941a56 31-Oct-2003 Chris Lattner <sabre@nondot.org> Strip off CPR's manually, because if we don't, the inliner doesn't delete dead
functions. GRR


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9641 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.cpp
6ace4daa57c23f7dbd4534a3c6401af9609c4af7 29-Oct-2003 Chris Lattner <sabre@nondot.org> Fix bug: ConstantMerge/2003-10-28-MergeExternalConstants.ll & PR64


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9579 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
fe2143d87d7153ddb15707e190d67a1475ea571d 29-Oct-2003 Chris Lattner <sabre@nondot.org> Check in statistifying patch for Bill


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9572 91177308-0d34-0410-b5e6-96231b3b80d8
owerSetJmp.cpp
2e8dfb8221d8fbb4d007cd1ab5e63dac0accea4b 27-Oct-2003 Chris Lattner <sabre@nondot.org> Propagating constants to arguments can make other arguments constant. For now
do something dumb, and inefficient, but more complete.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9542 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
2e56dd82b3b3ab9dde8cc55c06df78cec4dbd3b7 23-Oct-2003 Chris Lattner <sabre@nondot.org> We might as well strip off any CPRs before propagation


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9437 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
ff5bf9c62bb1d604ea9ad95f0687ac1592fa774a 23-Oct-2003 Chris Lattner <sabre@nondot.org> * We were forgetting to pass varargs arguments through a call
* Add a work around for bug PR56, gross but necessary for now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9428 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
d358e6fed51113b216756ea08fa361bb82022df2 23-Oct-2003 Chris Lattner <sabre@nondot.org> Check in initial version of ipcp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9423 91177308-0d34-0410-b5e6-96231b3b80d8
PConstantPropagation.cpp
c3afd9bf4bb06516b73645d6e0a73ae740433601 23-Oct-2003 Chris Lattner <sabre@nondot.org> Make this pass substantially stronger by having it delete dead return values
as well as arguments. Now it can delete arguments and return values which are
only passed into other arguments or are returned, if they are dead. This causes
it to delete several hundred extra args/retvals from the C++ hello world program,
shrinking it by about 2K.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9398 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
ce94319558ecc67383764da7e86083e57e3b0bc8 23-Oct-2003 Chris Lattner <sabre@nondot.org> This important patch fixes two warnings in the linker which can occur from linking
valid pieces of code


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9390 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
6be5e567ce9e1e319321470823f04d7e4caeeca4 22-Oct-2003 Chris Lattner <sabre@nondot.org> Update the 'used' flag correctly


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9366 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
4cb766af4a3ca51dd798608f8efb19c19ed5d2b5 22-Oct-2003 Chris Lattner <sabre@nondot.org> Loop over the module, not the symbol table. This makes the code handle
unused external functions again


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9365 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
efd47ba3ac178562d98a36a3538f89e3adac759f 22-Oct-2003 Chris Lattner <sabre@nondot.org> Implement FunctionResolve/2003-10-21-GlobalResolveHack.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9363 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
5858e1e3f3358d53a7aeff1a7a19a862bb814df3 22-Oct-2003 Chris Lattner <sabre@nondot.org> Fix bug: FunctionResolve/2003-10-21-GlobalTypeDifference.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9359 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
856ba76200ec2302f2fe500bc507f426c7d566c8 21-Oct-2003 John Criswell <criswell@uiuc.edu> Added LLVM copyright header.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9321 91177308-0d34-0410-b5e6-96231b3b80d8
nliner.h
e488e9360b1a865ba604330965edcf139e590b65 21-Oct-2003 John Criswell <criswell@uiuc.edu> Added LLVM copyright notice to Makefiles.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9312 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
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
onstantMerge.cpp
eadArgumentElimination.cpp
eadTypeElimination.cpp
xtractFunction.cpp
unctionResolution.cpp
lobalDCE.cpp
nlineSimple.cpp
nliner.cpp
nternalize.cpp
owerSetJmp.cpp
utateStructTypes.cpp
arallelize.cpp
runeEH.cpp
aiseAllocations.cpp
impleStructMutation.cpp
bacc773d207700dede0701d08e15dfdc650678e9 20-Oct-2003 Chris Lattner <sabre@nondot.org> Reorder for minor efficiency gain


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9285 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
3b237fcd385a734b49bb54893ce256ba181e36f9 19-Oct-2003 Chris Lattner <sabre@nondot.org> Change the Opcode enum for PHI nodes from "Instruction::PHINode" to "Instruction::PHI" to be more consistent with the other instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9269 91177308-0d34-0410-b5e6-96231b3b80d8
utateStructTypes.cpp
fd05924946ebfcfb3409b21996cfd0836e4ddb31 15-Oct-2003 Chris Lattner <sabre@nondot.org> Decrease usage of use_size()


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9135 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
8b716f66ad7606b38e5393bd67344235936d2f2c 13-Oct-2003 Chris Lattner <sabre@nondot.org> Whoops, we inserted into the wrong set. What's up with the dead set anyway?


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9094 91177308-0d34-0410-b5e6-96231b3b80d8
owerSetJmp.cpp
46e033d28d3d3f883432754ee65ce66b49b17874 13-Oct-2003 Chris Lattner <sabre@nondot.org> Use external df iterators to avoid revisiting blocks in functions with
multiple setjmp calls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9093 91177308-0d34-0410-b5e6-96231b3b80d8
owerSetJmp.cpp
cf3056db0fee1db7921214b1f25cea04e959e105 13-Oct-2003 Chris Lattner <sabre@nondot.org> Regularize header file comments


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9071 91177308-0d34-0410-b5e6-96231b3b80d8
utateStructTypes.cpp
impleStructMutation.cpp
6d3906be28a52546595749843449dd5bbb712f21 13-Oct-2003 Chris Lattner <sabre@nondot.org> Minor cleanups


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9067 91177308-0d34-0410-b5e6-96231b3b80d8
owerSetJmp.cpp
bb2d4de409f02d75ba43f64b6d9e446f3a910e70 13-Oct-2003 Chris Lattner <sabre@nondot.org> Checkin an improvement contributed by Bill:

Only transform call sites in a setjmp'ing function which are reachable from
the setjmp. If the call dominates the setjmp (for example), the called
function cannot longjmp to the setjmp.

This dramatically reduces the number of invoke instructions created in some
large testcases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9066 91177308-0d34-0410-b5e6-96231b3b80d8
owerSetJmp.cpp
cf00c4ab3ba308d45d98c5ccab87362cf802facb 10-Oct-2003 Misha Brukman <brukman+llvm@gmail.com> Fix spelling.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9027 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
xtractFunction.cpp
nlineSimple.cpp
utateStructTypes.cpp
arallelize.cpp
da78b002ca6bdaf9fd58443d943f60b8529bcf36 07-Oct-2003 Chris Lattner <sabre@nondot.org> Fix bugzilla bug #5


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8930 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
884d6c4e10501116a8ff45616231564a2738dadd 06-Oct-2003 Chris Lattner <sabre@nondot.org> Speed up the predicate used to decide when to inline by caching the size
of callees between executions.

On eon, in release mode, this changes the inliner from taking 11.5712s
to taking 2.2066s. In debug mode, it went from taking 14.4148s to
taking 7.0745s. In release mode, this is a 24.7% speedup of gccas, in
debug mode, it's a total speedup of 11.7%.

This also makes it slightly more aggressive. This could be because we
are not judging the size of the functions quite as accurately as before.
When we start looking at the performance of the generated code, this can
be investigated further.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8893 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
763f5ae9023e52e1978f2ffc21ca27a807a3404d 22-Sep-2003 Misha Brukman <brukman+llvm@gmail.com> Credits are now in top-level CREDITS.TXT


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8661 91177308-0d34-0410-b5e6-96231b3b80d8
owerSetJmp.cpp
a2d51afd79879607e7a1882462df0719d4b40fb8 20-Sep-2003 Chris Lattner <sabre@nondot.org> Global variables with APPENDING linkage are very important to keep around!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8632 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
02a3be020a6b4eedb4b489959997d23a22cdf22e 20-Sep-2003 Chris Lattner <sabre@nondot.org> Rename Function::getEntryNode -> getEntryBlock


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8625 91177308-0d34-0410-b5e6-96231b3b80d8
owerSetJmp.cpp
cc838348fc4eb60b09f6ef9cd248be347112c7a9 16-Sep-2003 Chris Lattner <sabre@nondot.org> Fix bug raising allocations whose call sites were invoke instructions.
Thanks to brg for tracking down the problem so precisely!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8568 91177308-0d34-0410-b5e6-96231b3b80d8
aiseAllocations.cpp
1cbcd0fd48869afd12eedf9017dbb545b360c37f 16-Sep-2003 Chris Lattner <sabre@nondot.org> This is effectively a complete rewrite of the globaldce algorithm, resulting
in it being both shorter and more effective. It no longer depends on the
callgraph, so one FIXME has been fixed.

Additionally, this pass was not able to delete recursive (but dead) functions
if they were pointed to by global variables which were also dead. In fact
this pass had a lot of problems deleting functions which were only pointed
to by dead globals and other stuff.

Fixing this means that the entire EH library should be stripped away now from
programs that don't use sjlj or exceptions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8567 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
77b398cd5f01fc69072e7d3af370d3b991dc82c4 15-Sep-2003 Chris Lattner <sabre@nondot.org> Minor cleanups, give credit, remove code that should not be necessary, and
was a "major hack" :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8524 91177308-0d34-0410-b5e6-96231b3b80d8
owerSetJmp.cpp
6420f1cd50173df17dba0deb660d88b563f08ac1 15-Sep-2003 Chris Lattner <sabre@nondot.org> Initial checkin of the Setjmp/Longjmp lowering/transformation pass,
contributed by the masterful Bill Wendling!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8520 91177308-0d34-0410-b5e6-96231b3b80d8
owerSetJmp.cpp
c9d3e5721b4e7c566a5e3fa4d312ebc6ba935f95 15-Sep-2003 Chris Lattner <sabre@nondot.org> Ugh, a bug fix needed because of the bug in the CallGraph code


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8519 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
ad9b5f31eaa739940c9ec540cc231afb99343304 15-Sep-2003 Chris Lattner <sabre@nondot.org> Fix bug: PruneEH/2003-09-14-ExternalCall.llx


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8516 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
7bc439a4b6c2d99707ebabf8f9b1c13041faa6a6 11-Sep-2003 Misha Brukman <brukman+llvm@gmail.com> Spell `definitely' correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8466 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
065a616adad624152618b1b0084ff074e5b03bbb 10-Sep-2003 Chris Lattner <sabre@nondot.org> Fix spell-o's


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8431 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
ee5457cbe88b7f691f774de8515d9a94226d1b00 08-Sep-2003 Chris Lattner <sabre@nondot.org> Eliminate support for the llvm.unwind intrinisic, using the Unwind instruction instead


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8411 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
36143fc4440ac1fc2a0fc95a4999bcadc3ec207d 08-Sep-2003 Chris Lattner <sabre@nondot.org> Add support for the unwind instruction


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8408 91177308-0d34-0410-b5e6-96231b3b80d8
utateStructTypes.cpp
758fefc0f046c54203602ba65d62a89ad781f370 01-Sep-2003 Chris Lattner <sabre@nondot.org> Final cleanup: remove dead code


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8291 91177308-0d34-0410-b5e6-96231b3b80d8
arallelize.cpp
273328e8e0e7b037bebfa8418400a247fba82496 01-Sep-2003 Chris Lattner <sabre@nondot.org> Not only is this a lot smaller, it actually works if there is already a
function with the right name in the module.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8290 91177308-0d34-0410-b5e6-96231b3b80d8
arallelize.cpp
a0201eaca86296981a6bd4038e3b5e51487cb6af 01-Sep-2003 Chris Lattner <sabre@nondot.org> Dead files


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8289 91177308-0d34-0410-b5e6-96231b3b80d8
ilkifier.cpp
ilkifier.h
09a670587a770ccf64207c933d95bc62bb56ffcf 01-Sep-2003 Chris Lattner <sabre@nondot.org> If "These should be used only by the auto-parallelization pass", we might as
well put them INTO the auto-par pass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8288 91177308-0d34-0410-b5e6-96231b3b80d8
arallelize.cpp
60a3518cf90d0acec861d9efbdc0f44652da6acf 01-Sep-2003 Chris Lattner <sabre@nondot.org> Moved all of the cilkifier stuff into lib/Transforms/IPO, as it really is not
support stuff.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8287 91177308-0d34-0410-b5e6-96231b3b80d8
ilkifier.cpp
arallelize.cpp
aa9214524d5935dd9b1b264d99d90f8b3086c106 01-Sep-2003 Chris Lattner <sabre@nondot.org> Minor cleanups
Do not #include Parallelize.h, it's just a subset of Cilkifier.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8285 91177308-0d34-0410-b5e6-96231b3b80d8
arallelize.cpp
2dbfa03fd8554d9045a95d3297a5d4164bddf128 01-Sep-2003 Chris Lattner <sabre@nondot.org> Change the RaiseAllocations pass to be a Pass instead of a BasicBlock pass.
This makes it more efficient: it doesn't have to scan the whole program, so
it performs work proportional to the number of malloc/free calls in the
program, not the size of the program.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8280 91177308-0d34-0410-b5e6-96231b3b80d8
aiseAllocations.cpp
237ef567f6764f24a47c63121cc0a599ddc8f56d 31-Aug-2003 Chris Lattner <sabre@nondot.org> Heavily refactor code:
* Separate the policy decisions into a derived class [InlineSimple]
* Move the inlining mechanics into a base class [Inliner]
* Change the inliner to be an SCCPass, making it more structured and
eventually pipelinable with other SCC passes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8257 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
nliner.cpp
nliner.h
f6fb96f5591de185f45ba8cd6ba3a3d98e04a86d 31-Aug-2003 Chris Lattner <sabre@nondot.org> Add accessor function


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8253 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
3e64b2e1a44b0bef896d645e9b293ab84dc16ab8 31-Aug-2003 Chris Lattner <sabre@nondot.org> Initial checkin of the -prune-eh pass, a very simple exception handling removal pass


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8250 91177308-0d34-0410-b5e6-96231b3b80d8
runeEH.cpp
e54453387486c1d5e61401e1d4febd3f6ebe86cf 24-Aug-2003 Chris Lattner <sabre@nondot.org> Inline invoke instructions as well as call instructions


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8107 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
6a67393e19632a9829c7ba0d3e7446db322612d9 24-Aug-2003 Chris Lattner <sabre@nondot.org> Big diff for a small change: delete inlined functions if all callees have
inlined the function.
Implements: Inline/inline_dce.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8101 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
a0f85e56c972b205e9c9cca368bd776154efd88e 23-Aug-2003 Chris Lattner <sabre@nondot.org> Fix bug: FunctionResolve/2003-08-23-ArgumentWarning.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8076 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
b29170fa40897a9b946557f7b7448661e5f78fdf 21-Aug-2003 Chris Lattner <sabre@nondot.org> Unless we CANNOT merge the arguments, do so


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7999 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
5560c9d49ccae132cabf1155f18aa0480dce3eda 18-Aug-2003 Misha Brukman <brukman+llvm@gmail.com> Spell `necessary' correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7944 91177308-0d34-0410-b5e6-96231b3b80d8
aiseAllocations.cpp
250d91b4bfe4b3b5cb87cebb6d9cef5fcc7e5b2a 14-Aug-2003 Chris Lattner <sabre@nondot.org> Fix FIXME by removing FIXME


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7832 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
478b3a9682c888d17abef1b19f779852ebba213b 13-Aug-2003 John Criswell <criswell@uiuc.edu> Removing the pool allocator from the main CVS tree.
Use the poolalloc module in CVS from now on.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7810 91177308-0d34-0410-b5e6-96231b3b80d8
ldPoolAllocate.cpp
oolAllocate.cpp
233d0758a1cc339946828fb0b5ef014b344b47ee 12-Aug-2003 Sumant Kowshik <kowshik@uiuc.edu> Bug fix: Some nodes pointed to by globals may not be marked incomplete and need to be tracked to find pool arguments


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7763 91177308-0d34-0410-b5e6-96231b3b80d8
oolAllocate.cpp
1f28e8ce4d8b2c31769e819619a8600349327ba2 11-Aug-2003 Chris Lattner <sabre@nondot.org> Fix handling of 'free' if it has absolutely no prototype


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7721 91177308-0d34-0410-b5e6-96231b3b80d8
aiseAllocations.cpp
7d3c5795f9624cd2fd9cdf9a61a9eb055bbead4b 07-Aug-2003 John Criswell <criswell@uiuc.edu> Fixed a segfault in gccld.
The original code does not work because the value from WorkList.end() is
invalidated once WorkList.erase() is called. To ensure proper functionality,
we must ensure that WorkList.erase() is always called before WorkList.end().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7673 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
8e37bd0330c65e24bcb8617c085a93d9a356d0f4 07-Aug-2003 Sumant Kowshik <kowshik@uiuc.edu> Added code for pool allocating only the pool-allocatable data structures in the presence of collapsed nodes + a couple of bug fixes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7662 91177308-0d34-0410-b5e6-96231b3b80d8
oolAllocate.cpp
804312786002b69b6b63ffce63c7074a254ccbb6 06-Aug-2003 Chris Lattner <sabre@nondot.org> Remove unnecessary use of NonCopyable


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7641 91177308-0d34-0410-b5e6-96231b3b80d8
arallelize.cpp
c8afdc150c0f73fa14cbd776f0b3db25cecde22d 05-Aug-2003 Chris Lattner <sabre@nondot.org> Minor changes:
* Expand most tabs into spaces
* Move #define DEBUG_TYPE to top of file to avoid warning


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7611 91177308-0d34-0410-b5e6-96231b3b80d8
oolAllocate.cpp
f67e7fc7b18a794cdda9c0ff20739072ae41aaac 05-Aug-2003 Sumant Kowshik <kowshik@uiuc.edu> Major bug fixes including a memory leak and tracking some exceptional conditions. Also added support for including global and indirect call information in the DS graphs used by the pool allocation


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7605 91177308-0d34-0410-b5e6-96231b3b80d8
oolAllocate.cpp
6806f5614d2ec260fda954c951d33f58e77ed610 02-Aug-2003 Chris Lattner <sabre@nondot.org> DEBUG got moved to Support/Debug.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7492 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
nlineSimple.cpp
nternalize.cpp
utateStructTypes.cpp
oolAllocate.cpp
1078d1185400cb0f7a6e7971346e3534d8d9ff72 24-Jul-2003 Chris Lattner <sabre@nondot.org> Fix bug: FunctionResolve/2003-07-23-CPR-Reference.ll

This fixes a long time annoyance which caused prototypes for bzero, bcopy,
bcmp, fputs, and fputs_unlocked to never get deleted. Grr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@7285 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
8bc95a176af5ce5380582fc9ed222bcb096f8c2c 30-Jun-2003 Chris Lattner <sabre@nondot.org> Eliminate using declarations, adjust for new DSGraph API


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6992 91177308-0d34-0410-b5e6-96231b3b80d8
oolAllocate.cpp
cf6bac3b565d02fe3a7e270e0d652303aa1279da 28-Jun-2003 Chris Lattner <sabre@nondot.org> Allow the inlining limit to be controlled from the command line!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6929 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
b12b75365a11e0a626b9826bff4e68272d808f19 26-Jun-2003 Chris Lattner <sabre@nondot.org> Add support to globaldce for deleting dead function prototypes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6918 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
81d4e14449fce69ca3a315685a80bb3c20a3db23 26-Jun-2003 Chris Lattner <sabre@nondot.org> When internalizing global ctor/dtor list, also mark it constant. This is gross, but
until DSA is working all of the time and is totally reliable, we do this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6917 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
9b2a14b6f1a7e1dc93f47778adb2d68f327f5ab9 25-Jun-2003 Chris Lattner <sabre@nondot.org> Add argument to DAE to allow operation on non-internal functions


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6895 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
1c6d6c996adcc396d6a5f7cf5a2c20f2841d35a2 20-Jun-2003 Chris Lattner <sabre@nondot.org> Fix the build. :(


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6797 91177308-0d34-0410-b5e6-96231b3b80d8
oolAllocate.cpp
31f612589f9be2ec890e65191d6df0a17d488fa9 19-Jun-2003 Chris Lattner <sabre@nondot.org> Changes to privatize NodeType


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6795 91177308-0d34-0410-b5e6-96231b3b80d8
oolAllocate.cpp
a3df1ff807ebbc0824e83246073faa5687a88966 19-Jun-2003 Chris Lattner <sabre@nondot.org> Remove a bunch of complicated code. The functionality is implemented in instcombine instead


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6782 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
97f4b664cd8a537cd2bf37b6a9d06a174078e947 18-Jun-2003 Chris Lattner <sabre@nondot.org> Handle arguments passed in through the va_arg area


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6769 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
08227e4f17f5c7686bc6f0fe5d2c030e2fa05806 18-Jun-2003 Chris Lattner <sabre@nondot.org> Initial checkin of DAE pass


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6759 91177308-0d34-0410-b5e6-96231b3b80d8
eadArgumentElimination.cpp
4432d8f3b5dd4e8bb9f46e0e12abe2ca328020be 07-Jun-2003 Chris Lattner <sabre@nondot.org> Fix compilation problem on GCC 2.9x


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6667 91177308-0d34-0410-b5e6-96231b3b80d8
oolAllocate.cpp
9271ade15bb1654fafe50e49e7f3079e86378bac 04-Jun-2003 Sumant Kowshik <kowshik@uiuc.edu> Made changes suggested by Chris


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6606 91177308-0d34-0410-b5e6-96231b3b80d8
oolAllocate.cpp
c16e631e943c3e8460598389c3fff57d1f73c17c 31-May-2003 Chris Lattner <sabre@nondot.org> Fix bug: FunctionResolve/2003-05-31-AllInternalDecls.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6486 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
12ce59d3c58ec4397e38b5acf2dd654ed578439e 31-May-2003 Chris Lattner <sabre@nondot.org> Fix bug: FuncResolve/2003-05-31-InternalDecl.ll
Count resolutions correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6482 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
40c4959e9fe77b8379e23f850a191bbacdfe6c03 31-May-2003 Chris Lattner <sabre@nondot.org> Simplify funcresolve a bit more


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6480 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
567cceea49f66ed7e743853cdd0ba689651f79bb 31-May-2003 Chris Lattner <sabre@nondot.org> Fix bug: FunctionResolve/2003-05-31-FuncPointerResolve.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6479 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
a78220fe2d7fe0a18e21e5d0303597855a811f55 30-May-2003 Sumant Kowshik <kowshik@uiuc.edu> Added support for function pointers


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6420 91177308-0d34-0410-b5e6-96231b3b80d8
oolAllocate.cpp
ca398dc3989d35e8516489fd163e012133bd41cb 29-May-2003 Chris Lattner <sabre@nondot.org> * Separate all of the grunt work of inlining out into the Utils library.
* Make the function inliner _significantly_ smarter. :)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6396 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
de579f11ff018aeac07ca28e7c94dd477f342b9c 23-May-2003 Chris Lattner <sabre@nondot.org> Remove using declarations


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6306 91177308-0d34-0410-b5e6-96231b3b80d8
eadTypeElimination.cpp
utateStructTypes.cpp
88c7c3295d936c807bc03ff4fd9da4691084f5d8 22-May-2003 Chris Lattner <sabre@nondot.org> Make the list accept comma separated names


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6295 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
2345d71853e75fd56a8ca66d40bf36eba0a9edb6 22-May-2003 Chris Lattner <sabre@nondot.org> * Revert to old behavior of ignoring a module if it doesn't contain a main
function and no symbols were explicitly marked to be externalized.
* Add new -internalize-public-api-list option that can be used if the symbol
list is small, and making a new file is annoying.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6289 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
c7a2c7f0c9900c6658bc567211d695f0593484c2 22-May-2003 Chris Lattner <sabre@nondot.org> Add option to internalize to allow it to read a file to determine which symbols
should not be internalized


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6288 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
c52b30dcfbc66a77d04fd152d3261f401aa05a0b 21-May-2003 Chris Lattner <sabre@nondot.org> Fix bug: FunctionResolve/2003-05-21-MissingArguments.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6273 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
8d8f20e47a7aaf75863d71d729283a60fce5c810 08-May-2003 Chris Lattner <sabre@nondot.org> Don't inline functions that take variable numbers of arguments!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6024 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
1b27cb7159bcd0130cd1a98332b8952f4751867f 08-May-2003 Chris Lattner <sabre@nondot.org> Remove using decl


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6023 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
1fd95afab3d49d16c6d0e1e174e4537336548ab1 28-Apr-2003 Chris Lattner <sabre@nondot.org> Fix several bugs:
* Warnings were emitted all of the time and were really annoying
* Functions could not be resolved unless they had external linkage. Linkonce
linkage was not allowed
* ConstantPointerRef's were not handled when linking functions
we now actually handle cast (CPR) to X -> cast (NewCPR) to X


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5967 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
e408e25132b8de8c757db1e3ddcd70432dfeb24d 23-Apr-2003 Chris Lattner <sabre@nondot.org> Remove unnecesary &*'s


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5872 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
ea2294a498aaafcd32ba1d3714370b220020494c 19-Apr-2003 Chris Lattner <sabre@nondot.org> Implement: FunctionResolve/2003-04-18-ForwardDeclGlobal.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5816 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
156bcf3f65c9d36dabc1b86e341d5ee08c24a33e 18-Apr-2003 Chris Lattner <sabre@nondot.org> Global constants CAN be external


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5808 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
fb242b6edc3d92daf49c7d5b2c19d81447aa61bc 17-Apr-2003 Chris Lattner <sabre@nondot.org> Change the interface to constant expressions to allow automatic folding


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5793 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
4ad02e726d9b634372b037d4b352d8b63bb9e849 16-Apr-2003 Chris Lattner <sabre@nondot.org> Add new linkage types to support a real frontend


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5786 91177308-0d34-0410-b5e6-96231b3b80d8
xtractFunction.cpp
nternalize.cpp
utateStructTypes.cpp
arallelize.cpp
oolAllocate.cpp
dde601d0eb6ffe64aea2f72e0baf8548247dbb4c 03-Mar-2003 Chris Lattner <sabre@nondot.org> Eliminate tons of bogus warnings


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5686 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
4e2fd7574af521d56d69066df2df969c761c4a33 27-Feb-2003 Chris Lattner <sabre@nondot.org> Replace assertion with a handler.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5653 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
fd595203bd0d501fae9c1341e8424b9f86af2bb8 14-Feb-2003 Chris Lattner <sabre@nondot.org> Fix a bug that cause a crash resolving questionable function calls


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5567 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
a3183be835b09ad0a5bb94fbac6756ff4ba956ed 14-Feb-2003 Chris Lattner <sabre@nondot.org> Fix a misunderstanding of the standard associative containers


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5565 91177308-0d34-0410-b5e6-96231b3b80d8
eadTypeElimination.cpp
617d92c7d9ff41fc3588d710a8f7aae73f9bdb0f 06-Feb-2003 Chris Lattner <sabre@nondot.org> Fix a problem Sumant was running into


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5499 91177308-0d34-0410-b5e6-96231b3b80d8
oolAllocate.cpp
f9c81670d7aa4fd3476895917189a25ad8e71ad9 03-Feb-2003 Chris Lattner <sabre@nondot.org> Split public interface out into header file


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5472 91177308-0d34-0410-b5e6-96231b3b80d8
oolAllocate.cpp
41c04f730b4fdce98b35603d1b02a1dc6b81e589 01-Feb-2003 Chris Lattner <sabre@nondot.org> Change DSGraph stuff to use hash_(set|map) instead of std::(set|map)
This change provides a small (3%) but consistent speedup


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5460 91177308-0d34-0410-b5e6-96231b3b80d8
oolAllocate.cpp
49f201214055c8eaffa3eef91b87c4997afadc45 30-Jan-2003 Chris Lattner <sabre@nondot.org> Fix a bug resolving sprintf(...) to sprintf(char*, char*, ...)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5446 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
9943a59cb5e0d8306fdbe32ccc0af89af8878024 30-Jan-2003 Chris Lattner <sabre@nondot.org> Actually print the function _name_ if there is a problem


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5443 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
da902ba970122d3fb39ffb0dfaa4bec1518c0176 30-Jan-2003 Chris Lattner <sabre@nondot.org> * Fix function resolution for varargs function to generate incorrect bytecode instead of crashing
* remove using decls
CVS: ----------------------------------------------------------------------


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5437 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
f34e1ba79c2561e664deb0084d0a2cff2b1d6365 29-Jan-2003 Chris Lattner <sabre@nondot.org> Initial checkin of pool allocation code


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5432 91177308-0d34-0410-b5e6-96231b3b80d8
oolAllocate.cpp
0ea3e6dc4162d1af9f22ca41d14799b834920eb0 24-Jan-2003 Chris Lattner <sabre@nondot.org> Disable construction of pool allocator


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5422 91177308-0d34-0410-b5e6-96231b3b80d8
ldPoolAllocate.cpp
019a7c801b491504868ad105016fc6ebbb09ff5d 13-Jan-2003 Chris Lattner <sabre@nondot.org> Fix references to functions


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5222 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
d86deb689bfec6cd3f0f2a0003dbbf3214f3cd4d 10-Dec-2002 Vikram S. Adve <vadve@cs.uiuc.edu> External routines used to identify Cilk operations inserted by the
parallelization pass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4965 91177308-0d34-0410-b5e6-96231b3b80d8
ilkifier.cpp
ilkifier.h
e12c74c07bec6d2570bb052a2e23c9e4dbf8c7f1 10-Dec-2002 Vikram S. Adve <vadve@cs.uiuc.edu> This file implements a pass that automatically parallelizes a program,
using the Cilk multi-threaded runtime system to execute parallel code.
The current version inserts too many sync() operations in the program
because it does not attempt to optimize their placement.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4962 91177308-0d34-0410-b5e6-96231b3b80d8
arallelize.cpp
da3c8a76748bd366f63f676df312319829c169e8 20-Nov-2002 Chris Lattner <sabre@nondot.org> Fix symbol table problem


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4785 91177308-0d34-0410-b5e6-96231b3b80d8
utateStructTypes.cpp
6e6026b46569b01f8f6d4dcdb6c899c3a9c76b3e 20-Nov-2002 Chris Lattner <sabre@nondot.org> - Eliminated the deferred symbol table stuff in Module & Function, it really
wasn't an optimization and it was causing lots of bugs.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4779 91177308-0d34-0410-b5e6-96231b3b80d8
eadTypeElimination.cpp
unctionResolution.cpp
d18015599cbe09dd327b5f73501581a865bf27da 19-Nov-2002 Chris Lattner <sabre@nondot.org> Minor changes to cloning interface


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4770 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
dcd8040d115803e427dc1caf9feb44a894eef927 19-Nov-2002 Chris Lattner <sabre@nondot.org> Rework inline pass to use cloning infrastructure to do the dirty work


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4766 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
309f19391b571084ba9f6b0372e63b875ca2b869 19-Nov-2002 Chris Lattner <sabre@nondot.org> Start using the new function cloning header


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4764 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
e6aa37388afafab49a307e7ff2e0dfd3688c3e06 19-Nov-2002 Chris Lattner <sabre@nondot.org> Move MutatStructTypes.h out of IPO


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4762 91177308-0d34-0410-b5e6-96231b3b80d8
utateStructTypes.cpp
impleStructMutation.cpp
36b7cc3b06b59f62b3bf8b34600c275f52481e23 19-Nov-2002 Chris Lattner <sabre@nondot.org> Rename CloneFunction.h to Cloning.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4760 91177308-0d34-0410-b5e6-96231b3b80d8
ldPoolAllocate.cpp
5113eb0c520280b42917a5e1d1b14d22392010f7 19-Nov-2002 Chris Lattner <sabre@nondot.org> Move the function extractor pass from tools/extract into lib/Xform/IPO


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4759 91177308-0d34-0410-b5e6-96231b3b80d8
xtractFunction.cpp
a2b8d7bff28bcee2b375ca74dca53f12218ff2b6 10-Nov-2002 Chris Lattner <sabre@nondot.org> Fix testcase: FunctionResolve/2002-11-09-ExternFn.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4668 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
93fbd733e778c2623436ed5a0b9cf7f394407b1a 08-Nov-2002 Chris Lattner <sabre@nondot.org> Use the new getMainFunction() method to efficiently locate main


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4630 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
6f23963adc8c3257ba3e4998d7894e147ca4b078 08-Nov-2002 Chris Lattner <sabre@nondot.org> Fix bug: FunctionResolve/2002-11-07-RetMismatch.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4618 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
c966a2acee176369be2f901e32c346c176b7f772 17-Oct-2002 Chris Lattner <sabre@nondot.org> Really disable pool allocator


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4216 91177308-0d34-0410-b5e6-96231b3b80d8
ldPoolAllocate.cpp
69da5cf26143e4542d4bf8c78ffac6d079efe5c9 13-Oct-2002 Chris Lattner <sabre@nondot.org> - Change Function's so that their argument list is populated when they are
constructed. Before, external functions would have an empty argument list,
now a Function ALWAYS has a populated argument list.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4149 91177308-0d34-0410-b5e6-96231b3b80d8
utateStructTypes.cpp
eaa359586c45712cb1e4be0cc8d9e6da5448963a 13-Oct-2002 Chris Lattner <sabre@nondot.org> Account for global variables resolved more accurately.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4143 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
66c25ff4382d5ef08a0b34c843b058da3099a963 13-Oct-2002 Chris Lattner <sabre@nondot.org> Use methods that are more explanatory


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4142 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
7a11a94183b82f067214927c6f0d76bbbde9c0f7 10-Oct-2002 Chris Lattner <sabre@nondot.org> Stop using DataStructureGraph.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4106 91177308-0d34-0410-b5e6-96231b3b80d8
ldPoolAllocate.cpp
c67ebfa78810f518c54381ed38c09d3a0afd77e4 10-Oct-2002 Chris Lattner <sabre@nondot.org> - Dramatically simplify the ConstantMerge code now that
Value::replaceAllUsesWith works with constants correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4104 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
a45ec54a029b7c8d20e4f3ba732a01ade031b5f9 09-Oct-2002 Chris Lattner <sabre@nondot.org> Almost a complete rewrite of FunctionResolution to now resolve functions
and global variables.

This fixes bug: FuncResolve/2002-08-19-ResolveGlobalVarsEasier.ll
And bug: SingleSource/UnitTests/2002-10-09-ArrayResolution.c

Note that this does not fix bug:
FunctionResolve/2002-08-19-ResolveGlobalVars.ll because replaceAllUsesWith
breaks when a constantexpr is pointing to the thing being replaced. This
is more of an infrastructure problem than anything.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4099 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
7c1faf0f598ca98216ff221b231c57b4d5ec184b 07-Oct-2002 Chris Lattner <sabre@nondot.org> Non-functionality change just to make it more clear what is going on


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4060 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
a92f696b74a99325026ebbdbffd2a44317e0c10b 02-Oct-2002 Chris Lattner <sabre@nondot.org> Updates to work with recent Statistic's changes:

* Renamed StatisticReporter.h/cpp to Statistic.h/cpp
* Broke constructor to take two const char * arguments instead of one, so
that indendation can be taken care of automatically.
* Sort the list by pass name when printing
* Make sure to print all statistics as a group, instead of randomly when
the statistics dtors are called.
* Updated ProgrammersManual with new semantics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4002 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
eadTypeElimination.cpp
unctionResolution.cpp
lobalDCE.cpp
nternalize.cpp
utateStructTypes.cpp
aiseAllocations.cpp
6ee6bbeb04b0213b3f2d60db3ba36fa71d6d9251 02-Oct-2002 Chris Lattner <sabre@nondot.org> Updates to work with recent Statistic's changes:
* Renamed StatisticReporter.h/cpp to Statistic.h/cpp
* Broke constructor to take two const char * arguments instead of one, so
that indendation can be taken care of automatically.
* Sort the list by pass name when printing
* Make sure to print all statistics as a group, instead of randomly when
the statistics dtors are called.
* Updated ProgrammersManual with new semantics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4001 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
3a15d707340eef80e01651a4529965ca1a3f3b2f 26-Sep-2002 Chris Lattner <sabre@nondot.org> Converted SimpleStructMutation to take TargetData as a required pass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3932 91177308-0d34-0410-b5e6-96231b3b80d8
impleStructMutation.cpp
e4314ed3154f168cc9324e2e213c2733c2b71761 24-Sep-2002 Chris Lattner <sabre@nondot.org> Fix: ConstantMerge/2002-09-23-CPR-Update.ll

Basically, this bug boiled down to calling replaceUsesOfWith on a constant,
which changed it's shape in an illegal way. This pass now goes through all
of the trouble neccesary to do the replacement on constants.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3895 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
bdccb0097061e05b506592c25b3b5e9e0692c950 22-Sep-2002 Chris Lattner <sabre@nondot.org> Don't insert a PHI node to merge "returns" from an inlined function if there
is only a single return from the function!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3878 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
dbcbe3f7e8dad01a6d4ad8460992b9139e4861ba 17-Sep-2002 Chris Lattner <sabre@nondot.org> Fix FunctionInlining pass assertion failure:
ilist:104: failed assertion `Traits::getNext(NodePtr) != 0 && "Dereferencing end()!"'


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3768 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
655fb5c817cfaa1bd0cc0e0613e3105c59d60dad 14-Sep-2002 Misha Brukman <brukman+llvm@gmail.com> Function.h is unnecessary when Module.h is included.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3716 91177308-0d34-0410-b5e6-96231b3b80d8
aiseAllocations.cpp
520eaff91a61a3206dcaf352101bdb9df1d45b42 14-Sep-2002 Misha Brukman <brukman+llvm@gmail.com> Following Chris's advice, I'm pruning some unnecessary .h includes that I'm
noticing. Since Module includes Function, and eventually, BasicBlock and
GlobalVariable, the last three are unnecessary to be included directly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3713 91177308-0d34-0410-b5e6-96231b3b80d8
utateStructTypes.cpp
e87e1c9aa947e6558412b6517308410cd0f5aea4 14-Sep-2002 Chris Lattner <sabre@nondot.org> Change the MallocInst & AllocaInst ctors to take the allocated type, not the
pointer type returned.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3711 91177308-0d34-0410-b5e6-96231b3b80d8
utateStructTypes.cpp
ldPoolAllocate.cpp
05804b74590ab8714bd7695d8cd0d98819c092f9 14-Sep-2002 Chris Lattner <sabre@nondot.org> Change the MallocInst & AllocaInst ctors to take the allocated type, not the
pointer type returned.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3710 91177308-0d34-0410-b5e6-96231b3b80d8
aiseAllocations.cpp
08c2e4838de6b5aebcccb13ef067283c5241f8f2 11-Sep-2002 Chris Lattner <sabre@nondot.org> Fix bug in previous checkin


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3672 91177308-0d34-0410-b5e6-96231b3b80d8
aiseAllocations.cpp
f2d2d0bb13ce63568362f3aaea68ce55ee040954 11-Sep-2002 Chris Lattner <sabre@nondot.org> Clean up code due to auto-insert constructors


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3666 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
1d608abbc07bbc7c78c20da6b305ef14c6c30e8e 11-Sep-2002 Chris Lattner <sabre@nondot.org> Clean up code due to auto-insert constructors


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3665 91177308-0d34-0410-b5e6-96231b3b80d8
aiseAllocations.cpp
3ea5cb0df1a992b900b6eefb9da2505792c2c819 10-Sep-2002 Chris Lattner <sabre@nondot.org> Simplify code (somtimes dramatically), by using the new "auto-insert" feature
of instruction constructors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3655 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
5fb724332aeb0f70fb6cd882718e09d1db0e12d5 08-Sep-2002 Chris Lattner <sabre@nondot.org> Factor silly code duplication out


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3627 91177308-0d34-0410-b5e6-96231b3b80d8
eadTypeElimination.cpp
3bb8ad27a81661865400fcff5e07d0461860faf7 23-Aug-2002 Chris Lattner <sabre@nondot.org> Eliminated the MemAccessInst class, folding contents into GEP class.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3488 91177308-0d34-0410-b5e6-96231b3b80d8
utateStructTypes.cpp
3f9b28d075e7c3991ddbf4535122298204093791 22-Aug-2002 Chris Lattner <sabre@nondot.org> Do not create load/stores with indexes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3420 91177308-0d34-0410-b5e6-96231b3b80d8
utateStructTypes.cpp
0bfb6ba3e354403d3102461d6e57e887689afbbd 18-Aug-2002 Chris Lattner <sabre@nondot.org> - Made GlobalDCE worklist driven, making it more successful. Now can handle
cases like: test/Regression/Transforms/GlobalDCE/2002-08-17-WorkListTest.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3381 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
e4c3764a9fa7bb7c6438567b2ddbf3f3d3ac8390 14-Aug-2002 Chris Lattner <sabre@nondot.org> Remove support for NOT instruction


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3313 91177308-0d34-0410-b5e6-96231b3b80d8
utateStructTypes.cpp
5f0eb8da62308126d5b61e3eee5bee75b9dc5194 08-Aug-2002 Chris Lattner <sabre@nondot.org> - Cleaned up the interface to AnalysisUsage to take analysis class names
instead of ::ID's.
- Pass::getAnalysis<> now no longer takes an optional argument


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3265 91177308-0d34-0410-b5e6-96231b3b80d8
eadTypeElimination.cpp
lobalDCE.cpp
ldPoolAllocate.cpp
impleStructMutation.cpp
cc8d8fb6763645af20caae96db5cc08f21748b7c 01-Aug-2002 Chris Lattner <sabre@nondot.org> Remove unneccesary #inlcude


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3200 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
55e41ba3d293699e47fdeb8996cc743b2018bde8 30-Jul-2002 Chris Lattner <sabre@nondot.org> * Indent class into anonymous namespace, filling up the diff with garbage
* Internalize global variables with initializers
* Add new stat to track global variable internalization
* Only count functions that were not internal before in internalized function
count


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3163 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
e902bda4ce1e56343a1c82feb591d3cd03adb44b 30-Jul-2002 Chris Lattner <sabre@nondot.org> Fix bug with last patch which would occur when a call returned void and we
attempted to assign it a name.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3142 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
9cf307fdebc7bdaa7f685b0d4f932ee87cde7f66 30-Jul-2002 Chris Lattner <sabre@nondot.org> * Make sure the resolved function call instructions get the name from the
old call instruction
* Implement conversion of return values for calls. This fixes bug:
test/Regression/Transforms/FunctionResolve/retmismatch3.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3140 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
a6275ccdf5e1aa208afde56c498e2b13e16442f0 26-Jul-2002 Chris Lattner <sabre@nondot.org> * Add support for different "PassType's"
* Add new RegisterOpt/RegisterAnalysis templates for registering passes that
are to show up in opt or analyze
* Register Analyses now
* Change optimizations to use RegisterOpt instead of RegisterPass
* Add support for different "PassType's"
* Add new RegisterOpt/RegisterAnalysis templates for registering passes that
are to show up in opt or analyze
* Register Analyses now
* Change optimizations to use RegisterOpt instead of RegisterPass
* Remove getPassName implementations from various subclasses


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3113 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
aiseAllocations.cpp
1e43516dcf4aa152432447397334cd43744d63e1 26-Jul-2002 Chris Lattner <sabre@nondot.org> * Add support for different "PassType's"
* Add new RegisterOpt/RegisterAnalysis templates for registering passes that
are to show up in opt or analyze
* Register Analyses now
* Change optimizations to use RegisterOpt instead of RegisterPass
* Add support for different "PassType's"
* Add new RegisterOpt/RegisterAnalysis templates for registering passes that
are to show up in opt or analyze
* Register Analyses now
* Change optimizations to use RegisterOpt instead of RegisterPass
* Remove getPassName implementations from various subclasses


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3112 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
eadTypeElimination.cpp
unctionResolution.cpp
lobalDCE.cpp
nternalize.cpp
ldPoolAllocate.cpp
impleStructMutation.cpp
0c0edf8afc35a42b15a24ebb5fa5f3fc674290ae 25-Jul-2002 Chris Lattner <sabre@nondot.org> *** empty log message ***


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3075 91177308-0d34-0410-b5e6-96231b3b80d8
utateStructTypes.cpp
ldPoolAllocate.cpp
568ddabc8f9015baf2d42cc425618412972f1b92 24-Jul-2002 Chris Lattner <sabre@nondot.org> Eliminate several include/llvm/Transforms/IPO/*.h files, moving their contents into IPO.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3043 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
nternalize.cpp
ldPoolAllocate.cpp
impleStructMutation.cpp
e9ee3e5a75beca33e18eba793980b1166d73f8e5 24-Jul-2002 Chris Lattner <sabre@nondot.org> Merge ChangeAllocations into scalar.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3038 91177308-0d34-0410-b5e6-96231b3b80d8
aiseAllocations.cpp
ff1be262c4b99053677da61e3437d7adcaa6f326 24-Jul-2002 Chris Lattner <sabre@nondot.org> Rename header


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3037 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
7311e389a691293b4cb6742ef2f77d11e9f2c07d 24-Jul-2002 Chris Lattner <sabre@nondot.org> Cleanup and simplify code


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3036 91177308-0d34-0410-b5e6-96231b3b80d8
eadTypeElimination.cpp
9cfea85b8b41458c8d0e84c52fad6f2244d3ae33 23-Jul-2002 Chris Lattner <sabre@nondot.org> Incorporate ConstantMerge.h into IPO.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3035 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
f629309f74cf1a64aa7fd1cd5784fd7db9a8f59e 23-Jul-2002 Chris Lattner <sabre@nondot.org> *** empty log message ***


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3016 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
nternalize.cpp
ldPoolAllocate.cpp
af41a12370010325eb163b734d5757a7f0296e67 23-Jul-2002 Chris Lattner <sabre@nondot.org> * Remove getPassName implementation
* Register all Passes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3015 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
unctionResolution.cpp
nlineSimple.cpp
aiseAllocations.cpp
e9754ef595c74b848e9a2409c758826abbd7d905 23-Jul-2002 Chris Lattner <sabre@nondot.org> * Break the two different behaviors of SimpleStructMutation into two subclasses
* Register the passes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3013 91177308-0d34-0410-b5e6-96231b3b80d8
impleStructMutation.cpp
72c27e2ae56a4c49b0f77436d834557dbdd09351 23-Jul-2002 Chris Lattner <sabre@nondot.org> * Remove lots of dead stuff
* Register Pass


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3011 91177308-0d34-0410-b5e6-96231b3b80d8
eadTypeElimination.cpp
56d27019e6aebd7cfa5d031c832193eb66d75830 23-Jul-2002 Chris Lattner <sabre@nondot.org> *** empty log message ***


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@3002 91177308-0d34-0410-b5e6-96231b3b80d8
akefile
5ff62e90d0bc321206023897edc1e2691cb0fbb6 22-Jul-2002 Chris Lattner <sabre@nondot.org> *** empty log message ***


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2985 91177308-0d34-0410-b5e6-96231b3b80d8
ldPoolAllocate.cpp
5796091dfd734cac8cf4a4ca70ed937d5a94f771 18-Jul-2002 Chris Lattner <sabre@nondot.org> Seperate stats for DCE'd functions and vars


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2961 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
f0cd4722bfb8fe9ac105f4fed54441b054781573 18-Jul-2002 Chris Lattner <sabre@nondot.org> *** empty log message ***


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2959 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
7f20ea7d7b9ab1b21147c58bec6491ce5ba7f816 18-Jul-2002 Chris Lattner <sabre@nondot.org> Only functions with external linkage can be resolved to function declarations.
This change fixes programs that have multiple functions named the same thing,
where are least one of them is static/internal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2954 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
0b5909e6ae3d31c3e6c1379f61d7b038f225a620 18-Jul-2002 Chris Lattner <sabre@nondot.org> * Correctly get prototype for void*malloc(size_t)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2951 91177308-0d34-0410-b5e6-96231b3b80d8
aiseAllocations.cpp
11910cf7e316a1349a624882af83605fbabe4aa5 11-Jul-2002 Chris Lattner <sabre@nondot.org> Disable pool allocation stuff until data structure analysis is sorted back out


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2869 91177308-0d34-0410-b5e6-96231b3b80d8
ldPoolAllocate.cpp
3e009942ed6d5b075377ea8eb34c2daa8d8c5f77 30-Jun-2002 Chris Lattner <sabre@nondot.org> *** empty log message ***


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2813 91177308-0d34-0410-b5e6-96231b3b80d8
ldPoolAllocate.cpp
5ba99bd124dc18302f527d6e2b0efd0fa866bc9e 25-Jun-2002 Anand Shukla <ashukla@cs.uiuc.edu> changes to make it compatible with 64bit gcc


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2792 91177308-0d34-0410-b5e6-96231b3b80d8
utateStructTypes.cpp
ldPoolAllocate.cpp
7e70829632f82de15db187845666aaca6e04b792 25-Jun-2002 Chris Lattner <sabre@nondot.org> MEGAPATCH checkin.

For details, See: docs/2002-06-25-MegaPatchInfo.txt


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2779 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
nlineSimple.cpp
aiseAllocations.cpp
0b12b5f50ec77a8bd01b92d287c52d748619bb4b 25-Jun-2002 Chris Lattner <sabre@nondot.org> MEGAPATCH checkin.

For details, See: docs/2002-06-25-MegaPatchInfo.txt


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2778 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
nternalize.cpp
utateStructTypes.cpp
ldPoolAllocate.cpp
impleStructMutation.cpp
9234d03373b7e0e590836f8fe1a5cd560d2620ea 25-Jun-2002 Chris Lattner <sabre@nondot.org> Remove DynamicConstantMerge pass, because it did not fit in with the Pass
system correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2772 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
ce0141ec22cbdc31e56151a0c4118050ecc96db3 25-Jun-2002 Chris Lattner <sabre@nondot.org> Remove "fixers" for problems in GCC generated code that cannot be generated
anymore.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2771 91177308-0d34-0410-b5e6-96231b3b80d8
eadTypeElimination.cpp
bd8619d3efcbf9dbc9a6432b43f0631df8db44b7 26-May-2002 Chris Lattner <sabre@nondot.org> Do not remove type names that contain a .


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2747 91177308-0d34-0410-b5e6-96231b3b80d8
eadTypeElimination.cpp
abe6c3d702a2f809ea394ff9be996cb777aedb79 24-May-2002 Chris Lattner <sabre@nondot.org> Fix "unimplemented features":
test/Regression/Transforms/FunctionResolve/retmismatch[12].ll

This makes it much more useful for running benchmarks that are missing
prototypes for some functions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2745 91177308-0d34-0410-b5e6-96231b3b80d8
unctionResolution.cpp
22ee3eb802cf4dfb5d5142dfa84618cb03e991a8 24-May-2002 Chris Lattner <sabre@nondot.org> Split the FunctionResolution pass out of CleanGCCOutput.cpp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2742 91177308-0d34-0410-b5e6-96231b3b80d8
eadTypeElimination.cpp
unctionResolution.cpp
47e0f3a8a0b1f280457f807e4bbc6bbaa593e687 24-May-2002 Chris Lattner <sabre@nondot.org> Support programs that do not #include <malloc.h> or give a full prototype
for malloc and free. Lots of crufty benchmarks are using stuff like:
char *malloc();
void free();

to forward declare malloc and free. Now we recognize and raise these forms


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2740 91177308-0d34-0410-b5e6-96231b3b80d8
aiseAllocations.cpp
b3abf9d0d8978408b3cb8d8983db8d1aaa9ce64c 22-May-2002 Chris Lattner <sabre@nondot.org> Convert transforms over to standardize debugging output on -debug option


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2714 91177308-0d34-0410-b5e6-96231b3b80d8
utateStructTypes.cpp
3dec1f272219ee1f8e1499929cdf53f5bc3c2272 10-May-2002 Chris Lattner <sabre@nondot.org> Add support for printing out statistics information when -stats is added to
the command line


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2601 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
eadTypeElimination.cpp
lobalDCE.cpp
nlineSimple.cpp
nternalize.cpp
aiseAllocations.cpp
65e96e57c5b8a1d6837c5c0866717c2e4aa9e2fc 07-May-2002 Chris Lattner <sabre@nondot.org> fix comments and documentation in file


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2530 91177308-0d34-0410-b5e6-96231b3b80d8
aiseAllocations.cpp
ade686e79bdd4938a5fe99257afce41ca27e736b 07-May-2002 Chris Lattner <sabre@nondot.org> Split ChangeAllocations.cpp into Raise & LowerAllocations.cpp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2529 91177308-0d34-0410-b5e6-96231b3b80d8
aiseAllocations.cpp
c8cc4cb03bd90f89be7fe1649542a2d5ae689632 07-May-2002 Chris Lattner <sabre@nondot.org> Updates to move some header files out of include/llvm/Transforms into
the Scalar and Utils subdirectories


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2523 91177308-0d34-0410-b5e6-96231b3b80d8
ldPoolAllocate.cpp
497c60c0ed891f4a189287cf3c1ad44dfcfe3099 07-May-2002 Chris Lattner <sabre@nondot.org> Reduce dependance on TransformInternals.h, instead using the TransformUtils library


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2518 91177308-0d34-0410-b5e6-96231b3b80d8
eadTypeElimination.cpp
impleStructMutation.cpp
1f8d13c361ea7c62198fdede9781e38b32faa451 02-May-2002 Chris Lattner <sabre@nondot.org> Be a little more efficient, do not generate loads and stores with indices in them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2430 91177308-0d34-0410-b5e6-96231b3b80d8
ldPoolAllocate.cpp
f772f8ef387b9b168f814e5a7c4f9cc0834894bc 29-Apr-2002 Chris Lattner <sabre@nondot.org> Eliminate dead global variables


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2400 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
c6f3ae5c66c8e0dab6a2bd9601d0e253ef9ba794 29-Apr-2002 Chris Lattner <sabre@nondot.org> Eliminate duplicate or unneccesary #include's


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2397 91177308-0d34-0410-b5e6-96231b3b80d8
eadTypeElimination.cpp
lobalDCE.cpp
nlineSimple.cpp
ldPoolAllocate.cpp
96c466b06ab0c830b07329c1b16037f585ccbe40 29-Apr-2002 Chris Lattner <sabre@nondot.org> Add new optional getPassName() virtual function that a Pass can override
to make debugging output a lot nicer.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2395 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
eadTypeElimination.cpp
lobalDCE.cpp
nlineSimple.cpp
nternalize.cpp
ldPoolAllocate.cpp
impleStructMutation.cpp
97e52e43361e77963145b95a576db11b4d14d309 28-Apr-2002 Chris Lattner <sabre@nondot.org> Tighten up the AnalysisUsage of lots of passes, primarily to correctly indicate whether or not they invalidate the CFGA


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2386 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
31bcdb822fe9133b1973de51519d34e5813a6184 28-Apr-2002 Chris Lattner <sabre@nondot.org> Split ConstantVals.h into Constant.h and Constants.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2378 91177308-0d34-0410-b5e6-96231b3b80d8
utateStructTypes.cpp
ldPoolAllocate.cpp
100d6daca4e6b762735b32bb2a00ee32945e2a82 28-Apr-2002 Chris Lattner <sabre@nondot.org> Be careful not to make "external" function internal


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2363 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
dbb1735673ed177a85f04698b9cd89f2dc1b4e91 28-Apr-2002 Chris Lattner <sabre@nondot.org> Initial checkin of new "Internalize" pass for GCCLD


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2362 91177308-0d34-0410-b5e6-96231b3b80d8
nternalize.cpp
483e14ee0412a98db1fb0121528d8d621ae3dfdb 27-Apr-2002 Chris Lattner <sabre@nondot.org> s/Method/Function


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2336 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
f57b845547302d24ecb6a9e79d7bc386f761a6c9 27-Apr-2002 Chris Lattner <sabre@nondot.org> * Rename MethodPass class to FunctionPass
- Rename runOnMethod to runOnFunction
* Transform getAnalysisUsageInfo into getAnalysisUsage
- Method is now const
- It now takes one AnalysisUsage object to fill in instead of 3 vectors
to fill in
- Pass's now specify which other passes they _preserve_ not which ones
they modify (be conservative!)
- A pass can specify that it preserves all analyses (because it never
modifies the underlying program)
* s/Method/Function/g in other random places as well


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2333 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
eadTypeElimination.cpp
lobalDCE.cpp
nlineSimple.cpp
utateStructTypes.cpp
ldPoolAllocate.cpp
impleStructMutation.cpp
f2361c5e5c2917e6f19a55927b221d8671753a40 27-Apr-2002 Chris Lattner <sabre@nondot.org> Changes because the Terminator::getSuccessor function now FAILS if successor
IDX is out of range instead of returning null.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2332 91177308-0d34-0410-b5e6-96231b3b80d8
utateStructTypes.cpp
8e343330a5067be21ca3b42a824772a0dc801228 27-Apr-2002 Chris Lattner <sabre@nondot.org> * Change Constant::getNullConstant to Constant::getNullValue
* Add support for pool allocating array allocations of varying size


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2329 91177308-0d34-0410-b5e6-96231b3b80d8
ldPoolAllocate.cpp
7b5577b371cd96cf500108fa173b179a705e6857 19-Apr-2002 Chris Lattner <sabre@nondot.org> Programs that actually free memory were broken


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2307 91177308-0d34-0410-b5e6-96231b3b80d8
ldPoolAllocate.cpp
0154505ab74e7bd0d4dc85dbddc1ff0df6357606 18-Apr-2002 Chris Lattner <sabre@nondot.org> Add a fixme so that we don't forget this is broken.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2298 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
3b87167ac4f644bf0b7357d79319e20336ec3047 18-Apr-2002 Chris Lattner <sabre@nondot.org> Correctly transform dependant arguments, allowing the perimeter bm to work.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2282 91177308-0d34-0410-b5e6-96231b3b80d8
ldPoolAllocate.cpp
09b9212b6e581dd4a6007071607069586d7402f5 16-Apr-2002 Chris Lattner <sabre@nondot.org> run an extra pass after a function has been transformed to eliminate
obviously duplicate loads of the pool base.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2255 91177308-0d34-0410-b5e6-96231b3b80d8
ldPoolAllocate.cpp
3e0e520728fe13ae96f1e1137ef480968927ff55 14-Apr-2002 Chris Lattner <sabre@nondot.org> Turn off debug output


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2247 91177308-0d34-0410-b5e6-96231b3b80d8
ldPoolAllocate.cpp
441d25a9f60c226af35cd87bdf00285e62cf472c 14-Apr-2002 Chris Lattner <sabre@nondot.org> * Allow datasize to be specified on the commandline
* Build new datatypes correctly
* Transform instructions that return null pointers from functions to return
a null index.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2244 91177308-0d34-0410-b5e6-96231b3b80d8
ldPoolAllocate.cpp
ddcbd34f566e1b3cb1e91cab128703cf9d13136d 13-Apr-2002 Chris Lattner <sabre@nondot.org> * Give alloca's for pool descriptors better names than "pool<n>".
* Fill in the pool descriptor links in the pool descriptors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2239 91177308-0d34-0410-b5e6-96231b3b80d8
ldPoolAllocate.cpp
027a6755f8c68818eca9cfa6b24b1f7fa105f100 13-Apr-2002 Chris Lattner <sabre@nondot.org> * Add names to the symbol table for pool types and modified types
* Handle more complex structure so that power works almost
* Fix bug with pooldestroy call where we passed in the size of the object
instead of the pool to destroy. bisort is now pool allocated successfully!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2238 91177308-0d34-0410-b5e6-96231b3b80d8
ldPoolAllocate.cpp
5146a7ddd4ffe9cda6d68f24d91dd14deab3714a 12-Apr-2002 Chris Lattner <sabre@nondot.org> Implement function rewriting to use offsets instead of pointers in programs.
This now works with treeadd at least, and perhaps other programs as well.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2233 91177308-0d34-0410-b5e6-96231b3b80d8
ldPoolAllocate.cpp
265b083e84f09473de0693221b1b1777813d6e33 10-Apr-2002 Chris Lattner <sabre@nondot.org> * Add documentation
* Split the CleanGCC pass into two passes, a global pass and an IP pass.
Before it was just a global pass, but it did illegal things to the
module, which broke other passes that were being scheduled with it by
gccld.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2224 91177308-0d34-0410-b5e6-96231b3b80d8
eadTypeElimination.cpp
73e214244f2403b5ba0ef81b8839600f3c8ffebc 09-Apr-2002 Chris Lattner <sabre@nondot.org> Move FunctionArgument out of iOther.h into Argument.h and rename class to
be 'Argument' instead of FunctionArgument.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2216 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
utateStructTypes.cpp
ldPoolAllocate.cpp
42a412711c000d175d992dd1b85cfd04fd345e5b 09-Apr-2002 Chris Lattner <sabre@nondot.org> Add #includes to make up for #includes pruned out of header files.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2207 91177308-0d34-0410-b5e6-96231b3b80d8
utateStructTypes.cpp
ldPoolAllocate.cpp
237e6d10f24863cf48821b601b4164794e89d847 09-Apr-2002 Chris Lattner <sabre@nondot.org> s/Method/Function
Remove extraneous #includes of llvm/Assembly/Writer


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2178 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
utateStructTypes.cpp
impleStructMutation.cpp
2fbfdcffd3e0cf41422aaa6c526c37cb02b81341 07-Apr-2002 Chris Lattner <sabre@nondot.org> Change references to the Method class to be references to the Function
class. The Method class is obsolete (renamed) and all references to it
are being converted over to Function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2144 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
lobalDCE.cpp
nlineSimple.cpp
61f64f9b6a6262a0ee47aa73b23aa5315d5d64b8 04-Apr-2002 Chris Lattner <sabre@nondot.org> PATypeHolder is now not a template


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2106 91177308-0d34-0410-b5e6-96231b3b80d8
utateStructTypes.cpp
f8285d4d8f74dff1efd6edf283bbe30bd63e7854 01-Apr-2002 Chris Lattner <sabre@nondot.org> Allow scalars that point to multiple nodes when building the scalar map.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2087 91177308-0d34-0410-b5e6-96231b3b80d8
ldPoolAllocate.cpp
f7196949bb5743b12e4d2a694cb377c4363bda9f 01-Apr-2002 Chris Lattner <sabre@nondot.org> Add extra case here to avoid getting spurious output


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2086 91177308-0d34-0410-b5e6-96231b3b80d8
ldPoolAllocate.cpp
9acfbeeaa8c71badd51d06959c082f377176a620 31-Mar-2002 Chris Lattner <sabre@nondot.org> Add debug output


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2066 91177308-0d34-0410-b5e6-96231b3b80d8
ldPoolAllocate.cpp
072d3a02241a27473ee245b5aac783501d78161e 30-Mar-2002 Chris Lattner <sabre@nondot.org> * Catch and ignore (for now) return instructions in tranformed functions
* Add more debugging output
* Fix problems refering to wrong versions of various graphs
* Build the pool descriptor map!
* Clear the nodemapping map after building pool descriptor to avoid assert
* Transform the NEw function body, not the old one...
* Matrix.ll now works!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2058 91177308-0d34-0410-b5e6-96231b3b80d8
ldPoolAllocate.cpp
cfb5f4ce2e9e7a40402b7313159f378435488b62 30-Mar-2002 Chris Lattner <sabre@nondot.org> * Clean up data structures [AllocDSNode -> DSNode]
* TransformFunctionInfo now has call field form field mapping. May be
removed in the future.
* Moved the computation of "Scalars" into transformFunctionBody so
transformFunction didn't have to recompute it.
* Implement the node mapping calculation in preparation to calculate
PoolDescriptors to pass to transformFunctionBody
* Print out the node mapping [it looks right!]
* Other minor changes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2056 91177308-0d34-0410-b5e6-96231b3b80d8
ldPoolAllocate.cpp
4c7f3dfeaac9c9ca155c00f0eb05ffa90ed317f9 30-Mar-2002 Chris Lattner <sabre@nondot.org> Maintain enough information so that the pools for all of the nodes of
the graph can be passed around.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2053 91177308-0d34-0410-b5e6-96231b3b80d8
ldPoolAllocate.cpp
9d3493e533f73e4e955e10a830d582fb48508fca 29-Mar-2002 Chris Lattner <sabre@nondot.org> Implement the first batch of transformations to the methods. So far it:
* Converts malloc instructions to poolalloc
* Converts free instructions to poolfree
* Convert calls to call the new cloned hacked up versions

Note that this does not modify hacked up stuff yet, just the top level
function


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2052 91177308-0d34-0410-b5e6-96231b3b80d8
ldPoolAllocate.cpp
a74445185637b198b53430f0640f858be637ba73 29-Mar-2002 Chris Lattner <sabre@nondot.org> Correctly clone the function with the extra argument types. Now we need
to modify the function next.

This also properly recycles functions so that we don't get exponential
code blowup in the common case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2049 91177308-0d34-0410-b5e6-96231b3b80d8
ldPoolAllocate.cpp
f40b4792eb478e6703e9a839a3b0e1bc4776a3d5 29-Mar-2002 Chris Lattner <sabre@nondot.org> s/Method/Function


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2048 91177308-0d34-0410-b5e6-96231b3b80d8
utateStructTypes.cpp
d250f4294e6c56a817462eabb5ca05c8c30cf854 29-Mar-2002 Chris Lattner <sabre@nondot.org> Find out which calls in the function we need to transform and how.
Next step is to start hacking functions up.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2044 91177308-0d34-0410-b5e6-96231b3b80d8
ldPoolAllocate.cpp
dc89f87d52298131e2265815b65f7aa22388524f 29-Mar-2002 Chris Lattner <sabre@nondot.org> s/Method/Function


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2043 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
9d891904342c50af4d859866823382f03bdd9cb5 29-Mar-2002 Chris Lattner <sabre@nondot.org> Modularize code a bit


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2040 91177308-0d34-0410-b5e6-96231b3b80d8
ldPoolAllocate.cpp
54ce13f983c44134014d06b03bdf8eab82d9e8a2 29-Mar-2002 Chris Lattner <sabre@nondot.org> Implement the first step of pool allocation - Creating, initialization, and
destruction of the pools.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2039 91177308-0d34-0410-b5e6-96231b3b80d8
ldPoolAllocate.cpp
d2d3a16641a411006078cc25b59382635d51f925 29-Mar-2002 Chris Lattner <sabre@nondot.org> Flesh out a bunch more code, print allocations that are poolable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2031 91177308-0d34-0410-b5e6-96231b3b80d8
ldPoolAllocate.cpp
a637859c713df05ef6ff023616a9ab07303726f7 29-Mar-2002 Chris Lattner <sabre@nondot.org> s/method/function


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2030 91177308-0d34-0410-b5e6-96231b3b80d8
utateStructTypes.cpp
0d461f7f09731b34b21b99dab749dae89db241c3 29-Mar-2002 Chris Lattner <sabre@nondot.org> s/Method/Function/g


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2029 91177308-0d34-0410-b5e6-96231b3b80d8
eadTypeElimination.cpp
bda28f7c2aaae557c56a602117670263c8608a84 28-Mar-2002 Chris Lattner <sabre@nondot.org> Initial checkin of Noop pass that will be the pool allocator


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2014 91177308-0d34-0410-b5e6-96231b3b80d8
ldPoolAllocate.cpp
79df7c0aaa18129e55968c8783ef8346807bd4af 26-Mar-2002 Chris Lattner <sabre@nondot.org> Change references from Method to Function
change references from MethodARgument to FunctionArgument


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1991 91177308-0d34-0410-b5e6-96231b3b80d8
eadTypeElimination.cpp
utateStructTypes.cpp
f09733a8766aaa331d7e5196ea36cd9c6bb82100 15-Mar-2002 Chris Lattner <sabre@nondot.org> Remove code designed to compensate for a bug in GCC. The bug has since
been fixed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1881 91177308-0d34-0410-b5e6-96231b3b80d8
eadTypeElimination.cpp
4ce0f8aa9ee0038ba741291e2ae1188be75d1d8b 06-Mar-2002 Chris Lattner <sabre@nondot.org> Take CallGraph out of the CFG namespace. It has nothing to do with CFGs


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1820 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
utateStructTypes.cpp
bd0ef77cde9c9e82f2b4ad33e4982c46274d6540 26-Feb-2002 Chris Lattner <sabre@nondot.org> Change over to use new style pass mechanism, now passes only expose small
creation functions in their public header file, unless they can help it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1816 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
eadTypeElimination.cpp
lobalDCE.cpp
nlineSimple.cpp
impleStructMutation.cpp
41b66b12e8be5024b0d8506b5b61a425a2becd49 25-Feb-2002 Chris Lattner <sabre@nondot.org> When inlining basic blocks and instructions, give them a name!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1796 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
e0f2753bb87f97fbbfc0f6820715156dc4d45b90 18-Feb-2002 Chris Lattner <sabre@nondot.org> Handle more cases in the linker


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1771 91177308-0d34-0410-b5e6-96231b3b80d8
eadTypeElimination.cpp
455889aa79e3463a4b0f2161e3d9d72a683268b6 12-Feb-2002 Chris Lattner <sabre@nondot.org> * Pull BasicBlock::pred_* and BasicBlock::succ_* out of BasicBlock.h and into
llvm/Support/CFG.h
* Make pred & succ iterators for intervals global functions
* Add #includes that are now neccesary because BasicBlock.h doesn't include
InstrTypes.h anymore


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1750 91177308-0d34-0410-b5e6-96231b3b80d8
eadTypeElimination.cpp
793c6b80d3e322c3fefb3c7314b054c7880d1691 31-Jan-2002 Chris Lattner <sabre@nondot.org> Convert xforms over to new pass structure.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1605 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
eadTypeElimination.cpp
lobalDCE.cpp
utateStructTypes.cpp
impleStructMutation.cpp
5048c3b853b8be541479e300705a88375569c8b1 22-Jan-2002 Chris Lattner <sabre@nondot.org> Pull RaiseAllocations stuff out of the CleanGCC pass into it's own pass in
the ChangeAllocations.h header file.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1522 91177308-0d34-0410-b5e6-96231b3b80d8
eadTypeElimination.cpp
59b6b8e0b3e51dd899da25bd25b0793cc8229eea 22-Jan-2002 Chris Lattner <sabre@nondot.org> Move stuff out of the Optimizations directories into the appropriate Transforms
directories. Eliminate the opt namespace.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1520 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
04c85dcad8f67d2bb2e0e5d051d130f90e473d86 21-Jan-2002 Chris Lattner <sabre@nondot.org> Rename SwapStructureContents -> IPO/SimpleStructMutation
Move MutateStructTypes.(cpp|h) -> IPO/MutateStructTypes.(cpp|h)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1510 91177308-0d34-0410-b5e6-96231b3b80d8
utateStructTypes.cpp
impleStructMutation.cpp
f4de63f65fa995e68e3cd268117ab065068be413 21-Jan-2002 Chris Lattner <sabre@nondot.org> Implement a more powerful, simpler, pass system. This pass system can figure
out how to run a collection of passes optimially given their behaviors and
charactaristics.

Convert code to use it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1507 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
eadTypeElimination.cpp
lobalDCE.cpp
utateStructTypes.cpp
impleStructMutation.cpp
697954c15da58bd8b186dbafdedd8b06db770201 20-Jan-2002 Chris Lattner <sabre@nondot.org> Changes to build successfully with GCC 3.02


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1503 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
eadTypeElimination.cpp
lobalDCE.cpp
nlineSimple.cpp
utateStructTypes.cpp
impleStructMutation.cpp
206ad80ef96ed6d9b4d2f8e4711a39df1278eb47 14-Dec-2001 Chris Lattner <sabre@nondot.org> The proper prototype for malloc returns a pointer, not an unsized array


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1463 91177308-0d34-0410-b5e6-96231b3b80d8
eadTypeElimination.cpp
7a1767520611d9ff6face702068de858e1cadf2c 04-Dec-2001 Chris Lattner <sabre@nondot.org> Renamed inst_const_iterator -> const_inst_iterator
Renamed op_const_iterator -> const_op_iterator
Renamed PointerType::getValueType() -> PointerType::getElementType()


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1408 91177308-0d34-0410-b5e6-96231b3b80d8
eadTypeElimination.cpp
utateStructTypes.cpp
e9bb2df410f7a22decad9a883f7139d5857c1520 03-Dec-2001 Chris Lattner <sabre@nondot.org> Rename ConstPoolVal -> Constant
Rename ConstPool* -> Constant*
Rename ConstPoolVals.h -> ConstantVals.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1407 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
eadTypeElimination.cpp
nlineSimple.cpp
utateStructTypes.cpp
7061dc50b2513731d7b346ab16183cda4a44619f 03-Dec-2001 Chris Lattner <sabre@nondot.org> Split the PHINode class out from the iOther.h file into the iPHINode.h file


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1405 91177308-0d34-0410-b5e6-96231b3b80d8
eadTypeElimination.cpp
nlineSimple.cpp
utateStructTypes.cpp
cee8f9ae67104576b2028125b56e9ba4856a1d66 27-Nov-2001 Chris Lattner <sabre@nondot.org> Create a new #include "Support/..." directory structure to move things
from "llvm/Support/..." that are not llvm dependant.

Move files and fix #includes


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1400 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
e81dc1dd94c96023c72d297b37298c08df4d24d7 26-Nov-2001 Chris Lattner <sabre@nondot.org> Remove debugging output


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1383 91177308-0d34-0410-b5e6-96231b3b80d8
impleStructMutation.cpp
c54692b969319888f9838020928d072b0474c9eb 26-Nov-2001 Chris Lattner <sabre@nondot.org> Support internal linkage


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1382 91177308-0d34-0410-b5e6-96231b3b80d8
utateStructTypes.cpp
30474bb92912b5097d8a515fae1ce1f53676c2b2 26-Nov-2001 Chris Lattner <sabre@nondot.org> Implement DCE of global values


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1360 91177308-0d34-0410-b5e6-96231b3b80d8
lobalDCE.cpp
akefile
12739d9f871b89f8a0b0db4cd2b15c7584029781 26-Nov-2001 Chris Lattner <sabre@nondot.org> Support selectable structure transformations


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1342 91177308-0d34-0410-b5e6-96231b3b80d8
impleStructMutation.cpp
8090e8c18e7093fc3706a5a5d688143f3effe513 26-Nov-2001 Chris Lattner <sabre@nondot.org> Support mutation of array indexing


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1341 91177308-0d34-0410-b5e6-96231b3b80d8
utateStructTypes.cpp
430aa9ec1c462886be420f000d62ddd93fc45250 15-Nov-2001 Chris Lattner <sabre@nondot.org> -cleangcc pass now remove type names that are never referenced and type names for pointers to primitive types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1312 91177308-0d34-0410-b5e6-96231b3b80d8
eadTypeElimination.cpp
d5b48ca422089a17fa6ba2945d3f8b46fff7d689 14-Nov-2001 Chris Lattner <sabre@nondot.org> Better heuristics for handling arrays


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1296 91177308-0d34-0410-b5e6-96231b3b80d8
impleStructMutation.cpp
fd79ab50889e1072958cb593a312d6861c5f34cb 12-Nov-2001 Chris Lattner <sabre@nondot.org> Fix minor bug


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1273 91177308-0d34-0410-b5e6-96231b3b80d8
eadTypeElimination.cpp
7546c21ae10204dee71d2186e6698a3c8dda68cb 10-Nov-2001 Chris Lattner <sabre@nondot.org> Initail checking of structure swapper


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1248 91177308-0d34-0410-b5e6-96231b3b80d8
impleStructMutation.cpp
bff7c3a898f103bfaa224b2a14428029e24db8ab 10-Nov-2001 Chris Lattner <sabre@nondot.org> Initial checkin of structure mutator


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1246 91177308-0d34-0410-b5e6-96231b3b80d8
utateStructTypes.cpp
277b4e4a9b490756149877661457377d178038b0 05-Nov-2001 Chris Lattner <sabre@nondot.org> Don't print spurious linking warnings about methods that are never used.
Cleanup ExprTypeConvert a bit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1141 91177308-0d34-0410-b5e6-96231b3b80d8
eadTypeElimination.cpp
59cd9f1e9fcad6b40fc522010512f60ec10151d0 05-Nov-2001 Chris Lattner <sabre@nondot.org> Refactor code to share stuff


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1127 91177308-0d34-0410-b5e6-96231b3b80d8
eadTypeElimination.cpp
ab9f21f4c4ce5224408b8566bdf3773e5b593367 04-Nov-2001 Chris Lattner <sabre@nondot.org> Fix cast instructions that end up in bad places in GCC output


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1117 91177308-0d34-0410-b5e6-96231b3b80d8
eadTypeElimination.cpp
5b497ee7c24b0cff0b5b5064b086d2ad4b190b6f 03-Nov-2001 Chris Lattner <sabre@nondot.org> Add new cleanup pass:
// 1. PHI nodes with multiple entries for the same predecessor. GCC sometimes
// generates code that looks like this:
//
// bb7: br bool %cond1004, label %bb8, label %bb8
// bb8: %reg119 = phi uint [ 0, %bb7 ], [ 1, %bb7 ]
//
// which is completely illegal LLVM code. To compensate for this, we insert
// an extra basic block, and convert the code to look like this:
//
// bb7: br bool %cond1004, label %bbX, label %bb8
// bbX: br label bb8
// bb8: %reg119 = phi uint [ 0, %bbX ], [ 1, %bb7 ]
//


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1114 91177308-0d34-0410-b5e6-96231b3b80d8
eadTypeElimination.cpp
b20807f23e331d43a4a6308ccd137bf8bba88e86 03-Nov-2001 Chris Lattner <sabre@nondot.org> * Export method to merge identically named methods
* Add code to fix PHI nodes that are missing arguments. These PHI nodes can
be generated by GCC if there is an uninitialized variable flowing into a merge
point. For example:

int foo(int y) {
int X;
if (y) X = 1;
return X;
}


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1110 91177308-0d34-0410-b5e6-96231b3b80d8
eadTypeElimination.cpp
055c963f5888bd7dc6241f84791abf2146df06d6 03-Nov-2001 Chris Lattner <sabre@nondot.org> Changes to compile the TSP benchmark successfully. Favor warning instead of assertion failures.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1103 91177308-0d34-0410-b5e6-96231b3b80d8
eadTypeElimination.cpp
b6b26921e3a6e0375b76e17e67d8a87dc34bda58 03-Nov-2001 Chris Lattner <sabre@nondot.org> Add code to link method together with the same name if one is vararg and the other isn't.
This resolves definitions like this:
%list * "foo"(...)
%list * "foo"(int)

together which can often occur because C programmers don't put prototypes in like they should. GRR


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1102 91177308-0d34-0410-b5e6-96231b3b80d8
eadTypeElimination.cpp
591bda986e750146133f31bedcff9952a822f0a7 01-Nov-2001 Chris Lattner <sabre@nondot.org> Propogate name to the malloc itself instead of to the cast


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1071 91177308-0d34-0410-b5e6-96231b3b80d8
eadTypeElimination.cpp
bfe11108adef46a7e366d07c9d04afb88a1966a9 31-Oct-2001 Chris Lattner <sabre@nondot.org> Implement code to convert %malloc and %free FUNCTION CALLS into the instruction equivalent


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1065 91177308-0d34-0410-b5e6-96231b3b80d8
eadTypeElimination.cpp
e51e03b3c649ed9419bd0e920c03ef9023ccee48 31-Oct-2001 Chris Lattner <sabre@nondot.org> Initial version of GCC cleanup pass: just removes extraneous global symbol table entries for types


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1062 91177308-0d34-0410-b5e6-96231b3b80d8
eadTypeElimination.cpp
4f68528de4d3f9746bb93ad3b58e86a7ae353491 31-Oct-2001 Chris Lattner <sabre@nondot.org> Fix bug when inlining a method that refers to a global variable


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@1056 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
475becb7bc835680c0b6973e8b7be0918f55cffd 18-Oct-2001 Chris Lattner <sabre@nondot.org> Initial checkin


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@897 91177308-0d34-0410-b5e6-96231b3b80d8
onstantMerge.cpp
5680ee6b28974c9cf6cab9f603d30e6eda2715bc 18-Oct-2001 Chris Lattner <sabre@nondot.org> Convert optimizations to the pass infrastructure


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@873 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
5fdc4c91ae9defb3d511fba103514b8dcc0955e1 15-Oct-2001 Chris Lattner <sabre@nondot.org> Minor cleanup


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@812 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
5a0d4179df79280d37b1cf9fdc8ba8b90c33ee13 13-Oct-2001 Chris Lattner <sabre@nondot.org> Support indirect calls


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@764 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
b00c582b6d40e6b9ff2d1ed4f5eaf7930e792ace 02-Oct-2001 Chris Lattner <sabre@nondot.org> Commit more code over to new cast style


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@697 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
1d87bcf4909b06dcd86320722653341f08b8b396 01-Oct-2001 Chris Lattner <sabre@nondot.org> Convert more code to use new style casts
Eliminate old style casts from value.h


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@696 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
78721d54186cad8db817bad13360dad286524945 07-Sep-2001 Chris Lattner <sabre@nondot.org> Constant pool is dead


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@455 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
bc7135f5c0aa0c1045e18ff18c98633349dc660c 15-Jul-2001 Chris Lattner <sabre@nondot.org> Support external methods


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@200 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
a41f50dea8573e4a610b5aa5e45b5c368559b084 07-Jul-2001 Chris Lattner <sabre@nondot.org> Broad superficial changes:
* Renamed getOpcode to getOpcodeName
* Changed getOpcodeName to return a const char * instead of string
* Added a getOpcode method to replace getInstType
* Changed code to use getOpcode instead of getInstType


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@152 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
c8b25d40cbec063b1ca99cc1adf794399c6d05c0 07-Jul-2001 Chris Lattner <sabre@nondot.org> Changed the fundemental architecture of Operands for Instructions. Now
Operands are maintained as a vector<Use> in the User class, and operator
iterators are provided as before. Getting an operand no longer requires
a virtual function call.

WARNING: getOperand(x) where x >= getNumOperands() will now assert instead
of returning null!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@149 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
7e02b7e600ce8b719b34e2df7a7e44310229564d 30-Jun-2001 Chris Lattner <sabre@nondot.org> Optimizations got their own header files
Optimizations now live in the 'opt' namespace
include/llvm/Opt was renamed include/llvm/Optimizations


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@113 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
7fc9fe34390c66ca58646d09a87f7dbaacb6c1f8 28-Jun-2001 Chris Lattner <sabre@nondot.org> Miscellaneous cleanups:
* Convert post to pre-increment for for loops
* Use generic programming more
* Use new Value::cast* instructions
* Use new Module, Method, & BasicBlock forwarding methods
* Use new facilities in STLExtras.h
* Use new Instruction::isPHINode() method


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@96 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
ee976f33713016a96e3fbb394b7d0c5465be25d7 11-Jun-2001 Chris Lattner <sabre@nondot.org> Updates to support
* Changes in PHI node structure


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp
009505452b713ed2e3a8e99c5545a6e721c65495 06-Jun-2001 Chris Lattner <sabre@nondot.org> Initial revision


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2 91177308-0d34-0410-b5e6-96231b3b80d8
nlineSimple.cpp