[llvm-dev] Why this piece of LLVM IR isn't optimized out at O3

Zhang via llvm-dev llvm-dev at lists.llvm.org
Tue Aug 13 01:05:23 PDT 2019


```
  %218 = call %struct._object* @PyObject_GetAttr(%struct._object* %216, %struct._object* %217)
  store %struct._object* %218, %struct._object** %26, align 8
  %219 = load %struct._object*, %struct._object** %26, align 8

```
It seems to me that %219 should't exist at all. 
For that %store, there is only one instruction loading from it later on (although in a different succeeding block) so I'd assume it should get optimized too, leaving an empty unreferenced alloca at the beginning of the Entry Block. But running opt src.bc -S -o opt.ll -O3 didn't change them. 


What did I misunderstand here?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20190813/97b1c2d0/attachment.html>


More information about the llvm-dev mailing list