[llvm] [X86] Invert (and X, ~(and ~Y, Z)) back into (and X, (or Y, ~Z)) (PR #109215)
Simon Pilgrim via llvm-commits
llvm-commits at lists.llvm.org
Wed Oct 9 06:42:48 PDT 2024
================
@@ -0,0 +1,40 @@
+; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 5
+; RUN: llc < %s -mtriple=x86_64-gnu-unknown -mcpu=znver3 | FileCheck %s
+
+define dso_local i64 @foo(i64 %0, i64 %1, i64 %2, i64 %3) local_unnamed_addr {
+; CHECK-LABEL: foo:
+; CHECK: # %bb.0: # %Entry
+; CHECK-NEXT: andq %rdx, %rsi
+; CHECK-NEXT: andnq %rcx, %rdx, %rcx
+; CHECK-NEXT: andnq %rdi, %rsi, %rax
+; CHECK-NEXT: andnq %rax, %rcx, %rax
+; CHECK-NEXT: retq
+Entry:
+ %4 = and i64 %2, %1
+ %5 = xor i64 %4, -1
+ %6 = and i64 %5, %0
+ %.not = xor i64 %3, -1
+ %7 = or i64 %.not, %2
+ %8 = and i64 %6, %7
+ ret i64 %8
+}
+
+declare void @llvm.dbg.value(metadata, metadata, metadata) #1
----------------
RKSimon wrote:
remove unnecessary declaration
https://github.com/llvm/llvm-project/pull/109215
More information about the llvm-commits
mailing list