Commit Graph

1242 Commits

Author SHA1 Message Date
Dale Johannesen
f8bc300821 Don't generate a select whose operand is load of a weak
external.  These may have address 0 and are not safe
to execute unconditionally.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71688 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-13 18:25:07 +00:00
Duncan Sands
777d2306b3 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
2009-05-09 07:06:46 +00:00
Eli Friedman
5877ad7e90 PR4123: don't crash when inlining a call which uses its own result.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71199 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-08 00:22:04 +00:00
Dan Gohman
e9d87f4906 Simplify code by using SmallVector's pop_back_val() instead of
separate back() and pop_back() calls.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71089 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-06 17:22:41 +00:00
Duncan Sands
7af1c78b98 Allow readonly functions to unwind exceptions. Teach
the optimizers about this.  For example, a readonly
function with no uses cannot be removed unless it is
also marked nounwind.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71071 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-06 06:49:50 +00:00
Dan Gohman
35738ac150 Re-apply 70645, converting ScalarEvolution to use
CallbackVH, with fixes. allUsesReplacedWith need to
walk the def-use chains and invalidate all users of a
value that is replaced. SCEVs of users need to be
recalcualted even if the new value is equivalent. Also,
make forgetLoopPHIs walk def-use chains, since any
SCEV that depends on a PHI should be recalculated when
more information about that PHI becomes available.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70927 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-04 22:30:44 +00:00
Mike Stump
fe095f39e7 Restore minor deletion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70892 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-04 18:40:41 +00:00
Dan Gohman
f9a77b77c2 Revert r70645 for now; it's causing a variety of regressions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70661 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-03 05:46:20 +00:00
Dan Gohman
db6fa29641 Convert ScalarEvolution to use CallbackVH for its internal map. This
makes ScalarEvolution::deleteValueFromRecords, and it's code that
subtly needed to be called before ReplaceAllUsesWith, unnecessary.

