From: Tom Stellard Date: Fri, 18 Nov 2016 14:14:35 +0000 (+0000) Subject: GlobalISel: Fix unconditional fallback with global isel abort is disabled X-Git-Tag: llvmorg-4.0.0-rc1~4189 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=df613198c0d6d208f57f02abc882b36b686fef64;p=platform%2Fupstream%2Fllvm.git GlobalISel: Fix unconditional fallback with global isel abort is disabled Reviewers: t.p.northover, ab, qcolombet Subscribers: mehdi_amini, vkalintiris, wdng, dberris, llvm-commits, rovka Differential Revision: https://reviews.llvm.org/D26765 llvm-svn: 287344 --- diff --git a/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp b/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp index 72e4a23b..1d205cd 100644 --- a/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp +++ b/llvm/lib/CodeGen/GlobalISel/InstructionSelect.cpp @@ -164,7 +164,7 @@ bool InstructionSelect::runOnMachineFunction(MachineFunction &MF) { MRI.getVRegToType().clear(); - if (!TPC.isGlobalISelAbortEnabled() && (Failed || MF.size() == NumBlocks)) { + if (!TPC.isGlobalISelAbortEnabled() && (Failed || MF.size() != NumBlocks)) { MF.getProperties().set(MachineFunctionProperties::Property::FailedISel); return false; } diff --git a/llvm/test/CodeGen/AArch64/GlobalISel/gisel-abort.ll b/llvm/test/CodeGen/AArch64/GlobalISel/gisel-abort.ll new file mode 100644 index 0000000..76eafdd --- /dev/null +++ b/llvm/test/CodeGen/AArch64/GlobalISel/gisel-abort.ll @@ -0,0 +1,8 @@ +; RUN: llc -march aarch64 -global-isel -global-isel-abort=2 -verify-machineinstrs %s -o - 2>&1 | FileCheck %s + +; CHECK-NOT: fallback +; CHECK: empty +define void @empty() { + ret void +} +