Commit Graph

325 Commits

Author SHA1 Message Date
Chris Lattner
4723303c97 remove a silly condition that doesn't make a lot of sense anymore.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89601 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-22 16:15:59 +00:00
Chris Lattner
92e803c2a4 reduce indentation, no functionality change.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89600 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-22 16:05:05 +00:00
Chris Lattner
66e08cf79a Remove the AliasAnalysis::getMustAliases method, which is dead.
The hasNoModRefInfoForCalls isn't worth it as a filter because 
basicaa provides m/r info and everything chains to it, so remove
it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89599 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-22 16:01:44 +00:00
Dan Gohman
f94b5edc45 Extend CaptureTracking to indicate when a value is never stored, even
if it is not ultimately captured. Teach BasicAliasAnalysis that a 
local object address which does not escape and is never stored does
not alias with a value resulting from a load.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@89398 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-19 21:57:48 +00:00
Nick Lewycky
20162ac566 Teach BasicAA that a constant expression can't alias memory provably not
allocated until runtime (such as an alloca). Patch by Hans Wennborg!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@88760 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-14 06:15:14 +00:00
Dan Gohman
f75ef668a7 Default-addressspace null pointers don't alias anything. This allows
GVN to be more aggressive. Patch by Hans Wennborg! (with a comment added by me)


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86582 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-09 19:29:11 +00:00
Chris Lattner
7b550ccfc5 remove a bunch of extraneous LLVMContext arguments
from various APIs, addressing PR5325.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86231 91177308-0d34-0410-b5e6-96231b3b80d8
2009-11-06 04:27:31 +00:00
Victor Hernandez
f006b183e2 Rename MallocFreeHelper as MemoryBuiltins
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85286 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-27 20:05:49 +00:00
Victor Hernandez
f2becca90b Rename MallocHelper as MallocFreeHelper, since it now also identifies calls to free()
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85181 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 23:58:56 +00:00
Dan Gohman
6665b0ea68 Teach BasicAA how to analyze Select instructions, and make it more
aggressive on PHI instructions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85158 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-26 21:55:43 +00:00
Nick Lewycky
f5a86f45e7 Remove includes of Support/Compiler.h that are no longer needed after the
VISIBILITY_HIDDEN removal.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85043 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 06:57:41 +00:00
Nick Lewycky
6726b6d75a Remove VISIBILITY_HIDDEN from class/struct found inside anonymous namespaces.
Chris claims we should never have visibility_hidden inside any .cpp file but
that's still not true even after this commit.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@85042 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-25 06:33:48 +00:00
Victor Hernandez
7b929dad59 Remove AllocationInst. Since MallocInst went away, AllocaInst is the only subclass of AllocationInst, so it no longer is necessary.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84969 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-23 21:09:37 +00:00
Chris Lattner
391d23b6c2 inline isGEP away.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84373 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-17 23:48:54 +00:00
Evan Cheng
a846a8a1dc When checking aliases between phi sources and V2, we know the sources are not themselves phi nodes. However, V2 may be. Call aliasCheck with V2 first to potentially eliminate a std::swap call.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84226 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-16 00:33:09 +00:00
Nick Lewycky
20312d0bb8 Add missing break statements! Thanks to Duncan Sands for pointing this out!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84191 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-15 18:48:58 +00:00
Nick Lewycky
6e9e010752 Teach basicaa about memcpy/memmove/memset. The length argument can be used to
improve alias results if constant, and the source pointer can't be modified.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84175 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-15 07:11:24 +00:00
Nick Lewycky
2d3820c29c Teach BasicAA to use the size parameter of the memory use marker intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84174 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-15 06:12:11 +00:00
Nick Lewycky
22c031296c Take advantage of TargetData when available; we know that the atomic intrinsics
only dereference the element they point to directly with no pointer arithmetic.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84159 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-15 00:36:35 +00:00
Evan Cheng
f0429fd1ca Clear VisitedPHIs after use.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84080 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-14 06:46:26 +00:00
Evan Cheng
681a33e26d Another BasicAA fix. If a value does not alias a GEP's base pointer, then it
cannot alias the GEP. GEP pointer alias rule states this clearly:
A pointer value formed from a getelementptr instruction is associated with the
addresses associated with the first operand of the getelementptr.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84079 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-14 06:41:49 +00:00
Evan Cheng
d83c2ca336 More code clean up based on patch feedback.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84074 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-14 05:22:03 +00:00
Evan Cheng
3dbe43b1b5 Change VisitedPHIs into an instance variable that's freed by each alias() call.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84072 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-14 05:05:02 +00:00
Evan Cheng
50a5914e12 Teach basic AA about PHI nodes. If all operands of a phi NoAlias another value than it's safe to declare the PHI NoAlias the value. Ditto for MustAlias.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84038 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-13 22:02:20 +00:00
Evan Cheng
094f04b429 Refactor some code. No functionality changes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@84000 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-13 18:42:04 +00:00
Nick Lewycky
5c9be67cff Teach BasicAA a little something about the atomic intrinsics: they can only
modify through the pointer they're given.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@83959 91177308-0d34-0410-b5e6-96231b3b80d8
2009-10-13 07:48:38 +00:00
Victor Hernandez
46e8312fb7 Enhance analysis passes so that they apply the same analysis to malloc calls as to MallocInst.
Reviewed by Eli Friedman.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@82281 91177308-0d34-0410-b5e6-96231b3b80d8
2009-09-18 21:34:51 +00:00
Dan Gohman
aae87cde50 Use stripPointerCasts instead of doing the same manually.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@80267 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-27 18:02:03 +00:00
Owen Anderson
1d0be15f89 Push LLVMContexts through the IntegerType APIs.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78948 91177308-0d34-0410-b5e6-96231b3b80d8
2009-08-13 21:58:54 +00:00
Owen Anderson
a7235ea724 Move a few more APIs back to 2.5 forms. The only remaining ones left to change back are
metadata related, which I'm waiting on to avoid conflicting with Devang.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77721 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-31 20:28:14 +00:00
Owen Anderson
baf3c40440 Move ConstantExpr to 2.5 API.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77494 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-29 18:55:55 +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
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
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
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
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
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
Torok Edwin
c23197a26f llvm_unreachable->llvm_unreachable(0), LLVM_UNREACHABLE->llvm_unreachable.
This adds location info for all llvm_unreachable calls (which is a macro now) in
!NDEBUG builds.
In NDEBUG builds location info and the message is off (it only prints
"UREACHABLE executed").


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75640 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-14 16:55:14 +00:00
Torok Edwin
c25e7581b9 assert(0) -> LLVM_UNREACHABLE.
Make llvm_unreachable take an optional string, thus moving the cerr<< out of
line.
LLVM_UNREACHABLE is now a simple wrapper that makes the message go away for
NDEBUG builds.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@75379 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-11 20:10:48 +00:00
Owen Anderson
07cf79ef53 "LLVMContext* " --> "LLVMContext *"
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74878 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-06 23:00:19 +00:00
Owen Anderson
508955156a Thread LLVMContext through the constant folding APIs, which touches a lot of files.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@74844 91177308-0d34-0410-b5e6-96231b3b80d8
2009-07-06 18:42:36 +00:00
Owen Anderson
e7b6118a51 Remove unneeded #include.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@73911 91177308-0d34-0410-b5e6-96231b3b80d8
2009-06-22 22:09:07 +00:00
Dan Gohman
72776d2190 Teach BasicAliasAnalysis to understand constant gep indices that fall
beyond their associated static array type.

