Issue 117838
Summary -deadargelim doesn't eliminate unused argument and parameter
Labels new issue
Assignees
Reporter hackhaye
    Recently, I compiled binutils-2.43.1 with llvm-18 in -O2 and -deadargelim, but i found that the unused parameter of function bfd_hash_entry and argument in  its callsite, both aren't eliminated. the source code of bfd_hash_entry in addr2line list below:

> struct bfd_hash_entry *
bfd_hash_newfunc (struct bfd_hash_entry *entry,
		  struct bfd_hash_table *table,
		  const char *string ATTRIBUTE_UNUSED)
{
  if (entry == NULL)
    entry = (struct bfd_hash_entry *) bfd_hash_allocate (table,
							 sizeof (* entry));
  return entry;
}




part of the bitcode with -O2 and -deadargelim  flag on lists below
> define dso_local ptr @bfd_hash_newfunc(ptr noundef readnone %0, ptr nocapture noundef readonly %1, ptr nocapture readnone %2) local_unnamed_addr #0 {
  %4 = icmp eq ptr %0, null
  br i1 %4, label %5, label %21



it's quite interesting, why in this situation the dead argument and parameter are not killed? Is this due to inadequate optimization implementations.

_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to