From 5d2c3a0b8cef545ad69f14264fe0466bb562c66f Mon Sep 17 00:00:00 2001 From: Eli Friedman Date: Tue, 19 May 2020 13:46:35 -0700 Subject: [PATCH] [AArch64] Disable MachineOutliner on Windows. The handling of unwind info is broken, so disable it for now. --- llvm/lib/Target/AArch64/AArch64InstrInfo.cpp | 4 ++++ llvm/test/CodeGen/AArch64/machine-outliner-calls.mir | 2 ++ 2 files changed, 6 insertions(+) diff --git a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp index 678fe05..83acf0d 100644 --- a/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp +++ b/llvm/lib/Target/AArch64/AArch64InstrInfo.cpp @@ -6106,6 +6106,10 @@ bool AArch64InstrInfo::isFunctionSafeToOutlineFrom( if (!AFI || AFI->hasRedZone().getValueOr(true)) return false; + // FIXME: Teach the outliner to generate/handle Windows unwind info. + if (MF.getTarget().getMCAsmInfo()->usesWindowsCFI()) + return false; + // It's safe to outline from MF. return true; } diff --git a/llvm/test/CodeGen/AArch64/machine-outliner-calls.mir b/llvm/test/CodeGen/AArch64/machine-outliner-calls.mir index 847ccb9..6a33bda 100644 --- a/llvm/test/CodeGen/AArch64/machine-outliner-calls.mir +++ b/llvm/test/CodeGen/AArch64/machine-outliner-calls.mir @@ -1,4 +1,5 @@ # RUN: llc -mtriple=aarch64--- -run-pass=prologepilog -run-pass=machine-outliner -verify-machineinstrs %s -o - | FileCheck %s +# RUN: llc -mtriple=aarch64-pc-windows-msvc -run-pass=prologepilog -run-pass=machine-outliner -verify-machineinstrs %s -o - | FileCheck %s -check-prefix=WINDOWS --- | define void @baz() #0 { ret void @@ -65,3 +66,4 @@ body: | # CHECK-NEXT: $w17 = ORRWri $wzr, 1 # CHECK-NEXT: early-clobber $sp, $lr = LDRXpost $sp, 16 # CHECK-NEXT: RET $lr +# WINDOWS-NOT: OUTLINED -- 2.7.4