llvm-project icon indicating copy to clipboard operation
llvm-project copied to clipboard

-fsplit-lto-unit bitcode writer crash with ifunc and type metadata

Open aeubanks opened this issue 3 years ago • 6 comments

$ cat /tmp/c.ll
target datalayout = "e-m:e-i8:8:32-i16:16:32-i64:64-i128:128-n32:64-S128"
target triple = "aarch64-unknown-linux-android24"

@i = ifunc ptr (ptr, i64), ptr @hoge

define ptr @hoge() !type !0 {
bb:
  ret ptr null
}

!0 = !{i64 0, !1}
!1 = distinct !{}

$ clang++ "-target" "aarch64-unknown-linux-android24" "-flto=thin" -fsplit-lto-unit /tmp/c.ll -o /dev/null -c
clang++: ../../llvm/lib/IR/ModuleSummaryIndex.cpp:173: GlobalValueSummary *llvm::ModuleSummaryIndex::getGlobalValueSummary(uint64_t, bool) const: Assertion `VI && "GlobalValue not found in index"' failed.

@teresajohnson

aeubanks avatar Feb 24 '23 00:02 aeubanks

See also https://github.com/llvm/llvm-project/issues/57870

nikic avatar Feb 24 '23 08:02 nikic

I wonder if this D82745 will fix it. It went through a couple rounds of review and it looks like I missed the fact that it was waiting for me and another reviewer to take another look. The patch relates to correctly summarizing ifunc. If so, let me ping the author and prioritize getting that reviewed.

teresajohnson avatar Feb 24 '23 15:02 teresajohnson

@teresajohnson D82745 alone is not enough, I have an additional patch for this, I'm going to upstream it.

I rebased the D82745, I can move it forward if needed.

DanielKristofKiss avatar Feb 27 '23 17:02 DanielKristofKiss

https://reviews.llvm.org/D144982, we have tested with Chromium and it works well there.

DanielKristofKiss avatar Feb 28 '23 18:02 DanielKristofKiss

@teresajohnson D82745 alone is not enough, I have an additional patch for this, I'm going to upstream it.

I rebased the D82745, I can move it forward if needed.

Thanks! Does your new patch depend on D82745, or are they orthogonal fixes?

https://reviews.llvm.org/D144982, we have tested with Chromium and it works well there.

Does Chromium also need D82745?

teresajohnson avatar Mar 05 '23 02:03 teresajohnson

@teresajohnson D82745 alone is not enough, I have an additional patch for this, I'm going to upstream it. I rebased the D82745, I can move it forward if needed.

Thanks! Does your new patch depend on D82745, or are they orthogonal fixes? They are orthogonal.

https://reviews.llvm.org/D144982, we have tested with Chromium and it works well there.

Does Chromium also need D82745? No. D144982 is enough in the Chromium's usecase.

DanielKristofKiss avatar Mar 06 '23 11:03 DanielKristofKiss