Hi Duncan,

> Hi Bill, does a branch instruction have side-effects?

Yes.

> What is a side-effect? I noticed some confusion in gcc about
> the definition of a side-effect, so it would be good to avoid
> confusion in LLVM.
>
My understanding of a side effect is when an instruction has
un-modeled effects. For instance, "emms" on X86 has side effects that
aren't modeled in the instruction pattern  -- it resets the FP
registers after MMX use. Other instructions have no un-modeled side
effects -- e.g., "xor" on X86 or "li" on PPC. Others may have
un-modeled side effects in some situations, but not in others -- e.g.,
loads, in general, have side effects (accessing memory), but loads
from a constant pool don't.

This is the working definition, anyway. In the beginning, it'll be
closely tied to what the "isRematerializable" flag means. I don't know
what GCC considers side effects. Could you give a summary? It would be
good to contrast/compare with it.

-bw
_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to