Commit Graph

1618 Commits

Author SHA1 Message Date
Devang Patel
6b4af744b8 Do not overuse std::string. Pass around char * directly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@41001 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-10 18:29:32 +00:00
Owen Anderson
9528f11481 Make NonLocal and None const in the right way. :-)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40961 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-09 04:42:44 +00:00
Owen Anderson
642a9e3436 Add more comments to memdep.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40953 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-08 22:26:03 +00:00
Owen Anderson
80b1f09693 Make memdep fit in 80 cols.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40950 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-08 22:01:54 +00:00
Owen Anderson
8cad423d94 Change the None and NonLocal markers in memdep to be const.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40946 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-08 21:39:39 +00:00
Chris Lattner
a099b6c7bb Handle functions with no name better.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40926 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-08 16:07:23 +00:00
Chris Lattner
c5f6a1f9d6 significantly speed up constant folding of calls (and thus all clients that use
ConstantFoldInstruction on calls) by avoiding Value::getName().  getName() constructs
and returns an std::string, which does heap allocation stuff.  This slightly speeds up
instcombine.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40924 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-08 06:55:43 +00:00
Chris Lattner
3e089ae0b8 reimplement dfs number computation to be significantly faster. This speeds up
natural loop canonicalization (which does many cfg xforms) by 4.3x, for 
example.  This also fixes a bug in postdom dfnumber computation.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40920 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-08 05:51:24 +00:00
Owen Anderson
dbbe816757 Clean up a bunch of caching stuff in memdep. This reduces the time to run GVN
on 403.gcc from ~15s to ~10s.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40884 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-07 00:33:45 +00:00
Owen Anderson
8f35315798 Improve the accuracy of memdep for determining the dependencies of loads.
This brings GVN to parity with GCSE+LoadVN.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40882 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-06 23:26:03 +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
Nick Lewycky
d6dac0eebc Let scalar-evolution analyze loops with an unsigned comparison for the exit
condition. Fixes 1597.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40867 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-06 19:21:00 +00:00
Nick Lewycky
06323bfe03 Don't assume it's safe to transform a loop just because it's dominated by any
comparison. Fixes bug 1598.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40866 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-06 18:33:46 +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
Chris Lattner
a31965301d Fix an iterator invalidation bug I induced.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40830 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-05 00:24:30 +00:00
Chris Lattner
2f0d1ea864 Switch some std::sets to SmallPtrSet. This speeds up
domtree by 10% and postdomtree by 17%


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40829 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-05 00:15:57 +00:00
Chris Lattner
e93e311981 Switch the internal "Info" map from an std::map to a DenseMap. This
speeds up idom by about 45% and postidom by about 33%.

