Fix LLVM API usage in optimize.cpp

Add missing include and drop use of TargetData which no longer exists.

Signed-off-by: Pekka Enberg <penberg@iki.fi>