For the following branch instruction
br i1 %cmp, label %if.then, label %if.end, !dbg !35
Since llvm is SSA, I can directly access the operand 0, to determine whether the comparison is true or not. The type evaluates to i1 but I am having trouble extracting the value (true or false)
BranchInst &I;
Value *val = I.getOperand(0);
Type yields to i1 type but when I tried to cast to
ConstantInt *cint = dyn_cast<ConstantInt>(val)
the casting does not seem to work? how do I go about it