Skip to content

Commit 750508e

Browse files
committed
[llvm] No inline stackprobe for UEFI
UEFI targets must be excluded from inline stack probes.
1 parent 0eae457 commit 750508e

File tree

5 files changed

+9
-2
lines changed

5 files changed

+9
-2
lines changed

llvm/lib/Target/X86/X86ISelLowering.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62039,7 +62039,7 @@ bool X86TargetLowering::hasStackProbeSymbol(const MachineFunction &MF) const {
6203962039
bool X86TargetLowering::hasInlineStackProbe(const MachineFunction &MF) const {
6204062040

6204162041
// No inline stack probe for Windows, they have their own mechanism.
62042-
if (Subtarget.isOSWindows() ||
62042+
if (Subtarget.isOSWindows() || Subtarget.isUEFI() ||
6204362043
MF.getFunction().hasFnAttribute("no-stack-arg-probe"))
6204462044
return false;
6204562045

@@ -62065,7 +62065,8 @@ X86TargetLowering::getStackProbeSymbolName(const MachineFunction &MF) const {
6206562065

6206662066
// Generally, if we aren't on Windows, the platform ABI does not include
6206762067
// support for stack probes, so don't emit them.
62068-
if (!Subtarget.isOSWindows() || Subtarget.isTargetMachO() ||
62068+
if ((!Subtarget.isOSWindows() && !Subtarget.isUEFI()) ||
62069+
Subtarget.isTargetMachO() ||
6206962070
MF.getFunction().hasFnAttribute("no-stack-arg-probe"))
6207062071
return "";
6207162072

llvm/test/CodeGen/X86/movtopush.ll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
; RUN: llc < %s -mtriple=i686-windows | FileCheck %s -check-prefix=NORMAL
22
; RUN: llc < %s -mtriple=i686-windows -no-x86-call-frame-opt | FileCheck %s -check-prefix=NOPUSH
33
; RUN: llc < %s -mtriple=x86_64-windows | FileCheck %s -check-prefix=X64
4+
; RUN: llc < %s -mtriple=x86_64-uefi | FileCheck %s -check-prefix=X64
45
; RUN: llc < %s -mtriple=i686-pc-linux | FileCheck %s -check-prefix=LINUX
56

67
%class.Class = type { i32 }

llvm/test/CodeGen/X86/win64_eh.ll

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
; RUN: llc < %s -O0 -mattr=sse2 -mtriple=x86_64-pc-windows-itanium | FileCheck %s -check-prefix=WIN64 -check-prefix=NORM
2+
; RUN: llc < %s -O0 -mattr=sse2 -mtriple=x86_64-uefi | FileCheck %s -check-prefix=WIN64 -check-prefix=NORM
23
; RUN: llc < %s -O0 -mattr=sse2 -mtriple=x86_64-pc-mingw32 | FileCheck %s -check-prefix=WIN64 -check-prefix=NORM
34
; RUN: llc < %s -O0 -mattr=sse2 -mtriple=x86_64-pc-mingw32 -mcpu=atom | FileCheck %s -check-prefix=WIN64 -check-prefix=ATOM
45

llvm/test/CodeGen/X86/win64_frame.ll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
22
; RUN: llc < %s -mtriple=x86_64-pc-win32 | FileCheck %s
33
; RUN: llc < %s -mtriple=x86_64-pc-win32 -mattr=+sahf | FileCheck %s
4+
; RUN: llc < %s -mtriple=x86_64-uefi | FileCheck %s
5+
; RUN: llc < %s -mtriple=x86_64-uefi -mattr=+sahf | FileCheck %s
46

57
define i32 @f1(i32 %p1, i32 %p2, i32 %p3, i32 %p4, i32 %p5) "frame-pointer"="all" {
68
; CHECK-LABEL: f1:

llvm/test/CodeGen/X86/win_chkstk.ll

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
; RUN: llc < %s -mtriple=i686-pc-win32 | FileCheck %s -check-prefix=WIN_X32
22
; RUN: llc < %s -mtriple=x86_64-pc-win32 | FileCheck %s -check-prefix=WIN_X64
33
; RUN: llc < %s -mtriple=x86_64-pc-win32 -code-model=large | FileCheck %s -check-prefix=WIN64_LARGE
4+
; RUN: llc < %s -mtriple=x86_64-uefi | FileCheck %s -check-prefix=WIN_X64
5+
; RUN: llc < %s -mtriple=x86_64-uefi -code-model=large | FileCheck %s -check-prefix=WIN64_LARGE
46
; RUN: llc < %s -mtriple=i686-pc-mingw32 | FileCheck %s -check-prefix=MINGW_X32
57
; RUN: llc < %s -mtriple=x86_64-pc-mingw32 | FileCheck %s -check-prefix=MINGW_X64
68
; RUN: llc < %s -mtriple=i386-pc-linux | FileCheck %s -check-prefix=LINUX

0 commit comments

Comments
 (0)