Commit Graph

6796 Commits

Author SHA1 Message Date
Gabor Greif
f1ba6513bf use ArgOperand API (one more hunk I could split)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106825 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-25 07:58:41 +00:00
Gabor Greif
9c68a7bb45 use ArgOperand API (some hunks I could split)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106824 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-25 07:57:14 +00:00
Gabor Greif
7f1d7f5779 use ArgOperand API; tighten type of handleFreeWithNonTrivialDependency to be able to use isFreeCall whithout a cast or new overload
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106823 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-25 07:40:32 +00:00
Dan Gohman
fc33a3099e Add an exports file for the Hello example plugin.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106768 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-24 17:36:51 +00:00
Dan Gohman
2ea09e0546 A few minor micro-optimizations.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106764 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-24 16:57:52 +00:00
Dan Gohman
d42819a07b Teach getExactSDiv to evaluate x/1 to x up front, as it's a common
enough special case, and it theoretically allows more folding because
it works even when x is unanalyzable.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106763 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-24 16:51:25 +00:00
Dan Gohman
473e63512a Fix copy+pasto issues in isMulSExtable.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106759 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-24 16:45:11 +00:00
Gabor Greif
caf70b31b0 use ArgOperand API
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106752 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-24 16:11:44 +00:00
Gabor Greif
2f1ab74e76 use (even more, still) ArgOperand API
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106750 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-24 15:51:11 +00:00
Gabor Greif
9e4f243de7 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
2010-06-24 14:42:01 +00:00
Gabor Greif
fef8c4eb54 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
2010-06-24 14:13:36 +00:00
Gabor Greif
bcda85c743 use (even more) ArgOperand API
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106744 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-24 13:54:33 +00:00
Gabor Greif
c310fcc909 use ArgOperand API
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106743 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-24 13:42:49 +00:00
Gabor Greif
cea7ac7c01 use ArgOperand API
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106740 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-24 12:58:35 +00:00
Gabor Greif
3e84e2e90f use ArgOperand API
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106737 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-24 12:35:13 +00:00
Gabor Greif
916973706d use ArgOperand API, also tighten the type of visitFree to make this work out smoothly
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106736 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-24 12:21:15 +00:00
Gabor Greif
3ccbb22eaf use ArgOperand API; introduce downcasted pointers into scope to facilitate this
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106734 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-24 12:03:56 +00:00
Gabor Greif
aee5dc1939 use ArgOperand API
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106731 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-24 10:42:46 +00:00
Gabor Greif
d883a9d1ed use ArgOperand API
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106730 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-24 10:17:17 +00:00
Gabor Greif
0a14be0693 use callsite to obtain all arguments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106729 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-24 10:04:07 +00:00
Gabor Greif
aeff385e3e use callsite to obtain all arguments
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106728 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-24 09:56:43 +00:00
Gabor Greif
407014f9a5 use getNumArgOperands
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106709 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-24 00:48:48 +00:00
Gabor Greif
de9f5452d3 use ArgOperand API
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106707 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-24 00:44:01 +00:00
Devang Patel
e9916a302f 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
2010-06-24 00:33:28 +00:00
Devang Patel
774cca70b1 Use available typedef for " DenseMap<const Value*, Value*>".
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106699 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-24 00:00:42 +00:00
Devang Patel
29d3dd8a64 Cosmetic change.
Do not use "ValueMap" as a name for a local variable or an argument.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106698 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-23 23:55:51 +00:00
Devang Patel
170f06ebe2 Revert 106592 for now. It causes clang-selfhost build failure.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106598 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-22 23:29:55 +00:00
Dan Gohman
caf71ab473 Fix OptimizeMax to handle an odd case where one of the max operands
is another max which folds. This fixes PR7454.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106594 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-22 23:07:13 +00:00
Devang Patel
186b3d2606 If a metadata operand is seeded in value map and the metadata should also be seeded in value map. This is not limited to function local metadata.
Failure to seed metdata in such cases causes troubles when in a cloned module, metadata from a new module refers to values in old module. Usually this results in mysterious bugpoint crashes. For example,

 Checking to see if we can delete global inits: Unknown constant!
 UNREACHABLE executed at /d/g/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp:904!



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106592 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-22 22:53:21 +00:00
Devang Patel
3bf329f495 While cloning a module, clone metadata attached with instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106591 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-22 22:50:42 +00:00
Devang Patel
d8800e7972 Clone named metadata while cloning a module.
Reapply Bob's patch.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106560 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-22 18:52:38 +00:00
Dan Gohman
fe60104ac9 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
2010-06-22 15:08:57 +00:00
Devang Patel
e4acff8720 Revert 106528. It is causing self host failures.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106529 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-22 06:14:09 +00:00
Devang Patel
52e0612f7d Do not rely on DenseMap slot which can be easily invalidated when DenseMap grows.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106528 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-22 05:16:56 +00:00
Bob Wilson
ec68864877 Revert my change to clone named metadata. Buildbots are complaining.
--- Reverse-merging r106508 into '.':
U    lib/Transforms/Utils/CloneModule.cpp


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106521 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-22 02:08:51 +00:00
Bob Wilson
e42f493f4c Include named metadata when cloning a module.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106508 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-22 00:11:03 +00:00
Dan Gohman
403a8cdda5 Use A.append(...) instead of A.insert(A.end(), ...) when A is a
SmallVector, and other SmallVector simplifications.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106452 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-21 19:47:52 +00:00
Dan Gohman
74e5ef096e Add a TODO comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106397 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-19 21:30:18 +00:00
Dan Gohman
1e3121c80a Include the use kind along with the expression in the key of the
use sharing map. The reconcileNewOffset logic already forces a
separate use if the kinds differ, so incorporating the kind in the
key means we can track more sharing opportunities.

