forked from intel/llvm
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SelectionDAG] Use unaligned store to move AVX registers onto stack f…
…or `extractelement` (#78422) Prior to this patch, SelectionDAG generated aligned move onto stacks for AVX registers when the function was marked as a no-realign-stack function. This lead to misalignment between the stack and the instruction generated. This patch fixes the issue. Fixes #77730
- Loading branch information
Showing
2 changed files
with
39 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
20 changes: 20 additions & 0 deletions
20
llvm/test/CodeGen/X86/unaligned_extract_from_vector_through_stack.ll
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py | ||
; RUN: llc < %s -mtriple=x86_64-unknown-linux-gnu | FileCheck %s | ||
|
||
define i32 @foo(i32 %arg1) #0 { | ||
; CHECK-LABEL: foo: | ||
; CHECK: # %bb.0: # %entry | ||
; CHECK-NEXT: # kill: def $edi killed $edi def $rdi | ||
; CHECK-NEXT: vxorps %xmm0, %xmm0, %xmm0 | ||
; CHECK-NEXT: vmovups %ymm0, -{{[0-9]+}}(%rsp) | ||
; CHECK-NEXT: andl $31, %edi | ||
; CHECK-NEXT: movzbl -40(%rsp,%rdi), %eax | ||
; CHECK-NEXT: vzeroupper | ||
; CHECK-NEXT: retq | ||
entry: | ||
%a = extractelement <32 x i8> zeroinitializer, i32 %arg1 | ||
%b = zext i8 %a to i32 | ||
ret i32 %b | ||
} | ||
|
||
attributes #0 = { "no-realign-stack" "target-cpu"="skylake-avx512" } |