I believe that this fixes a legitimate bug, because BasicAliasAnalysis
already has code to check for this condition that works for non-constant
indices, however it was missing the case of constant indices. With this
change, it checks for both.

This fixes PR4267, and miscompiles of SPEC 188.ammp and 464.h264.href.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@72451 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-27 01:48:27 +00:00
Duncan Sands
777d2306b3 Rename PaddedSize to AllocSize, in the hope that this
will make it more obvious what it represents, and stop
it being confused with the StoreSize.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@71349 91177308-0d34-0410-b5e6-96231b3b80d8
2009-05-09 07:06:46 +00:00
Duncan Sands
d869b3847f Generalize some alias analysis logic from atomic
intrinsics to any IntrWriteArgMem intrinsics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64551 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-14 10:56:35 +00:00
Nick Lewycky
826f7cebfd BasicAA was making the assumption that a local allocation which hadn't escaped
couldn't ever be the return of call instruction. However, it's quite possible
that said local allocation is itself the return of a function call. That's
what malloc and calloc are for, actually.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@64442 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-13 07:06:27 +00:00
Owen Anderson
e79422096e Refactor my previous change to maintain the distinction between AliasAnalysis and BasicAliasAnalysis. This involves some wider changes because it
folds away some never-used methods.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63900 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-05 23:36:27 +00:00
Owen Anderson
fe9388ccb4 Finish making AliasAnalysis aware of the fact that most atomic intrinsics only dereference their arguments, and enhance
BasicAA to make use of this fact when computing ModRef info.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63718 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-04 05:16:46 +00:00
Dan Gohman
a5f81bba4a Move isIdentifiedObject and isNoAliasCall into AliasAnalysis.cpp since
they are useful to analyses other than BasicAliasAnalysis.cpp. Include
the full comment for isIdentifiedObject in the header file. Thanks to
Chris for suggeseting this.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63589 91177308-0d34-0410-b5e6-96231b3b80d8
2009-02-03 01:28:32 +00:00
Dan Gohman
3311a1f8f0 Fix a post-RA scheduling dependency bug.
If a MachineInstr doesn't have a memoperand but has an opcode that
is known to load or store, assume its memory reference may alias
*anything*, including stack slots which the compiler completely
controls.

