Skip to content

Commit 61813b8

Browse files
committed
AMDGPU: Use member initializers in MFI
1 parent cfba1a9 commit 61813b8

File tree

2 files changed

+7
-12
lines changed

2 files changed

+7
-12
lines changed

llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,9 @@ using namespace llvm;
1515

1616
AMDGPUMachineFunction::AMDGPUMachineFunction(const MachineFunction &MF) :
1717
MachineFunctionInfo(),
18-
LocalMemoryObjects(),
19-
ExplicitKernArgSize(0),
20-
LDSSize(0),
2118
Mode(MF.getFunction()),
2219
IsEntryFunction(AMDGPU::isEntryFunctionCC(MF.getFunction().getCallingConv())),
23-
NoSignedZerosFPMath(MF.getTarget().Options.NoSignedZerosFPMath),
24-
MemoryBound(false),
25-
WaveLimiter(false) {
20+
NoSignedZerosFPMath(MF.getTarget().Options.NoSignedZerosFPMath) {
2621
const AMDGPUSubtarget &ST = AMDGPUSubtarget::get(MF);
2722

2823
// FIXME: Should initialize KernArgSize based on ExplicitKernelArgOffset,

llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -23,26 +23,26 @@ class AMDGPUMachineFunction : public MachineFunctionInfo {
2323
SmallDenseMap<const GlobalValue *, unsigned, 4> LocalMemoryObjects;
2424

2525
protected:
26-
uint64_t ExplicitKernArgSize; // Cache for this.
26+
uint64_t ExplicitKernArgSize = 0; // Cache for this.
2727
Align MaxKernArgAlign; // Cache for this.
2828

2929
/// Number of bytes in the LDS that are being used.
30-
unsigned LDSSize;
30+
unsigned LDSSize = 0;
3131

3232
// State of MODE register, assumed FP mode.
3333
AMDGPU::SIModeRegisterDefaults Mode;
3434

3535
// Kernels + shaders. i.e. functions called by the driver and not called
3636
// by other functions.
37-
bool IsEntryFunction;
37+
bool IsEntryFunction = false;
3838

39-
bool NoSignedZerosFPMath;
39+
bool NoSignedZerosFPMath = false;
4040

4141
// Function may be memory bound.
42-
bool MemoryBound;
42+
bool MemoryBound = false;
4343

4444
// Kernel may need limited waves per EU for better performance.
45-
bool WaveLimiter;
45+
bool WaveLimiter = false;
4646

4747
public:
4848
AMDGPUMachineFunction(const MachineFunction &MF);

0 commit comments

Comments
 (0)