Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check if instruction is a PHI instruction in LLVM IR

Tags:

c++

c

llvm

I am writing an LLVM pass. For an instruction (llvm::Instruction Class), how can I check if an instruction is a PHI instruction?

like image 482
MetallicPriest Avatar asked Feb 27 '12 18:02

MetallicPriest


1 Answers

I found the solution. You can check for a PHI node like this, isa<PHINode>(inst).

like image 139
MetallicPriest Avatar answered Oct 13 '22 23:10

MetallicPriest