To partially compensate for this, teach the ScheduleDAG building
code to do basic getUnderlyingValue analysis. This greatly
reduces the number of instructions that require restrictive
dependencies. This code will need to be revisited when we start
doing real alias analysis, but it should suffice for now.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@63370 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-30 02:49:14 +00:00
Duncan Sands
8556d2a7f1 BasicAliasAnalysis and FunctionAttrs were both
doing very similar pointer capture analysis.
Factor out the common logic.  The new version
is from FunctionAttrs since it does a better
job than the version in BasicAliasAnalysis


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62461 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-18 12:19:30 +00:00
Gabor Greif
7f85bb6f83 add a comment
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62436 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-18 00:27:21 +00:00
Duncan Sands
ceb4d1aecb Rename getABITypeSize to getTypePaddedSize, as
suggested by Chris.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62099 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-12 20:38:59 +00:00
Chris Lattner
d4a2700fdc make tblgen autogenerate the nocapture intrinsics for
llvm.memcpy/memset/memmove.  This allows removal of some 
hackish code from basicaa.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62071 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-12 02:41:37 +00:00
Duncan Sands
91c9c31033 When checking if an Argument escapes, check if
the argument is marked nocapture - no need to
analyze the argument if the answer is already
known!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61753 91177308-0d34-0410-b5e6-96231b3b80d8
2009-01-05 21:19:53 +00:00
Nick Lewycky
f23d0d392a Resubmit support for the 'nocapture' attribute.
The problematic part of this patch is that we were out of attribute bits,
requiring some fancy bit hacking to make it fit (by shrinking alignment)
without breaking existing users or the file format.

This change will require users to rebuild llvm-gcc to match llvm.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61239 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-19 06:39:12 +00:00
Bill Wendling
6fa311c233 Temporarily revert r61019, r61030, and r61040. These were breaking LLVM Release
builds.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61094 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-16 19:06:48 +00:00
Chris Lattner
1314f20283 Teach basicaa to use the nocapture attribute when possible. When the
intrinsics are properly marked nocapture, the fixme should be addressed.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61040 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-15 18:59:22 +00:00
Chris Lattner
b957bda0bc Allow basicaa to walk through geps with identical indices in
parallel, allowing it to decide that P/Q must alias if A/B
must alias in things like:
 P = gep A, 0, i, 1
 Q = gep B, 0, i, 1

This allows GVN to delete 62 more instructions out of 403.gcc.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60820 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-10 01:04:47 +00:00
Chris Lattner
20d6f0982a Teach BasicAA::getModRefInfo(CallSite, CallSite) some
tricks based on readnone/readonly functions.

Teach memdep to look past readonly calls when analyzing
deps for a readonly call.  This allows elimination of a
few more calls from 403.gcc:

before:
     63 gvn    - Number of instructions PRE'd
 153986 gvn    - Number of instructions deleted
  50069 gvn    - Number of loads deleted

after:
     63 gvn    - Number of instructions PRE'd
 153991 gvn    - Number of instructions deleted
  50069 gvn    - Number of loads deleted

5 calls isn't much, but this adds plumbing for the next change.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60794 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-09 21:19:42 +00:00
Duncan Sands
1832705b06 Fix comment typo.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60697 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-08 14:01:59 +00:00
Chris Lattner
295d4e953a Some minor optimizations for isObjectSmallerThan.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@60687 91177308-0d34-0410-b5e6-96231b3b80d8
2008-12-08 06:28:54 +00:00
Nick Lewycky
b2b32fd3fe Seriously strengthen the guarantee offered by noalias on a function's return
value. It must now be as if the pointer were allocated and has not escaped to
the caller. Thanks to Dan Gohman for pointing out the error in the original
and helping devise this definition.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59940 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 05:00:44 +00:00
Nick Lewycky
02ff308aa1 Extend the 'noalias' attribute to function return values. This is intended to
indicate functions that allocate, such as operator new, or list::insert. The
actual definition is slightly less strict (for now).

