[llvm] [ValueTracking] Handle assume( trunc x to i1) (PR #118406)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 9 09:46:48 PDT 2025


================
@@ -643,11 +643,16 @@ static bool isKnownNonZeroFromAssume(const Value *V, const SimplifyQuery &Q) {
     // Warning: This loop can end up being somewhat performance sensitive.
     // We're running this loop for once for each value queried resulting in a
     // runtime of ~O(#assumes * #values).
+    Value *Arg = I->getArgOperand(0);
----------------
dtcxzyw wrote:

However, InstCombine can simplify both of them after I removed the change to `isKnownNonZeroFromAssume`.
(the original tests check InstSimplify/LVI instead).

Can you please spill `isKnownNonZeroFromAssume` changes into a separate PR? Sorry for the inconvenience.


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


More information about the llvm-commits mailing list