This is an archive of the discontinued LLVM Phabricator instance.

[InferAttributes] Materialize all infered attributes for declaration
ClosedPublic

Authored by reames on Apr 13 2021, 10:54 AM.

Details

Summary

We have some cases today where attributes can be inferred from another on access, but the result is not explicitly materialized in IR. This change is a step towards changing that.

Why? Two main reasons:

  1. Human clarity. It's really confusing trying to figure out why a transform is triggering when the IR doesn't appear to have the required attributes.
  2. This avoids the need to special case declarations in e.g. functionattrs. Since we can assume the attribute is present, we can work directly from attributes (and only attributes) without also needing to query accessors on Function to avoid missing cases due to unannotated (but infered on use) declarations. (This piece will appear must easier to follow once D100226 also lands.)

Diff Detail

Event Timeline

reames created this revision.Apr 13 2021, 10:54 AM
reames requested review of this revision.Apr 13 2021, 10:54 AM
Herald added a project: Restricted Project. · View Herald TranscriptApr 13 2021, 10:54 AM
nlopes accepted this revision.Apr 14 2021, 3:24 AM

LGTM

This revision is now accepted and ready to land.Apr 14 2021, 3:24 AM
This revision was landed with ongoing or failed builds.Apr 14 2021, 2:45 PM
This revision was automatically updated to reflect the committed changes.
thakis added a subscriber: thakis.Apr 14 2021, 2:49 PM

Looks like this breaks tests: http://45.33.8.238/linux/44134/step_7.txt

Please take a look and revert for now if it takes a while to fix.