[llvm] r287362 - AMDGPU: Fix unused variable warning
Matt Arsenault via llvm-commits
llvm-commits at lists.llvm.org
Fri Nov 18 10:33:36 PST 2016
Author: arsenm
Date: Fri Nov 18 12:33:36 2016
New Revision: 287362
URL: http://llvm.org/viewvc/llvm-project?rev=287362&view=rev
Log:
AMDGPU: Fix unused variable warning
Modified:
llvm/trunk/lib/Target/AMDGPU/SIISelLowering.cpp
Modified: llvm/trunk/lib/Target/AMDGPU/SIISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AMDGPU/SIISelLowering.cpp?rev=287362&r1=287361&r2=287362&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AMDGPU/SIISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/AMDGPU/SIISelLowering.cpp Fri Nov 18 12:33:36 2016
@@ -2047,17 +2047,16 @@ SDValue SITargetLowering::lowerConstantF
}
SDValue SITargetLowering::lowerFP_ROUND(SDValue Op, SelectionDAG &DAG) const {
- EVT DstVT = Op.getValueType();
- EVT SrcVT = Op.getOperand(0).getValueType();
-
- assert(DstVT == MVT::f16 &&
+ assert(Op.getValueType() == MVT::f16 &&
"Do not know how to custom lower FP_ROUND for non-f16 type");
+ SDValue Src = Op.getOperand(0);
+ EVT SrcVT = Src.getValueType();
if (SrcVT != MVT::f64)
return Op;
SDLoc DL(Op);
- SDValue Src = Op.getOperand(0);
+
SDValue FpToFp16 = DAG.getNode(ISD::FP_TO_FP16, DL, MVT::i32, Src);
SDValue Trunc = DAG.getNode(ISD::TRUNCATE, DL, MVT::i16, FpToFp16);
return DAG.getNode(ISD::BITCAST, DL, MVT::f16, Trunc);;
More information about the llvm-commits
mailing list