|  | Commit message (Collapse) | Author | Age | Files | Lines | 
|---|
| ... |  | 
| | 
| 
| 
| 
| 
| 
| 
| | pointer at bitcast uses of a malloc call.
It should continue scanning until the malloc call, and this patch fixes that.
llvm-svn: 83931 | 
| | 
| 
| 
| 
| 
| | scary, as it indicates a lurking bug. yay.
llvm-svn: 82411 | 
| | 
| 
| 
| 
| 
| 
| | early for the stated reasons: this allows it to find more 
equivalences and depend less on code layout.
llvm-svn: 82404 | 
| | 
| 
| 
| 
| 
| 
| 
| | as to MallocInst.
Reviewed by Eli Friedman.
llvm-svn: 82281 | 
| | 
| 
| 
| | llvm-svn: 77727 | 
| | 
| 
| 
| | llvm-svn: 77725 | 
| | 
| 
| 
| 
| 
| | and use it from one more place.  Patch by Jakub Staszak!
llvm-svn: 75478 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | so that all code paths get it.  PR4256 was about a case where the
phi translation loop would find all preds in the Visited cache, so
it could get by without re-sorting the NonLocalPointerDeps cache.
Fix this by resorting it earlier, there is no reason not to do this.
This patch inspired by Jakub Staszak's patch.
llvm-svn: 75476 | 
| | 
| 
| 
| 
| 
| 
| | low-level alias() method, allowing it to reason more aggressively
about pointers into constant memory.  PR4189
llvm-svn: 72403 | 
| | 
| 
| 
| 
| 
| | hackish workarounds from memdep
llvm-svn: 67971 | 
| | 
| 
| 
| 
| 
| | for a dependency, not terminate the search.
llvm-svn: 66709 | 
| | 
| 
| 
| | llvm-svn: 66399 | 
| | 
| 
| 
| 
| 
| | IntrNoMem.
llvm-svn: 66256 | 
| | 
| 
| 
| 
| 
| | block.
llvm-svn: 66119 | 
| | 
| 
| 
| 
| 
| | With this, sqlite3 now passes.
llvm-svn: 62839 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| | 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 | 
| | 
| 
| 
| 
| 
| | when there are multiple iterations of the loop.  This fixes PR3375.
llvm-svn: 62822 | 
| | 
| 
| 
| 
| 
| 
| 
| | 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 | 
| | 
| 
| 
| 
| 
| 
| 
| | 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 | 
| | 
| 
| 
| 
| 
| 
| | return *just* a clobber of the start block, not other 
random stuff as well.
llvm-svn: 61026 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | 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 | 
| | 
| 
| 
| 
| 
| 
| | causing a bunch of failures when running
"make ENABLE_EXPENSIVE_CHECKS=1 check".
llvm-svn: 60832 | 
| | 
| 
| 
| 
| 
| 
| | invalidateCachedPointerInfo.  Thanks to Bill for sending me
a testcase.
llvm-svn: 60805 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | of a pointer.  This allows is to catch more equivalencies.  For example,
the type_lists_compatible_p function used to require two iterations of
the gvn pass (!) to delete its 18 redundant loads because the first pass
would CSE all the addressing computation cruft, which would unblock the
second memdep/gvn passes from recognizing them.  This change allows
memdep/gvn to catch all 18 when run just once on the function (as is 
typical :) instead of just 3.
On all of 403.gcc, this bumps up the # reundandancies found from:
     63 gvn    - Number of instructions PRE'd
 153991 gvn    - Number of instructions deleted
  50069 gvn    - Number of loads deleted
to:
     63 gvn    - Number of instructions PRE'd
 154137 gvn    - Number of instructions deleted
  50185 gvn    - Number of loads deleted
+120 loads deleted isn't bad.
llvm-svn: 60799 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | 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.
llvm-svn: 60794 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | load dependence queries.  This allows GVN to eliminate a few more
instructions on 403.gcc:
 152598 gvn    - Number of instructions deleted
  49240 gvn    - Number of loads deleted
after:
 153986 gvn    - Number of instructions deleted
  50069 gvn    - Number of loads deleted
