Skip to content

[X86] Do not directly fold for VINSERTPS #65718

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions llvm/test/CodeGen/X86/avx.ll
Original file line number Diff line number Diff line change
Expand Up @@ -184,12 +184,14 @@ define <4 x float> @nofold_insertps(ptr %a, <4 x float> %b) {
; X86-LABEL: nofold_insertps:
; X86: ## %bb.0:
; X86-NEXT: movl {{[0-9]+}}(%esp), %eax
; X86-NEXT: vinsertps $176, (%eax), %xmm0, %xmm0 ## xmm0 = xmm0[0,1,2],mem[2]
; X86-NEXT: vmovups (%eax), %xmm1
; X86-NEXT: vinsertps {{.*#+}} xmm0 = xmm0[0,1,2],xmm1[2]
; X86-NEXT: retl
;
; X64-LABEL: nofold_insertps:
; X64: ## %bb.0:
; X64-NEXT: vinsertps $176, (%rdi), %xmm0, %xmm0 ## xmm0 = xmm0[0,1,2],mem[2]
; X64-NEXT: vmovups (%rdi), %xmm1
; X64-NEXT: vinsertps {{.*#+}} xmm0 = xmm0[0,1,2],xmm1[2]
; X64-NEXT: retq
%1 = load <4 x float>, ptr %a, align 1
%2 = shufflevector <4 x float> %b, <4 x float> %1, <4 x i32> <i32 0, i32 1, i32 2, i32 6>
Expand Down
2 changes: 0 additions & 2 deletions llvm/test/TableGen/x86-fold-tables.inc
Original file line number Diff line number Diff line change
Expand Up @@ -2105,8 +2105,6 @@ static const X86MemoryFoldTableEntry MemoryFoldTable2[] = {
{X86::VINSERTI64x2Z256rr, X86::VINSERTI64x2Z256rm, 0},
{X86::VINSERTI64x2Zrr, X86::VINSERTI64x2Zrm, 0},
{X86::VINSERTI64x4Zrr, X86::VINSERTI64x4Zrm, 0},
{X86::VINSERTPSZrr, X86::VINSERTPSZrm, TB_NO_REVERSE},
{X86::VINSERTPSrr, X86::VINSERTPSrm, TB_NO_REVERSE},
{X86::VMAXCPDYrr, X86::VMAXCPDYrm, 0},
{X86::VMAXCPDZ128rr, X86::VMAXCPDZ128rm, 0},
{X86::VMAXCPDZ256rr, X86::VMAXCPDZ256rm, 0},
Expand Down
2 changes: 2 additions & 0 deletions llvm/utils/TableGen/X86ManualFoldTables.def
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,8 @@ NOFOLD(MMX_MOVQ64rr_REV)
// =>
// insertpsrm xmm1, m32, imm
NOFOLD(INSERTPSrr)
NOFOLD(VINSERTPSZrr)
NOFOLD(VINSERTPSrr)
#undef NOFOLD

#ifndef ENTRY
Expand Down