[PATCH] D100400: [InferAttributes] Materialize all infered attributes for declaration

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 13 10:54:57 PDT 2021


reames created this revision.
reames added reviewers: nikic, nlopes, jdoerfert.
Herald added subscribers: asbirlea, hiraditya, mcrosier.
Herald added a reviewer: bollu.
reames requested review of this revision.
Herald added a project: LLVM.

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 <https://reviews.llvm.org/D100226> also lands.)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D100400

Files:
  llvm/lib/Transforms/IPO/InferFunctionAttrs.cpp
  llvm/test/Other/cgscc-devirt-iteration.ll
  llvm/test/Transforms/InferFunctionAttrs/annotate.ll
  llvm/test/Transforms/LICM/strlen.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D100400.337204.patch
Type: text/x-patch
Size: 8240 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210413/c6ba2539/attachment.bin>


More information about the llvm-commits mailing list