It also makes ValueDeletionListener unnecessary.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70645 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-02 21:19:20 +00:00
Dan Gohman
afc36a9520 Previously, RecursivelyDeleteDeadInstructions provided an option
of returning a list of pointers to Values that are deleted. This was
unsafe, because the pointers in the list are, by nature of what
RecursivelyDeleteDeadInstructions does, always dangling. Replace this
with a simple callback mechanism. This may eventually be removed if
all clients can reasonably be expected to use CallbackVH.

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

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


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@70636 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-02 18:29:22 +00:00
Owen Anderson
7db2789251 Real fix for PR3549, by using caching for predecessor counts in addition to the predecessors themselves. This halves the time
to optimize the testcase, beyond what my previous patch did.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69792 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-22 08:50:12 +00:00
Owen Anderson
68fbd735f1 Use PredIteratorCache in LCSSA, which gives a 37% overall speedup on the testcase from PR3549. More improvements to come.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69788 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-22 08:09:13 +00:00
Chris Lattner
41b1a489f5 use predicate instead of hand-rolled loop
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69752 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-21 23:37:18 +00:00
Jim Grosbach
46445389d3 remove trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69402 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-17 23:30:55 +00:00
Eli Friedman
bde6fda729 Fix for PR3944: make mem2reg O(N) instead of O(N^2) in the number of
incoming edges for a block with many predecessors.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69312 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-16 21:40:28 +00:00
Devang Patel
517576d6f9 While inlining, clone llvm.dbg.func.start intrinsic and adjust
llvm.dbg.region.end instrinsic. This nested llvm.dbg.func.start/llvm.dbg.region.end pair now enables DW_TAG_inlined_subroutine support in code generator.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@69118 91177308-0d34-0410-b5e6-96231b3b80d8
2009-04-15 00:17:06 +00:00
Devang Patel
28c531cdbb Update call graph after inlining invoke.
Patch by Jay Foad.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@68120 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-31 17:36:12 +00:00
Dan Gohman
f871ccb853 Now that errs() is properly non-buffered, there's no need to
explicitly flush it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67526 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-23 15:57:19 +00:00
Duncan Sands
64da9409cb Factorize out a concept - no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67454 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-21 21:27:31 +00:00
Duncan Sands
ab6b226978 Don't load values out of global constants with weak
linkage: the value may be replaced with something
different at link time.  (Frontends that want to
allow values to be loaded out of weak constants can
give their constants weak_odr linkage).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67407 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-20 21:53:29 +00:00
Dale Johannesen
f33b1103a1 Fix comment typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67307 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-19 17:23:29 +00:00
Zhou Sheng
16767c6b49 Revert my previous change on Local.cpp, instead, fix the bug on scalarrepl.
If the instruction has no users, it is also not only used by debug info 
and should not be deleted.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67194 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-18 10:13:08 +00:00
Zhou Sheng
df95a2f6a9 Fix a bug.
If I->use_empty(), this method should return false.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@67180 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-18 07:56:13 +00:00
Bill Wendling
9a507cd915 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
2009-03-13 21:15:59 +00:00
Gabor Greif
b14cda3c0d 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
2009-03-13 18:27:29 +00:00
Dale Johannesen
990afedb3a Fix one more place where debug info affected
codegen (speculative execution).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66859 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-13 01:05:24 +00:00
Dale Johannesen
8483e54837 Previous debug info fix to this code wasn't quite
right; did the wrong thing when there are exactly 11
non-debug instructions, followed by debug info.
Remove a FIXME since it's apparently been fixed along the way.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66840 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-12 23:18:09 +00:00
Dale Johannesen
c81f5445a7 There already was a class to force deterministic
sorting of ConstantInt's; unreinvent wheel.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66824 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-12 21:01:11 +00:00
Dale Johannesen
80b8a62fda Another missing check for debug intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66800 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-12 17:42:45 +00:00
Dale Johannesen
1379cadf8d Allow for switch values bigger than 64 bits.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66751 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-12 01:20:06 +00:00
Dale Johannesen
a9537cf3fc Fix some nondeterministic behavior when forwarding
from a switch table.  Multiple table entries that
branch to the same place were being sorted by the
pointer value of the ConstantInt*; changed to sort
by the actual value of the ConstantInt.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66749 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-12 01:00:26 +00:00
Dale Johannesen
8aa90feb3d Don't consider debug intrinsics when checking
whether a callee to be inlined is a leaf.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66588 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-10 22:20:02 +00:00
Devang Patel
9200c89968 Ignore dbg info, while estimating size of jump through block.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66554 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-10 18:00:05 +00:00
Evan Cheng
8c7848f17f If a function is marked alwaysinline, it must be inlined (possibly for correctness). Do so even if the callee has dynamic alloca and the caller doesn't.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66539 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-10 07:57:50 +00:00
Duncan Sands
667d4b8de6 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
2009-03-07 15:45:40 +00:00
Dale Johannesen
3a56d14641 Fix another case where debug info interferes with
an optimization.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66288 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-06 21:08:33 +00:00
Devang Patel
06b1e67d44 While hoisting instruction to speculatively execute simple bb, ignore dbg intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66255 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-06 06:00:17 +00:00
Dale Johannesen
2511abf6e7 Tweak the check for promotable alloca's to handle
debug intrinsics correctly.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66225 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-06 00:42:50 +00:00
Devang Patel
c79e118247 Add "check/remove dbg var" helper routines.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66223 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-06 00:19:37 +00:00
Dale Johannesen
0744f09efc Revert unintended commmit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66001 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-04 02:09:48 +00:00
Dale Johannesen
d9c05d7711 Skip ptr-to-ptr bitcasts when counting in another case.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@66000 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-04 02:06:53 +00:00
Dale Johannesen
cdb16aa5ab Always skip ptr-to-ptr bitcasts when counting,
per Chris' suggestion.  Slightly faster.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65999 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-04 01:53:05 +00:00
Dale Johannesen
127a7936de Marking debug info intrinsics as not touching memory
caused them to be considered trivially dead.  Fix this.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65979 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-03 23:30:00 +00:00
Dale Johannesen
4ded40a44d Instruction counters must skip the bitcasts that
feed into llvm.dbg.declare nodes, as well as
the debug directives themselves.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65976 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-03 22:36:47 +00:00
Dale Johannesen
4945c65784 When removing a store to an alloca that has only one
use, check also for the case where it has two uses,
the other being a llvm.dbg.declare.  This is needed so
debug info doesn't affect codegen.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65970 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-03 21:26:39 +00:00
Bill Wendling
1c85503e38 Remove accidental check-ins in r65960. :-(
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65961 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-03 19:25:16 +00:00
Bill Wendling
3aaf5d9933 Use > instead of >=. We want to promote aggregates of 128-bytes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65960 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-03 19:18:49 +00:00
Dan Gohman
0f8b53f19d Fix a bunch of Doxygen syntax issues. Escape special characters,
and put @file directives on their own comment line.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65920 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-03 02:55:14 +00:00
Dale Johannesen
bd8e650876 When sinking an insn in InstCombine bring its debug
info with it.
Don't count debug info insns against the scan maximum
in FindAvailableLoadedValue (lest they affect codegen).



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65910 91177308-0d34-0410-b5e6-96231b3b80d8
2009-03-03 01:09:07 +00:00
Nick Lewycky
7569af769e Fix compiler warning about uninitialized variables. No functional change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65620 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-27 06:29:31 +00:00
Zhou Sheng
a8d57fe96b Ignore dbg info intrinsics when folding conditional branch to
conditional branch predecessors.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65509 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-26 06:56:37 +00:00
Zhou Sheng
9a7c743fc0 Don't block basic block with only SwitchInst to fold into predecessors.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65456 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-25 15:34:27 +00:00
Devang Patel
5622f07a21 While folding unconditional return move DbgRegionEndInst into the predecessor, instead of removing it. This fixes following tests from llvmgcc42 testsuite.
gcc.c-torture/execute/20000605-3.c
gcc.c-torture/execute/20020619-1.c
gcc.c-torture/execute/20030920-1.c
gcc.c-torture/execute/loop-ivopts-1.c



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65353 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-24 00:05:16 +00:00
Mon P Wang
b0000c376c Changed option name from inline-threshold to basic-inline-threshold because
inline-threshold option is used by the inliner.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65309 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-23 07:07:56 +00:00
Evan Cheng
b0ea08066c Add AddrModeMatcher.cpp
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65228 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-21 07:05:11 +00:00
Evan Cheng
a1fd5b386d Factor address mode matcher out of codegen prepare to make it available to other passes, e.g. loop strength reduction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65134 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 18:24:38 +00:00
Zhou Sheng
3f315eb5e0 Just roll back the previous change to -mem2reg.
Will re-think about this according to Chris's comments.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65126 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 17:49:33 +00:00
Zhou Sheng
a248c45e00 patch to update the line number information in pass -mem2reg.
Currently this pass will delete the variable declaration info, 
and keep the line number info. But the kept line number info is not updated, 
and some is redundant or not correct, this patch just updates those info.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@65123 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-20 16:31:35 +00:00
Nick Lewycky
586a7c4a37 Fix typo caused by too much surfing, dudes...
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64626 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-16 04:26:53 +00:00
Chris Lattner
af9985c6b9 Fix a nasty bug (PR3550) where the inline pass could incorrectly mark
calls with the tail marker when inlining them through an invoke.  Patch,
testcase, and perfect analysis by Jay Foad!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64364 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-12 07:06:42 +00:00
Devang Patel
bd75b8345f If llvm.dbg.region.end is disappearing then remove corresponding llvm.dbg.func.start also.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64278 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-11 01:29:06 +00:00
Devang Patel
0464a1431b Ignore dbg intrinsic while folding unconditional branch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64242 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-10 22:14:17 +00:00
Devang Patel
f66d7b5a51 Do not clone llvm.dbg.func.start and corresponding llvm.dbg.region.end during inlining.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64209 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-10 07:48:18 +00:00
Devang Patel
4afc90dacf Enable scalar replacement of AllocaInst whose one of the user is dbg info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64207 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-10 07:00:59 +00:00
Devang Patel
998cbb0444 Revert rev. 63876. It is causing llvm-gcc bootstrap failure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63888 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-05 21:46:41 +00:00
Devang Patel
1851db6b0f Ignore dbg intrinsics while propagating conditional expression info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63876 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-05 19:15:39 +00:00
Devang Patel
2cc86a1de1 Ignore dbg intrinsics while folding switch instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63802 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-05 00:30:42 +00:00
Devang Patel
d0a203d76f Ignore dbg intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63781 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-04 21:39:48 +00:00
Devang Patel
556b20ab46 While folding vallue comparison terminators ignore dbg intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63700 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-04 01:06:11 +00:00
Devang Patel
65085cf7b3 Ignore dbg intrinsics while hoisting common code in the two blocks up into the branch block.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63687 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-04 00:03:08 +00:00
Devang Patel
383d7ed915 Do not let dbg intrinsic block folding of two entry phi node.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63671 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-03 22:12:02 +00:00
Nick Lewycky
2eafb8b404 Revert r63600. It didn't fix the bug, it just moved it a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63618 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-03 06:30:37 +00:00
Nick Lewycky
dac5c4b10b Update the callgraph when replacing InvokeInst with CallInst when inlining.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63600 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-03 04:34:40 +00:00
Gabor Greif
c1bb13f1b8 use precise getters
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63402 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-30 18:21:13 +00:00
Duncan Sands
1465d61bdd Rename getAnalysisToUpdate to getAnalysisIfAvailable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63198 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-28 13:14:17 +00:00
Dale Johannesen
381e6f6b7d Revert previous change; even this mild and clearly
more accurate change loses more than it gains on
benchmarks.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62938 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-24 21:49:34 +00:00
Dale Johannesen
e4e094b52d Improve the inlining cost function a bit.
Little practical effect.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62908 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-24 01:27:33 +00:00
Gabor Greif
a36791da41 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
2009-01-23 19:40:15 +00:00
Chris Lattner
63bf29b5b1 another fix for PR3354
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62561 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-20 01:15:41 +00:00
Bill Wendling
5049fa6bbc Doxygen-ify comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62546 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-19 23:43:56 +00:00
Chris Lattner
6ff645bf0f Fix a problem exposed by PR3354: simplifycfg was making a potentially
trapping instruction be executed unconditionally.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62541 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-19 23:03:13 +00:00
Bill Wendling
13524bfd00 Temporarily revert r62487. It's causing this error during a release bootstrap of
llvm-gcc. Most likely, it's miscompiling one of the "gen*" programs:

/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.obj/./prev-gcc/xgcc -B/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.obj/./prev-gcc/ -B/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm-gcc.install/i386-apple-darwin9.6.0/bin/ -c -g -O2 -mdynamic-no-pic -DIN_GCC -W -Wall -Wwrite-strings -Wstrict-prototypes -Wmissing-prototypes -mdynamic-no-pic -DHAVE_CONFIG_H -DGENERATOR_FILE -I. -Ibuild -I../../llvm-gcc.src/gcc -I../../llvm-gcc.src/gcc/build -I../../llvm-gcc.src/gcc/../include -I./../intl -I../../llvm-gcc.src/gcc/../libcpp/include  -I../../llvm-gcc.src/gcc/../libdecnumber -I../libdecnumber -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.obj/include -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/include -DENABLE_LLVM -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.obj/../llvm.src/include  -D_DEBUG  -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS   -o build/gencondmd.o build/gencondmd.c
../../llvm-gcc.src/gcc/config/i386/mmx.md:926: error: expected '}' before ')' token
../../llvm-gcc.src/gcc/config/i386/mmx.md:926: warning: excess elements in struct initializer
../../llvm-gcc.src/gcc/config/i386/mmx.md:926: warning: (near initialization for 'insn_conditions[4]')
../../llvm-gcc.src/gcc/config/i386/mmx.md:926: error: expected '}' before ')' token
../../llvm-gcc.src/gcc/config/i386/mmx.md:926: error: expected ',' or ';' before ')' token
../../llvm-gcc.src/gcc/config/i386/mmx.md:927: error: expected identifier or '(' before ',' token
../../llvm-gcc.src/gcc/config/i386/sse.md:3458: error: expected identifier or '(' before ',' token
...



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62506 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-19 08:46:20 +00:00
Chris Lattner
c4f85dd708 Fix PR3016, a bug which can occur do to an invalid assumption:
we assumed a CFG structure that would be valid when all code in 
the function is reachable, but not all code is necessarily 
reachable.  Do a simple, but horrible, CFG walk to check for this
case.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62487 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-19 02:46:28 +00:00
Chris Lattner
9e0dad4f41 reduce indentation by using 'continue', no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62477 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-19 02:07:32 +00:00
Chris Lattner
6fe73bbcf3 Fix some problems in SpeculativelyExecuteBB. Basically,
because of dead code, a phi could use the speculated instruction
that was not in "BB2".  Make this check explicit and tighten up 
some other corners.  This fixes PR3292.  No testcase becauase this
depends entirely on visitation order of blocks and requires a 
sequence of 8 passes to repro.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62476 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-19 00:36:37 +00:00
Chris Lattner
9dd3b610dc Make this a bit more explicit about which cases need the
check.  No functionality change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62474 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-18 23:22:07 +00:00
Gabor Greif
125329891f introduce typedef for complicated vector, and use it too
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62384 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-17 00:09:08 +00:00
Gabor Greif
de62aeaec4 typo
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62377 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-16 23:08:50 +00:00
Rafael Espindola
bb46f52027 Add the private linkage.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62279 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-15 20:18:42 +00:00
Gabor Greif
c478e52bf4 avoid using iterators when they get invalidated potentially
this fixes PR3332

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62271 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-15 18:40:09 +00:00
Dale Johannesen
39fa32403e Fix testsuite regressions from recursive inlining.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62189 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-13 22:43:37 +00:00
Dale Johannesen
cbfdf9644c 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
2009-01-12 22:11:50 +00:00
Duncan Sands
ceb4d1aecb 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
2009-01-12 20:38:59 +00:00
Misha Brukman
9b8f542e27 Removed trailing whitespace from Makefiles.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61991 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-09 16:44:42 +00:00
Dale Johannesen
e345566f8e Adjustments to last patch based on review.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61969 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-09 01:30:11 +00:00
Dale Johannesen
4362387c74 Do not inline functions with (dynamic) alloca into
functions that don't already have a (dynamic) alloca.
Dynamic allocas cause inefficient codegen and we shouldn't
propagate this (behavior follows gcc).  Two existing tests
assumed such inlining would be done; they are hacked by
adding an alloca in the caller, preserving the point of
the tests.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61946 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-08 21:45:23 +00:00
Dan Gohman
d68a07650c Tidy up #includes, deleting a bunch of unnecessary #includes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61715 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 17:59:02 +00:00
Chris Lattner
31535f1f04 Fix PR2929 by making bugpoint/code extract propagate the nothrow
bit from the original function to the cloned one.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61194 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-18 05:52:56 +00:00
Chris Lattner
24313e7aba make instnamer name unnamed blocks as well as instructions and args.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61175 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-18 00:33:11 +00:00
Eli Friedman
080efb8cea Add a helper to remove a branch and DCE the condition, and use it
consistently for deleting branches.  In addition to being slightly 
more readable, this makes SimplifyCFG a bit better 
about cleaning up after itself when it makes conditions unused.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61100 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-16 20:54:32 +00:00
Misha Brukman
a4a83c314c Fix spelling.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60971 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-13 05:21:37 +00:00
Chris Lattner
a16ead8b10 fix a bug I introduced in simplifycfg handling single entry phi
nodes. FoldSingleEntryPHINodes deletes the PHI, so there is no
need to delete it afterward.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60653 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-07 07:22:45 +00:00
Chris Lattner
29874e0dc6 Factor some code into a new FoldSingleEntryPHINodes method.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60501 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 19:44:02 +00:00
Chris Lattner
2973a25dbc third time is the charm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60469 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 07:45:15 +00:00
Chris Lattner
15efa1a1fd fix assertion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60468 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 07:43:05 +00:00
Chris Lattner
71af9b07a5 Rename DeleteBlockIfDead to DeleteDeadBlock and make it
unconditionally delete the block.  All likely clients will
do the checking anyway.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60464 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 06:40:52 +00:00
Chris Lattner
2b1ba24fb7 Factor some code out of SimplifyCFG, forming a new
DeleteBlockIfDead method.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60463 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-03 06:37:44 +00:00
Chris Lattner
7605730ba8 rewrite RecursivelyDeleteTriviallyDeadInstructions to use a more efficient
formulation that doesn't require set lookups or scanning a set.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60203 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-28 01:20:46 +00:00
Chris Lattner
2872177834 remove some weirdness that came from the LSR code that has
nothing to do with dead instruction elimination.  No tests in
dejagnu depend on this, so I don't know what it was needed for.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60202 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-28 00:58:15 +00:00
Chris Lattner
9fd4955c6a delete ErasePossiblyDeadInstructionTree, replacing uses of it with
RecursivelyDeleteTriviallyDeadInstructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60196 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 23:25:44 +00:00
Chris Lattner
564c0a2330 enhance RecursivelyDeleteTriviallyDeadInstructions to make
PHIs dead if they are single-value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60194 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 23:18:11 +00:00
Chris Lattner
4f02c74a8e Enhance RecursivelyDeleteTriviallyDeadInstructions to optionally
return a list of deleted instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60193 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 23:14:34 +00:00
Chris Lattner
3481f24c06 remove doConstantPropagation and dceInstruction, they are just
wrappers around the interesting code and use an obscure iterator
abstraction that dates back many many years.

Move EraseDeadInstructions to Transforms/Utils and name it
RecursivelyDeleteTriviallyDeadInstructions.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60191 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 22:57:53 +00:00
Chris Lattner
4aebaee0e4 switch InstCombine::visitLoadInst to use
FindAvailableLoadedValue


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60169 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 08:56:30 +00:00
Chris Lattner
ee6e10bc8e enhance FindAvailableLoadedValue to make use of AliasAnalysis
if it has it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60167 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 08:18:12 +00:00
Chris Lattner
52c95856b4 move FindAvailableLoadedValue from JumpThreading to Transforms/Utils.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60166 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 08:10:05 +00:00
Chris Lattner
5a5c9a5acd simplify this code a bit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60164 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 07:54:38 +00:00
Chris Lattner
b29714a10a move MergeBasicBlockIntoOnlyPred to Transforms/Utils.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60162 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-27 07:43:12 +00:00
Chris Lattner
824b958e6f reapply Sanjiv's patch to genericize memcpy/memset/memmove to take an
arbitrary integer width for the count.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59823 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 16:42:48 +00:00
Bill Wendling
dc770929cb Revert r59802. It was breaking the build of llvm-gcc:
g++ -m32 -c -g -DIN_GCC -W -Wall -Wwrite-strings -Wmissing-format-attribute -fno-common -mdynamic-no-pic -DHAVE_CONFIG_H -Wno-unused -DTARGET_NAME=\"i386-apple-darwin9.5.0\" -I. -I. -I../../llvm-gcc.src/gcc -I../../llvm-gcc.src/gcc/. -I../../llvm-gcc.src/gcc/../include -I./../intl -I../../llvm-gcc.src/gcc/../libcpp/include  -I../../llvm-gcc.src/gcc/../libdecnumber -I../libdecnumber -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.obj/include -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/include -DENABLE_LLVM -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.obj/../llvm.src/include  -D_DEBUG  -D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS   -I. -I. -I../../llvm-gcc.src/gcc -I../../llvm-gcc.src/gcc/. -I../../llvm-gcc.src/gcc/../include -I./../intl -I../../llvm-gcc.src/gcc/../libcpp/include  -I../../llvm-gcc.src/gcc/../libdecnumber -I../libdecnumber -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.obj/include -I/Volumes/Sandbox/Buildbot/llvm/full-llvm/build/llvm.src/include ../../llvm-gcc.src/gcc/llvm-types.cpp -o llvm-types.o
../../llvm-gcc.src/gcc/llvm-convert.cpp: In member function 'void TreeToLLVM::EmitMemCpy(llvm::Value*, llvm::Value*, llvm::Value*, unsigned int)':
../../llvm-gcc.src/gcc/llvm-convert.cpp:1496: error: 'memcpy_i32' is not a member of 'llvm::Intrinsic'
../../llvm-gcc.src/gcc/llvm-convert.cpp:1496: error: 'memcpy_i64' is not a member of 'llvm::Intrinsic'
../../llvm-gcc.src/gcc/llvm-convert.cpp: In member function 'void TreeToLLVM::EmitMemMove(llvm::Value*, llvm::Value*, llvm::Value*, unsigned int)':
../../llvm-gcc.src/gcc/llvm-convert.cpp:1512: error: 'memmove_i32' is not a member of 'llvm::Intrinsic'
../../llvm-gcc.src/gcc/llvm-convert.cpp:1512: error: 'memmove_i64' is not a member of 'llvm::Intrinsic'
../../llvm-gcc.src/gcc/llvm-convert.cpp: In member function 'void TreeToLLVM::EmitMemSet(llvm::Value*, llvm::Value*, llvm::Value*, unsigned int)':
../../llvm-gcc.src/gcc/llvm-convert.cpp:1528: error: 'memset_i32' is not a member of 'llvm::Intrinsic'
../../llvm-gcc.src/gcc/llvm-convert.cpp:1528: error: 'memset_i64' is not a member of 'llvm::Intrinsic'
make[3]: *** [llvm-convert.o] Error 1
make[3]: *** Waiting for unfinished jobs....
rm fsf-funding.pod gcov.pod gfdl.pod cpp.pod gpl.pod gcc.pod
make[2]: *** [all-stage1-gcc] Error 2
make[1]: *** [stage1-bubble] Error 2
make: *** [all] Error 2



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59809 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 09:09:41 +00:00
Sanjiv Gupta
219ab405e6 Make mem[cpy,move,set] intrinsics overloaded.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59802 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-21 07:49:09 +00:00
Devang Patel
e0de705eb7 Don't forget arguments!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59745 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-20 19:50:17 +00:00
Oscar Fuentes
eb22065a35 CMake: Removed source file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59662 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 19:32:19 +00:00
Devang Patel
dfca407c79 Do not use separate utility to walk all instructions and remove dead dbg intrinsics. Let instcombiner do this job.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59659 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-19 19:01:37 +00:00
Devang Patel
4f3096b6af Initialize MallocFunc and FreeFunc properly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59538 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-18 18:43:07 +00:00
Devang Patel
b8c564f72e Let AnalyzeAlloca() remove debug intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59454 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-17 18:37:53 +00:00
Oscar Fuentes
4e506abedd CMake: Remove removed source file.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59098 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-12 00:14:12 +00:00
Devang Patel
19ab6b0940 Remove
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59093 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 23:58:15 +00:00
Devang Patel
94b29c3eac Undo previous check-in.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59092 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 23:57:33 +00:00
Oscar Fuentes
7d013e4bbd CMake: Updated list of source files for lib/Transforms/Utils.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59077 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 19:51:36 +00:00
Devang Patel
90d45b8a4a Add utility pass to remove dbg info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59068 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 19:33:39 +00:00
Cedric Venet
24d3b38a0a Update CMakeLists.txt
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59039 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 09:55:48 +00:00
Devang Patel
780c38d84f Add utility routines to remove dead debug info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59011 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-11 00:53:02 +00:00
Daniel Dunbar
746867c8b6 Rework r58829, allowing removal of dbg info intrinsics during alloca
promotion.
 - Eliminate uses after free and simplify tests.

Devang: Please check that this is still doing what you intended.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58887 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-08 04:12:17 +00:00
Bill Wendling
068a795b33 BCUI + 1 doesn't work. Use next instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58830 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-07 01:59:41 +00:00
Devang Patel
180ffaef18 Handle (delete) dbg intrinsics while promoting alloca.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58826 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-07 01:30:07 +00:00
Devang Patel
33e868ff43 InstructionNamer preserves everything.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58787 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-06 01:00:16 +00:00
Devang Patel
d91ac615e3 Check Attribute::NoInline.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58742 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-05 01:37:05 +00:00
Devang Patel
8a88a14462 Fix unused variable warnings.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58651 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-03 23:14:09 +00:00
Daniel Dunbar
0656466734 Fix warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58486 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-31 01:50:01 +00:00
Daniel Dunbar
c5e1ec47c7 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
2008-10-30 19:26:59 +00:00
Chris Lattner
f8131c99de Fix PR2967 by not deleting volatile load/stores that occur before unreachable.
I don't really see this as being needed, but there is little harm from doing
it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58385 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-29 17:46:26 +00:00
Daniel Dunbar
f184c66e71 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
2008-10-28 23:24:26 +00:00
Torok Edwin
3d54502304 export an ID for the instructionNamer, allowing analysis/transformation passes
that need it to require it by ID.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58238 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-27 10:16:27 +00:00
Chris Lattner
0fd77a579b Rewrite all the 'PromoteLocallyUsedAlloca[s]' logic. With the power of
LargeBlockInfo, we can now dramatically simplify their implementation
and speed them up at the same time.  Now the code has time proportional
to the number of uses of the alloca, not the size of the block.

This also eliminates code that tried to batch up different allocas which
are used in the same blocks, and eliminates the 'retry list' logic which
was baroque and no unneccesary.  In addition to being a speedup for crazy
cases, this is also a nice cleanup:

PromoteMemoryToRegister.cpp |  270 +++++++++++++++-----------------------------
 1 file changed, 96 insertions(+), 174 deletions(-)



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58229 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-27 07:05:53 +00:00
Chris Lattner
33210608be Add a new LargeBlockInfo helper, which is just a wrapper around
a trivial dense map.  Use this in RewriteSingleStoreAlloca to
avoid aggressively rescanning blocks over and over again.  This
fixes PR2925, speeding up mem2reg on the testcase in that bug
from 4.56s to 0.02s in a debug build on my machine.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58227 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-27 06:05:26 +00:00
Daniel Dunbar
394f0441e0 Change create*Pass factory functions to return Pass* instead of
LoopPass*.
 - Although less precise, this means they can be used in clients
   without RTTI (who would otherwise need to include LoopPass.h, which
   eventually includes things using dynamic_cast). This was the
   simplest solution that presented itself, but I am happy to use a
   better one if available.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@58010 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-22 23:32:42 +00:00
Nick Lewycky
a6bf66d0d6 Don't drop alignment on globals when cloning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57320 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-09 06:27:14 +00:00
Duncan Sands
4520dd2b7b Add <cstdio> include where needed by gcc-4.4.
Patch by Samuel Tardieu.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57291 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-08 07:23:46 +00:00
Andrew Lenharth
82cf32e5ef Correctly set attributes when removing args during cloning. Fixes PR2765
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@57254 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-07 18:08:38 +00:00