[X86] Change how the alignment for the stack object is created in LowerFLT_ROUNDS_.

We don't need FrameInfo's concept of the stack alignment. We just
need to tell it the desired alignment. Which in this case is 2.
This commit is contained in:
Craig Topper 2020-02-17 11:20:36 -08:00
parent b62de210cf
commit 43e948c4b7
2 changed files with 3 additions and 5 deletions

View File

@ -25736,14 +25736,12 @@ SDValue X86TargetLowering::LowerFLT_ROUNDS_(SDValue Op,
*/
MachineFunction &MF = DAG.getMachineFunction();
const TargetFrameLowering &TFI = *Subtarget.getFrameLowering();
const Align StackAlignment(TFI.getStackAlignment());
MVT VT = Op.getSimpleValueType();
SDLoc DL(Op);
// Save FP Control Word to stack slot
int SSFI =
MF.getFrameInfo().CreateStackObject(2, StackAlignment.value(), false);
MF.getFrameInfo().CreateStackObject(2, 2, false);
SDValue StackSlot =
DAG.getFrameIndex(SSFI, getPointerTy(DAG.getDataLayout()));

View File

@ -8,7 +8,7 @@ declare i32 @llvm.flt.rounds()
define i32 @test_flt_rounds() nounwind {
; X86-LABEL: test_flt_rounds:
; X86: # %bb.0:
; X86-NEXT: subl $12, %esp
; X86-NEXT: subl $2, %esp
; X86-NEXT: fnstcw (%esp)
; X86-NEXT: movzwl (%esp), %ecx
; X86-NEXT: shrl $9, %ecx
@ -17,7 +17,7 @@ define i32 @test_flt_rounds() nounwind {
; X86-NEXT: # kill: def $cl killed $cl killed $ecx
; X86-NEXT: shrl %cl, %eax
; X86-NEXT: andl $3, %eax
; X86-NEXT: addl $12, %esp
; X86-NEXT: addl $2, %esp
; X86-NEXT: retl
;
; X64-LABEL: test_flt_rounds: