[PATCH] D71660: [ValueTracking] isKnownNonZero() should take non-null-ness assumptions into consideration (PR43267)

Roman Lebedev via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Dec 19 14:11:32 PST 2019


lebedev.ri added inline comments.


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:611
+    ConstantInt *CI;
+    if (!match(RHS, m_ConstantInt(CI)))
+      return false;
----------------
nikic wrote:
> Any particular reason to use m_ConstantInt() over m_APInt() here? The difference in vector handling?
I've never ever seen assumptions for vectors, so either should be fine.


================
Comment at: llvm/test/Transforms/InstCombine/assume.ll:272
 ; CHECK:       taken:
+; CHECK-NEXT:    [[LOAD:%.*]] = load i32*, i32** [[A:%.*]], align 8
 ; CHECK-NEXT:    [[CMP:%.*]] = icmp ne i32* [[LOAD]], null
----------------
nikic wrote:
> I'm assuming that we first evaluate the icmp below, then the load is one-use and gets sunk. I'm wondering why the assume is not converted into `!nonnull` metadata after that, as the control dependence is now gone.
The best i can tell is because `isEphemeralValueOf()` says so?
I'm not really familiar with that, best to file a bug.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71660





More information about the llvm-commits mailing list