[llvm] ObjCARCContract: Use stripPointerCastsAndAliases (PR #134275)

Akira Hatanaka via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 10 15:25:02 PDT 2025


ahatanak wrote:

Is this supposed to be a NFC patch?

With the changes in this patch, the pass no longer rewrites the argument to the second call to `use_pointer` in the following IR:

```
define void @test0(ptr %x) {
  %y = getelementptr inbounds ptr, ptr %x, i32 0
  %v0 = call ptr @llvm.objc.retain(ptr %y) nounwind
  call void @use_pointer(ptr %x)
  call void @use_pointer(ptr %y)
  ret void
}
```

This is a contrived example and maybe it's okay if we know that clang/llvm never generates IR like this in practice. But I'd like to understand what assumptions you are making about the IR that's fed to this pass.

https://github.com/llvm/llvm-project/pull/134275


More information about the llvm-commits mailing list