llvm.org GIT mirror llvm / e6c1fc9
X86: use the correct alloca symbol for Windows Itanium Windows itanium targets the MSVCRT, and the stack probe symbol is provided by MSVCRT. This corrects the emission of stack probes on i686-windows-itanium. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@222439 91177308-0d34-0410-b5e6-96231b3b80d8 Saleem Abdulrasool 5 years ago
3 changed file(s) with 24 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
2060820608 .addReg(X86::RAX);
2060920609 }
2061020610 } else {
20611 const char *StackProbeSymbol =
20612 Subtarget->isTargetKnownWindowsMSVC() ? "_chkstk" : "_alloca";
20611 const char *StackProbeSymbol = (Subtarget->isTargetKnownWindowsMSVC() ||
20612 Subtarget->isTargetWindowsItanium())
20613 ? "_chkstk"
20614 : "_alloca";
2061320615
2061420616 BuildMI(*BB, MI, DL, TII->get(X86::CALLpcrel32))
2061520617 .addExternalSymbol(StackProbeSymbol)
425425 return TargetTriple.isWindowsGNUEnvironment();
426426 }
427427
428 bool isTargetWindowsItanium() const {
429 return TargetTriple.isWindowsItaniumEnvironment();
430 }
431
428432 bool isTargetCygMing() const { return TargetTriple.isOSCygMing(); }
429433
430434 bool isOSWindows() const { return TargetTriple.isOSWindows(); }
0 ; RUN: llc -mtriple i686-windows-itanium -filetype asm -o - %s | FileCheck %s
1
2 target datalayout = "e-m:w-p:32:32-i64:64-f80:32-n8:16:32-S32"
3 target triple = "i686--windows-itanium"
4
5 declare void @external(i8*)
6
7 define dllexport void @alloca(i32 %sz) {
8 entry:
9 %vla = alloca i8, i32 %sz, align 1
10 call void @external(i8* %vla)
11 ret void
12 }
13
14 ; CHECK: __chkstk
15