[AMDGPU] Do not only rely on BB number when finding bottom loop
authorMark Searles <m.c.searles@gmail.com>
Thu, 19 Apr 2018 15:42:30 +0000 (15:42 +0000)
committerMark Searles <m.c.searles@gmail.com>
Thu, 19 Apr 2018 15:42:30 +0000 (15:42 +0000)
commit1bc6e71f32ebadefc319c65b3f650e08e39d6aa7
treebbb954896e398ff8029b87d948ef765e7c5a9eba
parent9b20c245ca36998cb2ac6e81543f87b781a9d06b
[AMDGPU] Do not only rely on BB number when finding bottom loop

We should also check that the "bottom" basic block of a loopis a successor of the "header" basic block, otherwise we don't propagate the information correctly when the CFG is complex. This fixes an important rendering problem with Wolfsentein 2, because of one vector-memory wait was missing.

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

llvm-svn: 330337
llvm/lib/Target/AMDGPU/SIInsertWaitcnts.cpp
llvm/test/CodeGen/AMDGPU/waitcnt-back-edge-loop.mir [new file with mode: 0644]