| Issue |
163738
|
| Summary |
[X86] Failure to merge VPTERNLOG patterns
|
| Labels |
good first issue,
backend:X86,
missed-optimization
|
| Assignees |
|
| Reporter |
RKSimon
|
Noticed on #163516
```ll
define <8 x i64> @foo(<8 x i64> %a, <8 x i64> %b, <8 x i64> %c) {
%and.demorgan = or <8 x i64> %b, %a
%and3.demorgan = or <8 x i64> %and.demorgan, %c
%and3 = xor <8 x i64> %and3.demorgan, splat (i64 -1)
ret <8 x i64> %and3
}
```
```asm
foo: # @foo
vporq %zmm0, %zmm1, %zmm1
vpternlogd $255, %zmm0, %zmm0, %zmm0 # zmm0 = -1
vpternlogq $30, %zmm2, %zmm1, %zmm0 # zmm0 = zmm0 ^ (zmm1 | zmm2)
retq
```
This should be able to fold to a single vpternlog instruction
VPTERNLOG construction is handled in X86ISelDAGToDAG.cpp
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs