[llvm] [ThinLTO] Don't convert functions to declarations if `force-import-all` is enabled (PR #134541)

Shilei Tian via llvm-commits llvm-commits at lists.llvm.org
Sat Apr 12 11:18:00 PDT 2025


================
@@ -0,0 +1,35 @@
+; RUN: opt -mtriple=amdgcn-amd-amdhsa -module-summary %s -o %t.main.bc
+; RUN: opt -mtriple=amdgcn-amd-amdhsa -module-summary %p/Inputs/in-0.ll -o %t.in.0.bc
+; RUN: opt -mtriple=amdgcn-amd-amdhsa -module-summary %p/Inputs/in-1.ll -o %t.in.1.bc
+; RUN: llvm-lto -thinlto-action=run -force-import-all %t.main.bc %t.in.0.bc %t.in.1.bc --thinlto-save-temps=%t.2.
----------------
shiltian wrote:

I wanted to do that as well, but it looks like `thinLTOResolvePrevailingGUID` doesn't run if we simply does `import`, as shown below:

```
; RUN: llvm-lto -thinlto-action=thinlink -force-import-all %t.main.bc %t.in.bc -o %t.index.bc
; RUN: llvm-lto -thinlto-action=import -force-import-all %t.main.bc %t.in.bc --thinlto-index=%t.index.bc
; RUN: llvm-dis %t.main.bc.thinlto.imported.bc -o - | FileCheck --check-prefix=MOD1 %s
; RUN: llvm-dis %t.in.bc.thinlto.imported.bc -o - | FileCheck --check-prefix=MOD2 %s
```

Did I miss anything here?

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


More information about the llvm-commits mailing list