> Hi everybody,
>
> I saw that there are some instructions in the programs in which the flag nsw or nuw is placed. I wonder what rules does LLVM follows to put these flags in some instructions.
Hi Douglas,
The canonical reference for these types of questions is the IR description, here: http://llvm.org/docs/LangRef.html
-Chris
_______________________________________________
LLVM Developers mailing list
LLV...@cs.uiuc.edu http://llvm.cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
Language requirements appears to drive their placement. In C, "signed int"
overflow produces a trap value and undefined behavior. Thus, C "signed int"
operations do not wrap on overflow and get tagged with "nsw" in the LLVM IR.
Brian West