Machine dependent dead-instruction elimination

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?


Micah Villmow

Systems Engineer

Advanced Technology & Performance

Advanced Micro Devices Inc.

S1-609 One AMD Place

Sunnyvale, CA. 94085

P: 408-749-3966

No. See DeadMachineInstructionElim.cpp.