[llvm] [ThinLTO] Don't mark calloc function dead (PR #72673)

via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 22 09:14:13 PST 2023


================
@@ -0,0 +1,35 @@
+; RUN: opt -module-summary %s -o %t1.bc
+; RUN: opt -module-summary %p/Inputs/calloc.ll -o %t2.bc
+; RUN: llvm-lto2 run -save-temps -o %t.out \
+; RUN:   %t1.bc -r=%t1.bc,_Z7DoStuffv,px -r=%t1.bc,_ZnwmRKSt9nothrow_t,px \
+; RUN:          -r=%t1.bc,_ZSt7nothrow -r=%t1.bc,malloc,l \
+; RUN:   %t2.bc -r=%t2.bc,malloc,pl -r=%t2.bc,calloc,pl
+; RUN: llvm-dis %t.out.2.5.precodegen.bc -o - | FileCheck %s
+
+; CHECK: define {{.*}} @calloc
----------------
eleviant wrote:

Honestly, I'm not quite sure if such simplification is justified. May be it is better to also check that malloc/memset pair is folded to calloc, so we have both def and use?

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


More information about the llvm-commits mailing list