[X86] Refactored LowerINTRINSIC_W_CHAIN to use a switch statament. NFCI.

Pre-commit as requested in D32769.

llvm-svn: 302010
This commit is contained in:
Simon Pilgrim 2017-05-03 10:40:18 +00:00
parent 46c75d6ad5
commit 7533f4a030

View File

@ -20284,16 +20284,17 @@ static SDValue LowerINTRINSIC_W_CHAIN(SDValue Op, const X86Subtarget &Subtarget,
SelectionDAG &DAG) {
unsigned IntNo = cast<ConstantSDNode>(Op.getOperand(1))->getZExtValue();
const IntrinsicData* IntrData = getIntrinsicWithChain(IntNo);
const IntrinsicData *IntrData = getIntrinsicWithChain(IntNo);
if (!IntrData) {
if (IntNo == llvm::Intrinsic::x86_seh_ehregnode)
switch (IntNo) {
case llvm::Intrinsic::x86_seh_ehregnode:
return MarkEHRegistrationNode(Op, DAG);
if (IntNo == llvm::Intrinsic::x86_seh_ehguard)
case llvm::Intrinsic::x86_seh_ehguard:
return MarkEHGuard(Op, DAG);
if (IntNo == llvm::Intrinsic::x86_flags_read_u32 ||
IntNo == llvm::Intrinsic::x86_flags_read_u64 ||
IntNo == llvm::Intrinsic::x86_flags_write_u32 ||
IntNo == llvm::Intrinsic::x86_flags_write_u64) {
case llvm::Intrinsic::x86_flags_read_u32:
case llvm::Intrinsic::x86_flags_read_u64:
case llvm::Intrinsic::x86_flags_write_u32:
case llvm::Intrinsic::x86_flags_write_u64: {
// We need a frame pointer because this will get lowered to a PUSH/POP
// sequence.
MachineFrameInfo &MFI = DAG.getMachineFunction().getFrameInfo();
@ -20302,6 +20303,7 @@ static SDValue LowerINTRINSIC_W_CHAIN(SDValue Op, const X86Subtarget &Subtarget,
// during ExpandISelPseudos in EmitInstrWithCustomInserter.
return SDValue();
}
}
return SDValue();
}