This is an archive of the discontinued LLVM Phabricator instance.

[SimplifyCFG] Preserve metadata when unconditionalizing branches (same target).
ClosedPublic

Authored by Meinersbur on Apr 23 2021, 11:57 PM.

Details

Summary

When replacing a conditional branch by an unconditional one because the targets are identical, transfer the metadata to the new branch instruction.

Diff Detail

Event Timeline

Meinersbur created this revision.Apr 23 2021, 11:57 PM
Meinersbur requested review of this revision.Apr 23 2021, 11:57 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 23 2021, 11:57 PM
  • Transfer only selected metadata kinds.
  • clang-format
lebedev.ri accepted this revision.Apr 26 2021, 12:21 AM

This LGTM, thank you.

llvm/lib/Transforms/Utils/Local.cpp
155

I'm guessing you are intentionally not copying mustprogress?

This revision is now accepted and ready to land.Apr 26 2021, 12:21 AM
Meinersbur added inline comments.Apr 26 2021, 3:19 PM
llvm/lib/Transforms/Utils/Local.cpp
155

As @jeroen.dobbelaere mentioned in D101141, mustprogress is a property inside the MD_loop metadata.