Hello all, I am wondering the use case of undef. Is there any C code that I could get undef if it is compiled by clang. Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161204/7ab81194/attachment.html>
Here is an example: https://godbolt.org/g/wKoXWW -- Sean Silva On Sat, Dec 3, 2016 at 4:28 PM, LYU YH via llvm-dev <llvm-dev at lists.llvm.org> wrote:> Hello all, > > I am wondering the use case of undef. Is there any C code that I could get > undef if it is compiled by clang. > > Thanks > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev > >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161204/83fd58bd/attachment.html>
Hello Sean, I read several LLVM undef materials[1][2][3] but still have some questions of it. I can understand "add %X, undef -> undef". But why the equation "and %X, undef -> 0" is valid? In LLVM Language Reference Manual, the explanation of such equation is that it is safe to assume that all bits of the ‘undef‘ could be 0. If so, why can't we assume all bits of the 'undef' is 0 in the former equation. Therefore we can get "add %X, 0 -> %X" instead? By the way, is there any document that describe how 'undef' should be handled with other LLVM value? Is the 'undef' in LLVM the same as the UNDEF[4] (the top element in lattice) in constant propagation? [1] http://www.nondot.org/sabre/LLVMNotes/UndefinedValue.txt [2] https://www.cs.utah.edu/~regehr/llvm-ub.pdf [3] http://sunfishcode.github.io/blog/2014/07/14/undef-introduction.html [4] http://infolab.stanford.edu/~ullman/dragon/w06/lectures/cp.pdf Thanks for your reply -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20161205/1ed86f37/attachment.html>
Apparently Analagous Threads
- beneficial optimization of undef examples needed
- beneficial optimization of undef examples needed
- Influence of Google PageRank of a page on other pages of same site
- Cisco IP 8841 asterisk integration
- [LLVMdev] [llvmdev] Specifying / modeling copying semantics in more detail