summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
diff options
context:
space:
mode:
authorMatt Arsenault <Matthew.Arsenault@amd.com>2017-12-14 21:39:51 +0000
committerMatt Arsenault <Matthew.Arsenault@amd.com>2017-12-14 21:39:51 +0000
commit11171336874260dc7b3327a7123b9e97ccb45b2b (patch)
tree0aaa52c35f9885b5f9840f5dbebef618ed289c73 /llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
parentefe3d3436ac8cfa7a971c2303a88f655067dc553 (diff)
downloadbcm5719-llvm-11171336874260dc7b3327a7123b9e97ccb45b2b.tar.gz
bcm5719-llvm-11171336874260dc7b3327a7123b9e97ccb45b2b.zip
DAG: Expose all MMO flags in getTgtMemIntrinsic
Rather than adding more bits to express every MMO flag you could want, just directly use the MMO flags. Also fixes using a bunch of bool arguments to getMemIntrinsicNode. On AMDGPU, buffer and image intrinsics should always have MODereferencable set, but currently there is no way to do that directly during the initial intrinsic lowering. llvm-svn: 320746
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
index 2dc9a728b65..aa1f71a2b7f 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
@@ -4240,11 +4240,10 @@ void SelectionDAGBuilder::visitTargetIntrinsic(const CallInst &I,
SDValue Result;
if (IsTgtIntrinsic) {
// This is target intrinsic that touches memory
- Result = DAG.getMemIntrinsicNode(Info.opc, getCurSDLoc(),
- VTs, Ops, Info.memVT,
- MachinePointerInfo(Info.ptrVal, Info.offset),
- Info.align, Info.vol,
- Info.readMem, Info.writeMem, Info.size);
+ Result = DAG.getMemIntrinsicNode(Info.opc, getCurSDLoc(), VTs,
+ Ops, Info.memVT,
+ MachinePointerInfo(Info.ptrVal, Info.offset), Info.align,
+ Info.flags, Info.size);
} else if (!HasChain) {
Result = DAG.getNode(ISD::INTRINSIC_WO_CHAIN, getCurSDLoc(), VTs, Ops);
} else if (!I.getType()->isVoidTy()) {
@@ -5823,6 +5822,7 @@ SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I, unsigned Intrinsic) {
case Intrinsic::prefetch: {
SDValue Ops[5];
unsigned rw = cast<ConstantInt>(I.getArgOperand(1))->getZExtValue();
+ auto Flags = rw == 0 ? MachineMemOperand::MOLoad :MachineMemOperand::MOStore;
Ops[0] = getRoot();
Ops[1] = getValue(I.getArgOperand(0));
Ops[2] = getValue(I.getArgOperand(1));
@@ -5833,9 +5833,7 @@ SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I, unsigned Intrinsic) {
EVT::getIntegerVT(*Context, 8),
MachinePointerInfo(I.getArgOperand(0)),
0, /* align */
- false, /* volatile */
- rw==0, /* read */
- rw==1)); /* write */
+ Flags));
return nullptr;
}
case Intrinsic::lifetime_start:
OpenPOWER on IntegriCloud