Dalia
Dalia

Reputation: 155

get LHS and RHS of ICmpInst and FCmpInst in llvm?

How can I get LHS and RHS of ICmpInst and FCmpInst in llvm?

I need these values of Sign, Code, Value *LHS, Value *RHS, Predicate. To do analysis of CmpInst. I could find all values except LHS, and RHS. Any idea..

Upvotes: 1

Views: 649

Answers (1)

Dalia
Dalia

Reputation: 155

I could figure it out.

CmpInst* CI= dyn_cast<CmpInst>(&*I);
Value * LHS = CI->getOperand(0);
Value * RHS = CI->getOperand(1);

Upvotes: 3

Related Questions