%0 = icmp eq i32 %y, 0
In the above instruction how can i know that the comparison is equality comparison??
–Rajwinder Singh
%0 = icmp eq i32 %y, 0
In the above instruction how can i know that the comparison is equality comparison??
–Rajwinder Singh
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
The “eq” part means “equality”. That’s how you know which kind of comparison you’re dealing with. You should read about the icmp instruction.
Félix