File tree Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Expand file tree Collapse file tree 2 files changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -2483,6 +2483,11 @@ Align SelectionDAG::getReducedAlign(EVT VT, bool UseABI) {
24832483 Align RedAlign2 = UseABI ? DL.getABITypeAlign (Ty) : DL.getPrefTypeAlign (Ty);
24842484 if (RedAlign2 < RedAlign)
24852485 RedAlign = RedAlign2;
2486+
2487+ if (!getMachineFunction ().getFrameInfo ().isStackRealignable ())
2488+ // If the stack is not realignable, the alignment should be limited to the
2489+ // StackAlignment
2490+ RedAlign = std::min (RedAlign, StackAlign);
24862491 }
24872492
24882493 return RedAlign;
Original file line number Diff line number Diff line change @@ -17,4 +17,22 @@ entry:
1717 ret i32 %b
1818}
1919
20+ define i32 @foo2 (i32 %arg1 ) #1 {
21+ ; CHECK-LABEL: foo2:
22+ ; CHECK: # %bb.0: # %entry
23+ ; CHECK-NEXT: # kill: def $edi killed $edi def $rdi
24+ ; CHECK-NEXT: vxorps %xmm0, %xmm0, %xmm0
25+ ; CHECK-NEXT: vmovups %ymm0, -{{[0-9]+}}(%rsp)
26+ ; CHECK-NEXT: vmovups %ymm0, -{{[0-9]+}}(%rsp)
27+ ; CHECK-NEXT: andl $31, %edi
28+ ; CHECK-NEXT: movzwl -72(%rsp,%rdi,2), %eax
29+ ; CHECK-NEXT: vzeroupper
30+ ; CHECK-NEXT: retq
31+ entry:
32+ %a = extractelement <32 x i16 > zeroinitializer , i32 %arg1
33+ %b = zext i16 %a to i32
34+ ret i32 %b
35+ }
36+
2037attributes #0 = { "no-realign-stack" "target-cpu" ="skylake-avx512" }
38+ attributes #1 = { "no-realign-stack" "target-cpu" ="skylake" }
You can’t perform that action at this time.
0 commit comments