1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-21 12:02:58 +02:00
Commit Graph

1003 Commits

Author SHA1 Message Date
Devang Patel
7fa69ef109 Update call graph after inlining invoke.
Patch by Jay Foad.

llvm-svn: 68120
2009-03-31 17:36:12 +00:00
Dan Gohman
18daca0895 Now that errs() is properly non-buffered, there's no need to
explicitly flush it.

llvm-svn: 67526
2009-03-23 15:57:19 +00:00
Duncan Sands
3c115770e7 Factorize out a concept - no functionality change.
llvm-svn: 67454
2009-03-21 21:27:31 +00:00
Duncan Sands
926d062a48 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).

llvm-svn: 67407
2009-03-20 21:53:29 +00:00
Dale Johannesen
1d76ebc9ed Fix comment typo.
llvm-svn: 67307
2009-03-19 17:23:29 +00:00
Zhou Sheng
fd26fc58bd 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.

llvm-svn: 67194
2009-03-18 10:13:08 +00:00
Zhou Sheng
90fc23d03d Fix a bug.
If I->use_empty(), this method should return false.

llvm-svn: 67180
2009-03-18 07:56:13 +00:00
Bill Wendling
96e37540a0 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

llvm-svn: 66953
2009-03-13 21:15:59 +00:00
Gabor Greif
6a76677e1b 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.

llvm-svn: 66920
2009-03-13 18:27:29 +00:00
Dale Johannesen
3edb15a6c7 Fix one more place where debug info affected
codegen (speculative execution).

llvm-svn: 66859
2009-03-13 01:05:24 +00:00
Dale Johannesen
67278f57e8 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.

llvm-svn: 66840
2009-03-12 23:18:09 +00:00
Dale Johannesen
d9b24eba60 There already was a class to force deterministic
sorting of ConstantInt's; unreinvent wheel.

llvm-svn: 66824
2009-03-12 21:01:11 +00:00
Dale Johannesen
78eadcb3dc Another missing check for debug intrinsics.
llvm-svn: 66800
2009-03-12 17:42:45 +00:00
Dale Johannesen
6a856e8183 Allow for switch values bigger than 64 bits.
llvm-svn: 66751
2009-03-12 01:20:06 +00:00
Dale Johannesen
a63033a34c 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.

llvm-svn: 66749
2009-03-12 01:00:26 +00:00
Dale Johannesen
7579673822 Don't consider debug intrinsics when checking
whether a callee to be inlined is a leaf.

llvm-svn: 66588
2009-03-10 22:20:02 +00:00
Devang Patel
eedb8ab91a Ignore dbg info, while estimating size of jump through block.
llvm-svn: 66554
2009-03-10 18:00:05 +00:00
Evan Cheng
c147115cdf 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.
llvm-svn: 66539
2009-03-10 07:57:50 +00:00
Duncan Sands
5ab54d488f 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.

llvm-svn: 66339
2009-03-07 15:45:40 +00:00
Dale Johannesen
0643e4e36c Fix another case where debug info interferes with
an optimization.

llvm-svn: 66288
2009-03-06 21:08:33 +00:00
Devang Patel
3ae9d5d375 While hoisting instruction to speculatively execute simple bb, ignore dbg intrinsics.
llvm-svn: 66255
2009-03-06 06:00:17 +00:00
Dale Johannesen
83c13c2ace Tweak the check for promotable alloca's to handle
debug intrinsics correctly.

llvm-svn: 66225
2009-03-06 00:42:50 +00:00
Devang Patel
28a28a2588 Add "check/remove dbg var" helper routines.
llvm-svn: 66223
2009-03-06 00:19:37 +00:00
Dale Johannesen
8ca4d24371 Revert unintended commmit.
llvm-svn: 66001
2009-03-04 02:09:48 +00:00
Dale Johannesen
c6bfdb8253 Skip ptr-to-ptr bitcasts when counting in another case.
llvm-svn: 66000
2009-03-04 02:06:53 +00:00
Dale Johannesen
e184480072 Always skip ptr-to-ptr bitcasts when counting,
per Chris' suggestion.  Slightly faster.

