@@ -4018,10 +4018,10 @@ SDValue SITargetLowering::LowerCall(CallLoweringInfo &CLI,
40184018
40194019// This is similar to the default implementation in ExpandDYNAMIC_STACKALLOC,
40204020// except for:
4021- // 1. stack growth direction(default: downwards, AMDGPU: upwards), and
4022- // 2. scale size where, scale = wave-reduction(alloca-size) * wave-size
4023- SDValue SITargetLowering::lowerDYNAMIC_STACKALLOCImpl (SDValue Op,
4024- SelectionDAG &DAG) const {
4021+ // 1. Stack growth direction(default: downwards, AMDGPU: upwards), and
4022+ // 2. Scale size where, scale = wave-reduction(alloca-size) * wave-size
4023+ SDValue SITargetLowering::LowerDYNAMIC_STACKALLOC (SDValue Op,
4024+ SelectionDAG &DAG) const {
40254025 const MachineFunction &MF = DAG.getMachineFunction();
40264026 const SIMachineFunctionInfo *Info = MF.getInfo<SIMachineFunctionInfo>();
40274027
@@ -4057,13 +4057,13 @@ SDValue SITargetLowering::lowerDYNAMIC_STACKALLOCImpl(SDValue Op,
40574057 assert(Size.getValueType() == MVT::i32 && "Size must be 32-bit");
40584058 SDValue NewSP;
40594059 if (isa<ConstantSDNode>(Op.getOperand(1))) {
4060- // for constant sized alloca, scale alloca size by wave-size
4060+ // For constant sized alloca, scale alloca size by wave-size
40614061 SDValue ScaledSize = DAG.getNode(
40624062 ISD::SHL, dl, VT, Size,
40634063 DAG.getConstant(Subtarget->getWavefrontSizeLog2(), dl, MVT::i32));
40644064 NewSP = DAG.getNode(ISD::ADD, dl, VT, BaseAddr, ScaledSize); // Value
40654065 } else {
4066- // for dynamic sized alloca, perform wave-wide reduction to get max of
4066+ // For dynamic sized alloca, perform wave-wide reduction to get max of
40674067 // alloca size(divergent) and then scale it by wave-size
40684068 SDValue WaveReduction =
40694069 DAG.getTargetConstant(Intrinsic::amdgcn_wave_reduce_umax, dl, MVT::i32);
@@ -4086,11 +4086,6 @@ SDValue SITargetLowering::lowerDYNAMIC_STACKALLOCImpl(SDValue Op,
40864086 return DAG.getMergeValues({BaseAddr, CallSeqEnd}, dl);
40874087}
40884088
4089- SDValue SITargetLowering::LowerDYNAMIC_STACKALLOC(SDValue Op,
4090- SelectionDAG &DAG) const {
4091- return lowerDYNAMIC_STACKALLOCImpl(Op, DAG); // Use "generic" expansion.
4092- }
4093-
40944089SDValue SITargetLowering::LowerSTACKSAVE(SDValue Op, SelectionDAG &DAG) const {
40954090 if (Op.getValueType() != MVT::i32)
40964091 return Op; // Defer to cannot select error.
0 commit comments