Skip to content

Commit bff8356

Browse files
committed
Revert "[COFF, ARM64] Add __break intrinsic"
This reverts commit 8a9b4fb.
1 parent aa14e2e commit bff8356

File tree

10 files changed

+3
-47
lines changed

10 files changed

+3
-47
lines changed

clang/include/clang/Basic/BuiltinsAArch64.def

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -249,8 +249,6 @@ TARGET_HEADER_BUILTIN(_AddressOfReturnAddress, "v*", "nh", "intrin.h", ALL_MS_LA
249249
TARGET_HEADER_BUILTIN(__mulh, "SLLiSLLiSLLi", "nh", "intrin.h", ALL_MS_LANGUAGES, "")
250250
TARGET_HEADER_BUILTIN(__umulh, "ULLiULLiULLi", "nh", "intrin.h", ALL_MS_LANGUAGES, "")
251251

252-
TARGET_HEADER_BUILTIN(__break, "vi", "nh", "intrin.h", ALL_MS_LANGUAGES, "")
253-
254252
#undef BUILTIN
255253
#undef LANGBUILTIN
256254
#undef TARGET_HEADER_BUILTIN

clang/lib/CodeGen/CGBuiltin.cpp

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9823,15 +9823,6 @@ Value *CodeGenFunction::EmitAArch64BuiltinExpr(unsigned BuiltinID,
98239823
return Builder.CreateCall(F, Metadata);
98249824
}
98259825

9826-
if (BuiltinID == AArch64::BI__break) {
9827-
Expr::EvalResult Result;
9828-
if (!E->getArg(0)->EvaluateAsInt(Result, CGM.getContext()))
9829-
llvm_unreachable("Sema will ensure that the parameter is constant");
9830-
9831-
llvm::Function *F = CGM.getIntrinsic(llvm::Intrinsic::aarch64_break);
9832-
return Builder.CreateCall(F, {EmitScalarExpr(E->getArg(0))});
9833-
}
9834-
98359826
if (BuiltinID == AArch64::BI__builtin_arm_clrex) {
98369827
Function *F = CGM.getIntrinsic(Intrinsic::aarch64_clrex);
98379828
return Builder.CreateCall(F);

clang/lib/Headers/intrin.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -560,8 +560,6 @@ unsigned __int64 __cdecl _byteswap_uint64(unsigned __int64 val);
560560

561561
__int64 __mulh(__int64 __a, __int64 __b);
562562
unsigned __int64 __umulh(unsigned __int64 __a, unsigned __int64 __b);
563-
564-
void __break(int);
565563
#endif
566564

567565
/*----------------------------------------------------------------------------*\

clang/lib/Sema/SemaChecking.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2948,9 +2948,6 @@ bool Sema::CheckAArch64BuiltinFunctionCall(const TargetInfo &TI,
29482948
if (BuiltinID == AArch64::BI__getReg)
29492949
return SemaBuiltinConstantArgRange(TheCall, 0, 0, 31);
29502950

2951-
if (BuiltinID == AArch64::BI__break)
2952-
return SemaBuiltinConstantArgRange(TheCall, 0, 0, 0xffff);
2953-
29542951
if (CheckNeonBuiltinFunctionCall(TI, BuiltinID, TheCall))
29552952
return true;
29562953

clang/test/CodeGen/arm64-microsoft-intrinsics.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -103,13 +103,6 @@ unsigned long long check_umulh(unsigned long long a, unsigned long long b) {
103103
// CHECK-MSVC: %[[RES:.*]] = trunc i128 %[[HIGH]] to i64
104104
// CHECK-LINUX: error: call to undeclared function '__umulh'
105105

106-
void check__break() {
107-
__break(0);
108-
}
109-
110-
// CHECK-MSVC: call void @llvm.aarch64.break(i32 0)
111-
// CHECK-LINUX: error: implicit declaration of function '__break'
112-
113106
unsigned __int64 check__getReg(void) {
114107
unsigned volatile __int64 reg;
115108
reg = __getReg(18);

clang/test/Sema/builtins-microsoft-arm64.c

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,6 @@
33

44
#include <intrin.h>
55

6-
void check__break(int x) {
7-
__break(-1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
8-
__break(65536); // expected-error-re {{argument value {{.*}} is outside the valid range}}
9-
__break(x); // expected-error {{argument to '__break' must be a constant integer}}
10-
}
11-
126
void check__getReg(void) {
137
__getReg(-1); // expected-error-re {{argument value {{.*}} is outside the valid range}}
148
__getReg(32); // expected-error-re {{argument value {{.*}} is outside the valid range}}

llvm/include/llvm/IR/IntrinsicsAArch64.td

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,9 +62,6 @@ def int_aarch64_frint64x
6262

6363
def int_aarch64_hint : DefaultAttrsIntrinsic<[], [llvm_i32_ty]>;
6464

65-
def int_aarch64_break : Intrinsic<[], [llvm_i32_ty],
66-
[IntrNoMem, IntrHasSideEffects, IntrNoReturn, IntrCold, ImmArg<ArgIndex<0>>]>;
67-
6865
//===----------------------------------------------------------------------===//
6966
// Data Barrier Instructions
7067

llvm/lib/Target/AArch64/AArch64InstrFormats.td

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4529,9 +4529,8 @@ multiclass MemTagStore<bits<2> opc1, string insn> {
45294529
//---
45304530

45314531
let mayLoad = 0, mayStore = 0, hasSideEffects = 1 in
4532-
class ExceptionGeneration<bits<3> op1, bits<2> ll, string asm,
4533-
list<dag> pattern = []>
4534-
: I<(outs), (ins timm32_0_65535:$imm), asm, "\t$imm", "", pattern>,
4532+
class ExceptionGeneration<bits<3> op1, bits<2> ll, string asm>
4533+
: I<(outs), (ins timm32_0_65535:$imm), asm, "\t$imm", "", []>,
45354534
Sched<[WriteSys]> {
45364535
bits<16> imm;
45374536
let Inst{31-24} = 0b11010100;

llvm/lib/Target/AArch64/AArch64InstrInfo.td

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2432,8 +2432,7 @@ def : Pat<(AArch64call texternalsym:$func), (BL texternalsym:$func)>;
24322432
// Exception generation instructions.
24332433
//===----------------------------------------------------------------------===//
24342434
let isTrap = 1 in {
2435-
def BRK : ExceptionGeneration<0b001, 0b00, "brk",
2436-
[(int_aarch64_break timm32_0_65535:$imm)]>;
2435+
def BRK : ExceptionGeneration<0b001, 0b00, "brk">;
24372436
}
24382437
def DCPS1 : ExceptionGeneration<0b101, 0b01, "dcps1">;
24392438
def DCPS2 : ExceptionGeneration<0b101, 0b10, "dcps2">;

llvm/test/CodeGen/AArch64/arm64-break.ll

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)