Commit Graph

2387 Commits

Author SHA1 Message Date
Andreas Bolka
15f72dbf97 Skeleton for pairwise subscript testing.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77437 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 05:35:53 +00:00
Owen Anderson
af7ec97587 Return ConstantVector to 2.5 API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77366 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28 21:19:26 +00:00
Devang Patel
d2f79a1346 Add DebugInfoEnumerator to collect debug info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77360 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28 19:55:13 +00:00
Andreas Bolka
c3cc45aa8b Simplify LDA-internal interface.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77359 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28 19:50:13 +00:00
Andreas Bolka
328fb3d210 Add LDA statistics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77358 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28 19:49:49 +00:00
Andreas Bolka
34ce687144 Minor factoring, naming and formatting cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77357 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28 19:49:25 +00:00
Owen Anderson
1fd7096407 Change ConstantArray to 2.5 API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77347 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28 18:32:17 +00:00
Dan Gohman
d6aa02de10 Teach instcombine to respect and preserve inbounds. Add inbounds
to a few tests where it is required for the expected transformation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77290 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-28 01:40:03 +00:00
Owen Anderson
8fa3338ed2 Move ConstantStruct back to 2.5 API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77266 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 22:29:26 +00:00
Owen Anderson
6f83c9c6ef Move ConstantFP construction back to the 2.5-ish API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77247 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 20:59:43 +00:00
Dan Gohman
07ad19b509 Fix wording in comments.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77193 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-27 16:09:48 +00:00
Daniel Dunbar
460f656475 Remove Value::getName{Start,End}, the last of the old Name APIs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77152 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-26 09:48:23 +00:00
Daniel Dunbar
f0443c1eb4 Remove Value::getNameLen
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77148 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-26 08:34:35 +00:00
Dan Gohman
bc3d77a0df SCEV objects are no longer reference-counted.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77080 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-25 16:18:07 +00:00
Dan Gohman
19378d622e When attempting to sign-extend an addrec by interpreting
the step value as unsigned, the start value and the addrec
itself still need to be treated as signed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77078 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-25 16:03:30 +00:00
Andreas Bolka
8a8bd3d690 Convert DOUT to DEBUG.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77065 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-25 12:19:58 +00:00
Dan Gohman
eb490a7aa3 Teach ScalarEvolution to make use of no-overflow flags when
analyzing add recurrences.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77034 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-25 01:22:26 +00:00
Dan Gohman
fef8bb24de Instead of eagerly creating new SCEVs to replace all SCEVs that are
affected after a PHI node has been analyzed, just remove affected
SCEVs from the Scalars map, so that they'll be (lazily) recreated as
needed. This avoids creating SCEV objects that aren't actually needed.

Also, rewrite the associated def-use walking code to be non-recursive
and to continue traversing past Instructions that don't have an
entry in the Scalars map.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77032 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-25 01:13:03 +00:00
Dan Gohman
fc2a3ed0c9 Make AliasAnalysis and related classes use
getAnalysisIfAvailable<TargetData>().


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77028 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-25 00:48:42 +00:00
Daniel Dunbar
ce63ffb52f More migration to raw_ostream, the water has dried up around the iostream hole.
- Some clients which used DOUT have moved to DEBUG. We are deprecating the
   "magic" DOUT behavior which avoided calling printing functions when the
   statement was disabled. In addition to being unnecessary magic, it had the
   downside of leaving code in -Asserts builds, and of hiding potentially
   unnecessary computations.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77019 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-25 00:23:56 +00:00
Andreas Bolka
0baa25d539 Forward-declare raw_ostream.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77014 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 23:19:28 +00:00
Owen Anderson
eed707b1e6 Revert the ConstantInt constructors back to their 2.5 forms where possible, thanks to contexts-on-types. More to come.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77011 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 23:12:02 +00:00
Daniel Dunbar
3f0e83067d Move to raw_ostream.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76963 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 09:53:24 +00:00
Daniel Dunbar
f6ccee5a9d Switch to getNameStr().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76962 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 08:24:36 +00:00
Dan Gohman
d1e5db6c7c Fix whitespace.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76929 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-24 01:03:59 +00:00
Daniel Dunbar
6316fbcb04 Convert StringMap to using StringRef for its APIs.
- Yay for '-'s and simplifications!

 - I kept StringMap::GetOrCreateValue for compatibility purposes, this can
   eventually go away. Likewise the StringMapEntry Create functions still follow
   the old style.

 - NIFC.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76888 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-23 18:17:34 +00:00
