[llvm] 720015e - [x86] avoid build warning for enum mismatch; NFC
Sanjay Patel via llvm-commits
llvm-commits at lists.llvm.org
Sun Apr 19 07:24:32 PDT 2020
Author: Sanjay Patel
Date: 2020-04-19T10:22:11-04:00
New Revision: 720015e53790427872bea37a8ee41ed1cc6e93b5
URL: https://github.com/llvm/llvm-project/commit/720015e53790427872bea37a8ee41ed1cc6e93b5
DIFF: https://github.com/llvm/llvm-project/commit/720015e53790427872bea37a8ee41ed1cc6e93b5.diff
LOG: [x86] avoid build warning for enum mismatch; NFC
gcc may warn here because X86ISD::NodeType is specified as "unsigned",
but ISD::NodeType is a naked C enum (although passed as an "unsigned"
throughout SDAG).
Added:
Modified:
llvm/lib/Target/X86/X86ISelLowering.cpp
Removed:
################################################################################
diff --git a/llvm/lib/Target/X86/X86ISelLowering.cpp b/llvm/lib/Target/X86/X86ISelLowering.cpp
index 71d3240e6a90..176a62bb639c 100644
--- a/llvm/lib/Target/X86/X86ISelLowering.cpp
+++ b/llvm/lib/Target/X86/X86ISelLowering.cpp
@@ -19198,8 +19198,10 @@ static SDValue lowerFPToIntToFP(SDValue CastToFP, SelectionDAG &DAG,
// We need target-specific opcodes if this is v2f64 -> v4i32 -> v2f64.
bool NeedX86Opcodes = VT.getSizeInBits() != IntVT.getSizeInBits();
- unsigned ToIntOpcode = NeedX86Opcodes ? X86ISD::CVTTP2SI : ISD::FP_TO_SINT;
- unsigned ToFPOpcode = NeedX86Opcodes ? X86ISD::CVTSI2P : ISD::SINT_TO_FP;
+ unsigned ToIntOpcode =
+ NeedX86Opcodes ? X86ISD::CVTTP2SI : (unsigned)ISD::FP_TO_SINT;
+ unsigned ToFPOpcode =
+ NeedX86Opcodes ? X86ISD::CVTSI2P : (unsigned)ISD::SINT_TO_FP;
// sint_to_fp (fp_to_sint X) --> extelt (sint_to_fp (fp_to_sint (s2v X))), 0
//
More information about the llvm-commits
mailing list