R600/SI: Fix verifier error caused by SIAnnotateControlFlow
authorTom Stellard <thomas.stellard@amd.com>
Tue, 14 Apr 2015 14:36:45 +0000 (14:36 +0000)
committerTom Stellard <thomas.stellard@amd.com>
Tue, 14 Apr 2015 14:36:45 +0000 (14:36 +0000)
commit71fcd2d4d8d1ce17e12cdb82ce7cb96fe11ab70b
treedd7bd38a8885397a4fdb9b69f8bc43db16c51052
parent30e4b17e25b3a13efcabf102f16d8c7df8b15b60
R600/SI: Fix verifier error caused by SIAnnotateControlFlow

This pass will always try to insert llvm.SI.ifbreak intrinsics
in the same block that its conditional value is computed in.  This is
a problem when conditions for breaks or continue are computed outside
of the loop, because the llvm.SI.ifbreak intrinsic ends up being inserted
outside of the loop.

This patch fixes this problem by inserting the llvm.SI.ifbreak
intrinsics in the loop header when the condition is computed outside
the loop.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234891 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/R600/SIAnnotateControlFlow.cpp
test/CodeGen/R600/si-annotate-cf.ll [new file with mode: 0644]