[AArch64] Fix isel failure when BUILD_PAIR nodes are left over.
authorAmara Emerson <aemerson@apple.com>
Tue, 10 Apr 2018 19:01:58 +0000 (19:01 +0000)
committerAmara Emerson <aemerson@apple.com>
Tue, 10 Apr 2018 19:01:58 +0000 (19:01 +0000)
rdar://39175175

llvm-svn: 329743

llvm/lib/Target/AArch64/AArch64ISelLowering.cpp
llvm/test/CodeGen/AArch64/build-pair-isel.ll [new file with mode: 0644]

index 28edcc2..19573e1 100644 (file)
@@ -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 (file)
index 0000000..c9c5098
--- /dev/null
@@ -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
+}
+
+