This revision was automatically updated to reflect the committed changes. Closed by commit rL353337: [COFF, ARM64] Add ARM64 support for MS intrinsic _fastfail (authored by TomTan, committed by ). Herald added a project: LLVM. Herald added a subscriber: llvm-commits.
Changed prior to commit: https://reviews.llvm.org/D57631?vs=184869&id=185609#toc Repository: rL LLVM CHANGES SINCE LAST ACTION https://reviews.llvm.org/D57631/new/ https://reviews.llvm.org/D57631 Files: cfe/trunk/lib/CodeGen/CGBuiltin.cpp cfe/trunk/test/CodeGen/ms-intrinsics.c Index: cfe/trunk/test/CodeGen/ms-intrinsics.c =================================================================== --- cfe/trunk/test/CodeGen/ms-intrinsics.c +++ cfe/trunk/test/CodeGen/ms-intrinsics.c @@ -9,7 +9,7 @@ // RUN: | FileCheck %s --check-prefixes CHECK,CHECK-X64,CHECK-ARM-X64,CHECK-INTEL // RUN: %clang_cc1 -ffreestanding -fms-extensions -fms-compatibility -fms-compatibility-version=17.00 \ // RUN: -triple aarch64-windows -Oz -emit-llvm %s -o - \ -// RUN: | FileCheck %s --check-prefixes CHECK-ARM-ARM64,CHECK-ARM-X64 +// RUN: | FileCheck %s --check-prefixes CHECK-ARM-ARM64,CHECK-ARM-X64,CHECK-ARM64 // intrin.h needs size_t, but -ffreestanding prevents us from getting it from // stddef.h. Work around it with this typedef. @@ -1342,15 +1342,14 @@ // CHECK-ARM-ARM64: } #endif -#if !defined(__aarch64__) void test__fastfail() { __fastfail(42); } // CHECK-LABEL: define{{.*}} void @test__fastfail() // CHECK-ARM: call void asm sideeffect "udf #251", "{r0}"(i32 42) #[[NORETURN:[0-9]+]] // CHECK-INTEL: call void asm sideeffect "int $$0x29", "{cx}"(i32 42) #[[NORETURN]] +// CHECK-ARM64: call void asm sideeffect "brk #0xF003", "{w0}"(i32 42) #[[NORETURN:[0-9]+]] // Attributes come last. // CHECK: attributes #[[NORETURN]] = { noreturn{{.*}} } -#endif Index: cfe/trunk/lib/CodeGen/CGBuiltin.cpp =================================================================== --- cfe/trunk/lib/CodeGen/CGBuiltin.cpp +++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp @@ -997,6 +997,9 @@ Asm = "udf #251"; Constraints = "{r0}"; break; + case llvm::Triple::aarch64: + Asm = "brk #0xF003"; + Constraints = "{w0}"; } llvm::FunctionType *FTy = llvm::FunctionType::get(VoidTy, {Int32Ty}, false); llvm::InlineAsm *IA =
Index: cfe/trunk/test/CodeGen/ms-intrinsics.c =================================================================== --- cfe/trunk/test/CodeGen/ms-intrinsics.c +++ cfe/trunk/test/CodeGen/ms-intrinsics.c @@ -9,7 +9,7 @@ // RUN: | FileCheck %s --check-prefixes CHECK,CHECK-X64,CHECK-ARM-X64,CHECK-INTEL // RUN: %clang_cc1 -ffreestanding -fms-extensions -fms-compatibility -fms-compatibility-version=17.00 \ // RUN: -triple aarch64-windows -Oz -emit-llvm %s -o - \ -// RUN: | FileCheck %s --check-prefixes CHECK-ARM-ARM64,CHECK-ARM-X64 +// RUN: | FileCheck %s --check-prefixes CHECK-ARM-ARM64,CHECK-ARM-X64,CHECK-ARM64 // intrin.h needs size_t, but -ffreestanding prevents us from getting it from // stddef.h. Work around it with this typedef. @@ -1342,15 +1342,14 @@ // CHECK-ARM-ARM64: } #endif -#if !defined(__aarch64__) void test__fastfail() { __fastfail(42); } // CHECK-LABEL: define{{.*}} void @test__fastfail() // CHECK-ARM: call void asm sideeffect "udf #251", "{r0}"(i32 42) #[[NORETURN:[0-9]+]] // CHECK-INTEL: call void asm sideeffect "int $$0x29", "{cx}"(i32 42) #[[NORETURN]] +// CHECK-ARM64: call void asm sideeffect "brk #0xF003", "{w0}"(i32 42) #[[NORETURN:[0-9]+]] // Attributes come last. // CHECK: attributes #[[NORETURN]] = { noreturn{{.*}} } -#endif Index: cfe/trunk/lib/CodeGen/CGBuiltin.cpp =================================================================== --- cfe/trunk/lib/CodeGen/CGBuiltin.cpp +++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp @@ -997,6 +997,9 @@ Asm = "udf #251"; Constraints = "{r0}"; break; + case llvm::Triple::aarch64: + Asm = "brk #0xF003"; + Constraints = "{w0}"; } llvm::FunctionType *FTy = llvm::FunctionType::get(VoidTy, {Int32Ty}, false); llvm::InlineAsm *IA =
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits