Skip to content

Commit 05cfa83

Browse files
committedMay 3, 2017
[X86] Refactored LowerINTRINSIC_W_CHAIN to use a switch statament. NFCI.
Pre-commit as requested in D32769. llvm-svn: 302010
1 parent 6e254b5 commit 05cfa83

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed
 

‎llvm/lib/Target/X86/X86ISelLowering.cpp

+9-7
Original file line numberDiff line numberDiff line change
@@ -20284,16 +20284,17 @@ static SDValue LowerINTRINSIC_W_CHAIN(SDValue Op, const X86Subtarget &Subtarget,
2028420284
SelectionDAG &DAG) {
2028520285
unsigned IntNo = cast<ConstantSDNode>(Op.getOperand(1))->getZExtValue();
2028620286

20287-
const IntrinsicData* IntrData = getIntrinsicWithChain(IntNo);
20287+
const IntrinsicData *IntrData = getIntrinsicWithChain(IntNo);
2028820288
if (!IntrData) {
20289-
if (IntNo == llvm::Intrinsic::x86_seh_ehregnode)
20289+
switch (IntNo) {
20290+
case llvm::Intrinsic::x86_seh_ehregnode:
2029020291
return MarkEHRegistrationNode(Op, DAG);
20291-
if (IntNo == llvm::Intrinsic::x86_seh_ehguard)
20292+
case llvm::Intrinsic::x86_seh_ehguard:
2029220293
return MarkEHGuard(Op, DAG);
20293-
if (IntNo == llvm::Intrinsic::x86_flags_read_u32 ||
20294-
IntNo == llvm::Intrinsic::x86_flags_read_u64 ||
20295-
IntNo == llvm::Intrinsic::x86_flags_write_u32 ||
20296-
IntNo == llvm::Intrinsic::x86_flags_write_u64) {
20294+
case llvm::Intrinsic::x86_flags_read_u32:
20295+
case llvm::Intrinsic::x86_flags_read_u64:
20296+
case llvm::Intrinsic::x86_flags_write_u32:
20297+
case llvm::Intrinsic::x86_flags_write_u64: {
2029720298
// We need a frame pointer because this will get lowered to a PUSH/POP
2029820299
// sequence.
2029920300
MachineFrameInfo &MFI = DAG.getMachineFunction().getFrameInfo();
@@ -20302,6 +20303,7 @@ static SDValue LowerINTRINSIC_W_CHAIN(SDValue Op, const X86Subtarget &Subtarget,
2030220303
// during ExpandISelPseudos in EmitInstrWithCustomInserter.
2030320304
return SDValue();
2030420305
}
20306+
}
2030520307
return SDValue();
2030620308
}
2030720309

0 commit comments

Comments
 (0)
Please sign in to comment.