[llvm] [InstCombine] Add combines for unsigned comparison of absolute value to constant (PR #176148)

Antonio Frighetto via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 27 02:55:14 PST 2026


================
@@ -4301,6 +4301,32 @@ Instruction *InstCombinerImpl::foldICmpIntrinsicWithConstant(ICmpInst &Cmp,
                             II->getArgOperand(1));
     }
     break;
+  case Intrinsic::abs: {
+    if (!II->hasOneUse())
----------------
antoniofrighetto wrote:

If not mistaken, it looks like there are 7 multi-use tests. While being pedantic on test coverage is definitely a virtue, if we are just testing the multi-use check, I don't understand why we should differentiate per poison flag too, i.e., one single test should possibly suffice.

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


More information about the llvm-commits mailing list