No changes to the bitcode reader/writer, asm printer or verifier were needed.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@59934 91177308-0d34-0410-b5e6-96231b3b80d8
2008-11-24 03:41:24 +00:00
Duncan Sands
5d0392c6b3 Factorize code: remove variants of "strip off
pointer bitcasts and GEP's", and centralize the
logic in Value::getUnderlyingObject.  The
difference with stripPointerCasts is that
stripPointerCasts only strips GEPs if all
indices are zero, while getUnderlyingObject
strips GEPs no matter what the indices are.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56922 91177308-0d34-0410-b5e6-96231b3b80d8
2008-10-01 15:25:41 +00:00
Devang Patel
eaf42abab6 s/ParameterAttributes/Attributes/g
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@56513 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-23 23:03:40 +00:00
Dan Gohman
ae73dc1448 Tidy up several unbeseeming casts from pointer to intptr_t.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@55779 91177308-0d34-0410-b5e6-96231b3b80d8
2008-09-04 17:05:41 +00:00
Chris Lattner
25df20f169 simplify some code by using a helper function. This really really
wants a 'nocapture' predicate.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52304 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-16 06:38:26 +00:00
Chris Lattner
defa1c8034 move a bunch of predicates up into their own section
in this file, no other changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52303 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-16 06:30:22 +00:00
Chris Lattner
e7275794d3 Other parts of this code treat noalias arguments as objects for
the purposes of escape analysis.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52302 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-16 06:28:01 +00:00
Chris Lattner
845f0d2f0f If we are checking to see if the result of a call aliases a
pointer derived from a local allocation, if the local allocation
never escapes, the pointers can't alias.  This implements PR2436


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52301 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-16 06:19:11 +00:00
Chris Lattner
a413960a48 Refactor basicaa's main alias function somethin' fierce.
This fixes several minor bugs (such as returning noalias
for comparisons between external weak functions an null) but
is mostly a cleanup.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@52299 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-16 06:10:11 +00:00
Wojciech Matyjewicz
98e3a6829a Fixes PR2395. Looking for a constant in a GEP tail (when the first GEP
is longer than the second one) should stop after finding one. Added break 
instruction guarantees it. It also changes difference between offsets to 
absolute value of this difference in the condition.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51875 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-02 17:26:12 +00:00
Dan Gohman
844731a7f1 Clean up the use of static and anonymous namespaces. This turned up
several things that were neither in an anonymous namespace nor static
but not intended to be global.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51017 91177308-0d34-0410-b5e6-96231b3b80d8
2008-05-13 00:00:25 +00:00
Duncan Sands
e47d98200e Fix a "large integer implicitly truncated to unsigned type"
warning.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@50033 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-21 07:35:28 +00:00
Dale Johannesen
21d31a8d94 Don't assume a tail call can't reference a byval
argument to the outer function, this isn't correct.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@49731 91177308-0d34-0410-b5e6-96231b3b80d8
2008-04-15 17:41:34 +00:00
Devang Patel
4f4c28f75f Restore isCFGOnly property of various analysis passes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48579 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-20 02:25:21 +00:00
Devang Patel
c758209153 PassInfo keep tracks whether a pass is an analysis pass or not.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48554 91177308-0d34-0410-b5e6-96231b3b80d8
2008-03-19 21:56:59 +00:00
Duncan Sands
ec5ec88d15 Fix a compiler warning.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47328 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 09:28:48 +00:00
Owen Anderson
851bfff50f In addition to arguments passed to it, memcpy (and all other calls) can ModRef pointers that alias their arguments as well. This fixes PR2057.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47317 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-19 06:47:18 +00:00
Chris Lattner
bb494bcb0e don't bother calling getUnderlyingObject for non-pointers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47272 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 17:28:21 +00:00
Owen Anderson
ef562471ce Since we're not checking for the more general AllocationInst first, we need to explicitly check
that Object is an Argument before casting it to one.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47268 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 10:11:00 +00:00
Owen Anderson
26d914ada3 This check is not correct for mallocs, so exclude them earlier.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47263 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 09:11:02 +00:00
Owen Anderson
ae708a3d91 Fix a comment, and a bug where we weren't applying the tail call logic in cases that failed the first test.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47253 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 03:52:21 +00:00
Owen Anderson
9aa7c35cee Fix bugs that Chris noticed in my last patch.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47252 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 02:31:23 +00:00
Chris Lattner
0ab5a4ae55 bitcasts of pointers are always pointers.
If we see a memcpy of a pointer, make sure to check later
uses of the pointer as well.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47250 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-18 02:11:28 +00:00
Owen Anderson
9b636cb338 Teach getModRefInfo that memcpy, memmove, and memset don't "capture" memory addresses.
Also, noalias arguments are be considered "like" stack allocated ones for this purpose, because
the only way they can be modref'ed is if they escape somewhere in the current function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@47247 91177308-0d34-0410-b5e6-96231b3b80d8
2008-02-17 21:29:08 +00:00
Chris Lattner
d087480166 getUnderlyingObject can return null, handle this.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46318 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-24 19:07:10 +00:00
Chris Lattner
fd68750038 Teach basicaa that 'byval' arguments define a new memory location that
can't be aliased to other known objects.  This allows us to know that byval 
pointer args don't alias globals, etc.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46315 91177308-0d34-0410-b5e6-96231b3b80d8
2008-01-24 18:00:32 +00:00
Chris Lattner
4ee451de36 Remove attribution from file headers, per discussion on llvmdev.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@45418 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-29 20:36:04 +00:00
Wojciech Matyjewicz
4ba8cfc5a4 Make these loops follow GetGEPOperands() behavior.
Let: %q = GEP %p, X, ...
If %p is a GEP, we can chase baseptr further, only if X==0.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44999 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-13 16:22:58 +00:00
Chris Lattner
f88380ba2c Fix PR1782, patch by Wojtek Matyjewicz!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44733 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-09 07:35:13 +00:00
Duncan Sands
a3355ffb3d Rather than having special rules like "intrinsics cannot
throw exceptions", just mark intrinsics with the nounwind
attribute.  Likewise, mark intrinsics as readnone/readonly
and get rid of special aliasing logic (which didn't use
anything more than this anyway).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44544 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-03 20:06:50 +00:00
Duncan Sands
dff6710717 Integrate the readonly/readnone logic more deeply
into alias analysis.  This meant updating the API
which now has versions of the getModRefBehavior,
doesNotAccessMemory and onlyReadsMemory methods
which take a callsite parameter.  These should be
used unless the callsite is not known, since in
general they can do a better job than the versions
that take a function.  Also, users should no longer
call the version of getModRefBehavior that takes
both a function and a callsite.  To reduce the
chance of misuse it is now protected.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44487 91177308-0d34-0410-b5e6-96231b3b80d8
2007-12-01 07:51:45 +00:00
Duncan Sands
afa3b6da11 Add some convenience methods for querying attributes, and
use them.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44403 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-28 17:07:01 +00:00
Duncan Sands
dc024674ff Fix PR1146: parameter attributes are longer part of
the function type, instead they belong to functions
and function calls.  This is an updated and slightly
corrected version of Reid Spencer's original patch.
The only known problem is that auto-upgrading of
bitcode files doesn't seem to work properly (see
test/Bitcode/AutoUpgradeIntrinsics.ll).  Hopefully
a bitcode guru (who might that be? :) ) will fix it.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44359 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-27 13:23:08 +00:00
Duncan Sands
e4dc717585 Ding dong, the DoesntAccessMemoryFns and
OnlyReadsMemoryFns tables are dead!  We
get more, and more accurate, information
from gcc via the readnone and readonly
function attributes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44288 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-23 19:30:27 +00:00
Duncan Sands
920653d41e Teach alias analysis about readnone/readonly functions.
Based on a patch by Török Edwin.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44279 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-22 21:43:27 +00:00
Tanya Lattner
ee22be064e Fix for PR1801
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@44193 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-16 22:44:50 +00:00
Chris Lattner
9907cb12ae Fix PR1774 and BasicAA/2007-11-05-SizeCrash.ll
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43756 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-06 05:58:42 +00:00
Duncan Sands
514ab348fd Executive summary: getTypeSize -> getTypeStoreSize / getABITypeSize.
The meaning of getTypeSize was not clear - clarifying it is important
now that we have x86 long double and arbitrary precision integers.
The issue with long double is that it requires 80 bits, and this is
not a multiple of its alignment.  This gives a primitive type for
which getTypeSize differed from getABITypeSize.  For arbitrary precision
integers it is even worse: there is the minimum number of bits needed to
hold the type (eg: 36 for an i36), the maximum number of bits that will
be overwriten when storing the type (40 bits for i36) and the ABI size
(i.e. the storage size rounded up to a multiple of the alignment; 64 bits
for i36).