More sharing means fewer total uses to track, which means smaller
problem sizes, which means the conservative throttles don't kick
in as often.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106396 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-19 21:29:59 +00:00
Dan Gohman
b6211710ac Don't include things in anonymous namespaces that don't need it.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106395 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-19 21:21:39 +00:00
Dan Gohman
a52838285b Disable indvars on loops when LoopSimplify form is not available.
This fixes PR7333.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106267 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-18 01:35:11 +00:00
Jim Grosbach
d0e8469ba6 remove trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106164 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-16 22:41:09 +00:00
Rafael Espindola
e96af56a5b Make sure that simplify libcalls does not replace a call with one calling
convention with a new call with a different calling convention.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106134 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-16 19:34:01 +00:00
Benjamin Kramer
ea9ca0236d simplify-libcalls: fold strncmp(x, y, 1) -> memcmp(x, y, 1)
The memcmp will be optimized further and even the pathological case
'strstr(x, "x") == x' generates optimal code now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106097 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-16 10:30:29 +00:00
Benjamin Kramer
386e918438 simplify-libcalls: fold strstr(a, b) == a -> strncmp(a, b, strlen(b)) == 0
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@106047 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-15 21:34:25 +00:00
Chris Lattner
e58867e55e jump threading can't split a critical edge from an indirectbr. This
fixes PR7356.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105950 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-14 19:45:43 +00:00
Benjamin Kramer
c05cb8d561 SimplifyCFG: don't turn volatile stores to null/undef into unreachable. Fixes PR7369.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105914 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-13 14:35:54 +00:00
Kenneth Uildriks
42c7d23c6d Pulled CodeMetrics out of InlineCost.h and made it a bit more general, so it can be reused from PartialSpecializationCost
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@105725 91177308-0d34-0410-b5e6-96231b3b80d8
2010-06-09 15:11:37 +00:00
Dan Gohman
b9539745c5 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
2010-06-07 20:20:33 +00:00
Kenneth Uildriks
3a4340d4cb 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
2010-06-05 14:50:21 +00:00