[PATCH] D99769: [funcattrs] Infer nosync from instruction walk

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 1 14:12:29 PDT 2021


reames created this revision.
reames added reviewers: jdoerfert, sstefan1, nhaehnle, arsenm, jfb.
Herald added subscribers: dantrushin, uenoku, kerbowa, hiraditya, jvesely, mcrosier.
Herald added a reviewer: bollu.
Herald added a reviewer: uenoku.
reames requested review of this revision.
Herald added subscribers: bbn, wdng.
Herald added a reviewer: baziotis.
Herald added a project: LLVM.

Pretty straightforward use of existing infrastructure and port of the attributor inference rules for nosync.

A couple points of interest:

- I deliberately switched from "monotonic or better" to "unordered or better".  This is simply me being conservative and is better in line with the rest of the optimizer.  We treat monotonic conservatively pretty much everywhere.
- The operand bundle test change is suspicious.  It looks like we might have missed something here, but if so, it's an issue with the existing nofree inference as well.  I'm going to take a closer look at that separately.
- I needed to keep the previous inference from readnone.  This surprised me, but made sense once I realized readonly inference goes to lengths to reason about local vs non-local memory and that writes to local memory are okay.  This is fine for the purpose of nosync, but would e.g. prevent us from inferring nofree from readnone - which is slightly surprising.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D99769

Files:
  llvm/lib/Transforms/IPO/FunctionAttrs.cpp
  llvm/test/Analysis/TypeBasedAliasAnalysis/functionattrs.ll
  llvm/test/CodeGen/AMDGPU/inline-attr.ll
  llvm/test/Transforms/FunctionAttrs/nofree.ll
  llvm/test/Transforms/FunctionAttrs/nosync.ll
  llvm/test/Transforms/FunctionAttrs/operand-bundles-scc.ll
  llvm/test/Transforms/FunctionAttrs/read-write-scc.ll
  llvm/test/Transforms/InferFunctionAttrs/norecurse_debug.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D99769.334825.patch
Type: text/x-patch
Size: 11266 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210401/04494803/attachment.bin>


More information about the llvm-commits mailing list