Gabor Greif
c637593cda
rename pred_const_iterator to const_pred_iterator for consistency's sake
...
llvm-svn: 99567
2010-03-25 23:25:28 +00:00
Gabor Greif
df5013e4d8
rename use_const_iterator to const_use_iterator for consistency's sake
...
llvm-svn: 99564
2010-03-25 23:06:16 +00:00
Eric Christopher
e293604548
Temporarily revert this, it's causing an issue with an internal project.
...
llvm-svn: 99451
2010-03-24 23:35:21 +00:00
Gabor Greif
624a31f2eb
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.
llvm-svn: 99399
2010-03-24 13:21:49 +00:00
Gabor Greif
277e66591d
cache result of UI.getOperandNo() instead of calling it twice, it is cheaper this way
...
llvm-svn: 99394
2010-03-24 10:12:54 +00:00
Chris Lattner
a9eb6a6987
add some accessors to callsite/callinst/invokeinst to check
...
for the noinline attribute, and make the inliner refuse to
inline a call site when the call site is marked noinline even
if the callee isn't. This fixes PR6682.
llvm-svn: 99341
2010-03-23 22:59:07 +00:00
Evan Cheng
1144c23330
Teach simplify libcall to transform __strcpy_chk to __memcpy_chk to enable optimizations down stream.
...
llvm-svn: 99282
2010-03-23 15:48:04 +00:00
Evan Cheng
2c663b34d0
Fix 80 col violation.
...
llvm-svn: 99224
2010-03-22 22:44:31 +00:00
Gabor Greif
ef64581628
backing out r99170 because it still fails on clang-x86_64-darwin10-fnt
...
llvm-svn: 99171
2010-03-22 09:11:00 +00:00
Gabor Greif
04f7f381ae
Now that hopefully all direct accesses to InvokeInst operands are fixed
...
we can reapply the InvokeInst operand reordering patch. (see r98957).
llvm-svn: 99170
2010-03-22 08:28:00 +00:00
Gabor Greif
0bfed2dc4e
back out r98957, it broke http://smooshlab.apple.com:8010/builders/clang-x86_64-darwin10-fnt/builds/703 in the nightly test suite
...
llvm-svn: 98958
2010-03-19 13:50:02 +00:00
Gabor Greif
953702b8e6
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).
llvm-svn: 98957
2010-03-19 11:55:53 +00:00
Devang Patel
926c663cfd
Skip debug info intrinsics.
...
llvm-svn: 98581
2010-03-15 21:25:29 +00:00
Bill Wendling
3320ee3d10
Make returns more consistent with others.
...
llvm-svn: 98490
2010-03-14 10:40:28 +00:00
Benjamin Kramer
19c12c8ef4
Add a virtual destructor and give vtable a home.
...
llvm-svn: 98376
2010-03-12 20:41:29 +00:00
Benjamin Kramer
0592752a53
Factor checked library call optimization into a common helper class and use it
...
to unify the almost identical code in CodeGenPrepare and InstCombineCalls.
llvm-svn: 98338
2010-03-12 09:27:41 +00:00
Benjamin Kramer
846fefb000
stpcpy is so similar to strcpy, it doesn't deserve a complete copy of the __strcpy_chk -> strcpy code.
...
llvm-svn: 98284
2010-03-11 20:45:13 +00:00
Eric Christopher
017a0a06d8
Lower stpcpy_chk when possible.
...
llvm-svn: 98274
2010-03-11 19:24:34 +00:00
Eric Christopher
fd61aa2ea3
Fix typo.
...
llvm-svn: 98260
2010-03-11 17:45:38 +00:00
Eric Christopher
c2a92dadc5
Add strncpy libcall creator. Use it when it should be used.
...
llvm-svn: 98219
2010-03-11 01:25:07 +00:00
Dan Gohman
07eb9cb4c2
Add a DominatorTree argument to isLCSSA so that it doesn't have to
...
compute a set of reachable blocks for itself each time it is called, which
is fairly frequently.
llvm-svn: 98179
2010-03-10 19:38:49 +00:00
Dan Gohman
3f53795624
Fix a comment.
...
llvm-svn: 98122
2010-03-10 02:18:48 +00:00
Devang Patel
176dc29a62
Avoid using DIDescriptor.isNull().
...
This is a first step towards eliminating checks in Descriptor constructors.
llvm-svn: 97975
2010-03-08 20:52:55 +00:00
Devang Patel
a716e313d6
Revert r97947.
...
llvm-svn: 97963
2010-03-08 19:20:38 +00:00
Devang Patel
1527b2657b
Avoid using DIDescriptor.isNull().
...
This is a first step towards eliminating unncessary constructor checks in light weight DIDescriptor wrappers.
llvm-svn: 97947
2010-03-08 18:25:48 +00:00
Ted Kremenek
24e16cd322
Update CMake build.
...
llvm-svn: 97846
2010-03-05 22:34:16 +00:00
Eric Christopher
dfb465a816
Move SimplifyLibCalls's LibCall builders to a separate file so they
...
can be used in more places. Add an argument for the TargetData that
most of them need. Update for the getInt8PtrTy() change. Should be
no functionality change.
llvm-svn: 97844
2010-03-05 22:25:30 +00:00
Dan Gohman
3691dbc5cf
Add some debug output to LoopSimplify.
...
llvm-svn: 97458
2010-03-01 17:55:27 +00:00
Dan Gohman
52ed61204b
Make LoopSimplify change conditional branches in loop exiting blocks
...
which branch on undef to branch on a boolean constant for the edge
exiting the loop. This helps ScalarEvolution compute trip counts for
loops.
Teach ScalarEvolution to recognize single-value PHIs, when safe, and
ForgetSymbolicName to forget such single-value PHI nodes as apprpriate
in ForgetSymbolicName.
llvm-svn: 97126
2010-02-25 06:57:05 +00:00
Bob Wilson
86dded571f
Rename SuccessorNumber to GetSuccessorNumber.
...
llvm-svn: 96387
2010-02-16 21:06:42 +00:00
Bob Wilson
1115365fcf
Refactor to share code to find the position of a basic block successor in the
...
terminator's list of successors.
llvm-svn: 96377
2010-02-16 19:49:17 +00:00
Duncan Sands
1b33dd3c83
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.
llvm-svn: 96344
2010-02-16 11:11:14 +00:00
Chris Lattner
a8505609fe
fix PR6305 by handling BlockAddress in a helper function
...
called by jump threading.
llvm-svn: 96263
2010-02-15 20:47:49 +00:00
Duncan Sands
2acaf3609c
Uniformize the names of type predicates: rather than having isFloatTy and
...
isInteger, we now have isFloatTy and isIntegerTy. Requested by Chris!
llvm-svn: 96223
2010-02-15 16:12:20 +00:00
Chris Lattner
9c797fdf1d
Speed up codegen prepare from 3.58s to 0.488s.
...
llvm-svn: 96081
2010-02-13 05:01:14 +00:00
Chris Lattner
975da20868
PHINode::getBasicBlockIndex is O(n) in the number of inputs
...
to a PHI, avoid it in the common case where the BB occurs
in the same index for multiple phis. This speeds up CGP on
an insane testcase from 8.35 to 3.58s.
llvm-svn: 96080
2010-02-13 04:24:19 +00:00
Chris Lattner
1a067d53b0
iterate over preds using PHI information when available instead of
...
using pred_begin/end. It is much faster.
llvm-svn: 96079
2010-02-13 04:15:26 +00:00
Jakob Stoklund Olesen
670458b3be
Teach SimplifyCFG about magic pointer constants.
...
Weird code sometimes uses pointer constants other than null. This patch
teaches SimplifyCFG to build switch instructions in those cases.
Code like this:
void f(const char *x) {
if (!x)
puts("null");
else if ((uintptr_t)x == 1)
puts("one");
else if (x == (char*)2 || x == (char*)3)
puts("two");
else if ((intptr_t)x == 4)
puts("four");
else
puts(x);
}
Now becomes a switch:
define void @f(i8* %x) nounwind ssp {
entry:
%magicptr23 = ptrtoint i8* %x to i64 ; <i64> [#uses=1]
switch i64 %magicptr23, label %if.else16 [
i64 0, label %if.then
i64 1, label %if.then2
i64 2, label %if.then9
i64 3, label %if.then9
i64 4, label %if.then14
]
Note that LLVM's own DenseMap uses magic pointers.
llvm-svn: 95439
2010-02-05 22:03:18 +00:00
Dan Gohman
8142ba6bbb
Use a SmallSetVector instead of a SetVector; this code showed up as a
...
malloc caller in a profile.
llvm-svn: 95407
2010-02-05 19:20:15 +00:00
Bob Wilson
8207d33d94
Fix pr6198 by moving the isSized() check to an outer conditional.
...
The testcase from pr6198 does not crash for me -- I don't know what's up with
that -- so I'm not adding it to the tests.
llvm-svn: 94984
2010-02-01 17:41:44 +00:00
Bob Wilson
0f04082970
Check alignment of loads when deciding whether it is safe to execute them
...
unconditionally. Besides checking the offset, also check that the underlying
object is aligned as much as the load itself.
llvm-svn: 94875
2010-01-30 04:42:39 +00:00
Bob Wilson
bb651db10d
Use uint64_t instead of unsigned for offsets and sizes.
...
llvm-svn: 94835
2010-01-29 20:34:28 +00:00
Bob Wilson
f897b7b37e
Improve isSafeToLoadUnconditionally to recognize that GEPs with constant
...
indices are safe if the result is known to be within the bounds of the
underlying object.
llvm-svn: 94829
2010-01-29 19:19:08 +00:00
Victor Hernandez
60060d030c
mem2reg erases the dbg.declare intrinsics that it converts to dbg.val intrinsics
...
llvm-svn: 94763
2010-01-29 00:01:35 +00:00
Bob Wilson
2e1a609654
Avoid creating redundant PHIs in SSAUpdater::GetValueInMiddleOfBlock.
...
This was already being done in SSAUpdater::GetValueAtEndOfBlock so I've
just changed SSAUpdater to check for existing PHIs in both places.
llvm-svn: 94690
2010-01-27 22:01:02 +00:00
Benjamin Kramer
cfe07fadc7
Don't bother with sprintf, just pass the Twine through.
...
llvm-svn: 94684
2010-01-27 19:58:47 +00:00
Chris Lattner
deabd1cfb6
some cleanups.
...
llvm-svn: 94649
2010-01-27 02:12:20 +00:00
Chris Lattner
354782f9b9
no need to check for null
...
llvm-svn: 94648
2010-01-27 02:04:20 +00:00
Victor Hernandez
e6321dc910
When converting dbg.declare to dbg.value, attach promoted store's debug metadata to dbg.value
...
llvm-svn: 94634
2010-01-27 00:44:36 +00:00
Victor Hernandez
4e7937f77b
Avoid extra calls to MD->getNumOperands()
...
llvm-svn: 94618
2010-01-26 23:29:09 +00:00