llvm-svn: 65999
2009-03-04 01:53:05 +00:00
Dale Johannesen
e611f70764 Marking debug info intrinsics as not touching memory
caused them to be considered trivially dead.  Fix this.

llvm-svn: 65979
2009-03-03 23:30:00 +00:00
Dale Johannesen
81b6cd8ce5 Instruction counters must skip the bitcasts that
feed into llvm.dbg.declare nodes, as well as
the debug directives themselves.

llvm-svn: 65976
2009-03-03 22:36:47 +00:00
Dale Johannesen
ceed180d4c 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.

llvm-svn: 65970
2009-03-03 21:26:39 +00:00
Bill Wendling
7fdda71ad7 Remove accidental check-ins in r65960. :-(
llvm-svn: 65961
2009-03-03 19:25:16 +00:00
Bill Wendling
8244b700bf Use > instead of >=. We want to promote aggregates of 128-bytes.
llvm-svn: 65960
2009-03-03 19:18:49 +00:00
Dan Gohman
51d4e8db6a Fix a bunch of Doxygen syntax issues. Escape special characters,
and put @file directives on their own comment line.

llvm-svn: 65920
2009-03-03 02:55:14 +00:00
Dale Johannesen
33fa9dc8a9 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).

llvm-svn: 65910
2009-03-03 01:09:07 +00:00
Nick Lewycky
f5563f28d3 Fix compiler warning about uninitialized variables. No functional change.
llvm-svn: 65620
2009-02-27 06:29:31 +00:00
Zhou Sheng
670d50e102 Ignore dbg info intrinsics when folding conditional branch to
conditional branch predecessors.

llvm-svn: 65509
2009-02-26 06:56:37 +00:00
Zhou Sheng
241d74737b Don't block basic block with only SwitchInst to fold into predecessors.
llvm-svn: 65456
2009-02-25 15:34:27 +00:00
Devang Patel
702836b2dd 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

llvm-svn: 65353
2009-02-24 00:05:16 +00:00
Mon P Wang
75d957dba4 Changed option name from inline-threshold to basic-inline-threshold because
inline-threshold option is used by the inliner.

llvm-svn: 65309
2009-02-23 07:07:56 +00:00
Evan Cheng
74d0dda00f Add AddrModeMatcher.cpp
llvm-svn: 65228
2009-02-21 07:05:11 +00:00
Evan Cheng
d8aad94754 Factor address mode matcher out of codegen prepare to make it available to other passes, e.g. loop strength reduction.
llvm-svn: 65134
2009-02-20 18:24:38 +00:00
Zhou Sheng
0c2e862ad0 Just roll back the previous change to -mem2reg.
Will re-think about this according to Chris's comments.

llvm-svn: 65126
2009-02-20 17:49:33 +00:00
Zhou Sheng
580c176f47 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.

llvm-svn: 65123
2009-02-20 16:31:35 +00:00
Nick Lewycky
6feb7523b8 Fix typo caused by too much surfing, dudes...
llvm-svn: 64626
2009-02-16 04:26:53 +00:00
Chris Lattner
5babade39e 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!

llvm-svn: 64364
2009-02-12 07:06:42 +00:00
Devang Patel
dd611eac76 If llvm.dbg.region.end is disappearing then remove corresponding llvm.dbg.func.start also.
llvm-svn: 64278
2009-02-11 01:29:06 +00:00
Devang Patel
60571be0de Ignore dbg intrinsic while folding unconditional branch.
llvm-svn: 64242
2009-02-10 22:14:17 +00:00
Devang Patel
6c041de2ff Do not clone llvm.dbg.func.start and corresponding llvm.dbg.region.end during inlining.
llvm-svn: 64209
2009-02-10 07:48:18 +00:00
Devang Patel
7377e7aa89 Enable scalar replacement of AllocaInst whose one of the user is dbg info.
llvm-svn: 64207
2009-02-10 07:00:59 +00:00
Devang Patel
72f5fba371 Revert rev. 63876. It is causing llvm-gcc bootstrap failure.
llvm-svn: 63888
2009-02-05 21:46:41 +00:00
Devang Patel
66eee02024 Ignore dbg intrinsics while propagating conditional expression info.
llvm-svn: 63876
2009-02-05 19:15:39 +00:00