BPF: add a test for selectiondag alias analysis w.r.t. lifetime
authorYonghong Song <yhs@fb.com>
Wed, 2 Dec 2020 03:26:39 +0000 (19:26 -0800)
committerYonghong Song <yhs@fb.com>
Thu, 3 Dec 2020 06:27:17 +0000 (22:27 -0800)
commit61a06c071dd16a9725d3b7bfac806520dc1b95aa
tree941b66ba17d2d2a40740d798182d48309a8e652a
parentc1ba991e8dd69b17fd2d88be5f6cf2b23d382c6c
BPF: add a test for selectiondag alias analysis w.r.t. lifetime

This adds a test for the bug
  https://bugs.llvm.org/show_bug.cgi?id=47591

Previously, selection dag has a bug which may incorrectly
assume no alias when crossing a lifetime boundary and this
may generate incorrect code as demonstrated in the above bug.

It looks the bug is fixed by https://reviews.llvm.org/D91833.
Basically, when comparing two potential memory access dag nodes,
  a store and a lifetime.start,
with the same frame index.
Previously, it may be decided no alias. With the above fix,
these two will be considered aliasing which will prevent
incorrect code scheduling.

Differential Revision: https://reviews.llvm.org/D92451
llvm/test/CodeGen/BPF/selectiondag-bug.ll [new file with mode: 0644]