This patch removes getTypeSize (not really - it is still there but
deprecated to allow for a gradual transition).  Instead there is:

(1) getTypeSizeInBits - a number of bits that suffices to hold all
values of the type.  For a primitive type, this is the minimum number
of bits.  For an i36 this is 36 bits.  For x86 long double it is 80.
This corresponds to gcc's TYPE_PRECISION.

(2) getTypeStoreSizeInBits - the maximum number of bits that is
written when storing the type (or read when reading it).  For an
i36 this is 40 bits, for an x86 long double it is 80 bits.  This
is the size alias analysis is interested in (getTypeStoreSize
returns the number of bytes).  There doesn't seem to be anything
corresponding to this in gcc.

(3) getABITypeSizeInBits - this is getTypeStoreSizeInBits rounded
up to a multiple of the alignment.  For an i36 this is 64, for an
x86 long double this is 96 or 128 depending on the OS.  This is the
spacing between consecutive elements when you form an array out of
this type (getABITypeSize returns the number of bytes).  This is
TYPE_SIZE in gcc.

Since successive elements in a SequentialType (arrays, pointers
and vectors) need to be aligned, the spacing between them will be
given by getABITypeSize.  This means that the size of an array
is the length times the getABITypeSize.  It also means that GEP
computations need to use getABITypeSize when computing offsets.
Furthermore, if an alloca allocates several elements at once then
these too need to be aligned, so the size of the alloca has to be
the number of elements multiplied by getABITypeSize.  Logically
speaking this doesn't have to be the case when allocating just
one element, but it is simpler to also use getABITypeSize in this
case.  So alloca's and mallocs should use getABITypeSize.  Finally,
since gcc's only notion of size is that given by getABITypeSize, if
you want to output assembler etc the same as gcc then getABITypeSize
is the size you want.

