Skip to content

Commit df21ee4

Browse files
committed
[DAG] Add clang-format off/on wrappers around compact switch handlers. NFC.
Avoids a problem identified in #90503
1 parent aeab44d commit df21ee4

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6700,22 +6700,24 @@ void SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I,
67006700
case Intrinsic::roundeven:
67016701
case Intrinsic::canonicalize: {
67026702
unsigned Opcode;
6703+
// clang-format off
67036704
switch (Intrinsic) {
67046705
default: llvm_unreachable("Impossible intrinsic"); // Can't reach here.
6705-
case Intrinsic::sqrt: Opcode = ISD::FSQRT; break;
6706-
case Intrinsic::fabs: Opcode = ISD::FABS; break;
6707-
case Intrinsic::sin: Opcode = ISD::FSIN; break;
6708-
case Intrinsic::cos: Opcode = ISD::FCOS; break;
6709-
case Intrinsic::exp10: Opcode = ISD::FEXP10; break;
6710-
case Intrinsic::floor: Opcode = ISD::FFLOOR; break;
6711-
case Intrinsic::ceil: Opcode = ISD::FCEIL; break;
6712-
case Intrinsic::trunc: Opcode = ISD::FTRUNC; break;
6713-
case Intrinsic::rint: Opcode = ISD::FRINT; break;
6714-
case Intrinsic::nearbyint: Opcode = ISD::FNEARBYINT; break;
6715-
case Intrinsic::round: Opcode = ISD::FROUND; break;
6716-
case Intrinsic::roundeven: Opcode = ISD::FROUNDEVEN; break;
6706+
case Intrinsic::sqrt: Opcode = ISD::FSQRT; break;
6707+
case Intrinsic::fabs: Opcode = ISD::FABS; break;
6708+
case Intrinsic::sin: Opcode = ISD::FSIN; break;
6709+
case Intrinsic::cos: Opcode = ISD::FCOS; break;
6710+
case Intrinsic::exp10: Opcode = ISD::FEXP10; break;
6711+
case Intrinsic::floor: Opcode = ISD::FFLOOR; break;
6712+
case Intrinsic::ceil: Opcode = ISD::FCEIL; break;
6713+
case Intrinsic::trunc: Opcode = ISD::FTRUNC; break;
6714+
case Intrinsic::rint: Opcode = ISD::FRINT; break;
6715+
case Intrinsic::nearbyint: Opcode = ISD::FNEARBYINT; break;
6716+
case Intrinsic::round: Opcode = ISD::FROUND; break;
6717+
case Intrinsic::roundeven: Opcode = ISD::FROUNDEVEN; break;
67176718
case Intrinsic::canonicalize: Opcode = ISD::FCANONICALIZE; break;
67186719
}
6720+
// clang-format on
67196721

67206722
setValue(&I, DAG.getNode(Opcode, sdl,
67216723
getValue(I.getArgOperand(0)).getValueType(),
@@ -6727,13 +6729,15 @@ void SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I,
67276729
case Intrinsic::lrint:
67286730
case Intrinsic::llrint: {
67296731
unsigned Opcode;
6732+
// clang-format off
67306733
switch (Intrinsic) {
67316734
default: llvm_unreachable("Impossible intrinsic"); // Can't reach here.
67326735
case Intrinsic::lround: Opcode = ISD::LROUND; break;
67336736
case Intrinsic::llround: Opcode = ISD::LLROUND; break;
67346737
case Intrinsic::lrint: Opcode = ISD::LRINT; break;
67356738
case Intrinsic::llrint: Opcode = ISD::LLRINT; break;
67366739
}
6740+
// clang-format on
67376741

67386742
EVT RetVT = TLI.getValueType(DAG.getDataLayout(), I.getType());
67396743
setValue(&I, DAG.getNode(Opcode, sdl, RetVT,

0 commit comments

Comments
 (0)