1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-10-20 19:42:54 +02:00
Commit Graph

2000 Commits

Author SHA1 Message Date
Devang Patel
d980abaae2 Introduce two DWARF attribute extentions DW_AT_APPLE_optimized, DW_AT_APPLE_flags.
DW_AT_APPLE_optimized flag is set when a compile_unit is optimized. The debugger takes advantage of this information some way.

DW_AT_APPLE_flags encodes command line options when certain env. variable is set. This is used by build engineers to track various gcc command lines used by by  a project, irrespective of whether the project used makefile, Xcode or something else.

llvm-gcc patch is next.

llvm-svn: 62888
2009-01-23 22:33:47 +00:00
Chris Lattner
b36503c31b fix two more cases where we could let the NLPDI cache get unsorted.
With this, sqlite3 now passes.

llvm-svn: 62839
2009-01-23 07:12:16 +00:00
Chris Lattner
1dc435cdc7 Unconditionally reset 'cache' to zero, even if we don't need to resort it.
This avoids using a dangling pointer.

Reset NumSortedEntries after restoring Cache to avoid extraneous sorts.
This fixes the reduced sqlite3 testcase, but apparently not the whole app.

llvm-svn: 62838
2009-01-23 06:48:41 +00:00
Chris Lattner
f2adaaa0fc a minor tweak to my previous patch, handle the invalidation case
when there are multiple iterations of the loop.  This fixes PR3375.

llvm-svn: 62822
2009-01-23 00:27:03 +00:00
Gabor Greif
d56b0a8c03 introduce a useful abstraction to find out if a Use is in the call position of an instruction
llvm-svn: 62788
2009-01-22 21:35:57 +00:00
Chris Lattner
ddc8e78d54 Fix PR3358, a really nasty bug where recursive phi translated
analyses could be run without the caches properly sorted.  This
can fix all sorts of weirdness.  Many thanks to Bill for coming
up with the 'issorted' verification idea.

llvm-svn: 62757
2009-01-22 07:04:01 +00:00
Devang Patel
ccc3162f69 Need only one set of debug info versions enum.
llvm-svn: 62602
2009-01-20 19:22:03 +00:00
Chris Lattner
391f04d56e Eliminate use of uint32_t to improve compatibility with cygwin
llvm-svn: 62590
2009-01-20 18:22:57 +00:00
Devang Patel
7c2157602d Verify debug info.
llvm-svn: 62545
2009-01-19 23:21:49 +00:00
Oscar Fuentes
fae323d3f2 CMake: Add lib/Analysis/CaptureTracking.cpp
llvm-svn: 62462
2009-01-18 13:14:11 +00:00
Duncan Sands
ddfeabbab7 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

llvm-svn: 62461
2009-01-18 12:19:30 +00:00
Gabor Greif
6a02ecbd29 add a comment
llvm-svn: 62436
2009-01-18 00:27:21 +00:00
Gabor Greif
5608ce587b switch over some other methods from indices to iterators
llvm-svn: 62430
2009-01-17 19:46:01 +00:00
Gabor Greif
c379e7909b speed up iterative loop by using iterators. changes direction, but functionally equivalent
if this works out, I'll change the others next.

llvm-svn: 62385
2009-01-17 00:14:25 +00:00
Nick Lewycky
3f81059a01 Reinstate r60509 from Dale:
Make the debugging dump be a full line.

llvm-svn: 62325
2009-01-16 17:07:22 +00:00
Rafael Espindola
0aba6c9435 Add the private linkage.
llvm-svn: 62279
2009-01-15 20:18:42 +00:00
Gabor Greif
1f18247d42 minor simplification
llvm-svn: 62232
2009-01-14 17:09:04 +00:00
Nick Lewycky
911bb6122c Wind SCEV back in time, to Nov 18th. This 'fixes' PR3275, PR3294, PR3295,
PR3296 and PR3302.

llvm-svn: 62160
2009-01-13 09:18:58 +00:00
Devang Patel
78077adf03 Add classof() methods to support isa<> and other related facilities.
llvm-svn: 62104
2009-01-12 21:38:43 +00:00
Duncan Sands
bcdbfb63dc Rename getABITypeSize to getTypePaddedSize, as
suggested by Chris.

