[all-commits] [llvm/llvm-project] 542a08: [LAA] Avoid adding pointers to the checks if they ...

Florian Hahn via All-commits all-commits at lists.llvm.org
Mon Aug 3 06:58:45 PDT 2020


  Branch: refs/heads/release/11.x
  Home:   https://github.com/llvm/llvm-project
  Commit: 542a08dcb7a8044c0ba52146d866515603fad122
      https://github.com/llvm/llvm-project/commit/542a08dcb7a8044c0ba52146d866515603fad122
  Author: Florian Hahn <flo at fhahn.com>
  Date:   2020-08-03 (Mon, 03 Aug 2020)

  Changed paths:
    M llvm/lib/Analysis/LoopAccessAnalysis.cpp
    A llvm/test/Transforms/LoopLoadElim/pr46854-adress-spaces.ll

  Log Message:
  -----------
  [LAA] Avoid adding pointers to the checks if they are not needed.

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.

Reviewed By: anemet

Differential Revision: https://reviews.llvm.org/D84608

(cherry picked from commit 2062b3707c1ef698deaa9abc571b937fdd077168)




More information about the All-commits mailing list