[LLVMdev] Instruction comparison

Chris Lattner sabre at nondot.org
Thu Nov 21 12:44:01 PST 2002

> Or, is it possible to be certain of equality just by looking at
> per-instruction properties and ignoring the problem of proving
> equivalence of the instructions supplying the values to the current
> instruction.

The answer to your overall question is: No.  There is no easy way to check
for equivalence.

What you really want to check for is whether the SSA graphs defined by a
function are isomorphic to each other.  In this case, I think the problem
is restricted enough to make it possible to do in linear time (you have
roots), but it's still non-trivial to code up.

Is analysis time really that much of a problem?



More information about the llvm-dev mailing list