I am currently building a static analyzer for 'llvm-ir' and working on branch instructions. The 'condition' of a branch instruction seems to be either a result of a compare instruction, or a result of some logical operations of a compare instruction, which looks like
%cmp1377 = icmp sgt i32 %length, 0
br i1 %cmp1377, label %for.cond14.preheader.lr.ph, label %for.cond.cleanup
or probably like
%cmp2 = icmp slt i32 %rem, %div1
%cmp3 = icmp slt i32 %div, %div1
%or.cond = or i1 %cmp2, %cmp3
br i1 %or.cond, label %if.then9, label %lor.lhs.false4
But I'm not sure whether if LLVM-IR only uses compared values or it might also just use raw integer values. Is there any documentation that I can find how it constructs the condition of the branch instructions?