llvm-svn: 60786 | 
| | 
| 
| 
| 
| 
| | pointer stuff from it, simplifying the code a bit.
llvm-svn: 60783 | 
| | 
| 
| 
| | llvm-svn: 60754 | 
| | 
| 
| 
| 
| 
| 
| 
| | the first block of a query specially.  This makes the "complete query
caching" subsystem more effective, avoiding predecessor queries.  This
speeds up GVN another 4%.
llvm-svn: 60752 | 
| | 
| 
| 
| 
| 
| 
| | and split its inner loop out into a new GetNonLocalInfoForBlock
function.  No functionality change.
llvm-svn: 60751 | 
| | 
| 
| 
| 
| 
| | This speeds up the new GVN by another 3%
llvm-svn: 60747 | 
| | 
| 
| 
| 
| 
| 
| | position instead of using a full sort. This speeds up GVN by ~4% with the
new memdep stuff.
llvm-svn: 60746 | 
| | 
| 
| 
| 
| 
| | pred iterator.
llvm-svn: 60745 | 
| | 
| 
| 
| 
| 
| 
| | queries.  This speeds up GVN using the new queries (not yet
checked in) by just over 10%.
llvm-svn: 60743 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| | track of whether the CachedNonLocalPointerInfo for a block is specific
to a block.  If so, just return it without any pred scanning.  This is
good for a 6% speedup on GVN (when it uses this lookup method, which
it doesn't right now).
llvm-svn: 60695 | 
| | 
| 
| 
| 
| 
| | useful.
llvm-svn: 60674 | 
| | 
| 
| 
| | llvm-svn: 60673 | 
| | 
| 
| 
| | llvm-svn: 60672 | 
| | 
| 
| 
| 
| 
| | so it "can't" break anything.  That said, it does appear to work.
llvm-svn: 60654 | 
| | 
| 
| 
| | llvm-svn: 60650 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| | method.  This will eventually take over load/store dep
queries from getNonLocalDependency.  For now it works
fine, but is incredibly slow because it does no caching.
Lets not switch GVN to use it until that is fixed :)
llvm-svn: 60649 | 
| | 
| 
| 
| 
| 
| 
| | duplication of logic (in 2 places) to determine what pointer a 
load/store touches.  This will be addressed in a future commit.
llvm-svn: 60648 | 
| | 
| 
| 
| 
| 
| | instead of making getDependencyFrom do it.
llvm-svn: 60647 | 
| | 
| 
| 
| | llvm-svn: 60644 | 
| | 
| 
| 
| 
| 
| | I do.
llvm-svn: 60643 | 
| | 
| 
| 
| 
| 
| 
| 
| | emphasize the scanning and make it more similar to 
getDependencyFrom
 
llvm-svn: 60642 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| | clobber with the current implementation.  Instead of returning
a "precise clobber" just return a fuzzy one.  This doesn't 
matter to any clients anyway and should speed up analysis time
very very slightly.
llvm-svn: 60641 | 
| | 
| 
| 
| 
| 
| | original impl was correct and noone actually makes the query anyway.
llvm-svn: 60639 | 
| | 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| 
| | 1. Merge the 'None' result into 'Normal', making loads
   and stores return their dependencies on allocations as Normal.
2. Split the 'Normal' result into 'Clobber' and 'Def' to
   distinguish between the cases when memdep knows the value is
   produced from when we just know if may be changed.
3. Move some of the logic for determining whether readonly calls
   are CSEs into memdep instead of it being in GVN.  This still
   leaves verification that the arguments are hte same to GVN to
   let it know about value equivalences in different contexts.
4. Change memdep's call/call dependency analysis to use 
   getModRefInfo(CallSite,CallSite) instead of doing something 
   very weak.  This only really matters for things like DSA, but
   someday maybe we'll have some other decent context sensitive
   analyses :)
5. This reimplements the guts of memdep to handle the new results.
6. This simplifies GVN significantly:
   a) readonly call CSE is slightly simpler
   b) I eliminated the "getDependencyFrom" chaining for load 
      elimination and load CSE doesn't have to worry about 
      volatile (they are always clobbers) anymore.
   c) GVN no longer does any 'lastLoad' caching, leaving it to 
      memdep.
7. The logic in DSE is simplified a bit and sped up.  A potentially
   unsafe case was eliminated.
llvm-svn: 60607 | 
| | 
| 
| 
| 
| 
| | like binary operators.
llvm-svn: 60600 |