[LLVMdev] removnig instructions with uses
Chris Lattner
sabre at nondot.org
Tue Jun 15 15:27:01 PDT 2004
On Tue, 15 Jun 2004, Patrick Meredith wrote:
> How do you remove an instruction with uses before replacing said uses? Opt
> exits immediately if you do this, it seems like it should wait until your
> pass finishes running. The only way I can get around it now is to work
> recursively post order removing the use before the def, which is slower than
> if I could just remove them in linear order! Oh well.
I'm not sure exactly what you're trying to do, but you have to get rid of
all uses of a value before you can delete it (otherwise you have dangling
pointers and you get an assertion).
What exactly is the problem that you're having? Why is it slower to do it
at one time than another?
-Chris
--
http://llvm.cs.uiuc.edu/
http://www.nondot.org/~sabre/Projects/
More information about the llvm-dev
mailing list