Runtime Crash Resulting from llvm.used.conditional
GlobalDCE during Compilation
#65021
Labels
bug
A deviation from expected or documented behavior. Also: expected but undesirable behavior.
triage needed
This issue needs more specific labels
In some testing we've discovered the
-conditional-runtime-records
optimization option can cause runtime crashes in the resulting binary.Below we have attached a small example:
In this particular example, this protocol conformance record is stripped during GlobalDCE during compilation.
This is possible because it is conditional on
$sSHMp
, which is dead in this TU.It seems to be dead because it is not used by any other live GVs in this TU, nor is it trivially live. This problem seems to go away if we restrict
llvm.used.conditional
based stripping in GlobalDCE to post monoLTO merge. This way the usages of$sSHMp
present themselves.cc @kubamracek @manman-ren
conditional-runtime-records.zip
The text was updated successfully, but these errors were encountered: