@@ -6483,7 +6483,7 @@ void SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I,
6483
6483
return;
6484
6484
}
6485
6485
case Intrinsic::memcpy_inline: {
6486
- const auto &MCI = cast<MemCpyInlineInst >(I);
6486
+ const auto &MCI = cast<MemCpyInst >(I);
6487
6487
SDValue Dst = getValue(I.getArgOperand(0));
6488
6488
SDValue Src = getValue(I.getArgOperand(1));
6489
6489
SDValue Size = getValue(I.getArgOperand(2));
@@ -6503,35 +6503,21 @@ void SelectionDAGBuilder::visitIntrinsicCall(const CallInst &I,
6503
6503
updateDAGForMaybeTailCall(MC);
6504
6504
return;
6505
6505
}
6506
- case Intrinsic::memset: {
6507
- const auto &MSI = cast<MemSetInst>(I);
6508
- SDValue Op1 = getValue(I.getArgOperand(0));
6509
- SDValue Op2 = getValue(I.getArgOperand(1));
6510
- SDValue Op3 = getValue(I.getArgOperand(2));
6511
- // @llvm.memset defines 0 and 1 to both mean no alignment.
6512
- Align Alignment = MSI.getDestAlign().valueOrOne();
6513
- bool isVol = MSI.isVolatile();
6514
- SDValue Root = isVol ? getRoot() : getMemoryRoot();
6515
- SDValue MS = DAG.getMemset(
6516
- Root, sdl, Op1, Op2, Op3, Alignment, isVol, /* AlwaysInline */ false,
6517
- &I, MachinePointerInfo(I.getArgOperand(0)), I.getAAMetadata());
6518
- updateDAGForMaybeTailCall(MS);
6519
- return;
6520
- }
6506
+ case Intrinsic::memset:
6521
6507
case Intrinsic::memset_inline: {
6522
- const auto &MSII = cast<MemSetInlineInst >(I);
6508
+ const auto &MSII = cast<MemSetInst >(I);
6523
6509
SDValue Dst = getValue(I.getArgOperand(0));
6524
6510
SDValue Value = getValue(I.getArgOperand(1));
6525
6511
SDValue Size = getValue(I.getArgOperand(2));
6526
- assert(isa<ConstantSDNode>(Size) && "memset_inline needs constant size");
6512
+ assert((!MSII.isForceInlined() || isa<ConstantSDNode>(Size)) &&
6513
+ "memset_inline needs constant size");
6527
6514
// @llvm.memset defines 0 and 1 to both mean no alignment.
6528
6515
Align DstAlign = MSII.getDestAlign().valueOrOne();
6529
6516
bool isVol = MSII.isVolatile();
6530
6517
SDValue Root = isVol ? getRoot() : getMemoryRoot();
6531
- SDValue MC = DAG.getMemset(Root, sdl, Dst, Value, Size, DstAlign, isVol,
6532
- /* AlwaysInline */ true, &I,
6533
- MachinePointerInfo(I.getArgOperand(0)),
6534
- I.getAAMetadata());
6518
+ SDValue MC = DAG.getMemset(
6519
+ Root, sdl, Dst, Value, Size, DstAlign, isVol, MSII.isForceInlined(),
6520
+ &I, MachinePointerInfo(I.getArgOperand(0)), I.getAAMetadata());
6535
6521
updateDAGForMaybeTailCall(MC);
6536
6522
return;
6537
6523
}
0 commit comments