Stop bugpoint from removing operand of metadata.

Hi,

I am trying to use bugpoint to reduce testcase. And bugpoint try to reduce the number of operands for metadata, and this generate corrupted metadata:

*** Attempting to remove named metadata: Checking for crash with only these named metadata nodes: llvm.dbg.cu llvm.module.flags llvm.ident:
Checking for crash with only these named metadata nodes: llvm.module.flags llvm.ident:
Checking for crash with only these named metadata nodes: llvm.ident:
Checking for crash with only these named metadata nodes: llvm.module.flags:
Checking for crash with only 3 named metadata operands:
Checking for crash with only 2 named metadata operands: All DICompileUnits must be listed in llvm.dbg.cu
LLVM ERROR: Broken module found, compilation aborted!

This crash bugpoint itself. Is there away to prevent bugpoint from doing this rather than changing the source code of bugpoint?

I tried to run a “bugpoint --help-hidden” and get the following options related to metadata:

-lowertypetests - Lower type metadata
-disable-namedmd-remove - Do not remove global named metadata
-enable-import-metadata - Enable import metadata like ‘thinlto_src_module’
-enable-noalias-to-md-conversion - Convert noalias attributes to metadata during inlining.
-lto-strip-invalid-debug-info - Strip invalid debug info metadata during LTO instead of aborting.

And I don’t think these help.

Any suggestion?

Thanks
Hongbin

Hi,

Hi,

Hi,

I am trying to use bugpoint to reduce testcase. And bugpoint try to reduce
the number of operands for metadata, and this generate corrupted metadata:

*** Attempting to remove named metadata: Checking for crash with only
these named metadata nodes: llvm.dbg.cu llvm.module.flags llvm.ident:
<crash>
Checking for crash with only these named metadata nodes: llvm.module.flags
llvm.ident: <crash>
Checking for crash with only these named metadata nodes: llvm.ident:
Checking for crash with only these named metadata nodes:
llvm.module.flags: <crash>
Checking for crash with only 3 named metadata operands: <crash>
Checking for crash with only 2 named metadata operands: All DICompileUnits
must be listed in llvm.dbg.cu
LLVM ERROR: Broken module found, compilation aborted!

I had the same issue, and have some local patches to help with this.
Have you tried the -disable-namedmd-remove option?

Yep, that contains too much metadata :slight_smile:

Also, at this point where bug point crashes, it should already have dumped
a module.

Thanks for pointing this out. let me check

Hi,

Hi,

I am trying to use bugpoint to reduce testcase. And bugpoint try to
reduce the number of operands for metadata, and this generate corrupted
metadata:

*** Attempting to remove named metadata: Checking for crash with only
these named metadata nodes: llvm.dbg.cu llvm.module.flags llvm.ident:
<crash>
Checking for crash with only these named metadata nodes:
llvm.module.flags llvm.ident: <crash>
Checking for crash with only these named metadata nodes: llvm.ident:
Checking for crash with only these named metadata nodes:
llvm.module.flags: <crash>
Checking for crash with only 3 named metadata operands: <crash>
Checking for crash with only 2 named metadata operands: All
DICompileUnits must be listed in llvm.dbg.cu
LLVM ERROR: Broken module found, compilation aborted!

I had the same issue, and have some local patches to help with this.
Have you tried the -disable-namedmd-remove option?

Yep, that contains too much metadata :slight_smile:

Also, at this point where bug point crashes, it should already have
dumped a module.

Thanks for pointing this out. let me check

Looks like ListReducer::reduceList do not dump module during the iteration.
The module dumped is not "new" enough for me.

Thanks
Hongbin