==== //depot/stg/opencl/drivers/opencl/compiler/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp#30 - d:\hq\stg\opencl\drivers\opencl\compiler\llvm\lib\CodeGen\SelectionDAG\SelectionDAGBuilder.cpp ==== @@ -3508,9 +3508,12 @@ /// visitTargetIntrinsic - Lower a call of a target intrinsic to an INTRINSIC /// node. void SelectionDAGBuilder::visitTargetIntrinsic(const CallInst &I, - unsigned Intrinsic) { - bool HasChain = !I.doesNotAccessMemory(); - bool OnlyLoad = HasChain && I.onlyReadsMemory(); + unsigned Intrinsic) { + // Info is set by getTgtMemInstrinsic + TargetLowering::IntrinsicInfo Info; + bool IsTgtIntrinsic = TLI.getTgtMemIntrinsic(Info, I, Intrinsic); + bool HasChain = Info.readMem || Info.writeMem; + bool OnlyLoad = HasChain && Info.readMem; // Build the operand list. SmallVector Ops; @@ -3523,10 +3526,6 @@ } } - // Info is set by getTgtMemInstrinsic - TargetLowering::IntrinsicInfo Info; - bool IsTgtIntrinsic = TLI.getTgtMemIntrinsic(Info, I, Intrinsic); - // Add the intrinsic ID as an integer operand if it's not a target intrinsic. if (!IsTgtIntrinsic || Info.opc == ISD::INTRINSIC_VOID || Info.opc == ISD::INTRINSIC_W_CHAIN)