mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-01 18:33:56 +00:00
Explicitly set the scale to 1 on some segstack prologue instrs.
Patch by Brian Anderson. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@147952 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
8704b7897d
commit
014f7a3b37
@ -1385,10 +1385,10 @@ X86FrameLowering::adjustForSegmentedStacks(MachineFunction &MF) const {
|
||||
ScratchReg = X86::RSP;
|
||||
else
|
||||
BuildMI(checkMBB, DL, TII.get(X86::LEA64r), ScratchReg).addReg(X86::RSP)
|
||||
.addImm(0).addReg(0).addImm(-StackSize).addReg(0);
|
||||
.addImm(1).addReg(0).addImm(-StackSize).addReg(0);
|
||||
|
||||
BuildMI(checkMBB, DL, TII.get(X86::CMP64rm)).addReg(ScratchReg)
|
||||
.addReg(0).addImm(0).addReg(0).addImm(TlsOffset).addReg(TlsReg);
|
||||
.addReg(0).addImm(1).addReg(0).addImm(TlsOffset).addReg(TlsReg);
|
||||
} else {
|
||||
TlsReg = X86::GS;
|
||||
TlsOffset = 0x30;
|
||||
@ -1397,7 +1397,7 @@ X86FrameLowering::adjustForSegmentedStacks(MachineFunction &MF) const {
|
||||
ScratchReg = X86::ESP;
|
||||
else
|
||||
BuildMI(checkMBB, DL, TII.get(X86::LEA32r), ScratchReg).addReg(X86::ESP)
|
||||
.addImm(0).addReg(0).addImm(-StackSize).addReg(0);
|
||||
.addImm(1).addReg(0).addImm(-StackSize).addReg(0);
|
||||
|
||||
BuildMI(checkMBB, DL, TII.get(X86::CMP32rm)).addReg(ScratchReg)
|
||||
.addReg(0).addImm(0).addReg(0).addImm(TlsOffset).addReg(TlsReg);
|
||||
|
@ -12066,7 +12066,7 @@ X86TargetLowering::EmitLoweredSegAlloca(MachineInstr *MI, MachineBasicBlock *BB,
|
||||
BuildMI(BB, DL, TII->get(Is64Bit ? X86::SUB64rr:X86::SUB32rr), SPLimitVReg)
|
||||
.addReg(tmpSPVReg).addReg(sizeVReg);
|
||||
BuildMI(BB, DL, TII->get(Is64Bit ? X86::CMP64mr:X86::CMP32mr))
|
||||
.addReg(0).addImm(0).addReg(0).addImm(TlsOffset).addReg(TlsReg)
|
||||
.addReg(0).addImm(1).addReg(0).addImm(TlsOffset).addReg(TlsReg)
|
||||
.addReg(SPLimitVReg);
|
||||
BuildMI(BB, DL, TII->get(X86::JG_4)).addMBB(mallocMBB);
|
||||
|
||||
|
@ -1,6 +1,10 @@
|
||||
; RUN: llc < %s -mtriple=i686-linux -segmented-stacks -verify-machineinstrs | FileCheck %s -check-prefix=X32
|
||||
; RUN: llc < %s -mtriple=x86_64-linux -segmented-stacks -verify-machineinstrs | FileCheck %s -check-prefix=X64
|
||||
|
||||
; We used to crash with filetype=obj
|
||||
; RUN: llc < %s -mtriple=i686-linux -segmented-stacks -filetype=obj
|
||||
; RUN: llc < %s -mtriple=x86_64-linux -segmented-stacks -filetype=obj
|
||||
|
||||
; Just to prevent the alloca from being optimized away
|
||||
declare void @dummy_use(i32*, i32)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user