[PATCH] D103062: [ObjC][ARC] Ignore operand bundle "clang.arc.attachedcall" on a call if the call's return type is void

Akira Hatanaka via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon May 24 20:03:40 PDT 2021


ahatanak added a comment.

Without this patch, the verifier fails when the following code is compiled:

$ cat test.ll

  declare i8* @foo0()
  define internal i8* @foo1() #0 {
    %v1 = call i8 * @foo0()
    ret i8* %v1
  }
  
  define void @test() {
  entry:
    %call1 = call i8* @foo1() #0 [ "clang.arc.attachedcall"(i64 0) ]
    call void (...) @llvm.objc.clang.arc.noop.use(i8* %call1)
    ret void
  }
  
  declare i8* @llvm.objc.retain(i8*)
  declare void @llvm.objc.clang.arc.noop.use(...)
  
  attributes #0 = { noreturn }
  
  !0 = !{i32 1, !"clang.arc.retainAutoreleasedReturnValueMarker", !"mov\09fp, fp\09\09// marker for objc_retainAutoreleaseReturnValue"}

$ opt -S -o - -simplifycfg -deadargelim test.ll


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D103062/new/

https://reviews.llvm.org/D103062



More information about the llvm-commits mailing list