[PATCH] D123748: [ValueTracking] Added support to deduce PHI Nodes values being a power of 2

William Junda Huang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 14 13:22:36 PDT 2022


huangjd added inline comments.


================
Comment at: llvm/lib/Analysis/ValueTracking.cpp:2058
+    // be a constant value.
+    if (!match(Start, m_Power2()) || match(Start, m_SignMask()))
+      return false;
----------------
davidxl wrote:
> is the power2 check for start done above already?
This one checks for constant literal. The check before is for any expression that can be deduced to be a power of 2, which is not sufficient to be correct in this case because it may equal to sign bit (0x8000...) and sdiv of this number is no longer a power of 2


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D123748



More information about the llvm-commits mailing list