[PATCH] D69686: [LVI][CVP] Use block value when simplifying icmps

Nikita Popov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Sep 27 09:25:57 PDT 2020


nikic added inline comments.


================
Comment at: llvm/lib/Analysis/LazyValueInfo.cpp:1761
+  ValueLatticeElement Result = UseBlockValue
+      ? getImpl(PImpl, AC, M).getValueInBlock(V, CxtI->getParent(), CxtI)
+      : getImpl(PImpl, AC, M).getValueAt(V, CxtI);
----------------
fhahn wrote:
> Currently the comment for `getValueInBlock` says it returns the value at the end of the block. IIUC this only refers to the fact that all assumes in the block are used. But if `CxtI` is passed, only assumes dominating `CxtI` are passed, so effectively we get the value at `CxtI`? Might be good to clarify this in the docs.
Right, the comment there is outdated. Prior to D69914 the value was valid either at the start of the block (for integers) or the end of the block (for pointers), now it is always valid at the start (or at the context instruction if given). I've pushed a clarification to those doc comments in https://github.com/llvm/llvm-project/commit/709d03f8af4da4204849a70f01798e7cebba2e32.


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

https://reviews.llvm.org/D69686



More information about the llvm-commits mailing list