This is an archive of the discontinued LLVM Phabricator instance.

[X86] Complete preservation of !pcsections in X86ISelLowering
ClosedPublic

Authored by melver on Jul 11 2023, 10:13 AM.

Details

Summary

https://reviews.llvm.org/D130883 introduced MIMetadata to simplify
metadata propagation (DebugLoc and PCSections).

However, we're currently still permitting implicit conversion of
DebugLoc to MIMetadata, to allow for a gradual transition and let the
old code work as-is.

This manifests in lost !pcsections metadata for X86-specific lowerings.
For example, 128-bit atomics.

Fix the situation for X86ISelLowering by converting all BuildMI() calls
to use an explicitly constructed MIMetadata.

Diff Detail

Event Timeline

melver created this revision.Jul 11 2023, 10:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 11 2023, 10:13 AM
melver requested review of this revision.Jul 11 2023, 10:13 AM
Herald added a project: Restricted Project. · View Herald TranscriptJul 11 2023, 10:13 AM
dvyukov accepted this revision.Jul 12 2023, 2:10 AM

However, we're currently still permitting implicit conversion of DebugLoc to MIMetadata, to allow for a gradual transition and let the old code work as-is.

How much of the old code do we still have? Is there any old code in aarch64?

This revision is now accepted and ready to land.Jul 12 2023, 2:10 AM

However, we're currently still permitting implicit conversion of DebugLoc to MIMetadata, to allow for a gradual transition and let the old code work as-is.

How much of the old code do we still have? Is there any old code in aarch64?

Yes, unfortunately it's still everywhere. It's on my TODO list to remove the implicit conversion DebugLoc -> MIMetadata, so that the type system can help to enforce correct propagation where MachineInstrBuilder is used.

This revision was landed with ongoing or failed builds.Jul 12 2023, 6:10 AM
This revision was automatically updated to reflect the committed changes.
llvm/lib/Target/X86/X86ISelLowering.cpp