[PATCH] D89219: [ValueTracking] Use assume's noundef operand bundle

Tyker via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 12 13:15:47 PDT 2020


Tyker added a comment.

you probably want to add noundef to isUsefullToPreserve such that it gets preserved automatically when knowledge retention is turned on.



================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:4843
+}
+
 static bool isGuaranteedNotToBeUndefOrPoison(const Value *V,
----------------
jdoerfert wrote:
> I thought we had a helper for this, I think it is `hasAttributeInAssume` in `llvm/include/llvm/Analysis/AssumeBundleQueries.h`. If that is not enough we should extend it for sure. This kind of query is common and easy to get wrong. For example, this doesn't handle multiple `noundef` bundles.
there is getKnowledgeValidInContext which should be enough for what is being done here. it also has a fallback when there is no AssumptionCache.
also getOperandBundle is not valid since there maybe more than one noundef bundle in this assume.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D89219



More information about the llvm-commits mailing list