From e27d5016efed881df0deb467cbc70086a58c3730 Mon Sep 17 00:00:00 2001 From: Amara Emerson Date: Tue, 10 Apr 2018 19:01:58 +0000 Subject: [AArch64] Fix isel failure when BUILD_PAIR nodes are left over. rdar://39175175 llvm-svn: 329743 --- llvm/lib/Target/AArch64/AArch64ISelLowering.cpp | 2 ++ llvm/test/CodeGen/AArch64/build-pair-isel.ll | 13 +++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 llvm/test/CodeGen/AArch64/build-pair-isel.ll diff --git a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp index 28edcc2e47b..19573e180ee 100644 --- a/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp +++ b/llvm/lib/Target/AArch64/AArch64ISelLowering.cpp @@ -198,6 +198,8 @@ AArch64TargetLowering::AArch64TargetLowering(const TargetMachine &TM, setOperationAction(ISD::FREM, MVT::f64, Expand); setOperationAction(ISD::FREM, MVT::f80, Expand); + setOperationAction(ISD::BUILD_PAIR, MVT::i64, Expand); + // Custom lowering hooks are needed for XOR // to fold it into CSINC/CSINV. setOperationAction(ISD::XOR, MVT::i32, Custom); diff --git a/llvm/test/CodeGen/AArch64/build-pair-isel.ll b/llvm/test/CodeGen/AArch64/build-pair-isel.ll new file mode 100644 index 00000000000..c9c50980173 --- /dev/null +++ b/llvm/test/CodeGen/AArch64/build-pair-isel.ll @@ -0,0 +1,13 @@ +; RUN: llc -mtriple=aarch64 -o - -O0 %s | FileCheck %s +target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128" +target triple = "arm64-apple-ios5.0.0" + +; This test checks we don't fail isel due to unhandled build_pair nodes. +; CHECK: bfi +define void @compare_and_swap128() { + %1 = call i128 asm sideeffect "nop", "=r,~{memory}"() + store i128 %1, i128* undef, align 16 + ret void +} + + -- cgit v1.2.3