Encode a icmp predicate into a three bit mask. These bits are carefully arranged to allow folding of expressions such as:

Synopsis

Declared in <llvm/Analysis/CmpInstAnalysis.h>

unsigned int
getICmpCode(CmpInst::Predicate Pred);

Description

(A < B) | (A > B) ‐‐> (A != B)

Note that this is only valid if the first and second predicates have the same sign. It is illegal to do: (A u< B) | (A s> B)

Three bits are used to represent the condition, as follows: 0 A > B 1 A == B 2 A < B

<=> Value Definition 000 0 Always false 001 1 A > B 010 2 A == B 011 3 A >= B 100 4 A < B 101 5 A != B 110 6 A <= B 111 7 Always true

Parameters

Name

Description

Pred

This enumeration lists the possible predicates for CmpInst subclasses. Values in the range 0‐31 are reserved for FCmpInst, while values in the range 32‐64 are reserved for ICmpInst. This is necessary to ensure the predicate values are not overlapping between the classes.

Created with MrDocs