Villmow, Micah
2009-Mar-23 18:48 UTC
[LLVMdev] 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? 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>
On Mar 23, 2009, at 11:48 AM, Villmow, Micah wrote:> 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?No. See DeadMachineInstructionElim.cpp. Evan> > 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 > > > _______________________________________________ > LLVM Developers mailing list > LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu > http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090323/34f50394/attachment.html>