summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
diff options
context:
space:
mode:
authorXing Xue <xingxue@outlook.com>2019-05-27 13:57:28 +0000
committerXing Xue <xingxue@outlook.com>2019-05-27 13:57:28 +0000
commit3860aad6e7f0c261512ece251a6796dd71450e90 (patch)
tree7de382d99c7a8593bc076e38869d6db70ca56aea /llvm/lib/Target/AMDGPU/SIInstrInfo.cpp
parent441ad62531308e48599c97a2867d370a8fb4b417 (diff)
downloadbcm5719-llvm-3860aad6e7f0c261512ece251a6796dd71450e90.tar.gz
bcm5719-llvm-3860aad6e7f0c261512ece251a6796dd71450e90.zip
[MustExecute] Improve MustExecute to correctly handle loop nest
Summary: for.outer: br for.inner for.inner: LI <loop invariant load instruction> for.inner.latch: br for.inner, for.outer.latch for.outer.latch: br for.outer, for.outer.exit LI is a loop invariant load instruction that post dominate for.outer, so LI should be able to move out of the loop nest. However, there is a bug in allLoopPathsLeadToBlock(). Current algorithm of allLoopPathsLeadToBlock() 1. get all the transitive predecessors of the basic block LI belongs to (for.inner) ==> for.outer, for.inner.latch 2. if any successors of any of the predecessors are not for.inner or for.inner's predecessors, then return false 3. return true Although for.inner.latch is for.inner's predecessor, but for.inner dominates for.inner.latch, which means if for.inner.latch is ever executed, for.inner should be as well. It should not return false for cases like this. Author: Whitney (committed by xingxue) Reviewers: kbarton, jdoerfert, Meinersbur, hfinkel, fhahn Reviewed By: jdoerfert Subscribers: hiraditya, jsji, llvm-commits, etiotto, bmahjour Tags: #LLVM Differential Revision: https://reviews.llvm.org/D62418 llvm-svn: 361762
Diffstat (limited to 'llvm/lib/Target/AMDGPU/SIInstrInfo.cpp')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud