[PATCH] D51795: AMDGPU: Don't error on calls to constexpr casts of functions

Scott Linder via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 7 13:25:39 PDT 2018


scott.linder added a comment.

I still don't understand exactly when a call is indirect, but when an argument is cast this still seems to fail:

  %foo = type opaque
  
  define i64 @bar(i64 addrspace(1)* %p) {
    ret i64 1
  }
  
  define void @test_cast_to_opaque(%foo addrspace(1)* %out) {
    %1 = call i64 bitcast (i64 (i64 addrspace(1)*)* @bar to i64 (%foo addrspace(1)*)*)(%foo addrspace(1)* %out)
    ret void
  }

gives:

  error: <unknown>:0:0: in function test_cast_to_opaque void (%foo addrspace(1)*): unsupported indirect call to function bar



================
Comment at: test/CodeGen/AMDGPU/promote-alloca-bitcast-function.ll:9
 
-; XCHECK: in function crash_call_constexpr_cast{{.*}}: unsupported call to function foo
+; CHECK-LABEL: @crash_call_constexpr_cast(
+; CHECK: alloca
----------------
Maybe rename these without the `crash_`?


https://reviews.llvm.org/D51795





More information about the llvm-commits mailing list