@@ -7171,31 +7171,10 @@ SDValue RISCVTargetLowering::LowerOperation(SDValue Op,
7171
7171
SDValue RISCVTargetLowering::emitFlushICache(SelectionDAG &DAG, SDValue InChain,
7172
7172
SDValue Start, SDValue End,
7173
7173
SDValue Flags, SDLoc DL) const {
7174
- TargetLowering::ArgListTy Args;
7175
- TargetLowering::ArgListEntry Entry;
7176
-
7177
- // start
7178
- Entry.Node = Start;
7179
- Entry.Ty = PointerType::getUnqual(*DAG.getContext());
7180
- Args.push_back(Entry);
7181
-
7182
- // end
7183
- Entry.Node = End;
7184
- Entry.Ty = PointerType::getUnqual(*DAG.getContext());
7185
- Args.push_back(Entry);
7186
-
7187
- // flags
7188
- Entry.Node = Flags;
7189
- Entry.Ty = Type::getIntNTy(*DAG.getContext(), Subtarget.getXLen());
7190
- Args.push_back(Entry);
7191
-
7192
- TargetLowering::CallLoweringInfo CLI(DAG);
7193
- EVT Ty = getPointerTy(DAG.getDataLayout());
7194
- CLI.setDebugLoc(DL).setChain(InChain).setLibCallee(
7195
- CallingConv::C, Type::getVoidTy(*DAG.getContext()),
7196
- DAG.getExternalSymbol("__riscv_flush_icache", Ty), std::move(Args));
7197
-
7198
- std::pair<SDValue, SDValue> CallResult = LowerCallTo(CLI);
7174
+ MakeLibCallOptions CallOptions;
7175
+ std::pair<SDValue, SDValue> CallResult =
7176
+ makeLibCall(DAG, RTLIB::RISCV_FLUSH_ICACHE, MVT::isVoid,
7177
+ {Start, End, Flags}, CallOptions, DL, InChain);
7199
7178
7200
7179
// This function returns void so only the out chain matters.
7201
7180
return CallResult.second;
0 commit comments