[llvm-dev] Understand if a condition was true or false

Alberto Barbaro via llvm-dev llvm-dev at lists.llvm.org
Fri Mar 22 01:09:18 PDT 2019


Hi all,
I have the condition of an ICmpInst in a variable called condition obtained
doing GenericValue condition = getOperandValue(&I, SF);

Now I would like to understand if the comparison was true or false. Is it
correct to use condition.IntVal.getSExtValue() and if the value is 0
consider the true and if the value is -1 consider the condition false?

I'm not sure because I was expecting something different and I'm a bit lost

Should I use another approach?

Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190322/2c9287fc/attachment.html>


More information about the llvm-dev mailing list