Some extra precautions must be taken not to invalidate densemap iterators.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40827 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-05 00:02:00 +00:00
Chris Lattner
0a5f83c22c switch the DomTreeNodes and IDoms maps in idom/postidom to a
DenseMap instead of an std::map.  This speeds up postdomtree
by about 25% and domtree by about 23%.  It also speeds up clients,
for example, domfrontier by 11%, mem2reg by 4% and ADCE by 6%.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40826 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-04 23:48:07 +00:00
Chandler Carruth
6994040a95 This is the patch to provide clean intrinsic function overloading support in LLVM. It cleans up the intrinsic definitions and generally smooths the process for more complicated intrinsic writing. It will be used by the upcoming atomic intrinsics as well as vector and float intrinsics in the future.
This also changes the syntax for llvm.bswap, llvm.part.set, llvm.part.select, and llvm.ct* intrinsics. They are automatically upgraded by both the LLVM ASM reader and the bitcode reader. The test cases have been updated, with special tests added to ensure the automatic upgrading is supported.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40807 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-04 01:51:18 +00:00
Owen Anderson
1c2763d3fe Fix a bug that was causing several miscompilations on SPEC.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40746 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-02 17:56:05 +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
Owen Anderson
9066020993 Make non-local memdep not be recursive, and fix a bug on 403.gcc that this exposed.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40692 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-01 22:01:54 +00:00
Dan Gohman
c2bbfc18e9 More explicit keywords.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40673 91177308-0d34-0410-b5e6-96231b3b80d8
2007-08-01 15:32:29 +00:00
David Greene
df464195fe Fix GLIBCXX_DEBUG error owing to dereference of end iterator. There's
no guarantee that an instruction returned by getDependency exists in
the maps.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40647 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 20:01:27 +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
Devang Patel
c7e49c08c2 Introduce Simple Analysis interface for loop passes.
Right now, this interface provides hooks for only to operations, 1) clone basic block 2) delete value.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40625 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-31 08:00:57 +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
Owen Anderson
45c8388e2a Use more caching when computing non-local dependence. This makes bzip2 not
use up the entire 32-bit address space.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40596 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-30 17:29:24 +00:00
Owen Anderson
a377a24771 Fix a bug introduced in my last commit.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40542 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-26 18:57:04 +00:00
Owen Anderson
45537917ee Fix a couple more bugs in the phi construction by pulling in code that does
almost the same things from LCSSA.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40540 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-26 18:26:51 +00:00
Owen Anderson
3dfcf33cf8 Fix a bug in non-local memdep that was causing an infinite loop on 175.vpr.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40495 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-25 21:26:36 +00:00
Owen Anderson
0cd320362e Add basic support for performing whole-function RLE.
Note: This has not yet been thoroughly tested.  Use at your own risk.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40489 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-25 19:57:03 +00:00
Owen Anderson
4beedbd006 Add initial support for non-local memory dependence analysis.
NOTE: This has only been cursorily tested.  Expected improvements soon.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40476 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-24 21:52:37 +00:00
Devang Patel
62e279bbdb Unreachable block is not a root node in post dominator tree.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40458 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-24 01:02:25 +00:00
Owen Anderson
521a20207c When removing instructions from the analysis, be sure to check the confirmed
flag when determining what to do with dependencies.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40079 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-20 06:16:07 +00:00
Devang Patel
58e0ef1e90 Verify loop info.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40062 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 18:02:32 +00:00
Duncan Sands
20d824b7df Replace mysterious code causing a g++-4.2 warning
with hopefully correct code that pleases g++-4.2.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40051 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-19 09:42:01 +00:00
Owen Anderson
faac518ce0 Add support for walking up memory def chains, which enables finding many more
dead stores on 400.perlbench.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@39929 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-16 21:52:50 +00:00
Dan Gohman
384152444d Use ConstantFoldFP for folding all unary floating-point operations which may
have an error, and refector out the code for binary operators into
ConstantFoldBinaryFP and use it for all binary floating-point operations
which may have an error. These functions still rely exclusively on errno
to detect errors though.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@39923 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-16 15:26:22 +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
Nick Lewycky
eefdebe002 Handle decrementing loops properly. Fixes PR1533.
Always pass the constant as the second parameter to HowManyLessThans.

Remove obsolete "isSigned" parameter.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@39893 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-16 02:08:00 +00:00
Owen Anderson
1cb960a4bb Let MemoryDependenceAnalysis take care of updating AliasAnalysis.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@39769 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-12 00:06:21 +00:00
Owen Anderson
8e85048d7b Calculate the size of a array allocation correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@38511 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-10 20:48:38 +00:00
Owen Anderson
202da14fe0 Fix a crasher when finding the dependency of a call.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@38510 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-10 20:39:07 +00:00
Owen Anderson
776ee1fb33 Make this pass registration static as well.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@38509 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-10 20:21:08 +00:00
Owen Anderson
06b6e82f79 Handle vaarg instructions correctly.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@38504 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-10 18:43:15 +00:00
Owen Anderson
e314eb3255 Volatile loads and stores depend on each other.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@38502 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-10 18:11:42 +00:00
Owen Anderson
5f32320797 Add support for finding the dependencies of call and invoke instructions.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@38497 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-10 17:59:22 +00:00
Owen Anderson
7a616a1012 Fix the build, and fix the handling of pointer sizes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@38494 91177308-0d34-0410-b5e6-96231b3b80d8
2007-07-10 17:25:03 +00:00