llvm-svn: 62099
2009-01-12 20:38:59 +00:00
Chris Lattner
ed4ee47a0d make tblgen autogenerate the nocapture intrinsics for
llvm.memcpy/memset/memmove.  This allows removal of some 
hackish code from basicaa.

llvm-svn: 62071
2009-01-12 02:41:37 +00:00
Misha Brukman
71c7e40966 Removed trailing whitespace from Makefiles.
llvm-svn: 61991
2009-01-09 16:44:42 +00:00
Chris Lattner
5a8a2b046d ValueTracker can't assume that an alloca with no specified alignment
will get its preferred alignment.  It has to be careful and cautiously assume
it will just get the ABI alignment.  This prevents instcombine from rounding
up the alignment of a load/store without adjusting the alignment of the alloca.

llvm-svn: 61934
2009-01-08 19:28:38 +00:00
Duncan Sands
4e1ee2698f 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!

llvm-svn: 61753
2009-01-05 21:19:53 +00:00
Devang Patel
07cb07d80e Add classof() methods so that dwarf writer can decide what DIDescriptor is in its hand.
llvm-svn: 61740
2009-01-05 19:55:07 +00:00
Devang Patel
c4c51439bf Construct array/vector type DIEs using DebugInfo.
llvm-svn: 61724
2009-01-05 18:33:01 +00:00
Dan Gohman
8271066844 Tidy up #includes, deleting a bunch of unnecessary #includes.
llvm-svn: 61715
2009-01-05 17:59:02 +00:00
Nick Lewycky
5222f155a0 We know it's always a SCEVConstant if it gets here, so just cast it and
inline the only use of isNegative. Fixes warning reported by Mike Stump.

llvm-svn: 61600
2009-01-03 01:53:24 +00:00
Nick Lewycky
2c01a8db3d Don't try to analyze this "backward" case. This is overly conservative
pending a correct solution.

llvm-svn: 61589
2009-01-02 18:54:17 +00:00
Nick Lewycky
bb69bd55a4 Check that the function prototypes are correct before assuming that the
parameters are pointers.

llvm-svn: 61451
2008-12-27 16:20:53 +00:00
Nick Lewycky
8f96b51785 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.

llvm-svn: 61239
2008-12-19 06:39:12 +00:00
Evan Cheng
d3d1efc584 Remove dead comments.
llvm-svn: 61201
2008-12-18 09:01:18 +00:00
Devang Patel
ceeecba890 Today the front-ends (llvm-gcc and clang) generate multiple llvm.dbg.compile_units to identify source file for various debug entities. Each llvm.dbg.compile_unit matches one file on the disk. However, the backend only supports one DW_TAG_compile_unit per .o file. The backend selects first compile_unit from the vector to construct DW_TAG_compile_unit entry, which is not correct in all cases.
First step to resolve this is, record file name and directory directly in debug info for various debug entities. 

llvm-svn: 61164
2008-12-17 22:39:29 +00:00
Bill Wendling
f807a68f2e Temporarily revert r61019, r61030, and r61040. These were breaking LLVM Release
builds.

llvm-svn: 61094
2008-12-16 19:06:48 +00:00
Oscar Fuentes
9a300fe336 CMake: Added DbgInfoPrinter.cpp to lib/Analysis/CMakeFiles.txt.
llvm-svn: 61087
2008-12-16 12:25:04 +00:00
Torok Edwin
9562aa1742 Add -print-dbginfo pass that prints LLVM IR with comments inserted to show
which source/line a certain BB/instruction comes from, original variable names,
and original (unmangled) C++ name of functions.

llvm-svn: 61085
2008-12-16 09:09:19 +00:00
Torok Edwin
fe974a7ca9 Add utility functions to search for DbgStopPointInst corresponding to an
instruction or BasicBlock, and to search for DbgDeclareInst corresponding to a
variable.

llvm-svn: 61084
2008-12-16 09:07:36 +00:00
Torok Edwin
2e2c464771 use different name for parameter to make it clear that we set DIDescriptor::GV
llvm-svn: 61083
2008-12-16 09:06:01 +00:00
Nick Lewycky
1b0fc83809 Generalize support for analyzing loops to include SLE/SGE loop exit conditions
and support for non-unit strides with signed exit conditions.

