[llvm] [InstCombine] Fold icmp (zext X), (and (trunc Y), Mask) -> icmp X, trunc Y (PR #221189)
armandeep singh via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 16 12:53:01 PDT 2026
================
@@ -0,0 +1,71 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 6
+; RUN: opt < %s -passes=instcombine -S | FileCheck %s
+
+; Exact shape from issue #115466 — ugt, not eq.
+define i1 @test_zext_trunc_and_ugt(i16 %x, i64 %y) {
----------------
armandeep23947 wrote:
mask's a constant so per the guide it doesn't need a commuted test. icmp side isn't constant but that's already handled by canonicalization before foldICmpBinOp runs - test_zext_trunc_and_ugt actually proves it, zext's first there and it still folds fine. let me know if you meant something else
https://github.com/llvm/llvm-project/pull/221189
More information about the llvm-commits
mailing list