[PATCH] D135780: [IR] Switch everything to use memory attribute

Johannes Doerfert via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 4 00:16:15 PDT 2022


jdoerfert accepted this revision.
jdoerfert added a comment.
This revision is now accepted and ready to land.

I read through all the clang changes and clang test changes. Also again through all the LLVM changes (not through all the tests though).
I think this is fine. Minor nits below. I'll accept this now as there seems to be no objection.



================
Comment at: clang/test/CodeGen/function-attributes.c:114
 // CHECK: attributes [[AI]] = { alwaysinline nounwind optsize{{.*}} }
-// CHECK: attributes [[NUW_OS_RN]] = { nounwind optsize readnone{{.*}} }
+// CHECK: attributes [[NUW_OS_RN]] = { nounwind optsize willreturn memory(none){{.*}} }
 // CHECK: attributes [[SR]] = { nounwind optsize{{.*}} "stackrealign"{{.*}} }
----------------
Where does the willreturn come from? *thinking* Oh, it just hid in the {{.*}} part. Never-mind.


================
Comment at: llvm/docs/LangRef.rst:1423
+    If a function reads from or writes to a readnone pointer argument, the
+    behavior is undefined.
+``readonly``
----------------
Newline


================
Comment at: llvm/lib/IR/Instructions.cpp:399
+    assert(Kind != Attribute::Memory && "Use getMemoryEffects() instead");
+  }
+
----------------
C++17, cool.


================
Comment at: llvm/lib/Transforms/Instrumentation/DataFlowSanitizer.cpp:1476
 
-  ReadOnlyNoneAttrs.addAttribute(Attribute::ReadOnly)
-      .addAttribute(Attribute::ReadNone);
+  ReadOnlyNoneAttrs.addAttribute(Attribute::Memory);
 
----------------
This seems more pessimistic. Unsure if it makes a difference.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D135780/new/

https://reviews.llvm.org/D135780



More information about the llvm-commits mailing list