Skip to content

Commit bfd4af8

Browse files
authored
[llvm] No inline stackprobe for UEFI (llvm#139330)
UEFI targets must be excluded from inline stack probes.
1 parent dd3d7cf commit bfd4af8

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
@@ -62048,7 +62048,7 @@ bool X86TargetLowering::hasStackProbeSymbol(const MachineFunction &MF) const {
6204862048
bool X86TargetLowering::hasInlineStackProbe(const MachineFunction &MF) const {
6204962049

6205062050
// No inline stack probe for Windows, they have their own mechanism.
62051-
if (Subtarget.isOSWindows() ||
62051+
if (Subtarget.isOSWindows() || Subtarget.isUEFI() ||
6205262052
MF.getFunction().hasFnAttribute("no-stack-arg-probe"))
6205362053
return false;
6205462054

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

6207562075
// Generally, if we aren't on Windows, the platform ABI does not include
6207662076
// support for stack probes, so don't emit them.
62077-
if (!Subtarget.isOSWindows() || Subtarget.isTargetMachO() ||
62077+
if ((!Subtarget.isOSWindows() && !Subtarget.isUEFI()) ||
62078+
Subtarget.isTargetMachO() ||
6207862079
MF.getFunction().hasFnAttribute("no-stack-arg-probe"))
6207962080
return "";
6208062081

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)