llvm-svn: 61082
2008-12-16 08:30:01 +00:00
Chris Lattner
b3becc5776 fix PR3217: fully cached queries need to be verified against the
visited set before they are used.  If used, their blocks need to be
added to the visited set so that subsequent queries don't use conflicting
pointer values in the cache result blocks.

llvm-svn: 61080
2008-12-16 07:10:09 +00:00
Chris Lattner
0e79aa6595 Teach basicaa to use the nocapture attribute when possible. When the
intrinsics are properly marked nocapture, the fixme should be addressed.

llvm-svn: 61040
2008-12-15 18:59:22 +00:00
Chris Lattner
be89ad1615 if we have a phi translation failure of the start block,
return *just* a clobber of the start block, not other 
random stuff as well.

llvm-svn: 61026
2008-12-15 04:58:29 +00:00
Chris Lattner
c92b131639 Implement initial support for PHI translation in memdep. This means that
memdep keeps track of how PHIs affect the pointer in dep queries, which 
allows it to eliminate the load in cases like rle-phi-translate.ll, which
basically end up being:

BB1:
   X = load P
   br BB3
BB2:
   Y = load Q
   br BB3
BB3:
   R = phi [P] [Q]
   load R

turning "load R" into a phi of X/Y.  In addition to additional exposed
opportunities, this makes memdep safe in many cases that it wasn't before
(which is required for load PRE) and also makes it substantially more 
efficient.  For example, consider:


bb1:  // has many predecessors.
   P = some_operator()
   load P

In this example, previously memdep would scan all the predecessors of BB1
to see if they had something that would mustalias P.  In some cases (e.g.
test/Transforms/GVN/rle-must-alias.ll) it would actually find them and end
up eliminating something.  In many other cases though, it would scan and not
find anything useful.  MemDep now stops at a block if the pointer is defined
in that block and cannot be phi translated to predecessors.  This causes it
to miss the (rare) cases like rle-must-alias.ll, but makes it faster by not
scanning tons of stuff that is unlikely to be useful.  For example, this
speeds up GVN as a whole from 3.928s to 2.448s (60%)!.  IMO, scalar GVN 
should be enhanced to simplify the rle-must-alias pointer base anyway, which
would allow the loads to be eliminated.

In the future, this should be enhanced to phi translate through geps and 
bitcasts as well (as indicated by FIXMEs) making memdep even more powerful.

llvm-svn: 61022
2008-12-15 03:35:32 +00:00
Nick Lewycky
120e01b631 Fix whitespace in comment.
Remove TODO; icmp isn't a binary operator, so this function will never deal
with them.

llvm-svn: 61020
2008-12-15 01:35:36 +00:00
Torok Edwin
8898288749 Fix getFieldAs() to use the parameter instead of 6.
Add missing DIType constructor, needed by DIVariable::getType().

llvm-svn: 60976
2008-12-13 08:25:29 +00:00
Nick Lewycky
51228d6707 Revert my re-instated reverted commit, fixes the bootstrap build on x86-64 linux.
llvm-svn: 60951
2008-12-12 17:09:07 +00:00
Nick Lewycky
312d95be37 Sneaky, sneaky: move the -1 to the outside of the SMax. Reinstate the
optimization of SGE/SLE with unit stride, now that it works properly.

llvm-svn: 60881
2008-12-11 17:40:14 +00:00
Duncan Sands
ecb1273c5b Don't dereference the end() iterator. This was
causing a bunch of failures when running
"make ENABLE_EXPENSIVE_CHECKS=1 check".

llvm-svn: 60832
2008-12-10 09:38:36 +00:00
Chris Lattner
e2b5854e41 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.

llvm-svn: 60820
2008-12-10 01:04:47 +00:00
Chris Lattner
2550938060 loosen up an assertion that isn't valid when called from
invalidateCachedPointerInfo.  Thanks to Bill for sending me
a testcase.

llvm-svn: 60805
2008-12-09 22:45:32 +00:00