[LLVMdev] ldexp constant propagation

Tim Northover t.p.northover at gmail.com
Tue Jun 25 10:22:22 PDT 2013


Hi Ali,

> I found the problem to be with "ldexp". If I change my mathematical expression to something else (e.g. containing "sin", "sqrt", etc.) the constant propagation does happen. Any ideas on why this doesn't work for exponentials, and how I can fix it?

I think the code that's supposed to do what you want is in
lib/Analysis/ConstantFolding.cpp, which indeed doesn't know how to
handle ldexp yet. Unfortunately there's no ldexp intrinsic yet either
so you'll have to plumb that through LLVM too.

Tim



More information about the llvm-dev mailing list