This is an archive of the discontinued LLVM Phabricator instance.

Add debug location verification for !llvm.loop attachments
ClosedPublic

Authored by aprantl on Jun 18 2019, 9:49 AM.

Details

Summary

This patch teaches the Verifier how to detect broken !llvm.loop attachments as discussed in https://reviews.llvm.org/D60831. This allows LLVM to warn and strip out the broken debug info before attempting an LTO compilation with input generated by LLVM predating https://reviews.llvm.org/rL361149.

rdar://problem/51631158

Diff Detail

Repository
rL LLVM

Event Timeline

aprantl created this revision.Jun 18 2019, 9:49 AM
Orlando accepted this revision.Jun 18 2019, 11:33 AM

LGTM. Thanks for doing this!

llvm/lib/IR/Verifier.cpp
2380 ↗(On Diff #205378)

The loop metadata can contain nodes which are not DILocations but the check at the start of VisitDebugLoc() will catch this, so this seems fine.

This revision is now accepted and ready to land.Jun 18 2019, 11:33 AM
This revision was automatically updated to reflect the committed changes.