[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:43:42 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:

Similar to https://www.oreilly.com/library/view/hackers-delight/0201914654/0201914654_ch02lev1sec4.html.

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


More information about the llvm-commits mailing list