[llvm] [ValueTracking] Handle `icmp pred (trunc X), C` in `computeKnownBitsFromCmp` (PR #82803)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 4 23:18:42 PST 2024


================
@@ -27,7 +27,8 @@ static void findAffectedValues(Value *Cond,
 
       // Peek through unary operators to find the source of the condition.
       Value *Op;
-      if (match(I, m_PtrToInt(m_Value(Op)))) {
+      if (match(I,
+                m_CombineOr(m_PtrToInt(m_Value(Op)), m_Trunc(m_Value(Op))))) {
----------------
dtcxzyw wrote:

Rebased on the top of https://github.com/llvm/llvm-project/pull/83161.


https://github.com/llvm/llvm-project/pull/82803


More information about the llvm-commits mailing list