[PATCH] D99802: [rs4gc] Strip memory related attributes consistently

Philip Reames via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 2 09:59:52 PDT 2021


reames created this revision.
reames added reviewers: skatkov, anna.
Herald added subscribers: jdoerfert, dantrushin, hiraditya, mcrosier.
Herald added a reviewer: bollu.
reames requested review of this revision.
Herald added a project: LLVM.

I noticed that rs4gc is not stripping a number of memory aliasing related attributes.  We do strip some from call sites, but don't strip the same ones from declarations or parameters.

Why do we need to strip these?  Two answers:

1. Safepoints conceptually read and write to the entire garbage collected heap in the physical model.  We need this to preserve ordering of all loads and stores with respect to possible relocation.
2. We can infer other attributes from these.  For instance, readnone can imply both nofree and nosync.  Both of which don't hold after physical rewriting.

I'm mostly posting for review to give a chance for a sanity check, and a perf test if interested.  I could see this negatively impacting optimization after lowering.  I doubt it's a large effect, but that might be worth measuring.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D99802

Files:
  llvm/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp
  llvm/test/Transforms/RewriteStatepointsForGC/strip-invalid-attributes.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D99802.334978.patch
Type: text/x-patch
Size: 4591 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210402/f48b77fd/attachment.bin>


More information about the llvm-commits mailing list