[PATCH] D79234: [ValueTracking] Fix computeKnownBits() with bitwidth-changing ptrtoint

Eli Friedman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 15 14:42:13 PDT 2020


efriedma added a comment.

> Would anything speak against making the validity of constant expressions dependent on which module they are used in? That is, the same constant expression could be valid in one module and invalid in another, depending on data layout.

That's not something we've ever done, but I guess it's possible.



================
Comment at: lib/Analysis/ValueTracking.cpp:794
+        KnownBits RHSKnown =
+            computeKnownBits(A, Depth+1, Query(Q, I)).anyextOrTrunc(BitWidth);
         Known.Zero |= RHSKnown.Zero;
----------------
LangRef says ptrtoint zero-extends.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D79234





More information about the llvm-commits mailing list