[PATCH] D85524: [Loads] Add canReplacePointersIfEqual helper.

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 7 12:12:37 PDT 2020


efriedma added inline comments.


================
Comment at: llvm/include/llvm/Analysis/Loads.h:161
+/// value \B if they are deemed equal through some means (e.g. information from
+/// conditions). Note that the current implementations is incomplete and
+/// unsound. It does not reject all invalid cases yet and will be made stricter
----------------
Maybe make this note a little louder: put NOTE in all caps, at the beginning of a new paragraph.


================
Comment at: llvm/lib/Analysis/Loads.cpp:524
+    return C->isNullValue() ||
+           isDereferenceablePointer(B, Ty->getPointerElementType(), DL, CtxI);
+  }
----------------
This check is full of holes... but I guess it's a good thing if we can start marking the places in transforms where this matters without worrying too much about the initial performance impact.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D85524



More information about the llvm-commits mailing list