[LLVMdev] Prevent instruction elimination
Duncan Sands
baldrick at free.fr
Mon Oct 25 10:23:32 PDT 2010
Hi Alexandra,
> The empty inline asm crossed my mind as well, but LLVM handles inline
> assemblies as calls. This would lead to a dependence if it is inside of a
> loop, right? And this means a considerable impact on the optimizers.
> Is it possible to avoid it?
if a statement has no side-effects then the optimizers will remove it.
Thus you are obliged to have a statement with side-effects. This same
problem occurred with the debug info intrinsics, and the chosen solution
was to teach all the optimizers that these intrinsics didn't actually do
anything (but shouldn't be removed).
I think you should seek a different design. What are you really trying
to do?
Ciao,
Duncan.
More information about the llvm-dev
mailing list