How to figure out if particular LLVM instruction depends on the other?
问题 I'm trying to write an LLVM optimization pass. And I need a way to determine if one LLVM instruction affects the other (or depends on the other). These dependencies can have different nature: first instruction creates a value, the other uses it as operand first instructions writes to memory location, the other reads from there other possibilities? In short, first instruction must always be executed before the other in order to preserve code correctness. Three-way answer (depends, may depend,