[LLVMdev] Remove an instruction through Dead Code Elimination pass of llvm

Adarsh Konchady akonchady at gmail.com
Sat Feb 11 00:47:31 PST 2012

My pass in LLVM generates an IR like this
  %5 = icmp eq i32 %4, 0
  %7 = or i1 %5, %5
 ;. . .
Since the 'or' instruction is actually not needed(dead code), I replaced
all occurences of %7 with %5.
Now, the 'or' instruction should get deleted. How can I call Dead Code
Elimination pass of LLVM from my pass or is there any method to remove that
'or' instruction?

Thank you.
Adarsh Konchady
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120211/deeedb88/attachment.html>

More information about the llvm-dev mailing list