Since a store will overwrite no more than getTypeStoreSize bytes,
and a read will read no more than that many bytes, this is the
notion of size appropriate for alias analysis calculations.

In this patch I have corrected all type size uses except some of
those in ScalarReplAggregates, lib/Codegen, lib/Target (the hard
cases).  I will get around to auditing these too at some point,
but I could do with some help.

Finally, I made one change which I think wise but others might
consider pointless and suboptimal: in an unpacked struct the
amount of space allocated for a field is now given by the ABI
size rather than getTypeStoreSize.  I did this because every
other place that reserves memory for a type (eg: alloca) now
uses getABITypeSize, and I didn't want to make an exception
for unpacked structs, i.e. I did it to make things more uniform.
This only effects structs containing long doubles and arbitrary
precision integers.  If someone wants to pack these types more
tightly they can always use a packed struct.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43620 91177308-0d34-0410-b5e6-96231b3b80d8
2007-11-01 20:53:16 +00:00
Owen Anderson
ef15029258 Make a comment better.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43379 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-26 03:47:14 +00:00
Owen Anderson
f92ff03f71 Fix for PR1741.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@43326 91177308-0d34-0410-b5e6-96231b3b80d8
2007-10-25 02:36:18 +00:00
Owen Anderson
718cb665ca Add lengthof and endof templates that hide a lot of sizeof computations.
Patch by Sterling Stein!


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41758 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-07 04:06:50 +00:00
Evan Cheng
df344febe2 Missing break. Patch by Wojciech Matyjewicz.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41727 91177308-0d34-0410-b5e6-96231b3b80d8
2007-09-05 21:36:14 +00:00
Chandler Carruth
a583990ec8 This resolves a regression of BasicAA which failed to find any memory information for overloaded intrinsics (PR1600). This resolves that issue, and improves the matching scheme to use a BitVector rather than a binary search.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40872 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-06 20:57:16 +00:00
Chris Lattner
8c5287086c Upgrade BasicAliasAnalysis::getModRefBehavior to not call Value::getName,
which dynamically allocates the string result.  This speeds up dse on the
testcase from PR1432 from 0.3781s to 0.1804s (2.1x).


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40838 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-05 07:50:06 +00:00
Christopher Lamb
a326b5da4b Implement review feedback.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40745 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 17:52:00 +00:00
Christopher Lamb
406bfa3e21 Teach BasicAA about noalias parameter attributes, but do it correctly this time.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40711 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 01:18:14 +00:00
Christopher Lamb
321ff4e6d5 Revert overly aggressive interpretation of noalias
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40635 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 16:18:07 +00:00
Christopher Lamb
50192c2152 Teach BasicAA about noalias function parameters. Passes all of DejaGNU and test-suite.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40624 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 07:04:51 +00:00
Dan Gohman
07a96765da Fix comments about vectors to use the current wording.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@39921 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-16 14:29:03 +00:00
Dan Gohman
a6900c7ad9 Add explicit keywords.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37839 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-02 14:53:37 +00:00
Anton Korobeynikov
03265f98a3 Make BasicAliasAnalysis correctly register itself. Patch by Devang
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@37627 91177308-0d34-0410-b5e6-96231b3b80d8
2007-06-18 17:13:29 +00:00
Devang Patel
1997473cf7 Drop 'const'
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36662 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-03 01:11:54 +00:00
Devang Patel
3e15bf33e0 Use 'static const char' instead of 'static const int'.
Due to darwin gcc bug, one version of darwin linker coalesces
static const int, which defauts PassID based pass identification.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36652 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-02 21:39:20 +00:00
Devang Patel
794fd75c67 Do not use typeinfo to identify pass in pass manager.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36632 91177308-0d34-0410-b5e6-96231b3b80d8
2007-05-01 21:15:47 +00:00
Zhou Sheng
843f0767ac Make use of ConstantInt::isZero instead of ConstantInt::isNullValue.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@36261 91177308-0d34-0410-b5e6-96231b3b80d8
2007-04-19 05:39:12 +00:00
Reid Spencer
9d6565a5b1 For PR1195:
Rename PackedType -> VectorType, ConstantPacked -> ConstantVector, and
PackedTyID -> VectorTyID. No functional changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34293 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-15 02:26:10 +00:00
Chris Lattner
a77600e861 Switch some std::vector's to SmallVectors. This speeds up -load-vn -gcse
by 6% on tramp3d.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34167 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 22:15:31 +00:00
Chris Lattner
fd1ad3b730 modify CheckGEPInstructions to take a pointer and size instead of a vector.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34166 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 22:12:53 +00:00
Chris Lattner
829621c59e eliminate use of TargetData::getIndexedOffset that takes a vector
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@34163 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-10 20:35:22 +00:00
Reid Spencer
d7d83db5f2 Make classes in anonymous namespaces use VISIBILITY_HIDDEN to help reduce
LLVM's footprint and speed up linking.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33941 91177308-0d34-0410-b5e6-96231b3b80d8
2007-02-05 23:42:17 +00:00
Reid Spencer
5cbf985dcb For PR1136: Rename GlobalVariable::isExternal as isDeclaration to avoid
confusion with external linkage types.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33663 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-30 20:08:39 +00:00
Chris Lattner
241607d016 fit to 80 cols.
Remove now-extraneous checks for ptr->ptr bitcasts.

