[LLVMdev] Machine dependent dead-instruction elimination

Villmow, Micah Micah.Villmow at amd.com
Mon Mar 23 11:48:58 PDT 2009


I have a pass that modifies my machine dependent instructions and I have
ran into a situation where I want to remove all instructions that an
instruction is dependent on when I remove an instruction.

Is there a way to do this using the API calls?

 

For example, I have a sequence of instructions

a = b + c

d = c * c

store d, *a

load e, *a

f = e + d

 

 

since the store and load are pointless I want to turn them into a simple
move turning the code into

a = b + c

d = c * c

tmp = d

e = tmp

f = e + d

 

however I also want to remove the `a = b + c` instruction.

 

Any idea's?


Thanks,

 

Micah Villmow

Systems Engineer

Advanced Technology & Performance

Advanced Micro Devices Inc.

S1-609 One AMD Place

Sunnyvale, CA. 94085

P: 408-749-3966

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090323/ac52a0eb/attachment.html>


More information about the llvm-dev mailing list