[PATCH] D22025: AMDGPU/SI: Do not insert EndCf in an unreachable block

Changpeng Fang via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 22 10:37:03 PDT 2016


cfang added inline comments.

================
Comment at: test/CodeGen/AMDGPU/si-annotate-cf-unreachable.ll:30-34
@@ +29,7 @@
+
+bb4:                                              ; preds = %bb3
+  unreachable
+
+bb5:                                              ; preds = %bb3, %bb1
+  unreachable
+}
----------------
arsenm wrote:
> There should still be another copy of this function with blocks with code (like a volatile store) before the unreachable
The issue is: for an unreachable block, if we insert EndCf, we will hit "Instruction does not dominate all uses!" assert!

The "fix" here is actually just a workaround: if there is no instruction before unreachable, we don't insert EndCf.

If as you suggested there are instructions before unreachable, we will have to insert endCF, and the problem is still there.

This is a special case in control flow that both "else" and "then" is unreachable. Maybe we need to insert endCF on 
both paths. 



https://reviews.llvm.org/D22025





More information about the llvm-commits mailing list