Skip to content

Commit edfe5df

Browse files
krzysz00arsenm
andauthored
Style fixes perr Matt
Co-authored-by: Matt Arsenault <[email protected]>
1 parent d1ccda1 commit edfe5df

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

llvm/lib/Target/AMDGPU/AMDGPUSubtarget.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -253,8 +253,8 @@ bool AMDGPUSubtarget::isMesaKernel(const Function &F) const {
253253
unsigned AMDGPUSubtarget::getMaxWorkitemID(const Function &Kernel,
254254
unsigned Dimension) const {
255255
std::optional<unsigned> ReqdSize = getReqdWorkGroupSize(Kernel, Dimension);
256-
if (ReqdSize.has_value())
257-
return ReqdSize.value() - 1;
256+
if (ReqdSize)
257+
return *ReqdSize - 1;
258258
return getFlatWorkGroupSizes(Kernel).second - 1;
259259
}
260260

@@ -306,7 +306,7 @@ bool AMDGPUSubtarget::makeLIDRangeMetadata(Instruction *I) const {
306306

307307
if (Dim <= 3) {
308308
std::optional<unsigned> ReqdSize = getReqdWorkGroupSize(*Kernel, Dim);
309-
if (ReqdSize.has_value())
309+
if (ReqdSize)
310310
MinSize = MaxSize = *ReqdSize;
311311
}
312312
}

llvm/lib/Target/AMDGPU/AMDGPUTargetTransformInfo.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1012,12 +1012,12 @@ bool GCNTTIImpl::isSourceOfDivergence(const Value *V) const {
10121012
// Similarly, if the dimension has size 1, it is also uniform.
10131013
const Function *F = Intrinsic->getFunction();
10141014
std::optional<unsigned> ReqdXDimSize = ST->getReqdWorkGroupSize(*F, 0);
1015-
if (ReqdXDimSize.has_value() && isPowerOf2_32(*ReqdXDimSize) &&
1015+
if (ReqdXDimSize && isPowerOf2_32(*ReqdXDimSize) &&
10161016
*ReqdXDimSize >= ST->getWavefrontSize())
10171017
return false;
10181018
std::optional<unsigned> ThisDimSize = ST->getReqdWorkGroupSize(
10191019
*F, IID == Intrinsic::amdgcn_workitem_id_y ? 1 : 2);
1020-
return !(ThisDimSize.has_value() && *ThisDimSize == 1);
1020+
return !ThisDimSize || *ThisDimSize != 1;
10211021
}
10221022
default:
10231023
return AMDGPU::isIntrinsicSourceOfDivergence(IID);

0 commit comments

Comments
 (0)