[llvm] [llvm][lto] Precommit test for libcall internalization (PR #135705)
Paul Kirth via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 15 09:05:00 PDT 2025
================
@@ -0,0 +1,37 @@
+;; This test comes from a real world scenario in LTO, where the
+;; definition of bcmp is deleted because it has no uses, but later instcombine
+;; re-introduces a call to bcmp() as part of SimplifyLibCalls.
+
+; RUN: opt %s -o %t -module-summary -mtriple riscv32-unknown-linux-musl
+; RUN: llvm-lto2 run -o %t2 \
+; RUN: -r %t,foo,plx \
+; RUN: -r %t,memcmp,x \
+; RUN: -r %t,bcmp,pl %t -save-temps
+; RUN: llvm-dis %t2.1.2.internalize.bc -o - \
+; RUN: | FileCheck %s --check-prefix=INTERNALIZE
+; RUN: opt %t2.1.2.internalize.bc -passes=instcombine -o - -S \
+; RUN: | FileCheck %s --check-prefix=OPTIMIZE
+
+define i1 @foo(ptr %0, [2 x i32] %1) {
----------------
ilovepi wrote:
Sure. The reason I added it was to replicate the failure scenario as closely as possible. If I'm not testing that anymore, then I can also move the test under X86... and I guess rename it.
https://github.com/llvm/llvm-project/pull/135705
More information about the llvm-commits
mailing list