Index: lib/Target/AMDGPU/SIISelLowering.cpp =================================================================== --- lib/Target/AMDGPU/SIISelLowering.cpp +++ lib/Target/AMDGPU/SIISelLowering.cpp @@ -3601,10 +3601,10 @@ // Change from v4f16/v2f16 to EquivLoadVT. SDVTList VTList = DAG.getVTList(EquivLoadVT, MVT::Other); - SDValue Load - = DAG.getMemIntrinsicNode(IsIntrinsic ? ISD::INTRINSIC_W_CHAIN : Opcode, DL, - VTList, Ops, M->getMemoryVT(), - M->getMemOperand()); + if (IsIntrinsic) + Opcode = ISD::INTRINSIC_W_CHAIN; + SDValue Load = DAG.getMemIntrinsicNode(Opcode, DL, VTList, Ops, + M->getMemoryVT(), M->getMemOperand()); SDValue Adjusted = adjustLoadValueTypeImpl(Load, LoadVT, DL, DAG, Unpacked);