[LLVMdev] help

Nick Lewycky nicholas at mxc.ca
Sun Jun 27 21:56:10 PDT 2010


RAJWINDER SINGH wrote:
> %0 = icmp eq i32 %y, 0
> In the above instruction how can i know that the comparison is equality
> comparison??

ICI->getPredicate() == ICmpInst::ICMP_EQ.

See the doxygen for CmpInst: 
http://llvm.org/doxygen/classllvm_1_1CmpInst.html and ICmpInst: 
http://llvm.org/doxygen/classllvm_1_1ICmpInst.html . (Note that 
ICI->isEquality() returns true for both 'eq' and 'ne'.)

Nick



More information about the llvm-dev mailing list