Commit Graph

6803 Commits

Author SHA1 Message Date
Duncan Sands 3a5cb69cb8 Fix PR7328: when turning a tail recursion into a loop, need to preserve
the returned value after the tail call if it differs from other return
values.  The optimal thing to do would be to introduce a phi node for
the return value, but for the moment just fix the miscompile.

llvm-svn: 106947
2010-06-26 12:53:31 +00:00
Dan Gohman fb9712bdae In GenerateReassociations, don't bother thinking about individual
SCEVUnknown values which are loop-variant, as LSR can't do anything
interesting with these values in any case. This fixes very slow compile
times on loops which have large numbers of such values.

llvm-svn: 106897
2010-06-25 22:32:18 +00:00
Dale Johannesen ce97d55ad9 The hasMemory argument is irrelevant to how the argument
for an "i" constraint should get lowered; PR 6309.  While
this argument was passed around a lot, this is the only
place it was used, so it goes away from a lot of other
places.

llvm-svn: 106893
2010-06-25 21:55:36 +00:00
Gabor Greif e3ba486c9f use ArgOperand API (one more hunk I could split)
llvm-svn: 106825
2010-06-25 07:58:41 +00:00
Gabor Greif 5f3e656a1b use ArgOperand API (some hunks I could split)
llvm-svn: 106824
2010-06-25 07:57:14 +00:00
Gabor Greif 07e9284c75 use ArgOperand API; tighten type of handleFreeWithNonTrivialDependency to be able to use isFreeCall whithout a cast or new overload
llvm-svn: 106823
2010-06-25 07:40:32 +00:00
Dan Gohman 4143e9deeb Add an exports file for the Hello example plugin.
llvm-svn: 106768
2010-06-24 17:36:51 +00:00
Dan Gohman 963b1c142e A few minor micro-optimizations.
llvm-svn: 106764
2010-06-24 16:57:52 +00:00
Dan Gohman 47ddf76d89 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.

llvm-svn: 106763
2010-06-24 16:51:25 +00:00
Dan Gohman ab5422200b Fix copy+pasto issues in isMulSExtable.
llvm-svn: 106759
2010-06-24 16:45:11 +00:00
Gabor Greif 7ccec09252 use ArgOperand API
llvm-svn: 106752
2010-06-24 16:11:44 +00:00
Gabor Greif a6d75e2cf7 use (even more, still) ArgOperand API
llvm-svn: 106750
2010-06-24 15:51:11 +00:00
Gabor Greif 218f5541b2 use ArgOperand API and CallSite for arg range; add necessary casts and perform some cosmetics
llvm-svn: 106747
2010-06-24 14:42:01 +00:00
Gabor Greif 5aafdf1e43 use ArgOperand API and CallSite for arg range
llvm-svn: 106745
2010-06-24 14:13:36 +00:00
Gabor Greif 0a136c9b53 use (even more) ArgOperand API
llvm-svn: 106744
2010-06-24 13:54:33 +00:00
Gabor Greif 590d95ed18 use ArgOperand API
llvm-svn: 106743
2010-06-24 13:42:49 +00:00
Gabor Greif 589a0b950a use ArgOperand API
llvm-svn: 106740
2010-06-24 12:58:35 +00:00
Gabor Greif 7943017490 use ArgOperand API
llvm-svn: 106737
2010-06-24 12:35:13 +00:00
Gabor Greif 75f6943c95 use ArgOperand API, also tighten the type of visitFree to make this work out smoothly
llvm-svn: 106736
2010-06-24 12:21:15 +00:00
Gabor Greif 91f9589057 use ArgOperand API; introduce downcasted pointers into scope to facilitate this
llvm-svn: 106734
2010-06-24 12:03:56 +00:00
Gabor Greif e2f482ca0b use ArgOperand API
llvm-svn: 106731
2010-06-24 10:42:46 +00:00
Gabor Greif 2d958d4db5 use ArgOperand API
llvm-svn: 106730
2010-06-24 10:17:17 +00:00
Gabor Greif 5bcaa55761 use callsite to obtain all arguments
llvm-svn: 106729
2010-06-24 10:04:07 +00:00
Gabor Greif 42f620cc55 use callsite to obtain all arguments
llvm-svn: 106728
2010-06-24 09:56:43 +00:00
Gabor Greif 0f60709f0e use getNumArgOperands
llvm-svn: 106709
2010-06-24 00:48:48 +00:00
Gabor Greif 4a39b84a9d use ArgOperand API
llvm-svn: 106707
2010-06-24 00:44:01 +00:00
Devang Patel 0dc3c2d37e Use ValueMap instead of DenseMap.
The ValueMapper used by various cloning utility maps MDNodes also.

