[PATCH] D158081: [IR] Add writable attribute

Noah Goldstein via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 9 09:51:14 PDT 2023


goldstein.w.n added inline comments.


================
Comment at: llvm/lib/Transforms/Scalar/LICM.cpp:2190
+        (!ExplicitlyDereferenceableOnly ||
+         isDereferenceablePointer(SomePtr, AccessTy, MDL)) &&
         isThreadLocalObject(Object, CurLoop, DT, TTI))
----------------
nit: Given that the `writeable` attribute is only meaningful in conjunction with `isDeferenceablePointer`, maybe that check should just be part of the `isWritableObject` function? Then you can drop the `ExplicitlyDeferenceableOnly` bool. Just in general seems easier on the user to have the function do the checks of whether the `writable` attribute is meaningful for the object rather than the otherway around.

In general though I don't see any issues with the code, but am in no way qualified to approve this patch.



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

https://reviews.llvm.org/D158081



More information about the llvm-commits mailing list