[llvm] [InstCombine] Fold (sub (xor X, (sext C)), (sext C)) => (select C (neg X), X) (PR #79417)

Kai Luo via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 25 22:42:14 PST 2024


================
@@ -0,0 +1,19 @@
+; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 4
+; RUN: opt < %s -passes=instcombine -S | FileCheck %s
+
+define  i64 @absdiff(i64 %0, i64 %1) {
----------------
bzEq wrote:

> Does this pattern exist in some real-world applications?

Yes. We have observed this pattern in our internal workload.

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


More information about the llvm-commits mailing list