guoqing zhang
2015-Jan-30 10:37 UTC
[LLVMdev] [LLVMDev] About user of bitcast/GEP instruction
Hi, In PromoteMemoryToRegister.cpp, it seems to rely on the fact that the only users of bitcast/GEP instruction are lifetime intrinsics (llvm.lifetime.start/end). I did some searching in llvm/test folder, it seems to be true. However, by reading LLVM IR manual, I don't see any restriction stated on the possible user of bitcast/GEP instruction. So my question is who impose the restriction ? Is it Clang ? Regards -Guoqing -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150130/c81351d2/attachment.html>
Hans Wennborg
2015-Jan-30 18:18 UTC
[LLVMdev] [LLVMDev] About user of bitcast/GEP instruction
On Fri, Jan 30, 2015 at 2:37 AM, guoqing zhang <gqzhang81 at gmail.com> wrote:> Hi, > > In PromoteMemoryToRegister.cpp, it seems to rely on the fact that the only > users of bitcast/GEP instruction are lifetime intrinsics > (llvm.lifetime.start/end). I did some searching in llvm/test folder, it > seems to be true. > > However, by reading LLVM IR manual, I don't see any restriction stated on > the possible user of bitcast/GEP instruction. So my question is who impose > the restriction ? Is it Clang ? >Use of GEPs and bitcasts is certainly not restricted to lifetime intrinsics. For example, they're used by loads and stores all the time. PromoteMemoryToRegister.cpp tries to figure out whether allocas can be safely promoted to registers, and I assume the reasoning is that if an instruction is GEP'ing into stack-allocated memory for non-trivial purposes, it can't be promoted. - Hans -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20150130/5ec000be/attachment.html>
Possibly Parallel Threads
- [LLVMdev] About user of bitcast/GEP instruction
- [LLVMdev] About user of bitcast/GEP instruction
- [LLVMdev] About user of bitcast/GEP instruction
- Miscompilation bugs in GVN.cpp and PromoteMemoryToRegister.cpp?
- Miscompilation bugs in GVN.cpp and PromoteMemoryToRegister.cpp?