llvm-svn: 106706
2010-06-24 00:33:28 +00:00
Devang Patel d8dedee96d Use available typedef for " DenseMap<const Value*, Value*>".
llvm-svn: 106699
2010-06-24 00:00:42 +00:00
Devang Patel b8f11de105 Cosmetic change.
Do not use "ValueMap" as a name for a local variable or an argument.

llvm-svn: 106698
2010-06-23 23:55:51 +00:00
Devang Patel 9ad629367d Revert 106592 for now. It causes clang-selfhost build failure.
llvm-svn: 106598
2010-06-22 23:29:55 +00:00
Dan Gohman 1081f1a0f5 Fix OptimizeMax to handle an odd case where one of the max operands
is another max which folds. This fixes PR7454.

llvm-svn: 106594
2010-06-22 23:07:13 +00:00
Devang Patel 87f75f75be 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!

llvm-svn: 106592
2010-06-22 22:53:21 +00:00
Devang Patel e43c6487da While cloning a module, clone metadata attached with instructions.
llvm-svn: 106591
2010-06-22 22:50:42 +00:00
Devang Patel e3fbbd19ed Clone named metadata while cloning a module.
Reapply Bob's patch.

llvm-svn: 106560
2010-06-22 18:52:38 +00:00
Dan Gohman d2d1ae105d Use pre-increment instead of post-increment when the result is not used.
llvm-svn: 106542
2010-06-22 15:08:57 +00:00
Devang Patel f040dec68a Revert 106528. It is causing self host failures.
llvm-svn: 106529
2010-06-22 06:14:09 +00:00
Devang Patel b195eb4acf Do not rely on DenseMap slot which can be easily invalidated when DenseMap grows.
llvm-svn: 106528
2010-06-22 05:16:56 +00:00
Bob Wilson 6c1fc79cab Revert my change to clone named metadata. Buildbots are complaining.
--- Reverse-merging r106508 into '.':
U    lib/Transforms/Utils/CloneModule.cpp

llvm-svn: 106521
2010-06-22 02:08:51 +00:00
Bob Wilson 5f9575c1cd Include named metadata when cloning a module.
llvm-svn: 106508
2010-06-22 00:11:03 +00:00
Dan Gohman dd41bba517 Use A.append(...) instead of A.insert(A.end(), ...) when A is a
SmallVector, and other SmallVector simplifications.

llvm-svn: 106452
2010-06-21 19:47:52 +00:00
Dan Gohman 32655906e4 Add a TODO comment.
llvm-svn: 106397
2010-06-19 21:30:18 +00:00
Dan Gohman 51d00092b6 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.

llvm-svn: 106396
2010-06-19 21:29:59 +00:00
Dan Gohman 297fb8b9fc Don't include things in anonymous namespaces that don't need it.
llvm-svn: 106395
2010-06-19 21:21:39 +00:00
Dan Gohman f3aea7aecf Disable indvars on loops when LoopSimplify form is not available.
This fixes PR7333.

llvm-svn: 106267
2010-06-18 01:35:11 +00:00
Jim Grosbach e94f1ded24 remove trailing whitespace
llvm-svn: 106164
2010-06-16 22:41:09 +00:00
Rafael Espindola a20e2dfe86 Make sure that simplify libcalls does not replace a call with one calling
convention with a new call with a different calling convention.

llvm-svn: 106134
2010-06-16 19:34:01 +00:00
Benjamin Kramer a13bd20396 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.

llvm-svn: 106097
2010-06-16 10:30:29 +00:00
Benjamin Kramer 1118860e3a simplify-libcalls: fold strstr(a, b) == a -> strncmp(a, b, strlen(b)) == 0
llvm-svn: 106047
2010-06-15 21:34:25 +00:00
Chris Lattner 329ea064ed jump threading can't split a critical edge from an indirectbr. This
fixes PR7356.

llvm-svn: 105950
2010-06-14 19:45:43 +00:00
Benjamin Kramer b82de426de SimplifyCFG: don't turn volatile stores to null/undef into unreachable. Fixes PR7369.
llvm-svn: 105914
2010-06-13 14:35:54 +00:00