[PATCH] D130466: [LICM] - Add option to allow data races
Florian Hahn via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 3 09:44:02 PDT 2022
fhahn added inline comments.
================
Comment at: llvm/lib/Transforms/Scalar/LICM.cpp:2119
if (!SafeToInsertStore) {
- if (IsKnownThreadLocalObject)
+ if (IsKnownThreadLocalObject || AllowDataRaces)
SafeToInsertStore = true;
----------------
gsocshubham wrote:
> efriedma wrote:
> > I think you need a few more safety checks, even if you're assuming the program is single-threaded. Just because it's legal to load from a memory location, doesn't mean it's legal to store to it. For example, you can't write to a constant.
> I am not sure about writing to a constant. Can you elaborate with an example where it would fail?
This doesn't like quite right. You are just comparing the enum value, not the actual configured ThreadModel I think. You likely have to check the value returned by `getThreadModel`.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D130466/new/
https://reviews.llvm.org/D130466
More information about the llvm-commits
mailing list