[PATCH] D15093: Fix the assert in Annotate the loop in SIAnnotateControlFlow pass when the loop terminator condition is a constant.

Changpeng Fang via llvm-commits llvm-commits at lists.llvm.org
Thu Feb 11 14:24:56 PST 2016


cfang added a comment.

Any further comment?


================
Comment at: lib/Target/AMDGPU/SIAnnotateControlFlow.cpp:276-278
@@ +275,5 @@
+  // Insert IfBreak before TERM for constant COND.
+  } else if (isa<ConstantInt>(Cond)) {
+    Value *Args[] = { Cond, Broken };
+    return CallInst::Create(IfBreak, Args, "", Term);
+
----------------
tstellarAMD wrote:
> This kind of failure is a common symptom of strurcturizer bugs.  You should run llc with -print-before-all to see if the constant branch exists before the structurizer is run.
It is true that the structrizer has a bug generating wrong constant condition. However, in a general sense, nothing prevents
the condition from being constant. And as a result, we should handle constant condition in annotating loops.


http://reviews.llvm.org/D15093





More information about the llvm-commits mailing list