@@ -4018,10 +4018,10 @@ SDValue SITargetLowering::LowerCall(CallLoweringInfo &CLI,
4018
4018
4019
4019
// This is similar to the default implementation in ExpandDYNAMIC_STACKALLOC,
4020
4020
// 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 {
4025
4025
const MachineFunction &MF = DAG.getMachineFunction();
4026
4026
const SIMachineFunctionInfo *Info = MF.getInfo<SIMachineFunctionInfo>();
4027
4027
@@ -4057,13 +4057,13 @@ SDValue SITargetLowering::lowerDYNAMIC_STACKALLOCImpl(SDValue Op,
4057
4057
assert(Size.getValueType() == MVT::i32 && "Size must be 32-bit");
4058
4058
SDValue NewSP;
4059
4059
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
4061
4061
SDValue ScaledSize = DAG.getNode(
4062
4062
ISD::SHL, dl, VT, Size,
4063
4063
DAG.getConstant(Subtarget->getWavefrontSizeLog2(), dl, MVT::i32));
4064
4064
NewSP = DAG.getNode(ISD::ADD, dl, VT, BaseAddr, ScaledSize); // Value
4065
4065
} 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
4067
4067
// alloca size(divergent) and then scale it by wave-size
4068
4068
SDValue WaveReduction =
4069
4069
DAG.getTargetConstant(Intrinsic::amdgcn_wave_reduce_umax, dl, MVT::i32);
@@ -4086,11 +4086,6 @@ SDValue SITargetLowering::lowerDYNAMIC_STACKALLOCImpl(SDValue Op,
4086
4086
return DAG.getMergeValues({BaseAddr, CallSeqEnd}, dl);
4087
4087
}
4088
4088
4089
- SDValue SITargetLowering::LowerDYNAMIC_STACKALLOC(SDValue Op,
4090
- SelectionDAG &DAG) const {
4091
- return lowerDYNAMIC_STACKALLOCImpl(Op, DAG); // Use "generic" expansion.
4092
- }
4093
-
4094
4089
SDValue SITargetLowering::LowerSTACKSAVE(SDValue Op, SelectionDAG &DAG) const {
4095
4090
if (Op.getValueType() != MVT::i32)
4096
4091
return Op; // Defer to cannot select error.
0 commit comments