This is an archive of the discontinued LLVM Phabricator instance.

[mlir] Fix verifier for call debug locations
ClosedPublic

Authored by clementval on Aug 8 2023, 3:11 PM.

Details

Summary

D157096 introduces a new verifier for debug location
on call operation. isDeclaration() is actually not defined
for LLVMFuncOp and default to the interface definition that always
return false. This leads to wrong diagnostic in some case as shown in the added test.
Use callee.isExternal() instead that returns the
desired information.

We have seen this error being triggered during flang codegen.

Diff Detail

Event Timeline

clementval created this revision.Aug 8 2023, 3:11 PM
Herald added a reviewer: dcaballe. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
clementval requested review of this revision.Aug 8 2023, 3:11 PM
clementval edited the summary of this revision. (Show Details)Aug 8 2023, 3:13 PM
clementval edited the summary of this revision. (Show Details)Aug 8 2023, 3:16 PM
clementval edited the summary of this revision. (Show Details)
vzakhari accepted this revision.Aug 8 2023, 3:26 PM

Thank you!

This revision is now accepted and ready to land.Aug 8 2023, 3:26 PM
Dinistro accepted this revision.Aug 8 2023, 9:59 PM

LGTM!
Sorry for the inconvenience.

Dinistro added inline comments.Aug 8 2023, 11:03 PM
mlir/test/Dialect/LLVMIR/call-location.mlir
2

NIT: There is no need to forward stderr to stdout here, right?

clementval marked an inline comment as done.Aug 9 2023, 9:02 AM

LGTM!
Sorry for the inconvenience.

No worries!

mlir/test/Dialect/LLVMIR/call-location.mlir
2

Thanks. I'll remove it before landing the patch.

This revision was automatically updated to reflect the committed changes.
clementval marked an inline comment as done.