Skip to content

Commit 73e92d1

Browse files
committed
implement feedback
1 parent 4d405b2 commit 73e92d1

File tree

2 files changed

+11
-12
lines changed

2 files changed

+11
-12
lines changed

llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5373,7 +5373,7 @@ SmallVector<SDValue, 8> SelectionDAGBuilder::getTargetIntrinsicOperands(
53735373
Value *Token = Bundle->Inputs[0].get();
53745374
SDValue ConvControlToken = getValue(Token);
53755375
assert(Ops.back().getValueType() != MVT::Glue &&
5376-
"Did not expected another glue node here.");
5376+
"Did not expect another glue node here.");
53775377
ConvControlToken =
53785378
DAG.getNode(ISD::CONVERGENCECTRL_GLUE, {}, MVT::Glue, ConvControlToken);
53795379
Ops.push_back(ConvControlToken);
@@ -5395,20 +5395,18 @@ SDVTList SelectionDAGBuilder::getTargetIntrinsicVTList(const CallBase &I,
53955395
return DAG.getVTList(ValueVTs);
53965396
}
53975397

5398-
/// Get an INTRINSIC node for a target intrinsic which does not touch touch
5399-
/// memory.
5400-
SDValue SelectionDAGBuilder::getTargetNonMemIntrinsicNode(const CallBase &I,
5401-
bool HasChain,
5402-
ArrayRef<SDValue> Ops,
5403-
SDVTList &VTs) {
5398+
/// Get an INTRINSIC node for a target intrinsic which does not touch memory.
5399+
SDValue SelectionDAGBuilder::getTargetNonMemIntrinsicNode(
5400+
const Type &IntrinsicVT, bool HasChain, ArrayRef<SDValue> Ops,
5401+
const SDVTList &VTs) {
54045402
if (!HasChain)
54055403
return DAG.getNode(ISD::INTRINSIC_WO_CHAIN, getCurSDLoc(), VTs, Ops);
5406-
if (!I.getType()->isVoidTy())
5404+
if (!IntrinsicVT.isVoidTy())
54075405
return DAG.getNode(ISD::INTRINSIC_W_CHAIN, getCurSDLoc(), VTs, Ops);
54085406
return DAG.getNode(ISD::INTRINSIC_VOID, getCurSDLoc(), VTs, Ops);
54095407
}
54105408

5411-
/// Set root, convert return type if necessaey and check alignment.
5409+
/// Set root, convert return type if necessary and check alignment.
54125410
SDValue SelectionDAGBuilder::handleTargetIntrinsicRet(const CallBase &I,
54135411
bool HasChain,
54145412
bool OnlyLoad,
@@ -5485,7 +5483,7 @@ void SelectionDAGBuilder::visitTargetIntrinsic(const CallInst &I,
54855483
Result =
54865484
DAG.getMemIntrinsicNode(Info.opc, getCurSDLoc(), VTs, Ops, MemVT, MMO);
54875485
} else {
5488-
Result = getTargetNonMemIntrinsicNode(I, HasChain, Ops, VTs);
5486+
Result = getTargetNonMemIntrinsicNode(*I.getType(), HasChain, Ops, VTs);
54895487
}
54905488

54915489
Result = handleTargetIntrinsicRet(I, HasChain, OnlyLoad, Result);

llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -717,8 +717,9 @@ class SelectionDAGBuilder {
717717
const CallBase &I, bool HasChain, bool OnlyLoad,
718718
TargetLowering::IntrinsicInfo *TgtMemIntrinsicInfo = nullptr);
719719
SDVTList getTargetIntrinsicVTList(const CallBase &I, bool HasChain);
720-
SDValue getTargetNonMemIntrinsicNode(const CallBase &I, bool HasChain,
721-
ArrayRef<SDValue> Ops, SDVTList &VTs);
720+
SDValue getTargetNonMemIntrinsicNode(const Type &IntrinsicVT, bool HasChain,
721+
ArrayRef<SDValue> Ops,
722+
const SDVTList &VTs);
722723
SDValue handleTargetIntrinsicRet(const CallBase &I, bool HasChain,
723724
bool OnlyLoad, SDValue Result);
724725
};

0 commit comments

Comments
 (0)