[PATCH] D84608: [LAA] Avoid adding pointers to the checks if they are not needed.

Florian Hahn via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Jul 26 14:57:09 PDT 2020


fhahn created this revision.
fhahn added reviewers: Ayal, anemet, hfinkel, dmgreen.
Herald added a subscriber: hiraditya.
Herald added a project: LLVM.

Currently we skip alias sets with only reads or a single write and no
reads, but still add the pointers to the list of pointers in RtCheck.

This can lead to cases where we try to access a pointer that does not
exist when grouping checks.  In most cases, the way we access
PositionMap masked that, as the value would default to index 0.

But in the example in PR46854 it causes a crash.

This patch updates the logic to avoid adding pointers for alias sets
that do not need any checks. It makes things slightly more verbose, by
first checking the numbers of reads/writes and bailing out early if we don't
need checks for the alias set.

I think this makes the logic a bit simpler to follow.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D84608

Files:
  llvm/lib/Analysis/LoopAccessAnalysis.cpp
  llvm/test/Transforms/LoopLoadElim/pr46854-adress-spaces.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D84608.280756.patch
Type: text/x-patch
Size: 8959 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200726/b4e98a17/attachment.bin>


More information about the llvm-commits mailing list