Fix PR1109 and Analysis/BasicAA/2007-01-13-BasePointerBadNoAlias.ll.  We
need to consider arbitrary sized objects when checking for nested GEP offsets.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33195 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-14 05:57:53 +00:00
Chris Lattner
0bb38313ae GEP operands can't be bools
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33125 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 18:20:48 +00:00
Reid Spencer
579dca12c2 Implement review feedback for the ConstantBool->ConstantInt merge. Chris
recommended that getBoolValue be replaced with getZExtValue and that
get(bool) be replaced by get(const Type*, uint64_t). This implements
those changes.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33110 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-12 04:24:46 +00:00
Reid Spencer
4fe16d607d Rename BoolTy as Int1Ty. Patch by Sheng Zhou.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33076 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 18:21:29 +00:00
Zhou Sheng
6b6b6ef167 For PR1043:
Merge ConstantIntegral and ConstantBool into ConstantInt.
Remove ConstantIntegral and ConstantBool from LLVM.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@33073 91177308-0d34-0410-b5e6-96231b3b80d8
2007-01-11 12:24:14 +00:00
Reid Spencer
c5b206b6be For PR950:
This patch replaces signed integer types with signless ones:
1. [US]Byte -> Int8
2. [U]Short -> Int16
3. [U]Int   -> Int32
4. [U]Long  -> Int64.
5. Removal of isSigned, isUnsigned, getSignedVersion, getUnsignedVersion
   and other methods related to signedness. In a few places this warranted
   identifying the signedness information from other sources.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32785 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-31 05:48:39 +00:00
