This is an archive of the discontinued LLVM Phabricator instance.

[Attributor] Convert test to opaque pointers
ClosedPublic

Authored by nikic on Jun 21 2023, 2:12 AM.

Details

Summary

This converts the arg-count-mismatch.ll test to opaque pointers. The bitcasts of the called functions are now implicit and this change behavior. I wanted to double check whether the new output is correct / expected.

Diff Detail

Event Timeline

nikic created this revision.Jun 21 2023, 2:12 AM
Herald added a project: Restricted Project. · View Herald Transcript
nikic requested review of this revision.Jun 21 2023, 2:12 AM
Herald added a project: Restricted Project. · View Herald Transcript
nikic added a comment.Jun 21 2023, 2:16 AM

Good context to know here is that getCalledFunction() will check that the function signatures match, but e.g. isCallee() won't, that requires an explicit check. It may be that Attributor needs additional function signature checks in some places, but it's not really clear to me whether it is necessary from the test diff.

llvm/test/Transforms/Attributor/IPConstantProp/arg-count-mismatch.ll
45

We now infer attributes despite the mismatch in signature. That looks fine here, but possibly it only works by accident.

88

The fact that we no longer infer attributes for TUNIT seems suspicious.

nikic updated this revision to Diff 534965.Jun 27 2023, 6:59 AM

Rebase

llvm/test/Transforms/Attributor/IPConstantProp/arg-count-mismatch.ll
88

Okay, the TUNIT changes are gone after a rebase, so we now only infer more attributes.

jdoerfert accepted this revision.Jun 27 2023, 9:29 AM
jdoerfert added inline comments.
llvm/test/Transforms/Attributor/IPConstantProp/arg-count-mismatch.ll
45

It's fine to deduce correct attributes. We should not do sth wrong or crash.

This revision is now accepted and ready to land.Jun 27 2023, 9:29 AM
This revision was landed with ongoing or failed builds.Jun 28 2023, 12:53 AM
This revision was automatically updated to reflect the committed changes.