Andreas Bolka
b4c28e97f4 Cache dependence computation using FoldingSet.
This introduces an LDA-internal DependencePair class. The intention is,
that this is a place where dependence testers can store various results
such as SCEVs describing conflicting iterations, breaking conditions,
distance/direction vectors, etc.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76877 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-23 14:32:46 +00:00
Andreas Bolka
3b59dd886a Minor cosmetics: indentation, formatting, naming.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76839 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-23 01:57:06 +00:00
Devang Patel
6930f4f945 Fix thinko.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76769 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-22 18:56:16 +00:00
Devang Patel
c4999d71e1 Add replaceAllUsesWith() to FE replace debug info constructs while building complex types.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76765 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-22 18:23:44 +00:00
Owen Anderson
e922c02019 Get rid of the Pass+Context magic.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76702 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-22 00:24:57 +00:00
Dan Gohman
0f4b285a5b Replace the original ad-hoc code for determining whether (v pred w) implies
(x pred y) with more thorough code that does more complete canonicalization
before resorting to range checks. This helps it find more cases where
the canonicalized expressions match.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76671 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 23:03:19 +00:00
Owen Anderson
b3056faa55 Rename getConstantInt{True|False} to get{True|False} at Chris' behest.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76598 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 18:03:38 +00:00
Dan Gohman
a16b5764e3 Make the range calculations for addrecs to be more conservative,
as they aren't currently prepared to handle complicated overflow
cases.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76524 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 00:42:47 +00:00
Dan Gohman
c2b015e4c0 Whitespace cleanups.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76523 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 00:38:55 +00:00
Dan Gohman
c268e7c51e Minor code simplification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76521 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-21 00:37:45 +00:00
Dan Gohman
f117ed462c Add a comment to clarify why there isn't any code in this spot.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76505 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-20 23:54:43 +00:00
Dan Gohman
4500e9eb80 Remove the code that tried to evaluate whether (A pred B) is known
by determining if (B pred (B-A)) is known, as it doesn't handle
overflow correctly.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76504 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-20 23:53:35 +00:00
Dan Gohman
0d5bae41fb Minor code simplification.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76496 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-20 22:41:51 +00:00
Dan Gohman
746f3b1a9b The upper argument of ConstantRange is exclusive, not inclusive.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76492 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-20 22:34:18 +00:00
Dan Gohman
13c5e35222 Update this comment.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76438 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-20 17:44:17 +00:00
Dan Gohman
f241174421 Revert the addition of hasNoPointerOverflow to GEPOperator.
Getelementptrs that are defined to wrap are virtually useless to
optimization, and getelementptrs that are undefined on any kind
of overflow are too restrictive -- it's difficult to ensure that
all intermediate addresses are within bounds. I'm going to take
a different approach.

Remove a few optimizations that depended on this flag.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76437 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-20 17:43:30 +00:00
Nick Lewycky
3a4a884c16 Replace intersectWith with maximalIntersectWith. The latter guarantees that
all values belonging to the intersection will belong to the resulting range.
The former was inconsistent about that point (either way is fine, just pick
one.) This is part of PR4545.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76289 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-18 06:34:42 +00:00
Dan Gohman
3a7a68c108 Make BasicAliasAnalysis and Value::getUnderlyingObject use
GEPOperator's hasNoPointer0verflow(), and make a few places in instcombine
that create GEPs that may overflow clear the NoOverflow value. Among
other things, this partially addresses PR2831.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76252 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-17 22:25:10 +00:00
Dan Gohman
ca178908c8 Add a new Operator class, for handling Instructions and ConstantExprs
in a convenient manner, factoring out some common code from
InstructionCombining and ValueTracking. Move the contents of
BinaryOperators.h into Operator.h and use Operator to generalize them
to support ConstantExprs as well as Instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76232 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-17 20:47:02 +00:00
Eli Friedman
0b79a7727d Replace isTrapping with a new, similar method called
isSafeToSpeculativelyExecute. The new method is a bit closer to what 
the callers actually care about in that it rejects more things callers 
don't want.  It also adds more precise handling for integer 
division, and unifies code for analyzing the legality of a speculative 
load.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76150 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-17 04:28:42 +00:00
Owen Anderson
001dbfebcb Move the ConstantInt uniquing table into LLVMContextImpl. This exposed a number of issues in
our current context-passing stuff, which is also fixed here


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76089 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-16 18:04:31 +00:00
Dan Gohman
850f791abc Fill in some holes in ScalarEvolution's loop iteration condition
analysis. This allows indvars to emit a simpler loop trip count
expression.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76085 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-16 17:34:36 +00:00
Dan Gohman
9377386493 Add an isLoopSimplifyForm() predicate, following the example of
isLCSSAForm(), to test whether a loop is in the form guaranteed
by the LoopSimplify pass.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76077 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-16 16:16:23 +00:00
Ted Kremenek
1935629829 Lexically order files in CMakeLists.txt files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75831 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-15 21:08:16 +00:00