[all-commits] [llvm/llvm-project] 6fd229: [X86] Invert (and X, ~(and ~Y, Z)) back into (and ...
Miguel Saldivar via All-commits
all-commits at lists.llvm.org
Sat Oct 12 03:29:01 PDT 2024
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 6fd229a655f521a9f58d40c671e5cab4ea3ea87b
https://github.com/llvm/llvm-project/commit/6fd229a655f521a9f58d40c671e5cab4ea3ea87b
Author: Miguel Saldivar <miguel.saldivar at hpe.com>
Date: 2024-10-12 (Sat, 12 Oct 2024)
Changed paths:
M llvm/lib/Target/X86/X86ISelLowering.cpp
A llvm/test/CodeGen/X86/pr108731.ll
Log Message:
-----------
[X86] Invert (and X, ~(and ~Y, Z)) back into (and X, (or Y, ~Z)) (#109215)
When `andn` is available, we should avoid switching `s &= ~(z & ~y);` into `s &= ~z | y;`
This patch turns this assembly from:
```
foo:
not rcx
and rsi, rdx
andn rax, rsi, rdi
or rcx, rdx
and rax, rcx
ret
```
into:
```
foo:
and rsi, rdx
andn rcx, rdx, rcx
andn rax, rsi, rdi
andn rax, rcx, rax
ret
```
Fixes #108731
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list