Reid Spencer
e4d87aa2de For PR950:
This patch removes the SetCC instructions and replaces them with the ICmp
and FCmp instructions. The SetCondInst instruction has been removed and
been replaced with ICmpInst and FCmpInst.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32751 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-23 06:05:41 +00:00
Reid Spencer
d977d8651a Replace inferred getCast(V,Ty) calls with more strict variants.
Rename getZeroExtend and getSignExtend to getZExt and getSExt to match
the the casting mnemonics in the rest of LLVM.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32514 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-12 23:36:14 +00:00
Bill Wendling
e81561909d Changed llvm_ostream et all to OStream. llvm_cerr, llvm_cout, llvm_null, are
now cerr, cout, and NullStream resp.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32298 91177308-0d34-0410-b5e6-96231b3b80d8
2006-12-07 01:30:32 +00:00
Bill Wendling
a5b31ca856 Convert to using llvm streams instead of iostreams.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31989 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-28 23:33:06 +00:00
Reid Spencer
3da59db637 For PR950:
The long awaited CAST patch. This introduces 12 new instructions into LLVM
to replace the cast instruction. Corresponding changes throughout LLVM are
provided. This passes llvm-test, llvm/test, and SPEC CPUINT2000 with the
exception of 175.vpr which fails only on a slight floating point output
difference.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31931 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-27 01:05:10 +00:00
Chris Lattner
c2e6801cc7 remove redundant code
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31697 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-13 01:10:12 +00:00
Chris Lattner
7765d71304 Fix BasicAA/2006-11-03-BasicAAVectorCrash.ll by handling out-of-range
vector accesses like we handle out-of-range array accesses.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31427 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-03 21:58:48 +00:00
Reid Spencer
3ed469ccd7 For PR786:
Turn on -Wunused and -Wno-unused-parameter. Clean up most of the resulting
fall out by removing unused variables. Remaining warnings have to do with
unused functions (I didn't want to delete code without review) and unused
variables in generated code. Maintainers should clean up the remaining
issues when they see them. All changes pass DejaGnu tests and Olden.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31380 91177308-0d34-0410-b5e6-96231b3b80d8
2006-11-02 20:25:50 +00:00
Reid Spencer
b83eb6447b For PR950:
This patch implements the first increment for the Signless Types feature.
All changes pertain to removing the ConstantSInt and ConstantUInt classes
in favor of just using ConstantInt.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@31063 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-20 07:07:24 +00:00
Chris Lattner
90aa839c88 Fix more static dtor issues
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@30725 91177308-0d34-0410-b5e6-96231b3b80d8
2006-10-04 21:52:35 +00:00
Chris Lattner
a5370172b6 simplify AnalysisGroup registration, eliminating one typeid call.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29932 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-28 00:42:29 +00:00
Chris Lattner
7f8897f22e eliminate RegisterOpt. It does the same thing as RegisterPass.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29925 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-27 22:42:52 +00:00
Chris Lattner
a4f0b3a084 s|llvm/Support/Visibility.h|llvm/Support/Compiler.h|
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29911 91177308-0d34-0410-b5e6-96231b3b80d8
2006-08-27 12:54:02 +00:00
Chris Lattner
9525528a7d Use hidden visibility to make symbols in an anonymous namespace get
dropped.  This shrinks libllvmgcc.dylib another 67K


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28975 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-28 23:17:24 +00:00
Reid Spencer
4f1bd9e996 For PR780:
1. Fix the macros in IncludeFile.h to put everything in the llvm namespace
2. Replace the previous explicit mechanism in all the .h and .cpp files
   with the macros in IncludeFile.h
This gets us a consistent mechanism throughout LLVM for ensuring linkage.
Next step is to make sure its used in enough places.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28715 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-07 22:00:26 +00:00
Reid Spencer
192913e281 Change from using a stub function to a stub variable for passing to the
IncludeFile hack to ensure linkage of analysis passes. This works around
some -pedantic warnings about assigning an object to a function.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@28621 91177308-0d34-0410-b5e6-96231b3b80d8
2006-06-01 07:02:51 +00:00
Chris Lattner
cad25379d3 Use autogenerated mod/ref info for intrinsics.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26670 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-09 22:31:29 +00:00
Chris Lattner
2cfdd2854c Fix a crash compiling Obsequi
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26529 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-04 21:48:01 +00:00
Chris Lattner
5a3cf8de5d Be more conservative with our symbolic alias analysis. In particular,
don't assume that A[1][0] and A[0][i] can't alias.  "i" might be out of
range, or even negative.  This fixes a miscompilation of 188.ammp (which
does bad pointer tricks) with the new CFE.

Testcase here: Analysis/BasicAA/2006-03-03-BadArraySubscript.ll


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26515 91177308-0d34-0410-b5e6-96231b3b80d8
2006-03-04 02:06:34 +00:00
Nate Begeman
6fb3bd6a65 Add bswap intrinsics as documented in the Language Reference
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25309 91177308-0d34-0410-b5e6-96231b3b80d8
2006-01-14 01:25:24 +00:00